WordPress Zero Spam - Version 4.9.6

Version Description

  • Fix - Gravity Forms not catching spam.
Download this release

Release Info

Developer bmarshall511
Plugin Icon 128x128 WordPress Zero Spam
Version 4.9.6
Comparing to
See all releases

Code changes from version 4.9.5 to 4.9.6

Files changed (4) hide show
  1. inc/admin.php +1 -1
  2. inc/helpers.php +1 -1
  3. readme.txt +5 -1
  4. wordpress-zero-spam.php +8 -3
inc/admin.php CHANGED
@@ -428,7 +428,7 @@ function wpzerospam_admin_init() {
428
  add_settings_field( 'cookie_expiration', __( 'Cookie Expiration', 'wpzerospam' ), 'wpzerospam_field_cb', 'wpzerospam', 'wpzerospam_general_settings', [
429
  'label_for' => 'cookie_expiration',
430
  'type' => 'number',
431
- 'desc' => 'Number of days until a user\'s cookie is expired. Helps boost site performance so blacklist API requests aren\'t sent each page visit. <strong>Minimum recommend is 7 days</strong>.',
432
  'class' => 'small-text',
433
  'placeholder' => '7',
434
  'suffix' => __( 'days', 'wpzerospam' )
428
  add_settings_field( 'cookie_expiration', __( 'Cookie Expiration', 'wpzerospam' ), 'wpzerospam_field_cb', 'wpzerospam', 'wpzerospam_general_settings', [
429
  'label_for' => 'cookie_expiration',
430
  'type' => 'number',
431
+ 'desc' => 'Number of days until a user\'s cookie is expired. Helps boost site performance so access & blacklist checks aren\'t sent each page visit. <strong>Minimum recommend is 7 days</strong>.',
432
  'class' => 'small-text',
433
  'placeholder' => '7',
434
  'suffix' => __( 'days', 'wpzerospam' )
inc/helpers.php CHANGED
@@ -711,7 +711,7 @@ if ( ! function_exists( 'wpzerospam_plugin_integration_enabled' ) ) {
711
 
712
  $integrations = [
713
  'cf7' => 'contact-form-7/wp-contact-form-7.php',
714
- 'gforms' => 'gravityforms/gravityforms.php',
715
  'fluentform' => 'fluentform/fluentform.php',
716
  'wpforms' => [ 'wpforms/wpforms.php', 'wpforms-lite/wpforms.php' ],
717
  'formidable' => 'formidable/formidable.php',
711
 
712
  $integrations = [
713
  'cf7' => 'contact-form-7/wp-contact-form-7.php',
714
+ 'gform' => 'gravityforms/gravityforms.php',
715
  'fluentform' => 'fluentform/fluentform.php',
716
  'wpforms' => [ 'wpforms/wpforms.php', 'wpforms-lite/wpforms.php' ],
717
  'formidable' => 'formidable/formidable.php',
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://benmarshall.me/donate/?utm_source=wordpress_zero_spam&utm_m
5
  Requires at least: 5.2
6
  Tested up to: 5.4.2
7
  Requires PHP: 7.1
8
- Stable tag: 4.9.5
9
  License: GNU GPLv3
10
  License URI: https://choosealicense.com/licenses/gpl-3.0/
11
 
@@ -118,6 +118,10 @@ Yes. It does not store any kind of personally identifiable information. Only one
118
 
119
  == Changelog ==
120
 
 
 
 
 
121
  = 4.9.5 =
122
 
123
  * Enhancement - Added the *BotScout Count Minimum* field in settings to allow sites to control when a BotScout result should be marked spam/malicious. See [BotScout's documentation](https://botscout.com/api.htm) for more information.
5
  Requires at least: 5.2
6
  Tested up to: 5.4.2
7
  Requires PHP: 7.1
8
+ Stable tag: 4.9.6
9
  License: GNU GPLv3
10
  License URI: https://choosealicense.com/licenses/gpl-3.0/
11
 
118
 
119
  == Changelog ==
120
 
121
+ = 4.9.6 =
122
+
123
+ * Fix - Gravity Forms not catching spam.
124
+
125
  = 4.9.5 =
126
 
127
  * Enhancement - Added the *BotScout Count Minimum* field in settings to allow sites to control when a BotScout result should be marked spam/malicious. See [BotScout's documentation](https://botscout.com/api.htm) for more information.
wordpress-zero-spam.php CHANGED
@@ -13,7 +13,7 @@
13
  * Plugin Name: WordPress Zero Spam
14
  * Plugin URI: https://benmarshall.me/wordpress-zero-spam
15
  * Description: Tired of all the useless and bloated WordPress spam plugins? The WordPress Zero Spam plugin makes blocking spam a cinch. <strong>Just install, activate and say goodbye to spam.</strong> Based on work by <a href="http://davidwalsh.name/wordpress-comment-spam" target="_blank">David Walsh</a>.
16
- * Version: 4.9.5
17
  * Requires at least: 5.2
18
  * Requires PHP: 7.2
19
  * Author: Ben Marshall
@@ -31,7 +31,7 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
31
  // Define plugin constants
32
  define( 'WORDPRESS_ZERO_SPAM', __FILE__ );
33
  define( 'WORDPRESS_ZERO_SPAM_DB_VERSION', '0.5' );
34
- define( 'WORDPRESS_ZERO_SPAM_VERSION', '4.9.5' );
35
 
36
  /**
37
  * Utility helper functions
@@ -147,7 +147,7 @@ if ( wpzerospam_plugin_integration_enabled( 'cf7' ) ) {
147
  require plugin_dir_path( WORDPRESS_ZERO_SPAM ) . 'integrations/contact-form-7/contact-form-7.php';
148
  }
149
 
150
- if ( wpzerospam_plugin_integration_enabled( 'gforms' ) ) {
151
  require plugin_dir_path( WORDPRESS_ZERO_SPAM ) . 'integrations/gravity-forms/gravity-forms.php';
152
  }
153
 
@@ -172,6 +172,9 @@ if ( wpzerospam_plugin_integration_enabled( 'formidable' ) ) {
172
  */
173
  if ( ! function_exists( 'wpzerospam_template_redirect' ) ) {
174
  function wpzerospam_template_redirect() {
 
 
 
175
  $options = wpzerospam_options();
176
 
177
  // Check if the current user has access to the site
@@ -179,6 +182,8 @@ if ( ! function_exists( 'wpzerospam_template_redirect' ) ) {
179
 
180
  if ( ! $access['access'] ) {
181
  wpzerospam_attempt_blocked( $access['ip'], $access['reason'] );
 
 
182
  }
183
  }
184
  }
13
  * Plugin Name: WordPress Zero Spam
14
  * Plugin URI: https://benmarshall.me/wordpress-zero-spam
15
  * Description: Tired of all the useless and bloated WordPress spam plugins? The WordPress Zero Spam plugin makes blocking spam a cinch. <strong>Just install, activate and say goodbye to spam.</strong> Based on work by <a href="http://davidwalsh.name/wordpress-comment-spam" target="_blank">David Walsh</a>.
16
+ * Version: 4.9.6
17
  * Requires at least: 5.2
18
  * Requires PHP: 7.2
19
  * Author: Ben Marshall
31
  // Define plugin constants
32
  define( 'WORDPRESS_ZERO_SPAM', __FILE__ );
33
  define( 'WORDPRESS_ZERO_SPAM_DB_VERSION', '0.5' );
34
+ define( 'WORDPRESS_ZERO_SPAM_VERSION', '4.9.6' );
35
 
36
  /**
37
  * Utility helper functions
147
  require plugin_dir_path( WORDPRESS_ZERO_SPAM ) . 'integrations/contact-form-7/contact-form-7.php';
148
  }
149
 
150
+ if ( wpzerospam_plugin_integration_enabled( 'gform' ) ) {
151
  require plugin_dir_path( WORDPRESS_ZERO_SPAM ) . 'integrations/gravity-forms/gravity-forms.php';
152
  }
153
 
172
  */
173
  if ( ! function_exists( 'wpzerospam_template_redirect' ) ) {
174
  function wpzerospam_template_redirect() {
175
+ // No need to check everytime a user visits a page
176
+ if ( wpzerospam_get_cookie( 'last_check' ) ) { return false; }
177
+
178
  $options = wpzerospam_options();
179
 
180
  // Check if the current user has access to the site
182
 
183
  if ( ! $access['access'] ) {
184
  wpzerospam_attempt_blocked( $access['ip'], $access['reason'] );
185
+ } else {
186
+ wpzerospam_set_cookie( 'last_check', current_time( 'timestamp' ) );
187
  }
188
  }
189
  }