• Resolved Acoustical Solutions

    (@asolutions101)


    In Woo 8.8+, we are running into a PHP (8.1) Memory Exhausted error when we have a large number of shipping methods available in a Zone. The error is triggered in Cart and Checkout when updating the destination state/postal code (appears to be an AJAX call). It can also be slow to update the cart when enough methods are active in the zone.

    To trigger the error on our main site, add three products with different shipping methods to cart. Try Green Glue Compound Tubes first, then go to Cart and enter a shipping destination. Should be fine at this point. Next add a roll of MLV (AudioSeal Mass-Loaded Vinyl), and a box of PrivacyShield Ceiling Tile Barrier. Now that there are 3 items in cart with different shipping methods/instances, try changing the destination state & zip in Cart. This should trigger a spinner for 5–10 seconds but not actually update anything. Curiously if you subsequently go to the main shop page, it might update.

    On our Staging site, we increased our WP_MEMORY_LIMIT from 512M to 2048M and this allowed more methods to be active at one time, but does not fully stop the issue nor does it speed things up.

    As context our shipping setup is extraordinarily complex. We have 50 methods/instances available in the zone due to a combination of Parcel & LTL carriers, warehouses, and drop shippers (all with different origin zips and box sizes).

    I have been able to reproduce the error on our Staging site with Storefront and minimal active plugins (Woo, TaxJar, UPS). It is always related to the number of active methods in the zone. The interesting thing is the error occurs in different places in Woo and WordPress depending on the number of active methods. See list below:

    /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php on line 78
    /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php on line 531
    /wp-content/plugins/woocommerce/includes/class-wc-post-data.php on line 19
    /wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store-session.php on line 109
    /wp-content/plugins/woocommerce/includes/data-stores/class-wc-customer-data-store-session.php on line 119
    /wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php on line 158
    /wp-includes/class-wp-recovery-mode.php on line 367
    /wp-includes/class-wp-hook.php on line 85
    /wp-includes/class-wp-hook.php on line 97
    /wp-includes/functions.php on line 650
    /wp-includes/functions.php on line 4329
    /wp-includes/load.php on line 412
    /wp-includes/option.php on line 204
    /wp-includes/plugin.php on line 173

    Any ideas?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there @asolutions101,

    Thanks for reaching out.

    It is possible the PHP Memory Exhausted error you’re experiencing is due to the large number of shipping methods in a Zone. Dealing with complex shipping setups, like yours, can lead to memory issues and slow site speeds.

    However, increasing the WP_MEMORY_LIMIT can help to some extent, but as you’ve noticed, it does not fully resolve the issue nor speed up the process.

    Here are a few suggestions that you might try to see if they make any difference:

    1. Try to simplify your shipping setup if possible. Having 50 methods/instances available in the zone could be causing the system to overload.
    2. Consider using a shipping plugin that allows you to manage complex shipping scenarios more efficiently.
    3. Run a conflict test to check if there’s a plugin or theme conflict by disabling all plugins, leaving only WooCommerce and a default theme.

    Lest us know if you still need further assistance on this, and we’ll be happy to help.

    Thread Starter Acoustical Solutions

    (@asolutions101)

    Here’s the ironic part…we did simplify it. A lot. In the past, we had twice as many methods in a zone because we presented residential and commercial rates to our customers. We have since streamlined that. For many years, it worked well.

    These issues began when we updated from Woo 8.3 to 8.8 and simultaneously updated the UPS plugin to 3.4 to 3.6. We are forced to use the more recent UPS plugin due to UPS authentication changes. Testing with Storefront, Woo, and UPS alone was not fruitful.

    We also discovered during our testing that a rate is requested through each instance of a shipping method in a zone. For example if there are 10 instances of UPS set up in the zone by origin zip code, the method in Cart will return all 10 rates. While there are plugins available that will hide the rates conditionally, they do so after the requests, so it only masks any issues. The problem is most evident when a carrier API like Old Dominion or Estes takes 3–8 seconds to return a rate (times how ever many instances are enabled).

    That seems…inefficient. So, there needs to be a way to assign a shipping class directly to a method instance and only request rates from that instance. We tried the old Mike Jolley “bulky package” code, but ‘ship_via’ => ‘ups’ appears to be limited the parent method rather than instances (e.g. ‘ups:318’). Unless someone knows correct syntax that would work…

    We are considering ShipperHQ as a full replacement but having to spend nearly $10k per year for it is not a thrilling prospect.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Acoustical Solutions

    Thank you for your reply.

    May I ask which UPS plugin are you using?
    Also, could you tell me which web hosting are you using?
    Tell me the exact plan/package you have for your site.

    I am trying to understand if it is possible to resolve this issue by allocating more server resources.
    Another possibility is that the UPS plugin is not designed to handle that many instances.
    Have you asked this question from about the UPS plugin support?

    It would be helpful if you could share your site’s System Status Report.
    You can find it via WooCommerce > Status.
    Select Get system report and then Copy for support.

    Once you’ve done that, you can paste the text in https://gist.github.com
    After that, you can paste the Gist link here in your reply.

    Looking forward to your response. ??

    Best regards.

    Thread Starter Acoustical Solutions

    (@asolutions101)

    Zubair,

    We are using the standard WooCommerce UPS Shipping plugin from Woo.
    Host = Kinsta, Custom Enterprise plan.

    Before I post anything to GitHub I am doing some additional testing on a resource-constrained staging site that is running the last setup that worked. This was UPS 3.4.2 and Woo 8.8.2. On that setup, when I change destinations it takes approx. 4 seconds to refresh. I am currently adding dozens of items to cart to see if I can trigger the memory error.

    My next step is to update the staging site Woo to 8.9.2 and test, then roll UPS forward to a more recent version and see which version (if any) breaks. It may be possible to narrow in on the issue at that point if it is caused by the UPS plugin.

    I will update this when I have time.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @asolutions101,

    Thanks for the additional details. Please try everything in the latest version first, I see the UPS plugin is currently at version 3.6.4, for instance!

    If you still have issues after updating, kindly open a new ticket in our internal ticketing system. Since this relates to a premium extension, please get in touch with us directly via [Woo.com → My Account → Support] for further help with this.

    You may need to log in to the account used to purchase the extension before you can access that page. As per the [forum guidelines], no support for premium extensions is provided here, but we will be happy to assist you further from there.

    Thanks!
    -OP

    Thread Starter Acoustical Solutions

    (@asolutions101)

    After more testing we have determined that it is most likely the UPS plugin. Our next step is to contact support for that plugin to see if we can obtain different archived versions from 3.4.3 to 3.6.3 and step through those to see which version breaks our setup.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Out of Memory Error with Many Shipping Methods in a Zone’ is closed to new replies.