Commit Graph

6410 Commits

Author SHA1 Message Date
Sergey Biryukov e4a1254255 Site Health: Use `WP_Automatic_Updater::is_disabled()` to check whether automatic updates are disabled.
The previous check for `DISALLOW_FILE_MODS` and `AUTOMATIC_UPDATER_DISABLED` constants didn't always provide accurate results.

Props Clorith, kraftner, afragen.
Fixes #47869.

git-svn-id: https://develop.svn.wordpress.org/trunk@46276 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 20:51:38 +00:00
Sergey Biryukov a9fb2f6a38 Site Health: Introduce `site_status_test_result` filter for the output of a finished Site Health test.
Props Clorith.
Fixes #47864.

git-svn-id: https://develop.svn.wordpress.org/trunk@46269 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 20:03:15 +00:00
Sergey Biryukov 9a105cf004 Site Health: Update PHP extension tests to reflect the current state of the Hosting Teams handbook recommendations.
Props Clorith, bronsonquick, jrf, johnbillion, galbaras, mikeschroder, jorbin.
Fixes #47454.

git-svn-id: https://develop.svn.wordpress.org/trunk@46268 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 19:49:06 +00:00
Sergey Biryukov 13be30f493 Site Health: Improve wording for PHP update warning.
Props danieltj, garrett-eclipse, marybaum, afragen, chetan200891.
Fixes #47644.

git-svn-id: https://develop.svn.wordpress.org/trunk@46267 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 19:38:56 +00:00
Sergey Biryukov 06868d4d12 Privacy: Introduce `wp_privacy_personal_data_email_to` and `wp_privacy_personal_data_email_subject` filters.
Pass email data to the `wp_privacy_personal_data_email_content` filter.

Props garrett-eclipse, thakkarhardik, birgire.
Fixes #46303.

git-svn-id: https://develop.svn.wordpress.org/trunk@46265 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 19:24:20 +00:00
Sergey Biryukov 7ae0a5985f Privacy: Show a success message for personal data erasure.
Props garrett-eclipse, allendav, birgire, JoshuaWold, karmatosed, pputzer.
Fixes #44135.

git-svn-id: https://develop.svn.wordpress.org/trunk@46264 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 19:12:04 +00:00
John Blackbourn 027710ef8e Taxonomy: Redirect to the correct URL after deleting a taxonomy term attached to a post type other than Post.
Props donmhico, mukesh27

Fixes #47858


git-svn-id: https://develop.svn.wordpress.org/trunk@46263 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 19:09:54 +00:00
Jonathan Desrosiers 2b076b7709 Coding Standards: Fix a coding standards issue introduced in [46254].
See #37392.

git-svn-id: https://develop.svn.wordpress.org/trunk@46261 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 18:33:10 +00:00
Andrea Fercia 0ff03b3290 Login and Registration: Add a "Show password" button on the login page.
The ability for users to see the password they're typing improves usability and accessibility of the login users flow.

- brings the login screen in line with the same feature already used in the New User, Edit User, and Reset Password pages
- improves association of labels and input fields by using explicit association with `for` / `id` attributes
- slightly increases the "Remember me" label font size

Props johnbillion, Iceable, audrasjb, joyously, adamsilverstein, boemedia, DrewAPicture, shadyvb, birgire, peterwilsoncc, pento, anevins, davidbaumwald, whyisjake, afercia.
Fixes #42888.


git-svn-id: https://develop.svn.wordpress.org/trunk@46256 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 18:05:16 +00:00
John James Jacoby 1c69792253 Multisite/Sites: supplemental commit to r46251.
This commit adds the links to the list-table class itself (that were missed in r46251.)

See #37392. Props pbiron, thomaswm.



git-svn-id: https://develop.svn.wordpress.org/trunk@46254 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 17:50:22 +00:00
Ella van Durpe 83dd94f3a8 Editor: Add Nonce Endpoint
This is a follow up to #47843, implementing a PHP endpoint and inline scripts 
after the editor package updates. The action was originally added in
https://github.com/WordPress/gutenberg/pull/16683.

Fixes #48076.




git-svn-id: https://develop.svn.wordpress.org/trunk@46253 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 17:46:33 +00:00
John James Jacoby f2b03e208a Multisite/Sites: Add links to filter websites by status.
This commit brings the Network-Admin Sites list page up-to-speed with other similar list-table powered pages, by adding links to filter the results by Site Status.

Includes a single unit test for the newly introduced `wp_count_sites()` multisite function, named to match the `wp_count_` function pattern from other list tables.

Fixes #37392. Props mnelson4, spacedmonkey, pbiron.



