Skip to content

Commit 069bbb5

Browse files
authored
Merge branch 'main' into feature/plugin-theme-force-check-183
2 parents 9c85840 + f0cebef commit 069bbb5

16 files changed

+285
-37
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Testing
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
push:
67
branches:

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ These fields are optionally available:
239239
Installs one or more plugins.
240240

241241
~~~
242-
wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--activate] [--activate-network] [--insecure]
242+
wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--ignore-requirements] [--activate] [--activate-network] [--insecure]
243243
~~~
244244

245245
**OPTIONS**
@@ -255,6 +255,10 @@ wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--activat
255255
If set, the command will overwrite any installed version of the plugin, without prompting
256256
for confirmation.
257257

258+
[--ignore-requirements]
259+
:If set, the command will install the plugin while ignoring any WordPress or PHP version requirements
260+
specified by the plugin authors.
261+
258262
[--activate]
259263
If set, the plugin will be activated immediately after install.
260264

@@ -993,7 +997,7 @@ wp theme get <theme> [--field=<field>] [--fields=<fields>] [--format=<format>]
993997
Installs one or more themes.
994998

995999
~~~
996-
wp theme install <theme|zip|url>... [--version=<version>] [--force] [--activate] [--insecure]
1000+
wp theme install <theme|zip|url>... [--version=<version>] [--force] [--ignore-requirements] [--activate] [--insecure]
9971001
~~~
9981002

9991003
**OPTIONS**
@@ -1009,6 +1013,10 @@ wp theme install <theme|zip|url>... [--version=<version>] [--force] [--activate]
10091013
If set, the command will overwrite any installed version of the theme, without prompting
10101014
for confirmation.
10111015

