Anti-spam - Version 5.1

Version Description

  • Disable check for comments from logged in users
Download this release

Release Info

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

Code changes from version 5.0 to 5.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: 5.0
7
  Author: webvitaly
8
  Text Domain: anti-spam
9
  Author URI: http://web-profile.net/wordpress/plugins/
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) { // prevent full path disclosure
14
  exit;
15
  }
16
 
17
- define('ANTISPAM_PLUGIN_VERSION', '5.0');
18
 
19
  include('anti-spam-functions.php');
20
  include('anti-spam-settings.php');
@@ -24,7 +24,7 @@ include('anti-spam-info.php');
24
  function antispam_enqueue_script() {
25
  global $withcomments; // WP flag to show comments on all pages
26
  if ((is_singular() || $withcomments) && comments_open()) { // load script only for pages with comments form
27
- wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-5.0.js', __FILE__), null, null, true);
28
  }
29
  }
30
  add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
@@ -50,14 +50,18 @@ add_action('comment_form', 'antispam_form_part'); // add anti-spam inputs to the
50
 
51
  function antispam_check_comment($commentdata) {
52
  $antispam_settings = antispam_get_settings();
 
 
53
 
54
- if( antispam_check_for_spam() ) {
55
- if( $antispam_settings['save_spam_comments'] ) {
56
- antispam_store_comment($commentdata);
 
 
 
 
 
57
  }
58
- antispam_counter_stats();
59
- wp_die('Comment is a spam.'); // die - do not send comment and show errors
60
- //return false;
61
  }
62
 
63
  return $commentdata; // if comment does not looks like spam
3
  Plugin Name: Anti-spam
4
  Plugin URI: http://wordpress.org/plugins/anti-spam/
5
  Description: No spam in comments. No captcha.
6
+ Version: 5.1
7
  Author: webvitaly
8
  Text Domain: anti-spam
9
  Author URI: http://web-profile.net/wordpress/plugins/
14
  exit;
15
  }
16
 
17
+ define('ANTISPAM_PLUGIN_VERSION', '5.1');
18
 
19
  include('anti-spam-functions.php');
20
  include('anti-spam-settings.php');
24
  function antispam_enqueue_script() {
25
  global $withcomments; // WP flag to show comments on all pages
26
  if ((is_singular() || $withcomments) && comments_open()) { // load script only for pages with comments form
27
+ wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-5.1.js', __FILE__), null, null, true);
28
  }
29
  }
30
  add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
50
 
51
  function antispam_check_comment($commentdata) {
52
  $antispam_settings = antispam_get_settings();
53
+
54
+ extract($commentdata);
55
 
56
+ if ( ! is_user_logged_in() && $comment_type != 'pingback' && $comment_type != 'trackback') { // logged in user is not a spammer
57
+ if( antispam_check_for_spam() ) {
58
+ if( $antispam_settings['save_spam_comments'] ) {
59
+ antispam_store_comment($commentdata);
60
+ }
61
+ antispam_counter_stats();
62
+ wp_die('Comment is a spam.'); // die - do not send comment and show errors
63
+ //return false;
64
  }
 
 
 
65
  }
66
 
67
  return $commentdata; // if comment does not looks like spam
js/{anti-spam-5.0.js → anti-spam-5.1.js} RENAMED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-profile.net/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: 5.0
7
- Stable tag: 5.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -126,6 +126,9 @@ The plugin is pretty small and easy to read.
126
 
127
  == Changelog ==
128
 
 
 
 
129
  = 5.0 =
130
  * Rewriting/refactoring a lot of the code
131
  * Adding Settings page
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: 5.0
7
+ Stable tag: 5.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 5.1 =
130
+ * Disable check for comments from logged in users
131
+
132
  = 5.0 =
133
  * Rewriting/refactoring a lot of the code
134
  * Adding Settings page