46777 Commits

Author SHA1 Message Date
Joe McGill
b1b94c156b WordPress 6.1.5.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@57435 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-30 16:35:32 +00:00
Aaron Jorbin
7525441605 Grouped Backports to the 6.1 branch
- Install: When populating options, maybe_serialize instead of always serialize.
- Uploads: Check for and verify ZIP archives.

Merges [57388] and [57389] to the 6.1 branch.

Props costdev, peterwilsoncc, azaozz, tykoted, johnbillion, desrosj, afragen, jorbin, xknown.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@57394 602fd350-edb4-49c9-b593-d223f7449a82
2024-01-30 14:37:21 +00:00
Jonathan Desrosiers
533a75e38b Build/Test Tools: Change the default value of LOCAL_PHP.
This changes the default value for `LOCAL_PHP` in the 6.1 branch from `latest` to `8.2-fpm` to reflect the highest version of PHP this branch will support (with beta support).

After this change, future updates to the `latest` container built and published by the `wpdev-docker-images` repository will not cause failures in this branch.

This also pins the version of PHP used in the E2E test workflow to PHP 8.0 to avoid deprecated notices mostly related to #54504, which were not fixed until version 6.2.

Follow up to [57198], [57199], [57200], [57201], [57202].

See #60095.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@57205 602fd350-edb4-49c9-b593-d223f7449a82
2023-12-19 14:26:35 +00:00
Jb Audras
7aa07cb51a WordPress 6.1.4.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@56893 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-12 15:47:21 +00:00
Joe McGill
29be931894 Grouped backports to the 6.1 branch.
- REST API: Limit `search_columns` for users without `list_users`.
- Comments: Prevent users who can not see a post from seeing comments on it.
- Application Passwords: Prevent the use of some pseudo protocols in application passwords.
- Restrict media shortcode ajax to certain type
- REST API: Ensure no-cache headers are sent when methods are overriden.
- Prevent unintended behavior when certain objects are unserialized.

Merges [56833], [56834], [56835], [56836], [56837], and [56838] to the 6.1 branch.
Props xknown, jorbin, Vortfu, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, martinkrcho, paulkevan, dd32, antpb, rmccue.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@56867 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-12 14:54:10 +00:00
Jonathan Desrosiers
4930656ab8 WordPress 6.1.3.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55834 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-20 04:11:32 +00:00
Jonathan Desrosiers
e45d1dbdd9 Editor: Restore shortcode support for block templates.
Follow up to [55761].

Props youknowriad, Clorith, desrosj, antpb, Otto42, johnbillion, jorbin, rmccue, timothyblynjacobs, mikeschroder, peterwilsoncc, audrasjb, matveb, noisysocks, xknown, ehtis, isabel_brison, talldanwp, gziolo, chriscct7, davidbaumwald.
Merges [55828] to the 6.1 branch.
See #58333.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55830 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-20 04:02:09 +00:00
Jb Audras
8768607685 Grouped backports to the 6.1 branch.
- Media: Prevent CSRF setting attachment thumbnails.
- Embeds: Add protocol validation for WordPress Embed code.
- I18N: Introduce sanitization function for locale.
- Editor: Ensure block comments are of a valid form.
- Editor: Remove shortcode support from block templates.

Merges [55760-55764] to the 6.1 branch.
Props dd32, isabel_brison, martinkrcho, matveb, ocean90, paulkevan, peterwilsoncc, timothyblynjacobs, xknown, youknowriad.



git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55771 602fd350-edb4-49c9-b593-d223f7449a82
2023-05-16 15:13:50 +00:00
Jonathan Desrosiers
8a8e6cf1a8 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.

Merges [55487] to the 6.1 branch.
See #57572.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55489 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 16:40:28 +00:00
Jonathan Desrosiers
bc49aff127 Build/Test Tools: Update third-party welcome Action.
This updates the third-party action used to post a welcome message to pull requests opened by first time contributors.

This release updates the action to use Node.js version 16 instead of 12, the latter of which support has been deprecated for in GitHub Action runners.

The action has also changed from `bukboo/welcome-action` to `wow-action/welcome`.

