Commit Graph

7051 Commits

Author SHA1 Message Date
Felix Arntz
5d2c761568 Bootstrap/Load: Remove extension from the list of paused extensions when it is deactivated.
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.

Built from https://develop.svn.wordpress.org/trunk@45115


git-svn-id: http://core.svn.wordpress.org/trunk@44924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-05 15:33:52 +00:00
Felix Arntz
6d58109b09 Bootstrap/Load: Ensure WP_Fatal_Error_Handler does not conflict with existing mechanisms treating fatal errors.
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.

Built from https://develop.svn.wordpress.org/trunk@45114


git-svn-id: http://core.svn.wordpress.org/trunk@44923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-05 15:20:55 +00:00
Pascal Birchler
ec05cd3168 Site Health: Remove unused $wp_config_path variable.
Discovered and fixed during WordCamp London 2019 contributor day.

Props m_uysl.
Fixes #46808.

Built from https://develop.svn.wordpress.org/trunk@45113


git-svn-id: http://core.svn.wordpress.org/trunk@44922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-05 11:09:51 +00:00
tellyworth
23fe2800cc Upgrade/Install: Add more context in signature verify failures.
This includes version numbers and signature counts in error reports, to help diagnose isolated failures that have no apparent cause.

Props dd32.
See #39309.

Built from https://develop.svn.wordpress.org/trunk@45112


git-svn-id: http://core.svn.wordpress.org/trunk@44921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-05 05:20:51 +00:00
Andrew Ozz
4601e178e5 Site health: fix usage of max_execution_time. When PHP is run from the cli the default is 0.
Fixes #46645.
Built from https://develop.svn.wordpress.org/trunk@45111


git-svn-id: http://core.svn.wordpress.org/trunk@44920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-04 21:54:53 +00:00
desrosj
adbaba7d56 Site Health: Ensure the user locale is listed in debug information.
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.
Built from https://develop.svn.wordpress.org/trunk@45110


git-svn-id: http://core.svn.wordpress.org/trunk@44919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-04 21:24:52 +00:00
Sergey Biryukov
4ee7d453fa Site Health: Use wp_get_upload_dir() instead of wp_upload_dir(), remove duplicate call.
Props m_uysl.
Fixes #46729.
Built from https://develop.svn.wordpress.org/trunk@45108


git-svn-id: http://core.svn.wordpress.org/trunk@44917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-03 11:20:51 +00:00
Sergey Biryukov
991eb4258d Site Health: Use correct property for database-related messages.
Props mukesh27, birgire.
Fixes #46783.
Built from https://develop.svn.wordpress.org/trunk@45107


git-svn-id: http://core.svn.wordpress.org/trunk@44916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-03 11:01:53 +00:00
Sergey Biryukov
ef948cbfd6 PHPCS: Fix WPCS violations in [45104].
See #46645.
Built from https://develop.svn.wordpress.org/trunk@45106


git-svn-id: http://core.svn.wordpress.org/trunk@44915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-03 02:14:51 +00:00
Sergey Biryukov
5d0bd0ec47 Site Health: Use a consistent verbiage for the suggestion to remove inactive plugins and themes.
Props garrett-eclipse, marybaum, Clorith.
Fixes #46735.
Built from https://develop.svn.wordpress.org/trunk@45105


git-svn-id: http://core.svn.wordpress.org/trunk@44914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-03 02:01:51 +00:00
Andrew Ozz
2cdc22aded Site health:
- 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.
Built from https://develop.svn.wordpress.org/trunk@45104


git-svn-id: http://core.svn.wordpress.org/trunk@44913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-02 23:33:53 +00:00
Sergey Biryukov
0c92764023 Site Health: Use an established pattern for numbered placeholders in translator comments in WP_Debug_Data.
See #46683.
Built from https://develop.svn.wordpress.org/trunk@45102


