38077 Commits

Author SHA1 Message Date
Sergey Biryukov
f135660f52 Respect the commenter decision when they have checked the checkbox to consent to cookies, and keep it checked when they reload the page or post another comment.
Props azaozz.
Merges [42815] to the 4.9 branch.
See #43436.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43128 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 22:12:28 +00:00
Sergey Biryukov
b99fbcbec5 Add a checkbox to the comment form so logged out users can opt-out of commenter cookies.
Props lakenh, xkon, birgire, azaozz, johnbillion.
Merges [42772] and [43042] to the 4.9 branch.
See #43436.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43127 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 22:10:30 +00:00
Sergey Biryukov
db99cd18b9 Privacy: Add policy link to login screen.
Personal data collection is more likely for registered users than casual visitors, and the privacy policy might have been updated since a user last logged in. Those changes could impact the collection of personal data from registered users, so it makes sense to provide a link to the policy before users log in.

Props voneff, xkon, melchoyce, chetan200891, desrosj.
Merges [43120] to the 4.9 branch.
Fixes #43721.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43124 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 21:59:34 +00:00
Andrew Ozz
13a5d522bc Privacy: fix typo.
Props casiepa.
Merges [43121] to the 4.9 branch.
Fixes #43939.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43122 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 20:08:00 +00:00
Andrew Ozz
a731b77030 Privacy: fix inconsistencies in new strings.
Props audrasjb.
Merges [43118] to the 4.9 branch.
Fixes #43925.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43119 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 18:50:49 +00:00
Sergey Biryukov
b1b7009e55 Privacy: add user information to the personal data export file.
Props TZ-Media, desrosj.
Merges [43055] and [43116] to the 4.9 branch.
See #43547.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43117 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 04:20:35 +00:00
Sergey Biryukov
2363000d87 Privacy: add better docs for wp_add_privacy_policy_content() and WP_Privacy_Policy_Content::add().
Props azaozz.
Merges [43003] to the 4.9 branch.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43115 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:56:03 +00:00
Sergey Biryukov
e5785300b2 Make the string WordPress translatable.
Props mnelson4.
Merges [42999] to the 4.9 branch.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43114 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:54:05 +00:00
Sergey Biryukov
3aa67d2bf3 Privacy: make the sections in the suggested privacy policy text postbox foldable. Add Read More/Read Less buttons. Fix copying of the suggested text by pressing the button.
Props melchoyce, xkon, azaozz.
Merges [42992] to the 4.9 branch.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43113 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:53:15 +00:00
Sergey Biryukov
fa0102485e Fix typo in 'wp_get_default_privacy_policy_content' filter.
Props claudiu.
Merges [42985] to the 4.9 branch.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43112 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:51:15 +00:00
Sergey Biryukov
e8e4f97a73 Privacy: Limit export and erasure to super admins on Multisite.
Multisite networks have a variety of use cases, and in many of them single-site administrators are not trusted to take actions that affect the whole network, require making decisions about legal compliance, etc. By default, those actions should require super admin capabilities. Plugins can be used to override that behavior if a particular site's use case calls for it.

