A new release of WP-CLI, WP-CLI v2.10.0, is now available. For this release, we had 63 contributors collaborate to get 233 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This is a small release that fixes a lot of small and not so small bugs, but we also have a couple of new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.
If you already use WP-CLI, updating is as simple as wp cli update. Else, check out our website for recommended installation methods.
New i18n make-php command
The WordPress core performance team is working on the Performant Translations feature project, which aims to speed up translations by using PHP files instead of MO files. The goal is to get it ready for WordPress 6.5.
The new i18n make-php command allows you to experiment with these faster translations right away and see how these work for your projects.
# Create PHP files for all PO files in the current directory.
$ wp i18n make-php .
# Create a PHP file from a single PO file in a specific directory.
$ wp i18n make-php example-plugin-de_DE.po languages
Update themes to minor or patch versions
When updating themes with WP-CLI, you can now to choose to only update to the latest minor or patch version with the new flags --minor and --patch.
You could already do this for plugin updates, and now themes are joining the club as well.
Support for adding and removing of multiple user roles
The two commands user add-role and user remove-role are now less lazy and can accept multiple roles to add or remove for a given user. You can make this work by simply adding as many roles as needed as separate arguments.
$ wp user add-role 12 author editor
Success: Added 'author', 'editor' roles for johndoe (12).
$ wp user remove-role 12 author editor
Success: Removed 'author', 'editor' roles for johndoe (12).
Filter the site list by user
When displaying a list of sites on your multisite network, you can now filter this list by a site user and only display sites that this user is a part of. You can do so by using the new --site_user flag for the site list command.
This can be helpful for administrative tasks around access control or for offboarding users.
Detailed change log
To avoid too much noise in the list above, the following types of pull requests have been omitted:
- PRs that only bumped dependencies to their latest version.
- PRs that only fixed a typo in the documentation.
- PRs that add a Composer script.
wp-cli/wp-cli-bundle
- Fix SQLite tests [#588]
wp-cli/wp-cli
- Fix PHP deprecation warnings [#5897]
- Only use
--skip-column-statisticsflag when available [#5895] - Handle unparseable tags gracefully [#5894]
WpOrgApi: allow specifying fields request parameters [#5893]- Remove unneeded compatibility shim [#5885]
- Use
has_config()inget_config()to prevent warnings onnullvalues [#5880] - Suggest
'network meta'intead of'network option'[#5879] - Updated docblock for
admin.php[#5877] - Fix PHP fatals when
admin.phphasCRLFline endings [#5875] - Standard completion of current option [#5873]
- Add
WP_CLI\Utils\has_stdin()function [#5872] - Add verbosity level and quiet flag in ssh command based on debug flag [#5869]
- Remove the pre-commit hook installation and its corresponding command [#5868]
- Add missing required arguments when using
--prompt[#5865] - Move
RecursiveDataStructureTraversertowp-cli/wp-clipackage [#5864] [#5866] [#5871] - Add
docker composecommand support in SSH command generation [#5863] - Add missing documentation for
$dataattribute inhttp_request()[#5861] - Update inline PHP documentation [#5853]
- Remove
contrib-list.php[#5851] - Update release checklist template [#5850]
- Update tests to accommodate for SQLite [#5849]
- Post-release version bump after v2.9.0 [#5848]
- Update
Formatter\show_tableto useRunner->in_colorrather thanshouldColorize[#5804]
wp-cli/handbook
- Fix handbook generation when Phar is used directly [#476]
- Hack Day edits [#474]
- Refresh functional test docs [#471]
- Refresh Contributor Day Page for November 2023 Hack Day [#470]
wp-cli/wp-cli.github.com
wp-cli/checksum-command
- Add edge case handling checksum verification of
hello-dollyplugin [#119]
wp-cli/config-command
wp-cli/core-command
wp-cli/db-command
- Better document
--skip-column-namesfor retrieving a specific value [#249] - Regenerate README file [#246]
- Document what
wp db checkdoesn’t do and provide suggestions for next commands [#244]
wp-cli/entity-command
- Add missing documentation [#451]
- Add command to get the post ID by URL [#449]
- Fix archiving a site by numeric slug [#448]
- Regenerate README file [#447]
- Add
originandexclude-role-namesfilters tolist-capscommand [#445] - Fix deleting a site by a slug that is an integer [#444]
- Reuse
has_stdin()from framework [#443] - Remove
RecursiveDataStructureTraverser[#442] - Support for adding and removing of multiple user roles [#437]
- Add examples on listing unapproved, spam and trash comments [#436]
- Fix super admin test on SQLite [#434]
- Do not assume
get_super_admins()has the0array index [#432] - Improve SQLite compatibility [#431]
- Fix example for
post createcommand [#458] - Update examples for
user application deletecommand [#457] - Regenerate README file [#456]
- Fix variable name in
application_name_existspolyfill [#455] - Add filter
site__user_inonwp site list[#438]
wp-cli/extension-command
- Regenerate README file [#381]
- Add
update_versionto the default fields forpluginandthemecommands [#380] - Update some tests for SQLite [#378]
- Remove duplicated code [#391]
- Switch tests to use
site-secretsinstead ofuser-switching[#389] - Support
'wporg_status'and'wporg_last_updated'as optionalwp plugin listfields [#382] - Regenerate README file [#397]
- Added
--minorand--patchCLI option inwp theme update[#393] - Fix counting of errors when attempting activations [#398]
wp-cli/i18n-command
make-mo: Add destination file support [#373]- Stage the correct files in schema workflow [#370]
- Update
theme-i18n.json[#366] - Fix file format in
make-php[#379] - Regenerate README file [#378]
- Add file references for plugin/theme headers [#377]
- Add
wp i18n make-phpcommand [#363]
wp-cli/language-command
- Fix tests after WordPress 6.4 release [#133]
- Skip some tests on SQLite [#132]
- Allow for PHP 8.2+ warning on old WP core [#130]
- Remove use of
@require-wp-latest[#135] - Re-enable some tests for SQLite [#134]
- Properly delete JSON & PHP translation files [#137]
wp-cli/maintenance-mode-command
- Evaluate
$upgradingnumeric value when checking if maintenance mode is active [#22]
wp-cli/media-command
- Add
--file_name=<name>argument forwp media import[#187]
wp-cli/package-command
- Fix compatibility with newer Composer versions [#183]
wp-cli/php-cli-tools
- Fix
maxFlagtoflagMaxandmaxOptiontooptionMaxtypos inHelpScreenclass [#170] - Use class instead of static variables for the speed measurement [#168]
- Remove inexistent
post-install-cmd[#167] - Fix type hinting for prompt function [#141]
wp-cli/scaffold-command
- Add
@require-mysqlfor tests with explicit MySQL dependency [#326] - Remove Travis CI from
wp scaffold plugin-tests[#325]
wp-cli/search-replace-command
-
Skip search and replace on objects that can’t deserialize safely [#192]
-
PHP 8.2 Deprecation: Fix creation of dynamic property. [#193]
wp-cli/super-admin-command
- PHP 8.2 Deprecation: Fix creation of dynamic property. [#55]
wp-cli/wp-config-transformer
Contributors
@2ndkauboy, @benjaminprojas, @benlk, @christianwach, @cliffordp, @connerbw, @Dan-Q, @danielbachhuber, @dd32, @dlind1, @dougaxe1, @drzraf, @elenachavdarova, @ernilambar, @gedex, @gitlost, @greatislander, @herregroen, @janw-me, @jenkoian, @johnbillion, @johnrom, @jrfnl, @JulianBustamante, @kodie, @krupal-panchal, @l3ku, @localheinz, @MarkBerube, @marksabbath, @matzeeable, @michaelzangl, @oandregal, @ocean90, @pbiron, @pdaalder, @pekkakortelainen, @pfefferle, @pmbaldha, @ponsfrilus, @rodrigoprimo, @Roy-Orbison, @sandeshjangam, @schlessera, @sdnunca, @sejas, @selul, @shail-mehta, @shawnhooper, @shendy-a8c, @siliconforks, @Soean, @strarsis, @swissspidy, @thelovekesh, @todeveni, @Tug, @up1512001, @valeriySeregin, @wojsmol, @wojtekn, @xknown, @yousan