Bugs / Suggested Improvements
-
I help run the backend for a popular local news website and I’ve noticed a few things tonight while reverse engineering the code looking for the solution to an extremely slow email delivery issue.
The first thing I noticed, unrelated, was the fact that there were log files which indicated “fatal” errors happening sporadically. The log files produced blank lines so I traced the code back to add additional lines of output and found that issue was simply that the ip column in the wp_newsletter_stats table wasn’t big enough for ipv6 addresses (the maximum value length should be 45 instead of 20).
After further investigation I found that the thing actually causing the email delivery to be so slow simply had to do with recurring dots in the email address for (unverified) single opt-in subscribers. I was apparently getting “No error message reported” in the logs. However in my research I found that WordPress does emit an event (a hookable action) when one of these errors occurs. So with a bit of code I was able to log the actual error, being “You must provide at least one recipient email address”. I used a simple regex in a query to bounce the offending email addresses in the database, 189 in total, and that instantly and dramatically improved things.
I have a recommendation (other than the obvious) which is to implement an option to ignore errors when sending so that these types of issues don’t risk causing delays such as the kind we’ve been experiencing. Currently I think I’m just going to comment out the return statements on lines 686 and 730 for now in plugin.php.
Thanks for taking the time to read!
- The topic ‘Bugs / Suggested Improvements’ is closed to new replies.