Google Forms - Version 0.43

Version Description

No known upgrade issues.

Download this release

Release Info

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

Code changes from version 0.42 to 0.43

Files changed (4) hide show
  1. index.php +2 -2
  2. readme.txt +10 -1
  3. wpgform-core.php +15 -11
  4. wpgform-debug.php +10 -7
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.42
8
- * Build: 0.42.$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.43
8
+ * Build: 0.43.$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.4.2
7
- Stable tag: 0.42
8
 
9
  Embeds a published, public Google Form in a WordPress post, page, or widget.
10
 
@@ -204,7 +204,16 @@ No known upgrade issues.
204
 
205
  == Changelog ==
206
 
 
 
 
 
 
 
207
  = Version 0.42 =
 
 
 
208
  * Added simple math based CAPTCHA support.
209
  * Reintroduced jQuery Validation for checking required fields.
210
  * Improved support for multiple forms on one page.
4
  Tags: Google Forms, Google Docs, Google, Spreadsheet, shortcode, forms
5
  Requires at least: 3.0
6
  Tested up to: 3.4.2
7
+ Stable tag: 0.43
8
 
9
  Embeds a published, public Google Form in a WordPress post, page, or widget.
10
 
204
 
205
  == Changelog ==
206
 
207
+ = Version 0.43 =
208
+ * Reimplemented shortcode attribute *br='on'* usinq jQuery instead of preg_replace().
209
+ * Reimplemented shortcode attribute *legal='off'* usinq jQuery instead of preg_replace().
210
+ * Fixed DEBUG mode so it will work with PHP 5.2 (which doesn't support anonymous functions).
211
+ * Fixed CSS prefix bugs which prevented CSS prefix from being applied to all Google CSS classes.
212
+
213
  = Version 0.42 =
214
+ * Fixed typos in ReadMe file.
215
+
216
+ = Version 0.41 =
217
  * Added simple math based CAPTCHA support.
218
  * Reintroduced jQuery Validation for checking required fields.
219
  * Improved support for multiple forms on one page.
wpgform-core.php CHANGED
@@ -520,16 +520,8 @@ class wpGForm
520
 
521
  // Insert breaks between labels and input fields?
522
 
523
- if ($br)
524
- $html = preg_replace('/<\/label>[\w\n]*<input/i', '</label><br/><input', $html) ;
525
-
526
- // Hide Google Legal Stuff?
527
-
528
- if (!(bool)$legal)
529
- {
530
- $html = preg_replace(sprintf('/<div class="%sss-legal"/i', $prefix),
531
- sprintf('<div class="%sss-legal" style="display:none;"', $prefix), $html) ;
532
- }
533
 
534
  // Need to extract form action and rebuild form tag, and add hidden field
535
  // which contains the original action. This action is used to submit the
@@ -599,14 +591,26 @@ class wpGForm
599
  jQuery(document).ready(function($) {
600
  ' ;
601
 
 
 
 
 
 
 
602
  // Did short code specify a CSS prefix?
603
  if (!is_null($prefix)) $js .= sprintf('
604
- $("#ss-form [class]").each(function(i, el) {
605
  var c = $(this).attr("class").split(" ");
606
  for (var i = 0; i < c.length; ++i) {
607
  $(this).removeClass(c[i]).addClass("%s" + c[i]);
608
  }
609
  });
 
 
 
 
 
 
610
  ', $prefix) ;
611
 
612
  // Is CAPTCHA enabled?
520
 
521
  // Insert breaks between labels and input fields?
522
 
523
+ //if ($br)
524
+ //$html = preg_replace('/<\/label>[\w\n]*<input/i', '</label><br/><input', $html) ;
 
 
 
 
 
 
 
 
525
 
526
  // Need to extract form action and rebuild form tag, and add hidden field
527
  // which contains the original action. This action is used to submit the
591
  jQuery(document).ready(function($) {
592
  ' ;
593
 
594
+ // Insert breaks between labels and input fields?
595
+ if ($br) $js .= '
596
+ $("#ss-form textarea").before("<br/>");
597
+ $("#ss-form input[type=text]").before("<br/>");
598
+ ' ;
599
+
600
  // Did short code specify a CSS prefix?
601
  if (!is_null($prefix)) $js .= sprintf('
602
+ $("div.ss-form-container [class]").each(function(i, el) {
603
  var c = $(this).attr("class").split(" ");
604
  for (var i = 0; i < c.length; ++i) {
605
  $(this).removeClass(c[i]).addClass("%s" + c[i]);
606
  }
607
  });
608
+ $("div.ss-form-container").removeClass("ss-form-container").addClass("%s" + "ss-form-container");
609
+ ', $prefix, $prefix) ;
610
+
611
+ // Hide Google Legal Stuff?
612
+ if (!(bool)$legal) $js .= sprintf('
613
+ $("div.%sss-legal").hide();
614
  ', $prefix) ;
615
 
616
  // Is CAPTCHA enabled?
wpgform-debug.php CHANGED
@@ -31,13 +31,7 @@ if ($wpgform_options['http_request_timeout'] == 1)
31
  {
32
  if (is_int($wpgform_options['http_request_timeout_value'])
33
  || ctype_digit($wpgform_options['http_request_timeout_value']))
34
- {
35
- add_filter('http_request_timeout',
36
- function($timeout) {
37
- $wpgform_options = wpgform_get_plugin_options() ;
38
- return $wpgform_options['http_request_timeout'] ;
39
- }) ;
40
- }
41
  }
42
 
43
  // Disable fsockopen transport?
@@ -60,6 +54,15 @@ if ($wpgform_options['local_ssl_verify'] == 1)
60
  if ($wpgform_options['ssl_verify'] == 1)
61
  add_filter('https_ssl_verify', '__return_false') ;
62
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Debug action to examine server variables
65
  *
31
  {
32
  if (is_int($wpgform_options['http_request_timeout_value'])
33
  || ctype_digit($wpgform_options['http_request_timeout_value']))
34
+ add_filter('http_request_timeout', 'wpgform_http_request_timeout') ;
 
 
 
 
 
 
35
  }
36
 
37
  // Disable fsockopen transport?
54
  if ($wpgform_options['ssl_verify'] == 1)
55
  add_filter('https_ssl_verify', '__return_false') ;
56
 
57
+ /**
58
+ * Optional filter to change HTTP Request Timeout
59
+ *
60
+ */
61
+ function wpgform_http_request_timeout($timeout) {
62
+ $wpgform_options = wpgform_get_plugin_options() ;
63
+ return $wpgform_options['http_request_timeout'] ;
64
+ }
65
+
66
  /**
67
  * Debug action to examine server variables
68
  *