Title: plugin breaks wp-cli plugin commands
Last modified: July 6, 2020

---

# plugin breaks wp-cli plugin commands

 *  Resolved [roms981](https://wordpress.org/support/users/roms981/)
 * (@roms981)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-breaks-wp-cli-plugin-commands/)
 * The admin-menu-editor plugin seems to break [WP CLI](https://wp-cli.org/) 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 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Janis Elsts](https://wordpress.org/support/users/whiteshadow/)
 * (@whiteshadow)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-breaks-wp-cli-plugin-commands/#post-13077758)
 * Thank you for the report! Hmm, I thought I had already fixed this issue in the
   past and I can’t reproduce it on my own sites. Could you please try that again
   with the [development version](https://downloads.wordpress.org/plugin/admin-menu-editor.zip)
   of the plugin?
 *  Thread Starter [roms981](https://wordpress.org/support/users/roms981/)
 * (@roms981)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-breaks-wp-cli-plugin-commands/#post-13085060)
 * thank you, it works. sorry, for the confusion, but somehow wordpress didn’t recognize
   that an update for `admin-menu-editor pro` is available.
 * Using the latest version fixed the problem.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘plugin breaks wp-cli plugin commands’ is closed to new replies.

 * ![](https://ps.w.org/admin-menu-editor/assets/icon-128x128.png?rev=1418604)
 * [Admin Menu Editor](https://wordpress.org/plugins/admin-menu-editor/)
 * [Support Threads](https://wordpress.org/support/plugin/admin-menu-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/admin-menu-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/admin-menu-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/admin-menu-editor/reviews/)

## Tags

 * [wpcli](https://wordpress.org/support/topic-tag/wpcli/)

 * 2 replies
 * 2 participants
 * Last reply from: [roms981](https://wordpress.org/support/users/roms981/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-breaks-wp-cli-plugin-commands/#post-13085060)
 * Status: resolved