Square Site Banner | Q3 2025

Product Icon

Conditional Shipping and Payments for WooCommerce

Use conditional logic to restrict the shipping and payment options available on your store.

Feedback: A blank entry in the shipping restrictions causes an error and CPU race condition

A hosting client took down an entire server today because they had an extra “|” on the end of their shipping restrictions list in effect creating a blank entry.

The error in the logs was
PHP Warning: strpos(): Empty needle in /public_html/wp-content/plugins/woocommerce-conditional-shipping-and-payments/includes/restrictions/class-wc-csp-restrict-shipping-methods.php on line 712

This seemed to cause a CPU race condition and the client opening multiple orders at once in multiple tabs caused a 12-core server to stop responding.

The fix is to trim the array before processing so the needle is not empty – or clean the input on save.

Thanks!

Author

H van der Nol

Current Status

Completed

Last updated: February 13, 2023

1 comment

Log in to comment on this feature request.

  1. jaskyt8 says:
    Product developer February 11, 2025 8:49 am

    Hey there,

    Thank you for reporting this!

    The issue has been resolved in v2.0.5, which is now available for download/update!