forked from WordPress/wordpress-develop
- Notifications
You must be signed in to change notification settings - Fork 0
Demo #1
New issue
Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.
By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on ? Sign in to your account
Merged
Merged
Demo #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Props obayedmamur, hurayraiit, costdev, shraboni, msnewas. Fixes #56145. git-svn-id: https://develop.svn.wordpress.org/trunk@53677 602fd350-edb4-49c9-b593-d223f7449a82
This changeset removes a duplicate definition of the `type_label` property and consolidates the description of this property. Props dlh, SergeyBiryukov. Fixes #56072. git-svn-id: https://develop.svn.wordpress.org/trunk@53678 602fd350-edb4-49c9-b593-d223f7449a82
…class, as per docblock standards. See #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@53679 602fd350-edb4-49c9-b593-d223f7449a82
…ck-supports test groups. Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53680 602fd350-edb4-49c9-b593-d223f7449a82
…return_empty_when_privacy_policy_page_not_set()` from `Tests_Url_GetPrivacyPolicyUrl`. See: #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53681 602fd350-edb4-49c9-b593-d223f7449a82
Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53682 602fd350-edb4-49c9-b593-d223f7449a82
…nt in documentation and settings files. Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53683 602fd350-edb4-49c9-b593-d223f7449a82
…est groups. Props pbeane, hellofromTonya, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53684 602fd350-edb4-49c9-b593-d223f7449a82
- Deprecate `wp_get_attachment_thumb_file()`. - Make `wp_get_attachment_thumb_url()` an alias of `wp_get_attachment_image_url()`. This fixes it to return the proper thumbnail URL and fall back to returning the URL to `image_meta['thumb']` if only that exists. Props: markhowellsmead, mukesh27, csesumonpro, SergeyBiryukov, mikeschroder, killua99, joemcgill, mashukushibiki, mfgmicha, swissspidy, romulodl, nacin, JoshuaAbenazer, wonderboymusic, lonnylot, azaozz. git-svn-id: https://develop.svn.wordpress.org/trunk@53685 602fd350-edb4-49c9-b593-d223f7449a82
There were two kinds of tests in this file: * Tests for content of some files in the root directory: * `license.txt` * `SECURITY.md` * `package.json` * Tests for some utility functions of the test framework itself: * `strip_ws()` * `test_mask_input_value()` The latter are now moved to their own file, `utils.php`. Follow-up to [22/tests], [81/tests], [103/tests], [25240], [26940], [28064], [28480], [28493], [28523], [28631], [42381], [47403], [53683]. See #39265, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53686 602fd350-edb4-49c9-b593-d223f7449a82
* These were not used consistently, with only four instances across all the tests. * Using this tag in combination with the `beStrictAboutCoversAnnotation="true"` setting will mark a test as "Risky" if code is executed during the test which is not annotated via `@covers` or `@uses` tags. That would make the maintainance of the tags very fiddly, while adding little additional value for the test code base. Follow-up to [32995], [39914], [42636], [53682]. Props jrf. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53687 602fd350-edb4-49c9-b593-d223f7449a82
Syncing stable blocks from the Gutenberg repository to wordpress-develop was a manual process, but it got automated with the script that runs together with syncing WordPress packages changed in the Gutenberg package. Props zieladam. Fixes #56179. git-svn-id: https://develop.svn.wordpress.org/trunk@53688 602fd350-edb4-49c9-b593-d223f7449a82
…php`. See #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@53689 602fd350-edb4-49c9-b593-d223f7449a82
…_update_rows()`. Follow-up to [53689]. See #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@53690 602fd350-edb4-49c9-b593-d223f7449a82
…ers. This applies to: * `ngettext` * `ngettext_{$domain}` * `ngettext_with_context` * `ngettext_with_context_{$domain}` Follow-up to [25565], [48136]. Props cyrillbolliger. Fixes #56187. git-svn-id: https://develop.svn.wordpress.org/trunk@53691 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the post lock data returned by the Heartbeat API is consistent. Previously, `wp_check_locked_posts()` was updated to return the name of the user currently editing the post, but the `wp_refresh_post_lock()` response did not get a similar change. Follow-up to [53070]. Props nathan.noom. Fixes #56197. git-svn-id: https://develop.svn.wordpress.org/trunk@53692 602fd350-edb4-49c9-b593-d223f7449a82
…re sent when a new user account is registered. This introduces the following new filters: * `wp_send_new_user_notification_to_admin` * `wp_send_new_user_notification_to_user` Props janthiel, costdev, audrasjb, peterwilsoncc Fixes #54874 git-svn-id: https://develop.svn.wordpress.org/trunk@53698 602fd350-edb4-49c9-b593-d223f7449a82
…lt-constants.php`. This replaces the `VHOST` and `SUBDOMAIN_INSTALL` constant names in a message in `ms_subdomain_constants()` with placeholders, as they don't need to be translated. Follow-up to [36773]. Props weboccults, hztyfoon, pratiweb. Fixes #56216. git-svn-id: https://develop.svn.wordpress.org/trunk@53699 602fd350-edb4-49c9-b593-d223f7449a82
* Move the colon inside the `<strong>` tags in some `Error:` prefixes, to match other strings. * Move the full stop at the end of some sentences outside of the `<strong>` tags used for individual phrases. Follow-up to [11669], [23844], [53118], [53458], [53476]. Props NekoJonez, Presskopp. Fixes #56027. git-svn-id: https://develop.svn.wordpress.org/trunk@53700 602fd350-edb4-49c9-b593-d223f7449a82
… tests. This removes some duplicate code in favor of calling the `WP_Ajax_UnitTestCase::_setRole()` method created specifically for this purpose and used in other tests. Follow-up to [500/tests], [37288]. Props martin.krcho. See #56203. git-svn-id: https://develop.svn.wordpress.org/trunk@53701 602fd350-edb4-49c9-b593-d223f7449a82
…()` to `$user` for accuracy. Since the parameter accepts not only a user's ID, but also a `WP_User` object, `$user` is a more appropriate name, which better aligns with the `$post` parameter of functions that accept a post ID or a `WP_Post` object. The pre-existing internal `$user` variable which contained a `WP_User` object is renamed to `$user_object` for clarity. Follow-up to [38955]. Props aristath, poena, afercia, SergeyBiryukov. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53702 602fd350-edb4-49c9-b593-d223f7449a82
…WordPress 4.4. Previously, it was used in core and older bundled themes to display the list of allowed tags in the comment form. Follow-up to [709], [2009], [2012], [2032], [2040], [13030], [14365], [32858], [34316], [34351]. See #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@53703 602fd350-edb4-49c9-b593-d223f7449a82
The associated changes were backported to the 6.0 branch, so the version should be 6.0.1 instead of 6.1.0. This affects: * `@since` tag for the `block-templates` feature in `create_initial_theme_features()`. * `@since` tag for the `show_on_front`, `page_on_front`, and `page_for_posts` options on the REST API settings endpoint. Follow-up to [53590], [53661]. Props tommusrhodus, johnbillion. Fixes #56225. git-svn-id: https://develop.svn.wordpress.org/trunk@53704 602fd350-edb4-49c9-b593-d223f7449a82
Restructure the permalink settings fields so URL formats are communicated to screen readers through `aria-describedby` relationships, avoid the usage of implicitly labeled input fields, labeling the custom permalink format correctly, and clarifying values. Make settings `table` element presentational. Props rishishah, sabernhardt, kebbet. Fixes #55498. git-svn-id: https://develop.svn.wordpress.org/trunk@53706 602fd350-edb4-49c9-b593-d223f7449a82
Add an `aria-describedby` relationship between login email/password input fields and displayed login error messages. Props patrickgroot, rollybueno, afercia. Fixes #54483. git-svn-id: https://develop.svn.wordpress.org/trunk@53707 602fd350-edb4-49c9-b593-d223f7449a82
Fixes code style issue from [53707]. Follow up to [53707]. See #54483. git-svn-id: https://develop.svn.wordpress.org/trunk@53708 602fd350-edb4-49c9-b593-d223f7449a82
Issues appropriate audible messages via `wp.a11y.speak()` when `ajax-response.js` generates an error via `wp_die()`. Props afercia, alexstine. Fixes #54483. git-svn-id: https://develop.svn.wordpress.org/trunk@53709 602fd350-edb4-49c9-b593-d223f7449a82
…php`. Includes: * Wrapping longer lines and reducing alignment levels to fit more data on the screen. * Restoring `esc_attr()` for input values, which may include translatable parts. * Adding comments to closing `</div>` tags and PHP `endif` statements. * Reducing the context switching between HTML and PHP. * Balancing PHP conditionals to better reflect the structure. * Removing repeated function calls to improve performance. * Renaming some variables for clarity and consistency. Follow-up to [470], [601], [963], [1227], [1664], [2746], [3029], [6976], [7230], [11350], [14051], [14553], [21891], [34691], [34749], [37747], [38066], [41182], [41986], [42343], [43571], [48710], [50830], [51892], [53706]. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53710 602fd350-edb4-49c9-b593-d223f7449a82
This is intended as an introduction to permalink structure selection. Props kebbet, costdev, hasanuzzamanshamim, mukesh27. Fixes #55947. git-svn-id: https://develop.svn.wordpress.org/trunk@53711 602fd350-edb4-49c9-b593-d223f7449a82
…s screen. This brings more consistency with how the home URL is retrieved elsewhere in the admin. Follow-up to [1567], [1664], [2746], [3029], [4144], [53710]. Props sabernhardt. Fixes #56235. git-svn-id: https://develop.svn.wordpress.org/trunk@53712 602fd350-edb4-49c9-b593-d223f7449a82
The function to check whether WordPress is not installed has evolved over time, ending up with duplicate conditionals. This commit combines two conditionals into a single one and includes an early return. Follow-up to [672], [676], [725], [1184], [1401], [1980], [2171], [2467], [2468], [2486], [2703], [3011], [3670], [12688], [12732], [12762], [13253], [29599], [30581], [34828]. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53915 602fd350-edb4-49c9-b593-d223f7449a82
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. In this particular group of test files, the test classes contain a `set_up()` method which sets a few dynamic (not explicitly declared) properties. For those properties which were set using a function call or variable access, the property has been explicitly declared on the class now. For those properties which were set using a constant scalar expression and for which the value is not changed by any of the tests, the property setting has been removed in favor of declaring a class constant. Includes removing one unused dynamic property declaration: `$this->queries` in `Test_Block_Supports_Layout`, which appears to be a copy/paste from `Tests_Theme_wpThemeJsonResolver`. Follow-up to [40/tests], [260/tests], [598/tests], [50960], [52675], [53085], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856]. Props jrf. See #56033. git-svn-id: https://develop.svn.wordpress.org/trunk@53916 602fd350-edb4-49c9-b593-d223f7449a82
This is a maintenance release with minor changes: * Add `text/csv` MIME type. * Fix DKIM when sending to anonymous group via `mail()`. Release notes: https://.com/PHPMailer/PHPMailer/releases/tag/v6.6.4 For a full list of changes in this update, see the PHPMailer : PHPMailer/PHPMailer@v6.6.3...v6.6.4 Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535]. Props jrf, Synchro. Fixes #56016. git-svn-id: https://develop.svn.wordpress.org/trunk@53917 602fd350-edb4-49c9-b593-d223f7449a82
…aDB and MySQL versions. From [https://mariadb.com/kb/en/mariadb-1061-release-notes/ MariaDB 10.6.1 release notes]: > The `utf8` [https://mariadb.com/kb/en/character-sets/ character set] (and related collations) is now by default an alias for `utf8mb3` rather than the other way around. It can be set to imply `utf8mb4` by changing the value of the [https://mariadb.com/kb/en/server-system-variables/#old_mode old_mode] system variable ([https://jira.mariadb.org/browse/MDEV-8334 MDEV-8334]). From [https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-30.html#mysqld-8-0-30-charset MySQL 8.0.30 release notes]: > **Important Change:** A previous change renamed character sets having deprecated names prefixed with `utf8_` to use `utf8mb3_` instead. In this release, we rename the `utf8_` collations as well, using the `utf8mb3_` prefix; this is to make the collation names consistent with those of the character sets, not to rely any longer on the deprecated collation names, and to clarify the distinction between `utf8mb3` and `utf8mb4`. The names using the `utf8mb3_` prefix are now used exclusively for these collations in the output of `SHOW` statements such as `SHOW CREATE TABLE`, as well as in the values displayed in the columns of Information Schema tables including the `COLLATIONS` and `COLUMNS` tables. This commit adds `utf8mb3_bin` and `utf8mb3_general_ci` to the list of safe collations recognized by `wpdb::check_safe_collation()`. The full list is now as follows: * `utf8_bin` * `utf8_general_ci` * `utf8mb3_bin` * `utf8mb3_general_ci` * `utf8mb4_bin` * `utf8mb4_general_ci` The change is covered by existing database charset unit tests: six tests which previously failed on MariaDB 10.6.1+ or MySQL 8.0.30+ now pass. Includes: * Adjusting the expected test results based on MariaDB and MySQL version. * Using named data providers for the affected tests to make test output more descriptive. * Adding a failure message to each assertion when multiple assertions are used in the test. References: * [https://mariadb.com/kb/en/mariadb-1061-release-notes/ MariaDB 10.6.1 release notes] * [https://jira.mariadb.org/browse/MDEV-8334 MDEV-8334 Rename utf8 to utf8mb3] * [https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-30.html#mysqld-8-0-30-charset MySQL 8.0.30 release notes] * [https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html The utf8mb3 Character Set (3-Byte UTF-8 Unicode Encoding)] Follow-up to [30345], [32162], [37320]. Props skithund, ayeshrajans, JavierCasares, SergeyBiryukov. Fixes #53623. git-svn-id: https://develop.svn.wordpress.org/trunk@53918 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. git-svn-id: https://develop.svn.wordpress.org/trunk@53919 602fd350-edb4-49c9-b593-d223f7449a82
This makes sure there are no leftover images in case of a test failure. Applies to: `test_wp_calculate_image_srcset_no_date_uploads()`. Includes renaming the `$int` variable to `$int_size` for consistency with some other tests. Follow-up to [34855], [35412], [35751], [53463]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53920 602fd350-edb4-49c9-b593-d223f7449a82
…I test classes. WordPress core test suite uses PHPUnit's `beStrictAboutTestsThatDoNotTestAnything` option set to `true`, which marks a test as risky when no assertions are performed. REST API test classes have some empty tests for non-implemented methods because these test classes extend the abstract `WP_Test_REST_Controller_Testcase` class, which requires several methods to be implemented that don't necessarily make sense for all REST API routes. Some of these empty tests were already marked as skipped, but not in a consistent manner. Since skipping these tests is intentional for the time being, this commit aims to bring some consistency and adjust them all to be more accurately reported as skipped instead of risky. The skipping can be reconsidered in the future when the tests are either removed as unnecessary or updated to actually perform assertions related to their behavior. Follow-up to [40534], [41176], [41228]. Props Mte90, tomepajk, johnbillion, zieladam, SergeyBiryukov. See #40538, #41463, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53921 602fd350-edb4-49c9-b593-d223f7449a82
PHP 8.2 is expected to be released at the end of November 2022. Enabling the tests to run in CI on PHP 8.2 allows WordPress core to start getting ready. As an interim measure, while working through the PHP 8.1 and 8.2 issues, builds against these PHP versions are allowed to fail, so that they don't block PR merges in the Gutenberg project. Notes: * The `composer install` command for PHP 8.1 was still using the `--ignore-platform-reqs` option, while that has not been needed anymore for quite a while, so the condition is now reused for PHP 8.2. * The `--ignore-platform...` option used for the install is now made more specific: * Composer 2.0 added a `--ignore-platform-req=...` option to selectively ignore platform requirements. * Composer 2.2 then added the ability to only ignore the upper bound of platform requirements by adding the `+` sign. * Xdebug-related tests will not be run on PHP 8.2 at this time as the Docker image for PHP 8.2 does not contain Xdebug yet. Once a stable release of Xdebug 3.2.0 is available, it can be added to the Docker image and the test step can then be enabled for PHP 8.2. References: * [WordPress/wpdev-docker-images#87 wpdev-docker-images PR #87: Add PHP 8.2 containers] * [https://.com/composer/composer/releases/tag/2.0.0 Composer 2.0 changelog] * [https://.com/composer/composer/releases/tag/2.2.0 Composer 2.2 changelog] * [https://xdebug.org/announcements/2022-07-20 Xdebug 3.2.0alpha1 release notes] * [https://xdebug.org/announcements/2022-07-25 Xdebug 3.2.0alpha2 release notes] Follow-up to [49077], [49162], [50299], [51588], [51604]. Props jrf, desrosj. See #56009. git-svn-id: https://develop.svn.wordpress.org/trunk@53922 602fd350-edb4-49c9-b593-d223f7449a82
… section. This makes a transparent circle SVG smaller by removing empty space to match the height of other images in the same section, so that all three columns are aligned correctly. Follow-up to [53339]. Props sabernhardt, weboccults, ironprogrammer, webcommsat, marybaum, oglekler. Fixes #56210. git-svn-id: https://develop.svn.wordpress.org/trunk@53924 602fd350-edb4-49c9-b593-d223f7449a82
…mplate parts. The function was using the `array_column()` PHP function on an array of objects, which works as expected on PHP 7 or later, but not on PHP 5.6. This resulted in customized templates being listed multiple times on the Templates and Template Parts screens, and being repeatedly added between lists when switching between the screens. The issue is now resolved by replacing `array_column()` with the `wp_list_pluck()` WordPress core function, which provides consistent behavior beetween PHP versions. Reference: [https://.com/php/php-src/blob/PHP-7.0.0/UPGRADING#L626 PHP 7.0 Upgrade Notes: array_column()]. Props uofaberdeendarren, antonvlasenko, ironprogrammer, jonmackintosh, costdev, hellofromTonya, swissspidy, rudlinkon. Fixes #56271. git-svn-id: https://develop.svn.wordpress.org/trunk@53927 602fd350-edb4-49c9-b593-d223f7449a82
This brings a new version of the Gutenberg code from the [https://.com/WordPress/gutenberg/tree/wp/6.0 wp/6.0 branch] into core. - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] - @wordpress/[email protected] Props SergeyBiryukov. Fixes #56414. git-svn-id: https://develop.svn.wordpress.org/trunk@53929 602fd350-edb4-49c9-b593-d223f7449a82
This allows third-party themes to avoid accidentally being overwritten with an update of a theme of a similar name from the WordPress.org Theme Directory. Additionally, introduce the `update_themes_{$hostname}` filter, which third-party themes can use to offer updates for a given hostname. If set, the `Update URI` header field should be a URI and have a unique hostname. Some examples include: * `https://wordpress.org/themes/example-theme/` * `https://example.com/my-theme/` * `my-custom-theme-name` `Update URI: false` also works, and unless there is code handling the `false` hostname, the theme will never get an update notification. If the header is present, the WordPress.org API will currently only return updates for the theme if it matches the following format: * `https://wordpress.org/themes/{$slug}/` * `w.org/theme/{$slug}` If the header has any other value, the API will not return a result and will ignore the theme for update purposes. Follow-up to [50921]. Props dd32, meloniq, costdev, audrasjb, DavidAnderson, markjaquith, DrewAPicture, mweichert, design_dolphin, filosofo, sean212, nhuja, JeroenReumkens, infolu, dingdang, joyously, earnjam, williampatton, grapplerulrich, markparnell, apedog, afragen, miqrogroove, rmccue, crazycoders, jdgrimes, damonganto, joostdevalk, jorbin, georgestephanis, khromov, GeekStreetWP, jb510, Rarst, juliobox, Ipstenu, mikejolley, Otto42, gMagicScott, TJNowell, GaryJ, knutsp, mordauk, nvartolomei, aspexi, chriscct7, benoitchantre, ryno267, lev0, gregorlove, dougwollison, leemon, SergeyBiryukov. See #14179, #23318, #32101. git-svn-id: https://develop.svn.wordpress.org/trunk@53933 602fd350-edb4-49c9-b593-d223f7449a82
Previously, Windows paths in the `path_is_absolute` function resulted in incorrect URIs. This adjusts for forward slashes and adds tests for the `get_attached_file` function. Props Whissi, SergeyBiryukov, desrosj, stevenlinx, birgire, davidbaumwald, costdev, peterwilsoncc, audrasjb, hellofromTonya, johnbillion. Fixes #36308. git-svn-id: https://develop.svn.wordpress.org/trunk@53934 602fd350-edb4-49c9-b593-d223f7449a82
…Controller`. Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. In this particular case, the `test_create_update_post_with_featured_media()` method creates an attachment and writes the ID of the attachment to a dynamic (undeclared) property to be used as a flag to determine whether attachments need to be cleaned up after the test in the `tear_down()` method. As the actual ''value'' of the property is irrelevant for the cleaning up and the property is realistically being used as a “flag”, this is now fixed as follows: * Have an actual “flag” property declared with a descriptive name — `$attachments_created` — to make the code in the `tear_down()` more easily understandable. * As for the actual ID of the attachment, save that to a test method local variable as that is the only place where it has any relevance. Includes moving the `tear_down()` method up to be directly below the `set_up()` method. Follow-up to [38832], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856], [53916]. Props jrf. See #56033. git-svn-id: https://develop.svn.wordpress.org/trunk@53935 602fd350-edb4-49c9-b593-d223f7449a82
…Controller`. Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. In these particular cases, individual tests set a couple of properties (`$author_id`, `$post_id`) that are never used outside of the context of the test in which they are created. In other words: these should never have been properties, but should be local variables instead. Follow-up to [38832], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856], [53916], [53935]. Props jrf. See #56033. git-svn-id: https://develop.svn.wordpress.org/trunk@53936 602fd350-edb4-49c9-b593-d223f7449a82
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. In this particular case, the `scandir()` method sets a dynamic `$matched_dirs` property, which is subsequently used in the `delete_folders()` method. This commit removes the need for the property. Effectively, this changes the `scandir()` method to return an array of the matched directories instead of setting the property by using recursion in the method itself in an optimized manner. Note the `array_merge()` not being in the loop itself, but at the very end of the function. This is for performance reasons, see [https://.com/dseguy/clearPHP/blob/master/rules/no-array_merge-in-loop.md clearPHP: No array_merge() In Loops] for a more detailed explanation of this. It has been verified in detail that the actual results of the previous version of the method and this version match, even when the paths passed are more complex and have deeper nested subdirectories. Follow-up to [30658], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856], [53916], [53935], [53936]. Props jrf, johnbillion, markjaquith, SergeyBiryukov. See #56033. git-svn-id: https://develop.svn.wordpress.org/trunk@53937 602fd350-edb4-49c9-b593-d223f7449a82
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. In this test file, the `Tests_Comment_Walker::set_up()` method created a dynamic `$post_id` property, which should have been explicitly declared. Along the same lines, the `Comment_Callback_Test::__construct()` method also assigned values to two undeclared properties. This is now fixed by explicitly declaring the properties in both classes. Includes renaming the `Comment_Callback_Test` class to `Comment_Callback_Test_Helper` as it does not contain any test methods and its only purpose is as a “helper” class for the `Tests_Comment_Walker::test_has_children()` test. Follow-up to [28824], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856], [53916], [53935], [53936], [53937]. Props jrf. See #56033. git-svn-id: https://develop.svn.wordpress.org/trunk@53938 602fd350-edb4-49c9-b593-d223f7449a82
…ameter description. Props kebbet. See #55646. git-svn-id: https://develop.svn.wordpress.org/trunk@53939 602fd350-edb4-49c9-b593-d223f7449a82
Updated actions: - `actions/cache` - `actions/-script` - `actions/setup-node` - `bubkoo/welcome-action` - `shivammathur/setup-php` - `slackapi/slack--action` See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53940 602fd350-edb4-49c9-b593-d223f7449a82
Add object caching to the first database query in `WP_Query`, ie the database query for post IDs that match the desired result. Randomly ordered queries remain uncached as they are not intended to return consistent results. Caching of ID queries is enabled by default, per the post object, term and meta caches. Props spacedmonkey, aaroncampbell, batmoo, chriscct7, costdev, dd32, drewapicture, johnbillion, mukesh27, nacin, ocean90, peterwilsoncc, ryan, scribu, sergeybiryukov, tillkruss. Fixes #22176. git-svn-id: https://develop.svn.wordpress.org/trunk@53941 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Sep 14, 2022
…ize_Manager::get_return_url()`. This particular code block only makes sense to run when `$this->return_url` is not null. Previously, it caused a "passing null to non-nullable" deprecation notice on PHP 8.1. By moving the code into the `if ( $this->return_url )` condition block, the code will only be run when `$this->return_url` contains a non-falsey/non-null value. No additional tests added as this issue was found via the existing tests for the function containing the bug. This solves the following two PHP 8.1 test errors: {{{ 1) Tests_WP_Customize_Manager::test_return_url parse_url(): Passing null to parameter #1 ($url) of type string is deprecated /var/www/src/wp-includes/class-wp-customize-manager.php:4696 /var/www/tests/phpunit/tests/customize/manager.php:2975 /var/www/vendor/bin/phpunit:123 2) Tests_WP_Customize_Manager::test_customize_pane_settings parse_url(): Passing null to parameter #1 ($url) of type string is deprecated /var/www/src/wp-includes/class-wp-customize-manager.php:4696 /var/www/src/wp-includes/class-wp-customize-manager.php:4898 /var/www/tests/phpunit/tests/customize/manager.php:3085 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [46754]. Props jrf, costdev. See #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54135 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Dec 11, 2022
…pc_server::mw_newPost()`. The `wp_xmlrpc_server::mw_newPost()` method creates a new post via `wp_insert_post()`, but the default/fallback values used in the function were not in line with the default/fallback values used in the `wp_insert_post()` function. The `wp_insert_post()` function does a `wp_parse_args()` (array merge) of the received arguments with the defaults. If any of the received arguments are `null`, this would overwrite the default value, as seen in [https://3v4l.org/bfVlv array_merge() example], and lead to "passing null to non-nullable" deprecation notices on PHP 8.1 for certain arguments. This commit: * Ensures that all arguments are defined before they are `compact()`'ed together to the arguments array. * Verifies that the default/fallback value of the arguments as set within the `wp_xmlrpc_server::mw_newPost()` method are the same as the default/fallback values used in the `wp_insert_post()` function. * Verifies that arguments which do not have a default/fallback value defined in the `wp_insert_post()` function are handled correctly. * This was not the case for `$post_name`, which would previously already get an empty string default value in the `wp_xmlrpc_server::mw_newPost()` function, but then in the `wp_insert_post()` function, this would prevent the slug generation from being activated. Fixed now by setting the default in the `wp_xmlrpc_server::mw_newPost()` function to `null`. * The `page_template` argument was handled, but not documented in the `wp_insert_post()` function. The argument is now documented in the `wp_insert_post()` function DocBlock. Note: There are more than likely several other potential arguments missing from that list, but verifying the whole list is outside the scope of this particular commit. Includes minor simplifications, such as: * Setting a default ahead of an `if`, instead of in an `else` clause (as long as no function call is needed to set the default). * Removing the unnecessary logic duplication in the `$post_status` switch. * Using a combined concatenation + assignment operator for adding `$post_more`. Fixes various errors along the lines of: {{{ 1) Tests_XMLRPC_mw_editPost::test_draft_not_prematurely_published strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated /var/www/src/wp-includes/formatting.php:2497 /var/www/src/wp-includes/class-wp-hook.php:308 /var/www/src/wp-includes/plugin.php:205 /var/www/src/wp-includes/post.php:2835 /var/www/src/wp-includes/post.php:2720 /var/www/src/wp-includes/post.php:4066 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:5616 /var/www/tests/phpunit/tests/xmlrpc/mw/editPost.php:315 ... 23) Tests_XMLRPC_mw_editPost::test_draft_not_prematurely_published json_decode(): Passing null to parameter #1 ($json) of type string is deprecated /var/www/src/wp-includes/kses.php:2074 /var/www/src/wp-includes/class-wp-hook.php:307 /var/www/src/wp-includes/plugin.php:205 /var/www/src/wp-includes/post.php:2835 /var/www/src/wp-includes/post.php:2720 /var/www/src/wp-includes/post.php:4066 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:5615 /var/www/tests/phpunit/tests/xmlrpc/mw/editPost.php:315 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [1563], [4793], [7900], [16824], [19848], [40677], [51968]. Props jrf. See #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54320 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Dec 11, 2022
…pc_server::_insert_post()`. The `wp_xmlrpc_server::_insert_post()` method creates a new post via `wp_insert_post()` or updates an existing one via `wp_update_post()`, which subsequently calls `wp_insert_post()`. However, the default/fallback values used in the function were not in line with the default/fallback values used in the `wp_insert_post()` function. The `wp_insert_post()` function does a `wp_parse_args()` (array merge) of the received arguments with the defaults. If any of the received arguments are `null`, this would overwrite the default value, as seen in [https://3v4l.org/bfVlv array_merge() example], and lead to "passing null to non-nullable" deprecation notices on PHP 8.1 for certain arguments. Unfortunately, the conditional logic within the `wp_xmlrpc_server::_insert_post()` function itself often uses an `isset()` to trigger certain code blocks, so syncing the defaults with those used in the `wp_insert_post()` function was not an option. This commit: * Updates the default/fallback values in the `$defaults` array only for those values where this would not lead to a change in the behavior of the function. * Adds a safeguard function, filtering out all remaining `null` values from the `$post_data` array before it is passed on to the `wp_insert_post()` or `wp_update_post()` functions. Removing those values is safe as this means that these array keys will now: * either be set to the default/fallback value as defined in `wp_insert_post()`. * or not be set and for those values which don't have a default/fallback value in `wp_insert_post()`, the function does an `! empty()` or `isset()` check anyway and those array keys not being defined means that the result of those checks will remain the same. Includes * Removing a couple of conditions which are now redundant. * Removing an `expectDeprecation()` in the `Tests_Date_XMLRPC` test class, which is now no longer needed. Fixes various errors along the lines of: {{{ 36) Tests_XMLRPC_wp_newPost::test_no_content json_decode(): Passing null to parameter #1 ($json) of type string is deprecated /var/www/src/wp-includes/kses.php:2074 /var/www/src/wp-includes/class-wp-hook.php:307 /var/www/src/wp-includes/plugin.php:205 /var/www/src/wp-includes/post.php:2835 /var/www/src/wp-includes/post.php:2720 /var/www/src/wp-includes/post.php:4066 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:1683 /var/www/src/wp-includes/class-wp-xmlrpc-server.php:1347 /var/www/tests/phpunit/tests/xmlrpc/wp/newPost.php:25 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [1563], [4793], [7900], [16824], [19848], [19873], [20632], [40677], [51968], [54320]. Props jrf. See #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54321 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Dec 11, 2022
…ions path. The `$path` parameter of `load_script_textdomain()` had a default value of `null`, but would be passed onto the `untrailingslashit()` function without any input validation, even though the latter explicitly only expects/supports a string input. This commit changes the default value for `$path` to an empty string, and adds an `is_string()` check before passing the value to `untrailingslashit()` to fix the issue at the point where the invalid input is incorrectly (not) validated. Note: Changing the `untrailingslashit()` function is outside the scope of this commit. Includes: * Adding a dedicated unit test for this issue. * Correcting the default value for `$path` from `null` to an empty string in a few related methods and functions: * `WP_Dependency::set_translations()` * `WP_Scripts::set_translations()` * `wp_set_script_translations()` * `load_script_textdomain()` This fix also allows to remove a couple of calls to `expectDeprecation()` in unrelated tests. Fixes an error when running the test suite: {{{ 4) Tests_Dependencies_Scripts::test_wp_external_wp_i18n_print_order rtrim(): Passing null to parameter #1 ($string) of type string is deprecated /var/www/src/wp-includes/formatting.php:2782 /var/www/src/wp-includes/l10n.php:1068 /var/www/src/wp-includes/class.wp-scripts.php:605 /var/www/src/wp-includes/class.wp-scripts.php:320 /var/www/src/wp-includes/class.wp-dependencies.php:136 /var/www/src/wp-includes/functions.wp-scripts.php:109 /var/www/tests/phpunit/tests/dependencies/scripts.php:1505 /var/www/tests/phpunit/includes/utils.php:436 /var/www/tests/phpunit/tests/dependencies/scripts.php:1507 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [44169], [44607], [51968]. Props jrf, ocean90, Chouby, swissspidy, lovor, iviweb, meysamnorouzi, DarkoG, oneearth27, SergeyBiryukov. Fixes #55967. See #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54349 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Dec 11, 2022
…_JSON::get_property_value()`. This commit aims to fix errors caused by incorrect usage of the `strncmp()` function inside the `WP_Theme_JSON::get_property_value()` method on PHP 8.1 and above. Some history of the affected code: * [50973] introduced the `WP_Theme_JSON::get_property_value()` method. * [54162] removed the `$default` parameter from the `_wp_array_get()` call in the method. With the latter change, the default value that is returned if the path does not exist within the array, or if `$array` or `$path` are not arrays, became `null` instead of an empty string. Since `null` would then be unintentionally passed to the `strncmp()` function further in the code, this caused ~35 errors in the test suite along the lines of: {{{ 1) Tests_Blocks_Editor::test_get_block_editor_settings_theme_json_settings strncmp(): Passing null to parameter #1 ($string1) of type string is deprecated /var/www/src/wp-includes/class-wp-theme-json.php:1754 /var/www/src/wp-includes/class-wp-theme-json.php:1641 /var/www/src/wp-includes/class-wp-theme-json.php:2066 /var/www/src/wp-includes/class-wp-theme-json.php:1002 /var/www/src/wp-includes/class-wp-theme-json.php:898 /var/www/src/wp-includes/global-styles-and-settings.php:140 /var/www/src/wp-includes/block-editor.php:421 /var/www/tests/phpunit/tests/blocks/editor.php:388 /var/www/vendor/bin/phpunit:123 }}} This commit includes: * Restoring the `$default` value for `_wp_array_get()` call. * Adding an early return if the value is an empty string or `null`. * Adding a dedicated unit test to ensure that the method returns a string for invalid paths or `null` values. Follow-up to [50973], [54162]. Props antonvlasenko, jrf, imadarshakshat, SergeyBiryukov. Fixes #56620. git-svn-id: https://develop.svn.wordpress.org/trunk@54362 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Dec 11, 2022
…L10n`. These three tests for `wp_dasard_recent_drafts()` would run into a PHP 8.1 "passing null to non-nullable" deprecation for the call to `ltrim()` when the result of `get_edit_post_link()` is passed to `esc_url()`. Setting a deprecation expectation would not solve this as the returned value would still not match the expected value(s). The recent drafts list is only displayed on the Dasard screen for users with the `edit_posts` capability. By setting the current user to Editor, the prerequisites for `wp_dasard_recent_drafts()` are met, which means the deprecation notice is avoided and the assertions will succeed. This commit addresses a few errors in the test suite along the lines of: {{{ 1) Tests_L10n::test_length_of_draft_should_be_counted_by_words ltrim(): Passing null to parameter #1 ($string) of type string is deprecated /var/www/src/wp-includes/formatting.php:4376 /var/www/src/wp-admin/includes/dasard.php:657 /var/www/tests/phpunit/tests/l10n.php:449 /var/www/vendor/bin/phpunit:123 }}} Follow-up to [45505], [52253], [52259]. Props jrf, desrosj, SergeyBiryukov. See #56681, #55652, #55656. git-svn-id: https://develop.svn.wordpress.org/trunk@54365 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Feb 10, 2023
The `$credentials['user_login']` and `$credentials['user_password']` parameters are passed by reference to the `wp_authenticate` action, and are at that point [https://www.php.net/manual/en/language.references.pass.php#124383 created as null] if they don't exist in the array. This commit sets those values to an empty string, resolving two PHP 8.1 deprecation notices: * One from `preg_replace()` in `wp_strip_all_tags()` via `sanitize_user()` in `wp_authenticate()`: {{{ Deprecated: preg_replace(): Passing null to parameter WordPress#3 ($subject) of type array|string is deprecated }}} * One from `trim()` in `wp_authenticate()` itself: {{{ Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated }}} Includes documenting the `$credentials` parameter using hash notation. Follow-up to [6643], [37697]. Props lenasterg, TobiasBg, ocean90, afragen, lkraav, SergeyBiryukov. Fixes #56850. git-svn-id: https://develop.svn.wordpress.org/trunk@55301 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Mar 7, 2023
…air screen. The table is no longer created by core as of WordPress 3.0, and support for global terms was removed in WordPress 6.1, so `$wpdb->sitecategories` is unset by default. This commit resolves a "passing null to non-nullable" deprecation notice on PHP 8.1: {{{ Deprecated: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated in wp-includes/class-wpdb.php on line 1804 }}} The `tables_to_repair` filter is available for plugins to readd the table or include any additional tables to repair. Follow-up to [14854], [14880], [54240]. Props ipajen, chiragrathod103, SergeyBiryukov. Fixes #57762. git-svn-id: https://develop.svn.wordpress.org/trunk@55421 602fd350-edb4-49c9-b593-d223f7449a82
robinwpdeveloper pushed a commit that referenced this pull request Mar 28, 2024
…om next_posts(). The `esc_url()` function expects to a string for `$url` parameter. There is no input validation within that function. The function contains a `ltrim()` which also expects a string. Passing `null` to this parameter results in `Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1+. Tracing the stack back, a `null` is being passed to it within `next_posts()` when `get_next_posts_page_link()` returns `null` (it can return a string or `null`). On PHP 7.0 to PHP 8.x, an empty string is returned from `esc_url()` when `null` is passed to it. The change in this changeset avoids the deprecation notice by not invoking `esc_url()` when `get_next_posts_page_link()` returns `null` and instead sets the `$output` to an empty string, thus maintain the same behavior as before (minus the deprecation notice). Adds a test to validate an empty string is returned and the absence of the deprecation (when running on PHP 8.1+). Follow-up to [11383], [9632]. Props codersantosh, nihar007, hellofromTonya, mukesh27, oglekler, rajinsharwar. Fixes #59154. git-svn-id: https://develop.svn.wordpress.org/trunk@56740 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See Pull Requests for Code Review in the Core Handbook for more details.