Antispam Bee - Version 2.9.3

Version Description

Download this release

Release Info

Developer Kau-Boy
Plugin Icon 128x128 Antispam Bee
Version 2.9.3
Comparing to
See all releases

Code changes from version 2.9.2 to 2.9.3

Files changed (6) hide show
  1. CHANGELOG.md +14 -0
  2. README.md +1 -1
  3. antispam_bee.php +29 -5
  4. inc/columns.class.php +3 -0
  5. inc/gui.class.php +1 -1
  6. readme.txt +21 -13
CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
  ## Changelog ##
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  ### 2.9.2 ###
5
  * **English**
1
  ## Changelog ##
2
 
3
+ ### 2.9.3 ###
4
+ * **English**
5
+ * Fixed: Compatibility with WordPress 5.5
6
+ * Fixed: Undefined index on spam list page
7
+ * Tweak: Better wording on settings page
8
+ * Tweak: AMP compatibility
9
+ * Tweak: Protect CSS from overwrite through bad themes
10
+
11
+ * **Deutsch**
12
+ * Fix: Kompatibilität mit WordPress 5.5
13
+ * Fix: Undefined index in Spamliste
14
+ * Tweak: Inklusivere Sprache unter Einstellungen
15
+ * Tweak: AMP-Kompatibilität
16
+ * Tweak: Schütze CSS besser vor Überschreiben durch schlechte Themes
17
 
18
  ### 2.9.2 ###
19
  * **English**
README.md CHANGED
@@ -11,7 +11,7 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
11
  * Trust approved commenters.
12
  * Trust commenters with a Gravatar.
13
  * Consider the comment time.
14
- * Treat BBCode as spam.
15
  * Validate the IP address of commenters.
16
  * Use regular expressions.
17
  * Search local spam database for commenters previously marked as spammers.
11
  * Trust approved commenters.
12
  * Trust commenters with a Gravatar.
13
  * Consider the comment time.
14
+ * Treat BBCode links as spam.
15
  * Validate the IP address of commenters.
16
  * Use regular expressions.
17
  * Search local spam database for commenters previously marked as spammers.
antispam_bee.php CHANGED
@@ -9,7 +9,7 @@
9
  * Domain Path: /lang
10
  * License: GPLv2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
- * Version: 2.9.2
13
  *