Merges [54651] to the 6.1 branch.
See #56793.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55488 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-08 16:38:30 +00:00
Sergey Biryukov
5eefddf4af 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.
Merges [55462] to the 6.1 branch.
Fixes #56817.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55463 602fd350-edb4-49c9-b593-d223f7449a82
2023-03-06 12:51:40 +00:00
Sergey Biryukov
7c965e781f Media: Revert [55348] from the 6.1 branch.
This will be committed to trunk instead.

See #52569.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55403 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-22 14:19:26 +00:00
Peter Wilson
2f8f1fc795 I18N: Add new strings to about.php for use with end-of-life updates.
This changeset adds two additional translation strings in the changelog file, for use when releasing the final version of WordPress on a particular branch.

Props peterwilsoncc, audrasjb, mukesh27.
Merges [55350] to the 6.1 branch.
Fixes #57216.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55371 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-21 02:34:52 +00:00
Jonathan Desrosiers
73f7aa4a14 Build/Test Tools: Backport updates to GitHub Actions.
This backports updates to GitHub Actions workflows required to address deprecated notices related to `save-output` and `set-output`.

Merges [54650], [54750], [54851], [54852], [54856], and [55152] to the 6.1 branch.
See #56882, #56820.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55357 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-17 07:51:16 +00:00
Anthony Burchell
a8fd670237 Media: Add setImagickTimeLimit() function to avoid timeout in Imagick operations.
Previously, Imagick operations could silently error by timeout and produce unexpected results. The new `setImagickTimeLimit()` function will better handle garbage collection in these cases as well as better align Imagick's timeout with PHP timeout, assuming it is set.

Props drzraf, audrasjb, costdev.
Fixes #52569.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55348 602fd350-edb4-49c9-b593-d223f7449a82
2023-02-15 21:30:20 +00:00
Peter Wilson
28f10e4af5 Built/Test tools, HTTP API: Refactor test for multiple location headers.
Remove wordpress.org as an external dependency testing `WP_HTTP::handle_redirects()`.

This refactors and reenables an existing test to call the `WP_HTTP::handle_redirects()` method directly with a mocked array of HTTP headers containing multiple location headers.

The test is moved from the external-http group to the http test group as it no longer makes an HTTP request.

Follow up to [54955].

Props SergeyBiryukov, dd32, peterwilsoncc.
Merges [54968] to the 6.1 branch.
Fixes #57306.
See #56793.



git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54974 602fd350-edb4-49c9-b593-d223f7449a82
2022-12-15 04:18:48 +00:00
Jonathan Desrosiers
31f313e711 Upgrade/Install: Remove bundled theme files from $_old_files.
Because themes are updated independently of Core updates, any deleted files from bundled themes should not be included in the `$_old_files` list.

Any file included in this list is deleted on update, which could cause problems for sites with a given theme active if the removed files were required in earlier versions of that theme and that theme is not updated at the same time.

Props desrosj, costdev, SergeyBiryukov.
Merges [54849] to the 6.1 branch.
Fixes #56936.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54966 602fd350-edb4-49c9-b593-d223f7449a82
2022-12-13 18:50:39 +00:00
Dominik Schilling
9690aa7f7b Revert [54892] from the 6.1 branch.
This will be added again once committed to trunk first.

See #57163.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54893 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-29 20:25:02 +00:00
Dominik Schilling
a662739940 Query: Account for primed post caches without primed post meta/term caches.
In [54352] `update_post_caches()` was replaced by `_prime_post_caches()` to reduce excessive object cache calls. That's because `_prime_post_caches()` checks first if post IDs aren't already cached. Unfortunately this becomes an issue if a post itself is cached but not the meta/terms.
To fix this regression, `_prime_post_caches()` now always calls `update_postmeta_cache()` and `update_object_term_cache()` depending on the arguments passed to it. Both functions internally check whether IDs are already cached so the fix from [54352] remains in place.

Props peterwilsoncc, spacedmonkey, ocean90.
Fixes #57163.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54892 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-29 20:09:24 +00:00
Sergey Biryukov
360f6ed32d Coding Standards: Correct the deprecation version for _filter_query_attachment_filenames().
Follow-up to [54524].

