Version Description
on August 9, 2021 =
- Enhancement: Adds an entry note when an entry is marked as spam. Thanks to Gravity Forms for the enhancement!
Download this release
Release Info
Developer | gravityview |
Plugin | Gravity Forms Zero Spam |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.3
- gravityforms-zero-spam.php +25 -6
- readme.txt +14 -2
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.1.
|
7 |
* Author: GravityView
|
8 |
* Author URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=authoruri
|
9 |
* License: GPL-2.0+
|
@@ -40,7 +40,7 @@ class GF_Zero_Spam {
|
|
40 |
}
|
41 |
|
42 |
public function __construct() {
|
43 |
-
add_action( 'gform_register_init_scripts', array( $this, 'add_key_field' ) );
|
44 |
add_filter( 'gform_entry_is_spam', array( $this, 'check_key_field' ), 10, 3 );
|
45 |
}
|
46 |
|
@@ -107,14 +107,33 @@ EOD;
|
|
107 |
return $is_spam;
|
108 |
}
|
109 |
|
110 |
-
if ( ! isset( $_POST['gf_zero_spam_key'] ) ) {
|
111 |
-
|
112 |
-
}
|
113 |
|
114 |
-
if ( $_POST['gf_zero_spam_key'] !== $this->get_key() ) {
|
115 |
return true;
|
116 |
}
|
117 |
|
118 |
return $is_spam;
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
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.3
|
7 |
* Author: GravityView
|
8 |
* Author URI: https://gravityview.co?utm_source=plugin&utm_campaign=zero-spam&utm_content=authoruri
|
9 |
* License: GPL-2.0+
|
40 |
}
|
41 |
|
42 |
public function __construct() {
|
43 |
+
add_action( 'gform_register_init_scripts', array( $this, 'add_key_field' ), 9999 );
|
44 |
add_filter( 'gform_entry_is_spam', array( $this, 'check_key_field' ), 10, 3 );
|
45 |
}
|
46 |
|
107 |
return $is_spam;
|
108 |
}
|
109 |
|
110 |
+
if ( ! isset( $_POST['gf_zero_spam_key'] ) || html_entity_decode( $_POST['gf_zero_spam_key'] ) !== $this->get_key() ) {
|
111 |
+
add_action( 'gform_entry_created', array( $this, 'add_entry_note' ) );
|
|
|
112 |
|
|
|
113 |
return true;
|
114 |
}
|
115 |
|
116 |
return $is_spam;
|
117 |
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Adds a note to the entry once the spam status is set (GF 2.4.18+).
|
121 |
+
*
|
122 |
+
* @since 1.1.3
|
123 |
+
*
|
124 |
+
* @param array $entry The entry data.
|
125 |
+
*/
|
126 |
+
public function add_entry_note( $entry ) {
|
127 |
+
|
128 |
+
if ( 'spam' !== rgar( $entry, 'status' ) ) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
|
132 |
+
if ( ! method_exists( 'GFAPI', 'add_note' ) ) {
|
133 |
+
return;
|
134 |
+
}
|
135 |
+
|
136 |
+
GFAPI::add_note( $entry['id'], 0, 'Zero Spam', __( 'This entry has been marked as spam.', 'gf-zero-spam' ), 'gf-zero-spam', 'success' );
|
137 |
+
}
|
138 |
+
|
139 |
}
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
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.
|
6 |
Stable tag: trunk
|
7 |
Requires PHP: 5.2.6
|
8 |
License: GPLv2 or later
|
@@ -22,7 +22,7 @@ _Brought to you by [GravityView](https://gravityview.co?utm_source=plugin&utm_ca
|
|
22 |
|
23 |
== Frequently Asked Questions ==
|
24 |
|
25 |
-
= Is this plugin PHP 7 compatible? =
|
26 |
|
27 |
Yes.
|
28 |
|
@@ -49,8 +49,20 @@ This works with all Gravity Forms releases after v2.3 (released June 2017). The
|
|
49 |
|
50 |
No. For that, we recommend Ben Marshall‘s [WordPress Zero Spam plugin](https://wordpress.org/plugins/zero-spam/).
|
51 |
|
|
|
|
|
|
|
|
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
= 1.1.1 on April 22, 2021 =
|
55 |
|
56 |
* Fixed: Script not being correctly loaded using Gravity Forms' inline JavaScript
|
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
|
22 |
|
23 |
== Frequently Asked Questions ==
|
24 |
|
25 |
+
= Is this plugin PHP 7 and PHP 8 compatible? =
|
26 |
|
27 |
Yes.
|
28 |
|
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.3 on August 9, 2021 =
|
59 |
+
|
60 |
+
* Enhancement: Adds an entry note when an entry is marked as spam. Thanks to Gravity Forms for the enhancement!
|
61 |
+
|
62 |
+
= 1.1.2 on July 5, 2021 =
|
63 |
+
|
64 |
+
* Fixed: Entries going to spam on websites that have plugins that override random password generation. Thanks, @thomascharbit!
|
65 |
+
|
66 |
= 1.1.1 on April 22, 2021 =
|
67 |
|
68 |
* Fixed: Script not being correctly loaded using Gravity Forms' inline JavaScript
|