Antispam Bee - Version 2.9.2

Version Description

Download this release

Release Info

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

Code changes from version 2.9.1 to 2.9.2

Files changed (10) hide show
  1. CHANGELOG.md +586 -0
  2. LICENSE.txt +0 -0
  3. README.md +64 -0
  4. antispam_bee.php +97 -113
  5. css/styles.css +8 -0
  6. css/styles.min.css +1 -1
  7. inc/columns.class.php +57 -5
  8. inc/gui.class.php +10 -18
  9. phpunit.xml.dist +25 -0
  10. readme.txt +28 -10
CHANGELOG.md ADDED
@@ -0,0 +1,586 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Changelog ##
2
+
3
+
4
+ ### 2.9.2 ###
5
+ * **English**
6
+ * 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/)
7
+ * Fix: Statistic in dashboard showed wrong value
8
+ * Tweak: Change autocomplete attribute to "new-password"
9
+ * Tweak: Autoptimize compatibility improved
10
+ * Tweak: Renamed blacklist/whitelist to a better phrase
11
+ * Tweak: Added new pattern
12
+ * Tweak: UI and text optimizations
13
+ * Tweak: Better compatibility with some server configurations
14
+ * Tweak: Make spam reason sortable and filterable
15
+ * Tweak: Add spam reason for manually marked spam
16
+ * Maintenance: Deleted unused code
17
+ * Maintenance: Removed Fake IP check (unreliable and producing false positives)
18
+ * Maintenance: Fix some coding standard issues
19
+ * Maintenance: Tested up to WordPress 5.4
20
+ * Maintenance: Tested up to PHP 7.4
21
+
22
+
23
+ * **Deutsch**
24
+ * Fix: Lösche Kommentarmeta beim Löschen von Spamkommentaren. Für das Aufräumen alter verwaister Kommentarmetas empfehlen wir die Verwendung von [WP Sweep](https://de.wordpress.org/plugins/wp-sweep/)
25
+ * Fix: Dashboard Statistiken zeigten falschen Wert
26
+ * Tweak: Änderung des autocomplete Attributs zu "new-password"
27
+ * Tweak: Kompatibilität mit Autoptimize verbessert
28
+ * Tweak: "Blacklist/Whitelist" umbenannt
29
+ * Tweak: Neue Spamerkennungsmuster hinzugefügt
30
+ * Tweak: UI und Textverbesserungen
31
+ * Tweak: Erhöhte Kompatibilität mit einigen Serverkonfigurationen
32
+ * Tweak: Kommentare nach Spamgrund sortier- und filterbar gemacht
33
+ * Tweak: Neuer Spamgrund für manuell markierten Spam eingeführt
34
+ * Maintenance: Ungenutzter Code wurde gelöscht
35
+ * Maintenance: Der Fake IP check wurde entfernt. Dieser war unzuverlässig und produzierte falsche Ergebnisse
36
+ * Maintenance: Einige Probleme mit unseren Coding standards wurden gefixt
37
+ * Maintenance: Getestet bis WordPress 5.4
38
+ * Maintenance: Getestet bis PHP 7.4
39
+
40
+ ### 2.9.1 ###
41
+ * **English**
42
+ * Improved backend accessibility
43
+ * Prefilled comment textareas do now work with the honeypot
44
+ * Compatible with the AMP plugin (https://wordpress.org/plugins/amp/)
45
+ * Improved dashboard tooltips
46
+ * Improvements for the language detection API
47
+ * Scalable IP look up for local spam database
48
+
49
+
50
+ * **Deutsch**
51
+ * Verbesserte Barrierefreiheit im Backend
52
+ * Vorausgefüllte Kommentarfelder arbeiten jetzt mit dem Honeypot zusammen
53
+ * Kompatibel mit dem AMP Plugin (https://wordpress.org/plugins/amp/)
54
+ * Verbesserte Tooltips im Dashboard
55
+ * Verbesserte Kommunikation mit der Spracherkennungs-API
56
+ * Skalierbarer IP-Abgleich für den lokalen Datenbank-Check.
57
+
58
+ ### 2.9.0 ###
59
+ * **English**
60
+ * Introduction of coding standards.
61
+ * Switch to franc language detection API for the language check.
62
+ * Do not longer overwrite the IP address WordPress saves with the comment by using `pre_comment_user_ip`.
63
+ * Do not show "Trust commenters with a Gravatar" if the "Show Gravatar" option is not set.
64
+ * Skip the checks, when I ping myself.
65
+ * Fixes some wrong usages of the translation functions.
66
+ * Use the regular expressions check also for trackbacks.
67
+ * Add option to delete Antispam Bee related data when plugin gets deleted via the admin interface.
68
+ * Save a hashed + salted IP for every comment
69
+ * New check for incoming Trackbacks.
70
+ * Introduction of behat tests.
71
+ * Updates the used JavaScript library for the statistics widget.
72
+ * Bugfix in the "Comment form used outside of posts" option.
73
+
74
+ * **Deutsch**
75
+ * Einführung von Coding Standards.
76
+ * Wechsel auf die Franc Spracherkennungs API für den Sprach-Check.
77
+ * Beendet das Überschreiben der IP Adresse via `pre_comment_user_ip`, welche WordPress mit dem Kommentar speichert.
78
+ * Zeige die Option "Vertraue Kommentaren mit Gravatar" nur an wenn die Option "Zeige Gravatar" aktiviert ist.
79
+ * Überspringe die Filter, wenn ich mich selbst anpinge.
80
+ * Repariert einige falsche Verwendungsweisen der Übersetzungsfunktionalitäten.
81
+ * Wende den reguläre Ausdrücke Check auch auf Trackbacks an.
82
+ * Option hinzugefügt, dass Daten von Antispam Bee gelöscht werden, wenn das Plugin über das Admin Interface gelöscht wird.
83
+ * Speichere für jeden Kommentar eine salted Hash der IP Adresse.
84
+ * Ein neuer Check für eingehende Trackbacks.
85
+ * Einführung von Behat tests.
86
+ * Aktualisiert die genutzte JavaScript Bibliothek für das Statistik Widget.
87
+ * Bugfix in der "Kommentarformular wird außerhalb von Beiträgen verwendet" Einstellung
88
+
89
+ ### 2.8.1 ###
90
+
91
+ * **English**
92
+ * PHP 5.3 compatibility
93
+ * Bugfix where a spam trackback produced a fatal error
94
+ * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1
95
+
96
+ * **Deutsch**
97
+ * PHP 5.3 Kompatibilität wieder hergestellt
98
+ * Bugfix: Ein Spam Trackback produzierte einen Fatal Error
99
+ * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1
100
+
101
+ ### 2.8.0 ###
102
+
103
+ * **English**
104
+ * Removed stopforumspam.com to avoid potential GDPR violation
105
+ * Improves IP handling to comply with GDPR
106
+ * Improves PHP7.2 compatibility
107
+ * Fixes small bug on mobile views
108
+ * Allow more than one language in language check
109
+ * Minor interface improvements
110
+ * Remove old russian and Dutch translation files
111
+ * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
112
+
113
+ * **Deutsch**
114
+ - Entfernt stopforumspam.com zur Vorbeugung möglicher DSGVO-Verletzungen
115
+ - Verändert den Umgang mit IP-Adressen um der DSGVO zu entsprechen
116
+ - Verbessert PHP7.2-Kompatibilität
117
+ - Behebt einen CSS-Bugfix der mobilen Darstellung
118
+ - Erlaube mehr als eine Sprache im Sprachencheck
119
+ - Verberesserungen an der Benutzeroberfläche
120
+ - Entfernt alte russische und holländische Sprachversionen
121
+ - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
122
+
123
+ ### 2.7.1 ###
124
+
125
+ * **English**
126
+ * Fixes an incompatibility with Chrome autofill
127
+ * Fixes some incompatibilities with other plugins/themes where the comment field was left empty
128
+ * Support for RTL
129
+ * Solve some translation/language issues
130
+ * A new filter to add languages to the language check
131
+ * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1
132
+ * **Deutsch**
133
+ - Behebt eine Inkompatibilität mit Chromes Autofill-Funktion
134
+ - Behebt einige Inkompatibilitäten mit anderen Plugins/Themes, wo das Kommentarfeld leer bliebt
135
+ - Unterstützt RTL-Sprachen
136
+ - Behebt einige Probleme im Bereich Sprache/Übersetzung
137
+ - Bietet einen neuen Filter zum HInzufügen von Sprachen zum Sprach-Check
138
+ - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1
139
+
140
+ ### 2.7.0 ###
141
+ * **English**
142
+ * Country check is back again (thanks to Sergej Müller for his amazing work and the service page)
143
+ * Improved Honeypot
144
+ * Language check through Google Translate API is back again (thanks to [Simon Kraft](https://simonkraft.de/) for offering to cover the costs)
145
+ * More default Regexes
146
+ * Unit Test Framework
147
+ * Accessibility and GUI improvements
148
+ * An [english documentation](https://github.com/pluginkollektiv/antispam-bee/wiki) is now available, too. Some corrections in the german documentation.
149
+ * Some bugfixes - Among other things for WPML compatibility
150
+ * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1
151
+
152
+ * **Deutsch**
153
+ * Die Länderprüfung ist wieder zurück (dank an Sergej Müller für seine fantastische Arbeit und die Service-Seite)
154
+ * Der Honeypot wurde verbessert
155
+ * Die Sprachenprüfung über die Google Translate API ist wieder zurück (Dank an [Simon Kraft](https://simonkraft.de/), der sich angeboten hat, die Kosten zu übernehmen)
156
+ * Mehr Standard-Regexe
157
+ * Verbesserungen an Barrierefreiheit und Benutzer-Oberfläche
158
+ * Eine [englische Dokumentation](https://github.com/pluginkollektiv/antispam-bee/wiki) ist jetzt verfügbar. Einige Korrekturen in der deutschen Dokumentation.
159
+ * Einige Fehlerkorrekturen - Unter anderem für WPML-Kompatibilität
160
+ * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1
161
+
162
+ ### 2.6.9 ###
163
+ * **English**
164
+ * Updates donation links throughout the plugin
165
+ * Fixes an error were JavaScript on the dashboard was erroneously being enqueued
166
+ * Ensures compatibility with the latest WordPress version
167
+ * **Deutsch**
168
+ * Aktualisierung der Spenden Links im gesamten Plugin
169
+ * Behebt einen Fehler, durch den auf dem Dashboard fälschlicherweise JavaScript geladen wird
170
+ * Gewährleistet die Kompatibilität mit der neuesten WordPress-Version
171
+
172
+ ### 2.6.8 ###
173
+ * **English**
174
+ * added a POT file
175
+ * updated German translation, added formal version
176
+ * updated plugin text domain to include a dash instead of an underscore
177
+ * updated, translated + formatted README.md
178
+ * updated expired link URLs in plugin and languages files
179
+ * updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720)
180
+ * **Deutsch**
181
+ * eine POT-Datei hinzugefügt
182
+ * deutsche Übersetzung aktualisiert, formale Version hinzugefügt
183
+ * Die Text Domain des Plugins in der ReadMe aktualisiert. Statt einem Unterstrich enthält der Name nun ein Bindestrich.
184
+ * README.md aktualisiert, übersetzt und formatiert
185
+ * verwaiste Link-Adressen in dem Plugin und den Sprachdateien aktualisiert
186
+ * [Plugin Autor](https://gist.github.com/glueckpress/f058c0ab973d45a72720) aktualisiert
187
+
188
+ ### 2.6.7 ###
189
+ * **English**
190
+ * Removal of functions *Block comments from specific countries* and *Allow comments only in certain language* for financial reasons
191
+ * **Deutsch**
192
+ * Entfernung der Funktionen *Kommentare nur in einer Sprache zulassen* und *Bestimmte Länder blockieren bzw. erlauben* aus finanziellen Gründen - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/news/2015/removal-of-allow-comments-only-in-certain-language/)
193
+
194
+ ### 2.6.6 ###
195
+ * **English**
196
+ * Switch to the official Google Translation API
197
+ * *Release time investment (Development & QA): 2.5 h*
198
+ * **Deutsch**
199
+ * (Testweise) Umstellung auf die offizielle Google Translation API
200
+ * *Release-Zeitaufwand (Development & QA): 2,5 Stunden*
201
+
202
+ ### 2.6.5 ###
203
+ * **English**
204
+ * Fix: Return parameters on `dashboard_glance_items` callback / thx [@toscho](https://twitter.com/toscho)
205
+ * New function: [Trust commenters with a Gravatar](https://antispambee.pluginkollektiv.org/documentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress)
206
+ * Additional plausibility checks and filters
207
+ * *Release time investment (Development & QA): 12 h*
208
+ * **Deutsch**
209
+ * Fix: Parameter-Rückgabe bei `dashboard_glance_items` / thx [@toscho](https://twitter.com/toscho)
210
+ * Neue Funktion: [Kommentatoren mit Gravatar vertrauen](https://antispambee.pluginkollektiv.org/de/dokumentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress)
211
+ * Zusätzliche Plausibilitätsprüfungen und Filter
212
+ * *Release-Zeitaufwand (Development & QA): 12 Stunden*
213
+
214
+ ### 2.6.4 ###
215
+ * **English**
216
+ * Consideration of the comment time (Spam if a comment was written in less than 5 seconds)
217
+ * *Release time investment (Development & QA): 6.25 h*
218
+ * **Deutsch**
219
+ * Berücksichtigung der Kommentarzeit (Spam, wenn ein Kommentar in unter 5 Sekunden verfasst) - [Hintergrund-Informationen](https://antispambee.pluginkollektiv.org/news/2014/antispam-bee-2-6-4/)
220
+ * *Release-Zeitaufwand (Development & QA): 6,25 Stunden*
221
+
222
+ ### 2.6.3 ###
223
+ * **English**
224
+ * Sorting for the Antispam Bee column in the spam comments overview
225
+ * Code refactoring around the use of REQUEST_URI
226
+ * *Release time investment (Development & QA): 2.75 h*
227
+ * **Deutsch**
228
+ * Sortierung für die Antispam Bee Spalte in der Spam-Übersicht
229
+ * Code-Refactoring rund um die Nutzung von REQUEST_URI
230
+ * *Release-Zeitaufwand (Development & QA): 2,75 Stunden*
231
+
232
+ ### 2.6.2 ###
233
+ * **English**
234
+ * Improving detection of fake IPs
235
+ * *Release time investment (Development & QA): 11 h*
236
+ * **Deutsch**
237
+ * Überarbeitung der Erkennung von gefälschten IPs
238
+ * *Release-Zeitaufwand (Development & QA): 11 Stunden*
239
+
240
+ ### 2.6.1 ###
241
+ * **English**
242
+ * Code refactoring of options management
243
+ * Support for `HTTP_FORWARDED_FOR` header
244
+ * *Release time investment (Development & QA): 8.5 h*
245
+ * **Deutsch**
246
+ * Überarbeitung der Optionen-Verwaltung
247
+ * Berücksichtigung der Header `HTTP_FORWARDED_FOR`
248
+ * *Release-Zeitaufwand (Development & QA): 8,5 Stunden*
249
+
250
+ ### 2.6.0 ###
251
+ * **English**
252
+ * Optimizations for WordPress 3.8
253
+ * Clear invalid UTF-8 characters in comment fields
254
+ * Spam reason as a column in the table with spam comments
255
+ * **Deutsch**
256
+ * Optimierungen für WordPress 3.8
257
+ * Zusatzprüfung auf Nicht-UTF-8-Zeichen in Kommentardaten
258
+ * Spamgrund als Spalte in der Übersicht mit Spamkommentaren
259
+
260
+ ### 2.5.9 ###
261
+ * **English**
262
+ * Dashboard widget changes to work with [Statify](http://statify.de)
263
+ * **Deutsch**
264
+ * Anpassung des Dashboard-Skriptes für die Zusammenarbeit mit [Statify](http://statify.de)
265
+
266
+ ### 2.5.8 ###
267
+ * **English**
268
+ * Switch from TornevallDNSBL to [Stop Forum Spam](http://www.stopforumspam.com)
269
+ * New JS library for the Antispam Bee dashboard chart
270
+ * **Deutsch**
271
+ * Umstellung von TornevallDNSBL zu [Stop Forum Spam](http://www.stopforumspam.com)
272
+ * Neue JS-Bibliothek für das Dashboard-Widget
273
+
274
+ ### 2.5.7 ###
275
+ * **English**
276
+ * Optional logfile with spam entries e.g. for [Fail2Ban](https://help.ubuntu.com/community/Fail2ban)
277
+ * Filter `antispam_bee_notification_subject` for a custom subject in notifications
278
+ * **Deutsch**
279
+ * Optionale Spam-Logdatei z.B. für [Fail2Ban](https://wiki.ubuntuusers.de/fail2ban/)
280
+ * Filter `antispam_bee_notification_subject` für eigenen Betreff in Benachrichtigungen
281
+
282
+ ### 2.5.6 ###
283
+ * **English**
284
+ * [Added new detection/patterns for spam comments](https://antispambee.pluginkollektiv.org/news/2013/new-patterns-in-antispam-bee-2-5-6/)
285
+ * **Deutsch**
286
+ * [Neue Erkennungsmuster für Spam hinzugefügt](https://antispambee.pluginkollektiv.org/de/news/2013/neue-erkennungsmuster-in-antispam-bee-2-5-6/)
287
+
288
+ ### 2.5.5 ###
289
+ * **English**
290
+ * Detection and filtering of spam comments that try to exploit the latest [W3 Total Cache and WP Super Cache Vulnerability](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html).
291
+ * **Deutsch**
292
+ * Erkennung und Ausfilterung von Spam-Kommentaren, die versuchen, [Sicherheitslücken von W3 Total Cache und WP Super Cache](http://blog.sucuri.net/2013/05/w3-total-cache-and-wp-super-cache-vulnerability-being-targeted-in-the-wild.html) auszunutzen. [Ausführliche Informationen](https://antispambee.pluginkollektiv.org/de/news/2013/antispam-bee-nun-auch-als-antimalware-plugin/).
293
+
294
+ ### 2.5.4 ###
295
+ * **English**
296
+ * Jubilee edition
297
+ * New mascot for Antispam Bee
298
+ * Advanced Scanning on IP, URL and e-mail address of incoming comments in local blog spam database
299
+ * **Deutsch**
300
+ * Jubiläumsausgabe: [Details zum Update](https://plus.googlehttps://antispambee.pluginkollektiv.org/de/news/2013/jubilaeumsausgabe-antispam-bee-2-5-4/)
301
+ * Neues Maskottchen für Antispam Bee
302
+ * Erweiterte Prüfung eingehender Kommentare in lokaler Blog-Spamdatenbank auf IP, URL und E-Mail-Adresse
303
+
304
+ ### 2.5.3 ###
305
+ * **English**
306
+ * Optimization of regular expression
307
+ * **Deutsch**
308
+ * Optimierung des Regulären Ausdrucks
309
+
310
+ ### 2.5.2 ###
311
+ * **English**
312
+ * New: Use of regular expressions with predefined and own identification patterns
313
+ * Change the filter order
314
+ * Improvements to the language file
315
+ * **Deutsch**
316
+ * Neu: [Reguläre Ausdrücke anwenden](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#regex) mit vordefinierten und eigenen Erkennungsmustern
317
+ * Änderung der Filter-Reihenfolge
318
+ * Verbesserungen an der Sprachdatei
319
+
320
+ ### 2.5.1 ###
321
+ * **English**
322
+ * Treat BBCode as spam
323
+ * IP anonymization in the country evaluation
324
+ * More transparency by added Privacy Policy
325
+ * PHP 5.2.4 as a requirement (is also the prerequisite for WP 3.4)
326
+ * **Deutsch**
327
+ * [BBCode im Kommentar als Spamgrund](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#bbcode)
328
+ * IP-Anonymisierung bei der Länderprüfung
329
+ * [Mehr Transparenz](https://antispambee.pluginkollektiv.org/de/news/2012/datenschutz-update/) durch hinzugefügte Datenschutzhinweise
330
+ * PHP 5.2.4 als Voraussetzung (ist zugleich die Voraussetzung für WP 3.4)
331
+
332
+ ### 2.5.0 ###
333
+ * **English**
334
+ * [Edition 2012](https://antispambee.pluginkollektiv.org/news/2012/edition-2012/)
335
+ * **Deutsch**
336
+ * [Edition 2012](https://antispambee.pluginkollektiv.org/de/news/2012/edition-2012/)
337
+
338
+ ### 2.4.6 ###
339
+ * **English**
340
+ * Russian translation
341
+ * Change the secret string
342
+ * **Deutsch**
343
+ * Russische Übersetzung
344
+ * Veränderung der Secret-Zeichenfolge
345
+
346
+ ### 2.4.5 ###
347
+ * **English**
348
+ * Revised layout settings
349
+ * Deletion of Project Honey Pot
350
+ * TornevallNET as new DNSBL service
351
+ * WordPress 3.4 as a minimum requirement
352
+ * WordPress 3.5 support
353
+ * Recast of the online manual
354
+ * **Deutsch**
355
+ * Überarbeitetes Layout der Einstellungen
356
+ * Streichung von Project Honey Pot
357
+ * TornevallNET als neuer DNSBL-Dienst
358
+ * WordPress 3.4 als Mindestvoraussetzung
359
+ * WordPress 3.5 Unterstützung
360
+ * Neufassung des Online-Handbuchs
361
+
362
+ ### 2.4.4 ###
363
+ * **English**
364
+ * Technical and visual support for WordPress 3.5
365
+ * Modification of the file structure: from `xyz.dev.css` to `xyz.min.css`
366
+ * Retina screenshot
367
+ * **Deutsch**
368
+ * Technische und optische Unterstützung für WordPress 3.5
369
+ * Änderung der Dateistruktur: von `xyz.dev.css` zu `xyz.min.css`
370
+ * Retina Bildschirmfoto
371
+
372
+ ### 2.4.3 ###
373
+ * **English**
374
+ * Check for basic requirements
375
+ * Remove the sidebar plugin icon
376
+ * Set the Google API calls to SSL
377
+ * Compatibility with WordPress 3.4
378
+ * Add retina plugin icon on options
379
+ * Depending on WordPress settings: anonymous comments allowed
380
+ * **Deutsch**
381
+ * Mindestvoraussetzungen werden nun überprüft
382
+ * Entfernung des Plugin Icons in der Sidebar
383
+ * Google API Aufrufe auf SSL umgestellt
384
+ * Kompatibilität mit WordPress 3.4
385
+ * Retina Plugin Icon in den Einstellungen hinzugefügt
386
+ * In Abhängigkeit zu den Wordpress-Einstellungen: anonyme Kommentare erlauben
387
+
388
+ ### 2.4.2 ###
389
+ * **English**
390
+ * New geo ip location service (without the api key)
391
+ * Code cleanup: Replacement of `@` characters by a function
392
+ * JS-Fallback for missing jQuery UI
393
+ * **Deutsch**
394
+ * Neuer IP-Geolocation-Dienst (ohne api key)
395
+ * Quelltext aufgeräumt: Austausch von `@` Zeichen durch eine Funktion
396
+ * S-Fallback für fehlende jQuery UI
397
+
398
+ ### 2.4.1 ###
399
+ * **English**
400
+ * Add russian translation
401
+ * Fix for the textarea replace
402
+ * Detect and hide admin notices
403
+ * **Deutsch**
404
+ * Russian Übersetzung hinzugefügt
405
+ * Fehlerbehebung bei dem ersetzten Textfeld
406
+ * Erkennen und verstecken von Admin-Mitteilungen
407
+
408
+ ### 2.4 ###
409
+ * **English**
410
+ * Support for IPv6
411
+ * Source code revision
412
+ * Delete spam by reason
413
+ * Changing the user interface
414
+ * Requirements: PHP 5.1.2 and WordPress 3.3
415
+ * **Deutsch**
416
+ * Unterstützung für IPv6
417
+ * Quellcode Überarbeitung
418
+ * Spam mit Begründung löschen
419
+ * Änderung der Benutzeroberfläche
420
+ * Voraussetzungen: PHP 5.1.2 und WordPress 3.3
421
+
422
+ ### 2.3 ###
423
+ * **English**
424
+ * Xmas Edition
425
+ * **Deutsch**
426
+ * Weihnachtsausgabe
427
+
428
+ ### 2.2 ###
429
+ * **English**
430
+ * Interactive Dashboard Stats
431
+ * **Deutsch**
432
+ * Interaktive Dashboard Statistik
433
+
434
+ ### 2.1 ###
435
+ * **English**
436
+ * Remove Google Translate API support
437
+ * **Deutsch**
438
+ * Google Translate API Unterstützung entfernt
439
+
440
+ ### 2.0 ###
441
+ * **English**
442
+ * Allow comments only in certain language (English/German)
443
+ * Consider comments which are already marked as spam
444
+ * Dashboard Stats: Change from canvas to image format
445
+ * System requirements: WordPress 2.8
446
+ * Removal of the migration script
447
+ * Increase plugin security
448
+ * **Deutsch**
449
+ * Kommentare nur in bestimmten Sprachen erlauben (Englisch/Deutsch)
450
+ * Das Plugin kann nun Kommentare berücksichtigen, die bereits als Spam markiert wurden
451
+ * Dashboard-Statistik: Wechsel von canvas zu einem Bildformat
452
+ * Systemvoraussetzungen: WordPress 2.8
453
+ * Entfernung des Migrationsscriptes
454
+ * Plugin Sicherheit verbessert
455
+
456
+ ### 1.9 ###
457
+ * **English**
458
+ * Dashboard History Stats (HTML5 Canvas)
459
+ * **Deutsch**
460
+ * Dashboard Statistiken (HTML5 Canvas)
461
+
462
+ ### 1.8 ###
463
+ * **English**
464
+ * Support for the new IPInfoDB API (including API Key)
465
+ * **Deutsch**
466
+ * Unterstützung der neuen IPInfoDB API (einschließlich API-Key)
467
+
468
+ ### 1.7 ###
469
+ * **English**
470
+ * Black and whitelisting for specific countries
471
+ * "Project Honey Pot" as a optional spammer source
472
+ * Spam reason in the notification email
473
+ * Visual refresh of the notification email
474
+ * Advanced GUI changes + Fold-out options
475
+ * **Deutsch**
476
+ * Schwarze und weiße Liste für bestimmte Länder
477
+ * "Project Honey Pot" als optionale Spammer-Quelle
478
+ * Spam-Begründung in der E-Mail-Benachrichtigung
479
+ * Visuelle Überarbeitung der E-Mail-Benachrichtigung
480
+ * Erweiterte Benutzeroberflächenanpassungen + ausklappbare Einstellungen
481
+
482
+ ### 1.6 ###
483
+ * **English**
484
+ * Support for WordPress 3.0
485
+ * System requirements: WordPress 2.7
486
+ * Code optimization
487
+ * **Deutsch**
488
+ * Unterstützung für WordPress 3.0
489
+ * Systemvoraussetzungen: WordPress 2.7
490
+ * Quelltext optimiert
491
+
492
+ ### 1.5 ###
493
+ * **English**
494
+ * Compatibility with WPtouch
495
+ * Add support for do_action
496
+ * Translation to Portuguese of Brazil
497
+ * **Deutsch**
498
+ * Kompatibilität mit WPtouch
499
+ * Unterstützung für do_action hinzugefügt
500
+ * Übersetzung auf brasilianisches Portugiesisch
501
+
502
+ ### 1.4 ###
503
+ * **English**
504
+ * Enable stricter inspection for incomming comments
505
+ * Do not check if the author has already commented and approved
506
+ * **Deutsch**
507
+ * strengere Kontrolle für eingehende Kommentare aktiviert
508
+ * Nicht auf Spam überprüfen, wenn der Autor bereits kommentiert hat und freigegeben wurde
509
+
510
+ ### 1.3 ###
511
+ * **English**
512
+ * New code structure
513
+ * Email notifications about new spam comments
514
+ * Novel Algorithm: Advanced spam checking
515
+ * **Deutsch**
516
+ * Neue Quelltextstruktur
517
+ * E-Mail-Benachrichtigungen über neue Spam-Kommentare
518
+ * Neuartiger Algorithmus: Erweiterte Spamprüfung
519
+
520
+ ### 1.2 ###
521
+ * **English**
522
+ * Antispam Bee spam counter on dashboard
523
+ * **Deutsch**
524
+ * Antispam Bee Spam-Zähler auf dem Dashboard
525
+
526
+ ### 1.1 ###
527
+ * **English**
528
+ * Adds support for WordPress new changelog readme.txt standard
529
+ * Various changes for more speed, usability and security
530
+ * **Deutsch**
531
+ * Unterstützung des neuen readme.txt Standards für das Änderungsprotokoll hinzugefügt
532
+ * Verschiedene Änderungen für mehr Geschwindigkeit, Benutzerfreundlichkeit und Sicherheit
533
+
534
+ ### 1.0 ###
535
+ * **English**
536
+ * Adds WordPress 2.8 support
537
+ * **Deutsch**
538
+ * WordPress 2.8 Unterstützung hinzugefügt
539
+
540
+ ### 0.9 ###
541
+ * **English**
542
+ * Mark as spam only comments or only pings
543
+ * **Deutsch**
544
+ * nur Kommentare oder nur Pings als Spam markieren
545
+
546
+ ### 0.8 ###
547
+ * **English**
548
+ * Optical adjustments of the settings page
549
+ * Translation for Simplified Chinese, Spanish and Catalan
550
+ * **Deutsch**
551
+ * Optische Anpassungen der Einstellungsseite
552
+ * Übersetzung für vereinfachtes Chinesisch, Spanisch und Katalanisch
553
+
554
+ ### 0.7 ###
555
+ * **English**
556
+ * Spam folder cleanup after X days
557
+ * Optional hide the "MARKED AS SPAM" note
558
+ * Language support for Italian and Turkish
559
+ * **Deutsch**
560
+ * Spam-Ordner Bereinigung nach n Tagen
561
+ * Optionales verstecken des "als Spam markiert" Hinweises
562
+ * Übersetzungen für Italienisch und Türkisch
563
+
564
+ ### 0.6 ###
565
+ * **English**
566
+ * Language support for English, German, Russian
567
+ * **Deutsch**
568
+ * Übersetzungen für Englisch, Deutsch und Russisch
569
+
570
+ ### 0.5 ###
571
+ * **English**
572
+ * Workaround for empty comments
573
+ * **Deutsch**
574
+ * Problembehebung für leere Kommentare
575
+
576
+ ### 0.4 ###
577
+ * **English**
578
+ * Option for trackback and pingback protection
579
+ * **Deutsch**
580
+ * Einstellung für den Trackback- und Pingback-Schutz
581
+
582
+ ### 0.3 ###
583
+ * **English**
584
+ * Trackback and Pingback spam protection
585
+ * **Deutsch**
586
+ * Trackback und Pingback Spam-Schutz
LICENSE.txt CHANGED
File without changes
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Antispam Bee #
2
+
3
+ [![Build Status](https://travis-ci.org/pluginkollektiv/antispam-bee.svg?branch=master)](https://travis-ci.org/pluginkollektiv/antispam-bee) [![Current Antispam Bee version](https://img.shields.io/wordpress/plugin/v/antispam-bee.svg)](https://wordpress.org/plugins/antispam-bee/) [![Number of downloads](https://img.shields.io/wordpress/plugin/dt/antispam-bee.svg)](https://wordpress.org/plugins/antispam-bee/advanced/) [![Number of active installs](https://img.shields.io/wordpress/plugin/installs/antispam-bee.svg)](https://wordpress.org/plugins/antispam-bee/advanced/) [![WordPress plugin rating](https://img.shields.io/wordpress/plugin/r/antispam-bee.svg)](https://wordpress.org/plugins/antispam-bee/#reviews) [![Donate with PayPal](https://img.shields.io/badge/PayPal-Donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW)
4
+
5
+ Antispam plugin with a sophisticated toolset for effective day to day comment and trackback spam-fighting. Built with data protection and privacy in mind.
6
+
7
+ ## Description ##
8
+ 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.
9
+
10
+ ### Feature/Settings Overview ###
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.
18
+ * Notify admins by e-mail about incoming spam.
19
+ * Delete existing spam after n days.
20
+ * Limit approval to comments/pings (will delete other comment types).
21
+ * Select spam indicators to send comments to deletion directly.
22
+ * Optionally exclude trackbacks and pingbacks from spam detection.
23
+ * Optionally spam-check comment forms on archive pages.
24
+ * Display spam statistics on the dashboard, including daily updates of spam detection rate and a total of blocked spam comments.
25
+
26
+ ### Support ###
27
+ * Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/antispam-bee)
28
+ * We don’t handle support via e-mail, Twitter, GitHub issues etc.
29
+
30
+ ### Contribute ###
31
+ * Active development of this plugin is handled [on GitHub](https://github.com/pluginkollektiv/antispam-bee).
32
+ * Pull requests for documented bugs are highly appreciated.
33
+ * If you think you’ve found a bug (e.g. you’re experiencing unexpected behavior), please post at the [support forums](https://wordpress.org/support/plugin/antispam-bee) first.
34
+ * If you want to help us translate this plugin you can do so [on WordPress Translate](https://translate.wordpress.org/projects/wp-plugins/antispam-bee).
35
+
36
+ ### Donate
37
+ [Donate for us via Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TD4AMD2D8EMZW)
38
+
39
+ ### Credits ###
40
+ * Author: [Sergej Müller](https://sergejmueller.github.io/)
41
+ * Maintainers: [pluginkollektiv](https://pluginkollektiv.org)
42
+
43
+ ## Installation ##
44
+ * If you don’t know how to install a plugin for WordPress, [here’s how](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
45
+
46
+ ### Requirements ###
47
+ * PHP 5.2.4 or greater
48
+ * WordPress 4.5 or greater
49
+
50
+ ### Settings ###
51
+ 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.
52
+
53
+ ### Privacy Notice ###
54
+ 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.
55
+
56
+ ## Frequently Asked Questions ##
57
+
58
+ Please have a look [in the FAQ pages](https://github.com/pluginkollektiv/antispam-bee/wiki/en-FAQ).
59
+
60
+ A complete documentation is available in the [GitHub repository Wiki](https://github.com/pluginkollektiv/antispam-bee/wiki).
61
+
62
+ ## Changelog ##
63
+
64
+ [Changelog](https://github.com/pluginkollektiv/antispam-bee/blob/master/CHANGELOG.md).
antispam_bee.php CHANGED
@@ -4,12 +4,14 @@
4
  * Description: Antispam plugin with a sophisticated toolset for effective day to day comment and trackback spam-fighting. Built 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.9.1
 
 
13
  *
14
  * @package Antispam Bee
15
  **/
@@ -56,7 +58,7 @@ class Antispam_Bee {
56
  *
57
  * @var int
58
  */
59
- private static $db_version = 1;
60
 
61
  /**
62
  * The base.
@@ -101,6 +103,22 @@ class Antispam_Bee {
101
  )
102
  );
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
105
  return;
106
  }
@@ -247,12 +265,26 @@ class Antispam_Bee {
247
  )
248
  );
249
  add_action(
250
- 'pre_get_posts',
251
  array(
252
  'Antispam_Bee_Columns',
253
  'set_orderby_query',
254
  )
255
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  }
257
  }
258
  } else {
@@ -264,17 +296,6 @@ class Antispam_Bee {
264
  )
265
  );
266
 
267
- // Save IP hash, if comment is spam.
268
- add_action(
269
- 'comment_post',
270
- array(
271
- __CLASS__,
272
- 'save_ip_hash',
273
- ),
274
- 10,
275
- 1
276
- );
277
-
278
  add_action(
279
  'template_redirect',
280
  array(
@@ -389,7 +410,6 @@ class Antispam_Bee {
389
 
390
  self::$defaults = array(
391
  'options' => array(
392
- 'advanced_check' => 1,
393
  'regexp_check' => 1,
394
  'spam_ip' => 1,
395
  'already_commented' => 1,
@@ -428,13 +448,13 @@ class Antispam_Bee {
428
  'css' => esc_attr__( 'Honeypot', 'antispam-bee' ),
429
  'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
430
  'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
431
- 'server' => esc_attr__( 'Fake IP', 'antispam-bee' ),
432
  'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
433
  'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
434
  'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
435
  'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
436
  'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ),
437
  'title_is_name' => esc_attr__( 'Identical Post title and blog title', 'antispam-bee' ),
 
438
  ),
439
  );
440
  }
@@ -694,7 +714,7 @@ class Antispam_Bee {
694
  $items[] = '<span class="ab-count">' . esc_html(
695
  sprintf(
696
  // translators: The number of spam comments Antispam Bee blocked so far.
697
- __( '%d Blocked', 'antispam-bee' ),
698
  self::_get_spam_count()
699
  )
700
  ) . '</span>';
@@ -853,6 +873,10 @@ class Antispam_Bee {
853
  );
854
  }
855
 
 
 
 
 
856
  return wp_parse_args(
857
  $options,
858
  self::$defaults['options']
@@ -969,7 +993,7 @@ class Antispam_Bee {
969
 
970
  $wpdb->query(
971
  $wpdb->prepare(
972
- "DELETE FROM `$wpdb->comments` WHERE `comment_approved` = 'spam' AND SUBDATE(NOW(), %d) > comment_date_gmt",
973
  $days
974
  )
975
  );
@@ -1193,19 +1217,19 @@ class Antispam_Bee {
1193
  $init_time_field = '';
1194
  }
1195
 
1196
- $output = '<textarea autocomplete="nope" ' . $matches['before1'] . $matches['before2'] . $matches['before3'];
1197
 
1198
  $id_script = '';
1199
  if ( ! empty( $matches['id1'] ) || ! empty( $matches['id2'] ) ) {
1200
  $output .= 'id="' . self::get_secret_id_for_post( self::$_current_post_id ) . '" ';
1201
- $id_script = '<script 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>';
1202
  }
1203
 
1204
  $output .= ' name="' . esc_attr( self::get_secret_name_for_post( self::$_current_post_id ) ) . '" ';
1205
  $output .= $matches['between1'] . $matches['between2'] . $matches['between3'];
1206
  $output .= $matches['after'] . '>';
1207
  $output .= $matches['content'];
1208
- $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>';
1209
 
1210
  $output .= $id_script;
1211
  $output .= $init_time_field;
@@ -1261,12 +1285,6 @@ class Antispam_Bee {
1261
  );
1262
  }
1263
 
1264
- if ( $options['advanced_check'] && self::_is_fake_ip( $ip, self::parse_url( $url, 'host' ) ) ) {
1265
- return array(
1266
- 'reason' => 'server',
1267
- );
1268
- }
1269
-
1270
  if ( $options['spam_ip'] && self::_is_db_spam( $ip, $url ) ) {
1271
  return array(
1272
  'reason' => 'localdb',
@@ -1404,12 +1422,6 @@ class Antispam_Bee {
1404
  );
1405
  }
1406
 
1407
- if ( $options['advanced_check'] && self::_is_fake_ip( $ip ) ) {
1408
- return array(
1409
- 'reason' => 'server',
1410
- );
1411
- }
1412
-
1413
  if ( $options['regexp_check'] && self::_is_regexp_spam(
1414
  array(
1415
  'ip' => $ip,
@@ -1541,6 +1553,11 @@ class Antispam_Bee {
1541
  'body' => '^\w+\s\d+$',
1542
  'email' => '@gmail.com$',
1543
  ),
 
 
 
 
 
1544
  array(
1545
  'body' => '\<\!.+?mfunc.+?\>',
1546
  ),
@@ -1554,7 +1571,7 @@ class Antispam_Bee {
1554
  'body' => 'target[t]?ed (visitors|traffic)|viagra|cialis',
1555
  ),
1556
  array(
1557
- 'body' => 'purchase amazing|buy amazing',
1558
  ),
1559
  array(
1560
  'body' => 'dating|sex|lotto|pharmacy',
@@ -1777,45 +1794,6 @@ class Antispam_Bee {
1777
  return false;
1778
  }
1779
 
1780
-
1781
- /**
1782
- * Check for a fake IP
1783
- *
1784
- * @since 2.0
1785
- * @change 2.6.2
1786
- *
1787
- * @param string $client_ip Client IP.
1788
- * @param string $client_host Client Host (optional).
1789
- * @return boolean True if fake IP.
1790
- */
1791
- private static function _is_fake_ip( $client_ip, $client_host = '' ) {
1792
- $host_by_ip = gethostbyaddr( $client_ip );
1793
-
1794
- if ( self::_is_ipv6( $client_ip ) ) {
1795
- return $client_ip !== $host_by_ip;
1796
- }
1797
-
1798
- if ( empty( $client_host ) ) {
1799
- $ip_by_host = gethostbyname( $host_by_ip );
1800
-
1801
- if ( $ip_by_host === $host_by_ip ) {
1802
- return false;
1803
- }
1804
- } else {
1805
- if ( $host_by_ip === $client_ip ) {
1806
- return true;
1807
- }
1808
-
1809
- $ip_by_host = gethostbyname( $client_host );
1810
- }
1811
-
1812
- if ( strpos( $client_ip, self::_cut_ip( $ip_by_host ) ) === false ) {
1813
- return true;
1814
- }
1815
-
1816
- return false;
1817
- }
1818
-
1819
  /**
1820
  * Check for unwanted languages
1821
  *
@@ -2347,6 +2325,8 @@ class Antispam_Bee {
2347
  public static function get_client_ip() {
2348
  // phpcs:disable WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized
2349
  // Sanitization of $ip takes place further down.
 
 
2350
  if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
2351
  $ip = wp_unslash( $_SERVER['HTTP_CLIENT_IP'] );
2352
  } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
@@ -2357,32 +2337,50 @@ class Antispam_Bee {
2357
  $ip = wp_unslash( $_SERVER['HTTP_FORWARDED_FOR'] );
2358
  } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
2359
  $ip = wp_unslash( $_SERVER['HTTP_FORWARDED'] );
2360
- } elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
2361
- $ip = wp_unslash( $_SERVER['REMOTE_ADDR'] );
2362
- } else {
2363
- return '';
2364
  }
2365
- // phpcs:enable WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized
2366
 
2367
- if ( strpos( $ip, ',' ) !== false ) {
2368
- $ips = explode( ',', $ip );
2369
- $ip = trim( $ips[0] );
2370
  }
2371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2372
  if ( function_exists( 'filter_var' ) ) {
2373
- return filter_var(
2374
- $ip,
2375
  FILTER_VALIDATE_IP
2376
  );
2377
  }
2378
 
2379
- return preg_replace(
2380
- '/[^0-9a-f:\., ]/si',
2381
  '',
2382
- $ip
2383
  );
2384
  }
2385
 
 
2386
  /**
2387
  * Add spam reason as comment data
2388
  *
@@ -2399,31 +2397,6 @@ class Antispam_Bee {
2399
  );
2400
  }
2401
 
2402
- /**
2403
- * Saves the IP address.
2404
- *
2405
- * @param int $comment_id The ID of the comment.
2406
- */
2407
- public static function save_ip_hash( $comment_id ) {
2408
- $hashed_ip = self::hash_ip( self::get_client_ip() );
2409
- add_comment_meta(
2410
- $comment_id,
2411
- 'antispam_bee_iphash',
2412
- $hashed_ip
2413
- );
2414
- }
2415
-
2416
- /**
2417
- * Hashes an IP address
2418
- *
2419
- * @param string $ip The IP address to hash.
2420
- *
2421
- * @return string
2422
- */
2423
- public static function hash_ip( $ip ) {
2424
- return wp_hash_password( $ip );
2425
- }
2426
-
2427
 
2428
  /**
2429
  * Delete spam reason as comment data
@@ -2440,6 +2413,17 @@ class Antispam_Bee {
2440
  );
2441
  }
2442
 
 
 
 
 
 
 
 
 
 
 
 
2443
  /**
2444
  * Get the current post ID.
2445
  *
@@ -2556,7 +2540,7 @@ class Antispam_Bee {
2556
  ) . sprintf(
2557
  "%s\r\n%s\r\n",
2558
  esc_html__( 'Notify message by Antispam Bee', 'antispam-bee' ),
2559
- esc_html__( 'http://antispambee.com', 'antispam-bee' )
2560
  );
2561
 
2562
  wp_mail(
4
  * Description: Antispam plugin with a sophisticated toolset for effective day to day comment and trackback spam-fighting. Built with data protection and privacy in mind.
5
  * Author: pluginkollektiv
6
  * Author URI: https://pluginkollektiv.org
7
+ * Plugin URI: https://antispambee.pluginkollektiv.org/
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.9.2
13
+ *
14
+ * [](http://coderisk.com/wp/plugin/antispam-bee/RIPS-lAHLcgvqY8)
15
  *
16
  * @package Antispam Bee
17
  **/
58
  *
59
  * @var int
60
  */
61
+ private static $db_version = 1.01;
62
 
63
  /**
64
  * The base.
103
  )
104
  );
105
 
106
+ add_action(
107
+ 'comment_unapproved_to_spam',
108
+ array(
109
+ __CLASS__,
110
+ 'update_antispam_bee_reason',
111
+ )
112
+ );
113
+
114
+ add_action(
115
+ 'comment_approved_to_spam',
116
+ array(
117
+ __CLASS__,
118
+ 'update_antispam_bee_reason',
119
+ )
120
+ );
121
+
122
  if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
123
  return;
124
  }
265
  )
266
  );
267
  add_action(
268
+ 'pre_get_comments',
269
  array(
270
  'Antispam_Bee_Columns',
271
  'set_orderby_query',
272
  )
273
  );
274
+ add_action(
275
+ 'restrict_manage_comments',
276
+ array(
277
+ 'Antispam_Bee_Columns',
278
+ 'filter_columns',
279
+ )
280
+ );
281
+ add_action(
282
+ 'pre_get_comments',
283
+ array(
284
+ 'Antispam_Bee_Columns',
285
+ 'filter_by_spam_reason',
286
+ )
287
+ );
288
  }
289
  }
290
  } else {
296
  )
297
  );
298
 
 
 
 
 
 
 
 
 
 
 
 
299
  add_action(
300
  'template_redirect',
301
  array(
410
 
411
  self::$defaults = array(
412
  'options' => array(
 
413
  'regexp_check' => 1,
414
  'spam_ip' => 1,
415
  'already_commented' => 1,
448
  'css' => esc_attr__( 'Honeypot', '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' ),
455
  'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ),
456
  'title_is_name' => esc_attr__( 'Identical Post title and blog title', 'antispam-bee' ),
457
+ 'manually' => esc_attr__( 'Manually', 'antispam-bee' ),
458
  ),
459
  );
460
  }
714
  $items[] = '<span class="ab-count">' . esc_html(
715
  sprintf(
716
  // translators: The number of spam comments Antispam Bee blocked so far.
717
+ __( '%s Blocked', 'antispam-bee' ),
718
  self::_get_spam_count()
719
  )
720
  ) . '</span>';
873
  );
874
  }
875
 
876
+ if ( null === self::$defaults ) {
877
+ self::_init_internal_vars();
878
+ }
879
+
880
  return wp_parse_args(
881
  $options,
882
  self::$defaults['options']
993
 
994
  $wpdb->query(
995
  $wpdb->prepare(
996
+ "DELETE c, cm FROM `$wpdb->comments` AS c LEFT JOIN `$wpdb->commentmeta` AS cm ON (c.comment_ID = cm.comment_id) WHERE c.comment_approved = 'spam' AND SUBDATE(NOW(), %d) > c.comment_date_gmt",
997
  $days
998
  )
999
  );
1217
  $init_time_field = '';
1218
  }
1219
 
1220
+ $output = '<textarea autocomplete="new-password" ' . $matches['before1'] . $matches['before2'] . $matches['before3'];
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;
1285
  );
1286
  }
1287
 
 
 
 
 
 
 
1288
  if ( $options['spam_ip'] && self::_is_db_spam( $ip, $url ) ) {
1289
  return array(
1290
  'reason' => 'localdb',
1422
  );
1423
  }
1424
 
 
 
 
 
 
 
1425
  if ( $options['regexp_check'] && self::_is_regexp_spam(
1426
  array(
1427
  'ip' => $ip,
1553
  'body' => '^\w+\s\d+$',
1554
  'email' => '@gmail.com$',
1555
  ),
1556
+ array(
1557
+ 'body' => '\b[a-z]{30}\b',
1558
+ 'author' => '\b[a-z]{10}\b',
1559
+ 'host' => '\b[a-z]{10}\b',
1560
+ ),
1561
  array(
1562
  'body' => '\<\!.+?mfunc.+?\>',
1563
  ),
1571
  'body' => 'target[t]?ed (visitors|traffic)|viagra|cialis',
1572
  ),
1573
  array(
1574
+ 'body' => 'purchase amazing|buy amazing|luxurybrandsale',
1575
  ),
1576
  array(
1577
  'body' => 'dating|sex|lotto|pharmacy',
1794
  return false;
1795
  }
1796
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1797
  /**
1798
  * Check for unwanted languages
1799
  *
2325
  public static function get_client_ip() {
2326
  // phpcs:disable WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized
2327
  // Sanitization of $ip takes place further down.
2328
+ $ip = '';
2329
+
2330
  if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
2331
  $ip = wp_unslash( $_SERVER['HTTP_CLIENT_IP'] );
2332
  } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
2337
  $ip = wp_unslash( $_SERVER['HTTP_FORWARDED_FOR'] );
2338
  } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
2339
  $ip = wp_unslash( $_SERVER['HTTP_FORWARDED'] );
 
 
 
 
2340
  }
 
2341
 
2342
+ $ip = self::_sanitize_ip( $ip );
2343
+ if ( $ip ) {
2344
+ return $ip;
2345
  }
2346
 
2347
+ if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
2348
+ $ip = wp_unslash( $_SERVER['REMOTE_ADDR'] );
2349
+ return self::_sanitize_ip( $ip );
2350
+ }
2351
+
2352
+ return '';
2353
+ // phpcs:enable WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized
2354
+ }
2355
+
2356
+ /**
2357
+ * Sanitize an IP string.
2358
+ *
2359
+ * @param string $raw_ip The raw IP.
2360
+ *
2361
+ * @return string The sanitized IP or an empty string.
2362
+ */
2363
+ private static function _sanitize_ip( $raw_ip ) {
2364
+
2365
+ if ( strpos( $raw_ip, ',' ) !== false ) {
2366
+ $ips = explode( ',', $raw_ip );
2367
+ $raw_ip = trim( $ips[0] );
2368
+ }
2369
  if ( function_exists( 'filter_var' ) ) {
2370
+ return (string) filter_var(
2371
+ $raw_ip,
2372
  FILTER_VALIDATE_IP
2373
  );
2374
  }
2375
 
2376
+ return (string) preg_replace(
2377
+ '/[^0-9a-f:. ]/si',
2378
  '',
2379
+ $raw_ip
2380
  );
2381
  }
2382
 
2383
+
2384
  /**
2385
  * Add spam reason as comment data
2386
  *
2397
  );
2398
  }
2399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2400
 
2401
  /**
2402
  * Delete spam reason as comment data
2413
  );
2414
  }
2415
 
2416
+ /**
2417
+ * Updates the Antispam Bee reason for manual transitions
2418
+ *
2419
+ * @since 2.9.2
2420
+ * @param WP_Comment $comment Comment Object.
2421
+ */
2422
+ public static function update_antispam_bee_reason( $comment ) {
2423
+ update_comment_meta( $comment->comment_ID, 'antispam_bee_reason', 'manually' );
2424
+ }
2425
+
2426
+
2427
  /**
2428
  * Get the current post ID.
2429
  *
2540
  ) . sprintf(
2541
  "%s\r\n%s\r\n",
2542
  esc_html__( 'Notify message by Antispam Bee', 'antispam-bee' ),
2543
+ esc_html__( 'https://antispambee.com', 'antispam-bee' )
2544
  );
2545
 
2546
  wp_mail(
css/styles.css CHANGED
@@ -105,6 +105,10 @@
105
  min-height: 60px;
106
  }
107
 
 
 
 
 
108
  .ab-column input.ab-mini-field {
109
  width: 40px;
110
  }
@@ -261,6 +265,10 @@
261
  margin: 0 0 0 7px;
262
  }
263
 
 
 
 
 
264
  .ab-column > ul > li > input[type="checkbox"]:checked ~ ul {
265
  display: block;
266
  }
105
  min-height: 60px;
106
  }
107
 
108
+ .ab-column select[multiple][name="ab_ignore_reasons[]"] {
109
+ width: auto;
110
+ }
111
+
112
  .ab-column input.ab-mini-field {
113
  width: 40px;
114
  }
265
  margin: 0 0 0 7px;
266
  }
267
 
268
+ .ab-column > ul > li > ul label[for="ab_ignore_reasons"] {
269
+ margin: 0 0 5px 0;
270
+ }
271
+
272
  .ab-column > ul > li > input[type="checkbox"]:checked ~ ul {
273
  display: block;
274
  }
css/styles.min.css CHANGED
@@ -1 +1 @@
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:18px;font-weight:400;line-height:20px;color:#23282d}.ab-column h3.icon:before{font:400 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:#555d66;margin:0 0 20px;font-weight:400;font-size:13px}.ab-column input[type=text],.ab-column input[type=number],.ab-column select{font-size:13px;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:underline}.ab-column>ul>li a:hover{border-color:inherit}.ab-column>ul>li label{cursor:default;display:inline-block;font-size:14px;max-width:286px;color:#23282d}.ab-column>ul>li label span{color:#555d66;display:block;font-size:13px;line-height:16px;margin-top:5px}.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 0;text-rendering:optimizeLegibility}.ab-column{float:left;margin:0 0 0 10px;position:relative}.ab-column h3{margin:0;font-size:18px;font-weight:400;line-height:20px;color:#23282d}.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:#555d66;margin:0 0 20px;font-weight:400;font-size:13px}.ab-column input[type=number],.ab-column input[type=text],.ab-column select{font-size:13px;text-align:center;background:#f8f8f9}.ab-column input[type=number]{padding:0}.ab-column select[multiple]{width:175px;min-height:60px}.ab-column select[multiple][name="ab_ignore_reasons[]"]{width:auto}.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:underline}.ab-column>ul>li a:hover{border-color:inherit}.ab-column>ul>li label{cursor:default;display:inline-block;font-size:14px;max-width:286px;color:#23282d}.ab-column>ul>li label span{color:#555d66;display:block;font-size:13px;line-height:16px;margin-top:5px}.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>ul label[for=ab_ignore_reasons]{margin:0 0 5px 0}.ab-column>ul>li>input[type=checkbox]:checked~ul{display:block}
inc/columns.class.php CHANGED
@@ -69,24 +69,75 @@ final class Antispam_Bee_Columns {
69
  return $columns;
70
  }
71
 
 
 
72
  /**
73
  * Adjust orderby query
74
  *
75
  * @since 2.6.3
76
  * @change 2.6.3
77
  *
78
- * @param \WP_Query $query Current WordPress query.
79
  */
80
  public static function set_orderby_query( $query ) {
81
- $orderby = $query->get( 'orderby' );
82
 
83
  if ( empty( $orderby ) || 'antispam_bee_reason' !== $orderby ) {
84
  return;
85
  }
86
 
87
- $query->set( 'meta_key', 'antispam_bee_reason' );
88
- $query->set( 'orderby', 'meta_value' );
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  /**
92
  * Print CSS for the plugin column
@@ -94,7 +145,8 @@ final class Antispam_Bee_Columns {
94
  * @since 2.6.1
95
  * @change 2.6.1
96
  */
97
- public static function print_column_styles() { ?>
 
98
  <style>
99
  .column-antispam_bee_reason {
100
  width: 10%;
69
  return $columns;
70
  }
71
 
72
+ // phpcs:disable WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
73
+ // phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
74
  /**
75
  * Adjust orderby query
76
  *
77
  * @since 2.6.3
78
  * @change 2.6.3
79
  *
80
+ * @param \WP_Comment_Query $query Current WordPress query.
81
  */
82
  public static function set_orderby_query( $query ) {
83
+ $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( wp_unslash( $_GET['orderby'] ) ) : '';
84
 
85
  if ( empty( $orderby ) || 'antispam_bee_reason' !== $orderby ) {
86
  return;
87
  }
88
 
89
+ $query->query_vars['meta_key'] = 'antispam_bee_reason';
90
+ $query->query_vars['orderby'] = 'meta_value';
91
  }
92
+ // phpcs:enable WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
93
+ // phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification
94
+
95
+ //phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
96
+ /**
97
+ * Filter comments by the spam reason
98
+ *
99
+ * @global \wpdb $wpdb
100
+ */
101
+ public static function filter_columns() {
102
+ global $wpdb;
103
+ ?>
104
+ <label class="screen-reader-text" for="filter-by-comment-spam-reason"><?php esc_html_e( 'Filter by spam reason', 'antispam-bee' ); ?></label>
105
+ <select id="filter-by-comment-spam-reason" name="comment_spam_reason">
106
+ <option value=""><?php esc_html_e( 'All spam reasons', 'antispam-bee' ); ?></option>
107
+ <?php
108
+ $spam_reason = isset( $_GET['comment_spam_reason'] ) ? sanitize_text_field( wp_unslash( $_GET['comment_spam_reason'] ) ) : '';
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
+ }
115
+ ?>
116
+ </select>
117
+ <?php
118
+ }
119
+ //phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification
120
+
121
+ //phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
122
+ //phpcs:disable WordPress.VIP.SlowDBQuery.slow_db_query_meta_value
123
+ //phpcs:disable WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
124
+ /**
125
+ * Filter comments by the spam reason
126
+ *
127
+ * @param \WP_Comment_Query $query Current WordPress query.
128
+ */
129
+ public static function filter_by_spam_reason( $query ) {
130
+ $spam_reason = isset( $_GET['comment_spam_reason'] ) ? sanitize_text_field( wp_unslash( $_GET['comment_spam_reason'] ) ) : '';
131
+ if ( empty( $spam_reason ) || ! in_array( $spam_reason, array_keys( Antispam_Bee::$defaults['reasons'] ), true ) ) {
132
+ return;
133
+ }
134
+
135
+ $query->query_vars['meta_key'] = 'antispam_bee_reason';
136
+ $query->query_vars['meta_value'] = $spam_reason;
137
+ }
138
+ //phpcs:enable WordPress.VIP.SlowDBQuery.slow_db_query_meta_key
139
+ //phpcs:enable WordPress.VIP.SlowDBQuery.slow_db_query_meta_value
140
+ //phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification
141
 
142
  /**
143
  * Print CSS for the plugin column
145
  * @since 2.6.1
146
  * @change 2.6.1
147
  */
148
+ public static function print_column_styles() {
149
+ ?>
150
  <style>
151
  .column-antispam_bee_reason {
152
  width: 10%;
inc/gui.class.php CHANGED
@@ -54,7 +54,6 @@ class Antispam_Bee_GUI extends Antispam_Bee {
54
 
55
  'dashboard_count' => (int) ( ! empty( $_POST['ab_dashboard_count'] ) ),
56
  'dashboard_chart' => (int) ( ! empty( $_POST['ab_dashboard_chart'] ) ),
57
- 'advanced_check' => (int) ( ! empty( $_POST['ab_advanced_check'] ) ),
58
  'regexp_check' => (int) ( ! empty( $_POST['ab_regexp_check'] ) ),
59
  'spam_ip' => (int) ( ! empty( $_POST['ab_spam_ip'] ) ),
60
  'already_commented' => (int) ( ! empty( $_POST['ab_already_commented'] ) ),
@@ -213,7 +212,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
213
  $link1 = sprintf(
214
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
215
  esc_url(
216
- __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#trust-commenters-with-a-gravatar', 'antispam-bee' ),
217
  'https'
218
  )
219
  );
@@ -245,13 +244,6 @@ class Antispam_Bee_GUI extends Antispam_Bee {
245
  </label>
246
  </li>
247
 
248
- <li>
249
- <input type="checkbox" name="ab_advanced_check" id="ab_advanced_check" value="1" <?php checked( $options['advanced_check'], 1 ); ?> />
250
- <label for="ab_advanced_check">
251
- <?php esc_html_e( 'Validate the ip address of commenters', 'antispam-bee' ); ?>
252
- <span><?php esc_html_e( 'Validation of the IP address used', 'antispam-bee' ); ?></span>
253
- </label>
254
- </li>
255
 
256
  <li>
257
  <input type="checkbox" name="ab_regexp_check" id="ab_regexp_check" value="1" <?php checked( $options['regexp_check'], 1 ); ?> />
@@ -278,7 +270,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
278
  $link1 = sprintf(
279
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
280
  esc_url(
281
- __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#block-comments-from-specific-countries', 'antispam-bee' ),
282
  'https'
283
  )
284
  );
@@ -308,7 +300,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
308
  <?php
309
  printf(
310
  /* translators: 1: opening <a> tag with link to ISO codes reference. 2: closing </a> tag. */
311
- esc_html__( 'Blacklist %1$sISO Codes%2$s for this option.', 'antispam-bee' ),
312
  wp_kses_post( $iso_codes_link ),
313
  '</a>'
314
  );
@@ -323,7 +315,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
323
  <?php
324
  printf(
325
  /* translators: 1: opening <a> tag with link to ISO codes reference. 2: closing </a> tag. */
326
- esc_html__( 'Whitelist %1$sISO Codes%2$s for this option.', 'antispam-bee' ),
327
  wp_kses_post( $iso_codes_link ),
328
  '</a>'
329
  );
@@ -343,7 +335,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
343
  $link1 = sprintf(
344
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
345
  esc_url(
346
- __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation#allow-comments-only-in-certain-language', 'antispam-bee' ),
347
  'https'
348
  )
349
  );
@@ -459,14 +451,14 @@ class Antispam_Bee_GUI extends Antispam_Bee {
459
 
460
  <ul>
461
  <li>
462
- <select name="ab_ignore_reasons[]" id="ab_ignore_reasons" size="2" multiple>
 
 
 
463
  <?php foreach ( self::$defaults['reasons'] as $k => $v ) { ?>
464
  <option <?php selected( in_array( $k, $options['ignore_reasons'], true ), true ); ?> value="<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></option>
465
  <?php } ?>
466
  </select>
467
- <label for="ab_ignore_reasons">
468
- <?php esc_html_e( 'Spam Reason', 'antispam-bee' ); ?>
469
- </label>
470
  </li>
471
  </ul>
472
  </li>
@@ -534,7 +526,7 @@ class Antispam_Bee_GUI extends Antispam_Bee {
534
  <a href="<?php echo esc_url( __( 'https://wordpress.org/plugins/antispam-bee/faq/', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'FAQ', 'antispam-bee' ); ?></a>
535
  </p>
536
  <p>
537
- <a href="<?php echo esc_url( __( 'https://github.com/pluginkollektiv/antispam-bee/wiki/', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Manual', 'antispam-bee' ); ?></a>
538
  </p>
539
  <p>
540
  <a href="<?php echo esc_url( __( 'https://wordpress.org/support/plugin/antispam-bee', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Support', 'antispam-bee' ); ?></a>
54
 
55
  'dashboard_count' => (int) ( ! empty( $_POST['ab_dashboard_count'] ) ),
56
  'dashboard_chart' => (int) ( ! empty( $_POST['ab_dashboard_chart'] ) ),
 
57
  'regexp_check' => (int) ( ! empty( $_POST['ab_regexp_check'] ) ),
58
  'spam_ip' => (int) ( ! empty( $_POST['ab_spam_ip'] ) ),
59
  'already_commented' => (int) ( ! empty( $_POST['ab_already_commented'] ) ),
212
  $link1 = sprintf(
213
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
214
  esc_url(
215
+ __( 'https://antispambee.pluginkollektiv.org/documentation#gravatar', 'antispam-bee' ),
216
  'https'
217
  )
218
  );
244
  </label>
245
  </li>
246
 
 
 
 
 
 
 
 
247
 
248
  <li>
249
  <input type="checkbox" name="ab_regexp_check" id="ab_regexp_check" value="1" <?php checked( $options['regexp_check'], 1 ); ?> />
270
  $link1 = sprintf(
271
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
272
  esc_url(
273
+ __( 'https://antispambee.pluginkollektiv.org/documentation#country', 'antispam-bee' ),
274
  'https'
275
  )
276
  );
300
  <?php
301
  printf(
302
  /* translators: 1: opening <a> tag with link to ISO codes reference. 2: closing </a> tag. */
303
+ esc_html__( 'Denied %1$sISO country codes%2$s for this option.', 'antispam-bee' ),
304
  wp_kses_post( $iso_codes_link ),
305
  '</a>'
306
  );
315
  <?php
316
  printf(
317
  /* translators: 1: opening <a> tag with link to ISO codes reference. 2: closing </a> tag. */
318
+ esc_html__( 'Allowed %1$sISO country codes%2$s for this option.', 'antispam-bee' ),
319
  wp_kses_post( $iso_codes_link ),
320
  '</a>'
321
  );
335
  $link1 = sprintf(
336
  '<a href="%s" target="_blank" rel="noopener noreferrer">',
337
  esc_url(
338
+ __( 'https://antispambee.pluginkollektiv.org/documentation#language', 'antispam-bee' ),
339
  'https'
340
  )
341
  );
451
 
452
  <ul>
453
  <li>
454
+ <label for="ab_ignore_reasons">
455
+ <?php esc_html_e( 'Spam Reason', 'antispam-bee' ); ?>
456
+ </label>
457
+ <select name="ab_ignore_reasons[]" id="ab_ignore_reasons" size="5" multiple>
458
  <?php foreach ( self::$defaults['reasons'] as $k => $v ) { ?>
459
  <option <?php selected( in_array( $k, $options['ignore_reasons'], true ), true ); ?> value="<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></option>
460
  <?php } ?>
461
  </select>
 
 
 
462
  </li>
463
  </ul>
464
  </li>
526
  <a href="<?php echo esc_url( __( 'https://wordpress.org/plugins/antispam-bee/faq/', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'FAQ', 'antispam-bee' ); ?></a>
527
  </p>
528
  <p>
529
+ <a href="<?php echo esc_url( __( 'https://antispambee.pluginkollektiv.org/documentation', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Manual', 'antispam-bee' ); ?></a>
530
  </p>
531
  <p>
532
  <a href="<?php echo esc_url( __( 'https://wordpress.org/support/plugin/antispam-bee', 'antispam-bee' ) ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Support', 'antispam-bee' ); ?></a>
phpunit.xml.dist ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <phpunit
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
5
+ backupGlobals="false"
6
+ backupStaticAttributes="false"
7
+ bootstrap="vendor/autoload.php"
8
+ colors="true"
9
+ convertErrorsToExceptions="true"
10
+ convertNoticesToExceptions="true"
11
+ convertWarningsToExceptions="true"
12
+ processIsolation="false"
13
+ stopOnFailure="false">
14
+ <testsuites>
15
+ <testsuite name="unit">
16
+ <directory suffix=".php">tests/Unit</directory>
17
+ </testsuite>
18
+ <testsuite name="integration">
19
+ <directory suffix=".php">tests/Integration</directory>
20
+ </testsuite>
21
+ </testsuites>
22
+ <listeners>
23
+ <listener class="TestListener" file="tests/TestListener.php"/>
24
+ </listeners>
25
+ </phpunit>
readme.txt CHANGED
@@ -3,8 +3,8 @@
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.0
7
- * Stable tag: 2.9.1
8
  * License: GPLv2 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -33,7 +33,7 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
33
 
34
  ### Support ###
35
  * Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/antispam-bee)
36
- * Read [the documentation](https://github.com/pluginkollektiv/antispam-bee/wiki/en-Documentation)
37
  * We don’t handle support via e-mail, Twitter, GitHub issues etc.
38
 
39
  ### Contribute ###
@@ -51,7 +51,7 @@ Say Goodbye to comment spam on your WordPress blog or website. *Antispam Bee* bl
51
 
52
  ### Requirements ###
53
  * PHP 5.2.4 or greater
54
- * WordPress 3.8 or greater
55
 
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.
@@ -86,14 +86,32 @@ if (req.restarts == 0) {
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 in the [GitHub repository Wiki](https://github.com/pluginkollektiv/antispam-bee/wiki).
90
 
91
  ## Changelog ##
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  ### 2.9.1 ###
94
  * Improved backend accessibility
95
  * Prefilled comment textareas do now work with the honeypot
96
- * AMP compatibility
97
  * Improved dashboard tooltips
98
  * Improvements for the language detection API
99
  * Scalable IP look up for local spam database
@@ -158,13 +176,13 @@ A complete documentation is available in the [GitHub repository Wiki](https://gi
158
  * updated plugin text domain to include a dash instead of an underscore
159
  * updated, translated + formatted README.md
160
  * updated expired link URLs in plugin and languages files
161
- * updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720)
162
 
163
  ### 2.6.7 ###
164
- * Removal of functions *Block comments from specific countries* and *Allow comments only in certain language* for financial reasons - [more information](https://plus.google.com/u/0/+SergejMüller/posts/ZyquhoYjUyF) (only german)
165
 
166
  ### 2.6.6 ###
167
- * Switch to the official Google Translation API - [more information](https://plus.google.com/u/0/+SergejMüller/posts/ZyquhoYjUyF) (only german)
168
  * *Release time investment (Development & QA): 2.5 h*
169
 
170
  ### 2.6.5 ###
@@ -174,7 +192,7 @@ A complete documentation is available in the [GitHub repository Wiki](https://gi
174
  * *Release time investment (Development & QA): 12 h*
175
 
176
  ### 2.6.4 ###
177
- * Consideration of the comment time (Spam if a comment was written in less than 5 seconds) - [more information on Google+](https://plus.google.com/+SergejMüller/posts/73EbP6F1BgC) (only german)
178
  * *Release time investment (Development & QA): 6.25 h*
179
 
180
  ### 2.6.3 ###
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
 
33
 
34
  ### Support ###
35
  * Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/antispam-bee)
36
+ * Read [the documentation](https://antispambee.pluginkollektiv.org/documentation/)
37
  * We don’t handle support via e-mail, Twitter, GitHub issues etc.
38
 
39
  ### Contribute ###
51
 
52
  ### Requirements ###
53
  * PHP 5.2.4 or greater
54
+ * WordPress 4.5 or greater
55
 
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.
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"
98
+ * Tweak: Autoptimize compatibility improved
99
+ * Tweak: Renamed blacklist/whitelist to a better phrase
100
+ * Tweak: Added new pattern
101
+ * Tweak: UI and text optimizations
102
+ * Tweak: Better compatibility with some server configurations
103
+ * Tweak: Make spam reason sortable and filterable
104
+ * Tweak: Add spam reason for manually marked spam
105
+ * Maintenance: Deleted unused code
106
+ * Maintenance: Removed Fake IP check (unreliable and producing false positives)
107
+ * Maintenance: Fix some coding standard issues
108
+ * Maintenance: Tested up to WordPress 5.4
109
+ * Maintenance: Tested up to PHP 7.4
110
+
111
  ### 2.9.1 ###
112
  * Improved backend accessibility
113
  * Prefilled comment textareas do now work with the honeypot
114
+ * Compatible with the AMP plugin (https://wordpress.org/plugins/amp/)
115
  * Improved dashboard tooltips
116
  * Improvements for the language detection API
117
  * Scalable IP look up for local spam database
176
  * updated plugin text domain to include a dash instead of an underscore
177
  * updated, translated + formatted README.md
178
  * updated expired link URLs in plugin and languages files
179
+ * updated [plugin authors](https://pluginkollektiv.org/hello-world/)
180
 
181
  ### 2.6.7 ###
182
+ * Removal of functions *Block comments from specific countries* and *Allow comments only in certain language* for financial reasons - [more information](https://antispambee.pluginkollektiv.org/news/2015/removal-of-allow-comments-only-in-certain-language/)
183
 
184
  ### 2.6.6 ###
185
+ * Switch to the official Google Translation API
186
  * *Release time investment (Development & QA): 2.5 h*
187
 
188
  ### 2.6.5 ###
192
  * *Release time investment (Development & QA): 12 h*
193
 
194
  ### 2.6.4 ###
195
+ * Consideration of the comment time (Spam if a comment was written in less than 5 seconds) - [more information](https://antispambee.pluginkollektiv.org/news/2014/antispam-bee-2-6-4/)
196
  * *Release time investment (Development & QA): 6.25 h*
197
 
198
  ### 2.6.3 ###