Commit Graph

38441 Commits

Author SHA1 Message Date
Ian Dunn c07f5272f2 Bundled Themes: Add link to privacy policy page in footer.
If a privacy policy has been set, then a link to it will automatically be shown in the footer.

The element containing the "Proudly powered by WordPress" link was chosen for the new policy link, in order to minimize visual conflicts with custom CSS that was written before the new link existed. Unfortunately, some minor conflicts are expected and unavoidable. Adding this link is required as part of GDPR compliance, and the benefits outweigh the downsides. 

To further mitigate the conflicts, a new `imprint` class was added to the "Proudly powered..." link, in order to facilitate targeting each link invididually with custom styles.

Props xkon, laurelfulford, birgire, azaozz, iandunn.
See #43715.


git-svn-id: https://develop.svn.wordpress.org/trunk@43051 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 06:27:45 +00:00
Peter Wilson e73af26e92 Cron API: Return meaningful values from cron functions.
Return values added to Cron API functions to indicate outcome:

* `wp_schedule_single_event()`, `wp_schedule_event()`, `wp_reschedule_event()` and `wp_unschedule_event()`: boolean indicating success or failure,
* `wp_clear_scheduled_hook()`: integer indicating number of jobs cleared (zero or more), `false` if one or more jobs fail to clear,
* `wp_unschedule_hook()`: integer indicating number of jobs cleared (zero or more), `false` if the jobs fail to clear,
* `spawn_cron()`: boolean indicating whether job spawned,
* `wp_cron()`: integer indicating number of jobs spawned (zero or more), `false` if one or more jobs fail to spawned,
* `_set_cron_array()`: boolean outcome of `update_option()`.

Props evansolomon, jrf, peterwilsoncc, pento for code review.
Fixes #21072.



git-svn-id: https://develop.svn.wordpress.org/trunk@43050 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 02:04:25 +00:00
Boone Gorges 4c36079299 Taxonomy: Ensure that invalid term objects are discarded in `WP_Term_Query`.
The `get_term()` mapping may result in term objects that are `null` or
`WP_Error` when plugins use `get_term` or a related filter. Since `null`
and error objects are not valid results for a term query, we discard
them.

Props GM_Alex.
See #42691.

git-svn-id: https://develop.svn.wordpress.org/trunk@43049 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 21:07:16 +00:00
Andrew Ozz 360d8701aa Privacy: edits and improvements for the default text for a privacy policy.
Props idea15, allendav.
See #43473.

git-svn-id: https://develop.svn.wordpress.org/trunk@43048 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 21:05:34 +00:00
Ian Dunn a159bf4e16 Privacy: Add `wp_privacy_personal_data_export_file_created` filter.
This runs immediately after the data export file has been successfully created, allowing plugins to introduce some workflow customizations. For example, a plugin could password-protect the export file, for peace of mind, even though the CSPRN in the filename makes brute force attacks nearly impossible.

See #43546.


git-svn-id: https://develop.svn.wordpress.org/trunk@43047 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 21:03:31 +00:00
Ian Dunn a1fe96576f Privacy: Add cron to delete expired export files to protect privacy.
The primary means of protecting the files is the CSPRN appended to the filename, but there is no reason to keep the files after the data subject has downloaded them, so deleting them provides an additional layer of protection. Previously this was done from `wp_privacy_generate_personal_data_export_file()`, but that does not guarantee that it will be run regularly, and on smaller sites that could result in export files being exposed for much longer than necessary.

`wp_privacy_delete_old_export_files()` was moved to a front end file, so that it can be called from `cron.php`.

This introduces the `wp_privacy_export_expiration` filter, which allows plugins to customize how long the exports are kept before being deleted.

`index.html` was added to the `$exclusions` parameter of `list_files()` to make sure that it isn't deleted. If it were, then poorly-configured servers would allow the directory to be traversed, exposing all of the exported files.

Props iandunn, desrosj.
See #43546.


git-svn-id: https://develop.svn.wordpress.org/trunk@43046 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 20:08:37 +00:00
Ian Dunn 953e094719 Privacy: Use a CSPRNG in export filenames for more security.
`rand()` is deterministic and therefore offers much less protection in this context. `wp_generate_password()` is a convenient wrapper around `wp_rand()`, which uses `random_int()` to generate cryptographically-secure psuedorandom numbers.

See #43546.


git-svn-id: https://develop.svn.wordpress.org/trunk@43045 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 18:52:59 +00:00
Andrew Ozz 75000c03b7 Privacy: add default text for a privacy policy. First run.
Props xkon, idea15, allendav, azaozz.
See #43473.

