<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[45448] trunk: Privacy tools: Organize privacy functions into logical files and classes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/45448">45448</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/45448","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-05-26 20:49:04 +0000 (Sun, 26 May 2019)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy tools: Organize privacy functions into logical files and classes.

Props xkon, birgire, desrosj, garrett-eclipse, azaozz.
See <a href="https://core.trac.wordpress.org/ticket/43895">#43895</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunksrcjs_enqueuesadminxfnjs">trunk/src/js/_enqueues/admin/xfn.js</a></li>
<li><a href="#trunksrcwpadminincludesadminfiltersphp">trunk/src/wp-admin/includes/admin-filters.php</a></li>
<li><a href="#trunksrcwpadminincludesadminphp">trunk/src/wp-admin/includes/admin.php</a></li>
<li><a href="#trunksrcwpadminincludesdeprecatedphp">trunk/src/wp-admin/includes/deprecated.php</a></li>
<li><a href="#trunksrcwpadminincludeslisttablephp">trunk/src/wp-admin/includes/list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesmiscphp">trunk/src/wp-admin/includes/misc.php</a></li>
<li><a href="#trunksrcwpadminincludespluginphp">trunk/src/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunksrcwpadminincludesupgradephp">trunk/src/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunksrcwpadminincludesuserphp">trunk/src/wp-admin/includes/user.php</a></li>
<li><a href="#trunksrcwpadminmenuphp">trunk/src/wp-admin/menu.php</a></li>
<li><a href="#trunksrcwpadmintoolsphp">trunk/src/wp-admin/tools.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueuesadminprivacytoolsjs">trunk/src/js/_enqueues/admin/privacy-tools.js</a></li>
<li><a href="#trunksrcwpadminerasepersonaldataphp">trunk/src/wp-admin/erase-personal-data.php</a></li>
<li><a href="#trunksrcwpadminexportpersonaldataphp">trunk/src/wp-admin/export-personal-data.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacydataexportrequestslisttablephp">trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacydataremovalrequestslisttablephp">trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacypolicycontentphp">trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacyrequeststablephp">trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php</a></li>
<li><a href="#trunksrcwpadminincludesprivacytoolsphp">trunk/src/wp-admin/includes/privacy-tools.php</a></li>
<li><a href="#trunksrcwpadminoptionsprivacyphp">trunk/src/wp-admin/options-privacy.php</a></li>
<li><a href="#trunksrcwpadminprivacypolicyguidephp">trunk/src/wp-admin/privacy-policy-guide.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunksrcwpadminprivacyphp">trunk/src/wp-admin/privacy.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/Gruntfile.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/Gruntfile.js        2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/Gruntfile.js  2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,6 +264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        [ WORKING_DIR + 'wp-admin/js/tags-suggest.js' ]: [ './src/js/_enqueues/admin/tags-suggest.js' ],
</span><span class="cx" style="display: block; padding: 0 10px">                                        [ WORKING_DIR + 'wp-admin/js/tags.js' ]: [ './src/js/_enqueues/admin/tags.js' ],
</span><span class="cx" style="display: block; padding: 0 10px">                                        [ WORKING_DIR + 'wp-admin/js/site-health.js' ]: [ './src/js/_enqueues/admin/site-health.js' ],
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        [ WORKING_DIR + 'wp-admin/js/privacy-tools.js' ]: [ './src/js/_enqueues/admin/privacy-tools.js' ],
</ins><span class="cx" style="display: block; padding: 0 10px">                                         [ WORKING_DIR + 'wp-admin/js/theme-plugin-editor.js' ]: [ './src/js/_enqueues/wp/theme-plugin-editor.js' ],
</span><span class="cx" style="display: block; padding: 0 10px">                                        [ WORKING_DIR + 'wp-admin/js/theme.js' ]: [ './src/js/_enqueues/wp/theme.js' ],
</span><span class="cx" style="display: block; padding: 0 10px">                                        [ WORKING_DIR + 'wp-admin/js/updates.js' ]: [ './src/js/_enqueues/wp/updates.js' ],
</span></span></pre></div>
<a id="trunksrcjs_enqueuesadminprivacytoolsjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/js/_enqueues/admin/privacy-tools.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/admin/privacy-tools.js                             (rev 0)
+++ trunk/src/js/_enqueues/admin/privacy-tools.js       2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,256 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Interactions used by the User Privacy tools in WordPress.
+ *
+ * @output wp-admin/js/privacy-tools.js
+ */
+
+// Privacy request action handling
+jQuery( document ).ready( function( $ ) {
+       var strings = window.privacyToolsL10n || {};
+
+       function setActionState( $action, state ) {
+               $action.children().hide();
+               $action.children( '.' + state ).show();
+       }
+
+       function clearResultsAfterRow( $requestRow ) {
+               $requestRow.removeClass( 'has-request-results' );
+
+               if ( $requestRow.next().hasClass( 'request-results' ) ) {
+                       $requestRow.next().remove();
+               }
+       }
+
+       function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) {
+               var itemList = '',
+                       resultRowClasses = 'request-results';
+
+               clearResultsAfterRow( $requestRow );
+
+               if ( additionalMessages.length ) {
+                       $.each( additionalMessages, function( index, value ) {
+                               itemList = itemList + '<li>' + value + '</li>';
+                       });
+                       itemList = '<ul>' + itemList + '</ul>';
+               }
+
+               $requestRow.addClass( 'has-request-results' );
+
+               if ( $requestRow.hasClass( 'status-request-confirmed' ) ) {
+                       resultRowClasses = resultRowClasses + ' status-request-confirmed';
+               }
+
+               if ( $requestRow.hasClass( 'status-request-failed' ) ) {
+                       resultRowClasses = resultRowClasses + ' status-request-failed';
+               }
+
+               $requestRow.after( function() {
+                       return '<tr class="' + resultRowClasses + '"><th colspan="5">' +
+                               '<div class="notice inline notice-alt ' + classes + '">' +
+                               '<p>' + summaryMessage + '</p>' +
+                               itemList +
+                               '</div>' +
+                               '</td>' +
+                               '</tr>';
+               });
+       }
+
+       $( '.export-personal-data-handle' ).click( function( event ) {
+               var $this          = $( this ),
+                       $action        = $this.parents( '.export-personal-data' ),
+                       $requestRow    = $this.parents( 'tr' ),
+                       requestID      = $action.data( 'request-id' ),
+                       nonce          = $action.data( 'nonce' ),
+                       exportersCount = $action.data( 'exporters-count' ),
+                       sendAsEmail    = $action.data( 'send-as-email' ) ? true : false;
+
+               event.preventDefault();
+               event.stopPropagation();
+
+               $action.blur();
+               clearResultsAfterRow( $requestRow );
+
+               function onExportDoneSuccess( zipUrl ) {
+                       setActionState( $action, 'export-personal-data-success' );
+                       if ( 'undefined' !== typeof zipUrl ) {
+                               window.location = zipUrl;
+                       } else if ( ! sendAsEmail ) {
+                               onExportFailure( strings.noExportFile );
+                       }
+               }
+
+               function onExportFailure( errorMessage ) {
+                       setActionState( $action, 'export-personal-data-failed' );
+                       if ( errorMessage ) {
+                               appendResultsAfterRow( $requestRow, 'notice-error', strings.exportError, [ errorMessage ] );
+                       }
+               }
+
+               function doNextExport( exporterIndex, pageIndex ) {
+                       $.ajax(
+                               {
+                                       url: window.ajaxurl,
+                                       data: {
+                                               action: 'wp-privacy-export-personal-data',
+                                               exporter: exporterIndex,
+                                               id: requestID,
+                                               page: pageIndex,
+                                               security: nonce,
+                                               sendAsEmail: sendAsEmail
+                                       },
+                                       method: 'post'
+                               }
+                       ).done( function( response ) {
+                               var responseData = response.data;
+
+                               if ( ! response.success ) {
+
+                                       // e.g. invalid request ID
+                                       onExportFailure( response.data );
+                                       return;
+                               }
+
+                               if ( ! responseData.done ) {
+                                       setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
+                               } else {
+                                       if ( exporterIndex < exportersCount ) {
+                                               setTimeout( doNextExport( exporterIndex + 1, 1 ) );
+                                       } else {
+                                               onExportDoneSuccess( responseData.url );
+                                       }
+                               }
+                       }).fail( function( jqxhr, textStatus, error ) {
+
+                               // e.g. Nonce failure
+                               onExportFailure( error );
+                       });
+               }
+
+               // And now, let's begin
+               setActionState( $action, 'export-personal-data-processing' );
+               doNextExport( 1, 1 );
+       });
+
+       $( '.remove-personal-data-handle' ).click( function( event ) {
+               var $this         = $( this ),
+                       $action       = $this.parents( '.remove-personal-data' ),
+                       $requestRow   = $this.parents( 'tr' ),
+                       requestID     = $action.data( 'request-id' ),
+                       nonce         = $action.data( 'nonce' ),
+                       erasersCount  = $action.data( 'erasers-count' ),
+                       hasRemoved    = false,
+                       hasRetained   = false,
+                       messages      = [];
+
+               event.stopPropagation();
+
+               $action.blur();
+               clearResultsAfterRow( $requestRow );
+
+               function onErasureDoneSuccess() {
+                       var summaryMessage = strings.noDataFound;
+                       var classes = 'notice-success';
+
+                       setActionState( $action, 'remove-personal-data-idle' );
+
+                       if ( false === hasRemoved ) {
+                               if ( false === hasRetained ) {
+                                       summaryMessage = strings.noDataFound;
+                               } else {
+                                       summaryMessage = strings.noneRemoved;
+                                       classes = 'notice-warning';
+                               }
+                       } else {
+                               if ( false === hasRetained ) {
+                                       summaryMessage = strings.foundAndRemoved;
+                               } else {
+                                       summaryMessage = strings.someNotRemoved;
+                                       classes = 'notice-warning';
+                               }
+                       }
+                       appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, messages );
+               }
+
+               function onErasureFailure() {
+                       setActionState( $action, 'remove-personal-data-failed' );
+                       appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
+               }
+
+               function doNextErasure( eraserIndex, pageIndex ) {
+                       $.ajax({
+                               url: window.ajaxurl,
+                               data: {
+                                       action: 'wp-privacy-erase-personal-data',
+                                       eraser: eraserIndex,
+                                       id: requestID,
+                                       page: pageIndex,
+                                       security: nonce
+                               },
+                               method: 'post'
+                       }).done( function( response ) {
+                               var responseData = response.data;
+
+                               if ( ! response.success ) {
+                                       onErasureFailure();
+                                       return;
+                               }
+                               if ( responseData.items_removed ) {
+                                       hasRemoved = hasRemoved || responseData.items_removed;
+                               }
+                               if ( responseData.items_retained ) {
+                                       hasRetained = hasRetained || responseData.items_retained;
+                               }
+                               if ( responseData.messages ) {
+                                       messages = messages.concat( responseData.messages );
+                               }
+                               if ( ! responseData.done ) {
+                                       setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
+                               } else {
+                                       if ( eraserIndex < erasersCount ) {
+                                               setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
+                                       } else {
+                                               onErasureDoneSuccess();
+                                       }
+                               }
+                       }).fail( function() {
+                               onErasureFailure();
+                       });
+               }
+
+               // And now, let's begin
+               setActionState( $action, 'remove-personal-data-processing' );
+
+               doNextErasure( 1, 1 );
+       });
+
+       // Privacy policy page, copy button.
+       $( document ).on( 'click', function( event ) {
+               var $target = $( event.target );
+               var $parent, $container, range;
+
+               if ( $target.is( 'button.privacy-text-copy' ) ) {
+                       $parent = $target.parent().parent();
+                       $container = $parent.find( 'div.wp-suggested-text' );
+
+                       if ( ! $container.length ) {
+                               $container = $parent.find( 'div.policy-text' );
+                       }
+
+                       if ( $container.length ) {
+                               try {
+                                       window.getSelection().removeAllRanges();
+                                       range = document.createRange();
+                                       $container.addClass( 'hide-privacy-policy-tutorial' );
+
+                                       range.selectNodeContents( $container[0] );
+                                       window.getSelection().addRange( range );
+                                       document.execCommand( 'copy' );
+
+                                       $container.removeClass( 'hide-privacy-policy-tutorial' );
+                                       window.getSelection().removeAllRanges();
+                               } catch ( er ) {}
+                       }
+               }
+       });
+});
+
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/js/_enqueues/admin/privacy-tools.js
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcjs_enqueuesadminxfnjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/admin/xfn.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/admin/xfn.js       2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/js/_enqueues/admin/xfn.js 2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,259 +21,3 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px">        });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-// Privacy request action handling
-jQuery( document ).ready( function( $ ) {
-       var strings = window.privacyToolsL10n || {};
-
-       function setActionState( $action, state ) {
-               $action.children().hide();
-               $action.children( '.' + state ).show();
-       }
-
-       function clearResultsAfterRow( $requestRow ) {
-               $requestRow.removeClass( 'has-request-results' );
-
-               if ( $requestRow.next().hasClass( 'request-results' ) ) {
-                       $requestRow.next().remove();
-               }
-       }
-
-       function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) {
-               var itemList = '',
-                       resultRowClasses = 'request-results';
-
-               clearResultsAfterRow( $requestRow );
-
-               if ( additionalMessages.length ) {
-                       $.each( additionalMessages, function( index, value ) {
-                               itemList = itemList + '<li>' + value + '</li>';
-                       });
-                       itemList = '<ul>' + itemList + '</ul>';
-               }
-
-               $requestRow.addClass( 'has-request-results' );
-
-               if ( $requestRow.hasClass( 'status-request-confirmed' ) ) {
-                       resultRowClasses = resultRowClasses + ' status-request-confirmed';
-               }
-
-               if ( $requestRow.hasClass( 'status-request-failed' ) ) {
-                       resultRowClasses = resultRowClasses + ' status-request-failed';
-               }
-
-               $requestRow.after( function() {
-                       return '<tr class="' + resultRowClasses + '"><th colspan="5">' +
-                               '<div class="notice inline notice-alt ' + classes + '">' +
-                               '<p>' + summaryMessage + '</p>' +
-                               itemList +
-                               '</div>' +
-                               '</td>' +
-                               '</tr>';
-               });
-       }
-
-       $( '.export-personal-data-handle' ).click( function( event ) {
-
-               var $this          = $( this ),
-                       $action        = $this.parents( '.export-personal-data' ),
-                       $requestRow    = $this.parents( 'tr' ),
-                       requestID      = $action.data( 'request-id' ),
-                       nonce          = $action.data( 'nonce' ),
-                       exportersCount = $action.data( 'exporters-count' ),
-                       sendAsEmail    = $action.data( 'send-as-email' ) ? true : false;
-
-               event.preventDefault();
-               event.stopPropagation();
-
-               $action.blur();
-               clearResultsAfterRow( $requestRow );
-
-               function onExportDoneSuccess( zipUrl ) {
-                       setActionState( $action, 'export-personal-data-success' );
-                       if ( 'undefined' !== typeof zipUrl ) {
-                               window.location = zipUrl;
-                       } else if ( ! sendAsEmail ) {
-                               onExportFailure( strings.noExportFile );
-                       }
-               }
-
-               function onExportFailure( errorMessage ) {
-                       setActionState( $action, 'export-personal-data-failed' );
-                       if ( errorMessage ) {
-                               appendResultsAfterRow( $requestRow, 'notice-error', strings.exportError, [ errorMessage ] );
-                       }
-               }
-
-               function doNextExport( exporterIndex, pageIndex ) {
-                       $.ajax(
-                               {
-                                       url: window.ajaxurl,
-                                       data: {
-                                               action: 'wp-privacy-export-personal-data',
-                                               exporter: exporterIndex,
-                                               id: requestID,
-                                               page: pageIndex,
-                                               security: nonce,
-                                               sendAsEmail: sendAsEmail
-                                       },
-                                       method: 'post'
-                               }
-                       ).done( function( response ) {
-                               var responseData = response.data;
-
-                               if ( ! response.success ) {
-
-                                       // e.g. invalid request ID
-                                       onExportFailure( response.data );
-                                       return;
-                               }
-
-                               if ( ! responseData.done ) {
-                                       setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
-                               } else {
-                                       if ( exporterIndex < exportersCount ) {
-                                               setTimeout( doNextExport( exporterIndex + 1, 1 ) );
-                                       } else {
-                                               onExportDoneSuccess( responseData.url );
-                                       }
-                               }
-                       }).fail( function( jqxhr, textStatus, error ) {
-
-                               // e.g. Nonce failure
-                               onExportFailure( error );
-                       });
-               }
-
-               // And now, let's begin
-               setActionState( $action, 'export-personal-data-processing' );
-               doNextExport( 1, 1 );
-       });
-
-       $( '.remove-personal-data-handle' ).click( function( event ) {
-
-               var $this         = $( this ),
-                       $action       = $this.parents( '.remove-personal-data' ),
-                       $requestRow   = $this.parents( 'tr' ),
-                       requestID     = $action.data( 'request-id' ),
-                       nonce         = $action.data( 'nonce' ),
-                       erasersCount  = $action.data( 'erasers-count' ),
-                       hasRemoved    = false,
-                       hasRetained   = false,
-                       messages      = [];
-
-               event.stopPropagation();
-
-               $action.blur();
-               clearResultsAfterRow( $requestRow );
-
-               function onErasureDoneSuccess() {
-                       var summaryMessage = strings.noDataFound;
-                       var classes = 'notice-success';
-
-                       setActionState( $action, 'remove-personal-data-idle' );
-
-                       if ( false === hasRemoved ) {
-                               if ( false === hasRetained ) {
-                                       summaryMessage = strings.noDataFound;
-                               } else {
-                                       summaryMessage = strings.noneRemoved;
-                                       classes = 'notice-warning';
-                               }
-                       } else {
-                               if ( false === hasRetained ) {
-                                       summaryMessage = strings.foundAndRemoved;
-                               } else {
-                                       summaryMessage = strings.someNotRemoved;
-                                       classes = 'notice-warning';
-                               }
-                       }
-                       appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, messages );
-               }
-
-               function onErasureFailure() {
-                       setActionState( $action, 'remove-personal-data-failed' );
-                       appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
-               }
-
-               function doNextErasure( eraserIndex, pageIndex ) {
-                       $.ajax({
-                               url: window.ajaxurl,
-                               data: {
-                                       action: 'wp-privacy-erase-personal-data',
-                                       eraser: eraserIndex,
-                                       id: requestID,
-                                       page: pageIndex,
-                                       security: nonce
-                               },
-                               method: 'post'
-                       }).done( function( response ) {
-                               var responseData = response.data;
-
-                               if ( ! response.success ) {
-                                       onErasureFailure();
-                                       return;
-                               }
-                               if ( responseData.items_removed ) {
-                                       hasRemoved = hasRemoved || responseData.items_removed;
-                               }
-                               if ( responseData.items_retained ) {
-                                       hasRetained = hasRetained || responseData.items_retained;
-                               }
-                               if ( responseData.messages ) {
-                                       messages = messages.concat( responseData.messages );
-                               }
-                               if ( ! responseData.done ) {
-                                       setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
-                               } else {
-                                       if ( eraserIndex < erasersCount ) {
-                                               setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
-                                       } else {
-                                               onErasureDoneSuccess();
-                                       }
-                               }
-                       }).fail( function() {
-                               onErasureFailure();
-                       });
-               }
-
-               // And now, let's begin
-               setActionState( $action, 'remove-personal-data-processing' );
-
-               doNextErasure( 1, 1 );
-       });
-});
-
-( function( $ ) {
-
-       // Privacy policy page, copy button.
-       $( document ).on( 'click', function( event ) {
-               var $target = $( event.target );
-               var $parent, $container, range;
-
-               if ( $target.is( 'button.privacy-text-copy' ) ) {
-                       $parent = $target.parent().parent();
-                       $container = $parent.find( 'div.wp-suggested-text' );
-
-                       if ( ! $container.length ) {
-                               $container = $parent.find( 'div.policy-text' );
-                       }
-
-                       if ( $container.length ) {
-                               try {
-                                       window.getSelection().removeAllRanges();
-                                       range = document.createRange();
-                                       $container.addClass( 'hide-privacy-policy-tutorial' );
-
-                                       range.selectNodeContents( $container[0] );
-                                       window.getSelection().addRange( range );
-                                       document.execCommand( 'copy' );
-
-                                       $container.removeClass( 'hide-privacy-policy-tutorial' );
-                                       window.getSelection().removeAllRanges();
-                               } catch ( er ) {}
-                       }
-               }
-       });
-
-} ( jQuery ) );
</del></span></pre></div>
<a id="trunksrcwpadminerasepersonaldataphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/erase-personal-data.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/erase-personal-data.php                                (rev 0)
+++ trunk/src/wp-admin/erase-personal-data.php  2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,96 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Privacy tools, Erase Personal Data screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
+       wp_die( __( 'Sorry, you are not allowed to erase data on this site.' ) );
+}
+
+if ( ! class_exists( 'WP_Privacy_Data_Removal_Requests_Table' ) ) {
+       require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-table.php' );
+}
+
+// Handle list table actions.
+_wp_personal_data_handle_actions();
+
+// Cleans up failed and expired requests before displaying the list table.
+_wp_personal_data_cleanup_requests();
+
+wp_enqueue_script( 'privacy-tools' );
+
+add_screen_option(
+       'per_page',
+       array(
+               'default' => 20,
+               'option'  => 'remove_personal_data_requests_per_page',
+       )
+);
+
+$_list_table_args = array(
+       'plural'   => 'privacy_requests',
+       'singular' => 'privacy_request',
+);
+
+$requests_table = _get_list_table( 'WP_Privacy_Data_Removal_Requests_List_Table', $_list_table_args );
+
+$requests_table->screen->set_screen_reader_content(
+       array(
+               'heading_views'      => __( 'Filter erase personal data list' ),
+               'heading_pagination' => __( 'Erase personal data list navigation' ),
+               'heading_list'       => __( 'Erase personal data list' ),
+       )
+);
+
+$requests_table->process_bulk_action();
+$requests_table->prepare_items();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap nosubsub">
+       <h1><?php esc_html_e( 'Erase Personal Data' ); ?></h1>
+       <hr class="wp-header-end" />
+
+       <?php settings_errors(); ?>
+
+       <form action="<?php echo esc_url( admin_url( 'erase-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
+               <h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>
+               <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
+
+               <div class="wp-privacy-request-form-field">
+                       <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
+                       <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
+                       <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
+               </div>
+               <?php wp_nonce_field( 'personal-data-request' ); ?>
+               <input type="hidden" name="action" value="add_remove_personal_data_request" />
+               <input type="hidden" name="type_of_action" value="remove_personal_data" />
+       </form>
+       <hr />
+
+       <?php $requests_table->views(); ?>
+
+       <form class="search-form wp-clearfix">
+               <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
+               <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
+               <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
+               <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
+       </form>
+
+       <form method="post">
+               <?php
+               $requests_table->display();
+               $requests_table->embed_scripts();
+               ?>
+       </form>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/erase-personal-data.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminexportpersonaldataphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/export-personal-data.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/export-personal-data.php                               (rev 0)
+++ trunk/src/wp-admin/export-personal-data.php 2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,96 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Privacy tools, Export Personal Data screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'export_others_personal_data' ) ) {
+       wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
+}
+
+if ( ! class_exists( 'WP_Privacy_Data_Export_Requests_Table' ) ) {
+       require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-table.php' );
+}
+
+// Handle list table actions.
+_wp_personal_data_handle_actions();
+
+// Cleans up failed and expired requests before displaying the list table.
+_wp_personal_data_cleanup_requests();
+
+wp_enqueue_script( 'privacy-tools' );
+
+add_screen_option(
+       'per_page',
+       array(
+               'default' => 20,
+               'option'  => 'export_personal_data_requests_per_page',
+       )
+);
+
+$_list_table_args = array(
+       'plural'   => 'privacy_requests',
+       'singular' => 'privacy_request',
+);
+
+$requests_table = _get_list_table( 'WP_Privacy_Data_Export_Requests_List_Table', $_list_table_args );
+
+$requests_table->screen->set_screen_reader_content(
+       array(
+               'heading_views'      => __( 'Filter export personal data list' ),
+               'heading_pagination' => __( 'Export personal data list navigation' ),
+               'heading_list'       => __( 'Export personal data list' ),
+       )
+);
+
+$requests_table->process_bulk_action();
+$requests_table->prepare_items();
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+?>
+
+<div class="wrap nosubsub">
+       <h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
+       <hr class="wp-header-end" />
+
+       <?php settings_errors(); ?>
+
+       <form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form">
+               <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
+               <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
+
+               <div class="wp-privacy-request-form-field">
+                       <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
+                       <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
+                       <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
+               </div>
+               <?php wp_nonce_field( 'personal-data-request' ); ?>
+               <input type="hidden" name="action" value="add_export_personal_data_request" />
+               <input type="hidden" name="type_of_action" value="export_personal_data" />
+       </form>
+       <hr />
+
+       <?php $requests_table->views(); ?>
+
+       <form class="search-form wp-clearfix">
+               <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
+               <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
+               <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
+               <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
+       </form>
+
+       <form method="post">
+               <?php
+               $requests_table->display();
+               $requests_table->embed_scripts();
+               ?>
+       </form>
+</div>
+
+<?php
+include( ABSPATH . 'wp-admin/admin-footer.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/export-personal-data.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesadminfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/admin-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/admin-filters.php     2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/admin-filters.php       2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,11 +45,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'admin_head', 'wp_site_icon' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'admin_head', '_ipad_meta' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// Privacy tools
-add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
-add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
-add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Prerendering.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_customize_preview() ) {
</span><span class="cx" style="display: block; padding: 0 10px">        add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
</span></span></pre></div>
<a id="trunksrcwpadminincludesadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/admin.php     2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/admin.php       2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,6 +40,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Misc Administration API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/includes/misc.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** WordPress Misc Administration API */
+require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Options Administration API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/includes/options.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,6 +70,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Theme Administration API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/includes/theme.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/** WordPress Privacy Functions */
+require_once( ABSPATH . 'wp-admin/includes/privacy-tools.php' );
+
+/** WordPress Privacy List Table classes. */
+// Previously in wp-admin/includes/user.php. Need to be loaded for backwards compatibility.
+require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' );
+require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php' );
+require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** WordPress User Administration API */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/includes/user.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpprivacydataexportrequestslisttablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php                          (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php    2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,129 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * List Table API: WP_Privacy_Data_Export_Requests_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.9.6
+ */
+
+if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {
+       require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' );
+}
+
+/**
+ * WP_Privacy_Data_Export_Requests_Table class.
+ *
+ * @since 4.9.6
+ */
+class WP_Privacy_Data_Export_Requests_List_Table extends WP_Privacy_Requests_Table {
+       /**
+        * Action name for the requests this table will work with.
+        *
+        * @since 4.9.6
+        *
+        * @var string $request_type Name of action.
+        */
+       protected $request_type = 'export_personal_data';
+
+       /**
+        * Post type for the requests.
+        *
+        * @since 4.9.6
+        *
+        * @var string $post_type The post type.
+        */
+       protected $post_type = 'user_request';
+
+       /**
+        * Actions column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        * @return string Email column markup.
+        */
+       public function column_email( $item ) {
+               /** This filter is documented in wp-admin/includes/ajax-actions.php */
+               $exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+               $exporters_count = count( $exporters );
+               $request_id      = $item->ID;
+               $nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
+
+               $download_data_markup = '<div class="export-personal-data" ' .
+                       'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
+                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
+                       'data-nonce="' . esc_attr( $nonce ) .
+                       '">';
+
+               $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data' ) . '</button></span>' .
+                       '<span style="display:none" class="export-personal-data-processing" >' . __( 'Downloading Data...' ) . '</span>' .
+                       '<span style="display:none" class="export-personal-data-success"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data Again' ) . '</button></span>' .
+                       '<span style="display:none" class="export-personal-data-failed">' . __( 'Download failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>';
+
+               $download_data_markup .= '</div>';
+
+               $row_actions = array(
+                       'download-data' => $download_data_markup,
+               );
+
+               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
+       }
+
+       /**
+        * Displays the next steps column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        */
+       public function column_next_steps( $item ) {
+               $status = $item->status;
+
+               switch ( $status ) {
+                       case 'request-pending':
+                               esc_html_e( 'Waiting for confirmation' );
+                               break;
+                       case 'request-confirmed':
+                               /** This filter is documented in wp-admin/includes/ajax-actions.php */
+                               $exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );
+                               $exporters_count = count( $exporters );
+                               $request_id      = $item->ID;
+                               $nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
+
+                               echo '<div class="export-personal-data" ' .
+                                       'data-send-as-email="1" ' .
+                                       'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
+                                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
+                                       'data-nonce="' . esc_attr( $nonce ) .
+                                       '">';
+
+                               ?>
+                               <span class="export-personal-data-idle"><button type="button" class="button export-personal-data-handle"><?php _e( 'Send Export Link' ); ?></button></span>
+                               <span style="display:none" class="export-personal-data-processing button updating-message" ><?php _e( 'Sending Email...' ); ?></span>
+                               <span style="display:none" class="export-personal-data-success success-message" ><?php _e( 'Email sent.' ); ?></span>
+                               <span style="display:none" class="export-personal-data-failed"><?php _e( 'Email could not be sent.' ); ?> <button type="button" class="button export-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
+                               <?php
+
+                               echo '</div>';
+                               break;
+                       case 'request-failed':
+                               submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
+                               break;
+                       case 'request-completed':
+                               echo '<a href="' . esc_url(
+                                       wp_nonce_url(
+                                               add_query_arg(
+                                                       array(
+                                                               'action'     => 'delete',
+                                                               'request_id' => array( $item->ID ),
+                                                       ),
+                                                       admin_url( 'export-personal-data.php' )
+                                               ),
+                                               'bulk-privacy_requests'
+                                       )
+                               ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
+                               break;
+               }
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/includes/class-wp-privacy-data-export-requests-list-table.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesclasswpprivacydataremovalrequestslisttablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php                         (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php   2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,135 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * List Table API: WP_Privacy_Data_Removal_Requests_List_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.9.6
+ */
+
+if ( ! class_exists( 'WP_Privacy_Requests_Table' ) ) {
+       require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-requests-table.php' );
+}
+
+/**
+ * WP_Privacy_Data_Removal_Requests_Table class.
+ *
+ * @since 4.9.6
+ */
+class WP_Privacy_Data_Removal_Requests_List_Table extends WP_Privacy_Requests_Table {
+       /**
+        * Action name for the requests this table will work with.
+        *
+        * @since 4.9.6
+        *
+        * @var string $request_type Name of action.
+        */
+       protected $request_type = 'remove_personal_data';
+
+       /**
+        * Post type for the requests.
+        *
+        * @since 4.9.6
+        *
+        * @var string $post_type The post type.
+        */
+       protected $post_type = 'user_request';
+
+       /**
+        * Actions column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        * @return string Email column markup.
+        */
+       public function column_email( $item ) {
+               $row_actions = array();
+
+               // Allow the administrator to "force remove" the personal data even if confirmation has not yet been received.
+               $status = $item->status;
+               if ( 'request-confirmed' !== $status ) {
+                       /** This filter is documented in wp-admin/includes/ajax-actions.php */
+                       $erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+                       $erasers_count = count( $erasers );
+                       $request_id    = $item->ID;
+                       $nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
+
+                       $remove_data_markup = '<div class="remove-personal-data force-remove-personal-data" ' .
+                               'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
+                               'data-request-id="' . esc_attr( $request_id ) . '" ' .
+                               'data-nonce="' . esc_attr( $nonce ) .
+                               '">';
+
+                       $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force Erase Personal Data' ) . '</button></span>' .
+                               '<span style="display:none" class="remove-personal-data-processing" >' . __( 'Erasing Data...' ) . '</span>' .
+                               '<span style="display:none" class="remove-personal-data-failed">' . __( 'Force Erase has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>';
+
+                       $remove_data_markup .= '</div>';
+
+                       $row_actions = array(
+                               'remove-data' => $remove_data_markup,
+                       );
+               }
+
+               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
+       }
+
+       /**
+        * Next steps column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        */
+       public function column_next_steps( $item ) {
+               $status = $item->status;
+
+               switch ( $status ) {
+                       case 'request-pending':
+                               esc_html_e( 'Waiting for confirmation' );
+                               break;
+                       case 'request-confirmed':
+                               /** This filter is documented in wp-admin/includes/ajax-actions.php */
+                               $erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+                               $erasers_count = count( $erasers );
+                               $request_id    = $item->ID;
+                               $nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
+
+                               echo '<div class="remove-personal-data" ' .
+                                       'data-force-erase="1" ' .
+                                       'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
+                                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
+                                       'data-nonce="' . esc_attr( $nonce ) .
+                                       '">';
+
+                               ?>
+                               <span class="remove-personal-data-idle"><button type="button" class="button remove-personal-data-handle"><?php _e( 'Erase Personal Data' ); ?></button></span>
+                               <span style="display:none" class="remove-personal-data-processing button updating-message" ><?php _e( 'Erasing Data...' ); ?></span>
+                               <span style="display:none" class="remove-personal-data-failed"><?php _e( 'Erasing Data has failed.' ); ?> <button type="button" class="button remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
+                               <?php
+
+                               echo '</div>';
+
+                               break;
+                       case 'request-failed':
+                               submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
+                               break;
+                       case 'request-completed':
+                               echo '<a href="' . esc_url(
+                                       wp_nonce_url(
+                                               add_query_arg(
+                                                       array(
+                                                               'action'     => 'delete',
+                                                               'request_id' => array( $item->ID ),
+                                                       ),
+                                                       admin_url( 'erase-personal-data.php' )
+                                               ),
+                                               'bulk-privacy_requests'
+                                       )
+                               ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
+                               break;
+               }
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/includes/class-wp-privacy-data-removal-requests-list-table.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesclasswpprivacypolicycontentphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php                           (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php     2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,716 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * WP_Privacy_Policy_Content class.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.9.6
+ */
+
+final class WP_Privacy_Policy_Content {
+
+       private static $policy_content = array();
+
+       /**
+        * Constructor
+        *
+        * @since 4.9.6
+        */
+       private function __construct() {}
+
+       /**
+        * Add content to the postbox shown when editing the privacy policy.
+        *
+        * Plugins and themes should suggest text for inclusion in the site's privacy policy.
+        * The suggested text should contain information about any functionality that affects user privacy,
+        * and will be shown in the Suggested Privacy Policy Content postbox.
+        *
+        * Intended for use from `wp_add_privacy_policy_content()`.
+        *
+        * @since 4.9.6
+        *
+        * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.
+        * @param string $policy_text The suggested content for inclusion in the policy.
+        */
+       public static function add( $plugin_name, $policy_text ) {
+               if ( empty( $plugin_name ) || empty( $policy_text ) ) {
+                       return;
+               }
+
+               $data = array(
+                       'plugin_name' => $plugin_name,
+                       'policy_text' => $policy_text,
+               );
+
+               if ( ! in_array( $data, self::$policy_content, true ) ) {
+                       self::$policy_content[] = $data;
+               }
+       }
+
+       /**
+        * Quick check if any privacy info has changed.
+        *
+        * @since 4.9.6
+        */
+       public static function text_change_check() {
+
+               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+               // The site doesn't have a privacy policy.
+               if ( empty( $policy_page_id ) ) {
+                       return false;
+               }
+
+               if ( ! current_user_can( 'edit_post', $policy_page_id ) ) {
+                       return false;
+               }
+
+               $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+
+               // Updates are not relevant if the user has not reviewed any suggestions yet.
+               if ( empty( $old ) ) {
+                       return false;
+               }
+
+               $cached = get_option( '_wp_suggested_policy_text_has_changed' );
+
+               /*
+                * When this function is called before `admin_init`, `self::$policy_content`
+                * has not been populated yet, so use the cached result from the last
+                * execution instead.
+                */
+               if ( ! did_action( 'admin_init' ) ) {
+                       return 'changed' === $cached;
+               }
+
+               $new = self::$policy_content;
+
+               // Remove the extra values added to the meta.
+               foreach ( $old as $key => $data ) {
+                       if ( ! empty( $data['removed'] ) ) {
+                               unset( $old[ $key ] );
+                               continue;
+                       }
+
+                       $old[ $key ] = array(
+                               'plugin_name' => $data['plugin_name'],
+                               'policy_text' => $data['policy_text'],
+                       );
+               }
+
+               // Normalize the order of texts, to facilitate comparison.
+               sort( $old );
+               sort( $new );
+
+               // The == operator (equal, not identical) was used intentionally.
+               // See http://php.net/manual/en/language.operators.array.php
+               if ( $new != $old ) {
+                       // A plugin was activated or deactivated, or some policy text has changed.
+                       // Show a notice on the relevant screens to inform the admin.
+                       add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );
+                       $state = 'changed';
+               } else {
+                       $state = 'not-changed';
+               }
+
+               // Cache the result for use before `admin_init` (see above).
+               if ( $cached !== $state ) {
+                       update_option( '_wp_suggested_policy_text_has_changed', $state );
+               }
+
+               return 'changed' === $state;
+       }
+
+       /**
+        * Output a warning when some privacy info has changed.
+        *
+        * @since 4.9.6
+        */
+       public static function policy_text_changed_notice() {
+               global $post;
+
+               $screen = get_current_screen()->id;
+
+               if ( 'privacy' !== $screen ) {
+                       return;
+               }
+
+               ?>
+               <div class="policy-text-updated notice notice-warning is-dismissible">
+                       <p>
+                       <?php
+                               printf(
+                                       /* translators: %s: Privacy Policy Guide URL */
+                                       __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
+                                       esc_url( admin_url( 'privacy-policy-guide.php' ) )
+                               );
+                       ?>
+                       </p>
+               </div>
+               <?php
+       }
+
+       /**
+        * Update the cached policy info when the policy page is updated.
+        *
+        * @since 4.9.6
+        * @access private
+        */
+       public static function _policy_page_updated( $post_id ) {
+               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+               if ( ! $policy_page_id || $policy_page_id !== (int) $post_id ) {
+                       return;
+               }
+
+               // Remove updated|removed status.
+               $old          = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+               $done         = array();
+               $update_cache = false;
+
+               foreach ( $old as $old_key => $old_data ) {
+                       if ( ! empty( $old_data['removed'] ) ) {
+                               // Remove the old policy text.
+                               $update_cache = true;
+                               continue;
+                       }
+
+                       if ( ! empty( $old_data['updated'] ) ) {
+                               // 'updated' is now 'added'.
+                               $done[]       = array(
+                                       'plugin_name' => $old_data['plugin_name'],
+                                       'policy_text' => $old_data['policy_text'],
+                                       'added'       => $old_data['updated'],
+                               );
+                               $update_cache = true;
+                       } else {
+                               $done[] = $old_data;
+                       }
+               }
+
+               if ( $update_cache ) {
+                       delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+                       // Update the cache.
+                       foreach ( $done as $data ) {
+                               add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
+                       }
+               }
+       }
+
+       /**
+        * Check for updated, added or removed privacy policy information from plugins.
+        *
+        * Caches the current info in post_meta of the policy page.
+        *
+        * @since 4.9.6
+        *
+        * @return array The privacy policy text/informtion added by core and plugins.
+        */
+       public static function get_suggested_policy_text() {
+               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+               $checked        = array();
+               $time           = time();
+               $update_cache   = false;
+               $new            = self::$policy_content;
+               $old            = array();
+
+               if ( $policy_page_id ) {
+                       $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+               }
+
+               // Check for no-changes and updates.
+               foreach ( $new as $new_key => $new_data ) {
+                       foreach ( $old as $old_key => $old_data ) {
+                               $found = false;
+
+                               if ( $new_data['policy_text'] === $old_data['policy_text'] ) {
+                                       // Use the new plugin name in case it was changed, translated, etc.
+                                       if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {
+                                               $old_data['plugin_name'] = $new_data['plugin_name'];
+                                               $update_cache            = true;
+                                       }
+
+                                       // A plugin was re-activated.
+                                       if ( ! empty( $old_data['removed'] ) ) {
+                                               unset( $old_data['removed'] );
+                                               $old_data['added'] = $time;
+                                               $update_cache      = true;
+                                       }
+
+                                       $checked[] = $old_data;
+                                       $found     = true;
+                               } elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
+                                       // The info for the policy was updated.
+                                       $checked[] = array(
+                                               'plugin_name' => $new_data['plugin_name'],
+                                               'policy_text' => $new_data['policy_text'],
+                                               'updated'     => $time,
+                                       );
+                                       $found     = $update_cache = true;
+                               }
+
+                               if ( $found ) {
+                                       unset( $new[ $new_key ], $old[ $old_key ] );
+                                       continue 2;
+                               }
+                       }
+               }
+
+               if ( ! empty( $new ) ) {
+                       // A plugin was activated.
+                       foreach ( $new as $new_data ) {
+                               if ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) {
+                                       $new_data['added'] = $time;
+                                       $checked[]         = $new_data;
+                               }
+                       }
+                       $update_cache = true;
+               }
+
+               if ( ! empty( $old ) ) {
+                       // A plugin was deactivated.
+                       foreach ( $old as $old_data ) {
+                               if ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) {
+                                       $data = array(
+                                               'plugin_name' => $old_data['plugin_name'],
+                                               'policy_text' => $old_data['policy_text'],
+                                               'removed'     => $time,
+                                       );
+
+                                       $checked[] = $data;
+                               }
+                       }
+                       $update_cache = true;
+               }
+
+               if ( $update_cache && $policy_page_id ) {
+                       delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
+                       // Update the cache.
+                       foreach ( $checked as $data ) {
+                               add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
+                       }
+               }
+
+               return $checked;
+       }
+
+       /**
+        * Add a notice with a link to the guide when editing the privacy policy page.
+        *
+        * @since 4.9.6
+        * @since 5.0.0 The $post parameter is now optional.
+        *
+        * @param WP_Post|null $post The currently edited post. Default null.
+        */
+       public static function notice( $post = null ) {
+               if ( is_null( $post ) ) {
+                       global $post;
+               } else {
+                       $post = get_post( $post );
+               }
+
+               if ( ! ( $post instanceof WP_Post ) ) {
+                       return;
+               }
+
+               if ( ! current_user_can( 'manage_privacy_options' ) ) {
+                       return;
+               }
+
+               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
+
+               if ( ! $policy_page_id || $policy_page_id !== $post->ID ) {
+                       return;
+               }
+
+               $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' );
+               $url     = esc_url( admin_url( 'privacy-policy-guide.php' ) );
+               $label   = __( 'View Privacy Policy Guide.' );
+
+               if ( get_current_screen()->is_block_editor() ) {
+                       wp_enqueue_script( 'wp-notices' );
+                       $action = array(
+                               'url'   => $url,
+                               'label' => $label,
+                       );
+                       wp_add_inline_script(
+                               'wp-notices',
+                               sprintf(
+                                       'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )',
+                                       $message,
+                                       wp_json_encode( $action )
+                               ),
+                               'after'
+                       );
+               } else {
+                       ?>
+                       <div class="notice notice-warning inline wp-pp-notice">
+                               <p>
+                               <?php
+                               echo $message;
+                               printf(
+                                       ' <a href="%s" target="_blank">%s <span class="screen-reader-text">%s</span></a>',
+                                       $url,
+                                       $label,
+                                       /* translators: accessibility text */
+                                       __( '(opens in a new tab)' )
+                               );
+                               ?>
+                               </p>
+                       </div>
+                       <?php
+               }
+       }
+
+       /**
+        * Output the privacy policy guide together with content from the theme and plugins.
+        *
+        * @since 4.9.6
+        */
+       public static function privacy_policy_guide() {
+
+               $content_array = self::get_suggested_policy_text();
+
+               $content       = '';
+               $toc           = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
+               $date_format   = __( 'F j, Y' );
+               $copy          = __( 'Copy this section to clipboard' );
+               $return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
+
+               foreach ( $content_array as $section ) {
+                       $class = $meta = $removed = '';
+
+                       if ( ! empty( $section['removed'] ) ) {
+                               $class = ' text-removed';
+                               $date  = date_i18n( $date_format, $section['removed'] );
+                               $meta  = sprintf( __( 'Removed %s.' ), $date );
+
+                               $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
+                               $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
+                       } elseif ( ! empty( $section['updated'] ) ) {
+                               $class = ' text-updated';
+                               $date  = date_i18n( $date_format, $section['updated'] );
+                               $meta  = sprintf( __( 'Updated %s.' ), $date );
+                       }
+
+                       if ( $meta ) {
+                               $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
+                       }
+
+                       $plugin_name = esc_html( $section['plugin_name'] );
+                       $toc_id      = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
+                       $toc[]       = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
+
+                       $content .= '<div class="privacy-text-section' . $class . '">';
+                       $content .= '<a id="' . $toc_id . '">&nbsp;</a>';
+                       /* translators: %s: plugin name */
+                       $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
+                       $content .= $removed;
+
+                       $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
+                       $content .= $return_to_top;
+
+                       if ( empty( $section['removed'] ) ) {
+                               $content         .= '<div class="privacy-text-actions">';
+                                       $content     .= '<button type="button" class="privacy-text-copy button">';
+                                               $content .= $copy;
+                                               $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
+                                       $content     .= '</button>';
+                               $content         .= '</div>';
+                       }
+
+                       $content .= "</div>\n"; // End of .privacy-text-section.
+               }
+
+               if ( count( $toc ) > 2 ) {
+                       ?>
+                       <div  class="privacy-text-box-toc">
+                               <p><?php _e( 'Table of Contents' ); ?></p>
+                               <ol>
+                                       <?php echo implode( "\n", $toc ); ?>
+                               </ol>
+                       </div>
+                       <?php
+               }
+
+               ?>
+               <div class="privacy-text-box">
+                       <div class="privacy-text-box-head">
+                               <a id="wp-privacy-policy-guide-introduction">&nbsp;</a>
+                               <h2><?php _e( 'Introduction' ); ?></h2>
+                               <p><?php _e( 'Hello,' ); ?></p>
+                               <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
+                               <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>
+                               <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>
+                               <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>
+                       </div>
+
+                       <div class="privacy-text-box-body">
+                               <?php echo $content; ?>
+                       </div>
+               </div>
+               <?php
+       }
+
+       /**
+        * Return the default suggested privacy policy content.
+        *
+        * @since 4.9.6
+        * @since 5.0.0 Added the `$blocks` parameter.
+        *
+        * @param bool $description Whether to include the descriptions under the section headings. Default false.
+        * @param bool $blocks      Whether to format the content for the block editor. Default true.
+        * @return string The default policy content.
+        */
+       public static function get_default_content( $description = false, $blocks = true ) {
+               $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
+               $content        = '';
+               $strings        = array();
+
+               // Start of the suggested privacy policy text.
+               if ( $description ) {
+                       $strings[] = '<div class="wp-suggested-text">';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text, %s Site URL. */
+               $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Media' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy text. */
+               $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
+               }
+
+               /* translators: default privacy policy heading. */
+               $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
+
+               if ( $description ) {
+                       /* translators: privacy policy tutorial. */
+                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
+                       $strings[] = '</div>';
+               }
+
+               if ( $blocks ) {
+                       foreach ( $strings as $key => $string ) {
+                               if ( 0 === strpos( $string, '<p>' ) ) {
+                                       $strings[ $key ] = '<!-- wp:paragraph -->' . $string . '<!-- /wp:paragraph -->';
+                               }
+
+                               if ( 0 === strpos( $string, '<h2>' ) ) {
+                                       $strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
+                               }
+
+                               if ( 0 === strpos( $string, '<h3>' ) ) {
+                                       $strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
+                               }
+                       }
+               }
+
+               $content = implode( '', $strings );
+               // End of the suggested privacy policy text.
+
+               /**
+                * Filters the default content suggested for inclusion in a privacy policy.
+                *
+                * @since 4.9.6
+                * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
+                *
+                * @param string $content     The default policy content.
+                * @param array  $strings     An array of privacy policy content strings.
+                * @param bool   $description Whether policy descriptions should be included.
+                * @param bool   $blocks      Whether the content should be formatted for the block editor.
+                */
+               return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
+       }
+
+       /**
+        * Add the suggested privacy policy text to the policy postbox.
+        *
+        * @since 4.9.6
+        */
+       public static function add_suggested_content() {
+               $content = self::get_default_content( true, false );
+               wp_add_privacy_policy_content( __( 'WordPress' ), $content );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesclasswpprivacyrequeststablephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php                           (rev 0)
+++ trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php     2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,451 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * List Table API: WP_Privacy_Requests_Table class
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.9.6
+ */
+
+abstract class WP_Privacy_Requests_Table extends WP_List_Table {
+
+       /**
+        * Action name for the requests this table will work with. Classes
+        * which inherit from WP_Privacy_Requests_Table should define this.
+        *
+        * Example: 'export_personal_data'.
+        *
+        * @since 4.9.6
+        *
+        * @var string $request_type Name of action.
+        */
+       protected $request_type = 'INVALID';
+
+       /**
+        * Post type to be used.
+        *
+        * @since 4.9.6
+        *
+        * @var string $post_type The post type.
+        */
+       protected $post_type = 'INVALID';
+
+       /**
+        * Get columns to show in the list table.
+        *
+        * @since 4.9.6
+        *
+        * @return array Array of columns.
+        */
+       public function get_columns() {
+               $columns = array(
+                       'cb'                => '<input type="checkbox" />',
+                       'email'             => __( 'Requester' ),
+                       'status'            => __( 'Status' ),
+                       'created_timestamp' => __( 'Requested' ),
+                       'next_steps'        => __( 'Next Steps' ),
+               );
+               return $columns;
+       }
+
+       /**
+        * Normalize the admin URL to the current page (by request_type).
+        *
+        * @since 5.3.0
+        *
+        * @return string URL to the current admin page.
+        */
+       protected function get_admin_url() {
+               $pagenow = str_replace( '_', '-', $this->request_type );
+
+               if ( 'remove-personal-data' === $pagenow ) {
+                       $pagenow = 'erase-personal-data';
+               }
+
+               return admin_url( $pagenow . '.php' );
+       }
+
+       /**
+        * Get a list of sortable columns.
+        *
+        * @since 4.9.6
+        *
+        * @return array Default sortable columns.
+        */
+       protected function get_sortable_columns() {
+               // The initial sorting is by 'Requested' (post_date) and descending.
+               // With initial sorting, the first click on 'Requested' should be ascending.
+               // With 'Requester' sorting active, the next click on 'Requested' should be descending.
+               $desc_first = isset( $_GET['orderby'] );
+
+               return array(
+                       'email'             => 'requester',
+                       'created_timestamp' => array( 'requested', $desc_first ),
+               );
+       }
+
+       /**
+        * Default primary column.
+        *
+        * @since 4.9.6
+        *
+        * @return string Default primary column name.
+        */
+       protected function get_default_primary_column_name() {
+               return 'email';
+       }
+
+       /**
+        * Count number of requests for each status.
+        *
+        * @since 4.9.6
+        *
+        * @return object Number of posts for each status.
+        */
+       protected function get_request_counts() {
+               global $wpdb;
+
+               $cache_key = $this->post_type . '-' . $this->request_type;
+               $counts    = wp_cache_get( $cache_key, 'counts' );
+
+               if ( false !== $counts ) {
+                       return $counts;
+               }
+
+               $query = "
+                       SELECT post_status, COUNT( * ) AS num_posts
+                       FROM {$wpdb->posts}
+                       WHERE post_type = %s
+                       AND post_name = %s
+                       GROUP BY post_status";
+
+               $results = (array) $wpdb->get_results( $wpdb->prepare( $query, $this->post_type, $this->request_type ), ARRAY_A );
+               $counts  = array_fill_keys( get_post_stati(), 0 );
+
+               foreach ( $results as $row ) {
+                       $counts[ $row['post_status'] ] = $row['num_posts'];
+               }
+
+               $counts = (object) $counts;
+               wp_cache_set( $cache_key, $counts, 'counts' );
+
+               return $counts;
+       }
+
+       /**
+        * Get an associative array ( id => link ) with the list of views available on this table.
+        *
+        * @since 4.9.6
+        *
+        * @return array Associative array of views in the format of $view_name => $view_markup.
+        */
+       protected function get_views() {
+               $current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
+               $statuses       = _wp_privacy_statuses();
+               $views          = array();
+               $counts         = $this->get_request_counts();
+               $total_requests = absint( array_sum( (array) $counts ) );
+
+               // Normalized admin URL
+               $admin_url = $this->get_admin_url();
+
+               $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
+               $status_label            = sprintf(
+                       /* translators: %s: all requests count */
+                       _nx(
+                               'All <span class="count">(%s)</span>',
+                               'All <span class="count">(%s)</span>',
+                               $total_requests,
+                               'requests'
+                       ),
+                       number_format_i18n( $total_requests )
+               );
+
+               $views['all'] = sprintf(
+                       '<a href="%s"%s>%s</a>',
+                       esc_url( $admin_url ),
+                       $current_link_attributes,
+                       $status_label
+               );
+
+               foreach ( $statuses as $status => $label ) {
+                       $post_status = get_post_status_object( $status );
+                       if ( ! $post_status ) {
+                               continue;
+                       }
+
+                       $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
+                       $total_status_requests   = absint( $counts->{$status} );
+
+                       $status_label = sprintf(
+                               translate_nooped_plural( $post_status->label_count, $total_status_requests ),
+                               number_format_i18n( $total_status_requests )
+                       );
+
+                       $status_link = add_query_arg( 'filter-status', $status, $admin_url );
+
+                       $views[ $status ] = sprintf(
+                               '<a href="%s"%s>%s</a>',
+                               esc_url( $status_link ),
+                               $current_link_attributes,
+                               $status_label
+                       );
+               }
+
+               return $views;
+       }
+
+       /**
+        * Get bulk actions.
+        *
+        * @since 4.9.6
+        *
+        * @return array List of bulk actions.
+        */
+       protected function get_bulk_actions() {
+               return array(
+                       'delete' => __( 'Remove' ),
+                       'resend' => __( 'Resend email' ),
+               );
+       }
+
+       /**
+        * Process bulk actions.
+        *
+        * @since 4.9.6
+        */
+       public function process_bulk_action() {
+               $action      = $this->current_action();
+               $request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();
+
+               $count = 0;
+
+               if ( $request_ids ) {
+                       check_admin_referer( 'bulk-privacy_requests' );
+               }
+
+               switch ( $action ) {
+                       case 'delete':
+                               foreach ( $request_ids as $request_id ) {
+                                       if ( wp_delete_post( $request_id, true ) ) {
+                                               $count ++;
+                                       }
+                               }
+
+                               add_settings_error(
+                                       'bulk_action',
+                                       'bulk_action',
+                                       /* translators: %d: number of requests */
+                                       sprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ),
+                                       'updated'
+                               );
+                               break;
+                       case 'resend':
+                               foreach ( $request_ids as $request_id ) {
+                                       $resend = _wp_privacy_resend_request( $request_id );
+
+                                       if ( $resend && ! is_wp_error( $resend ) ) {
+                                               $count++;
+                                       }
+                               }
+
+                               add_settings_error(
+                                       'bulk_action',
+                                       'bulk_action',
+                                       /* translators: %d: number of requests */
+                                       sprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ),
+                                       'updated'
+                               );
+                               break;
+               }
+       }
+
+       /**
+        * Prepare items to output.
+        *
+        * @since 4.9.6
+        * @since 5.1.0 Added support for column sorting.
+        */
+       public function prepare_items() {
+               global $wpdb;
+
+               $this->items    = array();
+               $posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );
+               $args           = array(
+                       'post_type'      => $this->post_type,
+                       'post_name__in'  => array( $this->request_type ),
+                       'posts_per_page' => $posts_per_page,
+                       'offset'         => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page : 0,
+                       'post_status'    => 'any',
+                       's'              => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '',
+               );
+
+               $orderby_mapping = array(
+                       'requester' => 'post_title',
+                       'requested' => 'post_date',
+               );
+
+               if ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) {
+                       $args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ];
+               }
+
+               if ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) {
+                       $args['order'] = strtoupper( $_REQUEST['order'] );
+               }
+
+               if ( ! empty( $_REQUEST['filter-status'] ) ) {
+                       $filter_status       = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
+                       $args['post_status'] = $filter_status;
+               }
+
+               $requests_query = new WP_Query( $args );
+               $requests       = $requests_query->posts;
+
+               foreach ( $requests as $request ) {
+                       $this->items[] = wp_get_user_request_data( $request->ID );
+               }
+
+               $this->items = array_filter( $this->items );
+
+               $this->set_pagination_args(
+                       array(
+                               'total_items' => $requests_query->found_posts,
+                               'per_page'    => $posts_per_page,
+                       )
+               );
+       }
+
+       /**
+        * Checkbox column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        * @return string Checkbox column markup.
+        */
+       public function column_cb( $item ) {
+               return sprintf( '<input type="checkbox" name="request_id[]" value="%1$s" /><span class="spinner"></span>', esc_attr( $item->ID ) );
+       }
+
+       /**
+        * Status column.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        * @return string Status column markup.
+        */
+       public function column_status( $item ) {
+               $status        = get_post_status( $item->ID );
+               $status_object = get_post_status_object( $status );
+
+               if ( ! $status_object || empty( $status_object->label ) ) {
+                       return '-';
+               }
+
+               $timestamp = false;
+
+               switch ( $status ) {
+                       case 'request-confirmed':
+                               $timestamp = $item->confirmed_timestamp;
+                               break;
+                       case 'request-completed':
+                               $timestamp = $item->completed_timestamp;
+                               break;
+               }
+
+               echo '<span class="status-label status-' . esc_attr( $status ) . '">';
+               echo esc_html( $status_object->label );
+
+               if ( $timestamp ) {
+                       echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
+               }
+
+               echo '</span>';
+       }
+
+       /**
+        * Convert timestamp for display.
+        *
+        * @since 4.9.6
+        *
+        * @param int $timestamp Event timestamp.
+        * @return string Human readable date.
+        */
+       protected function get_timestamp_as_date( $timestamp ) {
+               if ( empty( $timestamp ) ) {
+                       return '';
+               }
+
+               $time_diff = time() - $timestamp;
+
+               if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
+                       /* translators: human readable timestamp */
+                       return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
+               }
+
+               return date_i18n( get_option( 'date_format' ), $timestamp );
+       }
+
+       /**
+        * Default column handler.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item        Item being shown.
+        * @param string          $column_name Name of column being shown.
+        * @return string Default column output.
+        */
+       public function column_default( $item, $column_name ) {
+               $cell_value = $item->$column_name;
+
+               if ( in_array( $column_name, array( 'created_timestamp' ), true ) ) {
+                       return $this->get_timestamp_as_date( $cell_value );
+               }
+
+               return $cell_value;
+       }
+
+       /**
+        * Actions column. Overridden by children.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        * @return string Email column markup.
+        */
+       public function column_email( $item ) {
+               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( array() ) );
+       }
+
+       /**
+        * Next steps column. Overridden by children.
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item Item being shown.
+        */
+       public function column_next_steps( $item ) {}
+
+       /**
+        * Generates content for a single row of the table,
+        *
+        * @since 4.9.6
+        *
+        * @param WP_User_Request $item The current item.
+        */
+       public function single_row( $item ) {
+               $status = $item->status;
+
+               echo '<tr id="request-' . esc_attr( $item->ID ) . '" class="status-' . esc_attr( $status ) . '">';
+               $this->single_row_columns( $item );
+               echo '</tr>';
+       }
+
+       /**
+        * Embed scripts used to perform actions. Overridden by children.
+        *
+        * @since 4.9.6
+        */
+       public function embed_scripts() {}
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/deprecated.php        2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/deprecated.php  2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1514,3 +1514,50 @@
</span><span class="cx" style="display: block; padding: 0 10px">        </script>
</span><span class="cx" style="display: block; padding: 0 10px">        <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Previous class for list table for privacy data export requests.
+ *
+ * @since 4.9.6
+ * @deprecated 5.3.0
+ */
+class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Data_Export_Requests_List_Table {
+       function __construct( $args ) {
+               _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Export_Requests_List_Table' );
+
+               if ( ! isset( $args['screen'] ) || $args['screen'] === 'export_personal_data' ) {
+                       $args['screen'] = 'export-personal-data';
+               }
+
+               parent::__construct( $args );   
+       }
+}
+
+/**
+ * Previous class for list table for privacy data erasure requests.
+ *
+ * @since 4.9.6
+ * @deprecated 5.3.0
+ */
+class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Data_Removal_Requests_List_Table {
+       function __construct( $args ) {
+               _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Removal_Requests_List_Table' );
+
+               if ( ! isset( $args['screen'] ) || $args['screen'] === 'remove_personal_data' ) {
+                       $args['screen'] = 'erase-personal-data';
+               }
+
+               parent::__construct( $args );
+       }
+}
+
+/**
+ * Was used to add options for the privacy requests screens before they were separate files.
+ *
+ * @since 4.9.8
+ * @access private
+ * @deprecated 5.3.0
+ */
+function _wp_privacy_requests_screen_options() {
+       _deprecated_function( __FUNCTION__, '5.3.0' );
+}
</ins></span></pre></div>
<a id="trunksrcwpadminincludeslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/list-table.php        2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/list-table.php  2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,10 +33,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'WP_Themes_List_Table'         => 'themes',
</span><span class="cx" style="display: block; padding: 0 10px">                'WP_Theme_Install_List_Table'  => array( 'themes', 'theme-install' ),
</span><span class="cx" style="display: block; padding: 0 10px">                'WP_Plugins_List_Table'        => 'plugins',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Network Admin
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'WP_MS_Sites_List_Table'       => 'ms-sites',
-               'WP_MS_Users_List_Table'       => 'ms-users',
-               'WP_MS_Themes_List_Table'      => 'ms-themes',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'WP_MS_Sites_List_Table'  => 'ms-sites',
+               'WP_MS_Users_List_Table'  => 'ms-users',
+               'WP_MS_Themes_List_Table' => 'ms-themes',
+
+               // Privacy requests tables
+               'WP_Privacy_Data_Export_Requests_List_Table'  => 'privacy-data-export-requests',
+               'WP_Privacy_Data_Removal_Requests_List_Table' => 'privacy-data-removal-requests',
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( isset( $core_classes[ $class ] ) ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/misc.php      2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/misc.php        2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1319,720 +1319,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WP_Privacy_Policy_Content class.
- * TODO: move this to a new file.
- *
- * @since 4.9.6
- */
-final class WP_Privacy_Policy_Content {
-
-       private static $policy_content = array();
-
-       /**
-        * Constructor
-        *
-        * @since 4.9.6
-        */
-       private function __construct() {}
-
-       /**
-        * Add content to the postbox shown when editing the privacy policy.
-        *
-        * Plugins and themes should suggest text for inclusion in the site's privacy policy.
-        * The suggested text should contain information about any functionality that affects user privacy,
-        * and will be shown in the Suggested Privacy Policy Content postbox.
-        *
-        * Intended for use from `wp_add_privacy_policy_content()`.
-        *
-        * @since 4.9.6
-        *
-        * @param string $plugin_name The name of the plugin or theme that is suggesting content for the site's privacy policy.
-        * @param string $policy_text The suggested content for inclusion in the policy.
-        */
-       public static function add( $plugin_name, $policy_text ) {
-               if ( empty( $plugin_name ) || empty( $policy_text ) ) {
-                       return;
-               }
-
-               $data = array(
-                       'plugin_name' => $plugin_name,
-                       'policy_text' => $policy_text,
-               );
-
-               if ( ! in_array( $data, self::$policy_content, true ) ) {
-                       self::$policy_content[] = $data;
-               }
-       }
-
-       /**
-        * Quick check if any privacy info has changed.
-        *
-        * @since 4.9.6
-        */
-       public static function text_change_check() {
-
-               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
-
-               // The site doesn't have a privacy policy.
-               if ( empty( $policy_page_id ) ) {
-                       return false;
-               }
-
-               if ( ! current_user_can( 'edit_post', $policy_page_id ) ) {
-                       return false;
-               }
-
-               $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
-
-               // Updates are not relevant if the user has not reviewed any suggestions yet.
-               if ( empty( $old ) ) {
-                       return false;
-               }
-
-               $cached = get_option( '_wp_suggested_policy_text_has_changed' );
-
-               /*
-                * When this function is called before `admin_init`, `self::$policy_content`
-                * has not been populated yet, so use the cached result from the last
-                * execution instead.
-                */
-               if ( ! did_action( 'admin_init' ) ) {
-                       return 'changed' === $cached;
-               }
-
-               $new = self::$policy_content;
-
-               // Remove the extra values added to the meta.
-               foreach ( $old as $key => $data ) {
-                       if ( ! empty( $data['removed'] ) ) {
-                               unset( $old[ $key ] );
-                               continue;
-                       }
-
-                       $old[ $key ] = array(
-                               'plugin_name' => $data['plugin_name'],
-                               'policy_text' => $data['policy_text'],
-                       );
-               }
-
-               // Normalize the order of texts, to facilitate comparison.
-               sort( $old );
-               sort( $new );
-
-               // The == operator (equal, not identical) was used intentionally.
-               // See http://php.net/manual/en/language.operators.array.php
-               if ( $new != $old ) {
-                       // A plugin was activated or deactivated, or some policy text has changed.
-                       // Show a notice on the relevant screens to inform the admin.
-                       add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) );
-                       $state = 'changed';
-               } else {
-                       $state = 'not-changed';
-               }
-
-               // Cache the result for use before `admin_init` (see above).
-               if ( $cached !== $state ) {
-                       update_option( '_wp_suggested_policy_text_has_changed', $state );
-               }
-
-               return 'changed' === $state;
-       }
-
-       /**
-        * Output a warning when some privacy info has changed.
-        *
-        * @since 4.9.6
-        */
-       public static function policy_text_changed_notice() {
-               global $post;
-
-               $screen = get_current_screen()->id;
-
-               if ( 'privacy' !== $screen ) {
-                       return;
-               }
-
-               ?>
-               <div class="policy-text-updated notice notice-warning is-dismissible">
-                       <p>
-                       <?php
-                               printf(
-                                       /* translators: %s: Privacy Policy Guide URL */
-                                       __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
-                                       esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) )
-                               );
-                       ?>
-                       </p>
-               </div>
-               <?php
-       }
-
-       /**
-        * Update the cached policy info when the policy page is updated.
-        *
-        * @since 4.9.6
-        * @access private
-        */
-       public static function _policy_page_updated( $post_id ) {
-               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
-
-               if ( ! $policy_page_id || $policy_page_id !== (int) $post_id ) {
-                       return;
-               }
-
-               // Remove updated|removed status.
-               $old          = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
-               $done         = array();
-               $update_cache = false;
-
-               foreach ( $old as $old_key => $old_data ) {
-                       if ( ! empty( $old_data['removed'] ) ) {
-                               // Remove the old policy text.
-                               $update_cache = true;
-                               continue;
-                       }
-
-                       if ( ! empty( $old_data['updated'] ) ) {
-                               // 'updated' is now 'added'.
-                               $done[]       = array(
-                                       'plugin_name' => $old_data['plugin_name'],
-                                       'policy_text' => $old_data['policy_text'],
-                                       'added'       => $old_data['updated'],
-                               );
-                               $update_cache = true;
-                       } else {
-                               $done[] = $old_data;
-                       }
-               }
-
-               if ( $update_cache ) {
-                       delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
-                       // Update the cache.
-                       foreach ( $done as $data ) {
-                               add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
-                       }
-               }
-       }
-
-       /**
-        * Check for updated, added or removed privacy policy information from plugins.
-        *
-        * Caches the current info in post_meta of the policy page.
-        *
-        * @since 4.9.6
-        *
-        * @return array The privacy policy text/informtion added by core and plugins.
-        */
-       public static function get_suggested_policy_text() {
-               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
-               $checked        = array();
-               $time           = time();
-               $update_cache   = false;
-               $new            = self::$policy_content;
-               $old            = array();
-
-               if ( $policy_page_id ) {
-                       $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
-               }
-
-               // Check for no-changes and updates.
-               foreach ( $new as $new_key => $new_data ) {
-                       foreach ( $old as $old_key => $old_data ) {
-                               $found = false;
-
-                               if ( $new_data['policy_text'] === $old_data['policy_text'] ) {
-                                       // Use the new plugin name in case it was changed, translated, etc.
-                                       if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {
-                                               $old_data['plugin_name'] = $new_data['plugin_name'];
-                                               $update_cache            = true;
-                                       }
-
-                                       // A plugin was re-activated.
-                                       if ( ! empty( $old_data['removed'] ) ) {
-                                               unset( $old_data['removed'] );
-                                               $old_data['added'] = $time;
-                                               $update_cache      = true;
-                                       }
-
-                                       $checked[] = $old_data;
-                                       $found     = true;
-                               } elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
-                                       // The info for the policy was updated.
-                                       $checked[] = array(
-                                               'plugin_name' => $new_data['plugin_name'],
-                                               'policy_text' => $new_data['policy_text'],
-                                               'updated'     => $time,
-                                       );
-                                       $found     = $update_cache = true;
-                               }
-
-                               if ( $found ) {
-                                       unset( $new[ $new_key ], $old[ $old_key ] );
-                                       continue 2;
-                               }
-                       }
-               }
-
-               if ( ! empty( $new ) ) {
-                       // A plugin was activated.
-                       foreach ( $new as $new_data ) {
-                               if ( ! empty( $new_data['plugin_name'] ) && ! empty( $new_data['policy_text'] ) ) {
-                                       $new_data['added'] = $time;
-                                       $checked[]         = $new_data;
-                               }
-                       }
-                       $update_cache = true;
-               }
-
-               if ( ! empty( $old ) ) {
-                       // A plugin was deactivated.
-                       foreach ( $old as $old_data ) {
-                               if ( ! empty( $old_data['plugin_name'] ) && ! empty( $old_data['policy_text'] ) ) {
-                                       $data = array(
-                                               'plugin_name' => $old_data['plugin_name'],
-                                               'policy_text' => $old_data['policy_text'],
-                                               'removed'     => $time,
-                                       );
-
-                                       $checked[] = $data;
-                               }
-                       }
-                       $update_cache = true;
-               }
-
-               if ( $update_cache && $policy_page_id ) {
-                       delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
-                       // Update the cache.
-                       foreach ( $checked as $data ) {
-                               add_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content', $data );
-                       }
-               }
-
-               return $checked;
-       }
-
-       /**
-        * Add a notice with a link to the guide when editing the privacy policy page.
-        *
-        * @since 4.9.6
-        * @since 5.0.0 The $post parameter is now optional.
-        *
-        * @param WP_Post|null $post The currently edited post. Default null.
-        */
-       public static function notice( $post = null ) {
-               if ( is_null( $post ) ) {
-                       global $post;
-               } else {
-                       $post = get_post( $post );
-               }
-
-               if ( ! ( $post instanceof WP_Post ) ) {
-                       return;
-               }
-
-               if ( ! current_user_can( 'manage_privacy_options' ) ) {
-                       return;
-               }
-
-               $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
-
-               if ( ! $policy_page_id || $policy_page_id !== $post->ID ) {
-                       return;
-               }
-
-               $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' );
-               $url     = esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) );
-               $label   = __( 'View Privacy Policy Guide.' );
-
-               if ( get_current_screen()->is_block_editor() ) {
-                       wp_enqueue_script( 'wp-notices' );
-                       $action = array(
-                               'url'   => $url,
-                               'label' => $label,
-                       );
-                       wp_add_inline_script(
-                               'wp-notices',
-                               sprintf(
-                                       'wp.data.dispatch( "core/notices" ).createWarningNotice( "%s", { actions: [ %s ], isDismissible: false } )',
-                                       $message,
-                                       wp_json_encode( $action )
-                               ),
-                               'after'
-                       );
-               } else {
-                       ?>
-                       <div class="notice notice-warning inline wp-pp-notice">
-                               <p>
-                               <?php
-                               echo $message;
-                               printf(
-                                       ' <a href="%s" target="_blank">%s <span class="screen-reader-text">%s</span></a>',
-                                       $url,
-                                       $label,
-                                       /* translators: accessibility text */
-                                       __( '(opens in a new tab)' )
-                               );
-                               ?>
-                               </p>
-                       </div>
-                       <?php
-               }
-       }
-
-       /**
-        * Output the privacy policy guide together with content from the theme and plugins.
-        *
-        * @since 4.9.6
-        */
-       public static function privacy_policy_guide() {
-
-               $content_array = self::get_suggested_policy_text();
-
-               $content       = '';
-               $toc           = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
-               $date_format   = __( 'F j, Y' );
-               $copy          = __( 'Copy this section to clipboard' );
-               $return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
-
-               foreach ( $content_array as $section ) {
-                       $class = $meta = $removed = '';
-
-                       if ( ! empty( $section['removed'] ) ) {
-                               $class = ' text-removed';
-                               $date  = date_i18n( $date_format, $section['removed'] );
-                               $meta  = sprintf( __( 'Removed %s.' ), $date );
-
-                               $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
-                               $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
-                       } elseif ( ! empty( $section['updated'] ) ) {
-                               $class = ' text-updated';
-                               $date  = date_i18n( $date_format, $section['updated'] );
-                               $meta  = sprintf( __( 'Updated %s.' ), $date );
-                       }
-
-                       if ( $meta ) {
-                               $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
-                       }
-
-                       $plugin_name = esc_html( $section['plugin_name'] );
-                       $toc_id      = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
-                       $toc[]       = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
-
-                       $content .= '<div class="privacy-text-section' . $class . '">';
-                       $content .= '<a id="' . $toc_id . '">&nbsp;</a>';
-                       /* translators: %s: plugin name */
-                       $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
-                       $content .= $removed;
-
-                       $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
-                       $content .= $return_to_top;
-
-                       if ( empty( $section['removed'] ) ) {
-                               $content         .= '<div class="privacy-text-actions">';
-                                       $content     .= '<button type="button" class="privacy-text-copy button">';
-                                               $content .= $copy;
-                                               $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
-                                       $content     .= '</button>';
-                               $content         .= '</div>';
-                       }
-
-                       $content .= "</div>\n"; // End of .privacy-text-section.
-               }
-
-               if ( count( $toc ) > 2 ) {
-                       ?>
-                       <div  class="privacy-text-box-toc">
-                               <p><?php _e( 'Table of Contents' ); ?></p>
-                               <ol>
-                                       <?php echo implode( "\n", $toc ); ?>
-                               </ol>
-                       </div>
-                       <?php
-               }
-
-               ?>
-               <div class="privacy-text-box">
-                       <div class="privacy-text-box-head">
-                               <a id="wp-privacy-policy-guide-introduction">&nbsp;</a>
-                               <h2><?php _e( 'Introduction' ); ?></h2>
-                               <p><?php _e( 'Hello,' ); ?></p>
-                               <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
-                               <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>
-                               <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>
-                               <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>
-                       </div>
-
-                       <div class="privacy-text-box-body">
-                               <?php echo $content; ?>
-                       </div>
-               </div>
-               <?php
-       }
-
-       /**
-        * Return the default suggested privacy policy content.
-        *
-        * @since 4.9.6
-        * @since 5.0.0 Added the `$blocks` parameter.
-        *
-        * @param bool $description Whether to include the descriptions under the section headings. Default false.
-        * @param bool $blocks      Whether to format the content for the block editor. Default true.
-        * @return string The default policy content.
-        */
-       public static function get_default_content( $description = false, $blocks = true ) {
-               $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
-               $content        = '';
-               $strings        = array();
-
-               // Start of the suggested privacy policy text.
-               if ( $description ) {
-                       $strings[] = '<div class="wp-suggested-text">';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text, %s Site URL. */
-               $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Media' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy text. */
-               $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
-               }
-
-               /* translators: default privacy policy heading. */
-               $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
-
-               if ( $description ) {
-                       /* translators: privacy policy tutorial. */
-                       $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
-                       $strings[] = '</div>';
-               }
-
-               if ( $blocks ) {
-                       foreach ( $strings as $key => $string ) {
-                               if ( 0 === strpos( $string, '<p>' ) ) {
-                                       $strings[ $key ] = '<!-- wp:paragraph -->' . $string . '<!-- /wp:paragraph -->';
-                               }
-
-                               if ( 0 === strpos( $string, '<h2>' ) ) {
-                                       $strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
-                               }
-
-                               if ( 0 === strpos( $string, '<h3>' ) ) {
-                                       $strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
-                               }
-                       }
-               }
-
-               $content = implode( '', $strings );
-               // End of the suggested privacy policy text.
-
-               /**
-                * Filters the default content suggested for inclusion in a privacy policy.
-                *
-                * @since 4.9.6
-                * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
-                *
-                * @param string $content     The default policy content.
-                * @param array  $strings     An array of privacy policy content strings.
-                * @param bool   $description Whether policy descriptions should be included.
-                * @param bool   $blocks      Whether the content should be formatted for the block editor.
-                */
-               return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
-       }
-
-       /**
-        * Add the suggested privacy policy text to the policy postbox.
-        *
-        * @since 4.9.6
-        */
-       public static function add_suggested_content() {
-               $content = self::get_default_content( true, false );
-               wp_add_privacy_policy_content( __( 'WordPress' ), $content );
-       }
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px">  * Checks if the user needs to update PHP.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 5.1.0
</span></span></pre></div>
<a id="trunksrcwpadminincludespluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin.php    2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/plugin.php      2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2187,7 +2187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                require_once( ABSPATH . 'wp-admin/includes/misc.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        WP_Privacy_Policy_Content::add( $plugin_name, $policy_text );
</span></span></pre></div>
<a id="trunksrcwpadminincludesprivacytoolsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/includes/privacy-tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/privacy-tools.php                             (rev 0)
+++ trunk/src/wp-admin/includes/privacy-tools.php       2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,289 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * WordPress Administration Privacy Tools API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Resend an existing request and return the result.
+ *
+ * @since 4.9.6
+ * @access private
+ *
+ * @param int $request_id Request ID.
+ * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object.
+ */
+function _wp_privacy_resend_request( $request_id ) {
+       $request_id = absint( $request_id );
+       $request    = get_post( $request_id );
+
+       if ( ! $request || 'user_request' !== $request->post_type ) {
+               return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
+       }
+
+       $result = wp_send_user_request( $request_id );
+
+       if ( is_wp_error( $result ) ) {
+               return $result;
+       } elseif ( ! $result ) {
+               return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );
+       }
+
+       return true;
+}
+
+/**
+ * Marks a request as completed by the admin and logs the current timestamp.
+ *
+ * @since 4.9.6
+ * @access private
+ *
+ * @param  int          $request_id Request ID.
+ * @return int|WP_Error $result Request ID on success or WP_Error.
+ */
+function _wp_privacy_completed_request( $request_id ) {
+       $request_id = absint( $request_id );
+       $request    = wp_get_user_request_data( $request_id );
+
+       if ( ! $request ) {
+               return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
+       }
+
+       update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
+
+       $result = wp_update_post(
+               array(
+                       'ID'          => $request_id,
+                       'post_status' => 'request-completed',
+               )
+       );
+
+       return $result;
+}
+
+/**
+ * Handle list table actions.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_handle_actions() {
+       if ( isset( $_POST['privacy_action_email_retry'] ) ) {
+               check_admin_referer( 'bulk-privacy_requests' );
+
+               $request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) );
+               $result     = _wp_privacy_resend_request( $request_id );
+
+               if ( is_wp_error( $result ) ) {
+                       add_settings_error(
+                               'privacy_action_email_retry',
+                               'privacy_action_email_retry',
+                               $result->get_error_message(),
+                               'error'
+                       );
+               } else {
+                       add_settings_error(
+                               'privacy_action_email_retry',
+                               'privacy_action_email_retry',
+                               __( 'Confirmation request sent again successfully.' ),
+                               'updated'
+                       );
+               }
+       } elseif ( isset( $_POST['action'] ) ) {
+               $action = ! empty( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : '';
+
+               switch ( $action ) {
+                       case 'add_export_personal_data_request':
+                       case 'add_remove_personal_data_request':
+                               check_admin_referer( 'personal-data-request' );
+
+                               if ( ! isset( $_POST['type_of_action'], $_POST['username_or_email_for_privacy_request'] ) ) {
+                                       add_settings_error(
+                                               'action_type',
+                                               'action_type',
+                                               __( 'Invalid action.' ),
+                                               'error'
+                                       );
+                               }
+                               $action_type               = sanitize_text_field( wp_unslash( $_POST['type_of_action'] ) );
+                               $username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) );
+                               $email_address             = '';
+
+                               if ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) {
+                                       add_settings_error(
+                                               'action_type',
+                                               'action_type',
+                                               __( 'Invalid action.' ),
+                                               'error'
+                                       );
+                               }
+
+                               if ( ! is_email( $username_or_email_address ) ) {
+                                       $user = get_user_by( 'login', $username_or_email_address );
+                                       if ( ! $user instanceof WP_User ) {
+                                               add_settings_error(
+                                                       'username_or_email_for_privacy_request',
+                                                       'username_or_email_for_privacy_request',
+                                                       __( 'Unable to add this request. A valid email address or username must be supplied.' ),
+                                                       'error'
+                                               );
+                                       } else {
+                                               $email_address = $user->user_email;
+                                       }
+                               } else {
+                                       $email_address = $username_or_email_address;
+                               }
+
+                               if ( empty( $email_address ) ) {
+                                       break;
+                               }
+
+                               $request_id = wp_create_user_request( $email_address, $action_type );
+
+                               if ( is_wp_error( $request_id ) ) {
+                                       add_settings_error(
+                                               'username_or_email_for_privacy_request',
+                                               'username_or_email_for_privacy_request',
+                                               $request_id->get_error_message(),
+                                               'error'
+                                       );
+                                       break;
+                               } elseif ( ! $request_id ) {
+                                       add_settings_error(
+                                               'username_or_email_for_privacy_request',
+                                               'username_or_email_for_privacy_request',
+                                               __( 'Unable to initiate confirmation request.' ),
+                                               'error'
+                                       );
+                                       break;
+                               }
+
+                               wp_send_user_request( $request_id );
+
+                               add_settings_error(
+                                       'username_or_email_for_privacy_request',
+                                       'username_or_email_for_privacy_request',
+                                       __( 'Confirmation request initiated successfully.' ),
+                                       'updated'
+                               );
+                               break;
+               }
+       }
+}
+
+/**
+ * Cleans up failed and expired requests before displaying the list table.
+ *
+ * @since 4.9.6
+ * @access private
+ */
+function _wp_personal_data_cleanup_requests() {
+       /** This filter is documented in wp-includes/user.php */
+       $expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
+
+       $requests_query = new WP_Query(
+               array(
+                       'post_type'      => 'user_request',
+                       'posts_per_page' => -1,
+                       'post_status'    => 'request-pending',
+                       'fields'         => 'ids',
+                       'date_query'     => array(
+                               array(
+                                       'column' => 'post_modified_gmt',
+                                       'before' => $expires . ' seconds ago',
+                               ),
+                       ),
+               )
+       );
+
+       $request_ids = $requests_query->posts;
+
+       foreach ( $request_ids as $request_id ) {
+               wp_update_post(
+                       array(
+                               'ID'            => $request_id,
+                               'post_status'   => 'request-failed',
+                               'post_password' => '',
+                       )
+               );
+       }
+}
+
+/**
+ * Mark erasure requests as completed after processing is finished.
+ *
+ * This intercepts the Ajax responses to personal data eraser page requests, and
+ * monitors the status of a request. Once all of the processing has finished, the
+ * request is marked as completed.
+ *
+ * @since 4.9.6
+ *
+ * @see wp_privacy_personal_data_erasure_page
+ *
+ * @param array  $response      The response from the personal data eraser for
+ *                              the given page.
+ * @param int    $eraser_index  The index of the personal data eraser. Begins
+ *                              at 1.
+ * @param string $email_address The email address of the user whose personal
+ *                              data this is.
+ * @param int    $page          The page of personal data for this eraser.
+ *                              Begins at 1.
+ * @param int    $request_id    The request ID for this personal data erasure.
+ * @return array The filtered response.
+ */
+function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) {
+       /*
+        * If the eraser response is malformed, don't attempt to consume it; let it
+        * pass through, so that the default Ajax processing will generate a warning
+        * to the user.
+        */
+       if ( ! is_array( $response ) ) {
+               return $response;
+       }
+
+       if ( ! array_key_exists( 'done', $response ) ) {
+               return $response;
+       }
+
+       if ( ! array_key_exists( 'items_removed', $response ) ) {
+               return $response;
+       }
+
+       if ( ! array_key_exists( 'items_retained', $response ) ) {
+               return $response;
+       }
+
+       if ( ! array_key_exists( 'messages', $response ) ) {
+               return $response;
+       }
+
+       $request = wp_get_user_request_data( $request_id );
+
+       if ( ! $request || 'remove_personal_data' !== $request->action_name ) {
+               wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) );
+       }
+
+       /** This filter is documented in wp-admin/includes/ajax-actions.php */
+       $erasers        = apply_filters( 'wp_privacy_personal_data_erasers', array() );
+       $is_last_eraser = count( $erasers ) === $eraser_index;
+       $eraser_done    = $response['done'];
+
+       if ( ! $is_last_eraser || ! $eraser_done ) {
+               return $response;
+       }
+
+       _wp_privacy_completed_request( $request_id );
+
+       /**
+        * Fires immediately after a personal data erasure request has been marked completed.
+        *
+        * @since 4.9.6
+        *
+        * @param int $request_id The privacy request post ID associated with this request.
+        */
+       do_action( 'wp_privacy_personal_data_erased', $request_id );
+
+       return $response;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/includes/privacy-tools.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminincludesupgradephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/upgrade.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/upgrade.php   2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/upgrade.php     2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $privacy_policy_content = get_site_option( 'default_privacy_policy_content' );
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                include_once( ABSPATH . 'wp-admin/includes/misc.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         include_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();
</span></span></pre></div>
<a id="trunksrcwpadminincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/user.php      2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/includes/user.php        2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -582,1142 +582,3 @@
</span><span class="cx" style="display: block; padding: 0 10px">                wp_specialchars_decode( translate_user_role( $role['name'] ) )
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-/**
- * Resend an existing request and return the result.
- *
- * @since 4.9.6
- * @access private
- *
- * @param int $request_id Request ID.
- * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object.
- */
-function _wp_privacy_resend_request( $request_id ) {
-       $request_id = absint( $request_id );
-       $request    = get_post( $request_id );
-
-       if ( ! $request || 'user_request' !== $request->post_type ) {
-               return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
-       }
-
-       $result = wp_send_user_request( $request_id );
-
-       if ( is_wp_error( $result ) ) {
-               return $result;
-       } elseif ( ! $result ) {
-               return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );
-       }
-
-       return true;
-}
-
-/**
- * Marks a request as completed by the admin and logs the current timestamp.
- *
- * @since 4.9.6
- * @access private
- *
- * @param  int          $request_id Request ID.
- * @return int|WP_Error $result Request ID on success or WP_Error.
- */
-function _wp_privacy_completed_request( $request_id ) {
-       $request_id = absint( $request_id );
-       $request    = wp_get_user_request_data( $request_id );
-
-       if ( ! $request ) {
-               return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
-       }
-
-       update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
-
-       $result = wp_update_post(
-               array(
-                       'ID'          => $request_id,
-                       'post_status' => 'request-completed',
-               )
-       );
-
-       return $result;
-}
-
-/**
- * Handle list table actions.
- *
- * @since 4.9.6
- * @access private
- */
-function _wp_personal_data_handle_actions() {
-       if ( isset( $_POST['privacy_action_email_retry'] ) ) {
-               check_admin_referer( 'bulk-privacy_requests' );
-
-               $request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) );
-               $result     = _wp_privacy_resend_request( $request_id );
-
-               if ( is_wp_error( $result ) ) {
-                       add_settings_error(
-                               'privacy_action_email_retry',
-                               'privacy_action_email_retry',
-                               $result->get_error_message(),
-                               'error'
-                       );
-               } else {
-                       add_settings_error(
-                               'privacy_action_email_retry',
-                               'privacy_action_email_retry',
-                               __( 'Confirmation request sent again successfully.' ),
-                               'updated'
-                       );
-               }
-       } elseif ( isset( $_POST['action'] ) ) {
-               $action = isset( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : '';
-
-               switch ( $action ) {
-                       case 'add_export_personal_data_request':
-                       case 'add_remove_personal_data_request':
-                               check_admin_referer( 'personal-data-request' );
-
-                               if ( ! isset( $_POST['type_of_action'], $_POST['username_or_email_for_privacy_request'] ) ) {
-                                       add_settings_error(
-                                               'action_type',
-                                               'action_type',
-                                               __( 'Invalid action.' ),
-                                               'error'
-                                       );
-                               }
-                               $action_type               = sanitize_text_field( wp_unslash( $_POST['type_of_action'] ) );
-                               $username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) );
-                               $email_address             = '';
-
-                               if ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) {
-                                       add_settings_error(
-                                               'action_type',
-                                               'action_type',
-                                               __( 'Invalid action.' ),
-                                               'error'
-                                       );
-                               }
-
-                               if ( ! is_email( $username_or_email_address ) ) {
-                                       $user = get_user_by( 'login', $username_or_email_address );
-                                       if ( ! $user instanceof WP_User ) {
-                                               add_settings_error(
-                                                       'username_or_email_for_privacy_request',
-                                                       'username_or_email_for_privacy_request',
-                                                       __( 'Unable to add this request. A valid email address or username must be supplied.' ),
-                                                       'error'
-                                               );
-                                       } else {
-                                               $email_address = $user->user_email;
-                                       }
-                               } else {
-                                       $email_address = $username_or_email_address;
-                               }
-
-                               if ( empty( $email_address ) ) {
-                                       break;
-                               }
-
-                               $request_id = wp_create_user_request( $email_address, $action_type );
-
-                               if ( is_wp_error( $request_id ) ) {
-                                       add_settings_error(
-                                               'username_or_email_for_privacy_request',
-                                               'username_or_email_for_privacy_request',
-                                               $request_id->get_error_message(),
-                                               'error'
-                                       );
-                                       break;
-                               } elseif ( ! $request_id ) {
-                                       add_settings_error(
-                                               'username_or_email_for_privacy_request',
-                                               'username_or_email_for_privacy_request',
-                                               __( 'Unable to initiate confirmation request.' ),
-                                               'error'
-                                       );
-                                       break;
-                               }
-
-                               wp_send_user_request( $request_id );
-
-                               add_settings_error(
-                                       'username_or_email_for_privacy_request',
-                                       'username_or_email_for_privacy_request',
-                                       __( 'Confirmation request initiated successfully.' ),
-                                       'updated'
-                               );
-                               break;
-               }
-       }
-}
-
-/**
- * Cleans up failed and expired requests before displaying the list table.
- *
- * @since 4.9.6
- * @access private
- */
-function _wp_personal_data_cleanup_requests() {
-       /** This filter is documented in wp-includes/user.php */
-       $expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
-
-       $requests_query = new WP_Query(
-               array(
-                       'post_type'      => 'user_request',
-                       'posts_per_page' => -1,
-                       'post_status'    => 'request-pending',
-                       'fields'         => 'ids',
-                       'date_query'     => array(
-                               array(
-                                       'column' => 'post_modified_gmt',
-                                       'before' => $expires . ' seconds ago',
-                               ),
-                       ),
-               )
-       );
-
-       $request_ids = $requests_query->posts;
-
-       foreach ( $request_ids as $request_id ) {
-               wp_update_post(
-                       array(
-                               'ID'            => $request_id,
-                               'post_status'   => 'request-failed',
-                               'post_password' => '',
-                       )
-               );
-       }
-}
-
-/**
- * Personal data export.
- *
- * @since 4.9.6
- * @access private
- */
-function _wp_personal_data_export_page() {
-       if ( ! current_user_can( 'export_others_personal_data' ) ) {
-               wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) );
-       }
-
-       _wp_personal_data_handle_actions();
-       _wp_personal_data_cleanup_requests();
-
-       // "Borrow" xfn.js for now so we don't have to create new files.
-       wp_enqueue_script( 'xfn' );
-
-       $requests_table = new WP_Privacy_Data_Export_Requests_Table(
-               array(
-                       'plural'   => 'privacy_requests',
-                       'singular' => 'privacy_request',
-                       'screen'   => 'export_personal_data',
-               )
-       );
-
-       $requests_table->screen->set_screen_reader_content(
-               array(
-                       'heading_views'      => __( 'Filter export personal data list' ),
-                       'heading_pagination' => __( 'Export personal data list navigation' ),
-                       'heading_list'       => __( 'Export personal data list' ),
-               )
-       );
-
-       $requests_table->process_bulk_action();
-       $requests_table->prepare_items();
-       ?>
-       <div class="wrap nosubsub">
-               <h1><?php esc_html_e( 'Export Personal Data' ); ?></h1>
-               <hr class="wp-header-end" />
-
-               <?php settings_errors(); ?>
-
-               <form action="<?php echo esc_url( admin_url( 'tools.php?page=export_personal_data' ) ); ?>" method="post" class="wp-privacy-request-form">
-                       <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
-                       <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
-
-                       <div class="wp-privacy-request-form-field">
-                               <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
-                               <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
-                               <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
-                       </div>
-                       <?php wp_nonce_field( 'personal-data-request' ); ?>
-                       <input type="hidden" name="action" value="add_export_personal_data_request" />
-                       <input type="hidden" name="type_of_action" value="export_personal_data" />
-               </form>
-               <hr />
-
-               <?php $requests_table->views(); ?>
-
-               <form class="search-form wp-clearfix">
-                       <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
-                       <input type="hidden" name="page" value="export_personal_data" />
-                       <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
-                       <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
-                       <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
-               </form>
-
-               <form method="post">
-                       <?php
-                       $requests_table->display();
-                       $requests_table->embed_scripts();
-                       ?>
-               </form>
-       </div>
-       <?php
-}
-
-/**
- * Personal data anonymization.
- *
- * @since 4.9.6
- * @access private
- */
-function _wp_personal_data_removal_page() {
-       /*
-        * Require both caps in order to make it explicitly clear that delegating
-        * erasure from network admins to single-site admins will give them the
-        * ability to affect global users, rather than being limited to the site
-        * that they administer.
-        */
-       if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
-               wp_die( __( 'Sorry, you are not allowed to erase data on this site.' ) );
-       }
-
-       _wp_personal_data_handle_actions();
-       _wp_personal_data_cleanup_requests();
-
-       // "Borrow" xfn.js for now so we don't have to create new files.
-       wp_enqueue_script( 'xfn' );
-
-       $requests_table = new WP_Privacy_Data_Removal_Requests_Table(
-               array(
-                       'plural'   => 'privacy_requests',
-                       'singular' => 'privacy_request',
-                       'screen'   => 'remove_personal_data',
-               )
-       );
-
-       $requests_table->screen->set_screen_reader_content(
-               array(
-                       'heading_views'      => __( 'Filter erase personal data list' ),
-                       'heading_pagination' => __( 'Erase personal data list navigation' ),
-                       'heading_list'       => __( 'Erase personal data list' ),
-               )
-       );
-
-       $requests_table->process_bulk_action();
-       $requests_table->prepare_items();
-
-       ?>
-       <div class="wrap nosubsub">
-               <h1><?php esc_html_e( 'Erase Personal Data' ); ?></h1>
-               <hr class="wp-header-end" />
-
-               <?php settings_errors(); ?>
-
-               <form action="<?php echo esc_url( admin_url( 'tools.php?page=remove_personal_data' ) ); ?>" method="post" class="wp-privacy-request-form">
-                       <h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>
-                       <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
-
-                       <div class="wp-privacy-request-form-field">
-                               <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label>
-                               <input type="text" required class="regular-text" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" />
-                               <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?>
-                       </div>
-                       <?php wp_nonce_field( 'personal-data-request' ); ?>
-                       <input type="hidden" name="action" value="add_remove_personal_data_request" />
-                       <input type="hidden" name="type_of_action" value="remove_personal_data" />
-               </form>
-               <hr />
-
-               <?php $requests_table->views(); ?>
-
-               <form class="search-form wp-clearfix">
-                       <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?>
-                       <input type="hidden" name="page" value="remove_personal_data" />
-                       <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" />
-                       <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" />
-                       <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" />
-               </form>
-
-               <form method="post">
-                       <?php
-                       $requests_table->display();
-                       $requests_table->embed_scripts();
-                       ?>
-               </form>
-       </div>
-       <?php
-}
-
-/**
- * Mark erasure requests as completed after processing is finished.
- *
- * This intercepts the Ajax responses to personal data eraser page requests, and
- * monitors the status of a request. Once all of the processing has finished, the
- * request is marked as completed.
- *
- * @since 4.9.6
- *
- * @see wp_privacy_personal_data_erasure_page
- *
- * @param array  $response      The response from the personal data eraser for
- *                              the given page.
- * @param int    $eraser_index  The index of the personal data eraser. Begins
- *                              at 1.
- * @param string $email_address The email address of the user whose personal
- *                              data this is.
- * @param int    $page          The page of personal data for this eraser.
- *                              Begins at 1.
- * @param int    $request_id    The request ID for this personal data erasure.
- * @return array The filtered response.
- */
-function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index, $email_address, $page, $request_id ) {
-       /*
-        * If the eraser response is malformed, don't attempt to consume it; let it
-        * pass through, so that the default Ajax processing will generate a warning
-        * to the user.
-        */
-       if ( ! is_array( $response ) ) {
-               return $response;
-       }
-
-       if ( ! array_key_exists( 'done', $response ) ) {
-               return $response;
-       }
-
-       if ( ! array_key_exists( 'items_removed', $response ) ) {
-               return $response;
-       }
-
-       if ( ! array_key_exists( 'items_retained', $response ) ) {
-               return $response;
-       }
-
-       if ( ! array_key_exists( 'messages', $response ) ) {
-               return $response;
-       }
-
-       $request = wp_get_user_request_data( $request_id );
-
-       if ( ! $request || 'remove_personal_data' !== $request->action_name ) {
-               wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) );
-       }
-
-       /** This filter is documented in wp-admin/includes/ajax-actions.php */
-       $erasers        = apply_filters( 'wp_privacy_personal_data_erasers', array() );
-       $is_last_eraser = count( $erasers ) === $eraser_index;
-       $eraser_done    = $response['done'];
-
-       if ( ! $is_last_eraser || ! $eraser_done ) {
-               return $response;
-       }
-
-       _wp_privacy_completed_request( $request_id );
-
-       /**
-        * Fires immediately after a personal data erasure request has been marked completed.
-        *
-        * @since 4.9.6
-        *
-        * @param int $request_id The privacy request post ID associated with this request.
-        */
-       do_action( 'wp_privacy_personal_data_erased', $request_id );
-
-       return $response;
-}
-
-/**
- * Add requests pages.
- *
- * @since 4.9.6
- * @access private
- */
-function _wp_privacy_hook_requests_page() {
-       add_submenu_page( 'tools.php', __( 'Export Personal Data' ), __( 'Export Personal Data' ), 'export_others_personal_data', 'export_personal_data', '_wp_personal_data_export_page' );
-       add_submenu_page( 'tools.php', __( 'Erase Personal Data' ), __( 'Erase Personal Data' ), 'erase_others_personal_data', 'remove_personal_data', '_wp_personal_data_removal_page' );
-}
-
-/**
- * Add options for the privacy requests screens.
- *
- * @since 4.9.8
- * @access private
- */
-function _wp_privacy_requests_screen_options() {
-       $args = array(
-               'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) . '_requests_per_page',
-       );
-       add_screen_option( 'per_page', $args );
-}
-
-// TODO: move the following classes in new files.
-if ( ! class_exists( 'WP_List_Table' ) ) {
-       require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
-}
-
-/**
- * WP_Privacy_Requests_Table class.
- *
- * @since 4.9.6
- */
-abstract class WP_Privacy_Requests_Table extends WP_List_Table {
-
-       /**
-        * Action name for the requests this table will work with. Classes
-        * which inherit from WP_Privacy_Requests_Table should define this.
-        *
-        * Example: 'export_personal_data'.
-        *
-        * @since 4.9.6
-        *
-        * @var string $request_type Name of action.
-        */
-       protected $request_type = 'INVALID';
-
-       /**
-        * Post type to be used.
-        *
-        * @since 4.9.6
-        *
-        * @var string $post_type The post type.
-        */
-       protected $post_type = 'INVALID';
-
-       /**
-        * Get columns to show in the list table.
-        *
-        * @since 4.9.6
-        *
-        * @return array Array of columns.
-        */
-       public function get_columns() {
-               $columns = array(
-                       'cb'                => '<input type="checkbox" />',
-                       'email'             => __( 'Requester' ),
-                       'status'            => __( 'Status' ),
-                       'created_timestamp' => __( 'Requested' ),
-                       'next_steps'        => __( 'Next Steps' ),
-               );
-               return $columns;
-       }
-
-       /**
-        * Get a list of sortable columns.
-        *
-        * @since 4.9.6
-        *
-        * @return array Default sortable columns.
-        */
-       protected function get_sortable_columns() {
-               // The initial sorting is by 'Requested' (post_date) and descending.
-               // With initial sorting, the first click on 'Requested' should be ascending.
-               // With 'Requester' sorting active, the next click on 'Requested' should be descending.
-               $desc_first = isset( $_GET['orderby'] );
-
-               return array(
-                       'email'             => 'requester',
-                       'created_timestamp' => array( 'requested', $desc_first ),
-               );
-       }
-
-       /**
-        * Default primary column.
-        *
-        * @since 4.9.6
-        *
-        * @return string Default primary column name.
-        */
-       protected function get_default_primary_column_name() {
-               return 'email';
-       }
-
-       /**
-        * Count number of requests for each status.
-        *
-        * @since 4.9.6
-        *
-        * @return object Number of posts for each status.
-        */
-       protected function get_request_counts() {
-               global $wpdb;
-
-               $cache_key = $this->post_type . '-' . $this->request_type;
-               $counts    = wp_cache_get( $cache_key, 'counts' );
-
-               if ( false !== $counts ) {
-                       return $counts;
-               }
-
-               $query = "
-                       SELECT post_status, COUNT( * ) AS num_posts
-                       FROM {$wpdb->posts}
-                       WHERE post_type = %s
-                       AND post_name = %s
-                       GROUP BY post_status";
-
-               $results = (array) $wpdb->get_results( $wpdb->prepare( $query, $this->post_type, $this->request_type ), ARRAY_A );
-               $counts  = array_fill_keys( get_post_stati(), 0 );
-
-               foreach ( $results as $row ) {
-                       $counts[ $row['post_status'] ] = $row['num_posts'];
-               }
-
-               $counts = (object) $counts;
-               wp_cache_set( $cache_key, $counts, 'counts' );
-
-               return $counts;
-       }
-
-       /**
-        * Get an associative array ( id => link ) with the list of views available on this table.
-        *
-        * @since 4.9.6
-        *
-        * @return array Associative array of views in the format of $view_name => $view_markup.
-        */
-       protected function get_views() {
-               $current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
-               $statuses       = _wp_privacy_statuses();
-               $views          = array();
-               $admin_url      = admin_url( 'tools.php?page=' . $this->request_type );
-               $counts         = $this->get_request_counts();
-               $total_requests = absint( array_sum( (array) $counts ) );
-
-               $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
-               $status_label            = sprintf(
-                       /* translators: %s: all requests count */
-                       _nx(
-                               'All <span class="count">(%s)</span>',
-                               'All <span class="count">(%s)</span>',
-                               $total_requests,
-                               'requests'
-                       ),
-                       number_format_i18n( $total_requests )
-               );
-
-               $views['all'] = sprintf(
-                       '<a href="%s"%s>%s</a>',
-                       esc_url( $admin_url ),
-                       $current_link_attributes,
-                       $status_label
-               );
-
-               foreach ( $statuses as $status => $label ) {
-                       $post_status = get_post_status_object( $status );
-                       if ( ! $post_status ) {
-                               continue;
-                       }
-
-                       $current_link_attributes = $status === $current_status ? ' class="current" aria-current="page"' : '';
-                       $total_status_requests   = absint( $counts->{$status} );
-                       $status_label            = sprintf(
-                               translate_nooped_plural( $post_status->label_count, $total_status_requests ),
-                               number_format_i18n( $total_status_requests )
-                       );
-                       $status_link             = add_query_arg( 'filter-status', $status, $admin_url );
-
-                       $views[ $status ] = sprintf(
-                               '<a href="%s"%s>%s</a>',
-                               esc_url( $status_link ),
-                               $current_link_attributes,
-                               $status_label
-                       );
-               }
-
-               return $views;
-       }
-
-       /**
-        * Get bulk actions.
-        *
-        * @since 4.9.6
-        *
-        * @return array List of bulk actions.
-        */
-       protected function get_bulk_actions() {
-               return array(
-                       'delete' => __( 'Remove' ),
-                       'resend' => __( 'Resend email' ),
-               );
-       }
-
-       /**
-        * Process bulk actions.
-        *
-        * @since 4.9.6
-        */
-       public function process_bulk_action() {
-               $action      = $this->current_action();
-               $request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();
-
-               $count = 0;
-
-               if ( $request_ids ) {
-                       check_admin_referer( 'bulk-privacy_requests' );
-               }
-
-               switch ( $action ) {
-                       case 'delete':
-                               foreach ( $request_ids as $request_id ) {
-                                       if ( wp_delete_post( $request_id, true ) ) {
-                                               $count ++;
-                                       }
-                               }
-
-                               add_settings_error(
-                                       'bulk_action',
-                                       'bulk_action',
-                                       /* translators: %d: number of requests */
-                                       sprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ),
-                                       'updated'
-                               );
-                               break;
-                       case 'resend':
-                               foreach ( $request_ids as $request_id ) {
-                                       $resend = _wp_privacy_resend_request( $request_id );
-
-                                       if ( $resend && ! is_wp_error( $resend ) ) {
-                                               $count++;
-                                       }
-                               }
-
-                               add_settings_error(
-                                       'bulk_action',
-                                       'bulk_action',
-                                       /* translators: %d: number of requests */
-                                       sprintf( _n( 'Re-sent %d request', 'Re-sent %d requests', $count ), $count ),
-                                       'updated'
-                               );
-                               break;
-               }
-       }
-
-       /**
-        * Prepare items to output.
-        *
-        * @since 4.9.6
-        * @since 5.1.0 Added support for column sorting.
-        */
-       public function prepare_items() {
-               global $wpdb;
-
-               $this->items    = array();
-               $posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );
-               $args           = array(
-                       'post_type'      => $this->post_type,
-                       'post_name__in'  => array( $this->request_type ),
-                       'posts_per_page' => $posts_per_page,
-                       'offset'         => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page : 0,
-                       'post_status'    => 'any',
-                       's'              => isset( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : '',
-               );
-
-               $orderby_mapping = array(
-                       'requester' => 'post_title',
-                       'requested' => 'post_date',
-               );
-
-               if ( isset( $_REQUEST['orderby'] ) && isset( $orderby_mapping[ $_REQUEST['orderby'] ] ) ) {
-                       $args['orderby'] = $orderby_mapping[ $_REQUEST['orderby'] ];
-               }
-
-               if ( isset( $_REQUEST['order'] ) && in_array( strtoupper( $_REQUEST['order'] ), array( 'ASC', 'DESC' ), true ) ) {
-                       $args['order'] = strtoupper( $_REQUEST['order'] );
-               }
-
-               if ( ! empty( $_REQUEST['filter-status'] ) ) {
-                       $filter_status       = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : '';
-                       $args['post_status'] = $filter_status;
-               }
-
-               $requests_query = new WP_Query( $args );
-               $requests       = $requests_query->posts;
-
-               foreach ( $requests as $request ) {
-                       $this->items[] = wp_get_user_request_data( $request->ID );
-               }
-
-               $this->items = array_filter( $this->items );
-
-               $this->set_pagination_args(
-                       array(
-                               'total_items' => $requests_query->found_posts,
-                               'per_page'    => $posts_per_page,
-                       )
-               );
-       }
-
-       /**
-        * Checkbox column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        * @return string Checkbox column markup.
-        */
-       public function column_cb( $item ) {
-               return sprintf( '<input type="checkbox" name="request_id[]" value="%1$s" /><span class="spinner"></span>', esc_attr( $item->ID ) );
-       }
-
-       /**
-        * Status column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        * @return string Status column markup.
-        */
-       public function column_status( $item ) {
-               $status        = get_post_status( $item->ID );
-               $status_object = get_post_status_object( $status );
-
-               if ( ! $status_object || empty( $status_object->label ) ) {
-                       return '-';
-               }
-
-               $timestamp = false;
-
-               switch ( $status ) {
-                       case 'request-confirmed':
-                               $timestamp = $item->confirmed_timestamp;
-                               break;
-                       case 'request-completed':
-                               $timestamp = $item->completed_timestamp;
-                               break;
-               }
-
-               echo '<span class="status-label status-' . esc_attr( $status ) . '">';
-               echo esc_html( $status_object->label );
-
-               if ( $timestamp ) {
-                       echo ' (' . $this->get_timestamp_as_date( $timestamp ) . ')';
-               }
-
-               echo '</span>';
-       }
-
-       /**
-        * Convert timestamp for display.
-        *
-        * @since 4.9.6
-        *
-        * @param int $timestamp Event timestamp.
-        * @return string Human readable date.
-        */
-       protected function get_timestamp_as_date( $timestamp ) {
-               if ( empty( $timestamp ) ) {
-                       return '';
-               }
-
-               $time_diff = time() - $timestamp;
-
-               if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
-                       /* translators: human readable timestamp */
-                       return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
-               }
-
-               return date_i18n( get_option( 'date_format' ), $timestamp );
-       }
-
-       /**
-        * Default column handler.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item        Item being shown.
-        * @param string          $column_name Name of column being shown.
-        * @return string Default column output.
-        */
-       public function column_default( $item, $column_name ) {
-               $cell_value = $item->$column_name;
-
-               if ( in_array( $column_name, array( 'created_timestamp' ), true ) ) {
-                       return $this->get_timestamp_as_date( $cell_value );
-               }
-
-               return $cell_value;
-       }
-
-       /**
-        * Actions column. Overridden by children.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        * @return string Email column markup.
-        */
-       public function column_email( $item ) {
-               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( array() ) );
-       }
-
-       /**
-        * Next steps column. Overridden by children.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        */
-       public function column_next_steps( $item ) {}
-
-       /**
-        * Generates content for a single row of the table,
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item The current item.
-        */
-       public function single_row( $item ) {
-               $status = $item->status;
-
-               echo '<tr id="request-' . esc_attr( $item->ID ) . '" class="status-' . esc_attr( $status ) . '">';
-               $this->single_row_columns( $item );
-               echo '</tr>';
-       }
-
-       /**
-        * Embed scripts used to perform actions. Overridden by children.
-        *
-        * @since 4.9.6
-        */
-       public function embed_scripts() {}
-}
-
-/**
- * WP_Privacy_Data_Export_Requests_Table class.
- *
- * @since 4.9.6
- */
-class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
-       /**
-        * Action name for the requests this table will work with.
-        *
-        * @since 4.9.6
-        *
-        * @var string $request_type Name of action.
-        */
-       protected $request_type = 'export_personal_data';
-
-       /**
-        * Post type for the requests.
-        *
-        * @since 4.9.6
-        *
-        * @var string $post_type The post type.
-        */
-       protected $post_type = 'user_request';
-
-       /**
-        * Actions column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        * @return string Email column markup.
-        */
-       public function column_email( $item ) {
-               /** This filter is documented in wp-admin/includes/ajax-actions.php */
-               $exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );
-               $exporters_count = count( $exporters );
-               $request_id      = $item->ID;
-               $nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
-
-               $download_data_markup = '<div class="export-personal-data" ' .
-                       'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
-                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
-                       'data-nonce="' . esc_attr( $nonce ) .
-                       '">';
-
-               $download_data_markup .= '<span class="export-personal-data-idle"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data' ) . '</button></span>' .
-                       '<span style="display:none" class="export-personal-data-processing" >' . __( 'Downloading Data...' ) . '</span>' .
-                       '<span style="display:none" class="export-personal-data-success"><button type="button" class="button-link export-personal-data-handle">' . __( 'Download Personal Data Again' ) . '</button></span>' .
-                       '<span style="display:none" class="export-personal-data-failed">' . __( 'Download failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>';
-
-               $download_data_markup .= '</div>';
-
-               $row_actions = array(
-                       'download-data' => $download_data_markup,
-               );
-
-               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
-       }
-
-       /**
-        * Displays the next steps column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        */
-       public function column_next_steps( $item ) {
-               $status = $item->status;
-
-               switch ( $status ) {
-                       case 'request-pending':
-                               esc_html_e( 'Waiting for confirmation' );
-                               break;
-                       case 'request-confirmed':
-                               /** This filter is documented in wp-admin/includes/ajax-actions.php */
-                               $exporters       = apply_filters( 'wp_privacy_personal_data_exporters', array() );
-                               $exporters_count = count( $exporters );
-                               $request_id      = $item->ID;
-                               $nonce           = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
-
-                               echo '<div class="export-personal-data" ' .
-                                       'data-send-as-email="1" ' .
-                                       'data-exporters-count="' . esc_attr( $exporters_count ) . '" ' .
-                                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
-                                       'data-nonce="' . esc_attr( $nonce ) .
-                                       '">';
-
-                               ?>
-                               <span class="export-personal-data-idle"><button type="button" class="button export-personal-data-handle"><?php _e( 'Send Export Link' ); ?></button></span>
-                               <span style="display:none" class="export-personal-data-processing button updating-message" ><?php _e( 'Sending Email...' ); ?></span>
-                               <span style="display:none" class="export-personal-data-success success-message" ><?php _e( 'Email sent.' ); ?></span>
-                               <span style="display:none" class="export-personal-data-failed"><?php _e( 'Email could not be sent.' ); ?> <button type="button" class="button export-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
-                               <?php
-
-                               echo '</div>';
-                               break;
-                       case 'request-failed':
-                               submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
-                               break;
-                       case 'request-completed':
-                               echo '<a href="' . esc_url(
-                                       wp_nonce_url(
-                                               add_query_arg(
-                                                       array(
-                                                               'action'     => 'delete',
-                                                               'request_id' => array( $item->ID ),
-                                                       ),
-                                                       admin_url( 'tools.php?page=export_personal_data' )
-                                               ),
-                                               'bulk-privacy_requests'
-                                       )
-                               ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
-                               break;
-               }
-       }
-}
-
-/**
- * WP_Privacy_Data_Removal_Requests_Table class.
- *
- * @since 4.9.6
- */
-class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
-       /**
-        * Action name for the requests this table will work with.
-        *
-        * @since 4.9.6
-        *
-        * @var string $request_type Name of action.
-        */
-       protected $request_type = 'remove_personal_data';
-
-       /**
-        * Post type for the requests.
-        *
-        * @since 4.9.6
-        *
-        * @var string $post_type The post type.
-        */
-       protected $post_type = 'user_request';
-
-       /**
-        * Actions column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        * @return string Email column markup.
-        */
-       public function column_email( $item ) {
-               $row_actions = array();
-
-               // Allow the administrator to "force remove" the personal data even if confirmation has not yet been received.
-               $status = $item->status;
-               if ( 'request-confirmed' !== $status ) {
-                       /** This filter is documented in wp-admin/includes/ajax-actions.php */
-                       $erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );
-                       $erasers_count = count( $erasers );
-                       $request_id    = $item->ID;
-                       $nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
-
-                       $remove_data_markup = '<div class="remove-personal-data force-remove-personal-data" ' .
-                               'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
-                               'data-request-id="' . esc_attr( $request_id ) . '" ' .
-                               'data-nonce="' . esc_attr( $nonce ) .
-                               '">';
-
-                       $remove_data_markup .= '<span class="remove-personal-data-idle"><button type="button" class="button-link remove-personal-data-handle">' . __( 'Force Erase Personal Data' ) . '</button></span>' .
-                               '<span style="display:none" class="remove-personal-data-processing" >' . __( 'Erasing Data...' ) . '</span>' .
-                               '<span style="display:none" class="remove-personal-data-failed">' . __( 'Force Erase has failed.' ) . ' <button type="button" class="button-link remove-personal-data-handle">' . __( 'Retry' ) . '</button></span>';
-
-                       $remove_data_markup .= '</div>';
-
-                       $row_actions = array(
-                               'remove-data' => $remove_data_markup,
-                       );
-               }
-
-               return sprintf( '<a href="%1$s">%2$s</a> %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( $row_actions ) );
-       }
-
-       /**
-        * Next steps column.
-        *
-        * @since 4.9.6
-        *
-        * @param WP_User_Request $item Item being shown.
-        */
-       public function column_next_steps( $item ) {
-               $status = $item->status;
-
-               switch ( $status ) {
-                       case 'request-pending':
-                               esc_html_e( 'Waiting for confirmation' );
-                               break;
-                       case 'request-confirmed':
-                               /** This filter is documented in wp-admin/includes/ajax-actions.php */
-                               $erasers       = apply_filters( 'wp_privacy_personal_data_erasers', array() );
-                               $erasers_count = count( $erasers );
-                               $request_id    = $item->ID;
-                               $nonce         = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
-
-                               echo '<div class="remove-personal-data" ' .
-                                       'data-force-erase="1" ' .
-                                       'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
-                                       'data-request-id="' . esc_attr( $request_id ) . '" ' .
-                                       'data-nonce="' . esc_attr( $nonce ) .
-                                       '">';
-
-                               ?>
-                               <span class="remove-personal-data-idle"><button type="button" class="button remove-personal-data-handle"><?php _e( 'Erase Personal Data' ); ?></button></span>
-                               <span style="display:none" class="remove-personal-data-processing button updating-message" ><?php _e( 'Erasing Data...' ); ?></span>
-                               <span style="display:none" class="remove-personal-data-failed"><?php _e( 'Erasing Data has failed.' ); ?> <button type="button" class="button remove-personal-data-handle"><?php _e( 'Retry' ); ?></button></span>
-                               <?php
-
-                               echo '</div>';
-
-                               break;
-                       case 'request-failed':
-                               submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
-                               break;
-                       case 'request-completed':
-                               echo '<a href="' . esc_url(
-                                       wp_nonce_url(
-                                               add_query_arg(
-                                                       array(
-                                                               'action'     => 'delete',
-                                                               'request_id' => array( $item->ID ),
-                                                       ),
-                                                       admin_url( 'tools.php?page=remove_personal_data' )
-                                               ),
-                                               'bulk-privacy_requests'
-                                       )
-                               ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
-                               break;
-               }
-       }
-
-}
</del></span></pre></div>
<a id="trunksrcwpadminmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/menu.php       2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/menu.php 2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,8 +264,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['tools.php'][20] = array( __( 'Site Health' ), 'install_plugins', 'site-health.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        $submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' );
+       $submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_multisite() && ! is_main_site() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $submenu['tools.php'][25] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,7 +280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' );
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' );
</span><span class="cx" style="display: block; padding: 0 10px">        $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'privacy.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'options-privacy.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpadminoptionsprivacyphpfromrev45407trunksrcwpadminprivacyphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/src/wp-admin/options-privacy.php (from rev 45407, trunk/src/wp-admin/privacy.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options-privacy.php                            (rev 0)
+++ trunk/src/wp-admin/options-privacy.php      2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,262 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Privacy Settings Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_privacy_options' ) ) {
+       wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
+}
+
+$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
+
+if ( ! empty( $action ) ) {
+       check_admin_referer( $action );
+
+       if ( 'set-privacy-page' === $action ) {
+               $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
+               update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
+
+               $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' );
+
+               if ( $privacy_policy_page_id ) {
+                       /*
+                        * Don't always link to the menu customizer:
+                        *
+                        * - Unpublished pages can't be selected by default.
+                        * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.
+                        * - Themes might not "officially" support menus.
+                        */
+                       if (
+                               'publish' === get_post_status( $privacy_policy_page_id )
+                               && current_user_can( 'edit_theme_options' )
+                               && current_theme_supports( 'menus' )
+                       ) {
+                               $privacy_page_updated_message = sprintf(
+                                       /* translators: %s: URL to Customizer -> Menus */
+                                       __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ),
+                                       esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )
+                               );
+                       }
+               }
+
+               add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', $privacy_page_updated_message, 'updated' );
+       } elseif ( 'create-privacy-page' === $action ) {
+
+               if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
+                       require_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
+               }
+
+               $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
+               $privacy_policy_page_id      = wp_insert_post(
+                       array(
+                               'post_title'   => __( 'Privacy Policy' ),
+                               'post_status'  => 'draft',
+                               'post_type'    => 'page',
+                               'post_content' => $privacy_policy_page_content,
+                       ),
+                       true
+               );
+
+               if ( is_wp_error( $privacy_policy_page_id ) ) {
+                       add_settings_error(
+                               'page_for_privacy_policy',
+                               'page_for_privacy_policy',
+                               __( 'Unable to create a Privacy Policy page.' ),
+                               'error'
+                       );
+               } else {
+                       update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
+
+                       wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );
+                       exit;
+               }
+       }
+}
+
+// If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.
+$privacy_policy_page_exists = false;
+$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );
+
+if ( ! empty( $privacy_policy_page_id ) ) {
+
+       $privacy_policy_page = get_post( $privacy_policy_page_id );
+
+       if ( ! $privacy_policy_page instanceof WP_Post ) {
+               add_settings_error(
+                       'page_for_privacy_policy',
+                       'page_for_privacy_policy',
+                       __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),
+                       'error'
+               );
+       } else {
+               if ( 'trash' === $privacy_policy_page->post_status ) {
+                       add_settings_error(
+                               'page_for_privacy_policy',
+                               'page_for_privacy_policy',
+                               sprintf(
+                                       /* translators: URL to Pages Trash */
+                                       __( 'The currently selected Privacy Policy page is in the trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ),
+                                       'edit.php?post_status=trash&post_type=page'
+                               ),
+                               'error'
+                       );
+               } else {
+                       $privacy_policy_page_exists = true;
+               }
+       }
+}
+
+$title       = __( 'Privacy Settings' );
+$parent_file = 'options-general.php';
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+<div class="wrap">
+       <h1><?php echo $title; ?></h1>
+       <h2><?php _e( 'Privacy Policy Page' ); ?></h2>
+       <p>
+               <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>
+               <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
+       </p>
+       <p>
+               <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>
+               <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>
+       </p>
+       <p>
+               <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
+               <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
+       </p>
+       <?php
+
+       if ( $privacy_policy_page_exists ) {
+               $edit_href = add_query_arg(
+                       array(
+                               'post'   => $privacy_policy_page_id,
+                               'action' => 'edit',
+                       ),
+                       admin_url( 'post.php' )
+               );
+
+               $view_href = get_permalink( $privacy_policy_page_id );
+
+               ?>
+               <p class="tools-privacy-edit"><strong>
+                       <?php
+
+                       if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
+                               printf(
+                                       /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page */
+                                       __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
+                                       esc_url( $edit_href ),
+                                       esc_url( $view_href )
+                               );
+                       } else {
+                               printf(
+                                       /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page */
+                                       __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
+                                       esc_url( $edit_href ),
+                                       esc_url( $view_href )
+                               );
+                       }
+
+                       ?>
+               </strong></p>
+               <?php
+       }
+       ?>
+       <p>
+               <?php
+
+               printf(
+                       /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */
+                       __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
+                       esc_url( admin_url( 'privacy-policy-guide.php' ) ),
+                       '',
+                       ''
+               );
+
+               ?>
+       </p>
+
+       <hr>
+       <table class="form-table tools-privacy-policy-page" role="presentation">
+               <tr>
+                       <th scope="row">
+                               <label for="page_for_privacy_policy">
+                                       <?php
+                                       if ( $privacy_policy_page_exists ) {
+                                               _e( 'Change your Privacy Policy page' );
+                                       } else {
+                                               _e( 'Select a Privacy Policy page' );
+                                       }
+                                       ?>
+                               </label>
+                       </th>
+                       <td>
+                               <?php
+                               
+                               $has_pages = (bool) get_posts(
+                                       array(
+                                               'post_type'      => 'page',
+                                               'posts_per_page' => 1,
+                                               'post_status'    => array(
+                                                       'publish',
+                                                       'draft',
+                                               ),
+                                       )
+                               );
+
+                               if ( $has_pages ) :
+                                       ?>
+                                       <form method="post" action="">
+                                               <input type="hidden" name="action" value="set-privacy-page" />
+                                               <?php
+                                               
+                                               wp_dropdown_pages(
+                                                       array(
+                                                               'name'              => 'page_for_privacy_policy',
+                                                               'show_option_none'  => __( '&mdash; Select &mdash;' ),
+                                                               'option_none_value' => '0',
+                                                               'selected'          => $privacy_policy_page_id,
+                                                               'post_status'       => array( 'draft', 'publish' ),
+                                                       )
+                                               );
+
+                                               wp_nonce_field( 'set-privacy-page' );
+
+                                               submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
+                                               ?>
+                                       </form>
+                               <?php endif; ?>
+
+                               <form class="wp-create-privacy-page" method="post" action="">
+                                       <input type="hidden" name="action" value="create-privacy-page" />
+                                       <span>
+                                               <?php
+                                               if ( $has_pages ) {
+                                                       _e( 'Or:' );
+                                               } else {
+                                                       _e( 'There are no pages.' );
+                                               }
+                                               ?>
+                                       </span>
+                                       <?php
+                                       wp_nonce_field( 'create-privacy-page' );
+
+                                       submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
+                                       ?>
+                               </form>
+                       </td>
+               </tr>
+       </table>
+</div>
+<?php
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
</ins></span></pre></div>
<a id="trunksrcwpadminprivacypolicyguidephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-admin/privacy-policy-guide.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/privacy-policy-guide.php                               (rev 0)
+++ trunk/src/wp-admin/privacy-policy-guide.php 2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,36 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Privacy Policy Guide Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+
+if ( ! current_user_can( 'manage_privacy_options' ) ) {
+       wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
+}
+
+if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
+       include_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
+}
+
+$title = __( 'Privacy Policy Guide' );
+
+wp_enqueue_script( 'privacy-tools' );
+
+require_once( ABSPATH . 'wp-admin/admin-header.php' );
+
+?>
+<div class="wrap">
+       <h1><?php echo esc_html( $title ); ?></h1>
+       
+       <div class="wp-privacy-policy-guide">
+               <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
+       </div>
+</div>
+<?php
+
+include( ABSPATH . 'wp-admin/admin-footer.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-admin/privacy-policy-guide.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpadminprivacyphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/src/wp-admin/privacy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/privacy.php    2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/privacy.php      2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,263 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * Privacy Settings Screen.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** WordPress Administration Bootstrap */
-require_once( dirname( __FILE__ ) . '/admin.php' );
-
-if ( ! current_user_can( 'manage_privacy_options' ) ) {
-       wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
-}
-
-$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
-
-if ( ! empty( $action ) ) {
-       check_admin_referer( $action );
-
-       if ( 'set-privacy-page' === $action ) {
-               $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0;
-               update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
-
-               $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' );
-
-               if ( $privacy_policy_page_id ) {
-                       /*
-                        * Don't always link to the menu customizer:
-                        *
-                        * - Unpublished pages can't be selected by default.
-                        * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities.
-                        * - Themes might not "officially" support menus.
-                        */
-                       if (
-                               'publish' === get_post_status( $privacy_policy_page_id )
-                               && current_user_can( 'edit_theme_options' )
-                               && current_theme_supports( 'menus' )
-                       ) {
-                               $privacy_page_updated_message = sprintf(
-                                       /* translators: %s: URL to Customizer -> Menus */
-                                       __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ),
-                                       esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) )
-                               );
-                       }
-               }
-
-               add_settings_error(
-                       'page_for_privacy_policy',
-                       'page_for_privacy_policy',
-                       $privacy_page_updated_message,
-                       'updated'
-               );
-       } elseif ( 'create-privacy-page' === $action ) {
-
-               if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
-                       require_once( ABSPATH . 'wp-admin/includes/misc.php' );
-               }
-
-               $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
-               $privacy_policy_page_id      = wp_insert_post(
-                       array(
-                               'post_title'   => __( 'Privacy Policy' ),
-                               'post_status'  => 'draft',
-                               'post_type'    => 'page',
-                               'post_content' => $privacy_policy_page_content,
-                       ),
-                       true
-               );
-
-               if ( is_wp_error( $privacy_policy_page_id ) ) {
-                       add_settings_error(
-                               'page_for_privacy_policy',
-                               'page_for_privacy_policy',
-                               __( 'Unable to create a Privacy Policy page.' ),
-                               'error'
-                       );
-               } else {
-                       update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id );
-
-                       wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) );
-                       exit;
-               }
-       }
-}
-
-// If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error.
-$privacy_policy_page_exists = false;
-$privacy_policy_page_id     = (int) get_option( 'wp_page_for_privacy_policy' );
-
-if ( ! empty( $privacy_policy_page_id ) ) {
-
-       $privacy_policy_page = get_post( $privacy_policy_page_id );
-
-       if ( ! $privacy_policy_page instanceof WP_Post ) {
-               add_settings_error(
-                       'page_for_privacy_policy',
-                       'page_for_privacy_policy',
-                       __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ),
-                       'error'
-               );
-       } else {
-               if ( 'trash' === $privacy_policy_page->post_status ) {
-                       add_settings_error(
-                               'page_for_privacy_policy',
-                               'page_for_privacy_policy',
-                               sprintf(
-                                       /* translators: URL to Pages Trash */
-                                       __( 'The currently selected Privacy Policy page is in the trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ),
-                                       'edit.php?post_status=trash&post_type=page'
-                               ),
-                               'error'
-                       );
-               } else {
-                       $privacy_policy_page_exists = true;
-               }
-       }
-}
-
-$title       = __( 'Privacy Settings' );
-$parent_file = 'options-general.php';
-
-require_once( ABSPATH . 'wp-admin/admin-header.php' );
-
-?>
-<div class="wrap">
-       <h1><?php echo $title; ?></h1>
-       <h2><?php _e( 'Privacy Policy Page' ); ?></h2>
-       <p>
-               <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>
-               <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
-       </p>
-       <p>
-               <?php _e( 'The new page will include help and suggestions for your Privacy Policy.' ); ?>
-               <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your Privacy Policy requires, and to keep that information current and accurate.' ); ?>
-       </p>
-       <p>
-               <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
-               <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
-       </p>
-       <?php
-
-       if ( $privacy_policy_page_exists ) {
-               $edit_href = add_query_arg(
-                       array(
-                               'post'   => $privacy_policy_page_id,
-                               'action' => 'edit',
-                       ),
-                       admin_url( 'post.php' )
-               );
-
-               $view_href = get_permalink( $privacy_policy_page_id );
-
-               ?>
-               <p class="tools-privacy-edit"><strong>
-                       <?php
-
-                       if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
-                               printf(
-                                       /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page */
-                                       __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
-                                       esc_url( $edit_href ),
-                                       esc_url( $view_href )
-                               );
-                       } else {
-                               printf(
-                                       /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page */
-                                       __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
-                                       esc_url( $edit_href ),
-                                       esc_url( $view_href )
-                               );
-                       }
-
-                       ?>
-               </strong></p>
-               <?php
-       }
-       ?>
-       <p>
-               <?php
-
-               printf(
-                       /* translators: 1: Privacy Policy guide URL, 2: additional link attributes, 3: accessibility text */
-                       __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
-                       esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) ),
-                       '',
-                       ''
-               );
-
-               ?>
-       </p>
-
-       <hr>
-       <table class="form-table tools-privacy-policy-page" role="presentation">
-               <tr>
-                       <th scope="row"><label for="page_for_privacy_policy">
-                               <?php
-                               if ( $privacy_policy_page_exists ) {
-                                       _e( 'Change your Privacy Policy page' );
-                               } else {
-                                       _e( 'Select a Privacy Policy page' );
-                               }
-                               ?>
-                       </label></th>
-                       <td>
-                               <?php
-                               $has_pages = (bool) get_posts(
-                                       array(
-                                               'post_type'      => 'page',
-                                               'posts_per_page' => 1,
-                                               'post_status'    => array(
-                                                       'publish',
-                                                       'draft',
-                                               ),
-                                       )
-                               );
-
-                               if ( $has_pages ) :
-                                       ?>
-                                       <form method="post" action="">
-                                               <input type="hidden" name="action" value="set-privacy-page" />
-                                               <?php
-                                               wp_dropdown_pages(
-                                                       array(
-                                                               'name'              => 'page_for_privacy_policy',
-                                                               'show_option_none'  => __( '&mdash; Select &mdash;' ),
-                                                               'option_none_value' => '0',
-                                                               'selected'          => $privacy_policy_page_id,
-                                                               'post_status'       => array( 'draft', 'publish' ),
-                                                       )
-                                               );
-
-                                               wp_nonce_field( 'set-privacy-page' );
-
-                                               submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
-                                               ?>
-                                       </form>
-                               <?php endif; ?>
-
-                               <form class="wp-create-privacy-page" method="post" action="">
-                                       <input type="hidden" name="action" value="create-privacy-page" />
-                                       <span>
-                                               <?php
-                                               if ( $has_pages ) {
-                                                       _e( 'Or:' );
-                                               } else {
-                                                       _e( 'There are no pages.' );
-                                               }
-                                               ?>
-                                       </span>
-                                       <?php
-                                       wp_nonce_field( 'create-privacy-page' );
-
-                                       submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
-                                       ?>
-                               </form>
-                       </td>
-               </tr>
-       </table>
-</div>
-<?php
-
-include( ABSPATH . 'wp-admin/admin-footer.php' );
</del></span></pre></div>
<a id="trunksrcwpadmintoolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/tools.php      2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-admin/tools.php        2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,37 +6,53 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @subpackage Administration
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {
+       // Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data`
+       // continues to work after creating the new files for exporting and erasing of personal data.
+       if ( $_GET['page'] === 'export_personal_data' ) {
+               require_once( ABSPATH . 'wp-admin/export-personal-data.php' );
+               return;
+       } elseif ( $_GET['page'] === 'remove_personal_data' ) {
+               require_once( ABSPATH . 'wp-admin/erase-personal-data.php' );
+               return;
+       }
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** WordPress Administration Bootstrap */
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( dirname( __FILE__ ) . '/admin.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$is_privacy_guide = ( isset( $_GET['wp-privacy-policy-guide'] ) && current_user_can( 'manage_privacy_options' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
+if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
+       wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
+       exit;
+} elseif ( isset( $_GET['page'] ) ) {
+       // These were also moved to files in WP 5.3.
+       if ( $_GET['page'] === 'export_personal_data' ) {
+               wp_redirect( admin_url( 'export-personal-data.php' ), 301 );
+               exit;
+       } elseif ( $_GET['page'] === 'remove_personal_data' ) {
+               wp_redirect( admin_url( 'erase-personal-data.php' ), 301 );
+               exit;
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $is_privacy_guide ) {
-       $title = __( 'Privacy Policy Guide' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$title = __( 'Tools' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // "Borrow" xfn.js for now so we don't have to create new files.
-       wp_enqueue_script( 'xfn' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_current_screen()->add_help_tab(
+       array(
+               'id'      => 'converter',
+               'title'   => __( 'Categories and Tags Converter' ),
+               'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
+               '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
+       )
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-} else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_current_screen()->set_help_sidebar(
+       '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+       '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
+       '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
+);
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $title = __( 'Tools' );
-
-       get_current_screen()->add_help_tab(
-               array(
-                       'id'      => 'converter',
-                       'title'   => __( 'Categories and Tags Converter' ),
-                       'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
-                       '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
-               )
-       );
-
-       get_current_screen()->set_help_sidebar(
-               '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
-               '<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
-               '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
-       );
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> require_once( ABSPATH . 'wp-admin/admin-header.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,15 +60,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <h1><?php echo esc_html( $title ); ?></h1>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $is_privacy_guide ) {
-       ?>
-       <div class="wp-privacy-policy-guide">
-               <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
-       </div>
-       <?php
-
-} else {
-
</del><span class="cx" style="display: block; padding: 0 10px">         if ( current_user_can( 'import' ) ) :
</span><span class="cx" style="display: block; padding: 0 10px">                $cats = get_taxonomy( 'category' );
</span><span class="cx" style="display: block; padding: 0 10px">                $tags = get_taxonomy( 'post_tag' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,8 +79,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 2.8.0
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        do_action( 'tool_box' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> include( ABSPATH . 'wp-admin/admin-footer.php' );
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php   2019-05-26 20:43:43 UTC (rev 45447)
+++ trunk/src/wp-includes/script-loader.php     2019-05-26 20:49:04 UTC (rev 45448)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1542,19 +1542,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array( 'jquery' ), false, 1 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                did_action( 'init' ) && $scripts->localize(
-                       'xfn',
-                       'privacyToolsL10n',
-                       array(
-                               'noDataFound'     => __( 'No personal data was found for this user.' ),
-                               'foundAndRemoved' => __( 'All of the personal data found for this user was erased.' ),
-                               'noneRemoved'     => __( 'Personal data was found for this user but was not erased.' ),
-                               'someNotRemoved'  => __( 'Personal data was found for this user but some of the personal data found was not erased.' ),
-                               'removalError'    => __( 'An error occurred while attempting to find and erase personal data.' ),
-                               'noExportFile'    => __( 'No personal data export file was generated.' ),
-                               'exportError'     => __( 'An error occurred while attempting to export personal data.' ),
-                       )
-               );
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array( 'jquery-ui-sortable' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">                did_action( 'init' ) && $scripts->localize(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1693,6 +1680,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $scripts->add( 'site-health', "/wp-admin/js/site-health$suffix.js", array( 'clipboard', 'jquery', 'wp-util', 'wp-a11y', 'wp-i18n' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">                $scripts->set_translations( 'site-health' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $scripts->add( 'privacy-tools', "/wp-admin/js/privacy-tools$suffix.js", array( 'jquery' ), false, 1 );
+               did_action( 'init' ) && $scripts->localize(
+                       'privacy-tools',
+                       'privacyToolsL10n',
+                       array(
+                               'noDataFound'     => __( 'No personal data was found for this user.' ),
+                               'foundAndRemoved' => __( 'All of the personal data found for this user was erased.' ),
+                               'noneRemoved'     => __( 'Personal data was found for this user but was not erased.' ),
+                               'someNotRemoved'  => __( 'Personal data was found for this user but some of the personal data found was not erased.' ),
+                               'removalError'    => __( 'An error occurred while attempting to find and erase personal data.' ),
+                               'noExportFile'    => __( 'No personal data export file was generated.' ),
+                               'exportError'     => __( 'An error occurred while attempting to export personal data.' ),
+                       )
+               );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">                did_action( 'init' ) && $scripts->localize(
</span><span class="cx" style="display: block; padding: 0 10px">                        'updates',
</span></span></pre>
</div>
</div>

</body>
</html>