Commit Graph

34643 Commits

Author SHA1 Message Date
Sergey Biryukov f940bc822d Coding Standards: Apply various alignment corrections from `composer format`.
This fixes a few WPCS warnings along the lines of:
* Array double arrow not aligned correctly
* Equals sign not aligned with surrounding statements
* Usage of ELSE IF is discouraged; use ELSEIF instead

Follow-up to [55099], [55192], [55194], [55271].

Props davidbaumwald, jrf, SergeyBiryukov.
Fixes #57994.
Built from https://develop.svn.wordpress.org/trunk@55606


git-svn-id: http://core.svn.wordpress.org/trunk@55118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-29 07:13:23 +00:00
hellofromTonya 08e9393f23 Help/About: Make Field Guide link translatable.
On the About page, wraps the Field Guide's link in `__()` to provide a localized field guide, when available.

Follow-up to [55600].

Props davidbaumwald, sergeybiryukov, desrosj, javiercasares, oglekler, mukesh27, clorith, eboxnet, costdev, ocean90.
Fixes #57477.
Built from https://develop.svn.wordpress.org/trunk@55601


git-svn-id: http://core.svn.wordpress.org/trunk@55113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 15:36:18 +00:00
hellofromTonya 7237836b1a Help/About: Add Field Guide link.
In the About page, replaces the `#` placeholder with the link to the Field Guide.

Follow-up to [55573], [55449], [55499], [55545].

Props vladytimy, ocean90.
Fixes #57998.
Built from https://develop.svn.wordpress.org/trunk@55600


git-svn-id: http://core.svn.wordpress.org/trunk@55112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 15:14:19 +00:00
hellofromTonya b1d826fb6e Date/Time: Revert [55054].
This changeset introduced a regression for partial-hour timezones such as +05:30 UTC which is India and Sri Lanka. How? These timezones are in float. The change made in [55054] type casted them to integer which dropped the decimal for the partial-hour, making the time inaccurate. For example, +05:30 UTC (India and Sri Lanka)'s `'gmt_offset'` is `5.5`, but with the changeset, it was changed to `5`.

Reverting the changeset restores the original state of `current_time()` and thus resolves the regression.

Props reputeinfosystems, Rarst, hellofromTonya, desrosj, audrasjb, sergeybiryukov, costdev, priethor, francina, nekojonez, codingchicken, cbringmann.
See #57035.
Fixes #57998.
Built from https://develop.svn.wordpress.org/trunk@55598


git-svn-id: http://core.svn.wordpress.org/trunk@55110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 14:22:21 +00:00
Sergey Biryukov f0f0173e40 Docs: Use typed array notation for `search_columns` in `WP_Query::parse_query()`.
Follow-up to [55248].

Props tmatsuur.
Fixes #57996.
Built from https://develop.svn.wordpress.org/trunk@55597


git-svn-id: http://core.svn.wordpress.org/trunk@55109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 10:56:23 +00:00
Dion Hulse 5ce81844a8 Coding Standards: Use the correct variable.
Follow-up to [55593].

See #57318.

Built from https://develop.svn.wordpress.org/trunk@55596


git-svn-id: http://core.svn.wordpress.org/trunk@55108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 05:34:21 +00:00
Sergey Biryukov 79d6ac7fd7 Docs: Clarify the `::hide_process_failed()` return value in plugin and theme installer.
Follow-up to [48390].

Props sakibmd, jrf, patelmohip, akmelias.
Fixes #57680.
Built from https://develop.svn.wordpress.org/trunk@55595


git-svn-id: http://core.svn.wordpress.org/trunk@55107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-27 15:11:20 +00:00
Sergey Biryukov b7ef3ffdd3 Docs: Add missing `@return` tag for `WP_Automatic_Updater::is_disabled()`.
Follow-up to [25421], [25823], [25859].

Props sakibmd, jrf, patelmohip, akmelias.
See #57680.
Built from https://develop.svn.wordpress.org/trunk@55594


git-svn-id: http://core.svn.wordpress.org/trunk@55106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-27 14:13:22 +00:00
Sergey Biryukov 7127052046 Coding Standards: Use strict comparison in `wp-admin/includes/nav-menu.php`.
Follow-up to [14248], [15008], [37748].

Props jenilk, johnbillion.
Fixes #57318.
Built from https://develop.svn.wordpress.org/trunk@55593


git-svn-id: http://core.svn.wordpress.org/trunk@55105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-26 10:06:18 +00:00
Sergey Biryukov 95a52be05d Coding Standards: Use strict comparison in `wp-admin/includes/user.php`.
Follow-up to [10990], [11162], [11217], [37059].

Props jenilk.
Fixes #57317.
Built from https://develop.svn.wordpress.org/trunk@55592


git-svn-id: http://core.svn.wordpress.org/trunk@55104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-25 15:25:26 +00:00
Sergey Biryukov 7278aadd72 Tests: Split the tests from `post/template.php` into individual test classes.
This aims to bring some consistency to the location of post template function tests, as well as to make the tests more discoverable and easier to expand.

Includes:
* Adding `@covers` tags.
* Renaming `get_post_parent()` and `has_post_parent()` tests to match the names of the functions.

Follow-up to [28398], [31522], [34654], [34950], [50127], [50396], [54717], [54726], [55590].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55591


git-svn-id: http://core.svn.wordpress.org/trunk@55103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 17:12:21 +00:00
Sergey Biryukov 33346784dc Tests: Move `wp_dropdown_pages()` tests to their own file.
This aims to make the tests more discoverable and easier to expand.

Includes removing a basic test hidden among `get_pages()` tests, as there is already a more comprehensive set of tests available.

Follow-up to [1279/tests], [28399], [31338].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55590


git-svn-id: http://core.svn.wordpress.org/trunk@55102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 16:14:22 +00:00
Sergey Biryukov d32720d67c Tests: Add a `@ticket` reference for `wp_list_pages()` CSS classes test.
Follow-up to [55588].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55589


git-svn-id: http://core.svn.wordpress.org/trunk@55101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 15:07:21 +00:00
Sergey Biryukov a9e3cb71bb Tests: Move the `wp_list_pages()` test for CSS classes to a more appropriate place.
Back when this test was introduced, `wp_list_pages()` did not have its own test class.

It does now, so the test can be moved there, instead of being hidden among `get_pages()` tests.

Includes:
* Updating the test name for clarity.
* Adding an unique message for each assertion.

Follow-up to [27755], [28400].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55588


git-svn-id: http://core.svn.wordpress.org/trunk@55100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 15:00:28 +00:00
audrasjb 1764cee3d1 Login and Registration: Revert [55358] and [55360].
This reverts the changes implemented in [55358] and [55360].

Changeset [55358] was committed to prevent login name collision when one user registers with the email address `user@example.com` and a second user tries to register with the username `user@example.com`. However, it also introduced a potential backward compatibility issues for plugins that use `wp_update_user()`. When updating an existing user, it throws an `existing_user_email_as_login` error if the email address is also used for the user login, due to the code introduced in [55358].

This changeset removes the new scenario added in [55358] and [55360], restoring the `wp_insert_user()` function back to its previous state.

Props polevaultweb, audrasjb, costdev, peterwilsoncc, hellofromTonya, SergeyBiryukov, azaozz.
See #57967, #57394.

Built from https://develop.svn.wordpress.org/trunk@55584


