• I understand that admin-ajax.php is used to check for new chats.
    However, it is being called on all pages even the home page where there are no chats open. I tried to turn off chats in the Admin Bar, but it will still run.

    I am working with sites that get thousands of users a minute and the admin-ajax.php is bogging down the server as it is being called every 2 seconds for each user.

    How can I get the polling to only happen on pages where the chat program is being displayed.

    This is a major flaw and should be resolved asap.

    Thanks

    https://www.ads-software.com/plugins/chat/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Gravitate

    (@gravitate)

    Seems like the issue is on
    wordpress-chat/js/mpmudev-chat.js Line: 211

    You are calling
    wpmudev_chat.chat_session_message_update();
    without checking any conditions.

    Either around that call or in the chat_session_message_update: function itself there should be a conditional set.

    For now I just commented out line: 211 and it seems to be working fine now.

    } else {
         //wpmudev_chat.chat_session_message_update();
    }
    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @gravitate,

    Thanks for posting on the forum.

    Are you using chat on specific pages using chat shortcode and want the polling should only happen on those pages?

    Please advise.

    Kind Regards,
    WPMU DEV

    Thread Starter Gravitate

    (@gravitate)

    Yes, that is correct.
    I am only having the Chat on a specific page.

    It seems to me that there is no reason for the polling to happen on non-chat pages.

    I suggest running a condition to check to see if the Chat is being displayed before running the Polling.

    Your init function seems to do that, but there is the }else{ statement that bypasses that condition and runs the
    wpmudev_chat.chat_session_message_update();
    even if there is no chat.

    Thanks

    Hi @gravitate,

    Thanks for clarifying that, I see what you mean. I think the plugin may do that because of the bottom chat but if you’re not using any chat at all in a specific area, it’s definitely helpful not to call that.

    I’ll run this by the developers, this could especially help in cutting down server requirements.

    Thanks!
    David

    Thread Starter Gravitate

    (@gravitate)

    Glad to hear it.
    Please reply back if there is an update that resolves this issue.

    Thanks

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Sure we will reply on this thread if there is any update regarding this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘admin-ajax.php – Overload’ is closed to new replies.