URGENT Excessive ajax requests via XStore Plugin

This topic has 21 replies, 2 voices, and was last updated 1 years, 8 months ago ago by Rose Tyler

  • Avatar: websitedude1985
    WebsiteDude
    Participant
    February 15, 2023 at 14:08

    Hi there

    okay so this is worrying – see message from host. Can you advise/recommend any steps re the Xstore Core Plugin as this is a big problem.

    Issue is they will disable my account if we cannot resolve the matter.

    MESSAGE FROM HOST

    Hi,

    I hope that you are doing well.

    We have noticed an abnormal CPU and MySQL usage from your site that seems to be coming from multiple sources.

    [1] – The XStore Core plugin makes constant requests via admin-ajax.php causing CPU usage.

    [2] – Pinterest bot aggressively crawls the site.

    TOP User-Agents by PHP Calls
    55144 Mozilla/5.0 (compatible; Pinterestbot/1.0; +http://www.pinterest.com/bot.html)

    Please, contact administrator
    for this information.
    20 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 15, 2023 at 14:49

    Hello, Websitedude1985,

    The number of requests depends on the number of Ajax elements on the page, whether there is an Ajaxify widget, or if someone is searching a lot, or if this option is enabled – https://prnt.sc/GirTEgelCA_3
    You need to disable ajax settings via Theme options, and edit the content of pages > disable Ajaxify in the settings of elements.

    Provide temporary wp-admin access, so we can take a closer look at your settings.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    February 15, 2023 at 14:52

    Hi there

    that would be amazing – if you can log in and check over the settings.

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 15, 2023 at 18:47

    Hello, Websitedude1985,

    We’ve disabled next options: Wishlist For Variation Products https://prnt.sc/lr1_SFxIgzwK and Ajaxify Widgets https://prnt.sc/NiCLlHiMTB-R
    Please check now.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    February 15, 2023 at 19:04

    Hi there

    thanks for the quick response, can you though please explain why this would need to be done? Surely disabling something is an option but in doing so I miss out on some feature?

    Would be good if the user guide/docs covered this sort of information

    Thanks again

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 16, 2023 at 11:19

    Hello, Websitedude1985,

    1/ Typically, there is no such issue, however, in your case it is a specific situation with server requirements.
    2/ As all these features use Ajax technology, which in turn makes requests through admin-ajax, the more of these elements there are, the more requests will be made.
    Some requests are only executed after certain manipulations, for example Quick View sends requests only after pressing the button and search as well.
    Some work without a trigger due to their particularities, for example, Ajaxify Widgets performs requests when an element is visible on the screen. The same applies to Wishlist For Variation Products, as a request is sent immediately after the products are loaded to determine which variation is selected and which one to add to the wishlist.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    February 16, 2023 at 14:57

    thanks for the more detailed reply, it has helped

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 16, 2023 at 15:05

    You’re welcome!

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 1, 2023 at 16:35

    I am still having major issues with the speed of this theme. Please see comment below from the host… PLEASE HELP

    Hi

    During the past 24 hours we have noticed a huge decrease in the CPU usage, but unfortunately, there seem to be new spikes logged on our graphs.

    You can check here –

    Most of the requests made by user agents are related to Google and instead of blocking them via .htaccess rules, we’d suggest that you limit the crawl activity in the Google Search Console where the bots are managed.

    As for the other bots, f.e. Pinterest, even if we block it the CPU usage will still go above the threshold limits, which affects the server.

    As my colleague mentioned, the main reason for the high CPU time is because of the admin-ajax.php requests that come from your theme and plugins.

    You can easily check that in your browser without any additional tools.

    As you suggested, the website can indeed be checked and optimized, but in this case the issue is related to the way the theme is coded and our optimization service does not include development or optimization of your plugins/theme or anything code related.

    We can help optimizing the website for better speed and performance, while reducing the calls to the admin-ajax.php file is something you should check with a developer.

    Alternatively, you can also consider changing that theme with another that would have similar layout but won’t have such intensive usage.

    Let me know if I can help with anything else.

    Warm regards,
    Luchezar Dimitrov.
    Security & Optimization at WPX

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 3, 2023 at 08:01

    Hello, Websitedude1985,

    For now you may add next few filters in xstore-child/functions.php which may help you to remove few ajax requests but it may create some issues with caching plugins

    add_filter('xstore_wishlist_mini_content_ajax', '__return_false');
    add_filter('xstore_compare_mini_content_ajax', '__return_false');

    Deep code refactoring is already written in our todo list. If you know the main code areas where we should take more time for refactoring, please, share them with us (public or in private area) so we will spend less time for searching such reasons and more time for improving those things of speed loading and excessive ajax requests.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 14, 2023 at 05:41

    Hi there

    thanks for this reply – so are you aware of this being an issue? It is good to hear you are considering code refactoring. I suspect many of us are affected in the same way

    Can you elaborate a little what the pitfall is of adding your suggestion to our functions.php? Of course I don’t want to break anything. I decided to turn off the Compare feature in the end – but it does still seem that the theme is really heavy on admin-ajax.php use so this must be problematic for many people. Are there any further ideas on how to combat this?

    Thanks

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 14, 2023 at 17:33

    Hello, WebsiteDude,

    The mentioned code disables additions ajax request for wishlist and compare quantity in the header, and this should not cause a problem on your site. For other customers, this additional ajax may be needed if they using cache plugins and face the problem of refreshing the quantity in the header while going through pages.

    Currently, the task about combat with additional admin-ajax.php is in our task list, but there is no ready solution. If you have your own ideas, please reply back here.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 24, 2023 at 07:22

    Hi there

    okay so after a long time testing, moving to a new host plan VPS with the best speed etc etc – this is what has been fed back from an independent audit.

    Hi Mark,

    I have reviewed your website and found some things that could improve your website’s performance.

    1. Currently most of your pages are not being cached by W3 Total cache because there is an exclusion for pages which set the cookie “woocommerce_recently_viewed”. If you do not use this functionality then it’s recommended to remove the exclusion and this will result in higher cache hit rate which will result in better site speed for your visitors. You can find this setting in “Performance -> Page Cache -> Rejected Cookies”.

    8THEME….. IS THIS SOMETHING YOU CAN ADVISE ON – WHETHER OR NOT THIS CAN BE HANDLED BETTER IN THE THEME?

    2.Built in Wishlist functionality of XStore – You can find this feature in HGWEB -> Theme Options -> Woocommerce (Shop) -> Built in Wishlist -> Enable Built-In Wishlist. This feature triggers 2 admin-ajax.php requests for each visit of your customers which are slow as the content is always dynamic.

    8THEME…… THIS IS AN ONGOING ISSUE AND CLEARLY HOWEVER THIS IS IMPLEMENTED THIS IS CAUSING ISSUES BOTH FOR US AND I GUESS ANYONE USING THE THEME – YOU USED TO USE YITH WISHLIST BUT CHANGED, CAN YOU TELL ME WHY AND MORE IMPORTANTLY HOW THIS CAN BE SOLVED AS THIS GETS WORSE WHEN USING THE COMPARE FEATURE AS THIS ADDS ANOTHER 2 REQUESTS.

    3.Elementor – I made few tests and basically just the Elementor plugin (and its extensions/widgets) is slowing down the website by 0.5 seconds for each request. I’ve turned off the whole caching in order to get raw results with and without Elementor plugin. I’ve made a comparison on a random page where with Elementor enabled your website was loaded in 1.7seconds and with Elementor disabled the website loads in just 1.15-1.20 seconds which is a huge difference.

    8THEME…… I UNDERSTAND THE ISSUES HERE WITH ELEMENTOR AND I GUESS THIS IS A WIDER ISSUE IN REGARDS TO ELEMENTOR WHICH WE ALL KNOW IS NOT THAT PERFORMANT – IS THERE ANYTHING YOU CAN SUGGEST HERE TO GET THE BEST FROM ELEMENTOR IN CONJUNCTION WITH THE THEME? I NOTICE MANY OF THE CONTENT BLOCKS AND TEMPLATES USING THE OLD SECTIONS AND COLUMNS RATHER THAN FLEXBOX – SO THIS COULD BE IMPROVED IF YOU FOLKS ROLLED OUT REPLACEMENT TEMPLATES IN THE FUTURE USING FLEXBOX

    We haven’t changed anything on your production website while doing the troubleshoot. You can try any of these and see if you can sacrifice some of these functionalities in order to achieve better performance of your website.
    Let me know if you would like to try any of these recommendations and you need assistance.

    THESE TESTS WERE DONE ON A AN EXACT CLONE OF THE SITE – SO ALL STEPS TO IMPROVE WERE CARRIED OUT – SO WE ARE FOR SURE FINDING THAT XSTORE IS A BIG PART OF OUR PROBLEM – AN AN ECOM STORE DOING £5M SALES AND GROWING WE ARE AT A CRITICAL POINT OF HAVING TO MOVE AWAY FROM XSTORE IF PERFORMANCE CANNOT BE IMPROVED.

    Currently you are not hitting the limits of allocated resources so even if we upgrade your account further that will not speed up the website.

    Let me know if you have any follow-up questions.

    Warm regards
    Aleksandar T.
    System Administrator
    WPX Support

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 24, 2023 at 15:11

    Hello, WebsiteDude,

    1) The woocommerce_recently_viewed cookie is created by the WooCommerce plugin – https://cookiedatabase.org/cookie/woocommerce/woocommerce_recently_viewed/
    https://woocommerce.com/document/woocommerce-cookies/

    2) We have provided an alternative solution for users who do not wish to use YITH plugins, as they can overload the system more than the similar functionality.

    Dynamic pages can be changed to static using our shortcodes https://prnt.sc/vc1Sn2yY6uSB , example is in the video – https://youtu.be/ZyjZ-vCx0pE
    Ajax can be disabled by adding next code to your child-theme/functions.php


    add_filter('xstore_wishlist_mini_content_ajax', '__return_false');
    add_filter('xstore_compare_mini_content_ajax', '__return_false');

    Or you can disable the XStore functionality in Theme Options -> Woocommerce (Shop) -> Built-in Wishlist -> Enable Built-In Wishlist and Theme Options -> Woocommerce (Shop) -> Built-in Compare -> Enable Built-In Compare and then use the corresponding YITH plugins.

    3) You facing this issue because almost all of the content is built on Elementor and its deactivation accordingly turns off the styles, scripts, and HTML that is being loaded on the page.
    As an option, we can suggest you to enable the XSTORE Ajaxify -> Lazy Loading option ( https://prnt.sc/gUIUs_M1iMlg ) which is available for our XStore Elementor widgets.
    We do not plan to go back to section and columns pather.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 25, 2023 at 09:56

    Hi there

    thanks for the reply. Can I check a few things…..

    1) The woocommerce_recently_viewed cookie is created by the WooCommerce plugin – https://cookiedatabase.org/cookie/woocommerce/woocommerce_recently_viewed/

    ME: What would you suggest to do about this? Remove recently viewed functionality?

    2) We have provided an alternative solution for users who do not wish to use YITH plugins, as they can overload the system more than the similar functionality.

    Dynamic pages can be changed to static using our shortcodes https://prnt.sc/vc1Sn2yY6uSB , example is in the video – https://youtu.be/ZyjZ-vCx0pE
    Ajax can be disabled by adding next code to your child-theme/functions.php


    ME: Okay so using your inbuilt version is better? But how can this be performance optimised? Also I do not understand what you are suggesting with the Dynamic Page to Static information? what is this doing?

    3) You facing this issue because almost all of the content is built on Elementor and its deactivation accordingly turns off the styles, scripts, and HTML that is being loaded on the page.
    As an option, we can suggest you to enable the XSTORE Ajaxify -> Lazy Loading option ( https://prnt.sc/gUIUs_M1iMlg ) which is available for our XStore Elementor widgets.

    ME: What is the Ajaxify doing? The sound of it to me is that it creates even more ajax calls and that is part of my problem in slow site performance? is this safe for me to do?

    Finally you suggested the following…. Ajax can be disabled by adding next code to your child-theme/functions.php


    add_filter(‘xstore_wishlist_mini_content_ajax’, ‘return_false’);
    add_filter(‘xstore_compare_mini_content_ajax’, ‘return_false’);

    Do does this remove the functionality? so if I have a Wishlist showing in the header as an Icon it is not going to populate? So bascially I have no Wishlist functionality? Can you explain a little better what you mean or what this achieves?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 25, 2023 at 10:12

    Hello, WebsiteDude,

    Thank you for your response.

    1/ We would suggest you contact the support of WooCommerce – https://wordpress.org/support/plugin/woocommerce/

    2/ Please follow our recommendations and check the result.

    3/ You can do this in test format: enable XStore Ajaxify for elements that are out of the first viewed window size (do not activate this for elements that you see at the top of page), and check results, for example via gtmetrix.
    If you will find any issues you may simply switch off XStore Ajaxify for the widgets which are “problematic”. For example, this option is not recommended for banners with links on buttons.

    4/ This code should not cause any problems on your site with Wishlist functionality.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 29, 2023 at 08:32

    Tried the code and the result I get shows it breaks the site. the theme is now becoming unusable folks. My web host have commented that it is one of the slowest they have ever encountered. 🙁

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 29, 2023 at 08:45

    Hello, WebsiteDude,

    Please provide FTP access, we will check what can be done to help you.

    Kind Regards,
    8theme team

    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 29, 2023 at 08:49

    please see here…. this is the LIVE SITE

    Please contact administrator
    for this information.
    Avatar: websitedude1985
    WebsiteDude
    Participant
    March 29, 2023 at 08:51

    Site details…. STAGING SITE

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 29, 2023 at 12:25

    Hello, WebsiteDude,

    We apologize for any inconvenience caused. The code was written with a typo. Here is the correct one. Please test it:

    add_filter('xstore_wishlist_mini_content_ajax', '__return_false');
    add_filter('xstore_compare_mini_content_ajax', '__return_false');

    Kind Regards,
    8theme team

  • Viewing 21 results - 1 through 21 (of 21 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.