Props allendav, jeremyfelt, iandunn.
Merges [43085] to the 4.9 branch.
Fixes #43919.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43111 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:48:27 +00:00
Sergey Biryukov
c9b8dffac9 Privacy: improve wp_privacy_erase_personal_data(), return boolean values.
Props ericdaams.
Merges [43061] to the 4.9 branch.
See #43602.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43110 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:43:37 +00:00
Sergey Biryukov
c3a2cff3f8 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.
Merges [43002] to the 4.9 branch.
See #43850.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43109 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:38:23 +00:00
Sergey Biryukov
a9dac1d567 Privacy: add attachments to the personal data export file.
Props allendav.
Merges [43054] to the 4.9 branch.
See #43883.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43108 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:33:22 +00:00
Sergey Biryukov
2d95d0744e I18N: Use consistent pattern for placeholder references in translator comments in wp_ajax_wp_privacy_erase_personal_data().
Merges [43088] to the 4.9 branch.
See #43438.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43107 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:23:58 +00:00
Sergey Biryukov
1fda38f83b Docs: Correct DocBlock formatting for wp_privacy_personal_data_erasers filter.
Merges [43104] to the 4.9 branch.
See #43637.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43106 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:19:54 +00:00
Sergey Biryukov
a0fa0cc602 Privacy: translate error messages, some fixes and improvements for the AJAX actions for exporting and erasing user data.
Props desrosj, birgire.
Merges [43060] to the 4.9 branch.
See #43438.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43105 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:18:19 +00:00
Sergey Biryukov
1fedcb92e2 Privacy: fix and improve the help text about adding a privacy policy page.
Props idea15, xkon.
Merges [43053] to the 4.9 branch.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43103 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:01:03 +00:00
Sergey Biryukov
9d09393bdf Privacy: fix get_privacy_policy_url() to only return the URL when the page is published.
Props azaozz.
Merges [42995] to the 4.9 branch.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43102 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:59:49 +00:00
Sergey Biryukov
45ad7dce3a Privacy: add a postbox that is shown when editing the privacy policy page, and where plugins and core will output suggested content and additional privacy info. First run.
Props melchoyce, azaozz.
Merges [42980] to the 4.9 branch.
See #43620.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43101 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:58:12 +00:00
Sergey Biryukov
5385778b73 Privacy: improve the screen for setting a privacy policy page.
Props melchoyce, xkon, azaozz.
Merges [42978] and [43091] to the 4.9 branch.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43100 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:49:55 +00:00
Sergey Biryukov
f7e3b58c18 Accessibility improvements for the Privacy Tools screen.
Props afercia.
Merges [42823] to the 4.9 branch.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43099 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:47:23 +00:00
Sergey Biryukov
2f90605ce5 Add Privacy Tools admin page under the Tools menu.
Props allendav, xkon, azaozz.
Merges [42814] to the 4.9 branch.
See #43435.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43098 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:45:22 +00:00
Sergey Biryukov
6ed9d96894 Privacy: Include wp-admin/includes/file.php to avoid fatal error.
`list_files()` is defined in `wp-admin/includes/file.php`, which is not included by `wp-cron.php`, so it needs to be included by the caller in order to avoid a fatal PHP error.

This bug was not detected during testing because the file _is_ included when executing jobs via `wp cron event run`.

Props mikejolley, iandunn.
Merges [43059] to the 4.9 branch.
See #43546.
See https://wordpress.slack.com/archives/C9695RJBW/p1525190405000860.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43097 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:37:50 +00:00
Sergey Biryukov
c61485d4cd 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.

Props iandunn.
Merges [43047] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43096 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:34:57 +00:00
Sergey Biryukov
ad1b9dd4bd 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.
Merges [43046] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43095 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:32:57 +00:00
Sergey Biryukov
f7518bfc6b 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.

Props iandunn.
Merges [43045] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43094 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:18:48 +00:00
Sergey Biryukov
9a76fbceab Privacy: fix unit tests after [43012].
Props iandunn.
Merges [43015] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43093 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:16:59 +00:00
Sergey Biryukov
18a8fc5b7a Privacy: add means to export personal data by username or email address. Generate a zipped export file containing all data. First run.
Props allendav.
Merges [43012] and [43089] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43092 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:15:05 +00:00
Sergey Biryukov
db7cfd0afe Privacy: make the emails in export and erasure list-tables clickable.
Props birgire.
Merges [43057] to the 4.9 branch.
See #43911.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43086 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 01:07:43 +00:00
Sergey Biryukov
1d02b207aa 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, desrosj.
Merges [43011] and [43014] to the 4.9 branch.
See #43443.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43084 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 01:03:53 +00:00
Sergey Biryukov
b36469d794 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.
Merges [43008] to the 4.9 branch.
See #43443.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43083 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 01:00:46 +00:00
Sergey Biryukov
ccccd321f6 Privacy: add helper function for anonymizing data in a standardized way.
Props jesperher, allendav, iandunn, birgire, azaozz, joemcgill.
Merges [42971] and [43081] to the 4.9 branch.
Fixes #43545.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43082 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:48:23 +00:00
Sergey Biryukov
f1dce1678f Privacy: add functionality to anonymize commenters.
Props xkon, fclaussen, allendav, birgire, azaozz.
Merges [42994] to the 4.9 branch.
See #43442.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43080 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:20:31 +00:00
Sergey Biryukov
870baf128f Privacy: docs fixes and improvements for wp_comments_personal_data_exporter().
Props desrosj.
Merges [43058] to the 4.9 branch.
See #43440.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43079 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:17:16 +00:00
Sergey Biryukov
799b903c36 Privacy: Fix JSHint errors.
Introduced in [42986].

