Version Description
- 2014-12-20 =
- added the ability to hide or show info block in the "Screen Options" section
Download this release
Release Info
Developer | webvitaly |
Plugin | Anti-spam |
Version | 3.4 |
Comparing to | |
See all releases |
Code changes from version 3.3 to 3.4
- anti-spam-info.php +82 -0
- anti-spam.php +4 -23
- js/{anti-spam-3.3.js → anti-spam-3.4.js} +0 -0
- readme.txt +9 -5
anti-spam-info.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! function_exists('antispam_admin_notice')):
|
4 |
+
function antispam_admin_notice() {
|
5 |
+
global $pagenow;
|
6 |
+
if ($pagenow == 'edit-comments.php'):
|
7 |
+
$user_id = get_current_user_id();
|
8 |
+
$antispam_info_visibility = get_user_meta($user_id, 'antispam_info_visibility', true);
|
9 |
+
if ($antispam_info_visibility == 1 OR $antispam_info_visibility == ''):
|
10 |
+
$antispam_stats = get_option('antispam_stats', array());
|
11 |
+
$blocked_total = $antispam_stats['blocked_total'];
|
12 |
+
?>
|
13 |
+
<div class="update-nag antispam-panel-info">
|
14 |
+
<p style="margin: 0;">
|
15 |
+
<?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam/">Anti-spam</a> plugin so far.
|
16 |
+
<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly" title="Anti-spam Pro">Upgrade to Pro</a>.
|
17 |
+
</p>
|
18 |
+
</div>
|
19 |
+
<?php
|
20 |
+
endif; // end of if($antispam_info_visibility)
|
21 |
+
endif; // end of if($pagenow == 'edit-comments.php')
|
22 |
+
}
|
23 |
+
add_action('admin_notices', 'antispam_admin_notice');
|
24 |
+
endif; // end of antispam_admin_notice()
|
25 |
+
|
26 |
+
|
27 |
+
if ( ! function_exists('antispam_display_screen_option')):
|
28 |
+
function antispam_display_screen_option() {
|
29 |
+
global $pagenow;
|
30 |
+
if ($pagenow == 'edit-comments.php'):
|
31 |
+
$user_id = get_current_user_id();
|
32 |
+
$antispam_info_visibility = get_user_meta($user_id, 'antispam_info_visibility', true);
|
33 |
+
|
34 |
+
if ($antispam_info_visibility == 1 OR $antispam_info_visibility == '') {
|
35 |
+
$checked = 'checked="checked"';
|
36 |
+
} else {
|
37 |
+
$checked = '';
|
38 |
+
}
|
39 |
+
|
40 |
+
?>
|
41 |
+
<script>
|
42 |
+
jQuery(function($){
|
43 |
+
$('.antispam_screen_options_group').insertAfter('#screen-options-wrap #adv-settings');
|
44 |
+
});
|
45 |
+
</script>
|
46 |
+
<form method="post" class="antispam_screen_options_group" style="padding: 20px 0 5px 0;">
|
47 |
+
<input type="hidden" name="antispam_option_submit" value="1" />
|
48 |
+
<label>
|
49 |
+
<input name="antispam_info_visibility" type="checkbox" value="1" <?php echo $checked; ?> />
|
50 |
+
Anti-spam info
|
51 |
+
</label>
|
52 |
+
<input type="submit" class="button" value="<?php _e('Apply'); ?>" />
|
53 |
+
</form>
|
54 |
+
<?php
|
55 |
+
endif; // end of if($pagenow == 'edit-comments.php')
|
56 |
+
}
|
57 |
+
endif; // end of antispam_display_screen_option()
|
58 |
+
|
59 |
+
|
60 |
+
if ( ! function_exists('antispam_register_screen_option')):
|
61 |
+
function antispam_register_screen_option() {
|
62 |
+
$screen = get_current_screen();
|
63 |
+
add_filter('screen_layout_columns', 'antispam_display_screen_option');
|
64 |
+
$screen->add_option('antispam_info', '');
|
65 |
+
}
|
66 |
+
add_action('admin_head', 'antispam_register_screen_option');
|
67 |
+
endif; // end of antispam_register_screen_option()
|
68 |
+
|
69 |
+
|
70 |
+
if ( ! function_exists('antispam_update_screen_option')):
|
71 |
+
function antispam_update_screen_option() {
|
72 |
+
if (isset($_POST['antispam_option_submit']) AND $_POST['antispam_option_submit'] == 1) {
|
73 |
+
$user_id = get_current_user_id();
|
74 |
+
if (isset($_POST['antispam_info_visibility']) AND $_POST['antispam_info_visibility'] == 1) {
|
75 |
+
update_user_meta($user_id, 'antispam_info_visibility', 1);
|
76 |
+
} else {
|
77 |
+
update_user_meta($user_id, 'antispam_info_visibility', 0);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
add_action('admin_init', 'antispam_update_screen_option');
|
82 |
+
endif; // end of antispam_update_screen_option()
|
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
|
@@ -15,7 +15,7 @@ $antispam_allow_trackbacks = false; // if true, than trackbacks will be allowed
|
|
15 |
// trackbacks almost not used by users, but mostly used by spammers; pingbacks are always enabled
|
16 |
// more about the difference between trackback and pingback - http://web-profile.com.ua/web/trackback-vs-pingback/
|
17 |
|
18 |
-
define('ANTISPAM_VERSION', '3.
|
19 |
|
20 |
$antispam_settings = array(
|
21 |
'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
|
@@ -25,11 +25,12 @@ $antispam_settings = array(
|
|
25 |
);
|
26 |
|
27 |
include('anti-spam-functions.php');
|
|
|
28 |
|
29 |
if ( ! function_exists('antispam_enqueue_script')):
|
30 |
function antispam_enqueue_script() {
|
31 |
if (is_singular() && comments_open()) { // load script only for pages with comments form
|
32 |
-
wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-3.
|
33 |
}
|
34 |
}
|
35 |
add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
|
@@ -157,26 +158,6 @@ if ( ! is_admin()) {
|
|
157 |
endif; // end of antispam_check_comment()
|
158 |
|
159 |
|
160 |
-
if ( ! function_exists('antispam_admin_notice')):
|
161 |
-
function antispam_admin_notice() {
|
162 |
-
global $pagenow;
|
163 |
-
if ($pagenow == 'edit-comments.php'):
|
164 |
-
$antispam_stats = get_option('antispam_stats', array());
|
165 |
-
$blocked_total = $antispam_stats['blocked_total'];
|
166 |
-
?>
|
167 |
-
<div class="update-nag">
|
168 |
-
<p style="margin: 0;">
|
169 |
-
<?php echo $blocked_total; ?> spam comments were blocked by <a href="http://wordpress.org/plugins/anti-spam/">Anti-spam</a> plugin so far.
|
170 |
-
<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitaly" title="Anti-spam Pro">Upgrade to Pro</a>.
|
171 |
-
</p>
|
172 |
-
</div>
|
173 |
-
<?php
|
174 |
-
endif; // end of if($pagenow == 'edit-comments.php')
|
175 |
-
}
|
176 |
-
add_action('admin_notices', 'antispam_admin_notice');
|
177 |
-
endif; // end of antispam_admin_notice()
|
178 |
-
|
179 |
-
|
180 |
if ( ! function_exists('antispam_plugin_meta')):
|
181 |
function antispam_plugin_meta($links, $file) { // add some links to plugin meta row
|
182 |
if (strpos($file, 'anti-spam.php') !== false) {
|
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.4
|
7 |
Author: webvitaly
|
8 |
Author URI: http://web-profile.com.ua/wordpress/plugins/
|
9 |
License: GPLv3
|
15 |
// trackbacks almost not used by users, but mostly used by spammers; pingbacks are always enabled
|
16 |
// more about the difference between trackback and pingback - http://web-profile.com.ua/web/trackback-vs-pingback/
|
17 |
|
18 |
+
define('ANTISPAM_VERSION', '3.4');
|
19 |
|
20 |
$antispam_settings = array(
|
21 |
'send_spam_comment_to_admin' => $antispam_send_spam_comment_to_admin,
|
25 |
);
|
26 |
|
27 |
include('anti-spam-functions.php');
|
28 |
+
include('anti-spam-info.php');
|
29 |
|
30 |
if ( ! function_exists('antispam_enqueue_script')):
|
31 |
function antispam_enqueue_script() {
|
32 |
if (is_singular() && comments_open()) { // load script only for pages with comments form
|
33 |
+
wp_enqueue_script('anti-spam-script', plugins_url('/js/anti-spam-3.4.js', __FILE__), array('jquery'), null, true);
|
34 |
}
|
35 |
}
|
36 |
add_action('wp_enqueue_scripts', 'antispam_enqueue_script');
|
158 |
endif; // end of antispam_check_comment()
|
159 |
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
if ( ! function_exists('antispam_plugin_meta')):
|
162 |
function antispam_plugin_meta($links, $file) { // add some links to plugin meta row
|
163 |
if (strpos($file, 'anti-spam.php') !== false) {
|
js/{anti-spam-3.3.js → anti-spam-3.4.js}
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: webvitaly
|
3 |
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.
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 3.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
@@ -74,7 +74,8 @@ If the spammer will fill this trap-field with anything - the comment will be blo
|
|
74 |
|
75 |
You may enable sending all rejected spam comments to admin email.
|
76 |
Edit [anti-spam.php](http://plugins.trac.wordpress.org/browser/anti-spam/trunk/anti-spam.php) file and find "$antispam_send_spam_comment_to_admin" and make it "true".
|
77 |
-
|
|
|
78 |
|
79 |
= Does plugin block spam from Contact or other forms? =
|
80 |
|
@@ -111,6 +112,9 @@ The plugin is pretty small and easy to read.
|
|
111 |
|
112 |
|
113 |
== Changelog ==
|
|
|
|
|
|
|
114 |
= 3.3 - 2014-12-15 =
|
115 |
* refactor code structure
|
116 |
* added blocked spam counter in the comments section
|
@@ -118,13 +122,13 @@ The plugin is pretty small and easy to read.
|
|
118 |
|
119 |
= 3.2 - 2014-12-05 =
|
120 |
* added ANTISPAM_VERSION constant (thanks to jumbo)
|
121 |
-
* removed
|
122 |
|
123 |
= 3.1 - 2014-12-04 =
|
124 |
* remove log notices
|
125 |
|
126 |
= 3.0 - 2014-12-02 =
|
127 |
-
* added
|
128 |
* bugfixing
|
129 |
* enqueue script only for pages with comments form and in the footer (thanks to dougvdotcom)
|
130 |
* refactor code structure
|
2 |
Contributors: webvitaly
|
3 |
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.3
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 3.4
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
|
74 |
|
75 |
You may enable sending all rejected spam comments to admin email.
|
76 |
Edit [anti-spam.php](http://plugins.trac.wordpress.org/browser/anti-spam/trunk/anti-spam.php) file and find "$antispam_send_spam_comment_to_admin" and make it "true".
|
77 |
+
You can also find the info block with total spam blocked counter in the admin comments section.
|
78 |
+
You can hide or show this info block in the "Screen Options" section. The info block visibility option is saved per user.
|
79 |
|
80 |
= Does plugin block spam from Contact or other forms? =
|
81 |
|
112 |
|
113 |
|
114 |
== Changelog ==
|
115 |
+
= 3.4 - 2014-12-20 =
|
116 |
+
* added the ability to hide or show info block in the "Screen Options" section
|
117 |
+
|
118 |
= 3.3 - 2014-12-15 =
|
119 |
* refactor code structure
|
120 |
* added blocked spam counter in the comments section
|
122 |
|
123 |
= 3.2 - 2014-12-05 =
|
124 |
* added ANTISPAM_VERSION constant (thanks to jumbo)
|
125 |
+
* removed new spam-block algorithm because it is not needed
|
126 |
|
127 |
= 3.1 - 2014-12-04 =
|
128 |
* remove log notices
|
129 |
|
130 |
= 3.0 - 2014-12-02 =
|
131 |
+
* added new spam-block algorithm
|
132 |
* bugfixing
|
133 |
* enqueue script only for pages with comments form and in the footer (thanks to dougvdotcom)
|
134 |
* refactor code structure
|