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

Open

Last updated: February 13, 2023

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.