WordPress Google Form v0.58-beta-3 now available

This morning I released beta-3 of WordPress Google Form v0.58.  This update addresses one problem, properly handling newline characters in TEXTAREA entry boxes.  This issue was reported on the WordPress Support Forum.

If there are no more reported issues, I will likely release v0.58 in the next day or so.

Google Forms Beta (8985 downloads )

Email Users v4.6.0-beta-3 now available

If you’ve been following the Email Users Support Forum, you are aware that for the past couple of days I have been chasing a bug which affects some users and places all of their intended recipient email addresses in the CC header instead of the BCC header.

This has been a challenging bug to find as it doesn’t happen on any of the systems I have access to.  Fortunately I had a few users affected by this problem willing to help me and I appreciate their assistance.  I am not sure how I would resolved this problem without their assistance.  Again, thanks.

So what was the problem?  The WordPress wp_mail() API allows you to pass extra header information as part of the mail content.  Email Users makes use of this by constructing a BCC header which contains all of the email addresses for the intended recipients.  The wp_mail() function supports headers as a single string or an array of headers, each header as an array element.

Up until this evening Email Users had constructed all email headers as a string.  With a large number of email addresses this string could end up being very long.  However, I don’t believe the length of the string had anything to do with the problem.

When wp_mail() receives headers as a string, it tries to intelligently decompose them.  In some cases it appears that the string wasn’t splitting correctly which means the BCC field wasn’t ever seen.  The “Bcc:” text became part of an email address which was subsequently discarded because it resulted in a bad address.

Email Users v4.6.0 has a rewrite of the mailusers_send_mail() function plus some new debug functionality which helps resolve these sorts of issues.  Additionally, the new debug is under user control so can be turned on and off as needed.

Email Users Beta (5793 downloads )

EU_SS_29

For testing this new version, I recommend turning Debug on until you’re comfortable with the the structure of the email addresses.

Questions or comments -don’t hesitate to ask.

Debugging the Email Users CC issue

For the past few days I have been chasing a reported issue where Email Users is putting recipient addresses into the CC header instead of the BCC header.  This has been a challenge to chase down.  To assist in this I have add a bunch of  new debug and checking to Email Users.

Email  Users will now check and report if wp_mail() has been overloaded by a plugin or theme.  Since wp_mail() is a pluggable function, this is the one area which is really out of the control of Email Users.  Simply knowing if wp_mail() has been overloaded is very helpful.

Additionally, I have finally found a way to initiate a complete email which is aborted just prior to the email actually being sent.  The content of several internal structures is displayed on the Dashboard so the email headers can easily be examined.

This build is in DEBUG mode which means it will never actually send an email unless wp_mail() has been overloaded in which case all bets are off.  Please visit the Settings page first to determine if wp_mail() has been overloaded.  If it has, do not send any email but let me know which plugin or theme has overloaded wp_mail().

Email Users Beta (5793 downloads )

WordPress Google Form v0.58-beta-2 available

I have just released beta-2 of WordPress Google Form v0,58.  This update addresses a couple of significant issues, notably the inability to disable some of the default options.

The problem with the default settings  based on checkboxes is described pretty well in this article by Devin Price.  I was dealing with the essentially the same problem Devin describes although my solution is slightly different, his solution was helpful in fixing this problem.

While fixing this problem I also added a new Reset button which appears on the Advanced tab.  This Reset button will reset the plugin to use the default settings.

This beta release also includes a fix to address the problem when an ampersand appears in a text box on a multi-page form.  This problem was reported on WordPress Support Forum.

Google Forms Beta (8985 downloads )

Email Users v4.5.3-beta-4 now available

This morning I pushed out beta-4 for Email Users v.4.5.3.  This latest update addresses the duplicate header information discovered by Andy Fragen.  I had already fixed the problem with the TO header Andy noted but was unaware of the duplicate MIME-Version header.  It turns out, there was also a duplicate X-Mailer header as well.

By default wp_mail() sits on top of PHPMailer.  WordPress does not check for either the MIME-Version header nor the X-Mailer header.  Unless specifically set, PHPMailer will add its default values for these two headers which is what was happening.  It appears that some systems are sensitive to duplicate headers and reject the messages and others do not.  This definitely explains why it is difficult to reproduce reports that come in of users not receiving email.

Because wp_mail() is pluggable, other mail implementations may be expecting these headers to continue to exist.  What I have done is added two new options to add the headers as Email Users has been doing all along.  By default these two options are off because PHPMailer duplicates them and I expect most people use the default WordPress implementation.

EU_SS_23

I also improved the information panel I added recently to report the existance of any filters which may interact with Email Users.  For the most part these filters don’t do any harm however they can change override the FROM information in the email or the format which may be unexpected. The new information in the panel is nothing more than a note that something else may be affecting your email outside of Email Users (e.g. why is my From name different than what I set?).

EU_SS_22

Please report any issues with this latest beta update.

Email Users Beta (5793 downloads )

Email Users v4.5.3-beta-3 now available

This afternoon I posted the third beta release of Email Users v4.5.3.  There is a pretty significant change in this build so I may bump to v4.6 when I release it.

Yesterday I posted an article about an odd Email Users problem I was looking at.  This build fixes (correctly) the problem encountered by that user by properly using get_users() instead of a complex SQL query to retrieve the information used to construct the User Settings page.

In addition to being properly constructed, the User Settings page has a number of fixes including proper sorting and the addition of Search (which I could never get working using the old query).

I’ve also addressed a couple of other very minor requests that came up recently in the WordPress Support Forum.

Email Users Beta (5793 downloads )

A Really Odd Email Users Problem

I was recently contacted about an Email Users issue on a site that is using bbPress and S2Member.  The person had come to the conclusion that there was some sort of conflict between the three plugins which resulted in the Email Users -> Users Settings screen being empty and asked me to look into it.

EU_SS_20

Clearly something is amiss as in order to access the WordPress Dashboard you need to login and in order to login, there needs to be at least one user!  This isn’t the sort of situation I can easily replicate.  Fortunately the person with this problem provided me access to their server so we could do some debugging.

The functionality in Email Users is based on the WP_List_Table class and an example plugin which you can find in the WordPress Plugin Repository.  When I first implemented it I was retrieving the list of users with a call to get_users() however I never got the sorting working correctly.  After playing around with it for a while, I gave up and wrote my own query.  The query I wrote yielded the results and sorting I wanted so I didn’t think much about it.  Until today.

This the query that WordPress generates and sends to MySQL:


SELECT ID, display_name, user_email, user_login, m1.meta_value first_name, m2.meta_value last_name, m3.meta_value massemail, m4.meta_value notifications
FROM wp_users u
LEFT JOIN wp_usermeta m1 ON (m1.user_id = u.ID AND m1.meta_key = 'first_name')
LEFT JOIN wp_usermeta m2 ON (m2.user_id = u.ID AND m2.meta_key = 'last_name')
LEFT JOIN wp_usermeta m3 ON (m3.user_id = u.ID AND m3.meta_key = 'email_users_accept_mass_emails')
LEFT JOIN wp_usermeta m4 ON (m4.user_id = u.ID AND m4.meta_key = 'email_users_accept_notifications')
ORDER BY last_name ASC LIMIT 0,100

What this query does is select all of the WordPress User Ids, first names, and last names, which have the proper Email Users user meta keys. The data is returned and stored in a format which can be rendered in the List Table.

Because the table was empty, I wanted to see what the results of the query were as that would tell me where the issue might be.  Because I had access to the MySQL database via phpMyAdmin, I was able to run the query directly against MySQL.  When I did so, this is what I found:

EU_SS_21

This certainly was unexpected but it explained why the List Table was empty.  I have never run into this sort of problem, in fact, I had never heard of either the SQL_MAX_JOIN_SIZE or the SQL_BIG_SELECTS MySQL system variables.

I was able to alter SQL_BIG_SELECTS using the following SQL:


SET SQL_BIG_SELECTS=1

When I did this and re-ran the query, phpMyAdmin returned the results I would have expected to see.  This was good news – it appears this users problem is due to a MySQL setting.  The bad news is sometimes it is hard to change these settings and it isn’t something I thought I could add to the query itself.

As a test, I modified the source for one of Email Users files so it was calling the original method I had coded  based on get_users() to see if it would work and it did.  This is very good news as I suspect fixing the sorting issue (or living with it) will be easier than changing the MySQL system variable settings.

My next step is to see if I can fix the sorting problem and roll out an update.

WordPress Google Form v0.56-beta-1 available

I have posted the initial beta version of WordPress Google Form v0.56.  This preliminary release has bug fixes to handle UTF-8 characters in from values and also handles the unusual case where a tab character is embedded in the form response value.

The embedded tab issue was particularly tricky to track down as it is (a) it wasn’t obvious since web browsers render tabs as white space and (b) it isn’t easy to actually enter a tab into an HTML form (which is how Google Forms are created).  I was able to embed a tab in a form response by pasting some text from Word.  It turns out the user that had the problem I was trying to resolve had done the exact same thing.

Handling the tabs turned out to be tricky so initially I thought I thought I might have to simply detect them and display a warning but in the end I was able to find a viable solution.

This beta release also has the first implementation of Transients for the initial rendering of a form.  This use case is likely not all that common but came from a user who had four (4) forms on a single page and was seeing timeouts from Google.  Caching the initial rendering of the form will help in this situation.  Thanks to Camilo Flores for providing a patch which I based the implementation on.

Google Forms Beta (8985 downloads )

WordPress Google Form v0.55 released

Yesterday WordPress 3.6 was released.  The bundled version of jQuery was updated to 1.10 which broke the jQuery Columnizer plugin I use to split a form into columns.  The result was jQuery would go into an infinite loop and eventually you would have to kill the page.

Fortunately someone had already encountered this problem and provided a patch to the jQuery plugin.  I have incorporated the patch and released v0.55.  If you’re running WordPress 3.6, this is a critical release.  Older versions should continue to run correctly.

You can find v0.55 on your WordPress Dashboard or in the plugin repository.