Privacy: cleanup of the "Export Personal Data" and "Erase Personal Data" screens.

Props desrosj, xkon.
See #43929.
Built from https://develop.svn.wordpress.org/trunk@43212


git-svn-id: http://core.svn.wordpress.org/trunk@43041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2018-05-10 10:01:21 +00:00
parent 06fd54dab6
commit 7d9265e5c5
11 changed files with 136 additions and 101 deletions

View File

@ -1132,6 +1132,18 @@ table.form-table td .updated p {
border-right-color: #d64d21;
}
.privacy_requests .request-results .notice {
margin: -2px 0 0;
}
.privacy_requests .request-results .notice p {
margin: 0.5em 0;
}
.request-results td {
padding: 0 0 1px;
}
.status-label {
font-weight: 600;
}

File diff suppressed because one or more lines are too long

View File

@ -1132,6 +1132,18 @@ table.form-table td .updated p {
border-left-color: #d64d21;
}
.privacy_requests .request-results .notice {
margin: -2px 0 0;
}
.privacy_requests .request-results .notice p {
margin: 0.5em 0;
}
.request-results td {
padding: 0 0 1px;
}
.status-label {
font-weight: 600;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -663,7 +663,6 @@ function _wp_personal_data_handle_actions() {
'updated'
);
}
} elseif ( isset( $_POST['action'] ) ) {
$action = isset( $_POST['action'] ) ? sanitize_key( wp_unslash( $_POST['action'] ) ) : ''; // WPCS: input var ok, CSRF ok.
@ -760,7 +759,7 @@ function _wp_personal_data_cleanup_requests() {
'posts_per_page' => -1,
'post_status' => 'request-pending',
'fields' => 'ids',
'date_query' => array(
'date_query' => array(
array(
'column' => 'post_modified_gmt',
'before' => $expires . ' seconds ago',
@ -1112,7 +1111,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
* @return array
*/
protected function get_views() {
$current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ): '';
$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 );
@ -1151,7 +1150,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
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(); // WPCS: input var ok, CSRF ok.
$count = 0;
$count = 0;
if ( $request_ids ) {
check_admin_referer( 'bulk-privacy_requests' );
@ -1168,6 +1167,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
add_settings_error(
'bulk_action',
'bulk_action',
/* translators: %d: number of requests */
sprintf( _n( 'Deleted %d request', 'Deleted %d requests', $count ), $count ),
'updated'
);
@ -1184,6 +1184,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
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'
);
@ -1213,7 +1214,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
'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,
'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'] ) : '',
);
@ -1305,6 +1306,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
$time_diff = current_time( 'timestamp', true ) - $timestamp;
if ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {
/* translators: human readable timestamp */
return sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );
}
@ -1412,21 +1414,21 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
$request_id = $item->ID;
$nonce = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
$download_data_markup = '<div class="export_personal_data" ' .
$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"><a href="#" >' . __( 'Download Personal Data' ) . '</a></span>' .
'<span style="display:none" class="export_personal_data_processing" >' . __( 'Downloading Data...' ) . '</span>' .
'<span style="display:none" class="export_personal_data_success"><a href="#" >' . __( 'Download Personal Data Again' ) . '</a></span>' .
'<span style="display:none" class="export_personal_data_failed">' . __( 'Download has failed.' ) . ' <a href="#" >' . __( 'Retry' ) . '</a></span>';
$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 has failed.' ) . ' <button type="button" class="button-link">' . __( 'Retry' ) . '</button></span>';
$download_data_markup .= '</div>';
$row_actions = array(
'download_data' => $download_data_markup,
'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 ) );
@ -1452,7 +1454,7 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
$request_id = $item->ID;
$nonce = wp_create_nonce( 'wp-privacy-export-personal-data-' . $request_id );
echo '<div class="export_personal_data" ' .
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 ) . '" ' .
@ -1460,10 +1462,10 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
'">';
?>
<span class="export_personal_data_idle"><a class="button" href="#" ><?php _e( 'Send Export Link' ); ?></a></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.' ); ?> <a class="button" href="#" ><?php _e( 'Retry' ); ?></a></span>
<span class="export-personal-data-idle"><button type="button" class="button export-personal-data-handle"><?php _e( 'Email Data' ); ?></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>';
@ -1473,9 +1475,9 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
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' ) ) . '">' . esc_html__( 'Remove request' ) . '</a>';
'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;
}
}
@ -1524,20 +1526,20 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
$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" ' .
$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"><a href="#" >' . __( 'Force Erase Personal Data' ) . '</a></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.' ) . ' <a href="#" >' . __( 'Retry' ) . '</a></span>';
$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,
'remove-data' => $remove_data_markup,
);
}
@ -1564,7 +1566,7 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
$request_id = $item->ID;
$nonce = wp_create_nonce( 'wp-privacy-erase-personal-data-' . $request_id );
echo '<div class="remove_personal_data" ' .
echo '<div class="remove-personal-data" ' .
'data-force-erase="1" ' .
'data-erasers-count="' . esc_attr( $erasers_count ) . '" ' .
'data-request-id="' . esc_attr( $request_id ) . '" ' .
@ -1572,9 +1574,9 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
'">';
?>
<span class="remove_personal_data_idle"><a class="button" href="#" ><?php _e( 'Erase Personal Data' ); ?></a></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.' ); ?> <a class="button" href="#" ><?php _e( 'Retry' ); ?></a></span>
<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>';
@ -1585,9 +1587,9 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
break;
case 'request-completed':
echo '<a href="' . esc_url( wp_nonce_url( add_query_arg( array(
'action' => 'delete',
'action' => 'delete',
'request_id' => array( $item->ID ),
), admin_url( 'tools.php?page=remove_personal_data' ) ), 'bulk-privacy_requests' ) ) . '">' . esc_html__( 'Remove request' ) . '</a>';
), admin_url( 'tools.php?page=remove_personal_data' ) ), 'bulk-privacy_requests' ) ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
break;
}
}

