Gravity Forms Zero Spam - Version 1.0.1

Version Description

  • Fix issue with forms not submitting after an initial validation error
Download this release

Release Info

Developer karpstrucking
Plugin Icon 128x128 Gravity Forms Zero Spam
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

Files changed (2) hide show
  1. gravityforms-zero-spam.php +5 -5
  2. readme.txt +6 -4
gravityforms-zero-spam.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Gravity Forms Zero Spam
5
  * Plugin URI: http://www.gowp.com/plugins/gravityforms-zero-spam
6
  * Description: Enhance your Gravity Forms to include anti-spam measures originally based on the work of David Walsh's <a href="http://davidwalsh.name/wordpress-comment-spam">"Zero Spam"</a> technique.
7
- * Version: 1.0
8
  * Author: GoWP
9
  * Author URI: http://www.gowp.com
10
  * License: GPL-2.0+
@@ -26,7 +26,7 @@
26
  class GF_Zero_Spam {
27
  public function __construct() { // instantiation (is that a word?)
28
  add_action( 'wp_footer', array( $this, 'add_key_field' ) ); // add key injection JS to the bottom of the page
29
- add_filter( 'gform_validation', array( $this, 'check_key_field' ) ); // add our validation check to all forms
30
  }
31
  public function deactivate() { // plugin deactivation
32
  delete_option( 'gf_zero_spam_key' ); // remove the key
@@ -54,11 +54,11 @@
54
  </script>
55
  <?php
56
  }
57
- public function check_key_field( $result ) { // check for the key during validation
58
  if ( ! isset( $_POST['gf_zero_spam_key'] ) || ( $_POST['gf_zero_spam_key'] != $this->get_key() ) ) {
59
- $result['is_valid'] = false;
60
  }
61
- return $result;
62
  }
63
  }
64
 
4
  * Plugin Name: Gravity Forms Zero Spam
5
  * Plugin URI: http://www.gowp.com/plugins/gravityforms-zero-spam
6
  * Description: Enhance your Gravity Forms to include anti-spam measures originally based on the work of David Walsh's <a href="http://davidwalsh.name/wordpress-comment-spam">"Zero Spam"</a> technique.
7
+ * Version: 1.0.1
8
  * Author: GoWP
9
  * Author URI: http://www.gowp.com
10
  * License: GPL-2.0+
26
  class GF_Zero_Spam {
27
  public function __construct() { // instantiation (is that a word?)
28
  add_action( 'wp_footer', array( $this, 'add_key_field' ) ); // add key injection JS to the bottom of the page
29
+ add_filter( 'gform_entry_is_spam', array( $this, 'check_key_field' ) ); // add our validation check to all forms
30
  }
31
  public function deactivate() { // plugin deactivation
32
  delete_option( 'gf_zero_spam_key' ); // remove the key
54
  </script>
55
  <?php
56
  }
57
+ public function check_key_field( $is_spam ) { // check for the key during validation
58
  if ( ! isset( $_POST['gf_zero_spam_key'] ) || ( $_POST['gf_zero_spam_key'] != $this->get_key() ) ) {
59
+ return true;
60
  }
61
+ return false;
62
  }
63
  }
64
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: karpstrucking
3
  Tags: gravityforms, gravity forms, anti-spam, antispam, spam, spam-blocker, spambot, spammer, addons, add-ons
4
  Requires at least: 3.0.1
5
- Tested up to: 4.0
6
- Stable tag: 1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -13,8 +13,7 @@ Enhance your Gravity Forms to include anti-spam measures originally based on the
13
 
14
  Requires: Gravity Forms v1.5+
15
 
16
- This plugin adds a non-obtrusive anti-spam measure to all of your Gravity Forms. This measure is originally based on David
17
- Walsh's "Zero Spam" technique.
18
 
19
  == Installation ==
20
 
@@ -23,5 +22,8 @@ Walsh's "Zero Spam" technique.
23
 
24
  == Changelog ==
25
 
 
 
 
26
  = 1.0.0 =
27
  * Initial version
2
  Contributors: karpstrucking
3
  Tags: gravityforms, gravity forms, anti-spam, antispam, spam, spam-blocker, spambot, spammer, addons, add-ons
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.8
6
+ Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
13
 
14
  Requires: Gravity Forms v1.5+
15
 
16
+ This plugin adds a non-obtrusive anti-spam measure to all of your Gravity Forms. This measure is originally based on David Walsh's "Zero Spam" technique.
 
17
 
18
  == Installation ==
19
 
22
 
23
  == Changelog ==
24
 
25
+ = 1.0.1 =
26
+ * Fix issue with forms not submitting after an initial validation error
27
+
28
  = 1.0.0 =
29
  * Initial version