Skip to content

Commit c00e855

Browse files
authored
Merge branch 'main' into fix/96-theme-mod-get-format
2 parents 16c60ed + 8c3bfd7 commit c00e855

24 files changed

Lines changed: 710 additions & 81 deletions

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@ on:
99
paths:
1010
- .github/workflows/copilot-setup-steps.yml
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
copilot-setup-steps:
17+
name: Setup environment
1418
runs-on: ubuntu-latest
1519
permissions:
1620
contents: read
1721

1822
steps:
1923
- name: Checkout code
20-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25+
with:
26+
persist-credentials: false
2127

2228
- name: Check existence of composer.json file
2329
id: check_composer_file
2430
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
2531

2632
- name: Set up PHP environment
2733
if: steps.check_composer_file.outputs.files_exists == 'true'
28-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
34+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
2935
with:
3036
php-version: 'latest'
3137
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -36,9 +42,6 @@ jobs:
3642

3743
- name: Install Composer dependencies & cache dependencies
3844
if: steps.check_composer_file.outputs.files_exists == 'true'
39-
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v3
45+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
4046
env:
4147
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
42-
with:
43-
# Bust the cache at least once a month - output format: YYYY-MM.
44-
custom-cache-suffix: $(date -u "+%Y-%m")

‎README.md‎

Lines changed: 110 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ wp-cli/extension-command
33

44
Manages plugins and themes, including installs, activations, and updates.
55