git-svn-id: https://develop.svn.wordpress.org/trunk@43044 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 14:46:25 +00:00
John Blackbourn a3c31fcebc Docs: Update the inline docs for `is_protected_meta()`.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43043 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 14:38:56 +00:00
John Blackbourn 37916c2a5f Comments: Update the inline docs following [42772].
See #43436


git-svn-id: https://develop.svn.wordpress.org/trunk@43042 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 13:09:21 +00:00
Andrea Fercia 2e08b275a6 Coding standards: Change a few occurrences of font weight 700 to 600 in multisite signup and activate.
Props chetan200891.
Amends [43018].
See #43897.


git-svn-id: https://develop.svn.wordpress.org/trunk@43041 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 07:04:12 +00:00
Sergey Biryukov a2b95a643f Themes: Avoid a PHP 7.2 warning in `get_theme_roots()` when `$wp_theme_directories` is an uncountable value.
See [41174] for `wp_get_themes()` and `get_raw_theme_root()`.

Props burlingtonbytes, teddytime, lbenicio, desrosj.
Fixes #43374. See #40109.

git-svn-id: https://develop.svn.wordpress.org/trunk@43039 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 04:50:52 +00:00
Sergey Biryukov 451ba4c401 General: Introduce a polyfill for `is_iterable()` function added in PHP 7.1.
Props jrf, schlessera, desrosj.
See #43619.

git-svn-id: https://develop.svn.wordpress.org/trunk@43036 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 04:14:30 +00:00
Sergey Biryukov 8edb00171c General: Introduce a polyfill for `is_countable()` function added in PHP 7.3.
Props jrf, ayeshrajans, desrosj.
See #43583.

git-svn-id: https://develop.svn.wordpress.org/trunk@43034 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 03:42:46 +00:00
Sergey Biryukov a1327b5eb6 Help/About: Move "Get involved" link on Credits screen to the top of the page for better visibility.
Props bridgetwillard, desrosj.
See #23348.

git-svn-id: https://develop.svn.wordpress.org/trunk@43032 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 03:15:23 +00:00
Sergey Biryukov 0041e393c1 Login and Registration: Send `nocache_headers()` on Multisite signup pages.
Props herregroen.
Fixes #43843.

git-svn-id: https://develop.svn.wordpress.org/trunk@43030 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 23:04:28 +00:00
Sergey Biryukov a6fa935244 Docs: Update `@since` version for `theme_templates` filter added in [43025].
See #43872.

git-svn-id: https://develop.svn.wordpress.org/trunk@43027 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 22:42:00 +00:00
Sergey Biryukov a0a8246734 Themes: Introduce `theme_templates` filter for page templates of all post types.
This complements the `theme_{$post_type}_templates` dynamic filter added in [38951].

Props desrosj.
Fixes #43872.

git-svn-id: https://develop.svn.wordpress.org/trunk@43025 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 22:17:20 +00:00
Sergey Biryukov a8a0adbaf7 Docs: Remove backtick-escaping around a core function in the hook docs for the `pre_prepare_themes_for_js` filter.
This allows the function to be auto-linked in the Developer Reference. Added in [42877].

See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@43024 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 21:46:54 +00:00
Sergey Biryukov dffed6639e Docs: Remove backtick-escaping around a core function in the hook docs for the `comment_form_submit_button` filter.
This allows the function to be auto-linked in the Developer Reference. See [32037] for `comment_form_submit_field`.

See #42505, #31888.

git-svn-id: https://develop.svn.wordpress.org/trunk@43023 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 21:43:17 +00:00
Sergey Biryukov 9192d7ab71 Docs: Add missing verb in `is_admin()`, `is_blog_admin()`, `is_network_admin()`, `is_user_admin()` descriptions.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@43022 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 21:13:49 +00:00
Andrea Fercia 518c7ab6ac Coding standards: Change one occurrence of font weight 700 to 600.
Props chetan200891.
Amends [43018].
See #43897.


git-svn-id: https://develop.svn.wordpress.org/trunk@43021 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 18:03:29 +00:00
Andrea Fercia 52e28b4085 Accessibility: Improve the Themes Installer navigation buttons accessibility.
- really disables buttons when they look disabled (when navigation is at the first or last theme)
- when navigation is at the first or last theme, moves focus to the other navigation button, to avoid a focus loss
- improves the buttons visually hidden accessibility text