git-svn-id: http://core.svn.wordpress.org/trunk@55096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-23 13:54:23 +00:00
Sergey Biryukov a0fdeb36dd Tests: Improve `get_pages()` tests organization.
Includes:
* Renaming some tests for clarity.
* Moving some tests to a more appropriate place.
* Moving the `@covers` tag to the top of the class.
* Using consistent formatting for assertion messages.

Follow-up to [27767], [41849], [44587], [55569].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55583


git-svn-id: http://core.svn.wordpress.org/trunk@55095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-23 11:37:23 +00:00
audrasjb 1b393fbb15 Login and Registration: Fix margin for language switcher button on small screens.
This fixes an alignement issue on small screens in the language switcher button displayed on the Login screen.

Follow-up to [52058], [52417].

Props sabernhardt.
Fixes #57617.

Built from https://develop.svn.wordpress.org/trunk@55582


git-svn-id: http://core.svn.wordpress.org/trunk@55094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-22 12:50:18 +00:00
Sergey Biryukov 93a4991c01 Tests: Consistently sanitize expiration in the test suite's Memcached implementation.
In a previous commit, the `::sanitize_expiration()` call in the `::add()` method was moved closer to where the value is used.

This commit does the same for the other methods:
* `::cas()`
* `::replace()`
* `::set()`
* `::setMulti()`

Follow-up to [40561], [55577].

See #57841, #57963.
Built from https://develop.svn.wordpress.org/trunk@55581


git-svn-id: http://core.svn.wordpress.org/trunk@55093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-22 09:27:23 +00:00
hellofromTonya f28f9194e2 Code Modernization: Fix dynamic properties in WP_Admin_Bar.
To fix the dynamic properties, the following changes are included:
* Removes `WP_Admin_Bar::__get()`.
* Declares `menu` as a property on the class, deprecates it, and initializes it to an empty array.
* Removes the unused 'proto' dynamic property.

Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

== Why remove the `WP_Admin_Bar::__get()` magic method?

tl;dr
The magic method is no longer needed.

The magic method only handled the `menu` and `proto` dynamic properties. Introducing a full set of magic methods is overkill for this class. Instead of having to maintain magic methods, this changeset instead directly addresses the 2 properties (see below).

== Why declare the `menu` property on the class?

tl;dr
To simplify the code while maintaining backwards compatibility for extenders who are using this deprecated property.

The `menu` property was introduced during the 3.1.0 ''development cycle'' as a declared property [15671]. Its purpose was to ''internally'' hold the menu structure.

During the WP 3.3.0 development cycle, it was replaced by a new `private` property called `nodes` (see [19120]).

But breakage reports from extenders caused it to be restored. [19501] added the `__get()` magic method, i.e. for handling it as a dynamic property, and deprecated it.

