WordPress.org

Ready to get started?Download WordPress

Forums

Facebook AWD All in one
[resolved] Facebook AWD Error: (#2500) (21 posts)

  1. Dementei
    Member
    Posted 1 year ago #

    Updated to the newest Facebook AWD version v1.4. Now whenever I logout of WP (using meta widget) or use the logout from the FB button, it directs me to this error: Facebook AWD Error: (#2500) An active access token must be used to query information about the current user.

    If I logout from the admin bar it directs me to the facebook login page, but it seems when I am not logged into facebook at all, logging in or out is no problem on the site (that is after I login by going to /wp-login.php), but when I am logged into facebook and I logout from the website that error occurs.

    Something is wrong between logging out of the site and out of facebook, but it wasn't like this before the update. It is a really great plugin, I use it on three of my sites, hope for fix.

    http://wordpress.org/extend/plugins/facebook-awd/

  2. trazopro
    Member
    Posted 1 year ago #

    I got the same problem. i hope he can fix it as soon as posible. :D

  3. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    Can you give me more info ? i need to know where this error happens ?
    Wich line of code can you paste the full error report here ? thanks

  4. QuietNoise
    Member
    Posted 1 year ago #

    Hi, got the same error. After you login with FB and then when you click on WP logout the error shows preventing any page to display.

    The problem might be in the cookies handling. After deleting cookies related to the website (specifically PHPSESSID and fbsr_xxxx) the error disappears.

    Edit:
    It's your plugin's generated error so it's hard to say from which line of code it is generated.
    When enabling WP Debug the following PHP notice shows:
    Notice: ob_end_flush() ref.outcontrol: failed to delete buffer zlib output compression. in /wp-includes/functions.php on line 2504 but I have no clue if it is relevant at all.

  5. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    What is your browser ? i need an url to test, as i can't reproduce the bug.

  6. QuietNoise
    Member
    Posted 1 year ago #

    It happens on all browsers I tried.
    Don't have a public URL yet am testing on local environment.

    I nailed the line where the error comes from.
    It's in AWD_facebook.php line 1899.
    My WP version: 3.4.2.

    Call stack:
    wp-content/plugins/facebook-awd/AWD_facebook.php.AWD_facebook->get_facebook_user_data:1899
    wp-content/plugins/facebook-awd/AWD_facebook.php.AWD_facebook->login:2079
    wp-content/plugins/facebook-awd/AWD_facebook.php.AWD_facebook->login_listener:2070
    wp-content/plugins/facebook-awd/AWD_facebook.php.AWD_facebook->parse_request:2187
    wp-includes/plugin.php.call_user_func_array:484
    wp-includes/plugin.php.do_action_ref_array:484
    wp-includes/query.php.WP_Query->parse_query:1674
    wp-includes/query.php.WP_Query->get_posts:1920
    wp-includes/query.php.WP_Query->query:2941
    wp-includes/class-wp.php.WP->query_posts:460
    wp-includes/class-wp.php.WP->main:524
    wp-includes/functions.php.wp:775
    wp-blog-header.php.require:14
    index.php.{main}:19

  7. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    Can you give me the url to logout on your site when your are FB connected ?

  8. QuietNoise
    Member
    Posted 1 year ago #

  9. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    OK so i decoded the url and that give that:
    https://www.facebook.com/logout.php?next=http://mytestdomain.com/facebook-awd/logout?redirect_to=index.php&_wpnonce=b69d42fb25&access_token=AAAEvnD4aoZAgBAGZCRiuSxKHxrrmuAZBZAN8GUm4PGAm28WZBxpEAdoXL0esv1ZCrkZC2y6my8en6xB6IJlaJXAOzdNySFc2AnxcezoO2or9wZDZD

    the strange thing is that redirect_to=index.php normaly, this should redirect to an url on your site.

    I explain:

    When you logout, first we redirect you on facebook to clear facebook session, then facebook redirect you to an special url on your site to clear WP session, then it will redirect you to the url after logout.

    Did you set an url for redirect after login ? It seems this is the problem, as this url is set to "index.php" it's not a good url

  10. QuietNoise
    Member
    Posted 1 year ago #

    Alright. Here is what I got so far:
    I've changed the option “Url after logout” in your plugin settings. However it didn't influence shape of the url of WordPress logout link (not the AWD FB logout link). It is still:
    https://www.facebook.com/logout.php?next=http://mytestdomain.com/facebook-awd/logout?redirect_to=index.php&_wpnonce=b69d42fb25&access_token=AAAEv...

    However, I noticed that it does change the logout button generated by your plugin.
    The button name is now the "after logout url" I entered in plugin settings (before it was just the word “Logout”).
    The button code is now:
    <a href="https://www.facebook.com/logout.php?next=http://mytestdomain.com/facebook-awd/logout?redirect_to=http://mytestdomain.com/users/?action=login&_wpnonce=b69d42fb25&access_token=AAAEvn...">http://mytestdomain.com/my-board</a>

    Please notice that redirect_to has value I entered in “Url after login” in plugin settings. And the anchor tag content is: http://mytestdomain.com/my-board which is url which I entered “Url after logout” plugin settings.

    The error still appears no matter which logout link I press.

  11. QuietNoise
    Member
    Posted 1 year ago #

    I tried to debug it with my humble abilities.

    After clicking logout WP user is being logged out from WP account and from FB account (for whatever reason. I would prefer that I'm still logged in to FB as it is different website).
    Anyway, after redirecting back from FB logout call to the website
    $this->is_user_logged_in_facebook() returns true (line: 2069) which causes chain of other calls which at the end results in the mentioned error.

    What exactly happens:
    $this->login($redirect_url); is called and it checks:
    if ($this->uid) { // which is true (but why if I'm logged out)
    because of that
    $this->get_facebook_user_data(); is called which causes the error.

    The question is why $this->uid is set if I’m supposed to be logged out?

    Furthermore, in line: 1976
    $this->uid = $this->fcbk->getUser();
    user id is returned. But at this particular moment I’m logged out from facebook.

    Another strange behavior, not sure if related
    If I’m logged out from WP it signs me back in after I sign in to Facebook. Is this desired behavior?

    I’m not sure if I can spend more time on this one. Need deliver working solution.

  12. QuietNoise
    Member
    Posted 1 year ago #

    Me again. So the problem you are facing is exactly same as expressed in this post:
    http://stackoverflow.com/questions/8517934/facebook-getuser-returns-a-userid-after-logout
    The suggested solution is to use function Facebook->api('/me') to determine whether user is logged in.

    So workaround I've came up with is changing function is_user_logged_in_facebook() in your plugin to:

    public function is_user_logged_in_facebook()
    {
        try {
            if ($this->fcbk->api('/me') && isset($this->uid) && $this->uid != 0)
                    return true;
        } catch (FacebookApiException $e) {
            if (is_object($this->fcbk))
                    $this->fcbk->destroySession();
            return false;
        }
    }

    For the bug I mentioned before (log out redirect url used as a label and log in url used in log out redirection) I'll create another thread.

  13. trazopro
    Member
    Posted 1 year ago #

    still not working. this error still showing up.

    http:/site.com/facebook-awd/login

    Facebook AWD Error: (#2500) An active access token must be used to query information about the current user.

  14. QuietNoise
    Member
    Posted 1 year ago #

    Apply the brutal fix above and clean your browser cookies.
    However, this version of plugin has many other flaws and am not sure if it is usable at this stage.

  15. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    If I’m logged out from WP it signs me back in after I sign in to Facebook. Is this desired behavior?

    Yes as you already authorized the app

    You re right, the is_user_logged_in_facebook() is broken. however, using the /me api call will increase the page loading on each page.

    For the bug I mentioned before (log out redirect url used as a label and log in url used in log out redirection) I'll create another thread.

    thank you, i will follow that.

  16. Dementei
    Member
    Posted 1 year ago #

    Glad to see it's all working out.

    As for me I just switched back to the version before, it may have its flaws but as long as my like box works it's all good. I can login fine just like before, but I do hope for an improvement in next update, the newer interface is nice too.

  17. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    However, I noticed that it does change the logout button generated by your plugin.
    The button name is now the "after logout url" I entered in plugin settings (before it was just the word “Logout”).
    The button code is now:
    <a href="https://www.facebook.com/logout.php?next=http://mytestdomain.com/facebook-awd/logout?redirect_to=http://mytestdomain.com/users/?action=login&_wpnonce=b69d42fb25&access_token=AAAEvn...">http://mytestdomain.com/my-board</a>

    Please notice that redirect_to has value I entered in “Url after login” in plugin settings. And the anchor tag content is: http://mytestdomain.com/my-board which is url which I entered “Url after logout” plugin settings.

    OK i note that to fix it. i must verify the name of variable beteween url after logout and url after login.

  18. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, I fixed the login button with good values and names.

    the file to replace is in plugins/facebook-awd/inc/admin/forms/login_bitton.php

    This will repair the login button redirect url.

    Dowload the file here and replace the old one.
    https://gist.github.com/3724003

  19. QuietNoise
    Member
    Posted 1 year ago #

    Thanks AH. Your plugin has the most potential from all FB Connect plugins I tested so far. Though I ended up writing my own one because of client's specific requirements and lack of flexibility in all the plugins.
    Hopefully I've been of some help in pushing your one forward.

  20. trazopro
    Member
    Posted 1 year ago #

    The new version still not working for facebook login. it returns http://site.com/#_=_

  21. AHWEBDEV
    Member
    Plugin Author

    Posted 1 year ago #

    @trazopro When ? Where ? Can you give more info than "it's not working ?" without more usable informations, i can't help you.

    However a little search and hop => http://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url/7297873#7297873

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.