WordPress Commenting Bug: Name Field Edition
If you have a non-alphanumeric character in your name, your comment goes into moderation.
After considerable time trying to figure out why a longtime commenter’s contributions were consistently going into the moderation queue, our IT guy finally figured it out:
Once there’s one approved comment from [someone with a given user name] in the system, future comments get published automatically.
The problem is the way that WP determines who a “new commenter” is. If the comment isn’t coming from a logged-in user, the way it does that is by taking the name and the email address the commenter provided, and then checking the comment database to see if there’s any approved comments in the system with that same name and email address. If it finds any, the new comment gets published; if it doesn’t, it goes into the moderation queue.
Normally that works fine, but in this case the name the commenter was providing (“Daryl’s other brother Darryl”) had an apostrophe in it, and apostrophes are special characters that need to be encoded before they’re passed in a database query. If they aren’t encoded properly, the database will register it as a syntax error and the query will fail every time, no matter how many approved comments are in the database with that same username and email address. So every time Darryl commented, WP thought he was a new commenter and plonked his comment into the moderation queue.
We’ve reached out to him a couple days back and he’s simply going to omit the apostrophe. Problem solved. The reason I’m posting this is that it’s just occurred to me that at least one other regular commenter (Just ‘nutha) has an apostrophe and there may be others that are in a similar boat I’m forgetting.
Jason has reached out to WordPress in hope this bug is fixed. In the meantime, word to the wise.