14
  * [](http://coderisk.com/wp/plugin/antispam-bee/RIPS-lAHLcgvqY8)
15
  *
@@ -449,6 +449,7 @@ class Antispam_Bee {
449
  'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
450
  'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
451
  'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
 
452
  'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
453
  'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
454
  'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
@@ -1221,15 +1222,17 @@ class Antispam_Bee {
1221
 
1222
  $id_script = '';
1223
  if ( ! empty( $matches['id1'] ) || ! empty( $matches['id2'] ) ) {
1224
- $output .= 'id="' . self::get_secret_id_for_post( self::$_current_post_id ) . '" ';
1225
- $id_script = '<script data-noptimize type="text/javascript">document.getElementById("comment").setAttribute( "id", "a' . substr( esc_js( md5( time() ) ), 0, 31 ) . '" );document.getElementById("' . esc_js( self::get_secret_id_for_post( self::$_current_post_id ) ) . '").setAttribute( "id", "comment" );</script>';
 
 
1226
  }
1227
 
1228
  $output .= ' name="' . esc_attr( self::get_secret_name_for_post( self::$_current_post_id ) ) . '" ';
1229
  $output .= $matches['between1'] . $matches['between2'] . $matches['between3'];
1230
  $output .= $matches['after'] . '>';
1231
  $output .= $matches['content'];
1232
- $output .= '</textarea><textarea id="comment" aria-hidden="true" name="comment" autocomplete="new-password" style="padding:0;clip:rect(1px, 1px, 1px, 1px);position:absolute !important;white-space:nowrap;height:1px;width:1px;overflow:hidden;" tabindex="-1"></textarea>';
1233
 
1234
  $output .= $id_script;
1235
  $output .= $init_time_field;
@@ -2188,6 +2191,18 @@ class Antispam_Bee {
2188
  return strpos( get_template_directory(), 'wptouch' );
2189
  }
2190
 
 
 
 
 
 
 
 
 
 
 
 
 
2191
 
2192
 
2193
  /*
@@ -2488,6 +2503,15 @@ class Antispam_Bee {
2488
  );
2489
  }
2490
 
 
 
 
 
 
 
 
 
 
2491
  // Body.
2492
  $body = sprintf(
2493
  "%s \"%s\"\r\n\r\n",
@@ -2504,7 +2528,7 @@ class Antispam_Bee {
2504
  ) . sprintf(
2505
  "%s: %s\r\n",
2506
  esc_html__( 'Type', 'antispam-bee' ),
2507
- esc_html( ( empty( $comment['comment_type'] ) ? __( 'Comment', 'antispam-bee' ) : __( 'Trackback', 'antispam-bee' ) ) )
2508
  ) . sprintf(
2509
  "Whois: http://whois.arin.net/rest/ip/%s\r\n",
2510
  $comment['comment_author_IP']
9
  * Domain Path: /lang
10
  * License: GPLv2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
+ * Version: 2.9.3
13
  *
14
  * [](http://coderisk.com/wp/plugin/antispam-bee/RIPS-lAHLcgvqY8)
15
  *
449
  'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
450
  'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
451
  'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
452
+ 'server' => esc_attr__( 'Fake IP', 'antispam-bee' ),
453
  'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
454
  'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
455
  'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
1222
 
1223
  $id_script = '';
1224
  if ( ! empty( $matches['id1'] ) || ! empty( $matches['id2'] ) ) {
1225
+ $output .= 'id="' . self::get_secret_id_for_post( self::$_current_post_id ) . '" ';
1226
+ if ( ! self::_is_amp() ) {
1227
+ $id_script = '<script data-noptimize type="text/javascript">document.getElementById("comment").setAttribute( "id", "a' . substr( esc_js( md5( time() ) ), 0, 31 ) . '" );document.getElementById("' . esc_js( self::get_secret_id_for_post( self::$_current_post_id ) ) . '").setAttribute( "id", "comment" );</script>';
1228
+ }
1229
  }
1230
 
1231
  $output .= ' name="' . esc_attr( self::get_secret_name_for_post( self::$_current_post_id ) ) . '" ';
1232
  $output .= $matches['between1'] . $matches['between2'] . $matches['between3'];
1233
  $output .= $matches['after'] . '>';
1234
  $output .= $matches['content'];
1235
+ $output .= '</textarea><textarea id="comment" aria-hidden="true" name="comment" autocomplete="new-password" style="padding:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;position:absolute !important;white-space:nowrap !important;height:1px !important;width:1px !important;overflow:hidden !important;" tabindex="-1"></textarea>';
1236
 
1237
  $output .= $id_script;
1238
  $output .= $init_time_field;
2191
  return strpos( get_template_directory(), 'wptouch' );
2192
  }
2193
 
2194
+ /**
2195
+ * Testing if we are on an AMP site.
2196
+ *
2197
+ * Starting with v2.0, amp_is_request() is the preferred method to check,
2198
+ * but we fall back to the then deprecated is_amp_endpoint() as needed.
2199
+ *
2200
+ * @return bool
2201
+ */
2202
+ private static function _is_amp() {
2203
+ return ( function_exists( 'amp_is_request' ) && amp_is_request() ) || ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() );
2204
+ }
2205
+
2206
 
2207
 
2208
  /*
2503
  );
2504
  }
2505
 
2506
+ // Prepare Comment Type.
2507
+ $comment_name = __( 'Comment', 'antispam-bee' );
2508
+ if ( 'trackback' === $comment['comment_type'] ) {
2509
+ $comment_name = __( 'Trackback', 'antispam-bee' );
2510
+ }
2511
+ if ( 'pingback' === $comment['comment_type'] ) {
2512
+ $comment_name = __( 'Pingback', 'antispam-bee' );
2513
+ }
2514
+
2515
  // Body.
2516
  $body = sprintf(
2517
  "%s \"%s\"\r\n\r\n",
2528
  ) . sprintf(
2529
  "%s: %s\r\n",
2530
  esc_html__( 'Type', 'antispam-bee' ),
2531
+ esc_html( $comment_name )
2532
  ) . sprintf(
2533
  "Whois: http://whois.arin.net/rest/ip/%s\r\n",
2534
  $comment['comment_author_IP']
inc/columns.class.php CHANGED
@@ -109,6 +109,9 @@ final class Antispam_Bee_Columns {
109
  $reasons = $wpdb->get_results( "SELECT meta_value FROM {$wpdb->prefix}commentmeta WHERE meta_key = 'antispam_bee_reason' group by meta_value", ARRAY_A );
110
 
111
  foreach ( $reasons as $reason ) {
 
 
 
112
  $label = Antispam_Bee::$defaults['reasons'][ $reason['meta_value'] ];
113
  echo "\t" . '<option value="' . esc_attr( $reason['meta_value'] ) . '"' . selected( $spam_reason, $reason['meta_value'], false ) . '>' . esc_html( $label ) . "</option>\n";
114
  }
109
  $reasons = $wpdb->get_results( "SELECT meta_value FROM {$wpdb->prefix}commentmeta WHERE meta_key = 'antispam_bee_reason' group by meta_value", ARRAY_A );
110
 
111
  foreach ( $reasons as $reason ) {
112
+ if ( ! isset( Antispam_Bee::$defaults['reasons'][ $reason['meta_value'] ] ) ) {
113
+ continue;
114
+ }
115
  $label = Antispam_Bee::$defaults['reasons'][ $reason['meta_value'] ];
116
  echo "\t" . '<option value="' . esc_attr( $reason['meta_value'] ) . '"' . selected( $spam_reason, $reason['meta_value'], false ) . '>' . esc_html( $label ) . "</option>\n";
117
  }
inc/gui.class.php CHANGED
@@ -239,7 +239,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
239
  <li>
240
  <input type="checkbox" name="ab_bbcode_check" id="ab_bbcode_check" value="1" <?php checked( $options['bbcode_check'], 1 ); ?> />
241
  <label for="ab_bbcode_check">
242
- <?php esc_html_e( 'BBCode is spam', 'antispam-bee' ); ?>
243
  <span><?php esc_html_e( 'Review the comment contents for BBCode links', 'antispam-bee' ); ?></span>
244
  </label>
245
  </li>
239
  <li>
240
  <input type="checkbox" name="ab_bbcode_check" id="ab_bbcode_check" value="1" <?php checked( $options['bbcode_check'], 1 ); ?> />
241
  <label for="ab_bbcode_check">
242
+ <?php esc_html_e( 'BBCode links are spam', 'antispam-bee' ); ?>
243
  <span><?php esc_html_e( 'Review the comment contents for BBCode links', 'antispam-bee' ); ?></span>
244
  </label>
245
  </li>
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  # Antispam Bee #
2
- * Contributors: pluginkollektiv
3
  * Tags: anti-spam, antispam, block spam, comment, comments, comment spam, pingback, spam, spam filter, trackback, GDPR
4
  * Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW
5
  * Requires at least: 4.5
6
- * Tested up to: 5.4
7
- * Stable tag: 2.9.2
 
8
  * License: GPLv2 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,7 +20,7 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
19
  * Consider the comment time.
20
  * Allow comments only in a certain language.
21
  * Block or allow commenters from certain countries.
22
- * Treat BBCode as spam.
23
  * Validate the IP address of commenters.
24
  * Use regular expressions.
25
  * Search local spam database for commenters previously marked as spammers.
@@ -58,6 +59,9 @@ After you have activated *Antispam Bee* the plugin will block spam comments out
58
 
59
  ## Frequently Asked Questions ##
60
 
 
 
 
61
  ### Does Antispam Bee work with Jetpack, Disqus Comments and other comment plugins? ###
62
  Antispam Bee works best with default WordPress comments. It is not compatible with Jetpack or Disqus Comments as those plugins load the comment form within an iframe. Thus Antispam Bee can not access the comment form directly.
63
  It also won’t work with any AJAX-powered comment forms.
@@ -77,21 +81,25 @@ If the antispam plugin has passed some spam comments, these comments can be repo
77
  ### Antispam Bee with Varnish? ###
78
  If WordPress is operated with Apache + Varnish, the actual IP address of the visitors does not appear in WordPress. Accordingly the Antispam-Plugin lacks the base for the correct functionality. An adaptation in the Varnish configuration file /etc/varnish/default.vcl provides a remedy and forwards the original (not from Apache) IP address in the HTTP header X-Forwarded-For:
79
 
80
- ```
81
- if (req.restarts == 0) {
82
- set req.http.X-Forwarded-For = client.ip;
83
- }
84
- ```
85
 
86
  ### Are there some paid services or limitations? ###
87
  No, Antispam Bee is free forever, for both private and commercial projects. You can use it on as many sites as you want. There is no limitation to the number of sites you use the plugin on.
88
 
89
- A complete documentation is available on [pluginkollektiv.org](https://antispambee.pluginkollektiv.org/documentation/.
90
 
91
  ## Changelog ##
92
 
 
 
 
 
 
 
 
93
  ### 2.9.2 ###
94
- * **English**
95
  * Fix: Delete comment meta for deleted old spam. For the cleanup of older orphaned comment meta we suggest the usage of [WP Sweep](https://wordpress.org/plugins/wp-sweep/)
96
  * Fix: Statistic in dashboard showed wrong value
97
  * Tweak: Change autocomplete attribute to "new-password"
@@ -130,7 +138,7 @@ A complete documentation is available on [pluginkollektiv.org](https://antispamb
130
  * Introduction of behat tests.
131
  * Updates the used JavaScript library for the statistics widget.
132
  * Bugfix in the "Comment form used outside of posts" option.
133
-
134
  ### 2.8.1 ###
135
  * PHP 5.3 compatibility
136
  * Bugfix where a spam trackback produced a fatal error
@@ -145,7 +153,7 @@ A complete documentation is available on [pluginkollektiv.org](https://antispamb
145
  * Minor interface improvements
146
  * Remove old russian and Dutch translation files
147
  * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
148
-
149
  ### 2.7.1 ###
150
  * Fixes an incompatibility with Chrome autofill
151
  * Fixes some incompatibilities with other plugins/themes where the comment field was left empty
1
  # Antispam Bee #
2
+ * Contributors: pluginkollektiv, websupporter, schlessera, zodiac1978, swissspidy, krafit, kau-boy
3
  * Tags: anti-spam, antispam, block spam, comment, comments, comment spam, pingback, spam, spam filter, trackback, GDPR
4
  * Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW
5
  * Requires at least: 4.5
6
+ * Tested up to: 5.6
7
+ * Requires PHP: 5.2
8
+ * Stable tag: 2.9.3
9
  * License: GPLv2 or later
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
20
  * Consider the comment time.
21
  * Allow comments only in a certain language.
22
  * Block or allow commenters from certain countries.
23
+ * Treat BBCode links as spam.
24
  * Validate the IP address of commenters.
25
  * Use regular expressions.
26
  * Search local spam database for commenters previously marked as spammers.
59
 
60
  ## Frequently Asked Questions ##
61
 
62
+ ### Does Antispam Bee prevents spam registrations or protects form plugins? ###
63
+ Antispam Bee works best with default WordPress comments. It does not help to protect form plugins and does not prevent spam registrations. Hopefully we can provide better hooks for third party plugins to use Antispam Bee to fill this gap in the forthcoming new major version.
64
+
65
  ### Does Antispam Bee work with Jetpack, Disqus Comments and other comment plugins? ###
66
  Antispam Bee works best with default WordPress comments. It is not compatible with Jetpack or Disqus Comments as those plugins load the comment form within an iframe. Thus Antispam Bee can not access the comment form directly.
67
  It also won’t work with any AJAX-powered comment forms.
81
  ### Antispam Bee with Varnish? ###
82
  If WordPress is operated with Apache + Varnish, the actual IP address of the visitors does not appear in WordPress. Accordingly the Antispam-Plugin lacks the base for the correct functionality. An adaptation in the Varnish configuration file /etc/varnish/default.vcl provides a remedy and forwards the original (not from Apache) IP address in the HTTP header X-Forwarded-For:
83
 
84
+ > if (req.restarts == 0) {
85
+ > set req.http.X-Forwarded-For = client.ip;
86
+ > }
 
 
87
 
88
  ### Are there some paid services or limitations? ###
89
  No, Antispam Bee is free forever, for both private and commercial projects. You can use it on as many sites as you want. There is no limitation to the number of sites you use the plugin on.
90
 
91
+ A complete documentation is available on [pluginkollektiv.org](https://antispambee.pluginkollektiv.org/documentation/).
92
 
93
  ## Changelog ##
94
 
95
+ ### 2.9.3 ###
96
+ * Fixed: Compatibility with WordPress 5.5
97
+ * Fixed: Undefined index on spam list page
98
+ * Tweak: Better wording on settings page
99
+ * Tweak: AMP compatibility
100
+ * Tweak: Protect CSS from overwrite through bad themes
101
+
102
  ### 2.9.2 ###
 
103
  * Fix: Delete comment meta for deleted old spam. For the cleanup of older orphaned comment meta we suggest the usage of [WP Sweep](https://wordpress.org/plugins/wp-sweep/)
104
  * Fix: Statistic in dashboard showed wrong value
105
  * Tweak: Change autocomplete attribute to "new-password"
138
  * Introduction of behat tests.
139
  * Updates the used JavaScript library for the statistics widget.
140
  * Bugfix in the "Comment form used outside of posts" option.
141
+
142
  ### 2.8.1 ###
143
  * PHP 5.3 compatibility
144
  * Bugfix where a spam trackback produced a fatal error
153
  * Minor interface improvements
154
  * Remove old russian and Dutch translation files
155
  * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
156
+
157
  ### 2.7.1 ###
158
  * Fixes an incompatibility with Chrome autofill
159
  * Fixes some incompatibilities with other plugins/themes where the comment field was left empty