• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Question Is there a way to use the Woocommerce command line tools ('wp wc') with plesk ext wp-toolkit --wp-cli

wolfatadfilm

New Pleskian
There are a couple of tools that are helpful to run as a cron job, e.g. I could just run
wp wc tool run regenerate_product_lookup_tables

I know that each tool has a REST API equivalent but to run them a POST request is needed, so this doesn't work with CRON.
Do I need to write a script just to do such a simple call or is there a way to bind the wc commands into
plesk ext wp-toolkit --wp-cli ?
 
A surprisingly high number of users have viewed this question, but no answer so far, so I will just post the code for the quick script I put together. Maybe someone else finds it useful:

<?php require __DIR__ . '/vendor/autoload.php'; use Automattic\WooCommerce\Client; $woocommerce = new Client( 'https://your_server.com', 'ck_clientkey', 'cs_clientsecret', [ 'wp_api' => true, 'version' => 'wc/v3' ] ); print_r($woocommerce->put('system_status/tools/regenerate_product_lookup_tables',[])); ?>
Of course you need to
composer require automattic/woocommerce
and adapt the path and REST API auth credentials.
 
Back
Top