Google Forms - Version 0.21

Version Description

No known upgrade issues.

Download this release

Release Info

Developer mpwalsh8
Plugin Icon wp plugin Google Forms
Version 0.21
Comparing to
See all releases

Code changes from version 0.20 to 0.21

Files changed (3) hide show
  1. index.php +2 -2
  2. readme.txt +14 -6
  3. wpgform-core.php +16 -1
index.php CHANGED
@@ -4,8 +4,8 @@
4
  * Plugin Name: WordPress Google Form
5
  * Plugin URI: http://michaelwalsh.org/wordpress/wordpress-plugins/wpgform/
6
  * Description: Add Google Forms to a WordPress web site. Display a Google Form directly into your posts, pages or sidebar. Style the Google Form to match your existing theme and display a custom confirmation page after form submission.
7
- * Version: 0.20
8
- * Build: 0.20.$WCREV$
9
  * Last Modified: $WCDATE$
10
  * Author: Mike Walsh
11
  * Author URI: http://www.michaelwalsh.org
4
  * Plugin Name: WordPress Google Form
5
  * Plugin URI: http://michaelwalsh.org/wordpress/wordpress-plugins/wpgform/
6
  * Description: Add Google Forms to a WordPress web site. Display a Google Form directly into your posts, pages or sidebar. Style the Google Form to match your existing theme and display a custom confirmation page after form submission.
7
+ * Version: 0.21
8
+ * Build: 0.21.$WCREV$
9
  * Last Modified: $WCDATE$
10
  * Author: Mike Walsh
11
  * Author URI: http://www.michaelwalsh.org
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: Google Forms, Google Docs, Google, Spreadsheet, shortcode, forms
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
- Stable tag: 0.20
8
 
9
  Embeds a published, public Google Form in a WordPress post, page, or widget.
10
 
@@ -35,6 +35,7 @@ The WordPress Google Form shortcode `gform` supports a number of attributes that
35
 
36
  * __form__: The full URL to the published Google Form. You must be able to open this URL successfully from a browser for the __gform__ shortcode to work properly.
37
  * __confirm__: A full URL to the confirmation (e.g. _Thanks for your submission!_) page. Be default Google displays a very basic confirmation page which cannot be integrated easily with your WordPress site. The _confirm_ attribute allows the form submission to land on a page of your choosing. **It is strongly encouraged that you make use of a confirmation page.** It will make the form submission process cleaner and clearer to the end user.
 
38
  * __class__: Google Forms are full of classes but the WordPress Google Form plugin does not bring their definitions into page when importing the form. The _class_ attribute allows the addition of one or more CSS classes to the DIV which wraps the Google Form. To add multiple classes, simply separate the class names with spaces.
39
  * __legal__: By default Google Forms have a _Powered by Google Docs_ section at the bottom of the form which includes links to Google TOS and other Google information. If you do not want to see this information as part of the form, add `legal='off'` to your shortcode usage. The content remains in the form, it is simply hidden from the end user using CSS.
40
  * __br__: For a <br> tag to be inserted between the form label and the input text box by setting the *br* attribute to *on*. This will result in the form label and the input box being stacked on top of one another.
