Antispam Bee - Version 2.8.0

Version Description

This update makes sure your spam check is GDPR compliant, no matter the options you choose. Please make sure to update before May 25th!

Screenshots

  1. Antispam Bee settings
Download this release

Release Info

Developer websupporter
Plugin Icon 128x128 Antispam Bee
Version 2.8.0
Comparing to
See all releases

Code changes from version 2.7.1 to 2.8.0

Files changed (5) hide show
  1. antispam_bee.php +109 -94
  2. css/styles.css +4 -15
  3. css/styles.min.css +1 -1
  4. inc/gui.class.php +20 -35
  5. readme.txt +22 -16
antispam_bee.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /*
3
  * Plugin Name: Antispam Bee
4
- * Description: Easy and extremely productive spam-fighting plugin with many sophisticated solutions. Includes privacy hints and protection against trackback spam.
5
  * Author: pluginkollektiv
6
- * Author URI: http://pluginkollektiv.org
7
  * Plugin URI: https://wordpress.org/plugins/antispam-bee/
8
  * Text Domain: antispam-bee
9
  * Domain Path: /lang
10
  * License: GPLv2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
- * Version: 2.7.1
13
  */
14
 
15
  /*
@@ -377,14 +377,13 @@ class Antispam_Bee {
377
  'country_white' => '',
378
 
379
  'translate_api' => 0,
380
- 'translate_lang' => '',
381
 
382
- 'dnsbl_check' => 0,
383
  'bbcode_check' => 1,
384
 
385
  // Advanced
386
  'flag_spam' => 1,
387
- 'email_notify' => 1,
388
  'no_notice' => 0,
389
  'cronjob_enable' => 0,
390
  'cronjob_interval' => 0,
@@ -396,13 +395,12 @@ class Antispam_Bee {
396
  'ignore_reasons' => array(),
397
  ),
398
  'reasons' => array(
399
- 'css' => esc_attr__( 'CSS Hack', 'antispam-bee' ),
400
  'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
401
  'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
402
  'server' => esc_attr__( 'Fake IP', 'antispam-bee' ),
403
  'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
404
  'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
405
- 'dnsbl' => esc_attr__( 'Public Antispam DB', 'antispam-bee' ),
406
  'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
407
  'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
408
  'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ),
@@ -476,9 +474,7 @@ class Antispam_Bee {
476
  public static function load_plugin_lang()
477
  {
478
  load_plugin_textdomain(
479
- 'antispam-bee',
480
- false,
481
- 'antispam-bee/lang'
482
  );
483
  }
484
 
@@ -536,7 +532,7 @@ class Antispam_Bee {
536
  return array_merge(
537
  $input,
538
  array(
539
- '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8CH5FPR88QYML" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Donate', 'antispam-bee' ) . '</a>',
540
  '<a href="https://wordpress.org/support/plugin/antispam-bee" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Support', 'antispam-bee' ) . '</a>',
541
  )
542
  );
@@ -574,7 +570,7 @@ class Antispam_Bee {
574
  wp_register_style(
575
  'ab_style',
576
  plugins_url('css/styles.min.css', __FILE__),
577
- array(),
578
  $plugin['Version']
579
  );
580
  }
@@ -693,21 +689,15 @@ class Antispam_Bee {
693
  return $items;
694
  }
695
 
696
- // Icon styling
697
- echo '<style>#dashboard_right_now .ab-count:before {content: "\f117"}</style>';
698
 
699
  // Right now item
700
- $items[] = sprintf(
701
- '<a href="%s" class="ab-count">%s %s</a>',
702
- add_query_arg(
703
- array(
704
- 'page' => 'antispam_bee'
705
- ),
706
- admin_url( 'options-general.php' )
707
- ),
708
- esc_html( self::_get_spam_count() ),
709
- esc_html__('Blocked', 'antispam-bee')
710
- );
711
 
712
  return $items;
713
  }
@@ -1308,7 +1298,7 @@ class Antispam_Bee {
1308
  $output .= ' name="' . esc_attr( self::get_secret_name_for_post( self::$_current_post_id ) ) . '" ';
1309
  $output .= $matches['between1'] . $matches['between2'] . $matches['between3'];
1310
  $output .= $matches['after'] . '>';
1311
- $output .= '</textarea><textarea id="comment" aria-hidden="true" name="comment" autocomplete="nope" style="clip:rect(1px, 1px, 1px, 1px);position:absolute !important;white-space:nowrap;height:1px;width:1px;overflow:hidden;" tabindex="-1"></textarea>';
1312
 
1313
  $output .= $id_script;
1314
  $output .= $init_time_field;
@@ -1372,13 +1362,6 @@ class Antispam_Bee {
1372
  );
1373
  }
1374
 
1375
- // DNSBL spam
1376
- if ( $options['dnsbl_check'] && self::_is_dnsbl_spam($ip) ) {
1377
- return array(
1378
- 'reason' => 'dnsbl'
1379
- );
1380
- }
1381
-
1382
  // Check Country Code
1383
  if ( $options['country_code'] && self::_is_country_spam($ip) ) {
1384
  return array(
@@ -1499,13 +1482,6 @@ class Antispam_Bee {
1499
  );
1500
  }
1501
 
1502
- // DNSBL spam
1503
- if ( $options['dnsbl_check'] && self::_is_dnsbl_spam($ip) ) {
1504
- return array(
1505
- 'reason' => 'dnsbl'
1506
- );
1507
- }
1508
-
1509
  // Check Country Code
1510
  if ( $options['country_code'] && self::_is_country_spam($ip) ) {
1511
  return array(
@@ -1709,10 +1685,27 @@ class Antispam_Bee {
1709
  // Global
1710
  global $wpdb;
1711
 
1712
- // Default
1713
- $filter = array('`comment_author_IP` = %s');
1714
- $params = array( wp_unslash($ip) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1715
 
 
 
1716
  // Match the URL
1717
  if ( ! empty($url) ) {
1718
  $filter[] = '`comment_author_url` = %s';
@@ -1725,6 +1718,10 @@ class Antispam_Bee {
1725
  $params[] = wp_unslash($email);
1726
  }
1727
 
 
 
 
 
1728
  // Perform query
1729
  $result = $wpdb->get_var(
1730
  $wpdb->prepare(
@@ -1812,49 +1809,6 @@ class Antispam_Bee {
1812
  return ( ! in_array($country, $white) );
1813
  }
1814
 
1815
- /**
1816
- * Check for DNSBL spam
1817
- *
1818
- * @since 2.4.5
1819
- * @change 2.4.5
1820
- *
1821
- * @param string $ip IP address
1822
- * @return boolean TRUE for reported IP
1823
- */
1824
-
1825
- private static function _is_dnsbl_spam($ip)
1826
- {
1827
- // Start request
1828
- $response = wp_safe_remote_request(
1829
- esc_url_raw(
1830
- sprintf(
1831
- 'http://www.stopforumspam.com/api?ip=%s&f=json',
1832
- $ip
1833
- ),
1834
- 'http'
1835
- )
1836
- );
1837
-
1838
- // Response error?
1839
- if ( is_wp_error($response) ) {
1840
- return false;
1841
- }
1842
-
1843
- // Get JSON
1844
- $json = wp_remote_retrieve_body($response);
1845
-
1846
- // Decode JSON
1847
- $result = json_decode($json);
1848
-
1849
- // Empty data
1850
- if ( empty($result->success) ) {
1851
- return false;
1852
- }
1853
-
1854
- // Return status
1855
- return (bool) $result->ip->appears;
1856
- }
1857
-
1858
 
