Title: admin-ajax.php &#8211; Overload
Last modified: August 22, 2016

---

# admin-ajax.php – Overload

 *  [Gravitate](https://wordpress.org/support/users/gravitate/)
 * (@gravitate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/)
 * 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://wordpress.org/plugins/chat/](https://wordpress.org/plugins/chat/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Gravitate](https://wordpress.org/support/users/gravitate/)
 * (@gravitate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393672)
 * 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](https://wordpress.org/support/users/wpmudev-support1/)
 * (@wpmudev-support1)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393764)
 * Hi [@gravitate](https://wordpress.org/support/users/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](https://wordpress.org/support/users/gravitate/)
 * (@gravitate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393766)
 * 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
 *  [David](https://wordpress.org/support/users/ugotsta/)
 * (@ugotsta)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393780)
 * Hi [@gravitate](https://wordpress.org/support/users/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](https://wordpress.org/support/users/gravitate/)
 * (@gravitate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393782)
 * Glad to hear it.
    Please reply back if there is an update that resolves this 
   issue.
 * Thanks
 *  Plugin Support [Predrag – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support1/)
 * (@wpmudev-support1)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393799)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/chat_c9d6b1.svg)
 * [Chat](https://wordpress.org/plugins/chat/)
 * [Support Threads](https://wordpress.org/support/plugin/chat/)
 * [Active Topics](https://wordpress.org/support/plugin/chat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/chat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/chat/reviews/)

## Tags

 * [admin-ajax.php](https://wordpress.org/support/topic-tag/admin-ajax-php/)
 * [polling](https://wordpress.org/support/topic-tag/polling/)

 * 6 replies
 * 3 participants
 * Last reply from: [Predrag – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support1/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/admin-ajaxphp-overload/#post-5393799)
 * Status: not resolved