git-svn-id: http://core.svn.wordpress.org/trunk@44911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-02 22:18:52 +00:00
Sergey Biryukov
f7357d3957 Site Health: i18n audit, take 1.
* 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.
Built from https://develop.svn.wordpress.org/trunk@45099


git-svn-id: http://core.svn.wordpress.org/trunk@44908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-02 21:32:53 +00:00
Sergey Biryukov
5291f46c8a Docs: Fix typo in a comment in unzip_file().
Props mukesh27.
Fixes #46766.
Built from https://develop.svn.wordpress.org/trunk@45098


git-svn-id: http://core.svn.wordpress.org/trunk@44907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-02 13:34:53 +00:00
Sergey Biryukov
474f57e0fa Site Health: Add missing i18n for Security and Performance badge labels.
Props iworks.
Fixes #46755. See #46683.
Built from https://develop.svn.wordpress.org/trunk@45095


git-svn-id: http://core.svn.wordpress.org/trunk@44904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-02 10:08:56 +00:00
Sergey Biryukov
ccbf084609 Docs: Fix more typos in WP_Site_Health DocBlocks.
See #46753.
Built from https://develop.svn.wordpress.org/trunk@45094


git-svn-id: http://core.svn.wordpress.org/trunk@44903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 20:30:52 +00:00
Sergey Biryukov
12a2bf946a Docs: Fix typos in WP_Site_Health DocBlocks.
Props mukesh27.
Fixes #46753.
Built from https://develop.svn.wordpress.org/trunk@45093


git-svn-id: http://core.svn.wordpress.org/trunk@44902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 20:23:50 +00:00
Sergey Biryukov
9c8e9354b1 Docs: Add missing @since tag for WP_Site_Health::get_test_php_extensions().
Props mukesh27.
Fixes #46752.
Built from https://develop.svn.wordpress.org/trunk@45092


git-svn-id: http://core.svn.wordpress.org/trunk@44901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 20:17:54 +00:00
Sergey Biryukov
0aedea9470 Docs: Improve documentation for get_plugin_page_hook() and get_plugin_page_hookname().
Props subrataemfluence, desrosj.
Fixes #44224.
Built from https://develop.svn.wordpress.org/trunk@45085


git-svn-id: http://core.svn.wordpress.org/trunk@44894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 14:09:52 +00:00
Sergey Biryukov
06d8f376ea PHPCS: Fix WPCS violation in [45082].
See #42223.
Built from https://develop.svn.wordpress.org/trunk@45084


git-svn-id: http://core.svn.wordpress.org/trunk@44893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 13:30:52 +00:00
Sergey Biryukov
733ec3da48 Docs: Improve documentation for postbox_classes().
Rename `$page` and `$id` variables to `$screen_id` and `$box_id` for clarity.

Props sharifkiberu, DrewAPicture.
Fixes #45179.
Built from https://develop.svn.wordpress.org/trunk@45083


git-svn-id: http://core.svn.wordpress.org/trunk@44892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 12:47:51 +00:00
Sergey Biryukov
2f5b5baa07 I18N: Merge similar strings about allowed space allocation in Multisite.
Props ramiy, Jonathandejong, pento.
Fixes #42223.
Built from https://develop.svn.wordpress.org/trunk@45082


git-svn-id: http://core.svn.wordpress.org/trunk@44891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 12:24:51 +00:00
Sergey Biryukov
de95fac19c Themes: Link to an updated documentation on child themes on developer.wordpress.org, instead of Codex.
Props man4toman.
See #46450.
Built from https://develop.svn.wordpress.org/trunk@45080


git-svn-id: http://core.svn.wordpress.org/trunk@44889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 11:55:52 +00:00
Sergey Biryukov
5cca79f806 Site Health: If WP_DEBUG_LOG contains a file path, display it on Site Info tab.
Props xkon, knutsp, ocean90.
Fixes #46692.
Built from https://develop.svn.wordpress.org/trunk@45079


