Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#53631 closed enhancement (fixed)

Modify "email already exists" message upon registration

Reported by: dansoschin's profile dansoschin Owned by: hellofromtonya's profile hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Login and Registration Keywords: has-patch commit has-copy-review has-testing needs-unit-tests
Focuses: ui-copy Cc:

Description

I recently encountered this topic in the WordPress.org support forums:

https://wordpress.org/support/topic/that-email-address-is-already-in-use-please-try-again/

Therefore, I'm opening a feature request for the ability to edit/customize the system-generated messages through the front-end UI/settings in WordPress.

Currently, through the use of plugins, you can edit many of the system-generated emails to users, but not the on-screen messages.

Attachments (4)

53631.diff (1.5 KB) - added by sabernhardt 3 years ago.
53631.1.diff (1.5 KB) - added by sabernhardt 2 years ago.
adding error prefix
Before_After_53631.1.diff.jpg (169.3 KB) - added by costdev 2 years ago.
53631.2.diff (902 bytes) - added by hellofromTonya 2 years ago.
Fixes the broken unit test.

Download all attachments as: .zip

Change History (20)

#1 @sabernhardt
3 years ago

  • Focuses accessibility removed

@dansoschin Thanks for the ticket!

I think adding the UI likely would be plugin territory. Branda facilitates editing login page errors, though I don't see the same for the signup page. The messages are at least customizable with the 'registration_errors' filter (in a custom plugin).

However, I agree with @andynick that including a link to the login page would be helpful when the user email is already registered. Perhaps this would belong on a separate ticket, unless it's better to change the direction of this one.

Single site email_exists message:
Error: This email is already registered. Please choose another one.

Multisite email_exists message:
Sorry, that email address is already used!

Suggestion to replace both:
Error: This email is already registered. [Log in] with this address or choose another one.

#2 @andynick
3 years ago

@sabernhardt I'm glad to see that you agree with me about the single site email message. Thank you for your interest.
I'm not familiar with these feature request tickets.
Your suggested new wording would be far more helpful.
Is there anything more I can do to help this along?
Thanks also to @dansoschin for posting this ticket.

#3 @dansoschin
3 years ago

  • Summary changed from Enable customization of system notices to Modify "email already exists" message upon registration

I concur that modifying the direction of the ticket per your suggestion makes the most sense and accomplishes the primary objective of the original author. Reserving further modification to custom plugins, etc., etc.

Having not modified a ticket previously, would you kindly let me know what I should do with the settings to accomplish this? (Or, if that's something I'm unable to do, but you or another contributor can do, that's also fine.) I went ahead and changed the summary to be more descriptive... just unsure if there are other properties that require changing.

Thank you!

#4 @sabernhardt
3 years ago

  • Focuses ui-copy added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.9
  • Owner set to sabernhardt
  • Severity changed from trivial to normal
  • Status changed from new to accepted
  • Type changed from feature request to enhancement
  • Version 5.7.2 deleted

If we switch direction to improving the default messages, then this is an enhancement with normal severity. Changing the summary was good. And I set the milestone to try for later this year.

I do not have a patch ready today. If someone else wants to create one before I do (and/or claim ownership of the ticket), you are welcome to do so.

I think the code would be similar to this in both files, though I expect it still needs some editing to work for any site (that does not override the message):

	$login_url = network_site_url( '/wp-login.php' );
	$errors->add( 'email_exists', sprintf( '<strong>Error</strong>: This email is already registered. <a href="%s">Log in</a> with this address or choose another one.', $login_url ) );

@sabernhardt
3 years ago

#5 @sabernhardt
3 years ago

  • Keywords has-patch added; needs-patch removed

Using the wp_login_url() function accommodates custom login URLs.

@sabernhardt
2 years ago

adding error prefix

#6 @sabernhardt
2 years ago

  • Keywords needs-testing needs-copy-review added

I had planned to include the prefix earlier:

Error: This email address is already registered. [Log in] with this address or choose another one.

I tested the login URL on single site, both with the standard wp-login.php and a custom login URL, plus a local multisite installation with the standard wp-login.php. It would be good to confirm that wp_login_url() is correct for subdomain networks, too.

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


2 years ago

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 years ago

#9 @costdev
2 years ago

Test Report

Env

  • WordPress 5.9-alpha-20211102.234109
  • Chrome 95.0.4638.69
  • Windows 10
  • Theme: Twenty Twenty One
  • Gutenberg Editor
  • Plugins: None

Steps to test

  1. Visit the registration page: /wp-login.php?action=register.
  2. Enter a unique username.
  3. Enter an email address used by an existing user.
  4. Apply patch 53631.1.diff.
  5. Repeat steps 1-3 to see the new text added by the patch.

Results

  • Patch: 53631.1.diff
  • Result: The patch correctly changes the words in the registration error. However, it may need some improvement. See before/after image posted below.
Last edited 2 years ago by costdev (previous) (diff)

#10 @webcommsat
2 years ago

  • Keywords needs-copy-review removed

Copy review. The revised copy makes this clearer, and now with a single point of direction with the addition of the login link. Back to you @hellofromTonya

#11 @hellofromTonya
2 years ago

  • Keywords commit has-copy-review has-testing added; needs-testing removed

Thank you @webcommsat and @costdev for review and testing.
Marking for commit.

#12 @hellofromTonya
2 years ago

  • Owner changed from sabernhardt to hellofromTonya
  • Status changed from accepted to assigned

Reassigning review to me for commit.

#13 @hellofromTonya
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52074:

Login and Registration: Improve "email already exists" registration error message.

Adds the wp_login_url() login link to the Error message to be more helpful to users when their user email already is registered.

Improves the error message to more clearly communicate next step.

Follow-up to [16009], [22124], [31963].

Props andynick, costdev, dansoschin, sabernhardt, webcommsat.
Fixes #53631.

#14 @hellofromTonya
2 years ago

Thank you everyone for your contributions! The improved error message is now in Core and will ship with 5.9.

#15 @johnbillion
2 years ago

  • Keywords needs-unit-tests added
  • Resolution fixed deleted
  • Status changed from closed to reopened

The assertion in test_create_existing_network_user_on_sub_site_has_error() for Multsite needs to be updated. Failing test here: https://github.com/WordPress/wordpress-develop/runs/4154138084?check_suite_focus=true .

@hellofromTonya
2 years ago

Fixes the broken unit test.

#16 @hellofromTonya
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 52075:

Login and Registration: Fix failing test for "email already exists" registration error improvement.

Follow-up to [52074].

Fixes #53631.

Note: See TracTickets for help on using tickets.