Props jrf.
Merges [54878] to the 6.1 branch.
See #56791.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54879 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-26 16:23:49 +00:00
Jonathan Desrosiers
f2a5690c4e Post WordPress 6.1.1 version bump.
The 6.1 branch is now `6.1.2-alpha`.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54847 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-15 19:56:15 +00:00
Jonathan Desrosiers
41e3d9cde9 WordPress 6.1.1.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54845 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-15 18:57:15 +00:00
Jonathan Desrosiers
a945fbbd31 Help/About: Use the correct comment for translators.
Follow up to [54843].

Unprops desrosj.
Props SergeyBiryukov.
See #57119.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54844 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-15 18:48:29 +00:00
Jonathan Desrosiers
23c61cead9 Help/About: Update the About page for 6.1.1.
Props jeffpaul.
Fixes #57119.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54843 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-15 18:43:34 +00:00
Jonathan Desrosiers
900165c10c Upgrade/Install: Delete the comments-query-loop folder in wp-includes/blocks.
This properly deletes the now empty `src/wp-includes/blocks/comments-query-loop` directory and adds that directory to the `$_old_files` array.

The files in this directory were removed in [54257], but the directory was not marked as deleted in SVN.

Props azaozz, jorbin, SergeyBiryukov.
Merges [54836] to the 6.1 branch.
Fixes #57080.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54837 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-14 18:31:56 +00:00
Sergey Biryukov
ed90b47db9 Tests: Resolve WP_Query test failures on MariaDB due to indeterminate sort order.
[54768] added a few tests to verify that caching within `WP_Query` is bypassed when the `SELECT` clause has been modified via a filter, to avoid cache key collisions and the returning of incomplete or unexpected results.

However, creating several posts with the same date/time fields can result in inconsistent sort ordering between MySQL and MariaDB, as each engine refines the order further using a different index.

This commit aims to stabilize the tests by using `assertEqualSets()` instead of `assertEquals()`, since testing the order is out of their scope. Includes removing `array_unshift()` and `array_reverse()` calls as no longer needed.

This resolves a few test failures on MariaDB along the lines of:
{{{
Tests_Query_FieldsClause::test_should_limit_fields_to_id_and_parent_subset
Posts property for first query is not of expected form.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => stdClass Object (
-        'ID' => 36019
+        'ID' => 36015
         'post_parent' => 0
     )
     1 => stdClass Object (
-        'ID' => 36018
+        'ID' => 36016
         'post_parent' => 0
     )
     2 => stdClass Object (...)
     3 => stdClass Object (
-        'ID' => 36016
+        'ID' => 36018
         'post_parent' => 0
     )
     4 => stdClass Object (
-        'ID' => 36015
+        'ID' => 36019
         'post_parent' => 0
     )
 )

/tmp/wp-test-runner/tests/phpunit/tests/query/fieldsClause.php:67
/tmp/wp-test-runner/phpunit-5.7.phar:598
}}}

Follow-up to [54768].

Props peterwilsoncc, SergeyBiryukov.
Merges [54829] to the 6.1 branch.
Fixes #57012.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54830 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-12 15:25:57 +00:00
Jonathan Desrosiers
57727f26a0 Post WordPress 6.1.1 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54828 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 18:39:22 +00:00
Jonathan Desrosiers
7ee5fb107c WordPress 6.1.1 RC1.
git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54827 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 18:19:48 +00:00
Jonathan Desrosiers
96eb83db8e Coding Standards: Apply spacing changes after composer format.
Follow up to [54817].

Merges [54824] to the 6.1 branch.
See #57057.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54826 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:55:30 +00:00
Jonathan Desrosiers
43e21c29f9 Editor: Improve how min/max font sizes are calculated for fluid typography.
- Where no fluid max values are set (e.g., single or custom font size values), the "size" value will act as the maximum value in a `clamp()` function.
- In the absence of any fluid `min`/`max` values, the lower bound rule of `>16px` will be enforced. This applies to custom values from the editor or single-value `theme.json` styles. Font sizes below this will not be clamped.
- In a preset, if a `fluid.min` value has been specified, the lower bound rule of `>16px` won't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.
- In a preset, if there is NOT a `fluid.max` but there is `fluid.min`, use the incoming "size" value as the `max`.
- In a preset, if there is NOT a `fluid.min` but there is a `fluid.max`, use `size * min_size_factor` as the `min`. The lower bound rule of `>16px` is enforced here, because the block editor is computing the `min` value. This is consistent with the way minimum sizes are calculated for single or custom values.


