WP-CLI v2.11.0 Release Notes

A new release of WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/WP-CLI v2.11.0, is now available. For this release, we had 61 contributors collaborate to get 274 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.

Thank you for providing the additional details on the pull requests. I’ll go through each one and provide improved highlights with examples and usage details:

Improved CSV Handling

The CSV reading functionality has been enhanced to properly handle multi-line values. This fix ensures that complex CSV data can be processed correctly, improving the reliability of commands that work with CSV input.

Example of a CSV file that can now be correctly processed:

id,name,description
1,"Product A","This is a
multi-line
description"
2,"Product B","Another description"

New Signup Management Commands

New commands have been added for managing signups on multisiteMultisite Multisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network. installations:

  • wp user signup list: List signups
  • wp user signup get: Get details about a signup
  • wp user signup activate: Activate one or more signups
  • wp user signup delete: Delete one or more signups

Example usage:

# List all signups
$ wp user signup list

# Activate a signup
$ wp user signup activate [email protected]

# Delete a signup
$ wp user signup delete 123

New Site Generator Command

A new wp site generate command has been added to create multiple sites programmatically in a multisite installation. This is useful for testing or development purposes.

Example usage:

# Generate 10 new sites
$ wp site generate --count=10

# Generate sites with a specific slug
$ wp site generate --count=2 --slug=testsite

GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ Release Installation Support

The extension command now supports installing plugins and themes directly from GitHub releases. This feature allows users to easily install and manage extensions hosted on GitHub without manual downloads.

Example usage:

# Install a plugin from its latest GitHub release
$ wp plugin install https://github.com/username/plugin-name/releases/latest

# Install a specific version of a theme from GitHub
$ wp theme install https://github.com/username/theme-name/releases/tag/v1.2.3

Improved PluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party Management

A new --recently-active option has been added to the plugin list command, allowing users to quickly identify and manage plugins that have been recently active on their site.

Example usage:

# List recently active plugins
$ wp plugin list --recently-active

# Activate all recently active plugins
$ wp plugin activate $(wp plugin list --recently-active --field=name)

Option to Delete Unknown Image Sizes

A new --delete-unknown flag has been added to the wp media regenerate command. This allows users to remove files and image metadata for image sizes that no longer exist in the site’s configuration, without regenerating other thumbnails.

Example usage:

# Remove unknown image sizes for all images
$ wp media regenerate --delete-unknown

# Remove unknown image sizes for a specific image
$ wp media regenerate 123 --delete-unknown

This feature is particularly useful for cleaning up after changing image size configurations or removing plugins that added custom image sizes.

User Existence Check Command

A new wp user exists command has been added, similar to the existing wp post exists command. This allows for quick checks on whether a user exists in the WordPress database.

Example usage:

# The user exists.
$ wp user exists 1337
Success: User with ID 1337 exists.
$ echo $?
0

# The user does not exist.
$ wp user exists 10000
$ echo $?
1

Fish Shell Completion Support

