WordPress Google Form v0.46-beta-17 is now available

I have just uploaded WordPress Google Form v0.46-beta-17 which addresses one bug and adds new capability to the CAPTCHA functionality.

  • CAPCTHA can now have 2 or 3 terms
  • CAPTCHA now supports operators for addition (+), subtraction (-), and multiplication (*)

GForm_SS_44 GForm_SS_45

I finally found a solution to passing the query arguments correctly so the page navigation for the Form Submission Log now works properly.

At this point I think I am close to done with this release.  Scope creep can be a killer and it has been a long time since I’ve formally released an update.  With the number of questions I am getting about new Google Forms and all of the fixes being in this beta, it is time to get it out!

The next question to resolve is do I bump the version number to 1.0 with all of the changes I’ve made or continue as it is and release v0.46 – thoughts?

Google Forms Beta (8813 downloads )

New Google Forms now support the language parameter!

For several weeks I have been trying to figure out a solution how to handle language issues with new Google Forms.  In the old version, a URL parameter could be specified (see this page).  However, this didn’t work with the new version of Google Forms.

Until today.  Thanks to a posting on the WordPress Support Forum, I was alerted to the fact that the URL parameter is indeed working again.  This is great news as dealing with odd language issues is one of the more common support requests I receive.

In the new version of Google Forms, simply append ?hl=en (or ?hl=fr for French, etc.) to the end of the URL of the live form.  Wish they would have done this several weeks ago, would have saved me quite a bit of time!

WordPress Google Form v0.46-beta-16 is available

I have just uploaded WordPress Google Form v0.46-beta-16 which addresses one bug and adds the ability to oveeride the default Google text in several more areas:

  • Radio Button hint
  • Check Boxes hint
  • “Other” option when allowed as a Radio Button option

The bug fixed had to do with saving the Options tab losing the Override setting on the Advanced Options tab.  It only happened if the Options tab was saved after the Advanced Options but now that it is fixed, save order is no longer an issue.

I also added some more default CSS to account for some of the CSS changes Google has made lately.

Google Forms Beta (8813 downloads )

Constantly Amazed by jQuery

I am constantly amazed by what one can do with jQuery.  If it were not for jQuery, I don’t think I would have continued working on WordPress Google Forms.  I’ve used jQuery to adapt check box parameters so they will pass from PHP (used by WordPress) to Python (used by Google for form process).  I’ve used jQuery to implement CAPTCHA.  I’ve used jQuery to implement multiple columns.  And now I am using jQuery to work-around the language issues which have recently become a problem.

Recently Google changed the structure of Google Forms.  The new version no longer supports the hl=XX (where XX is a language parameter such as en or fr) parameter.  For most instances this isn’t a problem.

However, there are some cases where Google thinks the server hosting WordPress (and hence WordPress Google Forms) is located in a certain part of the globe and therefore should receive Google Forms with some of the boiler plate text in the native language suitable for the location.  Awesome.  Google thinks I need German buttons and text.  I don’t speak German nor do any of my users however the server is physically located in Germany. Now what?

Over the past couple of days I been implementing jQuery that finds the default text which Google is serving in  a native language and allowing WordPress Google Forms to override it.  I am doing this with jQuery.  Fortunately Google adds numerous CSS classes to their forms so most of the replacements can be accomplished in a single line of jQuery.  However, there is one situation where it isn’t so simple.

If you employ a multiple choice question, Google provides an option to add an “Other” choice where the user can type in another answer.  Again, very nice of them.  However the “Other” text is one of those that Google serves up in a localized language and more importantly, it isn’t wrapped in a SPAN or a DIV with a CSS class that makes it easy to select.

Here is one of the questions on one of my development forms.  You can see I’ve already overridden the “hint” (which is also new):

GForm_SS_42

Here is the same question with the “Other” text overridden:

GForm_SS_43

So how do we select just the “Other” text but only when using a multiple select widget which employs an Other choice? jQuery and Javascript to the rescue:

$("div.ss-radio label:last+span.ss-q-other-container").prev().contents().filter(function() {
        return this.nodeType == Node.TEXT_NODE;
    })[0].nodeValue = "<<<<Other:";

This snippet of jQuery (which I got some help on from this thread on StackOverflow) combined with Javascript selects the one case there is and replaces it with my override.  Pretty slick eh?

Look for another beta update today with more override options.

WordPress Google Form v0.46-beta-15 now available

