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
size.
Pull quote bodies weren't inheriting the correct styling from the block
editor. This ensure that will happen.
Props nidhidhandhukiya, poena, varjodesigns, jivygraphics, whyisjake.
Fixes#57854.
git-svn-id: https://develop.svn.wordpress.org/trunk@56451 602fd350-edb4-49c9-b593-d223f7449a82
Move the position of the Save and Delete buttons in menu editing so they are immediate neighbors, improving the proximity of related controls.
Props 90lines, sabernhardt, costdev.
See #56594.
git-svn-id: https://develop.svn.wordpress.org/trunk@56449 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the `rewrite_rules` option is not emptied until the new value has been recalculated and the option is updated. The logic for refreshing the option value is moved to a new private method named `WP_Rewrite::refresh_rewrite_rules` which is used by both the `flush_rules` and `refresh_rewrite_rules` methods.
Props iCaleb, joemcgill, flixos90, mukesh27.
Fixes#58998.
git-svn-id: https://develop.svn.wordpress.org/trunk@56448 602fd350-edb4-49c9-b593-d223f7449a82
Set the default width and height attributes of the SVG social icons to match the dimensions used within the CSS. This increases the attributes to 32px x 32 px.
Props crunnells, mukesh27, laurelfulford, tahmidulkarim, jordanpak.
Fixes#45950.
git-svn-id: https://develop.svn.wordpress.org/trunk@56447 602fd350-edb4-49c9-b593-d223f7449a82
Ensures the encoded search term in the input field is correctly decoded again.
Follow-up to [53844] and [54904].
Props adhun, nithi22, huzaifaalmesbah, deepakvijayan, zunaid321, iammehedi1.
Fixes#59143.
git-svn-id: https://develop.svn.wordpress.org/trunk@56446 602fd350-edb4-49c9-b593-d223f7449a82
WordPress's `get_option()` function generally relies on making individual database requests for each option, however with the majority of options (in most cases) being autoloaded, i.e. fetched once with a single database request and then stored in (memory) cache.
As part of a greater effort to reduce the amount of options that are unnecessarily autoloaded, this changeset introduces an alternative way to retrieve multiple options in a performant manner, with a single database request. This provides a reasonable alternative for e.g. plugins that use several options which only need to be loaded in a few specific screens.
Specifically, this changeset introduces the following functions:
* `prime_options( $options )` is the foundation to load multiple specific options with a single database request. Only options that aren't already cached (in `alloptions` or an individual cache) are retrieved from the database.
* `prime_options_by_group( $option_group )` is a convenience wrapper function for the above which allows to prime all options of a specific option group (as configured via `register_setting()`).
* `get_options( $options )` is another wrapper function which first primes the requested options and then returns them in an associative array, calling `get_option()` for each of them.
Props mukesh27, joemcgill, costdev, olliejones.
Fixes#58962.
git-svn-id: https://develop.svn.wordpress.org/trunk@56445 602fd350-edb4-49c9-b593-d223f7449a82
Removes the foreach loops from the tests by moving the in-test data sets into data providers and combines the URL data sets into one data provider to test with one test method. By using a data providor, all the tests run rather than stopping at the first failure in this group.
Fixes#57660.
Props hellofromTonya.
git-svn-id: https://develop.svn.wordpress.org/trunk@56444 602fd350-edb4-49c9-b593-d223f7449a82
This ensures the Hosting Test results API key is present for reporting results.
Follow up to [56439] and [56440].
See #30462.
git-svn-id: https://develop.svn.wordpress.org/trunk@56443 602fd350-edb4-49c9-b593-d223f7449a82