ملاحظات إصدار WP-CLI v2.8.0


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-plugins rule to Composer.
  • PRs that add a Composer script.

wp-cli/wp-cli-bundle

  • Adapt tests for Requests [#540]
  • Skip update-framework.yml workflow on forks [#537]
  • Add a workflow to keep wp-cli/wp-cli up 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-install in Deployment workflow [#463]

wp-cli/wp-cli

  • Harden loading of upgrader [#5791]
  • Ignore Requests deprecations in error handling for now [#5790]
  • Fallback to hardcoded folder when WPINC not 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_runtime if supported. [#5778]
  • Extract cacert from Phar for cURL [#5777]
  • Fix some PHP 8.2 depreciation notices in behat tests [#5776]
  • Use rtrim on phar-safe path to avoid double slash [#5775]
  • Upgrade WP-CLI to Requests v2 [#5774]
  • Added wp cli alias is-group subcommand. [#5766]
  • Update test to reflect warning when --url=<url> is provided [#5763]
  • Use -R instead of -r for 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=1 to force --user=<login> [#5738]
  • Fix --skip-themes for 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 @alias definition respects @when definition [#5730]
  • Improve docs for SHELL_PIPE [#5729]
  • Use awk instead of sed to create BOM in feature test [#5728]
  • Add runtime_args to options array for runcommand [#5722]
  • Fix deprecation notice triggered in WpOrgApi class in PHP 8.1 [#5717]
  • Fix return type of make_progress_bar [#5715]
  • Add name context to before_invoke and after_invoke [#5712]
  • Check that proc_open() is available in Process::run() [#5711]
  • Improve support for cases with empty --path provided to commands [#5709]
  • Fix composer test after branch rename [#5708]
  • PHP 8.2: explicitly declare CompositeCommand::$longdesc to fix deprecation warning [#5707]
  • Detect Object Cache Pro [#5698]
  • Ensure WP_CLI_ROOT is defined before accessing it [#5697]
  • Fix proc_open_compat util on Windows [#5689]
  • Move WP_CLI_CONFIG_SPEC_FILTER_CALLBACK test to flags.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 doctor content and a landing page [#430]
  • Add two primary wp doctor docs 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]
  • تحديث ملف readme الألماني [#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]
  • تمرير false بدلاً من null لإصلاح تحذير PHP 8.1 [#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]
  • الإبقاء على دليلي wp-content/plugins وwp-content/themes عند استخدام --skip-content [#230]
  • التحقق من مزيد من الملفات لتحديد ما إذا كان WordPress موجوداً أم لا [#233]
  • إضافة الخيار --skip-config إلى wp core multisite-convert [#231]
  • إصلاح الاختبارات لدعم Requests v2 [#235]

wp-cli/cron-command

  • استخدام wp_get_ready_cron_jobs() مع --due-now لتطبيق مرشحمرشح المرشحات هي أحد نوعي الخطافات https://codex.wordpress.org/Plugin_API/Hooks. وهي توفر طريقة للدوال لتعديل بيانات الدوال الأخرى. وهي النظير للإجراءات. وعلى عكس الإجراءات، يُفترض أن تعمل المرشحات بطريقة معزولة، وألا تكون لها آثار جانبية مثل التأثير في المتغيرات العامة والمخرجات. الأساسي [#89]
  • إصدار تحذير بدلاً من حدوث خطأ قاتل عند اكتشاف حدث cron غير صالح [#93]
  • إضافة الوسيط --exclude=<hooks> إلى wp cron event run [#97]

wp-cli/db-command

  • إصلاح استرداد get_post_table_characterset [#231]

wp-cli/entity-command

  • إضافة مثال لحذف معرّفات منشورات متعددة [#387]
  • إضافة دعم --field=url للمنشورات والتعليقات والمصطلحات [#383]
  • إضافة wp option get-autoload وwp option set-autoload [#382]
  • استبدال محمّل التشغيل التلقائي لمساحة الأسماء الفارغة بخريطة أصناف [#390]
  • عدم وضع علامة مزعج على الموقع الرئيسي عند استخدام wp user spam [#393]
  • توضيح حقل url في وثائق wp site list [#401]
  • تغيير كلمات المرور الجديدة إلى 24 حرفاً في بعض المواضع [#399]
  • إضافة أمثلة وتحديث الوثائق الخاصة بـ wp post term [#398]
  • إضافة الخيار --show-password إلى user reset-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]
  • إضافة المعامل --include_once=<section> لبيانات before_posts في عمليات التصدير متعددة الملفات [#100]
  • استبعاد معرّفات المؤلفين غير الضرورية من منشورات oembed_cache في التصدير [#99]

wp-cli/extension-command

  • إصلاح الاختبارات الفاشلة [#347]
  • إصلاح اختبارات PHP 5.6 الفاشلة باشتراط WP 5.2 [#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 [#172]
  • لم يعد Travis مستخدماً، لذا يمكن إزالة ملفات الإعداد [#171]
  • تجنب حذف البيانات الوصفيةالبيانات الوصفية البيانات الوصفية مصطلح يشير إلى الأعمال الداخلية لمجموعة ما. ويشير هذا بالنسبة لنا إلى الفريق الذي يعمل على مواقع WordPress الداخلية مثل WordCamp Central وMake WordPress. للأحجام الأخرى عند تشغيل wp media regenerate مع --image_size [#170]
  • دعم --post_name= عند استيراد الوسائط [#166]
  • تصحيح الوسيط الخاص بالأمر الفرعي fix-orientation [#165]
  • إزالة الاختبارات المتعلقة بإعادة إنشاء الصور المصغرة للصور المربعة [#177]

wp-cli/package-command

  • إصلاح اختبارات package-command الفاشلة [#164]
  • وضع علامة @broken على الاختبار الذي يستخدم yoast/wp-cli-faker [#170]
  • تكييف الوصول إلى الشهادة المضمّنة [#174]

wp-cli/php-cli-tools

  • إضافة تعليقات توضيحية لإزالة رسالة التحذير المهملة في PHP 8.1 [#152]
  • استعادة عمليات تشغيل اختبارات PHPUnit [#155]
  • إصلاح إهمال PHP: إنشاء خاصية ديناميكية [#158]

wp-cli/rewrite-command

  • دعم عناوين URL الكاملة لـ wp rewrite list --match=<url> [#59]

wp-cli/role-command

  • إضافة شرح لما يحدث عند استخدام wp role reset [#58]
  • إصلاح الخطأ القاتل عند إعادة تعيين دور محذوف مسبقاً [#57]
  • إصلاح دعم الوسيط --grant=false [#59]

wp-cli/scaffold-command

  • تحديث عنوان URL لـ GitHubGitHub GitHub هو موقع إلكتروني يوفر تنفيذاً عبر الإنترنت لمستودعات git يمكن للمطورين الآخرين مشاركتها ونسخها وتعديلها بسهولة. استضافة المستودعات العامة مجانية، بينما تتطلب المستودعات الخاصة اشتراكاً مدفوعاً. قدم GitHub مفهوم «طلب السحب»، حيث يمكن مراجعة تغييرات الشيفرة التي يجريها المساهمون في الفروع ومناقشتها قبل دمجها بواسطة مالك المستودع. https://github.com/ الخاص بـ db.php [#317]
  • إضافة معايير ترميز phpcompatibility-wp إلى قالب Gitlab [#315]
  • استخدام حزم mysql-client المستقلة عن المنصة في Gitlab CI [#314]
  • إضافة vendor إلى ملف .gitignore المُنشأ الذي ينشئه scaffold [#279]

wp-cli/search-replace-command

  • جعل بحث is_text_col غير حساس لحالة الأحرف لدعم sqlite [#177]
  • إصلاح اختبار الفاصل غير الصالح للتعبير النمطي في PHP 8.2 [#181]
  • معالجة الاستعلامات طويلة التشغيل والمساهم المتعلق بنفاد الذاكرة (OOM) في استبدال PHP [#180]

wp-cli/wp-config-transformer

  • تحديث شارة الحالة في README.md [#40]
  • تجنب فشل الاختبار باستخدام assertNotSame بدلاً من assertNotEquals [#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

#إصدار، #v2-8-0