This afternoon I uploaded WordPress Google Form v0.46-beta-15 which addresses a CAPTCHA problem.  CAPTCHA requires Validation and unless Validation was specifically enabled for the form, the Validation code wasn’t loaded and hence CAPTCHA wasn’t running.

I also added some new default CSS to account for some of the CSS changes Google has made lately.  Google has actually made quite a few CSS changes so I need to make sure it is all covered.

This morning Google also made some changes to Check Boxes and Radio Buttons adding more text which is subject to the language problem.  The quick fix is to hide the new text using Custom CSS:

div.ss-printable-hint { display: none; }

Download the latest beta and please provide feedback on any issues you run into.

Google Forms Beta (8813 downloads )

WordPress Google Form v0.46-beta-14 available

This afternoon I uploaded WordPress Google Form v0.46-beta-14 which addresses a problem with certain parts of Google Forms (usually the buttons, required text, and disclaimer text) being displayed in a foreign language.  I wrote up some details on why this happens in a previous post.

GForm_SS_39

GForm_SS_38

GForm_SS_40

If you are having this issue, please download the beta and provide me some feedback.  I think I am going to move a few items from the Options tab to the Advanced Options tab before I release it.

Google Forms Beta (8813 downloads )

Why are my buttons in Chinese?

Periodically I get a question from someone using WordPress Google Form asking why their buttons (and some other text) is in Chinese (or some other language but Chinese is the most common)?

If you haven’t run into this problem, consider yourself lucky!  The problem manifests itself similar to the images below.

GForm_SS_35 GForm_SS_36

As near as I can tell, this problem happens when the Web server that is running WordPress Google Form is geographically located in a part of the world where Google thinks it should serve up a particular language.

So how do you fix it?  In the previous version of Google Forms, the solution was simple:  Add &hl=en to your form URL and Google would deliver the content in the specificed language (in the case English) – refer to to this post for more details.  Unfortunately the new version of Google Forms doesn’t support this language parameter so I have been at a loss to help people who find themselves in this situation.

For several days I have been trying to find a solution.  Adding cookies to the wp_remote_get() request, .htaccess entries, PHP locale settings, etc.  Nothing made a difference.

While at the gym this morning it dawned on me that there isn’t any reason why I couldn’t “fix” the problem by processing the HTML that Google generates with jQuery.  So that is what I have done.

GForm_SS_37

 

I have renamed the Debug tab to Advanced Options and added the ability to define the text that will appear on the Submit, Back, and Continue buttons as well as the text which indicates fields are Required.

New Google Forms break multi-page support

Ugh. Google has made the process of using multi-page forms much harder than it used to be. In the older version of Google Forms the values were passed from one page to another in an array.

In the new version of Google Forms the data is still passed from page to page in a variable (called draftResponses) however PHP sees this data as a string instead of an array so the code which reformats the array from a PHP style (which WordPress uses) to a Python style (which Google uses) doesn’t run.

It looks like I will need to parse the string into a PHP array and then encode the array to be compatible with Python. As I said, ugh.

Logging Google Form Submissions

For a while I have wanted to have a log of form submissions. My interest in this has mostly been to understand the source of spam submissions but there are other reasons too. With all of the changes Google Forms have undergone recently, this seemed like a good time to add this functionality as I chase down what Google changed to cause multi-page forms not to work.

The logging functionality I have implemented will only work with forms defined using the new Custom Post Type (CPT) as the log data is stored as Post Meta data attached to the CPT for the form.  In my current build I am working with all submissions are logged however there will be a setting to turn it on and off (default will be off) when I make a beta release available (hopefully today).

Access to the log is via a sub-menu selection from the Google Forms menu.

GForm_SS_33The log itself is implemented using the standard WordPress List Table class which provides a standard look and feel which WordPress users will recognize.

GForm_SS_34

Log entries can be deleted (in bulk or individually  but right now that is the only operation.  Is there some other operation that would make sense?  Export might make sense but I’ll defer on that for now.

WordPress Google Form v0.46 beta 12 available

I have posted wpGForm v0.46-beta-12 this morning.  This update removes some debug code,  updates the ReadMe file to reflect usage of the Custom Post Type and new wpgform shortcode, and adds the URL (permalink) of the page from which the form was submitted to the confirmation email (when used).

Now that the issues with the new version of Google Forms appear to be worked out, I am close to releasing this update.  All I have left to do is to update my Help and Support Form to support the new usage model (CPT) and I think I am ready.

Google Forms Beta (8813 downloads )