Version Description
- let blog owner to choose to allow trackbacks or not (@dragonblogger)
=
Download this release
Release Info
Developer | commentluv |
Plugin | Growmap Anti Spambot Plugin |
Version | 1.03 |
Comparing to | |
See all releases |
Code changes from version 1.02 to 1.03
- growmap-anti-spambot-plugin.php +24 -10
- readme.txt +10 -3
growmap-anti-spambot-plugin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Growmap Anti Spambot Plugin
|
4 |
Plugin URI: http://www.growmap.com/growmap-anti-spambot-plugin/
|
5 |
Description: Very simple plugin that adds a client side generated checkbox to the comment form requesting that the user clicks it to prove they are not a spammer. Bots wont see it so their spam comment will be discarded.
|
6 |
-
Version: 1.
|
7 |
Author: Andy Bailey
|
8 |
Author URI: http://ComLuv.com
|
9 |
*/
|
@@ -80,7 +80,8 @@ function gasp_get_options(){
|
|
80 |
'no_checkbox_message' => __('You may have disabled javascript. Please enable javascript before leaving a comment on this site.','ab_gasp'),
|
81 |
'hidden_email_message' => __('You appear to be a spambot. Contact admin another way if you feel this message is in error','ab_gasp'),
|
82 |
'checkbox_label' => __('Confirm you are NOT a spammer','ab_gasp'),
|
83 |
-
|
|
|
84 |
);
|
85 |
$options = get_option('gasp_options',$default_options);
|
86 |
// update options with new defaults if upgrading from older version
|
@@ -88,8 +89,9 @@ function gasp_get_options(){
|
|
88 |
update_option('gasp_options',$default_options);
|
89 |
return $default_options;
|
90 |
}
|
91 |
-
if((float)$options['version'] < 1.
|
92 |
-
$options['version'] = '1.
|
|
|
93 |
update_option('gasp_options',$options);
|
94 |
}
|
95 |
return $options;
|
@@ -109,19 +111,23 @@ function gasp_options_sanitize($newoptions){
|
|
109 |
*/
|
110 |
function gasp_check_comment($commentdata){
|
111 |
// DebugBreak();
|
|
|
112 |
if($commentdata['comment_type'] == 'pingback' || $commentdata['comment_type'] == 'trackback'){
|
113 |
-
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
if(is_user_logged_in()){
|
116 |
-
|
117 |
}
|
118 |
-
$options = gasp_get_options();
|
119 |
if(!isset($_POST['gasp_checkbox'])){
|
120 |
-
|
121 |
} elseif (isset($_POST['gasp_email']) && $_POST['gasp_email'] !== ''){
|
122 |
-
|
123 |
} elseif ($_POST['gasp_checkbox'] === 'on') {
|
124 |
-
|
125 |
}
|
126 |
return $commentdata; // not needed but put it here anyway
|
127 |
}
|
@@ -145,6 +151,14 @@ function gasp_options_page(){
|
|
145 |
<td><?php _e('Checkbox Label','ab_gasp');?></td>
|
146 |
<td><input type="text" size="60" name="gasp_options[checkbox_label]" value="<?php echo $options['checkbox_label'];?>"/></td>
|
147 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
<tr><td colspan="2"><p><?php _e('These are the messages you will show the user if they forget to check the checkbox or if the comment looks like it was submitted by a spambot','ab_gasp');?></p></td></tr>
|
149 |
<tr><td width="30%">
|
150 |
<?php _e('There is only 1 situation where this can happen','ab_gasp'); ?>
|
3 |
Plugin Name: Growmap Anti Spambot Plugin
|
4 |
Plugin URI: http://www.growmap.com/growmap-anti-spambot-plugin/
|
5 |
Description: Very simple plugin that adds a client side generated checkbox to the comment form requesting that the user clicks it to prove they are not a spammer. Bots wont see it so their spam comment will be discarded.
|
6 |
+
Version: 1.03
|
7 |
Author: Andy Bailey
|
8 |
Author URI: http://ComLuv.com
|
9 |
*/
|
80 |
'no_checkbox_message' => __('You may have disabled javascript. Please enable javascript before leaving a comment on this site.','ab_gasp'),
|
81 |
'hidden_email_message' => __('You appear to be a spambot. Contact admin another way if you feel this message is in error','ab_gasp'),
|
82 |
'checkbox_label' => __('Confirm you are NOT a spammer','ab_gasp'),
|
83 |
+
'trackbacks' => 'yes',
|
84 |
+
'version' => '1.03'
|
85 |
);
|
86 |
$options = get_option('gasp_options',$default_options);
|
87 |
// update options with new defaults if upgrading from older version
|
89 |
update_option('gasp_options',$default_options);
|
90 |
return $default_options;
|
91 |
}
|
92 |
+
if((float)$options['version'] < 1.03){
|
93 |
+
$options['version'] = '1.03';
|
94 |
+
$options['trackbacks'] = 'yes';
|
95 |
update_option('gasp_options',$options);
|
96 |
}
|
97 |
return $options;
|
111 |
*/
|
112 |
function gasp_check_comment($commentdata){
|
113 |
// DebugBreak();
|
114 |
+
$options = gasp_get_options();
|
115 |
if($commentdata['comment_type'] == 'pingback' || $commentdata['comment_type'] == 'trackback'){
|
116 |
+
if($options['trackbacks'] == 'yes'){
|
117 |
+
return $commentdata;
|
118 |
+
} else {
|
119 |
+
exit;
|
120 |
+
}
|
121 |
}
|
122 |
if(is_user_logged_in()){
|
123 |
+
return $commentdata;
|
124 |
}
|
|
|
125 |
if(!isset($_POST['gasp_checkbox'])){
|
126 |
+
wp_die($options['no_checkbox_message']);
|
127 |
} elseif (isset($_POST['gasp_email']) && $_POST['gasp_email'] !== ''){
|
128 |
+
wp_die($options['hidden_email_message']);
|
129 |
} elseif ($_POST['gasp_checkbox'] === 'on') {
|
130 |
+
return $commentdata;
|
131 |
}
|
132 |
return $commentdata; // not needed but put it here anyway
|
133 |
}
|
151 |
<td><?php _e('Checkbox Label','ab_gasp');?></td>
|
152 |
<td><input type="text" size="60" name="gasp_options[checkbox_label]" value="<?php echo $options['checkbox_label'];?>"/></td>
|
153 |
</tr>
|
154 |
+
<tr valign="top" class="alt menu_option postbox">
|
155 |
+
<td><?php _e('Allow Trackbacks?','ab_gasp');?></td>
|
156 |
+
<td><input type="checkbox" name="gasp_options[trackbacks]" value="yes" <?php checked($options['trackbacks'],'yes');?>/>
|
157 |
+
(<?php _e('Unchecking the box will prevent ALL trackbacks', 'ab_gasp'); ?>)
|
158 |
+
<br/><?php _e('See this plugin if you want a trackback validation plugin that works well with GASP','ab_gasp');?>
|
159 |
+
<a href="http://wordpress.org/extend/plugins/simple-trackback-validation/" target="_blank">Simple Trackback Validation</a>
|
160 |
+
</td>
|
161 |
+
</tr>
|
162 |
<tr><td colspan="2"><p><?php _e('These are the messages you will show the user if they forget to check the checkbox or if the comment looks like it was submitted by a spambot','ab_gasp');?></p></td></tr>
|
163 |
<tr><td width="30%">
|
164 |
<?php _e('There is only 1 situation where this can happen','ab_gasp'); ?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:http://comluv.com/about/donate
|
|
4 |
Tags: comments, anti spam, spam, spambot, gasp
|
5 |
Requires at least: 2.9.2
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Defeat automated spambots by adding a client side generated checkbox asking the comment author to confirm that they are not a spammer.
|
10 |
|
@@ -44,6 +44,10 @@ If you're logged out, it only shows if you have javascript enabled.
|
|
44 |
If you are logged out and have javascript enabled and it is still not showing then you need to have the comment form action active in your comments.php theme file
|
45 |
` do_action('comment_form',$post->ID); `
|
46 |
|
|
|
|
|
|
|
|
|
47 |
== Screenshots ==
|
48 |
|
49 |
1. settings page
|
@@ -75,11 +79,14 @@ If you are logged out and have javascript enabled and it is still not showing th
|
|
75 |
= 1.02 =
|
76 |
* ignore trackbacks and pingbacks (@basicblogtips)
|
77 |
|
|
|
|
|
|
|
78 |
== Upgrade Notice ==
|
79 |
|
80 |
-
= 1.
|
81 |
|
82 |
-
*
|
83 |
|
84 |
== Configuration ==
|
85 |
|
4 |
Tags: comments, anti spam, spam, spambot, gasp
|
5 |
Requires at least: 2.9.2
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 1.03
|
8 |
|
9 |
Defeat automated spambots by adding a client side generated checkbox asking the comment author to confirm that they are not a spammer.
|
10 |
|
44 |
If you are logged out and have javascript enabled and it is still not showing then you need to have the comment form action active in your comments.php theme file
|
45 |
` do_action('comment_form',$post->ID); `
|
46 |
|
47 |
+
= I am allowing trackbacks but I am being trackback spammed! what do I do? =
|
48 |
+
|
49 |
+
You can download any of the number of trackback validation plugins which will check the trackback before allowing it or not.
|
50 |
+
|
51 |
== Screenshots ==
|
52 |
|
53 |
1. settings page
|
79 |
= 1.02 =
|
80 |
* ignore trackbacks and pingbacks (@basicblogtips)
|
81 |
|
82 |
+
= 1.03 =
|
83 |
+
* let blog owner to choose to allow trackbacks or not (@dragonblogger)
|
84 |
+
|
85 |
== Upgrade Notice ==
|
86 |
|
87 |
+
= 1.03 =
|
88 |
|
89 |
+
* added - let blog owner choose to allow trackbacks or not
|
90 |
|
91 |
== Configuration ==
|
92 |
|