Google Forms - Version 0.66

Version Description

No known upgrade issues.

Download this release

Release Info

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

Code changes from version 0.65 to 0.66

Files changed (5) hide show
  1. index.php +3 -3
  2. readme.txt +6 -1
  3. wpgform-core.php +2 -2
  4. wpgform-options.php +1 -1
  5. wpgform-post-type.php +9 -2
index.php CHANGED
@@ -4,8 +4,8 @@
4
  * Plugin Name: Google Forms
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.65
8
- * Build: 0.65.$WCREV$
9
  * Last Modified: $WCDATE$
10
  * Author: Mike Walsh
11
  * Author URI: http://www.michaelwalsh.org
@@ -25,7 +25,7 @@
25
  *
26
  */
27
 
28
- define('WPGFORM_VERSION', '0.65') ;
29
 
30
  require_once('wpgform-core.php') ;
31
  require_once('wpgform-post-type.php') ;
4
  * Plugin Name: Google Forms
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.66
8
+ * Build: 0.66.$WCREV$
9
  * Last Modified: $WCDATE$
10
  * Author: Mike Walsh
11
  * Author URI: http://www.michaelwalsh.org
25
  *
26
  */
27
 
28
+ define('WPGFORM_VERSION', '0.66') ;
29
 
30
  require_once('wpgform-core.php') ;
31
  require_once('wpgform-post-type.php') ;
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.7.1
6
  Tested up to: 3.8.3
7
- Stable tag: 0.65
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -381,6 +381,11 @@ No known upgrade issues.
381
 
382
  == Change log ==
383
 
 
 
 
 
 
384
  = Version 0.65 =
385
  * Implemented "save_post" for custom post type eliminating general purpose "save_post" (only option prior to WordPress 3.7) action which could potentially, if not handled correctly by another plugin, corrupt post data.
386
  * Formally __deprecated__ the `gform` shortcode by updating README file.
4
  Tags: Google Forms, Google Docs, Google, Spreadsheet, shortcode, forms
5
  Requires at least: 3.7.1
6
  Tested up to: 3.8.3
7
+ Stable tag: 0.66
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
381
 
382
  == Change log ==
383
 
384
+ = Version 0.66 =
385
+ * Moved hygiene out of init hook into admin_init hook so it won't run on every page load. Resolves conflict with WordPress SEO.
386
+ * Fixed hygiene to only update post content when it isn't what is expected.
387
+ * Fixed bug which caused all form submissions to be logged regardless of plugin setting.
388
+
389
  = Version 0.65 =
390
  * Implemented "save_post" for custom post type eliminating general purpose "save_post" (only option prior to WordPress 3.7) action which could potentially, if not handled correctly by another plugin, corrupt post data.
391
  * Formally __deprecated__ the `gform` shortcode by updating README file.
wpgform-core.php CHANGED
@@ -301,6 +301,7 @@ function wpgform_entry_log_page()
301
  function wpgform_admin_init()
302
  {
303
  register_setting('wpgform_options', 'wpgform_options', 'wpgform_options_validate') ;
 
304
  }
305
 
306
  /**
@@ -1445,7 +1446,6 @@ jQuery(document).ready(function($) {
1445
  ($style === WPGFORM_CONFIRM_AJAX) && !self::$post_error)
1446
  {
1447
  $js .= PHP_EOL . ' // Confirmation page by AJAX page load' ;
1448
- $js .= PHP_EOL . 'alert("here");' ;
1449
  //$js .= PHP_EOL . ' $("body").load("' . $confirm . ' body") ;' ;
1450
  $js .= PHP_EOL . ' $.get( "' . $confirm . '", function( data ) {
1451
  $( ".result" ).html( data );
@@ -1548,7 +1548,7 @@ jQuery(document).ready(function($) {
1548
  $html = $onetime_html . $html ;
1549
 
1550
  // Log form submission?
1551
- if (self::$posted && is_null($action))
1552
  {
1553
  $unknown = __('Unknown', WPGFORM_I18N_DOMAIN) ;
1554
 
301
  function wpgform_admin_init()
302
  {
303
  register_setting('wpgform_options', 'wpgform_options', 'wpgform_options_validate') ;
304
+ wpgform_routine_maintenance() ;
305
  }
306
 
307
  /**
1446
  ($style === WPGFORM_CONFIRM_AJAX) && !self::$post_error)
1447
  {
1448
  $js .= PHP_EOL . ' // Confirmation page by AJAX page load' ;
 
1449
  //$js .= PHP_EOL . ' $("body").load("' . $confirm . ' body") ;' ;
1450
  $js .= PHP_EOL . ' $.get( "' . $confirm . '", function( data ) {
1451
  $( ".result" ).html( data );
1548
  $html = $onetime_html . $html ;
1549
 
1550
  // Log form submission?
1551
+ if (self::$posted && is_null($action) && $wpgform_options['form_submission_log'] == 1)
1552
  {
1553
  $unknown = __('Unknown', WPGFORM_I18N_DOMAIN) ;
1554
 
wpgform-options.php CHANGED
@@ -206,7 +206,7 @@ function wpgform_options_page()
206
  function wpgform_settings_input()
207
  {
208
  $wpgform_options = wpgform_get_plugin_options() ;
209
- error_log(print_r($wpgform_options, true)) ;
210
  ?>
211
  <table class="form-table">
212
  <tr valign="top">
206
  function wpgform_settings_input()
207
  {
208
  $wpgform_options = wpgform_get_plugin_options() ;
209
+ //error_log(print_r($wpgform_options, true)) ;
210
  ?>
211
  <table class="form-table">
212
  <tr valign="top">
wpgform-post-type.php CHANGED
@@ -59,7 +59,12 @@ function wpgform_register_post_types()
59
 
60
  // Register the WordPress Google Form post type
61
  register_post_type(WPGFORM_CPT_FORM, $wpgform_args) ;
 
62
 
 
 
 
 
63
  // Post type is registered, do some hygiene on any that exist in the database.
64
  // Insert the "wpgform" shortcode for that post into the post content. This
65
  // ensures the form will be displayed properly when viewed through the CPT URL.
@@ -73,8 +78,10 @@ function wpgform_register_post_types()
73
 
74
  while ($loop->have_posts()) :
75
  $loop->the_post() ;
76
- wp_update_post(array('ID' => get_the_ID(),
77
- 'post_content' => sprintf('[wpgform id=\'%d\']', get_the_ID()))) ;
 
 
78
  endwhile ;
79
 
80
  // re-hook this function
59
 
60
  // Register the WordPress Google Form post type
61
  register_post_type(WPGFORM_CPT_FORM, $wpgform_args) ;
62
+ }
63
 
64
+ /** Perform routine maintenance */
65
+ function wpgform_routine_maintenance()
66
+ {
67
+ error_log(sprintf('%s::%s (init)', basename(__FILE__), __LINE__)) ;
68
  // Post type is registered, do some hygiene on any that exist in the database.
69
  // Insert the "wpgform" shortcode for that post into the post content. This
70
  // ensures the form will be displayed properly when viewed through the CPT URL.
78
 
79
  while ($loop->have_posts()) :
80
  $loop->the_post() ;
81
+ $content = sprintf('[wpgform id=\'%d\']', get_the_ID()) ;
82
+
83
+ if ($content !== get_the_content())
84
+ wp_update_post(array('ID' => get_the_ID(), $content)) ;
85
  endwhile ;
86
 
87
  // re-hook this function