Props jorbin.
Merges [42989] to the 4.9 branch.
See #43440.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43078 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:14:57 +00:00
Sergey Biryukov
a5d2916bdf Privacy: fix docs, formatting, white space, add tests for the personal data from comments exporter.
Props birgire.
Merges [42987] to the 4.9 branch.
See #43440.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43077 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:11:50 +00:00
Sergey Biryukov
df0de119df Privacy: add functionality for exporting personal data from comments.
Props allendav, xkon.
Merges [42888] to the 4.9 branch.
See #43440.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43076 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:10:36 +00:00
Sergey Biryukov
22f97e1e30 Privacy: add means to erase personal data by username or email address. First run.
Props allendav, coreymckrill, ericdaams, azaozz.
Merges [42986] to the 4.9 branch.
See #43637, #43602.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43075 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:02:01 +00:00
Sergey Biryukov
7ebb5524db Privacy: add support for exporting multiple pages of personal data.
Props allendav.
Merges [42889] to the 4.9 branch.
See #43438.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43074 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:57:42 +00:00
Sergey Biryukov
60248e9a03 Privacy: fix error message and list table sorting errors on the Export Personal Data and Remove Personal Data screens.
Props azaozz.
Merges [42977] to the 4.9 branch.
See #43481.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43073 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:48:21 +00:00
Sergey Biryukov
61018a787a Tests: Update the REST API fixtures.
[42967] included new post statii, but didn't add them to the REST API tests.

Props pento.
Merges [42972] to the 4.9 branch.
See #43481.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43072 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:45:35 +00:00
Sergey Biryukov
253a86bf7c Privacy: add new wp-admin screens for exporting and removing of personal data.
Props melchoyce, mikejolley, allendav, xkon.
Merges [42967] to the 4.9 branch.
See #43481.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43071 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:41:37 +00:00
Sergey Biryukov
d8b5073d64 Privacy: fixes and updates for the method to confirm user requests by email.
- Improve function and variable names.
- Allow extra data to be passed with the request.
- Make the option/user meta names more consistent.
- Adds an inline comment explaining use of hash.

Props mikejolley.
Merges [42964] to the 4.9 branch.
See #43443.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43070 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:36:37 +00:00
Sergey Biryukov
235018e300 Add a method to confirm user requests by email. First run.
Props mikejolley.
Merges [42791] to the 4.9 branch.
See #43443.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43069 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 23:33:17 +00:00
Sergey Biryukov
5e68fb88e6 TinyMCE: Update to 4.7.11.
Props iseulde.
Merges [43004] to the 4.9 branch.
Fixes #43862.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43068 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 22:30:29 +00:00
Sergey Biryukov
d9d156de80 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.
Merges [43001] to the 4.9 branch.
Fixes #42202.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43067 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 22:17:26 +00:00
Sergey Biryukov
ee583a604d Login and Registration: Send nocache_headers() on Multisite account activation pages.
Props herregroen.
Merges [43065] to the 4.9 branch.
Fixes #43917.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43066 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 22:09:09 +00:00
Sergey Biryukov
a6d5c137d8 Privacy: add "Mine" filter for media similarly to posts and comments.
Props audrasjb.
Merged [43056], [43062], [43063] to the 4.9 branch.
Fixes #43820.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43064 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-01 22:03:18 +00:00
Sergey Biryukov
1edae38fde 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.
Merges [43039] to the 4.9 branch.
Fixes #43374. See #40109.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43040 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 04:54:54 +00:00