WP-CLI v2.10.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.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 coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. performance team is working on the Performant Translations feature project, which aims to speed up translations by using 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. http://php.net/manual/en/intro-whatis.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 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 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).

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 site list by user

When displaying a list of sites on your 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. 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-statistics flag when available [#5895]
  • Handle unparseable tags gracefully [#5894]
  • WpOrgApi: allow specifying fields request parameters [#5893]
  • Remove unneeded compatibility shim [#5885]
  • Use has_config() in get_config() to prevent warnings on null values [#5880]
  • Suggest 'network meta' intead of 'network option' [#5879]
  • Updated docblock for admin.php [#5877]
  • Fix PHP fatals when admin.php has CRLF line 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 RecursiveDataStructureTraverser to wp-cli/wp-cli package [#5864] [#5866] [#5871]
  • Add docker compose command support in SSHSSH Secure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. command generation [#5863]
  • Add missing documentation for $data attribute in http_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_table to use Runner->in_color rather than shouldColorize [#5804]

wp-cli/handbook

wp-cli/wp-cli.github.com

  • Update translations [#434]
  • Fix link in index.md [#433]
  • Update ja/index.md [#432]

wp-cli/checksum-command

  • Add edge case handling checksum verification of hello-dolly plugin [#119]

wp-cli/config-command

  • Add support for MySQLMySQL MySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/. socket connection [#171]
  • Fix tests for SQLite [#168]

wp-cli/core-command

  • Add --force-check flag to check-update command [#246]
  • Improve SQLite compatibility [#243]

wp-cli/db-command

  • Better document --skip-column-names for retrieving a specific value [#249]
  • Regenerate README file [#246]
  • Document what wp db check doesn’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 URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org [#449]
  • Fix archiving a site by numeric slug [#448]
  • Regenerate README file [#447]
  • Add origin and exclude-role-names filters to list-caps command [#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 trashTrash Trash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days. comments [#436]
  • Fix super admin test on SQLite [#434]
  • Do not assume get_super_admins() has the 0 array index [#432]
  • Improve SQLite compatibility [#431]
  • Fix example for post create command [#458]
  • Update examples for user application delete command [#457]
  • Regenerate README file [#456]
  • Fix variable name in application_name_exists polyfill [#455]
  • Add filter site__user_in on wp site list [#438]

wp-cli/extension-command

  • Regenerate README file [#381]
  • Add update_version to the default fields for plugin and theme commands [#380]
  • Update some tests for SQLite [#378]
  • Remove duplicated code [#391]
  • Switch tests to use site-secrets instead of user-switching [#389]
  • Support 'wporg_status' and 'wporg_last_updated' as optional wp plugin list fields [#382]
  • Regenerate README file [#397]
  • Added --minor and --patch CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. option in wp 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-php command [#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 JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. & PHP translation files [#137]

wp-cli/maintenance-mode-command

  • Evaluate $upgrading numeric value when checking if maintenance mode is active [#22]

wp-cli/media-command

  • Add --file_name=<name> argument for wp media import [#187]

wp-cli/package-command

  • Fix compatibility with newer Composer versions [#183]

wp-cli/php-cli-tools

  • Fix maxFlag to flagMax and maxOption to optionMax typos in HelpScreen class [#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-mysql for 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

  • Replace DOS line endings with LF [#49]
  • Fix empty line comment parsing by checking for the existing of a line ending [#48]

Contributors

#release, #v2-10-0