This WordPress plugin trims the usernames to eliminate accidentally entered ( usually during copy/paste) spaces, tabs, colons, and double quotation marks.
Why? – Because some hotheads out there will not memorize their own username but will attempt to co copy/paste it into your login page even though they have not been licensed to operate a computer mouse.
Seriously, there are real people who got shaky hands due to their old age, physical exertion, excessive use of recreational substances ( = too much coffee), or just the plain excitement of seeing your blog.
They would try to copy their username and then paste it into your login form, but would capture a few extra characters around the username, and WordPress will dutifully accept these extras, process them as a part of the username, and spit out “wrong password” error, confusing the hell out of the users and you. (they know they simply could not make a mistake, since all they did was copy the data)!
And then they will blame you.
Notice how the message “wrong password” is misleading. In my experience, most of “wrong password” problems in WordPress are caused by one of three mistakes:
- Ignoring WordPress insistance on paying attention to the capitalization of usernames – this can be solved with my Insensitive plug-in;
- Capturing extra characters when copying/pasting passwords – covered by my Trim Passwords plug-in;
- Capturing extra characters when copying/pasting usernames – resolved here by Trim Usernames plug-in.
What it does, how it works
All you have to do is install the plugin. There is nothing to configure.
Once installed, it will automatically trim spaces, colons, tabs, and double quotation marks at the beginning and the end of usernames at login.
If you have readers with existing usernames that start/end with the characters trimmed by this plugin, they will NOT be able to log in. Granted, such usernames are rather extravagant, so you are on your own then. Sorry.
I wrote “Trim Usernames” for my own purposes, not for public distribution. It is provided “As Is” and can probably do horrible harm.
I do not know PHP. I have never written a full PHP program in my life. Not even “Hello, World”. This means the code may be buggy and is guaranteed to be sub-optimal. Yes, this is my fifth WordPress plug-in, but it has been developed using the time honored Open Source model: “Monkey See – Monkey Do”. Do not expect me to understand why it works 😉
If it works fine for you, please leave a comment here – it will encourage me and other potential users. Oh, and if you can make it better – go for it!
Have you read the Disclaimer above??? – download Trim Usernames here: Trim Usernames plug-in for WordPress, Version 0.9
- Download the plugin (see “Download” above).
- Rename trim-usernames.txt to trim-usernames.php and put it into your plugins directory (wp-content/plugins/) or in a sub directory of the plugins directory.
- Activate the Plug-in.
Writing all this up took time and effort. If you happen to be actually using this plug-in – I appreciate your vote of confidence and would love to hear about it!