Closed gonzad26 closed 6 years ago
Hi @gonzad26,
Could you share more details on how to reproduce? Our bug reporting guidelines are a good guide to the level of detail we're looking for.
Yes of course. Sorry for the short message.
I'm currently running the following command:
wp-cli.phar --path /home/wordpress/public_html/ plugin list --fields=name,status,update,version,title,description,update_version --format=json
and it's output is empty, but if run:
wp-cli.phar --path /home/wordpress/public_html/ plugin list --fields=name,status,update,version,title,description,update_version --format=yaml
It's output is the following:
name: twentysixteen status: inactive update: available version: "1.3" title: Twenty Sixteen description: | Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. update_version: "1.4"
Do you know why you get theme output when you run wp plugin list
?
Sorry, my bad. I was trying with themes too. With themes i dont have this problem with json output.
This is the output of plugin list in yaml
status: active update: none version: "1.2" title: WP CLI Login Command Server description: Companion plugin to the WP-CLI Login Command update_version: null
@gonzad26 It looks like your YAML data is broken too:
It's hard to say what the problem might be without being able to reproduce, but it seems like it's tied to a specific plugin. If this is a production environment, I'd suggest creating a second environment for testing, and installing each plugin separately to see if it might be caused by one.
Right! I've tried with a fresh install and it worked good. The plugin that break the json output is WP CLI Login Command Server
Anyway, using yaml output format, i dont have any problem with the sintax of the output to parse it.
I tried installing WP-CLI Login Command Server:
wp plugin install https://github.com/aaemnnosttv/wp-cli-login-server/archive/master.zip
Downloading installation package from https://github.com/aaemnnosttv/wp-cli-login-server/archive/master.zip...
Unpacking the package...
Installing the plugin...
Renamed Github-based project from 'wp-cli-login-server-master' to 'wp-cli-login-server'.
Plugin installed successfully.
Success: Installed 1 of 1 plugins
I'm unable to reproduce the broken JSON issue:
wp plugin list --format=json --fields=name,status,update,version,title,description,update_version
[{"name":"application-passwords","status":"inactive","update":"none","version":"0.1-dev","title":"Application Passwords","description":"A prototype framework to add application passwords to core.","update_version":null},{"name":"gutenberg","status":"active","update":"available","version":"2.1.0","title":"Gutenberg","description":"Printing since 1440. This is the development plugin for the new block\neditor in core.","update_version":"2.3.0"},{"name":"hello","status":"inactive","update":"none","version":"1.6","title":"Hello Dolly","description":"This is not just a plugin, it symbolizes the hope and enthusiasm of an\nentire generation summed up in two words sung most famously by Louis\nArmstrong: Hello, Dolly. When activated you will randomly see a lyric from\n<cite>Hello, Dolly<\/cite> in the upper right of your admin screen on every\npage.","update_version":null},{"name":"post-content-link-filter","status":"inactive","update":"none","version":"0.1.0-alpha","title":"Post Content Link Filter","description":"Process content for its links and allow transformation with a filter.","update_version":null},{"name":"sample-plugin","status":"inactive","update":"none","version":"0.1.0","title":"Sample Plugin","description":"PLUGIN DESCRIPTION HERE","update_version":null},{"name":"sensei","status":"inactive","update":"none","version":"1.9.19","title":"Sensei","description":"A course management plugin that offers the smoothest platform for helping\nyou teach anything.","update_version":null},{"name":"user-switching","status":"inactive","update":"available","version":"1.0.8","title":"User Switching","description":"Instant switching between user accounts in WordPress","update_version":"1.3.0"},{"name":"wp-cli-login-server","status":"inactive","update":"none","version":"1.2","title":"WP CLI Login Command Server","description":"Companion plugin to the WP-CLI Login Command","update_version":null},{"name":"wp-saml-auth","status":"inactive","update":"available","version":"0.3.3","title":"WP SAML Auth","description":"SAML authentication for WordPress, using SimpleSAMLphp.","update_version":"0.3.8"},{"name":"local","status":"must-use","update":"none","version":"","title":"","description":"","update_version":null}]
Are there other relevant details you can share to reproduce?
I cannot reproduce this either. @gonzad26 You'll have to pinpoint this further (or try reinstalling WP-CLI & packages).
I'm running the following command:
plugin list --fields=name,status,update,version,title,description,update_version --format=json
Its output is empty.If I use it with yaml or csv options, it works great.