Skip to content

Commit 696bc8c

Browse files
authored
Merge branch 'main' into copilot/add-plugin-theme-language-update-check
2 parents 2b58da7 + 81d549d commit 696bc8c

13 files changed

+595
-11
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@v3
24+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
2525
with:
2626
files: "composer.json"
2727

2828
- name: Set up PHP environment
2929
if: steps.check_composer_file.outputs.files_exists == 'true'
30-
uses: shivammathur/setup-php@v2
30+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
3131
with:
3232
php-version: 'latest'
3333
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Install Composer dependencies & cache dependencies
4040
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@v3
41+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
4242
env:
4343
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4444
with:

.github/workflows/issue-triage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ name: Issue and PR Triage
1313
required: false
1414
type: string
1515

16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
actions: write
20+
contents: read
21+
models: read
22+
1623
jobs:
1724
issue-triage:
1825
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main

.github/workflows/regenerate-readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- "features/**"
1111
- "README.md"
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
regenerate-readme:
1519
uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main

.github/workflows/welcome-new-contributors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
- master
99

10+
permissions:
11+
pull-requests: write
12+
1013
jobs:
1114
welcome:
1215
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

README.md

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

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

245245
**OPTIONS**
246246

247247
<plugin|zip|url>...
248-
One or more plugins to install. Accepts a plugin slug, the path to a local zip file, or a URL to a remote zip file.
248+
One or more plugins to install. Accepts a plugin slug, the path to a local zip file, a URL to a remote zip file, or a URL to a WordPress.org plugin directory.
249249

250250
[--version=<version>]
251251
If set, get that particular version from wordpress.org, instead of the
@@ -268,6 +268,9 @@ wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--ignore-
268268
[--insecure]
269269
Retry downloads without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
270270

271+
[--with-dependencies]
272+
If set, the command will also install all required dependencies of the plugin as specified in the 'Requires Plugins' header.
273+
271274
**EXAMPLES**
272275

273276
# Install the latest version from wordpress.org and activate
@@ -325,6 +328,64 @@ wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--ignore-
325328
Plugin updated successfully
326329
Success: Installed 1 of 1 plugins.
327330

331+
# Install a plugin with all its dependencies
332+
$ wp plugin install my-plugin --with-dependencies
333+
Installing Required Plugin 1 (1.2.3)
334+
Plugin installed successfully.
335+
Installing Required Plugin 2 (2.0.0)
336+
Plugin installed successfully.
337+
Installing My Plugin (3.5.0)
338+
Plugin installed successfully.
339+
Success: Installed 3 of 3 plugins.
340+
341+
# Install from a WordPress.org plugin directory URL
342+
$ wp plugin install https://wordpress.org/plugins/akismet/
343+
Detected WordPress.org plugins directory URL, using slug: akismet
344+
Installing Akismet Anti-spam: Spam Protection (3.1.11)
345+
Downloading install package from https://downloads.wordpress.org/plugin/akismet.3.1.11.zip...
346+
Unpacking the package...
347+
Installing the plugin...
348+
Plugin installed successfully.
349+
Success: Installed 1 of 1 plugins.
350+
351+
352+
353+
### wp plugin install-dependencies
354+
355+
Installs all dependencies of an installed plugin.
356+
357+
~~~
358+
wp plugin install-dependencies <plugin> [--activate] [--activate-network] [--force]
359+
~~~
360+
361+
This command is useful when you have a plugin installed that depends on other plugins,
362+
and you want to install those dependencies without activating the main plugin.
363+
364+
**OPTIONS**
365+
366+
<plugin>
367+
The installed plugin to get dependencies for.
368+
369+
[--activate]
370+
If set, dependencies will be activated immediately after install.
371+
372+
[--activate-network]
373+
If set, dependencies will be network activated immediately after install.
374+
375+
[--force]
376+
If set, the command will overwrite any installed version of the plugin, without prompting
377+
for confirmation.
378+
379+
**EXAMPLES**
380+
381+
# Install all dependencies of an installed plugin
382+
$ wp plugin install-dependencies my-plugin
383+
Installing Required Plugin 1 (1.2.3)
384+
Plugin installed successfully.
385+
Installing Required Plugin 2 (2.0.0)
386+
Plugin installed successfully.
387+
Success: Installed 2 of 2 plugins.
388+
328389

329390

330391
### wp plugin is-active
@@ -1036,7 +1097,7 @@ wp theme install <theme|zip|url>... [--version=<version>] [--force] [--ignore-re
10361097
**OPTIONS**
10371098

10381099
<theme|zip|url>...
1039-
One or more themes to install. Accepts a theme slug, the path to a local zip file, or a URL to a remote zip file.
1100+
One or more themes to install. Accepts a theme slug, the path to a local zip file, a URL to a remote zip file, or a URL to a WordPress.org theme directory.
10401101

10411102
[--version=<version>]
10421103
If set, get that particular version from wordpress.org, instead of the
@@ -1075,6 +1136,16 @@ wp theme install <theme|zip|url>... [--version=<version>] [--force] [--ignore-re
10751136
# Install from a remote zip file
10761137
$ wp theme install http://s3.amazonaws.com/bucketname/my-theme.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef
10771138

1139+
# Install from a WordPress.org theme directory URL
1140+
$ wp theme install https://wordpress.org/themes/twentysixteen/
1141+
Detected WordPress.org themes directory URL, using slug: twentysixteen
1142+
Installing Twenty Sixteen (1.2)
1143+
Downloading install package from http://downloads.wordpress.org/theme/twentysixteen.1.2.zip...
1144+
Unpacking the package...
1145+
Installing the theme...
1146+
Theme installed successfully.
1147+
Success: Installed 1 of 1 themes.
1148+
10781149

10791150

10801151
### wp theme is-active

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"plugin delete",
5050
"plugin get",
5151
"plugin install",
52+
"plugin install-dependencies",
5253
"plugin is-active",
5354
"plugin is-installed",
5455
"plugin list",

features/plugin-activate.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,26 @@ Feature: Activate WordPress plugins
154154
Success:
155155
"""
156156
And the return code should be 0
157+
158+
Scenario: Activating a plugin that generates unexpected output shows the output in debug mode
159+
Given a wp-content/plugins/output-plugin.php file:
160+
"""
161+
<?php
162+
/**
163+
* Plugin Name: Output Plugin
164+
* Description: This plugin generates unexpected output during activation
165+
* Author: WP-CLI tests
166+
*/
167+
echo "Unexpected output from plugin activation";
168+
"""
169+
170+
When I try `wp plugin activate output-plugin --debug`
171+
Then STDERR should contain:
172+
"""
173+
Warning: Failed to activate plugin. The plugin generated unexpected output.
174+
"""
175+
And STDERR should contain:
176+
"""
177+
Debug (plugin): Unexpected output: Unexpected output from plugin activation
178+
"""
179+
And the return code should be 1

0 commit comments

Comments
 (0)