This extends the performance test workflow added in [55459] to also run tests against the target branch (if running on a pull request) or the previous commit (if running on trunk).
Those results are then compared with the ones from the current commit, and the difference is displayed as a GitHub Actions workflow summary for convenience.
Props mukesh27, flixos90, desrosj, joemcgill, swissspidy.
Fixes#58358, #58359.
See #56150.
git-svn-id: https://develop.svn.wordpress.org/trunk@56506 602fd350-edb4-49c9-b593-d223f7449a82
Changes fluid typography calculation to use fallback value if layout wide size is a fluid value.
Props ramonopoly, mukesh27, jastos, aurooba.
See #58754.
git-svn-id: https://develop.svn.wordpress.org/trunk@56503 602fd350-edb4-49c9-b593-d223f7449a82
Adds the ability to process block style variations to the `remove_insecure_properties` function of theme json class.
Props dsas, ramonopoly.
Fixes#59108.
git-svn-id: https://develop.svn.wordpress.org/trunk@56502 602fd350-edb4-49c9-b593-d223f7449a82
Removes the test file and `webfonts` directory for the stopgap code that was deprecated by [56500].
Follow-up to [56500], [53282].
Fixes#59165.
git-svn-id: https://develop.svn.wordpress.org/trunk@56501 602fd350-edb4-49c9-b593-d223f7449a82
Introducing Font Face, a server-side `@font-face` styles generator and printer.
tl;dr:
* Introduces Font Face.
* Deprecates `_wp_theme_json_webfonts_handler()`.
**Introduce Font Face**
From an array of fonts (i.e. each font-family and its font variations to be processed), it:
1. Validates each `font-face` declaration, i.e. the CSS property and value pairing. If validation fails, processing stops with no font-face styles printed.
3. Generates the `@font-face` CSS for each font-family.
4. Prints the CSS within a `<style id="wp-fonts-local">` element.
The entry point into Font Face is through a new global function called `wp_print_font_faces()`, which is automatically called:
* when the `'wp_head'` hook runs (for the front-end).
* when the `'admin_print_styles'` hook runs (for the back-end).
* when `_wp_get_iframed_editor_assets()` runs to inject the `@font-face` styles into the iframed editor.
Once called, it gets the fonts from Theme_JSON merged data layer, which includes theme defined fonts and user activated fonts (once the Font Library #59166 is introduced into Core).
For classic sites, themes and plugins can directly call `wp_print_font_faces()` and pass their fonts array to it for processing.
**Deprecates `_wp_theme_json_webfonts_handler()`.**
As Font Face is a direct replacement, the stopgap code in `_wp_theme_json_webfonts_handler()` (introduced in 6.0.0 via [53282]) is deprecated and unused in Core.
**Props note:**
There's a long multiple year history baked into Font Face, which dates back to the early versions of a web font API (see #46370 and [https://github.com/WordPress/gutenberg/issues/41479 roadmap]. The props list includes those who contributed from those early versions up to this commit.
**References:**
* #46370 original (Web)Fonts API proposal for registering and enqueuing web fonts.
* [https://github.com/WordPress/gutenberg/issues/41479 Gutenberg tracking issue] which includes the evolution from Webfonts API to Fonts API to Font Face.
* [53282] / #55567 Added the stopgap code `_wp_theme_json_webfonts_handler()` in 6.0.
* [https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face @font-face on mdn web docs]
* #59166 Font Library: Font manager for WordPress
Follow-up to [53282].
Props aristath, jonoaldersonwp, hellofromTonya, andraganescu, annezazu, antonvlasenko, arena, askdesign, azaozz, bph, bradley2083, colorful-tones, costdev, davidbaumwald, desrosj, dingo_d, djcowan, domainsupport, dryanpress, elmastudio, flixos90, francina, garrett-eclipse, gigitux, grantmkin, grapplerulrich, gziolo, ironprogrammer, jb510, jeffpaul, jeremyyip, jffng, joostdevalk, jorgefilipecosta, juanmaguitar, mamaduka, matveb, mburridge, mitogh, ndiego, ntsekouras, oandregal, ocean90, oglekler, paaljoachim, pagelab, peterwilsoncc, poena, priethor, scruffian, SergeyBiryukov, shiloey, simison, skorasaurus, soean, westonruter, wildworks, zaguiini.
Fixes#59165.
git-svn-id: https://develop.svn.wordpress.org/trunk@56500 602fd350-edb4-49c9-b593-d223f7449a82
PHP 8.3 is expected to be released at the end of November 2023.
Enabling the tests to run in CI on PHP 8.3 allows WordPress core to start getting ready.
Note: Xdebug-related tests will not be run on PHP 8.3 at this time as the Docker image for PHP 8.3 does not contain Xdebug yet. Once a stable release of Xdebug 3.3.0 is available, it can be added to the Docker image and the test step can then be enabled for PHP 8.3.
Follow-up to [53922], [56492], [56495].
Props jrf, costdev.
See #59231.
git-svn-id: https://develop.svn.wordpress.org/trunk@56498 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds an exception to prevent permission issues on `.docx` generated by Google Docs. This is a temporary fix for an upstream bug on the `finfo_file()`
PHP function which returns a redundant MIME type for these documents.
Props winterstreet, jakariaistauk, mujuonly, mi5t4n, annashopina, audrasjb, azaozz, mikeschroder, oglekler.
Fixes#57898.
git-svn-id: https://develop.svn.wordpress.org/trunk@56497 602fd350-edb4-49c9-b593-d223f7449a82
This changeset updates `wp_default_packages_inline_scripts()` to add relative time strings to the `wp-date` inline script, so the JS version of `human_time_diff`
can output translated strings.
Props ramonopoly, oandregal, swissspidy, manzoorwanijk, adrianduffell, Presskopp.
Fixes#59219, #47373.
git-svn-id: https://develop.svn.wordpress.org/trunk@56496 602fd350-edb4-49c9-b593-d223f7449a82
This aims to improve performance by calling `sanitize_url()` directly, instead of the `esc_url_raw()` wrapper. As of WordPress 6.1, `sanitize_url()` is the recommended function for sanitizing a URL for database or redirect usage.
This replaces the two remaining instances of `esc_url_raw()` with `sanitize_url()` in WordPress core.
Follow-up to [53455], [53933], [54522].
Props rajinsharwar, SergeyBiryukov.
Fixes#59247.
git-svn-id: https://develop.svn.wordpress.org/trunk@56494 602fd350-edb4-49c9-b593-d223f7449a82
It was a design goal of the HTML Processor to abort processing its input document when encountering unsupported markup. Unfortunately there was no test for this and so-far, the HTML Processor has paused, but continued processing in these situations.
In this patch a new test ensures that the HTML Processor stops and refuses to move forward after encountering any unsupported markup. It also ensures that it doesn't report any current tag names since unsupported markup could imply that the read tag name is different than the parsed tag name.
Props dmsnell.
Fixes#59167.
git-svn-id: https://develop.svn.wordpress.org/trunk@56493 602fd350-edb4-49c9-b593-d223f7449a82
The single parameter signature, which was used for setting the value on a static property, is deprecated since PHP 8.3. A cross-version solution is to pass `null` as the first parameter.
This commit updates all the instances that use the deprecated signature in WordPress core.
Reference: [https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue PHP RFC: Deprecate functions with overloaded signatures: ReflectionProperty::setValue()].
Follow-up to [53152], [54493], [54799].
Props jrf, costdev, Tests: Correct uses of `ReflectionProperty::setValue()` for static properties.
The single parameter signature, which was used for setting the value on a static property, is deprecated since PHP 8.3. A cross-version solution is to pass `null` as the first parameter.
This commit updates all the instances that use the deprecated signature in WordPress core.
Reference: [https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue PHP RFC: Deprecate functions with overloaded signatures: ReflectionProperty::setValue()].
Follow-up to [53152], [54493], [54799].
Props jrf, costdev, sc0ttkclark.
See #59231.
git-svn-id: https://develop.svn.wordpress.org/trunk@56492 602fd350-edb4-49c9-b593-d223f7449a82
This avoids an additional query by passing the query args directly to the `WP_Query::query()` method, rather than to the constructor and calling get_posts(), following [55569].
Props david.binda, azaozz, spacedmonkey, mukesh27, flixos90, SergeyBiryukov, joemcgill.
Fixes#59224.
git-svn-id: https://develop.svn.wordpress.org/trunk@56491 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an issue introduced in [55569] that broke sort ordering by `post_modified_gmt` or `modified_gmt`.
Props david.binda, azaozz, spacedmonkey, flixos90, joemcgill.
Fixes#59226.
git-svn-id: https://develop.svn.wordpress.org/trunk@56490 602fd350-edb4-49c9-b593-d223f7449a82
Updates the calls to permission validation calls for the `directory-sizes` and `page-cache` routes to actually match the route names.
Follow-up to r54043 and r49154.
Props szepeviktor.
Fixes#59236
git-svn-id: https://develop.svn.wordpress.org/trunk@56489 602fd350-edb4-49c9-b593-d223f7449a82
This improves the performance of inserting users as it removes one unnecessary `SELECT` query for every row of metadata inserted.
Props swissspidy, spacedmonkey, johnbillion
Fixes#59212
git-svn-id: https://develop.svn.wordpress.org/trunk@56478 602fd350-edb4-49c9-b593-d223f7449a82
The `mysql` extension is no longer used in PHP 7 or above. There's a good amount of conditional code in `wpdb` and the health checks that can be removed now that only the `mysqli` functions are used.
Fixes#59118
git-svn-id: https://develop.svn.wordpress.org/trunk@56475 602fd350-edb4-49c9-b593-d223f7449a82
Includes a few other formatting adjustments for consistency.
Follow-up to [48327], [56467], [56471].
See #58833.
git-svn-id: https://develop.svn.wordpress.org/trunk@56474 602fd350-edb4-49c9-b593-d223f7449a82
- `__construct()` gets the new `_deprecated_class()` function
- `WP_User_Search` PHP4 style constructor is changed from `_deprecated_function()` to `_deprecated_constructor()`
Adds a test to confirm `WP_User_Search` class is testable as deprecated.
Props jrf, DrewAPicture.
Fixes#41125.
git-svn-id: https://develop.svn.wordpress.org/trunk@56469 602fd350-edb4-49c9-b593-d223f7449a82
Similar to other function in the `_deprecated_*` series, `_deprecated_class()` comes with two new hooks: `deprecated_class_run` and `deprecated_class_trigger_error`.
Support has also been added for setting class deprecation expectations in tests.
Props jrf, wvega, ohryan.
See #41125.
git-svn-id: https://develop.svn.wordpress.org/trunk@56467 602fd350-edb4-49c9-b593-d223f7449a82
By default, Docker waits for a container to be started before considering it “ready”. But this does not necessarily mean that it’s ready to receive commands.
This adds a check that ensures the database container is ready to receive commands before proceeding with running commands.
Follow up to [56439], [56440], [56443].
Props rmccue, desrosj.
See #30462, #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56464 602fd350-edb4-49c9-b593-d223f7449a82
Fix an issue where the `X-Robots` header was used instead of the `X-Robots-Tag` header. Using `X-Robots-Tag` yields the correct behavior that the original code intended to add. `X-Robots` is left in place for backward compatibility.
Props michelleblanchette, dhruvishah2203, rajinsharwar, jorbin, hztyfoon, elrae.
Fixes#58865.
git-svn-id: https://develop.svn.wordpress.org/trunk@56462 602fd350-edb4-49c9-b593-d223f7449a82
This prevents erroneously copying a file from source onto itself in source.
Props westonruter, jorbin.
Fixes#59196.
git-svn-id: https://develop.svn.wordpress.org/trunk@56461 602fd350-edb4-49c9-b593-d223f7449a82
Change the 'x' in the Help message that instructs a user how to remove an item from a group of bulk edit items to use the dashicon and text equivalent that matches the visual and accessible control name.
Props Presskopp, costdev, sabernhardt, matthewfarlymn, bvreeman22.
Fixes#58785.
git-svn-id: https://develop.svn.wordpress.org/trunk@56460 602fd350-edb4-49c9-b593-d223f7449a82
In r56093 schema caching was added above a comment instructing developers not to cache that controller's schema. However, there is no obvious penalty for re-caching schema that is partially derived from a parent.
Caching schema in the same way in every controller is beneficial consistency, and discussion at WCUS2023 contributor day concluded we could remove this comment.
Props ahardyjpl, davidbinda, johnjamesjacoby, TimothyBlynJacobs.
Fixes#59193. See #58657.
git-svn-id: https://develop.svn.wordpress.org/trunk@56459 602fd350-edb4-49c9-b593-d223f7449a82
Some block themes like TT3 use `wp_get_block_css_selector` to determine a CSS selector based on block type and other parameters. However, recent performance profiling indicated a bottleneck in `wp_get_block_css_selector`, particularly sections that utilize `array_merge`. By slightly refactoring these sections, `array_merge` calls can be avoided which increases performance.
Props mukesh27, joemcgill, daxelrod, tabrisrp.
Fixes#59178.
git-svn-id: https://develop.svn.wordpress.org/trunk@56457 602fd350-edb4-49c9-b593-d223f7449a82
Previously, in `register_block_script_handle()` the `$script_uri` variable initialized with a `plugins_url()` call that was reported to invoke four times. In this patch the var is initialized as a blank string with a fallback to use the `plugins_url()` if the other intended conditions are not met.
Props mukesh27, daxelrod, adamsilverstein, davidbaumwald.
Fixes#59181.
git-svn-id: https://develop.svn.wordpress.org/trunk@56455 602fd350-edb4-49c9-b593-d223f7449a82
Adds new tests to ensure that `wp_authenticate_email_password`, `wp_authenticate_username_password`, and `wp_authenticate_cookie` are better tested. This also unsets cookies properly between tests.
Props JordanPak, johnregan3.
Fixes#36476.
git-svn-id: https://develop.svn.wordpress.org/trunk@56454 602fd350-edb4-49c9-b593-d223f7449a82
This introduces the `get_available_post_mime_types` filter so this query can be skipped or cached by plugins.
Props maciejmackowiak, archon810, rcorrales
Fixes#52759
git-svn-id: https://develop.svn.wordpress.org/trunk@56452 602fd350-edb4-49c9-b593-d223f7449a82