Skip to content

Privacy: Require explicit confirmation for personal data requests - #12765

Draft
ArkaPrabhaChowdhury wants to merge 2 commits into
WordPress:trunkfrom
ArkaPrabhaChowdhury:trac-50141-privacy-request-confirmation
Draft

Privacy: Require explicit confirmation for personal data requests#12765
ArkaPrabhaChowdhury wants to merge 2 commits into
WordPress:trunkfrom
ArkaPrabhaChowdhury:trac-50141-privacy-request-confirmation

Conversation

@ArkaPrabhaChowdhury

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/50141

Summary

  • shows a confirmation form instead of confirming personal data requests on the initial GET request
  • performs the request confirmation only after the form is submitted
  • reports when a valid request link has already been confirmed
  • adds regression coverage for confirmed request keys

Testing

  • phpunit tests/phpunit/tests/auth.php (143 tests, 358 assertions)
  • PHPCBF and PHPCS on all changed files
  • manually verified the GET, POST, and reused-link flows in the local WordPress environment

Copilot AI review requested due to automatic review settings July 30, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=confirmaction GET and perform confirmation only after the form is submitted (POST).
  • Add a new confirmed_request error 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.

Comment thread src/wp-includes/user.php Outdated
Comment on lines 5087 to 5093
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.' ) );
}
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copilot AI review requested due to automatic review settings July 30, 2026 07:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return false (e.g., if the request is deleted between validation and rendering). The subsequent $request->action_name access 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 ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants