[wp-trac] [WordPress Trac] #33376: Create index on user_email and UNIQUE on user_nicename, user_email and user_login
WordPress Trac
noreply at wordpress.org
Thu Aug 20 04:47:49 UTC 2015
#33376: Create index on user_email and UNIQUE on user_nicename, user_email and
user_login
------------------------------------------+-----------------------------
Reporter: chriscct7 | Owner: chriscct7
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Database | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback early | Focuses: performance
------------------------------------------+-----------------------------
Comment (by DrewAPicture):
Replying to [comment:3 chriscct7]:
> Replying to [comment:2 knutsp]:
> > This may fail for user_email, as a plugin could have allowed users
with the same email.
>
> To do so would either require direct SQL calls or overriding tons of
checks for email_exists in order to avoid the fact that WordPress prevents
users from sharing an email address. I'm sure a plugin could be devised,
if so desired, that could break on any nearly any change to WordPress
core.
>
> A plugin that allows the same email to be shared would also break other
issues like #9568 (login via an email address; which user gets logged in
when they share an email?), as well as developers ability to count on
predicable results to core functions like `get_user_by('email', $value)`.
As such, changing the tables to not support duplicates simply complements
checks WordPress already has.
The [https://wordpress.org/plugins/allow-multiple-accounts/ Allow Multiple
Accounts] plugin by @coffee2code has been a popular choice for years for
allowing multiple accounts with the same email. So it's not really unheard
of.
And for what it's worth, it leverages the `pre_user_email` hook to do it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33376#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list