I’m pleased to present the first release of WP-CLI in 2014, coincidentally called 0.14.0. Let’s get right into it.
Automatically detect WordPress in a subdirectory
Having WordPress in a subdirectory is a great way keep your code repository clean.
Until now, you had to explicitly tell WP-CLI how to find it, either by using the --path= parameter, or by creating a wp-cli.yml file in the root directory. With version 0.14, it will find it automatically.
To make this not-common-enough scenario work, we had to once again call upon the dark powers of eval().
Protection against running as root
If you try to run a WP-CLI command as the superuser, WP-CLI will refuse to run. In production environments, most of the commands should actually be run under the same user as the web server. But, in general, running commands as root is a bad idea.
For example, if you run wp media regenerate as root, then the newly created thumbnail files will naturally be owned by root. If the web server is running under the www-data user, it won’t be able to change these files (unless they’re globally writable, which is less secure). So, the correct command would be sudo -u www-data wp media regenerate.
If you trigger this protection, you will also receive instructions about how to disable it.
--skip-plugins global flag
Ever used WP-CLI to install a plugin that broke WP-CLI? Well, now there’s a 100% sure way to deactivate it: wp --skip-plugins plugin deactivate naughty-plugin.
You can also skip only particular plugins: wp --skip-plugins=admin-blocker,complex-beast.
Breaking changes
wp term create,wp term update,wp term getandwp term deletenow accept the taxonomy as the first parameter, just like all the other term subcommands
Other changes
- added
wp post url,wp comment urlandwp site urlsubcommands - added
wp theme enableandwp theme disablesubcommands for multisite installs - added
wp term generatesubcommand - added
--recurse-objectsflag towp search-replace - added
--localeflag towp core update wp core downloadnow caches WordPress archives- all
wp usersubcommands now accept user emails as parameters (besides IDs and usernames) wp optionandwp *-metasubcommands can now read values from STDINwp importnow accepts multiple fileswp db exportnow accepts all parameters thatmysqldumpacceptswp exportnow uses a better backend developed by Nikolay Bachiyski (see #525)- plugin slugs passed to
wp pluginsubcommands are now always case-sensitive - fixed JetPack activation
- fixed
wp core is-installedfor multisite - fixed
--max_depthparameter forwp post generate - fixed
--roleparameter forwp user generate - fixed issue where
wp user import-csvwould pick up previous user IDs - fixed issue with progress bar calling
tputtoo often - execution is now aborted if too many positional parameters are passed or if an unknown associative parameter is passed
You can browse the full list of resolved issues on GitHub.
Contributors to this release: bartaakos, boonebgorges, danielbachhuber, eliorivero, francescolaffi, itsananderson, Japh, jmslbam, johnbillion, mboynes, mgburns, nb, rodrigoprimo, scribu, sibprogrammer, simonwheatley, SpikesDivZero, westonruter, ziz