Props ramonopoly, mamaduka, andrewserong, aristath, joen, desrosj.
Merges [54823] to the 6.1 branch.
Fixes #57075.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54825 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:54:23 +00:00
Jonathan Desrosiers
66c8599abf Editor: Correctly style separator blocks when only a background-color is defined.
When separator blocks are configured using only a `background-color`, they are shown correctly within the editor but not on the front end.

This changes `WP_Theme_JSON` to detect this scenario and move the `background-color` value to just `color` when both `color` and `border-color` are missing.

Props cbravobernal, flixos90, davidbaumwald, hellofromTonya, desrosj, andrewserong, czapla, glendaviesnz, wildworks.
Merges [54821] to the 6.1 branch.
Fixes #56903.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54822 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 17:23:19 +00:00
Jonathan Desrosiers
d8712695cb Themes: Revert one instance of wp_get_theme() from [54817].
Since this specific call to `wp_get_theme()` is found within `wp-includes/blocks`, this change will need to be made upstream in the Gutenberg repository.

Merges [54819] to the 6.1 branch.
See #57057.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54820 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 16:38:03 +00:00
Jonathan Desrosiers
4344bdeb54 Themes: Reduce usage of wp_get_theme function.
Calling the `wp_get_theme` function creates a instance of the `WP_Theme` class. This can be a performance issue, if all you need is one property of the class instance. This change replaces the usage of `wp_get_theme()->get_stylesheet()` with `get_stylesheet()` to improve performance.

Props spacedmonkey, flixos90, peterwilsoncc, desrosj.
Merges [54817] to the 6.1 branch.
Fixes #57057.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54818 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 16:29:27 +00:00
Jonathan Desrosiers
1588b86d48 Filesystem: Return FTP/FTP Sockets exists() methods to a previous state.
This partially reverts [53860] and [53862], which refactored the `exists()` method to rely on `ftp_rawlist()` instead of `ftp_nlist()`.

[53860] makes a similar attempt to the ones made in [33648] and [34733] (which were also reverted in [35944]). Being compliant with the specifications while continuing to work without issue for all FTP servers continues seem impossible. These little ghosts are the ones we’re scared of the most.

Props jsh4, afragen, costdev, pkolenbr, SergeyBiryukov, dd32, peterwilsoncc, gamecreature, desrosj.
Merges [54815] to the 6.1 branch.
Fixes #56966.
See #51170, #28013.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54816 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 16:02:41 +00:00
Sergey Biryukov
ffc36e53b5 Formatting: Check that both normalizer_* functions exist in remove_accents().
This applies to:
* `normalizer_is_normalized()`
* `normalizer_normalize()`

Includes removing the `Normalizer::FORM_C` constant as a parameter, since it is the default value for both functions and does not need to be explicitly passed. This avoids a fatal error if a plugin includes polyfill for any of the functions but the `Normalizer` class has a different namespace, for example when using the Symfony polyfill.

Follow-up to [53754].

Props hellofromTonya, costdev, desrosj, mukesh27, zodiac1978, jchambo, gisgeo, SergeyBiryukov.
Merges [54813] to the 6.1 branch.
Fixes #56980.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54814 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 15:29:13 +00:00
Jonathan Desrosiers
661d9ea04c Editor: Update block editor packages to the latest patch releases.
This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.1.1.

For a full list of what’s included in this update, see 432ed388f8...6566f5fe9e.

Props aaronrobertshaw, ntsekouras, bernhard-reiter, ramonopoly, isabel_brison, andrewserong, get_dave, scruffian, andraganescu, talldanwp, mciampini, noisysocks, cbravobernal, bph, tyxla, ellatrix, czapla, mcsf, ironprogrammer, wildworks, peterwilsoncc, mamaduka, mikachan, spacedmonkey, cybr, youknowriad, alexstine, aristath, kevin940726, ndiego, 0mirka00, poena, joen, ryankienstra, desrosj, vtad, nithins53, audrasjb, kacper3355, sabernhardt.
Merges [54811] to the 6.1 branch.
Fixes #57038, #56818, #56955, #56923.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54812 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 14:54:01 +00:00
Jonathan Desrosiers
88745395b8 Menus: Apply menu-item-has-children class in sub-menus.
Ensure the `menu-item-has-children` class is added to sub-menu items when `wp_nav_menu()` is called with the `depth` parameter specified to a non-zero value.

