WordPress Chat Endlessly refreshes for Facebook

Howdy,

I’ve tried to set up WordPress chat on two sites now and Twitter authentication works just fine, but whenever I try to work with Facebook it becomes unusable.

Once I authorize the app, the page goes into an endless refresh loop. Then, when I try to enter the page in another tab, it also goes into an endless refresh loop.

You can try it out on a 2011 installation with no plugins here: http://hermpheus.andrewsfreeman.com

Any help is appreciated.

  • Paul
    • The Green Incsub

    @johnetec, looking into this deeper this morning. I’ve setup my local instance of the latest version of WordPress and latest version of the chat plugin. Running default theme and no other plugins running. Both the inline and bottom corner chats work fine no repeated loads.

    So back to your site. Running Firefox latest with Firebug to debug the JS. When I attempt to signin to Facebook it appears there is a JS conflict with the Facebook Library. This not part of the Chat plugin directly but simply a reference we call as per the Facebook API https://developers.facebook.com/docs/reference/javascript/

    In looking at the page load it appears there are quite a few other JS libs being loaded. So you might try turning some other things off. Specifically there are two JS libs all.js and anywhere.js

  • Kimberly
    • Champion of Loops

    Paul,

    I tried this one myself on a twenty eleven install and had some crazy issues. Same as johntec in FF, couldn’t see it at all in Chrome and Explorer broke.

    I deactivated all my plugins before testing, but I did have Ult Facebook installed and deactivated.

    What can I try to see if this is just my setup? would I need to just create a new site?

  • Paul
    • The Green Incsub

    @kimberly, could be a cookie conflict. Try clearing browser cookies. On John’s site I say JS errors. Not sure if Facebook has once again changed their API.

    I tries on 4 different WP installs on my local system this morning running vanilla configuration. Are you running any caching plugins? I know Super Cache plugin when trying to compress JS sometimes breaks it.

  • johnetec
    • Design Lord, Child of Thor

    @paul

    I just tested this again on a even cleaner install of WP at http://epicwpdev.com (the hermpheus address, incidentally, was MU and had Akismet, MU Domain Mapping, and G-Forms network installed, no caching though), and a local LAMP install. Same problem with latest Firefox and Chrome. I can give you an admin account to epicwpdev.com (lol) if need be.

    The only JS errors I’m getting are permissions errors from Twitter’s anywhere.js., and anywhere.js and all.js are explicitly enqueued in the Chat plugin on lines 1511 and 1520, not loaded asynchronously.

    If it’s any help, if I comment out line 438 of chat.js it stops endlessly refreshing (there’s no textarea#chat-send-1 element).

    I’m pretty sure Facebook changes their API every month. :slight_smile: And I blame them.

  • Paul
    • The Green Incsub

    @johnetec, Thanks for the attempt to debug. At first I thought this might be related to having both the Twitter and Facebook signin enabled. Since that was one difference between your setup and mine.

    As for the not about commenting out the JS because there is no chat-send-1 texarea. It is there. But only shown once the user it properly authenticated.

    This morning I signed up for a new FB app ID and setup the chat on one of my public facing WP sites (Multisite). I’m now getting the error. So will at least have a way to dig into this deeper.

    http://site5.media-tags.com/

    Thanks.

  • Paul
    • The Green Incsub

    @johnetec, I know this is Friday before a long weekend for most. If you are still around and have a chance. Can you try something for me?

    I think I narrowed this bug down but want to get some independent confirmation. One your chat setup (settings > chat) I’m assuming you table ‘Bottom corner chat’ looks something like mine http://screencast.com/t/NYabnvv7eTtf mostly concerned with the Facebook checkbox.

    So on the other tab ‘In post chat options’ do you also have the Facebook checkbox set? If not then please set this and let me know if the continuous reloading stops.

    @kimberly, Feel free to also confirm this.

    The bug has to do with the authentication with in the PHP code. Since the In Post setting was not checked on my own site the PHP code does not even attempt to authenticate for Facebook. So the page reloads without the needed textara. And since the JS known the user has authenticated it steps through the processing and gets to the point to reload again because the textarea is not present.

    Took most of the day to dig into that. Just want to confirm what I’m seeing before I start tearing into the code for a fix.

  • johnetec
    • Design Lord, Child of Thor

    @paul

    Thank you so much. I really appreciate the time you’ve put into this, and I hope this results in a more stable/straightforward release… You get all the points.

    After debugging it seemed to me like the PHP auth was the problem. Checking the FB box for in-post options fixed this, and now it works just fine. It’s working on epicwpdev.com if you want a visual confirmation.

    Thanks again. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.