Happy release day! After 210 total merged pull requests, we’re excited to bring you WP-CLI v1.3.0.
Install packages with shortened identifiers
Recently, we have been discussing the future of the WP-CLI package index. Our conclusion was to deprecate the existing package index for now and provide a new mechanism for more easily installing external commands that are hosted on GitHub.
As of WP-CLI v1.3.0, whenever you provide a package identifier in the form of <vendor>/<package>, WP-CLI will first check the deprecated package index (for backward compatibility reasons), and then check for a GitHub repository that matches this identifier. This also accepts all version qualifiers/requirements that Composer can parse.
Examples:
# Install vendor/command from GitHub (uses https://github.com/vendor/command):
$ wp package install vendor/command
# Install version 1.0.5 of vendor/command:
$ wp package install vendor/command:v1.0.5
# Install commit 95ce52b of vendor/command:
$ wp package install vendor/command:dev-master#95ce52b
New commands
Wondering whether a specific string exists in your database? Wonder no more! Use the new wp db search to search through all text columns in your database for your specified string (or regex pattern) [#29, #33]:
# Search through the database for the 'http://' regular expression, printing stats.
$ wp db search 'http:\/\/' --regex --stats
wp_comments:comment_author_url
1:https://wordpress.org/
...
Success: Found 99146 matches in 10.752s (10.559s searching). Searched 12 tables, 53 columns, 1358907 rows. 1 table skipped:
wp_term_relationships.
Need easy access to the database prefix for chaining into other commands? Use wp db prefix to print it out [#22]:
$ wp db prefix --url=example.com/foo
wp_3_
Everything else in v1.3.0
Command improvements
wp config *:- Errors early when no
wp-config.phpcan be found [#22].
- Errors early when no
wp config create:- Generates keys/salts locally and use WordPress.org API as fallback [#25].
wp config get:wp core (multisite-install|multisite-convert):- Use
--skip-configto avoid addition of multisite constants towp-config.phpfile [#18].
- Use
wp import:- Prevents non-existent directories from ending up in the list of files to import [#8].
wp media *:- Changes media noun to ‘items’ in most cases, to reflect multi-type nature of media [#18].
wp media import:- Adds
--skip-copyflag to allow import of media from local filesystem without moving on disk [#21].
- Adds
wp package install:- Adds support for short package identifiers [#22].
wp post term delete:- Implements
--allflag to remove all terms from a post [#23].
- Implements
wp scaffold *:wp search-replace:- Includes
--format=countto only show number of rows affected [#14].
- Includes
wp term (get|update|delete):- Introduces
--by=<type>argument to get/update/delete term by slug [#27].
- Introduces
wp user *:- Support fetching users with an email address in the login field [#21].
wp super-admin remove:- Allows revoking super-admin of non-existent user [#6].
Framework enhancements
- Fixes autoload file names for
$custom_vendorcondition [#4147]. - Saves runtime config so it can be passed as args to
Runner::run_alias_group()invocation [#4148]. - Manually loads comments if
opcache.save_commentsis disabled [#4161]. - Allows numbers in subcommand names and arguments [#4164, #4269].
- Fixes double slash in
boot-phar.phppath [#4169]. - Allows root use of
wp cli info, in addition towp cli update[#4177]. - Updates SSH URL parser regexp to allow for null port number [#4182].
- Add
WP_CLI\Utils\get_home_dir()helper function [#4184]. - Reduces included files (Behat/PHPUnit in particular) in built Phar [#4185].
- Behat: Allows test DB user + pass to be set by environment variables [#4196].
- Fixes output in JSON format in case of error while encoding [#4199].
- Passes
WP_CLI_STRICT_ARGS_MODEon to--ssh=<ssh>if set [#4207]. - Displays a more helpful error message when site cannot be found [#4212].
- Fixes broken indentation on Windows systems because of line endings [#4221, #4222].
- Adapts
--ssh=<ssh>flag to work with Docker and Docker Compose [#4240]. - Checks for availability of
proc_open/closein various scenarios [#4245].
Contributors to this release (45 total): aaemnnosttv, BhargavBhandari90, chetansatasiya, chriszarate, cjhaas, colemanedwards, danielbachhuber, davetha, drrobotnik, electrokit, emgk, emirpprime, erikjoling, fjarrett, freegenie, gitlost, greatislander, iansvo, Ippey, jalavoy, jameselks, joehoyle, johnbillion, @JPry, junaidbhura, kouratoras, lucatume, @mapk, mikeschinkel, miya0001, @murtzsarialtun, nikolov-tmw, pierre-dargham, plastikdreams, rahul286, ronaksampat, schlessera, Sidsector9, soulseekah, szepeviktor, tfrommen, vbaranovskiy-plesk, westonruter, wp-make-coffee, wpbullet