Skip to content

Commit 5db7494

Browse files
committed
Deprecate plugin status and theme status commands
Mark `wp plugin status` and `wp theme status` as deprecated using the declarative `@deprecated` docblock tag (wp-cli/wp-cli#6343), pointing users at `wp plugin list` / `wp theme list` for the full listing and `wp plugin get` / `wp theme get` for a single item. The commands keep working and exit 0; the framework now emits a deprecation warning before running and surfaces it in `wp help`. Removal is planned for WP-CLI 4.0. Every `status` invocation now writes the warning to STDERR, so scripted Behat calls move from `When I run` to `When I try`, plus new scenarios assert the warning.
1 parent 437e645 commit 5db7494

7 files changed

Lines changed: 42 additions & 16 deletions

File tree

features/plugin-status.feature

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: List the status of plugins
88
<?php
99
"""
1010

11-
When I run `wp plugin status`
11+
When I try `wp plugin status`
1212
Then STDOUT should contain:
1313
"""
1414
D db-error.php
@@ -17,4 +17,13 @@ Feature: List the status of plugins
1717
"""
1818
D = Drop-In
1919
"""
20-
And STDERR should be empty
20+
21+
Scenario: Plugin status command is deprecated
22+
Given a WP install
23+
24+
When I try `wp plugin status`
25+
Then STDERR should contain:
26+
"""
27+
Warning: The `plugin status` command is deprecated. Use `wp plugin list` or `wp plugin get <plugin>` instead.
28+
"""
29+
And the return code should be 0

features/plugin-uninstall.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Feature: Uninstall a WordPress plugin
186186
Scenario: Uninstalling a plugin should remove its update info
187187
Given a WP install
188188
And I run `wp plugin install wordpress-importer --version=0.6`
189-
And I run `wp plugin status wordpress-importer`
189+
And I try `wp plugin status wordpress-importer`
190190

191191
And I run `wp transient get --network update_plugins`
192192
Then STDOUT should contain:

features/plugin-update.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Feature: Update WordPress plugins
6060
package from https://downloads.wordpress.org/plugin/wordpress-importer.0.5.zip...
6161
"""
6262

63-
When I run `wp plugin status wordpress-importer`
63+
When I try `wp plugin status wordpress-importer`
6464
Then STDOUT should contain:
6565
"""
6666
Update available
@@ -72,7 +72,7 @@ Feature: Update WordPress plugins
7272
wordpress-importer
7373
"""
7474

75-
When I run `wp plugin status wordpress-importer`
75+
When I try `wp plugin status wordpress-importer`
7676
Then STDOUT should contain:
7777
"""
7878
Update available

features/plugin.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Feature: Manage WordPress plugins
3838

3939
# Check that the inner-plugin is not picked up
4040
When I run `mv {PLUGIN_DIR}/plugin1 {PLUGIN_DIR}/Zombieland/`
41-
And I run `wp plugin status Zombieland`
41+
And I try `wp plugin status Zombieland`
4242
Then STDOUT should contain:
4343
"""
4444
Plugin Zombieland details:
@@ -52,13 +52,13 @@ Feature: Manage WordPress plugins
5252
When I run `wp plugin activate Zombieland`
5353
Then STDOUT should not be empty
5454

55-
When I run `wp plugin status Zombieland`
55+
When I try `wp plugin status Zombieland`
5656
Then STDOUT should contain:
5757
"""
5858
Status: Active
5959
"""
6060

61-
When I run `wp plugin status`
61+
When I try `wp plugin status`
6262
Then STDOUT should not be empty
6363

6464
When I run `wp plugin list --fields=name,status,update,version,update_version,auto_update`
@@ -198,7 +198,7 @@ Feature: Manage WordPress plugins
198198
Success: Activated 1 of 1 plugins.
199199
"""
200200

201-
When I run `wp plugin status network-only`
201+
When I try `wp plugin status network-only`
202202
Then STDOUT should contain:
203203
"""
204204
Status: Active
@@ -220,7 +220,7 @@ Feature: Manage WordPress plugins
220220
Success: Activated 1 of 1 plugins.
221221
"""
222222

223-
When I run `wp plugin status network-only`
223+
When I try `wp plugin status network-only`
224224
Then STDOUT should contain:
225225
"""
226226
Status: Network Active

features/theme.feature

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
Feature: Manage WordPress themes
22

3+
Scenario: Theme status command is deprecated
4+
Given a WP install
5+
6+
When I try `wp theme status`
7+
Then STDERR should contain:
8+
"""
9+
Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
10+
"""
11+
And the return code should be 0
12+
313
Scenario: Installing and deleting theme
414
Given a WP install
515
And I run `wp theme delete --all --force`
@@ -8,7 +18,7 @@ Feature: Manage WordPress themes
818
When I run `wp theme install twentytwelve`
919
Then STDOUT should not be empty
1020

11-
When I run `wp theme status twentytwelve`
21+
When I try `wp theme status twentytwelve`
1222
Then STDOUT should contain:
1323
"""
1424
Theme twentytwelve details:
@@ -64,7 +74,7 @@ Feature: Manage WordPress themes
6474

6575
When I run `wp theme install classic --activate`
6676
And I run `wp theme list --field=name --status=inactive | xargs wp theme delete`
67-
And I run `wp theme status`
77+
And I try `wp theme status`
6878
Then STDOUT should be:
6979
"""
7080
1 installed theme:
@@ -155,7 +165,7 @@ Feature: Manage WordPress themes
155165
Success: Deleted
156166
"""
157167

158-
When I run `wp theme status twentytwelve`
168+
When I try `wp theme status twentytwelve`
159169
Then STDOUT should contain:
160170
"""
161171
Update available
@@ -167,7 +177,7 @@ Feature: Manage WordPress themes
167177
twentytwelve
168178
"""
169179

170-
When I run `wp theme status twentytwelve`
180+
When I try `wp theme status twentytwelve`
171181
Then STDOUT should contain:
172182
"""
173183
Update available
@@ -558,12 +568,15 @@ Feature: Manage WordPress themes
558568
This theme requires a parent theme. Checking if it is installed
559569
"""
560570

561-
When I run `wp theme status moina`
571+
When I try `wp theme status moina`
562572
Then STDOUT should contain:
563573
"""
564574
Theme moina details:
565575
"""
566-
And STDERR should be empty
576+
And STDERR should contain:
577+
"""
578+
Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
579+
"""
567580

568581
Scenario: Get status field in theme detail
569582
Given a WP install

src/Plugin_Command.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ protected function get_upgrader_class( $force ) {
109109
* Version: 20160523.1
110110
* Author: Otto42, pross
111111
* Description: A simple and easy way to test your theme for all the latest WordPress standards and practices. A great theme development tool!
112+
*
113+
* @deprecated Use `wp plugin list` or `wp plugin get <plugin>` instead.
112114
*/
113115
public function status( $args ) {
114116
parent::status( $args );

src/Theme_Command.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ protected function get_upgrader_class( $force ) {
9696
* Status: Inactive
9797
* Version: 1.2
9898
* Author: the WordPress team
99+
*
100+
* @deprecated Use `wp theme list` or `wp theme get <theme>` instead.
99101
*/
100102
public function status( $args ) {
101103
if ( isset( $args[0] ) ) {

0 commit comments

Comments
 (0)