1859
  /**
1860
  * Check for BBCode spam
@@ -1963,7 +1917,7 @@ class Antispam_Bee {
1963
 
1964
  private static function _is_lang_spam( $comment_content ) {
1965
  // User defined language
1966
- $allowed_lang = self::get_option( 'translate_lang' );
1967
 
1968
  // Make comment text plain
1969
  $comment_text = wp_strip_all_tags( $comment_content );
@@ -2023,12 +1977,15 @@ class Antispam_Bee {
2023
  return false;
2024
  }
2025
 
 
 
 
2026
  // Get detected language
2027
- if ( ! $detected_lang = @$data_array['data']['detections'][0][0]['language'] ) {
2028
  return false;
2029
  }
2030
 
2031
- return ( $detected_lang != $allowed_lang );
2032
  }
2033
 
2034
  /**
@@ -2196,6 +2153,26 @@ class Antispam_Bee {
2196
  self::_go_in_peace();
2197
  }
2198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2199
  // Handle types
2200
  if ( $ignore_filter && (( $ignore_type == 1 && $is_ping ) or ( $ignore_type == 2 && !$is_ping )) ) {
2201
  self::_go_in_peace();
@@ -2210,9 +2187,9 @@ class Antispam_Bee {
2210
  // Mark spam
2211
  add_filter(
2212
  'pre_comment_approved',
2213
- create_function(
2214
- '',
2215
- 'return "spam";'
2216
  )
2217
  );
2218
 
@@ -2361,6 +2338,21 @@ class Antispam_Bee {
2361
  );
2362
  }
2363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2364
 
2365
  /**
2366
  * Delete spam reason as comment data
@@ -2509,7 +2501,18 @@ class Antispam_Bee {
2509
 
2510
  // Send
2511
  wp_mail(
2512
- get_bloginfo('admin_email'),
 
 
 
 
 
 
 
 
 
 
 
2513
  apply_filters(
2514
  'antispam_bee_notification_subject',
2515
  $subject
@@ -2664,6 +2667,18 @@ class Antispam_Bee {
2664
  (int) $post_id
2665
  );
2666
  }
 
 
 
 
 
 
 
 
 
 
 
 
2667
  }
2668
 
2669
 
1
  <?php
2
  /*
3
  * Plugin Name: Antispam Bee
4
+ * Description: Antispam plugin with a sophisticated tool set for effective day to day comment and trackback spam-fighting. Build with data protection and privacy in mind.
5
  * Author: pluginkollektiv
6
+ * Author URI: https://pluginkollektiv.org
7
  * Plugin URI: https://wordpress.org/plugins/antispam-bee/
8
  * Text Domain: antispam-bee
9
  * Domain Path: /lang
10
  * License: GPLv2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
+ * Version: 2.8.0
13
  */
14
 
