Home Forums WoodMart support forum WC ajax‑poc massively slowing page load

WC ajax‑poc massively slowing page load

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #673529

    [email protected]
    Participant

    Hello XTemos team and community,

    I’m running WoodMart (v9.9.5) with WP Rocket on a WooCommerce site, and I’ve identified two AJAX fetches that are blocking my Largest Contentful Paint by nearly 10 seconds combined. They fire on every page load—even on the homepage—before any of my images or other resources, severely degrading performance.

    What I’m seeing in Chrome DevTools Network
    Name Time Initiator Description
    ajax‑poc‑data‑client‑id ~6.00 s button.js?ver=… Fetches a client/session ID for analytics
    ajax‑poc‑simulate‑cart ~3.52 s button.js?ver=… Simulates current cart state for mini‑cart

    These both originate from button.js (v1752255179‑2), which appears to be part of WoodMart’s “Add to Cart” functionality or a bundled PPC script.

    What I’ve tried so far
    WP Rocket “Disable WooCommerce Cart Fragments” toggle (✅ cart‑fragments are now gone on non‑cart pages).

    Custom PHP snippet to dequeue wc-cart-fragments on all but Cart/Checkout.

    JS snippet to refresh only the mini‑cart badge/UI on add‑to‑cart events.

    Everything works—my cart UI, compare buttons, off‑canvas cart, header icon all update correctly—but these two AJAX calls remain and continue to block page rendering.

    My questions
    What exactly loads button.js on non‑cart pages? Is this part of WoodMart core, or perhaps one of the bundled “PayPal Buttons” / PPC modules?

    How can I disable or defer these two AJAX endpoints (ajax‑poc‑data‑client‑id & ajax‑poc‑simulate‑cart) on all pages except Cart/Checkout, without breaking the mini‑cart or dynamic pricing features?

    Is there a recommended WoodMart filter or hook that controls these endpoints or the loading of button.js so I can scope it appropriately?

    Any pointers, code snippets, or best practices would be hugely appreciated. Thank you in advance!

    #673761

    Artem Temos
    Keymaster

    Hello,

    Thank you for reaching out with your concerns and providing detailed information about the issue. It’s essential to optimize the performance of your site, and I understand the AJAX fetches are causing you difficulties.

    Firstly, to clarify, there is no file called button.js in our WoodMart theme’s default installation. It seems this file may be coming from a third-party plugin or custom script. Could you please provide the exact path to this file for further investigation?

    To address the issue with the AJAX calls, you may want to identify all the scripts enqueued on your site to see where button.js is being included. Using tools such as the Chrome DevTools or similar WordPress plugins that list enqueued scripts could be beneficial in this situation.

    Let us know if you have further questions or need additional assistance.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)