Welcome to WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/!
WP-CLI is the official command line tool for interacting with and managing your WordPress sites.
A new release of WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/, WP-CLI v2.12.0, is now available. For this release, we had 68 contributors collaborate to get 382 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This release includes numerous bug fixes and compatibility improvements, but we still could teach WP-CLI a few new tricks which I’ll highlight below. As always, you can also skip directly to the detailed changelog if you prefer.
If you already use WP-CLI, updating is as simple as wp cli update. Else, check out our website for recommended installation methods.
Pluck & patch commands for caches and transients
The cache and transient commands have now also learned the subtle art of plucking and patching. This means that you can directly manipulate individual entries in an array of values that these commands let you manage.
Here’s an example of how such an operation can look and how it compare to the regular cache/transient operations:
# Transient structure
# 'some_key' => ['foo' => ['bar' => 'baz']]
# Retrieve the transient value
$ wp transient get some_key --format=json
{'foo':{'bar':'baz'}}
# Retrieve the value of the foo => bar subkey
$ wp transient pluck some_key foo bar
baz
# Replace baz with bazzer
$ wp transient patch update some_key foo bar bazzer
Success: Updated transient 'some_key'.
Post lists can now handle complex query flags
When using post list, you can now use JSONJSONJSON, 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. notation to provide complex query arguments to the --tax_query, --meta_query and --post_date fields.
$ wp post list --field=post_title --date_query='{"before":{"year":"2024"}}
+--------------------------+
| post_title |
+--------------------------+
| My year in review - 2021 |
| My year in review - 2022 |
| My year in review - 2023 |
+--------------------------+
$ wp post list --field=post_title --tax_query='[{"taxonomy":"category","field":"slug","terms":"first-category"}]'
...
$ wp post list --field=post_title --meta_query='[{"key":"key2","value":"value2b"}]'
...
Post metaMetaMeta 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. can be forced to only return a single value
The post meta get command now has a --single flag defaulting to true which can be negated with --no-single. This flag tells WordPress whether to only return a single value or all existing values for a given key.
# Create a post meta key for post with ID 123 that has multiple values
$ wp post meta add 123 my_meta_key value_1
$ wp post meta add 123 my_meta_key value_2
$ wp post meta add 123 my_meta_key value_4
# Retrieve a single value
$ wp post meta get 123 my_meta_key --single
value_1
# Retrieve all values
$ wp post meta get 123 my_meta_key --no-single --format=json
["value_1","value_2","value_3"]
Exclude files on core checksum verification
When running a core checksum verification, you can exclude one or more files from the checksum verification with the new --exclude=<files> flag, which takes a comma-separated list of filepaths relative to the current root.
# Make a change to the README file in the WordPress core root folder
$ echo "nonsense" > readme.html
# Run the core checksum verification
$ wp core verify-checksums --exclude='readme.html'
Success: WordPress installation verifies against checksums.
Respect requires and requires_php tags for plugins and themes
The pluginPluginA 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 and theme commands now understand and respect the requires and requires_phpheaderHeaderThe 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. tags when trying ot install or update extensions. A new state unavailable has been introduced to denote the updates that are newer that your current installation but for which your site does not fulfill the requirements.
This also adds new fields requires and requires_php which are displayed if they contain relevant information and otherwise hidden by default.
$ wp plugin list
+----------------+----------+-------------+---------+----------------+-------------+----------+--------------+
| name | status | update | version | update_version | auto_update | requires | requires_php |
+----------------+----------+-------------+---------+----------------+-------------+----------+--------------+
| akismet | inactive | available | 5.1 | 5.3.5 | off | 5.8 | 5.6.20 |
| edit-flow | inactive | none | 0.9.9 | | off | 6.0 | 8.0 |
| wp-super-cache | inactive | unavailable | 1.9.4 | 1.12.4 | off | 6.5 | 7.0 |
+----------------+----------+-------------+---------+----------------+-------------+----------+--------------+
$ wp plugin update wp-super-cache
Warning: wp-super-cache: This update requires WordPress version 6.5, but the version installed is 6.2.
Error: No plugins updated.
More control over make-json generation
The make-json command was made more powerful again. You can not only set a custom text domain to be used, you can also define the file extension to parse.
# Use a custom text domain
$ wp i18n make-json foo-theme --domain=my-custom-domain
Success: Created 1 file.
# Include typescript files
$ wp i18n make-json foo-theme --extensions=".ts, .tsx"
Success: Created 2 files.
Force update checks on plugin|theme list
When displaying the list of plugins or themes, WP-CLI now always ensures you get fresh data. No need to manually clear transients anymore! The existing --skip-update-check flag can be used to prevent this behavior.
# Clears any update transients to trigger an update check and display results
$ wp plugin list --fields=name,status,update --force-check
+-------------+----------+--------+
| name | status | update |
+-------------+----------+--------+
| hello-dolly | inactive | none |
+-------------+----------+--------+
PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.4 Compatiblity
WP-CLI is now fully compatible with PHP 8.4. This has required quite a bit of trickery and hacks to maintain compatibility with our current minimum of PHP 5.6+ at the same time. With the next release, we’ll bump the minimum PHP version to 7.2.24+, which will allow us to get rid of all these workarounds again.
Detect MariaDB vs MySQLMySQLMySQL 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/. [#6072]
Make transient test more robust against added transients by coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. [#98]
Add pluck & patch commands for caches and transients [#89]
Add a flag for getting post meta as a single value or not [#523]
Add JSON input support for tax_query and meta_query [#522]
Add JSON input support for date_query argument [#520]
wp option – new autoload values in autoload filterFilterFilters 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. [#515]
Return a proper WP_Error object when failing to update a comment [#514]
Add test cases asserting post/term update error exit codes [#513]
Safeguard remove cap from collisions with roles [#530]
Use strpos() instead of str_contains() in get_wporg_data() function [#432]
Don’t use transient values when doing plugin|theme list [#446]
Fix fatal error issue in in_array() function [#445]
Support requires and requires_php in plugin|theme list and plugin|theme update commands [#440]
Update logic when deleting and uninstalling plugins [#438]
Check WordPress and PHP requirements before installing a theme or plugin [#436]
Add --force-check flag to wp plugin list and wp theme list. [#426]
Cache certain GitHubGitHubGitHub 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/ URLs [#385]
Update templates for child themeChild themeA 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/. scaffolding [#342]
Update custom post typeCustom Post TypeWordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept. and taxonomyTaxonomyA 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. scaffolding [#341]
A new release of WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/, WP-CLI v2.11.0, is now available. For this release, we had 61 contributors collaborate to get 274 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This is a small release that fixes a lot of small and not so small bugs, but we also have a couple of new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.
If you already use WP-CLI, updating is as simple as wp cli update. Else, check out our website for recommended installation methods.
Thank you for providing the additional details on the pull requests. I’ll go through each one and provide improved highlights with examples and usage details:
Improved CSV Handling
The CSV reading functionality has been enhanced to properly handle multi-line values. This fix ensures that complex CSV data can be processed correctly, improving the reliability of commands that work with CSV input.
Example of a CSV file that can now be correctly processed:
id,name,description
1,"Product A","This is a
multi-line
description"
2,"Product B","Another description"
New Signup Management Commands
New commands have been added for managing signups on multisiteMultisiteMultisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network. installations:
wp user signup list: List signups
wp user signup get: Get details about a signup
wp user signup activate: Activate one or more signups
wp user signup delete: Delete one or more signups
Example usage:
# List all signups
$ wp user signup list
# Activate a signup
$ wp user signup activate johndoe@example.com
# Delete a signup
$ wp user signup delete 123
New Site Generator Command
A new wp site generate command has been added to create multiple sites programmatically in a multisite installation. This is useful for testing or development purposes.
Example usage:
# Generate 10 new sites
$ wp site generate --count=10
# Generate sites with a specific slug
$ wp site generate --count=2 --slug=testsite
GitHubGitHubGitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ Release Installation Support
The extension command now supports installing plugins and themes directly from GitHub releases. This feature allows users to easily install and manage extensions hosted on GitHub without manual downloads.
Example usage:
# Install a plugin from its latest GitHub release
$ wp plugin install https://github.com/username/plugin-name/releases/latest
# Install a specific version of a theme from GitHub
$ wp theme install https://github.com/username/theme-name/releases/tag/v1.2.3
Improved PluginPluginA plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party Management
A new --recently-active option has been added to the plugin list command, allowing users to quickly identify and manage plugins that have been recently active on their site.
Example usage:
# List recently active plugins
$ wp plugin list --recently-active
# Activate all recently active plugins
$ wp plugin activate $(wp plugin list --recently-active --field=name)
Option to Delete Unknown Image Sizes
A new --delete-unknown flag has been added to the wp media regenerate command. This allows users to remove files and image metadata for image sizes that no longer exist in the site’s configuration, without regenerating other thumbnails.
Example usage:
# Remove unknown image sizes for all images
$ wp media regenerate --delete-unknown
# Remove unknown image sizes for a specific image
$ wp media regenerate 123 --delete-unknown
This feature is particularly useful for cleaning up after changing image size configurations or removing plugins that added custom image sizes.
User Existence Check Command
A new wp user exists command has been added, similar to the existing wp post exists command. This allows for quick checks on whether a user exists in the WordPress database.
Example usage:
# The user exists.
$ wp user exists 1337
Success: User with ID 1337 exists.
$ echo $?
0
# The user does not exist.
$ wp user exists 10000
$ echo $?
1
Fish Shell Completion Support
WP-CLI now supports command completion for the Fish shell, expanding its compatibility beyond Bash and Zsh. This addition makes it easier for Fish shell users to work with WP-CLI commands.
Detailed change log
To avoid too much noise in the list above, the following types of pull requests have been omitted:
PRs that only bumped dependencies to their latest version.
Stop testing WordPress latest version on PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. < 7.2 [#651]
Fix breaking multi-line CSV values on reading [#5939]
Fix broken GutenbergGutenbergThe Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ test [#5938]
Update docker runner to resolve docker path using /usr/bin/env [#5936]
Separate out the WP-CLI Hack Day and WordCampWordCampWordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Contributor Day docs [#490]
Update failing tests after new transient in WP coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. [#97]
Show additional plugin headerHeaderThe header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. values in plugin get <plugin> output [#414]
A new release of WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/, WP-CLI v2.10.0, is now available. For this release, we had 63 contributors collaborate to get 233 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This is a small release that fixes a lot of small and not so small bugs, but we also have a couple of new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.
If you already use WP-CLI, updating is as simple as wp cli update. Else, check out our website for recommended installation methods.
New i18n make-php command
The WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. performance team is working on the Performant Translations feature project, which aims to speed up translations by using PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. files instead of MO files. The goal is to get it ready for WordPress 6.5.
The new i18n make-php command allows you to experiment with these faster translations right away and see how these work for your projects.
# Create PHP files for all PO files in the current directory.
$ wp i18n make-php .
# Create a PHP file from a single PO file in a specific directory.
$ wp i18n make-php example-plugin-de_DE.po languages
Update themes to minor or patch versions
When updating themes with WP-CLI, you can now to choose to only update to the latest minor or patch version with the new flags --minor and --patch.
You could already do this for pluginPluginA plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party updates, and now themes are joining the club as well.
Support for adding and removing of multiple user roles
The two commands user add-role and user remove-role are now less lazy and can accept multiple roles to add or remove for a given user. You can make this work by simply adding as many roles as needed as separate arguments.
$ wp user add-role 12 author editor
Success: Added 'author', 'editor' roles for johndoe (12).
$ wp user remove-role 12 author editor
Success: Removed 'author', 'editor' roles for johndoe (12).
FilterFilterFilters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. the site list by user
When displaying a list of sites on your multisiteMultisiteMultisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network. network, you can now filter this list by a site user and only display sites that this user is a part of. You can do so by using the new --site_user flag for the site list command.
This can be helpful for administrative tasks around access control or for offboarding users.
Detailed change log
To avoid too much noise in the list above, the following types of pull requests have been omitted:
PRs that only bumped dependencies to their latest version.
Add verbosity level and quiet flag in ssh command based on debug flag [#5869]
Remove the pre-commit hook installation and its corresponding command [#5868]
Add missing required arguments when using --prompt [#5865]
Move RecursiveDataStructureTraverser to wp-cli/wp-cli package [#5864] [#5866] [#5871]
Add docker compose command support in SSHSSHSecure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. command generation [#5863]
Add missing documentation for $data attribute in http_request() [#5861]
Add support for MySQLMySQLMySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/. socket connection [#171]
Add command to get the post ID by URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org [#449]
Support for adding and removing of multiple user roles [#437]
Add examples on listing unapproved, spam and trashTrashTrash in WordPress is like the Recycle Bin on your PC or Trash in your Macintosh computer. Users with the proper permission level (administrators and editors) have the ability to delete a post, page, and/or comments. When you delete the item, it is moved to the trash folder where it will remain for 30 days. comments [#436]
Added --minor and --patchCLICLICommand Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. option in wp theme update [#393]
Fix counting of errors when attempting activations [#398]
Properly delete JSONJSONJSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. & PHP translation files [#137]
A new release of WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/, WP-CLI v2.9.0, is now available. For this release, we had 62 contributors collaborate to get 225 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 polishing PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.2 support and ensuring compatibility with WordPress 6.4. Nevertheless, apart from the flurry of bugs that were fixed, 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.
If you already use WP-CLI, updating is as simple as wp cli update. Else, check out our website for recommended installation methods.
wp config is-true
The new wp config is-true command determines whether value of a specific defined constant or variable is truthy. This is useful for scripting purposes. Example:
# Assert if MULTISITE is true
$ wp config is-true MULTISITE
$ echo $?
0
Uninstalling languages for all plugins/themes at once
The wp language plugin and wp language theme commands both now support the --all flag. If set, languages for all plugins will be uninstalled. This brings them more in line with other wp language commands.
Modify sites by slug
All the wp site subcommands, such as wp site archive, wp site delete or wp spam now support a --slug argument instead of passing an ID. Here, the slug is the path of the site to be modified. Subdomain on subdomain installs, directory on subdirectory installs.
SSHSSHSecure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. ProxyJump support
The wp-cli.yml config file now supports a proxyjump key for hosts to specify a common proxy for all traffic to go through. This is the equivalent of passing the -J argument to ssh.
Beginning testing against SQLite
This is not a change in WP-CLI itself, but starting with WP-CLI 2.9.0, we’re now running all automated tests against SQLite, using the SQLite Database Integrationfeature pluginFeature PluginA plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. developed by the community. This not only makes contributions easier (as no MySQLMySQLMySQL 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/. database server is needed), but also paves the way for eventually supporting using WP-CLI with WordPress sites using SQLite. It’s still a long way to go, but the initial results are very positive. More on this in the future!
Update DEBIAN/control depends to support later versions of PHP [#562]
Run trunkdeployDeployLaunching code from a local development environment to the production web server, so that it's available to visitors. tests against PHP 7 instead of PHP 5.6 [#560]
Respect alias --path= in IncludeRequestsAutoloader [#5830]
Update type hint of $callable parameter in add_command() method [#5828]
Require PHP 7.0 for tests installing WP via Composer [#5825]
Require PHP 7+ for installing GutenbergGutenbergThe 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/ [#5824]
Remove blank line from HTMLHTMLHTML is an acronym for Hyper Text Markup Language. It is a markup language that is used in the development of web pages and websites. table [#465]
Fix handbook manifest JSONJSONJSON, 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. corruption [#457]
Add a new doc for WordCampWordCampWordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Contributor Day [#456]
Update GitHubGitHubGitHub 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/ links to use search endpoint instead [#453]
Fix multisiteMultisiteMultisite 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. search-replace example [#451]
Change mysql CLICLICommand Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. call to native PHP function [#158]
The v2.9.0 release of WP-CLIWP-CLIWP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/https://make.wordpress.org/cli/ is scheduled to be published on Wednesday, October 25th 2023.
In addition to a lot of bug fixes and enhancements, this release is also expected to address the last known compatibility issues with PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.2 and the upcoming WordPress 6.4 version.
The release candidateRelease CandidateA beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. for this release will already be available sometime during the week prior, to allow for early testing. We will announce the availability of that release candidate in the #hosting-community channel to allow hosting providers to do early smoke testing.
A new release of WP-CLIWP-CLIWP-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.8.1. For this release, we had 3 contributors collaborate to get 7 pull requests merged.
This is a hotfix release to fix 2 critical bugs with release v2.8.0.
After a bit of unexpected delay, a new release of WP-CLIWP-CLIWP-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.8.0. For this release, we had 66 contributors collaborate to get 277 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 polishing PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.1/8.2 support. Nevertheless, apart from the flurry of bugs that were fixed, 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.
Bundled with Requests v2
The last component that needed updating for full PHP 8.1 was the bundled Requests library. With the move to v2 of Requests, adding support for PHP 8.1 seems to be complete, an.d PHP 8.2 is starting to look good as well.
Note that the way the dependencies interact between WP-CLI and WordPress CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. (which has no proper dependency management that could help out here) makes for a somewhat hacky solution at this time. We’re looking into something more robust for a future release, but until then make sure you submit issues when you encounter edge cases that the current approach does not yet take into account.
Improve support for caching solutions
There is a new command wp cache supports <feature> to detect cache features like add_multiple. Furthermore, we have a new command wp cache flush-group that allows you to flush at the group level. Also, WP-CLI now produces warning when you use wp transient list when an object cache is active. Finally, WP-CLI now recognizes Object Cache Pro as a caching solution.
$ wp cache supports add_multiple
$ echo $?
0
$ wp cache flush-group my_group
Success: Cache group 'my_group' was flushed.
Fetch URLs of entities
For the posts, terms and comments, you can now retrieve their canonical URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org via the --field=url argument. As an example, you can retrieve the URL of the post with ID 123 via the following command:
$ wp post get 123 --field=url
https://example.com/hello-world-the-sequel/
Skip config changes on multisiteMultisiteMultisite 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. conversion
In case you’re working on a read-only filesystem or are forced to push file changes through VCS, you can now skip the automatic config file changes that wp core multisite-convert does. All you need to do is add the --skip-config flag, and the command will not only obey that choice, but also conveniently print the changes you need to make to the config file manually. This behavior was already included with wp core multisite-install, but now the conversion command knows this trick too.
$ wp core multisite-convert --skip-config
Set up multisite database tables.
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', {$subdomain_export} );
\$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Success: Network installed. Don't forget to set up rewrite rules (and a .htaccess file, if using Apache).
Verify checksums for the root folder
The wp core verify-checksums now has a new --include-root flag that makes it scan and verify the root folder as well (the one that ABSPATH points to).
$ wp core verify-checksums --include-root
Warning: File should not exist: dump.sql
Warning: File should not exist: backdoor.php
Configure autoloading behavior for options
Two new commands wp option get-autoload and wp option set-autoload have been added to change the autoloading behavior for an existing option. This was not easily possible with wp option update as that only allowed the autoloading to change when the value changed as well.
$ wp option add foo bar
Success: Added 'foo' option.
$ wp option get-autoload foo
yes
$ wp option set-autoload foo no
Success: Updated autoload value for 'foo' option.
$ wp option set-autoload foo no
Success: Autoload value passed for 'foo' option is unchanged.
New flags for password reset
The command wp user reset-password now has two new flags. The first one is --show-password, and it will immediately show the new password as it is being reset. The second one is --porcelain, and it will show only the password and nothing else as output of the command. The latter one is useful for scripting purposes.
$ wp user reset-password admin --skip-email --show-password
Reset password for admin.
Password: bt6Hy!9*P0A1
Success: Password reset for 1 user.
$ wp user reset-password admin --skip-email --porcelain
yV6BP*!d70wg
Include ad-hoc code instead of evaluating it
If you’re using the wp eval-file command, it will read the file you point it to and run it through the PHP eval logic. This has a few drawbacks, though. One one hand, directives like declare(strict_types=1) will throw errors. On the other, it is not possible to use XDebug to debug such an evaluated piece of code.
To counter this, the wp eval-file command now has a new --use-include flag that makes it include the file you’re pointing to, instead of running it through eval. Note that this does not work with STDIN as input, so the - file argument can not be used at the same time as the --use-include flag.
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.
Use WP_CLI_FORCE_USER_LOGIN=1 to force --user=<login> [#5738]
Fix --skip-themes for themes with blockBlockBlock 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. patterns [#5737]
Make sure subcommand@alias definition respects @when definition [#5730]
Link to ‘Shell Friends’ from the Philosophy doc [#435]
Add example for how to discard headerHeaderThe 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. row from CSV [#434]
Adding new pluginPluginA 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 to handbook [#427]
Use wp_get_ready_cron_jobs() for --due-now to apply core filterFilterFilters 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. [#89]
Warn instead of fatal when invalid cron event is detected [#93]
Add --exclude=<hooks> argument to wp cron event run [#97]
Travis is no longer in use, so fine to remove config files [#171]
Avoid deleting metaMetaMeta 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. for other sizes when running wp media regenerate with --image_size [#170]
Update the GitHubGitHubGitHub 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/ URL for db.php [#317]
Add phpcompatibility-wp coding standards to Gitlab template [#315]
Use platform-agnostic mysql-client packages in Gitlab CI [#314]
Added vendor to the generated .gitignore which the scaffold creates [#279]
The v2.8.0 release of WP-CLIWP-CLIWP-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 PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.2 issues within WP-CLI itself.
The release candidateRelease CandidateA 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.
A new release of WP-CLIWP-CLIWP-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.
Fix PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. 8.1 fatal error with --orderby=size and --size_format=mb [#230]
Avoid throwing error when excluding missing pluginPluginA 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]
A new release of WP-CLIWP-CLIWP-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.
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 extensibleExtensibleThis is the ability to add additional functionality to the code. Plugins extend the WordPress core software. via a clean APIAPIAn 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 filterFilterFilters 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 PHPPHPPHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. bootstrapping logic.
You can use both of these to let the WP_CLI_EARLY_REQUIRE load a PHP file that defines a new filter callback and then sets the WP_CLI_CONFIG_SPEC_FILTER_CALLBACK to point to that filter.
This test snippet shows an example of how these two mechanisms can be used in tandem:
Download WordPress CoreCoreCore 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 HTTPHTTPHTTP 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 URLURLA 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 metaMetaMeta 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 pluginPluginA 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 GutenbergGutenbergThe 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.
Fix broken tests due to DB connection failure error message change [#224]
Stop reordering most MySQLMySQLMySQL 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]
Support filtering for users without a role with --role=none [#360]
Sync user-contributed example to user delete [#358]
Fix JSONJSONJSON, 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]
You must be logged in to post a comment.