Embedded chat no longer appearing

I have been using the chat plugin for a few months now in our staging site. This morning I pushed it over to our production site and have bumped in to an interesting issue. Basically, when I embed the chat using the following shortcode:

[chat id="16" log_creation="disabled" log_display="disabled" ]

It does not appear on the page. Taking a look at the page source, the chat box is being overriden by in-line CSS:

<div id="wpmudev-chat-box-16" style="display:none;" class="wpmudev-chat-box wpmudev-chat-box-page wpmudev-chat-box-moderator wpmudev-chat-box-max wpmudev-chat-box-sound-on wpmudev-chat-session-open"></div>

I’m pretty sure the “display:none;” is not supposed to be there :slight_smile: I have dug through my theme’s style sheets and I do not have anything applied to the classes assigned to the plugin so I am at a loss as to what is killing it. It worked fine in my staging site which is supposed to be a mirror image of production. Could I get you guys to take a look at my page and give me a guess as to where to start looking? I left it enabled on this page:

http://edutainmentlive.com/itprotv/test

The page is empty except for a simple sentence above and below the embedded chat box to help me find it in the code :slight_smile:

Thanks,

Don

  • Patrick Cohen
    • Technical Docs Wrangler

    Hi @dpezet

    Yah, that’s an odd one. It almost looks like your theme is interpreting the shortcode as being a style declaration.

    Can you test with a different theme like Twenty-Twelve?

    Also, does your current theme have exactly the same configuration as your dev site did? And do you have the same set of plugins active?

  • dpezet
    • Design Lord, Child of Thor

    I haven’t tried changing the theme yet because it is my production site. However, I did recopy my production site in to staging again to make sure they were mirrored. Same files, same plugins, same theme and same configuration. Surprisingly, the chat still works in staging but not in production. The only difference at this point should be the URL.

    Production: http://edutainmentlive.com/itprotv/test/

    Staging: http://edulive.staging.wpengine.com/itprotv/test/

    Does the chat plugin store the site URL in the database or anything like that?

    Thanks,

    Don

  • dpezet
    • Design Lord, Child of Thor

    As a “Bronze” member with WPMU DEV I am only entitled to one site. Is it possible that the chat plugin has latched on to my staging URL as the only approved URL? I don’t know what kind of piracy detection goes on behind the scenes.

  • Patrick Cohen
    • Technical Docs Wrangler

    Hi again @dpezet

    I see you’re hosting with WP Engine. Have you checked cache settings on your production site?

    Please also double-check that your page had not already been mysteriously added to the blocked URLs section under Settings Common (ya never know).

    Is it possible that the chat plugin has latched on to my staging URL as the only approved URL?

    Nope, I can see in our records that you have enabled auto-updates on your production site instead of the staging one, so that shouldn’t be an issue.

  • Paul
    • The Green Incsub

    @dpezet,

    Wanted to jump in and provide some information. One reason the chat is not showing is it appears it can't call the AJAX URL needed to load the chat session. The Chat plugin bypasses the default AJAX file in wp-admin/admin-ajax.php and instead tries to use a custom AJAX file located in the plugin's folder.

    Looking at your site in Firebug I see the polling which means chat is installed. But I also see 301 errors (see image). To solve this go to Chat > Settings Comment. On the first tab 'Polling Intervals' you will see at the bottom of the panel a dropdown to select using the Chat plugin AJAX or the default WordPress AJAX. Select the WordPress AJAX (see second image).

    So why you might ask does chat want to not use the default WP AJAX file? Good question. When calling the default WP AJAX file WordPress will fully load all theme and plugins into memory, for each AJAx request. So if you are polling chat one a second for every user this polling consumes a large amount of system resources. So we wrote our own AJAX handler that just loads the minimal WP environment. But sadly on some sites due to security issues chat is not allowed to use it's own AJAX calls.

    [attachments are only viewable by logged-in members] [attachments are only viewable by logged-in members]

  • dpezet
    • Design Lord, Child of Thor

    Switching to the WordPress ajax file worked, but it definitely isn’t ideal. I have been working a ticket with WPEngine to help track down the issue. Their support is slow at best so I’ll have to keep you posted. Basically, they don’t allow plugins like the WordPress HTTPS plugin to manage SSL pages. Instead, they use some kind of URL rewrite rules on their end to manage which pages are rendered via HTTPS. For some reason, they are remapping the call to the chat ajax file over to HTTPS and the chat plugin doesn’t like it. That isn’t the chat plugin’s fault since it shouldn’t be happening anyway. I have asked WPEngine to examine their rules and make sure the plugin directory is not being forced to use SSL.

    Thanks for pointing me in the right direction. I’ll let you know what happens as soon as it is resolved.

  • Paul
    • The Green Incsub

    @dpezet,

    Thanks. Keep me posted. I have a few other members with the same or similar issues where they just cannot do AJAX calls to the Chat AJAX file only the wp-admin. Hence why I added that drop down as an option.

    I just checked my own WPE test site and the chat seems to work as designed. http://paulincsub.wpengine.com/chat/ Then again this is just a basic install running BuddyPress and a few stock plugin. Just to test out performance issue.

    Anyway keep us posted. If they come back with suggestions on the plugin let us know.

  • dpezet
    • Design Lord, Child of Thor

    They are still digging in to the issue over at WPEngine. It looks like they put in a rule that ensures the entire /wp-admin folder is accessed via SSL and it is somehow getting involved in the calls the chat plugin is making even though I only use the chat plugin embedded in a page that is not in wp-admin. They are looking in to it and I’ll let you know what they find.

    Thanks again,

    Don

  • Paul
    • The Green Incsub

    @dpezet,

    Thanks for the update. But I’m sort of confused what WPE is attempting. The Chat plugin tries to connect with its AJAX file in the plugins folder which is not in /wp-admin. So technically it should not need the rewrite logic that are applying.

  • dpezet
    • Design Lord, Child of Thor

    Paul,

    I wanted to follow up on this to keep you updated. I have been working with the WPEngine team on the issue for quite a while now. I got escalated to their top tier of support and they finally tracked down the issue. They didn’t give me an exact cause, though. Here is what they said:

    it appears to have been caused by a configuration issue on our end.

    Either way, I was able to switch back to the chat plugin’s built-in Ajax and it is working fine now.

    Thanks again for your help,

    Don