Fixes updating WordPress from 5.7 and earlier versions. When doing the update this file runs first in the old version where the polifills may not be available.
Porps: frankit.
Fixes: #59145.
git-svn-id: https://develop.svn.wordpress.org/trunk@56417 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new public function, `wp_get_theme_data_custom_templates` that returns the `customTemplates` defined by the active theme from `theme.json`. It also substitutes the usage of private APIs by this new
API.
Props johnbillion, audrasjb.
Fixes#59137
git-svn-id: https://develop.svn.wordpress.org/trunk@56413 602fd350-edb4-49c9-b593-d223f7449a82
This resolves a few WPCS warnings:
{{{
Variable "$sX" is not in valid snake_case format, try "$s_x"
Variable "$sY" is not in valid snake_case format, try "$s_y"
}}}
The `$sX` and `$sY` variables are renamed to `$original_width` and `$original_height`, respectively.
Additionally, the `$fwidth` and `$fheight` variables are renamed to `$full_width` and `$full_height`, for clarity.
Follow-up to [11965], [22094], [56400].
See #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56411 602fd350-edb4-49c9-b593-d223f7449a82
Fix `additional_classes` argument passed as a string instead of an array. Follow up to [56409].
Props joedolson.
See #57791.
git-svn-id: https://develop.svn.wordpress.org/trunk@56410 602fd350-edb4-49c9-b593-d223f7449a82
Use `wp_get_admin_notice` and `wp_admin_notice` to handle multisite settings notices.
Props costdev.
See #57791.
git-svn-id: https://develop.svn.wordpress.org/trunk@56409 602fd350-edb4-49c9-b593-d223f7449a82
Add functions `wp_get_admin_notice()` and `wp_admin_notice()` to create and output admin notices & tests for usage. New functions accept a message and array of optional arguments. This commit does not implement the functions. Include new filters: `wp_admin_notice_args`, `wp_admin_notice_markup` and action: `wp_admin_notice`.
Props joedolson, costdev, sakibmd, dasnitesh780, sabernhardt.
Fixes#57791.
git-svn-id: https://develop.svn.wordpress.org/trunk@56408 602fd350-edb4-49c9-b593-d223f7449a82
This reverts [56404], [56405], [56406].
More testing is needed to ensure multiple messages are not sent unintentionally.
Unprops desrosj.
See #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56407 602fd350-edb4-49c9-b593-d223f7449a82
This adds `startup_failure` to the list of conclusions that the Slack workflow looks for when determining whether to send a failure notice.
See #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56406 602fd350-edb4-49c9-b593-d223f7449a82
[53947] introduced a callable workflow that allowed a workflow run to be retried automatic. By default all workflows are retried once.
Since a run is not considered “failed” until after the automatic retry, the first Slack message is unnecessary and can cause a lot of noise when there are network hiccups.
This alters the logic to skip a failure notice in Slack until the second failure.
See #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56404 602fd350-edb4-49c9-b593-d223f7449a82
Because `slack-notifications` job requires all preceding jobs in each workflow to complete, there’s no need to include the same jobs in the `needs` configuration for the `failed-workflow` one.
See #58867.
git-svn-id: https://develop.svn.wordpress.org/trunk@56402 602fd350-edb4-49c9-b593-d223f7449a82
If the available disk space exceeds the `PHP_INT_MAX` value, i.e. a 32-bit PHP version is in use with more than 2 GB free, the type casting to `(int)` could cause an overflow, and the Site Health test would then erroneously report that there is not enough free space.
This commit removes the unnecessary type casting and uses the result from `disk_free_space()` directly.
Includes optimizing the logic to skip further checks if the available disk space could not be determined.
Follow-up to [55720].
Props mathsgrinds, Presskopp, rajinsharwar, SergeyBiryukov.
Fixes#59116.
git-svn-id: https://develop.svn.wordpress.org/trunk@56401 602fd350-edb4-49c9-b593-d223f7449a82
Three new metrics are being collected and reported as part of this change:
- Time To First Byte (TTFB) - the time between the request for a resource and when the first byte of a response begins to arrive
- Largest Contentful Paint (LCP) — the render time of the largest image or text block visible within the viewport
- The difference between the two (LCP minus TTFB)
Props joemcgill, flixos90, oandregal, mukesh27, youknowriad, swissspidy.
Fixes#58360.
git-svn-id: https://develop.svn.wordpress.org/trunk@56399 602fd350-edb4-49c9-b593-d223f7449a82
This updates two fragments for sending a `304 Not Modified` header to better align with each other by using consistent variable names and formatting.
Follow-up to [1036], [1037], [1043], [2534], [2584], [2627], [12603], [12936], [56362].
See #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56395 602fd350-edb4-49c9-b593-d223f7449a82
Includes minor code layout fixes for better readability.
Follow-up to [3634], [4189].
Props aristath, poena, afercia, SergeyBiryukov.
See #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56394 602fd350-edb4-49c9-b593-d223f7449a82
Prior to this change, all block files were excluded from coding standards checks, but there's no reason these files shouldn't adhere to core's coding standards.
Props lopo, Rahe, adamsilverstein
Fixes#50010
git-svn-id: https://develop.svn.wordpress.org/trunk@56392 602fd350-edb4-49c9-b593-d223f7449a82
This updates the following dependencies to their latest versions:
- `chalk`
- `cssnano`
- `dotenv`
- `grunt-contrib-cssmin`
- `grunt-contrib-qunit`
- `grunt-webpack`
- `jest-image-snapshot`
- `postcss`
- `sass`
- `sinon`
- `webpack`
Additionally, `npm audit fix` has been run to automatically fix as many issues as possible.
See #58863.
git-svn-id: https://develop.svn.wordpress.org/trunk@56390 602fd350-edb4-49c9-b593-d223f7449a82
This updates the `whatwg-fetch` library from version `3.6.2` to `3.6.17`, the latest current version.
This library is included and registered within WordPress as the `wp-polyfill-fetch` script and is no longer used by WordPress itself.
Props rajinsharwar, hareesh-pillai.
Fixes#59066.
git-svn-id: https://develop.svn.wordpress.org/trunk@56389 602fd350-edb4-49c9-b593-d223f7449a82
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
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
* 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
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
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
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
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
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
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
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
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
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