Simplify overall code structure by passing the required format to the helper function.
Clarify functionality by renaming `get_last_build_date` to `get_feed_build_date`.
Props pento, spacedmonkey.
Fixes#4575.
git-svn-id: https://develop.svn.wordpress.org/trunk@45247 602fd350-edb4-49c9-b593-d223f7449a82
* Use `$debug_data` instead of `$field['value']` to retrieve the debug data.
* Rename inner variables to avoid overriding the output variable.
Props Clorith, ocean90.
See #46573.
git-svn-id: https://develop.svn.wordpress.org/trunk@45246 602fd350-edb4-49c9-b593-d223f7449a82
As this point release doesn't modify any images, only adding a few missing ones, we don't need to change the CDN location.
Props earnjam.
Fixes#46805.
git-svn-id: https://develop.svn.wordpress.org/trunk@45240 602fd350-edb4-49c9-b593-d223f7449a82
This reduces the potential email noise to places where the fatal error could be interfering with the login and admin experience.
Once the user is in recovery mode, any fatal errors (even if they aren't in a protected endpoint) are handled and the plugin or theme will be paused.
Props TimothyBlynJacobs.
See #46950.
git-svn-id: https://develop.svn.wordpress.org/trunk@45238 602fd350-edb4-49c9-b593-d223f7449a82
This significantly reduces the number of SQL queries when `wp_list_authors()` is called on a site where the majority of users don't have any posts, e.g. a membership site.
Props billerickson, ianbelanger, dswebsme.
Fixes#45105.
git-svn-id: https://develop.svn.wordpress.org/trunk@45235 602fd350-edb4-49c9-b593-d223f7449a82
Per the documentation standards, the `@global` tag is meant to list PHP globals used within functions or methods.
The code in question uses the variable in global namespace, but does not explicitly declare it.
Props jayupadhyay01, dswebsme.
Fixes#46602.
git-svn-id: https://develop.svn.wordpress.org/trunk@45233 602fd350-edb4-49c9-b593-d223f7449a82
These keys are used in `{$type}_template_hierarchy` and `{$type}_template` filters.
Previously, `front_page` and `privacy_policy` were passed, but `get_query_template()` stripped the underscores before passing the values to the filters.
Props rinatkhaziev, tmatsuur, johnbillion.
Fixes#21213, #46958.
git-svn-id: https://develop.svn.wordpress.org/trunk@45231 602fd350-edb4-49c9-b593-d223f7449a82
Also, restores the keyboard interaction behavior prior to [41988] by requesting one single Enter key press to add a tag.
Props ryanshoover, miyauchi.
Fixes#45371.
git-svn-id: https://develop.svn.wordpress.org/trunk@45227 602fd350-edb4-49c9-b593-d223f7449a82
Currently, there are a number of scenarios where `is_block_editor()` (and `WP_Screen::is_block_editor`) would incorrectly indicate block editor support at different points of the loading process. Most notably, checking `is_block_editor` when hooking into the `current_screen` action will always result in `false`, even when the block editor is being loaded. This is because `is_block_editor` is not set to `true` until `edit-form-blocks.php` is included.
This change adds logic to `WP_Screen` to ensure the accuracy of `is_block_editor` on block editor pages earlier in the load process.
While edit screens will now be accurate 100% of the time from `current_screen` on, there are still a few edge cases where `is_block_editor` could contain an incorrect value when creating a new post.
Because a `WP_Post` object is a required parameter for the `replace_editor` filter and `use_block_editor_for_post()` function, `WP_Screen` will fall back to the value returned by `use_block_editor_for_post_type()` for the post being created. To eliminate these edge cases, the `use_block_editor_for_post_type` filter can be used to return the appropriate boolean value to indicate support.
Props Chouby, desrosj, aduth, johnbillion.
Fixes#46195.
git-svn-id: https://develop.svn.wordpress.org/trunk@45224 602fd350-edb4-49c9-b593-d223f7449a82
- Change `recurse_dirsize()` to accept an array of excluded paths.
- Change so we don't calculate the sizes of dirs in wp-content twice.
- Add the size in bytes to the "debug" into.
- Add a custom DOM event after the dir sizes request is done. Can be used by plugins to "daisy chain" more requests.
- Move "WordPress directory location" and "WordPress directory size" to the top in the "Directories and Sizes" section.
- Move "Theme directory location" to the "Active Theme" section.
- Fix labels capitalization.
Props xkon, afercia, Clorith, azaozz.
Fixes#46707.
git-svn-id: https://develop.svn.wordpress.org/trunk@45220 602fd350-edb4-49c9-b593-d223f7449a82
Address an issue since r44947 where calling `wp_enqueue_media` on the front-end would result in a PHP fatal.
Props david.binda.
Fixes#46795.
git-svn-id: https://develop.svn.wordpress.org/trunk@45219 602fd350-edb4-49c9-b593-d223f7449a82
For many bundled theme related stylesheets, a version is either not specified, or specified as a hardcoded date string when enqueued. This is problematic when a stylesheet is updated and the version number is not (which has happened several times recently). This change ensures that all bundled theme related stylesheets use the theme’s version as the stylesheet version. This ensures cache busting for theme stylesheets every time a theme is updated and guarantees that users receive any new or updated styles included in the update when visiting the site for the first time after an update.
Props parsmizban, ianbelanger, dswebsme.
Fixes#39997.
git-svn-id: https://develop.svn.wordpress.org/trunk@45213 602fd350-edb4-49c9-b593-d223f7449a82
In [28693], the Genericons stylesheet was updated to `3.0.3`, but the version was incorrectly indicated as `3.03`.
See #39997.
git-svn-id: https://develop.svn.wordpress.org/trunk@45212 602fd350-edb4-49c9-b593-d223f7449a82
While currently a recovery link is only made available via the admin email address, this will be expanded in the future. In order to accomplish that, the mechanisms to store and validate recovery keys must support multiple keys to be valid at the same time.
This changeset adds that support, adding an additional token parameter which is part of a recovery link in addition to the key. A key itself is always associated with a token, so the two are only valid in combination. These associations are stored in a new `recovery_keys` option, which is regularly cleared in a new Cron hook, to prevent potential cluttering from unused recovery keys.
This changeset does not have any user-facing implications otherwise.
Props pbearne, timothyblynjacobs.
Fixes#46595. See #46130.
git-svn-id: https://develop.svn.wordpress.org/trunk@45211 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that at least for the admin, which is more predictable than the frontend, the user-friendlier error notice from the fatal error handler still shows if a runtime fatal error happens within the page generation process.
Props axaak.
Fixes#46811.
git-svn-id: https://develop.svn.wordpress.org/trunk@45210 602fd350-edb4-49c9-b593-d223f7449a82
Per Atom format's RFC, there must not be any whitespace in a Date construct or in any IRI.
Props josephwa.
Fixes#46922.
git-svn-id: https://develop.svn.wordpress.org/trunk@45208 602fd350-edb4-49c9-b593-d223f7449a82
Instantiating `WP_Recovery_Mode` should no longer have any required timing.
Props TimothyBlynJacobs, lkraav.
Fixes#46882.
git-svn-id: https://develop.svn.wordpress.org/trunk@45205 602fd350-edb4-49c9-b593-d223f7449a82
As static markup, the Privacy Policy editor help notice link no longer needs to be translateable with the revisions included in [45174].
Props garrett-eclipse.
Fixes#46098. See [45174].
git-svn-id: https://develop.svn.wordpress.org/trunk@45180 602fd350-edb4-49c9-b593-d223f7449a82
* Use `wp.i18n` to translate JavaScript strings.
* Use `_n()` for proper plural forms support.
Props TimothyBlynJacobs, ocean90, afercia.
Fixes#46683.
git-svn-id: https://develop.svn.wordpress.org/trunk@45178 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a bug introduced in [43392] which breaks file deletion on systems using stream wrappers, due to limitations of `realpath()`.
Props antonypuckey, pfiled.
Fixes#44563.
git-svn-id: https://develop.svn.wordpress.org/trunk@45177 602fd350-edb4-49c9-b593-d223f7449a82
This improves accessibility, ensuring users utilizing screen readers are informed that the site is in recovery mode.
Props: afercia, TimothyBlynJacobs.
See #46608.
git-svn-id: https://develop.svn.wordpress.org/trunk@45175 602fd350-edb4-49c9-b593-d223f7449a82
Use the Notices data module when viewing the block editor screen for the assigned Privacy Policy page to display a help notice.
Props garrett-eclipse, joen, xkon.
Fixes#46098.
git-svn-id: https://develop.svn.wordpress.org/trunk@45174 602fd350-edb4-49c9-b593-d223f7449a82
The preceding period (`.`) should always be included when referring to an `.htaccess` file.
Props: ianbelanger, garrett-eclipse, subrataemfluence, burhandodhy.
Fixes#46841.
git-svn-id: https://develop.svn.wordpress.org/trunk@45171 602fd350-edb4-49c9-b593-d223f7449a82
This change adds missing actions for several tests. This ensures that the user is provided with a next step, whenever possible.
Also, change the URL displayed in the WordPress.org communication test description to `api.wordpress.org` for accuracy.
Props: garrett-eclipse, Clorith, vaishalipanchal.
Fixes#46734.
git-svn-id: https://develop.svn.wordpress.org/trunk@45170 602fd350-edb4-49c9-b593-d223f7449a82
Label badges for each Site Health test currently display in either red, orange, or green, regardless of if the test passed or failed. This is confusing, as seeing red labels in the “Passed Test” section could alarm users (when really everything is OK and no action is required), and seeing green labels in the “Failed Tests” section would not appropriately encourage the user to take appropriate action.
This change makes several improvements to the label badges:
- Always right align the badges for consistent display.
- Remove background fill for badges. Instead, use a border.
- Use a consistent styling for all tests (passed and failed).
- The text color no longer uses true black (#000000).
- The `.badge.pink` CSS definition has been switched to `.badge.purple`, and the definitions for blue, gray, and green have also been updated to more closely follow the official WordPress color palette.
Props: pbiron, garrett-eclipse, hedgefield, Clorith, xkon, melchoyce, mdwolinski, alexdenning.
Fixes#46623.
git-svn-id: https://develop.svn.wordpress.org/trunk@45169 602fd350-edb4-49c9-b593-d223f7449a82
Previously, only the site’s locale was displayed in the Site Health debug information. Moving forward, both the site’s default locale and the user’s locale will be specified.
This change also removes the `@param` tag for `WP_Debug_Data::debug_data()`. This parameter was previously removed in [45156].
Props: mukesh27, ianbelanger, Clorith, desrosj.
Fixes#46803.
git-svn-id: https://develop.svn.wordpress.org/trunk@45166 602fd350-edb4-49c9-b593-d223f7449a82
In [44937] and [44939], changes were made to prevent a user from updating any plugin that requires a higher version of PHP than the site is running. This compliments those changes to also prevent plugins from being auto updated when the same requirements are not met.
Props: TimothyBlynJacobs, davidbaumwald.
Fixes#46613.
git-svn-id: https://develop.svn.wordpress.org/trunk@45165 602fd350-edb4-49c9-b593-d223f7449a82
Clarifies that `WP_DEBUG` can cause `WP_DEBUG_DISPLAY` to be enabled,
and uses the constants themselves in related translation contexts.
Props mukesh27, ocean90, clorith, SergeyBiryukov, mikeschroder.
Fixes#46877.
git-svn-id: https://develop.svn.wordpress.org/trunk@45164 602fd350-edb4-49c9-b593-d223f7449a82
Brings parity with the changes for the Media Views introduced in [44900].
- moves the alt text field to the top as first field
- adds an explanatory text with a link pointing to the W3C "alt decision tree" tutorial
- adds `aria-describedby` to target the explanatory text
- adjusts the CSS and indentation
Props chetan200891.
Fixes#46875.
git-svn-id: https://develop.svn.wordpress.org/trunk@45158 602fd350-edb4-49c9-b593-d223f7449a82
The right padding added in [44895] needs to be set only on the input fields in the Reset Password screen and exclude other login screens.
Amends [44895].
Fixes#42853.
git-svn-id: https://develop.svn.wordpress.org/trunk@45157 602fd350-edb4-49c9-b593-d223f7449a82
- More verbose set used to generate the admin page.
- More concise set that is copied when clicking the "Copy the site info" button intended mostly for support and developers.
Props xkon, azaozz.
Fixes#46726.
git-svn-id: https://develop.svn.wordpress.org/trunk@45156 602fd350-edb4-49c9-b593-d223f7449a82
This caused the post-plugin installation actions to jump around when the "Activate Plugin" primary button became active.
Props seedsca, pratikthink, ianbelanger, mukesh27.
Fixes#44836.
git-svn-id: https://develop.svn.wordpress.org/trunk@45150 602fd350-edb4-49c9-b593-d223f7449a82
This lack of action could cause an expired nonce to end up in the URL.
Props garrett-eclipse, saimonh, xkon.
Fixes#44047.
git-svn-id: https://develop.svn.wordpress.org/trunk@45149 602fd350-edb4-49c9-b593-d223f7449a82
An admin may download an export to check that it's all correct, but this action shouldn't mark the request as complete.
Props garrett-eclipse, JoshuaWold, birgire.
Fixes#44644.
git-svn-id: https://develop.svn.wordpress.org/trunk@45148 602fd350-edb4-49c9-b593-d223f7449a82
When selecting custom colour schemes in the customiser, the hover colour is incorrectly applied to MediaElement controls.
Props xkon, ianbelanger.
Fixes#40843.
git-svn-id: https://develop.svn.wordpress.org/trunk@45146 602fd350-edb4-49c9-b593-d223f7449a82
This notification was a little too intrustive, and suffered from being difficult to dismiss.
Props garrett-eclipse, xkon, ianbelanger.
Fixes#46819.
git-svn-id: https://develop.svn.wordpress.org/trunk@45142 602fd350-edb4-49c9-b593-d223f7449a82
This expands upon `rel="noopener"` being previously added to links in the content.
Props audrasjb, welcher.
Fixes#43290.
git-svn-id: https://develop.svn.wordpress.org/trunk@45141 602fd350-edb4-49c9-b593-d223f7449a82
When `do_blocks()` is run, it sets up some special handling of the `wpautop` filter, as we don't want `wpautop` to run on block content, but we do want it to be available for subsequent runs of `the_content`, which may be happening on non-block content.
As we set this up before rendering dynamic blocks, however, a dynamic block choosing to run `the_content` will cause unintentially structural deficiences in this particular recursive block tower.
Moving this handling to after dynamic blocks are rendered makes our tower lean a little less.
Props aldavigdis, pento.
Fixes#45495.
git-svn-id: https://develop.svn.wordpress.org/trunk@45139 602fd350-edb4-49c9-b593-d223f7449a82
This change brings more coherence between the subject lines of the various emails WordPress will send.
Props ramiy, pento.
Fixes#37940.
git-svn-id: https://develop.svn.wordpress.org/trunk@45137 602fd350-edb4-49c9-b593-d223f7449a82
In CSS, the `linear-gradient` function requires that the direction value explicitly use `to` instead of an implicit `from`.
Props: ianbelanger, joyously, man4toman.
Fixes#46786.
git-svn-id: https://develop.svn.wordpress.org/trunk@45124 602fd350-edb4-49c9-b593-d223f7449a82
The backticks ensure that the data is formatted accordingly on pasting whenever possible.
Props Clorith.
Fixes#46809.
git-svn-id: https://develop.svn.wordpress.org/trunk@45119 602fd350-edb4-49c9-b593-d223f7449a82
This changeset introduces several changes around usability when recovery mode is active:
* Display a notice in the admin clarifying that the user is in recovery mode.
* Use a highlight color for the admin bar link to exit recovery mode.
* Exit recovery mode automatically when logging out.
* Include a recovery mode indicator in the title tag.
Props aandrewdixon, azaozz, dhanukanuwan, flixos90, henrywright, karmatosed, mapk, melchoyce, spacedmonkey, TimothyBlynJacobs, tinkerbelly.
See #46608.
git-svn-id: https://develop.svn.wordpress.org/trunk@45117 602fd350-edb4-49c9-b593-d223f7449a82
With this change, fatal errors recorded before a plugin was deactivated or a theme was switched away from do not persist. This ensures that re-enabling it re-checks for fatal errors correctly.
Props aandrewdixon, dhanukanuwan, henrywright.
Fixes#46812.
git-svn-id: https://develop.svn.wordpress.org/trunk@45115 602fd350-edb4-49c9-b593-d223f7449a82
Prior to this change, resuming or activating a plugin or theme that is still broken would result in a redirect loop if in recovery mode. If outside recovery mode, it would cause the error template to be displayed.
Furthermore this applies to breaking a plugin or theme when editing from the backend.
Props aandrewdixon, azaozz, dhanukanuwan, henrywright, ocean90, ohiosierra, PandelisZ, xkon.
Fixes#46045, #46751.
git-svn-id: https://develop.svn.wordpress.org/trunk@45114 602fd350-edb4-49c9-b593-d223f7449a82
This includes version numbers and signature counts in error reports, to help diagnose isolated failures that have no apparent cause.
Props dd32.
See #39309.
git-svn-id: https://develop.svn.wordpress.org/trunk@45112 602fd350-edb4-49c9-b593-d223f7449a82
This change switches to using `get_user_locale()` when adding the language to the Site Health debug information to ensure the user’s locale preference is reflected.
Also, `function_exists()` checks for `switch_to_locale()` and `restore_previous_locale()` were required in the plugin to support older versions of WordPress, but they are not required in core/
Props: Clorith, desrosj.
Fixes#46694.
git-svn-id: https://develop.svn.wordpress.org/trunk@45110 602fd350-edb4-49c9-b593-d223f7449a82
In CSS, the `linear-gradient` function requires that the direction value explicitly use `to` instead of an implicit `from`.
Props: ianbelanger, Malae, man4toman.
Fixes#46770.
git-svn-id: https://develop.svn.wordpress.org/trunk@45109 602fd350-edb4-49c9-b593-d223f7449a82
- Prevent fatal errors from timeouts on the Tools => Site Health => Info tab.
- Use the `get_dirsize()` and `recurse_dirsize()` functions to calculate directory sizes. The results are cached.
- Introduce "timeout protection" in `recurse_dirsize()`.
Props pento, Clorith, xkon, afercia, jeremyfelt, azaozz.
Fixes#46645.
git-svn-id: https://develop.svn.wordpress.org/trunk@45104 602fd350-edb4-49c9-b593-d223f7449a82
Previously, `WP_Widget_Media_Audio`, `WP_Widget_Media_Image`, and `WP_Widget_Media_Video` used to override the changes due to reversed arguments in `array_merge()` call.
Props Toro_Unit, birgire.
Fixes#45029.
git-svn-id: https://develop.svn.wordpress.org/trunk@45100 602fd350-edb4-49c9-b593-d223f7449a82
* Split plural strings with multiple sentences to avoid duplicating translations.
* Decouple strings where the singular and plural form are not just the same string with different numbers, but essentially two different strings.
* Use an established pattern for numbered placeholders in translator comments.
* Replace constants in translatable strings with placeholders, mark them as code.
* Make sure sentences are translated as a whole, not as separate string parts.
* Remove unnecessary context and escaping.
Props ocean90, SergeyBiryukov.
See #46683.
git-svn-id: https://develop.svn.wordpress.org/trunk@45099 602fd350-edb4-49c9-b593-d223f7449a82
A unitless `0` value for a `<time>` CSS data type was reintroduced in [45040]. This is allowed for `<length>` data types, but is invalid for `<time>`.
See #43195.
Fixes#46774.
git-svn-id: https://develop.svn.wordpress.org/trunk@45097 602fd350-edb4-49c9-b593-d223f7449a82
- removes the definition list and uses the markup from the ARIA Authoring Practices example
- removes incorrect ARIA roles
- avoids ARIA landmark regions proliferation
Props mukesh27 for the initial patch.
Fixes#46714.
git-svn-id: https://develop.svn.wordpress.org/trunk@45087 602fd350-edb4-49c9-b593-d223f7449a82
Rename `$page` and `$id` variables to `$screen_id` and `$box_id` for clarity.
Props sharifkiberu, DrewAPicture.
Fixes#45179.
git-svn-id: https://develop.svn.wordpress.org/trunk@45083 602fd350-edb4-49c9-b593-d223f7449a82
- displays an error notice when JavaScript is off, consistently with other admin screens that depend on JavaScript
- keeps the main `h1` visible
Minor clean-ups:
- makes code indentation consistent in `site-health.php` and `site-health-info.php`
- removes a couple of `<div class="wp-clearfix"></div>` as that's not the intended usage of `wp-clearfix` (those divs didn't do anything anyways)
Fixes#46717.
git-svn-id: https://develop.svn.wordpress.org/trunk@45076 602fd350-edb4-49c9-b593-d223f7449a82
Adds `role="presentation"` to the `<table>` elements used in the Site Health reports.
Ideally, HTML tables should be used for tabular data. When tables are used for layout purposes, it's important to remove any native semantics so that assistive technologies can correctly announce the table content in a linearized fashion.
Props chetan200891.
Fixes#46725.
git-svn-id: https://develop.svn.wordpress.org/trunk@45075 602fd350-edb4-49c9-b593-d223f7449a82
Avoids the Site Health pages header layout to break when the Hello Dolly plugin or other floated content is printed out at the top of the page.
Props xkon.
Fixes#46650.
git-svn-id: https://develop.svn.wordpress.org/trunk@45072 602fd350-edb4-49c9-b593-d223f7449a82
The document `<title>` gives a name to a web document. In the context of the WordPress admin, a unique, meaningful, title is important for various reasons:
- it allows browser's history to store meaningful entries
- when multiple browser's tabs are open, it allows users to better identify the tab content
- it's the first thing screen readers announce when navigating to a web page, thus helping users to identify the nature of the page content
Props chetan200891, mukesh27.
Fixes#46699.
git-svn-id: https://develop.svn.wordpress.org/trunk@45070 602fd350-edb4-49c9-b593-d223f7449a82
Arrows navigation on accordions is an optional keyboard interaction feature mentioned in the WAI-ARIA Authoring Practices. While it can add some value in some specific cases, it's not so discoverable and it's unlikely users, including assistive technologies users, would really "expect" this kind of interaction.
See #46573.
Fixes#46682.
git-svn-id: https://develop.svn.wordpress.org/trunk@45069 602fd350-edb4-49c9-b593-d223f7449a82
- Fix adding the keyboard shortcuts to all button tooltips in the classic editor and classic block.
- Fix translating the aria labels for all buttons.
Fixes#35710;
git-svn-id: https://develop.svn.wordpress.org/trunk@45066 602fd350-edb4-49c9-b593-d223f7449a82
This action allows debugging mechanisms to perform greater introspection into which template parts are loaded for any given request. It also exposes the array of candidate template part file names for each template part instance.
Props pcfreak30, jdeeburke
Fixes#41575
git-svn-id: https://develop.svn.wordpress.org/trunk@45059 602fd350-edb4-49c9-b593-d223f7449a82
Previous [44982] and [44950].
This bumps the minimum version down slightly based on some research into the usage of php 5.6. This also brings the recommended version in line with https://wordpress.org/about/requirements/ .
The travis matrix is also being reduced in order to speed up builds. This is a hard break. PHP 5.2 - 5.5 we are never ever, ever, getting back together. You go talk to your friends, talk to my friends, talk to me, But we are never ever, ever, ever getting back together.
Props DD32, afergen for research.
Fixes#46594.
git-svn-id: https://develop.svn.wordpress.org/trunk@45058 602fd350-edb4-49c9-b593-d223f7449a82
In particular, this allows downgrading from WordPress 5.2 to 5.1.1, if sites wish to opt out of the beta.
Props dd32.
See #46615.
git-svn-id: https://develop.svn.wordpress.org/trunk@45046 602fd350-edb4-49c9-b593-d223f7449a82
The previous method for copying the debug report to the clipboard involved having a hidden `<textarea>`, but this shows up in screen readers and can't be reliably hidden.
To work around this, the button now uses the `clipboard.js` library, which automatically handles browser differences in the Clipboard API, and can load the text to copy from a `data-` attribute on the button.
Props pento, hedgefield, afercia.
Fixes#46647.
git-svn-id: https://develop.svn.wordpress.org/trunk@45044 602fd350-edb4-49c9-b593-d223f7449a82