1016+
[--ignore-requirements]
1017+
If set, the command will install the theme while ignoring any WordPress or PHP version requirements
1018+
specified by the theme authors.
1019+
10121020
[--activate]
10131021
If set, the theme will be activated immediately after install.
10141022

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"require": {
2020
"composer/semver": "^1.4 || ^2 || ^3",
21-
"wp-cli/wp-cli": "^2.10"
21+
"wp-cli/wp-cli": "^2.12"
2222
},
2323
"require-dev": {
2424
"wp-cli/cache-command": "^2.0",
@@ -33,7 +33,8 @@
3333
"allow-plugins": {
3434
"dealerdirect/phpcodesniffer-composer-installer": true,
3535
"johnpbloch/wordpress-core-installer": true
36-
}
36+
},
37+
"lock": false
3738
},
3839
"extra": {
3940
"branch-alias": {

features/plugin-activate.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ Feature: Activate WordPress plugins
1313
And the return code should be 0
1414

1515
Scenario: Attempt to activate a plugin that's not installed
16-
When I try `wp plugin activate edit-flow`
16+
When I try `wp plugin activate debug-bar`
1717
Then STDERR should be:
1818
"""
19-
Warning: The 'edit-flow' plugin could not be found.
19+
Warning: The 'debug-bar' plugin could not be found.
2020
Error: No plugins activated.
2121
"""
2222
And the return code should be 1
2323

24-
When I try `wp plugin activate akismet hello edit-flow`
24+
When I try `wp plugin activate akismet hello debug-bar`
2525
Then STDERR should be:
2626
"""
27-
Warning: The 'edit-flow' plugin could not be found.
27+
Warning: The 'debug-bar' plugin could not be found.
2828
Error: Only activated 2 of 3 plugins.
2929
"""
3030
And STDOUT should be:

features/plugin-auto-updates-disable.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Disable auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post`
5+
And I run `wp plugin install duplicate-post --ignore-requirements`
66
And I run `wp plugin auto-updates enable --all`
77

88
@require-wp-5.5

features/plugin-auto-updates-enable.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Enable auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post`
5+
And I run `wp plugin install duplicate-post --ignore-requirements`
66

77
@require-wp-5.5
88
Scenario: Show an error if required params are missing

features/plugin-auto-updates-status.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Show the status of auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post`
5+
And I run `wp plugin install duplicate-post --ignore-requirements`
66

77
@require-wp-5.5
88
Scenario: Show an error if required params are missing

features/plugin-deactivate.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ Feature: Deactivate WordPress plugins
1414
And the return code should be 0
1515

1616
Scenario: Attempt to deactivate a plugin that's not installed
17-
When I try `wp plugin deactivate edit-flow`
17+
When I try `wp plugin deactivate debug-bar`
1818
Then STDERR should be:
1919
"""
20-
Warning: The 'edit-flow' plugin could not be found.
20+
Warning: The 'debug-bar' plugin could not be found.
2121
Error: No plugins deactivated.
2222
"""
2323
And STDOUT should be empty
2424
And the return code should be 1
2525

26-
When I try `wp plugin deactivate akismet hello edit-flow`
26+
When I try `wp plugin deactivate akismet hello debug-bar`
2727
Then STDERR should be:
2828
"""
29-
Warning: The 'edit-flow' plugin could not be found.
29+
Warning: The 'debug-bar' plugin could not be found.
3030
Error: Only deactivated 2 of 3 plugins.
3131
"""
3232
And STDOUT should be:

features/plugin-delete.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ Feature: Delete WordPress plugins
2929
"""
3030

3131
Scenario: Attempting to delete a plugin that doesn't exist
32-
When I try `wp plugin delete edit-flow`
32+
When I try `wp plugin delete debug-bar`
3333
Then STDOUT should be:
3434
"""
3535
Success: Plugin already deleted.
3636
"""
3737
And STDERR should be:
3838
"""
39-
Warning: The 'edit-flow' plugin could not be found.
39+
Warning: The 'debug-bar' plugin could not be found.
4040
"""
4141
And the return code should be 0
4242

features/plugin-install.feature

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ Feature: Install WordPress plugins
9292
define( 'WP_PROXY_PORT', '443' );
9393
"""
9494

95-
When I try `wp --require=invalid-proxy-details.php plugin install edit-flow`
95+
When I try `wp --require=invalid-proxy-details.php plugin install debug-bar`
9696
Then STDERR should contain:
9797
"""
98-
Warning: edit-flow: An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration.
98+
Warning: debug-bar: An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration.
9999
"""
100100
And STDERR should contain:
101101
"""
@@ -104,7 +104,7 @@ Feature: Install WordPress plugins
104104
And STDOUT should be empty
105105
And the return code should be 1
106106

107-
When I run `wp plugin install edit-flow`
107+
When I run `wp plugin install debug-bar`
108108
Then STDOUT should contain:
109109
"""
110110
Plugin installed successfully.
@@ -171,7 +171,7 @@ Feature: Install WordPress plugins
171171
When I run `rm wp-content/plugins/akismet/akismet.php`
172172
Then the return code should be 0
173173

174-
When I try `wp plugin install akismet`
174+
When I try `wp plugin install akismet --ignore-requirements`
175175
Then STDERR should contain:
176176
"""
177177
Warning: Destination folder already exists. "{WORKING_DIR}/wp-content/plugins/akismet/"
@@ -237,3 +237,36 @@ Feature: Install WordPress plugins
237237
Plugin 'site-secrets' activated.
238238
Success: Plugin already installed.
239239
"""
240+
241+
@require-php-7
242+
Scenario: Can't install plugin that requires a newer version of WordPress
243+
Given a WP install
244+
245+
When I run `wp core download --version=6.4 --force`
246+
And I run `rm -r wp-content/themes/*`
247+
248+
And I try `wp plugin install wp-super-cache`
249+
Then STDERR should contain:
250+
"""
251+
Warning: wp-super-cache: This plugin does not work with your version of WordPress
252+
"""
253+
254+
And STDERR should contain:
255+
"""
256+
Error: No plugins installed.
257+
"""
258+
259+
@less-than-php-7.4 @require-wp-6.6
260+
Scenario: Can't install plugin that requires a newer version of PHP
261+
Given a WP install
262+
263+
And I try `wp plugin install contact-form-7`
264+
Then STDERR should contain:
265+
"""
266+
Warning: contact-form-7: This plugin does not work with your version of PHP
267+
"""
268+
269+
And STDERR should contain:
270+
"""
271+
Error: No plugins installed.
272+
"""

0 commit comments

Comments
 (0)