>We're not going to maintain compat for $menu. Suggest we make it array() and plugins will have to deal. We can throw a _deprecated_argument() and push them to use the new methods.
~ Source: [https://core.trac.wordpress.org/ticket/19371#comment:17 see #19371 comment 17]

[https://wpdirectory.net/search/01GSTW1X69TBN8FH3SY7V8KPY5 A search of the wp.org plugins and themes repository] shows that a few plugins are still using this deprecated property. To maintain backwards compatibility, `menu` is moved back to the class as a declared property, set to an empty array (as it's been since 3.3.0), and deprecated in the property's description.

== Why remove the `proto` dynamic property?

tl;dr
* It was not intended to be released in 3.1.
* There are no usages of it in Core or in the WP.org's plugin or theme directories.
* It should be safe to remove.

This property was first introduced in the WP 3.1.0 ''development cycle'' to replace the `PROTO` constant (see [16038]) for protocol handling for the admin bar's hyperlinks. [16077] replaced the property's usages with URL functions such as `get_admin_url()` and `admin_url()`. But it missed removing the property, which was no longer needed or used.

It was relocated to the `__get()` magic method as a dynamic property when the `menu` property was restored (see [19501]).

A search of WP.org's plugins and themes repositories shows no usages of the property. Core hasn't used it since the removed in [16038] before 3.1 final release. It should be safe to remove it, but committing very early in the 6.3 alpha cycle to give time for reports of usages, if there are any.

References:
* A [https://www.youtube.com/watch?v=vDZWepDQQVE&t=9362s live open public working session] where these changes were discussed and agreed to.
* [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [19501], [19120], [16308], [16038], [15671].

Props antonvlasenko, hellofromTonya, jrf, markjaquith, desrosj, ironprogrammer, peterwilsoncc, SergeyBiryukov.
See #56876, #56034.
Built from https://develop.svn.wordpress.org/trunk@55580


git-svn-id: http://core.svn.wordpress.org/trunk@55092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 20:00:19 +00:00
spacedmonkey e30068eb49 Build/Test Tools: Fix issue with add method in object-cache.php.
In the object-cache.php file used for unit tests, the add method did not work as expected. Other object cache plugins and core, have a check to see if the key exists in memory before writing it. Without this check, it used to write unnecessarily to the cache.  

Props spacedmonkey, SergeyBiryukov.
Fixes #57963.
Built from https://develop.svn.wordpress.org/trunk@55577


git-svn-id: http://core.svn.wordpress.org/trunk@55089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 17:02:19 +00:00
ryelle cee125e1f4 Administration: Update dashboard welcome panel colors, remove broken link
Remove the green background from the "dot" accent, to prevent low contrast for the dismiss button. Use menu colors for the background on alternate color schemes. Remove the "Edit styles" link as there is no longer a direct link to the global styles section of the site editor.

Follow-up to [55451].

Props sabernhardt, ryokuhi, laurlittle, richtabor.
Fixes #57759.


Built from https://develop.svn.wordpress.org/trunk@55574


git-svn-id: http://core.svn.wordpress.org/trunk@55086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 15:37:21 +00:00
ryelle 1aba63dc46 Help/About: Updates to About page.
Remove link to release video, update split controls image.

Follow-up to [55449], [55499], [55545].

Props laurlittle, richtabor.
Fixes #57477.


Built from https://develop.svn.wordpress.org/trunk@55573


git-svn-id: http://core.svn.wordpress.org/trunk@55085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 15:27:19 +00:00
hellofromTonya 9f559f452a Tests: Rename test class and improve tests for wp_get_global_stylesheet().
Changes include:
* Renames the test class to be compliant with test coding standards.
* Converts the test class to extend `WP_Theme_UnitTestCase` to reuse test fixtures.
* Implements data providers to encapsulate datasets and reduce code repetition.
* Adds a `@covers` annotation.
* Improves assertion messages to help with diagnosing failed tests.

Follow-up to [55567], [55148], [52682], [53916], [52675-52677].

Props costdev, hellofromTonya.
See #57841, #57958.
Built from https://develop.svn.wordpress.org/trunk@55572


git-svn-id: http://core.svn.wordpress.org/trunk@55084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 13:54:22 +00:00
Sergey Biryukov 94a1aed064 Coding Standards: Remove unused variable in `WP_Plugins_List_Table::single_row()`.
Follow-up to [47835], [48669].

Props azouamauriac.
Fixes #55132.
Built from https://develop.svn.wordpress.org/trunk@55571


git-svn-id: http://core.svn.wordpress.org/trunk@55083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 13:27:21 +00:00
spacedmonkey 7dde8c4440 Posts, Post Types: Use WP_Query internally in get_pages.
Convert `get_pages` to use `WP_Query` internally. Using WP_Query means that a lot of code has been removed however existing parameters supported by get_pages are transformed in to query arguments. The custom caching solution found in the old version of this function is replaced with the caching found in WP_Query (added in [53941]). This change adds consistency to the codebase, as improvements and changes to `WP_Query` will filter down to the `get_pages` function. 

Props mikeschinkel, spacedmonkey, nacin, scribu, filosofo, jane, garyc40, markoheijnen, grandslambert, kevinB, wlindley, dbernar1, atimmer, mdawaffe, helen, benjibee, johnbillion, peterwilsoncc, costdev, flixos90, joemcgill.
Fixes #12821.
Built from https://develop.svn.wordpress.org/trunk@55569


git-svn-id: http://core.svn.wordpress.org/trunk@55081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 12:49:18 +00:00
hellofromTonya 90b5db421c Editor: Update @wordpress packages for 6.2 RC3.
Updates the `@wordpress` packages to include the fixes for these regressions introduced in the 6.2 cycle:

* [Regression] Navigation Block: Category/Custom taxonomy links are not searchable in the Link inserter [https://github.com/WordPress/gutenberg/pull/49126 Gutenberg PR 49126]. See #57929 
* [Regression] Post Editor: List View has no close button on mobile viewports [https://github.com/WordPress/gutenberg/pull/49200 Gutenberg PR 49200] 

References:
* [811da1ab3a Packages x.3.11 publish commit].

Follow-up to [55548].

Props andraganescu, costdev, get_dave, hellofromTonya, mamaduka, ntsekouras, scruffian, talldanwp, thomask.
See #57471.
Fixes #57929.
Built from https://develop.svn.wordpress.org/trunk@55568


git-svn-id: http://core.svn.wordpress.org/trunk@55080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 12:43:46 +00:00
hellofromTonya 69a5893569 Tests: Add test class for `wp_enqueue_stored_styles()`.
[54214] added the `wp_enqueue_stored_styles()` tests and `clean_up_global_scope()` reset global method to `Tests_Theme_wpGetGlobalStylesheet`.

This changeset relocates those tests a new test class specifically for `wp_enqueue_stored_styles()` and removes `Tests_Theme_wpGetGlobalStylesheet::clean_up_global_scope()` method.

Why not relocate the `clean_up_global_scope()` method to the new test class?
The test class extends from `WP_Theme_UnitTestCase` which includes this method.

Follow-up to [54214], [54703].

Props costdev.
See #57841.
Built from https://develop.svn.wordpress.org/trunk@55567


git-svn-id: http://core.svn.wordpress.org/trunk@55079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 18:22:19 +00:00
Sergey Biryukov fc43b28dec Cache API: Correct the second parameter's name in `_get_non_cached_ids()`.
The parameter represents the cache group, not the cache key.

Follow-up to [19918].

Props johnjamesjacoby, spacedmonkey.
Fixes #40420.
Built from https://develop.svn.wordpress.org/trunk@55566


git-svn-id: http://core.svn.wordpress.org/trunk@55078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 16:42:19 +00:00
hellofromTonya 5b0a2e6d06 Tests: Add test class for `wp_script_is()`.
Changes:
* Adds a test class for `wp_script_is()`.
* Moves `WP_Dependencies_jQuery::test_wp_script_is_dep_enqueued()` into this test class and splits it into 2 separate tests, happy and unhappy paths.
* Adds `WP_Scripts::query` `@covers`, as `wp_script_is()` is helper function for it.
* Relocates the global resetting from the test method to the `clean_up_global_scope()` method.

Follow-up to [52010], [29252].

Props hellofromTonya, antonvlasenko.
See #57841, #57958.
Built from https://develop.svn.wordpress.org/trunk@55565


git-svn-id: http://core.svn.wordpress.org/trunk@55077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 16:18:20 +00:00
Sergey Biryukov 6740fd5821 KSES: Allow `filter` property to accept a URL in `safecss_filter_attr()`.
CSS filters can accept `url()` as a reference to an SVG filter element:
{{{
filter: url( file.svg#filter-element-id );
}}}
This commit allows for that syntax to be used in inline CSS.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/48281 #48281 Duotone: Use the style engine to generate CSS for Duotone]

References:
* [https://developer.mozilla.org/en-US/docs/Web/CSS/filter MDN Web Docs: filter()]
* [https://developer.mozilla.org/en-US/docs/Web/CSS/url MDN Web Docs: url()]

Follow-up to [44136], [52049].

Props scruffian, jeryj, ironprogrammer, azaozz, hellofromTonya, SergeyBiryukov.
Fixes #57780.
Built from https://develop.svn.wordpress.org/trunk@55564


git-svn-id: http://core.svn.wordpress.org/trunk@55076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 08:25:22 +00:00
Sergey Biryukov 4630e311e7 Tests: Improve documentation and variable names in some formatting tests.
Includes documenting data provider values using hash notation in the tests for:
* `convert_smilies()`
* `get_url_in_content()`
* `links_add_target()`
* `normalize_whitespace()`

Follow-up to [26191], [26327], [26328], [26972], [55562].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55563


git-svn-id: http://core.svn.wordpress.org/trunk@55075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-19 12:53:17 +00:00
Sergey Biryukov 77fe35a423 Tests: Use the `data_` prefix for various data provider methods.
This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.

Includes moving some data providers next to the tests they are used in.

Follow-up to [55464].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55562


git-svn-id: http://core.svn.wordpress.org/trunk@55074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-19 12:05:21 +00:00
joedolson d49897485b Editor: Show scheduled text when changing to new future dates.
In the classic editor, fix the publish status change text shown when a future post's date is changed to a different future date. Show 'scheduled' statement instead of 'publish' statement.

Props tyxla, sdavis2702, joedolson.
Fixes #31040.
Built from https://develop.svn.wordpress.org/trunk@55561


git-svn-id: http://core.svn.wordpress.org/trunk@55073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 16:35:18 +00:00
joedolson 514460e505 Quick/Bulk Edit: Show scheduled in status for future drafts.
Change the quick edit status `select` to use the 'Scheduled' status instead of the 'Published' status or posts where the date is in the future. 

Props ipstenu, MrFlannagan, sabernhardt, oglekler.
Fixes #38834.
Built from https://develop.svn.wordpress.org/trunk@55560


git-svn-id: http://core.svn.wordpress.org/trunk@55072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 15:47:24 +00:00
Sergey Biryukov 123b819f4f Coding Standards: Remove unused variables in `WP_Comment_Query`.
* `$unapproved_ids` and `$unapproved_emails` in `WP_Comment_Query::get_comment_ids()` were added in [29965] and appear to never have been used.
* `$wpdb` in `WP_Comment_Query::fill_descendants()` was replaced with `$this->db` in [38275], removed in [38446], and accidentally reinstated in [38768].

Follow-up to [29965], [34546], [37625], [38275], [38446], [38768], [44546].

Props upadalavipul, dingo_d, audrasjb, SergeyBiryukov.
Fixes #57482.
Built from https://develop.svn.wordpress.org/trunk@55559


git-svn-id: http://core.svn.wordpress.org/trunk@55071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 12:34:21 +00:00
spacedmonkey 0e55b6ab84 Date / Time: Remove usage of mysql2date in generate_postdata method.
Remove usage of `mysql2date` in `generate_postdata`. `mysql2date` has a performance overhead, as it creates a `DateTimeZone` object each time it is called. Use a simple 
sub string function to generate the values needed for the `currentmonth` and `currentday` global variables. 

Props spacedmonkey, Rarst, SergeyBiryukov, flixos90.
Fixes #57683.
Built from https://develop.svn.wordpress.org/trunk@55558


git-svn-id: http://core.svn.wordpress.org/trunk@55070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-17 15:58:23 +00:00
Sergey Biryukov 215ecfc7ad External Libraries: Upgrade PHPMailer to version 6.8.0.
This is a maintenance release with a new feature: DSN URL parsing, which allows you to create a PHPMailer instance with most important settings by passing in a single URL, ideal for configuring PHPMailer from an environment variable.

Note: This commit does not include new DSN class, as it is not particularly relevant for WordPress core at this time.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.8.0 PHPMailer 6.8.0 release notes]
* [https://github.com/PHPMailer/PHPMailer/compare/v6.7...v6.8.0 Full list of changes in PHPMailer 6.8.0]

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937].

Props ayeshrajans, jrf, Synchro.
Fixes #57873.
Built from https://develop.svn.wordpress.org/trunk@55557


git-svn-id: http://core.svn.wordpress.org/trunk@55069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-17 14:22:22 +00:00
Sergey Biryukov 07b35de70a Filesystem API: Return `false` for empty paths in FTP `::exists()` methods.
When `ftp_nlist()` receives an empty path, it checks the current working directory and may return `true`.

This affects:
* `WP_Filesystem_FTPext::exists()`
* `WP_Filesystem_ftpsockets::exists()`

As the purpose of the API is to provide a consistent interface for various filesystem implementations, this commit updates the affected methods to returns `false` when an empty path is provided, bringing consistency with the other filesystem abstraction classes, specifically `WP_Filesystem_Direct` and `WP_Filesystem_SSH2`.

Follow-up to [6779], [11821], [25274], [31815].

Props mkox, costdev, Zdrobau, dd32, pbiron, azaozz, mukesh27, SergeyBiryukov.
Fixes #33058.
Built from https://develop.svn.wordpress.org/trunk@55556


git-svn-id: http://core.svn.wordpress.org/trunk@55068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-16 16:14:22 +00:00
hellofromTonya 95f3aceea7 HTML API: Add bookmark invalidation logic.
While `WP_HTML_Tag_Processor` currently only supports changing a given tag's attributes, the plan is to provide methods to make broader changes (possibly through a subclass of `WP_HTML_Tag_Processor`). The API will have the potential of replacing a tag that a bookmark points to. To prepare, this changeset makes sure that all bookmarks affected by a HTML replacement are invalidated (i.e. released).

Changes:
* Extends the existing loop in `WP_HTML_Tag_Processor::apply_attributes_updates()` that adjusts bookmarks' start and end positions upon HTML changes to check if the entire bookmark is within a portion of the HTML that has been replaced.
* Adds `WP_HTML_Tag_Processor::has_bookmark() to check whether the given bookmark name exists.

References:
* [https://github.com/WordPress/gutenberg/pull/47559 Gutenberg PR 47559]
* [https://github.com/WordPress/gutenberg/releases/tag/v15.3.0 Released in Gutenberg 15.3.0]

Follow-up to [55203].

Props bernhard-reiter, dmsnell, zieladam.
Fixes #57788.
Built from https://develop.svn.wordpress.org/trunk@55555


git-svn-id: http://core.svn.wordpress.org/trunk@55067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-16 13:11:24 +00:00
spacedmonkey bef2674152 Build/Test Tools: Revert [55553].
Revert package-lock.json changes in [55553].

See #57864.
Built from https://develop.svn.wordpress.org/trunk@55554


git-svn-id: http://core.svn.wordpress.org/trunk@55066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 11:55:20 +00:00
spacedmonkey d409e8ad50 Widgets: Defer register inline script in `WP_Widget_Custom_HTML` and `WP_Widget_Text`.
In [41376] an inline script was added to push `idBases` for the custom html and text widgets. However, this script is not used unless the widget script is output in the widget screen / customizer. Deferring registering this script until it is needed, results in a faster server response times. 


Props spacedmonkey, sakibmd, flixos90, westonruter.
Fixes #57864.
Built from https://develop.svn.wordpress.org/trunk@55553


git-svn-id: http://core.svn.wordpress.org/trunk@55065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 11:38:20 +00:00
Sergey Biryukov 26852dbac7 Administration: Define the `$title` global on the Menus screen for classic themes.
This brings more consistency with other screens and avoids a PHP warning in `get_plugin_page_hookname()`:
{{{
preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

Follow-up to [13257], [13366], [55263].

Props nendeb55, costdev, SergeyBiryukov.
Fixes #57918.
Built from https://develop.svn.wordpress.org/trunk@55552


git-svn-id: http://core.svn.wordpress.org/trunk@55064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 09:05:22 +00:00
Sergey Biryukov 0c53d8ef73 Docs: Fix typo in `_validate_cache_id()` description.
Includes:
* Capitalizing "ID" in a consistent way.
* Expanding the comment on not using `filter_var()`.
* Adding a `@covers` tag for the function in unit tests.
* Minor tweak to the `_doing_it_wrong()` message.

Follow-up to [53818], [55543].

See #57593.
Built from https://develop.svn.wordpress.org/trunk@55549


git-svn-id: http://core.svn.wordpress.org/trunk@55061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:55:19 +00:00
Sergey Biryukov 00803d3e5f Coding Standards: Use single quotes for strings without variables in `register_block_style_handle()`.
This resolves two WPCS errors:
{{{
String ".css" does not require double quotes; use single quotes instead
String "-rtl.css" does not require double quotes; use single quotes instead
}}}
Follow-up to [55544].

See #57903.
Built from https://develop.svn.wordpress.org/trunk@55547


git-svn-id: http://core.svn.wordpress.org/trunk@55059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:26:18 +00:00
ryelle 42bedb5164 Help/About: Add CDN images to About page.
Props richtabor.
See #57477.


Built from https://develop.svn.wordpress.org/trunk@55545


git-svn-id: http://core.svn.wordpress.org/trunk@55057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:05:17 +00:00
Sergey Biryukov 74ca5659a2 Editor: Correctly load RTL stylesheets for non-core blocks.
If `SCRIPT_DEBUG` is disabled, `register_block_style_handle()` loads core blocks' styles with the `.min` suffix, while non-core ones never use the minified files, but the suffix was still mistakenly included in the `-rtl` file lookup.

This commit updates the logic to match the style path set earlier in the function, ensuring that RTL stylesheets are loaded properly for both core and non-core blocks, with or without `SCRIPT_DEBUG`.

Follow-up to [49982], [50836], [54330], [55486].

Props david.binda.
Fixes #57903.
Built from https://develop.svn.wordpress.org/trunk@55544


git-svn-id: http://core.svn.wordpress.org/trunk@55056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:00:19 +00:00
spacedmonkey 8a8216c1c7 Cache API: Add a warning when calling `_get_non_cached_ids` with invalid ids.
Sanitize the array of ids passed to the `_get_non_cached_ids` function and add a `_doing_it_wrong` call, if an invalid type is passed. 

Props tillkruess, spacedmonkey, peterwilsoncc, flixos90, SergeyBiryukov.
Fixes #57593.
Built from https://develop.svn.wordpress.org/trunk@55543


git-svn-id: http://core.svn.wordpress.org/trunk@55055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 15:53:18 +00:00
hellofromTonya 48deabccbe Editor: Update @wordpress packages for 6.2 RC2.
Updates the `@wordpress` packages to include the following changes:

- [Regression] Don't offer Classic block as a recovery action when not registered [https://github.com/WordPress/gutenberg/pull/49051 Gutenberg PR 49051]  
- [i18n Change] Fix typo in the media-categories component [https://github.com/WordPress/gutenberg/pull/49047 Gutenberg PR 49047] 
- Hide navigation screen in site editor [https://github.com/WordPress/gutenberg/pull/49043 Gutenberg PR 49043]  
 [https://make.wordpress.org/core/2023/03/14/fyi-navigation-section-of-new-site-editor-experienced-removed-for-6-2-rc-2/ Feature is not ready for 6.2]
- [i18n Change] Site editor: Fix non-us spelling in sidebar [https://github.com/WordPress/gutenberg/pull/48976 Gutenberg PR 48976]  See Trac #57895.
- [Regression] Site Editor: Fix lingering insertion point within template parts [https://github.com/WordPress/gutenberg/pull/48913 Gutenberg PR 48913]  > Regression introduced in 6.2 cycle.
- Navigation Link: Remove color generation code [https://github.com/WordPress/gutenberg/pull/48927 Gutenberg PR 48927] and [https://github.com/WordPress/gutenberg/pull/49064 Gutenberg PR 49064] 
- Fix settings tab active state border in block inspector [https://github.com/WordPress/gutenberg/pull/48945 Gutenberg PR 48945] 
- Fix text alignment in the Site Editor sidebar  [https://github.com/WordPress/gutenberg/pull/48959 Gutenberg PR 48959]  Making template descriptions more prominent is part of 6.2.

References:
* [f22a3cbf0c Packages x.3.9 publish commit]
* [356298f91f Packages x.3.10 publish commit]

Follow-up to [55496].

Props mamaduka, tobifjellner, davidbaumwald, costdev, audrasjb, hellofromTonya.
See #57471.
Fixes #57895.
Built from https://develop.svn.wordpress.org/trunk@55542


git-svn-id: http://core.svn.wordpress.org/trunk@55054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 15:45:47 +00:00
spacedmonkey 9caf1c4ade Editor: Move variables to where used in wp_render_layout_support_flag.
Improves the performance of wp_render_layout_support_flag() function by moving variables to where each is used.
If a return happens before the variable is needed, this change avoids unnecessary processing and memory.

Props spacedmonkey, hellofromTonya, mukesh27.
Fixes #57815.
Built from https://develop.svn.wordpress.org/trunk@55541


git-svn-id: http://core.svn.wordpress.org/trunk@55053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-13 16:32:20 +00:00
Sergey Biryukov 34662ac6d6 Coding Standards: Bring some consistency to `wp_validate_redirect()` existence checks.
The `wp_get_referer()` and `wp_get_original_referer()` functions both depend on `wp_validate_redirect()` and check whether it is defined by the time they run, but do so in a slightly different way.

This commit ensures both functions return early if they are called before `wp_validate_redirect()` is defined.

Follow-up to [3908], [25399], [25400].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55540


git-svn-id: http://core.svn.wordpress.org/trunk@55052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-13 10:54:22 +00:00
Sergey Biryukov a2c7bba031 Docs: Improve some DocBlock formatting in `wp-includes/class-wp-xmlrpc-server.php`.
Includes clarifying the list of fields passed to the `xmlrpc_default_*_fields` filters by default.

Follow-up to [16046], [17647], [27730], [32550], [37492], [55316].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55539


git-svn-id: http://core.svn.wordpress.org/trunk@55051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-12 14:50:24 +00:00
Sergey Biryukov 8d7d99289d Filesystem API: Return correct error data from `copy_dir()` if the directory listing failed.
The `::dirlist()` method is run on the `$from` directory, so `basename( $from )` is the correct thing to pass to the `WP_Error` object.

Follow-up to [50149].

Props afragen, costdev, pravinparmar2404.
Fixes #57907.
Built from https://develop.svn.wordpress.org/trunk@55538


git-svn-id: http://core.svn.wordpress.org/trunk@55050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-11 11:34:24 +00:00
spacedmonkey fe32dc4241 Cache API: Make `network-queries` and `site-queries` global cache groups.
Fixes a bug introduced in [55526]. The cache groups `network-queries` and `site-queries` store query results for network and site. These are network level data and should be stored in a global cache group. 

Props spacedmonkey, tillkruess, flixos90.
See #57625.
Built from https://develop.svn.wordpress.org/trunk@55537


git-svn-id: http://core.svn.wordpress.org/trunk@55049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 17:51:23 +00:00
spacedmonkey 1bf93a87a4 Cache API: Introduce new queries cache groups.
Give developers more control over how query caches are handled within an object caches. Now all caches that cache the result of a query, are cached in a group that is suffixed with -queries. Developers can use these groups, to add custom cache invalidation rules or to make them none persistent.

Props spacedmonkey, owi, tillkruess, skithund, peterwilsoncc, flixos90, sergeybiryukov, mukesh27.
Fixes #57625.
Built from https://develop.svn.wordpress.org/trunk@55526


git-svn-id: http://core.svn.wordpress.org/trunk@55048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 16:30:03 +00:00
spacedmonkey df7b417d64 Networks and Sites: Replace `get_blog_details` with `get_site`.
Replace usage of the function get_blog_details with more lightweight get_site. 

Props spacedmonkey, kapilpaul, flixos90.
Fixes #57571.
Built from https://develop.svn.wordpress.org/trunk@55515


git-svn-id: http://core.svn.wordpress.org/trunk@55047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:49:18 +00:00
spacedmonkey 49692206c0 Date/Time: Save a call to wp_timezone in mysql2date.
Save a call to wp_timezone in mysql2date by saving the timezone to a variable and pass it into wp_date function call.

Props spacedmonkey, costdev, SergeyBiryukov, audrasjb.
Fixes #57705.
Built from https://develop.svn.wordpress.org/trunk@55514


git-svn-id: http://core.svn.wordpress.org/trunk@55046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:36:20 +00:00
spacedmonkey 39e6d6d348 Comments: Prime post caches in WP_Comments_List_Table.
In the `WP_Comments_List_Table` class, when the function `get_comments` is called, pass the parameter `update_comment_post_cache` set to true. This primes all the related posts for the displayed comments. This improves performance, as all posts are primed at once. 

Props spacedmonkey, adarshposimyth.
Fixes #57802.
Built from https://develop.svn.wordpress.org/trunk@55513


git-svn-id: http://core.svn.wordpress.org/trunk@55045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:26:22 +00:00
zieladam c80f206e94 Build/Test tools: Prevent registering the same private JavaScript API twice.
This sets the IS_WORDPRESS_CORE global variable to true in the webpack build script to enable extra safeguards around private JavaScript APIs.

Props costdev, hellofromTonya, gziolo, peterwilsoncc.
Fixes #57795.

Built from https://develop.svn.wordpress.org/trunk@55512


git-svn-id: http://core.svn.wordpress.org/trunk@55044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 12:37:24 +00:00
Sergey Biryukov e636fcd30c Coding Standards: Use strict comparison in `wp-admin/includes/taxonomy.php`.
Follow-up to [4490], [9481], [55190].

Props ankitmaru, costdev, dhrumilk.
Fixes #57859.
Built from https://develop.svn.wordpress.org/trunk@55511


git-svn-id: http://core.svn.wordpress.org/trunk@55043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 07:04:20 +00:00
desrosj e296294486 Build/Test Tools: Add the `workflow_dispatch` event to the performance workflow.
This allows workflow runs to be initiated through the GitHub API.

Follow up to [55507].

See #57687.
Built from https://develop.svn.wordpress.org/trunk@55508


git-svn-id: http://core.svn.wordpress.org/trunk@55040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 00:17:18 +00:00
desrosj 080b49902e Build/Test Tools: Test the new performance workflow regularly.
This adds the new performance measurement workflow introduced in [55459] to the one that tests old branches on a regular schedule.

This ensures it continues to work as expected over time, even if the branches with this workflow are not updated for a bit of time.

Props flixos90, joemcgill, desrosj.
See #57687.
Built from https://develop.svn.wordpress.org/trunk@55507


git-svn-id: http://core.svn.wordpress.org/trunk@55039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 00:06:19 +00:00
hellofromTonya 86580c7802 Build/Test Tools: Add 6.2 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@55506


git-svn-id: http://core.svn.wordpress.org/trunk@55038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 21:59:22 +00:00
hellofromTonya b1185f8be9 Trunk is now 6.3 alpha.
Built from https://develop.svn.wordpress.org/trunk@55505


git-svn-id: http://core.svn.wordpress.org/trunk@55037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 21:38:20 +00:00
audrasjb dc079079c0 Post WordPress 6.2 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@55503


git-svn-id: http://core.svn.wordpress.org/trunk@55035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 17:37:17 +00:00
audrasjb 1adf240bfd WordPress 6.2 RC1.
Built from https://develop.svn.wordpress.org/trunk@55502


git-svn-id: http://core.svn.wordpress.org/trunk@55034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 17:16:19 +00:00
hellofromTonya 8031a399be Editor: Combine Date template description translations.
Combine the 2 translatable strings into 1 string. Why? The example URL does not require a separate translation. Combining makes the string easier to view in context.

Follow-up to [55500].

Props SergeyBiryukov.
See #57892.
Built from https://develop.svn.wordpress.org/trunk@55501


git-svn-id: http://core.svn.wordpress.org/trunk@55033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:55:20 +00:00
hellofromTonya 230a23206d Editor: Add more details to template descriptions.
The template descriptions in `get_default_block_template_types()` are updated to add more details. Why? These descriptions are now more prominent in 6.2 to provide a better UX experience with more helpful information.

References:
* [https://github.com/WordPress/gutenberg/pull/48934 Gutenberg PR 48934]

Follow-up to [54761], [54104], [54269], [53129], [52331], [52062].

Props ntsekouras, andrewserong, bph, davidbaumwald, greenshady, glendaviesnz, hellofromTonya, jameskoster, mamaduka, peterwilsoncc, sabernhardt, SergeyBiryukov.
Fixes #57892.
Built from https://develop.svn.wordpress.org/trunk@55500


git-svn-id: http://core.svn.wordpress.org/trunk@55032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:32:19 +00:00
ryelle b16599e760 Help/About: Update copy & style for About page and subpages.
Minor copy updates. Update heading style, text size, spacing in smaller columns. Remove columns placement code to simplify CSS. This was necessary for IE11, but modern browsers can use auto-placement. Move navigation out of the banner to keep size & background placement consistent across About section.

Props marybaum, sereedmedia, annezazu, jpantani, laurlittle, richtabor, markoserb, fcoveram, joen, kebbet.
See #57477.


Built from https://develop.svn.wordpress.org/trunk@55499


git-svn-id: http://core.svn.wordpress.org/trunk@55031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:30:19 +00:00
hellofromTonya 338b45ddba Editor: Update @wordpress packages for 6.2 RC1.
Updates the `@wordpress` packages to include the following changes:

- Site Editor: Move "Add Template"'s descriptions to tooltips
- Update template descriptions with more detail
- Distraction Free Mode: Don't show the metaboxes
- Remove actions from SidebarNavigationScreenWrapper
- Fix: Navigation sidebar shows a wrong submenu popover.
- Fix: Site button metrics
- Fix navigation block off-canvas appender for empty menus
- Style Book: Move iframe to root of content area to support styles that overflow block previews
- Fix navigation block off-canvas appender for empty

Reference:
* [446428841b Package publish commit in Gutenberg]

Follow-up to [55475].

Props mamaduka.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55496


git-svn-id: http://core.svn.wordpress.org/trunk@55029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 13:55:07 +00:00
Sergey Biryukov 8743a96dfe Formatting: Restore consistent quotes in `_make_web_ftp_clickable_cb()`.
After the introduction of `_make_clickable_rel_attr()` in an earlier commit, the function ended up returning link markup with a mix of single and double quotes.

This commit ensures that `_make_web_ftp_clickable_cb()` always returns double quotes, restoring consistency with other similar callback functions used by `make_clickable()`:
* `_make_url_clickable_cb()`
* `_make_email_clickable_cb()`

Follow-up to [55289].

See #53290, #56444.
Built from https://develop.svn.wordpress.org/trunk@55495


git-svn-id: http://core.svn.wordpress.org/trunk@55028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 00:20:18 +00:00
Andrew Ozz 11d4f1b3bf Build/Test Tools: Fix cleaning of old CSS files in `wp-includes/blocks/*`. Have to be cleaned earlier, before Webpack runs. Not together with the rest of the CSS files.
Props: ironprogrammer, petitphp, hellofromTonya, azaozz.
Fixes: #57891. 
Built from https://develop.svn.wordpress.org/trunk@55494


git-svn-id: http://core.svn.wordpress.org/trunk@55027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 00:05:24 +00:00
hellofromTonya 956dd0d50c Site Editor: Revert r54860.
[54860] caused a regression. Changes to a parent theme's template part (i.e.e when a child theme does not override that template part) no longer saved in the Site Editor. Reverting the changeset resolves the regression.

Props mreishus, hellofromTonya, azaozz, ironprogrammer, antonvlasenko.

Fixes #57630.
See #55437.
Built from https://develop.svn.wordpress.org/trunk@55493


git-svn-id: http://core.svn.wordpress.org/trunk@55026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 22:45:19 +00:00
audrasjb abac5af424 Docs: Add security warning in `remove_query_arg()` docblock to make it consistent with `add_query_arg()`.
Props roytanck.
Fixes #57885.
See #56792.

Built from https://develop.svn.wordpress.org/trunk@55492


git-svn-id: http://core.svn.wordpress.org/trunk@55025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 22:19:23 +00:00
Aaron Jorbin 2f20a88190 External Libraries: Update jQuery to 3.6.4.
Update the jQuery library from 3.6.1 to 3.6.3.

[3.6.4 release announcement](https://blog.jquery.com/2023/03/08/jquery-3-6-4-released-selector-forgiveness/)
[Full changelog](https://github.com/jquery/jquery/compare/3.6.3...3.6.4)

Props TobiasBg, audrasjb, hellofromTonya.
See #57324.
Fixes 57888.


Built from https://develop.svn.wordpress.org/trunk@55491


git-svn-id: http://core.svn.wordpress.org/trunk@55024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 18:37:33 +00:00
desrosj 66ea2b293f Build/Test Tools: Update several GitHub Actions.
This updates three GitHub Actions to their latest versions:
- `shivammathur/setup-php`
- `actions/cache`
- `wow-actions/welcome`

The welcome action now uses the `GITHUB_TOKEN` by default, so it no longer needs to be passed manually.

See #57572.
Built from https://develop.svn.wordpress.org/trunk@55487


git-svn-id: http://core.svn.wordpress.org/trunk@55020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 16:35:22 +00:00
Sergey Biryukov 4711b88811 Tests: Add a unit test for `register_block_style_handle()` with an RTL locale.
The test ensures that the function loads RTL stylesheets when a locale with the right-to-left text direction is set.

Follow-up to [54330].

Props costdev, thomasplevy, audrasjb, mukesh27.
Fixes #56797.
Built from https://develop.svn.wordpress.org/trunk@55486


git-svn-id: http://core.svn.wordpress.org/trunk@55019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 15:02:18 +00:00
audrasjb 91787c363c Docs: Add missing 6.2.0 @since mention in `get_the_privacy_policy_link()`.
Follow-up to #55261.

See #56792, #56345.

Built from https://develop.svn.wordpress.org/trunk@55485


git-svn-id: http://core.svn.wordpress.org/trunk@55018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 13:36:22 +00:00
Andrew Ozz e437ae83f3 Build/Test Tools: Remove all previously built files when running `clean:files`.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.

Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.

Fixes: #47749.
Built from https://develop.svn.wordpress.org/trunk@55484


git-svn-id: http://core.svn.wordpress.org/trunk@55017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 01:03:28 +00:00
davidbaumwald 4959927285 Post WordPress 6.2 Beta 5 version bump.
Built from https://develop.svn.wordpress.org/trunk@55481


git-svn-id: http://core.svn.wordpress.org/trunk@55014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:44:18 +00:00
davidbaumwald 7f213f7829 WordPress 6.2 Beta 5.
Built from https://develop.svn.wordpress.org/trunk@55480


git-svn-id: http://core.svn.wordpress.org/trunk@55013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:23:26 +00:00
Joe McGill 01833f5fb2 Build/Test Tools: Update the URL for logging performance workflows.
This is a follow up to r55459, which fixes the hostname used for logging performance metrics by adding the correct www subdomain.

See #57687.

Built from https://develop.svn.wordpress.org/trunk@55479


git-svn-id: http://core.svn.wordpress.org/trunk@55012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:00:19 +00:00
desrosj 1ee2032699 Bundled Themes: Add missing trailing `/` in HelpHub links.
HelpHub links without trailing slashes with anchors present result in an unnecessary redirect.

These were introduced with the `/` missing in [55476].

Props audrasjb.
See #57689, #57726.
Built from https://develop.svn.wordpress.org/trunk@55478


git-svn-id: http://core.svn.wordpress.org/trunk@55011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:50:18 +00:00
hellofromTonya 2257e9b451 HTML API: Document shorthand usage of the next_tag().
Documents the shorthand usage, i.e. `$this->next_tag( 'img' )`, of `WP_HTML_Tag_Processor::next_tag()`.

Also includes table alignments and formatting adjustments in the class docs.

Follow-up to [55203], [55206].

Props zieladam, poena, dmsnell, costdev, hellofromTonya.
Fixes #57863.
See #57575.
Built from https://develop.svn.wordpress.org/trunk@55477


git-svn-id: http://core.svn.wordpress.org/trunk@55010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:48:21 +00:00
desrosj 741c88b2ef Bundled Themes: Bump version numbers for WordPress 6.2.
In coordination with the release of 6.2, a new version of each bundled theme will also be released. This bumps the version of each theme to the following:

- Twenty Ten: 3.8
- Twenty Eleven: 4.3
- Twenty Twelve: 3.9
- Twenty Thirteen: 3.8
- Twenty Fourteen: 3.6
- Twenty Fifteen: 3.4
- Twenty Sixteen: 2.9
- Twenty Seventeen: 3.2
- Twenty Nineteen: 2.5
- Twenty Twenty: 2.2
- Twenty Twenty-One: 1.8
- Twenty Twenty-Two: 1.4
- Twenty Twenty-Three: 1.1

Props robinwpdeveloper, costdev, audrasjb, sabernhardt, desrosj.
Fixes #57689.
Built from https://develop.svn.wordpress.org/trunk@55476


git-svn-id: http://core.svn.wordpress.org/trunk@55009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:27:18 +00:00
hellofromTonya 67abdca2cc Editor: Update @wordpress packages for 6.2 Beta 5.
Updates the `@wordpress` packages to include the following changes:

- Add border radius to off canvas navigation menu items
- Remove border from quick inserter child elements
- Show variant patterns even if there are no patterns for the Query Loop block
- Order initial block items in Navigation with PrivateInserter
- Update: Add descriptions to all panels in the Site Editor's dark side
- Fix typo in template parts description
- Fix: Browse mode descriptions margin
- Fix: Show creation popover on empty page links in the navigation sidebar
- Make sure the directly inserted block in the Nav block is a Page link
- Fix browser history when synchronising state with urls
- Navigation Sidebar: Change the logic about which navigation gets selected for the sidebar
- Fixes extra UI in navigation block inspector
- Renames parent selection boolean param and improves docs
- Widget Importer: Fix Widget Group block imports
- Don't add Post Content layout styles to title in the post editor
- Site editor: Add hover animation to site editor canvas
- Prevent the saving button from showing when renaming templates
- Navigation Block: Fix big spinner
- Navigation: Don't save the level of the link in an attribute
- Focus 1st parent block on block remove, if no previous block is available
- Navigation: Performance: improve params in `block_core_navigation_get_most_recently_published_navigation()`
- Navigation Block inspector: fix link UI popover opening on links that have a url
- Fix for `WP_Theme_JSON_Resolver::get_merged_data()`
- Site Editor: Add page details when viewing a specific page.
- Fix site editor sidebar scrollbars
- Fix: Custom link UI does appears outside canvas on the sidebar navigation
- Fix: Make navigation page list load its items on navigation sidebar

References:
* [d14fea64bd Gutenberg's commit for publishing the packages]
* [dbe47a5e8f Gutenberg's commit for `blocks/navigation-link.php` and `blocks/navigation-submenu.php`]
* [ea74a306e5 Gutenberg's commit for `blocks/navigation.php`]

Follow-up to [55441], [55440].

Props ntsekouras, mamaduka, gziolo, costdev, hellofromTonya.
See #57471. 
Built from https://develop.svn.wordpress.org/trunk@55475


git-svn-id: http://core.svn.wordpress.org/trunk@55008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 15:31:49 +00:00
audrasjb c41d5e69d3 Media: Revert `wp_ajax_save_attachment_updated` hook.
This changeset removes the `wp_ajax_save_attachment_updated` hook by reverting [55106], [55111], and [55450], to give it more time for further discussions as there are still concerns about whether this hook is necessary.

Follow-up to [55106], [55111], [55450].

Props costdev, SergeyBiryukov, peterwilsoncc, azaozz.
See #23148.

Built from https://develop.svn.wordpress.org/trunk@55474


git-svn-id: http://core.svn.wordpress.org/trunk@55007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 13:13:22 +00:00
Sergey Biryukov 3958c2b23b Build/Test Tools: Check if the Docker is available when running `npm run env:start`.
This aims to display a more helpful error message if the Docker service is not running.

Follow-up to [45783], [45819].

Props mkox, cnspecialcolor, pento, hasanuzzamanshamim, bgoewert, robinwpdeveloper, costdev, mukesh27.
Fixes #51898.
Built from https://develop.svn.wordpress.org/trunk@55473


git-svn-id: http://core.svn.wordpress.org/trunk@55006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 09:09:17 +00:00
audrasjb dac1d3fb8d Bundled Themes: Improve various globals documentation, as per docblock standards.
Props viralsampat, audrasjb, costdev.
See #56792, #57069.

Built from https://develop.svn.wordpress.org/trunk@55472


git-svn-id: http://core.svn.wordpress.org/trunk@55005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 08:30:17 +00:00
Peter Wilson 14801a97a5 Build/Tests Tools: Add unit tests for Gallery blocks.
Introduces unit tests for the following blocks

* Gallery block with caption
* Gallery block, deprecations 1 thru 7

Updates the unit tests for the following blocks to match the counterparts stored in the Gutenberg repository:

* Gallery block
* Gallery block with columns

Modifies `Tests_Blocks_Render::test_do_block_output()` to ignore white space at the end of lines to account for whitespace equivalence in HTML.

Props peterwilsoncc, isabel_brison, gziolo.
Fixes #55571.


Built from https://develop.svn.wordpress.org/trunk@55471


git-svn-id: http://core.svn.wordpress.org/trunk@55004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 05:48:17 +00:00
Adam Silverstein a6c33c8a3b Media: improve display of cropped image in media editor.
Correctly display edits after you crop an image and return to the attachments page. 

Prefer the `full` over the `large` size image on the edit image screen.

Props andy786, antpb, sanketchodavadiya, antonvlasenko, ironprogrammer.
Fixes #55070.


Built from https://develop.svn.wordpress.org/trunk@55470


git-svn-id: http://core.svn.wordpress.org/trunk@55003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 04:47:22 +00:00
hellofromTonya 39308664bf HTML API: Fix finding RCData and Script tag closers.
Fixes finding the following tag closers `</script>`, `</textarea>`, and `</title>` in `WP_HTML_Tag_Processor`.

Follow-up to [55407], [55203].

Props zieladam, dmsnell, hellofromTonya.
Fixes #57852.
See #57575.
Built from https://develop.svn.wordpress.org/trunk@55469


git-svn-id: http://core.svn.wordpress.org/trunk@55002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 18:55:21 +00:00
hellofromTonya c2cd23a06b Tests: Use assertSame() in Tests_Theme_wpThemeJson.
Change from assertEquals() to assertSame(). Why? To ensure both the return value and data type match the expected results.

Follow-up to [55216].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800, #57621.
Built from https://develop.svn.wordpress.org/trunk@55468


git-svn-id: http://core.svn.wordpress.org/trunk@55001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 17:46:21 +00:00
hellofromTonya e4402cfe1a Tests: Improve Tests_Media::test_wp_generate_attachment_metadata_doesnt_generate_sizes_for_150_square_image().
Changes:

* from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

* the expected height and width from `string` to `integer` data types. Why integer? `getimagesize()` (within `wp_getimagesize()`) will return an integer for both height and weight.

* adds the ticket annotation.

* adds assertion failure messages. Why? To denote which assertion failed, which aids in debugging efforts.

Follow-up to [55278].

Props costdev, peterwilsoncc, mukesh27, ankitmaru, hellofromTonya.
See #56800, #57370.
Built from https://develop.svn.wordpress.org/trunk@55467


git-svn-id: http://core.svn.wordpress.org/trunk@55000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 16:29:21 +00:00
hellofromTonya a7a66100ff Build/Test Tooling: Use `assertSame()` in Tests_Comment::test_update_comment_from_privileged_user_by_privileged_user().
Change from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

Follow-up to [c].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800.
Built from https://develop.svn.wordpress.org/trunk@55466


git-svn-id: http://core.svn.wordpress.org/trunk@54999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 15:03:17 +00:00
hellofromTonya 1fd3cfa2c2 Build/Test Tooling: Use `assertSame()` in `WP_Date_Query` tests.
Change from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

Follow-up to [54530].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800.
Built from https://develop.svn.wordpress.org/trunk@55465


git-svn-id: http://core.svn.wordpress.org/trunk@54998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 14:46:20 +00:00
Sergey Biryukov 961e38f063 Tests: Move some data providers in `Tests_Functions` next to the tests they are used in.
Includes renaming some data provider methods to use the `data_` prefix for consistency.

Follow-up to [36832], [40124], [40397], [50810], [53457].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55464


git-svn-id: http://core.svn.wordpress.org/trunk@54997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 13:10:19 +00:00
Sergey Biryukov 37d9040897 Tests: Adjust the expected mime type for WOFF fonts on PHP 8.1.12+.
As of PHP 8.1.12, which includes libmagic/file update to version 5.42, the expected mime type for WOFF files has changed to `font/woff`, so the type needs to be adjusted accordingly in `wp_check_filetype_and_ext()` tests.

References:
* [https://github.com/php/php-src/issues/8805 php-src: #8805: finfo returns wrong mime type for woff/woff2 files]
* [https://www.php.net/ChangeLog-8.php#8.1.12 PHP 8.1.12 changelog]

Follow-up to [40124], [54508], [54509], [54724].

Props costdev, SergeyBiryukov.
Fixes #56817.
Built from https://develop.svn.wordpress.org/trunk@55462


git-svn-id: http://core.svn.wordpress.org/trunk@54995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 12:41:23 +00:00
Sergey Biryukov aa10c88a86 Docs: Use the new `/documentation/` URL for HelpHub link in `readme.html`.
Follow-up to [55412], [55413], [55414], [55415], [55416], [55431], [55432], [55434].

See #57726.
Built from https://develop.svn.wordpress.org/trunk@55461


git-svn-id: http://core.svn.wordpress.org/trunk@54994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-05 00:52:19 +00:00
Sergey Biryukov 2f87b14d11 Tests: Make sure the correct query is tested for term limits in taxonomy queries.
By hooking into `terms_pre_query` after the fixture posts and terms are created but before the actual taxonomy query runs, we ensure that the correct SQL query from `WP_Term_Query::get_terms()` is tested for requested term limits, rather than the one initiated from `wp_insert_post()` or `wp_insert_term()` via `term_exists()`.

Follow-up to [52921], [53037].

Props david.binda.
Fixes #57342.
Built from https://develop.svn.wordpress.org/trunk@55460


git-svn-id: http://core.svn.wordpress.org/trunk@54993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-04 11:52:22 +00:00
Joe McGill 53fcd4bacb Build/Test Tools: Add a performance measurement workflow.
This adds a new GitHub Action workflow that measures a set of performance metrics on every commit, so we can track changes in the performance of WordPress over time and more easily identify changes that are responsible for significant performance improvements or regressions during development cycles.

The workflow measures the homepage of a classic theme (Twenty Twenty-One) and a block theme (Twenty Twenty-Three) set up with demo content from the Theme Test Data project. Using the e2e testing framework, it makes 20 requests and records the median value of the following Server Timing metrics, generated by an mu-plugin installed as part of this workflow:

- Total server response time
- Server time before templates are loaded
- Server time during template rendering

In addition to measuring the performance metrics of the current commit, it also records performance metrics of a consistent version of WordPress (6.1.1) to be used as a baseline measurement in order to remove variance caused by the GitHub workers themselves from our reporting.

The measurements are collected and displayed at https://www.codevitals.run/project/wordpress.

Props adamsilverstein, mukesh27, flixos90, youknowriad, oandregal, desrosj, costdev, swissspidy.
Fixes #57687.

Built from https://develop.svn.wordpress.org/trunk@55459


git-svn-id: http://core.svn.wordpress.org/trunk@54992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-03 20:39:20 +00:00