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.
Here it finally is, the long-awaited 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/ release v2.5.0! For this release, we had 73 contributors collaborate to get a whopping 600 pull requests merged.
It was a very tough release to get out, as so many different systems and dependencies all broke or had issues at the same time: 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/index.php, 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, Travis CI, Composer, Requests, … all of these produced major compatibility issues in a seemingly concerted effort! 😅
More importantly, though, I’m pretty certain that all of the WP-CLI contributors were additionally suffering under the “new normal” of COVID-19 – those contributors lucky enough to still earn regular income during the pandemic are still battling health issues (for themselves and their family), isolation and burnout.
As a maintainer, my initial plan was to devise special events and additional incentives to hopefully raise the level of contribution back up again. But I decided against doing so. Even though we all can’t wait to get a new release out and onto servers, I did not want to add to the additional pressure that the volunteer contributors are already feeling right now. The risks of burnout or other negative effects on mental health have never been so prevalent than now where everyone has to dial down their social support systems. In that perspective, I opted to knowingly go with a longer release time. I am fully aware that a lot of companies had to look into extra workarounds or similar to deal with the late release, but I had to assume that this still happens in a paid capacity. Given the global situation, this seemed more justifiable to me than moving the cost towards volunteer health instead.
Thanks to all the support I had during the extended release time, not least to the WP-CLI sponsors who have allowed me to personally invest as much time as needed into the project to make this release happen.
Now, with that being said, let’s go over some of the noteworthy changes in this release. As always, you can also skip directly to the detailed changelog if you prefer.
Security Fixes
This release fixes one direct and one upstream security vulnerability, so it is recommended for everyone to update to this latest release.
Improper Certificate Validation in WP-CLI framework
This security vulnerability is categorized as CWE-295: Improper Certificate Validation with a CSSCSSCSS is an acronym for cascading style sheets. This is what controls the design or look and feel of a site. V3 severity rating of ‘high‘ and was disclosed as CVE-2021-29504 (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 by the repository owner. https://github.com/ security advisory GHSA-rwgm-f83r-v3qj).
An improper error handling in HTTPSHTTPSHTTPS is an acronym for Hyper Text Transfer Protocol Secure. HTTPS is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The 'S' at the end of HTTPS stands for 'Secure'. It means all communications between your browser and the website are encrypted. This is especially helpful for protecting sensitive data like banking information. requests management in WP-CLI version 0.12.0 and later allows remote attackers able to intercept the communication to remotely disable the certificate verification on WP-CLI side, gaining full control over the communication content, including the ability to impersonate update servers and push malicious updates towards WordPress instances controlled by the vulnerable WP-CLI agent, or push malicious updates toward WP-CLI itself.
The vulnerability stems from the fact that the default behavior of WP_CLI\Utils\http_request() when encountering a TLS handshake error is to disable certificate validation and retry the same request.
The default behavior has been changed with version 2.5.0 of WP-CLI and the wp-cli/wp-cli framework (via wp-cli/wp-cli#5523) so that the WP_CLI\Utils\http_request() method accepts an $insecure option that is false by default and consequently that a TLS handshake failure is a hard error by default. This new default is a breaking change and ripples through to all consumers of WP_CLI\Utils\http_request(), including those in separate WP-CLI bundled or third-party packages.
Insecure Deserialization of untrusted data in upstream Requests library
The vulnerability was found in the FilteredIterator class and was first reported to the WordPress project. The security fix applied to WordPress has been ported back into the Requests library and was distributed with release v1.8.0.
Breaking Changes
The security fix for CVE-2021-29504 detailed above led to a breaking change where the retry behavior of commands that use remote requests is disabled. Furthermore, the framework is stricter in making use of the certificates that are provided via environment settings.
This means that automated systems that previously succeeded with reliable downloads of external assets can now start to fail because there is an issue with the certificate verification. This can be due to either the environment being misconfigured for certificate verification or the server to connect to actually being insecure.
To get back to the previous behavior, the affected commands now include a new --insecure flag that re-enables the insecure retrying mechanism again. Beware: This opens up these remote requests to man-in-the-middle attacks!
The following commands were affected and were adapted to recognize this new --insecure flag:
cli update
config create
config shuffle-salts
core download
core update
core verify-checksums
package install
plugin install
plugin update
plugin verify-checksums
theme install
theme update
PHP 8 support
WP-CLI now officially supports PHP 8. All commands are being extensively tested against PHP 8 and the actual development is currently being done on PHP 8 as well.
However, keep in mind that PHP 8 support is not fully there for WordPress CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress., and especially for a large part of plugins and themes. Due to the nature of the changes that PHP 8 brings about, it is very easy to break perfectly compatible WordPress Core or WP-CLI via the actions/filters system. Keep this in mind when trying to diagnose PHP 8 compatibility issues and trying to deduce where the erroneous code is to be found.
Improved MySQL/MariaDB support
As it turns out, WordPress Core has not been compatible with a default MySQL database for a while now. What actually happens is that WordPress switches the database in a sort of “legacy” mode at runtime. This has caused the WP-CLI code that uses WPDB to slowly diverge in results from the code that makes direct database requests via the mysql shell binary.
This has now been rectified (at least for all of the major use cases) by letting WP-CLI employ the same “legacy” database mode via a few hacks around the mysql binary.
Package Manager is now powered by Composer v2
Composer v2 has drastically improved both the processing time as well as the memory usage of its dependency resolution mechanisms. And now the WP-CLI Package Manager that you can use via wp package * commands gets to benefit from these same improvements, at it internally uses the new Composer v2 code.
This should also make the dreaded Out-Of-Memory problems with package installation much rarer, even on shared hosting or tight Docker containers.
New commands for managing automatic updates
The following commands were added to allow you to manage the state of automatic updates for plugins and themes:
plugin auto-updates disable
plugin auto-updates enable
plugin auto-updates status
theme auto-updates disable
theme auto-updates enable
theme auto-updates status
Although you could technically already work on the state of the automatic updates by directly controlling the WordPress Options table, this now provides 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. that abstracts away the technical implementation.
New command for creating MO files
A new command was added to the wp-cli/i18-command package for creating MO files from existing PO files. This can be useful if you use a translation platform that can only output PO files, or tooling that modifies these files.
// Reads from a single .po file.
$ wp i18n make-mo ./wp-content/languages/slug.po
Success: Created 1 file.
// Reads from a directory for multiple .po files.
$ wp i18n make-mo ./wp-content/languages/
Success: Created 5 files.
Smarter I18N handling of JS files
The ongoing effort to improve the internationalization of client-side JavascriptJavaScriptJavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser.
https://www.javascript.com code that is made necessary by the move to the 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.-based editor has led to a number of improvements to the i18n make-pot command.
Apart from understanding more complex Javascript constructs, like webpack bundling and JS eval() statements, the i18n make-pot now also parses the new block.json file as it is defined in the Block Type Registration RFC. This can optionally be skipped via the new --skip-block-json flag.
New environment variable: WP_CLI_ALLOW_ROOT
When you’ve been using WP-CLI within a Docker container, you’ve probably noticed the big “YIKES!” message you get that aborts the execution of the command if it detects that you’re running as root. You’d then have to add the --allow-root flag to every single command you run within that container.
Within a docker container, everything is done as the root user, though, and there’s no really security issue, as the container itself acts as a sandbox. Therefore, WP-CLI now allows you to let it know not to warn about the root user via the new WP_CLI_ALLOW_ROOT environment variable. Just set this variable through in your container’s ENV section, and you’re good to go – no need for multiple --allow-root flags anymore.
New global parameter: --exec
Some scenarios require you to run a small PHP snippet before the actual WP-CLI command, to make sure the command runs under the right context or encounters the right environment. You would typically do this by creating a PHP file with the code snippet that needs to be executed and then using the --require global parameter to load that file upfront before the command gets executed.
This is very cumbersome for short snippets, though, or not even easily possible on read-only filesystems. Therefore, WP-CLI now also accepts a new global parameter --exec that you can use to execute PHP logic directly from the command-line before running the actual command.
The WP-CLI package manager now supports GitLab URLs. This means you can host your custom commands on GitLab and still easily install them right from the VCS:
Chunked queries in search-replace to avoid memory issues
When you need to run a search & replace operation on a very large database, you can easily run into memory issues. WP-CLI tried to fetch all matching query results into memory to loopLoopThe 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 over them.
This type of operation is now processed via a chunked loop that works on 1000 query results at a time via pagination. This drastically reduces the memory requirements and decouples them from the database size.
This is just the first command that receives this treatment, but expect to see more of such scalability fixes in the future.
Hide global parameters help
If you’re a more seasoned WP-CLI, you might have been annoyed from time to time about the wasted screen real estate on the help screens that always append the list of global parameters every single time.
You can now choose to skip the display of these global parameters by setting the following environment variable:
export WP_CLI_SUPPRESS_GLOBAL_PARAMS=true
All the help screens will then only display the help for the current context.
Switch from Travis CI to GitHub Actions
For multiple different reasons, I decided to move away from Travis CI, and I ended up migrating the entire infrastructure (testing, automation, deployment, publication, …) over to GitHub Actions.
You will now find a .github/workflows folder in each of the repositories that contains a set of workflows for that repository. However, we also have a new wp-cli/.github repository. This contains centralized workflows that mostly deal with keeping the workflows and configurations across all of the other repositories in sync.
This means that, when I now need to make a change in the testing workflow, for example, I don’t need to manually create a pull request in each of the packages. I modify the template workflow in the wp-cli/.github repository instead, and this one then syncs all the changes over to the individual repositories.
The added automation details, as well as the much improved parallelization of running the tests in GitHub Actions has drastically accelerated the development experience and ultimately leads to faster and cheaper maintenance of the entire project.
Documentation is automatically kept in sync
If you’ve contributed to one of the commands before, I might have required you to install the wp-cli/scaffold-package-command package and run a cryptic command on your PR to get the README.md file updated based on changes in the code’s docblocks. This was an awful contributor experience and I wanted to get rid of that requirement.
When I initially experimented with a git hook to automatically add a commit on PRs when they are pushed, I realized that that approach leads down to a path of merge conflicts and confusion.
The move from Travis CI to GitHub Actions was a good opportunity to revisit this, as I have now solved this problem via an automated GitHub Actions workflow. Whenever changes are pushed to the default branch of a repository, the GitHub Actions bot will try to regenerate the documentation and if this actually produced any changes, it creates a new pull request with the needed patch.
This PR can then be reviewed and merged just like any other contribution. It happens independently of the code change a contributor submitted, so they don’t need to worry about any of this.
MigrationMigrationMoving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. to Behat v3
WP-CLI has been stuck with Behat v2 for quite a while now, and this also had an impact on the dependencies we needed to rely on. This made the move to PHP 8 compatibility all the more difficult. Therefore wp-cli/wp-cli-tests was updated to migrate from Behat v2 to Behat v3.
Apart from multiple improvements of the syntax and its execution, this also finally makes it easy to reuse the functional testing infrastructure outside of a wp-cli package. Expect to see a guide on how to migrate your own package code to Behat v3 as well as on how to use wp-cli/wp-cli-tests within other contexts soon.
More flexible test setup
The test setup was made way more configurable to adapt to less standardized environments. Where it was previously difficult to run the tests on a non-traditional stack like a Docker network or a GitHub Actions environment, this can now be easily done via a set of new environment variables.
The database credentials can now be provided via the following environment variables:
WP_CLI_TEST_DBHOST
host to use and can include a port, i.e “127.0.0.1:33060”
localhost
WP_CLI_TEST_DBROOTUSER
user that has permission to administer databases and users
root
WP_CLI_TEST_DBROOTPASS
password to use for the above user
(empty password)
WP_CLI_TEST_DBUSER
user that the tests run under
wp_cli_test
WP_CLI_TEST_DBPASS
password to use for the above user
password1
Provided that these environment variables are present and that your database is online, a simple composer prepare-tests will take care of everything.
Detailed change log
To avoid too much noise in the list above, the following types of pull requests have been omitted:
PRs that dealt with Travis CI and its many issues, as Travis CI has now been replaced with GitHub Actions. Note that the PRs that switched from Travis CI to GitHub Actions are still included, as these often include fixes in the tests or even in the actual code to make the tests pass again on GHA.
PRs that only bumped a single dependency to its latest version.
Move fetcher implementations back into framework [#5527]
Add WpOrgApi abstraction to handle WordPress.orgWordPress.orgThe community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ API requests [#5526]
[BREAKING CHANGE] Disable automatic retry by default on certificate validation error [#5523]
Add missing $pipes variables when creating processes [#5522]
Harden error message on failed cache directory creation [#5520]
Update docblocks for methods that accept error objects [#5516]
[BREAKING CHANGE] Use custom certificate if provided [#5514]
[BREAKING CHANGE] Respect provided verify option in Utils\http_request [#5507]
Add $interactive arg for run_mysql_command() [#5420]
Add support for comma-separated flag values [#5419]
Fix SERVER_PORTJSONJSONJSON, 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. encoding failure [#5417]
Create a default global config file if it does not exist [#5411]
Updated minimum required PHP version to 5.6 [#5408]
Include classmap in order to fix Composer 2 deprecation notices [#5407]
Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#5406]
Throw exception when misusing error_to_string() [#5405]
Prevent array access notice when $update_info is null [#214]
Add missing --network parameter for plugin is-active [#222]
Don’t show a warning when theme delete --all skips the active theme [#218]
Deny --dry-run usage when requiring a specific version [#236]
Bump PHPCS compatibility tests to new PHP 5.6+ minimum [#235]
Allow for filtering multiple field values for the list command [#234]
Validate the --statusfilterFilterFilters 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. passed to wp plugin list and wp theme list [#229]
Add commands to manage auto-updates for plugins and themes [#259]
Provide clear error message when 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. fails PHP requirement [#253]
The long-awaited release v2.5.0 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 19th, 2021.
I won’t go into too much detail about why the release was so long in the making, but let me nevertheless add a link to an article in which Juliette Reinders Folmer eloquently talks about some of the reasons: https://24daysindecember.net/2020/12/21/a-perfect-storm/. Add to this the fact that the pandemic situation has drastically reduced the pool of contributors, as well as Travis CI deciding to effectively drop OSS support (forcing me to switch both testing and deployments to 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 by the repository owner. https://github.com/ Actions), and we’re in a situation that I’m glad will finally be resolved again soon.
Thanks to all the sponsors of the project that make it possible to work on WP-CLI with the persistence and staying power it requires.
Also big thanks to the contributors to the project that kept helping me figure out bugs and come up with solutions! I truly appreciate all your assistance.
And in case you’re one of the many people who created an issue in recent times that hasn’t been resolved yet, know that getting v2.5.0 out was an absolute priority, but I’ll slowly work off the backlog again once the pressing compatibility issues have been taken care of.
Maintaining an open sourceOpen SourceOpen Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. project requires a substantial, ongoing commitment of time and energy. 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 a dependable tool loved by thousands because it’s actively maintained, which is made possible by the generosity of its sponsors.
For 2019, the following sponsors have stepped forward and directly support the WP-CLI project and ensure it can continue to save both time and headaches to its users:
Please note that, although we’re approaching the middle of the year, these sponsors had already been supporting the WP-CLI project for the majority of 2019 to pick up from the last sponsoring round that ended with 2018. Some legal details that had to be finalized behind the scenes kept delaying this announcement, unfortunately.
If you happen to meet any of their representatives during an event or see that they have a booth, please take a few seconds to say hi and let them know you value their support for the project! 🤗
wp scaffold * presents a series of commands to help you quickly get up and running with your development project:
wp scaffold plugin generates a basic 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., complete with unit tests.
wp scaffold post-type produces a full 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., with all of the different arguments you can change.
etc.
We’d like to make it even better! To help guide your feedback:
What basic code do you find yourself copy and pasting between WordPress projects?
Of the existing commands, are there ways you’d like to improve upon them?
What boilerplate/scaffolded code do you find most helpful in the other open sourceOpen SourceOpen Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. projects you use?
Consider this an open thread: we welcome all the ideas you have.
Just in time for the release of WordPress CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. 5.3.0 we have 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/ as well. A team of 37 contributors has collaborated to get 159 pull requests merged.
Let’s go over some of the noteworthy changes in this release. Most of the work went into compatibility fixes, so there’s not many new toys to play around with, unfortunately. As always, you can also skip directly to the detailed changelog if you prefer.
WordPress 5.3 support
It should be obvious that WP-CLI supports the latest upcoming WordPress Core release, of course. However, there were quite a few changes that went into 5.3 that made it not only difficult to keep WP-CLI working across 5.3 and earlier versions at the same time, but also made it necessary to release WP-CLI in parallel to have a working option available.
The push to support more of the newer 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/index.php features that became available due to the bump to the minimum PHP version of Core introduced changes to function signatures and class interfaces, which required a few adventurous fixes in some cases…
PHP 7.4 support
PHP 7.4 is not yet available in a stable release, but we’re slowly coming closer to the planned release date.
There have been quite a few fixes that went into WP-CLI to make sure it works correctly with PHP 7.4 once it’s available. It’s an ongoing process, still, as we’re working towards the first stable version. Tests are running for PHP 7.4 in the background as well for each package. These are still allowed to fail right now, but after this release, they will be switch to break on error.
Download a specific URLURLA specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org as Core
The core download command now accepts a URL to download a specific ZIP archive with a version of Core to use. This also allows you to use your own custom version easily. Just add the URL and you’re good to go: wp core download https://somesite/build.zip
Large image support
WP-CLI will properly deal with large images in the way that WP Core 5.3 was improved. It knows about the original source images as well so you can safely rebuild your thumbnails without losing quality.
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. Advanced Administration Handbook -> Create A Network.-convert, don’t assume site_id is 1 [#122]
Add second must-use 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. that is added with wp-cli-tests 2.1.6+ [#200]
Equalize theme folder naming conventions across Win/Mac/Linux [#196]
Required PHP version 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. [#238]
Adapt tests to make the widgetWidgetA WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. expectations more flexible [#34]
Version 2.4.0 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/ will be released on Tuesday, November 12th, 2019, presumably around 15:00 UTC.
This places it in-between the release dry-run and the final release for WordPress CoreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. 5.3, which is currently slated for November 12th at around 19:00 UTC.
Note: In case the scheduled release for WP 5.3 is adapted, we might also need to move the one for WP-CLI accordingly. In this case, I’ll send updates as needed.
There quite a few breaking “non-breaking changes” in the upcoming 5.3 release, and some of them have shown a weakness in the current packaging strategy regarding the framework package itself, which are the reason for this release to come on such short notice. Due to its very tight integration with Core, WP-CLI is very susceptible to these breaking changes, and the current packaging strategy does not always deal with this in the best way possible.
After 2.4.0, I will re-evaluate the current versioning policy regarding the framework package and how best to take interface changes in Core into account, that need us to modify signatures between Core versions to support.
We’re all looking forward to an awesome WordPress 5.3 release, so let’s make sure the ecosystem is ready for it! 👍
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/ provides a way for system administrators to verify the integrity of the WordPress coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. files. Through wp checksum core, you can easily verify that a given installation has not been tampered with. It not only checks whether the correct files are in place, but also that their content has not been changed. This is possible because WordPress provides an official 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. to check the expected core file checksums at https://api.wordpress.org/core/checksums/.
Having this kind of functionality for plugins and themes as well would be a huge security benefit. It would allow you to check the file integrity of an entire site, possibly in an automated fashion. However, there is no centralized way of retrieving the file checksums for plugins or themes yet, and the alternative of downloading the plugins and themes from the official servers first just to check against them is wasteful in terms of resources and bandwidth.
The aim of this project is to extend the checksum verification and its underlying infrastructure so that it can reliably and efficiently check the integrity of plugins and themes as well.
Project Stages
The project will be structured into four stages. Each stage will be followed by a detailed report, containing a summary of the stage’s efforts as well as a clear enumeration of decisions and results.
A. Initiation (← we are here)
During this initial project stage, we raise awareness of the project and discuss it with key stakeholders, sponsors, and volunteers.
We’ll evaluate the alternative approaches with all involved parties to distill the most viable path to a maintainable solution.
Finally, we’ll define a clear scope for the project, and the metrics that define its success. We plan for a working betaBetaA pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. version by end of November, so we will want to keep the scope tight for this first iteration.
B. Planning
After we’ve decided on a specific route to follow, we can start planning the details of the solution we want to implement.
This stage will result in a project roadmap with milestones and their respective deliverables. It will also produce a list of requirements, like the provisional budget for infrastructure, the decisions needed or the estimated workload for each milestone.
C. Implementation
After we’ve planned all the technical details and broke down the work involved, we’ll start with building the infrastructure and implementing the client and server software.
The specifics of how this stage will be handled should have been laid out during the planning stage already, so this stage is all about execution and monitoring progress.
D. Integration
During the final project stage, we will move all code and infrastructure to reside under the official wordpress.org domain and complete the integration with the WordPress Core and the WP-CLI tool.
Get Involved!
This project will have a huge impact on the perceived and effective security of WordPress installations. It can greatly reduce the amount of malware-infested sites plaguing the internet, and through the substantial market share of WordPress, improve the general browsing experience for all net citizens.
If you want to get involved, you’d ideally meet the following criteria:
You have a vested interest in security and/or system administration in a WordPress context.
You can spare a consistent average of ~5+ hours/week (hopefully on your employer’s time).
You have experience with one or more of the types of components this project requires.
If this is you, please get in touch with us, either by commenting on this post or by joining the discussion in the following 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 by the repository owner. https://github.com/ issue: https://github.com/wp-cli/ideas/issues/6.
We will have a formal kickoff during the next WP-CLI office hours in the #cli channel on October 3rd, 2017 at 16:00 UTC. Feel free to join the discussion and help us get this ball rolling.
This release v2.3.0 is, as already announced, rather unspectacular. The previous release was very taxing for several reasons, so we lowered the pace for a while to recover.
This version is mainly meant to finally get a few bug fixes out there that were not critical enough to warrant an immediate hotfix release but are nice to have eradicated at one point, nevertheless.
Overall, a team of 36 contributors has collaborated to get 129 pull requests merged. I’ll briefly go over some of the more noteworthy stuff, but as always, you can also skip directly to the detailed changelog if you prefer.
New command to fix image orientation
Some cameras and smartphones will automatically tag pictures to denote “which way is up”. This means that you will have these devices show you the pictures you took during your handstand in the correct orientation no matter what, even though the actual picture file is upside down.
The media command now has a new subcommand media fix-orientation that reads these special tags and properly applies them to your images. This way, the images will also be shown with the correct orientation on devices that do not support this tag.
You can now skip tables using wildcards
The --skip-tables flag for the search-replace command has learnt a new trick – it now lets you skip a group of tables in one go through wildcards.
You can use wildcards like 'wp_*options' or 'wp_post*' to make your life easier.
Add config settings to the end of the file
Up until now you always had to provide an anchor to attach changes to your wp-config.php to when using the config add command.
You can use this through the special anchor flag --anchor=EOF.
Optimized vagrant support
When you’re connecting to your vagrant VMs through 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/’s special-case vagrant SSHSSHSecure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. connection scheme, you’ll notice that the operations are way faster now, as we’re caching the configuration across calls now.
Fix issue with failing test cases due to version mismatch [#181]
Fix activation issue of installed 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./theme [#180]
Skip broken test 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/index.php 7.3 [#178]
Skip test for duplicate resizes for coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. trunk because of bug in current version [#112]
Just a quick heads-up regarding the next release for 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.3.0 is scheduled to be released on August 7th, 2019, which is a Wednesday according to the calendar I’m looking at.
It will be a pretty unspectacular release, as I will mostly focus on tying up a few loose ends in that particular release and wanted to get a few bug fixes out into the wild.
Expect v2.4.0 (November-ish) to be more feature-rich again… 😊
Phew, it’s finally here! Although there are not that many new features, we had a lot of work being done behind the scenes, to make future releases smoother. A lot of the processes have been improved, and we’ve managed to squash quite a few bugs while doing so.
A team of 57 contributors has collaborated on this release to get 347 pull requests merged. I’ll briefly go over some of the more noteworthy stuff, but as always, you can also skip directly to the detailed changelog or examine the breaking changes section if you’re impatient.
New Committer
Thrijith Thankachan (@thrijith) is from Surat, India. He works for rtCamp as a WordPress Engineer and he is the developer behind the two new commands alias and maintenance-mode.
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/ code standard
Through the initiative of @jrf, and with the outstanding help from @thrijith, @wojsmol & @williampatton, we now have a WP-CLI code standard that we can enforce.
For any package, you can just run composer phpcs to verify that your code meets the CS requirements. Basic formatting issues can be automatically corrected through vendor/bin/phpcbf (a Composer script will soon follow for that).
The goal of this big effort is to reduce the back & forth on pull requests and thus reduce the maintenance burden. For most pull requests, whitespace issues and code style issues represent the bulk of the time and effort required by the maintainers. With enforced and automated coding standards, everyone saves time and the discussion more often revolves around the actual logic that solves the problem, instead of alignment issues and spacing rules.
This is all pretty fresh, so stay tuned while more extensive documentation and updates to the tooling will follow.
New command to manage aliases
The old wp cli alias has finally grown up and has become a complete CRUD interface for managing your WP-CLI aliases. You can alias list to retrieve your current configuration, alias get to retrieve an individual alias, and alias add|update|delete to make changes.
While experimenting with these commands, please remember that you need to work around the already active global parameters. This is why we had to add a prefix (--set-<flag>) to all the flags that let you configure the aliases. So, updating the SSHSSHSecure SHell - a protocol for securely connecting to a remote system in addition to or in place of a password. connection string for an alias is done through alias update <key> --set-ssh=<ssh>. If you would use --ssh instead to configure it, you’d actually immediately connect to that SSH target instead.
# List alias information.
$ wp cli alias list
---
@all: Run command against every registered alias.
@local:
user: wpcli
path: /Users/wpcli/sites/testsite
# Get alias information.
$ wp cli alias get @dev
ssh: dev@somedeve.env:12345/home/dev/
# Add alias.
$ wp cli alias add prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli
Success: Added '@prod' alias.
# Update alias.
$ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/
Success: Updated 'prod' alias.
# Delete alias.
$ wp cli alias delete @prod
Success: Deleted '@prod' alias.
New command to control maintenance mode
WP-CLI now lets you enable or disable the WordPress maintenance mode with the two simple commands maintenance activate and maintenance deactivate. You can query the current status with maintenance status (for humans) or maintenance is-active (for easy shell scripting).
The eval-file had a small, innocuous tweak. When it encounters a “shebang“, a first line in a file that starts with #!, it will strip that line and try to run the rest of the file through 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/index.php’s eval().
For folks not used to working in Unix shells, that might sound rather useless, but this shebang is actually a construct that your shell understands, and that lets you tell the shell how to execute the file.
As an example, here’s a file that contains such a shebang and actually points to WP-CLI’s eval-file command:
With that file structure, you can now rename that script file to something like blogname and make it executable. It now behaves like any other shell tool, and will use WP-CLI as a shell framework for retrieving the current blog’s name.
Have fun experimenting with this new functionality, and don’t forget to share the more interesting use cases you can think of with the rest of the community!
Breaking changes
Name changes
While going through the code to make it fit for actually enforcing our new WP-CLI coding standard, we decided to rename some of the more internal functions, methods and properties to make the experience more consistent.
Although we took great care to figure out what we could safely rename and what needed to stay intact, there might be some edge cases where people are nevertheless directly coupling to some bit of internal code.
This is mostly relevant if you extend one of the WP-CLI classes to override default behavior.
Removal of framework files from test package
The test package included a few framework files that were used to make the FeatureContext logic work. However, as wp-cli/wp-cli was a hard requirement for wp-cli/wp-cli-tests anyway, we removed these framework files and had the test package pull them in through the dependency.
In case you were directly coupling your code to these files as they were found in wp-cli/wp-cli-tests (which is unlikely), then you’ll have to change your code to refer to these same files in the wp-cli/wp-cli package. See the pull request for more details.
Consistent display of serialized 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
Serialized data has been displayed very inconsistently, with some commands showing them as is (option list), and some commands unserializing them automatically for display (post meta list).
We’ve changed this so that they all show the values as they are stored, to avoid surprises.
This is a breaking change, however, and if you happened to rely on the automatic unserialization, you’ll be glad to hear that the affected commands now provide an optional --unserialize flag to get back to the old behavior. You can even put this flag into your global config to permanently stick with the old behavior.
Affected commands are: comment meta get|list, network meta get|list, post meta get|list, user meta get|list.
Complete change log
All repositories
Implement CS checking based on the WP_CLI_CS ruleset
Add a 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 by the repository owner. https://github.com/ setting for label to dependencies.yml [#74]
Try removing “ignore-platform-reqs” from Dependencies.yml [#72]
Add dependencies.yml file to define auto-updates [#70]
Introduce ability to override wp-config.php path with env var WP_CONFIG_PATH [#5119]
Support persistent 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 connections [#5115]
Fixed documented return type for make_progress_bar() [#5112]
Fix FileCache::export() not ensuring parent directories exist for $target [#5103]
Switch ext-readline to ‘suggest’ instead of a hard requirement [#5102]
Update docblock for add_command() to properly reflect the return value [#5099]
Change to “Happy publishing.” per change in coreCoreCore is the set of software required to run WordPress. The Core Development Team builds WordPress. [#5059]
Adapt outdated links in ISSUE_TEMPLATEfile [#5056]
Update link of backwpuppluginPluginA 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. [#315]
Update release checklist documentation to point to the issue templates [#306]
Set Language 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. directly to prevent exceptions [#150]
Add script file name to 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. translation files [#134]
Improve language handling when creating JSON files [#133]
Add DeployHQ .deployignore to ignored files in .distignore [#201]
Ignore various JavaScriptJavaScriptJavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser.
https://www.javascript.com config files in plugin .distignore [#200]
You must be logged in to post a comment.