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!
Completed
Last updated: February 13, 2023
Log in to comment on this feature request.
Hey there,
Thank you for reporting this!
The issue has been resolved in v2.0.5, which is now available for download/update!