@@ -60,7 +61,7 @@ Yes, see a demo here: [Demo of WordPress Google Form plugin](http://michaelwals
60
 
61
  Feel free to submit a response and then view other responses as well.
62
 
63
- = Content appears, but it's not my form and it looks odd! =
64
  You should triple-check that you've published your Form. Google provides instructions for doing this. Be sure to follow steps 1 and 2 in [Google Spreadsheets Help: Publishing to the Web](http://docs.google.com/support/bin/answer.py?hl=en&answer=47134) as the same process applies to Forms and Spreadsheets.
65
 
66
  = Why doesn't my form look the same as it does when I use the stand alone URL? =
@@ -78,7 +79,7 @@ label.ss-q-title:after {
78
  }
79
  `
80
 
81
- = No matter what I do, I always get the *Unable to retrieve Google Form. Please try reloading this page.* error message. Why is this? =
82
  Validate that the WordPress HTTP API is working correctly. If you are seeing HTTP API errors on the WordPress Dashboard or when you attempt to access the plugin repository through the Dashboard, the WordPress Google Form will likely fail too. It requires the WordPress HTTP API to be working. With some free hosting plans, ISPs disable the ability to access remote content.
83
 
84
  == CSS ==
@@ -176,6 +177,13 @@ No known upgrade issues.
176
 
177
  == Changelog ==
178
 
 
 
 
 
 
 
 
179
  = Version 0.19 =
180
  * Documentation updates in the READMME.txt file.
181
  * Update information on About Tab to reflect new architecture.
@@ -191,15 +199,15 @@ No known upgrade issues.
191
  * Fixed bug with passing checkbox values. Only one value, the last selected, was being passed for a multiple choice question.
192
  * Rearchitected process for passing parameters to the Google Form with wp_remote_post().
193
 
194
- = Version 0.15
195
  * Fixed bug with default options which manifested itself always loading the default options for any setting which is on by default even when turned off by user.
196
  * Removed loading of jQuery-Validate as it is no longer used.
197
  * Removed debug and other deprecated code (e.g. wpgform_footer()).
198
 
199
- = Version 0.14
200
  * Fixed minor bug with default options which manifested itself as an array index warning on the Options page.
201
 
202
- = Version 0.13
203
  * Fixed bug where values for check boxes and radio buttons was not retained when going back on multi-page Google Forms.
204
 
205
  = Version 0.12 =
4
  Tags: Google Forms, Google Docs, Google, Spreadsheet, shortcode, forms
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
+ Stable tag: 0.21
8
 
9
  Embeds a published, public Google Form in a WordPress post, page, or widget.
10
 
35
 
36
  * __form__: The full URL to the published Google Form. You must be able to open this URL successfully from a browser for the __gform__ shortcode to work properly.
37
  * __confirm__: A full URL to the confirmation (e.g. _Thanks for your submission!_) page. Be default Google displays a very basic confirmation page which cannot be integrated easily with your WordPress site. The _confirm_ attribute allows the form submission to land on a page of your choosing. **It is strongly encouraged that you make use of a confirmation page.** It will make the form submission process cleaner and clearer to the end user.
38
+ * __alert__: A message to display upon successful form submission in a Javascript Alert box (e.g. _Thanks for your submission!_).
39
  * __class__: Google Forms are full of classes but the WordPress Google Form plugin does not bring their definitions into page when importing the form. The _class_ attribute allows the addition of one or more CSS classes to the DIV which wraps the Google Form. To add multiple classes, simply separate the class names with spaces.
40
  * __legal__: By default Google Forms have a _Powered by Google Docs_ section at the bottom of the form which includes links to Google TOS and other Google information. If you do not want to see this information as part of the form, add `legal='off'` to your shortcode usage. The content remains in the form, it is simply hidden from the end user using CSS.
41
  * __br__: For a <br> tag to be inserted between the form label and the input text box by setting the *br* attribute to *on*. This will result in the form label and the input box being stacked on top of one another.
61
 
62
  Feel free to submit a response and then view other responses as well.
63
 
64
+ = Content appears, but it's not my form and it looks odd! Why? =
65
  You should triple-check that you've published your Form. Google provides instructions for doing this. Be sure to follow steps 1 and 2 in [Google Spreadsheets Help: Publishing to the Web](http://docs.google.com/support/bin/answer.py?hl=en&answer=47134) as the same process applies to Forms and Spreadsheets.
66
 
67
  = Why doesn't my form look the same as it does when I use the stand alone URL? =
79
  }
80
  `
81
 
82
+ = No matter what I do, I always get the "Unable to retrieve Google Form. Please try reloading this page." error message. Why is this? =
83
  Validate that the WordPress HTTP API is working correctly. If you are seeing HTTP API errors on the WordPress Dashboard or when you attempt to access the plugin repository through the Dashboard, the WordPress Google Form will likely fail too. It requires the WordPress HTTP API to be working. With some free hosting plans, ISPs disable the ability to access remote content.
84
 
85
  == CSS ==
177
 
178
  == Changelog ==
179
 
180
+ = Version 0.21 =
181
+ * Added ability to display a Javascript alert box upon successful form submission.
182
+ * Fixed more syntax errors in the ReadMe.txt markdown.
183
+
184
+ = Version 0.20 =
185
+ * More documentation cleanup.
186
+
187
  = Version 0.19 =
188
  * Documentation updates in the READMME.txt file.
189
  * Update information on About Tab to reflect new architecture.
199
  * Fixed bug with passing checkbox values. Only one value, the last selected, was being passed for a multiple choice question.
200
  * Rearchitected process for passing parameters to the Google Form with wp_remote_post().
201
 
202
+ = Version 0.15 =
203
  * Fixed bug with default options which manifested itself always loading the default options for any setting which is on by default even when turned off by user.
204
  * Removed loading of jQuery-Validate as it is no longer used.
205
  * Removed debug and other deprecated code (e.g. wpgform_footer()).
206
 
207
+ = Version 0.14 =
208
  * Fixed minor bug with default options which manifested itself as an array index warning on the Options page.
209
 
210
+ = Version 0.13 =
211
  * Fixed bug where values for check boxes and radio buttons was not retained when going back on multi-page Google Forms.
212
 
213
  = Version 0.12 =
wpgform-core.php CHANGED
@@ -187,6 +187,16 @@ class wpGForm
187
  $form = $options['form'] ;
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
190
  // Custom Confirmation URL? Optional
191
  if (!$options['confirm'])
192
  {
@@ -466,7 +476,11 @@ jQuery(document).ready(function($) {
466
  ' ;
467
 
468
  // Before closing the <script> tag, is this the confirmation
469
- // AND do we have a custom confiormation page?
 
 
 
 
470
  if ($posted && is_null($action) && !is_null($confirm))
471
  $js .= PHP_EOL . 'window.location.replace("' . $confirm . '") ;' ;
472
 
@@ -487,6 +501,7 @@ jQuery(document).ready(function($) {
487
  $params = shortcode_atts(array(
488
  'form' => false, // Google Form URL
489
  'confirm' => false, // Custom confirmation page URL to redirect to
 
490
  'class' => 'gform', // Container element's custom class value
491
  'legal' => 'on', // Display Google Legal Stuff
492
  'br' => 'off', // Insert <br> tags between labels and inputs
187
  $form = $options['form'] ;
188
  }
189
 
190
+ // Custom Alert Message? Optional
191
+ if (!$options['alert'])
192
+ {
193
+ $alert = null ;
194
+ }
195
+ else
196
+ {
197
+ $alert = $options['alert'] ;
198
+ }
199
+
200
  // Custom Confirmation URL? Optional
201
  if (!$options['confirm'])
202
  {
476
  ' ;
477
 
478
  // Before closing the <script> tag, is this the confirmation
479
+ // AND do we have a custom confiormation page or alert message?
480
+
481
+ if ($posted && is_null($action) && !is_null($alert))
482
+ $js .= PHP_EOL . 'alert("' . $alert . '") ;' ;
483
+
484
  if ($posted && is_null($action) && !is_null($confirm))
485
  $js .= PHP_EOL . 'window.location.replace("' . $confirm . '") ;' ;
486
 
501
  $params = shortcode_atts(array(
502
  'form' => false, // Google Form URL
503
  'confirm' => false, // Custom confirmation page URL to redirect to
504
+ 'alert' => null, // Optional Alert Message
505
  'class' => 'gform', // Container element's custom class value
506
  'legal' => 'on', // Display Google Legal Stuff
507
  'br' => 'off', // Insert <br> tags between labels and inputs