#52914 closed defect (bug) (fixed)
Inconsistent error message format on login
Reported by: | dd32 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Login and Registration | Keywords: | |
Focuses: | ui-copy | Cc: |
Description
The WordPress login screen is inconsistent in it's error messaging, using two different forms of textual error messages.
The formatting is mostly related to [48059] which removed the <strong>Error:</strong>
prefix from a few login related errors, but didn't remove it from the authentication handlers and other areas of wp-login.php
. As a result, you can receive two different formats of errors.
See the below attachment for an example of the mixed error message style.
Here's a list of most of the error messages related to authentication/registration
wp-login.php __( 'Your password reset link appears to be invalid. Please request a new link below.' ) __( 'Your password reset link has expired. Please request a new link below.' ) __( 'The passwords do not match.' ) __( '<strong>Error</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ), __( '<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ), __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' ); __( 'You are now logged out.' ), 'message' ); __( 'User registration is currently not allowed.' ) ); __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what’s new.' ), 'message' ); __( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' ); wp-includes/pluggable.php __( '<strong>Error</strong>: Invalid username, email address or incorrect password.' ) ); wp-includes/user.php __( '<strong>Error</strong>: The username field is empty.' ) ); __( '<strong>Error</strong>: The password field is empty.' ) ); __( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ), __( '<strong>Error</strong>: The email field is empty.' ) ); __( '<strong>Error</strong>: The password field is empty.' ) ); __( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ), __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) ); __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); __( '<strong>Error</strong>: Please enter a username or email address.' ) ); __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); __( '<strong>Error</strong>: The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ), __( '<strong>Error</strong>: Please enter a username.' ) ); __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) ); __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) ); __( '<strong>Error</strong>: Please type your email address.' ) ); __( '<strong>Error</strong>: The email address isn’t correct.' ) ); __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ) ); __( '<strong>Error</strong>: Couldn’t register you… please contact the <a href="mailto:%s">site admin</a>!' ), __( '<strong>Error</strong>: The email address isn’t correct.' ), __( '<strong>Error</strong>: The email address is already used.' ),
Attachments (1)
Change History (6)
#2
in reply to:
↑ description
@
4 years ago
- Milestone changed from Awaiting Review to 5.8
- Owner set to SergeyBiryukov
- Status changed from new to accepted
Replying to dd32:
The formatting is mostly related to [48059] which removed the
<strong>Error:</strong>
prefix from a few login related errors, but didn't remove it from the authentication handlers and other areas ofwp-login.php
. As a result, you can receive two different formats of errors.
As noted above, [48115] restored any prefixes removed in [48059], so the inconsistencies were likely pre-existing.
Some strings appear to be introduced or adjusted in [2438], [15710], [25696], [33019], [33034].
At a glance, it seems like these four strings should get an "Error:" prefix:
__( 'Your password reset link appears to be invalid. Please request a new link below.' )
__( 'Your password reset link has expired. Please request a new link below.' )
__( 'The passwords do not match.' )
__( 'User registration is currently not allowed.' ) );
These, on the other hand, seem more like informational messages and probably don't need the prefix:
__( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );
__( 'You are now logged out.' ), 'message' );
__( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' );
See also #50442 for consistent prefixes. ([48115] restored any prefixes removed in [48059].)