#7932 closed defect (bug) (no action required)
BP Owner's gMail Address Appears as the Username
Reported by: | pastordatm | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.0 |
Component: | Registration | Keywords: | reporter-feedback close |
Cc: | pastor@… |
Description
WordPress Version: 4.9.7 and installed 6 July 2018
Active Theme: Twenty Seventeen
BuddyPress Version: 3.1.0 and installed 18 July 2018.
Layout Style: BuddyPress Nouveau
Website Link: https://datm.org/
My Google eMail address is pastordatm at gmail dot com. As the website owner, when my BuddyPress Username was automatically created during installation, my Username came out to be @pastordatmgmail-com which is clearly my eMail address. I registered another account with BuddyPress as a Subscriber which had a gmail address of dave.k4eet at gmail dot com. This time the Username came out to be @k4eet. While this is not an issue to me, it is truncated from the original eMail address's prefix.
The bug that is being reported is the appearance of @pastordatmgmail-com for the owner's Username. This is clearly an eMail address and does not conform to BuddyPresses naming convention for a Username.
Thanks for your time and assistance. Let me know if I need to do anything further and if anybody needs a temporary login to the website.
Cheers! Pastor Dave
Attachments (3)
Change History (11)
#1
@
6 years ago
Hello - Thanks for the report!
When creating a user account, BuddyPress (and WordPress) ask you to provide a username. It is not generated automatically. For example, see Screenshot_2018-07-19_11-24-52.png, which is a screenshot from https://datm.org/register/. Likewise, if you create an account via Dashboard > Users, you'll be prompted to enter the username manually.
If you're using email addresses as usernames, then the "truncation" you've described - pastordatmgmail-com
- is expected behavior. @-mentions and profile URLs are built using what's called in WordPress the "user_nicename", which is generally a version of the user_login (ie the username) that is URL-friendly. In your case, this means removing the @ sign, and replacing the .
with a -
.
If you'd like to prevent users from entering an email address when creating a username, you might consider a plugin like https://wordpress.org/plugins/restrict-usernames/, which I think will work with BuddyPress.
#2
@
6 years ago
- Component changed from Core to Registration
- Keywords reporter-feedback close added
Dave posted in the forum thread about this as well:
https://buddypress.org/support/topic/would-prefer-bp-not-use-derivative-of-email-address-for-username-beside-picture/
From what I can gleam from the screenshots, Dave activated BuddyPress on an existing WordPress install that might have used a customized registration or member management process in the past. This process created user accounts with the email address as the username.
This would explain the email address showing up on the user profile (and recorded as the user_nicename
in the WordPress wp_users
table) and how the second subscriber user account is correct.
Dave, you could try using the following snippet in wp-config.php
to see if this might fix older user accounts:
define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );
This would use the user_login
field instead of the user_nicename
field for the @-USERNAME
on your user profile and URL. It's possible that your previous member management plugin only used the email address for the user_nicename
field. If so, this might fix your issue, but probably will not.
I say this is a wontfix based on the customized nature of the install.
If you want to fix this issue manually for your older accounts, you would have to use some type of username renamer plugin like this:
https://wordpress.org/plugins/rename-users/
Untested, please test on a development install or backup your database before using that plugin.
I should also note that if you are using plugins that rely on your older usernames (such as a LDAP install or some member management plugin), then please take caution or talk to your site developer before using the user rename plugin.
#3
@
6 years ago
@r-a-y is exactly correct on the install. I was never prompted to fill in any information.
As for the WordPress snippet, I am smart enough to know how to edit the file but I do not know where to insert the line. Does it go at the very top of the file after the <?php statement?
I'll hold off on the manual fix for now.
Thanks for your help! Pastor Dave
#4
@
6 years ago
Also, once I upload the changed file after making a backup, do I need to restart anything and, if so, how do I restart whatever? :-)
#5
@
6 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
I'd put the line around the define( 'WP_DEBUG', false );
line.
No need to restart. Once you've saved the file on the server, check out your profile page and see if the username looks correct. Note: Your profile URL might change as well as a result.
If it doesn't work, just remove the line and re-save.
I'm going to close this ticket as this isn't a core problem, but feel free to keep replying.
#6
@
6 years ago
Nope, no change. I'll undo the change and put the original file back in.
Let me ask, is this a WordPress or a BuddyPress issue that is causing this? I installed both fresh as listed in the original ticket. Certainly something somewhere is amiss. No?
Cheers! Pastor Dave
#7
@
6 years ago
Since this was closed, I went ahead and used https://wordpress.org/plugins/rename-users/ which is OK for WordPress (v)4.9.7 in my case at least.
Cheers! Pastor Dave
#8
@
4 years ago
While this option doesn't replace the username with something safer, it at least lets you rename the username if you are the admin and had used an obvious admin username. https://wordpress.org/plugins/username-changer/ it is current as of the time stamp of this post.
Owner's Username