The Legacy REST API plugin will be automatically installed in WooCommerce 8.8

Back in October 2023 we announced that the Legacy REST API will be removed from WooCommerce as of version 9.0, but for those who have not been able to transition to the more modern REST API based on the WordPress JSON API we have created an extension which allows you to continue using the WooCommerce Legacy REST API, available both at a dedicated GitHub repository and at the official plugins directory.

In the original announcement we hinted that we were exploring the possibility of automatically install the plugin as part of the upgrade to WooCommerce 9.0 on the appropriate sites (WooCommerce sites that have the Legacy REST API enabled or have legacy webhooks), finally we decided to do that but in advance of the actual Legacy REST API removal: the Legacy REST API plugin will be installed and activated as part of the upgrade to WooCommerce 8.8 or newer if the site has the Legacy REST API enabled or has legacy webhooks.

How can I tell if this affects me?

See the “How can I tell if this affects me?” section in the original announcement: if your site falls in the “This change affects you” category, then indeed, you’ll get the Legacy REST API plugin installed and activated automatically once you upgrade to WooCommerce 8.8.

There will be three clues that will make you notice that the plugin has been installed. First there will be a notification in your WordPress admin area:

You’ll also find two entries in the WooCommerce logs, under the plugin_auto_installs category:

And of course you’ll see the plugin listed in the WordPress plugins list, with a notice indicating that it was automatically installed:

If WooCommerce attempts to install the plugin but for some reason the process fails (or the plugin gets installed but not activated), you’ll also get an admin notice and a log entry with relevant information.

A note on multisite setups

In WordPress multisite installations plugins are installed network-wide (that is, all the individual sites get the same sets of plugins) but can be activated on a per-site basis. As such, once WooCommerce gets upgraded to version 8.8 in a multisite installation, and provided that at least one of the sites fulfills the conditions for the automatic install of the Legacy REST API plugin, it will get installed and visible on all the sites; but it will get activated only on the relevant sites. Thus in the rest of the sites it will remain inactive, being for all practical purposes as if it wasn’t there.

What if I don’t want the plugin to be automatically installed?

If your site has the Legacy REST API active or has webhooks that use the Legacy REST API payload format, but you don’t want the Legacy REST API plugin to be automatically installed, you have two options:

  1. Install the plugin manually yourself. You don’t need to activate it: just having it installed is enough. WooCommerce won’t try to activate the plugin if it has been installed manually.
  2. Or add the following snippet to your install (for example using the Code Snippets plugin):
add_filter('woocommerce_skip_legacy_rest_api_plugin_auto_install', '__return_true');

And yet another note for multisite setups:

  1. If you don’t want the plugin to be installed at all, your easiest option is to install it yourself and leave it inactive.
  2. If you only want to prevent the plugin from being activated in some sites, just add the snippet to the relevant sites.

What action should I take?

Unless you don’t want the plugin to be automatically installed, there’s nothing you need to do: WooCommerce will check if your site need the Legacy REST API plugin, and if so (and provided you haven’t installed it manually, and you aren’t using the woocommerce_skip_legacy_rest_api_plugin_auto_install filter), it will install and activate it.

And as a final reminder: the Legacy REST API plugin will do nothing as long as the Legacy REST API is still part of WooCommerce core, therefore it’s safe to have it installed and active before WooCommerce 9.0 rolls out, regardless of whether it gets installed manually or automatically.

Leave a Reply

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