15
  /*
377
  'country_white' => '',
378
 
379
  'translate_api' => 0,
380
+ 'translate_lang' => array(),
381
 
 
382
  'bbcode_check' => 1,
383
 
384
  // Advanced
385
  'flag_spam' => 1,
386
+ 'email_notify' => 0,
387
  'no_notice' => 0,
388
  'cronjob_enable' => 0,
389
  'cronjob_interval' => 0,
395
  'ignore_reasons' => array(),
396
  ),
397
  'reasons' => array(
398
+ 'css' => esc_attr__( 'Honeypot', 'antispam-bee' ),
399
  'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
400
  'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
401
  'server' => esc_attr__( 'Fake IP', 'antispam-bee' ),
402
  'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
403
  'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
 
404
  'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
405
  'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
406
  'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ),
474
  public static function load_plugin_lang()
475
  {
476
  load_plugin_textdomain(
477
+ 'antispam-bee'
 
 
478
  );
479
  }
480
 
532
  return array_merge(
533
  $input,
534
  array(
535
+ '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Donate', 'antispam-bee' ) . '</a>',
536
  '<a href="https://wordpress.org/support/plugin/antispam-bee" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Support', 'antispam-bee' ) . '</a>',
537
  )
538
  );
570
  wp_register_style(
571
  'ab_style',
572
  plugins_url('css/styles.min.css', __FILE__),
573
+ array( 'dashicons' ),
574
  $plugin['Version']
575
  );
576
  }
689
  return $items;
690
  }
691
 
692
+ // Icon styling
693
+ echo '<style>#dashboard_right_now .ab-count:before {content: "\f117"}</style>';
694
 
695
  // Right now item
696
+ $items[] = '<span class="ab-count">' . esc_html( sprintf(
697
+ __( '%d Blocked', 'antispam-bee' ),
698
+ self::_get_spam_count()
699
+ )
700
+ ) . '</span>';
 
 
 
 
 
 
701
 
702
  return $items;
703
  }
1298
  $output .= ' name="' . esc_attr( self::get_secret_name_for_post( self::$_current_post_id ) ) . '" ';
1299
  $output .= $matches['between1'] . $matches['between2'] . $matches['between3'];
1300
  $output .= $matches['after'] . '>';
1301
+ $output .= '</textarea><textarea id="comment" aria-hidden="true" name="comment" autocomplete="nope" style="padding:0;clip:rect(1px, 1px, 1px, 1px);position:absolute !important;white-space:nowrap;height:1px;width:1px;overflow:hidden;" tabindex="-1"></textarea>';
1302
 
1303
  $output .= $id_script;
1304
  $output .= $init_time_field;
1362
  );
1363
  }
1364
 
 
 
 
 
 
 
 
1365
  // Check Country Code
1366
  if ( $options['country_code'] && self::_is_country_spam($ip) ) {
1367
  return array(
1482
  );
1483
  }
1484
 
 
 
 
 
 
 
 
1485
  // Check Country Code
1486
  if ( $options['country_code'] && self::_is_country_spam($ip) ) {
1487
  return array(
1685
  // Global
1686
  global $wpdb;
1687
 
1688
+ $sql = '
1689
+ select
1690
+ meta_value as ip
1691
+ from
1692
+ ' . $wpdb->commentmeta . ' as meta,
1693
+ ' . $wpdb->comments . ' as comments
1694
+ where
1695
+ comments.comment_ID = meta.comment_id
1696
+ AND meta.meta_key = "antispam_bee_iphash"
1697
+ AND comments.comment_approved="spam"';
1698
+ $hashed_ips = $wpdb->get_col( $sql );
1699
+ if( ! empty( $hashed_ips) ) {
1700
+ foreach ( $hashed_ips as $hash ) {
1701
+ if( wp_check_password($ip, $hash) ) {
1702
+ return true;
1703
+ }
1704
+ }
1705
+ }
1706
 
1707
+ $params = array();
1708
+ $filter = array();
1709
  // Match the URL
1710
  if ( ! empty($url) ) {
1711
  $filter[] = '`comment_author_url` = %s';
1718
  $params[] = wp_unslash($email);
1719
  }
1720
 
1721
+ if( empty( $params ) ) {
1722
+ return false;
1723
+ }
1724
+
1725
  // Perform query
1726
  $result = $wpdb->get_var(
1727
  $wpdb->prepare(
1809
  return ( ! in_array($country, $white) );
1810
  }
1811
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1812
 
1813
  /**
1814
  * Check for BBCode spam
1917
 
1918
  private static function _is_lang_spam( $comment_content ) {
1919
  // User defined language
1920
+ $allowed_lang = (array) self::get_option( 'translate_lang' );
1921
 
1922
  // Make comment text plain
1923
  $comment_text = wp_strip_all_tags( $comment_content );
1977
  return false;
1978
  }
1979
 
1980
+ if( ! isset( $data_array['data']['detections'][0][0]['language'] ) ) {
1981
+ return false;
1982
+ }
1983
  // Get detected language
1984
+ if ( ! $detected_lang = $data_array['data']['detections'][0][0]['language'] ) {
1985
  return false;
1986
  }
1987
 
1988
+ return ! in_array( $detected_lang, $allowed_lang, true );
1989
  }
1990
 
1991
  /**
2153
  self::_go_in_peace();
2154
  }
2155
 
2156
+ // Save IP hash, if comment is spam.
2157
+ add_action(
2158
+ 'trackback_post',
2159
+ array(
2160
+ __CLASS__,
2161
+ 'save_ip_hash',
2162
+ ),
2163
+ 10,
2164
+ 3
2165
+ );
2166
+ add_action(
2167
+ 'comment_post',
2168
+ array(
2169
+ __CLASS__,
2170
+ 'save_ip_hash',
2171
+ ),
2172
+ 10,
2173
+ 3
2174
+ );
2175
+
2176
  // Handle types
2177
  if ( $ignore_filter && (( $ignore_type == 1 && $is_ping ) or ( $ignore_type == 2 && !$is_ping )) ) {
2178
  self::_go_in_peace();
2187
  // Mark spam
2188
  add_filter(
2189
  'pre_comment_approved',
2190
+ array(
2191
+ __CLASS__,
2192
+ 'return_spam'
2193
  )
2194
  );
2195
 
2338
  );
2339
  }
2340
 
2341
+ public static function save_ip_hash( $comment_id, $approved, $comment_data )
2342
+ {
2343
+ $hashed_ip = self::hash_ip( $comment_data['comment_author_IP'] );
2344
+ add_comment_meta(
2345
+ $comment_id,
2346
+ 'antispam_bee_iphash',
2347
+ $hashed_ip
2348
+ );
2349
+ }
2350
+
2351
+ public static function hash_ip($ip)
2352
+ {
2353
+ return wp_hash_password( $ip );
2354
+ }
2355
+
2356
 
2357
  /**
2358
  * Delete spam reason as comment data
2501
 
2502
  // Send
2503
  wp_mail(
2504
+ /**
2505
+ * Filters the recipients of the spam notification
2506
+ * @param array The recipients array.
2507
+ **/
2508
+ apply_filters(
2509
+ 'antispam_bee_notification_recipients',
2510
+ array( get_bloginfo('admin_email') )
2511
+ ),
2512
+ /**
2513
+ * Filters the subject of the spam notification
2514
+ * @param string $subject subject line.
2515
+ **/
2516
  apply_filters(
2517
  'antispam_bee_notification_subject',
2518
  $subject
2667
  (int) $post_id
2668
  );
