Version Description
Download this release
Release Info
Developer | bmarshall511 |
Plugin | WordPress Zero Spam |
Version | 5.2.3 |
Comparing to | |
See all releases |
Code changes from version 5.2.2 to 5.2.3
- assets/css/admin.css +7 -1
- assets/img/icon-givewp.png +0 -0
- core/class-access.php +2 -2
- core/class-settings.php +1 -1
- core/class-utilities.php +2 -2
- includes/class-plugin.php +4 -0
- modules/fluentforms/class-fluentforms.php +1 -1
- modules/give/class-give.php +170 -0
- readme.txt +9 -4
- wordpress-zero-spam.php +2 -2
assets/css/admin.css
CHANGED
@@ -240,7 +240,8 @@
|
|
240 |
.zerospam-type-comment::before,
|
241 |
.zerospam-type-fluent_form::before,
|
242 |
.zerospam-type-wpforms::before,
|
243 |
-
.zerospam-type-contactform7::before
|
|
|
244 |
background-repeat: no-repeat;
|
245 |
background-size: contain;
|
246 |
content: "";
|
@@ -282,6 +283,11 @@
|
|
282 |
background-image: url('../img/icon-cf7.png');
|
283 |
}
|
284 |
|
|
|
|
|
|
|
|
|
|
|
285 |
@media (min-width: 768px) {
|
286 |
.zerospam-callout {
|
287 |
flex-wrap: nowrap;
|
240 |
.zerospam-type-comment::before,
|
241 |
.zerospam-type-fluent_form::before,
|
242 |
.zerospam-type-wpforms::before,
|
243 |
+
.zerospam-type-contactform7::before,
|
244 |
+
.zerospam-type-givewp::before {
|
245 |
background-repeat: no-repeat;
|
246 |
background-size: contain;
|
247 |
content: "";
|
283 |
background-image: url('../img/icon-cf7.png');
|
284 |
}
|
285 |
|
286 |
+
/* Type gicewp */
|
287 |
+
.zerospam-type-givewp::before {
|
288 |
+
background-image: url('../img/icon-givewp.png');
|
289 |
+
}
|
290 |
+
|
291 |
@media (min-width: 768px) {
|
292 |
.zerospam-callout {
|
293 |
flex-wrap: nowrap;
|
assets/img/icon-givewp.png
ADDED
Binary file
|
core/class-access.php
CHANGED
@@ -84,13 +84,13 @@ class Access {
|
|
84 |
header( 'Pragma: no-cache' );
|
85 |
header( 'Expires: 0' );
|
86 |
|
87 |
-
$message = __( 'Your IP address has been blocked
|
88 |
if ( ! empty( $settings['blocked_message']['value'] ) ) {
|
89 |
$message = $settings['blocked_message']['value'];
|
90 |
}
|
91 |
wp_die(
|
92 |
$message,
|
93 |
-
__( 'Blocked
|
94 |
array(
|
95 |
'response' => 403,
|
96 |
)
|
84 |
header( 'Pragma: no-cache' );
|
85 |
header( 'Expires: 0' );
|
86 |
|
87 |
+
$message = __( 'Your IP address has been blocked due to detected spam/malicious activity.', 'zerospam' );
|
88 |
if ( ! empty( $settings['blocked_message']['value'] ) ) {
|
89 |
$message = $settings['blocked_message']['value'];
|
90 |
}
|
91 |
wp_die(
|
92 |
$message,
|
93 |
+
__( 'Blocked', 'zerospam' ),
|
94 |
array(
|
95 |
'response' => 403,
|
96 |
)
|
core/class-settings.php
CHANGED
@@ -236,7 +236,7 @@ class Settings {
|
|
236 |
'recommended' => 'php',
|
237 |
);
|
238 |
|
239 |
-
$message = __( 'Your IP address has been blocked
|
240 |
|
241 |
self::$settings['blocked_message'] = array(
|
242 |
'title' => __( 'Blocked Message', 'zerospam' ),
|
236 |
'recommended' => 'php',
|
237 |
);
|
238 |
|
239 |
+
$message = __( 'Your IP address has been blocked due to detected spam/malicious activity.', 'zerospam' );
|
240 |
|
241 |
self::$settings['blocked_message'] = array(
|
242 |
'title' => __( 'Blocked Message', 'zerospam' ),
|
core/class-utilities.php
CHANGED
@@ -224,7 +224,7 @@ class Utilities {
|
|
224 |
* @param string $setting_msg_key Optional. Setting message key.
|
225 |
*/
|
226 |
public static function detection_title( $setting_msg_key = false ) {
|
227 |
-
$title = __( 'Blocked
|
228 |
|
229 |
return apply_filters( 'zerospam_detection_title', $title, $setting_msg_key );
|
230 |
}
|
@@ -235,7 +235,7 @@ class Utilities {
|
|
235 |
* @param string $setting_msg_key Optional. Setting message key.
|
236 |
*/
|
237 |
public static function detection_message( $setting_msg_key = false ) {
|
238 |
-
$message = __( 'You have been flagged as spam/malicious
|
239 |
|
240 |
if ( $setting_msg_key && ! empty( ZeroSpam\Core\Settings::get_settings( $setting_msg_key ) ) ) {
|
241 |
$message = ZeroSpam\Core\Settings::get_settings( $setting_msg_key );
|
224 |
* @param string $setting_msg_key Optional. Setting message key.
|
225 |
*/
|
226 |
public static function detection_title( $setting_msg_key = false ) {
|
227 |
+
$title = __( 'Blocked for Suspected Malicious IP/Spam', 'zerospam' );
|
228 |
|
229 |
return apply_filters( 'zerospam_detection_title', $title, $setting_msg_key );
|
230 |
}
|
235 |
* @param string $setting_msg_key Optional. Setting message key.
|
236 |
*/
|
237 |
public static function detection_message( $setting_msg_key = false ) {
|
238 |
+
$message = __( 'You have been flagged as spam/malicious user.', 'zerospam' );
|
239 |
|
240 |
if ( $setting_msg_key && ! empty( ZeroSpam\Core\Settings::get_settings( $setting_msg_key ) ) ) {
|
241 |
$message = ZeroSpam\Core\Settings::get_settings( $setting_msg_key );
|
includes/class-plugin.php
CHANGED
@@ -110,6 +110,10 @@ class Plugin {
|
|
110 |
|
111 |
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
112 |
|
|
|
|
|
|
|
|
|
113 |
if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
|
114 |
new ContactForm7();
|
115 |
}
|
110 |
|
111 |
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
112 |
|
113 |
+
if ( is_plugin_active( 'give/give.php' ) ) {
|
114 |
+
new \ZeroSpam\Modules\Give\Give();
|
115 |
+
}
|
116 |
+
|
117 |
if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
|
118 |
new ContactForm7();
|
119 |
}
|
modules/fluentforms/class-fluentforms.php
CHANGED
@@ -226,7 +226,7 @@ class FluentForms {
|
|
226 |
'recommended' => 'enabled',
|
227 |
);
|
228 |
|
229 |
-
$message = __( 'You
|
230 |
|
231 |
$settings['fluentforms_spam_message'] = array(
|
232 |
'title' => __( 'Spam/Malicious Message', 'zerospam' ),
|
226 |
'recommended' => 'enabled',
|
227 |
);
|
228 |
|
229 |
+
$message = __( 'You IP has been flagged as spam/malicious.', 'zerospam' );
|
230 |
|
231 |
$settings['fluentforms_spam_message'] = array(
|
232 |
'title' => __( 'Spam/Malicious Message', 'zerospam' ),
|
modules/give/class-give.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Give class
|
4 |
+
*
|
5 |
+
* @package ZeroSpam
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace ZeroSpam\Modules\Give;
|
9 |
+
|
10 |
+
// Security Note: Blocks direct access to the plugin PHP files.
|
11 |
+
defined( 'ABSPATH' ) || die();
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Give
|
15 |
+
*/
|
16 |
+
class Give {
|
17 |
+
/**
|
18 |
+
* Add-on constructor
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
add_filter( 'zerospam_setting_sections', array( $this, 'sections' ) );
|
22 |
+
add_filter( 'zerospam_settings', array( $this, 'settings' ) );
|
23 |
+
add_filter( 'zerospam_types', array( $this, 'types' ), 10, 1 );
|
24 |
+
|
25 |
+
if ( 'enabled' === \ZeroSpam\Core\Settings::get_settings( 'verify_givewp' ) && \ZeroSpam\Core\Access::process() ) {
|
26 |
+
// Adds Zero Spam's honeypot field.
|
27 |
+
add_action( 'give_donation_form_bottom', array( $this, 'add_honeypot' ), 10 );
|
28 |
+
|
29 |
+
// Processes the form.
|
30 |
+
add_action( 'give_checkout_error_checks', array( $this, 'process_form' ), 10, 1 );
|
31 |
+
|
32 |
+
// Load scripts.
|
33 |
+
// @todo - integrate the david walsh technique.
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Adds Zero Spam's honeypot field.
|
39 |
+
*/
|
40 |
+
public function add_honeypot() {
|
41 |
+
// @codingStandardsIgnoreLine
|
42 |
+
echo \ZeroSpam\Core\Utilities::honeypot_field();
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Processes a donation submission.
|
47 |
+
*
|
48 |
+
* @param array $valid_data List of Valid Data.
|
49 |
+
*/
|
50 |
+
public function process_form( $valid_data ) {
|
51 |
+
// Get post values.
|
52 |
+
// @codingStandardsIgnoreLine
|
53 |
+
$post_data = give_clean( $_POST );
|
54 |
+
|
55 |
+
// Check Zero Spam's honeypot field.
|
56 |
+
$honeypot_field_name = \ZeroSpam\Core\Utilities::get_honeypot();
|
57 |
+
|
58 |
+
// Get the error message.
|
59 |
+
$error_message = \ZeroSpam\Core\Utilities::detection_message( 'login_spam_message' );
|
60 |
+
|
61 |
+
// Create the details array for logging & sharing data.
|
62 |
+
$details = array(
|
63 |
+
'data' => $post_data,
|
64 |
+
'type' => 'givewp',
|
65 |
+
);
|
66 |
+
|
67 |
+
// Begin validation checks.
|
68 |
+
$validation_errors = array();
|
69 |
+
|
70 |
+
if ( isset( $post_data[ $honeypot_field_name ] ) && ! empty( $post_data[ $honeypot_field_name ] ) ) {
|
71 |
+
// Failed the honeypot check.
|
72 |
+
$details['failed'] = 'honeypot';
|
73 |
+
|
74 |
+
$validation_errors[] = 'honeypot';
|
75 |
+
}
|
76 |
+
|
77 |
+
if ( ! empty( $validation_errors ) ) {
|
78 |
+
// Failed validations, log & send details if enabled.
|
79 |
+
foreach ( $validation_errors as $key => $fail ) {
|
80 |
+
$details['failed'] = $fail;
|
81 |
+
|
82 |
+
// Log the detection if enabled.
|
83 |
+
if ( 'enabled' === \ZeroSpam\Core\Settings::get_settings( 'log_blocked_givewp' ) ) {
|
84 |
+
\ZeroSpam\Includes\DB::log( 'givewp', $details );
|
85 |
+
}
|
86 |
+
|
87 |
+
// Share the detection if enabled.
|
88 |
+
if ( 'enabled' === \ZeroSpam\Core\Settings::get_settings( 'share_data' ) ) {
|
89 |
+
do_action( 'zerospam_share_detection', $details );
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
give_set_error( 'zerospam_honeypot', $error_message );
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Add to the types array
|
99 |
+
*
|
100 |
+
* @param array $types Array of available detection types.
|
101 |
+
*/
|
102 |
+
public function types( $types ) {
|
103 |
+
$types['givewp'] = __( 'GiveWP', 'zerospam' );
|
104 |
+
|
105 |
+
return $types;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Admin section
|
110 |
+
*
|
111 |
+
* @param array $sections Array of available setting sections.
|
112 |
+
*/
|
113 |
+
public function sections( $sections ) {
|
114 |
+
$sections['givewp'] = array(
|
115 |
+
'title' => __( 'GiveWP Integration', 'zerospam' ),
|
116 |
+
);
|
117 |
+
|
118 |
+
return $sections;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Admin settings
|
123 |
+
*
|
124 |
+
* @param array $settings Array of available settings.
|
125 |
+
*/
|
126 |
+
public function settings( $settings ) {
|
127 |
+
$options = get_option( 'wpzerospam' );
|
128 |
+
|
129 |
+
$settings['verify_givewp'] = array(
|
130 |
+
'title' => __( 'Protect GiveWP Submissions', 'zerospam' ),
|
131 |
+
'section' => 'givewp',
|
132 |
+
'type' => 'checkbox',
|
133 |
+
'options' => array(
|
134 |
+
'enabled' => __( 'Monitor GiveWP submissions for malicious or automated spambots.', 'zerospam' ),
|
135 |
+
),
|
136 |
+
'value' => ! empty( $options['verify_givewp'] ) ? $options['verify_givewp'] : false,
|
137 |
+
'recommended' => 'enabled',
|
138 |
+
);
|
139 |
+
|
140 |
+
$message = __( 'Your IP has been flagged as spam/malicious.', 'zerospam' );
|
141 |
+
|
142 |
+
$settings['givewp_spam_message'] = array(
|
143 |
+
'title' => __( 'Spam/Malicious Message', 'zerospam' ),
|
144 |
+
'desc' => __( 'When GiveWP protection is enabled, the message displayed to the user when a submission has been detected as spam/malicious.', 'zerospam' ),
|
145 |
+
'section' => 'givewp',
|
146 |
+
'type' => 'text',
|
147 |
+
'field_class' => 'large-text',
|
148 |
+
'placeholder' => $message,
|
149 |
+
'value' => ! empty( $options['givewp_spam_message'] ) ? $options['givewp_spam_message'] : $message,
|
150 |
+
'recommended' => $message,
|
151 |
+
);
|
152 |
+
|
153 |
+
$settings['log_blocked_givewp'] = array(
|
154 |
+
'title' => __( 'Log Blocked GiveWP Submissions', 'zerospam' ),
|
155 |
+
'section' => 'givewp',
|
156 |
+
'type' => 'checkbox',
|
157 |
+
'desc' => wp_kses(
|
158 |
+
__( 'Enables logging blocked GiveWP submissions. <strong>Recommended for enhanced protection.</strong>', 'zerospam' ),
|
159 |
+
array( 'strong' => array() )
|
160 |
+
),
|
161 |
+
'options' => array(
|
162 |
+
'enabled' => __( 'Enabled', 'zerospam' ),
|
163 |
+
),
|
164 |
+
'value' => ! empty( $options['log_blocked_givewp'] ) ? $options['log_blocked_givewp'] : false,
|
165 |
+
'recommended' => 'enabled',
|
166 |
+
);
|
167 |
+
|
168 |
+
return $settings;
|
169 |
+
}
|
170 |
+
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.zerospam.org/subscribe/
|
|
5 |
Requires at least: 5.2
|
6 |
Tested up to: 5.8.2
|
7 |
Requires PHP: 7.3
|
8 |
-
Stable tag: 5.2.
|
9 |
License: GNU GPLv3
|
10 |
License URI: https://choosealicense.com/licenses/gpl-3.0/
|
11 |
|
@@ -34,6 +34,7 @@ Quit forcing people to answer questions or confusing captchas to prove they're n
|
|
34 |
= WordPress Zero Spam also protects =
|
35 |
|
36 |
* WordPress core comments, user registrations & login attempts
|
|
|
37 |
* [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) submissions
|
38 |
* [WPForms](https://wordpress.org/plugins/wpforms-lite/) submissions
|
39 |
* [Formidable Form Builder](https://wordpress.org/plugins/formidable/) submissions
|
@@ -78,9 +79,8 @@ For more information & developer documentation, see the [plugin’s website](htt
|
|
78 |
|
79 |
Some hosts have issues with they way they access files. If you're seeing a `ftp_fget` PHP notice, setting the `FS_METHOD` constant to `direct` in `wp-config.php` above the line `/* That's all, stop editing! Happy Pressing. */` should solve the problem:
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
```
|
84 |
|
85 |
If hosting with Pantheon, see their [known issues page](https://pantheon.io/docs/plugins-known-issues#define-fs_method) for more information and what to do to resolve it with their `$_ENV['PANTHEON_ENVIRONMENT']` variable check.
|
86 |
|
@@ -94,6 +94,11 @@ If hosting with Pantheon, see their [known issues page](https://pantheon.io/docs
|
|
94 |
|
95 |
== Changelog ==
|
96 |
|
|
|
|
|
|
|
|
|
|
|
97 |
= v5.2.2 =
|
98 |
|
99 |
* fix(db): resolves #281, fixes db update error for multisite installations
|
5 |
Requires at least: 5.2
|
6 |
Tested up to: 5.8.2
|
7 |
Requires PHP: 7.3
|
8 |
+
Stable tag: 5.2.3
|
9 |
License: GNU GPLv3
|
10 |
License URI: https://choosealicense.com/licenses/gpl-3.0/
|
11 |
|
34 |
= WordPress Zero Spam also protects =
|
35 |
|
36 |
* WordPress core comments, user registrations & login attempts
|
37 |
+
* [GiveWP](https://wordpress.org/plugins/give/) donation submissions
|
38 |
* [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) submissions
|
39 |
* [WPForms](https://wordpress.org/plugins/wpforms-lite/) submissions
|
40 |
* [Formidable Form Builder](https://wordpress.org/plugins/formidable/) submissions
|
79 |
|
80 |
Some hosts have issues with they way they access files. If you're seeing a `ftp_fget` PHP notice, setting the `FS_METHOD` constant to `direct` in `wp-config.php` above the line `/* That's all, stop editing! Happy Pressing. */` should solve the problem:
|
81 |
|
82 |
+
`define('FS_METHOD', 'direct');`
|
83 |
+
|
|
|
84 |
|
85 |
If hosting with Pantheon, see their [known issues page](https://pantheon.io/docs/plugins-known-issues#define-fs_method) for more information and what to do to resolve it with their `$_ENV['PANTHEON_ENVIRONMENT']` variable check.
|
86 |
|
94 |
|
95 |
== Changelog ==
|
96 |
|
97 |
+
= v5.2.3 =
|
98 |
+
|
99 |
+
* feat(givewp): now support givewp donation forms
|
100 |
+
* style(notices): minor update to default detection notice
|
101 |
+
|
102 |
= v5.2.2 =
|
103 |
|
104 |
* fix(db): resolves #281, fixes db update error for multisite installations
|
wordpress-zero-spam.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
* Plugin Name: WordPress Zero Spam
|
14 |
* Plugin URI: https://www.highfivery.com/projects/zero-spam/
|
15 |
* Description: Tired of all the worthless and bloated WordPress anti-spam plugins? The WordPress Zero Spam plugin makes blocking spam & malicious activity a cinch. <strong>Just install, activate, configure, and say goodbye to spam.</strong>
|
16 |
-
* Version: 5.2.
|
17 |
* Requires at least: 5.2
|
18 |
* Requires PHP: 7.3
|
19 |
* Author: Highfivery LLC
|
@@ -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.2.
|
35 |
|
36 |
if ( defined( 'ZEROSPAM_DEVELOPMENT_URL' ) ) {
|
37 |
define( 'ZEROSPAM_URL', ZEROSPAM_DEVELOPMENT_URL );
|
13 |
* Plugin Name: WordPress Zero Spam
|
14 |
* Plugin URI: https://www.highfivery.com/projects/zero-spam/
|
15 |
* Description: Tired of all the worthless and bloated WordPress anti-spam plugins? The WordPress Zero Spam plugin makes blocking spam & malicious activity a cinch. <strong>Just install, activate, configure, and say goodbye to spam.</strong>
|
16 |
+
* Version: 5.2.3
|
17 |
* Requires at least: 5.2
|
18 |
* Requires PHP: 7.3
|
19 |
* Author: Highfivery LLC
|
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.2.3' );
|
35 |
|
36 |
if ( defined( 'ZEROSPAM_DEVELOPMENT_URL' ) ) {
|
37 |
define( 'ZEROSPAM_URL', ZEROSPAM_DEVELOPMENT_URL );
|