While looking at a CSS styling problem for someone I encountered a minor bug on the Options page. The plugin wasn’t picking up the default options correctly and in some cases a PHP array index warning would appear on the Options page. This bug has been fixed and I’ve released v0.14. You can download it from the WordPress plugin repository or update it from the Dashboard.
Category Archives: Plugin
WordPress Google Form v0.13 fixes “back” bug
I have just committed v0.13 to the WordPress plugin repository. An update should appear in your WordPress Dashboard fairly soon. This update fixes a problem when using multi-page Google Forms which have radio buttons and check boxes on them. When the “Back” button was selected to view the previous page of the form, the previously selected values were not retained. This bug has been fixed and the “Back” and “Continue” buttons now work as expected.
WordPress Google Form v0.12 is out
Yesterday I committed and tagged the v0.12 release of my WordPress Google Form plugin. It is available from the WordPress plugin repository. The main feature of this release is support for multi-page Google Forms. The changes made to support multi-page forms should also enable use of fields that have optional answers.
There is still some leftover code from the old validation process that I was reluctant to completely remove until I know for sure this new architecture is working in more use cases than I have to test with. There will likely be another update that is nothing more than a code clean up in a couple weeks unless someone reports a problem.
wpGForm v0.11 beta update
This morning I posted an updated wpGForm v0.11 beta release. This updated beta introduces two new shortcode attributes:
- title=’on|off’ – Show (default) or remove the Google Form title. The title is often redundant with the WordPress post or page title, this attribute will allow you to remove the title from the HTML displayed within the WordPress context.
- maph1h2=’on|off’ – Map H1 elements (usually just the title) on the Google Form to H2 elements. This allows you to retain the form title from the Google Form but map it’s H1 tags to H2 tags which prevents multiple H1 tags from appearing on the WordPress page (which I understand is an SEO no-no).
This build also includes default CSS definitions for div.ss-q-help classes. Why the help text appears adjacent to the question as opposed to on top of it is a question comes up pretty frequently. This CSS makes the output more consistent with how Google presents the form so I’ve decided it should be the default.
label.ss-q-help { display: block; }
I’ve also started removing debug and obsolete code.
wpGForm v0.11 beta
I am currently running a beta version of wpGForm v0.11 here on my site. The big change for this version if the support for multi-page Google Forms. You can see how they work using my Sample Multi-Page Google Form.
I am looking for some people to test this version and provide feedback. If you can check it out and provide some feedback I’d really appreciate it. There are quite a few changes in this version due to the rearchitecture required to support multi-page forms. There shouldn’t be any changes to what is actually rendered for the user.
This version also fixes the confirmation page bug that has been present when a custom confirmation page wasn’t specified. The behavior of the custom confirmation page is slightly different too in this version.
[download#7]Mutli-Page GForm Update
I’ve been trying to find a solution that will allow wpGForm to support multi-page Google Forms. I realize that this is a pretty important feature for people who use Google Forms and my lack up updates or news isn’t from lack of effort! I’ve tried a number of things, each of which hasn’t worked out.
The single page Google Form works pretty well but even with it, there are still a couple of minor nits (e.g. properly handling optional fields). I’ve thought that if I can find a better way to handle multi-page forms that I may also be able to eliminate the limitations that single page forms have too.
The problem with trying to do what I am trying to do is that Google Forms aren’t really designed to be anything but their own entity. Yes, you can embed them with an IFRAME tag and they will work correctly but there is no way to modify the HTML in an IFRAME due to Cross Site Scripting (XSS) security concerns. Yesterday I thought I had a clever solution that used jQuery and AJAX to load to the result from a form submission using a small script within the plugin to submit the form and then WordPress could load the results from the plugin script eliminating the XSS concern but I couldn’t get it to work reliably (and it was slow).
I’ve been using wp_remote_get() to retrieve the contents of the Google Form since I started this plugin. Why it never occurred to me (until last night) to use wp_remote_post() to submit the form to Google I have no idea. This was one of those “Doh!” moments we (at least I do and I am pretty sure I am not alone) have when you simply get caught up making the problem much harder than it needs to be.
This morning I noodled on this while I was at the gym and from my preliminary experiments, it looks like it is going to work. No promises or commitments yet but this path is the most promising I’ve explored since I’ve started looking at the multi-page form problem. So far I’ve been able to submit a multi-page form however only the first page of the form is styled correctly and the confirmation page isn’t working properly either. I think both are solvable.
I am posting this because this question comes up a few times a week and I am sure the lack of progress I’ve demonstrated may result in lack of confidence for the plugin.
Assuming I get this flushed out in the next day or two, I’d like a couple volunteers to test the plugin before I release and update through the WordPress plugin repository. Please let me know if you’d be interested in testing an early build.
WordPress 3.3 and WordPress Google Form?
The answer is: I don’t know yet. WordPress 3.3 came out last night and I am just playing with it now. One of the key features of WordPress 3.3 is the inclusion of the complete JQuery UI library. This definitely affects wpGForm because I am loading one of the UI libraries that wasn’t previously included from Microsoft’s CDN. That will no longer be necessary (yeah!). I guess the question now is what to do about backward compatibility with older versions of WordPress.
Historically I’ve just put a stake in the ground and moved on but wpGForm is the first WordPress theme or plugin that I’ve done that has quite a few users so I’ll probably implement some sort of version detection and conditionally load the UI library from the CDN if running an older version of WordPress. A little more work for me but probably the right answer.
WordPress Google Form bug fix
In the process of trying to solve the multipage Google Form problem, I found a bug with the “Confirmation” page. When a custom confirmation page isn’t supplied, the plugin is supposed to use the default Google conformation page. It currently isn’t, instead the page the form is on is rendered again. This is incorrect behavior and I’ve fixed it in my development thread and it will appear in the next release.
Multipage Google Forms – no solution yet
Yesterday I had some time to look at supporting multipage Google Forms. Unfortunately it doesn’t look like it will be possible because of the way multipage forms work. As you work through a multipage form Google adds hidden values to each successive page to facilitate moving forward and back without losing any data. Pretty standard stuff for a “wizard-like” form implementation.
The problem is the way the plugin is implemented, the HTML code for the form is extracted and then re-processed before being added to a page within WordPress. What I’ve implemented works fine for a single page form, actually, in my opinion, it works pretty well. However, detecting the page transitions and obtaining the hidden form fields either isn’t easy or isn’t possible. Right now I am leaning toward the later because the hidden fields are generated based on the prior page (Continue or Back) form submission.
What I have successfully made work is to use the “embedded” version of a Google form within a WordPress page. It works but aesthetically it looks awful. What I am playing with right now is some jQuery to try and manipulate the embedded form to use the styling from the site instead of from Google. We’ll see how it goes ….
CSS for the WordPress Google Form Submit button
I was recently asked how the Submit button could be styled when using a Google Form in conjunction with my WordPress Google Form plugin. Fortunately this was an easy question to answer because I had done something similar for another site. Now I suspect the person asking me didn’t want to make their submit button pink but the CSS selector should be the same – it is just a matter of adding the CSS directives to achieve the desired affect! I used the following selector to style the Submit button:
div.ss-form-entry>input[type="submit"] { background-color: pink; }
This little trick should help further integrate Google Forms with your WordPress site.
Update: Recently I was asked how to style only the Submit button – all other buttons (e.g. Back, Continue, etc.) and input fields should keep their default styles. Here is some CSS which will style only the Submit button:
div.ss-form-entry>input[type="submit"][name="submit"] { background-color: pink; }