├── CHANGELOG.md
├── LICENSE.txt
├── antispam_bee.php
├── css
├── dashboard.css
└── styles.css
├── inc
├── columns.class.php
└── gui.class.php
├── js
├── dashboard.js
├── raphael.helper.js
├── raphael.min.js
└── scripts.js
└── readme.txt
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## Changelog ##
2 |
3 | ### 2.11.7 ###
4 |
5 | * **English**
6 | * Tweak: Use SCRIPT_NAME instead of REQUEST_URI to check path
7 | * Fix: Remove `add_reasons_to_defaults()` from general initialization for better WordPress 6.7 compatibility
8 | * Maintenance: Tested up to WordPress 6.7
9 |
10 | * **Deutsch**
11 | * Tweak: Verwende SCRIPT_NAME anstelle von REQUEST_URI, um den Pfad zu prüfen
12 | * Fix: Entfernen von `add_reasons_to_defaults()` von der allgemeinen Initialisierung für bessere WordPress 6.7 Kompatibilität
13 | * Wartung: Getestet mit WordPress 6.7
14 |
15 | ### 2.11.6 ###
16 | * **English**
17 | * Fix: Delete missed out option on uninstall (Thanks @okvee!)
18 | * Tweak: Minor i18n improvements (Thanks Pedro!)
19 | * Tweak: Minor code changes and housekeeping
20 | * Tweak: Updated dependencies
21 |
22 | * **Deutsch**
23 | * Fix: Bei Deinstallation wurde eine Option nicht korrekt gelöscht (Danke @okvee!)
24 | * Tweak: Kleinere i18n-Verbesserungen (Danke Pedro!)
25 | * Tweak: Kleinere Code-Änderungen und Aufräumarbeiten
26 | * Tweak: Aktualisierte Abhängigkeiten
27 |
28 | ### 2.11.5 ###
29 | IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the `antispam_bee_trusted_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED` (don’t return an empty value here, otherwise all comments are marked as spam).
30 | WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich bist, musst du den `antispam_bee_trusted_ip`-Filter verwenden, um die richtige Adresse des Users von einem Header wie `HTTP_X_FORWARDED` zu bekommen (hier darfst du keinen leeren String zurückgeben, sonst werden alle Kommentare als Spam markiert).
31 | * **English**
32 | * Fix: Usage of core filter `pre_comment_user_ip` breaks ASB if the IP address is removed for GDPR compliance
33 |
34 | * **Deutsch**
35 | * Fix: Die Verwendung des Core-Filters `pre_comment_user_ip` sorgt für Fehler, wenn die IP-Adresse für die Einhaltung der DSGVO entfernt wird
36 |
37 | ### 2.11.4 ###
38 | IMPORTANT: If you use the country check and are behind a proxy or similar, you need to use the `pre_comment_user_ip` filter to get the correct IP from a header like `HTTP_X_FORWARDED`.
39 | WICHTIG: Wenn du den Spam-Check für bestimmte Länder verwendest und hinter einem Proxy oder ähnlich bist, musst du den `pre_comment_user_ip`-Filter verwenden, um die richtige Adresse des Users von einem Header wie `HTTP_X_FORWARDED` zu bekommen.
40 | * **English**
41 | * Fix: Read client IP for country check from `REMOTE_ADDR` only (filterable via `pre_comment_user_ip`)
42 | * Fix: No spam reason in spam notification email, and related PHP warning
43 | * Fix: Remove outdated info from readme
44 | * Enhancement: Show upgrade notice on plugin overview page
45 | * Maintenance: Tested up to WordPress 6.3
46 |
47 | * **Deutsch**
48 | * Fix: Client-IP wird nur noch aus `REMOTE_ADDR` ermittelt (filterbar über `pre_comment_user_ip`)
49 | * Fix: Der Spam-Grund wird wieder korrekt in der Benachrichtigungs-E-Mail zu Spam angezeigt und die damit zusammenhängende PHP-Warning behoben
50 | * Fix: Veraltete Infos aus der Readme wurden entfernt
51 | * Verbesserung: Upgrade-Hinweis wird auch in der Plugin-Übersicht angezeigt
52 | * Wartung: Getestet mit WordPress 6.3
53 |
54 | ### 2.11.3 ###
55 | * **English**
56 | * Fix: Multiselect for "Delete comments by spam reasons" was not saving values
57 | * Fix: Fix broken link for ISO country codes
58 | * Maintenance: Added test for PHP 8.2
59 | * Maintenance: Tested up to WordPress 6.2
60 |
61 | * **Deutsch**
62 | * Behoben: Multiselect für "Kommentare aus Spamgründen löschen" speicherte keine Werte
63 | * Fix: Fehlerhafter Link für ISO-Ländercodes behoben
64 | * Wartung: Test für PHP 8.2 hinzugefügt
65 | * Wartung: Getestet mit WordPress 6.2
66 |
67 | ### 2.11.2 ###
68 | * **English**
69 | * Tweak: remove superfluous translations
70 | * Tweak: make FAQ link an anchor link
71 | * Fix: spam counter no longer raises a warning with PHP 8.1 if no spam is present yet
72 | * Fix: spam reasons are now localized correctly
73 | * Fix: Translations were loaded twice on some admin pages
74 | * Maintenance: Tested up to WordPress 6.1
75 |
76 | * **Deutsch**
77 | * Tweak: Überflüssige Übersetzungen entfernt
78 | * Tweak: Link zu den FAQ ist jetzt ein Anker-Link
79 | * Fix: Der Spam-Zähler erzeugt mit PHP 8.1 keine Warnung mehr, wenn noch kein Spam vorhanden ist
80 | * Fix: Spam-Gründe werden nun korrekt übersetzt
81 | * Fix: Übersetzungen wurden auf einzelnen Adminseiten doppelt geladen
82 | * Wartung: Getestet mit WordPress 6.1
83 |
84 | ### 2.11.1 ###
85 | * **English**
86 | * Tweak: remove superfluous type attribute from inline script tag
87 | * Maintenance: Tested up to WordPress 6.0
88 |
89 | * **Deutsch**
90 | * Tweak: Überflüssiges type-Attribut von script-Tag entfernt
91 | * Wartung: Getestet mit WordPress 6.0
92 |
93 | ### 2.11.0 ###
94 | * **English**
95 | * Fix: Allow empty comments if `allow_empty_comment` is set to true
96 | * Fix: Add `aria-label` to work around bug in a11y testing tools
97 | * Fix: Change priority for `comment_form_field_comment` from 10 to 99
98 | * Tweak: Updated some FAQ entries
99 | * Tweak: Updated build tooling
100 |
101 | * **Deutsch**
102 | * Fix: Leere Kommentare erlauben, wenn der Filter `allow_empty_comment` gesetzt ist
103 | * Fix: Ein `aria-label` hinzugefügt, um einen bekannten Fehler bei Tests zu umgehen
104 | * Fix: Änderung der Priorität vom Filter `comment_form_field_comment` von 10 auf 99
105 | * Tweak: Aktualisierungen in der FAQ
106 | * Tweak: Optimierungen am Build-Prozess
107 |
108 | ### 2.10.0 ###
109 | * **English**
110 | * Fix: Switch from ip2country.info to iplocate.io for country check
111 | * Enhancement: Use filter to add the honeypot field instead of output buffering for new installations and added option to switch between the both ways
112 | * Tweak: Added comment user agent to regex pattern check
113 | * Tweak: Make the ping detection filterable to support new comment types
114 | * Tweak: Updated internal documentation links
115 | * Tweak: Several updates and optimizations in the testing process
116 | * Tweak: Adjust color palette to recent WP version
117 | * Tweak: Adjust wording in variables and option names
118 | * Readme: Add new contributor and clean up unused code
119 |
120 | * **Deutsch**
121 | * Fix: Wechsel von ip2country.info zu iplocate.io für die Länderprüfung
122 | * Verbesserung: Bei neuen Installationen wird ein Filter zum Hinzufügen des Honeypot-Felds genutzt statt Output-Buffering. Es wurde eine Option hinzugefügt, zwischen den beiden Wegen zu wechseln
123 | * Tweak: Kommentar User-Agent zu Regex-Pattern hinzugefügt
124 | * Tweak: Die Ping-Erkennung ist jetzt filterbar, um neue Kommentartypen zu unterstützen
125 | * Tweak: Aktualisierte Links zur internen Dokumentation
126 | * Tweak: Verschiedene Aktualisierungen und Optimierungen im Testprozess
127 | * Tweak: Farbpalette an aktuelle WP-Version anpassen
128 | * Tweak: Wortlaut in Variablen und Optionsnamen wurden angepasst
129 | * Readme: Neuer Contributor hinzugefügt und unbenutzten Code bereinigt
130 |
131 | ### 2.9.4 ###
132 | * **English**
133 | * Enhancement: Add filter to allow ajax calls
134 | * Tweak: Better wording for BBCode feature in plugin description
135 | * Tweak: Better screenshots in the plugin directory
136 | * Maintenance: Tested up to WordPress 5.7
137 |
138 | * **Deutsch**
139 | * Verbesserung: Filter hinzugefügt, um Ajax-Aufrufe zuzulassen
140 | * Tweak: Bessere Formulierung für BBCode-Funktion in Plugin-Beschreibung
141 | * Tweak: Bessere Screenshots im Plugin-Verzeichnis
142 | * Wartung: Getestet mit WordPress 5.7
143 |
144 | ### 2.9.3 ###
145 | * **English**
146 | * Fixed: Compatibility with WordPress 5.5
147 | * Fixed: Undefined index on spam list page
148 | * Tweak: Better wording on settings page
149 | * Tweak: AMP compatibility
150 | * Tweak: Protect CSS from overwrite through bad themes
151 |
152 | * **Deutsch**
153 | * Fix: Kompatibilität mit WordPress 5.5
154 | * Fix: Undefined index in Spamliste
155 | * Tweak: Inklusivere Sprache unter Einstellungen
156 | * Tweak: AMP-Kompatibilität
157 | * Tweak: Schütze CSS besser vor Überschreiben durch schlechte Themes
158 |
159 | ### 2.9.2 ###
160 | * **English**
161 | * 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/)
162 | * Fix: Statistic in dashboard showed wrong value
163 | * Tweak: Change autocomplete attribute to "new-password"
164 | * Tweak: Autoptimize compatibility improved
165 | * Tweak: Renamed blacklist/whitelist to a better phrase
166 | * Tweak: Added new pattern
167 | * Tweak: UI and text optimizations
168 | * Tweak: Better compatibility with some server configurations
169 | * Tweak: Make spam reason sortable and filterable
170 | * Tweak: Add spam reason for manually marked spam
171 | * Maintenance: Deleted unused code
172 | * Maintenance: Removed Fake IP check (unreliable and producing false positives)
173 | * Maintenance: Fix some coding standard issues
174 | * Maintenance: Tested up to WordPress 5.4
175 | * Maintenance: Tested up to PHP 7.4
176 |
177 |
178 | * **Deutsch**
179 | * 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/)
180 | * Fix: Dashboard Statistiken zeigten falschen Wert
181 | * Tweak: Änderung des autocomplete Attributs zu "new-password"
182 | * Tweak: Kompatibilität mit Autoptimize verbessert
183 | * Tweak: "Blacklist/Whitelist" umbenannt
184 | * Tweak: Neue Spamerkennungsmuster hinzugefügt
185 | * Tweak: UI und Textverbesserungen
186 | * Tweak: Erhöhte Kompatibilität mit einigen Serverkonfigurationen
187 | * Tweak: Kommentare nach Spamgrund sortier- und filterbar gemacht
188 | * Tweak: Neuer Spamgrund für manuell markierten Spam eingeführt
189 | * Maintenance: Ungenutzter Code wurde gelöscht
190 | * Maintenance: Der Fake IP check wurde entfernt. Dieser war unzuverlässig und produzierte falsche Ergebnisse
191 | * Maintenance: Einige Probleme mit unseren Coding standards wurden gefixt
192 | * Maintenance: Getestet bis WordPress 5.4
193 | * Maintenance: Getestet bis PHP 7.4
194 |
195 | ### 2.9.1 ###
196 | * **English**
197 | * Improved backend accessibility
198 | * Prefilled comment textareas do now work with the honeypot
199 | * Compatible with the AMP plugin (https://wordpress.org/plugins/amp/)
200 | * Improved dashboard tooltips
201 | * Improvements for the language detection API
202 | * Scalable IP look up for local spam database
203 |
204 |
205 | * **Deutsch**
206 | * Verbesserte Barrierefreiheit im Backend
207 | * Vorausgefüllte Kommentarfelder arbeiten jetzt mit dem Honeypot zusammen
208 | * Kompatibel mit dem AMP Plugin (https://wordpress.org/plugins/amp/)
209 | * Verbesserte Tooltips im Dashboard
210 | * Verbesserte Kommunikation mit der Spracherkennungs-API
211 | * Skalierbarer IP-Abgleich für den lokalen Datenbank-Check.
212 |
213 | ### 2.9.0 ###
214 | * **English**
215 | * Introduction of coding standards.
216 | * Switch to franc language detection API for the language check.
217 | * Do not longer overwrite the IP address WordPress saves with the comment by using `pre_comment_user_ip`.
218 | * Do not show "Trust commenters with a Gravatar" if the "Show Gravatar" option is not set.
219 | * Skip the checks, when I ping myself.
220 | * Fixes some wrong usages of the translation functions.
221 | * Use the regular expressions check also for trackbacks.
222 | * Add option to delete Antispam Bee related data when plugin gets deleted via the admin interface.
223 | * Save a hashed + salted IP for every comment
224 | * New check for incoming Trackbacks.
225 | * Introduction of behat tests.
226 | * Updates the used JavaScript library for the statistics widget.
227 | * Bugfix in the "Comment form used outside of posts" option.
228 |
229 | * **Deutsch**
230 | * Einführung von Coding Standards.
231 | * Wechsel auf die Franc Spracherkennungs API für den Sprach-Check.
232 | * Beendet das Überschreiben der IP Adresse via `pre_comment_user_ip`, welche WordPress mit dem Kommentar speichert.
233 | * Zeige die Option "Vertraue Kommentaren mit Gravatar" nur an wenn die Option "Zeige Gravatar" aktiviert ist.
234 | * Überspringe die Filter, wenn ich mich selbst anpinge.
235 | * Repariert einige falsche Verwendungsweisen der Übersetzungsfunktionalitäten.
236 | * Wende den reguläre Ausdrücke Check auch auf Trackbacks an.
237 | * Option hinzugefügt, dass Daten von Antispam Bee gelöscht werden, wenn das Plugin über das Admin Interface gelöscht wird.
238 | * Speichere für jeden Kommentar eine salted Hash der IP Adresse.
239 | * Ein neuer Check für eingehende Trackbacks.
240 | * Einführung von Behat tests.
241 | * Aktualisiert die genutzte JavaScript Bibliothek für das Statistik Widget.
242 | * Bugfix in der "Kommentarformular wird außerhalb von Beiträgen verwendet" Einstellung
243 |
244 | ### 2.8.1 ###
245 |
246 | * **English**
247 | * PHP 5.3 compatibility
248 | * Bugfix where a spam trackback produced a fatal error
249 | * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1
250 |
251 | * **Deutsch**
252 | * PHP 5.3 Kompatibilität wieder hergestellt
253 | * Bugfix: Ein Spam Trackback produzierte einen Fatal Error
254 | * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/8?closed=1
255 |
256 | ### 2.8.0 ###
257 |
258 | * **English**
259 | * Removed stopforumspam.com to avoid potential GDPR violation
260 | * Improves IP handling to comply with GDPR
261 | * Improves PHP7.2 compatibility
262 | * Fixes small bug on mobile views
263 | * Allow more than one language in language check
264 | * Minor interface improvements
265 | * Remove old russian and Dutch translation files
266 | * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
267 |
268 | * **Deutsch**
269 | - Entfernt stopforumspam.com zur Vorbeugung möglicher DSGVO-Verletzungen
270 | - Verändert den Umgang mit IP-Adressen um der DSGVO zu entsprechen
271 | - Verbessert PHP7.2-Kompatibilität
272 | - Behebt einen CSS-Bugfix der mobilen Darstellung
273 | - Erlaube mehr als eine Sprache im Sprachencheck
274 | - Verberesserungen an der Benutzeroberfläche
275 | - Entfernt alte russische und holländische Sprachversionen
276 | - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/4?closed=1
277 |
278 | ### 2.7.1 ###
279 |
280 | * **English**
281 | * Fixes an incompatibility with Chrome autofill
282 | * Fixes some incompatibilities with other plugins/themes where the comment field was left empty
283 | * Support for RTL
284 | * Solve some translation/language issues
285 | * A new filter to add languages to the language check
286 | * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1
287 | * **Deutsch**
288 | - Behebt eine Inkompatibilität mit Chromes Autofill-Funktion
289 | - Behebt einige Inkompatibilitäten mit anderen Plugins/Themes, wo das Kommentarfeld leer bliebt
290 | - Unterstützt RTL-Sprachen
291 | - Behebt einige Probleme im Bereich Sprache/Übersetzung
292 | - Bietet einen neuen Filter zum HInzufügen von Sprachen zum Sprach-Check
293 | - Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/6?closed=1
294 |
295 | ### 2.7.0 ###
296 | * **English**
297 | * Country check is back again (thanks to Sergej Müller for his amazing work and the service page)
298 | * Improved Honeypot
299 | * Language check through Google Translate API is back again (thanks to [Simon Kraft](https://simonkraft.de/) for offering to cover the costs)
300 | * More default Regexes
301 | * Unit Test Framework
302 | * Accessibility and GUI improvements
303 | * An [english documentation](https://github.com/pluginkollektiv/antispam-bee/wiki) is now available, too. Some corrections in the german documentation.
304 | * Some bugfixes - Among other things for WPML compatibility
305 | * For more details see https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1
306 |
307 | * **Deutsch**
308 | * Die Länderprüfung ist wieder zurück (dank an Sergej Müller für seine fantastische Arbeit und die Service-Seite)
309 | * Der Honeypot wurde verbessert
310 | * 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)
311 | * Mehr Standard-Regexe
312 | * Verbesserungen an Barrierefreiheit und Benutzer-Oberfläche
313 | * Eine [englische Dokumentation](https://github.com/pluginkollektiv/antispam-bee/wiki) ist jetzt verfügbar. Einige Korrekturen in der deutschen Dokumentation.
314 | * Einige Fehlerkorrekturen - Unter anderem für WPML-Kompatibilität
315 | * Mehr Details: https://github.com/pluginkollektiv/antispam-bee/milestone/3?closed=1
316 |
317 | ### 2.6.9 ###
318 | * **English**
319 | * Updates donation links throughout the plugin
320 | * Fixes an error were JavaScript on the dashboard was erroneously being enqueued
321 | * Ensures compatibility with the latest WordPress version
322 | * **Deutsch**
323 | * Aktualisierung der Spenden Links im gesamten Plugin
324 | * Behebt einen Fehler, durch den auf dem Dashboard fälschlicherweise JavaScript geladen wird
325 | * Gewährleistet die Kompatibilität mit der neuesten WordPress-Version
326 |
327 | ### 2.6.8 ###
328 | * **English**
329 | * added a POT file
330 | * updated German translation, added formal version
331 | * updated plugin text domain to include a dash instead of an underscore
332 | * updated, translated + formatted README.md
333 | * updated expired link URLs in plugin and languages files
334 | * updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720)
335 | * **Deutsch**
336 | * eine POT-Datei hinzugefügt
337 | * deutsche Übersetzung aktualisiert, formale Version hinzugefügt
338 | * Die Text Domain des Plugins in der ReadMe aktualisiert. Statt einem Unterstrich enthält der Name nun ein Bindestrich.
339 | * README.md aktualisiert, übersetzt und formatiert
340 | * verwaiste Link-Adressen in dem Plugin und den Sprachdateien aktualisiert
341 | * [Plugin Autor](https://gist.github.com/glueckpress/f058c0ab973d45a72720) aktualisiert
342 |
343 | ### 2.6.7 ###
344 | * **English**
345 | * Removal of functions *Block comments from specific countries* and *Allow comments only in certain language* for financial reasons
346 | * **Deutsch**
347 | * 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/)
348 |
349 | ### 2.6.6 ###
350 | * **English**
351 | * Switch to the official Google Translation API
352 | * *Release time investment (Development & QA): 2.5 h*
353 | * **Deutsch**
354 | * (Testweise) Umstellung auf die offizielle Google Translation API
355 | * *Release-Zeitaufwand (Development & QA): 2,5 Stunden*
356 |
357 | ### 2.6.5 ###
358 | * **English**
359 | * Fix: Return parameters on `dashboard_glance_items` callback / thx [@toscho](https://twitter.com/toscho)
360 | * New function: [Trust commenters with a Gravatar](https://antispambee.pluginkollektiv.org/documentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress)
361 | * Additional plausibility checks and filters
362 | * *Release time investment (Development & QA): 12 h*
363 | * **Deutsch**
364 | * Fix: Parameter-Rückgabe bei `dashboard_glance_items` / thx [@toscho](https://twitter.com/toscho)
365 | * Neue Funktion: [Kommentatoren mit Gravatar vertrauen](https://antispambee.pluginkollektiv.org/de/dokumentation#gravatar) / thx [@glueckpress](https://twitter.com/glueckpress)
366 | * Zusätzliche Plausibilitätsprüfungen und Filter
367 | * *Release-Zeitaufwand (Development & QA): 12 Stunden*
368 |
369 | ### 2.6.4 ###
370 | * **English**
371 | * Consideration of the comment time (Spam if a comment was written in less than 5 seconds)
372 | * *Release time investment (Development & QA): 6.25 h*
373 | * **Deutsch**
374 | * 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/)
375 | * *Release-Zeitaufwand (Development & QA): 6,25 Stunden*
376 |
377 | ### 2.6.3 ###
378 | * **English**
379 | * Sorting for the Antispam Bee column in the spam comments overview
380 | * Code refactoring around the use of REQUEST_URI
381 | * *Release time investment (Development & QA): 2.75 h*
382 | * **Deutsch**
383 | * Sortierung für die Antispam Bee Spalte in der Spam-Übersicht
384 | * Code-Refactoring rund um die Nutzung von REQUEST_URI
385 | * *Release-Zeitaufwand (Development & QA): 2,75 Stunden*
386 |
387 | ### 2.6.2 ###
388 | * **English**
389 | * Improving detection of fake IPs
390 | * *Release time investment (Development & QA): 11 h*
391 | * **Deutsch**
392 | * Überarbeitung der Erkennung von gefälschten IPs
393 | * *Release-Zeitaufwand (Development & QA): 11 Stunden*
394 |
395 | ### 2.6.1 ###
396 | * **English**
397 | * Code refactoring of options management
398 | * Support for `HTTP_FORWARDED_FOR` header
399 | * *Release time investment (Development & QA): 8.5 h*
400 | * **Deutsch**
401 | * Überarbeitung der Optionen-Verwaltung
402 | * Berücksichtigung der Header `HTTP_FORWARDED_FOR`
403 | * *Release-Zeitaufwand (Development & QA): 8,5 Stunden*
404 |
405 | ### 2.6.0 ###
406 | * **English**
407 | * Optimizations for WordPress 3.8
408 | * Clear invalid UTF-8 characters in comment fields
409 | * Spam reason as a column in the table with spam comments
410 | * **Deutsch**
411 | * Optimierungen für WordPress 3.8
412 | * Zusatzprüfung auf Nicht-UTF-8-Zeichen in Kommentardaten
413 | * Spamgrund als Spalte in der Übersicht mit Spamkommentaren
414 |
415 | ### 2.5.9 ###
416 | * **English**
417 | * Dashboard widget changes to work with [Statify](http://statify.de)
418 | * **Deutsch**
419 | * Anpassung des Dashboard-Skriptes für die Zusammenarbeit mit [Statify](http://statify.de)
420 |
421 | ### 2.5.8 ###
422 | * **English**
423 | * Switch from TornevallDNSBL to [Stop Forum Spam](http://www.stopforumspam.com)
424 | * New JS library for the Antispam Bee dashboard chart
425 | * **Deutsch**
426 | * Umstellung von TornevallDNSBL zu [Stop Forum Spam](http://www.stopforumspam.com)
427 | * Neue JS-Bibliothek für das Dashboard-Widget
428 |
429 | ### 2.5.7 ###
430 | * **English**
431 | * Optional logfile with spam entries e.g. for [Fail2Ban](https://help.ubuntu.com/community/Fail2ban)
432 | * Filter `antispam_bee_notification_subject` for a custom subject in notifications
433 | * **Deutsch**
434 | * Optionale Spam-Logdatei z.B. für [Fail2Ban](https://wiki.ubuntuusers.de/fail2ban/)
435 | * Filter `antispam_bee_notification_subject` für eigenen Betreff in Benachrichtigungen
436 |
437 | ### 2.5.6 ###
438 | * **English**
439 | * [Added new detection/patterns for spam comments](https://antispambee.pluginkollektiv.org/news/2013/new-patterns-in-antispam-bee-2-5-6/)
440 | * **Deutsch**
441 | * [Neue Erkennungsmuster für Spam hinzugefügt](https://antispambee.pluginkollektiv.org/de/news/2013/neue-erkennungsmuster-in-antispam-bee-2-5-6/)
442 |
443 | ### 2.5.5 ###
444 | * **English**
445 | * 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).
446 | * **Deutsch**
447 | * 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/).
448 |
449 | ### 2.5.4 ###
450 | * **English**
451 | * Jubilee edition
452 | * New mascot for Antispam Bee
453 | * Advanced Scanning on IP, URL and e-mail address of incoming comments in local blog spam database
454 | * **Deutsch**
455 | * Jubiläumsausgabe: [Details zum Update](https://plus.googlehttps://antispambee.pluginkollektiv.org/de/news/2013/jubilaeumsausgabe-antispam-bee-2-5-4/)
456 | * Neues Maskottchen für Antispam Bee
457 | * Erweiterte Prüfung eingehender Kommentare in lokaler Blog-Spamdatenbank auf IP, URL und E-Mail-Adresse
458 |
459 | ### 2.5.3 ###
460 | * **English**
461 | * Optimization of regular expression
462 | * **Deutsch**
463 | * Optimierung des Regulären Ausdrucks
464 |
465 | ### 2.5.2 ###
466 | * **English**
467 | * New: Use of regular expressions with predefined and own identification patterns
468 | * Change the filter order
469 | * Improvements to the language file
470 | * **Deutsch**
471 | * Neu: [Reguläre Ausdrücke anwenden](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#regex) mit vordefinierten und eigenen Erkennungsmustern
472 | * Änderung der Filter-Reihenfolge
473 | * Verbesserungen an der Sprachdatei
474 |
475 | ### 2.5.1 ###
476 | * **English**
477 | * Treat BBCode as spam
478 | * IP anonymization in the country evaluation
479 | * More transparency by added Privacy Policy
480 | * PHP 5.2.4 as a requirement (is also the prerequisite for WP 3.4)
481 | * **Deutsch**
482 | * [BBCode im Kommentar als Spamgrund](hhttps://antispambee.pluginkollektiv.org/de/dokumentation#bbcode)
483 | * IP-Anonymisierung bei der Länderprüfung
484 | * [Mehr Transparenz](https://antispambee.pluginkollektiv.org/de/news/2012/datenschutz-update/) durch hinzugefügte Datenschutzhinweise
485 | * PHP 5.2.4 als Voraussetzung (ist zugleich die Voraussetzung für WP 3.4)
486 |
487 | ### 2.5.0 ###
488 | * **English**
489 | * [Edition 2012](https://antispambee.pluginkollektiv.org/news/2012/edition-2012/)
490 | * **Deutsch**
491 | * [Edition 2012](https://antispambee.pluginkollektiv.org/de/news/2012/edition-2012/)
492 |
493 | ### 2.4.6 ###
494 | * **English**
495 | * Russian translation
496 | * Change the secret string
497 | * **Deutsch**
498 | * Russische Übersetzung
499 | * Veränderung der Secret-Zeichenfolge
500 |
501 | ### 2.4.5 ###
502 | * **English**
503 | * Revised layout settings
504 | * Deletion of Project Honey Pot
505 | * TornevallNET as new DNSBL service
506 | * WordPress 3.4 as a minimum requirement
507 | * WordPress 3.5 support
508 | * Recast of the online manual
509 | * **Deutsch**
510 | * Überarbeitetes Layout der Einstellungen
511 | * Streichung von Project Honey Pot
512 | * TornevallNET als neuer DNSBL-Dienst
513 | * WordPress 3.4 als Mindestvoraussetzung
514 | * WordPress 3.5 Unterstützung
515 | * Neufassung des Online-Handbuchs
516 |
517 | ### 2.4.4 ###
518 | * **English**
519 | * Technical and visual support for WordPress 3.5
520 | * Modification of the file structure: from `xyz.dev.css` to `xyz.min.css`
521 | * Retina screenshot
522 | * **Deutsch**
523 | * Technische und optische Unterstützung für WordPress 3.5
524 | * Änderung der Dateistruktur: von `xyz.dev.css` zu `xyz.min.css`
525 | * Retina Bildschirmfoto
526 |
527 | ### 2.4.3 ###
528 | * **English**
529 | * Check for basic requirements
530 | * Remove the sidebar plugin icon
531 | * Set the Google API calls to SSL
532 | * Compatibility with WordPress 3.4
533 | * Add retina plugin icon on options
534 | * Depending on WordPress settings: anonymous comments allowed
535 | * **Deutsch**
536 | * Mindestvoraussetzungen werden nun überprüft
537 | * Entfernung des Plugin Icons in der Sidebar
538 | * Google API Aufrufe auf SSL umgestellt
539 | * Kompatibilität mit WordPress 3.4
540 | * Retina Plugin Icon in den Einstellungen hinzugefügt
541 | * In Abhängigkeit zu den Wordpress-Einstellungen: anonyme Kommentare erlauben
542 |
543 | ### 2.4.2 ###
544 | * **English**
545 | * New geo ip location service (without the api key)
546 | * Code cleanup: Replacement of `@` characters by a function
547 | * JS-Fallback for missing jQuery UI
548 | * **Deutsch**
549 | * Neuer IP-Geolocation-Dienst (ohne api key)
550 | * Quelltext aufgeräumt: Austausch von `@` Zeichen durch eine Funktion
551 | * S-Fallback für fehlende jQuery UI
552 |
553 | ### 2.4.1 ###
554 | * **English**
555 | * Add russian translation
556 | * Fix for the textarea replace
557 | * Detect and hide admin notices
558 | * **Deutsch**
559 | * Russian Übersetzung hinzugefügt
560 | * Fehlerbehebung bei dem ersetzten Textfeld
561 | * Erkennen und verstecken von Admin-Mitteilungen
562 |
563 | ### 2.4 ###
564 | * **English**
565 | * Support for IPv6
566 | * Source code revision
567 | * Delete spam by reason
568 | * Changing the user interface
569 | * Requirements: PHP 5.1.2 and WordPress 3.3
570 | * **Deutsch**
571 | * Unterstützung für IPv6
572 | * Quellcode Überarbeitung
573 | * Spam mit Begründung löschen
574 | * Änderung der Benutzeroberfläche
575 | * Voraussetzungen: PHP 5.1.2 und WordPress 3.3
576 |
577 | ### 2.3 ###
578 | * **English**
579 | * Xmas Edition
580 | * **Deutsch**
581 | * Weihnachtsausgabe
582 |
583 | ### 2.2 ###
584 | * **English**
585 | * Interactive Dashboard Stats
586 | * **Deutsch**
587 | * Interaktive Dashboard Statistik
588 |
589 | ### 2.1 ###
590 | * **English**
591 | * Remove Google Translate API support
592 | * **Deutsch**
593 | * Google Translate API Unterstützung entfernt
594 |
595 | ### 2.0 ###
596 | * **English**
597 | * Allow comments only in certain language (English/German)
598 | * Consider comments which are already marked as spam
599 | * Dashboard Stats: Change from canvas to image format
600 | * System requirements: WordPress 2.8
601 | * Removal of the migration script
602 | * Increase plugin security
603 | * **Deutsch**
604 | * Kommentare nur in bestimmten Sprachen erlauben (Englisch/Deutsch)
605 | * Das Plugin kann nun Kommentare berücksichtigen, die bereits als Spam markiert wurden
606 | * Dashboard-Statistik: Wechsel von canvas zu einem Bildformat
607 | * Systemvoraussetzungen: WordPress 2.8
608 | * Entfernung des Migrationsscriptes
609 | * Plugin Sicherheit verbessert
610 |
611 | ### 1.9 ###
612 | * **English**
613 | * Dashboard History Stats (HTML5 Canvas)
614 | * **Deutsch**
615 | * Dashboard Statistiken (HTML5 Canvas)
616 |
617 | ### 1.8 ###
618 | * **English**
619 | * Support for the new IPInfoDB API (including API Key)
620 | * **Deutsch**
621 | * Unterstützung der neuen IPInfoDB API (einschließlich API-Key)
622 |
623 | ### 1.7 ###
624 | * **English**
625 | * Black and whitelisting for specific countries
626 | * "Project Honey Pot" as a optional spammer source
627 | * Spam reason in the notification email
628 | * Visual refresh of the notification email
629 | * Advanced GUI changes + Fold-out options
630 | * **Deutsch**
631 | * Schwarze und weiße Liste für bestimmte Länder
632 | * "Project Honey Pot" als optionale Spammer-Quelle
633 | * Spam-Begründung in der E-Mail-Benachrichtigung
634 | * Visuelle Überarbeitung der E-Mail-Benachrichtigung
635 | * Erweiterte Benutzeroberflächenanpassungen + ausklappbare Einstellungen
636 |
637 | ### 1.6 ###
638 | * **English**
639 | * Support for WordPress 3.0
640 | * System requirements: WordPress 2.7
641 | * Code optimization
642 | * **Deutsch**
643 | * Unterstützung für WordPress 3.0
644 | * Systemvoraussetzungen: WordPress 2.7
645 | * Quelltext optimiert
646 |
647 | ### 1.5 ###
648 | * **English**
649 | * Compatibility with WPtouch
650 | * Add support for do_action
651 | * Translation to Portuguese of Brazil
652 | * **Deutsch**
653 | * Kompatibilität mit WPtouch
654 | * Unterstützung für do_action hinzugefügt
655 | * Übersetzung auf brasilianisches Portugiesisch
656 |
657 | ### 1.4 ###
658 | * **English**
659 | * Enable stricter inspection for incomming comments
660 | * Do not check if the author has already commented and approved
661 | * **Deutsch**
662 | * strengere Kontrolle für eingehende Kommentare aktiviert
663 | * Nicht auf Spam überprüfen, wenn der Autor bereits kommentiert hat und freigegeben wurde
664 |
665 | ### 1.3 ###
666 | * **English**
667 | * New code structure
668 | * Email notifications about new spam comments
669 | * Novel Algorithm: Advanced spam checking
670 | * **Deutsch**
671 | * Neue Quelltextstruktur
672 | * E-Mail-Benachrichtigungen über neue Spam-Kommentare
673 | * Neuartiger Algorithmus: Erweiterte Spamprüfung
674 |
675 | ### 1.2 ###
676 | * **English**
677 | * Antispam Bee spam counter on dashboard
678 | * **Deutsch**
679 | * Antispam Bee Spam-Zähler auf dem Dashboard
680 |
681 | ### 1.1 ###
682 | * **English**
683 | * Adds support for WordPress new changelog readme.txt standard
684 | * Various changes for more speed, usability and security
685 | * **Deutsch**
686 | * Unterstützung des neuen readme.txt Standards für das Änderungsprotokoll hinzugefügt
687 | * Verschiedene Änderungen für mehr Geschwindigkeit, Benutzerfreundlichkeit und Sicherheit
688 |
689 | ### 1.0 ###
690 | * **English**
691 | * Adds WordPress 2.8 support
692 | * **Deutsch**
693 | * WordPress 2.8 Unterstützung hinzugefügt
694 |
695 | ### 0.9 ###
696 | * **English**
697 | * Mark as spam only comments or only pings
698 | * **Deutsch**
699 | * nur Kommentare oder nur Pings als Spam markieren
700 |
701 | ### 0.8 ###
702 | * **English**
703 | * Optical adjustments of the settings page
704 | * Translation for Simplified Chinese, Spanish and Catalan
705 | * **Deutsch**
706 | * Optische Anpassungen der Einstellungsseite
707 | * Übersetzung für vereinfachtes Chinesisch, Spanisch und Katalanisch
708 |
709 | ### 0.7 ###
710 | * **English**
711 | * Spam folder cleanup after X days
712 | * Optional hide the "MARKED AS SPAM" note
713 | * Language support for Italian and Turkish
714 | * **Deutsch**
715 | * Spam-Ordner Bereinigung nach n Tagen
716 | * Optionales verstecken des "als Spam markiert" Hinweises
717 | * Übersetzungen für Italienisch und Türkisch
718 |
719 | ### 0.6 ###
720 | * **English**
721 | * Language support for English, German, Russian
722 | * **Deutsch**
723 | * Übersetzungen für Englisch, Deutsch und Russisch
724 |
725 | ### 0.5 ###
726 | * **English**
727 | * Workaround for empty comments
728 | * **Deutsch**
729 | * Problembehebung für leere Kommentare
730 |
731 | ### 0.4 ###
732 | * **English**
733 | * Option for trackback and pingback protection
734 | * **Deutsch**
735 | * Einstellung für den Trackback- und Pingback-Schutz
736 |
737 | ### 0.3 ###
738 | * **English**
739 | * Trackback and Pingback spam protection
740 | * **Deutsch**
741 | * Trackback und Pingback Spam-Schutz
742 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/antispam_bee.php:
--------------------------------------------------------------------------------
1 | 0,
374 | ),
375 | '',
376 | 'no'
377 | );
378 |
379 | if ( self::get_option( 'cronjob_enable' ) ) {
380 | self::init_scheduled_hook();
381 | }
382 | }
383 |
384 |
385 | /**
386 | * Action to deactivate the plugin
387 | *
388 | * @since 0.1
389 | * @since 2.4
390 | */
391 | public static function deactivate() {
392 | self::clear_scheduled_hook();
393 | }
394 |
395 |
396 | /**
397 | * Action deleting the plugin
398 | *
399 | * @since 2.4
400 | */
401 | public static function uninstall() {
402 | if ( ! self::get_option( 'delete_data_on_uninstall' ) ) {
403 | return;
404 | }
405 | global $wpdb;
406 |
407 | delete_option( 'antispam_bee' );
408 | delete_option( 'antispambee_db_version' );
409 | $wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
410 |
411 | //phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
412 | $sql = 'delete from `' . $wpdb->commentmeta . '` where `meta_key` IN ("antispam_bee_iphash", "antispam_bee_reason")';
413 | $wpdb->query( $sql );
414 | //phpcs:enable WordPress.DB.PreparedSQL.NotPrepared
415 | }
416 |
417 |
418 |
419 | /*
420 | * ############################
421 | * ######## INTERNAL ########
422 | * ############################
423 | */
424 |
425 | /**
426 | * Initialization of the internal variables
427 | *
428 | * @since 2.4
429 | * @since 2.7.0
430 | * @since 2.10.0 Change renamed country option names in options array
431 | */
432 | private static function _init_internal_vars() {
433 | self::$_base = plugin_basename( __FILE__ );
434 |
435 | $salt = defined( 'NONCE_SALT' ) ? NONCE_SALT : ABSPATH;
436 | self::$_salt = substr( sha1( $salt ), 0, 10 );
437 |
438 | self::$defaults = array(
439 | 'options' => array(
440 | 'regexp_check' => 1,
441 | 'spam_ip' => 1,
442 | 'already_commented' => 1,
443 | 'gravatar_check' => 0,
444 | 'time_check' => 0,
445 | 'ignore_pings' => 0,
446 |
447 | 'dashboard_chart' => 0,
448 | 'dashboard_count' => 0,
449 |
450 | 'country_code' => 0,
451 | 'country_denied' => '',
452 | 'country_allowed' => '',
453 |
454 | 'translate_api' => 0,
455 | 'translate_lang' => array(),
456 |
457 | 'bbcode_check' => 1,
458 |
459 | 'flag_spam' => 1,
460 | 'email_notify' => 0,
461 | 'no_notice' => 0,
462 | 'cronjob_enable' => 0,
463 | 'cronjob_interval' => 0,
464 |
465 | 'ignore_filter' => 0,
466 | 'ignore_type' => 0,
467 |
468 | 'reasons_enable' => 0,
469 | 'ignore_reasons' => array(),
470 |
471 | 'delete_data_on_uninstall' => 1,
472 | ),
473 | );
474 | }
475 |
476 | /**
477 | * Adds spam reason labels to the `$defaults` array.
478 | *
479 | * That is done in an extra method instead of `_init_internal_vars`
480 | * so that the translations are loaded before.
481 | *
482 | * @since 2.11.2
483 | */
484 | public static function add_reasons_to_defaults() {
485 | self::$defaults['reasons'] = array(
486 | 'css' => esc_attr__( 'Honeypot', 'antispam-bee' ),
487 | 'time' => esc_attr__( 'Comment time', 'antispam-bee' ),
488 | 'empty' => esc_attr__( 'Empty Data', 'antispam-bee' ),
489 | 'localdb' => esc_attr__( 'Local DB Spam', 'antispam-bee' ),
490 | 'server' => esc_attr__( 'Fake IP', 'antispam-bee' ),
491 | 'country' => esc_attr__( 'Country Check', 'antispam-bee' ),
492 | 'bbcode' => esc_attr__( 'BBCode', 'antispam-bee' ),
493 | 'lang' => esc_attr__( 'Comment Language', 'antispam-bee' ),
494 | 'regexp' => esc_attr__( 'Regular Expression', 'antispam-bee' ),
495 | 'title_is_name' => esc_attr__( 'Identical Post title and blog title', 'antispam-bee' ),
496 | 'manually' => esc_attr__( 'Manually', 'antispam-bee' ),
497 | );
498 | }
499 |
500 | /**
501 | * Check and return an array key
502 | *
503 | * @since 2.4.2
504 | * @since 2.10.0 Only return `null` if option does not exist.
505 | *
506 | * @param array $array Array with values.
507 | * @param string $key Name of the key.
508 | * @return mixed Value of the requested key.
509 | */
510 | public static function get_key( $array, $key ) {
511 | if ( empty( $array ) || empty( $key ) || ! isset( $array[ $key ] ) ) {
512 | return null;
513 | }
514 |
515 | return $array[ $key ];
516 | }
517 |
518 | /**
519 | * Check if comment is a ping (pingback, trackback or something similar)
520 | *
521 | * @since 2.10.0
522 | *
523 | * @param array $comment Treated commentary data.
524 | * @return boolean `true` if ping and `false` if classic comment
525 | */
526 | public static function is_ping( $comment ) {
527 | $types = array( 'pingback', 'trackback', 'pings' );
528 | $is_ping = false;
529 |
530 | if ( in_array( self::get_key( $comment, 'comment_type' ), $types, true ) ) {
531 | $is_ping = true;
532 | }
533 |
534 | return apply_filters( 'antispam_bee_is_ping', $is_ping, $comment );
535 | }
536 |
537 | /**
538 | * Localization of the admin pages
539 | *
540 | * @since 0.1
541 | * @since 2.4
542 | *
543 | * @param string $page Mark the page.
544 | * @return boolean True on success.
545 | */
546 | private static function _current_page( $page ) {
547 | // phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
548 | switch ( $page ) {
549 | case 'dashboard':
550 | return ( empty( $GLOBALS['pagenow'] ) || ( ! empty( $GLOBALS['pagenow'] ) && 'index.php' === $GLOBALS['pagenow'] ) );
551 |
552 | case 'options':
553 | return ( ! empty( $_GET['page'] ) && 'antispam_bee' === $_GET['page'] );
554 |
555 | case 'plugins':
556 | return ( ! empty( $GLOBALS['pagenow'] ) && 'plugins.php' === $GLOBALS['pagenow'] );
557 |
558 | case 'admin-post':
559 | return ( ! empty( $GLOBALS['pagenow'] ) && 'admin-post.php' === $GLOBALS['pagenow'] );
560 |
561 | case 'edit-comments':
562 | return ( ! empty( $GLOBALS['pagenow'] ) && 'edit-comments.php' === $GLOBALS['pagenow'] );
563 |
564 | default:
565 | return false;
566 | }
567 | // phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification
568 | }
569 |
570 |
571 | /**
572 | * Add the link to the settings
573 | *
574 | * @since 1.1
575 | *
576 | * @param array $data The action link array.
577 | * @return array $data The action link array.
578 | */
579 | public static function init_action_links( $data ) {
580 | if ( ! current_user_can( 'manage_options' ) ) {
581 | return $data;
582 | }
583 |
584 | return array_merge(
585 | $data,
586 | array(
587 | sprintf(
588 | '%s',
589 | add_query_arg(
590 | array(
591 | 'page' => 'antispam_bee',
592 | ),
593 | admin_url( 'options-general.php' )
594 | ),
595 | esc_attr__( 'Settings', 'antispam-bee' )
596 | ),
597 | )
598 | );
599 | }
600 |
601 | /**
602 | * Meta links of the plugin
603 | *
604 | * @since 0.1
605 | * @since 2.6.2
606 | *
607 | * @param array $input Existing links.
608 | * @param string $file Current page.
609 | * @return array $data Modified links.
610 | */
611 | public static function init_row_meta( $input, $file ) {
612 | if ( $file !== self::$_base ) {
613 | return $input;
614 | }
615 |
616 | return array_merge(
617 | $input,
618 | array(
619 | '' . esc_html__( 'Donate', 'antispam-bee' ) . '',
620 | '' . esc_html__( 'Support', 'antispam-bee' ) . '',
621 | )
622 | );
623 | }
624 |
625 | /*
626 | * ############################
627 | * ####### RESOURCES ########
628 | * ############################
629 | */
630 |
631 | /**
632 | * Registration of resources (CSS & JS)
633 | *
634 | * @since 1.6
635 | * @since 2.4.5
636 | */
637 | public static function init_plugin_sources() {
638 | $plugin = get_plugin_data( __FILE__ );
639 |
640 | wp_register_script(
641 | 'ab_script',
642 | plugins_url( 'js/scripts.min.js', __FILE__ ),
643 | array( 'jquery' ),
644 | $plugin['Version']
645 | );
646 |
647 | wp_register_style(
648 | 'ab_style',
649 | plugins_url( 'css/styles.min.css', __FILE__ ),
650 | array( 'dashicons' ),
651 | $plugin['Version']
652 | );
653 | }
654 |
655 |
656 | /**
657 | * Initialization of the option page
658 | *
659 | * @since 0.1
660 | * @since 2.4.3
661 | */
662 | public static function add_sidebar_menu() {
663 | $page = add_options_page(
664 | 'Antispam Bee',
665 | 'Antispam Bee',
666 | 'manage_options',
667 | 'antispam_bee',
668 | array(
669 | 'Antispam_Bee_GUI',
670 | 'options_page',
671 | )
672 | );
673 |
674 | add_action(
675 | 'admin_print_scripts-' . $page,
676 | array(
677 | __CLASS__,
678 | 'add_options_script',
679 | )
680 | );
681 |
682 | add_action(
683 | 'admin_print_styles-' . $page,
684 | array(
685 | __CLASS__,
686 | 'add_options_style',
687 | )
688 | );
689 |
690 | add_action(
691 | 'load-' . $page,
692 | array(
693 | __CLASS__,
694 | 'init_options_page',
695 | )
696 | );
697 | }
698 |
699 |
700 | /**
701 | * Initialization of JavaScript
702 | *
703 | * @since 1.6
704 | * @since 2.4
705 | */
706 | public static function add_options_script() {
707 | wp_enqueue_script( 'ab_script' );
708 | }
709 |
710 |
711 | /**
712 | * Initialization of Stylesheets
713 | *
714 | * @since 1.6
715 | * @since 2.4
716 | */
717 | public static function add_options_style() {
718 | wp_enqueue_style( 'ab_style' );
719 | }
720 |
721 |
722 | /**
723 | * Integration of the GUI
724 | *
725 | * @since 2.4
726 | */
727 | public static function init_options_page() {
728 | require_once dirname( __FILE__ ) . '/inc/gui.class.php';
729 | }
730 |
731 |
732 |
733 | /*
734 | * ############################
735 | * ####### DASHBOARD ########
736 | * ############################
737 | */
738 |
739 | /**
740 | * Display the spam counter on the dashboard
741 | *
742 | * @since 0.1
743 | * @since 2.6.5
744 | *
745 | * @param array $items Initial array with dashboard items.
746 | * @return array $items Merged array with dashboard items.
747 | */
748 | public static function add_dashboard_count( $items = array() ) {
749 | if ( ! current_user_can( 'manage_options' ) || ! self::get_option( 'dashboard_count' ) ) {
750 | return $items;
751 | }
752 |
753 | echo '';
754 |
755 | $items[] = '' . esc_html(
756 | sprintf(
757 | // translators: The number of spam comments Antispam Bee blocked so far.
758 | _n(
759 | '%s Blocked',
760 | '%s Blocked',
761 | self::_get_spam_count(),
762 | 'antispam-bee'
763 | ),
764 | self::_get_spam_count()
765 | )
766 | ) . '';
767 |
768 | return $items;
769 | }
770 |
771 | /**
772 | * Initialize the dashboard chart
773 | *
774 | * @since 1.9
775 | * @since 2.5.6
776 | */
777 | public static function add_dashboard_chart() {
778 | if ( ! current_user_can( 'publish_posts' ) || ! self::get_option( 'dashboard_chart' ) ) {
779 | return;
780 | }
781 |
782 | wp_add_dashboard_widget(
783 | 'ab_widget',
784 | 'Antispam Bee',
785 | array(
786 | __CLASS__,
787 | 'show_spam_chart',
788 | )
789 | );
790 |
791 | add_action(
792 | 'admin_head',
793 | array(
794 | __CLASS__,
795 | 'add_dashboard_style',
796 | )
797 | );
798 | }
799 |
800 | /**
801 | * Print dashboard styles
802 | *
803 | * @since 1.9.0
804 | * @since 2.5.8
805 | */
806 | public static function add_dashboard_style() {
807 | $plugin = get_plugin_data( __FILE__ );
808 |
809 | wp_register_style(
810 | 'ab_chart',
811 | plugins_url( 'css/dashboard.min.css', __FILE__ ),
812 | array(),
813 | $plugin['Version']
814 | );
815 |
816 | wp_print_styles( 'ab_chart' );
817 | }
818 |
819 |
820 | /**
821 | * Print dashboard scripts
822 | *
823 | * @since 1.9.0
824 | * @since 2.5.8
825 | */
826 | public static function add_dashboard_script() {
827 | if ( ! self::get_option( 'daily_stats' ) ) {
828 | return;
829 | }
830 |
831 | $plugin = get_plugin_data( __FILE__ );
832 |
833 | wp_enqueue_script(
834 | 'raphael',
835 | plugins_url( 'js/raphael.min.js', __FILE__ ),
836 | array(),
837 | '2.1.0',
838 | true
839 | );
840 |
841 | wp_enqueue_script(
842 | 'ab-raphael',
843 | plugins_url( 'js/raphael.helper.min.js', __FILE__ ),
844 | array( 'raphael' ),
845 | $plugin['Version'],
846 | true
847 | );
848 |
849 | wp_enqueue_script(
850 | 'ab_chart_js',
851 | plugins_url( 'js/dashboard.min.js', __FILE__ ),
852 | array( 'jquery', 'ab-raphael' ),
853 | $plugin['Version'],
854 | true
855 | );
856 | }
857 |
858 | /**
859 | * Print dashboard html
860 | *
861 | * @since 1.9.0
862 | * @since 2.5.8
863 | */
864 | public static function show_spam_chart() {
865 | $items = (array) self::get_option( 'daily_stats' );
866 |
867 | if ( empty( $items ) ) {
868 | printf(
869 | '
',
870 | esc_html__( 'No data available.', 'antispam-bee' )
871 | );
872 |
873 | return;
874 | }
875 |
876 | self::add_dashboard_script();
877 |
878 | ksort( $items, SORT_NUMERIC );
879 |
880 | $html = "\n";
881 |
882 | $html .= "\n";
883 | foreach ( $items as $date => $count ) {
884 | $html .= '' . date_i18n( 'j. F Y', $date ) . " | \n";
885 | }
886 | $html .= "
\n";
887 |
888 | $html .= "\n";
889 | foreach ( $items as $date => $count ) {
890 | $html .= '' . (int) $count . " | \n";
891 | }
892 | $html .= "
\n";
893 |
894 | $html .= "
\n";
895 |
896 | echo wp_kses_post( '' . $html . '
' );
897 | }
898 |
899 | /*
900 | * ############################
901 | * ######## OPTIONS #########
902 | * ############################
903 | */
904 |
905 | /**
906 | * Get all plugin options
907 | *
908 | * @since 2.4
909 | * @since 2.6.1
910 | *
911 | * @return array $options Array with option fields.
912 | */
913 | public static function get_options() {
914 | $options = wp_cache_get( 'antispam_bee' );
915 | if ( ! $options ) {
916 | wp_cache_set(
917 | 'antispam_bee',
918 | $options = get_option( 'antispam_bee' )
919 | );
920 | }
921 |
922 | if ( null === self::$defaults ) {
923 | self::_init_internal_vars();
924 | }
925 |
926 | return wp_parse_args(
927 | $options,
928 | self::$defaults['options']
929 | );
930 | }
931 |
932 | /**
933 | * Get single option field
934 | *
935 | * @since 0.1
936 | * @since 2.4.2
937 | *
938 | * @param string $field Field name.
939 | * @return mixed Field value.
940 | */
941 | public static function get_option( $field ) {
942 | $options = self::get_options();
943 |
944 | return self::get_key( $options, $field );
945 | }
946 |
947 |
948 | /**
949 | * Update single option field
950 | *
951 | * @since 0.1
952 | * @since 2.4
953 | *
954 | * @param string $field Field name.
955 | * @param mixed $value The Field value.
956 | */
957 | private static function _update_option( $field, $value ) {
958 | self::update_options(
959 | array(
960 | $field => $value,
961 | )
962 | );
963 | }
964 |
965 |
966 | /**
967 | * Update multiple option fields
968 | *
969 | * @since 0.1
970 | * @since 2.6.1
971 | *
972 | * @param array $data Array with plugin option fields.
973 | */
974 | public static function update_options( $data ) {
975 | $options = get_option( 'antispam_bee' );
976 |
977 | if ( is_array( $options ) ) {
978 | $options = array_merge(
979 | $options,
980 | $data
981 | );
982 | } else {
983 | $options = $data;
984 | }
985 |
986 | update_option(
987 | 'antispam_bee',
988 | $options
989 | );
990 |
991 | wp_cache_set(
992 | 'antispam_bee',
993 | $options
994 | );
995 | }
996 |
997 |
998 |
999 | /*
1000 | * ############################
1001 | * ######## CRONJOBS ########
1002 | * ############################
1003 | */
1004 |
1005 | /**
1006 | * Execution of the daily cronjobs
1007 | *
1008 | * @since 0.1
1009 | * @since 2.4
1010 | */
1011 | public static function start_daily_cronjob() {
1012 | if ( ! self::get_option( 'cronjob_enable' ) ) {
1013 | return;
1014 | }
1015 |
1016 | self::_update_option(
1017 | 'cronjob_timestamp',
1018 | time()
1019 | );
1020 |
1021 | self::_delete_old_spam();
1022 | }
1023 |
1024 |
1025 | /**
1026 | * Delete old spam comments
1027 | *
1028 | * @since 0.1
1029 | * @since 2.4
1030 | */
1031 | private static function _delete_old_spam() {
1032 | $days = (int) self::get_option( 'cronjob_interval' );
1033 |
1034 | if ( empty( $days ) ) {
1035 | return false;
1036 | }
1037 |
1038 | global $wpdb;
1039 |
1040 | $wpdb->query(
1041 | $wpdb->prepare(
1042 | "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",
1043 | $days
1044 | )
1045 | );
1046 |
1047 | $wpdb->query( "OPTIMIZE TABLE `$wpdb->comments`" );
1048 | }
1049 |
1050 |
1051 | /**
1052 | * Initialization of the cronjobs
1053 | *
1054 | * @since 0.1
1055 | * @since 2.4
1056 | */
1057 | public static function init_scheduled_hook() {
1058 | if ( ! wp_next_scheduled( 'antispam_bee_daily_cronjob' ) ) {
1059 | wp_schedule_event(
1060 | time(),
1061 | 'daily',
1062 | 'antispam_bee_daily_cronjob'
1063 | );
1064 | }
1065 | }
1066 |
1067 |
1068 | /**
1069 | * Deletion of the cronjobs
1070 | *
1071 | * @since 0.1
1072 | * @since 2.4
1073 | */
1074 | public static function clear_scheduled_hook() {
1075 | if ( wp_next_scheduled( 'antispam_bee_daily_cronjob' ) ) {
1076 | wp_clear_scheduled_hook( 'antispam_bee_daily_cronjob' );
1077 | }
1078 | }
1079 |
1080 | /**
1081 | * Shows plugin update notice
1082 | *
1083 | * @since 2.11.4
1084 | *
1085 | * @param array $data An array of plugin metadata. See get_plugin_data()
1086 | * and the {@see 'plugin_row_meta'} filter for the list
1087 | * of possible values.
1088 | *
1089 | * @return void
1090 | */
1091 | public static function upgrade_notice( $data ) {
1092 | if ( isset( $data['upgrade_notice'] ) ) {
1093 | printf(
1094 | '%s
',
1095 | wp_kses(
1096 | wpautop( $data['upgrade_notice '] ),
1097 | array(
1098 | 'p' => array(),
1099 | 'a' => array( 'href', 'title' ),
1100 | 'strong' => array(),
1101 | 'em' => array(),
1102 | )
1103 | )
1104 | );
1105 | }
1106 | }
1107 |
1108 |
1109 | /*
1110 | * ############################
1111 | * ###### SPAM CHECK ########
1112 | * ############################
1113 | */
1114 |
1115 | /**
1116 | * Check POST values
1117 | *
1118 | * @since 0.1
1119 | * @since 2.6.3
1120 | * @since 2.11.7 Switching from REQUEST_URI to SCRIPT_NAME for the check
1121 | */
1122 | public static function precheck_incoming_request() {
1123 | // phpcs:disable WordPress.Security.NonceVerification.Missing
1124 | if ( is_feed() || is_trackback() || empty( $_POST ) || self::_is_mobile() ) {
1125 | return;
1126 | }
1127 |
1128 | $request_uri = self::get_key( $_SERVER, 'SCRIPT_NAME' );
1129 | $request_path = self::parse_url( $request_uri, 'path' );
1130 |
1131 | if ( strpos( $request_path, 'wp-comments-post.php' ) === false ) {
1132 | return;
1133 | }
1134 |
1135 | $post_id = (int) self::get_key( $_POST, 'comment_post_ID' );
1136 | $hidden_field = self::get_key( $_POST, 'comment' );
1137 | $plugin_field = self::get_key( $_POST, self::get_secret_name_for_post( $post_id ) );
1138 |
1139 | if ( ! empty( $hidden_field ) ) {
1140 | $_POST['ab_spam__hidden_field'] = 1;
1141 | } else {
1142 | $_POST['comment'] = $plugin_field;
1143 | unset( $_POST[ self::get_secret_name_for_post( $post_id ) ] );
1144 | }
1145 | // phpcs:enable WordPress.Security.NonceVerification.Missing
1146 | }
1147 |
1148 |
1149 | /**
1150 | * Check incoming requests for spam
1151 | *
1152 | * @since 0.1
1153 | * @since 2.6.3
1154 | * @since 2.10.0 Refactoring of code if pings are allowed and if is ping
1155 | * @since 2.11.7 Switching from REQUEST_URI to SCRIPT_NAME for the check
1156 | *
1157 | * @param array $comment Untreated comment.
1158 | * @return array $comment Treated comment.
1159 | */
1160 | public static function handle_incoming_request( $comment ) {
1161 | $comment['comment_author_IP'] = self::get_client_ip();
1162 |
1163 | $request_uri = self::get_key( $_SERVER, 'SCRIPT_NAME' );
1164 | $request_path = self::parse_url( $request_uri, 'path' );
1165 |
1166 | if ( empty( $request_path ) ) {
1167 | return self::_handle_spam_request(
1168 | $comment,
1169 | 'empty'
1170 | );
1171 | }
1172 |
1173 | $pings_allowed = ! self::get_option( 'ignore_pings' );
1174 |
1175 | // phpcs:disable WordPress.Security.NonceVerification.Missing
1176 | // Everybody can post.
1177 | if ( strpos( $request_path, 'wp-comments-post.php' ) !== false && ! empty( $_POST ) ) {
1178 | // phpcs:enable WordPress.Security.NonceVerification.Missing
1179 | $status = self::_verify_comment_request( $comment );
1180 |
1181 | if ( ! empty( $status['reason'] ) ) {
1182 | return self::_handle_spam_request(
1183 | $comment,
1184 | $status['reason']
1185 | );
1186 | }
1187 | } elseif ( self::is_ping( $comment ) && $pings_allowed ) {
1188 | $status = self::_verify_trackback_request( $comment );
1189 |
1190 | if ( ! empty( $status['reason'] ) ) {
1191 | return self::_handle_spam_request(
1192 | $comment,
1193 | $status['reason'],
1194 | true
1195 | );
1196 | }
1197 | }
1198 |
1199 | return $comment;
1200 | }
1201 |
1202 | /**
1203 | * Prepares the replacement of the comment field with output buffering.
1204 | *
1205 | * @since 2.10.0
1206 | */
1207 | public static function prepare_comment_field_output_buffering() {
1208 | if ( is_feed() || is_trackback() || is_robots() || self::_is_mobile() ) {
1209 | return;
1210 | }
1211 |
1212 | ob_start(
1213 | array(
1214 | 'Antispam_Bee',
1215 | 'prepare_comment_field',
1216 | )
1217 | );
1218 | }
1219 |
1220 |
1221 | /**
1222 | * Prepares the replacement of the comment field
1223 | *
1224 | * @since 0.1
1225 | * @since 2.4
1226 | * @since 2.10.0 Changes needed because of new way to add the honeypot field via filter instead of output buffering
1227 | *
1228 | * @param string $data Markup of the comment field or whole page (depending on ob option).
1229 | */
1230 | public static function prepare_comment_field( $data ) {
1231 | if ( empty( $data ) ) {
1232 | return $data;
1233 | }
1234 |
1235 | if ( ! preg_match( '# (?# match the whole textarea tag )
1241 |