After a bit of unexpected delay, a new release of WP-CLIWP-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/ is available as of today: WP-CLI v2.8.0. For this release, we had 66 contributors collaborate to get 277 pull requests merged.
As always, big thanks to the WP-CLI sponsors that make the continued maintenance possible.
This is a small release with the main purpose of polishing PHPPHP 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/index.php 8.1/8.2 support. Nevertheless, apart from the flurry of bugs that were fixed, we also have a few new features that I’ll want to highlight. As always, you can also skip directly to the detailed changelog if you prefer.
Bundled with Requests v2
The last component that needed updating for full PHP 8.1 was the bundled Requests library. With the move to v2 of Requests, adding support for PHP 8.1 seems to be complete, an.d PHP 8.2 is starting to look good as well.
Note that the way the dependencies interact between WP-CLI and WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. (which has no proper dependency management that could help out here) makes for a somewhat hacky solution at this time. We’re looking into something more robust for a future release, but until then make sure you submit issues when you encounter edge cases that the current approach does not yet take into account.
Improve support for caching solutions
There is a new command wp cache supports <feature> to detect cache features like add_multiple. Furthermore, we have a new command wp cache flush-group that allows you to flush at the group level. Also, WP-CLI now produces warning when you use wp transient list when an object cache is active. Finally, WP-CLI now recognizes Object Cache Pro as a caching solution.
$ wp cache supports add_multiple
$ echo $?
0
$ wp cache flush-group my_group
Success: Cache group 'my_group' was flushed.
Fetch URLs of entities
For the posts, terms and comments, you can now retrieve their canonical URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org via the --field=url argument. As an example, you can retrieve the URL of the post with ID 123 via the following command:
$ wp post get 123 --field=url
https://example.com/hello-world-the-sequel/
Skip config changes on multisiteMultisite 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. Advanced Administration Handbook -> Create A Network. conversion
In case you’re working on a read-only filesystem or are forced to push file changes through VCS, you can now skip the automatic config file changes that wp core multisite-convert does. All you need to do is add the --skip-config flag, and the command will not only obey that choice, but also conveniently print the changes you need to make to the config file manually. This behavior was already included with wp core multisite-install, but now the conversion command knows this trick too.
$ wp core multisite-convert --skip-config
Set up multisite database tables.
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', {$subdomain_export} );
\$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Success: Network installed. Don't forget to set up rewrite rules (and a .htaccess file, if using Apache).
Verify checksums for the root folder
The wp core verify-checksums now has a new --include-root flag that makes it scan and verify the root folder as well (the one that ABSPATH points to).
$ wp core verify-checksums --include-root
Warning: File should not exist: dump.sql
Warning: File should not exist: backdoor.php
Configure autoloading behavior for options
Two new commands wp option get-autoload and wp option set-autoload have been added to change the autoloading behavior for an existing option. This was not easily possible with wp option update as that only allowed the autoloading to change when the value changed as well.
$ wp option add foo bar
Success: Added 'foo' option.
$ wp option get-autoload foo
yes
$ wp option set-autoload foo no
Success: Updated autoload value for 'foo' option.
$ wp option set-autoload foo no
Success: Autoload value passed for 'foo' option is unchanged.
New flags for password reset
The command wp user reset-password now has two new flags. The first one is --show-password, and it will immediately show the new password as it is being reset. The second one is --porcelain, and it will show only the password and nothing else as output of the command. The latter one is useful for scripting purposes.
$ wp user reset-password admin --skip-email --show-password
Reset password for admin.
Password: bt6Hy!9*P0A1
Success: Password reset for 1 user.
$ wp user reset-password admin --skip-email --porcelain
yV6BP*!d70wg
Include ad-hoc code instead of evaluating it
If you’re using the wp eval-file command, it will read the file you point it to and run it through the PHP eval logic. This has a few drawbacks, though. One one hand, directives like declare(strict_types=1) will throw errors. On the other, it is not possible to use XDebug to debug such an evaluated piece of code.
To counter this, the wp eval-file command now has a new --use-include flag that makes it include the file you’re pointing to, instead of running it through eval. Note that this does not work with STDIN as input, so the - file argument can not be used at the same time as the --use-include flag.
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 an
allow-pluginsrule to Composer. - PRs that add a Composer script.
wp-cli/wp-cli-bundle
- Adapt tests for Requests [#540]
- Skip
update-framework.ymlworkflow on forks [#537] - Add a workflow to keep
wp-cli/wp-cliup to date [#507] - Move the new README into its proper location [#478]
- Add a new bundle-specific README [#476]
- Use Composer 2.2 LTS for PHP < 7.2 [#472]
- Detect if running Phar via CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. SAPI [#465]
- Use
ramsey/composer-installinDeploymentworkflow [#463]
wp-cli/wp-cli
- Harden loading of upgrader [#5791]
- Ignore Requests deprecations in error handling for now [#5790]
- Fallback to hardcoded folder when
WPINCnot defined [#5786] - Add
RequestsLibrary::get_bundled_certificate_path()method [#5785] - Conditionally adapt to Core Requests library [#5783]
- Add bootstrap step to extract default CA certificate [#5781]
- Revert “Extract cacert from Phar for cURL” [#5780]
- Use
wp_cache_flush_runtimeif supported. [#5778] - Extract
cacertfrom Phar for cURL [#5777] - Fix some PHP 8.2 depreciation notices in behat tests [#5776]
- Use
rtrimon phar-safe path to avoid double slash [#5775] - Upgrade WP-CLI to Requests v2 [#5774]
- Added
wp cli alias is-groupsubcommand. [#5766] - Update test to reflect warning when
--url=<url>is provided [#5763] - Use
-Rinstead of-rfor fallback pager command [#5759] - Fix autocompletion notice with PHP 8.2 [#5749]
- Fix PHP Deprecation for 8.1 [#5743]
- Use
WP_CLI_FORCE_USER_LOGIN=1to force--user=<login>[#5738] - Fix
--skip-themesfor themes with blockBlock Block 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. patterns [#5737] - Make sure
subcommand@aliasdefinition respects@whendefinition [#5730] - Improve docs for
SHELL_PIPE[#5729] - Use
awkinstead ofsedto create BOM in feature test [#5728] - Add
runtime_argsto options array forruncommand[#5722] - Fix deprecation notice triggered in
WpOrgApiclass in PHP 8.1 [#5717] - Fix return type of
make_progress_bar [#5715] - Add name context to
before_invokeandafter_invoke[#5712] - Check that
proc_open()is available inProcess::run()[#5711] - Improve support for cases with empty
--pathprovided to commands [#5709] - Fix
composer testafter branch rename [#5708] - PHP 8.2: explicitly declare
CompositeCommand::$longdescto fix deprecation warning [#5707] - Detect Object Cache Pro [#5698]
- Ensure
WP_CLI_ROOTis defined before accessing it [#5697] - Fix
proc_open_compatutil on Windows [#5689] - Move
WP_CLI_CONFIG_SPEC_FILTER_CALLBACKtest toflags.feature[#5687]
wp-cli/handbook
- Replacement added for the
&&[#444] - Add HostRiver to list of hosting companies [#442]
- Add DataPerk to list of hosting companies [#441]
- Include a couple more helpful Behat calls [#440]
- Add maintainer expectations to the Governance page [#439]
- Fill out page for
wp profile[#437] - Link to ‘Shell Friends’ from the Philosophy doc [#435]
- Add example for how to discard headerHeader 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. row from CSV [#434]
- Uppercase for ‘Committers Credo’ title [#433]
- Update
hosting-companies.md[#432] - Move the Doctor docs under ‘Guides’ [#431]
- Add secondary
wp doctorcontent and a landing page [#430] - Add two primary
wp doctordocs to the handbook [#429] - Fix phar download url [#428]
- Adding new pluginPlugin 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. to handbook [#427]
- Corrected local jumplinks [#426]
- Running commands remotely: On restrictive webhost [#425]
- Remove BackupBuddy [#423]
- Remove non existing tool [#421]
wp-cli/wp-cli.github.com
- Update
index.md[#428] - Add “WP-CLI” heading [#427]
- जर्मन रीडमी अपडेट करें [#426]
ja/index.mdअपडेट करें [#424]- वर्तमान स्थिर रिलीज़ 2.6.0 है [#423]
wp-cli/cache-command
- जब बाहरी ऑब्जेक्ट कैश के साथ
wp transient listका उपयोग किया जाए, तो चेतावनी दें [#82] - मल्टीसाइट पर
--url=<url>के साथ कैश फ्लश करते समय चेतावनी दें [#86] - कैश समूह को फ्लश करने के लिए
wp cache flush-groupजोड़ें [#85] wp cache supports <feature>कमांड जोड़ें [#84]
wp-cli/checksum-command
WP_VERSION=trunkपर टाइमआउट के कारण विफल हो रहे चेकसम परीक्षणों को ठीक करें [#99]- PHP 8.1 चेतावनी को ठीक करने के लिए
nullके बजायfalseपास करें [#103] - रूट डायरेक्टरी को भी सत्यापित करने के लिए
--include-rootपैरामीटर जोड़ें [#102] - किसी विशिष्ट प्लगइन संस्करण को सत्यापित करें [#108]
- यदि
WpOrgApi::get_plugin_checksums()विफल हो, तो चेतावनी लॉग करें [#105]
wp-cli/core-command
- माइनर अपडेट परीक्षण के रूप में WordPress 4.1 पर स्विच करके विफल हो रहे परीक्षणों को ठीक करें [#223]
WP_AUTO_UPDATE_CORE=falseसेट करके विफल हो रहे परीक्षण को ठीक करें [#222]- PHP 8.1 में डिप्रिकेशन सूचनाएँ ठीक करें [#220]
- WordPress 6.2 से उत्पन्न परीक्षण विफलताओं का समाधान करें [#229]
--skip-contentका उपयोग करते समयwp-content/pluginsऔरwp-content/themesडायरेक्टरी को बनाए रखें [#230]- WordPress मौजूद है या नहीं, यह निर्धारित करने के लिए अधिक फ़ाइलों की जाँच करें [#233]
wp core multisite-convertमें--skip-configफ़्लैग जोड़ें [#231]- Requests v2 समर्थन के लिए परीक्षण ठीक करें [#235]
wp-cli/cron-command
--due-nowके लिएwp_get_ready_cron_jobs()का उपयोग करें ताकि कोर फ़िल्टरफ़िल्टर फ़िल्टर हुक के दो प्रकारों में से एक हैं https://codex.wordpress.org/Plugin_API/Hooks। वे फ़ंक्शनों को अन्य फ़ंक्शनों के डेटा को संशोधित करने का तरीका प्रदान करते हैं। वे एक्शनों के समकक्ष हैं। एक्शनों के विपरीत, फ़िल्टर अलग-थलग तरीके से काम करने के लिए होते हैं और इनके कभी भी साइड इफ़ेक्ट नहीं होने चाहिए, जैसे ग्लोबल वेरिएबल और आउटपुट को प्रभावित करना। लागू हो [#89]- अमान्य क्रॉन इवेंट मिलने पर फ़ैटल होने के बजाय चेतावनी दें [#93]
wp cron event runमें--exclude=<hooks>आर्ग्युमेंट जोड़ें [#97]
wp-cli/db-command
get_post_table_charactersetकी पुनर्प्राप्ति ठीक करें [#231]
wp-cli/entity-command
- एकाधिक पोस्ट IDs हटाने का उदाहरण जोड़ें [#387]
- पोस्ट, टिप्पणियों और टर्म्स के लिए
--field=urlसमर्थन जोड़ें [#383] wp option get-autoloadऔरwp option set-autoloadजोड़ें [#382]- खाली नेमस्पेस ऑटोलोडर को क्लासमैप से बदलें [#390]
wp user spamका उपयोग करते समय मुख्य साइट को स्पैम के रूप में चिह्नित न करें [#393]wp site listदस्तावेज़ मेंurlफ़ील्ड स्पष्ट करें [#401]- कुछ स्थानों पर नए पासवर्ड को 24 वर्णों का करें [#399]
wp post termके लिए उदाहरण जोड़ें और दस्तावेज़ अपडेट करें [#398]user reset-passwordमें--show-passwordफ़्लैग जोड़ें [#394]wp user updateके लिए अमान्य भूमिका दिए जाने पर चेतावनी दें [#406]
wp-cli/eval-command
--use-includeफ़्लैग जोड़ें [#64]
wp-cli/export-command
post__inदस्तावेज़ में स्पेस से अलग किए जाने का उल्लेख करें [#104]- WordPress Importer का उपयोग करने वाले परीक्षणों को WordPress 5.2 की आवश्यकता के लिए अपडेट करें [#102]
- मल्टी-फ़ाइल एक्सपोर्ट में
before_postsडेटा के लिए--include_once=<section>पैरामीटर जोड़ें [#100] - एक्सपोर्ट में
oembed_cacheपोस्ट से अनावश्यक लेखक IDs निकालें [#99]
wp-cli/extension-command
- विफल हो रहे परीक्षणों को ठीक करें [#347]
- WP 5.2 की आवश्यकता रखकर विफल हो रहे PHP 5.6 परीक्षणों को ठीक करें [#342]
- प्लगइन अनइंस्टॉल होने पर उसकी अनुवाद फ़ाइलें हटाएँ [#339]
- जब 5 में से 5 प्लगइन अपडेट हो जाएँ, तो त्रुटि रिपोर्ट न करें [#338]
- अतिरिक्त स्पेस हटाएँ [#335]
wp plugin|theme auto-updates statusमें फ़ॉर्मैट विकल्प जोड़ें [#351]- प्लगइन और थीम सूचियों में वैकल्पिक
'auto_updates'फ़ील्ड शामिल करें [#350] - निर्दिष्ट संस्करण न मिलने पर थीम हटाने से बचें [#349]
--minorया--patchनिर्दिष्ट होने पर स्थिर संस्करण का उपयोग सुनिश्चित करें [#355]- अमान्य प्लगइन अपडेट ऑफ़र में फ़ैटल त्रुटि ठीक करें [#354]
- PHP 8.2 की ‘डायनेमिक प्रॉपर्टी का निर्माण’ चेतावनी ठीक करें [#360]
wp-cli/i18n-command
- PHP 8.2:
${var}स्ट्रिंग इंटरपोलेशन की डिप्रिकेशन चेतावनी ठीक करें [#346] - अधिक मानक ‘excludes’ मान जोड़ें [#351]
- बंद न किए गए उद्धरण को ठीक करें [#350]
- CI: सुनिश्चित करें कि PHPUnit वर्कफ़्लो वास्तव में चलता है [#360]
- PHP 8.2 के लिए डिप्रिकेटेड आंशिक रूप से समर्थित कॉलएबल्स ठीक करें [#359]
update-po: गंतव्य की जाँच करें [#356]
wp-cli/import-command
@require-wp-5.2के साथ विफल हो रहे परीक्षणों को ठीक करें [#79]IMPORT_DEBUGकॉन्स्टेंट के उपयोग का दस्तावेज़ीकरण करें [#82]
wp-cli/language-command
- विफल हो रहे परीक्षणों को ठीक करने के लिए
twentytwentyoneपर स्विच करें [#118]
wp-cli/media-command
importकमांड केlongdescमें टाइपो ठीक करें [#172]- Travis अब उपयोग में नहीं है, इसलिए कॉन्फ़िगरेशन फ़ाइलें हटाना ठीक है [#171]
--image_sizeके साथwp media regenerateचलाते समय अन्य आकारों के लिए मेटामेटा मेटा एक ऐसा शब्द है जो किसी समूह की आंतरिक कार्यप्रणाली को संदर्भित करता है। हमारे लिए, यह वह टीम है जो WordCamp Central और Make WordPress जैसी आंतरिक WordPress साइटों पर काम करती है। हटाने से बचें [#170]- मीडिया आयात करते समय
--post_name=का समर्थन करें [#166] fix-orientationसबकमांड के लिए सही आर्ग्युमेंट दें [#165]- वर्गाकार इमेज थंबनेल पुनर्जनन से संबंधित परीक्षण हटाएँ [#177]
wp-cli/package-command
- विफल हो रहे
package-commandपरीक्षण ठीक करें [#164] yoast/wp-cli-fakerवाले परीक्षण को@brokenके रूप में चिह्नित करें [#170]- बंडल किए गए प्रमाणपत्र एक्सेस को अनुकूलित करें [#174]
wp-cli/php-cli-tools
- PHP 8.1 पर डिप्रिकेटेड चेतावनी संदेश हटाने के लिए एनोटेशन जोड़ें[#152]
- PHPUnit परीक्षण रन पुनर्स्थापित करें [#155]
- PHP की ‘डायनेमिक प्रॉपर्टी का निर्माण’ डिप्रिकेशन ठीक करें [#158]
wp-cli/rewrite-command
wp rewrite list --match=<url>के लिए पूर्ण URLs का समर्थन करें [#59]
wp-cli/role-command
wp role resetके दौरान क्या होता है, इसकी व्याख्या जोड़ें [#58]- पहले से हटाई गई भूमिका को रीसेट करते समय फ़ैटल त्रुटि ठीक करें [#57]
--grant=falseआर्ग्युमेंट के समर्थन को ठीक करें [#59]
wp-cli/scaffold-command
db.phpके लिए GitHubGitHub GitHub एक वेबसाइट है जो git रिपॉज़िटरी का ऑनलाइन कार्यान्वयन प्रदान करती है, जिन्हें अन्य डेवलपर आसानी से साझा, कॉपी और संशोधित कर सकते हैं। सार्वजनिक रिपॉज़िटरी होस्ट करना निःशुल्क है, जबकि निजी रिपॉज़िटरी के लिए सशुल्क सदस्यता आवश्यक है। GitHub ने ‘पुल रिक्वेस्ट’ की अवधारणा प्रस्तुत की, जिसमें योगदानकर्ताओं द्वारा ब्रांच में किए गए कोड परिवर्तनों की समीक्षा और चर्चा रिपॉज़िटरी मालिक द्वारा मर्ज किए जाने से पहले की जा सकती है। https://github.com/ URL अपडेट करें [#317]- GitLab टेम्पलेट में
phpcompatibility-wpकोडिंग मानक जोड़ें [#315] - GitLab CI में प्लेटफ़ॉर्म-स्वतंत्र
mysql-clientपैकेज का उपयोग करें [#314] - स्कैफ़ोल्ड द्वारा बनाए गए जनरेटेड
.gitignoreमेंvendorजोड़ें [#279]
wp-cli/search-replace-command
sqliteसमर्थन के लिएis_text_colकी खोज को केस-इंसेंसिटिव बनाएँ [#177]- PHP 8.2 के लिए रेगेक्स अमान्य डिलीमीटर परीक्षण ठीक करें [#181]
- PHP प्रतिस्थापन में लंबे समय से चल रही क्वेरीज़ और OOM योगदानकर्ता को संबोधित करें [#180]
wp-cli/wp-config-transformer
README.mdमें स्थिति बैज अपडेट करें [#40]assertNotEqualsके बजायassertNotSameका उपयोग करके परीक्षण विफलता से बचें [#41]get_value()के लिए डॉकब्लॉक में गलत रिटर्न प्रकार ठीक करें [#43]
योगदानकर्ता
@aerogus, @agrullon95, @akirk, @benjaminprojas, @BhargavBhandari90, @brandonpayton, @bukowa, @cliffordp, @connerbw, @danielbachhuber, @dd32, @dlind1, @drzraf, @dsXLII, @elenachavdarova, @endriu84, @gagan0123, @gedex, @gitlost, @greatislander, @hbhalodia, @herregroen, @janw-me, @jenkoian, @joeldcanfield, @josedumas, @jrfnl, @kozer, @l3ku, @lipemat, @localheinz, @matzeeable, @michaelzangl, @mpkelly, @mrsdizzie, @mweimerskirch, @oandregal, @ocean90, @ouikhuan, @paulschreiber, @pbiron, @pdaalder, @pmbaldha, @ponsfrilus, @pwtyler, @r-a-y, @Rahmon, @rodrigoprimo, @rutviksavsani, @Saggre, @schlessera, @semseysandor, @SH4LIN, @shendy-a8c, @siliconforks, @srtfisher, @SteenSchutt, @strarsis, @stuartlangridge, @swissspidy, @tecking, @Tug, @tyrann0us, @wojsmol, @wojtekn, @yousan