git-svn-id: https://develop.svn.wordpress.org/trunk@46251 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 17:34:20 +00:00
Andrea Fercia aba005be39 Accessibility: Make sortable meta boxes non sortable when there are no locations they can be dragged to.
Depending on the amount of meta boxes and the layout settings under Screen Options, sortable meta boxes may not be actually sortable.
In these cases, jQuery UI sortable needs to be disabled and the user interface shouldn't use a CSS `cursor: move`.

The use of consistent and relevant cursors may be important for users who have a cognitive disability, since cursors give a visual clue as to an element's functionality. Using the move cursor for elements which cannot be moved may be confusing or counter-intuitive for users.

Props adamsilverstein, antpb, anevins.
Fixes #47131.


git-svn-id: https://develop.svn.wordpress.org/trunk@46250 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 17:29:46 +00:00
Andrea Fercia e3db9a1361 Accessibility: Improve and modernize user interface controls. Sixth part: allow checkboxes and radio buttons to scale with text.
- uses a SVG icon for checkboxes
- uses CSS `rem` relative units

Props kjellr, afercia, audrasjb.
Fixes #47498.


git-svn-id: https://develop.svn.wordpress.org/trunk@46248 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 16:50:17 +00:00
Andrea Fercia e994411a99 Accessibility: Improve and modernize user interface controls for better contrast. Fifth part: Common form controls.
Props anevins, melchoyce, audrasjb, kjellr.
Fixes #47153.


git-svn-id: https://develop.svn.wordpress.org/trunk@46247 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 16:20:24 +00:00
Anthony Burchell 3363eaa22d Media: Sets `post_id` optional in `media_sideload_image()` and `media_handle_sideload()`.
Props SergeyBiryukov, donmhico, mikeschroder, sebastian.pisula.
Fixes #43579.


git-svn-id: https://develop.svn.wordpress.org/trunk@46245 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 16:02:38 +00:00
Andrea Fercia 3f58ce59d7 Accessibility: Improve and modernize user interface controls. Third part: allow buttons and form controls to scale with text.
Props kjellr, abrightclearweb, audrasjb.
Fixes #47477.


git-svn-id: https://develop.svn.wordpress.org/trunk@46243 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 15:26:23 +00:00
Andrea Fercia 82bded36f8 Accessibility: Improve and modernize user interface controls for better contrast. Second part: tables, meta boxes, and other user interface elements.
Introduces better contrast for borders of the following user interface elements:
- Tables
- Screen Options and Help 
- Admin notices
- Welcome panel
- Meta boxes (post boxes)
- Cards
- Health Check accordions and headings
- Theme and Plugin upload forms

Props kjellr, melchoyce, karmatosed, audrasjb.
Fixes #48101.


git-svn-id: https://develop.svn.wordpress.org/trunk@46242 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 15:09:59 +00:00
Andrea Fercia 94211aeb05 Accessibility: Improve and modernize user interface controls for better contrast. First part: buttons and links.
- Introduces new styles for the buttons, with better contrast for borders and better focus style.
- Introduces a new focus style for links.
- The new styles improve consistency with the ones used in the new Block Editor (Gutenberg).

Props michaelarestad, truchot, mor10, kellychoffman, adamsoucie, paaljoachim, Joen, kjellr, melchoyce, karmatosed, audrasjb, afercia.
Fixes #34904.


git-svn-id: https://develop.svn.wordpress.org/trunk@46241 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 14:42:36 +00:00
Andrea Fercia 42b5133a25 Accessibility: Menus: Improve the menu items "Select All".
- changes "Select All" from a link to a checkbox
- the new checkbox is available only when JavaScript support is on
- semantically and for accessibility, a checkbox is a better user interface control because the available action is clear to all users and the selected state is communicated natively
- it's consistent with the existing pattern for the admin tables

Props birgire, audrasjb, afercia.
Fixes #47048.


git-svn-id: https://develop.svn.wordpress.org/trunk@46240 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-23 12:41:14 +00:00
John Blackbourn 6bd7097626 Docs: Docblock corrections and improvements, mostly related to various `pre_*` filters.
See #47110


git-svn-id: https://develop.svn.wordpress.org/trunk@46232 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 17:40:58 +00:00
Dominik Schilling 144c5f760d Site Health: Don't verify SSL certificate when testing the local site.
The SSL certificate may be self-signed which prevents various tests from returning proper results. Since the Cron API and file editors don't verify the certificate the tests shouldn't either.

Props Clorith, ocean90.
Fixes #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46231 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 16:05:13 +00:00
Dominik Schilling e6ea695f5a File Editor: Don't verify SSL certificate when doing loopback requests for checking for fatal errors.
Props Clorith.
See #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46230 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 15:58:38 +00:00
Dominik Schilling 39fff01a1f Site Health: Replace `wp_get_upload_dir()` with `wp_upload_dir()`.
`wp_get_upload_dir()` returns the theoretical path of the uploads directory. When there was no upload yet the test returns an incorrect result (not writeable) because the directory doesn't exist. Switching to `wp_upload_dir()`, which creates the directory on the fly, ensures a proper test result.

