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. http://php.net/manual/en/intro-whatis.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

WP-CLI v2.7.1 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.1. For this release, we hadĀ 4 contributorsĀ collaborate to getĀ 12 pull requestsĀ merged.Ā 

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

This is a patch release to fix a few regressions that were introduced with release v2.7.0.

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 anĀ allow-pluginsĀ rule to Composer

wp-cli/core-command

  • Avoid deleting TinyMCE themes/plugins by using more precise check [#215]

wp-cli/db-command

  • Fix 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. 8.1 fatal error with --orderby=size and --size_format=mb [#230]

wp-cli/extension-command

  • Avoid throwing error when excluding missing 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 [#332]

wp-cli/search-replace-command

  • Use empty string default value for flags to safeguard the use ofĀ explode() [#169]

Contributors

@cjhaas, @danielbachhuber, @schlessera, @wojsmol

#release, #v2-7-1

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. http://php.net/manual/en/intro-whatis.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:

Download WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. files without extracting them

Previously, you could already use the core download command not only to retrieve the set of files from the WordPress central servers. But we did not have a way to solely download a ZIP archive of WordPress Core instead.

Now you can do so via the --extract flag. This is on by default to keep with the current behavior, but you can now switch extraction off by adding the --no-extract flag.

Why would you do that, if it is a single file download you could also trigger via wget or curl? Well, for one, it uses the HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. stack of WordPress/WP-CLI to do the download. And what’s more, it allows you to use the smart WP-CLI flags like --version to automatically retrieve the file from the right URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org.

Directly install a specific locale

Previously, when you wanted to install a locale of WordPress Core other than the default en_US, you had to first run a wp core install, and then switch the locale in a second step.

Now, WP-CLI allows you to select a specific locale right away via core installā€˜s new --locale flag.

Ordering of the db size results

To quickly see what the biggest tables in your installation are, you can now make use of the new --order and --orderby flags. The most useful example would be to use --orderby=size --order=desc to get the largest tables first.

Clean duplicate metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. values

Due to limitations of the WordPress database schema, the WordPress importer can end up inadvertently creating duplicate post meta entries if the import is run multiple times.

WP-CLI has now learned a new command to remove duplicate post meta values for a given meta key.

# Delete duplicate post meta.
wp post meta clean-duplicates 1234 enclosure
Success: Cleaned up duplicate 'enclosure' meta values.

Exclude select plugins on certain 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 commands

The plugin commands activate, deactivate, delete and uninstall now accept an additional --exclude flag if you use their --all flag.

The --exclude accepts a comma-separated list of plugin slugs, and allows you to do operations in the vein of ā€œdeactivate all plugins except for these few onesā€.

# Deactivate all plugins with exclusion
$ wp plugin deactivate --all --exclude=hello,wordpress-seo
Plugin 'contact-form-7' deactivated.
Plugin 'ninja-forms' deactivated.
Success: Deactivated 2 of 2 plugins.

Multiple changes to the i18n support

In our ongoing effort to further internationalization support within 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/, we have made yet another around of i18n changes and additions.

Most of the changes deal with changes to block.json and theme.json, in order to support all the latest fields and mechanisms.

Also, there is now a new update-po command. Up until now, if you added a new translation to one of your plugins, you could update the messages.pot file with make-pot, but you’d have to update existing po files with the new translation by hand. With the new i18n update-po (which is a WP-CLI alternative to msgmerge), you get around this without requiring manual edits.

And finally, i18n now supports PHP Blade templates as an additional input format to parse for translations.

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 an allow-plugins rule to Composer

wp-cli/wp-cli-bundle

  • Add eftect/bladeone to PHAR for i18n-command [#417]

wp-cli/wp-cli

  • Add support forĀ docker-compose runĀ to theĀ --sshĀ option [#5637]
  • Internalize global_terms_enabled() [#5684]
  • Add cache directory path to cli info output [#5681]
  • Always return PHP_BINARY when using a PHAR bundle [#5672]
  • Load config-spec.php in a ā€œfilterableā€ way [#5664]
  • Use different action for admin context logic [#5663]
  • Require v3.1.6 of wp-cli/wp-cli-tests [#5659]
  • Address some PHP 8.1 deprecation notices [#5658]
  • Document return type for WP_CLI::halt() as never [#5651]
  • Fix skip theme tests [#5646]
  • Add missing $upgrade argument to enable_maintenance_mode filter [#5630]
  • Handle optional option values in SynopsisParser::render() [#5618]
  • Add missing relative namespace [#5616]

wp-cli/handbook

  • Add additional instructions to override the DB test credentials. [#410]

wp-cli/cache-command

  • Make transients deletion test more robust [#74]

wp-cli/config-command

  • Prevent WP_DEBUG already defined when provided via --extra-php [#144]

wp-cli/core-command

  • Add --extract flag to core download [#204]
  • Update the link in the docblock of core multisite-convert command [#201]
  • Add --locale parameter [#133]
  • Remove only themes/plugins folders on --skip-content [#212]

wp-cli/db-command

  • Fix broken tests due to DB connection failure error message change [#224]
  • Stop reordering most 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/. arguments [#221]
  • Add support for --order, --orderby flags in db size command [#226]

wp-cli/entity-command

  • Use https in post generate example [#355]
  • Support filtering for users without a role with --role=none [#360]
  • Sync user-contributed example to user delete [#358]
  • Fix 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. formatting in feature file [#368]
  • Add post meta clean-duplicates <id> <key> command [#366]
  • Document primary_blog meta key for users [#365]
  • Allow user_url to be set with user create [#372]
  • Show error when parameter is missing in option patch [#371]
  • Use current_time() for setting the default value for user_registered in user create [#378]
  • Add examples for option patch command [#375]

wp-cli/export-command

  • Fix test for attachment serialization [#96]

wp-cli/extension-command

  • Add optional --exclude=<name> argument for multiple plugin commands [#321]
  • Fix broken Behat tests [#318]
  • Add title/description for mu-plugins [#305]
  • Avoid deleting parent of active theme unless using --force [#324]
  • Exit with 0 when checked theme is active parent theme [#327]

wp-cli/i18n-command

  • Extract pattern metadata (title & description) [#312]
  • Look for theme.json files in the styles directory of a theme [#311]
  • Translate title field from theme.json [#306]
  • Add support for PHP-Blade files [#304]
  • Fix include logic where include path is subdirectory of excluded path [#302]
  • Add missing docs for make-mo command [#315]
  • Add update-po command [#316]
  • Improve warnings for strings with different comments [#318]
  • Extract some shared code into FileDataExtractor [#321]
  • Update and combine theme.json and block.json extractors [#319]
  • Improve theme patterns and styles lookup [#320]
  • Use preg_match instead of mb_ereg [#317]
  • Prefix JSON files with text domain if needed [#313]

wp-cli/import-command

  • Bail with status code if file does not exist [#75]

wp-cli/language-command

  • Add warning for nonexistent plugins [#115]

wp-cli/media-command

  • Fix read error detection in EXIF discovery [#162]

wp-cli/package-command

  • Adapt test for changed Composer output [#151]

wp-cli/php-cli-tools

  • Fix ${var} string interpolation deprecation [#148]
  • Fix logic to check for TTY [#146]

wp-cli/scaffold-command

  • Deprecate scaffold block in favor of @wordpress/create-block [#311]
  • Add 'testsuite' name in phpunit.xml.dist [#310]
  • Add backup files ending with tilde to default .distignore [#273]

wp-cli/search-replace-command

  • Restore blogdescription to fix test [#171]
  • Add further suppression of warnings and notices [#172]

wp-cli/server-command

  • Restore blogdescription to fix test [#75]

Contributors

@2ndkauboy, @alexstine, @Ayesh, @BhargavBhandari90, @borkweb, @brandonpayton, @connerbw, @dan-m-joh, @danielbachhuber, @dd32, @dlind1, @drzraf, @Flimm, @gedex, @GeoJunkie, @github-actions[bot], @gitlost, @greatislander, @herregroen, @janw-me, @jenkoian, @johnbillion, @jorgeatorres, @jrfnl, @kjohnson, @l3ku, @localheinz, @lucatume, @matzeeable, @michaelzangl, @oandregal, @ocean90, @pbiron, @pdaalder, @pmbaldha, @ponsfrilus, @schlessera, @shendy-a8c, @Sidsector9, @siliconforks, @strarsis, @swissspidy, @Tug, @tyrann0us, @versusbassz, @wojsmol, @xyulex, @yousan

#release, #v2-7-0

WP-CLI v2.6.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.6.0. For this release, we had 57 contributors collaborate to get 311 pull requests merged. šŸŽ‰

The pandemic is still controlling our daily lives, and as a side-effect we still notice a significant reduction in contributors to WP-CLI, probably due to the lack of in-person contributor days.

As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible – even with a reduced number of contributors. ā¤ļø

Apart from the numerous bug fixes that were included in this release, we also managed to snuggle in a few new features that add to the power or convenience of your CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. experience, so I want to spend a few paragraphs going over some of the noteworthy changes. As always, you can also skip directly to theĀ detailed changelogĀ if you prefer.

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. 8.1 Support

WP-CLI now officially supports PHP 8.1. All commands are being extensively tested against PHP 8 and the actual development is currently being done on PHP 8.1 as well.

However, keep in mind that PHP 8.1 support is not fully there for WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., and especially for a large part of plugins and themes. Due to the nature of the changes that PHP 8.1 brings about, it is very easy to break perfectly compatible WordPress Core or WP-CLI via the actions/filters system. Keep this in mind when trying to diagnose PHP 8.1 compatibility issues and trying to deduce where the erroneous code is to be found.

Tabular data showing a timeline with supported PHP releases, with only 8.0 and 8.1 currently in active support.

For those of you who are not closely following the PHP release cycles, please be aware that only PHP 8.0 and 8.1 are currently actively supported versions. WP-CLI sticks with the WordPress Core PHP support policy (+ 1 year), which means we’re still spending huge amounts of efforts to keep everything running all the way down to PHP 5.6 at the moment.

If you want to help the maintainers in their work, please ensure that all your sites run on the latest PHP versions, and nag your hosting providers to move everything over to the latest and greatest. WordPress will only bump the minimum version when the number of active sites on PHP 5.6 has dropped to an insignificant amount.

New commands for managing application passwords

The following commands were added to allow CLI users to create and manage WordPress application passwords:

  • wp user application-password list
  • wp user application-password get
  • wp user application-password exists
  • wp user application-password update
  • wp user application-password record-usage
  • wp user application-password create
  • wp user application-password delete
WP-CLI examples of creating a new application password and then listing all existing application passwords for that same user.

Although you could technically already work with application passwords by directly controlling the WordPress user-metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. table, this now provides 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. that abstracts away the technical implementation. See the Application Passwords: Integration Guide to find out more about how to use them.

New global flag:Ā --context

A new global flag --context=<context>Ā was added which allows users to select the WordPress context in which WP-CLI is supposed to execute its command(s).

One of the main goals is to allow WP-CLI to run updates on premium plugins and themes without requiring any special setup. From our initial testing, this allows a large range of popular premium extensions to just workā„¢ļø with WP-CLI in terms of their update procedures.

Possible values for this flag with this initial release:

  • cli: The context which has been the default before introduction of this flag. This is something in-between a frontend and an admin request, to get around some of the quirks of WordPress when running on the console.
  • admin: A context that simulates running a command as if it would be executed in the administration backend. This is meant to be used to get around issues with plugins that limit functionality behind anĀ is_admin()Ā check.
  • auto: Switches betweenĀ cliĀ andĀ adminĀ depending on which command is being used. For this initial release, allĀ wp plugin *Ā andĀ wp theme *Ā commands will useĀ admin, while all other commands will useĀ cli.
  • frontend: [WIP] This does nothing yet.

Roadmap: By default, theĀ --contextĀ flag will be set toĀ cliĀ with this initial release (v2.6.0). With WP-CLI v2.7.0, the default will change toĀ auto. This gradual deployment will allow hosters and site owners to run tests on v2.6.0 by manually setting the context before the default behavior is changed.

If you want to use the future default of --context=auto right away in your present operations, you can do so by adding the necessary context: auto line to your global wp-cli.yml configuration file. Feel free to check the documentation on WP-CLI configuration files if this is new to you.

We also have a new hook to support this new global flag: before_registering_contexts.Ā This hook behaves like a 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. with one argument:Ā array<string, Context> $contexts. When hooking into this hook, the callback should return (a potentially modified)Ā $contextsĀ value. This can be used to remove or override bundled contexts or add new ones.

To make this work, the hook functionality in WP-CLI (provided viaĀ WP_CLI::do_hook()) was modified to return the first argument if arguments were provided.

Thanks toĀ CloudwaysĀ for the special support and testing of this new flag with the goal of solving the ā€œpremium updates problemā€ for everyone.

Configurable WP-CLI cache settings

The WP-CLI file cache can now be configured via the following environment variables:

  • WP_CLI_CACHE_DIR – Directory in which to store the cached files. Default value:Ā "$home/.wp-cli/cache".
  • WP_CLI_CACHE_EXPIRY – Time after which cached files are automatically purged, in seconds. Default value:Ā 15552000Ā (6 months).
  • WP_CLI_CACHE_MAX_SIZE – Total size of the file cache after which older files are purged, in bytes. Default value:Ā 314572800Ā (300 MB).

This not only allows you to fine-tune the WP-CLI cache behavior for the best balance between available storage and bandwidth usage, it could also be used to share cache storage between installations/users (beware the security implications, though!).

Use custom names/locations for the wp-config.php file

The different config * commands now accept a new flag --config-file=<filepath> that allow you point the different manipulations towards a custom location, that might not even fully adhere to conventions for the WordPress wp-config.php file.

This allows you for example to use the config set command for a configuration file outside of the WordPress document root (and parent folder).

Keep in mind that you’re on your own when it comes to making WordPress understand the structure and bootstrap correctly!

Generate a dotenv file from your existing wp-config.php file

For all the 12-factor app fans out there, WP-CLI has learnt a new format for its config list command: --format=dotenv. This will take the existing configuration key/value pairs in your wp-config.php file and render them in a format that you can use in a .env file.

WP-CLI example of list the contents of the wp-config.php file into a file in dotenv format and then showing the result.

Combine with the previously mentioned --config-file to extract the dotenv file from an arbitrary location, even without a WordPress installation present.

Allow 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/theme enumeration without forcing an update check

Previously, when you run plugin list or theme list, WP-CLI would automatically run a check in the background to see if updates are available. This is slow and expensive to do, and might not always be what is needed, especially in scripting scenarios.

This automatic check for updates can now be disabled for these two commands with the --skip-update-check flag. This can drastically speed up some scripts and make them more reliable.

New flag --strict for adapting the filtering of taxonomies by post type

When retrieving taxonomies for a given post type, the old default behavior of WordPress (through the use of get_taxonomies()) is to only show those taxonomies that have as a sole associated post type the requested one. Taxonomies that have multiple associated post types, including the requested one, are not returned.

WordPress had added a newer mechanism via get_object_taxonomies() that would return all taxonomies that are in some way associated with the requested post type, even if other post types are associated as well.

WP-CLI now has a new --strict flag for the taxonomy list command that defines whether the strict filtering (the old default) should be used, or the more sensible inclusive approach should be used via --no-strict (or --strict=false).

We’ve opted to make this new, more sensible approach (i.e. --no-strict) the new default, so be mindful of that if you’re using taxonomy list in a script somewhere.

Another round of improvements to the i18n * commands

As with all of the recent releases, the i18n * commands have received yet another round of overall improvements to keep in sync with the localisation requirements of WordPress Core.

From new flags like --subtract-and-merge, --update-mo-files & --location and multiple improvements to the way JavascriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. syntax is parsed all the way up to the support for the new theme.json format, all your localization needs should be accounted for (at least for now).

Make your to check out the detailed logs to find out more and play around with the new functionality when you get the chance!

With super admin permissions come super admin consequences!

WP-CLI now mirrors the behavior of WordPress core and triggers various hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. when you grant or revoke the super admin status to users.

The following actions are being triggered now but the super-admin add & super-admin remove commands:

  • grant_super_adminĀ (before changes,Ā alwaysĀ executed)
  • granted_super_adminĀ (after changes, executed only on success)
  • revoke_super_adminĀ (before changes,Ā alwaysĀ executed)
  • revoked_super_adminĀ (after changes, executed only on success)

Changes to the default branches

In order to make the language used in the code and documentation of WP-CLI more inclusive, work has started to change the name of default branch across all repositories. From now on, the default branch name across the WP-CLI 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/ organization is main.

This change is currently a work in progress, as it unfortunately causes open pull requests to be automatically closed and often become unsalvageable. The current progress of this effort can be monitored here: wp-cli/wp-cli#5598.

Keep this in mind when you want to check out the latest development state of a repository or contribute by creating a PR!

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 an allow-plugins rule to Composer

wp-cli/wp-cli-bundle

  • Disable deployments on forks [#389]
  • DeployDeploy Launching code from a local development environment to the production web server, so that it's available to visitors. from main branch [#385]
  • Revert usage of Mustache fork [#373]
  • Use latest branch for Roave security advisories [#357]
  • Add DEB build workflow [#345]
  • Add RPM build workflow [#344]
  • Switch to dev-master for wp-cli framework [#333]

wp-cli/wp-cli

  • Adapt VERSION from 2.5.1-alpha to 2.6.0-alpha [#5605]
  • Fix Composer stack tests [#5599]
  • Detect and ignore BOMs [#5597]
  • Check github.repository_owner in automerge workflow [#5591]
  • Revert addition of the Mustache PHP 8.1 workaround and update dependency [#5590]
  • Use Mustache work-around for PHP 8.1 compat [#5588]
  • Use fork on schlessera for Mustache PHP 8.1 fix [#5587]
  • Re-add subcommands on all composite commands that are overwritten [#5584]
  • Fix default mysqli error reporting mode for PHP 8.1+ [#5582]
  • Add --context flag [#5581]
  • Make cache size and expiry configurable via environment variables [#5576]
  • Updated default branch for roave/security-advisories [#5575]
  • Fix wrong variable name used in argument parsing [#5564]
  • Fix regression that broke extending existing commands [#5563]
  • Add a SECURITY.md file [#5562]
  • Update credits [#5556]
  • Pass in arguments to before_run_command hook [#5554]
  • Change ā€œFake Siteā€ site name to ā€œWordPressā€ in core multisite-install command [#5552]
  • Add missing docblocks [#5551]
  • Make logger accessible and add colorization control to Quiet logger [#5549]
  • Fix OOM issues when exporting to STDOUT [#5546]
  • Allow WP_DEBUG_LOG to override the debug.log location [#5511]

wp-cli/handbook

  • Document the exec global parameter [#397]
  • Provide example of optional positional arguments [#390]
  • Added create table statement. [#389]

wp-cli/wp-cli.github.com

  • UpdateĀ zh-cnĀ translation file [#422]
  • Update build status badge [#416]
  • Fix quick links anchors in German translation [#415]

wp-cli/cache-command

  • Add PHP 8.1 support [#72]

wp-cli/checksum-command

  • Add PHP 8.1 support [#89]

wp-cli/config-command

  • Add PHP 8.1 support [#135]
  • Document special EOF anchor [#136]
  • Add --config-file argument to process custom configuration files [#104]
  • Add dotenv format option to config get command [#102]
  • Escape values to avoid breaking them within single quotes [#95]
  • Update the wp-config.php template [#139]

wp-cli/core-command

  • Update download_package() function signature [#197]
  • Support case-insensitive filesystems when pruning files after update [#196]
  • Do not exit on error but pass on error [#193]

wp-cli/cron-command

  • Add PHP 8.1 support [#77]
  • Adapt feature test to use HTTPSHTTPS HTTPS is an acronym for Hyper Text Transfer Protocol Secure. HTTPS is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The 'S' at the end of HTTPS stands for 'Secure'. It means all communications between your browser and the website are encrypted. This is especially helpful for protecting sensitive data like banking information. with example.com [#78]
  • Promote a non-200 response from the cron spawn test to an error [#66]

wp-cli/db-command

  • Refactor --defaults flag handling [#205]
  • Adapt mysqldump message string to check for in tests [#201]
  • Set 'utf8mb4' when exporting without '--default-character-set' option [#199]
  • Add decimal numbers to wp db size [#163]
  • Add --defaults flag to remaining commands [#206]
  • Add PHP 8.1 support [#214]
  • Fix table existence check in db columns [#210]
  • Adapt feature test to use HTTPS with example.com [#216]
  • Fix ā€œWP_DEBUG already definedā€ test failure [#220]

wp-cli/embed-command

  • Add PHP 8.1 support [#65]

wp-cli/entity-command

  • Support PHP 8.1 [#331]
  • Update example input to reflect example output [#326]
  • Document default post type filtering for post list command [#321]
  • Correct the home URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org when listing sites [#312]
  • Adapt http => https URLs [#339]
  • Add application password commands [#330]
  • Better error message when trying to delete super admin [#304]
  • Recalculate menu order on insertion or deletion [#275]
  • Add strict/no-strict mode for taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies. list [#256]

wp-cli/eval-command

  • Add PHP 8.1 support [#60]

wp-cli/export-command

  • Ensure post attachment meta is exported correctly [#89]
  • Only add needed user when filtering by --author [#88]
  • Adapt tests [#87]
  • Fix categoryCategory The 'category' taxonomy lets you group posts / content together that share a common bond. Categories are pre-defined and broad ranging., tag and term names missing in export [#86]
  • Add the_title_export filter and cdata for item title to export [#77]
  • Add PHP 8.1 support [#93]
  • Adapt feature test to use HTTPS with example.com [#94]

wp-cli/extension-command

  • Fix test issues [#293]
  • Fix incorrect examples [#290]
  • Check for WP_Error on bulk updates [#294]
  • Add support for PHP 8.1 [#306]
  • Replace one-time-login with a sample plugin in the tests [#302]
  • Add --skip-update-check flag to plugin list and theme list commands [#300]
  • Ensure bundled themes don’t interfere with update tests [#311]

wp-cli/i18n-command

  • Fix tests [#268]
  • Add subtract-and-merge flag [#267]
  • Use more inclusive language in argument description [#266]
  • Add new --update-mo-files flag to make-json [#265]
  • AddĀ new --locationĀ flag to omit source code references [#264]
  • Add ext-mbstring to list of suggested dependencies [#263]
  • Prevent adding JS comments to multiple strings [#261]
  • Fix string extraction when using template literals [#260]
  • Update version constraint for mck89/peast [#259]
  • Fix plural extraction in JS [#258]
  • Remove now unneeded workaround in JS scanner [#256]
  • Extract strings for translation from theme.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. [#254]
  • Fix string extraction from block.json [#253]
  • Add support to IterableCodeExtractor for symlinks. [#249]
  • Add PHP 8.1 support [#293]
  • Add new field to translate in theme.json [#292]
  • Fix JS string extraction with unsupported argument type [#296]

wp-cli/import-command

  • Add PHP 8.1 support [#71]

wp-cli/language-command

  • Add PHP 8.1 support [#111]

wp-cli/maintenance-mode-command

  • Add PHP 8.1 support [#20]

wp-cli/media-command

  • Add PHP 8.1 support [#153]
  • Add missing intermediate_image_sizes_advanced filter argument for WP 5.3+ [#150]

wp-cli/package-command

  • Only allow secure Composer versions [#144]
  • Support PHP 8.1 [#143]
  • Fetch default branch for GitHub packages [#146]
  • Support common default development branches [#148]

wp-cli/php-cli-tools

  • Update TTY checks [#145]

wp-cli/rewrite-command

  • Add PHP 8.1 support [#54]

wp-cli/role-command

  • Add PHP 8.1 support [#49]

wp-cli/scaffold-command

  • Fix testing on WordPress trunk version [#297]
  • Ignore .github directory in .distignore [#295]
  • Allow for diverging PHPUnit version specifics in tests [#304]
  • Add PHP 8.1 support [#301]

wp-cli/search-replace-command

  • Fix offset handling when doing chunked replacements [#162]
  • Add strict comparisons for color tests [#163]
  • Add PHP 8.1 support [#166]
  • Adapt feature test to use HTTPS with example.com [#167]

wp-cli/server-command

  • Add PHP 8.1 support [#72]

wp-cli/shell-command

  • Add PHP 8.1 support [#58]

wp-cli/super-admin-command

  • Add PHP 8.1 support [#48]
  • Trigger core actions when granting or revoking super-admin permissions [#20]

wp-cli/widget-command

  • Append new widgets to the bottom of a sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. [#52]
  • Decouple tests from default theme widgets [#51]
  • Add PHP 8.1 support [#53]

wp-cli/wp-config-transformer

  • Adapt tests for polyfilled test case [#36]

Contributors

@bgturner, @BhargavBhandari90, @CodeProKid, @connerbw, @dd32, @dh-programacion, @dlind1, @drzraf, @felixarntz, @gedex, @gitlost, @grappler, @greatislander, @herregroen, @imadphp, @janw-me, @jenkoian, @jmdodd, @johnbillion, @johnjago, @jrfnl, @kapilpaul, @KarlAustin, @l3ku, @localheinz, @matzeeable, @mbuxsoomro, @michaelzangl, @mircobabini, @mn7zDev, @mrkaluzny, @nickdaugherty, @Nikschavan, @oandregal, @ocean90, @pbiron, @pdaalder, @petruchek, @pmbaldha, @ponsfrilus, @ryotsun, @saz, @schlessera, @seatonjiang, @siliconforks, @skeltoac, @stefanpejcic, @stodorovic, @swissspidy, @tammelin, @thomasplevy, @Tug, @tyrann0us, @UVLabs, @wojsmol, @wpamitkumar, @yousan

#release, #v2-6-0

WP-CLI v2.5.0 Release Notes

Here it finally is, the long-awaited 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/ release v2.5.0! For this release, we had 73 contributors collaborate to get a whopping 600 pull requests merged.

It was a very tough release to get out, as so many different systems and dependencies all broke or had issues at the same time: 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., 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/., Travis CI, Composer, Requests, … all of these produced major compatibility issues in a seemingly concerted effort! šŸ˜…

More importantly, though, I’m pretty certain that all of the WP-CLI contributors were additionally suffering under the ā€œnew normalā€ of COVID-19 – those contributors lucky enough to still earn regular income during the pandemic are still battling health issues (for themselves and their family), isolation and burnout.

As a maintainer, my initial plan was to devise special events and additional incentives to hopefully raise the level of contribution back up again. But I decided against doing so. Even though we all can’t wait to get a new release out and onto servers, I did not want to add to the additional pressure that the volunteer contributors are already feeling right now. The risks of burnout or other negative effects on mental health have never been so prevalent than now where everyone has to dial down their social support systems. In that perspective, I opted to knowingly go with a longer release time. I am fully aware that a lot of companies had to look into extra workarounds or similar to deal with the late release, but I had to assume that this still happens in a paid capacity. Given the global situation, this seemed more justifiable to me than moving the cost towards volunteer health instead.

Thanks to all the support I had during the extended release time, not least to the WP-CLI sponsors who have allowed me to personally invest as much time as needed into the project to make this release happen.

Now, with that being said, let’s go over some of the noteworthy changes in this release. As always, you can also skip directly to theĀ detailed changelogĀ if you prefer.

Security Fixes

This release fixes one direct and one upstream security vulnerability, so it is recommended for everyone to update to this latest release.

Improper Certificate Validation in WP-CLI framework

This security vulnerability is categorized as CWE-295: Improper Certificate Validation with a CSSCSS CSS is an acronym for cascading style sheets. This is what controls the design or look and feel of a site. V3 severity rating of ā€˜highā€˜ and was disclosed as CVE-2021-29504 (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/ security advisory GHSA-rwgm-f83r-v3qj).

An improper error handling in HTTPSHTTPS HTTPS is an acronym for Hyper Text Transfer Protocol Secure. HTTPS is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The 'S' at the end of HTTPS stands for 'Secure'. It means all communications between your browser and the website are encrypted. This is especially helpful for protecting sensitive data like banking information. requests management in WP-CLI version 0.12.0 and later allows remote attackers able to intercept the communication to remotely disable the certificate verification on WP-CLI side, gaining full control over the communication content, including the ability to impersonate update servers and push malicious updates towards WordPress instances controlled by the vulnerable WP-CLI agent, or push malicious updates toward WP-CLI itself.

The vulnerability stems from the fact that the default behavior of WP_CLI\Utils\http_request() when encountering a TLS handshake error is to disable certificate validation and retry the same request.

The default behavior has been changed with version 2.5.0 of WP-CLI and the wp-cli/wp-cli framework (via wp-cli/wp-cli#5523) so that the WP_CLI\Utils\http_request() method accepts an $insecure option that is false by default and consequently that a TLS handshake failure is a hard error by default. This new default is a breaking change and ripples through to all consumers of WP_CLI\Utils\http_request(), including those in separate WP-CLI bundled or third-party packages.

Insecure Deserialization of untrusted data in upstream Requests library

This security vulnerability is categorized as CWE-502: Deserialization of Untrusted Data with a CSS V3 severity rating of ā€˜criticalā€˜ and was disclosed as CVE-2021-29476.

The vulnerability was found in the FilteredIterator class and was first reported to the WordPress project. The security fix applied to WordPress has been ported back into the Requests library and was distributed with release v1.8.0.

Breaking Changes

The security fix for CVE-2021-29504 detailed above led to a breaking change where the retry behavior of commands that use remote requests is disabled. Furthermore, the framework is stricter in making use of the certificates that are provided via environment settings.

This means that automated systems that previously succeeded with reliable downloads of external assets can now start to fail because there is an issue with the certificate verification. This can be due to either the environment being misconfigured for certificate verification or the server to connect to actually being insecure.

To get back to the previous behavior, the affected commands now include a new --insecure flag that re-enables the insecure retrying mechanism again. Beware: This opens up these remote requests to man-in-the-middle attacks!

The following commands were affected and were adapted to recognize this new --insecure flag:

  • cli update
  • config create
  • config shuffle-salts
  • core download
  • core update
  • core verify-checksums
  • package install
  • plugin install
  • plugin update
  • plugin verify-checksums
  • theme install
  • theme update

PHP 8 support

WP-CLI now officially supports PHP 8. All commands are being extensively tested against PHP 8 and the actual development is currently being done on PHP 8 as well.

However, keep in mind that PHP 8 support is not fully there for WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., and especially for a large part of plugins and themes. Due to the nature of the changes that PHP 8 brings about, it is very easy to break perfectly compatible WordPress Core or WP-CLI via the actions/filters system. Keep this in mind when trying to diagnose PHP 8 compatibility issues and trying to deduce where the erroneous code is to be found.

Improved MySQL/MariaDB support

As it turns out, WordPress Core has not been compatible with a default MySQL database for a while now. What actually happens is that WordPress switches the database in a sort of ā€œlegacyā€ mode at runtime. This has caused the WP-CLI code that uses WPDB to slowly diverge in results from the code that makes direct database requests via the mysql shell binary.

This has now been rectified (at least for all of the major use cases) by letting WP-CLI employ the same ā€œlegacyā€ database mode via a few hacks around the mysql binary.

Package Manager is now powered by Composer v2

Composer v2 has drastically improved both the processing time as well as the memory usage of its dependency resolution mechanisms. And now the WP-CLI Package Manager that you can use via wp package * commands gets to benefit from these same improvements, at it internally uses the new Composer v2 code.

This should also make the dreaded Out-Of-Memory problems with package installation much rarer, even on shared hosting or tight Docker containers.

New commands for managing automatic updates

The following commands were added to allow you to manage the state of automatic updates for plugins and themes:

  • plugin auto-updates disable
  • plugin auto-updates enable
  • plugin auto-updates status
  • theme auto-updates disable
  • theme auto-updates enable
  • theme auto-updates status

Although you could technically already work on the state of the automatic updates by directly controlling the WordPress Options table, this now provides 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. that abstracts away the technical implementation.

New command for creating MO files

A new command was added to the wp-cli/i18-command package for creating MO files from existing PO files. This can be useful if you use a translation platform that can only output PO files, or tooling that modifies these files.

// Reads from a single .po file.
$ wp i18n make-mo ./wp-content/languages/slug.po
Success: Created 1 file.

// Reads from a directory for multiple .po files.
$ wp i18n make-mo ./wp-content/languages/
Success: Created 5 files.

Smarter I18N handling of JS files

The ongoing effort to improve the internationalization of client-side JavascriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. code that is made necessary by the move to the blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience.-based editor has led to a number of improvements to the i18n make-pot command.

Apart from understanding more complex Javascript constructs, like webpack bundling and JS eval() statements, the i18n make-pot now also parses the new block.json file as it is defined in the Block Type Registration RFC. This can optionally be skipped via the new --skip-block-json flag.

New environment variable: WP_CLI_ALLOW_ROOT

When you’ve been using WP-CLI within a Docker container, you’ve probably noticed the big ā€œYIKES!ā€ message you get that aborts the execution of the command if it detects that you’re running as root. You’d then have to add the --allow-root flag to every single command you run within that container.

Within a docker container, everything is done as the root user, though, and there’s no really security issue, as the container itself acts as a sandbox. Therefore, WP-CLI now allows you to let it know not to warn about the root user via the new WP_CLI_ALLOW_ROOT environment variable. Just set this variable through in your container’s ENV section, and you’re good to go – no need for multiple --allow-root flags anymore.

New global parameter: --exec

Some scenarios require you to run a small PHP snippet before the actual WP-CLI command, to make sure the command runs under the right context or encounters the right environment. You would typically do this by creating a PHP file with the code snippet that needs to be executed and then using the --require global parameter to load that file upfront before the command gets executed.

This is very cumbersome for short snippets, though, or not even easily possible on read-only filesystems. Therefore, WP-CLI now also accepts a new global parameter --exec that you can use to execute PHP logic directly from the command-line before running the actual command.

$ wp --exec='define( "WP_ADMIN", true );' plugin update --all

Support for third-party WP-CLI packages on GitLab

The WP-CLI package manager now supports GitLab URLs. This means you can host your custom commands on GitLab and still easily install them right from the VCS:

$ wp package install https://gitlab.com/my/package.git

Chunked queries in search-replace to avoid memory issues

When you need to run a search & replace operation on a very large database, you can easily run into memory issues. WP-CLI tried to fetch all matching query results into memory to loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. over them.

This type of operation is now processed via a chunked loop that works on 1000 query results at a time via pagination. This drastically reduces the memory requirements and decouples them from the database size.

This is just the first command that receives this treatment, but expect to see more of such scalability fixes in the future.

Hide global parameters help

If you’re a more seasoned WP-CLI, you might have been annoyed from time to time about the wasted screen real estate on the help screens that always append the list of global parameters every single time.

You can now choose to skip the display of these global parameters by setting the following environment variable:

export WP_CLI_SUPPRESS_GLOBAL_PARAMS=true

All the help screens will then only display the help for the current context.

Switch from Travis CI to GitHub Actions

For multiple different reasons, I decided to move away from Travis CI, and I ended up migrating the entire infrastructure (testing, automation, deployment, publication, …) over to GitHub Actions.

You will now find a .github/workflows folder in each of the repositories that contains a set of workflows for that repository. However, we also have a new wp-cli/.github repository. This contains centralized workflows that mostly deal with keeping the workflows and configurations across all of the other repositories in sync.

This means that, when I now need to make a change in the testing workflow, for example, I don’t need to manually create a pull request in each of the packages. I modify the template workflow in the wp-cli/.github repository instead, and this one then syncs all the changes over to the individual repositories.

The added automation details, as well as the much improved parallelization of running the tests in GitHub Actions has drastically accelerated the development experience and ultimately leads to faster and cheaper maintenance of the entire project.

Documentation is automatically kept in sync

If you’ve contributed to one of the commands before, I might have required you to install the wp-cli/scaffold-package-command package and run a cryptic command on your PR to get the README.md file updated based on changes in the code’s docblocks. This was an awful contributor experience and I wanted to get rid of that requirement.

When I initially experimented with a git hook to automatically add a commit on PRs when they are pushed, I realized that that approach leads down to a path of merge conflicts and confusion.

The move from Travis CI to GitHub Actions was a good opportunity to revisit this, as I have now solved this problem via an automated GitHub Actions workflow. Whenever changes are pushed to the default branch of a repository, the GitHub Actions bot will try to regenerate the documentation and if this actually produced any changes, it creates a new pull request with the needed patch.

This PR can then be reviewed and merged just like any other contribution. It happens independently of the code change a contributor submitted, so they don’t need to worry about any of this.

MigrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. to Behat v3

WP-CLI has been stuck with Behat v2 for quite a while now, and this also had an impact on the dependencies we needed to rely on. This made the move to PHP 8 compatibility all the more difficult. Therefore wp-cli/wp-cli-tests was updated to migrate from Behat v2 to Behat v3.

Apart from multiple improvements of the syntax and its execution, this also finally makes it easy to reuse the functional testing infrastructure outside of a wp-cli package. Expect to see a guide on how to migrate your own package code to Behat v3 as well as on how to use wp-cli/wp-cli-tests within other contexts soon.

More flexible test setup

The test setup was made way more configurable to adapt to less standardized environments. Where it was previously difficult to run the tests on a non-traditional stack like a Docker network or a GitHub Actions environment, this can now be easily done via a set of new environment variables.

The database credentials can now be provided via the following environment variables:

WP_CLI_TEST_DBHOST host to use and can include a port, i.e ā€œ127.0.0.1:33060ā€localhost
WP_CLI_TEST_DBROOTUSER user that has permission to administer databases and usersroot
WP_CLI_TEST_DBROOTPASS password to use for the above user(empty password)
WP_CLI_TEST_DBUSER user that the tests run underwp_cli_test
WP_CLI_TEST_DBPASS password to use for the above userpassword1

Provided that these environment variables are present and that your database is online, a simple composer prepare-tests will take care of everything.

Detailed change log

To avoid too much noise in the list above, the following types of pull requests have been omitted:

  • PRs that dealt with Travis CI and its many issues, as Travis CI has now been replaced with GitHub Actions. Note that the PRs that switched from Travis CI to GitHub Actions are still included, as these often include fixes in the tests or even in the actual code to make the tests pass again on GHA.
  • PRs that only bumped a single dependency to its latest version.
  • PRs that only fixed a typo in the documentation.

wp-cli/wp-cli-bundle

  • Fix typo in Symfony autoloader strips [#323]
  • Adapt Phar build [#322]
  • Remove myclabs/deep-copy from Phar [#321]
  • Optimize build [#320]
  • Flip Symfony dependency management logic [#315]
  • Keep symfony/polyfill-intl-normalizer in Phar [#314]
  • Keep symfony/deprecation-contracts in Phar [#313]
  • Keep symfony/polyfill-php80 in Phar [#312]
  • Add regression test for using magic constants in wp-config.php [#309]
  • Add PHP 8 back as testing requirement [#276]
  • Adapt reading of version artifact [#275]
  • Persist version as GHA artifact [#274]
  • Update deployment workflow [#273]
  • Update GHA functional tests workflow [#267]
  • Handle files with the .php8 extension [#263]
  • Remove symfony/polyfill-php80 [#261]
  • Conditionally include react folder in phar [#259]
  • Switch from Travis CI to GitHub Actions [#249]
  • Updated minimum required PHP version to 5.6 [#198]
  • Bump PHPCSPHP Code Sniffer PHP Code Sniffer, a popular tool for analyzing code quality. The WordPress Coding Standards rely on PHPCS. compatibility tests to new PHP 5.6+ minimum [#197]

wp-cli/wp-cli

  • Require v1.8 of Requests [#5529]
  • Remove tech debt via Rector [#5528]
  • Move fetcher implementations back into framework [#5527]
  • Add WpOrgApi abstraction to handle WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ API requests [#5526]
  • [BREAKING CHANGE] Disable automatic retry by default on certificate validation error [#5523]
  • Add missing $pipes variables when creating processes [#5522]
  • Harden error message on failed cache directory creation [#5520]
  • Update docblocks for methods that accept error objects [#5516]
  • [BREAKING CHANGE] Use custom certificate if provided [#5514]
  • [BREAKING CHANGE] Respect provided verify option in Utils\http_request [#5507]
  • Add magic properties to docblock [#5504]
  • Allow disabling of ini_set() [#5499]
  • Update GHA functional tests workflow [#5498]
  • Switch from Travis CI to GitHub Actions [#5483]
  • Add PHP 8 as an allowed PHP version [#5477]
  • Fix registering a command with a class and method name pair on PHP 8 [#5476]
  • Add $properties argument to __set_state magic() method [#5469]
  • Improve regex to match __FILE__ and __DIR__ magic constants [#5465]
  • Skip using removed Operation::getReason() for Composer v2 compat [#5462]
  • Support custom folder structures in wp-config.php file [#5460]
  • Fix wrong argument type in proc_open_compat() [#5459]
  • Fix non static methods in Extractor_Test class call statically [#5457]
  • Only suppress global parameters if set as true [#5455]
  • Add global parameter --exec for executing PHP [#5454]
  • Missing @return tag in function/method PHPDoc comment [#5450]
  • Allow root from environment via WP_CLI_ALLOW_ROOT environment variable [#5448]
  • Fix a broken link in the README.md file [#5443]
  • Add support for Redis Object Cache [#5436]
  • Allow user to suppress global parameters info from help display [#5423]
  • Updated license date [#5421]
  • Add $interactive arg for run_mysql_command() [#5420]
  • Add support for comma-separated flag values [#5419]
  • Fix SERVER_PORT 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. encoding failure [#5417]
  • Create a default global config file if it does not exist [#5411]
  • Updated minimum required PHP version to 5.6 [#5408]
  • Include classmap in order to fix Composer 2 deprecation notices [#5407]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#5406]
  • Throw exception when misusing error_to_string() [#5405]
  • Add regenerate-readme GitHub Action workflow [#5399]
  • Improve replace_path_costs() with logic from eval file command [#5397]
  • Add database info to cli info command [#5386]
  • Let Utils\run_mysql_command() return data [#5384]
  • [BREAKING CHANGE] Remove is_bundled_command() method [#5375]
  • Allow for array of strings in ComposerIO [#5370]
  • Escape path before wp-config.php string replacement [#5368]
  • Add $wp_config_path param for get_wp_config_code() [#5366]
  • Update drush project URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org [#5350]
  • Support exceptions in WP_CLI::error_to_string() method [#5331]
  • Show full command after using the --prompt flag [#5322]

wp-cli/handbook

  • Update handbook for v2.5.0 release [#381]
  • Add altushost.com to hosting-companies.md [#380]
  • Add hostico.ro to hosting-companies.md [#379]
  • ā€œ1&1ā€ is now called ā€œIONOSā€ [#376]
  • Update link to tutorial [#375]
  • Update running-commands-remotely.md [#374]
  • Add WP Provider to hosting-companies.md [#373]
  • Add dhosting.pl to hosting-companies.md [#371]
  • Adding Veerotech to hosting-companies.md [#368]
  • Add Oderland to hosting-companies.md [#367]
  • Add info for WP_CLI_SUPPRESS_GLOBAL_PARAMS env variable [#365]
  • Update link on the index page [#364]
  • Add ManagedWPHosting to hosting-companies.md [#363]
  • Update expression for dependencies of PHPUnit [#362]
  • Create a new ā€œHow to ā€¦ā€ section in the handbook [#360]
  • Update Handbook frontpage [#359]
  • Add a link in the Option Update page of the Handbook to the Option Reference page in the Codex [#358]
  • Update plugin-unit-tests.md with more details [#357]
  • Add SpinupWP to hosting-companies.md [#355]
  • Add Zenith Media Canada to hosting-companies.md [#348]
  • Update global configuration parameters URL. [#347]
  • Add 20i to hosting-companies.md [#344]
  • Add WooCart to hosting-companies.md [#336]

wp-cli/wp-cli.github.com

  • Update Romanian translation [#407]
  • Fix broken markup in German translation [#405]
  • Add initial right-to-left support [#403]
  • Update German translation to match the English version [#402]
  • Update Chinese Simplified translation [#400]
  • Add Chinese Simplified support [#398]

wp-cli/cache-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#65]
  • Switch from Travis CI to GitHub Actions [#66]
  • Update GHA functional tests workflow [#69]

wp-cli/checksum-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#73]
  • Switch from Travis CI to GitHub Actions [#78]
  • Prevent unnecessary directory recursion [#77]
  • Update GHA functional tests workflow [#80]
  • Add --insecure flag to core|plugin verify-checksums commands [#86]

wp-cli/config-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#110]
  • Allow for shuffling of specific keys and generating new ones [#114]
  • Update documentation link [#111]
  • Switch from Travis CI to GitHub Actions [#116]
  • Update GHA functional tests workflow [#123]
  • Add --insecure flag to config create & config shuffle-salts commands [#128]

wp-cli/core-command

  • Fix DB Upgrade tests for PHP 7.4 [#162]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#159]
  • Remove command substitution from is-installed example [#145]
  • Change CoreUpgrader::download_package signature [#166]
  • Switch from Travis CI to GitHub Actions [#175]
  • Update GHA functional tests workflow [#181]
  • Add --insecure flag to core download & core update commands [#186]

wp-cli/cron-command

  • Add command to unschedule all events with a given hook [#51]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#67]
  • Fix documentation for the cron delete command. [#62]
  • Switch from Travis CI to GitHub Actions [#69]
  • Update GHA functional tests workflow [#72]

wp-cli/db-command

  • Add --defaults flag to allow loading of MySQL configuration [#157]
  • Emulate WordPress SQL mode compat hack [#169]
  • Add SQL mode compat query to db import command [#170]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#172]
  • Use MySQL binary in interactive mode for db cli command [#178]
  • Switch to GitHub Actions [#182]
  • Update GHA functional tests workflow [#188]
  • Extend wp db export description [#184]
  • Document that individual text columns are searched. [#174]

wp-cli/embed-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#56]
  • Fix Behat tests [#57]
  • Switch from Travis CI to GitHub Actions [#58]
  • Update GHA functional tests workflow [#60]

wp-cli/entity-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#295]
  • Update site empty feature to handle sticky posts [#290]
  • Update site empty command to include removal of wp_links table data [#284]
  • Fix comment approval test [#299]
  • Switch from Travis CI to GitHub Actions [#305]
  • Update GHA functional tests workflow [#310]
  • Remove Fetcher implementations [#320]
  • Add workflow for regenerating README.md file [#316]

wp-cli/eval-command

  • Improve __FILE__/__DIR__ regex pattern [#44]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#48]
  • Switch from Travis CI to GitHub Actions [#51]
  • Update GHA functional tests workflow [#54]
  • Reuse Utils\replace_path_consts() for magic constants [#59]

wp-cli/export-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#70]
  • Switch from Travis CI to GitHub Actions [#73]
  • Add post_modified and post_modified_gmt fields to export [#75]
  • Update GHA functional tests workflow [#79]
  • Improve type handling and remove unused variables [#84]

wp-cli/extension-command

  • Prevent array access notice when $update_info is null [#214]
  • Add missing --network parameter for plugin is-active [#222]
  • Don’t show a warning when theme delete --all skips the active theme [#218]
  • Deny --dry-run usage when requiring a specific version [#236]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#235]
  • Allow for filtering multiple field values for the list command [#234]
  • Validate the --status 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. passed to wp plugin list and wp theme list [#229]
  • Add commands to manage auto-updates for plugins and themes [#259]
  • Provide clear error message when 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 fails PHP requirement [#253]
  • Only run auto-updates commands on WP 5.5+ [#269]
  • Avoid notice when $update_info is null [#265]
  • Switch from Travis CI to GitHub Actions [#273]
  • Update GHA functional tests workflow [#279]
  • Add --insecure flag to plugin|theme install & plugin\theme update commands [#287]

wp-cli/i18n-command

  • Ensure that the pot file use the same license as the plugin [#199]
  • Add wp i18n make-mo command. [#214]
  • block.json string extraction [#210]
  • Add option --skip-php to i18n make-pot command [#207]
  • Parse mangled Webpack statements [#204]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#215]
  • Scan for esc_xml_*() localization helpers [#221]
  • Switch from Travis CI to GitHub Actions [#235]
  • Update GHA functional tests workflow [#241]
  • Add support for indirect translation function calls in JS [#228]
  • Extract strings contained within eval() [#222]

wp-cli/import-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#60]
  • Switch from Travis CI to GitHub Actions [#61]
  • Update GHA functional tests workflow [#63]
  • Fix menu import tests [#69]

wp-cli/language-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#95]
  • add $hook_extra to LanguagePackUpgrader::download_package() [#100]
  • Switch from Travis CI to GitHub Actions [#104]
  • Update GHA functional tests workflow [#106]

wp-cli/maintenance-mode-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#9]
  • Switch from Travis CI to GitHub Actions [#11]
  • Update GHA functional tests workflow [#13]

wp-cli/media-command

  • Skip video cover regeneration on WP 5.5+ [#129]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#132]
  • Update GHA functional tests workflow [#140]

wp-cli/package-command

  • Update URL to ā€œCommands cookbookā€ documentation [#115]
  • Replace missing test package [#113]
  • Fix broken tests because of missing repo [#112]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#121]
  • Support gitlab.com URLs [#117]
  • Make the package manager compatible with Composer v2 [#127]
  • Switch from Travis CI to GitHub Actions [#128]
  • Update GHA functional tests workflow [#130]
  • Add --insecure flag to package install command [#138]
  • Improve installation instructions [#136]
  • Remove duplicate test and mark remaining as broken [#140]

wp-cli/php-cli-tools

  • Fix deprecated usage of join() [#142]

wp-cli/rewrite-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#44]
  • Switch from Travis CI to GitHub Actions [#47]
  • Update GHA functional tests workflow [#49]

wp-cli/role-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#40]
  • Switch from Travis CI to GitHub Actions [#41]
  • Update GHA functional tests workflow [#43]

wp-cli/scaffold-command

  • Include --ignore-externals when running svn co [#243]
  • Update plugin/theme test scaffolding [#262]
  • Use longer option names in install_db() to avoid stalling CIs [#255]
  • Deal with existing database in test init script [#249]
  • GitHub workflow files should be ignored on build [#270]
  • Make use of $EXTRA connection settings in install_db() [#269]
  • WP_CORE_DIR does not need a trailing slash [#266]
  • Updated minimum required PHP version to 5.6 [#265]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#264]
  • Scaffold block support for child themeChild theme A Child Theme is a customized theme based upon a Parent Theme. It’s considered best practice to create a child theme if you want to modify the CSS of your theme. https://developer.wordpress.org/themes/advanced-topics/child-themes/. [#242]
  • Keep test suite in sync with WP files when testing trunk/nightlies [#271]
  • Fix PHPCS issues for post-types [#276]
  • Add a callback for the bulk messages for post-types [#275]
  • Fix variables in tests [#284]
  • Add missing clean-up in templates/install-wp-tests.sh [#283]
  • Add updated GHA testing workflow [#282]

wp-cli/search-replace-command

  • Improve error message on regex check [#131]
  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#141]
  • Only try to unserialize strings [#148]
  • Switch from Travis CI to GitHub Actions [#152]
  • Chunk query that can potentially OOM [#153]
  • Update GHA functional tests workflow [#156]

wp-cli/server-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#64]
  • Switch from Travis CI to GitHub Actions [#65]
  • Update GHA functional tests workflow [#67]

wp-cli/shell-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#48]
  • Fixed PsySH initialization [#49]
  • Switch from Travis CI to GitHub Actions [#51]
  • Update GHA functional tests workflow [#54]

wp-cli/super-admin-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#41]
  • Switch from Travis CI to GitHub Actions [#42]
  • Update GHA functional tests workflow [#44]

wp-cli/widget-command

  • Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#42]
  • Switch from Travis CI to GitHub Actions [#44]
  • Update GHA functional tests workflow [#46]

wp-cli/wp-config-transformer

  • Update Composer requirement to include v2 [#29]

Contributors

@2ndkauboy, @aaemnnosttv, @aidvu, @akkspros, @alexholt, @ankitpanchal7, @austinginder, @chesio, @ChrisWiegman, @claudiosanches, @connerbw, @danielbachhuber, @dd32, @dilipbheda, @dishitpala, @drzraf, @dsifford, @ediamin, @emersonveenstra, @freezy-sk, @gedex, @gitlost, @greatislander, @herregroen, @iandunn, @janw-me, @jasongill, @jenkoian, @jespervnielsen, @jmdodd, @joemcgill, @johnbillion, @jrfnl, @kadimi, @l3ku, @Lewiscowles1986, @localheinz, @matzeeable, @michaelzangl, @msaggiorato, @mukeshpanchal27, @ocean90, @octalmage, @oytuntez, @pbiron, @pdaalder, @pmbaldha, @ponsfrilus, @rob006, @schlessera, @shahariaazam, @siliconforks, @stevegrunwell, @swissspidy, @szepeviktor, @tedsecretsource, @thrijith, @tillkruss, @TimothyBJacobs, @torounit, @tosite, @Tug, @uplime, @vaishaliagola27, @vsamoletov, @waclawjacek, @WhiteWinterWolf, @wojsmol, @wpamitkumar, @yousan, @yukihiko-shinoda, @zaantar, @zzap

#release, #v2-5-0

WP-CLI v2.5.0 release date

The long-awaited release v2.5.0 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 19th, 2021.

I won’t go into too much detail about why the release was so long in the making, but let me nevertheless add a link to an article in which Juliette Reinders Folmer eloquently talks about some of the reasons: https://24daysindecember.net/2020/12/21/a-perfect-storm/. Add to this the fact that the pandemic situation has drastically reduced the pool of contributors, as well as Travis CI deciding to effectively drop OSS support (forcing me to switch both testing and deployments to 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/ Actions), and we’re in a situation that I’m glad will finally be resolved again soon.

Thanks to all the sponsors of the project that make it possible to work on WP-CLI with the persistence and staying power it requires.

Also big thanks to the contributors to the project that kept helping me figure out bugs and come up with solutions! I truly appreciate all your assistance.

And in case you’re one of the many people who created an issue in recent times that hasn’t been resolved yet, know that getting v2.5.0 out was an absolute priority, but I’ll slowly work off the backlog again once the pressing compatibility issues have been taken care of.

#release, #v2-5-0

WP-CLI Release v2.4.0

Just in time for the release of WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. 5.3.0 we have 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/ as well. A team of 37 contributors has collaborated to get 159 pull requests merged.

Let’s go over some of the noteworthy changes in this release. Most of the work went into compatibility fixes, so there’s not many new toys to play around with, unfortunately. As always, you can also skip directly to theĀ detailed changelog if you prefer.

WordPress 5.3 support

It should be obvious that WP-CLI supports the latest upcoming WordPress Core release, of course. However, there were quite a few changes that went into 5.3 that made it not only difficult to keep WP-CLI working across 5.3 and earlier versions at the same time, but also made it necessary to release WP-CLI in parallel to have a working option available.

The push to support more of the newer 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. features that became available due to the bump to the minimum PHP version of Core introduced changes to function signatures and class interfaces, which required a few adventurous fixes in some cases…

PHP 7.4 support

PHP 7.4 is not yet available in a stable release, but we’re slowly coming closer to the planned release date.

There have been quite a few fixes that went into WP-CLI to make sure it works correctly with PHP 7.4 once it’s available. It’s an ongoing process, still, as we’re working towards the first stable version. Tests are running for PHP 7.4 in the background as well for each package. These are still allowed to fail right now, but after this release, they will be switch to break on error.

Download a specific URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org as Core

The core download command now accepts a URL to download a specific ZIP archive with a version of Core to use. This also allows you to use your own custom version easily. Just add the URL and you’re good to go: wp core download https://somesite/build.zip

Large image support

WP-CLI will properly deal with large images in the way that WP Core 5.3 was improved. It knows about the original source images as well so you can safely rebuild your thumbnails without losing quality.

Detailed Change Log

wp-cli/wp-cli-bundle

  • Allow patches from dependencies to be applied [#150]

wp-cli/handbook

  • Fix STDERR redirection example code [#342]
  • Add SiteDistrict to hosting-companies.md file [#341]
  • Update reference URLs. [#337]
  • Add WooCart to hosting-companies.md file [#336]
  • Add MinHost to hosting-companies.md file [#334]

wp-cli/wp-cli.github.com

  • Update romanian translation [#392]
  • Update link to wp-completion.bash [#391]
  • [pt_BR] Update to v2.3.0 + refresh sponsors [#390]
  • Update Turkish translation [#389]
  • Small adjustments for French translation [#388]
  • Update ja/index.md [#387]

wp-cli/core-command

  • Use version known to work for core download test [#136]
  • Support URL for core download [#135]
  • install changed to installation [#132]
  • 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.-convert, don’t assume site_id is 1 [#122]

wp-cli/db-command

  • Fix tests for changes in WP Core 5.3 [#149]
  • Make db clean get all the tables with prefix [#152]
  • Fix output message for STDIN input [#151]

wp-cli/entity-command

wp-cli/extension-command

  • Add second must-use 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 that is added with wp-cli-tests 2.1.6+ [#200]
  • Equalize theme folder naming conventions across Win/Mac/Linux [#196]

wp-cli/i18n-command

  • Adapt code to gettext v4.8 [#194]
  • Add --debug output for the file being processed. [#183]
  • Use correct argument name in warning message [#180]

wp-cli/media-command

  • Adapt to changes in WP 5.3 image handling to fix broken tests [#115]
  • Fix suffix of scaled large images [#118]

wp-cli/scaffold-command

  • Required PHP version 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. [#238]
  • Fix deprecated whitelist code flag [#236]
  • Switch test prep feature from global PHPUnit to local PHPUnit [#235]
  • Add a minimum php requirement [#234]
  • Scripts added to plugin package.json [#225]

wp-cli/widget-command

  • Adapt tests to make the widgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. expectations more flexible [#34]

Contributors

@aommundsen, @azito122, @beaucollins, @burhandodhy, @connerbw, @derweili, @drzraf, @dz0ny, @felipeelia, @gitlost, @greatislander, @herregroen, @jrfnl, @l3ku, @localheinz, @marksabbath, @marty-crane, @maximejobin, @mcdwayne, @michaelzangl, @mustafauysal, @nxnjz, @nylen, @ocean90, @pdaalder, @raphael-concil, @sagarnasit, @schlessera, @siliconforks, @swissspidy, @tecking, @thrijith, @vladutilie, @wojsmol, @yousan, @zzap

#release, #v2-4-0

WP-CLI Release v2.3.0

This release v2.3.0 is, as already announced, rather unspectacular. The previous release was very taxing for several reasons, so we lowered the pace for a while to recover.

This version is mainly meant to finally get a few bug fixes out there that were not critical enough to warrant an immediate hotfix release but are nice to have eradicated at one point, nevertheless.

Overall, a team of 36 contributors has collaborated to get 129 pull requests merged. I’ll briefly go over some of the more noteworthy stuff, but as always, you can also skip directly to theĀ detailed changelog if you prefer.

New command to fix image orientation

Some cameras and smartphones will automatically tag pictures to denote ā€œwhich way is upā€. This means that you will have these devices show you the pictures you took during your handstand in the correct orientation no matter what, even though the actual picture file is upside down.

The media command now has a new subcommand media fix-orientation that reads these special tags and properly applies them to your images. This way, the images will also be shown with the correct orientation on devices that do not support this tag.

You can now skip tables using wildcards

The --skip-tables flag for the search-replace command has learnt a new trick – it now lets you skip a group of tables in one go through wildcards.

You can use wildcards like 'wp_*options' or 'wp_post*' to make your life easier.

Add config settings to the end of the file

Up until now you always had to provide an anchor to attach changes to your wp-config.php to when using the config add command.

You can use this through the special anchor flag --anchor=EOF.

Optimized vagrant support

When you’re connecting to your vagrant VMs through 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/’s special-case vagrant SSHSSH Secure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. connection scheme, you’ll notice that the operations are way faster now, as we’re caching the configuration across calls now.

Detailed Change Log

wp-cli/wp-cli-bundle

  • Permit use of php7.2-mysql and php7.3-mysql in Debian build [#130]

wp-cli/wp-cli

  • Make extraction more robust [#5261]
  • Improve ā€œAdding deferred commandā€¦ā€ debug output (Closes: #4893) [#5242]
  • Fix parse_url scheme bug [#5241]
  • Speed up vagrant scheme calls by caching vagrant ssh-config [#5235]
  • Remove bug-provoking test for a bug in WPDB that was fixed [#5220]
  • Fix return types [#5212]

wp-cli/handbook

  • Update handbook for release v2.3.0 [#333]
  • Add Fedora and CentOS to installation instructions [#328]
  • Add documentation to integrate Dash/Alfred [#327]

wp-cli/wp-cli.github.com

  • Add Romanian language [#329]
  • Update Brazilian Portugues translation [#328]
  • Update Japanese translation [#326]
  • Update French translation [#324]

wp-cli/export-command

  • Allow to opt-out from dumping specific sections [#61]
  • Reuse File_Writer for STDOUT support [#60]
  • Make load_export_api() public [#59]

wp-cli/extension-command

  • Add theme status in wp theme get command [#177]
  • Fix issue with failing test cases due to version mismatch [#181]
  • Fix activation issue of installed 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/theme [#180]

wp-cli/i18n-command

  • Skip broken test 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. http://php.net/manual/en/intro-whatis.php. 7.3 [#178]
  • Investigate include/exclude oddities [#175]
  • Sort translation files by name to ensure same order on all systems [#173]
  • Workaround for parsing dynamic imports [#164]
  • Avoid throwing a notice about strpos(): Empty needle when going through include paths [#149]

wp-cli/media-command

  • Skip test for duplicate resizes for coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. trunk because of bug in current version [#112]
  • Clarify implications of using --skip-copy [#110]
  • Add media fix-orientation command [#108]

wp-cli/search-replace-command

  • Adds wildcards support to --skip-tables parameter [#124]

wp-cli/server-command

  • Fix port number in example [#58]

wp-cli/wp-config-transformer

  • Add EOF as special-case anchor [#23]

Contributors

@afragen, @ajoah, @blackfile, @connerbw, @drzraf, @felipeelia, @fernandoherlo, @fuegas, @fullsteamlabs, @gitlost, @greatislander, @herregroen, @hofmannsven, @jrfnl, @l3ku, @localheinz, @maximejobin, @michaelzangl, @MikeWKrystal, @mustafauysal, @ocean90, @ovidiul, @pdaalder, @sagarnasit, @schlessera, @shadyvb, @shashank3105, @siliconforks, @swissspidy, @szepeviktor, @tecking, @thrijith, @vladutilie, @wojsmol, @yognsk, @yousan

#release, #v2-3-0

WP-CLI Release v2.2.0

Phew, it’s finally here! Although there are not that many new features, we had a lot of work being done behind the scenes, to make future releases smoother. A lot of the processes have been improved, and we’ve managed to squash quite a few bugs while doing so.

A team of 57 contributors has collaborated on this release to get 347 pull requests merged. I’ll briefly go over some of the more noteworthy stuff, but as always, you can also skip directly to theĀ detailed changelogĀ or examine theĀ breaking changesĀ section if you’re impatient.

New Committer

  • Thrijith Thankachan (@thrijith) is from Surat, India. He works for rtCamp as a WordPress Engineer and he is the developer behind the two new commands alias and maintenance-mode.

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/ code standard

Through the initiative of @jrf, and with the outstanding help from @thrijith, @wojsmol & @williampatton, we now have a WP-CLI code standard that we can enforce.

For any package, you can just run composer phpcs to verify that your code meets the CS requirements. Basic formatting issues can be automatically corrected through vendor/bin/phpcbf (a Composer script will soon follow for that).

The goal of this big effort is to reduce the back & forth on pull requests and thus reduce the maintenance burden. For most pull requests, whitespace issues and code style issues represent the bulk of the time and effort required by the maintainers. With enforced and automated coding standards, everyone saves time and the discussion more often revolves around the actual logic that solves the problem, instead of alignment issues and spacing rules.

This is all pretty fresh, so stay tuned while more extensive documentation and updates to the tooling will follow.

New command to manage aliases

The old wp cli alias has finally grown up and has become a complete CRUD interface for managing your WP-CLI aliases. You can alias list to retrieve your current configuration, alias get to retrieve an individual alias, and alias add|update|delete to make changes.

While experimenting with these commands, please remember that you need to work around the already active global parameters. This is why we had to add a prefix (--set-<flag>) to all the flags that let you configure the aliases. So, updating the SSHSSH Secure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. connection string for an alias is done through alias update <key> --set-ssh=<ssh>. If you would use --ssh instead to configure it, you’d actually immediately connect to that SSH target instead.

# List alias information.
$ wp cli alias list
---
@all: Run command against every registered alias.
@local:
  user: wpcli
  path: /Users/wpcli/sites/testsite

# Get alias information.
$ wp cli alias get @dev
ssh: dev@somedeve.env:12345/home/dev/

# Add alias.
$ wp cli alias add prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli
Success: Added '@prod' alias.

# Update alias.
$ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/
Success: Updated 'prod' alias.

# Delete alias.
$ wp cli alias delete @prod
Success: Deleted '@prod' alias.

New command to control maintenance mode

WP-CLI now lets you enable or disable the WordPress maintenance mode with the two simple commands maintenance activate and maintenance deactivate. You can query the current status with maintenance status (for humans) or maintenance is-active (for easy shell scripting).

# Activate Maintenance mode.
$ wp maintenance-mode activate
Enabling Maintenance mode...
Success: Activated Maintenance mode.

# Deactivate Maintenance mode.
$ wp maintenance-mode deactivate
Disabling Maintenance mode...
Success: Deactivated Maintenance mode.

# Display Maintenance mode status.
$ wp maintenance-mode status
Maintenance mode is active.

# Get Maintenance mode status for scripting purpose.
$ wp maintenance-mode is-active
$ echo $?
1

WP-CLI ā€œbinariesā€

The eval-file had a small, innocuous tweak. When it encounters a ā€œshebangā€œ, a first line in a file that starts with #!, it will strip that line and try to run the rest of the file through 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.’s eval().

For folks not used to working in Unix shells, that might sound rather useless, but this shebang is actually a construct that your shell understands, and that lets you tell the shell how to execute the file.

As an example, here’s a file that contains such a shebang and actually points to WP-CLI’s eval-file command:

#!/bin/env wp eval-file
<?php
echo get_bloginfo('name');

With that file structure, you can now rename that script file to something like blogname and make it executable. It now behaves like any other shell tool, and will use WP-CLI as a shell framework for retrieving the current blog’s name.

Have fun experimenting with this new functionality, and don’t forget to share the more interesting use cases you can think of with the rest of the community!

Breaking changes

Name changes

While going through the code to make it fit for actually enforcing our new WP-CLI coding standard, we decided to rename some of the more internal functions, methods and properties to make the experience more consistent.

Although we took great care to figure out what we could safely rename and what needed to stay intact, there might be some edge cases where people are nevertheless directly coupling to some bit of internal code.

This is mostly relevant if you extend one of the WP-CLI classes to override default behavior.

Removal of framework files from test package

The test package included a few framework files that were used to make the FeatureContext logic work. However, as wp-cli/wp-cli was a hard requirement for wp-cli/wp-cli-tests anyway, we removed these framework files and had the test package pull them in through the dependency.

In case you were directly coupling your code to these files as they were found in wp-cli/wp-cli-tests (which is unlikely), then you’ll have to change your code to refer to these same files in the wp-cli/wp-cli package. See the pull request for more details.

Consistent display of serialized metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. values

Serialized data has been displayed very inconsistently, with some commands showing them as is (option list), and some commands unserializing them automatically for display (post meta list).

We’ve changed this so that they all show the values as they are stored, to avoid surprises.

This is a breaking change, however, and if you happened to rely on the automatic unserialization, you’ll be glad to hear that the affected commands now provide an optional --unserialize flag to get back to the old behavior. You can even put this flag into your global config to permanently stick with the old behavior.

Affected commands are: comment meta get|list, network meta get|list, post meta get|list, user meta get|list.

Complete change log

All repositories

  • Implement CS checking based on theĀ WP_CLI_CSĀ ruleset
  • Add PHP 7.3 to Travis CI build matrix
  • Move PHP 5.4 tests fromĀ WP_VERSION=latestĀ toĀ 5.1

wp-cli/wp-cli-bundle

  • Bundle new maintenance-mode command [#113]
  • Add a 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/ setting for label toĀ dependencies.ymlĀ [#74]
  • Try removing ā€œignore-platform-reqsā€ from Dependencies.yml [#72]
  • AddĀ dependencies.ymlĀ file to define auto-updates [#70]

wp-cli/wp-cli

  • Always reattach subcommands [#5203]
  • Add warning message to let the user know whenĀ WP_CLI_SSH_PRE_CMDĀ is in use [#5197]
  • AddĀ aliasesĀ subcommand for backwards compatibility [#5194]
  • Avoid double registration of commands [#5193]
  • Add default titles to release checklists [#5168]
  • Limit ranges of PHP versions in Composer [#5142]
  • Add checklists for regular and patch releases [#5141]
  • Add flags to include / exclude views in wp_get_table_names() [#5128]
  • InternalizeĀ array_column()Ā shim, because package is abandoned [#5126]
  • Add command to manage aliases [#5122]
  • Introduce ability to override wp-config.php path with env var WP_CONFIG_PATH [#5119]
  • Support persistent 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/. connections [#5115]
  • Fixed documented return type forĀ make_progress_bar()Ā [#5112]
  • FixĀ FileCache::export()Ā not ensuring parent directories exist forĀ $targetĀ [#5103]
  • SwitchĀ ext-readlineĀ to ā€˜suggest’ instead of a hard requirement [#5102]
  • Update docblock for add_command() to properly reflect the return value [#5099]
  • Fix failing test under WP 5.1 [#5094]
  • UpdateĀ parse_str_to_argv()Ā regex to be more accurate [#5090]
  • Update ISSUE_TEMPLATE [#5078]
  • Ensure cache directories are accessible [#5068]
  • AddĀ dependencies.ymlĀ file to define auto-updates [#5066]
  • AddĀ WP_CLI::has_config()Ā method [#5063]
  • Change to ā€œHappy publishing.ā€ per change in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. [#5059]
  • Adapt outdated links inĀ ISSUE_TEMPLATEfile [#5056]
  • Fix typo: Autolaoder => Autoloader [#5055]

wp-cli/handbook

  • Update example of wp config create [#317]
  • Update link ofĀ backwpupĀ 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 [#315]
  • Update release checklist documentation to point to the issue templates [#306]
  • AddĀ wp cli infoĀ as first environment info [#305]
  • Document theĀ <scheme>Ā part of theĀ --sshĀ flag [#299]
  • Add documentation for theĀ --foo[=<bar>]toĀ command-cookbook.mdĀ [#293]
  • DocumentĀ WP_CLI_CUSTOM_SHELLenvironment variable [#292]
  • Change references to paths being inĀ .bash_profileĀ toĀ .bashrcĀ [#290]
  • Update roadmap [#287]
  • Add instructions for checking additional configuration files for PHPĀ memory_limit[#286]
  • Update the ā€˜using a custom PHP binary’ link [#285]
  • Update hosting-companies.md [#284]
  • Update link to command list in Quick Start [#282]
  • Add a note about potential connection issues when using MySQL >= 8.0. [#280]
  • Composer installation instructions are dated and incorrect [#279]
  • Update broken links on Command Cookbook page [#276]

wp-cli/wp-cli.github.com

  • Switch to githubusercontent per other submission [#322]
  • pt_BR – Version update and minor adjustments [#321]
  • Redirect blog to site [#320]

wp-cli/checksum-command

  • Make soft change detection more flexible [#41]
  • Add backslash to the regex for matching Windows paths correctly [#39]

wp-cli/config-command

  • Update template based on latest version [#88]
  • ChangeĀ Happy blogging.Ā toĀ Happy publishing.Ā inĀ wp-config.phpĀ template [#82]

wp-cli/core-command

  • Replace instances ofĀ wp.devĀ withĀ example.comĀ [#115]
  • Change to ā€œHappy publishing.ā€ per change in core [#103]

wp-cli/embed-command

  • Modify tests to correctly verifyĀ --force-regexĀ flag [#50]

wp-cli/entity-command

  • Allow deleting multiple options at once [#247]
  • Fix logic error in presence of ā€˜site meta’ check [#244]
  • Add count to post-type and taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies. commands [#241]
  • Reset option value to default for privacy policy on site empty [#236]
  • Migrate term from a taxonomy to another one [#234]
  • Include ā€˜supports’ field when fetching a single post type [#233]
  • Check forĀ STDINĀ ifĀ --post_contentĀ is used [#189]
  • RenameĀ phpunit.xmlĀ toĀ phpunit.xml.distĀ [#252]

wp-cli/eval-command

  • Strips outĀ #! /bin/bashĀ and similar at the beginning of PHP files [#35]
  • Fix handling ofĀ __FILE__Ā andĀ __DIR__constants inĀ eval()ā€˜d code. [#38]

wp-cli/export-command

  • Identify non-writable directory as such [#54]

wp-cli/extension-command

  • Add theĀ --pageĀ parameter to theĀ theme searchĀ command [#167]
  • Allow deleting the currently active theme [#158]
  • Display warning in plugin list info if plugin version is higher than expected [#157]
  • Fix success message example on plugin uninstall [#148]
  • Handle extension activation for WP error or extension not found [#146]

wp-cli/i18n-command

  • Set Language 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. directly to prevent exceptions [#150]
  • Fix make-pot tests [#135]
  • Add script file name to 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. translation files [#134]
  • Improve language handling when creating JSON files [#133]
  • Add support for nested theme folders [#130]
  • Prevent possible PHP notice in IterableCodeExtractor [#129]
  • Extend PotGenerator to improve plural forms output [#128]
  • Remove project header comments for comments audit [#123]

wp-cli/language-command

  • ChangeĀ LanguagePackUpgrader::download_packagesignature [#82]

wp-cli/media-command

  • Refactored aspects of the image collection and determination of sizes [#103]

wp-cli/package-command

  • Adapt framework requirement [#103]

wp-cli/rewrite-command

  • Update success message position [#29]

wp-cli/role-command

  • AddĀ --show-grantĀ argument toĀ cap listĀ andĀ --grantĀ toĀ cap add[#19]
  • AddĀ --field=<field>Ā support to listing roles [#17]

wp-cli/scaffold-command

  • Prevent creating unregisterable blocks due to invalid plugin slug [#203]
  • AddĀ dependencies.ymlĀ to pluginĀ .distignoreĀ [#202]
  • Add DeployHQĀ .deployignoreĀ to ignored files inĀ .distignoreĀ [#201]
  • Ignore various JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. config files in pluginĀ .distignoreĀ [#200]
  • Update links to blocks documentation [#199]

wp-cli/search-replace-command

  • Swapped out the .dev Google TLD for the .test RFC protected domain in doc examples [#107]

wp-cli/shell-command

  • Better explain theĀ --basicĀ flag [#23]
  • Close already opened process while prompting [#36]
  • Add possibility to change the shell binary [#33]

wp-cli/super-admin-command

  • Fix a bug where adding superadmins would crash if none existed before [#22]

wp-cli/wp-config-transformer

  • Fix parsing of escaped quotes [#16]
  • Normalize the newline to prevent an issue coming from OSX [#14]
  • Change to ā€œHappy publishing.ā€ per change in core [#13]
  • AddĀ .gitattributesĀ file [#12]

Contributors

@abhijitrakas,Ā @afragen,Ā @ajitbohra,Ā @amieiro,Ā @andreamk,Ā @andrewminion-luminfire,Ā @anthony-curtis,Ā @atanas-angelov-dev,Ā @cwales92,Ā @D9Dan,Ā @danielbachhuber,Ā @DavidHickman,Ā @dependencies[bot],Ā @desrosj,Ā @diggy,Ā @emirpprime,Ā @felipeelia,Ā @jankimoradiya,Ā @jbwtech,Ā @jcomack,Ā @jonathanbardo,Ā @jrfnl,Ā @Juberstine,Ā @killua99,Ā @kimdcottrell,Ā @korikori,Ā @kuoko,Ā @kushalraha,Ā @lanresmith,Ā @localheinz,Ā @luc122c,Ā @man4toman,Ā @mkaz,Ā @mrmakadia94,Ā @msaggiorato,Ā @Mte90,Ā @musicaljoeker,Ā @nickdavis,Ā @nishitlangaliya,Ā @Nomafin,Ā @pattonwebz,Ā @rosswintle,Ā @salcode,Ā @shashank3105,Ā @Sidsector9,Ā @spicecadet,Ā @ssnepenthe,Ā @swissspidy,Ā @thrijith,Ā @tomjn,Ā @tyrann0us,Ā @Umang8,Ā @villuorav,Ā @websupporter,Ā @wojsmol,Ā @XedinUnknown

#release, #v2-2-0

WP-CLI v2.1.0 Release Notes

ā€˜Tis the season to celebrate 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/! šŸŽ„ A total of 39 contributors has collaborated on this release to have a staggering 293 pull requests merged. We’ll go over the main areas now, but you also skip directly to the detailed changelog or ponder over the breaking changes section if you’re impatient.

i18n – round two!

The recent i18n make-pot command has replace the old make-pot tool in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. and is now the official translation build tool for the Core. This effort has lead to numerous improvements to make it both more robust and more flexible. Amongst the more notable changes, it can now parse JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. in addition to the 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, and together with the new i18nĀ make-json command that lets you produce separate 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. files, you’re all set to make your 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/ blocks translatable!

Translation pack improvements

We didn’t stop there with regards to making WordPress an ā€œinternational successā€ā€¦ the language family of commands got several improvements and fixes. The most notable one is that language plugin|theme update now understands an --all flag, so you can update language packs for all your installed plugins/themes in one go.
# Update the language packs for all plugins.
$ wp language plugin update --all
Updating 'Japanese' translation for Akismet 3.1.11...
Downloading translation from https://downloads.wordpress.org/translation/plugin/akismet/3.1.11/ja.zip...
Translation updated successfully.
Updating 'Japanese' translation for Contact Forms 7 4.2.1...
https://downloads.wordpress.org/translation/plugin/contact-form-7/4.2.1/ja.zip...
Translation updated successfully.
Success: Updated 2/2 translation.

Partial prompting

The lesser known --prompt global parameter has now become even more useful. Instead of always prompting for all arguments, it skips those that were already provided, as you would probably already have expected. One way this can be used is to prefill all arguments that you can remember and then use --prompt to help you with the more arcane flags. More importantly, though, you can now prefill all the arguments that are already known inside of a script, and then add the --prompt argument to let the script query the remaining information from the user.

Manage the WP-CLI cache

We added two additional commands that let you manage the WP-CLI internal cache. cli cache clear will clear the entire cache, whereas cli cache prune will only clear the elements known to be stale. This latter will for example remove all the versions of WP core that you downloaded except for the most recent one.
# Remove all cached files.
$ wp cli cache clear
Success: Cache cleared.

# Remove all cached files except for the newest version of each one.
$ wp cli cache prune
Success: Cache pruned.

Better control over transients

You can now list the current transients on your site or network using the filterable transient list command. You can search for specific transients or exclude the ones you want to hide. You can even choose whether you want the expiration to be displayed in a human-readable or machine-parseable format.
# List all transients
$ wp transient list
+------+-------+---------------+
| name | value | expiration    |
+------+-------+---------------+
| foo  | bar   | 39 mins       |
| foo2 | bar2  | no expiration |
| foo3 | bar2  | expired       |
| foo4 | bar4  | 4 hours       |
+------+-------+---------------+
Furthermore, transients are now handled more consistently across 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. networks, and allow you to properly distinguish between regular transients and site transients.

Database management improvements

Also, the db size loved the idea of a --human-readable flag like in the transient list command so much that it got its own version. This will always use the unit that is best adapted to convey the information.
# List the size of the database in a human-readable form
$ wp db size --tables --human-readable
+---------+--------+
| Name    | Size   |
+---------+--------+
| my_site | 117 MB |
+---------+--------+
Furthermore, the db import command now understands all the flags that the mysql binary does, so that you can get past errors in SQL exports or adapt the result you want to see in your target site.
# Import an SQL export file that contains errors, by
# passing the --force argument to mysql binary.
$ wp db import export-with-errors.sql --force
Success: Imported from 'export-with-errors.sql'.

Smarter configuration

The config commands are now smarter. They not only allow you to edit the wp-config.php even on a broken WordPress installation, but you’re also able to retrieve the individual settings in whatever format best fits your scripting needs. Finally, adding new configuration values or updating existing ones will now only throw errors in the most ambiguous scenarios, while they just work for the majority use cases without the need to explicitly specify a --type.

Checking the existence of a post

You can now check whether a given post exists by using the new post exists command. It returns a shell exit code, so you can use it directly in shell conditionals.
if wp post exists 42; then
   echo "Skipping post import for ID 42, it already exists."
else
   echo "Importing post with ID 42..."
   # ...
fi

Breaking changes

  • While we had already bumped the minimum PHP version in v2.0.0 and started using PHP 5.4+ code in some places, we now actively enforce this requirement in the bootstrapping code [wp-cli#5039](https://github.com/wp-cli/wp-cli/pull/5039).
  • The restructuring of the packages in v2.0.0 produced a regression which caused overrides through the package manager to not work anymore. We fixed this by completely ripping the framework out of the regular Composer autoload flow. This should now lead to less surprises when rearranging the Composer compositions, but might have side-effects in some exotic Composer setups [wp-cli#5010](https://github.com/wp-cli/wp-cli/pull/5010).
  • The breaking change from v2.0.1 to throw an error for non-lowercase theme slugs was reverted, as it broke far more than we anticipated. That’s why we now break the breaking change to get back to the original behavior [extension-command#137](https://github.com/wp-cli/extension-command/pull/137). šŸ˜›
  • WP-CLI tries to speak proper English now. To achieve this, we changed the output to use the real world ā€œinstallationā€ where we were using the fantasy term ā€œinstallā€ before [wp-cli#4946](https://github.com/wp-cli/wp-cli/pull/4946).

Complete change log

wp-cli/wp-cli-bundle

  • Bump PHP version to 5.4+ for PHP Compatibility Checker [#63]
  • Bump included package-command to v2.0.3 [#35]
  • Remove .behat-progress.log [#25]
  • Use dev-master for framework instead of tagged release [#24]
  • Add replace-label maintenance command [#17]

wp-cli/wp-cli

  • Properly reorder synopsis passed in via $args [#5049]
  • Bump PHP version check in bootstrap code to v5.4+ [#5039]
  • Remove ext-posix requirement from Composer file [#5038]
  • Fix override test on Composer stack [#5036]
  • PHP 7.0+: allow for changed list assignment order [#5021]
  • Skip associative arguments that were already provided on --prompt [#5015]
  • Bump PHP version to 5.4+ for PHP Compatibility Checker [#5014]
  • Use custom autoloader to load framework [#5010]
  • Add extension requirements to composer.json file [#5001]
  • Add ext-zip as suggested extension [#4998]
  • Fix parsing of arguments for WP_CLI::runcommand() with launch=false [#4989]
  • Match the way WordPress Core locates wp-config.php [#4984]
  • Use dirname() instead of .. to locate wp-config.php to match Core behavior [#4963]
  • Update README to account for the 280-character limit on Twitter [#4962]
  • Use ā€œinstallationā€ instead of ā€œinstallā€ in documentation [#4960]
  • Bump included package-command to v2.0.3 [#4957]
  • Reattach existing subcommands from namespace to replacing command [#4951]
  • Convert ā€˜install’ to ā€˜installation’ [#4946]
  • Add sibling vendor folder location [#4938]
  • Check and display help command if requested [#4928]
  • Fix var_export return in WP_CLI::print_value [#4926]
  • Adapt README.md file for v2.0.1 release [#4924]
  • Bump version to 2.1.0-alpha [#4898]
  • Added cli cache prune & cli cache clear commands [#4787]

wp-cli/handbook

  • Add Savvii to hosting companies [#267]
  • Update hosting-companies.md [#266]
  • Update the set up and testing flow [#265]
  • History | grep = even better than ctrl-r [#263]
  • Please add One.com to the list [#261]
  • Add lima-city to hosting companies [#258]
  • Add 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 Simple History [#257]
  • Update running-commands-remotely.md to add ~/bin approach [#256]
  • Use ā€œinstallationā€ instead of ā€œinstallā€ [#255]
  • Fix issue with broken filename [#253]
  • Document root cause to STDOUT PHP notice [#252]
  • Update with v2 changes [#251]
  • Remove WP_CLI_Command class [#250]
  • Include the cron jobs in the governance document [#248]

wp-cli/wp-cli.github.com

  • Updated index.md – Spanish version [#316]
  • Adapt index.md file for v2.0.1 release [#315]

wp-cli/cache-command

  • Rename transient list method to be consistent with other list commands [#49]
  • Introduce a list command to list all transients [#48]
  • Make output of transient type generic to include multisite behaviour [#47]
  • Replace usage of global with wp_using_ext_object_cache() [#45]
  • Improve deleting site transients [#42]

wp-cli/checksum-command

  • Use command namespaces instead of conditional addition [#54]

wp-cli/config-command

  • Permit use of wp config edit when WP isn’t functional [#71]
  • Use constant as default type when adding new keys [#80]
  • Add --format option for config get command [#79]
  • Use print_value() instead of log() for output of config get [#78]

wp-cli/core-command

  • Switch to wp-cli@dev [#92]
  • Adapt install => installation in tests [#90]
  • Fix tests for uncached nightly downloads [#100]
  • Adapt framework requirement [#101]

wp-cli/cron-command

  • Make sure WP Cron is enabled for cron tests [#36]

wp-cli/db-command

  • Fix comment argument test [#127]
  • Adds --human-readable parameter to db size command [#124]
  • Support all mysql flags while importing database [#123]
  • Add search and delete example [#122]
  • Add new db clean to README.md and configuration files [#119]
  • Fix combination of --format & --size_format flags [#118]
  • Add links to 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/. documentation [#117]

wp-cli/entity-command

  • Update readme [#204]
  • Bump site meta test requirement to WP 5.1+ [#225]
  • Add missing --description flag logic for user create [#217]
  • Expose the available query variables for comment and post queries [#213]
  • Use ā€œinstallationā€ instead of ā€œinstallā€ [#212]
  • List all entities in the package description [#208]
  • Bail with a warning when deleting custom post types without --force [#188]
  • Add post exists command [#182]

wp-cli/eval-command

  • Adapt install => installation in tests [#33]

wp-cli/extension-command

  • Throw error in theme fetcher on non-lowercase slugs [#126]
  • Raise timeout for HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. requests to 1 minute [#125]
  • Revert ā€œThrow error in theme fetcher on non-lowercase slugsā€ [#137]
  • Failed plugin updates now throw errors [#143]
  • Use ā€œinstallationā€ instead of ā€œinstallā€ [#139]
  • plugin delete <plugin-name> not working if path has a space or & in it [#138]

wp-cli/i18n-command

  • Require framework as hard dependency [#78]
  • Add Composer config settings [#74]
  • Improve detection of translator’s comments [#101]
  • Improve regex replacement [#100]
  • Replace regexes Peast can’t parse [#99]
  • Allow skipping strings audit [#94]
  • Update file-comment argument docs [#93]
  • Set a placeholder PO-Revision-Date 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. [#92]
  • Remove ā€˜foo’ file [#88]
  • Include should override exclude instead of the other way around [#87]
  • Support parsing minified JS files created by WebPack [#85]
  • Add unit test cases for include/exclude options [#83]
  • Allow passing an empty file comment [#82]
  • Determine includes and excludes based on scores [#104]
  • Add parsing of .js.map files to improve reliability of JS translations [#103]
  • Remove second argument to WP_CLI::success() [#112]
  • Normalize paths [#111]
  • Normalize paths [#110]
  • Add i18n make-json command [#109]

wp-cli/language-command

  • Make sure upgrader strings are always in English [#54]
  • Slug fixes [#53]
  • Change access to activate_language() to private [#47]
  • Don’t error when a translation is not yet available [#69]
  • Check if array key exists to prevent undefined index notices [#67]
  • Support installing translations for all installed plugins/themes [#64]
  • Make use of report_batch_operation_results() for install commands [#63]
  • Continue if $available_updates is not a array [#62]
  • Add tests for wp site switch-language [#57]

wp-cli/media-command

  • Fix SVG regeneration test by adding an XML header to fake SVG file [#98]

wp-cli/package-command

  • Make tests work with both install and installation strings [#100]

wp-cli/php-cli-tools

  • Use forced width attribution as fallback only to avoid scrapping manual widths [#136]
  • Fix incorrect namespace for cli\notify\xxx [#137]

wp-cli/scaffold-command

  • PHPCSPHP Code Sniffer PHP Code Sniffer, a popular tool for analyzing code quality. The WordPress Coding Standards rely on PHPCS. template: fix XML error in ruleset [#171]
  • Add textdomain to blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. strings and update tests accordingly [#187]
  • Use branch for WP_TEST_TAG for RCRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. and betaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. [#186]
  • Missing text domain in post_type_extended.mustache [#184]
  • Work around Travis CI issue with _s download certificate [#182]
  • Fix typo in Travis config [#180]
  • Ignore ā€˜node_modules’ in PHPCS XML file [#178]
  • Allow for installation as well as install [#177]
  • Fix syntax error in block-php.mustache [#176]
  • Inc ā€˜menu_position’ when scaffolding a post type [#173]
  • Remove Inflector Class [#172]
  • Run docker-php-ext-install with sudo -E in CircleCI [#188]
  • Split up the list of expected files to allow for WP 5.0+ changes [#195]

wp-cli/search-replace-command

  • Corrects NULL export values. [#93]

wp-cli/server-command

  • Set SERVER_ADDR for the built-in webserver [#49]

wp-cli/wp-config-transformer

  • Add regression test for #5 [#8]
  • Remove colloquialism [#6]
  • Preserve leading whitespace characters on config update [#5]
  • Fix regex for closing syntax in string [#9]
  • Use real config filename in Exception messages [#11]

Contributors

Please give a big round of applause to these fine folks that have contributed their time and expertise to make this release possible: @abhijitrakas, @antigenius, @austinginder, @BhargavBhandari90, @birkestroem, @bitwombat, @bonny, @Calinou, @danielbachhuber, @dgroddick, @emirpprime, @fjarrett, @frozzare, @GaryJones, @Grucqq, @henrywright, @herregroen, @insomnux, @jrfnl, @KushibikiMashu, @markjaquith, @MoisesMN, @Mte90, @ocean90, @phillipp, @pmgarman, @rmccue, @siliconforks, @soulseekah, @swissspidy, @szepeviktor, @thrijith, @torounit, @tsmith1, @VladimirAus, @wojsmol, @yahilmadakiya, @yousan Thank you! ā¤ļø

#release, #v2-1-0