WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 17 months ago

#34927 new enhancement

user_url and user_email length too short

Reported by: DonnaMiller Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords: 2nd-opinion has-patch
Focuses: Cc:
PR Number:

Description

I have been adding users to my client's site with no issues, until I got to a user with a .edu email address. I add the user details as normal. Click the Add New User button and get the message "New user created". No error message at all. But the user has not been created. I tried 3 times, same result. I have turned off all plugins and changed to the wordpress default theme (2015). Same issue.

What I expect to happen: When I add a user I expect them to be added to the Users list.

What happens: when I add a user with a .edu email address, there is no error message, I get message "New user created", but the user is not in the user's list. These users should also appear in the Author drop down in posts (because they are added with Author role), but the new user does not appear in the Author dropdown eiither.

Using Firefox 42.0 on Mac OS X Yosemite.
Same issue happens with Safari 9.0.1 on Mac OS X Yosemite.

Attachments (2)

Inspect Network Request.pdf (169.1 KB) - added by DonnaMiller 4 years ago.
Console Log
34927.diff (1013 bytes) - added by samirmalpande 17 months ago.
Patch to increase the length of user_email and user_url fields

Download all attachments as: .zip

Change History (18)

#1 @DonnaMiller
4 years ago

  • Severity changed from normal to major

#2 follow-up: @chriscct7
4 years ago

Cannot replicate this. Successfully added multiple college emails accounts from Chrome, Opera and FireFox.

Are you using WordPress multisite?

#3 follow-up: @swissspidy
4 years ago

  • Keywords reporter-feedback added
  • Severity changed from major to normal

Cannot reproduce on single install or multisite. Adding a user with a .edu email address works as expected.

"New user created" message is used only on single sites I think.

@DonnaMiller Some questions:

  • What username did you use?
  • Is there an error shown in the console (open developer tools in your browser)
  • Has this worked before, i.e. in 4.3.1?
  • Does it work on another site running 4.4? Perhaps it's a caching issue.

#4 @morganestes
4 years ago

@DonnaMiller Thanks for your report. Although we're not able to immediately reproduce this, finding the potential cause is important.

I have one more question to add to those posted by @swissspidy: When you get the "New user created" message, do you also get a link immediately following to "Edit user"? Knowing that can help track down exactly where in the code this is happening.

#5 in reply to: ↑ 2 @DonnaMiller
4 years ago

Replying to chriscct7:

Cannot replicate this. Successfully added multiple college emails accounts from Chrome, Opera and FireFox.

Are you using WordPress multisite?

No, single site instance.

#6 in reply to: ↑ 3 @DonnaMiller
4 years ago

Replying to swissspidy:

Cannot reproduce on single install or multisite. Adding a user with a .edu email address works as expected.

"New user created" message is used only on single sites I think.

@DonnaMiller Some questions:

  • What username did you use?
  • Is there an error shown in the console (open developer tools in your browser)
  • Has this worked before, i.e. in 4.3.1?
  • Does it work on another site running 4.4? Perhaps it's a caching issue.
  • Username: Cabrillo College
  • No errors in the Log tab of the console... but see below
  • This is the first .edu email we have added, so I'm not sure if it worked in previous versions.

I tried to add the user again with the console open. But not having used the console much I was trying to figure out where to look for the data that would be most helpful to you. The same issue happened as I filled in all the initial fields.

Then I cleared the console and was just looking under the Log tab, added the member again, but being tired of putting in all their data, I just added their username and email. And it worked!

@morganestes I was not getting the link to Edit User previously, but this time when I only supplied the username and email and it worked I did get the Edit User link.

So I went into edit user and started filling out the rest of the information that is found in the initial Add User screen and saving to see what was causing the problem. It was the Website URL. These website URLs are all on the same domain, they are posts within this instance of Wordpress (each member has a post which is their member page).

Here is the URL of this user, which was causing the problem:
http://santacruzconstructionguild.us/cabrillo-college-construction-and-energy-management-cem-program/

It's very long, is there a limit to the number of characters allowed in the URL? Obviously as a post slug this number of characters was allowed. But perhaps the Add User Website field does not support as many characters?

If you know please let me know and I can shorten the slug for this post and we can keep that in mind for future posts. Because when I try to add that Website URL and save it, I don't get an error, but it does not save.

I will attach a PDF of the log output from the console

@DonnaMiller
4 years ago

Console Log

#7 @swissspidy
4 years ago

  • Keywords reporter-feedback removed

Indeed, the user_url field is currently limited to 100 characters. Yours is exactly 101 characters long.

user_email is limited to 100 characters as well, even though a valid email address can be longer.

Although usually URLs and email addresses are in that range, there are exceptions to this. Perhaps we should change those fields to varchar(255).

#8 @jeremyfelt
4 years ago

  • Version 4.4 deleted

I'm going to bump the 4.4 version off this until we can determine the root cause. It sounds like there may be a related ticket for user_url and user_email restrictions that this may apply to.

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


4 years ago

#10 @swissspidy
4 years ago

Related: #33793 (recent increase of user_login length)

#11 @swissspidy
4 years ago

#35811 was marked as a duplicate.

#12 follow-up: @swissspidy
4 years ago

  • Keywords needs-patch added
  • Summary changed from Cannot add users with .edu email addresses to user_url and user_email length too short
  • Type changed from defect (bug) to enhancement

Can we increase those columns to something like 255 chars?

#13 in reply to: ↑ 12 @DrewAPicture
4 years ago

  • Keywords 2nd-opinion added

Replying to swissspidy:

Can we increase those columns to something like 255 chars?

I don't know if email addresses are utf8mb4-ready, but I know URLs are. Meaning, if I remember correctly, the most we could do is 191. @pento might have some insight here.

#14 @pento
4 years ago

I'm cool with increasing them to 255.

191 is the index prefix limit, we can have longer columns, we're only able to index the first 191 characters of them.

#15 @samirmalpande
17 months ago

We are using WordPress Social Login (https://wordpress.org/plugins/wordpress-social-login/) on one of our sites. It was working fine until now. Facebook has recently made some changes in its URL structure and their URLs are now much longer. WordPress Social Login uses the user_url field to store the Facebook's profile URLs.

As URLs are much longer now they are not saved in the database and user registration fails.

There are many people facing this issue. One of the reports can be seen at https://github.com/miled/wordpress-social-login/issues/263.

In the above mentioned GitHub issue, its suggested that we increase the user_url column's length to 255 to fix the issue.

I can make changes to the database table to fix this issue, but I will prefer not to make any changes to core table.

We should really consider increasing the length of user_url and user_email columns.

@samirmalpande
17 months ago

Patch to increase the length of user_email and user_url fields

#16 @samirmalpande
17 months ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.