View File

@ -25,7 +25,7 @@ jQuery( document ).ready(function( $ ) {
jQuery( document ).ready( function( $ ) {
var strings = window.privacyToolsL10n || {};
function set_action_state( $action, state ) {
function setActionState( $action, state ) {
$action.children().hide();
$action.children( '.' + state ).show();
}
@ -37,13 +37,14 @@ jQuery( document ).ready( function( $ ) {
}
function appendResultsAfterRow( $requestRow, classes, summaryMessage, additionalMessages ) {
var itemList = '';
clearResultsAfterRow( $requestRow );
var itemList = '';
if ( additionalMessages.length ) {
$.each( additionalMessages, function( index, value ) {
itemList = itemList + '<li>' + value + '</li>';
} );
});
itemList = '<ul>' + itemList + '</ul>';
}
@ -55,41 +56,42 @@ jQuery( document ).ready( function( $ ) {
'</div>' +
'</td>' +
'</tr>';
} );
});
}
$( '.export_personal_data a' ).click( function( event ) {
$( '.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();
var $this = $( this );
var $action = $this.parents( '.export_personal_data' );
var $requestRow = $this.parents( 'tr' );
var requestID = $action.data( 'request-id' );
var nonce = $action.data( 'nonce' );
var exportersCount = $action.data( 'exporters-count' );
var sendAsEmail = $action.data( 'send-as-email' ) ? true : false;
$action.blur();
clearResultsAfterRow( $requestRow );
function on_export_done_success( zipUrl ) {
set_action_state( $action, 'export_personal_data_success' );
function onExportDoneSuccess( zipUrl ) {
setActionState( $action, 'export-personal-data-success' );
if ( 'undefined' !== typeof zipUrl ) {
window.location = zipUrl;
} else if ( ! sendAsEmail ) {
on_export_failure( strings.noExportFile );
onExportFailure( strings.noExportFile );
}
}
function on_export_failure( errorMessage ) {
set_action_state( $action, 'export_personal_data_failed' );
function onExportFailure( errorMessage ) {
setActionState( $action, 'export-personal-data-failed' );
if ( errorMessage ) {
appendResultsAfterRow( $requestRow, 'notice-error', strings.exportError, [ errorMessage ] );
}
}
function do_next_export( exporterIndex, pageIndex ) {
function doNextExport( exporterIndex, pageIndex ) {
$.ajax(
{
url: window.ajaxurl,
@ -104,54 +106,59 @@ jQuery( document ).ready( function( $ ) {
method: 'post'
}
).done( function( response ) {
var responseData = response.data;
if ( ! response.success ) {
// e.g. invalid request ID
on_export_failure( response.data );
onExportFailure( response.data );
return;
}
var responseData = response.data;
if ( ! responseData.done ) {
setTimeout( do_next_export( exporterIndex, pageIndex + 1 ) );
setTimeout( doNextExport( exporterIndex, pageIndex + 1 ) );
} else {
if ( exporterIndex < exportersCount ) {
setTimeout( do_next_export( exporterIndex + 1, 1 ) );
setTimeout( doNextExport( exporterIndex + 1, 1 ) );
} else {
on_export_done_success( responseData.url );
onExportDoneSuccess( responseData.url );
}
}
} ).fail( function( jqxhr, textStatus, error ) {
}).fail( function( jqxhr, textStatus, error ) {
// e.g. Nonce failure
on_export_failure( error );
} );
onExportFailure( error );
});
}
// And now, let's begin
set_action_state( $action, 'export_personal_data_processing' );
do_next_export( 1, 1 );
} );
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 = [];
$( '.remove_personal_data a' ).click( function( event ) {
event.preventDefault();
event.stopPropagation();
var $this = $( this );
var $action = $this.parents( '.remove_personal_data' );
var $requestRow = $this.parents( 'tr' );
var requestID = $action.data( 'request-id' );
var nonce = $action.data( 'nonce' );
var erasersCount = $action.data( 'erasers-count' );
var hasRemoved = false;
var hasRetained = false;
var messages = [];
$action.blur();
clearResultsAfterRow( $requestRow );
function on_erasure_done_success() {
set_action_state( $action, 'remove_personal_data_idle' );
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;
@ -170,13 +177,13 @@ jQuery( document ).ready( function( $ ) {
appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, messages );
}
function on_erasure_failure() {
set_action_state( $action, 'remove_personal_data_failed' );
function onErasureFailure() {
setActionState( $action, 'remove-personal-data-failed' );
appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] );
}
function do_next_erasure( eraserIndex, pageIndex ) {
$.ajax( {
function doNextErasure( eraserIndex, pageIndex ) {
$.ajax({
url: window.ajaxurl,
data: {
action: 'wp-privacy-erase-personal-data',
@ -186,12 +193,13 @@ jQuery( document ).ready( function( $ ) {
security: nonce
},
method: 'post'
} ).done( function( response ) {
}).done( function( response ) {
var responseData = response.data;
if ( ! response.success ) {
on_erasure_failure();
onErasureFailure();
return;
}
var responseData = response.data;
if ( responseData.items_removed ) {
hasRemoved = hasRemoved || responseData.items_removed;
}
@ -202,27 +210,28 @@ jQuery( document ).ready( function( $ ) {
messages = messages.concat( responseData.messages );
}
if ( ! responseData.done ) {
setTimeout( do_next_erasure( eraserIndex, pageIndex + 1 ) );
setTimeout( doNextErasure( eraserIndex, pageIndex + 1 ) );
} else {
if ( eraserIndex < erasersCount ) {
setTimeout( do_next_erasure( eraserIndex + 1, 1 ) );
setTimeout( doNextErasure( eraserIndex + 1, 1 ) );
} else {
on_erasure_done_success();
onErasureDoneSuccess();
}
}
} ).fail( function() {
on_erasure_failure();
} );
}).fail( function() {
onErasureFailure();
});
}
// And now, let's begin
set_action_state( $action, 'remove_personal_data_processing' );
setActionState( $action, 'remove-personal-data-processing' );
do_next_erasure( 1, 1 );
} );
} );
doNextErasure( 1, 1 );
});
});
( function( $ ) {
// Privacy policy page, copy button.
$( document ).on( 'click', function( event ) {
var $target = $( event.target );
@ -253,4 +262,4 @@ jQuery( document ).ready( function( $ ) {
}
});
} )( jQuery );
} ( jQuery ) );

View File

@ -1 +1 @@
jQuery(document).ready(function(a){a("#link_rel").prop("readonly",!0),a("#linkxfndiv input").bind("click keyup",function(){var b=a("#me").is(":checked"),c="";a("input.valinp").each(function(){b?a(this).prop("disabled",!0).parent().addClass("disabled"):(a(this).removeAttr("disabled").parent().removeClass("disabled"),a(this).is(":checked")&&""!==a(this).val()&&(c+=a(this).val()+" "))}),a("#link_rel").val(b?"me":c.substr(0,c.length-1))})}),jQuery(document).ready(function(a){function b(a,b){a.children().hide(),a.children("."+b).show()}function c(a){a.next().hasClass("request-results")&&a.next().remove()}function d(b,d,e,f){c(b);var g="";f.length&&(a.each(f,function(a,b){g=g+"<li>"+b+"</li>"}),g="<ul>"+g+"</ul>"),b.after(function(){return'<tr class="request-results"><td colspan="5"><div class="notice inline notice-alt '+d+'"><p>'+e+"</p>"+g+"</div></td></tr>"})}var e=window.privacyToolsL10n||{};a(".export_personal_data a").click(function(f){function g(a){b(k,"export_personal_data_success"),"undefined"!=typeof a?window.location=a:p||h(e.noExportFile)}function h(a){b(k,"export_personal_data_failed"),a&&d(l,"notice-error",e.exportError,[a])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:b,id:m,page:c,security:n,sendAsEmail:p},method:"post"}).done(function(a){if(!a.success)return void h(a.data);var d=a.data;d.done?b<o?setTimeout(i(b+1,1)):g(d.url):setTimeout(i(b,c+1))}).fail(function(a,b,c){h(c)})}f.preventDefault(),f.stopPropagation();var j=a(this),k=j.parents(".export_personal_data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("exporters-count"),p=!!k.data("send-as-email");k.blur(),c(l),b(k,"export_personal_data_processing"),i(1,1)}),a(".remove_personal_data a").click(function(f){function g(){b(k,"remove_personal_data_idle");var a=e.noDataFound,c="notice-success";!1===p?!1===q?a=e.noDataFound:(a=e.noneRemoved,c="notice-warning"):!1===q?a=e.foundAndRemoved:(a=e.someNotRemoved,c="notice-warning"),d(l,"notice-success",a,r)}function h(){b(k,"remove_personal_data_failed"),d(l,"notice-error",e.removalError,[])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:b,id:m,page:c,security:n},method:"post"}).done(function(a){if(!a.success)return void h();var d=a.data;d.items_removed&&(p=p||d.items_removed),d.items_retained&&(q=q||d.items_retained),d.messages&&(r=r.concat(d.messages)),d.done?b<o?setTimeout(i(b+1,1)):g():setTimeout(i(b,c+1))}).fail(function(){h()})}f.preventDefault(),f.stopPropagation();var j=a(this),k=j.parents(".remove_personal_data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("erasers-count"),p=!1,q=!1,r=[];k.blur(),c(l),b(k,"remove_personal_data_processing"),i(1,1)})}),function(a){a(document).on("click",function(b){var c,d,e,f=a(b.target);if(f.is("button.privacy-text-copy")&&(c=f.parent().parent(),d=c.find("div.wp-suggested-text"),d.length||(d=c.find("div.policy-text")),d.length))try{window.getSelection().removeAllRanges(),e=document.createRange(),d.addClass("hide-privacy-policy-tutorial"),e.selectNodeContents(d[0]),window.getSelection().addRange(e),document.execCommand("copy"),d.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges()}catch(g){}})}(jQuery);
jQuery(document).ready(function(a){a("#link_rel").prop("readonly",!0),a("#linkxfndiv input").bind("click keyup",function(){var b=a("#me").is(":checked"),c="";a("input.valinp").each(function(){b?a(this).prop("disabled",!0).parent().addClass("disabled"):(a(this).removeAttr("disabled").parent().removeClass("disabled"),a(this).is(":checked")&&""!==a(this).val()&&(c+=a(this).val()+" "))}),a("#link_rel").val(b?"me":c.substr(0,c.length-1))})}),jQuery(document).ready(function(a){function b(a,b){a.children().hide(),a.children("."+b).show()}function c(a){a.next().hasClass("request-results")&&a.next().remove()}function d(b,d,e,f){var g="";c(b),f.length&&(a.each(f,function(a,b){g=g+"<li>"+b+"</li>"}),g="<ul>"+g+"</ul>"),b.after(function(){return'<tr class="request-results"><td colspan="5"><div class="notice inline notice-alt '+d+'"><p>'+e+"</p>"+g+"</div></td></tr>"})}var e=window.privacyToolsL10n||{};a(".export-personal-data-handle").click(function(f){function g(a){b(k,"export-personal-data-success"),"undefined"!=typeof a?window.location=a:p||h(e.noExportFile)}function h(a){b(k,"export-personal-data-failed"),a&&d(l,"notice-error",e.exportError,[a])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:b,id:m,page:c,security:n,sendAsEmail:p},method:"post"}).done(function(a){var d=a.data;return a.success?void(d.done?b<o?setTimeout(i(b+1,1)):g(d.url):setTimeout(i(b,c+1))):void h(a.data)}).fail(function(a,b,c){h(c)})}var j=a(this),k=j.parents(".export-personal-data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("exporters-count"),p=!!k.data("send-as-email");f.preventDefault(),f.stopPropagation(),k.blur(),c(l),b(k,"export-personal-data-processing"),i(1,1)}),a(".remove-personal-data-handle").click(function(f){function g(){var a=e.noDataFound,c="notice-success";b(k,"remove-personal-data-idle"),!1===p?!1===q?a=e.noDataFound:(a=e.noneRemoved,c="notice-warning"):!1===q?a=e.foundAndRemoved:(a=e.someNotRemoved,c="notice-warning"),d(l,"notice-success",a,r)}function h(){b(k,"remove-personal-data-failed"),d(l,"notice-error",e.removalError,[])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:b,id:m,page:c,security:n},method:"post"}).done(function(a){var d=a.data;return a.success?(d.items_removed&&(p=p||d.items_removed),d.items_retained&&(q=q||d.items_retained),d.messages&&(r=r.concat(d.messages)),void(d.done?b<o?setTimeout(i(b+1,1)):g():setTimeout(i(b,c+1)))):void h()}).fail(function(){h()})}var j=a(this),k=j.parents(".remove-personal-data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("erasers-count"),p=!1,q=!1,r=[];f.stopPropagation(),k.blur(),c(l),b(k,"remove-personal-data-processing"),i(1,1)})}),function(a){a(document).on("click",function(b){var c,d,e,f=a(b.target);if(f.is("button.privacy-text-copy")&&(c=f.parent().parent(),d=c.find("div.wp-suggested-text"),d.length||(d=c.find("div.policy-text")),d.length))try{window.getSelection().removeAllRanges(),e=document.createRange(),d.addClass("hide-privacy-policy-tutorial"),e.selectNodeContents(d[0]),window.getSelection().addRange(e),document.execCommand("copy"),d.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges()}catch(g){}})}(jQuery);

View File

@ -3078,7 +3078,7 @@ function _wp_privacy_account_request_confirmed_message( $message, $request_id )
$request = wp_get_user_request_data( $request_id );
if ( $request && in_array( $request->action_name, _wp_privacy_action_request_types(), true ) ) {
$message = '<p class="message">' . __( 'Action has been confirmed.' ) . '</p>';
$message = '<p class="message">' . __( 'Action has been confirmed.' ) . '</p>';
$message .= __( 'The site administrator has been notified and will fulfill your request as soon as possible.' );
}
@ -3111,7 +3111,7 @@ function wp_create_user_request( $email_address = '', $action_name = '', $reques
}
$user = get_user_by( 'email', $email_address );
$user_id = $user && ! is_wp_error( $user ) ? $user->ID: 0;
$user_id = $user && ! is_wp_error( $user ) ? $user->ID : 0;
// Check for duplicates.
$requests_query = new WP_Query( array(

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43211';
$wp_version = '5.0-alpha-43212';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.