WP-CLI (original) (raw)
A new release of WP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/, WP-CLI v2.11.0, is now available. For this release, we had 61 contributors collaborate to get 274 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This is a small release that fixes a lot of small and not so small bugs, but we also have a couple of new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.
If you already use WP-CLI, updating is as simple as wp cli update
. Else, check out our website for recommended installation methods.
Thank you for providing the additional details on the pull requests. I’ll go through each one and provide improved highlights with examples and usage details:
Improved CSV Handling
The CSV reading functionality has been enhanced to properly handle multi-line values. This fix ensures that complex CSV data can be processed correctly, improving the reliability of commands that work with CSV input.
Example of a CSV file that can now be correctly processed:
id,name,description
1,"Product A","This is a
multi-line
description"
2,"Product B","Another description"
New Signup Management Commands
New commands have been added for managing signups on multisite Multisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network. installations:
wp user signup list
: List signupswp user signup get
: Get details about a signupwp user signup activate
: Activate one or more signupswp 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
GitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ Release Installation Support
The extension command now supports installing plugins and themes directly from GitHub releases. This feature allows users to easily install and manage extensions hosted on GitHub without manual downloads.
Example usage:
# Install a plugin from its latest GitHub release
$ wp plugin install https://github.com/username/plugin-name/releases/latest
# Install a specific version of a theme from GitHub
$ wp theme install https://github.com/username/theme-name/releases/tag/v1.2.3
Improved Plugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party Management
A new --recently-active
option has been added to the plugin list
command, allowing users to quickly identify and manage plugins that have been recently active on their site.
Example usage:
# List recently active plugins
$ wp plugin list --recently-active
# Activate all recently active plugins
$ wp plugin activate $(wp plugin list --recently-active --field=name)
Option to Delete Unknown Image Sizes
A new --delete-unknown
flag has been added to the wp media regenerate
command. This allows users to remove files and image metadata for image sizes that no longer exist in the site’s configuration, without regenerating other thumbnails.
Example usage:
# Remove unknown image sizes for all images
$ wp media regenerate --delete-unknown
# Remove unknown image sizes for a specific image
$ wp media regenerate 123 --delete-unknown
This feature is particularly useful for cleaning up after changing image size configurations or removing plugins that added custom image sizes.
User Existence Check Command
A new wp user exists
command has been added, similar to the existing wp post exists
command. This allows for quick checks on whether a user exists in the WordPress database.
Example usage:
# The user exists.
$ wp user exists 1337
Success: User with ID 1337 exists.
$ echo $?
0
# The user does not exist.
$ wp user exists 10000
$ echo $?
1
Fish Shell Completion Support
WP-CLI now supports command completion for the Fish shell, expanding its compatibility beyond Bash and Zsh. This addition makes it easier for Fish shell users to work with WP-CLI commands.
Detailed change log
To avoid too much noise in the list above, the following types of pull requests have been omitted:
- PRs that only bumped dependencies to their latest version.
- PRs that only fixed a typo in the documentation.
- PRs that add a Composer script.
wp-cli/wp-cli-bundle
- Update versions of WP-CLI used in tests [#658]
- Stop testing WordPress
latest
version on PHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. < 7.2 [#651]
wp-cli/wp-cli
- Add fish shell completion [#5954]
- Add defaults and accepted values for
runcommand()
options in documentation [#5953] - Address warnings with filenames ending in full stop on Windows [#5951]
- Fix unit tests [#5950]
- Update copyright year in license [#5942]
- Fix breaking multi-line CSV values on reading [#5939]
- Fix broken Gutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ test [#5938]
- Update docker runner to resolve docker path using
/usr/bin/env
[#5936] - Fix
inherit
path in nested directory [#5930] - Minor docblock improvements [#5929]
- Add Signup fetcher [#5926]
- Ensure the alias has the leading
@
symbol when added [#5924] - Include any non-default hook information in
CompositeCommand
[#5921] - Correct completion case when it ends in
=
[#5913] - Fix inline comments [#5912]
- Update inline comments [#5910]
- Add a real-world example for
cli has-command
[#5908] - Fix typos [#5901]
- Avoid PHP deprecation notices in PHP 8.1.x [#5899]
wp-cli/handbook
- Update handbook for v2.11.0 release [#531]
- Add missing scaffold package markdown files [#529]
- Fix
Undefined array key
warning [#525] - Add files autoloader for
bin/command.php
[#524] - Small typo correction [#523]
- Fix documentation generation error [#520]
- Add Yoast WP-CLI command to
tools.md
[#517] - Add search and replace quick start & adding new command [#515]
- Add Composer package name [#514]
- Clean up hosting links [#513]
- Add to
hosting-companies.md
[#512] - Remove invalid link from handbook [#511]
- Update contributor day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/. page for WCEU 2024 [#510]
- Add documentation on Fish completions [#508]
- Add code quality setup [#506]
- Fix global parameters 404 link [#504]
- Fix release checklist hyperlink [#503]
- Fix broken link for the global parameters hyperlink [#502]
- Include hook details in documentation [#501]
- Add link to contribution tutorial videos [#500]
- Update
hosting-companies.md
[#499] - Refresh the Hack Day page for April 2024 [#498]
- Fix branch name in common issues handbook page [#497]
- Fix common issues title [#496]
- Fix broken link [#494]
- Add Hack Day page to manifest [#492]
- Separate out the WP-CLI Hack Day and WordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Contributor Day docs [#490]
- Update
running-commands-remotely.md
[#489] - Update brew formula link [#487]
- Update
installing.md
[#481]
wp-cli/cache-command
- Update failing tests after new transient in WP core Core is the set of software required to run WordPress. The Core Development Team builds WordPress. [#97]
wp-cli/config-command
- Improve messaging when shuffling salts [#177]
- Fix incorrect message shuffling salt in PHP 5.6 [#176]
- Update
config
commands examples [#174] - Refactor
config create
command [#181]
wp-cli/core-command
- Remove extraneous argument in
core update
example [#255] - Fix
--format
incore check-update
command [#253] - Update
core
commands docs [#251]
wp-cli/cron-command
wp-cli/db-command
- Add note about multisite usage in
db query
docs [#251] - Enable
--format=<format>
fordb search
[#247] - Update tests after change in WP
trunk
version [#257]
wp-cli/embed-command
- Update examples for
embed
commands [#75]
wp-cli/entity-command
- Avoid time dependent test in
user application-password
[#499] - Support new upstream autoload options [#496]
- Support nickname when creating user [#495]
- Use
twentytwelve
theme in menu location test [#494] - Add examples for
option set-autoload
andoption get-autoload
commands [#492] - Add missing
## OPTIONS
inCommandWithTerms
class [#487] - Add
user exists
command [#486] - Accept user login and email in
user spam
anduser unspam
commands [#485] - Update doc for
user spam
anduser unspam
command [#483] - Validate reassigning user in
user delete
command [#482] - Fix warning message in
user spam
command [#481] - Add missing
application-password
andsite meta
subcommands to readme [#478] - Introduce
--format=ids
inuser application-password list
[#475] - Fix dynamic property issue in user session class [#470]
- Fix PHP notice in
comment recount
with invalid ID [#469] - Fix example for
site deactivate
command [#468] - Update examples in
user
commands [#467] - Update
term
commands examples [#466] - Update example output for
comment delete
command [#465] - Fix
menu
command output examples [#462] - Add
site generate
command [#498] - Add commands for managing signups on multisite [#489]
wp-cli/extension-command
- Improve warning message for installing and activating multiple themes [#419]
- Replace
user-switching
plugin from feature tests [#418] - Update the theme in feature tests [#417]
- Show additional plugin header The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. values in
plugin get <plugin>
output [#414] - Add
tested_up_to
field [#413] - Warn when supplying multiple themes with
theme install --activate
[#408] - Fix
plugin
commands examples [#403] - Update
theme
commands examples [#401] - Correct parameter type in
ParseThemeNameInput
trait [#400] - Add
--recently-active
option inplugin list
command [#424] - Fix visibility in command class methods [#423]
- Add support for GitHub release installation [#421]
- Replace
edit-flow
plugin bydebug-bar
in feature tests [#427]
wp-cli/i18n-command
- Skip strings without translation in
make-php
[#389] - Add more headers to PHP translation files [#388]
- Use relative paths for file header references [#384]
- Translate “description” field from
theme.json
[#408] - Revert changes to extract title from
styles.blocks.variations
[#407] - find
title
string withinstyles.blocks.variations
intheme.json
[#405] - Add tests for
rspack
andesbuild
bundle output [#404] - Fix deprecation warnings in unit tests [#402]
- Use relative paths for file header references (Windows fix) [#400]
- Ensure that the POT file uses the same license as the theme [#399]
- Add examples for
i18n update-po
command [#392] - Add examples for
i18 make-pot
[#390]
wp-cli/language-command
- Update examples for
language
command [#145] - Update examples for
language core
command [#142] - Update examples for
language theme
command [#141] - Update examples for
language plugin
command [#140] - Improve warning message for unavailable language pack [#139]
- Update doc for
language core install
command [#153] - Add
--format=count
inlanguage list
commands [#151] - Update feature tests for
language core update
[#149]
wp-cli/maintenance-mode-command
- Add missing
OPTIONS
heading inmaintenance-mode activate
command [#28]
wp-cli/media-command
- Fix incorrect image sizes in
media image-size
command [#192] - Remove extraneous error check [#191]
- Update
media
commands examples [#189] - Optimize memory consumption when querying attachments [#188]
- Add option to delete unknown image sizes [#199]
wp-cli/package-command
- Update docs and examples for
package
commands [#186] - Fix failing test [#185]
- Fix failing PHPUnit tests [#188]
wp-cli/php-cli-tools
- Fix unit tests [#172]
wp-cli/scaffold-command
- Update theme tests to remove
p2
and usetwentytwelve
[#336] - Correct plugin main file in bootstrap in scaffolded test [#335]
- Scaffold theme test should work in PHP greater than 8.0 [#334]
- Add GitHub as valid CI for
plugin scaffold
andtheme scaffold
[#331] - Update
scaffold
command examples [#329]
wp-cli/search-replace-command
wp-cli/super-admin-command
wp-cli/widget-command
- Replace
p2
theme withtwentytwelve
in feature test [#61]
wp-cli/wp-config-transformer
- Fix failing PHPUnit tests [#52]
Contributors
@2ndkauboy, @aldisruiz, @austinginder, @benjaminprojas, @BrianHenryIE, @Chintesh, @christianwach, @cliffordp, @dac514, @danielbachhuber, @dd32, @dlind1, @drzraf, @elenachavdarova, @ernilambar, @gedex, @gitlost, @grafruessel, @greatislander, @herregroen, @huzaifaalmesbah, @i-am-chitti, @janw-me, @jenkoian, @jkrrv, @jrfnl, @l3ku, @localheinz, @matzeeable, @meszarosrob, @michaelzangl, @Mike-Hermans, @mrsdizzie, @oandregal, @ocean90, @oxyc, @pbiron, @pdaalder, @petitphp, @pmbaldha, @ponsfrilus, @ramonjd, @rodrigoprimo, @Roy-Orbison, @saas786, @schlessera, @Scotchester, @sdnunca, @shawnhooper, @shendy-a8c, @siliconforks, @strarsis, @swissspidy, @szepeviktor, @Takshil-Kunadia, @tfirdaus, @thelovekesh, @Tug, @UmeshSingla, @wojsmol, @yousan