Happy release day!
After 325 merged pull requests, we’re excited to bring you 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/ v1.2.0, chock full of enhancements, bug fixes… and a bootstrap refactor.
We have a new logo!
Coming soon to a laptop near you:
Thanks to Chris Wallace and the crew at Lift UX for their work, as well as everyone who responded to my pings about feedback.
Commands abstracted to distinct packages
We’ve split up the project!
wp-cli/wp-cli repository now only contains the framework itself. All of the bundled commands can be found in separate repositories. For instance, the
wp cache * series of commands are now located at github.com/wp-cli/cache-command.
This abstraction provides a few benefits:
- While developing, the tests are only run for the specific component you’re working on, making the feedback loop 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. much shorter.
- Individual command packages can be controlled and set up independently, opening up the opportunity for better collaboration.
- Hotfixes and intermediary releases can be published for individual commands, that can then be updated through the built-in package manager.
- Tests run really fast now.
- When you submit a pull request, you don’t have to wait two hours for the tests to run.
For those using WP-CLI via Composer, you can contribute improvements to packages as you’d normally contribute to Composer dependencies. Use
composer install --prefer-source to install dependencies as Git Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/. clones.
For those using WP-CLI via Phar downloadable, you can contribute improvements by installing the package (which will override the bundled version). For instance, with the cache command, this is:
$ wp package install email@example.com:wp-cli/cache-command.git
$ cd $(wp package path wp-cli/cache-command)
Check out #3728 for the original history. For a better understanding of the underlying infrastructure, read Alain’s posts about the new bootstrapping mechanism, managing command dependencies and dependency resolution mechanisms.
Next up: Contribution workflow
The investments in package abstraction and the bootstrap process are a part of our larger effort to improve the contribution workflow.
Ultimately, we’d like to make contributing to the project:
- Effortless. While understanding the WP-CLI codebase does require a certain technical knowledge, those who can contribute to the codebase should be able to do so with as little overhead as possible.
- Enjoyable. Making improvements to WP-CLI should be fun and rewarding. For contributors, this means well-defined entry points, sufficient workflow documentation, clearly-articulated vision, roadmap, and decision-making process, and so on.
For new contributors, we now have a Good First Issues page:
For committers, we now have the beginnings of a customized dashboard:
Work on the contribution workflow is an on-going process. We’ve barely scratched the surface.
Expect to see lots efforts on some of the key areas that make up the contributor experience:
- Articulation of the decision making process for transforming ideas into new commands. We need to identify how we can sustainably transform ideas into maintained packages.
- Improving the onboarding of new committers through documentation, tools and processes. Read the Committers credo to better understand our expectations.
Join the conversation during our weekly office hours, Tuesday, April 25 at 16:00 UTC, or at 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. Europe.
Want to sanity check your
wp config get list constants and globals defined in
$ wp config get --fields=key,value
| key | value |
| table_prefix | wp_ |
Don’t want to remember where
wp-config.php is on your filesystem? Use
wp config path to get the path to
# Edit wp-config.php in your editor.
$ vim $(wp config path)
Curious how much your database weighs? Run
wp db size to get the size of the database and its tables [#16]
$ wp db size --tables
| Name | Size |
| wp_users | 64 KB |
| wp_usermeta | 48 KB |
| wp_posts | 4 MB |
| wp_comments | 2 MB |
| wp_links | 32 KB |
| wp_options | 1 MB |
| wp_postmeta | 8 MB |
| wp_terms | 416 KB |
| wp_term_taxonomy | 336 KB |
| wp_term_relationships | 736 KB |
| wp_termmeta | 48 KB |
| wp_commentmeta | 2 MB |
Everything else in v1.2.0
wp core install:
- Generates 18 character password for admin user [#4002].
wp cron event run:
- Only runs specified events when
$args are passed with
wp db *:
/usr/bin/env mysql instead of
mysql when calling MySQL 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/. executable [#14].
wp db (drop|reset):
- Presents database name to confirmation prompts for
wp db drop and
wp db reset commands [#12].
wp db export:
--exclude_tables=<tables> option when exporting a database [#20].
wp db import:
- Speeds up import process by disabling auto-commit and (unique and foreign) key checks [#3829].
wp language core install:
--activate flag even when language is already installed [#3851].
wp language core (install|uninstall)
- Permits multiple languages to be installed or uninstalled at the same time [#4, #5].
wp media import:
- Error handling is improved in a variety of ways [#3755].
wp media regenerate:
- Deletes existing PDF preview images upon regeneration [#3824].
- Fixes media regeneration when an image has a dimension smaller than a registered image size [#5].
--image_size=<size> to regenerate a specific image size [#9].
wp menu location assign:
- Increases verbosity and error reporting [#3852].
wp package *:
- Fixes path returned from
get_composer_json_path() under Windows [#11].
wp plugin install:
- Disables renaming behavior when installing from 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/ raw ZIP URLs [#3823].
wp plugin update:
--patch flags for limiting updates based on semantic versioning [#13].
- Displays correct error when 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 fails to update [#3803].
wp (plugin|theme) update:
--exclude=<name> argument to exclude plugins or themes from updating [#16].
wp post term *:
--by=id argument to explicitly handle terms as ids [#3896].
- Pluralizes messages based on term count [#3898].
wp rewrite *:
- Warns user when managing rewrites with
--skip-themes, because rewrites may be missing [#3917].
wp scaffold (child-theme|_s):
- Includes a default
May also refer to The collection of PHP_CodeSniffer rules (sniffs) used to format and validate PHP code developed for WordPress according to the PHP coding standards. [#3902].
wp scaffold plugin-tests
- Variety of improvements to scaffolded
- Caches Composer in scaffolded
- Installs PHPUnit
4.8.* for 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. http://php.net/manual/en/intro-whatis.php.
5.*, and PHPUnit
5.7.* for everything else [#6].
- Tests PHP 7 versions in scaffolded
- Permits environment variables to define a specific PHP binary [#3868].
wp user create:
- Generates 24 character password for new users [#7].
wp user import-csv:
- Disables core Core is the set of software required to run WordPress. The Core Development Team builds WordPress.’s email notifications when updating a user [#3904].
- Symfony 3.x components can be used with WP-CLI. We didn’t even need to break backwards-compatibility [#4067].
- New hooks 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.:
before_add_command:<parent command> lets you check runtime requirements before adding a command
after_add_command:<parent command> lets you depend on a specific parent command before triggering a given functionality [#4033]
- Automatic command dependency resolution. If a sub-command depends on a parent command not yet registered, the addition of this sub-command is deferred until the parent is available [#4094].
- Spelling suggestions. If you mistype a command, WP-CLI will now be smart enough to make suggestions about what you probably wanted to type, and suggest these corrected spellings. This helps with discovery and error resolution. Suggestions are provided for commands, parameters and aliases [#4004, #4008, #4109]
- Help documentation wordwraps to 80 characters by default. It wordwrapped previously, but inconsistently so it was often broken [#4105].
- Variety of testing framework improvements:
- Variables are replaced in subdirectory paths [#4085].
RUN_DIR deletion, safely, to ensure Behat doesn’t hang on cleanup [#4112].
- Terminates all launched background processes in a cross-platform compatible manner [#4074].
- Only applies
@require-wp tags when
WP_VERSION isn’t ‘latest’ or ‘nightly’ to ensure full test suite is run in these contexts [#4055].
Contributors to this release (43 total): 1naveengiri, aaemnnosttv, afragen, balbuf, behzod, carl-alberto, CodeProKid, danielbachhuber, davgothic, diablodale, diggy, dnmvisser, fjarrett, flaskboy, geekoun, gitlost, hason, JayWood, jeremyfrady, ka7, kcarwilemiller, lichtscheu, mbovel, MiteshShah, miya0001, Nikschavan, ntwb, petenelson, rahul3883, raquelmsmith, Rarst, ryanshoover, schlessera, Sidsector9, SosyalAlkolik, ssnepenthe, Steveorevo, tfrommen, tillkruss, timdream, trepmal, wp-make-coffee, zacksheppard