git-svn-id: http://core.svn.wordpress.org/trunk@44888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 01:26:51 +00:00
Sergey Biryukov
c241c16846 Site Health: Simplify the checks for constants that are always defined by default.
Props xkon.
Fixes #46738.
Built from https://develop.svn.wordpress.org/trunk@45078


git-svn-id: http://core.svn.wordpress.org/trunk@44887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-01 00:10:53 +00:00
Sergey Biryukov
44602b5ed9 Docs: Fix typos in site_status_tests filter DocBlock.
Props kraftbj.
Fixes #46727.
Built from https://develop.svn.wordpress.org/trunk@45073


git-svn-id: http://core.svn.wordpress.org/trunk@44882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-30 10:58:52 +00:00
Sergey Biryukov
10409c0f7c Privacy: Ensure the personal data export email is sent in the locale of the user whose data is being exported (or the site's default locale if they are not a registered user) when the administrator fulfilling the request uses a different locale.
Props garrett-eclipse.
Fixes #46056.
Built from https://develop.svn.wordpress.org/trunk@45062


git-svn-id: http://core.svn.wordpress.org/trunk@44871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-28 21:29:50 +00:00
Sergey Biryukov
a02494a80f Site Health: Add description for a successful HTTPS check.
Props Clorith, xkon.
Fixes #46617.
Built from https://develop.svn.wordpress.org/trunk@45052


git-svn-id: http://core.svn.wordpress.org/trunk@44861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-28 16:15:51 +00:00
Sergey Biryukov
d69165bd3b Site Health: Correct wp_version_check() existence verification by performing a request to the Site Health page instead of Dashboard.
Props Clorith, audrasjb.
Fixes #46616.
Built from https://develop.svn.wordpress.org/trunk@45049


git-svn-id: http://core.svn.wordpress.org/trunk@44858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-28 14:31:51 +00:00
Gary Pendergast
0a4d431e11 Upgrades: Allow upgrades to proceed when a soft failure occurs on package signatures.
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.


Built from https://develop.svn.wordpress.org/trunk@45046


git-svn-id: http://core.svn.wordpress.org/trunk@44855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 23:05:54 +00:00
Gary Pendergast
65f7cdbce0 Site Health: Improve the "Copy to clipboard" button.
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.


Built from https://develop.svn.wordpress.org/trunk@45044


git-svn-id: http://core.svn.wordpress.org/trunk@44853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 22:31:52 +00:00
Sergey Biryukov
179c2ea230 Plugins: Disable "Update Now" button for plugins that require a higher version of PHP or WordPress.
This complements disabling the "Install Now" button in [43436].

Props afragen.
Fixes #46677. See #43986.
Built from https://develop.svn.wordpress.org/trunk@45043


git-svn-id: http://core.svn.wordpress.org/trunk@44852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 22:11:53 +00:00
Sergey Biryukov
7807324652 Taxonomy: Initialize $noparents variable in wp_ajax_add_tag() to avoid a notice with compact() in PHP 7.3.
Props pilou69.
Fixes #46670.
Built from https://develop.svn.wordpress.org/trunk@45034


git-svn-id: http://core.svn.wordpress.org/trunk@44843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 15:33:52 +00:00
Sergey Biryukov
b2e3f517e1 Database: Use wp_die() instead of die() in wp_check_mysql_version(), for more flexibility and consistency with other error messages in core.
Props spacedmonkey.
Fixes #45975.
Built from https://develop.svn.wordpress.org/trunk@45030


git-svn-id: http://core.svn.wordpress.org/trunk@44839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 14:03:51 +00:00
Sergey Biryukov
6037e5ab5e Plugins: Use correct singular for "Drop-in" in plugins list table.
Props tobifjellner, mukesh27.
Fixes #46592.
Built from https://develop.svn.wordpress.org/trunk@45021


git-svn-id: http://core.svn.wordpress.org/trunk@44830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 00:00:50 +00:00
Sergey Biryukov
8ea4da0826 Privacy: Update default privacy policy text to match the current behavior of setting a temporary cookie on visiting the login page.
Props mechter, subrataemfluence, garrett-eclipse.
Fixes #44175.
Built from https://develop.svn.wordpress.org/trunk@44987


git-svn-id: http://core.svn.wordpress.org/trunk@44818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-23 10:54:53 +00:00
Gary Pendergast
0a9d61ab63 Admin: Introduce the Site Health screens.
The Site Health tool serves two purposes:
- Provide site owners with information to improve the performance, reliability, and security of their site.
- Collect comprehensive debug information about the site.

By encouraging site owners to maintain their site and adhere to modern best practices, we ultimately improve the software hygeine of both the WordPress ecosystem, and the open internet as a whole.

Props Clorith, hedgefield, melchoyce, xkon, karmatosed, jordesign, earnjam, ianbelanger, wpscholar, desrosj, pedromendonca, peterbooker, jcastaneda, garyj, soean, pento, timothyblynjacobs, zodiac1978, dgroddick, garrett-eclipse, netweb, tobifjellner, pixolin, afercia, joedolson, birgire.
See #46573.

Built from https://develop.svn.wordpress.org/trunk@44986


git-svn-id: http://core.svn.wordpress.org/trunk@44817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-23 03:55:53 +00:00
Sergey Biryukov
50bb3c689f Plugins: Remove wp_is_wp_compatible() and wp_is_php_compatible() functions added in [44978] for now, to discuss use cases and better naming.
See #46599, #43992.
Built from https://develop.svn.wordpress.org/trunk@44981


git-svn-id: http://core.svn.wordpress.org/trunk@44812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-22 13:00:52 +00:00
Sergey Biryukov
79e9aa9ed6 Plugins: Use <em> instead of <span> for PHP annotation in wp_plugin_update_row(), for consistency with other instances.
Props afragen.
Fixes #46598. See #43987.
Built from https://develop.svn.wordpress.org/trunk@44980


git-svn-id: http://core.svn.wordpress.org/trunk@44811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-22 01:08:51 +00:00
Sergey Biryukov
8954465943 PHPCS: Fix WPCS violations in [44978].
See #43992.
Built from https://develop.svn.wordpress.org/trunk@44979


git-svn-id: http://core.svn.wordpress.org/trunk@44810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-22 01:00:52 +00:00
Sergey Biryukov
75a3e484ec Plugins: Block plugin activation if it requires a higher version of PHP or WordPress.
Introduce `validate_plugin_requirements()` for validating a plugin's WordPress and PHP version requirements.

Introduce `wp_is_wp_compatible()` and `wp_is_php_compatible()` for checking compatibility with the current WordPress or PHP version.

Props afragen, joyously, DrewAPicture, TimothyBlynJacobs, desrosj, flixos90, SergeyBiryukov.
See #43992.
Built from https://develop.svn.wordpress.org/trunk@44978


git-svn-id: http://core.svn.wordpress.org/trunk@44809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-22 00:37:50 +00:00
desrosj
36af5473be Networks and Sites: Introduce the ms_user_list_site_class filter.
In the network admin user table on multisite installs (`WP_MS_Users_List_Table`), this filter allows the classes for the `<span>` tag surrounding each site link to be modified.

Props kraftbj, flixos90, johnjamesjacoby.
Fixes #41146.
Built from https://develop.svn.wordpress.org/trunk@44977


git-svn-id: http://core.svn.wordpress.org/trunk@44808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 23:55:51 +00:00
Sergey Biryukov
8dcd3a09a8 I18N: Move the strings for default user roles to wp-includes/capabilities.php, to make the translations available on the front end as well.
Props keraweb, ocean90.
Fixes #37539.
Built from https://develop.svn.wordpress.org/trunk@44976


git-svn-id: http://core.svn.wordpress.org/trunk@44807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 22:23:52 +00:00
Sergey Biryukov
30491f2410 Customize: Add a link to theme reviews in the theme details modal in the Customizer and on Add Themes screen.
Props celloexpressions, Travel_girl, Ixium, marco-peralta, dd32.
Fixes #36612.
Built from https://develop.svn.wordpress.org/trunk@44975


git-svn-id: http://core.svn.wordpress.org/trunk@44806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 22:02:51 +00:00
Felix Arntz
3a77265148 Bootstrap/Load: Introduce a recovery mode for fixing fatal errors.
Using the new fatal handler introduced in [44962], an email is sent to the admin when a fatal error occurs. This email includes a secret link to enter recovery mode. When clicked, the link will be validated and on success a cookie will be placed on the client, enabling recovery mode for that user. This functionality is executed early before plugins and themes are loaded, in order to be unaffected by potential fatal errors these might be causing.

When in recovery mode, broken plugins and themes will be paused for that client, so that they are able to access the admin backend despite of these errors. They are notified about the broken extensions and the errors caused, and can then decide whether they would like to temporarily deactivate the extension or fix the problem and resume the extension.

A link in the admin bar allows the client to exit recovery mode.

Props timothyblynjacobs, afragen, flixos90, nerrad, miss_jwo, schlessera, spacedmonkey, swissspidy.
Fixes #46130, #44458.

Built from https://develop.svn.wordpress.org/trunk@44973


git-svn-id: http://core.svn.wordpress.org/trunk@44804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 21:53:51 +00:00
Sergey Biryukov
7d74080b80 Privacy: Introduce Privacy Policy page helpers:
* `is_privacy_policy()` template tag
* `privacy-policy.php` template
* `.privacy-policy` body class
* `.menu-item-privacy-policy` menu item class

Props garrett-eclipse, birgire, xkon, Clorith.
Fixes #44005.
Built from https://develop.svn.wordpress.org/trunk@44966


git-svn-id: http://core.svn.wordpress.org/trunk@44797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 19:48:50 +00:00
Andrea Fercia
03bd75f053 Upgrade/Install: Add missing opening curly bracket after [44513].
Props WebFactory.
Fixes #46563.

Built from https://develop.svn.wordpress.org/trunk@44964


git-svn-id: http://core.svn.wordpress.org/trunk@44795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 18:03:51 +00:00
Sergey Biryukov
99b929cbbc Accessibility: Remove post format filter links from format icons in the Posts list table.
Introduce a dedicated 'Formats' drop-down filter as a replacement.

Keep the icons as a simple visual indicator of the post format for now.

Props afercia, melchoyce, GaryJ, chiaralovelaces, SergeyBiryukov.
Fixes #35497.
Built from https://develop.svn.wordpress.org/trunk@44961


git-svn-id: http://core.svn.wordpress.org/trunk@44792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 15:32:01 +00:00
desrosj
899e7d3800 Posts, Post Types: Add type parameter to post_exists().
This allows post exists checks scoped to a specific post type.

Props sgarza, birgire, swissspidy.
Fixes #37406.
Built from https://develop.svn.wordpress.org/trunk@44959


git-svn-id: http://core.svn.wordpress.org/trunk@44790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 12:44:54 +00:00
tellyworth
e38814f359 Upgrade/Install: Add experimental package signing to some updates.
This adds code for soft verification of signatures for theme and plugin installs and updates, when provided by the update server. This experimental version does not reject unverified packages or failed signatures; it simply reports anonymous errors so we can evaluate its feasibility and detect incompatibilities.

This code relies on the new sodium_compat library for PHP versions prior to 7.2.

Props dd32, paragoninitiativeenterprises.
See #39309, #45806.

Built from https://develop.svn.wordpress.org/trunk@44954


git-svn-id: http://core.svn.wordpress.org/trunk@44785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 05:49:50 +00:00