Back to Community

Resolving the WooCommerce Legacy REST API v1.0.2 Critical Error

25 threads Sep 16, 2025 PluginWoocommerce legacy rest api

Content

Many users recently encountered a critical error after updating the WooCommerce Legacy REST API plugin to version 1.0.2. This issue caused a fatal PHP error that could bring an entire site to a halt, displaying a 'White Screen of Death' or a critical error message. This guide explains the cause of the problem and provides the most effective solutions to get your site back online.

What Caused the Error?

The error was triggered by a coding oversight in the plugin's version 1.0.2. A specific method, hpos_is_enabled(), was defined as a non-static function but was being called statically from within the plugin's code. This mismatch caused a fatal PHP error, as the language does not allow non-static methods to be called in a static context. The error typically appeared on line 77 of the class-wc-legacy-rest-api-plugin.php file.

How to Fix the WooCommerce Legacy REST API v1.0.2 Critical Error

Solution 1: Update the Plugin (Recommended)

The 'WooCommerce Legacy REST API' team quickly addressed this issue by releasing patched versions. The most straightforward and recommended solution is to ensure your plugin is updated to the latest version.

  1. If your site is accessible, navigate to Plugins → Installed Plugins.
  2. Check if an update is available for the WooCommerce Legacy REST API plugin.
  3. Update it to version 1.0.3 or later.

If your site is down due to the error, you may need to manually update the plugin via FTP/SFTP or your hosting provider's file manager.

Solution 2: Manual Code Edit (If You Cannot Update Immediately)

For users who needed an immediate fix before the update was available, a manual code edit was a successful workaround. Warning: Editing plugin core files is generally not recommended, as changes can be overwritten by future updates. Use this method only if you cannot update and remember to revert your changes after a proper update.

The fix involves modifying two lines in the file:
/wp-content/plugins/woocommerce-legacy-rest-api/includes/class-wc-legacy-rest-api-plugin.php

  1. Access your site's files via FTP/SFTP or your host's file manager.
  2. Navigate to the plugin's includes directory and open the class-wc-legacy-rest-api-plugin.php file.
  3. On or around line 102, change:
    private function hpos_is_enabled(): bool {
    to:
    private static function hpos_is_enabled(): bool {
  4. On or around line 111, change:
    self::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
    to:
    WC_Admin_Notices::remove_notice( 'legacy_rest_api_is_incompatible_with_hpos' );
  5. Save the file and upload it back to your server, overwriting the old one.

This manual edit resolves the static method call error and corrects a subsequent undefined function error, restoring site functionality.

Solution 3: Roll Back to a Previous Version

Another temporary solution is to downgrade the plugin to a version before 1.0.2, such as 1.0.1. You can often download previous versions from the Advanced View on the plugin's WordPress.org page. After downloading, manually replace the plugin folder via FTP/SFTP. Remember that this is a temporary measure, and you should plan to update to the latest, stable version as soon as possible.

Preventing Future Issues

To avoid similar problems in the future, it is considered a best practice to maintain a staging environment. A staging site is a clone of your live website where you can safely test plugin and theme updates before applying them to your production site. This allows you to catch and resolve conflicts or errors without affecting your visitors.

If you continue to experience issues after trying these steps, it can be helpful to search for or create a thread on community support forums, detailing your specific error message and the steps you have already taken.

Related Support Threads Support