wp cli - WP CLI not finding plugin commands

admin2025-01-07  8

On a Ubuntu 20.04 Linode I have a Wordpress installation. I deploy the website using , a Capistrano deployment tool. When the website is deployed the folder structure is like this:

  • current folder points to the actual release (virtual host points to this folder)
  • inside of current there are:
  • wordpress folder with all the Wordpress core files
  • and the content folder which is wp-content renamed and contains plugins, themes, uploads

On my wp-config.php file are defined:

  • define('WP_CONTENT_URL', '');
  • define('WP_SITEURL','');

WP CLI is installed and it works with its own basic commands. The deployment is not a problem and it works using WP CLI commands.

The problem arises when I try to use WP CLI commands defined by plugins I have installed, like WP All Import. The error I get is:

Error: 'all-import' is not a registered wp command. See 'wp help' for available commands.

Running wp help it doesn't list any plugin command. Instead, on my computer, it lists all the commands.

I guess is due to the different folder structure but I'm not able to find a solution. I need to be able to run for example wp all-import run ID to run imports from the command line since they're way faster and I have 90k products to edit.

On a Ubuntu 20.04 Linode I have a Wordpress installation. I deploy the website using https://github.com/Mixd/wp-deploy, a Capistrano deployment tool. When the website is deployed the folder structure is like this:

  • current folder points to the actual release (virtual host points to this folder)
  • inside of current there are:
  • wordpress folder with all the Wordpress core files
  • and the content folder which is wp-content renamed and contains plugins, themes, uploads

On my wp-config.php file are defined:

  • define('WP_CONTENT_URL', 'https://website.com/content');
  • define('WP_SITEURL','https://website.com/wordpress');

WP CLI is installed and it works with its own basic commands. The deployment is not a problem and it works using WP CLI commands.

The problem arises when I try to use WP CLI commands defined by plugins I have installed, like WP All Import. The error I get is:

Error: 'all-import' is not a registered wp command. See 'wp help' for available commands.

Running wp help it doesn't list any plugin command. Instead, on my computer, it lists all the commands.

I guess is due to the different folder structure but I'm not able to find a solution. I need to be able to run for example wp all-import run ID to run imports from the command line since they're way faster and I have 90k products to edit.

Share Improve this question asked Nov 9, 2021 at 18:42 Roberto CinettoRoberto Cinetto 111 silver badge3 bronze badges 3
  • What does wp plugin path give you? – vancoder Commented Nov 9, 2021 at 22:54
  • From inside current, wordpress, and content it gives /plugins path – Roberto Cinetto Commented Nov 10, 2021 at 2:13
  • The only solution I found to fix this right now is to define WP_CONTENT_DIR constant in wp-config.php as a absolute path without using dirname(__FILE__) or $_SERVER['DOCUMENT_ROOT']. Is it a bad practice? Can this be a harm to the installation? – Roberto Cinetto Commented Nov 10, 2021 at 17:24
Add a comment  | 

1 Answer 1

Reset to default 0

Please see WP-CLI r2.0 release blog post , for normal use with all commands remove wp-cli/wp-cli and require wp-cli/wp-cli-bundle

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736254236a188.html

最新回复(0)