6-
[![Testing](https://github.com/wp-cli/extension-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/extension-command/actions/workflows/testing.yml)
6+
[![Testing](https://github.com/wp-cli/extension-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/extension-command/actions/workflows/testing.yml) [![Code Coverage](https://codecov.io/gh/wp-cli/extension-command/branch/main/graph/badge.svg)](https://codecov.io/gh/wp-cli/extension-command/tree/main)
77

88
Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)
99

@@ -635,33 +635,33 @@ search query.
635635
[--fields=<fields>]
636636
Ask for specific fields from the API. Defaults to name,slug,author_profile,rating. Acceptable values:
637637

638-
**name**: Plugin Name
639-
**slug**: Plugin Slug
640-
**version**: Current Version Number
641-
**author**: Plugin Author
642-
**author_profile**: Plugin Author Profile
643-
**contributors**: Plugin Contributors
644-
**requires**: Plugin Minimum Requirements
645-
**tested**: Plugin Tested Up To
646-
**compatibility**: Plugin Compatible With
647-
**rating**: Plugin Rating in Percent and Total Number
648-
**ratings**: Plugin Ratings for each star (1-5)
649-
**num_ratings**: Number of Plugin Ratings
650-
**homepage**: Plugin Author's Homepage
651-
**description**: Plugin's Description
652-
**short_description**: Plugin's Short Description
653-
**sections**: Plugin Readme Sections: description, installation, FAQ, screenshots, other notes, and changelog
654-
**downloaded**: Plugin Download Count
655-
**last_updated**: Plugin's Last Update
656-
**added**: Plugin's Date Added to wordpress.org Repository
657-
**tags**: Plugin's Tags
658-
**versions**: Plugin's Available Versions with D/L Link
659-
**donate_link**: Plugin's Donation Link
660-
**banners**: Plugin's Banner Image Link
661-
**icons**: Plugin's Icon Image Link
662-
**active_installs**: Plugin's Number of Active Installs
663-
**contributors**: Plugin's List of Contributors
664-
**url**: Plugin's URL on wordpress.org
638+
**name**: Plugin Name
639+
**slug**: Plugin Slug
640+
**version**: Current Version Number
641+
**author**: Plugin Author
642+
**author_profile**: Plugin Author Profile
643+
**contributors**: Plugin Contributors
644+
**requires**: Plugin Minimum Requirements
645+
**tested**: Plugin Tested Up To
646+
**compatibility**: Plugin Compatible With
647+
**rating**: Plugin Rating in Percent and Total Number
648+
**ratings**: Plugin Ratings for each star (1-5)
649+
**num_ratings**: Number of Plugin Ratings
650+
**homepage**: Plugin Author's Homepage
651+
**description**: Plugin's Description
652+
**short_description**: Plugin's Short Description
653+
**sections**: Plugin Readme Sections: description, installation, FAQ, screenshots, other notes, and changelog
654+
**downloaded**: Plugin Download Count
655+
**last_updated**: Plugin's Last Update
656+
**added**: Plugin's Date Added to wordpress.org Repository
657+
**tags**: Plugin's Tags
658+
**versions**: Plugin's Available Versions with D/L Link
659+
**donate_link**: Plugin's Donation Link
660+
**banners**: Plugin's Banner Image Link
661+
**icons**: Plugin's Icon Image Link
662+
**active_installs**: Plugin's Number of Active Installs
663+
**contributors**: Plugin's List of Contributors
664+
**url**: Plugin's URL on wordpress.org
665665

666666
[--format=<format>]
667667
Render output in a particular format.
@@ -780,6 +780,39 @@ Lists the available plugin updates. Similar to `wp core check-update`.
780780

781781

782782

783+
### wp plugin download
784+
785+
Downloads a plugin zip package without loading WordPress.
786+
787+
~~~
788+
wp plugin download <slug> [--target-path=<path>] [--version=<version>] [--force] [--insecure]
789+
~~~
790+
791+
**OPTIONS**
792+
793+
<slug>
794+
Slug of the plugin to download.
795+
796+
[--target-path=<path>]
797+
Directory to store the downloaded zip file. Defaults to the current directory.
798+
799+
[--version=<version>]
800+
Version to download. Accepts a version number or `dev`.
801+
802+
[--force]
803+
Overwrite destination file if it already exists.
804+
805+
[--insecure]
806+
Retry download without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
807+
808+
**EXAMPLES**
809+
810+
$ wp plugin download bbpress
811+
Downloading bbpress (2.5.9)...
812+
Success: Downloaded plugin package to /path/to/bbpress.2.5.9.zip
813+
814+
815+
783816
### wp plugin toggle
784817

785818
Toggles a plugin's activation state.
@@ -1695,17 +1728,17 @@ search query.
16951728
[--fields=<fields>]
16961729
Ask for specific fields from the API. Defaults to name,slug,author,rating. Acceptable values:
16971730

1698-
**name**: Theme Name
1699-
**slug**: Theme Slug
1700-
**version**: Current Version Number
1701-
**author**: Theme Author
1702-
**preview_url**: Theme Preview URL
1703-
**screenshot_url**: Theme Screenshot URL
1704-
**rating**: Theme Rating
1705-
**num_ratings**: Number of Theme Ratings
1706-
**homepage**: Theme Author's Homepage
1707-
**description**: Theme Description
1708-
**url**: Theme's URL on wordpress.org
1731+
**name**: Theme Name
1732+
**slug**: Theme Slug
1733+
**version**: Current Version Number
1734+
**author**: Theme Author
1735+
**preview_url**: Theme Preview URL
1736+
**screenshot_url**: Theme Screenshot URL
1737+
**rating**: Theme Rating
1738+
**num_ratings**: Number of Theme Ratings
1739+
**homepage**: Theme Author's Homepage
1740+
**description**: Theme Description
1741+
**url**: Theme's URL on wordpress.org
17091742

17101743
[--format=<format>]
17111744
Render output in a particular format.
@@ -1811,6 +1844,39 @@ Lists the available theme updates. Similar to `wp core check-update`.
18111844

18121845

18131846

1847+
### wp theme download
1848+
1849+
Downloads a theme zip package without loading WordPress.
1850+
1851+
~~~
1852+
wp theme download <slug> [--target-path=<path>] [--version=<version>] [--force] [--insecure]
1853+
~~~
1854+
1855+
**OPTIONS**
1856+
1857+
<slug>
1858+
Slug of the theme to download.
1859+
1860+
[--target-path=<path>]
1861+
Directory to store the downloaded zip file. Defaults to the current directory.
1862+
1863+
[--version=<version>]
1864+
Version to download. Accepts a version number or `dev`.
1865+
1866+
[--force]
1867+
Overwrite destination file if it already exists.
1868+
1869+
[--insecure]
1870+
Retry download without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
1871+
1872+
**EXAMPLES**
1873+
1874+
$ wp theme download twentytwelve
1875+
Downloading twentytwelve (1.3)...
1876+
Success: Downloaded theme package to /path/to/twentytwelve.1.3.zip
1877+
1878+
1879+
18141880
### wp theme update
18151881

18161882
Updates one or more themes.
@@ -2119,9 +2185,13 @@ Want to contribute a new feature? Please first [open a new issue](https://github
21192185

21202186
Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.
21212187

2188+
### License
2189+
2190+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
2191+
21222192
## Support
21232193

2124-
GitHub issues aren't for general support questions, but there are other venues you can try: https://wp-cli.org/#support
2194+
GitHub issues aren't for general support questions. For support resources and next steps, see the WP-CLI Support page: https://make.wordpress.org/cli/handbook/support/
21252195

21262196

21272197
*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

‎codecov.yml‎

Whitespace-only changes.

‎composer.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"plugin search",
5858
"plugin status",
5959
"plugin check-update",
60+
"plugin download",
6061
"plugin toggle",
6162
"plugin uninstall",
6263
"plugin update",
@@ -82,6 +83,7 @@
8283
"theme search",
8384
"theme status",
8485
"theme check-update",
86+
"theme download",
8587
"theme update",
8688
"theme mod list",
8789
"theme auto-updates",

‎extension-command.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
if ( file_exists( $wpcli_extension_autoloader ) ) {
99
require_once $wpcli_extension_autoloader;
1010
}
11+
require_once __DIR__ . '/src/Plugin_Download_Command.php';
12+
require_once __DIR__ . '/src/Theme_Download_Command.php';
1113

1214
$wpcli_extension_requires_wp_5_5 = [
1315
'before_invoke' => static function () {
@@ -18,8 +20,10 @@
1820
];
1921

2022
WP_CLI::add_command( 'plugin', 'Plugin_Command' );
23+
WP_CLI::add_command( 'plugin download', 'Plugin_Download_Command' );
2124
WP_CLI::add_command( 'plugin auto-updates', 'Plugin_AutoUpdates_Command', $wpcli_extension_requires_wp_5_5 );
2225
WP_CLI::add_command( 'theme', 'Theme_Command' );
26+
WP_CLI::add_command( 'theme download', 'Theme_Download_Command' );
2327
WP_CLI::add_command( 'theme auto-updates', 'Theme_AutoUpdates_Command', $wpcli_extension_requires_wp_5_5 );
2428
WP_CLI::add_command( 'theme mod', 'Theme_Mod_Command' );
2529

0 commit comments

Comments
 (0)