The updated PHP 8.4 and 8.3 containers are running Imagick 7 which is producing some test failures for AVIFs and PNGs with 1-bit transparency. This requires further investigation, possibly accompanied by more comprehensive testing across Imagick versions, so these tests are disabled for now.
Additional missing assertions have also been added which ensure an unexpected `WP_Error` instance correctly fails the test and is not passed to an image processing function.
Props johnbillion, siliconforks, desrosj, jorbin.
See #63932
Built from https://develop.svn.wordpress.org/trunk@60736
git-svn-id: http://core.svn.wordpress.org/trunk@60072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`esc_url()` will now prepend `https://` to the URL if it does not already contain a scheme and the first item in the `$protocols` array is `'https'`.
Follow-up to [5088], [6015], [13299], [33851], [60672].
Props sabernhardt, mkaz, rachelbaker, audrasjb, costdev, aksl95, johnbillion, pcarvalho, SergeyBiryukov.
Fixes#52886.
Built from https://develop.svn.wordpress.org/trunk@60734
git-svn-id: http://core.svn.wordpress.org/trunk@60070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a follow-up to [59461] from 6.8, which leveraged `Domain Path` for just-in-time loading of MO/PHP translation files.
Now, the same is done for script translations, which means plugins/themes shipping with their own translation no longer need to manually specify the translation path when calling `wp_set_script_translations()`.
Props tusharbharti, swissspidy, shailu25, jsnajdr.
See #62244, #54797.
Fixes#63944.
Built from https://develop.svn.wordpress.org/trunk@60728
git-svn-id: http://core.svn.wordpress.org/trunk@60064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When encountering HTML tags with boolean or missing tags, the get_attribute() method in the HTML API returns true and null, respectively. If these returned values are sent directly into string comparison functions then as of PHP 8.0 they will throw E_DEPRECATED errors.
In this patch, block supports is enhanced to check that the class value is a string before it performs string operations on it.
Also in this patch: using `assertEqualHTML()` in background support test instead of `assertSame()`
Developed in https://github.com/WordPress/wordpress-develop/pull/5486
Discussed in https://core.trac.wordpress.org/ticket/59622
Props dmsnell, jonsurrell, hellofromtonya, peterwilsoncc.
Fixes#59622.
Built from https://develop.svn.wordpress.org/trunk@60727
git-svn-id: http://core.svn.wordpress.org/trunk@60063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As there's an `is_string()` check already, `! empty( $href )` can be simplified to a string comparison, as the other variable types that are checked in `empty()` won't appear.
`empty()` also returns `false` for the string `"0"` which would however be a valid (relative) URL and thus should be detectable by the function.
Follow-up to [60665].
Props TobiasBg.
Fixes#63694.
Built from https://develop.svn.wordpress.org/trunk@60726
git-svn-id: http://core.svn.wordpress.org/trunk@60062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves an error on Multisite networks where an individual site doesn't have plugins active:
{{{
array_search(): Argument #2 ($haystack) must be of type array, string given
}}}
Follow-up to [60666], [60721].
Props dd32.
See #53323.
Built from https://develop.svn.wordpress.org/trunk@60725
git-svn-id: http://core.svn.wordpress.org/trunk@60061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Specifically, this change when a network activated plugin has plugin dependencies, the disabled deactivate row action link text is changed from "Deactivate" to "Network Deactivate".
Follow-up to [57545].
Props pbiron, nikunj8866, shailu25, jjj.
Fixes#63942.
Built from https://develop.svn.wordpress.org/trunk@60723
git-svn-id: http://core.svn.wordpress.org/trunk@60059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit:
* Moves the call to `upgrade_690()` to the correct place so it actually gets called.
* Wraps Hello Dolly upgrade code in a version check per standard practice.
* Removes the `$wpdb->query()` call to avoid attempting to create the new index twice, once in the upgrade and once in `dbDelta()`.
Follow-up to [60666], [60716], [60717].
Props peterwilsoncc, mukesh27.
See #50161, #53323.
Built from https://develop.svn.wordpress.org/trunk@60721
git-svn-id: http://core.svn.wordpress.org/trunk@60057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Refactoring covered:
- Use the newly introduced `block_bindings_supported_attributes_{$block_name}` filter to register a `test/block`'s attribute as supported by Block Bindings, rather than using an actual block (Paragraph) for most tests.
- Merge three test cases that check if `get_value_callback` works correctly (accepts arguments; correctly includes symbols and numbers; return value is sanitized when rendered) into one, by using a `dataProvider`.
- Merge two test cases that check if block context is correctly evaluated, and that access is only given to context included in a source's `uses_context` property.
Follow-up to [60684].
Props bernhard-reiter, gziolo.
See #63840.
Built from https://develop.svn.wordpress.org/trunk@60720
git-svn-id: http://core.svn.wordpress.org/trunk@60056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improve the source locations referenced by developer tooling in supporting browsers. Inline source locations are named like inline:handle-js-after and appear in the developer tools "sources" panel.
This is the second attempt to add sourceURL comments. The first attempt in [60685] was reverted due to an issue with script concatenation that has been addressed.
Developed in https://github.com/WordPress/wordpress-develop/pull/9672.
Follow-up to [60685], [60690].
Props jonsurrell, westonruter, wildworks, peterwilsoncc, johnbillion, tobiasbg.
Fixes#63887.
Built from https://develop.svn.wordpress.org/trunk@60719
git-svn-id: http://core.svn.wordpress.org/trunk@60055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to improve performance of some queries on installations with a large number of posts.
Follow-up to [3678], [3690], [9290], [13576].
Props josephscott, LucasMS, Otto42, flixos90, matt, johnjamesjacoby, siliconforks, mukesh27, jonsurrell, SirLouen, SergeyBiryukov.
Fixes#50161.
Built from https://develop.svn.wordpress.org/trunk@60717
git-svn-id: http://core.svn.wordpress.org/trunk@60053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When setting the home page settings or dynamically adding new pages in the menu manager, the error messages didn't meet accessibility standards.
Add a screen reader announcement, a visible notification, and standardize the error styles.
Props dilipbheda, dlh, celloexpressions, joedolson, jeremiahbratton, shailu25.
Fixes#50696.
Built from https://develop.svn.wordpress.org/trunk@60715
git-svn-id: http://core.svn.wordpress.org/trunk@60051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After [60634], `wp_set_password` is now fired during new user creation and existing user updates when a password is changed. `wp_set_password` expects the third argument to be a `WP_User` object of the user's data prior to the update. This change simply passes the newly created `WP_User` object.
Follow-up to [60634].
Props dd32.
See #22114.
Built from https://develop.svn.wordpress.org/trunk@60712
git-svn-id: http://core.svn.wordpress.org/trunk@60048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows plugins to run custom queries only when a term count is actually updated and not on every update of terms or posts.
Follow-up to [60365], [60510].
Props leonidasmilossis, peterwilsoncc, mukesh27, rollybueno, SergeyBiryukov.
Fixes#63904.
Built from https://develop.svn.wordpress.org/trunk@60711
git-svn-id: http://core.svn.wordpress.org/trunk@60047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Page title actions were modified to match the global button styles in #41986, but these styles were not applied to mobile viewports at the time.
Fix padding, height, line-height, and alignment to match these links to global styles.
Props joedolson, rollybueno, sumitbagthariya16, circlecube, shailu25.
Fixes#63831.
Built from https://develop.svn.wordpress.org/trunk@60705
git-svn-id: http://core.svn.wordpress.org/trunk@60041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Allow scripts and script modules to be registered with a `fetchpriority` of `auto` (default), `high`, `low`:
* When registering a script, add a `fetchpriority` arg to go alongside the `strategy` arg which was added for loading scripts with the `defer` and `async` loading strategies. See #12009.
* For script modules, introduce an `$args` array parameter with a `fetchpriority` key to the `wp_register_script_module()`, and `wp_enqueue_script_module()` functions (and their respective underlying `WP_Script_Modules::register()` and `WP_Script_Modules::enqueue()` methods). This `$args` parameter corresponds with the same parameter used when registering non-module scripts.
* Also for script modules, introduce `WP_Script_Modules::set_fetchpriority()` to override the `fetchpriority` for what was previously registered.
* Emit a `_doing_it_wrong()` warning when an invalid `fetchpriority` value is used, and when `fetchpriority` is added to a script alias.
* Include `fetchpriority` as an attribute on printed `SCRIPT` tags as well as on preload `LINK` tags for static script module dependencies.
* Use a `fetchpriority` of `low` by default for:
* Script modules used with the Interactivity API. For overriding this default in blocks, see [https://github.com/WordPress/gutenberg/issues/71366 Gutenberg#71366].
* The `comment-reply` script.
* Improve type checks and type hints.
Developed in [https://github.com/WordPress/wordpress-develop/pull/8815 GitHub PR], with [https://github.com/WordPress/gutenberg/pull/70173 companion for Gutenberg].
Props westonruter, jonsurrell, swissspidy, luisherranz, kraftbj, audrasjb, dennysdionigi.
Fixes#61734.
Built from https://develop.svn.wordpress.org/trunk@60704
git-svn-id: http://core.svn.wordpress.org/trunk@60040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Several PHP functions that have not been doing anything since PHP 8.0/8.1, specifically:
* `finfo_close()` since the `ext/fileinfo` migration in PHP 8.1
* `xml_parser_free()` since the `ext/xml` migration in PHP 8.0
* `curl_close()` since the `ext/curl` migration in PHP 8.0
* `curl_share_close()` since the `ext/curl` migration in PHP 8.0
* `imagedestroy()` since the `ext/gd` migration in PHP 8.0
will be deprecated in PHP 8.5 and will thus be throwing warnings.
This commit adds conditional checks to only call these functions on the relevant PHP versions.
Reference: [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_no-op_functions_from_the_resource_to_object_conversion PHP RFC: Deprecations for PHP 8.5: Deprecate no-op functions from the resource to object conversion].
Props TobiasBg, SergeyBiryukov.
See #63061.
Built from https://develop.svn.wordpress.org/trunk@60703
git-svn-id: http://core.svn.wordpress.org/trunk@60039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As `wp_insert_post()` can return an error for various reasons, this commit ensures that this scenario is properly handled and an error message is displayed.
Follow-up to [12987].
Props rishabhwp, tfrommen, SirLouen, siliconforks, SergeyBiryukov.
Fixes#37441.
Built from https://develop.svn.wordpress.org/trunk@60701
git-svn-id: http://core.svn.wordpress.org/trunk@60037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When deleting a term using AJAX, notify screen reader users of the deletion using `wp.a11y.speak()`, set the active row to be unfocusable, then explicitly set new focus after the deletion is completed.
Props jeremyfelt, afercia, wido, nikunj8866, SirLouen, pmbaldha, joedolson.
Fixes#47101.
Built from https://develop.svn.wordpress.org/trunk@60700
git-svn-id: http://core.svn.wordpress.org/trunk@60036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MIME allows for referencing included attachments by their `Content-ID` header using the `cid` URL scheme. This can be used to embed images inline to the HTML message. For example, `<img src="cid:logo">`, will display the contents of message part with the `Content-Id: <logo>` header.
The `wp_mail()` function now supports including inline attachments through a new `$embeds` parameter. It accepts a map of `Content-ID` values to file paths. The `wp_mail_embed_args` filter can be used to customize the resulting `PHPMailer::addEmbeddedImage` method call.
Props jesin, swissspidy, chrisvendiadvertisingcom, SirLouen, mukesh27, yashjawale, iamadisingh.
Fixes#28059.
Built from https://develop.svn.wordpress.org/trunk@60698
git-svn-id: http://core.svn.wordpress.org/trunk@60034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Query-based caches are now improved by reusing cache keys. Previously, cache keys for query caches were generated using the `last_changed` value as part of the key. This meant that whenever `last_changed` was updated, all the previously cached values for the group became unreachable.
The new approach allows WordPress to replace previously cached results that are known to be stale. The previous approach relied on the object cache backend evicting stale keys which is done at various levels of efficiency.
To address this, the following new helper functions have been introduced:
* wp_cache_get_salted
* wp_cache_set_salted
* wp_cache_get_multiple_salted
* wp_cache_set_multiple_salted
These functions provide a consistent way to get/set query caches. Instead of using the last_changed value as part of the cache key, it is now stored inside the cache value as a "salt". This allows cache keys to be reused, with values updated in place rather than relying on eviction of outdated entries.
Props spacedmonkey, peterwilsoncc, flixos90, sanchothefat, tillkruess, rmccue, mukesh27, adamsilverstein, owi, nickchomey.
Built from https://develop.svn.wordpress.org/trunk@60697
git-svn-id: http://core.svn.wordpress.org/trunk@60033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This patch replaces the use of the problematic error-suppresssion operator with a specific error-handler to catch and report Unicode PCRE support without raising the related issues of error-suppression: notably conflating errors and failing to prevent completely the logging of the warnings.
In this case, the WPCS rule against using error-suppression was actually helpful in pointing out the risk, but the code was left in place with an “ignore” comment to silence the violation; this patch addresses the risk and removes the need for the comment.
Developed in https://github.com/WordPress/wordpress-develop/pull/9576
Discussed in https://core.trac.wordpress.org/ticket/63865
Follow-up to: [45611].
Props dmsnell.
Fixes#63865.
Built from https://develop.svn.wordpress.org/trunk@60694
git-svn-id: http://core.svn.wordpress.org/trunk@60030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the following third-party actions to their latest versions:
`actions/checkout` from `4.2.2` to `5.0.0`
`shivammathur/setup-php` from `2.32.0` to `2.35.3`
`actions/setup-node` from `4.3.0` to `4.4.0`
`ramsey/composer-install` from `3.1.0` to `3.1.1`
`actions/cache` from `4.2.3` to `4.2.4`
`actions/download-artifact` from `4.2.1` to `5.0.0`
`codecov/codecov-action` from `5.4.0` to `5.4.3`
`slackapi/slack-github-action` from `2.0.0` to `2.1.1`
See #63170.
Built from https://develop.svn.wordpress.org/trunk@60692
git-svn-id: http://core.svn.wordpress.org/trunk@60028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As of WordPress 6.7.0, it is possible -- e.g. for plugins -- to register block templates via a new API, `register_block_template()`. Unlike block templates loaded from theme files or from the database, however, those block templates didn't have Block Hooks applied. This changeset rectifies this inconsistency.
Props iamadisingh, aljullu, bernhard-reiter.
Fixes#63808.
Built from https://develop.svn.wordpress.org/trunk@60688
git-svn-id: http://core.svn.wordpress.org/trunk@60024 1a063a9b-81f0-0310-95a4-ce76da25c4cd