diff --git a/wp-admin/erase-personal-data.php b/wp-admin/erase-personal-data.php index 5ea801d136..d08292dac7 100644 --- a/wp-admin/erase-personal-data.php +++ b/wp-admin/erase-personal-data.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/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.' ) ); + wp_die( __( 'Sorry, you are not allowed to erase personal data on this site.' ) ); } // Handle list table actions. diff --git a/wp-admin/includes/privacy-tools.php b/wp-admin/includes/privacy-tools.php index ff3e6cadd2..2e4589d6d2 100644 --- a/wp-admin/includes/privacy-tools.php +++ b/wp-admin/includes/privacy-tools.php @@ -20,7 +20,7 @@ function _wp_privacy_resend_request( $request_id ) { $request = get_post( $request_id ); if ( ! $request || 'user_request' !== $request->post_type ) { - return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) ); + return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) ); } $result = wp_send_user_request( $request_id ); @@ -28,7 +28,7 @@ function _wp_privacy_resend_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 new WP_Error( 'privacy_request_error', __( 'Unable to initiate user privacy confirmation request.' ) ); } return true; @@ -49,7 +49,7 @@ function _wp_privacy_completed_request( $request_id ) { $request = wp_get_user_request( $request_id ); if ( ! $request ) { - return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) ); + return new WP_Error( 'privacy_request_error', __( 'Invalid user privacy request.' ) ); } update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() ); @@ -104,7 +104,7 @@ function _wp_personal_data_handle_actions() { add_settings_error( 'action_type', 'action_type', - __( 'Invalid action.' ), + __( 'Invalid user privacy action.' ), 'error' ); } @@ -116,7 +116,7 @@ function _wp_personal_data_handle_actions() { add_settings_error( 'action_type', 'action_type', - __( 'Invalid action.' ), + __( 'Invalid user privacy action.' ), 'error' ); } @@ -297,20 +297,20 @@ function wp_privacy_generate_personal_data_export_group_html( $group_data, $grou */ function wp_privacy_generate_personal_data_export_file( $request_id ) { if ( ! class_exists( 'ZipArchive' ) ) { - wp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) ); + wp_send_json_error( __( 'Unable to generate user privacy export file. ZipArchive not available.' ) ); } // Get the request. $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when generating export file.' ) ); + wp_send_json_error( __( 'Invalid request ID when generating user privacy export file.' ) ); } $email_address = $request->email; if ( ! is_email( $email_address ) ) { - wp_send_json_error( __( 'Invalid email address when generating export file.' ) ); + wp_send_json_error( __( 'Invalid email address when generating user privacy export file.' ) ); } // Create the exports folder if needed. @@ -318,7 +318,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $exports_url = wp_privacy_exports_url(); if ( ! wp_mkdir_p( $exports_dir ) ) { - wp_send_json_error( __( 'Unable to create export folder.' ) ); + wp_send_json_error( __( 'Unable to create user privacy export folder.' ) ); } // Protect export folder from browsing. @@ -326,7 +326,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { if ( ! file_exists( $index_pathname ) ) { $file = fopen( $index_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) ); + wp_send_json_error( __( 'Unable to protect user privacy export folder from browsing.' ) ); } fwrite( $file, '' ); fclose( $file ); @@ -395,7 +395,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $file = fopen( $json_report_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to open export file (JSON report) for writing.' ) ); + wp_send_json_error( __( 'Unable to open user privacy export file (JSON report) for writing.' ) ); } fwrite( $file, '{' ); @@ -410,7 +410,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $file = fopen( $html_report_pathname, 'w' ); if ( false === $file ) { - wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) ); + wp_send_json_error( __( 'Unable to open user privacy export file (HTML report) for writing.' ) ); } fwrite( $file, "\n" ); @@ -504,11 +504,11 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $zip = new ZipArchive; if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) { if ( ! $zip->addFile( $json_report_pathname, 'export.json' ) ) { - $error = __( 'Unable to add data to JSON file.' ); + $error = __( 'Unable to add data to user privacy export file (JSON format).' ); } if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) { - $error = __( 'Unable to add data to HTML file.' ); + $error = __( 'Unable to add data to user privacy export file (HTML format).' ); } $zip->close(); @@ -529,7 +529,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname, $request_id, $json_report_pathname ); } } else { - $error = __( 'Unable to open export file (archive) for writing.' ); + $error = __( 'Unable to open user privacy export file (archive) for writing.' ); } // Remove the JSON file. @@ -758,7 +758,7 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde $request = wp_get_user_request( $request_id ); if ( ! $request || 'export_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) ); + wp_send_json_error( __( 'Invalid request ID when merging user privacy exporter data.' ) ); } $export_data = array(); @@ -909,7 +909,7 @@ function wp_privacy_process_personal_data_erasure_page( $response, $eraser_index $request = wp_get_user_request( $request_id ); if ( ! $request || 'remove_personal_data' !== $request->action_name ) { - wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) ); + wp_send_json_error( __( 'Invalid request ID when processing user privacy eraser data.' ) ); } /** This filter is documented in wp-admin/includes/ajax-actions.php */ diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php index f0715a2f06..437b3eb68a 100644 --- a/wp-admin/options-privacy.php +++ b/wp-admin/options-privacy.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_privacy_options' ) ) { - wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); + wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); } $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; diff --git a/wp-admin/privacy-policy-guide.php b/wp-admin/privacy-policy-guide.php index 566f3f14cd..137a5016f9 100644 --- a/wp-admin/privacy-policy-guide.php +++ b/wp-admin/privacy-policy-guide.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_privacy_options' ) ) { - wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); + wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); } if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { diff --git a/wp-includes/user.php b/wp-includes/user.php index 284b3d71b2..d2977e3467 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -3612,7 +3612,7 @@ function wp_create_user_request( $email_address = '', $action_name = '', $reques ); if ( $requests_query->found_posts ) { - return new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) ); + return new WP_Error( 'duplicate_request', __( 'An incomplete user privacy request for this email address already exists.' ) ); } $request_id = wp_insert_post( @@ -3680,7 +3680,7 @@ function wp_send_user_request( $request_id ) { $request = wp_get_user_request( $request_id ); if ( ! $request ) { - return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) ); + return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) ); } // Localize message content for user; fallback to site default for visitors. @@ -3862,19 +3862,21 @@ function wp_generate_user_request_key( $request_id ) { function wp_validate_user_request_key( $request_id, $key ) { global $wp_hasher; - $request_id = absint( $request_id ); - $request = wp_get_user_request( $request_id ); + $request_id = absint( $request_id ); + $request = wp_get_user_request( $request_id ); + $saved_key = $request->confirm_key; + $key_request_time = $request->modified_timestamp; - if ( ! $request ) { - return new WP_Error( 'invalid_request', __( 'Invalid request.' ) ); + if ( ! $request || ! $saved_key || ! $key_request_time ) { + return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) ); } if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) { - return new WP_Error( 'expired_link', __( 'This link has expired.' ) ); + return new WP_Error( 'expired_request', __( 'This user privacy request has expired.' ) ); } if ( empty( $key ) ) { - return new WP_Error( 'missing_key', __( 'Missing confirm key.' ) ); + return new WP_Error( 'missing_key', __( 'This user privacy request is missing the confirmation key.' ) ); } if ( empty( $wp_hasher ) ) { @@ -3882,17 +3884,6 @@ function wp_validate_user_request_key( $request_id, $key ) { $wp_hasher = new PasswordHash( 8, true ); } - $key_request_time = $request->modified_timestamp; - $saved_key = $request->confirm_key; - - if ( ! $saved_key ) { - return new WP_Error( 'invalid_key', __( 'Invalid key.' ) ); - } - - if ( ! $key_request_time ) { - return new WP_Error( 'invalid_key', __( 'Invalid action.' ) ); - } - /** * Filters the expiration time of confirm keys. * @@ -3904,11 +3895,11 @@ function wp_validate_user_request_key( $request_id, $key ) { $expiration_time = $key_request_time + $expiration_duration; if ( ! $wp_hasher->CheckPassword( $key, $saved_key ) ) { - return new WP_Error( 'invalid_key', __( 'Invalid key.' ) ); + return new WP_Error( 'invalid_key', __( 'This user privacy request confirmation key is invalid.' ) ); } if ( ! $expiration_time || time() > $expiration_time ) { - return new WP_Error( 'expired_key', __( 'The confirmation email has expired.' ) ); + return new WP_Error( 'expired_key', __( 'This user privacy request confirmation key has expired.' ) ); } return true; diff --git a/wp-includes/version.php b/wp-includes/version.php index f236d18b95..8d11ea92b5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-49089'; +$wp_version = '5.6-alpha-49090'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.