Props walbo, afercia.
Fixes #36627.


git-svn-id: https://develop.svn.wordpress.org/trunk@43020 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 17:03:56 +00:00
Andrea Fercia 75ca3d6386 Accessibility: Better color contrast for the tables pagination links.
By making the pagination links use the default style for buttons, color contrast
is improved and the CSS is simplified. Improves consistency with other UI controls.
Also, slightly increases the white space below the pagination links.

Props benoitchantre, afercia.
Fixes #41858.


git-svn-id: https://develop.svn.wordpress.org/trunk@43019 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 16:24:41 +00:00
Andrea Fercia b3836882ef Coding standards: Use numeric font weights instead of keywords.
Fixes #43897.


git-svn-id: https://develop.svn.wordpress.org/trunk@43018 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-29 11:36:53 +00:00
John Blackbourn 6eef5a6234 Docs: Correct the possible return types for the `wpdb::query()` method.
Props isabel104

See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43017 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-28 14:43:36 +00:00
John Blackbourn c71a898f78 Formatting: Begin the process of improving the docs for KSES related functions.
See #33801


git-svn-id: https://develop.svn.wordpress.org/trunk@43016 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-28 13:57:32 +00:00
Andrew Ozz 6173287317 Privacy: fix unit tests after [43012].
Props iandunn.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/trunk@43015 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-28 12:10:13 +00:00
Andrew Ozz bf1ddda65f Fix docs and white space.
Props desrosj.
See #43443.

git-svn-id: https://develop.svn.wordpress.org/trunk@43014 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-28 12:03:09 +00:00
John Blackbourn 790f1ef5da Build/Test Tools: Don't trigger the global variable override PHPCS sniff for core.
Props jrf

Fixes #43776


git-svn-id: https://develop.svn.wordpress.org/trunk@43013 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-28 00:44:50 +00:00
Andrew Ozz da5dc711a5 Privacy: add means to export personal data by username or email address. Generate a zipped export file containing all data. First run.
Props allendav.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/trunk@43012 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 19:53:37 +00:00
Andrew Ozz a0c3fab75b Privacy: update and enhance the method to confirm user requests by email. Introduce WP_User_Request to hold all request vars similarly to WP_Post.
Props mikejolley.
See #43443.


git-svn-id: https://develop.svn.wordpress.org/trunk@43011 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 17:30:28 +00:00
Felix Arntz f9d314aaf7 Multisite: Add meta query functionality to `WP_Site_Query`.
After the introduction of site metadata in [42836], it should be possible to query sites by that data.

Fixes #40229.


git-svn-id: https://develop.svn.wordpress.org/trunk@43010 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 11:40:35 +00:00
Felix Arntz 1e9d46387c Bootstrap: Load `class-wp-meta-query.php` earlier in `wp-settings.php`.
This change is necessary to enable multisite-specific meta query functionality during the multisite bootstrap process.

Fixes #40948. See #40229.


git-svn-id: https://develop.svn.wordpress.org/trunk@43009 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 11:36:47 +00:00
Andrew Ozz 11d594e3a8 Privacy: update the method to confirm user requests by email. Use a single CPT to store the requests and to allow logging/audit trail.
Props mikejolley.
See #43443.


git-svn-id: https://develop.svn.wordpress.org/trunk@43008 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 10:12:01 +00:00
Gary Pendergast 0907ed4894 REST API: Include `viewable` attribute on Post Type resource for `edit` context
For the block editor to be able to expose the Preview button correctly, it needs to know the `is_post_type_viewable()` setting, this change adds it to the Post Type response.

Props danielbachhuber.
Fixes #43739.



git-svn-id: https://develop.svn.wordpress.org/trunk@43007 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-27 03:05:40 +00:00
Felix Arntz 41b6e0da34 General: Implement editorial, design and accessibility feedback for the PHP version nag.
The updated version of the nag is shorter, more on point and less aggressive than the previous one. It integrates better with the other dashboard widgets and fixes several accessibility concerns. A yellow warning color is used when the current PHP version is outdated, a red error color is used when it is also insecure.

Props afercia, birgire, danieltj, flixos90, johnjamesjacoby, karmatosed, Luciano Croce, nerrad, pento, schlessera, SergeyBiryukov, sonjaleix.

Fixes #41191.


