Privacy: Require explicit confirmation for personal data requests - #12765
Privacy: Require explicit confirmation for personal data requests#12765ArkaPrabhaChowdhury wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the privacy request confirmation flow to require an explicit user confirmation step (via a POSTed form) instead of confirming on the initial GET, and adds handling/reporting for already-confirmed request links.
Changes:
- Show a confirmation form on the initial
wp-login.php?action=confirmactionGET and perform confirmation only after the form is submitted (POST). - Add a new
confirmed_requesterror state when a request is already confirmed/completed, and display an appropriate message in the login flow. - Add a regression test covering validation behavior for already-confirmed request keys.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/phpunit/tests/auth.php | Adds a regression assertion for confirmed request keys returning confirmed_request. |
| src/wp-login.php | Splits confirmaction into GET (display form) vs POST (confirm), and handles already-confirmed links with a dedicated message. |
| src/wp-includes/user.php | Introduces confirmed_request result from wp_validate_user_request_key() for confirmed/completed requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ( in_array( $request->status, array( 'request-confirmed', 'request-completed' ), true ) ) { | ||
| return new WP_Error( 'confirmed_request', __( 'This personal data request has already been confirmed.' ) ); | ||
| } | ||
|
|
||
| if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) { | ||
| return new WP_Error( 'expired_request', __( 'This personal data request has expired.' ) ); | ||
| } |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/wp-login.php:1268
wp_get_user_request( $request_id )can returnfalse(e.g., if the request is deleted between validation and rendering). The subsequent$request->action_nameaccess would then trigger a fatal error. Add a guard before using$request.
$request = wp_get_user_request( $request_id );
if ( 'export_personal_data' === $request->action_name ) {
$message = __( 'Please confirm that you want to export your personal data.' );
} elseif ( 'remove_personal_data' === $request->action_name ) {
Trac ticket: https://core.trac.wordpress.org/ticket/50141
Summary
Testing
phpunit tests/phpunit/tests/auth.php(143 tests, 358 assertions)