Skip to content

Remove plaintext passwords from multisite activation flow#922

Merged
mikelittle merged 1 commit intomasterfrom
issue-2009-fix-new-user-signup
Mar 4, 2026
Merged

Remove plaintext passwords from multisite activation flow#922
mikelittle merged 1 commit intomasterfrom
issue-2009-fix-new-user-signup

Conversation

@mikelittle
Copy link
Contributor

@mikelittle mikelittle commented Feb 26, 2026

Summary

  • After account activation, redirect users to the password reset page instead of displaying the plaintext password on wp-activate.php
  • Replace plaintext passwords in welcome emails with a message directing users to set their password via the login page
  • Invalidate the wp-user-signups plugin cache after activation so the admin signups list reflects the correct status

Fixes https://github.com/humanmade/product-dev/issues/2009

Changes

All changes in inc/signup_notification/namespace.php:

  • bootstrap() — Register two new hooks at priority 20 on wpmu_activate_user and wpmu_activate_blog to redirect after welcome emails fire at priority 10
  • altis_welcome_notification() — Replace PASSWORD placeholder with a message instead of the actual password
  • altis_welcome_user_notification() — Same change as above
  • redirect_to_password_reset() — New function for user-only activations. Generates a reset key, invalidates signups cache, and redirects to wp-login.php?action=rp
  • redirect_blog_user_to_password_reset() — New function for blog activations. Same approach, using network_site_url() for the login URL to avoid wp_safe_redirect() rejecting cross-host subdomain redirects

Test plan

  • Create a user-only signup via Network Admin > Signups > Add New
  • Activate the user via the activation email link
  • Verify: user is redirected to the password reset form (not the activation page)
  • Verify: the welcome email does NOT contain a plaintext password
  • Verify: Network Admin > Signups shows the user as activated with a timestamp
  • Create a blog signup and activate it
  • Verify: same redirect and email behaviour for blog signups
  • Test "already active" case — should show existing message, no redirect

🤖 Generated with Claude Code

After account activation, redirect users to the password reset page
instead of displaying the plaintext password on wp-activate.php.
Replace plaintext passwords in welcome emails with a message directing
users to set their password via the login page.

- humanmade/product-dev#2009

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikelittle
Copy link
Contributor Author

Testing:
Created new user:
CleanShot 2026-02-26 at 16 17 03

User gets activation email
CleanShot 2026-02-26 at 16 17 56

User clicks link and is redirected to set password page
CleanShot 2026-02-26 at 16 18 16

User logs in with new password
CleanShot 2026-02-26 at 16 18 42

User is logged in
CleanShot 2026-02-26 at 16 18 53

Welcome email does not contain password
CleanShot 2026-02-26 at 16 19 25

Copy link
Contributor

@wisyhambolu wisyhambolu left a comment

Choose a reason for hiding this comment

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

Looks good.

@mikelittle mikelittle merged commit 8cb7458 into master Mar 4, 2026
1 of 2 checks passed
@mikelittle mikelittle deleted the issue-2009-fix-new-user-signup branch March 4, 2026 11:23
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Successfully created backport PR for v23-branch:

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Successfully created backport PR for v24-branch:

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Successfully created backport PR for v25-branch:

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Successfully created backport PR for v26-branch:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants