Custom Confirmation problems with v0.26

In v0.26 of WordPress Google Form I changed how I was handling the custom confirmation page as many people had told me they didn’t like the redirection which caused a rapid page reload.  The new mechanism does a partial page reload using Ajax so the effect is much more graceful but I have heard from several people that it isn’t working for them.

If you are having this problem, please let me know so I can figure what is going on as it is working fine in my development and testing area.  I am still looking for a more graceful solution but the model I used before supporting multi-page forms simply won’t work with multi-page forms.  Multi-page forms are too important and commonplace not to support them.  Sort of a catch 22 for now but I am trying to find a viable alternative.

wpGForm now has email notification

I’ve received a couple of requests to have an email notification sent out when a form is submitted. Today I released v0.26 which supports a new attribute (email=’on|off’) on the gform shortcode. By default email notification is off but when set to on, an email to the blog administrator will receive an e-mail indicating a form was submitted. The email also contains the URL for the form, and date and time the form was submitted.

While I was working on this version, I also decided to see if I could make the custom confirmation work like my original implementation which did not use a Javascript redirect.  I had switched to the redirect when I added support for multi-page forms because the mechanism I was using previously no longer worked.

Email can be sent in either HTML or Plain Text formats, there is a new option on the settings page.  By default email notifications are sent in HTML format.

The v0.26 version switches from a Javascript redirect to an Ajax page load using jQuery.  In my testing it seems to work pretty well and is much less intrusive than the redirect was.  Let me know if you run into any problems with it.

The v0.26 release is now available from the WordPress plugin repository and an update will appear on your WordPress Dashboard.

WordPress Google Form v0.25 now available

Today I was alerted to an issue where my WordPress Google Form plugin wasn’t behaving correctly. This turned out to be due to the prefix attribute in the gform shortcode not handling it correctly. I have fixed the problem with the prefix attribute and a couple of other things and pushed out a release on the WordPress plugin respository.

Version 0.25

  • Fixed problem with checkbox processing when using the prefix attribute.
  • Fixed problem with hiding legal links when using the prefix attribute.
  • Fixed problem with legal=’off’ attribute not being processed correctly.

Possible Enhancements for wpGForm

Recently I have had a couple requests for enhancements to wpGForm. One of the recent ones was the ability to define hidden fields on a form to capture some data from a WordPress user.

Currently Google’s forms define fields like this:

<input id="entry_0" class="wpgform_ss-q-short" type="text" value="" name="entry.0.single">

It would not be too hard to add an attribute like hidden=’entry_0,entry_2,
entry_27′ to the shortcode. I could even do something like
hidden=’entry_0=email,entry_2=username,entry_27=first_name,entry_28=last_name’ where the “allowable” presets would have to map to the fields which can be returned by get_userdata() see:
http://codex.wordpress.org/Function_Reference/get_userdata Of course all of this predicates that the user is logged in so those fields exist.

I’ve also considered changing the plugin to allow for more complicated things – adding more options to the shortcode could get pretty cumbersome. What’ve I thought about is doing leveraging the Dashboard (using a Custom Post Type) to Manage Forms where you “Add” a form and the Dashbaord provides a GUI where all sorts of information would be added:

1. Form URL
2. Confirmation URL
3. Switches for all of the other options (legal, read-only, etc.)
4. More things I haven’t thought about

Forms could then be “Edited/Deleted/etc.” just like other post types. Then you’d simply embed the form using a simple shortcode like [wpgform id='1']. The rest of the information would be stored inWordPress as custom Post Type fields. I’d probably define a new shortcode for this so the current one would continue to work but that is the general idea.

Thoughts?

WordPress Google Form v0.24 fixes UTF-8 bug

Recently a couple people have reported problems with international (or UTF-8) characters. The UTF-8 characters were not being passed correctly from the form on the WordPress site on to Google. I had planned to look into the problem this coming weekend but a wpGForm user (cablop.net) beat me to it and has provided the fix (thank you very much!).

I have incorporated the fix and tested it and was able to submit a couple Spanish words that have UTF-8 characters. The update should appear on your Dashboard shortly.

WordPress Google Form v0.23

This evening I released v0.23 of my WordPress Google Form plugin. This update fixes a situation where CSS declarations were output as plain text as part of the form. I believe the cause of this was due to an appearance theme for the form being specified in the Google Form Designer. The update should roll out via the WordPress Dashboard Update failrly soon.

WordPress Google Form update – v0.22

Yesterday I received a report from someone using WordPress Google Form that their checkboxes weren’t working. This was very confusing to me because last weekend I spent a bunch of time fixing and testing the checkbox problem.

It turns out the jQuery script which fixes the checkboxes to work with PHP was never running. Why wasn’t it running? Because jQuery wasn’t ever loaded. Why wasn’t jQuery loaded? Because wpGForm never loaded it! It turned out the website which reported the problem was using a theme that doesn’t use jQuery and therefore never loaded it.

Well the WordPress Google Form plugin, which needs jQuery, didn’t load it either. I (and I can only assume other people) was never seeing a problem because either the theme or another plugin was loading jQuery.

The v0.22 update corrects this problem which was somewhat of a corner case, but a problem none the less.

WordPress Google Form minor update – v0.21

This morning I have updated WordPress Google Form and fixed a number of documentation problems and added one minor new feature.  While I am not a big fan of Javascript Alerts, I had a request to allow a message to be displayed upon successful form submission.  I have added a new parameter (alert=’message’) to the gform short code to enable this new functionality.

[gform form='https://docs.google.com/spreadsheet/viewform?hl=en_US&formkey=dEYwbGNYVG9TRUhXellMaDBuZ1RQTHc6MQ#gid=0' confirm='http://localhost/?page_id=435' alert='You da man!']

The new release should appear in the WordPress repository immediately and as Dashboard update fairly soon.

Yet another update! WordPress Google Form v0.18 available

I have just released another update to the WordPress Google Form plugin.  Within the HTML code that Google generates for their forms, each input field has  unique identifier (e.g entry.0.group, entry.47.group, entry.6.single, etc.).  There was a bug in the Regular Expression which incorrectly handled these identifiers when then had more than one digit.  This bug is fixed in v0.17.

Why do the identifiers need to be processed?  The need to “massage” the identifiers is due to the fact that WordPress is based on PHP and Google Forms are processed by Python.  The two languages handle passing form parameters slightly differently.  When the form is submitted on the WordPress side, the periods in the id are translated to underscores by PHP.  Inputs like check boxes which may contain multiple values are handled using arrays in PHP where as Python allows the use of the same identifier multiple times.  In order to submit the form values to Google, any value received as an array must be converted to a multi-value and the underscores need to be translated back to periods so they match the Python script on the Google side which actually processes the form and stores the result in a Google Spreadsheet.

There was a mistake in the logic which transforms the identifiers from PHP syntax to Python syntax.  It didn’t correctly handle more than one digit in the identifier resulting in the wrong identifier names being sent to Google.  This also caused loss of input values when a required field was not supplied.

Hopefully this will be the last problem!

WordPress Google Form plugin v0.16 released

This morning I uploaded a new version of my WordPress Google Form plugin.  This update addresses the three items I noted in this post.  I also expanded the Test Bed Form I have  been using to develop and test the plugin.  If you’re curious, I have added the form to a page on this site.  If you run into a combination that isn’t working and I haven’t accounted for it in the test bed, please let me know and I’ll update my form.

I think I finally have Check Boxes working correctly.  They were a challenge because how PHP (which WordPress uses) pass arrays of information and Python (which Google Forms use for processing) are very different.  Thanks to a tip on the WordPress Hackers Mailing List to a utility called http://httpbin.org I was able to get my plugin to pass the parameters as Google expects them and everything seems to be working correctly.  The update should appear in your WordPress Dashboard fairly soon.