Follow up to [54478].

Props davidvongries, fpodhorsky, hellofromTonya, innovext, larsmqller, LeonidasMilossis, mattkeys, mukesh27, nuvoPoint, ocean90, outrankjames, petitphp, SergeyBiryukov, sippis, webmandesign, peterwilsoncc.
Merges [54801] to the 6.1 branch.
Fixes #56946.
See #28620.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54809 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 02:40:54 +00:00
Jonathan Desrosiers
1760eaa601 Docs: Update comments in wp_nav_menu() tests per the documentation standards.
Includes:

- Fixing a few typos.
- Using the correct format for multi-line comments.
- Removing some comments that duplicate the assertion messages without providing any additional context. 

Follow-up to [54478].

Props SergeyBiryukov.
Merges [54741] to the 6.1 branch.
See #56792, #56946.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54808 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 02:39:20 +00:00
Jonathan Desrosiers
48f6bce9db Media: Prevent decoding attribute corrupting JSON data.
Workaround `wp_img_tag_add_decoding_attr()` potentially breaking JavaScript and JSON data by limiting the addition of the decoding attribute to image tags using unescaped double quoted attributes `src` attributes.

Props rodricus, TimothyBlynJacobs, joelmadigan, mw108, adamsilverstein, flixos90, desrosj, mukesh27, peterwilsoncc.
Merges [54802] to the 6.1 branch.
Fixes #56969.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54807 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 02:26:02 +00:00
Jonathan Desrosiers
4cd60b794e I18N: Initialize textdomain registry in wp_load_translations_early().
Initialize `WP_Textdomain_Registry` in `wp_load_translations_early()`. This ensures the global `$wp_textdomain_registry` is set up prior to loading the translations.

Props azurseisme, TimothyBlynJacobs, costdev, ocean90, flixos90, swissspidy, peterwilsoncc.
Merges [54803] to the 6.1 branch.
Fixes #57051.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54806 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 02:24:29 +00:00
Felix Arntz
bb3d335340 Editor: Improve performance of WP_Theme_JSON class by reducing usage of expensive array functions.
In many scenarios array functions are more expensive than using simpler `for` or `foreach` loops.

This changeset results in roughly 4% faster `wp_head` execution time for both block themes and classic themes. While this may seem like a small win, it is a worthwhile enhancement and only one part of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.

Props aristath, desrosj, jrf, spacedmonkey.
Merges [54804] to the 6.1 branch.
Fixes #56974.
See #57067.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54805 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-11 02:05:56 +00:00
Felix Arntz
3b454cf360 Editor: Avoid running certain logic around theme.json parsing unnecessarily for classic themes.
Here's what it does:
* Do not load and parse `theme-i18n.json` schema if the theme does not have a `theme.json` file.
* Fix the variable caching layer around the theme's `theme.json` parsing so that a parent's theme `theme.json` is cached as well.
* Do not run a `WP_Query` for global styles for a user when the theme does not have a `theme.json`.

In a basic WordPress setup, this changeset improves `wp_head` execution time for classic themes by 10%, and overall response time for both block themes and classic themes by 4%. This may seem like a small win, but 4% reduced overall response time is actually quite a bit for one change, and it is worth mentioning that this is just one of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.

Props flixos90, manuilov, oandregal, peterwilsoncc, spacedmonkey.
Merges [54799] to the 6.1 branch.
Fixes #56945.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54800 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 22:40:59 +00:00
Dominik Schilling
265e7f2207 I18N: Always pass $locale to load_textdomain().
In [53874] the optional `$locale` parameter was added to `load_textdomain()`. While most `load_textdomain()` calls in core were were updated, some were missed. Passing the original locale avoids the need to call `determine_locale()` by `load_textdomain()` which is used as a fallback.

