Search code examples
wordpresswoocommercewoocommerce-rest-api

PHP Fatal error: Uncaught Error: Class "WC_Legacy_API" not found


Wordpress error after upgrading woocommerce plugin version to 9.0.0, see error details below

PHP Fatal error: Uncaught Error: Class "WC_Legacy_API" not found in /home/dettrart/public_html/wp-content/plugins/woocommerce/includes/class-wc-api.php:19

I found the details in the cpanel error log file.


Solution

  • There are two solutions to this;

    1- Rollback the woocommerce plugin to v8.9.3

    2- Follow the steps below to reinstall the plugin manually:

    i- Delete the woocommerce plugin folder in plugin directory using file manager in your cpanel

    ii- Download the plugin zip from the wordpress official plugin site

    iii- Upload the zip file to your plugin directory in cpanel and extract the file.