Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed JSON Output - Error on plugin update #161

Open
eckelarsson opened this issue Mar 26, 2019 · 2 comments
Open

Malformed JSON Output - Error on plugin update #161

eckelarsson opened this issue Mar 26, 2019 · 2 comments

Comments

@eckelarsson
Copy link

eckelarsson commented Mar 26, 2019

Hello,

When running wp plugin update --all --format=jsonand there is an error with updating a plugin the output is.

[{"name":"advanced-custom-fields-pro","old_version":"5.3.5","new_version":"5.7.13","status":"Error"},{"name":"wordpress-seo","old_version":"10.0","new_version":"10.0.1","status":"Updated"}]Error: Only updated 1 of 2 plugins.

The error is outside of the JSON format, should not be a mixed output.

Sysinfo

OS: Linux 4.4.0-127-generic #153-Ubuntu SMP
Shell:
PHP binary: /usr/bin/php7
PHP version: 7.2.13
php.ini used: /etc/php7/php.ini
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /var/www/html
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.1.0

@ernilambar
Copy link
Member

This issue is still valid. I can reproduce this error in WP CLI 2.10 and WP 6.5.

wp plugin update --all --format=json

Output:

[{"name":"advanced-custom-fields-pro","old_version":"6.2.7","new_version":"6.2.9","status":"Error"}]Error: No plugins updated (1 failed).

@ernilambar
Copy link
Member

I dug down a little and found that we have implemented Quiet logger for format with json and csv.

$logger = new Loggers\Quiet( WP_CLI::get_runner()->in_color() );
WP_CLI::set_logger( $logger );

But this https://github.com/wp-cli/wp-cli/blob/main/php/WP_CLI/Loggers/Quiet.php logger still produce output for error(). May be we need more quieter logger or something which will completely silence the output in error() also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants