WordPress WooCommerce Bug Causing Sites To Crash


A WordPress bug is causing WooCommerce sites to display a fatal error, crashing ecommerce sites. The problem originates from a single line of code. A workaround has been created. The WooCommerce team is aware of the issue and is working on issuing a permanent fix in the form of a patch.

WooCommerce Sites Crashing

Someone posted about the error at the WordPress.org support forums and others with the same problem replied that they were experiencing the same thing. Most of those responding reported that they had not recently done anything to their sites, that they had crashed all of a sudden.

The person who initially reported the bug offered a workaround for getting websites back up and running, an edit of a single line of code in the BlockPatterns.php file, which is a WooCommerce file.

The file is located here:

wp-content/plugins/woocommerce/src/Blocks/BlockPatterns.php

Others reported receiving the same fatal error message:

“Uncaught Error: strpos(): Argument #1 ($haystack) must be of type string, null given in /var/www/site/data/www/site.com.br/wp-content/plugins/woocommerce/src/Blocks/BlockPatterns.php on line 251”

One of the commenters on the discussion posted:

“Same issue here.

It occurred in version 9.8.2, and upgrading to 9.8.3 didn’t resolve it. Downgrading to 9.7.1 didn’t help either.

The problem happened without any interaction with plugins or recent updates. Replacing the code at line 251 worked as a temporary workaround.

We’ll need to find a more stable solution until the WooCommerce team releases an official patch.”

Others reported that they received the error after updating their plugins but that rolling back the update didn’t solve the problem, while others reported that they hadn’t done anything prior to experiencing the crash.

Someone from WooCommerce support responded to say that the WooCommerce team is aware of the problem and are working to address it:

“Thank you for reporting this. It’s a known issue, and a temporary workaround has been shared here: https://github.com/woocommerce/woocommerce/issues/57760#issuecomment-2854510504

You can track progress and updates on the GitHub thread: https://github.com/woocommerce/woocommerce/issues/57760, as the team is aware and actively addressing it.”

Discussion On GitHub

The official WooCommerce GitHub repository has this note:

“Some sites might see a fatal error around class BlockPatterns.php, with the website not loading. This was due a bad response from Woo pattern repository. A fix was deployed to the repository but certain sites might still have a bad cache value.”

They also wrote:

“The issue has been fixed from the cache source side but certain sites were left with a bad cache value, we will be releasing patch updates to fix that.”

Featured Image by Shutterstock/Kues



Source link

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

We Know You Better!
Subscribe To Our Newsletter
Be the first to get latest updates and
exclusive content straight to your email inbox.
Yes, I want to receive updates
No Thanks!
close-link

Subscribe to our newsletter

Sign-up to get the latest marketing tips straight to your inbox.
SUBSCRIBE!
Give it a try, you can unsubscribe anytime.