Bug

WordPress 5.5 & WooCommerce 4.4 Bugs?

It seems that WordPress and WooCommerce updates over the past week have been challenging for thousands of sites. Challenging is a kinder way of saying these updates seem to be breaking things.

The good news is that most of the site-breaking issues are related to code that has been deprecated — that is made obsolete (and sometimes removed) and/or replaced with something newer. Read on for a temporary fix for several problems we’ve encountered.

WordPress 5.5 Changes

WordPress 5.5 was officially released on August 11, 2020 and it was not just another simple update. It should be considered a major update. As a major update, that means it contains significant change from previous versions.

Rather than go over a big list of what changed in WordPress 5.5, please see the following:

jQuery Migrate Library Removal

Perhaps the biggest change affecting most sites negatively is that the jQuery Migrate library was removed from WordPress. This seemed to impact some features within the Classic Editor and the Yoast SEO plugin for one of our clients. A temporary fix, however, was to add the jQuery Migrate library back with the Enable jQuery Migrate Helper plugin. A long-term solution, though, is for developers to update their themes, plugins, and code (don’t forget to remove Enable jQuery Migrate Helper when no longer needed).

WooCommerce 4.4.x Changes

It seems that WooCommerce 4.4 required at least a handful of plugin developers to quickly work on a solution since version 4.4 added some new filters and a new action, among other changes. It was supposed to be fully backward compatible with the previous WooCommerce 4.3.3 but that didn’t seem to be the case for everyone (more below). For more details about the changes in this latest release, see the official WooCommerce 4.4 announcement.

While officially a minor release, from some of the chatter on WooCommerce’s support forum, it had what seems to be several unintended consequences that broke quite a few WooCommerce sites or functions within those sites. WooCommerce 4.4.0 was released on August 18 and followed by 4.4.1 the very next day to address two issues that were causing conflicts (see the WooCommerce Changelog for details).

Tip: As a general rule, especially for something as critical as an e-commerce site, it’s often wise to wait until the x.x.1 version has been released at a minimum before upgrading. In any case, don’t upgrade without a good backup and recovery plan in place.

Before Upgrading from WooCommerce 4.3.3

We are aware of at least two problems that can occur when moving from WooComerce 4.3.3 to what is now version 4.4.1 (as noted above, we did not recommend upgrading to 4.4.0).

WP Rocket

WP Rocket is one of the most popular caching plugins in the world. On the day WooCommerce 4.4.0 was released, they sent the following alert via email:

WooCommerce just released a new version (4.4.0) which is breaking themes and plugins, including WP Rocket.

We just released a new version 3.6.4 to avoid the conflict.

We recommend to all our users to update to WP Rocket 3.6.4 before updating WooCommerce.

If you have already deactivated WP Rocket we suggest temporarily deactivating WooCommerce in order to reactivate and update WP Rocket (WP Rocket needs to be active in order to receive the update notification).

Alternatively you may:

In short, if you use WP Rocket, be sure to upgrade to version 3.6.4 or greater before upgrading to WooCommerce 4.4.x from any previous version.

Relevanssi

Since the default search feature within WordPress is less than ideal for advanced queries, many e-commerce sites rely on search enhancement plugins. One such search plugin is Relevanssi.

The current version of Relevanssi (2.10.0), however, does not work with WooCommerce 4.4.0 or 4.4.1 as we learned the hard way. In fact, a query will find zero search results. You can learn why but in short, it’s due to changes introduced into WooCommerce 4.4. Fortunately there is a temporary fix. [Please see the Post Changelog below since this problem is resolved in the latest Relevanssi release.]

The following line of code needs to be added to your theme’s functions.php file to allow Relevanssi to perform properly. The developer has stated that the next version of Relevanssi will include a fix.

add_action( 'woocommerce_before_shop_loop', 'relevanssi_wc_reset_loop' );
function relevanssi_wc_reset_loop() {
	global $wp_query;
	if ( $wp_query->is_search ) {
		wc_reset_loop();
	}
}

Adding code snippets like the one above to the theme file is scary for many. Thankfully, there is a quick and simple way to do so. The Code Snippets plugin helps you complete this task in just a few seconds. Remember, however, that this code addition above is only needed until the next version of Relevanssi is released so be sure to remove this snippet after the update (and at least deactivate Code Snippets if not being used for another code snippet).

In Conclusion

WordPress and WooCommerce upgrades can be challenging under the best of circumstances but these last two have probably been more problematic than most of the ones we’ve seen over the past few years. Challenges like this are yet another reason why one must have a sound backup and recovery system in place. Ideally, your recovery solution would allow a rollback of just the cantankerous plugin.

We may update this space with additional news about WordPress 5.5 and WooCommerce 4.4.x as other problems come across our radar screen. Please note that we have deployed all the above fixes and found them to be reliable and to address the problems encountered.

Post Changlelog

  • 20-Aug-2020 – Original post published.
  • 21-Aug-2020 – Added link to Search Engine Journal article.
  • 26-Aug-2020 – Updated Relevanssi code fix per developer recommendations. Please note that this Relevanssi fix is no longer necessary with the release of Relevanssi Premium 2.10.1 and Relevanssi free 4.8.1.
  • 27-Aug-2020 – Added the basic 5.5 overview on SiteGround written by Francesca Marano since it’s a great post and she is on three WordPress teams (including Core). Also added the WordPress 5.5 Field Guide.

Leave a Comment

Your email address will not be published. Required fields are marked *