WP-CLI now supports command completion for the Fish shell, expanding its compatibility beyond Bash and Zsh. This addition makes it easier for Fish shell users to work with WP-CLI commands.

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

  • Update versions of WP-CLI used in tests [#658]
  • Stop testing WordPress latest version on PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. < 7.2 [#651]

wp-cli/wp-cli

  • Add fish shell completion [#5954]
  • Add defaults and accepted values for runcommand() options in documentation [#5953]
  • Address warnings with filenames ending in full stop on Windows [#5951]
  • Fix unit tests [#5950]
  • Update copyright year in license [#5942]
  • Fix breaking multi-line CSV values on reading [#5939]
  • Fix broken GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ test [#5938]
  • Update docker runner to resolve docker path using /usr/bin/env [#5936]
  • Fix inherit path in nested directory [#5930]
  • Minor docblock improvements [#5929]
  • Add Signup fetcher [#5926]
  • Ensure the alias has the leading @ symbol when added [#5924]
  • Include any non-default hook information in CompositeCommand [#5921]
  • Correct completion case when it ends in = [#5913]
  • Fix inline comments [#5912]
  • Update inline comments [#5910]
  • Add a real-world example for cli has-command [#5908]
  • Fix typos [#5901]
  • Avoid PHP deprecation notices in PHP 8.1.x [#5899]

wp-cli/handbook

  • Update handbook for v2.11.0 release [#531]
  • Add missing scaffold package markdown files [#529]
  • Fix Undefined array key warning [#525]
  • Add files autoloader for bin/command.php [#524]
  • Small typo correction [#523]
  • Fix documentation generation error [#520]
  • Add Yoast WP-CLI command to tools.md [#517]
  • Add search and replace quick start & adding new command [#515]
  • Add Composer package name [#514]
  • Clean up hosting links [#513]
  • Add to hosting-companies.md [#512]
  • Remove invalid link from handbook [#511]
  • Update contributor dayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/. page for WCEU 2024 [#510]
  • Add documentation on Fish completions [#508]
  • Add code quality setup [#506]
  • Fix global parameters 404 link [#504]
  • Fix release checklist hyperlink [#503]
  • Fix broken link for the global parameters hyperlink [#502]
  • Include hook details in documentation [#501]
  • Add link to contribution tutorial videos [#500]
  • Update hosting-companies.md [#499]
  • Refresh the Hack Day page for April 2024 [#498]
  • Fix branch name in common issues handbook page [#497]
  • Fix common issues title [#496]
  • Fix broken link [#494]
  • Add Hack Day page to manifest [#492]
  • Separate out the WP-CLI Hack Day and WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Contributor Day docs [#490]
  • Update running-commands-remotely.md [#489]
  • Update brew formula link [#487]
  • Update installing.md [#481]

wp-cli/cache-command

  • Update failing tests after new transient in WP coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. [#97]

wp-cli/config-command

  • Improve messaging when shuffling salts [#177]
  • Fix incorrect message shuffling salt in PHP 5.6 [#176]
  • Update config commands examples [#174]
  • Refactor config create command [#181]

wp-cli/core-command

  • Remove extraneous argument in core update example [#255]
  • Fix --format in core check-update command [#253]
  • Update core commands docs [#251]

wp-cli/cron-command

  • Fix cron commands examples [#102]
  • Add --all flag to cron event delete [#98]

wp-cli/db-command

  • Add note about multisite usage in db query docs [#251]
  • Enable --format=<format> for db search [#247]
  • Update tests after change in WP trunk version [#257]

wp-cli/embed-command

  • Update examples for embed commands [#75]

wp-cli/entity-command

  • Avoid time dependent test in user application-password [#499]
  • Support new upstream autoload options [#496]
  • Support nickname when creating user [#495]
  • Use twentytwelve theme in menu location test [#494]
  • Add examples for option set-autoload and option get-autoload commands [#492]
  • Add missing ## OPTIONS in CommandWithTerms class [#487]
  • Add user exists command [#486]
  • Accept user login and email in user spam and user unspam commands [#485]
  • Update doc for user spam and user unspam command [#483]
  • Validate reassigning user in user delete command [#482]
  • Fix warning message in user spam command [#481]
  • Add missing application-password and site meta subcommands to readme [#478]
  • Introduce --format=ids in user application-password list [#475]
  • Fix dynamic property issue in user session class [#470]
  • Fix PHP notice in comment recount with invalid ID [#469]
  • Fix example for site deactivate command [#468]
  • Update examples in user commands [#467]
  • Update term commands examples [#466]
  • Update example output for comment delete command [#465]
  • Fix menu command output examples [#462]
  • Add site generate command [#498]
  • Add commands for managing signups on multisite [#489]

wp-cli/extension-command

  • Improve warning message for installing and activating multiple themes [#419]
  • Replace user-switching plugin from feature tests [#418]
  • Update the theme in feature tests [#417]
  • Show additional plugin headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. values in plugin get <plugin> output [#414]
  • Add tested_up_to field [#413]
  • Warn when supplying multiple themes with theme install --activate [#408]
  • Fix plugin commands examples [#403]
  • Update theme commands examples [#401]
  • Correct parameter type in ParseThemeNameInput trait [#400]
  • Add --recently-active option in plugin list command [#424]
  • Fix visibility in command class methods [#423]
  • Add support for GitHub release installation [#421]
  • Replace edit-flow plugin by debug-bar in feature tests [#427]

wp-cli/i18n-command

  • Skip strings without translation in make-php [#389]
  • Add more headers to PHP translation files [#388]
  • Use relative paths for file header references [#384]
  • Translate “description” field from theme.json [#408]
  • Revert changes to extract title from styles.blocks.variations [#407]
  • find title string within styles.blocks.variations in theme.json [#405]
  • Add tests for rspack and esbuild bundle output [#404]
  • Fix deprecation warnings in unit tests [#402]
  • Use relative paths for file header references (Windows fix) [#400]
  • Ensure that the POT file uses the same license as the theme [#399]
  • Add examples for i18n update-po command [#392]
  • Add examples for i18 make-pot [#390]

wp-cli/language-command

  • Update examples for language command [#145]
  • Update examples for language core command [#142]
  • Update examples for language theme command [#141]
  • Update examples for language plugin command [#140]
  • Improve warning message for unavailable language pack [#139]
  • Update doc for language core install command [#153]
  • Add --format=count in language list commands [#151]
  • Update feature tests for language core update [#149]

wp-cli/maintenance-mode-command

  • Add missing OPTIONS heading in maintenance-mode activate command [#28]

wp-cli/media-command

  • Fix incorrect image sizes in media image-size command [#192]
  • Remove extraneous error check [#191]
  • Update media commands examples [#189]
  • Optimize memory consumption when querying attachments [#188]
  • Add option to delete unknown image sizes [#199]

wp-cli/package-command

  • Update docs and examples for package commands [#186]
  • Fix failing test [#185]
  • Fix failing PHPUnit tests [#188]

wp-cli/php-cli-tools

  • Fix unit tests [#172]

wp-cli/scaffold-command

  • Update theme tests to remove p2 and use twentytwelve [#336]
  • Correct plugin main file in bootstrap in scaffolded test [#335]
  • Scaffold theme test should work in PHP greater than 8.0 [#334]
  • Add GitHub as valid CI for plugin scaffold and theme scaffold [#331]
  • Update scaffold command examples [#329]

wp-cli/search-replace-command

  • Fix tests after change in WordPress trunk [#195]
  • Fix test for WordPress trunk [#197]

wp-cli/super-admin-command

  • Add IDs as format for super admin list [#60]
  • Correct super-admin commands examples [#57]

wp-cli/widget-command

  • Replace p2 theme with twentytwelve in feature test [#61]

wp-cli/wp-config-transformer

  • Fix failing PHPUnit tests [#52]

Contributors

#release, #v2-11-0

Fifteen Merged PRs for WP-CLI Hack Day 2024

The third ever WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ Hack Day is now complete!

It was really nice to connect with folks both on Zoom and in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.. With how much async collaboration we have in the project, it’s quite refreshing to discuss bugs and implementations in real-time. I think we had a Zoom room open for over seven hours.

Many thanks to everyone that participated! 🙏 @abhi3315, @brianhenryie, @danielbachhuber, Deepak Kumar, isla w, @johnbillion, @kau-boy, @mkrndmane, @meszarosrob, @petitphp, @rabmalin, @schlessera, @swissspidy, Takshil Kunadia, @tfirdaus, @thelovekesh

We had 15 pull requests that were merged during the event:

  1. Update docker runner to resolve docker path using /usr/bin/env
  2. Add Signup fetcher
  3. Fix broken Gutenberg test
  4. Warn when supplying multiple themes with theme install --activate
  5. Add wp-versions-data-fetcher workflow
  6. Improve warning message for install and activate multiple themes
  7. Fix breaking multi-line CSV values on reading
  8. Ensure that the POT file use the same license as the theme
  9. Fix inherit path in nested directory
  10. Update failing tests after new transient in WP core
  11. Add tested_up_to field
  12. Correct plugin main file in bootstrap in scaffolded test
  13. Include any non default hook information in CompositeCommand
  14. Add support for GitHub release installation
  15. Enable --format=<format> for db search

In addition to those, we had an additional 6 pull requests with substantial progress during the event that aren’t yet merged:

See you at the next WP-CLI Hack Day!

Save the date! WP-CLI Hack Day on Friday, April 26th

We’re happy to announce the third ever WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ Hack Day! 🤓🎈

On 🕓 Friday, 26th April 2024 we’ll officially kick off the WP-CLI Hack Day at 🕗 Friday, 26th April 2024, 0800 UTC. From that point on, @schlessera, @swissspidy, and I will be generally available in Slack #cli channel and on the GitHub wp-cli organization to onboard new contributors, help people pick issues to work on and remove hurdles that keep them from finishing their PRs. This will continue more or less without interruption during the entire event.

From 🕓 Friday, 26th April 2024, 0900 UTC to Friday, 26th April 2024, 1000 UTC and then again between 🕓 Friday, 26th April 2024, 1500 UTC and Friday, 26th April 2024, 1600 UTC we’ll have an open video chat that everyone can join, where we can discuss remaining issues live and chat about the progress we’ve made. This extended video chat session will then conclude the event. Shortly after 🕕 Friday, 26th April 2024, 2200 UTC, I will post a make/cli blog post about the progress we were able to make during the allotted time frame.

The 🎯 goal for this WP-CLI Hack Day is both simple and ambitious:

Finish the day with 2️⃣0️⃣ pull requests that have been merged during the event ❗️

Everyone is welcome to participate! This event is supposed to be fun and inspiring, and we expect people to help each other make progress along the way.

Let’s make this happen! 👍 The official hashtag for the event is #hackwpcli 📣

#hack-day

WP-CLI v2.9.0 release date: October 25th

The v2.9.0 release of WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ is scheduled to be published on Wednesday, October 25th 2023.

In addition to a lot of bug fixes and enhancements, this release is also expected to address the last known compatibility issues with PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.2 and the upcoming WordPress 6.4 version.

The release candidateRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. for this release will already be available sometime during the week prior, to allow for early testing. We will announce the availability of that release candidate in the #hosting-community channel to allow hosting providers to do early smoke testing.

#release, #v2-9-0

WP-CLI v2.8.0 release date

The v2.8.0 release of WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ is scheduled to be published on Wednesday, May 3rd 2023.

Amongst others a multitude of bug fixes and some new features, we’re also expecting this release to fix all known PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.2 issues within WP-CLI itself.

The release candidateRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. for this release will already be available sometime during the week prior, to allow for early testing. We will announce the availability of that release candidate in the #hosting-community channel to allow hosters to do early smoke testing.

#release, #v2-8-0

Good issues for new and existing contributors

Want to submit your first pull request to WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/? We’ve identified a few good first issues for you to get your feet wet:

If you’ve contributed to WP-CLI before, we have 77 open bugs we’d love your assistance sorting through. 😁

Read through the contributing guide for details on how to get started. Feel free to ask questions on the specific issue, or join us in the #cli channel with any questions you might have.

Thanks for your help!

WP-CLI v2.7.0 Release Notes

A new release of WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ is available as of today: WP-CLI v2.7.0. For this release, we had 48 contributors collaborate to get 195 pull requests merged. 🎉

As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible. ❤️

This is a small release with the main purpose of getting some much needed bug fixes into a stable version. Nevertheless, we also have a few new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.

Support for docker-compose run

The --ssh flag and ssh configuration key (and along with them the remote execution aliases) have learned a new scheme: docker-compose-run:.

The docker: and docker-compose: schemes for the ssh option are useful, but they only work when the target container is already running and therefore supports running a shell command via docker[-compose] exec.

Some environments, for example the wordpress-develop local development environment, run WP-CLI via a container that only starts when needed and therefore requires the use of run instead of exec.

With the support of the new docker-compose-run scheme in place you could put the following config into the root of any project that uses wordpressdevelop/cli and then simply use wp <cmd> instead of npm run env:cli -- <cmd> or docker-compose run cli -- <cmd>.

# wp-cli.yml
ssh: docker-compose-run:cli

Customizable global parameters

It was not previously possible to extend the list of parameters without modifying the WP-CLI source files. While we are still considering different options for making the global parameters extensibleExtensible This is the ability to add additional functionality to the code. Plugins extend the WordPress core software. via a clean APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways., we already needed a short-term solution for a specific use case.

Because of this, we now introduced a set of small changes that allow the global parameters to be adapted on a “platform level”. This means that, for now, you can change the global parameters, but only if you control the environment in which WP-CLI is being executed in. This functionality works through the combination of the following changes:

  • A new constant WP_CLI_CONFIG_SPEC_FILTER_CALLBACK is being checked to filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. the array that the config-spec.php file has provided.
  • A new environment variable WP_CLI_EARLY_REQUIRE is checked to allow for the environment to provide extra PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. bootstrapping logic.

You can use both of these to let the WP_CLI_EARLY_REQUIRE load a PHP file that defines a new filter callback and then sets the WP_CLI_CONFIG_SPEC_FILTER_CALLBACK to point to that filter.

This test snippet shows an example of how these two mechanisms can be used in tandem: