• Resolved amitramani

    (@amitramani)


    I am noticing (when running speed tests using GTMetrix), that admin-ajax.php was causing 10+ second delays.

    After I enabled the admin-ajax debug using wp-config.php, I was able to collect the wpe_admin_ajax.log. The log shows about 90 queries by Live Chat for action “wc-livechat-check-cart” in just 1 minute.

    Here is a sample from the log:

    (
    [action] => wc-livechat-check-cart
    )
    \nArray
    (
    [action] => wc-livechat-check-cart
    [_ga] => GA1.3.2059938626.1497597634
    [_gid] => GA1.3.2118358805.1497597634
    [__lc_visitor_id_8483057] => S1497597641.9b3f74d879
    [wp_woocommerce_session_4970599edf142eda2d04c3d5c41b24c2] => d897d98df8395b640050daa81b027bde||1497770627||1497767027||1b8171bac22769e429984023a06584fb
    [woocommerce_items_in_cart] => 1
    [woocommerce_cart_hash] => 42a5aa3e1ff6dd4715499d13b6392254
    [lc_window_state] => minimized
    )

    Any ideas on how to fix this? This is causing a delay in page load times on every page since Livechat is on every page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author LiveChat

    (@livechat)

    Hello Amitramani,

    Thank you very much for reaching us with this!

    Actually, the plugin that you are referring to is our plugin for WooCommerce stores but I will be more than happy to help you with this one as well ?? There is an easy way to alter the behavior of our plugin.

    This can be done by editing the woocommerce-livechat/src/view/script-template.php file available in the plugin’s directory. When editing this file, you can alter the following line:

    setInterval(function() { checkCart(); }, 10000);

    It’s the 62 line of code. This line of code determines how often our plugin will call your customer’s cart and ask for its value. The value stated in this line (10000) is stated in milliseconds.

    Changing it to a higher value will change the time after which the plugin sends the query again. This should also help with getting a 10+ seconds delay when running speed tests using GTMetrix.

    Amitramani, I hope that I was able to help! Please don’t hesitate to ask in case of any additional questions.

    • This reply was modified 7 years, 1 month ago by LiveChat. Reason: Beter text formatting
    • This reply was modified 7 years, 1 month ago by LiveChat. Reason: Better text formatting
    Jon

    (@freshyjon)

    We noticed this issue as well. If we used the non-WooCommerce version of the plugin, would this also solve the issue of 1066 ajax requests from ‘wc-livechat-check-cart’ in about 5 minutes?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘LiveChat causes slow down in Page Load Speed/Time’ is closed to new replies.