Fixes #47958.

git-svn-id: https://develop.svn.wordpress.org/trunk@46228 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-21 15:48:56 +00:00
Sergey Biryukov f3a0da9fca Code Modernization: Remove a workaround for `IMAGETYPE_ICO` in `file_is_displayable_image()`.
The `IMAGETYPE_ICO` constant was introduced in PHP 5.3, so no longer needs a workaround.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46217 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 22:17:48 +00:00
Jonathan Desrosiers 8de962479d Docs: Add missing `$which` parameter descriptions.
Follow up of [46211].

See #45954.

git-svn-id: https://develop.svn.wordpress.org/trunk@46212 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:56:49 +00:00
Jonathan Desrosiers e31bd15ab5 Networks and Sites: Add support for the `extra_tablenav()` method in `WP_MS_Sites_List_Table`.
This method allows additional filters or other UI components to be added to the top and bottom of the `WP_List_Table` between the bulk actions dropdown and search input field.

Fixes #45954.
Props pbiron, desrosj.

git-svn-id: https://develop.svn.wordpress.org/trunk@46211 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:52:58 +00:00
Sergey Biryukov 6b65af939f Code Modernization: Remove conditional use of PHP `realpath()`.
The `realpath()` function was introduced in PHP 4.0.0. There's no point in checking if the function exists in PHP 5.6+, in only 2 instances out of 29.

Props jrf.
Fixes #48075.

git-svn-id: https://develop.svn.wordpress.org/trunk@46210 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:45:58 +00:00
Sergey Biryukov 6922b15e3a Privacy: Display group items count in the personal data export file if there's more than one item in the group.
Props birgire, garrett-eclipse, pputzer.
Fixes #46895.

git-svn-id: https://develop.svn.wordpress.org/trunk@46209 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:29:30 +00:00
Adam Silverstein dcd3371c3b Media: make search input full width on mobile. Take two.
Props m1tk00.
Fixes #40130.



git-svn-id: https://develop.svn.wordpress.org/trunk@46207 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:07:53 +00:00
Jonathan Desrosiers f6b8632508 Code Modernization: Remove JSON extension workarounds for PHP < 5.6.
The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

This change removes code that supported JSON related functionality on older versions of PHP. This includes (but is not limited to) checks that `json_last_error()` exists, checking and setting the `JSON_UNESCAPED_SLASHES` and `JSON_PRETTY_PRINT` constants if not previously defined, and deprecating the `_wp_json_prepare_data()` function (which was 100% workaround code).

Follow up of [46205].

See #47699.
Props jrf, Clorith, pento.

git-svn-id: https://develop.svn.wordpress.org/trunk@46206 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 20:07:28 +00:00
Andrew Ozz 388e7fe7f4 Admin email verification:
- Fix wording of the HTML title.
- Add hidden `(opens in a new tab)` to links that need it.
- Add the `screen-reader-text` CSS class to login.css.
- Add another translator comment.

Props afercia.
See #46349.


git-svn-id: https://develop.svn.wordpress.org/trunk@46203 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 18:50:19 +00:00
Andrew Ozz 89939327e3 Media/Upload: rotate images on upload according to EXIF Orientation.
Props msaggiorato, wpdavis, markoheijnen, dhuyvetter, msaggiorato, n7studios, triplejumper12, pbiron, mikeschroder, joemcgill, azaozz.

Fixes #14459.

git-svn-id: https://develop.svn.wordpress.org/trunk@46202 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 18:20:26 +00:00
Jonathan Desrosiers a4e8fe2145 Site Health: Use sentence casing consistently in header tags.
Props SergeyBiryukov, ajayghaghretiya1, ronakganatra, mukesh27, Clorith.
Fixes #47298.

git-svn-id: https://develop.svn.wordpress.org/trunk@46199 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:25:38 +00:00
Sergey Biryukov 1a6d41b4d6 Docs: Add `@since` tag for the new `$position` argument added to `add_submenu_page()` and related functions in [46197].
See #39776.

git-svn-id: https://develop.svn.wordpress.org/trunk@46198 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 17:05:26 +00:00
Adam Silverstein 78e8100b6b Menus: add a position argument to `add_submenu_page` and the helper functions that use it.
Add a position argument to the `add_submenu_page` function similar to the one already in `add_menu_page`. When adding sub menus enables setting the position in the sub menu where the item should appear.

In addition, add the position argument to functions that call `add_submenu_page` under the hood: `add_management_page`, `add_options_page`, `add_theme_page`, `add_plugins_page`, `add_users_page`, `add_dashboard_page`, `add_posts_page`, `add_media_page`, `add_links_page`, `add_pages_page` and `add_comments_page`.