2669
  }
2670
+
2671
+ /**
2672
+ * Returns 'spam'
2673
+ *
2674
+ * @since 2.7.3
2675
+ *
2676
+ * @return string
2677
+ */
2678
+ public static function return_spam() {
2679
+
2680
+ return 'spam';
2681
+ }
2682
  }
2683
 
2684
 
css/styles.css CHANGED
@@ -1,14 +1,3 @@
1
- /* @group Webfont */
2
-
3
- @font-face {
4
- font-family: icons;
5
- src: url('../font/icons.woff2') format('woff2'),
6
- url('../font/icons.woff') format('woff');
7
- }
8
-
9
- /* @end group */
10
-
11
-
12
  /* @group General */
13
 
14
  .ab-main *,
@@ -64,7 +53,7 @@
64
  text-transform: uppercase;
65
  }
66
  .ab-column h3.icon:before {
67
- font: normal 30px/30px icons;
68
  top: 4px;
69
  right: 20px;
70
  speak: none;
@@ -76,13 +65,13 @@
76
  -moz-osx-font-smoothing: grayscale;
77
  }
78
  .ab-column.ab-arrow h3.icon:before {
79
- content: '\2387';
80
  }
81
  .ab-column.ab-join h3.icon:before {
82
- content: '\e795';
83
  }
84
  .ab-column.ab-diff h3.icon:before {
85
- content: '\e73c';
86
  }
87
 
88
  .ab-column h6 {
 
 
 
 
 
 
 
 
 
 
 
1
  /* @group General */
2
 
3
  .ab-main *,
53
  text-transform: uppercase;
54
  }
55
  .ab-column h3.icon:before {
56
+ font: normal 30px/30px Dashicons;
57
  top: 4px;
58
  right: 20px;
59
  speak: none;
65
  -moz-osx-font-smoothing: grayscale;
66
  }
67
  .ab-column.ab-arrow h3.icon:before {
68
+ content: '\f536';
69
  }
70
  .ab-column.ab-join h3.icon:before {
71
+ content: '\f108';
72
  }
73
  .ab-column.ab-diff h3.icon:before {
74
+ content: '\f237';
75
  }
76
 