Props ocean90, swissspidy, desrosj.
Merges [54797] to the 6.1 branch.
Fixes #57060.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54798 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 19:42:58 +00:00
Dominik Schilling
1322922ce7 I18N: Revert [54795] from the 6.1 branch.
This will be added again once committed to trunk first.

See #57060.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54796 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 19:34:13 +00:00
Dominik Schilling
94fbb44168 I18N : Always pass $locale to load_textdomain().
In [53874] the optional `$locale` parameter was added to `load_textdomain()`. While most `load_textdomain()` calls in core were were updated, some were missed. Passing the original locale avoids the need to call `determine_locale()` by `load_textdomain()` which is used as a fallback.

Props ocean90, swissspidy, desrosj.
Fixes #57060.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54795 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 19:19:11 +00:00
Jonathan Desrosiers
18ec488445 Canonical: Protect against error for term not exists queries.
Prevent term `NOT EXISTS` queries causing `redirect_canonical()` to throw a fatal error in PHP 8 and above, or a warning in earlier versions.

This ensures the `tax_query`'s `terms` property both exists and is countable before attempting to count it.

Props codesdnc, SergeyBiryukov, kadamwhite, costdev, miguelaxcar.
Merges [54785] to the 6.1 branch.
Fixes #55955.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54793 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 16:23:20 +00:00
Jb Audras
055b864ba8 Text Changes: Replace "Full site editing" with "Site Editor".
This changeset replaces the various occurrences of "Full site editing" with "Site Editor" as it is the new official name of the feature.
For more background about this change, see https://make.wordpress.org/updates/2022/11/04/site-editor-a-more-user-friendly-name/.

Props audrasjb, peterwilsoncc, poena, ocean90, Mamaduka, desrosj.
Fixes #57026.
Merges [54786], [54787], and [54788] to the 6.1 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54792 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 16:21:48 +00:00
Tonya Mork
dc1399a409 Update/Install: Deactivate Gutenberg plugin version older than 14.1.
Resolves a fatal error due to `get_template_hierarchy()` due to incompatible older Gutenberg versions.

[54269] introduced this new function for 6.1. This function was introduced in Gutenberg 13.9.0. However, it was not guarded to protect the plugin from when the function was loaded in Core. Gutenberg 14.1.0 added the `function_exists()` wrapper to protect the plugin from the fatal error.

Minimum compatible version:
This commit changes the Gutenberg minimum compatible version number to 14.1. For versions older than 14.1, the plugin will deactivate when upgrading Core to 6.1 or newer.

Function rename:
Past commits renamed the upgrade function by changing Core's version number. This commit renames the function to be generic, i.e. `_upgrade_core_deactivate_incompatible_plugins()` and adopts the `@since [reason]` strategy to track historical changes to the function. 

Follow-up to [54269], [52199], [52166], [52165], [51180].

Props namithjawahar, hellofromTonya, azaozz, desrosj, ironprogrammer.
Merges [54789] to the 6.1 branch.
Fixes #56985.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54790 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 12:37:44 +00:00
Peter Wilson
a33bfeec92 Query: Prevent ID only queries erroring when starting the loop.
Ensure only full post objects are passed to `update_post_author_caches()` when called within `WP_Query::the_post()`. This prevents an error when starting the Loop for Queries initiated with a subset of fields or IDs only.

Props konyoldeath, dd32, lozula, TimothyBlynJacobs, spacedmonkey, mxbclang, peterwilsoncc.
Merges [54771] to the 6.1 branch.
Fixes #56948.



git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54784 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 02:20:47 +00:00
Peter Wilson
ca4684a6eb Posts, Post Types: Revert get_page_by_title()'s use of WP_Query.
Revert to legacy database query in `get_pages_by_title()`. Due to the lack of `orderby` clause in the previous database query, it is not possible to gain consistent results by converting the function to a `WP_Query` wrapper.

Reverts [54271, 54242, 54234].

Props Bjorn2404, 10upsimon, dilipbheda, mukesh27, spacedmonkey, TimothyBlynJacobs, rjasdfiii, stentibbing, pbiron, pento.
Merges [54782] to the 6.1 branch.
Fixes #57039, #56991.
See #57041.



git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54783 602fd350-edb4-49c9-b593-d223f7449a82
2022-11-10 02:19:05 +00:00