Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

plugin breaks wp-cli plugin commands

$
0
0

Replies: 0

The admin-menu-editor plugin seems to break WP CLI plugin commands; or more specific, it does not allow WP CLI to access plugin information.

WP CLI is a command line tool which allows, among other things, to manage (list, install, activate, deactivate) plugins.

So wp plugin list should give a list of all plugins and their status

for example:

+———————————————+———-+———–+———+
| name | status | update | version |
+———————————————+———-+———–+———+
| admin-menu-editor-pro | active | available | 2.4.3 |
| advanced-custom-fields-pro | active | available | 5.8.2 |

But unfortunately, admin-menu-editor pro does restrict plugin information to users (admins, and so on). Since wp cli is not in the allowed users list, it does not get this information.

So wp plugin list with admin-menu-editor pro activated only returns a list of must-use plugins.

Long story short: admin-menu-editor pro should check in its isPluginVisible function, if WP CLI is requesting plugin information and and return true regardless of wp_get_current_user or users’ roles.

A short

if(DEFINED('WP_CLI') && DEFINED('WP_CLI_VERSION')){
  return true;
}

should be enough.

Thank you.


Viewing all articles
Browse latest Browse all 59525

Trending Articles