wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
90 stars 79 forks source link

Fix message on error in plugin activation #395

Closed ernilambar closed 9 months ago

ernilambar commented 9 months ago
wp plugin activate hello.php

When some plugin generates error while activation, output was shown like this.

Warning: Failed to activate plugin. Current PHP version (8.1.16) does not meet minimum requirements for Hello Dolly. The plugin requires PHP 9.0..
Success: Plugin already activated.

In this PR, above issue is fixed.

Output of wp plugin activate hello.php:

Warning: Failed to activate plugin. Current PHP version (7.4.33) does not meet minimum requirements for Hello Dolly. The plugin requires PHP 9.0..
Success: Activated 0 of 1 plugins (1 skipped).

Output of wp plugin activate hello.php disable-gutenberg:

Warning: Failed to activate plugin. Current PHP version (7.4.33) does not meet minimum requirements for Hello Dolly. The plugin requires PHP 9.0..
Plugin 'disable-gutenberg' activated.
Success: Activated 1 of 2 plugins (1 skipped).
ernilambar commented 9 months ago

This seems to affect in several places and could also create back compat issue. So first details discussions should be done. Closing for now.