Anti-spam - Version 4.2

Version Description

  • 2016-01-30 =
  • removed XSS vulnerability - thanks to Kenan from tbmnull.com
Download this release

Release Info

Developer webvitaly
Plugin Icon 128x128 Anti-spam
Version 4.2
Comparing to
See all releases

Code changes from version 4.1 to 4.2

anti-spam-info.php CHANGED
@@ -17,7 +17,7 @@ function antispam_admin_notice() {
17
  <div class="update-nag antispam-panel-info">
18
  <p style="margin: 0;">
19
  <?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam/">Anti-spam</a> plugin so far.
20
- <a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly" title="Anti-spam Pro">Upgrade to Pro</a> for more advanced protection.
21
  </p>
22
  </div>
23
  <?php
17
  <div class="update-nag antispam-panel-info">
18
  <p style="margin: 0;">
19
  <?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam/">Anti-spam</a> plugin so far.
20
+ <a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" title="Anti-spam Pro">Upgrade to Pro</a> for more advanced protection.
21
  </p>
22
  </div>
23
  <?php
anti-spam.php CHANGED
@@ -3,14 +3,16 @@
3
  Plugin Name: Anti-spam
4
  Plugin URI: http://wordpress.org/plugins/anti-spam/
5
  Description: No spam in comments. No captcha.
6
- Version: 4.1
7
  Author: webvitaly
8
  Text Domain: anti-spam
9
  Author URI: http://web-profile.com.ua/wordpress/plugins/
10
  License: GPLv3
11
  */
12
 
13
- defined('ABSPATH') OR exit; // prevent full path disclosure
 
 
14
 
15
  $antispam_send_spam_comment_to_admin = false; // if true, than rejected spam comments will be sent to admin email
16
  $antispam_log_spam_comment = false; // if true, than rejected spam comments will be logged to wp-content/plugins/anti-spam/log/anti-spam-2015-11.log
@@ -18,7 +20,7 @@ $antispam_allow_trackbacks = false; // if true, than trackbacks will be allowed
18
  // trackbacks almost not used by users, but mostly used by spammers; pingbacks are always enabled
19
  // more about the difference between trackback and pingback - http://web-profile.com.ua/web/trackback-vs-pingback/
20
 
21
- define('ANTISPAM_PLUGIN_VERSION', '4.1');
22
 
23
  $antispam_settings = array(
24
  'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
@@ -33,7 +35,7 @@ include('anti-spam-info.php');
33
 
34
  function antispam_enqueue_script() {
35
  if (is_singular() && comments_open()) { // load script only for pages with comments form
36
- wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-4.1.js', __FILE__), null, null, true);
37
  }
38
  }
39
  add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
@@ -107,16 +109,16 @@ function antispam_check_comment($commentdata) {
107
  if ( trim($_POST['antspm-d']) != date('Y') ) { // extra js-only check: there is no js added input - it is spam
108
  $spam_flag = true;
109
  if (empty($_POST['antspm-q'])) { // empty answer - it is spam
110
- $antispam_error_message .= 'Error: empty answer. ['.$_POST['antspm-q'].']<br> '.$rn;
111
  } else {
112
- $antispam_error_message .= 'Error: answer is wrong. ['.$_POST['antspm-q'].']<br> '.$rn;
113
  }
114
  }
115
  }
116
 
117
  if ( ! empty($_POST['antspm-e-email-url-website'])) { // trap field is not empty - it is spam
118
  $spam_flag = true;
119
- $antispam_error_message .= 'Error: field should be empty. ['.$_POST['antspm-e-email-url-website'].']<br> '.$rn;
120
  }
121
 
122
  if ($spam_flag) { // it is spam
@@ -159,17 +161,21 @@ function antispam_check_comment($commentdata) {
159
  return $commentdata; // if comment does not looks like spam
160
  }
161
 
 
162
  if ( ! is_admin()) {
163
  add_filter('preprocess_comment', 'antispam_check_comment', 1);
164
  }
165
 
166
 
167
  function antispam_plugin_meta($links, $file) { // add some links to plugin meta row
168
- if (strpos($file, 'anti-spam/anti-spam.php') !== false) {
169
- $links = array_merge($links, array('<a href="http://web-profile.com.ua/wordpress/plugins/anti-spam/" title="Plugin page">Anti-spam</a>'));
170
- $links = array_merge($links, array('<a href="http://web-profile.com.ua/donate/" title="Support the development">Donate</a>'));
171
- $links = array_merge($links, array('<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly" title="Upgrade to Pro">Anti-spam Pro</a>'));
 
 
 
172
  }
173
- return $links;
174
  }
175
  add_filter('plugin_row_meta', 'antispam_plugin_meta', 10, 2);
3
  Plugin Name: Anti-spam
4
  Plugin URI: http://wordpress.org/plugins/anti-spam/
5
  Description: No spam in comments. No captcha.
6
+ Version: 4.2
7
  Author: webvitaly
8
  Text Domain: anti-spam
9
  Author URI: http://web-profile.com.ua/wordpress/plugins/
10
  License: GPLv3
11
  */
12
 
13
+ if ( ! defined( 'ABSPATH' ) ) { // prevent full path disclosure
14
+ exit;
15
+ }
16
 
17
  $antispam_send_spam_comment_to_admin = false; // if true, than rejected spam comments will be sent to admin email
18
  $antispam_log_spam_comment = false; // if true, than rejected spam comments will be logged to wp-content/plugins/anti-spam/log/anti-spam-2015-11.log
20
  // trackbacks almost not used by users, but mostly used by spammers; pingbacks are always enabled
21
  // more about the difference between trackback and pingback - http://web-profile.com.ua/web/trackback-vs-pingback/
22
 
23
+ define('ANTISPAM_PLUGIN_VERSION', '4.2');
24
 
25
  $antispam_settings = array(
26
  'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
35
 
36
  function antispam_enqueue_script() {
37
  if (is_singular() && comments_open()) { // load script only for pages with comments form
38
+ wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-4.2.js', __FILE__), null, null, true);
39
  }
40
  }
41
  add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
109
  if ( trim($_POST['antspm-d']) != date('Y') ) { // extra js-only check: there is no js added input - it is spam
110
  $spam_flag = true;
111
  if (empty($_POST['antspm-q'])) { // empty answer - it is spam
112
+ $antispam_error_message .= 'Error: empty answer. ['.esc_attr( $_POST['antspm-q'] ).']<br> '.$rn;
113
  } else {
114
+ $antispam_error_message .= 'Error: answer is wrong. ['.esc_attr( $_POST['antspm-q'] ).']<br> '.$rn;
115
  }
116
  }
117
  }
118
 
119
  if ( ! empty($_POST['antspm-e-email-url-website'])) { // trap field is not empty - it is spam
120
  $spam_flag = true;
121
+ $antispam_error_message .= 'Error: field should be empty. ['.esc_attr( $_POST['antspm-e-email-url-website'] ).']<br> '.$rn;
122
  }
123
 
124
  if ($spam_flag) { // it is spam
161
  return $commentdata; // if comment does not looks like spam
162
  }
163
 
164
+
165
  if ( ! is_admin()) {
166
  add_filter('preprocess_comment', 'antispam_check_comment', 1);
167
  }
168
 
169
 
170
  function antispam_plugin_meta($links, $file) { // add some links to plugin meta row
171
+ if ( $file == plugin_basename( __FILE__ ) ) {
172
+ $row_meta = array(
173
+ 'support' => '<a href="http://web-profile.com.ua/wordpress/plugins/anti-spam/" target="_blank"><span class="dashicons dashicons-editor-help"></span> ' . __( 'Anti-spam', 'anti-spam' ) . '</a>',
174
+ 'donate' => '<a href="http://web-profile.com.ua/donate/" target="_blank"><span class="dashicons dashicons-heart"></span> ' . __( 'Donate', 'anti-spam' ) . '</a>',
175
+ 'upgrage' => '<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" target="_blank"><span class="dashicons dashicons-star-filled"></span> ' . __( 'Anti-spam Pro', 'anti-spam' ) . '</a>'
176
+ );
177
+ $links = array_merge( $links, $row_meta );
178
  }
179
+ return (array) $links;
180
  }
181
  add_filter('plugin_row_meta', 'antispam_plugin_meta', 10, 2);
js/{anti-spam-4.1.js → anti-spam-4.2.js} RENAMED
File without changes
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webvitaly
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: spam, spammer, comment, comments, comment-spam, antispam, anti-spam, block-spam, spam-free, spambot, spam-bot, bot
5
  Requires at least: 3.3
6
- Tested up to: 4.5
7
- Stable tag: 4.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -12,11 +12,11 @@ No spam in comments. No captcha.
12
 
13
  == Description ==
14
 
15
- > **[Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly "Upgrade to Pro")** |
16
  > **[Anti-spam](http://web-profile.com.ua/wordpress/plugins/anti-spam/ "Plugin page")** |
17
  > **[Donate](http://web-profile.com.ua/donate/ "Support the development")** |
18
- > **[Github](https://github.com/webvitaly/anti-spam "Fork")**
19
-
20
 
21
  **Captcha madness:**
22
 
@@ -40,9 +40,8 @@ After installing the Anti-spam plugin **try to submit a comment on your site bei
40
  If you get an error - you may check the solution in the [Support section](http://wordpress.org/support/plugin/anti-spam) or submit a new topic with detailed description of your problem.
41
 
42
  = Useful: =
43
- * [Anti-spam Pro - extended version with settings and manual spam protection](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly "Upgrade to Pro")
44
- * [Security-protection - blocks brute-force attacks](http://wordpress.org/plugins/security-protection/ "stops brute-force attacks")
45
- * [WordPress Pro plugins](http://codecanyon.net/popular_item/by_category?category=wordpress&ref=webvitaly)
46
 
47
  == Installation ==
48
 
@@ -55,7 +54,7 @@ If you get an error - you may check the solution in the [Support section](http:/
55
 
56
  Anti-spam plugin blocks 100% of automatic spam messages (sent by spam-bots via post requests).
57
  Plugin does not block manual spam (submitted by spammers manually via browser).
58
- You can use [Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly "Upgrade to Pro") plugin if you need to block manual spam.
59
 
60
  = Incompatible with: =
61
 
@@ -136,11 +135,14 @@ The plugin is pretty small and easy to read.
136
 
137
  == Changelog ==
138
 
 
 
 
139
  = 4.1 - 2015-10-25 =
140
- * added log spam to file feature (huge thanks to [Guti](http://www.javiergutierrezchamorro.com/ "Javier Gutiérrez Chamorro")
141
  * prevent full path disclosure
142
  * added empty index.php file
143
- * publish plugin to Github
144
  * added Text Domain for translation.wordpress.org
145
 
146
  = 4.0 - 2015-10-11 =
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: spam, spammer, comment, comments, comment-spam, antispam, anti-spam, block-spam, spam-free, spambot, spam-bot, bot
5
  Requires at least: 3.3
6
+ Tested up to: 4.7
7
+ Stable tag: 4.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
12
 
13
  == Description ==
14
 
15
+ > **[Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro")** |
16
  > **[Anti-spam](http://web-profile.com.ua/wordpress/plugins/anti-spam/ "Plugin page")** |
17
  > **[Donate](http://web-profile.com.ua/donate/ "Support the development")** |
18
+ > **[GitHub](https://github.com/webvitalii/anti-spam "Fork")** |
19
+ > **[Silver Bullet Pro](http://codecanyon.net/item/silver-bullet-pro/15171769?ref=webvitalii "Speedup and protect WordPress in a smart way")**
20
 
21
  **Captcha madness:**
22
 
40
  If you get an error - you may check the solution in the [Support section](http://wordpress.org/support/plugin/anti-spam) or submit a new topic with detailed description of your problem.
41
 
42
  = Useful: =
43
+ * **[Anti-spam Pro - extended version with settings and manual spam protection](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro")**
44
+ * **[Silver Bullet Pro - Speedup and protect WordPress in a smart way](http://codecanyon.net/item/silver-bullet-pro/15171769?ref=webvitalii "Speedup and protect WordPress in a smart way")**
 
45
 
46
  == Installation ==
47
 
54
 
55
  Anti-spam plugin blocks 100% of automatic spam messages (sent by spam-bots via post requests).
56
  Plugin does not block manual spam (submitted by spammers manually via browser).
57
+ You can use [Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Upgrade to Pro") plugin if you need to block manual spam.
58
 
59
  = Incompatible with: =
60
 
135
 
136
  == Changelog ==
137
 
138
+ = 4.2 - 2016-01-30 =
139
+ * removed XSS vulnerability - thanks to Kenan from [tbmnull.com](http://tbmnull.com/)
140
+
141
  = 4.1 - 2015-10-25 =
142
+ * added log spam to file feature - huge thanks to [Guti](http://www.javiergutierrezchamorro.com/ "Javier Gutiérrez Chamorro")
143
  * prevent full path disclosure
144
  * added empty index.php file
145
+ * publish plugin to GitHub
146
  * added Text Domain for translation.wordpress.org
147
 
148
  = 4.0 - 2015-10-11 =