WordPress Zero Spam - Version 5.0.10

Version Description

Download this release

Release Info

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

Code changes from version 5.0.9 to 5.0.10

core/class-utilities.php CHANGED
@@ -385,10 +385,7 @@ class Utilities {
385
  }
386
 
387
  /**
388
- * Remote get.
389
- *
390
- * @since 5.0.0
391
- * @access public
392
  */
393
  public static function remote_get( $endpoint, $args = array() ) {
394
  $response = wp_remote_get( $endpoint, $args );
385
  }
386
 
387
  /**
388
+ * Remote get
 
 
 
389
  */
390
  public static function remote_get( $endpoint, $args = array() ) {
391
  $response = wp_remote_get( $endpoint, $args );
includes/class-plugin.php CHANGED
@@ -135,9 +135,9 @@ class Plugin {
135
  new FluentForms();
136
  }*/
137
 
 
138
  new StopForumSpam();
139
  new ipstack();
140
- new Zero_Spam();
141
 
142
  if (
143
  ! is_admin() &&
135
  new FluentForms();
136
  }*/
137
 
138
+ new Zero_Spam();
139
  new StopForumSpam();
140
  new ipstack();
 
141
 
142
  if (
143
  ! is_admin() &&
modules/class-ipstack.php CHANGED
@@ -13,16 +13,11 @@ use ZeroSpam;
13
  defined( 'ABSPATH' ) || die();
14
 
15
  /**
16
- * ipstack.
17
- *
18
- * @since 5.0.0
19
  */
20
  class ipstack {
21
  /**
22
- * ipstack constructor.
23
- *
24
- * @since 5.0.0
25
- * @access public
26
  */
27
  public function __construct() {
28
  add_filter( 'zerospam_setting_sections', array( $this, 'sections' ) );
@@ -31,10 +26,7 @@ class ipstack {
31
  }
32
 
33
  /**
34
- * ipstack sections.
35
- *
36
- * @since 5.0.0
37
- * @access public
38
  */
39
  public function sections( $sections ) {
40
  $sections['ipstack'] = array(
@@ -45,10 +37,7 @@ class ipstack {
45
  }
46
 
47
  /**
48
- * Botscout settings.
49
- *
50
- * @since 5.0.0
51
- * @access public
52
  */
53
  public function settings( $settings ) {
54
  $options = get_option( 'wpzerospam' );
@@ -103,10 +92,7 @@ class ipstack {
103
  }
104
 
105
  /**
106
- * Log record filter.
107
- *
108
- * @since 5.0.0
109
- * @access public
110
  */
111
  public static function log_record( $record ) {
112
  $location = self::get_geolocation( ZeroSpam\Core\User::get_ip() );
@@ -148,10 +134,7 @@ class ipstack {
148
  }
149
 
150
  /**
151
- * Get geolocation.
152
- *
153
- * @since 5.0.0
154
- * @access public
155
  */
156
  public static function get_geolocation( $ip ) {
157
  $settings = ZeroSpam\Core\Settings::get_settings();
13
  defined( 'ABSPATH' ) || die();
14
 
15
  /**
16
+ * ipstack
 
 
17
  */
18
  class ipstack {
19
  /**
20
+ * Constructor
 
 
 
21
  */
22
  public function __construct() {
23
  add_filter( 'zerospam_setting_sections', array( $this, 'sections' ) );
26
  }
27
 
28
  /**
29
+ * Sections
 
 
 
30
  */
31
  public function sections( $sections ) {
32
  $sections['ipstack'] = array(
37
  }
38
 
39
  /**
40
+ * Settings
 
 
 
41
  */
42
  public function settings( $settings ) {
43
  $options = get_option( 'wpzerospam' );
92
  }
93
 
94
  /**
95
+ * Log record filter
 
 
 
96
  */
97
  public static function log_record( $record ) {
98
  $location = self::get_geolocation( ZeroSpam\Core\User::get_ip() );
134
  }
135
 
136
  /**
137
+ * Get geolocation
 
 
 
138
  */
139
  public static function get_geolocation( $ip ) {
140
  $settings = ZeroSpam\Core\Settings::get_settings();
modules/class-zerospam.php CHANGED
@@ -27,6 +27,9 @@ class Zero_Spam {
27
  * Constructor
28
  */
29
  public function __construct() {
 
 
 
30
  // Fires when a user is blocked from accessing the site.
31
  add_action( 'zerospam_share_blocked', array( $this, 'share_blocked' ), 10, 1 );
32
 
@@ -34,6 +37,125 @@ class Zero_Spam {
34
  add_action( 'zerospam_share_detection', array( $this, 'share_detection' ), 10, 1 );
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /**
38
  * Global API data.
39
  */
27
  * Constructor
28
  */
29
  public function __construct() {
30
+ add_filter( 'zerospam_setting_sections', array( $this, 'sections' ) );
31
+ add_filter( 'zerospam_settings', array( $this, 'settings' ) );
32
+
33
  // Fires when a user is blocked from accessing the site.
34
  add_action( 'zerospam_share_blocked', array( $this, 'share_blocked' ), 10, 1 );
35
 
37
  add_action( 'zerospam_share_detection', array( $this, 'share_detection' ), 10, 1 );
38
  }
39
 
40
+ /**
41
+ * Sections
42
+ */
43
+ public function sections( $sections ) {
44
+ $sections['zerospam'] = array(
45
+ 'title' => __( 'Zero Spam Integration', 'zerospam' ),
46
+ );
47
+
48
+ return $sections;
49
+ }
50
+
51
+ /**
52
+ * Settings
53
+ */
54
+ public function settings( $settings ) {
55
+ $options = get_option( 'wpzerospam' );
56
+
57
+ $settings['zerospam'] = array(
58
+ 'title' => __( 'Zero Spam', 'zerospam' ),
59
+ 'section' => 'zerospam',
60
+ 'type' => 'checkbox',
61
+ 'options' => array(
62
+ 'enabled' => __( 'Enabled', 'zerospam' ),
63
+ ),
64
+ 'desc' => sprintf(
65
+ wp_kses(
66
+ __( 'Checks user IPs & submissions against <a href="%s" target="_blank" rel="noopener noreferrer">Zero Spam</a>\'s blacklist.', 'zerospam' ),
67
+ array(
68
+ 'strong' => array(),
69
+ 'a' => array(
70
+ 'target' => array(),
71
+ 'href' => array(),
72
+ 'rel' => array(),
73
+ ),
74
+ )
75
+ ),
76
+ esc_url( 'https://www.zerospam.org/#utm_source=wordpresszerospam&utm_medium=admin_link&utm_campaign=wordpresszerospam' )
77
+ ),
78
+ 'value' => ! empty( $options['zerospam'] ) ? $options['zerospam'] : false,
79
+ 'recommended' => 'enabled',
80
+ );
81
+
82
+ $settings['zerospam_license'] = array(
83
+ 'title' => __( 'Zero Spam License Key', 'zerospam' ),
84
+ 'desc' => sprintf(
85
+ wp_kses(
86
+ __( 'Enter your <a href="%1$s" target="_blank" rel="noopener noreferrer">Zero Spam license key</a> to enable enhanced premium protection. Don\'t have an license key? <a href="%2$s" target="_blank" rel="noopener noreferrer"><strong>Get one now!</strong></a>', 'zerospam' ),
87
+ array(
88
+ 'strong' => array(),
89
+ 'a' => array(
90
+ 'target' => array(),
91
+ 'href' => array(),
92
+ 'rel' => array(),
93
+ ),
94
+ )
95
+ ),
96
+ esc_url( 'https://www.zerospam.org/' ),
97
+ esc_url( 'https://www.zerospam.org/product/premium/' )
98
+ ),
99
+ 'section' => 'zerospam',
100
+ 'type' => 'text',
101
+ 'field_class' => 'regular-text',
102
+ 'placeholder' => __( 'Enter your Zero Spam license key.', 'zerospam' ),
103
+ 'value' => ! empty( $options['zerospam_license'] ) ? $options['zerospam_license'] : false,
104
+ );
105
+
106
+ $settings['zerospam_timeout'] = array(
107
+ 'title' => __( 'Zero Spam API Timeout', 'zerospam' ),
108
+ 'section' => 'zerospam',
109
+ 'type' => 'number',
110
+ 'field_class' => 'small-text',
111
+ 'suffix' => __( 'seconds', 'zerospam' ),
112
+ 'placeholder' => __( '5', 'zerospam' ),
113
+ 'min' => 0,
114
+ 'desc' => __( 'Recommended setting is 5 seconds. Setting to high could result in degraded site performance, too low won\'t allow to API enough time to respond.', 'zerospam' ),
115
+ 'value' => ! empty( $options['zerospam_timeout'] ) ? $options['zerospam_timeout'] : 5,
116
+ );
117
+
118
+ $settings['zerospam_cache'] = array(
119
+ 'title' => __( 'Zero Spam Cache Expiration', 'zerospam' ),
120
+ 'section' => 'zerospam',
121
+ 'type' => 'number',
122
+ 'field_class' => 'small-text',
123
+ 'suffix' => __( 'day(s)', 'zerospam' ),
124
+ 'placeholder' => __( WEEK_IN_SECONDS, 'zerospam' ),
125
+ 'min' => 0,
126
+ 'desc' => __( 'Recommended setting is 14 days. Setting to high could result in outdated information, too low could cause a decrease in performance.', 'zerospam' ),
127
+ 'value' => ! empty( $options['zerospam_cache'] ) ? $options['zerospam_cache'] : 14,
128
+ );
129
+
130
+ $settings['zerospam_confidence_min'] = array(
131
+ 'title' => __( 'Zero Spam Confidence Minimum', 'zerospam' ),
132
+ 'section' => 'zerospam',
133
+ 'type' => 'number',
134
+ 'field_class' => 'small-text',
135
+ 'suffix' => __( '%', 'zerospam' ),
136
+ 'placeholder' => __( '30', 'zerospam' ),
137
+ 'min' => 0,
138
+ 'max' => 100,
139
+ 'step' => 0.1,
140
+ 'desc' => sprintf(
141
+ wp_kses(
142
+ __( 'Recommended setting is 20%%. Minimum <a href="%s" target="_blank" rel="noopener noreferrer">confidence score</a> an IP must meet before being blocked. Setting this too low could cause users to be blocked that shouldn\'t be.', 'zerospam' ),
143
+ array(
144
+ 'a' => array(
145
+ 'target' => array(),
146
+ 'href' => array(),
147
+ 'rel' => array(),
148
+ ),
149
+ )
150
+ ),
151
+ esc_url( 'https://www.zerospam.org/spam-blacklist-api/#utm_source=wordpresszerospam&utm_medium=admin_link&utm_campaign=wordpresszerospam' )
152
+ ),
153
+ 'value' => ! empty( $options['zerospam_confidence_min'] ) ? $options['zerospam_confidence_min'] : 30,
154
+ );
155
+
156
+ return $settings;
157
+ }
158
+
159
  /**
160
  * Global API data.
161
  */
modules/comments/class-comments.php CHANGED
@@ -28,7 +28,6 @@ class Comments {
28
  if ( 'enabled' === ZeroSpam\Core\Settings::get_settings( 'verify_comments' ) && ZeroSpam\Core\Access::process() ) {
29
  add_filter( 'comment_form_defaults', array( $this, 'honeypot' ) );
30
  add_action( 'preprocess_comment', array( $this, 'preprocess_comments' ) );
31
- add_action( 'comment_form_before_fields', array( $this, 'enqueue_davidwalsh' ) );
32
  }
33
  }
34
 
28
  if ( 'enabled' === ZeroSpam\Core\Settings::get_settings( 'verify_comments' ) && ZeroSpam\Core\Access::process() ) {
29
  add_filter( 'comment_form_defaults', array( $this, 'honeypot' ) );
30
  add_action( 'preprocess_comment', array( $this, 'preprocess_comments' ) );
 
31
  }
32
  }
33
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.benmarshall.me/donate/?utm_source=wordpress_zero_spam&u
5
  Requires at least: 5.2
6
  Tested up to: 5.6.2
7
  Requires PHP: 7.3
8
- Stable tag: 5.0.9
9
  License: GNU GPLv3
10
  License URI: https://choosealicense.com/licenses/gpl-3.0/
11
 
@@ -73,6 +73,10 @@ For more information & developer documentation, see the [plugin’s website](htt
73
 
74
  == Changelog ==
75
 
 
 
 
 
76
  = v5.0.9 =
77
 
78
  * Performance enhancements
5
  Requires at least: 5.2
6
  Tested up to: 5.6.2
7
  Requires PHP: 7.3
8
+ Stable tag: 5.0.10
9
  License: GNU GPLv3
10
  License URI: https://choosealicense.com/licenses/gpl-3.0/
11
 
73
 
74
  == Changelog ==
75
 
76
+ = v5.0.10 =
77
+
78
+ * PHP notice fix
79
+
80
  = v5.0.9 =
81
 
82
  * Performance enhancements
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>.
16
- * Version: 5.0.9
17
  * Requires at least: 5.2
18
  * Requires PHP: 7.3
19
  * Author: Ben Marshall
@@ -31,7 +31,7 @@ defined( 'ABSPATH' ) || die();
31
  define( 'ZEROSPAM', __FILE__ );
32
  define( 'ZEROSPAM_PATH', plugin_dir_path( ZEROSPAM ) );
33
  define( 'ZEROSPAM_PLUGIN_BASE', plugin_basename( ZEROSPAM ) );
34
- define( 'ZEROSPAM_VERSION', '5.0.9' );
35
 
36
  add_action( 'plugins_loaded', 'zerospam_load_plugin_textdomain' );
37
 
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>.
16
+ * Version: 5.0.10
17
  * Requires at least: 5.2
18
  * Requires PHP: 7.3
19
  * Author: Ben Marshall
31
  define( 'ZEROSPAM', __FILE__ );
32
  define( 'ZEROSPAM_PATH', plugin_dir_path( ZEROSPAM ) );
33
  define( 'ZEROSPAM_PLUGIN_BASE', plugin_basename( ZEROSPAM ) );
34
+ define( 'ZEROSPAM_VERSION', '5.0.10' );
35
 
36
  add_action( 'plugins_loaded', 'zerospam_load_plugin_textdomain' );
37