git-svn-id: https://develop.svn.wordpress.org/trunk@43006 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-26 14:30:24 +00:00
Felix Arntz 79bf20d320 Tests: Skip multisite-only or single site-only tests correctly based on test doc annotations.
Without the `ms-required` and `ms-excluded` groups being marked as excluded in the PHPUnit configurations for the project, those groups were still executed, causing fatal errors. Checking against the groups in the correct structure of the array returned from PHPUnit's `Testcase::getAnnotations()` ensures that those tests are skipped properly.

Fixes #43863.


git-svn-id: https://develop.svn.wordpress.org/trunk@43005 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-25 22:37:08 +00:00
Ella Van Dorpe f6c215c8bf TinyMCE: Update to 4.7.11
git-svn-id: https://develop.svn.wordpress.org/trunk@43004 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-25 22:34:41 +00:00
Andrew Ozz 6cd0ee3b7a Privacy: add better docs for `wp_add_privacy_policy_content()` and `WP_Privacy_Policy_Content::add()`.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/trunk@43003 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-25 18:10:00 +00:00
Ian Dunn d336475bf5 Privacy: Add template tags for building link to privacy policy page.
This introduces the `get_the_privacy_policy_link()` and `the_privacy_policy_link()` functions, as well as the `privacy_policy_url` filter.

A new `tests/url/` folder was added to better organize tests related to `get_*_url()` functions. Previously, those tests were placed in `tests/url.php` and `tests/link/`, but neither of those locations are optimal. Placing tests in `tests/url.php` violates the guideline of creating separate files/classes for each function under test, and using `tests/link/` conflates two distinct -- albeit related -- groups of functions. Over time, URL-related tests can be migrated to the new folder.

Props birgire, xkon, azaozz, iandunn.
See #43850.


git-svn-id: https://develop.svn.wordpress.org/trunk@43002 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-25 15:54:29 +00:00
Gary Pendergast 50e9639f22 REST API: Add `who=authors` as a query parameter for `GET wp/v2/users`.
Any WordPress user who can `edit_posts` of a post type with `show_in_rest=true` can query for authors. This maps to current WordPress behavior where a WordPress user who can view the Manage Posts view for a post type can see any WordPress user assigned to a post (whether published or draft).

This implementation, over restricting `who=authors` to users with `list_users`, gives us future flexibility in displaying lists of posts. It still respects more restrictive permissions for `context=edit`.

Props danielbachhuber.
Fixes #42202.



git-svn-id: https://develop.svn.wordpress.org/trunk@43001 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-25 13:05:48 +00:00
Andrew Ozz 6bee78edcf Privacy: fix styling of counts on the list tables for user requests.
Props allendav.
Fixes #43846.

git-svn-id: https://develop.svn.wordpress.org/trunk@43000 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-24 21:34:59 +00:00
Andrew Ozz 84251cc161 Make the string `WordPress` translatable.
Props mnelson4.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/trunk@42999 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-24 21:22:52 +00:00
Felix Arntz f3150c77c5 Plugins: Show the required PHP version in the plugin details view, if specified.
Props xkon.
Fixes #43650.


git-svn-id: https://develop.svn.wordpress.org/trunk@42998 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-24 11:40:25 +00:00
Gary Pendergast f9e4467b3d REST API: Remove `permalink_structure` from the index.
This was originally added to allow Gutenberg to do permalink editing, but is no longer required. It's also superceded by #41014.

Reverts [42142].
Fixes #42465.



git-svn-id: https://develop.svn.wordpress.org/trunk@42997 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-23 04:11:42 +00:00
Anton Timmermans db0a8af84b Docs: Improve JSDoc for `wp-includes/js/wp-backbone.js`.
Changes some additional docs after [42993].

Props birgire, adamsilverstein, netweb.
Fixes #35465.


git-svn-id: https://develop.svn.wordpress.org/trunk@42996 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-22 14:36:23 +00:00
Andrew Ozz c9aaa0ddb7 Privacy: fix `get_privacy_policy_url()` to only return the URL when the page is published.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/trunk@42995 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-20 14:43:26 +00:00
Andrew Ozz 7e26130f12 Privacy: add functionality to anonymize commenters.
Props xkon, fclaussen, allendav, birgire, azaozz.
See #43442.

git-svn-id: https://develop.svn.wordpress.org/trunk@42994 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-20 12:18:35 +00:00
Anton Timmermans ad13b8bbda Docs: Improve JSDoc for `wp-includes/js/wp-backbone.js`.
Props ericlewis, gma992, adamsilverstein.
Fixes #35465.


git-svn-id: https://develop.svn.wordpress.org/trunk@42993 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-19 14:01:48 +00:00