77
  .ab-column h6 {
css/styles.min.css CHANGED
@@ -1 +1 @@
1
- @font-face{font-family:icons;src:url(../font/icons.woff2) format('woff2'),url(../font/icons.woff) format('woff')}.ab-main *,.ab-main :after,.ab-main :before{border:0;margin:0;padding:0;outline:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.browsehappy{margin:0 0 20px;padding:10px;border:1px solid #e66f00;text-align:center}.ab-wrap{margin:0 0 0 -10px;padding:20px 0 0;text-rendering:optimizeLegibility}.ab-column{float:left;margin:0 0 0 10px;position:relative}.ab-column h3{margin:0;font-size:14px;font-weight:400;line-height:20px;text-transform:uppercase}.ab-column h3.icon:before{font:400 30px/30px icons;top:4px;right:20px;speak:none;width:1em;color:#8e959c;position:absolute;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ab-column.ab-arrow h3.icon:before{content:'\2387'}.ab-column.ab-join h3.icon:before{content:'\e795'}.ab-column.ab-diff h3.icon:before{content:'\e73c'}.ab-column h6{clear:both;color:#8e959c;margin:0 0 20px;font-size:10px;font-weight:400;text-transform:uppercase}.ab-column input[type=text],.ab-column input[type=number],.ab-column select{font-size:12px;text-align:center;background:#f8f8f9}.ab-column input[type=number]{padding:0}.ab-column select[multiple]{width:175px;min-height:60px}.ab-column input.ab-mini-field{width:40px}.ab-column .ab-medium-field{width:100%;max-width:285px}.ab-column input[type=text]+label,.ab-column select+label{color:#8e959c;margin:0 0 0 7px;display:inline-block;text-transform:uppercase}.ab-column>ul{padding:0 20px 0 0}.ab-column:last-of-type>ul{border:0}.ab-column>ul>li{width:330px;margin:0 0 36px;padding:10px 0 12px 12px;position:relative;background:#fff}.ab-column>ul>li a{text-decoration:none;border-bottom:1px dotted #e0e5e9}.ab-column>ul>li a:hover{border-color:inherit}.ab-column>ul>li label{cursor:default;display:inline-block;line-height:24px;max-width:286px}.ab-column>ul>li label span{color:#8e959c;display:block;font-size:12px;line-height:16px}.ab-column>ul>li:after,.ab-column>ul>li:before{width:0;content:'';position:absolute}.ab-column.ab-arrow>ul>li:after,.ab-column.ab-arrow>ul>li:before{left:157px;border-width:10px 10px 0;border-style:solid}.ab-column.ab-arrow>ul>li:before{bottom:-24px;border-color:#fff transparent}.ab-column.ab-arrow>ul>li:after{bottom:-22px;border-color:#f1f1f1 transparent}.ab-column.ab-join>ul>li:before{left:171px;bottom:-27px;height:18px;border-right:2px solid #fff}.ab-column.ab-diff>ul>li:before{left:162px;bottom:-19px;width:18px;height:0;border-bottom:2px solid #fff}.ab-column--submit-service{width:342px;margin-top:20px;padding-right:20px}.ab-column--submit-service p{padding:5px 0;margin:0;text-align:center;width:100%}.ab-column--submit-service p:first-of-type{border-top:1px solid #e0e5e9}.ab-column--submit-service p:last-of-type{border-bottom:1px solid #e0e5e9}.ab-column--submit-service .button{width:100%;margin:35px 0 10px}.ab-column>ul>li:last-of-type:after,.ab-column>ul>li:last-of-type:before{display:none}.ab-column>ul>li>ul{margin:10px 10px 0 26px;display:none}.ab-column>ul>li>ul li{padding:2px 0}.ab-column>ul>li>ul label{margin:0 0 0 7px}.ab-column>ul>li>input[type=checkbox]:checked~ul{display:block}
1
+ .ab-main *,.ab-main :after,.ab-main :before{border:0;margin:0;padding:0;outline:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.browsehappy{margin:0 0 20px;padding:10px;border:1px solid #e66f00;text-align:center}.ab-wrap{margin:0 0 0 -10px;padding:20px 0 0;text-rendering:optimizeLegibility}.ab-column{float:left;margin:0 0 0 10px;position:relative}.ab-column h3{margin:0;font-size:14px;font-weight:400;line-height:20px;text-transform:uppercase}.ab-column h3.icon:before{font:normal 30px/30px Dashicons;top:4px;right:20px;speak:none;width:1em;color:#8e959c;position:absolute;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ab-column.ab-arrow h3.icon:before{content:'\f536'}.ab-column.ab-join h3.icon:before{content:'\f108'}.ab-column.ab-diff h3.icon:before{content:'\f237'}.ab-column h6{clear:both;color:#8e959c;margin:0 0 20px;font-size:10px;font-weight:400;text-transform:uppercase}.ab-column input[type="text"],.ab-column input[type="number"],.ab-column select{font-size:12px;text-align:center;background:#f8f8f9}.ab-column input[type="number"]{padding:0}.ab-column select[multiple]{width:175px;min-height:60px}.ab-column input.ab-mini-field{width:40px}.ab-column .ab-medium-field{width:100%;max-width:285px}.ab-column input[type="text"] + label,.ab-column select + label{color:#8e959c;margin:0 0 0 7px;display:inline-block;text-transform:uppercase}.ab-column > ul{padding:0 20px 0 0}.ab-column:last-of-type > ul{border:0}.ab-column > ul > li{width:330px;margin:0 0 36px;padding:10px 0 12px 12px;position:relative;background:#fff}.ab-column > ul > li a{text-decoration:none;border-bottom:1px dotted #e0e5e9}.ab-column > ul > li a:hover{border-color:inherit}.ab-column > ul > li label{cursor:default;display:inline-block;line-height:24px;max-width:286px}.ab-column > ul > li label span{color:#8e959c;display:block;font-size:12px;line-height:16px}.ab-column > ul > li:after,.ab-column > ul > li:before{width:0;content:'';position:absolute}.ab-column.ab-arrow > ul > li:before,.ab-column.ab-arrow > ul > li:after{left:157px;border-width:10px 10px 0;border-style:solid}.ab-column.ab-arrow > ul > li:before{bottom:-24px;border-color:#fff transparent}.ab-column.ab-arrow > ul > li:after{bottom:-22px;border-color:#f1f1f1 transparent}.ab-column.ab-join > ul > li:before{left:171px;bottom:-27px;height:18px;border-right:2px solid #fff}.ab-column.ab-diff > ul > li:before{left:162px;bottom:-19px;width:18px;height:0;border-bottom:2px solid #fff}.ab-column--submit-service{width:342px;margin-top:20px;padding-right:20px}.ab-column--submit-service p{padding:5px 0;margin:0;text-align:center;width:100%}.ab-column--submit-service p:first-of-type{border-top:1px solid #e0e5e9}.ab-column--submit-service p:last-of-type{border-bottom:1px solid #e0e5e9}.ab-column--submit-service .button{width:100%;margin:35px 0 10px}.ab-column > ul > li:last-of-type:after,.ab-column > ul > li:last-of-type:before{display:none}.ab-column > ul > li > ul{margin:10px 10px 0 26px;display:none}.ab-column > ul > li > ul li{padding:2px 0}.ab-column > ul > li > ul label{margin:0 0 0 7px}.ab-column > ul > li > input[type="checkbox"]:checked ~ ul{display:block}
inc/gui.class.php CHANGED
@@ -33,8 +33,21 @@ class Antispam_Bee_GUI extends Antispam_Bee {
33
 
34
  // Check referer
35
  check_admin_referer('_antispam_bee__settings_nonce');
36
-
37
  // Determine options
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  $options = array(
39
  'flag_spam' => (int)(!empty($_POST['ab_flag_spam'])),
40
  'email_notify' => (int)(!empty($_POST['ab_email_notify'])),
@@ -61,13 +74,12 @@ class Antispam_Bee_GUI extends Antispam_Bee {
61
 
62
  'bbcode_check' => (int)(!empty($_POST['ab_bbcode_check'])),
63
  'gravatar_check' => (int)(!empty($_POST['ab_gravatar_check'])),
64
- 'dnsbl_check' => (int)(!empty($_POST['ab_dnsbl_check'])),
65
  'country_code' => (int)(!empty($_POST['ab_country_code'])),
66
  'country_black' => sanitize_text_field( wp_unslash( self::get_key( $_POST, 'ab_country_black' ) ) ),
67
  'country_white' => sanitize_text_field( wp_unslash( self::get_key( $_POST, 'ab_country_white' ) ) ),
68
 
69
  'translate_api' => (int)(!empty($_POST['ab_translate_api'])),
70
- 'translate_lang' => sanitize_text_field( wp_unslash( self::get_key($_POST, 'ab_translate_lang' ) ) ),
71
  );
72
 
73
  foreach( $options['ignore_reasons'] as $key => $val ) {
@@ -82,13 +94,6 @@ class Antispam_Bee_GUI extends Antispam_Bee {
82
  }
83
 
84
  // Translate API
85
- if ( !empty($options['translate_lang']) ) {
86
- $lang = self::get_allowed_translate_languages();
87
- $lang = array_keys( $lang );
88
- if ( ! in_array( $options['translate_lang'], $lang, true ) ) {
89
- $options['translate_lang'] = '';
90
- }
91
- }
92
  if ( empty($options['translate_lang']) ) {
93
  $options['translate_api'] = 0;
94
  }
@@ -275,31 +280,10 @@ class Antispam_Bee_GUI extends Antispam_Bee {
275
  </label>
276
  </li>
277
 
278
- <li>
279
- <input type="checkbox" name="ab_dnsbl_check" id="ab_dnsbl_check" value="1" <?php checked($options['dnsbl_check'], 1) ?> />
280
- <label for="ab_dnsbl_check">
281
- <?php esc_html_e( 'Use a public antispam database', 'antispam-bee' ); ?>
282
- <span><?php $link2 = sprintf(
283
- '<a href="%s" target="_blank" rel="noopener noreferrer">',
284
- esc_url( __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#use-a-public-antispam-database', 'antispam-bee' ),
285
- 'https' )
286
- );
287
- printf(
288
- /* translators: 1: opening <a> tag with link to documentation. 2: closing </a> tag. 3: opening <a> tag with link to documentation. 4: closing </a> tag. */
289
- esc_html__( 'Matching the ip address with %1$sStop Forum Spam%2$s. Please note the %3$sprivacy notice%4$s for this option.', 'antispam-bee' ),
290
- '<a href="https://www.stopforumspam.com/" target="_blank" rel="noopener noreferrer">',
291
- '</a>',
292
- $link2,
293
- '</a>'
294
- );
295
- ?></span>
296
- </label>
297
- </li>
298
-
299
  <li>
300
  <input type="checkbox" name="ab_country_code" id="ab_country_code" value="1" <?php checked($options['country_code'], 1) ?> />
301
  <label for="ab_country_code">
302
- <?php esc_html_e('Block comments from specific countries', 'antispam-bee') ?>
303
  <span><?php $link1 = sprintf(
304
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
305
  esc_url( __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#block-comments-from-specific-countries', 'antispam-bee' ),
@@ -366,11 +350,12 @@ class Antispam_Bee_GUI extends Antispam_Bee {
366
 
367
  <ul>
368
  <li>
369
- <select name="ab_translate_lang">
370
  <?php
371
  $lang = self::get_allowed_translate_languages();
 
372
  foreach( $lang as $k => $v ) { ?>
373
- <option <?php selected( $options['translate_lang'], $k ); ?> value="<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></option>
374
  <?php } ?>
375
  </select>
376
  <label for="ab_translate_lang">
@@ -514,7 +499,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
514
 
515
  <div class="ab-column ab-column--submit-service">
516
  <p>
517
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8CH5FPR88QYML" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Donate', 'antispam-bee' ); ?></a>
518
  </p>
519
  <p>
520
  <a href="<?php esc_html_e( 'https://wordpress.org/plugins/antispam-bee/faq/', 'antispam-bee' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'FAQ', 'antispam-bee' ); ?></a>
33
 
34
  // Check referer
35
  check_admin_referer('_antispam_bee__settings_nonce');
36
+
37
  // Determine options
38
+ $selected_languages_raw = wp_unslash( self::get_key($_POST, 'ab_translate_lang' ) );
39
+ if(!is_array($selected_languages_raw)) {
40
+ $selected_languages_raw = [];
41
+ }
42
+ $selected_languages = [];
43
+ $lang = self::get_allowed_translate_languages();
44
+ $lang = array_keys( $lang );
45
+ foreach ( $selected_languages_raw as $value ) {
46
+ if ( ! in_array( $value, $lang, true ) ) {
47
+ continue;
48
+ }
49
+ $selected_languages[] = $value;
50
+ }
51
  $options = array(
52
  'flag_spam' => (int)(!empty($_POST['ab_flag_spam'])),
53
  'email_notify' => (int)(!empty($_POST['ab_email_notify'])),
74
 
75
  'bbcode_check' => (int)(!empty($_POST['ab_bbcode_check'])),
76
  'gravatar_check' => (int)(!empty($_POST['ab_gravatar_check'])),
 
77
  'country_code' => (int)(!empty($_POST['ab_country_code'])),
78
  'country_black' => sanitize_text_field( wp_unslash( self::get_key( $_POST, 'ab_country_black' ) ) ),
79
  'country_white' => sanitize_text_field( wp_unslash( self::get_key( $_POST, 'ab_country_white' ) ) ),
80
 
81
  'translate_api' => (int)(!empty($_POST['ab_translate_api'])),
82
+ 'translate_lang' => $selected_languages,
83
  );
84
 
85
  foreach( $options['ignore_reasons'] as $key => $val ) {
94
  }
95
 
96
  // Translate API
 
 
 
 
 
 
 
97
  if ( empty($options['translate_lang']) ) {
98
  $options['translate_api'] = 0;
99
  }
280
  </label>
281
  </li>
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  <li>
284
  <input type="checkbox" name="ab_country_code" id="ab_country_code" value="1" <?php checked($options['country_code'], 1) ?> />
285
  <label for="ab_country_code">
286
+ <?php esc_html_e('Block or allow comments from specific countries', 'antispam-bee') ?>
287
  <span><?php $link1 = sprintf(
288
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
289
  esc_url( __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#block-comments-from-specific-countries', 'antispam-bee' ),
350
 
351
  <ul>
352
  <li>
353
+ <select multiple name="ab_translate_lang[]">
354
  <?php
355
  $lang = self::get_allowed_translate_languages();
356
+ $selected_languages = (array) $options['translate_lang'];
357
  foreach( $lang as $k => $v ) { ?>
358
+ <option <?php echo in_array( $k, $selected_languages, true ) ? 'selected="selected"' : ''; ?> value="<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></option>
359
  <?php } ?>
360
  </select>
361
  <label for="ab_translate_lang">
499
 
500
  <div class="ab-column ab-column--submit-service">
501
  <p>
502
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Donate', 'antispam-bee' ); ?></a>
503
  </p>
504
  <p>
505
  <a href="<?php esc_html_e( 'https://wordpress.org/plugins/antispam-bee/faq/', 'antispam-bee' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'FAQ', 'antispam-bee' ); ?></a>
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
  # Antispam Bee #
2
  * Contributors: pluginkollektiv
3
- * Tags: anti-spam, antispam, block spam, comment, comments, comment spam, pingback, prevention, protect, protection, spam, spam filter, trackback
4
- * Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8CH5FPR88QYML
5
- * Requires at least: 3.8
6
- * Tested up to: 4.9.4
7
- * Stable tag: 2.7.1
8
  * License: GPLv2 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Easy and extremely productive spam-fighting plugin with many sophisticated solutions. Includes protection against trackback spam and privacy hints.
12
 
13
  ## Description ##
14
- Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* blocks spam comments and trackbacks effectively and without captchas. It is free of charge, ad-free and compliant with European data privacy standards.
15
 
16
  ### Feature/Settings Overview ###
17
  * Trust approved commenters.
@@ -23,7 +23,6 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
23
  * Validate the IP address of commenters.
24
  * Use regular expressions.
25
  * Search local spam database for commenters previously marked as spammers.
26
- * Match against a public anti-spam database.
27
  * Notify admins by e-mail about incoming spam.
28
  * Delete existing spam after n days.
29
  * Limit approval to comments/pings (will delete other comment types).
@@ -44,7 +43,7 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
44
 
45
  ### Credits ###
46
  * Author: [Sergej Müller](https://sergejmueller.github.io/)
47
- * Maintainers: [pluginkollektiv](http://pluginkollektiv.org)
48
 
49
  ## Installation ##
50
  * If you don’t know how to install a plugin for WordPress, [here’s how](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
@@ -56,17 +55,14 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
56
  ### Settings ###
57
  After you have activated *Antispam Bee* the plugin will block spam comments out of the box. However, you may want to visit *Settings → Antispam Bee* to configure your custom set of anti-spam options that works best for your site.
58
 
59
- ### Privacy Notice ###
60
- On sites operating from within the EU the option *Use a public antispam database* should not be activated for privacy reasons. When that option has been activated, *Antispam Bee* will match full IP addresses from comments against a public spam database. Technically it is not possible to encrypt those IPs, because spam databases only store and operate with complete, unencrypted IP addresses.
61
-
62
  ## Frequently Asked Questions ##
63
 
64
  ### Does Antispam Bee work with Jetpack, Disqus Comments and other comment plugins? ###
65
  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.
66
  It also won’t work with any AJAX-powered comment forms.
67
 
68
- ### Does Antispam Bee store any private user data, IP addresses or the like? ###
69
- Nope. Antispam Bee is developed in Germany and Switzerland. You might have heard we can be a bit nitpicky over here when it comes to privacy.
70
 
71
  ### Will I have to edit any theme templates to get Antispam Bee to work? ###
72
  No, the plugin works as is. You may want to configure your favorite settings, though.
@@ -90,6 +86,16 @@ A complete documentation is available in the [GitHub repository Wiki](https://gi
90
 
91
  ## Changelog ##
92
 
 
 
 
 
 
 
 
 
 
 
93
  ### 2.7.1 ###
94
  * Fixes an incompatibility with Chrome autofill
95
  * Fixes some incompatibilities with other plugins/themes where the comment field was left empty
@@ -162,8 +168,8 @@ For the complete changelog, check out our [GitHub repository](https://github.com
162
 
163
  == Upgrade Notice ==
164
 
165
- = 2.7.1 =
166
- This update changes the actual markup of your comment fields. Please make sure that you flush your caches after the plugin was updated!
167
 
168
  ## Screenshots ##
169
  1. Antispam Bee settings
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: 4.9
7
+ * Stable tag: 2.8.0
8
  * License: GPLv2 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Antispam plugin with a sophisticated tool set for effective day to day comment and trackback spam-fighting. Build with data protection and privacy in mind.
12
 
13
  ## Description ##
14
+ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* blocks spam comments and trackbacks effectively, without captchas and without sending personal information to third party services. It is free of charge, ad-free and 100% GDPR compliant.
15
 
16
  ### Feature/Settings Overview ###
17
  * Trust approved commenters.
23
  * Validate the IP address of commenters.
24
  * Use regular expressions.
25
  * Search local spam database for commenters previously marked as spammers.
 
26
  * Notify admins by e-mail about incoming spam.
27
  * Delete existing spam after n days.
28
  * Limit approval to comments/pings (will delete other comment types).
43
 
44
  ### Credits ###
45
  * Author: [Sergej Müller](https://sergejmueller.github.io/)
46
+ * Maintainers: [pluginkollektiv](https://pluginkollektiv.org)
47
 
48
  ## Installation ##
49
  * If you don’t know how to install a plugin for WordPress, [here’s how](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
55
  ### Settings ###
56
  After you have activated *Antispam Bee* the plugin will block spam comments out of the box. However, you may want to visit *Settings → Antispam Bee* to configure your custom set of anti-spam options that works best for your site.
57
 
 
 
 
58
  ## Frequently Asked Questions ##
59
 
60
  ### Does Antispam Bee work with Jetpack, Disqus Comments and other comment plugins? ###
61
  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.
62
  It also won’t work with any AJAX-powered comment forms.
63
 
64
+ ### Does Antispam Bee store any private user data, and is it copmliant with GDPR? ###
65
+ Antispam Bee is developed in Europe. You might have heard we can be a bit nitpicky over here when it comes to privacy. The plugin does not save private user data and is 100% compliant with GDPR.
66
 
67
  ### Will I have to edit any theme templates to get Antispam Bee to work? ###
68
  No, the plugin works as is. You may want to configure your favorite settings, though.
86
 
87
  ## Changelog ##
88
 
89
+ ### 2.8.0 ###
90
+ * Removed stopforumspam.com to avoid potential GDPR violation
91
+ * Improves IP handling to comply with GDPR
92
+ * Improves PHP7.2 compatibility
93
+ * Fixes small bug on mobile views
94
+ * Allow more than one language in language check
95
+ * Minor interface improvements
96
+ * Remove old russian and Dutch translation files
97
+ * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
98
+
99
  ### 2.7.1 ###
100
  * Fixes an incompatibility with Chrome autofill
101
  * Fixes some incompatibilities with other plugins/themes where the comment field was left empty
168
 
169
  == Upgrade Notice ==
170
 
171
+ = 2.8.0 =
172
+ This update makes sure your spam check is GDPR compliant, no matter the options you choose. Please make sure to update before May 25th!
173
 
174
  ## Screenshots ##
175
  1. Antispam Bee settings