Ultimate Facebook refreshes page but doesn't log in

Hi there,

On the home page of my site http://tenderlovingcalls.com, I’ve installed the Ultimate Facebook plug-in and styled the button to appear alongside the standard BuddyPress login form.

When I click the button, the Facebook connect pop-up appears properly and it authenticates me properly. When the pop-up closes, the “Login with Facebook” button transforms into the “loading” GIF animation, and the page refreshes itself. Upon refresh, I’m still logged out (e.g., nothing changes).

Can you walk me through whether this is a common problem; whether you see the same problem on the live site; and what the expected behavior should be, so I can try to track down a fix?

Thanks very much!

  • aecnu
    • WP Unicorn

    Greetings mudgey,

    Sorry to see that you are having an issue with the Ultimate Facebook plugin and your WordPress installation.

    I indeed visited your web site and found the same type of behavior and the first thing that came to mind is caching.

    Are you running a caching plugin of some sort?

    Please advise.

    Cheers, Joe

  • mudgey
    • Flash Drive

    Joe,

    That’s a great thought — but no, I’m not running any caching plugins at all.

    The Ultimate Facebook settings page says that it’s able to successfully connect to the Facebook app, and the domain is set properly in the Facebook app.

    I’m also seeing that registration via Facebook isn’t working properly, but I get the sense that may be a separate issue so let’s stick to the login problem for now.

    Do you have a suggestion for a next step to troubleshoot? Thanks!

  • aecnu
    • WP Unicorn

    Greetings mudgey,

    Thank you for the additional input.

    I went ahead and paid a visit to your site again to attempt to identify and possible JS errors or any errors of any kind and to my surprise the Facebook log in is missing.

    However, I did do what I intended and seen a JS issue right away using Chrome shift+cntrl+J screen shot below.

    I anticipate until this issue is resolved the rest will not play nice.

    Please advise.

    Cheers, Joe

  • mudgey
    • Flash Drive

    Hi there,

    Thanks for your follow-up. I’ve removed the plug-in from that site, tenderlovingcalls.com, and am now testing it at beta.tenderlovingcalls.com. Unfortunately, it’s not working there either, and now there’s a new problem. I’m going to open up a new ticket with that problem, but I have a feeling I’ll be coming back to this one once that roadblock is broken.

    Thanks very much.

  • mudgey
    • Flash Drive

    Hi there,

    I think I’ve resolved this problem and am offering two tips in case they’re helpful to you or to others finding this page:

    1) The Facebook Connect service used by the plug-in doesn’t work if your browser is in Incognito mode. (Which is otherwise very helpful, because it allows you to be logged out of WordPress in that window and still tweak settings using the same browser.) In order to test, you’ll need to either log out of WordPress entirely or use a completely different browser.

    2) The hook that the Ultimate Facebook Plug-in uses to inject the FB.init() JavaScript appears to be the wrong hook for the job. The function wdfb_get_footer_hook() (line 83, wdfb_utilities.php) sets get_footer as the footer hook. That inserts the FB.init() call BEFORE the Facebook JavaScript has been loaded (it’s enqueued in the footer) and so it’s an uncaught exception. I changed wp_footer to be the hook, instead of get_footer, and it’s working properly for me now.

    Your results may vary.

    Thanks. You can close this ticket.

  • aecnu
    • WP Unicorn

    Greetings mudgey,

    Thank you for the fantastic news and more importantly thank you for posting your findings above and I will indeed flag the lead developer @vladislav so that he can check the coding part you indicated in #2 above.

    Some rep points sent your way for your effort in posting your findings.

    Cheers, Joe

  • Vladislav
    • Dead Eye Dev

    Hello,

    The issue that caused this to happen has been fixed in v2.6.2 of the plugin, and the Facebook initialization shouldn’t be appearing before the actual script inclusion. Also, by the way, you can set up your footer hook without changing the plugin core by setting the “WDFB_FOOTER_HOOK” define. If you set it to “true”, it will default to “wp_footer” hook, as you want it to (it is not the plugin default for a reason – you’d be surprised how many themes don’t have a notion of this hook). You can also set it to an explicit value to use a different hook altogether – e.g. this will work with Shoestrap theme:

    define('WDFB_FOOTER_HOOK', 'shoestrap_after_footer', true);

    Another thing you may want to consider is using async Facebook script inclusion. You can tell the plugin to do this by setting another define like so:

    define('WDFB_FB_ASYNC_INIT', true);

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.