Version Description
- 2014-12-04 =
- remove log notices
Download this release
Release Info
Developer | webvitaly |
Plugin | Anti-spam |
Version | 3.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.1
- anti-spam.php +8 -9
- readme.txt +6 -1
anti-spam.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Anti-spam
|
4 |
Plugin URI: http://wordpress.org/plugins/anti-spam/
|
5 |
Description: No spam in comments. No captcha.
|
6 |
-
Version: 3.
|
7 |
Author: webvitaly
|
8 |
Author URI: http://web-profile.com.ua/wordpress/plugins/
|
9 |
License: GPLv3
|
@@ -19,7 +19,7 @@ $antispam_allow_trackbacks = false; // if true, than trackbacks will be allowed
|
|
19 |
$antispam_settings = array(
|
20 |
'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
|
21 |
'allow_trackbacks' => $antispam_allow_trackbacks,
|
22 |
-
'version' => '3.
|
23 |
'admin_email' => get_option('admin_email'),
|
24 |
'max_spam_points' => 3, // if more - it is spam
|
25 |
'max_links_number' => 2, // if more - +1 spam point
|
@@ -61,7 +61,6 @@ endif; // end of antispam_form_part()
|
|
61 |
if ( ! function_exists('antispam_check_comment')):
|
62 |
function antispam_check_comment($commentdata) {
|
63 |
global $antispam_settings;
|
64 |
-
$spam_points = 0;
|
65 |
$rn = "\r\n"; // .chr(13).chr(10)
|
66 |
|
67 |
extract($commentdata);
|
@@ -125,34 +124,34 @@ if ( ! function_exists('antispam_check_comment')):
|
|
125 |
$antispam_error_message .= 'Info: COOKIE array is empty. +1 spam point.<br> '.$rn;
|
126 |
}
|
127 |
|
128 |
-
if ( ! empty($commentdata[comment_author_url])) { // probably spam
|
129 |
$spam_points += 1;
|
130 |
$antispam_error_message .= 'Info: URL field is not empty. +1 spam point.<br> '.$rn;
|
131 |
}
|
132 |
|
133 |
-
$links_count = substr_count($commentdata[comment_content], 'http');
|
134 |
if ($links_count > $antispam_settings['max_links_number']) { // probably spam
|
135 |
$spam_points += 1;
|
136 |
$antispam_error_message .= 'Info: comment contains too many links ['.$links_count.' links; max = '.$antispam_settings['max_links_number'].']. +1 spam point.<br> '.$rn;
|
137 |
}
|
138 |
|
139 |
-
if (strpos($commentdata[comment_content], '</') !== false) { // probably spam
|
140 |
$spam_points += 1;
|
141 |
$antispam_error_message .= 'Info: comment contains html. +1 spam point.<br> '.$rn;
|
142 |
}
|
143 |
|
144 |
-
$comment_length = strlen($commentdata[comment_content]);
|
145 |
if ($comment_length > $antispam_settings['max_comment_length']) { // probably spam
|
146 |
$spam_points += 1;
|
147 |
$antispam_error_message .= 'Info: comment is too long ['.$comment_length.' chars; max = '.$antispam_settings['max_comment_length'].']. +1 spam point.<br> '.$rn;
|
148 |
}
|
149 |
|
150 |
-
if (strpos($commentdata[comment_content], 'rel="nofollow"') !== false) { // probably spam
|
151 |
$spam_points += 1;
|
152 |
$antispam_error_message .= 'Info: comment contains rel="nofollow" code. +1 spam point.<br> '.$rn;
|
153 |
}
|
154 |
|
155 |
-
if (strpos($commentdata[comment_content], '[/url]') !== false) { // probably spam
|
156 |
$spam_points += 1;
|
157 |
$antispam_error_message .= 'Info: comment contains [/url] code. +1 spam point.<br> '.$rn;
|
158 |
}
|
3 |
Plugin Name: Anti-spam
|
4 |
Plugin URI: http://wordpress.org/plugins/anti-spam/
|
5 |
Description: No spam in comments. No captcha.
|
6 |
+
Version: 3.1
|
7 |
Author: webvitaly
|
8 |
Author URI: http://web-profile.com.ua/wordpress/plugins/
|
9 |
License: GPLv3
|
19 |
$antispam_settings = array(
|
20 |
'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
|
21 |
'allow_trackbacks' => $antispam_allow_trackbacks,
|
22 |
+
'version' => '3.1',
|
23 |
'admin_email' => get_option('admin_email'),
|
24 |
'max_spam_points' => 3, // if more - it is spam
|
25 |
'max_links_number' => 2, // if more - +1 spam point
|
61 |
if ( ! function_exists('antispam_check_comment')):
|
62 |
function antispam_check_comment($commentdata) {
|
63 |
global $antispam_settings;
|
|
|
64 |
$rn = "\r\n"; // .chr(13).chr(10)
|
65 |
|
66 |
extract($commentdata);
|
124 |
$antispam_error_message .= 'Info: COOKIE array is empty. +1 spam point.<br> '.$rn;
|
125 |
}
|
126 |
|
127 |
+
if ( ! empty($commentdata['comment_author_url'])) { // probably spam
|
128 |
$spam_points += 1;
|
129 |
$antispam_error_message .= 'Info: URL field is not empty. +1 spam point.<br> '.$rn;
|
130 |
}
|
131 |
|
132 |
+
$links_count = substr_count($commentdata['comment_content'], 'http');
|
133 |
if ($links_count > $antispam_settings['max_links_number']) { // probably spam
|
134 |
$spam_points += 1;
|
135 |
$antispam_error_message .= 'Info: comment contains too many links ['.$links_count.' links; max = '.$antispam_settings['max_links_number'].']. +1 spam point.<br> '.$rn;
|
136 |
}
|
137 |
|
138 |
+
if (strpos($commentdata['comment_content'], '</') !== false) { // probably spam
|
139 |
$spam_points += 1;
|
140 |
$antispam_error_message .= 'Info: comment contains html. +1 spam point.<br> '.$rn;
|
141 |
}
|
142 |
|
143 |
+
$comment_length = strlen($commentdata['comment_content']);
|
144 |
if ($comment_length > $antispam_settings['max_comment_length']) { // probably spam
|
145 |
$spam_points += 1;
|
146 |
$antispam_error_message .= 'Info: comment is too long ['.$comment_length.' chars; max = '.$antispam_settings['max_comment_length'].']. +1 spam point.<br> '.$rn;
|
147 |
}
|
148 |
|
149 |
+
if (strpos($commentdata['comment_content'], 'rel="nofollow"') !== false) { // probably spam
|
150 |
$spam_points += 1;
|
151 |
$antispam_error_message .= 'Info: comment contains rel="nofollow" code. +1 spam point.<br> '.$rn;
|
152 |
}
|
153 |
|
154 |
+
if (strpos($commentdata['comment_content'], '[/url]') !== false) { // probably spam
|
155 |
$spam_points += 1;
|
156 |
$antispam_error_message .= 'Info: comment contains [/url] code. +1 spam point.<br> '.$rn;
|
157 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-profile.com.ua/donate/
|
|
4 |
Tags: spam, spammer, spammers, comment, comments, antispam, anti-spam, block-spam, spamfree, spam-free, spambot, spam-bot, bot
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 3.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -134,8 +134,13 @@ Do not order products from spam. If spam will be less effective than spammers wi
|
|
134 |
|
135 |
|
136 |
== Changelog ==
|
|
|
|
|
|
|
137 |
= 3.0 - 2014-12-02 =
|
138 |
* added 'spam points' algorithm
|
|
|
|
|
139 |
* refactor code structure
|
140 |
|
141 |
= 2.6 - 2014-11-30 =
|
4 |
Tags: spam, spammer, spammers, comment, comments, antispam, anti-spam, block-spam, spamfree, spam-free, spambot, spam-bot, bot
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 3.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
134 |
|
135 |
|
136 |
== Changelog ==
|
137 |
+
= 3.1 - 2014-12-04 =
|
138 |
+
* remove log notices
|
139 |
+
|
140 |
= 3.0 - 2014-12-02 =
|
141 |
* added 'spam points' algorithm
|
142 |
+
* bugfixing
|
143 |
+
* enqueue script only for pages with comments form and in the footer (thanks to dougvdotcom)
|
144 |
* refactor code structure
|
145 |
|
146 |
= 2.6 - 2014-11-30 =
|