• Hello,
    We recently ran into an issue in which the live chat backend change occasionally refreshes and sometimes breaks chats. The refreshes themselves are disrupting, but the fact that it can mess with the chats as well is more concerning.

    The issues (I’m not sure if they are all related) are: frequent page refreshing, chat messages lost sometimes when page refreshed, option to end/leave chat not available occasionally, chat messages get reorganized sometimes when page refreshed, occasionally messages sent before agent joins don’t show, webpage becomes unresponsive, error message “This site can’t be reached” occasionally happens.

    For the refreshes I’ve been able to narrow those down to a specific event in the Network tab of Chrome Inspect tools. Essentially WP Live Chat is making hundreds of ajax calls (https://www.domain.com/wp-admin/admin-ajax.php?_fs_blog_admin=true) in a short time period (it ranges from about 10 every couple seconds to about 100 every couple seconds). Usually after 1-1.5 thousand calls one of the them will fail and it’ll initiate a page refresh.
    The number of ajax calls seem to increase based off how many visitors are there, but usually doesn’t cause any issues until a chat starts.

    Before the failed ajax call there is only one error and one warning in Chrome Inspector Console (Warning: DevTools failed to parse SourceMap, Error: 404 Not Found for resources ui-icons_444444_256x240.png). After the failed ajax call there are a few errors that appear (Error: Uncaught TypeError cannot read property ‘name’ of undefined, Error: 502 GET request for total-visitors-online api?, and then an error of that same GET request being blocked based off of CORS policy).

    I’m working on seeing it this issue is related to the theme on a test site (currently the issue has only been seen on our live site). I’ve ruled out caching and optimization plugins and installing and configuring the Heartbeat API plugin to send ajax calls less frequently seems to help a bit, but doesn’t solve the issue. I’m wondering if it’s related to this issue here. https://www.ads-software.com/support/topic/429-erros-too-many-requests/
    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wp3cx

    (@wp3cx)

    Hi @thetishbyte ,

    It is not WP Live Chat that makes the requests to admin-ajax.php?_fs_blog_admin=true but rather another plugin you are using (or maybe the theme).

    If I recall correctly there was another case similar to yours and the user had a security plugin installed which was initiating those requests and page refreshing. (not related to the link you posted).

    Thread Starter thetishbyte

    (@thetishbyte)

    Are you certain?
    The issue only initiates in the Live Chat dashboard.
    The ajax call Referrer data shows it’s from the Live Chat plugin:
    Referer: https://www.domain.com/wp-admin/admin.php?page=wplivechat-menu
    Form Data:
    action: wplc_agent_list
    security: e34f42783c
    user_id: 77

    On the other admin pages there are the usual ajax calls, but on the Live Chat page there are hundreds of the above ajax calls (including the failed ones). Just to be clear, are you saying that the Live Chat plugin doesn’t generate these?

    • This reply was modified 4 years, 8 months ago by thetishbyte.
    Thread Starter thetishbyte

    (@thetishbyte)

    The information it’s sending is the list of chat agents online, I’m assuming for the top admin bar because it contains users who aren’t assigned as chat agents.

    Would it be possible to disable it showing/requesting the agent list for the top bar? Where in the plugin code would I need to comment it out?

    Also after studying it, it incrementally increases the number of requests and frequency of the requests the longer the page goes without refreshing. At first it’s only a couple every few seconds, then at around 1500 calls it’s 20-40 every few seconds, and that around 3000 it’s 40-100 requests every few seconds. It’s like some sort of recursive function is making the ajax calls. It doesn’t even directly scale to the amount of traffic, but having active chats does boost the cycle considerably (by a factor of about 2.5-3x).

    I’m still testing to see if I can pull more information for this.

    Plugin Author wp3cx

    (@wp3cx)

    Hi @thetishbyte ,

    The request you are referring to in your second post is indeed originating from our plugin. Your initial post did not contain information regarding the request body, only the endpoint. I said that it didn’t originate from our plugin because _fs_blog_admin=true is definitely appended by something else. Now that you have included the post body I can confirm it’s from the plugin.

    We are aware of this issue and working towards optimising the plugin’s performance in upcoming releases.

    Thread Starter thetishbyte

    (@thetishbyte)

    Hello,
    That’s good news.
    Would it be possible to implement a temporary fix? Something like I mentioned above.

    Would it be possible to disable it showing/requesting the agent list for the top bar? Where in the plugin code would I need to comment it out?

    It’s not an essential feature and I’d like to at least see if that would temporarily fix the issue. That would also provide more insight into a piece of the issue (i.e. if commenting out that code actually fixes the issue or not).
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Backend Chat page refreshing’ is closed to new replies.