Antispam Bee - Version 2.6.2

Version Description

  • English

    • Improving detection of fake IPs
    • Release time investment (Development & QA): 11 h
  • Deutsch

    • berarbeitung der Erkennung von geflschten IPs
    • Release-Zeitaufwand (Development & QA): 11 Stunden
Download this release

Release Info

Developer sergej.mueller
Plugin Icon 128x128 Antispam Bee
Version 2.6.2
Comparing to
See all releases

Code changes from version 2.6.1 to 2.6.2

antispam_bee.php CHANGED
@@ -8,7 +8,7 @@ Author: Sergej Müller
8
  Author URI: http://wpcoder.de
9
  Plugin URI: http://antispambee.com
10
  License: GPLv2 or later
11
- Version: 2.6.1
12
  */
13
 
14
  /*
@@ -323,7 +323,7 @@ class Antispam_Bee {
323
  * Initialisierung der internen Variablen
324
  *
325
  * @since 2.4
326
- * @change 2.5.2
327
  */
328
 
329
  private static function _init_internal_vars()
@@ -371,7 +371,7 @@ class Antispam_Bee {
371
  'reasons' => array(
372
  'css' => 'CSS Hack',
373
  'empty' => 'Empty Data',
374
- 'server' => 'Server IP',
375
  'localdb' => 'Local DB Spam',
376
  'country' => 'Country Check',
377
  'dnsbl' => 'DNSBL Spam',
@@ -491,7 +491,7 @@ class Antispam_Bee {
491
  * Meta-Links des Plugins
492
  *
493
  * @since 0.1
494
- * @change 2.6.1
495
  *
496
  * @param array $input Bereits vorhandene Links
497
  * @param string $file Aktuelle Seite
@@ -508,9 +508,9 @@ class Antispam_Bee {
508
  return array_merge(
509
  $input,
510
  array(
 
511
  '<a href="https://flattr.com/t/1323822" target="_blank">Flattr</a>',
512
- '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=5RDDW9FEHGLG6" target="_blank">PayPal</a>',
513
- '<a href="https://www.amazon.de/gp/registry/wishlist/2U5I7F9649LOJ/?layout=grid" target="_blank">Wishlist</a>'
514
  )
515
  );
516
  }
@@ -1355,7 +1355,7 @@ class Antispam_Bee {
1355
  }
1356
 
1357
  /* Bot erkannt */
1358
- if ( !empty($_POST['bee_spam']) ) {
1359
  return array(
1360
  'reason' => 'css'
1361
  );
@@ -1732,52 +1732,48 @@ class Antispam_Bee {
1732
 
1733
 
1734
  /**
1735
- * Prüfung auf eine gefälschte IP
1736
  *
1737
  * @since 2.0
1738
- * @change 2.5.1
1739
  *
1740
- * @param string $ip IP-Adresse
1741
- * @param string $host Host [optional]
1742
- * @return boolean TRUE bei gefälschter IP
1743
  */
1744
 
1745
- private static function _is_fake_ip($ip, $host = false)
1746
  {
1747
  /* Remote Host */
1748
- $hostbyip = gethostbyaddr($ip);
1749
 
1750
  /* IPv6 */
1751
- if ( !self::_is_ipv4($ip) ) {
1752
- return $ip != $hostbyip;
1753
  }
1754
 
1755
- /* IPv4 / Kommentar */
1756
- if ( empty($host) ) {
1757
- $found = strpos(
1758
- $ip,
1759
- self::_cut_ip(
1760
- gethostbyname($hostbyip)
1761
- )
1762
- );
1763
 
1764
  /* IPv4 / Trackback */
1765
  } else {
1766
- /* IP-Vergleich */
1767
- if ( $hostbyip == $ip ) {
1768
  return true;
1769
  }
1770
 
1771
- /* Treffer suchen */
1772
- $found = strpos(
1773
- $ip,
1774
- self::_cut_ip(
1775
- gethostbyname($host)
1776
- )
1777
- );
1778
  }
1779
 
1780
- return $found === false;
1781
  }
1782
 
1783
 
@@ -1785,7 +1781,7 @@ class Antispam_Bee {
1785
  * Prüfung auf unerwünschte Sprachen
1786
  *
1787
  * @since 2.0
1788
- * @change 2.4.2
1789
  *
1790
  * @param string $content Inhalt des Kommentars
1791
  * @return boolean TRUE bei Spam
@@ -1813,7 +1809,7 @@ class Antispam_Bee {
1813
  $response = wp_remote_get(
1814
  esc_url_raw(
1815
  sprintf(
1816
- 'http://translate.google.com/translate_a/t?client=x&text=%s',
1817
  $content
1818
  ),
1819
  'http'
@@ -1910,13 +1906,13 @@ class Antispam_Bee {
1910
 
1911
 
1912
  /**
1913
- * Prüfung auf eine IPv4-Adresse
1914
  *
1915
  * @since 2.4
1916
- * @change 2.4
1917
  *
1918
- * @param string $ip Zu prüfende IP
1919
- * @return integer Anzahl der Treffer
1920
  */
1921
 
1922
  private static function _is_ipv4($ip)
@@ -1925,6 +1921,22 @@ class Antispam_Bee {
1925
  }
1926
 
1927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1928
  /**
1929
  * Prüfung auf Mobile
1930
  *
8
  Author URI: http://wpcoder.de
9
  Plugin URI: http://antispambee.com
10
  License: GPLv2 or later
11
+ Version: 2.6.2
12
  */
13
 
14
  /*
323
  * Initialisierung der internen Variablen
324
  *
325
  * @since 2.4
326
+ * @change 2.6.2
327
  */
328
 
329
  private static function _init_internal_vars()
371
  'reasons' => array(
372
  'css' => 'CSS Hack',
373
  'empty' => 'Empty Data',
374
+ 'server' => 'Fake IP',
375
  'localdb' => 'Local DB Spam',
376
  'country' => 'Country Check',
377
  'dnsbl' => 'DNSBL Spam',
491
  * Meta-Links des Plugins
492
  *
493
  * @since 0.1
494
+ * @change 2.6.2
495
  *
496
  * @param array $input Bereits vorhandene Links
497
  * @param string $file Aktuelle Seite
508
  return array_merge(
509
  $input,
510
  array(
511
+ '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=ZAQUT9RLPW8QN" target="_blank">PayPal</a>',
512
  '<a href="https://flattr.com/t/1323822" target="_blank">Flattr</a>',
513
+ '<a href="https://www.amazon.de/registry/wishlist/2U5I7F9649LOJ/" target="_blank">Wishlist</a>'
 
514
  )
515
  );
516
  }
1355
  }
1356
 
1357
  /* Bot erkannt */
1358
+ if ( ! empty($_POST['bee_spam']) ) {
1359
  return array(
1360
  'reason' => 'css'
1361
  );
1732
 
1733
 
1734
  /**
1735
+ * Check for a fake IP
1736
  *
1737
  * @since 2.0
1738
+ * @change 2.6.2
1739
  *
1740
+ * @param string $ip Client IP
1741
+ * @param string $host Client Host [optional]
1742
+ * @return boolean TRUE if fake IP
1743
  */
1744
 
1745
+ private static function _is_fake_ip($client_ip, $client_host = false)
1746
  {
1747
  /* Remote Host */
1748
+ $host_by_ip = gethostbyaddr($client_ip);
1749
 
1750
  /* IPv6 */
1751
+ if ( self::_is_ipv6($client_ip) ) {
1752
+ return $client_ip != $host_by_ip;
1753
  }
1754
 
1755
+ /* IPv4 / Comment */
1756
+ if ( empty($client_host) ) {
1757
+ $ip_by_host = gethostbyname($host_by_ip);
1758
+
1759
+ if ( $ip_by_host === $host_by_ip ) {
1760
+ return false;
1761
+ }
 
1762
 
1763
  /* IPv4 / Trackback */
1764
  } else {
1765
+ if ( $host_by_ip === $client_ip ) {
 
1766
  return true;
1767
  }
1768
 
1769
+ $ip_by_host = gethostbyname($client_host);
1770
+ }
1771
+
1772
+ if ( strpos( $client_ip, self::_cut_ip($ip_by_host) ) === false ) {
1773
+ return true;
 
 
1774
  }
1775
 
1776
+ return false;
1777
  }
1778
 
1779
 
1781
  * Prüfung auf unerwünschte Sprachen
1782
  *
1783
  * @since 2.0
1784
+ * @change 2.6.2
1785
  *
1786
  * @param string $content Inhalt des Kommentars
1787
  * @return boolean TRUE bei Spam
1809
  $response = wp_remote_get(
1810
  esc_url_raw(
1811
  sprintf(
1812
+ 'https://translate.google.com/translate_a/t?client=x&text=%s',
1813
  $content
1814
  ),
1815
  'http'
1906
 
1907
 
1908
  /**
1909
+ * Check for an IPv4 address
1910
  *
1911
  * @since 2.4
1912
+ * @change 2.6.2
1913
  *
1914
+ * @param string $ip IP to validate
1915
+ * @return integer TRUE if IPv4
1916
  */
1917
 
1918
  private static function _is_ipv4($ip)
1921
  }
1922
 
1923
 
1924
+ /**
1925
+ * Check for an IPv6 address
1926
+ *
1927
+ * @since 2.6.2
1928
+ * @change 2.6.2
1929
+ *
1930
+ * @param string $ip IP to validate
1931
+ * @return boolean TRUE if IPv6
1932
+ */
1933
+
1934
+ private static function _is_ipv6($ip)
1935
+ {
1936
+ return ! self::_is_ipv4($ip);
1937
+ }
1938
+
1939
+
1940
  /**
1941
  * Prüfung auf Mobile
1942
  *
inc/gui.class.php CHANGED
@@ -439,7 +439,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
439
  <?php } ?>
440
 
441
  <p>
442
- <a href="https://flattr.com/t/1323822" target="_blank">Flattr</a> &bull; <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=5RDDW9FEHGLG6" target="_blank">PayPal</a> &bull; <a href="https://www.amazon.de/gp/registry/wishlist/2U5I7F9649LOJ/?layout=grid" target="_blank">Wishlist</a>
443
  </p>
444
  </div>
445
 
439
  <?php } ?>
440
 
441
  <p>
442
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=ZAQUT9RLPW8QN" target="_blank">PayPal</a> &bull; <a href="https://flattr.com/t/1323822" target="_blank">Flattr</a> &bull; <a href="https://www.amazon.de/registry/wishlist/2U5I7F9649LOJ/" target="_blank">Wishlist</a>
443
  </p>
444
  </div>
445
 
lang/antispam_bee-de_DE.mo CHANGED
Binary file
lang/antispam_bee-de_DE.po CHANGED
@@ -36,8 +36,8 @@ msgstr "Leere Daten"
36
  msgid "CSS Hack"
37
  msgstr "CSS Hack"
38
 
39
- msgid "Server IP"
40
- msgstr "Server IP"
41
 
42
  msgid "Local DB Spam"
43
  msgstr "Lokale Spamdatenbank"
36
  msgid "CSS Hack"
37
  msgstr "CSS Hack"
38
 
39
+ msgid "Fake IP"
40
+ msgstr "Gefälschte IP"
41
 
42
  msgid "Local DB Spam"
43
  msgstr "Lokale Spamdatenbank"
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Antispam Bee ===
2
  Contributors: sergej.mueller
3
  Tags: comment, spam, antispam, comments, trackback, protection, prevention
4
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RDDW9FEHGLG6
5
  Requires at least: 3.8
6
  Tested up to: 4.0
7
  Stable tag: trunk
@@ -10,7 +10,7 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
 
12
 
13
- „...another popular solution to fight spam is Antispam Bee“ – Matt Mullenweg, Q&A WordCamp Europe 2014
14
 
15
 
16
 
@@ -69,12 +69,7 @@ Anmeldefrei und ohne lästige Captchas.
69
 
70
 
71
  = Support =
72
- Freundlich formulierte Fragen rund um das Plugin werden per E-Mail beantwortet.
73
-
74
-
75
- = Systemanforderungen =
76
- * PHP 5.2.4
77
- * WordPress 3.8
78
 
79
 
80
  = Inkompatibilität =
@@ -84,12 +79,12 @@ Freundlich formulierte Fragen rund um das Plugin werden per E-Mail beantwortet.
84
 
85
 
86
  = Unterstützung =
87
- * Via [Flattr](https://flattr.com/t/1323822)
88
- * Via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RDDW9FEHGLG6)
89
- * Via [Wishlist](https://www.amazon.de/gp/registry/wishlist/2U5I7F9649LOJ/?layout=grid)
90
 
91
 
92
- = Handbücher =
93
  * [Antispam Bee: Antispam für WordPress](http://playground.ebiene.de/antispam-bee-wordpress-plugin/)
94
  * [Guide: Spam-Bekämpfung in WordPress](http://cup.wpcoder.de/wordpress-antispam-guide/)
95
 
@@ -109,13 +104,29 @@ Freundlich formulierte Fragen rund um das Plugin werden per E-Mail beantwortet.
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
 
112
  = 2.6.1 =
113
- * EN: Code refactoring of options management
114
- * DE: Überarbeitung der Optionen-Verwaltung
115
- * EN: Support for `HTTP_FORWARDED_FOR` header
116
- * DE: Berücksichtigung der Header `HTTP_FORWARDED_FOR`
117
- * *EN: Release time investment (Development & QA): 8,5 h*
118
- * *DE: Release-Zeitaufwand (Development & QA): 8,5 Stunden*
 
 
 
 
 
119
 
120
  = 2.6.0 =
121
  * DE: Optimierungen für WordPress 3.8
@@ -301,6 +312,18 @@ Freundlich formulierte Fragen rund um das Plugin werden per E-Mail beantwortet.
301
 
302
 
303
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  == Screenshots ==
305
 
306
  1. Antispam Bee Optionen
1
  === Antispam Bee ===
2
  Contributors: sergej.mueller
3
  Tags: comment, spam, antispam, comments, trackback, protection, prevention
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZAQUT9RLPW8QN
5
  Requires at least: 3.8
6
  Tested up to: 4.0
7
  Stable tag: trunk
10
 
11
 
12
 
13
+ „... another popular solution to fight spam is Antispam Bee“ – Matt Mullenweg, Q&A WordCamp Europe 2014
14
 
15
 
16
 
69
 
70
 
71
  = Support =
72
+ Fragen rund ums Plugin werden gern per E-Mail beantwortet. Beachtet auch die [Guidelines](https://plus.google.com/+SergejMüller/posts/Ex2vYGN8G2L).
 
 
 
 
 
73
 
74
 
75
  = Inkompatibilität =
79
 
80
 
81
  = Unterstützung =
82
+ * [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZAQUT9RLPW8QN)
83
+ * [Flattr](https://flattr.com/t/1323822)
84
+ * [Wishlist](https://www.amazon.de/registry/wishlist/2U5I7F9649LOJ/)
85
 
86
 
87
+ = Lesenswertes =
88
  * [Antispam Bee: Antispam für WordPress](http://playground.ebiene.de/antispam-bee-wordpress-plugin/)
89
  * [Guide: Spam-Bekämpfung in WordPress](http://cup.wpcoder.de/wordpress-antispam-guide/)
90
 
104
 
105
  == Changelog ==
106
 
107
+ = 2.6.2 =
108
+
109
+ * **English**
110
+ * Improving detection of fake IPs
111
+ * *Release time investment (Development & QA): 11 h*
112
+
113
+ * **Deutsch**
114
+ * Überarbeitung der Erkennung von gefälschten IPs
115
+ * *Release-Zeitaufwand (Development & QA): 11 Stunden*
116
+
117
+
118
  = 2.6.1 =
119
+
120
+ * **English**
121
+ * Code refactoring of options management
122
+ * Support for `HTTP_FORWARDED_FOR` header
123
+ * *Release time investment (Development & QA): 8,5 h*
124
+
125
+ * **Deutsch**
126
+ * Überarbeitung der Optionen-Verwaltung
127
+ * Berücksichtigung der Header `HTTP_FORWARDED_FOR`
128
+ * *Release-Zeitaufwand (Development & QA): 8,5 Stunden*
129
+
130
 
131
  = 2.6.0 =
132
  * DE: Optimierungen für WordPress 3.8
312
 
313
 
314
 
315
+ == Installation ==
316
+
317
+ = Requirements =
318
+ * WordPress 3.8 or greater
319
+ * PHP 5.2.4 or greater
320
+
321
+ = Installation =
322
+ * WordPress Dashboard > Plugins > Add New
323
+ * Search for *Antispam Bee* > Install
324
+ * Set plugin settings or leave the default values
325
+
326
+
327
  == Screenshots ==
328
 
329
  1. Antispam Bee Optionen