• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Update WP CLI version on Plesk ext wp-toolkit --wp-cli to work with LSCache

Alnaggar

New Pleskian
Hello, I'm trying to use LSCache plugin with their wp cli commands but I get this error in every command (example):

Code:
plesk ext wp-toolkit --wp-cli -instance-id 2 -- litespeed-option all
"Error: 'litespeed-option' is not a registered wp command. See 'wp help' for available commands."

LSCache WP CLI commands

I think it's because the WP CLI version it's not updated it's currently v 2.4.0 and the latest version is 2.5.0, I tried to update it with the command:
Code:
plesk ext wp-toolkit --wp-cli -instance-id 2 -- cli update
and it gave me this error:
"Error: You can only self-update Phar files."

I'm managing a lot of sites and all of them using LSCache plugin and I really need to be able to manage the plugin setting with WP CLI commands LSCache WP CLI commands.
Is it a version issue or do I need to do anything else to make LSCache wp cli commands work?
 
Try to add --skip-plugins=false at the end of your command:

# plesk ext wp-toolkit --wp-cli -instance-id 2 -- litespeed-option all --skip-plugins=false

I hope it will help.
 
Try to add --skip-plugins=false at the end of your command:

# plesk ext wp-toolkit --wp-cli -instance-id 2 -- litespeed-option all --skip-plugins=false

I hope it will help.

From the bottom of my heart, thank you so much. It works perfectly.

Is it possible to make "--skip-plugins=false" the default when running wp cli commands, without needing to append it to each command?

Another thing is how can I update the WP-CLI to v2.5.0 manually? It has many improvements, I think WP Toolkit should update it automatically as WP CLi is so important when you dealing with a lot of sites or with automation scripts like in my case.
 
how can I update the WP-CLI to v2.5.0 manually
You can install and run the official WP-CLI from the document root directory of your WordPress instance. Do the following:

1) Go to the document root of your WP instance:
Code:
# cd /var/www/vhosts/example.com/httpdocs

2) Download wp-cli from the official site and check that it is working:
Code:
# curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# php wp-cli.phar --info

3) Make the wp-cli.phar file executable and available as wp command:
Code:
# chmod +x wp-cli.phar
# mv wp-cli.phar /usr/local/bin/wp

4) Run the desired command as you would in a regular (non-Plesk) WP-CLI.

Note: If you come across errors like -bash: php: command not found, add /opt/plesk/php/X.X/bin to $PATH, where X.X is your PHP version. For example:
Code:
export PATH=/opt/plesk/php/7.4/bin/:$PATH
 
Thank you so much for your explanation, It worked fine. I just hope they will update it soon or at least make a command to do that.
 
Hey there @Alnaggar, yesterday we've released WordPress Toolkit v5.6 that includes wp-cli updated to v2.5. Hope this helps!
 
Back
Top