Fatal error when WooCommerce is unavailable

[ad_1]

Hi, I noticed that when (for whatever reason) WooCommerce is not available, both admin and front-end become inaccessible. The following fatal error appears in debug.log

[27-Aug-2024 00:06:38 UTC] PHP Fatal error:  Uncaught Error: Class "WC_Shipping_Method" not found in /home/XXX/public_html/wp-content/plugins/flexible-shipping/classes/table-rate/flexible-shipping-settings.php:21

This happened to me after a failed automatic update that somehow completely removed WooCommerce. It took me a while to discover that it was the missing (but otherwise marked as activate) WooCommerce plugin that was the root cause of the fatal error πŸ˜‰

Might be a good idea to check for WC core class before loading any Flexible Shipping modules?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer