48101 Commits

Author SHA1 Message Date
Jonathan Desrosiers
25f00597ec Build/Test Tools: Update the README file to reflect new Node.js/npm versions.
Follow up to [56378].

Props dantovbein, hbhalodia.
Fixes #59071. See #56658.

git-svn-id: https://develop.svn.wordpress.org/trunk@56387 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-11 12:47:42 +00:00
Sergey Biryukov
27da228e90 Docs: Correct duplicate hook reference for wp_min_priority_img_pixels.
The original filter location is `wp_maybe_add_fetchpriority_high_attr()` in `wp-includes/media.php`.

This commit updates the instance in `wp_get_loading_optimization_attributes()` to point to the correct file.

Follow-up to [56037], [56143], [56347].

Props tmatsuur, rajinsharwar, khokansardar.
Fixes #59067.

git-svn-id: https://develop.svn.wordpress.org/trunk@56386 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-11 11:33:27 +00:00
André
92521d79e3 Themes: add wp_get_theme_data_template_parts function.
Adds a new public function, `wp_get_theme_data_template_parts` that returns the `templateParts` defined by the active theme from `theme.json`. It also substitutes the usage of private APIs by this new API.

Props felixarntz.
Fixes #59003


git-svn-id: https://develop.svn.wordpress.org/trunk@56385 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-11 11:22:54 +00:00
Sergey Biryukov
1bd3cac151 Tests: Correct two @covers annotations to use the recommended pattern.
When global functions are covered, they need to be prefixed with `::` (double colon) to distinguish them from class name.

Reference: [https://docs.phpunit.de/en/10.3/annotations.html#covers PHPUnit Manual: @covers annotation].

Follow-up to [48848], [49305], [53741], [56296].

Props ayeshrajans.
Fixes #59069.

git-svn-id: https://develop.svn.wordpress.org/trunk@56384 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-11 11:17:40 +00:00
Weston Ruter
415c9f6bb4 Embeds: Modernize wp-embed script with removal of obsolete IE10/IE11 code and support for WP<4.4.
* Remove obsolete `load` event handler in `wp-embed` since IE10+ support `DOMContentLoaded`.
* Replace obsolete use of `document.createElement('a')` in favor of the newer `URL` class (supported in all browsers but obsolete IE11).
* Remove obsolete IE10/IE11 code.
* Combine conditionals.
* Use `substring()` instead of deprecated `substr()` method.
* Eliminate the stipulation that `wp-embed.js` not include ampersands, considering this was put in place for WP<4.3 which now accounts for only 1.43% of sites. This includes the elimination of the `verify:wp-embed` grunt task.

Props westonruter, swissspidy.
Fixes #58974.


git-svn-id: https://develop.svn.wordpress.org/trunk@56383 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 19:47:08 +00:00
Felix Arntz
bb6de6b8c0 Editor: Simplify usage of block_has_support() function by supporting a string.
Most block feature checks are for a single feature string, and for such cases it is not intuitive to require an array for the `$feature` parameter of the `block_has_support()` function.

This changeset brings it in line with other functions like `post_type_supports()`, allowing to pass a string for the `$feature`. An array is still supported for more complex cases where support for sub-features needs to be determined. This change furthermore includes a very minor performance tweak by avoiding calls to the `_wp_array_get()` function if a single feature string is being checked for.

Props thekt12, nihar007, mukesh27, swissspidy.
Fixes #58532.


git-svn-id: https://develop.svn.wordpress.org/trunk@56382 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 16:47:00 +00:00
Sergey Biryukov
e5b586bfd0 Users: Correct the logic for switch_to_blog() in WP_User_Query::generate_cache_key().
If `$blog_id` equals `0`, it should be treated as the current site ID, and there is no need to switch to a different site.

This commit prevents an unnecessary call to `switch_to_blog()` on single site to avoid a fatal error when using `'orderby' => 'post_count'` and the deprecated `'who' => 'authors'` parameter:
{{{
Uncaught Error: Call to undefined function switch_to_blog() in wp-includes/class-wp-user-query.php:1077
}}}

Follow-up to [55657].

Props dd32, austinginder, RavanH, mukesh27.
Fixes #59011.

git-svn-id: https://develop.svn.wordpress.org/trunk@56381 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 10:24:29 +00:00
Bernie Reiter
37b145a0e4 HTML API: Add support for BUTTON element.
This patch adds support to process the BUTTON element. This requires adding some additional semantic rules to handle situations where a BUTTON element is already in scope.

Also included is a fixup to enforce that `WP_HTML_Processor::next_tag()` never returns for a tag closer. This is useful with the Tag Processor, but not for the HTML Processor. There were tests relying on this behavior to assert that internal processes were working as they should, but those tests have been updated to use the semi-private `step()` function, which does stop on tag closers.

This patch is one in a series of changes to expand support within the HTML API, moving gradually to allow for more focused changes that are easier to review and test. The HTML Processor is a work in progress with a certain set of features slated to be ready and tested by 6.4.0, but it will only contain partial support of the HTML5 specification even after that. Whenever it cannot positively recognize and process its input it bails, and certain function stubs and logical stubs exist to structure future expansions of support.

Props dmsnell.
Fixes #58961.

git-svn-id: https://develop.svn.wordpress.org/trunk@56380 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 08:35:55 +00:00
Sergey Biryukov
d4b496acab Docs: Remove @see references for SimplePie classes.
As SimplePie is an external library, these classes are not parsed for the WordPress Code Reference, so the `@see` tags were linking to non-existing pages.

Follow-up to [38112].

Props crstauf.
Fixes #59030.

git-svn-id: https://develop.svn.wordpress.org/trunk@56379 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-10 01:04:35 +00:00
Jonathan Desrosiers
429de7ae77 Build/Test Tools: Bump the required versions of Node.js and npm.
This changes the minimum required version of Node.js to 16.19.1, and npm to 8.19.3.

Node.js 14.x reached end of life on April 30, 2023. While 18.x is the currently active LTS version, it can’t yet be used due to a systems level constraint on the build server. 

Updating further will be considered once this blocker is resolved.

Gutenberg has also been updated to follow the same version requirements for consistency.

Props youknowriad, gziolo, swissspidy, kevin940726, desrosj.
Fixes #56658.

git-svn-id: https://develop.svn.wordpress.org/trunk@56378 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-09 18:52:42 +00:00
Sergey Biryukov
b1d59267af Coding Standards: Use strict comparison in wp-includes/kses.php.
Follow-up to [649], [2896], [3418], [8386], [20540], [47219], [54933].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56377 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-09 10:59:04 +00:00
Aaron Jorbin
f7fbd0c25f HTML API: Fix missing * for docblock.
Follow up to [56363].

Props dmsnell.
See #58918. Fixes #59010.


git-svn-id: https://develop.svn.wordpress.org/trunk@56376 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-08 22:59:52 +00:00
Felix Arntz
79a36ded52 Options, Meta APIs: Expand $autoload parameter documentation.
This changeset expands documentation of the `$autoload` parameter of the `add_option()` and `update_option()` functions, in order to provide more context on what autoloading is and which considerations should go into the decision whether to autoload an option.

Excessive autoloading of options can lead to severe performance problems on some sites, and lack of documentation is a partial cause for the issue.

Props rajinsharwar.
Fixes #58963.


git-svn-id: https://develop.svn.wordpress.org/trunk@56370 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-07 19:31:13 +00:00
David Baumwald
4ff71a6adf Upgrade/Install: Update $_old_files for 6.3.
Props SergeyBiryukov.
Fixes #58994.

git-svn-id: https://develop.svn.wordpress.org/trunk@56365 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-07 17:19:57 +00:00
Bernie Reiter
c96b089ec7 HTML API: Adjust code styling to Gutenberg's linter's preferences.
Adjust the code style according to the rules that the linting process in Gutenberg requires.

There are only a couple code changes that should have no effect on the runtime:
 - A missing check to verify that only `UTF-8` is supported has been added (brought up because it was identified as an undefined variable).
 - A few `return false;` statements have been added to avoid having the linter complain that functions don't return a value despite indicating they return `bool`. The functions are stubs for coming support and currently `throw`, so the `return` statements are unreachable.

Props dmsnell, costdev, davidbaumwald, peterwilsoncc, SergeyBiryukov.
Fixes #58918.

git-svn-id: https://develop.svn.wordpress.org/trunk@56363 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-07 13:48:55 +00:00
Sergey Biryukov
4a0712a0c2 Coding Standards: Use strict comparison in wp-includes/class-wp.php.
Includes minor code layout fixes for better readability.

Follow-up to [1043], [2534], [2584], [2627], [2958], [3252], [3564], [21818], [37356].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56362 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-07 09:59:20 +00:00
Sergey Biryukov
b4cfea6f4e Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor.php.
Follow-up to [22094].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56361 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-06 12:50:42 +00:00
Sergey Biryukov
fd846534b6 Coding Standards: Rewrite loose comparison in wp_list_categories().
A truthy check is more in line with similar checks elsewhere, including conditionals in the same exact code block.

Follow-up to [10275], [34696].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56360 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-05 14:00:56 +00:00
Sergey Biryukov
847328068d Coding Standards: Use strict comparison in wp-includes/revision.php.
Follow-up to [24414], [38118], [38433].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56359 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-04 11:56:16 +00:00
Weston Ruter
72c9909999 Emoji: Suppress console errors from sessionStorage usage in sandboxed post embed iframe.
Amends [56074].

Props westonruter, flixos90.
Fixes #58978.
See #58472.


git-svn-id: https://develop.svn.wordpress.org/trunk@56358 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-04 00:21:11 +00:00
Felix Arntz
470911715d Themes: Avoid unnecessary check whether parent template file exists when not using a child theme.
Prior to this change, the `locate_template()` function would unconditionally check whether the relevant template file exists in the parent theme, which for sites not using a child theme is an exact duplicate of the previous check. This is wasteful and has a small impact on performance since `file_exists()` checks have a cost.

Props nihar007, thekt12, spacedmonkey, mukesh27.
Fixes #58576.


git-svn-id: https://develop.svn.wordpress.org/trunk@56357 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 20:29:12 +00:00
Tonya Mork
9e4188b93b Code Modernization: Use "declare" in WP_List_Table magic methods deprecation message
Changes "define" to "declare" in the deprecation message in `WP_List_Table` magic methods.

Why is "declare" better?
It aligns well to:

* the topic of and published information about dynamic properties.
* the act of explicitly listing the variable as a property on the class.

The goal of this message is guide developers to change their code. Changing the term to "declare" hopefully will aid in the understanding of what is being asked of developers when this deprecation is thrown.

Follow-up [56349].

Props hellofromTonya, antonvlasenko.
Fixes #58896.

git-svn-id: https://develop.svn.wordpress.org/trunk@56356 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 19:50:20 +00:00
Weston Ruter
1fc10c92a2 Script Loader: Use defer loading strategy for wp-embed script and move to head (in block themes).
Props westonruter, flixos90, swissspidy.
Fixes #58931.


git-svn-id: https://develop.svn.wordpress.org/trunk@56355 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 19:20:36 +00:00
Tonya Mork
5b5d174a30 Code Modernization: Deprecate dynamic properties in WP_Text_Diff_Renderer_Table magic methods.
The unknown use of unknown dynamic property within the `WP_Text_Diff_Renderer_Table` property magic methods is now deprecated. A descriptive deprecation notice is provided to alert developers to declare the property on the child class extending `WP_Text_Diff_Renderer_Table`.

Changes in this commit:
* Adds a deprecation notice to the `__get()`, `__set()`, `__isset()`, `__unset()` magic methods, i.e. to alert and inform developers when attempting to get/set/isset/unset a dynamic property.
* Fixes `__get()` to explicitly returns `null` when attempting to get a dynamic property.
* Fixes `__set()` by removing the value return after setting a declared property, as (a) unnecessary and (b) `__set()` should return `void` [https://www.php.net/manual/en/language.oop5.overloading.php#object.set per the PHP handbook].
* Fixes `__isset()` to return `false` if not in the `$compat_fields`, as `isset()` and `__isset()` should always return `bool`:
   * [https://www.php.net/manual/en/language.oop5.overloading.php#object.isset `__isset()` in the PHP manual] 
   * [https://www.php.net/manual/en/function.isset.php `isset()` in the PHP manual] 
* Adds a test class with happy and unhappy paths for these changes.

For backward compatibility, no changes are made to the internal declared properties listed in `$compat_fields` and accessed through the magic methods. 

For example:
A child class uses a property named `$data` that is not declared as a property on the child class. When getting its value, e.g. `$user_query->data`, the `WP_Text_Diff_Renderer_Table::__get()` magic method is invoked, the following deprecation notice thrown, and `null` returned:

>The property `data` is not declared. Setting a dynamic property is deprecated since version 6.4.0! Instead, declare the property on the class.

=== Why not remove the magic methods, remove the `$compat_fields` property, and restore the properties `public`?

tl;dr Backward compatibility.

If a plugin adds a property to `$compat_fields` array, then sites using that plugin would experience (a) an `Undefined property` `Warning` (PHP 8) | `Notice` (PHP 7) and (b) a possible change in behavior.

=== Why not limit the deprecation for PHP versions >= 8.2?

tl;dr original design intent and inform

The magic methods and `$compat_fields` property were added for one purpose: to continue providing external access to internal properties declared on `WP_Text_Diff_Renderer_Table`. They were not intended to be used for dynamic properties.

Deprecating that unintended usage both alerts developers a change is needed in their child class and informs them what to change.

References: 
* Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
* A [https://www.youtube.com/live/vDZWepDQQVE?feature=share&t=10097 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 [28525], [31135].

Props antonvlasenko, rajinsharwar, jrf, markjaquith, hellofromTonya, SergeyBiryukov, desrosj, peterwilsoncc, audrasjb, costdev, oglekler, jeffpaul.
Fixes #58898.
See #56034.

git-svn-id: https://develop.svn.wordpress.org/trunk@56354 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 18:11:36 +00:00
Tonya Mork
6fe193ce54 Code Modernization: Deprecate dynamic properties in WP_User_Query magic methods.
The unknown use of unknown dynamic property within the `WP_User_Query` property magic methods is now deprecated. A descriptive deprecation notice is provided to alert developers to declare the property on the child class extending `WP_User_Query`.

Changes in this commit:
* Adds a deprecation notice to the `__get()`, `__set()`, `__isset()`, `__unset()` magic methods, i.e. to alert and inform developers when attempting to get/set/isset/unset a dynamic property.
* Fixes `__get()` to explicitly returns `null` when attempting to get a dynamic property.
* Fixes `__set()` by removing the value return after setting a declared property, as (a) unnecessary and (b) `__set()` should return `void` [https://www.php.net/manual/en/language.oop5.overloading.php#object.set per the PHP handbook].
* Fixes `__isset()` to return `false` if not in the `$compat_fields`, as `isset()` and `__isset()` should always return `bool`:
   * [https://www.php.net/manual/en/language.oop5.overloading.php#object.isset `__isset()` in the PHP manual] 
   * [https://www.php.net/manual/en/function.isset.php `isset()` in the PHP manual] 
* Adds unit tests for happy and unhappy paths.

For backward compatibility, no changes are made to the internal declared properties listed in `$compat_fields` and accessed through the magic methods. 

For example:
A child class uses a property named `$data` that is not declared as a property on the child class. When getting its value, e.g. `$user_query->data`, the `WP_User_Query::__get()` magic method is invoked, the following deprecation notice thrown, and `null` returned:

>The property `data` is not declared. Setting a dynamic property is deprecated since version 6.4.0! Instead, declare the property on the class.

=== Why not remove the magic methods, remove the `$compat_fields` property, and restore the properties `public`?

tl;dr Backward compatibility.

If a plugin adds a property to `$compat_fields` array, then sites using that plugin would experience (a) an `Undefined property` `Warning` (PHP 8) | `Notice` (PHP 7) and (b) a possible change in behavior.

=== Why not limit the deprecation for PHP versions >= 8.2?

tl;dr original design intent and inform

The magic methods and `$compat_fields` property were added for one purpose: to continue providing external access to internal properties declared on `WP_User_Query`. They were not intended to be used for dynamic properties.

Deprecating that unintended usage both alerts developers a change is needed in their child class and informs them what to change.

References: 
* Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
* A [https://www.youtube.com/live/vDZWepDQQVE?feature=share&t=10097 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.]

Related to #14579, #27881, #30891.

Follow-up to [15491], [28528], [31144].

Props antonvlasenko, rajinsharwar, jrf, markjaquith, hellofromTonya, SergeyBiryukov, desrosj, peterwilsoncc, audrasjb, costdev, oglekler, jeffpaul.
Fixes #58897.
See #56034.

git-svn-id: https://develop.svn.wordpress.org/trunk@56353 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 16:25:25 +00:00
Sergey Biryukov
b92491b8d2 Coding Standards: Use instanceof keyword instead of the is_a() function.
This is a micro-optimization that removes a few unnecessary function calls.

Follow-up to [31188], [34369], [38986], [41159], [43211], [43230], [44606], [45757].

Props ayeshrajans, jrf, rajinsharwar, costdev, mukesh27, SergeyBiryukov.
Fixes #58943.

git-svn-id: https://develop.svn.wordpress.org/trunk@56352 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 12:08:30 +00:00
Isabel Brison
f8b4e2c184 Build/Test Tools: revert downgrade of uuid.
Reverts the accidental downgrade of uuid in [56065] by changing it back to 9.0.0.

Props Hareesh Pillai, JeffPaul, audrasjb.
Fixes #58623.


git-svn-id: https://develop.svn.wordpress.org/trunk@56350 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-03 04:57:04 +00:00
Tonya Mork
c362c2ad99 Code Modernization: Deprecate dynamic properties in WP_List_Table magic methods.
The unknown use of unknown dynamic property within the `WP_List_Table` property magic methods is now deprecated. A descriptive deprecation notice is provided to alert developers to declare the property on the child class extending `WP_List_Table`.

Changes in this commit:
* Adds a deprecation notice to the `__get()`, `__set()`, `__isset()`, `__unset()` magic methods, i.e. to alert and inform developers when attempting to get/set/isset/unset a dynamic property.
* Fixes `__get()` to explicitly returns `null` when attempting to get a dynamic property.
* Removes returning the value when setting a declared property, as (a) unnecessary and (b) `__set()` should return `void` [https://www.php.net/manual/en/language.oop5.overloading.php#object.set per the PHP handbook].
* Adds unit tests for happy and unhappy paths.

For backward compatibility, no changes are made to the internal declared properties listed in `$compat_fields` and accessed through the magic methods. 

For example:
A child class uses a property named `$data` that is not declared / defined as a property on the child class. When getting its value, e.g. `$list_table->data`, the `WP_List_Table::__get()` magic method is invoked, the following deprecation notice thrown, and `null` returned:

>The property `data` is not defined. Setting a dynamic (undefined) property is deprecated since version 6.4.0! Instead, define the property on the class.

=== Why not remove the magic methods, remove the `$compat_fields` property, and restore the properties `public`?

tl;dr Backward compatibility.

Several plugins, one of which has over 5M installs, add a property to the `$compat_fields` array. Removing the property would cause an `Undefined property` `Warning` (PHP 8) | `Notice` (PHP 7) to be thrown. Removing the associated code would change the functionality.

=== Why not limit the deprecation for PHP versions >= 8.2?

tl;dr original design intent and inform

The magic methods and `$compat_fields` property were added for one purpose: to continue providing external access to internal properties declared on `WP_List_Table`. They were not intended to be used for dynamic properties.

Deprecating that unintended usage both alerts developers a change is needed in their child class and informs them what to change.

References: 
* Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
* A [https://www.youtube.com/live/vDZWepDQQVE?feature=share&t=10097 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.]

Related to #14579, #22234, #30891.

Follow-up to [15491], [28493], [28521], [28524], [31146].

Props antonvlasenko, jrf, markjaquith, hellofromTonya, SergeyBiryukov, desrosj, peterwilsoncc, audrasjb, costdev, oglekler, jeffpaul.
Fixes #58896.
See #56034.

git-svn-id: https://develop.svn.wordpress.org/trunk@56349 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-02 18:35:24 +00:00
Tonya Mork
88570fd5b3 Tests: Fix leakage in WP_List_Table tests.
Fixes `WP_List_table` tests leaking into other tests by:

* Restores the original `$hook_suffix` global value.
Rather than modifying the global for all tests, it now restores the original value between tests. Why? To ensure each test starts at a known state.

* Uses a new instance of `WP_List_Table` for each test.
A test may modify the `$list_table` object. If it does, it could impact tests yet to run. By instantiating a new instance in the `set_up()` test fixture, each test is isolated from the others.

Follow-up to [53868], [54215].

Props hellofromTonya, antonvlasenko.
See #58955, #58896.

git-svn-id: https://develop.svn.wordpress.org/trunk@56348 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-02 17:58:18 +00:00
Felix Arntz
02f9f1ea95 Media: Simplify logic in wp_get_loading_optimization_attributes().
While the `wp_get_loading_optimization_attributes()` function was only recently introduced in 6.3, its code was mostly ported over from the now deprecated `wp_get_loading_attr_default()` function introduced in 5.5.

That function started out in a simple way, but over time was expanded with more and more conditionals on when to avoid lazy-loading, which ended up making the logic extremely complex and hard to follow.

This changeset refactors the logic to simplify it, in a way that allows to follow it more sequentially, and without making any functional changes, ensuring that the extensive existing unit test coverage still passes. This will facilitate future enhancements to the function to be less error-prone and make it more accessible to new contributors.

Props flixos90, joemcgill.
Fixes #58891.


git-svn-id: https://develop.svn.wordpress.org/trunk@56347 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-02 17:56:16 +00:00
Sergey Biryukov
3a3bd8ea83 Site Health: Use PHP_SAPI constant instead of the php_sapi_name() function.
This is a micro-optimization that removes an unnecessary function call.

Follow-up to [44986], [45156].

Props ayeshrajans, jrf, mukesh27, rmccue.
Fixes #58942.

git-svn-id: https://develop.svn.wordpress.org/trunk@56346 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-02 10:57:10 +00:00
Felix Arntz
70bbc8dd0f Themes: Use isset instead of array_key_exists in WP_Theme_JSON class.
With the minimum PHP version requirement raised to 7.0, we can now use `isset` on constants that are arrays. Since `isset` is slightly faster than `array_key_exists` (and the different handling of `null` values is irrelevant for the updates here), remaining instances of `array_key_exists` in the `WP_Theme_JSON` class are replaced in this changeset.

Props soean.
Fixes #57067.


git-svn-id: https://develop.svn.wordpress.org/trunk@56345 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 20:29:47 +00:00
Sergey Biryukov
e39967d8dd Upgrade/Install: Pass stored credentials to WP_Filesystem() where appropriate.
With the introduction of temporary backups of plugins and themes before updating, a new Site Health test was added to verify that plugin and theme temporary backup directories are writable or can be created.

When using a non-direct filesystem, the Site Health test did not include the required credentials, leading to a fatal error as the connection was not initialized properly.

This commit attemps to use the stored credentials if available, and displays a message otherwise.

Includes a similar fix in a function that performs a cleanup of the temporary backup directory.

Follow-up to [55720].

Props utsav72640, rajinsharwar, costdev, mukesh27, peterwilsoncc, audrasjb, SergeyBiryukov.
See #58940.

git-svn-id: https://develop.svn.wordpress.org/trunk@56341 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 16:05:23 +00:00
Kelly Choyce-Dwan
54493538a8 Help/About: Add images to About page, match header style to images.
Props richtabor, markoserb, audrasjb, peterwilsoncc, mukesh27.
See #58067.



git-svn-id: https://develop.svn.wordpress.org/trunk@56339 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 15:02:08 +00:00
Jb Audras
eef800de27 Help/About: Escape "Contribute" links, for better consistency.
Props SergeyBiryukov, peterwilsoncc.
See #23348.




git-svn-id: https://develop.svn.wordpress.org/trunk@56337 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 12:56:40 +00:00
Jb Audras
eb12d31edc Help/About: Remove target="_blank" from the Contribute link.
Props davidbaumwald.
See #23348.




git-svn-id: https://develop.svn.wordpress.org/trunk@56335 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 12:48:34 +00:00
Sergey Biryukov
e1355c14ac Coding Standards: Use strict comparison in wp-includes/option.php.
Follow-up to [8784], [25109].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56333 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 10:59:34 +00:00
Isabel Brison
2e0c5a8b3a Editor: second update of npm packages for 6.3 RC3.
Includes bug fixes for footnotes, patterns, command palette, top toolbar and other small regressions.

Props andrewserong, spacedmonkey.
See #58926.



git-svn-id: https://develop.svn.wordpress.org/trunk@56332 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 07:59:33 +00:00
Bernie Reiter
41bffadb83 HTML API: Add support for SPAN element.
In this patch we're introducing support for the SPAN element, which is the first
in the class of "any other tag" in the "in body" insertion mode.

This patch introduces the mechanisms required to handle that class of tags but
only introduces SPAN to keep the change focused. With the tests and mechanisms
in place it will be possible to follow-up and add another limited set of tags.

It's important that this not use the default catch-all in the switch handling
`step_in_body` because that would catch tags that have specific rules in previous
case statements that aren't yet added. For example, we don't want to treat the
`TABLE` element as "any other tag".

Props dmsnell.
Fixes #58907.

git-svn-id: https://develop.svn.wordpress.org/trunk@56331 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 07:54:54 +00:00
Isabel Brison
39e1fb0528 Editor: fix duplication in templates list.
Excludes parent template when a child template is defined during template retrieval.

Props oandregal, mukesh27, flixos90, bgardner.
See #57756.


git-svn-id: https://develop.svn.wordpress.org/trunk@56329 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-01 02:10:08 +00:00
Jb Audras
40dd2f982a Help/About: Make Contribute links translatable.
Follow-up to [17877], [26354], [35898], [43032], [56220], [56312].

Props sereedmedia, tobifjellner, oglekler, ryelle, fierevere, davidbaumwald, audrasjb.
See #23348.




git-svn-id: https://develop.svn.wordpress.org/trunk@56327 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-31 20:21:09 +00:00
Sergey Biryukov
4569aa17ae Coding Standards: Use strict comparison in wp-includes/functions.php.
Follow-up to [5999], [6342], [7406], [8369], [10322], [11288], [11332], [11597], [12405], [13569], [14649], [15806], [19773], [26449], [26926], [39831], [40124].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56326 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-31 13:31:28 +00:00
Sergey Biryukov
c676279a14 Coding Standards: Use strict comparison in wp-includes/formatting.php.
Follow-up to [1345], [4112], [6974], [24214], [25055], [28831], [32863].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56325 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-30 08:51:37 +00:00
Sergey Biryukov
78e9478de7 Coding Standards: Use strict comparison in wp-includes/feed-atom-comments.php.
Follow-up to [9818].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56324 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-29 00:29:29 +00:00
Weston Ruter
73be6804d2 Script Loader: Delay loading comment-reply script with async loading strategy.
Props westonruter, flixos90, joemcgill, sergiomdgomes.
See #12009.
Fixes #58870.


git-svn-id: https://develop.svn.wordpress.org/trunk@56323 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-28 17:15:57 +00:00
Sergey Biryukov
d44c6e5fda Coding Standards: Use strict comparison in wp-includes/class-wp-roles.php.
Follow-up to [25695], [41625].

Props aristath, poena, afercia, SergeyBiryukov.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56321 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-28 11:35:17 +00:00
Isabel Brison
2c56eef8a1 Editor: initial update of npm packages for 6.3 RC3.
Includes bug fixes for patterns, command palette and several minor regressions.

Props ramonopoly.
See #58926.


git-svn-id: https://develop.svn.wordpress.org/trunk@56320 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-28 07:37:52 +00:00
Sergey Biryukov
8698238039 Coding Standards: Use correct case for class name in WP_Http tests.
Follow-up to [8516], [54968].

Props jrf.
See #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56319 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-27 14:45:09 +00:00
Jb Audras
12a0205829 Editor: Revert [56316].
This reverts [56316] as it needs to be fixed by updating npm packages.

Unprops audrasjb.
Props swissspidy.
See #58920.




git-svn-id: https://develop.svn.wordpress.org/trunk@56317 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-27 10:08:40 +00:00
Jb Audras
2c8315c776 Editor: Prevent PHP warning when accessing icon by area.
This changeset prevents an attempt to access an array via a key that doesn't exist.
See https://github.com/WordPress/gutenberg/pull/52961.

Props aaronrobertshaw, glendaviesnz, mukesh27.
Fixes #58920.




git-svn-id: https://develop.svn.wordpress.org/trunk@56316 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-27 09:16:53 +00:00