Props welcher, birgire, alexvorn2.
Fixes #39776.



git-svn-id: https://develop.svn.wordpress.org/trunk@46197 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-20 14:59:04 +00:00
Jake Spurlock a63e490a1e Multisite: Remove the redundant `blog_versions` table.
As part of the Multisite installation process, a `blog_versions` table is created. This table is never read from (except immediately prior to updating it), it's only ever inserted into or updated. It is not used to determine which blogs need to be upgraded.
This table was introduced in 3.0 when the WPMU schema was merged #11644 and it appears the table has never been used in core and is therefore redundant and may as well be removed.

Props johnbillion, nacin, ryan, johnjamesjacoby, whyisjake.

Fixes #19755. See #41685.



git-svn-id: https://develop.svn.wordpress.org/trunk@46194 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 22:06:41 +00:00
Jake Spurlock c0ad8e700f Networks and Sites: Save database version in site meta (Multisite)
Currently there is there a table in multisite called blog_versions. All this table stores is the database version as number and the date updated. With plans to add site meta in #37923 this new table should be used. This has a number of benefits, including functions to CRUD these values in the database. Once this data is in the blogmeta, table, the blog_versions table can be removed all together. If require a SQL view can be used blog_versions from data stored in blogmeta.

Props spacedmonkey, leogermani.

Fixes #41685. See #19755.



git-svn-id: https://develop.svn.wordpress.org/trunk@46193 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 21:41:35 +00:00
Jonathan Desrosiers 3514a52019 PHP 7.4: Fix another instance of array access on a datatype that cannot be accessed as an array.
PHP 7.4 adds a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array.

Follow up of [45639].

Props desrosj, jrf.
See #47704.

git-svn-id: https://develop.svn.wordpress.org/trunk@46185 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 14:29:30 +00:00
Andrew Ozz 20a17438d0 Uploads: add helper functions for setting, getting, and deleting the temp upload reference used to the attachment_id when retrying to make image sub-sizes.
See #47872.

git-svn-id: https://develop.svn.wordpress.org/trunk@46174 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 01:25:14 +00:00
Jake Spurlock 8029e23ffe Accessibility: Replace wp-a11y.js with @wordpress/a11y package
We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure webpack to load is an external.

Props omarreiss, herregroen, desrosj, ocean90, afercia, sstoqnov



git-svn-id: https://develop.svn.wordpress.org/trunk@46167 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 17:40:35 +00:00
Jonathan Desrosiers 45f1fbbceb Docs: Add missing descriptions for functions in `wp-admin/update-core.php`.
Also, fix the `@since` annotation added in [45480] to include the correct version.

Props SergeyBiryukov, ajayghaghretiya1.
Fixes #47424.

git-svn-id: https://develop.svn.wordpress.org/trunk@46161 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 20:42:57 +00:00
Jonathan Desrosiers 352665d6df General: Ensure the arguments passed to `implode()` are in the correct order.
The `implode()` function accepts two. parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

This change fixes the occurrences of reversed arguments in Core with the exception of those contained in included external libraries. These will be handled separately.

Props jrf, jorbin.
See #47746.

git-svn-id: https://develop.svn.wordpress.org/trunk@46155 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 13:39:15 +00:00
John James Jacoby 7cbb1f32a3 Network Admin: Allow Sites to have filterable States in List Table rows.
This change introduces a new `site_states()` method to the Sites List Table class (with a new `display_site_states` filter inside of it) following the pattern popularized in other List Table classes before it (Posts, Media, etc...)

Fixes #37684. Props mnelson4, pbiron, jeremyfelt, johnjamesjacoby.

git-svn-id: https://develop.svn.wordpress.org/trunk@46153 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 23:33:45 +00:00
Sergey Biryukov 1ace25088f Code Modernisation: Replace `call_user_func_array()` in various `__call()` methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46144 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:53:01 +00:00
Sergey Biryukov fd05ea0de9 Code Modernisation: Replace `call_user_func_array()` in `wp-admin/includes/widgets.php` and associated unit tests with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46138 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:40:08 +00:00
Sergey Biryukov 751f69be42 Code Modernisation: Replace `call_user_func_array()` in `wp-admin/includes/template.php` with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46137 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:34:23 +00:00
Sergey Biryukov f16a56ca41 Code Modernisation: Replace `call_user_func_array()` in `wp-admin/includes/ajax-actions.php` with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46136 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:33:20 +00:00
Sergey Biryukov 49de2b7312 Code Modernisation: Introduce the spread operator in `wp-admin/includes/media.php`.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46131 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:11:14 +00:00
Sergey Biryukov 752c36bbf4 Code Modernisation: Introduce the spread operator in `wp-admin/includes/dashboard.php`.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46130 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:10:17 +00:00