Frequent AJAX requests to admin-ajax.php

This topic has 5 replies, 2 voices, and was last updated 1 days, 1 hours ago ago by Rose Tyler

  • Avatar: HUSSTLE
    HUSSTLE
    Participant
    March 6, 2025 at 16:24

    Running into an issue, and this is what my current host support chat response to me simply trying to edit a page using Elementor.

    ####

    Allowed memory exhaustion can mean that a PHP script has exceeded the maximum memory limit set in the server’s PHP configuration. This typically happens when a script consumes too much memory due to large data processing, infinite loops, or excessive AJAX calls (like in your case with xstore_wishlist_fragments).

    Based on the graph, the xstore_wishlist_fragments and xstore_get_user_wishlist functions from the et-core-plugin (which is part of the XStore theme) are making frequent AJAX requests to admin-ajax.php.

    This can contribute to high memory usage, especially if these requests are triggered on every page load or by multiple users simultaneously.

    You’re currently on Version 9.4.8 released on February 27, 2025, which seems to be the most recent version of the theme according to the change logs here.

    To mitigate and possibly resolve the issue – look for a setting in XStore’s theme options to disable or limit AJAX calls for the wishlist if possible. or you can reach out to the theme developer for help with this.

    ####

    Please, contact administrator
    for this information.
    4 Answers
    Avatar: HUSSTLE
    HUSSTLE
    Participant
    March 6, 2025 at 19:21

    [06-Mar-2025 16:10:41 UTC] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /scripts/env.php on line 105
    1:20 pm

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 7, 2025 at 10:43

    Thank you for reaching out to us.

    The error message you provided indicates that the allowed memory size has been exhausted. This typically occurs when a script requires more memory than the allocated limit. To resolve this issue, we recommend increasing the PHP memory limit in your server settings. You can do this by modifying the php.ini file or adding the following line to your wp-config.php file:

    define('WP_MEMORY_LIMIT', '1024M');

    Read more – https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/

    If the issue persists, please check with your hosting provider to ensure that the memory limit can be increased. Additionally, reviewing any recently installed plugins or scripts that may be consuming excessive resources could help identify the cause.

    Should you require further assistance, please do not hesitate to contact us.

    Best Regards,
    8Theme’s Team

    Avatar: HUSSTLE
    HUSSTLE
    Participant
    April 16, 2025 at 20:51

    So, we have moved to another host provider and now have a VPS.

    Our domain is consuming high resources on the server.

    I can see there are lots of hits to these pages on the website:

    1055 /?wc-ajax=get_refreshed_fragments
    2686 /wp-admin/admin-ajax.php

    The major contributor for high resource usage were the ajax calls, which are basically used by WordPress to refresh the page without you having to reload it.

    Any recommendations?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 17, 2025 at 07:15

    Hello,

    Thank you for reaching out to us.

    – ?wc-ajax=get_refreshed_fragments is the default WooCommerce request to update cart in header and also wishlist. Unfortunately, the theme does not have options to speed it up. You can read this topic and maybe find any solution suitable for you https://wordpress.org/support/topic/wc-ajaxget_refreshed_fragments-5/
    Or you can disable Ajax Cart Fragments – Theme Options > Speed Optimization > Always Load Wc-Cart-Fragments > off. Ajax Cart Fragments option allows you to sync the number of products in the header mini-cart if you open your site in a few browser tabs.

    – In order to resolve the issue with /wp-admin/admin-ajax.php, we suggest that you edit home page with Elementor > edit the relevant XStore widgets using Elementor > Edit the relevant element > Advanced > XStore Ajaxify > Lazy Load > Toggle it OFF and Publish it.

    – Review your active plugins and disable or remove any unnecessary plugins that may be contributing to excessive AJAX usage.

    – Implement a reliable caching solution such as WP Rocket, W3 Total Cache, or LiteSpeed Cache (if supported by your server). These plugins can help reduce the number of AJAX calls and improve overall site performance.

    – A Content Delivery Network (CDN) can offload static resources and reduce the load on your server, improving response times for users globally.

    Warm Regards,
    The 8Theme Team

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

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

Helpful Topics

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