Version Description
on July 5, 2021 =
- Fixed: Entries going to spam on websites that have plugins that override random password generation. Thanks, @thomascharbit!
Download this release
Release Info
Developer | gravityview |
Plugin | Gravity Forms Zero Spam |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.1.2
- gravityforms-zero-spam-form-settings.php +0 -81
- gravityforms-zero-spam.php +5 -42
- readme.txt +7 -57
gravityforms-zero-spam-form-settings.php
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! class_exists( 'GFForms' ) || ! is_callable( array( 'GFForms', 'include_addon_framework' ) ) ) {
|
4 |
-
return;
|
5 |
-
}
|
6 |
-
|
7 |
-
GFForms::include_addon_framework();
|
8 |
-
|
9 |
-
/**
|
10 |
-
* @since 1.2
|
11 |
-
*/
|
12 |
-
class GF_Zero_Spam_AddOn extends GFAddOn {
|
13 |
-
|
14 |
-
public function init() {
|
15 |
-
parent::init();
|
16 |
-
|
17 |
-
add_filter( 'gform_form_settings_fields', array( $this, 'add_settings_field' ), 10, 2 );
|
18 |
-
add_filter( 'gform_tooltips', array( $this, 'add_tooltip' ) );
|
19 |
-
|
20 |
-
// Adding at 20 priority so anyone filtering the default priority (10) will define the default, but the
|
21 |
-
// per-form setting may still _override_ the default.
|
22 |
-
add_filter( 'gf_zero_spam_check_key_field', array( $this, 'filter_gf_zero_spam_check_key_field' ), 20, 2 );
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Use per-form settings to determine whether to check for spam.
|
27 |
-
*
|
28 |
-
* @param bool $check_key_field
|
29 |
-
* @param array $form
|
30 |
-
*
|
31 |
-
* @return array|mixed
|
32 |
-
*/
|
33 |
-
public function filter_gf_zero_spam_check_key_field( $check_key_field = true, $form = array() ) {
|
34 |
-
|
35 |
-
// The setting has been set, but it's not enabled.
|
36 |
-
if ( isset( $form['enableGFZeroSpam'] ) && empty( $form['enableGFZeroSpam'] ) ) {
|
37 |
-
return false;
|
38 |
-
}
|
39 |
-
|
40 |
-
return $check_key_field;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Include custom tooltip text for the Zero Spam setting in the Form Settings page
|
45 |
-
*
|
46 |
-
* @param array $tooltips Key/Value pair of tooltip/tooltip text
|
47 |
-
*
|
48 |
-
* @return array
|
49 |
-
*/
|
50 |
-
public function add_tooltip( $tooltips ) {
|
51 |
-
|
52 |
-
$tooltips['enableGFZeroSpam'] = esc_html__( 'Enable to fight spam using a simple, effective method that is more effective than the built-in anti-spam honeypot.', 'gf-zero-spam' );
|
53 |
-
|
54 |
-
return $tooltips;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Adds the Zero Spam field to the "Form Options" settings group in GF 2.5+
|
59 |
-
*
|
60 |
-
* @see https://docs.gravityforms.com/gform_form_settings_fields/
|
61 |
-
*
|
62 |
-
* @param array $fields Form Settings fields.
|
63 |
-
* @param array $form The current form
|
64 |
-
*
|
65 |
-
* @return array
|
66 |
-
*/
|
67 |
-
function add_settings_field( $fields, $form = array() ) {
|
68 |
-
|
69 |
-
$fields['form_options']['fields'][] = array(
|
70 |
-
'name' => 'enableGFZeroSpam',
|
71 |
-
'type' => 'toggle',
|
72 |
-
'label' => esc_html__( 'Prevent spam using Gravity Forms Zero Spam', 'gf-zero-spam' ),
|
73 |
-
'tooltip' => gform_tooltip( 'enableGFZeroSpam', '', true ),
|
74 |
-
'default_value' => apply_filters( 'gf_zero_spam_check_key_field', true, $form ),
|
75 |
-
);
|
76 |
-
|
77 |
-
return $fields;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
new GF_Zero_Spam_AddOn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gravityforms-zero-spam.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Gravity Forms Zero Spam
|
4 |
* Plugin URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=pluginuri
|
5 |
* Description: Enhance Gravity Forms to include effective anti-spam measures—without using a CAPTCHA.
|
6 |
-
* Version: 1.2
|
7 |
* Author: GravityView
|
8 |
* Author URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=authoruri
|
9 |
* License: GPL-2.0+
|
@@ -27,9 +27,6 @@ class GF_Zero_Spam {
|
|
27 |
* Instantiate the plugin on Gravity Forms loading
|
28 |
*/
|
29 |
public static function gform_loaded() {
|
30 |
-
|
31 |
-
include_once plugin_dir_path( __FILE__ ) . 'gravityforms-zero-spam-form-settings.php';
|
32 |
-
|
33 |
new self;
|
34 |
}
|
35 |
|
@@ -100,21 +97,6 @@ EOD;
|
|
100 |
*/
|
101 |
public function check_key_field( $is_spam = false, $form = array(), $entry = array() ) {
|
102 |
|
103 |
-
/**
|
104 |
-
* Modify whether to process this entry submission for spam.
|
105 |
-
*
|
106 |
-
* @since 1.2
|
107 |
-
*
|
108 |
-
* @param bool $should_check_key_field Whether the Zero Spam plugin should check for the existence and validity of the key field. Default: true.
|
109 |
-
* @param array $form The form currently being processed.
|
110 |
-
* @param array $entry The entry currently being processed.
|
111 |
-
*/
|
112 |
-
$should_check_key_field = gf_apply_filters( 'gf_zero_spam_check_key_field', rgar( $form, 'id' ), true, $form, $entry );
|
113 |
-
|
114 |
-
if( false === $should_check_key_field ) {
|
115 |
-
return $is_spam;
|
116 |
-
}
|
117 |
-
|
118 |
// This was not submitted using a web form; created using API
|
119 |
if ( ! did_action( 'gform_pre_submission' ) ) {
|
120 |
return $is_spam;
|
@@ -125,33 +107,14 @@ EOD;
|
|
125 |
return $is_spam;
|
126 |
}
|
127 |
|
128 |
-
if ( ! isset( $_POST['gf_zero_spam_key'] )
|
129 |
-
add_action( 'gform_entry_created', array( $this, 'add_entry_note' ) );
|
130 |
-
|
131 |
return true;
|
132 |
}
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Adds a note to the entry once the spam status is set (GF 2.4.18+).
|
139 |
-
*
|
140 |
-
* @since 1.1.3
|
141 |
-
*
|
142 |
-
* @param array $entry The entry data.
|
143 |
-
*/
|
144 |
-
public function add_entry_note( $entry ) {
|
145 |
-
|
146 |
-
if ( 'spam' !== rgar( $entry, 'status' ) ) {
|
147 |
-
return;
|
148 |
-
}
|
149 |
-
|
150 |
-
if ( ! method_exists( 'GFAPI', 'add_note' ) ) {
|
151 |
-
return;
|
152 |
}
|
153 |
|
154 |
-
|
155 |
}
|
156 |
-
|
157 |
}
|
3 |
* Plugin Name: Gravity Forms Zero Spam
|
4 |
* Plugin URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=pluginuri
|
5 |
* Description: Enhance Gravity Forms to include effective anti-spam measures—without using a CAPTCHA.
|
6 |
+
* Version: 1.1.2
|
7 |
* Author: GravityView
|
8 |
* Author URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=authoruri
|
9 |
* License: GPL-2.0+
|
27 |
* Instantiate the plugin on Gravity Forms loading
|
28 |
*/
|
29 |
public static function gform_loaded() {
|
|
|
|
|
|
|
30 |
new self;
|
31 |
}
|
32 |
|
97 |
*/
|
98 |
public function check_key_field( $is_spam = false, $form = array(), $entry = array() ) {
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
// This was not submitted using a web form; created using API
|
101 |
if ( ! did_action( 'gform_pre_submission' ) ) {
|
102 |
return $is_spam;
|
107 |
return $is_spam;
|
108 |
}
|
109 |
|
110 |
+
if ( ! isset( $_POST['gf_zero_spam_key'] ) ) {
|
|
|
|
|
111 |
return true;
|
112 |
}
|
113 |
|
114 |
+
if ( html_entity_decode( $_POST['gf_zero_spam_key'] ) !== $this->get_key() ) {
|
115 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
+
return $is_spam;
|
119 |
}
|
|
|
120 |
}
|
readme.txt
CHANGED
@@ -1,13 +1,12 @@
|
|
1 |
=== Gravity Forms Zero Spam ===
|
2 |
-
Contributors: gravityview
|
3 |
-
Tags: gravityforms, gravity forms, anti-spam, antispam, spam, spam-blocker, spambot, spammer, add-ons
|
4 |
Requires at least: 3.0.1
|
5 |
-
Tested up to: 5.8
|
6 |
Stable tag: trunk
|
7 |
Requires PHP: 5.2.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
Donate link: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=donate
|
11 |
|
12 |
Enhance your Gravity Forms to include anti-spam measures originally based on the work of David Walsh's "Zero Spam" technique.
|
13 |
|
@@ -15,31 +14,19 @@ Enhance your Gravity Forms to include anti-spam measures originally based on the
|
|
15 |
|
16 |
This Gravity Forms add-on blocks spam using a non-obtrusive anti-spam measure. There are no settings or configuration needed: all you need to do is activate the plugin!
|
17 |
|
18 |
-
### Is the Gravity Forms honeypot field not working for you? 🍯 🐝
|
19 |
-
|
20 |
-
Zero Spam is better than the Gravity Forms anti-spam honeypot field. If you're getting spammed, try this plugin.
|
21 |
-
|
22 |
-
### Use instead of reCaptcha
|
23 |
-
|
24 |
**reCaptcha is user-hostile!** Use this instead! Users don't need to click stoplights, crosswalks, or bicycles when you use this plugin to stop spam.
|
25 |
|
26 |
-
### Enable or disable per-form
|
27 |
-
|
28 |
-
If you only want the plugin for specific forms, that's possible! The plugin adds a simple "Prevent spam using Gravity Forms Zero Spam" setting to each form (requires Gravity Forms 2.5 or newer).
|
29 |
-
|
30 |
Requires [Gravity Forms](https://www.gravityforms.com/?partner_id=1210629&irgwc=1&utm_medium=affiliate&utm_campaign=1210629&utm_source=Katz%20Web%20Services%2C%20Inc.).
|
31 |
|
32 |
_Brought to you by [GravityView](https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=readme). We create essential Gravity Forms Add-Ons._
|
33 |
|
34 |
== Frequently Asked Questions ==
|
35 |
|
36 |
-
=
|
37 |
-
|
38 |
-
Yes! When this plugin marks an entry as spam, it prevents processing of any configured notifications and add-on feeds.
|
39 |
|
40 |
-
|
41 |
|
42 |
-
= Does this plugin work in combination with other CAPTCHAs
|
43 |
|
44 |
Yep, you can use this plugin in combination with all other spam-blocking plugins:
|
45 |
|
@@ -52,7 +39,7 @@ Yep, you can use this plugin in combination with all other spam-blocking plugins
|
|
52 |
- WP Armor
|
53 |
- fail2ban
|
54 |
|
55 |
-
Zero Spam will not interfere with the operation of those plugins.
|
56 |
|
57 |
= What version of Gravity Forms does this work with? =
|
58 |
|
@@ -62,49 +49,12 @@ This works with all Gravity Forms releases after v2.3 (released June 2017). The
|
|
62 |
|
63 |
No. For that, we recommend Ben Marshall‘s [WordPress Zero Spam plugin](https://wordpress.org/plugins/zero-spam/).
|
64 |
|
65 |
-
= How do I disable Zero Spam on specific forms? =
|
66 |
-
|
67 |
-
1. Go to the form
|
68 |
-
2. Click on Settings
|
69 |
-
3. Under Form Options, disable "Prevent spam using Gravity Forms Zero Spam". _Don't see the setting? This feature requires Gravity Forms 2.5 or newer._
|
70 |
-
4. Save the settings
|
71 |
-
|
72 |
-
New form submissions will not be checked using Zero Spam.
|
73 |
-
|
74 |
-
= I only want on sepecific forms. How do I disable Zero Spam by default? =
|
75 |
-
|
76 |
-
To disable by default, add this code to your site ([here's how](https://docs.gravityview.co/article/210-where-to-put-code-samples)):
|
77 |
-
|
78 |
-
`add_filter( 'gf_zero_spam_check_key_field', '__return_false' );`
|
79 |
-
|
80 |
-
Once you have added that code to your site:
|
81 |
-
|
82 |
-
1. Go to the form
|
83 |
-
2. Click on Settings
|
84 |
-
3. Under Form Options, enable "Prevent spam using Gravity Forms Zero Spam". _Don't see the setting? This feature requires Gravity Forms 2.5 or newer._
|
85 |
-
4. Save the settings
|
86 |
-
|
87 |
-
Now that form will use Zero Spam.
|
88 |
-
|
89 |
-
= Is this plugin PHP 7 and PHP 8 compatible? =
|
90 |
-
|
91 |
-
Yes.
|
92 |
-
|
93 |
= All entries are going to spam. What can I do? =
|
94 |
|
95 |
First, **de-activate and re-activate the plugin**. Then let us know on the support tab!
|
96 |
|
97 |
-
|
98 |
== Changelog ==
|
99 |
|
100 |
-
= 1.2 on December 10, 2021 =
|
101 |
-
|
102 |
-
* New! Added a per-form setting "Prevent spam using Gravity Forms Zero Spam" that enables or disables Gravity Forms Zero Spam from processing! [Check out the FAQ to learn how to use this setting](https://wordpress.org/plugins/gravity-forms-zero-spam/#faq-header). Note: this feature requires Gravity Forms 2.5 or newer.
|
103 |
-
|
104 |
-
= 1.1.3 on August 9, 2021 =
|
105 |
-
|
106 |
-
* Enhancement: Adds an entry note when an entry is marked as spam. Thanks to Gravity Forms for the enhancement!
|
107 |
-
|
108 |
= 1.1.2 on July 5, 2021 =
|
109 |
|
110 |
* Fixed: Entries going to spam on websites that have plugins that override random password generation. Thanks, @thomascharbit!
|
1 |
=== Gravity Forms Zero Spam ===
|
2 |
+
Contributors: gravityview, karpstrucking, supporthero
|
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: 5.8
|
6 |
Stable tag: trunk
|
7 |
Requires PHP: 5.2.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
10 |
|
11 |
Enhance your Gravity Forms to include anti-spam measures originally based on the work of David Walsh's "Zero Spam" technique.
|
12 |
|
14 |
|
15 |
This Gravity Forms add-on blocks spam using a non-obtrusive anti-spam measure. There are no settings or configuration needed: all you need to do is activate the plugin!
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
**reCaptcha is user-hostile!** Use this instead! Users don't need to click stoplights, crosswalks, or bicycles when you use this plugin to stop spam.
|
18 |
|
|
|
|
|
|
|
|
|
19 |
Requires [Gravity Forms](https://www.gravityforms.com/?partner_id=1210629&irgwc=1&utm_medium=affiliate&utm_campaign=1210629&utm_source=Katz%20Web%20Services%2C%20Inc.).
|
20 |
|
21 |
_Brought to you by [GravityView](https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=readme). We create essential Gravity Forms Add-Ons._
|
22 |
|
23 |
== Frequently Asked Questions ==
|
24 |
|
25 |
+
= Is this plugin PHP 7 and PHP 8 compatible? =
|
|
|
|
|
26 |
|
27 |
+
Yes.
|
28 |
|
29 |
+
= Does this plugin work in combination with other CAPTCHAs or spam blocker plugins? =
|
30 |
|
31 |
Yep, you can use this plugin in combination with all other spam-blocking plugins:
|
32 |
|
39 |
- WP Armor
|
40 |
- fail2ban
|
41 |
|
42 |
+
Zero Spam will not interfere with the operation of those plugins.
|
43 |
|
44 |
= What version of Gravity Forms does this work with? =
|
45 |
|
49 |
|
50 |
No. For that, we recommend Ben Marshall‘s [WordPress Zero Spam plugin](https://wordpress.org/plugins/zero-spam/).
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
= All entries are going to spam. What can I do? =
|
53 |
|
54 |
First, **de-activate and re-activate the plugin**. Then let us know on the support tab!
|
55 |
|
|
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
= 1.1.2 on July 5, 2021 =
|
59 |
|
60 |
* Fixed: Entries going to spam on websites that have plugins that override random password generation. Thanks, @thomascharbit!
|