Antispam Bee - Version 2.4.1

Version Description

  • Add russian translation
  • Fix for the textarea replace
  • Detect and hide admin notices
Download this release

Release Info

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

Version 2.4.1

antispam_bee.php ADDED
@@ -0,0 +1,2026 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Antispam Bee
4
+ Text Domain: antispam_bee
5
+ Domain Path: /lang
6
+ Description: Easy and extremely productive spam-fighting plugin with many sophisticated solutions. Includes protection again trackback spam.
7
+ Author: Sergej M&uuml;ller
8
+ Author URI: http://wpseo.de
9
+ Plugin URI: http://antispambee.com
10
+ Version: 2.4.1
11
+ */
12
+
13
+
14
+ /* Sicherheitsabfrage */
15
+ if ( !class_exists('WP') ) {
16
+ die();
17
+ }
18
+
19
+
20
+ /**
21
+ * Antispam_Bee
22
+ *
23
+ * @since 0.1
24
+ * @change 2.4
25
+ */
26
+
27
+ class Antispam_Bee {
28
+
29
+
30
+ /* Init */
31
+ public static $short;
32
+ public static $default;
33
+ private static $base;
34
+ private static $secret;
35
+ private static $reason;
36
+
37
+
38
+ /**
39
+ * "Konstruktor" der Klasse
40
+ *
41
+ * @since 0.1
42
+ * @change 2.4
43
+ */
44
+
45
+ public static function init()
46
+ {
47
+ /* AJAX & Co. */
48
+ if ( (defined('DOING_AJAX') && DOING_AJAX) or (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) ) {
49
+ return;
50
+ }
51
+
52
+ /* Initialisierung */
53
+ self::_init_internal_vars();
54
+
55
+ /* Cronjob */
56
+ if ( defined('DOING_CRON') ) {
57
+ add_action(
58
+ 'antispam_bee_daily_cronjob',
59
+ array(
60
+ __CLASS__,
61
+ 'start_daily_cronjob'
62
+ )
63
+ );
64
+
65
+ /* Admin */
66
+ } elseif ( is_admin() ) {
67
+ /* Menü */
68
+ add_action(
69
+ 'admin_menu',
70
+ array(
71
+ __CLASS__,
72
+ 'add_sidebar_menu'
73
+ )
74
+ );
75
+
76
+ /* Dashboard */
77
+ if ( self::_current_page('dashboard') ) {
78
+ add_action(
79
+ 'init',
80
+ array(
81
+ __CLASS__,
82
+ 'load_plugin_lang'
83
+ )
84
+ );
85
+ add_action(
86
+ 'right_now_discussion_table_end',
87
+ array(
88
+ __CLASS__,
89
+ 'add_dashboard_count'
90
+ )
91
+ );
92
+ add_action(
93
+ 'wp_dashboard_setup',
94
+ array(
95
+ __CLASS__,
96
+ 'add_dashboard_chart'
97
+ )
98
+ );
99
+
100
+ /* Plugins */
101
+ } else if ( self::_current_page('plugins') ) {
102
+ add_action(
103
+ 'init',
104
+ array(
105
+ __CLASS__,
106
+ 'load_plugin_lang'
107
+ )
108
+ );
109
+ add_action(
110
+ 'admin_notices',
111
+ array(
112
+ __CLASS__,
113
+ 'check_system_health'
114
+ )
115
+ );
116
+ add_filter(
117
+ 'plugin_row_meta',
118
+ array(
119
+ __CLASS__,
120
+ 'init_row_meta'
121
+ ),
122
+ 10,
123
+ 2
124
+ );
125
+ add_filter(
126
+ 'plugin_action_links_' .self::$base,
127
+ array(
128
+ __CLASS__,
129
+ 'init_action_links'
130
+ )
131
+ );
132
+
133
+ /* Optionen */
134
+ } else if ( self::_current_page('options') ) {
135
+ add_action(
136
+ 'admin_init',
137
+ array(
138
+ __CLASS__,
139
+ 'load_plugin_lang'
140
+ )
141
+ );
142
+ add_action(
143
+ 'admin_init',
144
+ array(
145
+ __CLASS__,
146
+ 'init_plugin_sources'
147
+ )
148
+ );
149
+
150
+ } else if ( self::_current_page('admin-post') ) {
151
+ require_once( dirname(__FILE__). '/inc/gui.class.php' );
152
+
153
+ add_action(
154
+ 'admin_post_ab_save_changes',
155
+ array(
156
+ 'Antispam_Bee_GUI',
157
+ 'save_changes'
158
+ )
159
+ );
160
+ }
161
+
162
+ /* Frontend */
163
+ } else {
164
+ add_action(
165
+ 'template_redirect',
166
+ array(
167
+ __CLASS__,
168
+ 'prepare_comment_field'
169
+ )
170
+ );
171
+ add_action(
172
+ 'init',
173
+ array(
174
+ __CLASS__,
175
+ 'precheck_incoming_request'
176
+ )
177
+ );
178
+ add_action(
179
+ 'preprocess_comment',
180
+ array(
181
+ __CLASS__,
182
+ 'handle_incoming_request'
183
+ ),
184
+ 1
185
+ );
186
+ add_action(
187
+ 'antispam_bee_count',
188
+ array(
189
+ __CLASS__,
190
+ 'the_spam_count'
191
+ )
192
+ );
193
+
194
+ add_filter(
195
+ 'comment_notification_text',
196
+ array(
197
+ __CLASS__,
198
+ 'replace_whois_link'
199
+ )
200
+ );
201
+ add_filter(
202
+ 'comment_moderation_text',
203
+ array(
204
+ __CLASS__,
205
+ 'replace_whois_link'
206
+ )
207
+ );
208
+ }
209
+ }
210
+
211
+
212
+
213
+
214
+ ############################
215
+ ######## INSTALL #########
216
+ ############################
217
+
218
+
219
+ /**
220
+ * Aktion bei der Aktivierung des Plugins
221
+ *
222
+ * @since 0.1
223
+ * @change 2.4
224
+ */
225
+
226
+ public static function activate()
227
+ {
228
+ /* Option anlegen */
229
+ add_option(
230
+ self::$short,
231
+ array(),
232
+ '',
233
+ 'no'
234
+ );
235
+
236
+ /* Cron aktivieren */
237
+ if ( self::get_option('cronjob_enable') ) {
238
+ self::init_scheduled_hook();
239
+ }
240
+ }
241
+
242
+
243
+ /**
244
+ * Aktion bei der Deaktivierung des Plugins
245
+ *
246
+ * @since 0.1
247
+ * @change 2.4
248
+ */
249
+
250
+ public static function deactivate()
251
+ {
252
+ self::clear_scheduled_hook();
253
+ }
254
+
255
+
256
+ /**
257
+ * Aktion beim Löschen des Plugins
258
+ *
259
+ * @since 2.4
260
+ * @change 2.4
261
+ */
262
+
263
+ public static function uninstall()
264
+ {
265
+ /* Global */
266
+ global $wpdb;
267
+
268
+ /* Remove settings */
269
+ delete_option('antispam_bee');
270
+
271
+ /* Clean DB */
272
+ $wpdb->query("OPTIMIZE TABLE `" .$wpdb->options. "`");
273
+ }
274
+
275
+
276
+
277
+
278
+ ############################
279
+ ######### INTERN #########
280
+ ############################
281
+
282
+
283
+ /**
284
+ * Initialisierung der internen Variablen
285
+ *
286
+ * @since 2.4
287
+ * @change 2.4
288
+ */
289
+
290
+ private static function _init_internal_vars()
291
+ {
292
+ self::$base = plugin_basename(__FILE__);
293
+ self::$short = 'antispam_bee';
294
+ self::$secret = substr(md5(get_bloginfo('url')), 0, 5). '-comment';
295
+
296
+ self::$default = array(
297
+ 'options' => array(
298
+ /* Allgemein */
299
+ 'advanced_check' => 1,
300
+ 'spam_ip' => 1,
301
+ 'already_commented' => 1,
302
+ 'ignore_pings' => 0,
303
+ 'always_allowed' => 0,
304
+
305
+ 'dashboard_chart' => 1,
306
+ 'dashboard_count' => 0,
307
+
308
+ /* Filter */
309
+ 'country_code' => 0,
310
+ 'ipinfodb_key' => '',
311
+ 'country_black' => '',
312
+ 'country_white' => '',
313
+
314
+ 'translate_api' => 0,
315
+ 'translate_lang' => '',
316
+
317
+ 'honey_pot' => 0,
318
+ 'honey_key' => '',
319
+
320
+ /* Erweitert */
321
+ 'flag_spam' => 1,
322
+ 'email_notify' => 1,
323
+ 'no_notice' => 1,
324
+ 'cronjob_enable' => 0,
325
+ 'cronjob_interval' => 0,
326
+
327
+ 'ignore_filter' => 0,
328
+ 'ignore_type' => 0,
329
+ 'ignore_reasons' => array(),
330
+
331
+ /* Tab */
332
+ 'tab_index' => 0
333
+ ),
334
+ 'reasons' => array(
335
+ 'css' => 'CSS Hack',
336
+ 'empty' => 'Empty Data',
337
+ 'server' => 'Server IP',
338
+ 'spamip' => 'Spam IP',
339
+ 'country' => 'Country Check',
340
+ 'honey' => 'Honey Pot',
341
+ 'lang' => 'Comment Language'
342
+ )
343
+ );
344
+ }
345
+
346
+
347
+ /**
348
+ * Prüfung auf die Mindestvoraussetzungen
349
+ *
350
+ * @since 2.4
351
+ * @change 2.4
352
+ */
353
+
354
+ public static function check_system_health()
355
+ {
356
+ if ( !version_compare(PHP_VERSION, '5.1.2', '>=') or !version_compare($GLOBALS['wp_version'], '3.0', '>=') ) {
357
+ echo sprintf(
358
+ '<div class="error"><p>%s</p></div>',
359
+ esc_html__('Antispam Bee requires at least PHP 5.1.2 and WordPress 3.0', self::$short)
360
+ );
361
+ }
362
+ }
363
+
364
+
365
+ /**
366
+ * Lokalisierung der Admin-Seiten
367
+ *
368
+ * @since 0.1
369
+ * @change 2.4
370
+ *
371
+ * @param string $page Kennzeichnung der Seite
372
+ * @return boolean TRUE Bei Erfolg
373
+ */
374
+
375
+ private static function _current_page($page)
376
+ {
377
+ switch ($page) {
378
+ case 'dashboard':
379
+ return ( empty($GLOBALS['pagenow']) or ( !empty($GLOBALS['pagenow']) && $GLOBALS['pagenow'] == 'index.php' ) );
380
+
381
+ case 'options':
382
+ return ( !empty($_REQUEST['page']) && $_REQUEST['page'] == self::$short );
383
+
384
+ case 'plugins':
385
+ return ( !empty($GLOBALS['pagenow']) && $GLOBALS['pagenow'] == 'plugins.php' );
386
+
387
+ case 'admin-post':
388
+ return ( !empty($GLOBALS['pagenow']) && $GLOBALS['pagenow'] == 'admin-post.php' );
389
+
390
+ default:
391
+ return false;
392
+ }
393
+ }
394
+
395
+
396
+ /**
397
+ * Einbindung der Sprachdatei
398
+ *
399
+ * @since 0.1
400
+ * @change 2.4
401
+ */
402
+
403
+ public static function load_plugin_lang()
404
+ {
405
+ load_plugin_textdomain(
406
+ self::$short,
407
+ false,
408
+ 'antispam-bee/lang'
409
+ );
410
+ }
411
+
412
+
413
+ /**
414
+ * Hinzufügen des Links zu den Einstellungen
415
+ *
416
+ * @since 1.1
417
+ * @change 1.1
418
+ */
419
+
420
+ public static function init_action_links($data)
421
+ {
422
+ /* Rechte? */
423
+ if ( !current_user_can('manage_options') ) {
424
+ return $data;
425
+ }
426
+
427
+ return array_merge(
428
+ $data,
429
+ array(
430
+ sprintf(
431
+ '<a href="%s">%s</a>',
432
+ add_query_arg(
433
+ array(
434
+ 'page' => self::$short
435
+ ),
436
+ admin_url('options-general.php')
437
+ ),
438
+ __('Settings')
439
+ )
440
+ )
441
+ );
442
+ }
443
+
444
+
445
+ /**
446
+ * Meta-Links des Plugins
447
+ *
448
+ * @since 0.1
449
+ * @change 2.4
450
+ *
451
+ * @param array $data Bereits vorhandene Links
452
+ * @param string $page Aktuelle Seite
453
+ * @return array $data Modifizierte Links
454
+ */
455
+
456
+ public static function init_row_meta($data, $page)
457
+ {
458
+ /* Rechte */
459
+ if ( $page != self::$base ) {
460
+ return $data;
461
+ }
462
+
463
+ return array_merge(
464
+ $data,
465
+ array(
466
+ '<a href="http://flattr.com/profile/sergej.mueller" target="_blank">Plugin flattern</a>',
467
+ '<a href="https://plus.google.com/110569673423509816572" target="_blank">Auf Google+ folgen</a>'
468
+ )
469
+ );
470
+ }
471
+
472
+
473
+
474
+
475
+ ############################
476
+ ####### RESSOURCEN #######
477
+ ############################
478
+
479
+
480
+ /**
481
+ * Registrierung von Ressourcen (CSS & JS)
482
+ *
483
+ * @since 1.6
484
+ * @change 2.4
485
+ */
486
+
487
+ public static function init_plugin_sources()
488
+ {
489
+ /* Infos auslesen */
490
+ $plugin = get_plugin_data(__FILE__);
491
+
492
+ /* JS einbinden */
493
+ wp_register_script(
494
+ 'ab_script',
495
+ plugins_url('js/script.js', __FILE__),
496
+ array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'),
497
+ $plugin['Version']
498
+ );
499
+
500
+ /* CSS einbinden */
501
+ wp_register_style(
502
+ 'ab_style',
503
+ plugins_url('css/style.css', __FILE__),
504
+ array(),
505
+ $plugin['Version']
506
+ );
507
+ }
508
+
509
+
510
+ /**
511
+ * Initialisierung der Optionsseite
512
+ *
513
+ * @since 0.1
514
+ * @change 2.4
515
+ */
516
+
517
+ public static function add_sidebar_menu()
518
+ {
519
+ /* Menü anlegen */
520
+ $page = add_options_page(
521
+ 'Antispam Bee',
522
+ '<img src="' .plugins_url('img/icon.png', __FILE__). '" id="ab_icon" alt="Antispam Bee" />Antispam Bee',
523
+ 'manage_options',
524
+ self::$short,
525
+ array(
526
+ 'Antispam_Bee_GUI',
527
+ 'options_page'
528
+ )
529
+ );
530
+
531
+ /* JS einbinden */
532
+ add_action(
533
+ 'admin_print_scripts-' . $page,
534
+ array(
535
+ __CLASS__,
536
+ 'add_options_script'
537
+ )
538
+ );
539
+
540
+ /* CSS einbinden */
541
+ add_action(
542
+ 'admin_print_styles-' . $page,
543
+ array(
544
+ __CLASS__,
545
+ 'add_options_style'
546
+ )
547
+ );
548
+
549
+ /* PHP laden */
550
+ add_action(
551
+ 'load-' .$page,
552
+ array(
553
+ __CLASS__,
554
+ 'init_options_page'
555
+ )
556
+ );
557
+ }
558
+
559
+
560
+ /**
561
+ * Initialisierung von JavaScript
562
+ *
563
+ * @since 1.6
564
+ * @change 2.4
565
+ */
566
+
567
+ public static function add_options_script()
568
+ {
569
+ wp_enqueue_script('ab_script');
570
+ }
571
+
572
+
573
+ /**
574
+ * Initialisierung von Stylesheets
575
+ *
576
+ * @since 1.6
577
+ * @change 2.4
578
+ */
579
+
580
+ public static function add_options_style()
581
+ {
582
+ wp_enqueue_style('ab_style');
583
+ }
584
+
585
+
586
+ /**
587
+ * Einbindung der GUI
588
+ *
589
+ * @since 2.4
590
+ * @change 2.4
591
+ */
592
+
593
+ public static function init_options_page()
594
+ {
595
+ require_once( dirname(__FILE__). '/inc/gui.class.php' );
596
+ }
597
+
598
+
599
+
600
+
601
+ ############################
602
+ ####### DASHBOARD ########
603
+ ############################
604
+
605
+
606
+ /**
607
+ * Anzeige des Spam-Counters auf dem Dashboard
608
+ *
609
+ * @since 0.1
610
+ * @change 2.4
611
+ */
612
+
613
+ public static function add_dashboard_count()
614
+ {
615
+ /* Aktiv? */
616
+ if ( !self::get_option('dashboard_count') ) {
617
+ return;
618
+ }
619
+
620
+ /* Ausgabe */
621
+ echo sprintf(
622
+ '<tr>
623
+ <td class="b b-spam" style="font-size:18px">%s</td>
624
+ <td class="last t">%s</td>
625
+ </tr>',
626
+ esc_html( self::_get_spam_count() ),
627
+ esc_html__('Blocked', self::$short)
628
+ );
629
+ }
630
+
631
+
632
+ /**
633
+ * Initialisierung des Dashboard-Chart
634
+ *
635
+ * @since 1.9
636
+ * @change 2.4
637
+ */
638
+
639
+ public static function add_dashboard_chart()
640
+ {
641
+ /* Filter */
642
+ if ( !current_user_can('level_2') or !self::get_option('dashboard_chart') ) {
643
+ return;
644
+ }
645
+
646
+ /* Widget hinzufügen */
647
+ wp_add_dashboard_widget(
648
+ 'ab_widget',
649
+ 'Antispam Bee',
650
+ array(
651
+ __CLASS__,
652
+ 'show_spam_chart'
653
+ )
654
+ );
655
+
656
+ /* JS laden */
657
+ add_action(
658
+ 'wp_print_scripts',
659
+ array(
660
+ __CLASS__,
661
+ 'add_dashboard_script'
662
+ )
663
+ );
664
+
665
+ /* CSS laden */
666
+ add_action(
667
+ 'admin_head',
668
+ array(
669
+ __CLASS__,
670
+ 'add_dashboard_style'
671
+ )
672
+ );
673
+ }
674
+
675
+
676
+ /**
677
+ * Ausgabe der Dashboard-CSS
678
+ *
679
+ * @since 1.9
680
+ * @change 2.4
681
+ */
682
+
683
+ public static function add_dashboard_style()
684
+ {
685
+ /* Plugin-Info */
686
+ $plugin = get_plugin_data(__FILE__);
687
+
688
+ /* CSS registrieren */
689
+ wp_register_style(
690
+ 'ab_chart',
691
+ plugins_url('css/dashboard.css', __FILE__),
692
+ array(),
693
+ $plugin['Version']
694
+ );
695
+
696
+ /* CSS ausgeben */
697
+ wp_print_styles('ab_chart');
698
+ }
699
+
700
+
701
+ /**
702
+ * Ausgabe der Dashboard-JS
703
+ *
704
+ * @since 1.9
705
+ * @change 2.4
706
+ */
707
+
708
+ public static function add_dashboard_script()
709
+ {
710
+ /* Init */
711
+ $items = (array)self::get_option('daily_stats');
712
+
713
+ /* Leer? */
714
+ if ( empty($items) ) {
715
+ return;
716
+ }
717
+
718
+ /* Sortieren */
719
+ krsort($items, SORT_NUMERIC);
720
+
721
+ /* Init */
722
+ $output = array(
723
+ 'created' => array(),
724
+ 'count' => array()
725
+ );
726
+
727
+ /* Init */
728
+ $i = 0;
729
+
730
+ /* Zeilen loopen */
731
+ foreach($items as $timestamp => $count) {
732
+ array_push(
733
+ $output['created'],
734
+ ( $timestamp == strtotime('today', current_time('timestamp')) ? __('Today', self::$short) : date('d.m', $timestamp) )
735
+ );
736
+ array_push(
737
+ $output['count'],
738
+ (int)$count
739
+ );
740
+ }
741
+
742
+ /* Zusammenfassen */
743
+ $stats = array(
744
+ 'created' => implode(',', $output['created']),
745
+ 'count' => implode(',', $output['count'])
746
+ );
747
+
748
+ /* Plugin-Info */
749
+ $plugin = get_plugin_data(__FILE__);
750
+
751
+ /* JS einbinden */
752
+ wp_register_script(
753
+ 'ab_chart',
754
+ plugins_url('js/dashboard.js', __FILE__),
755
+ array('jquery'),
756
+ $plugin['Version']
757
+ );
758
+ wp_register_script(
759
+ 'google_jsapi',
760
+ 'http://www.google.com/jsapi',
761
+ false
762
+ );
763
+
764
+ /* Einbinden */
765
+ wp_enqueue_script('google_jsapi');
766
+ wp_enqueue_script('ab_chart');
767
+
768
+ /* Übergeben */
769
+ wp_localize_script(
770
+ 'ab_chart',
771
+ 'antispambee',
772
+ $stats
773
+ );
774
+ }
775
+
776
+
777
+ /**
778
+ * Ausgabe des Dashboard-Chart
779
+ *
780
+ * @since 1.9
781
+ * @change 2.4
782
+ */
783
+
784
+ public static function show_spam_chart()
785
+ {
786
+ /* Init */
787
+ $items = (array)self::get_option('daily_stats');
788
+
789
+ /* Ausgabe */
790
+ echo sprintf(
791
+ '<div id="ab_chart">%s</div>',
792
+ ( empty($items) ? esc_html__('No data available.', self::$short) : '' )
793
+ );
794
+ }
795
+
796
+
797
+
798
+
799
+ ############################
800
+ ######## OPTIONS #########
801
+ ############################
802
+
803
+
804
+ /**
805
+ * Rückgabe der Optionen
806
+ *
807
+ * @since 2.4
808
+ * @change 2.4
809
+ *
810
+ * @return array $options Array mit Optionen
811
+ */
812
+
813
+ public static function get_options()
814
+ {
815
+ if ( !$options = wp_cache_get(self::$short) ) {
816
+ $options = wp_parse_args(
817
+ get_option(self::$short),
818
+ self::$default['options']
819
+ );
820
+
821
+ wp_cache_set(
822
+ self::$short,
823
+ $options
824
+ );
825
+ }
826
+
827
+ return $options;
828
+ }
829
+
830
+
831
+ /**
832
+ * Rückgabe eines Optionsfeldes
833
+ *
834
+ * @since 0.1
835
+ * @change 2.4
836
+ *
837
+ * @param string $field Name des Feldes
838
+ * @return mixed Wert des Feldes
839
+ */
840
+
841
+ public static function get_option($field)
842
+ {
843
+ $options = self::get_options();
844
+
845
+ return @$options[$field];
846
+ }
847
+
848
+
849
+ /**
850
+ * Aktualisiert ein Optionsfeld
851
+ *
852
+ * @since 0.1
853
+ * @change 2.4
854
+ *
855
+ * @param string $field Name des Feldes
856
+ * @param mixed Wert des Feldes
857
+ */
858
+
859
+ private static function _update_option($field, $value)
860
+ {
861
+ self::update_options(
862
+ array(
863
+ $field => $value
864
+ )
865
+ );
866
+ }
867
+
868
+
869
+ /**
870
+ * Aktualisiert mehrere Optionsfelder
871
+ *
872
+ * @since 0.1
873
+ * @change 2.4
874
+ *
875
+ * @param array $data Array mit Feldern
876
+ */
877
+
878
+ public static function update_options($data)
879
+ {
880
+ /* Option zuweisen */
881
+ $options = array_merge(
882
+ (array)get_option(self::$short),
883
+ $data
884
+ );
885
+
886
+ /* DB updaten */
887
+ update_option(
888
+ self::$short,
889
+ $options
890
+ );
891
+
892
+ /* Cache updaten */
893
+ wp_cache_set(
894
+ self::$short,
895
+ $options
896
+ );
897
+ }
898
+
899
+
900
+
901
+
902
+ ############################
903
+ ######## CRONJOBS ########
904
+ ############################
905
+
906
+
907
+ /**
908
+ * Ausführung des täglichen Cronjobs
909
+ *
910
+ * @since 0.1
911
+ * @change 2.4
912
+ */
913
+
914
+ public static function start_daily_cronjob()
915
+ {
916
+ /* Kein Cronjob? */
917
+ if ( !self::get_option('cronjob_enable') ) {
918
+ return;
919
+ }
920
+
921
+ /* Timestamp updaten */
922
+ self::_update_option(
923
+ 'cronjob_timestamp',
924
+ time()
925
+ );
926
+
927
+ /* Spam löschen */
928
+ self::_delete_old_spam();
929
+ }
930
+
931
+
932
+ /**
933
+ * Löschung alter Spamkommentare
934
+ *
935
+ * @since 0.1
936
+ * @change 2.4
937
+ */
938
+
939
+ private static function _delete_old_spam()
940
+ {
941
+ /* Anzahl der Tage */
942
+ $days = (int)self::get_option('cronjob_interval');
943
+
944
+ /* Kein Wert? */
945
+ if ( empty($days) ) {
946
+ return false;
947
+ }
948
+
949
+ /* Global */
950
+ global $wpdb;
951
+
952
+ /* Kommentare löschen */
953
+ $wpdb->query(
954
+ $wpdb->prepare(
955
+ "DELETE FROM `$wpdb->comments` WHERE `comment_approved` = 'spam' AND SUBDATE(NOW(), %d) > comment_date_gmt",
956
+ $days
957
+ )
958
+ );
959
+
960
+ /* DB optimieren */
961
+ $wpdb->query("OPTIMIZE TABLE `$wpdb->comments`");
962
+ }
963
+
964
+
965
+ /**
966
+ * Initialisierung des Cronjobs
967
+ *
968
+ * @since 0.1
969
+ * @change 2.4
970
+ */
971
+
972
+ public static function init_scheduled_hook()
973
+ {
974
+ if ( !wp_next_scheduled('antispam_bee_daily_cronjob') ) {
975
+ wp_schedule_event(
976
+ time(),
977
+ 'daily',
978
+ 'antispam_bee_daily_cronjob'
979
+ );
980
+ }
981
+ }
982
+
983
+
984
+ /**
985
+ * Löschung des Cronjobs
986
+ *
987
+ * @since 0.1
988
+ * @change 2.4
989
+ */
990
+
991
+ public static function clear_scheduled_hook()
992
+ {
993
+ if ( wp_next_scheduled('antispam_bee_daily_cronjob') ) {
994
+ wp_clear_scheduled_hook('antispam_bee_daily_cronjob');
995
+ }
996
+ }
997
+
998
+
999
+
1000
+
1001
+ ############################
1002
+ ###### SPAMPRÜFUNG #######
1003
+ ############################
1004
+
1005
+
1006
+ /**
1007
+ * Überprüfung der POST-Werte
1008
+ *
1009
+ * @since 0.1
1010
+ * @change 2.4
1011
+ */
1012
+
1013
+ public static function precheck_incoming_request()
1014
+ {
1015
+ /* Nur Frontend */
1016
+ if ( is_feed() or is_trackback() or self::_is_mobile() ) {
1017
+ return;
1018
+ }
1019
+
1020
+ /* Allgemeine Werte */
1021
+ $request_url = @$_SERVER['REQUEST_URI'];
1022
+ $hidden_field = @$_POST['comment'];
1023
+ $plugin_field = @$_POST[self::$secret];
1024
+
1025
+ /* Falsch verbunden */
1026
+ if ( empty($_POST) or empty($request_url) or strpos($request_url, 'wp-comments-post.php') === false ) {
1027
+ return;
1028
+ }
1029
+
1030
+ /* Felder prüfen */
1031
+ if ( empty($hidden_field) && !empty($plugin_field) ) {
1032
+ $_POST['comment'] = $plugin_field;
1033
+ unset($_POST[self::$secret]);
1034
+ } else {
1035
+ $_POST['bee_spam'] = 1;
1036
+ }
1037
+ }
1038
+
1039
+
1040
+ /**
1041
+ * Prüfung der eingehenden Anfragen auf Spam
1042
+ *
1043
+ * @since 0.1
1044
+ * @change 2.4
1045
+ *
1046
+ * @param array $comment Unbehandelter Kommentar
1047
+ * @return array $comment Behandelter Kommentar
1048
+ */
1049
+
1050
+ public static function handle_incoming_request($comment)
1051
+ {
1052
+ /* Server-Werte */
1053
+ $url = @$_SERVER['REQUEST_URI'];
1054
+
1055
+ /* Leere Werte? */
1056
+ if ( empty($url) ) {
1057
+ return self::_handle_spam_request(
1058
+ $comment,
1059
+ 'empty'
1060
+ );
1061
+ }
1062
+
1063
+ /* Ping-Optionen */
1064
+ $ping = array(
1065
+ 'types' => array('pingback', 'trackback', 'pings'),
1066
+ 'allowed' => !self::get_option('ignore_pings')
1067
+ );
1068
+
1069
+ /* Kommentar */
1070
+ if ( strpos($url, 'wp-comments-post.php') !== false && !empty($_POST) ) {
1071
+ /* Filter ausführen */
1072
+ $status = self::_verify_comment_request($comment);
1073
+
1074
+ /* Spam lokalisiert */
1075
+ if ( !empty($status['reason']) ) {
1076
+ return self::_handle_spam_request(
1077
+ $comment,
1078
+ $status['reason']
1079
+ );
1080
+ }
1081
+
1082
+ /* Trackback */
1083
+ } else if ( in_array(@$comment['comment_type'], $ping['types']) && $ping['allowed'] ) {
1084
+ /* Filter ausführen */
1085
+ $status = self::_verify_trackback_request($comment);
1086
+
1087
+ /* Spam lokalisiert */
1088
+ if ( !empty($status['reason']) ) {
1089
+ return self::_handle_spam_request(
1090
+ $comment,
1091
+ $status['reason'],
1092
+ true
1093
+ );
1094
+ }
1095
+ }
1096
+
1097
+ return $comment;
1098
+ }
1099
+
1100
+
1101
+ /**
1102
+ * Bereitet die Ersetzung des KOmmentarfeldes vor
1103
+ *
1104
+ * @since 0.1
1105
+ * @change 2.4
1106
+ */
1107
+
1108
+ public static function prepare_comment_field()
1109
+ {
1110
+ /* Nur Frontend */
1111
+ if ( is_feed() or is_trackback() or is_robots() or self::_is_mobile() ) {
1112
+ return;
1113
+ }
1114
+
1115
+ /* Nur Beiträge */
1116
+ if ( !is_singular() && !self::get_option('always_allowed') ) {
1117
+ return;
1118
+ }
1119
+
1120
+ /* Fire! */
1121
+ ob_start(
1122
+ array(
1123
+ 'Antispam_Bee',
1124
+ 'replace_comment_field'
1125
+ )
1126
+ );
1127
+ }
1128
+
1129
+
1130
+ /**
1131
+ * ersetzt das Kommentarfeld
1132
+ *
1133
+ * @since 2.4
1134
+ * @change 2.4.1
1135
+ *
1136
+ * @param string $data HTML-Code der Webseite
1137
+ * @return string Behandelter HTML-Code
1138
+ */
1139
+
1140
+ public static function replace_comment_field($data)
1141
+ {
1142
+ /* Leer? */
1143
+ if ( empty($data) ) {
1144
+ return;
1145
+ }
1146
+
1147
+ /* Convert */
1148
+ return preg_replace(
1149
+ '#<textarea(.+?)name=["\']comment["\'](.+?)</textarea>#s',
1150
+ '<textarea$1name="' .self::$secret. '"$2</textarea><textarea name="comment" style="display:none" rows="1" cols="1"></textarea>',
1151
+ (string) $data,
1152
+ 1
1153
+ );
1154
+ }
1155
+
1156
+
1157
+ /**
1158
+ * Kürzung der IP-Adressen
1159
+ *
1160
+ * @since 0.1
1161
+ * @change 2.4
1162
+ *
1163
+ * @param string $ip Ungekürzte IP
1164
+ * @return string $ip Gekürzte IP
1165
+ */
1166
+
1167
+ private static function _cut_ip($ip)
1168
+ {
1169
+ return str_replace(
1170
+ strrchr(
1171
+ $ip,
1172
+ ( self::_is_ipv4($ip) ? '.' : ':' )
1173
+ ),
1174
+ '',
1175
+ $ip
1176
+ );
1177
+ }
1178
+
1179
+
1180
+ /**
1181
+ * Prüfung auf Mobile
1182
+ *
1183
+ * @since 0.1
1184
+ * @change 2.4
1185
+ *
1186
+ * @return boolean TRUE, wenn "wptouch" aktiv ist
1187
+ */
1188
+
1189
+ private static function _is_mobile()
1190
+ {
1191
+ return strpos(TEMPLATEPATH, 'wptouch');
1192
+ }
1193
+
1194
+
1195
+ /**
1196
+ * Prüfung auf eine IPv4-Adresse
1197
+ *
1198
+ * @since 2.4
1199
+ * @change 2.4
1200
+ *
1201
+ * @param string $ip Zu prüfende IP
1202
+ * @return integer Anzahl der Treffer
1203
+ */
1204
+
1205
+ private static function _is_ipv4($ip)
1206
+ {
1207
+ return preg_match('/^\d{1,3}(\.\d{1,3}){3,3}$/', $ip);
1208
+ }
1209
+
1210
+
1211
+ /**
1212
+ * Prüfung einer IP auf ihre Existenz im Spam
1213
+ *
1214
+ * @since 2.0
1215
+ * @change 2.4
1216
+ *
1217
+ * @param string $ip IP-Adresse
1218
+ * @return boolean TRUE bei verdächtiger IP
1219
+ */
1220
+
1221
+ private static function _is_spam_ip($ip)
1222
+ {
1223
+ /* Keine IP? */
1224
+ if ( empty($ip) ) {
1225
+ return true;
1226
+ }
1227
+
1228
+ /* Global */
1229
+ global $wpdb;
1230
+
1231
+ /* Suchen */
1232
+ $found = $wpdb->get_var(
1233
+ $wpdb->prepare(
1234
+ "SELECT `comment_ID` FROM `$wpdb->comments` WHERE `comment_approved` = 'spam' AND `comment_author_IP` = %s LIMIT 1",
1235
+ (string)$ip
1236
+ )
1237
+ );
1238
+
1239
+ /* Gefunden? */
1240
+ if ( $found ) {
1241
+ return true;
1242
+ }
1243
+
1244
+ return false;
1245
+ }
1246
+
1247
+
1248
+ /**
1249
+ * Prüfung auf erlaubten Ländercodes
1250
+ *
1251
+ * @since 0.1
1252
+ * @change 2.4
1253
+ *
1254
+ * @param string $ip IP-Adresse
1255
+ * @return boolean TRUE bei unerwünschten Ländercodes
1256
+ */
1257
+
1258
+ private static function _is_spam_country($ip)
1259
+ {
1260
+ /* Keine IP? */
1261
+ if ( empty($ip) ) {
1262
+ return true;
1263
+ }
1264
+
1265
+ /* Optionen */
1266
+ $options = self::get_options();
1267
+
1268
+ /* Kein Key? */
1269
+ if ( empty($options['ipinfodb_key']) ) {
1270
+ return false;
1271
+ }
1272
+
1273
+ /* White & Black */
1274
+ $white = preg_split(
1275
+ '/ /',
1276
+ $options['country_white'],
1277
+ -1,
1278
+ PREG_SPLIT_NO_EMPTY
1279
+ );
1280
+ $black = preg_split(
1281
+ '/ /',
1282
+ $options['country_black'],
1283
+ -1,
1284
+ PREG_SPLIT_NO_EMPTY
1285
+ );
1286
+
1287
+ /* Leere Listen? */
1288
+ if ( empty($white) && empty($black) ) {
1289
+ return false;
1290
+ }
1291
+
1292
+ /* IP abfragen */
1293
+ $response = wp_remote_get(
1294
+ sprintf(
1295
+ 'http://api.ipinfodb.com/v2/ip_query_country.php?key=%s&ip=%s',
1296
+ $options['ipinfodb_key'],
1297
+ $ip
1298
+ )
1299
+ );
1300
+
1301
+ /* Fehler? */
1302
+ if ( is_wp_error($response) ) {
1303
+ return false;
1304
+ }
1305
+
1306
+ /* XML lesen */
1307
+ preg_match(
1308
+ '#Code>([A-Z]{2})</Country#i',
1309
+ wp_remote_retrieve_body($response),
1310
+ $matches
1311
+ );
1312
+
1313
+ /* Kein Code? */
1314
+ if ( empty($matches[1]) ) {
1315
+ return false;
1316
+ }
1317
+
1318
+ /* Blacklist */
1319
+ if ( !empty($black) ) {
1320
+ return ( in_array($matches[1], $black) ? true : false );
1321
+ }
1322
+
1323
+ /* Whitelist */
1324
+ return ( in_array($matches[1], $white) ? false : true );
1325
+ }
1326
+
1327
+
1328
+ /**
1329
+ * Prüfung auf Honey Pot Spam
1330
+ *
1331
+ * @since 1.7
1332
+ * @change 2.4
1333
+ *
1334
+ * @param string $ip IP-Adresse
1335
+ * @return boolean TRUE bei gemeldeter IP
1336
+ */
1337
+
1338
+ private static function _is_honey_spam($ip)
1339
+ {
1340
+ /* Keine IP? */
1341
+ if ( empty($ip) ) {
1342
+ return true;
1343
+ }
1344
+
1345
+ /* Optionen */
1346
+ $options = self::get_options();
1347
+
1348
+ /* Kein Key? */
1349
+ if ( empty($options['honey_key']) ) {
1350
+ return false;
1351
+ }
1352
+
1353
+ /* Host */
1354
+ $host = sprintf(
1355
+ '%s.%s.dnsbl.httpbl.org',
1356
+ $options['honey_key'],
1357
+ implode(
1358
+ '.',
1359
+ array_reverse(
1360
+ explode(
1361
+ '.',
1362
+ $ip
1363
+ )
1364
+ )
1365
+ )
1366
+ );
1367
+
1368
+ /* Response */
1369
+ $bits = explode(
1370
+ '.',
1371
+ gethostbyname($host)
1372
+ );
1373
+
1374
+ return ( $bits[0] == 127 && $bits[3] & 4 );
1375
+ }
1376
+
1377
+
1378
+ /**
1379
+ * Prüfung der Trackbacks
1380
+ *
1381
+ * @since 2.4
1382
+ * @change 2.4
1383
+ *
1384
+ * @param array $comment Daten des Trackbacks
1385
+ * @return array Array mit dem Verdachtsgrund [optional]
1386
+ */
1387
+
1388
+ private static function _verify_trackback_request($comment)
1389
+ {
1390
+ /* IP */
1391
+ $ip = @$_SERVER['REMOTE_ADDR'];
1392
+
1393
+ /* Kommentarwerte */
1394
+ $url = @$comment['comment_author_url'];
1395
+ $body = @$comment['comment_content'];
1396
+
1397
+ /* Leere Werte ? */
1398
+ if ( empty($ip) or empty($url) or empty($body) ) {
1399
+ return array(
1400
+ 'reason' => 'empty'
1401
+ );
1402
+ }
1403
+
1404
+ /* Optionen */
1405
+ $options = self::get_options();
1406
+
1407
+ /* IP != Server */
1408
+ if ( $options['advanced_check'] && self::_is_fake_ip($ip, parse_url($url, PHP_URL_HOST)) ) {
1409
+ return array(
1410
+ 'reason' => 'server'
1411
+ );
1412
+ }
1413
+
1414
+ /* IP im Spam */
1415
+ if ( $options['spam_ip'] && self::_is_spam_ip($ip) ) {
1416
+ return array(
1417
+ 'reason' => 'spamip'
1418
+ );
1419
+ }
1420
+
1421
+ /* Translate API */
1422
+ if ( $options['translate_api'] && self::_is_lang_spam($body) ) {
1423
+ return array(
1424
+ 'reason' => 'lang'
1425
+ );
1426
+ }
1427
+
1428
+ /* Country Code prüfen */
1429
+ if ( $options['country_code'] && self::_is_spam_country($ip) ) {
1430
+ return array(
1431
+ 'reason' => 'country'
1432
+ );
1433
+ }
1434
+
1435
+ /* Honey Pot */
1436
+ if ( $options['honey_pot'] && self::_is_honey_spam($ip) ) {
1437
+ return array(
1438
+ 'reason' => 'honey'
1439
+ );
1440
+ }
1441
+ }
1442
+
1443
+
1444
+ /**
1445
+ * Prüfung auf eine bereits freigegebene E-Mail-Adresse
1446
+ *
1447
+ * @since 2.0
1448
+ * @change 2.4
1449
+ *
1450
+ * @param string $email E-Mail-Adresse
1451
+ * @return boolean TRUE bei einem gefundenen Eintrag
1452
+ */
1453
+
1454
+ private static function _is_approved_email($email)
1455
+ {
1456
+ /* Leer? */
1457
+ if ( empty($email) ) {
1458
+ return false;
1459
+ }
1460
+
1461
+ /* Global */
1462
+ global $wpdb;
1463
+
1464
+ /* Suchen */
1465
+ $found = $wpdb->get_var(
1466
+ $wpdb->prepare(
1467
+ "SELECT `comment_ID` FROM `$wpdb->comments` WHERE `comment_approved` = '1' AND `comment_author_email` = %s LIMIT 1",
1468
+ (string)$email
1469
+ )
1470
+ );
1471
+
1472
+ /* Gefunden? */
1473
+ if ( $found ) {
1474
+ return true;
1475
+ }
1476
+
1477
+ return false;
1478
+ }
1479
+
1480
+
1481
+ /**
1482
+ * Prüfung auf eine gefälschte IP
1483
+ *
1484
+ * @since 2.0
1485
+ * @change 2.4
1486
+ *
1487
+ * @param string $ip IP-Adresse
1488
+ * @param string $host Host [optional]
1489
+ * @return boolean TRUE bei gefälschter IP
1490
+ */
1491
+
1492
+ private static function _is_fake_ip($ip, $host = false)
1493
+ {
1494
+ /* Leer? */
1495
+ if ( empty($ip) ) {
1496
+ return true;
1497
+ }
1498
+
1499
+ /* Remote Host */
1500
+ $hostbyip = gethostbyaddr($ip);
1501
+
1502
+ /* IPv6 */
1503
+ if ( !self::_is_ipv4($ip) ) {
1504
+ return $ip != $hostbyip;
1505
+ }
1506
+
1507
+ /* IPv4 / Kommentar */
1508
+ if ( empty($host) ) {
1509
+ $found = strpos(
1510
+ $ip,
1511
+ self::_cut_ip(
1512
+ gethostbyname($hostbyip)
1513
+ )
1514
+ );
1515
+
1516
+ /* IPv4 / Trackback */
1517
+ } else {
1518
+ /* IP-Vergleich */
1519
+ if ( $hostbyip == $ip ) {
1520
+ return true;
1521
+ }
1522
+
1523
+ /* Treffer suchen */
1524
+ $found = strpos(
1525
+ $ip,
1526
+ self::_cut_ip(
1527
+ gethostbyname($host)
1528
+ )
1529
+ );
1530
+ }
1531
+
1532
+ return $found === false;
1533
+ }
1534
+
1535
+
1536
+ /**
1537
+ * Prüfung auf unerwünschte Sprachen
1538
+ *
1539
+ * @since 2.0
1540
+ * @change 2.4
1541
+ *
1542
+ * @param string $content Inhalt des Kommentars
1543
+ * @return boolean TRUE bei Spam
1544
+ */
1545
+
1546
+ private static function _is_lang_spam($content)
1547
+ {
1548
+ /* Kein MB_STR? */
1549
+ if ( !function_exists('mb_substr') ) {
1550
+ return false;
1551
+ }
1552
+
1553
+ /* Init */
1554
+ $lang = self::get_option('translate_lang');
1555
+
1556
+ /* Formatieren */
1557
+ $content = rawurlencode(
1558
+ mb_substr(
1559
+ strip_tags(stripslashes($content)),
1560
+ 0,
1561
+ 200
1562
+ )
1563
+ );
1564
+
1565
+ /* Keine Daten? */
1566
+ if ( empty($lang) or empty($content) ) {
1567
+ return false;
1568
+ }
1569
+
1570
+ /* IP abfragen */
1571
+ $response = wp_remote_get(
1572
+ sprintf(
1573
+ 'http://translate.google.de/translate_a/t?client=x&text=%s',
1574
+ $content
1575
+ )
1576
+ );
1577
+
1578
+ /* Fehler? */
1579
+ if ( is_wp_error($response) ) {
1580
+ return false;
1581
+ }
1582
+
1583
+ /* Parsen */
1584
+ preg_match(
1585
+ '/"src":"(\\D{2})"/',
1586
+ wp_remote_retrieve_body($response),
1587
+ $matches
1588
+ );
1589
+
1590
+ /* Fehler? */
1591
+ if ( empty($matches[1]) ) {
1592
+ return false;
1593
+ }
1594
+
1595
+ return ( $matches[1] != $lang );
1596
+ }
1597
+
1598
+
1599
+ /**
1600
+ * Prüfung den Kommentar
1601
+ *
1602
+ * @since 2.4
1603
+ * @change 2.4
1604
+ *
1605
+ * @param array $comment Daten des Kommentars
1606
+ * @return array Array mit dem Verdachtsgrund [optional]
1607
+ */
1608
+
1609
+ private static function _verify_comment_request($comment)
1610
+ {
1611
+ /* IP */
1612
+ $ip = @$_SERVER['REMOTE_ADDR'];
1613
+
1614
+ /* Kommentarwerte */
1615
+ $body = @$comment['comment_content'];
1616
+ $email = @$comment['comment_author_email'];
1617
+
1618
+ /* Leere Werte ? */
1619
+ if ( empty($ip) or empty($body) or empty($email) ) {
1620
+ return array(
1621
+ 'reason' => 'empty'
1622
+ );
1623
+ }
1624
+
1625
+ /* Optionen */
1626
+ $options = self::get_options();
1627
+
1628
+ /* Bereits kommentiert? */
1629
+ if ( $options['already_commented'] && self::_is_approved_email($email) ) {
1630
+ return;
1631
+ }
1632
+
1633
+ /* Bot erkannt */
1634
+ if ( !empty($_POST['bee_spam']) ) {
1635
+ return array(
1636
+ 'reason' => 'css'
1637
+ );
1638
+ }
1639
+
1640
+ /* Erweiterter Schutz */
1641
+ if ( $options['advanced_check'] && self::_is_fake_ip($ip) ) {
1642
+ return array(
1643
+ 'reason' => 'server'
1644
+ );
1645
+ }
1646
+
1647
+ /* IP im Spam */
1648
+ if ( $options['spam_ip'] && self::_is_spam_ip($ip) ) {
1649
+ return array(
1650
+ 'reason' => 'spamip'
1651
+ );
1652
+ }
1653
+
1654
+ /* Translate API */
1655
+ if ( $options['translate_api'] && self::_is_lang_spam($body) ) {
1656
+ return array(
1657
+ 'reason' => 'lang'
1658
+ );
1659
+ }
1660
+
1661
+ /* Country Code prüfen */
1662
+ if ( $options['country_code'] && self::_is_spam_country($ip) ) {
1663
+ return array(
1664
+ 'reason' => 'country'
1665
+ );
1666
+ }
1667
+
1668
+ /* Honey Pot */
1669
+ if ( $options['honey_pot'] && self::_is_honey_spam($ip) ) {
1670
+ return array(
1671
+ 'reason' => 'honey'
1672
+ );
1673
+ }
1674
+ }
1675
+
1676
+
1677
+ /**
1678
+ * Ausführung des Lösch-/Markier-Vorgangs
1679
+ *
1680
+ * @since 0.1
1681
+ * @change 2.4
1682
+ *
1683
+ * @param array $comment Unbehandelte Kommentardaten
1684
+ * @param string $reason Verdachtsgrund
1685
+ * @param boolean $is_ping Ping (ja oder nein) [optional]
1686
+ * @return array $comment Behandelte Kommentardaten
1687
+ */
1688
+
1689
+ private static function _handle_spam_request($comment, $reason, $is_ping = false)
1690
+ {
1691
+ /* Optionen */
1692
+ $options = self::get_options();
1693
+
1694
+ /* Einstellungen */
1695
+ $spam_remove = !$options['flag_spam'];
1696
+ $spam_notice = !$options['no_notice'];
1697
+
1698
+ /* Filter-Einstellungen */
1699
+ $ignore_filter = $options['ignore_filter'];
1700
+ $ignore_type = $options['ignore_type'];
1701
+ $ignore_reason = in_array($reason, $options['ignore_reasons']);
1702
+
1703
+ /* Spam hochzählen */
1704
+ self::_update_spam_count();
1705
+ self::_update_daily_stats();
1706
+
1707
+ /* Spam löschen */
1708
+ if ( $spam_remove ) {
1709
+ die('Spam deleted.');
1710
+ }
1711
+
1712
+ /* Typen behandeln */
1713
+ if ( $ignore_filter && (( $ignore_type == 1 && $is_ping ) or ( $ignore_type == 2 && !$is_ping )) ) {
1714
+ die('Spam deleted.');
1715
+ }
1716
+
1717
+ /* Spamgrund */
1718
+ if ( $ignore_reason ) {
1719
+ die('Spam deleted.');
1720
+ }
1721
+
1722
+ /* Spam-Grund */
1723
+ self::$reason = $reason;
1724
+
1725
+ /* Spam markieren */
1726
+ add_filter(
1727
+ 'pre_comment_approved',
1728
+ create_function(
1729
+ '',
1730
+ 'return "spam";'
1731
+ )
1732
+ );
1733
+
1734
+ /* E-Mail senden */
1735
+ add_filter(
1736
+ 'trackback_post',
1737
+ array(
1738
+ __CLASS__,
1739
+ 'send_mail_notification'
1740
+ )
1741
+ );
1742
+ add_filter(
1743
+ 'comment_post',
1744
+ array(
1745
+ __CLASS__,
1746
+ 'send_mail_notification'
1747
+ )
1748
+ );
1749
+
1750
+
1751
+ /* Notiz setzen */
1752
+ if ( $spam_notice ) {
1753
+ $comment['comment_content'] = sprintf(
1754
+ '[MARKED AS SPAM BY ANTISPAM BEE | %s]%s%s',
1755
+ self::$default['reasons'][self::$reason],
1756
+ "\n",
1757
+ $comment['comment_content']
1758
+ );
1759
+ }
1760
+
1761
+ return $comment;
1762
+ }
1763
+
1764
+
1765
+ /**
1766
+ * Ersetzung des Whois-Links
1767
+ *
1768
+ * @since 1.7
1769
+ * @change 2.4
1770
+ *
1771
+ * @param string $body Body mit Whois
1772
+ * @return string $body Body mit IPinfoDB
1773
+ */
1774
+
1775
+ public static function replace_whois_link($body)
1776
+ {
1777
+ if ( self::get_option('country_code') ) {
1778
+ return preg_replace(
1779
+ '/^Whois .+?=(.+?)/m',
1780
+ 'IP Locator: http://ipinfodb.com/ip_locator.php?ip=$1',
1781
+ $body
1782
+ );
1783
+ }
1784
+
1785
+ return $body;
1786
+ }
1787
+
1788
+
1789
+ /**
1790
+ * Versand einer Benachrichtigung via E-Mail
1791
+ *
1792
+ * @since 0.1
1793
+ * @change 2.4
1794
+ *
1795
+ * @param intval $id ID des Kommentars
1796
+ * @return intval $id ID des Kommentars
1797
+ */
1798
+
1799
+ public static function send_mail_notification($id)
1800
+ {
1801
+ /* Optionen */
1802
+ $options = self::get_options();
1803
+
1804
+ /* Keine Benachrichtigung? */
1805
+ if ( !$options['email_notify'] ) {
1806
+ return $id;
1807
+ }
1808
+
1809
+ /* Kommentar */
1810
+ $comment = get_comment($id, ARRAY_A);
1811
+
1812
+ /* Keine Werte? */
1813
+ if ( empty($comment) ) {
1814
+ return $id;
1815
+ }
1816
+
1817
+ /* Parent-Post */
1818
+ if ( !$post = get_post($comment['comment_post_ID']) ) {
1819
+ return $id;
1820
+ }
1821
+
1822
+ /* Sprache laden */
1823
+ self::load_plugin_lang();
1824
+
1825
+ /* Betreff */
1826
+ $subject = sprintf(
1827
+ '[%s] %s',
1828
+ get_bloginfo('name'),
1829
+ __('Comment marked as spam', self::$short)
1830
+ );
1831
+
1832
+ /* Content */
1833
+ if ( !$content = strip_tags(stripslashes($comment['comment_content'])) ) {
1834
+ $content = sprintf(
1835
+ '-- %s --',
1836
+ __('Content removed by Antispam Bee', self::$short)
1837
+ );
1838
+ }
1839
+
1840
+ /* Body */
1841
+ $body = sprintf(
1842
+ "%s \"%s\"\r\n\r\n",
1843
+ __('New spam comment on your post', self::$short),
1844
+ strip_tags($post->post_title)
1845
+ ).sprintf(
1846
+ "%s: %s\r\n",
1847
+ __('Author'),
1848
+ $comment['comment_author']
1849
+ ).sprintf(
1850
+ "URL: %s\r\n",
1851
+ esc_url($comment['comment_author_url'])
1852
+ ).sprintf(
1853
+ "%s: %s\r\n",
1854
+ __('Type', self::$short),
1855
+ __( ( empty($comment['comment_type']) ? 'Comment' : 'Trackback' ), self::$short )
1856
+ ).sprintf(
1857
+ "IP Locator: http://ipinfodb.com/ip_locator.php?ip=%s\r\n",
1858
+ $comment['comment_author_IP']
1859
+ ).sprintf(
1860
+ "%s: %s\r\n\r\n",
1861
+ __('Spam Reason', self::$short),
1862
+ __(self::$default['reasons'][self::$reason], self::$short)
1863
+ ).sprintf(
1864
+ "%s\r\n\r\n\r\n",
1865
+ $content
1866
+ ).(
1867
+ EMPTY_TRASH_DAYS ? (
1868
+ sprintf(
1869
+ "%s: %s\r\n",
1870
+ __('Trash it', self::$short),
1871
+ admin_url('comment.php?action=trash&c=' .$id)
1872
+ )
1873
+ ) : (
1874
+ sprintf(
1875
+ "%s: %s\r\n",
1876
+ __('Delete it', self::$short),
1877
+ admin_url('comment.php?action=delete&c=' .$id)
1878
+ )
1879
+ )
1880
+ ).sprintf(
1881
+ "%s: %s\r\n",
1882
+ __('Approve it', self::$short),
1883
+ admin_url('comment.php?action=approve&c=' .$id)
1884
+ ).sprintf(
1885
+ "%s: %s\r\n\r\n",
1886
+ __('Spam list', self::$short),
1887
+ admin_url('edit-comments.php?comment_status=spam')
1888
+ ).sprintf(
1889
+ "%s\r\n%s\r\n",
1890
+ __('Notify message by Antispam Bee', self::$short),
1891
+ __('http://antispambee.com', self::$short)
1892
+ );
1893
+
1894
+ /* Send */
1895
+ wp_mail(
1896
+ get_bloginfo('admin_email'),
1897
+ $subject,
1898
+ $body
1899
+ );
1900
+
1901
+ return $id;
1902
+ }
1903
+
1904
+
1905
+
1906
+
1907
+ ############################
1908
+ ####### STATISTIK ########
1909
+ ############################
1910
+
1911
+
1912
+ /**
1913
+ * Rückgabe der Anzahl von Spam-Kommentaren
1914
+ *
1915
+ * @since 0.1
1916
+ * @change 2.4
1917
+ *
1918
+ * @param intval $count Anzahl der Spam-Kommentare
1919
+ */
1920
+
1921
+ private static function _get_spam_count()
1922
+ {
1923
+ /* Init */
1924
+ $count = self::get_option('spam_count');
1925
+
1926
+ /* Fire */
1927
+ return ( get_locale() == 'de_DE' ? number_format($count, 0, '', '.') : number_format_i18n($count) );
1928
+ }
1929
+
1930
+
1931
+ /**
1932
+ * Ausgabe der Anzahl von Spam-Kommentaren
1933
+ *
1934
+ * @since 0.1
1935
+ * @change 2.4
1936
+ */
1937
+
1938
+ public static function the_spam_count()
1939
+ {
1940
+ echo esc_html( self::_get_spam_count() );
1941
+ }
1942
+
1943
+
1944
+ /**
1945
+ * Aktualisierung der Anzahl von Spam-Kommentaren
1946
+ *
1947
+ * @since 0.1
1948
+ * @change 2.4
1949
+ */
1950
+
1951
+ private static function _update_spam_count()
1952
+ {
1953
+ self::_update_option(
1954
+ 'spam_count',
1955
+ intval( self::get_option('spam_count') + 1 )
1956
+ );
1957
+ }
1958
+
1959
+
1960
+ /**
1961
+ * Aktualisierung der Statistik
1962
+ *
1963
+ * @since 1.9
1964
+ * @change 2.4
1965
+ */
1966
+
1967
+ private static function _update_daily_stats()
1968
+ {
1969
+ /* Init */
1970
+ $stats = (array)self::get_option('daily_stats');
1971
+ $today = (int)strtotime('today');
1972
+
1973
+ /* Hochzählen */
1974
+ if ( array_key_exists($today, $stats) ) {
1975
+ $stats[$today] ++;
1976
+ } else {
1977
+ $stats[$today] = 1;
1978
+ }
1979
+
1980
+ /* Sortieren */
1981
+ krsort($stats, SORT_NUMERIC);
1982
+
1983
+ /* Speichern */
1984
+ self::_update_option(
1985
+ 'daily_stats',
1986
+ array_slice($stats, 0, 31, true)
1987
+ );
1988
+ }
1989
+ }
1990
+
1991
+
1992
+ /* Fire */
1993
+ add_action(
1994
+ 'plugins_loaded',
1995
+ array(
1996
+ 'Antispam_Bee',
1997
+ 'init'
1998
+ )
1999
+ );
2000
+
2001
+ /* Activation */
2002
+ register_activation_hook(
2003
+ __FILE__,
2004
+ array(
2005
+ 'Antispam_Bee',
2006
+ 'activate'
2007
+ )
2008
+ );
2009
+
2010
+ /* Deactivation */
2011
+ register_deactivation_hook(
2012
+ __FILE__,
2013
+ array(
2014
+ 'Antispam_Bee',
2015
+ 'deactivate'
2016
+ )
2017
+ );
2018
+
2019
+ /* Uninstall */
2020
+ register_uninstall_hook(
2021
+ __FILE__,
2022
+ array(
2023
+ 'Antispam_Bee',
2024
+ 'uninstall'
2025
+ )
2026
+ );
css/dashboard.css ADDED
@@ -0,0 +1 @@
 
1
+ #ab_chart{color:#aaa;height:120px;}
css/dashboard.dev.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ #ab_chart {
2
+ color: #aaa;
3
+ height: 120px;
4
+ }
css/style.css ADDED
@@ -0,0 +1 @@
 
1
+ #icon-ab{top:5px;left:0;width:36px;height:34px;position:absolute;background:url('../img/icon32.png') no-repeat;}#ab_main .table{width:460px;height:1%;margin:20px 0 0 -10px;}#ab_main .hr{width:283px;margin:10px 0 10px 10px;border-top:1px dotted #dfdfdf;}#ab_main .related tr{display:none;}#ab_main .related tr:first-child{display:table-row;}#ab_main .form-table{margin:0;}#ab_main .form-table th{width:250px;padding-top:8px;vertical-align:middle;}#ab_main .form-table label{text-shadow:none;}#ab_main .form-table small{color:#aaa;}#ab_main .form-table .maxi-text,#ab_main .form-table .maxi-select{width:160px;}#ab_main .form-table .mini-select option{padding-right:6px;}#ab_main .submit{width:431px;height:1%;margin:20px 0 0;padding:15px 0 0;overflow:hidden;border-top:1px solid #bebebe;}#ab_main .submit .help{float:left;color:#bebebe;font-size:11px;line-height:23px;}#ab_main .submit .button-primary{float:right;}#ab_main .nav-tab-wrapper{height:35px;margin:13px 0 0;padding:0 0 0 44px;border-bottom:1px solid #ccc;}#ab_main .nav-tab-wrapper li{float:left;margin:0;padding:0;}#ab_main .nav-tab-wrapper h2{padding:0;}#ab_main .nav-tab-wrapper a{color:#AAA;height:24px;}#ab_main .ui-tabs-selected a{color:#464646;border-color:#ccc;border-bottom:1px solid #fff;}.ui-tabs .ui-tabs-hide{display:none;}#message{display:none;}#setting-error-settings_updated{top:13px;right:15px;margin:0;padding:1px 10px 0;position:absolute;animation:blink 1s cubic-bezier(1,0,0,1) 2;-moz-animation:blink 1s cubic-bezier(1,0,0,1) 2;-webkit-animation:blink 1s cubic-bezier(1,0,0,1) 2;}#setting-error-settings_updated p{padding:0;}@keyframes blink{from{opacity:1;}to{opacity:0;}}@-moz-keyframes blink{from{opacity:1;}to{opacity:0;}}@-webkit-keyframes blink{from{opacity:1;}to{opacity:0;}}
css/style.dev.css ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @group Icon */
2
+
3
+ #icon-ab {
4
+ top: 5px;
5
+ left: 0;
6
+ width: 36px;
7
+ height: 34px;
8
+ position: absolute;
9
+ background: url('../img/icon32.png') no-repeat;
10
+ }
11
+
12
+ /* @end group */
13
+
14
+
15
+ /* @group GUI */
16
+
17
+ #ab_main .table {
18
+ width: 460px;
19
+ height: 1%;
20
+ margin: 20px 0 0 -10px;
21
+ }
22
+
23
+ #ab_main .hr {
24
+ width: 283px;
25
+ margin: 10px 0 10px 10px;
26
+ border-top: 1px dotted #DFDFDF;
27
+ }
28
+
29
+ #ab_main .related tr {
30
+ display: none;
31
+ }
32
+ #ab_main .related tr:first-child {
33
+ display: table-row;
34
+ }
35
+
36
+ #ab_main .form-table {
37
+ margin: 0;
38
+ }
39
+ #ab_main .form-table th {
40
+ width: 250px;
41
+ padding-top: 8px;
42
+ vertical-align: middle;
43
+ }
44
+ #ab_main .form-table label {
45
+ text-shadow: none;
46
+ }
47
+ #ab_main .form-table small {
48
+ color: #aaa;
49
+ }
50
+ #ab_main .form-table .maxi-text,
51
+ #ab_main .form-table .maxi-select {
52
+ width: 160px;
53
+ }
54
+ #ab_main .form-table .mini-select option {
55
+ padding-right: 6px;
56
+ }
57
+
58
+ #ab_main .submit {
59
+ width: 431px;
60
+ height: 1%;
61
+ margin: 20px 0 0;
62
+ padding: 15px 0 0;
63
+ overflow: hidden;
64
+ border-top: 1px solid #bebebe;
65
+ }
66
+ #ab_main .submit .help {
67
+ float: left;
68
+ color: #bebebe;
69
+ font-size: 11px;
70
+ line-height: 23px;
71
+ }
72
+ #ab_main .submit .button-primary {
73
+ float: right;
74
+ }
75
+
76
+ /* @end group */
77
+
78
+
79
+ /* @group Tabs */
80
+
81
+ #ab_main .nav-tab-wrapper {
82
+ height: 35px;
83
+ margin: 13px 0 0;
84
+ padding: 0 0 0 44px;
85
+ border-bottom: 1px solid #ccc;
86
+ }
87
+ #ab_main .nav-tab-wrapper li {
88
+ float: left;
89
+ margin: 0;
90
+ padding: 0;
91
+ }
92
+ #ab_main .nav-tab-wrapper h2 {
93
+ padding: 0;
94
+ }
95
+ #ab_main .nav-tab-wrapper a {
96
+ color: #AAA;
97
+ height: 24px;
98
+ }
99
+ #ab_main .ui-tabs-selected a {
100
+ color: #464646;
101
+ border-color: #ccc;
102
+ border-bottom: 1px solid #fff;
103
+ }
104
+ .ui-tabs .ui-tabs-hide {
105
+ display: none;
106
+ }
107
+
108
+ /* @end group */
109
+
110
+
111
+ /* @group Alert */
112
+
113
+ #message {
114
+ display: none;
115
+ }
116
+ #setting-error-settings_updated {
117
+ top: 13px;
118
+ right: 15px;
119
+ margin: 0;
120
+ padding: 1px 10px 0;
121
+ position: absolute;
122
+
123
+ animation: blink 1s cubic-bezier(1, 0, 0, 1) 2;
124
+ -moz-animation: blink 1s cubic-bezier(1, 0, 0, 1) 2;
125
+ -webkit-animation: blink 1s cubic-bezier(1, 0, 0, 1) 2;
126
+ }
127
+ #setting-error-settings_updated p {
128
+ padding: 0;
129
+ }
130
+
131
+ @keyframes blink {
132
+ from {
133
+ opacity: 1;
134
+ }
135
+ to {
136
+ opacity: 0;
137
+ }
138
+ }
139
+ @-moz-keyframes blink {
140
+ from {
141
+ opacity: 1;
142
+ }
143
+ to {
144
+ opacity: 0;
145
+ }
146
+ }
147
+ @-webkit-keyframes blink {
148
+ from {
149
+ opacity: 1;
150
+ }
151
+ to {
152
+ opacity: 0;
153
+ }
154
+ }
155
+
156
+ /* @end group */
img/icon.png ADDED
Binary file
img/icon32.png ADDED
Binary file
inc/gui.class.php ADDED
@@ -0,0 +1,490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /* Sicherheitsabfrage */
5
+ if ( !class_exists('Antispam_Bee') ) {
6
+ die();
7
+ }
8
+
9
+
10
+ /**
11
+ * Antispam_Bee_GUI
12
+ *
13
+ * @since 2.4
14
+ */
15
+
16
+ class Antispam_Bee_GUI extends Antispam_Bee {
17
+
18
+
19
+ /**
20
+ * Speicherung der GUI
21
+ *
22
+ * @since 0.1
23
+ * @change 2.4
24
+ */
25
+
26
+ public static function save_changes()
27
+ {
28
+ /* Kein POST? */
29
+ if ( empty($_POST) ) {
30
+ wp_die(__('Cheatin&#8217; uh?'));
31
+ }
32
+
33
+ /* Referer prüfen */
34
+ check_admin_referer(self::$short);
35
+
36
+ /* Optionen ermitteln */
37
+ $options = array(
38
+ 'flag_spam' => (int)(!empty($_POST['ab_flag_spam'])),
39
+ 'email_notify' => (int)(!empty($_POST['ab_email_notify'])),
40
+ 'cronjob_enable' => (int)(!empty($_POST['ab_cronjob_enable'])),
41
+ 'cronjob_interval' => (int)(@$_POST['ab_cronjob_interval']),
42
+
43
+ 'no_notice' => (int)(!empty($_POST['ab_no_notice'])),
44
+
45
+ 'dashboard_count' => (int)(!empty($_POST['ab_dashboard_count'])),
46
+ 'dashboard_chart' => (int)(!empty($_POST['ab_dashboard_chart'])),
47
+ 'advanced_check' => (int)(!empty($_POST['ab_advanced_check'])),
48
+ 'spam_ip' => (int)(!empty($_POST['ab_spam_ip'])),
49
+ 'already_commented' => (int)(!empty($_POST['ab_already_commented'])),
50
+ 'always_allowed' => (int)(!empty($_POST['ab_always_allowed'])),
51
+
52
+ 'ignore_pings' => (int)(!empty($_POST['ab_ignore_pings'])),
53
+ 'ignore_filter' => (int)(!empty($_POST['ab_ignore_filter'])),
54
+ 'ignore_type' => (int)(@$_POST['ab_ignore_type']),
55
+ 'ignore_reasons' => (array)(@$_POST['ab_ignore_reasons']),
56
+
57
+ 'honey_pot' => (int)(!empty($_POST['ab_honey_pot'])),
58
+ 'honey_key' => sanitize_text_field(@$_POST['ab_honey_key']),
59
+
60
+ 'country_code' => (int)(!empty($_POST['ab_country_code'])),
61
+ 'country_black' => sanitize_text_field(@$_POST['ab_country_black']),
62
+ 'country_white' => sanitize_text_field(@$_POST['ab_country_white']),
63
+ 'ipinfodb_key' => sanitize_text_field(@$_POST['ab_ipinfodb_key']),
64
+
65
+ 'translate_api' => (int)(!empty($_POST['ab_translate_api'])),
66
+ 'translate_lang' => sanitize_text_field(@$_POST['ab_translate_lang']),
67
+
68
+ 'tab_index' => (int)(@$_POST['ab_tab_index'])
69
+ );
70
+
71
+ /* Kein Tag eingetragen? */
72
+ if ( empty($options['cronjob_interval']) ) {
73
+ $options['cronjob_enable'] = 0;
74
+ }
75
+
76
+ /* Honey Key reinigen */
77
+ if ( !empty($options['honey_key']) ) {
78
+ $options['honey_key'] = preg_replace(
79
+ '/[^a-z]/',
80
+ '',
81
+ strtolower($options['honey_key'])
82
+ );
83
+ }
84
+ if ( empty($options['honey_key']) ) {
85
+ $options['honey_pot'] = 0;
86
+ }
87
+
88
+ /* Translate API */
89
+ if ( !empty($options['translate_lang']) ) {
90
+ $options['translate_lang'] = preg_replace(
91
+ '/[^den]/',
92
+ '',
93
+ $options['translate_lang']
94
+ );
95
+ }
96
+ if ( empty($options['translate_lang']) ) {
97
+ $options['translate_api'] = 0;
98
+ }
99
+
100
+
101
+ /* Blacklist reinigen */
102
+ if ( !empty($options['country_black']) ) {
103
+ $options['country_black'] = preg_replace(
104
+ '/[^A-Z ]/',
105
+ '',
106
+ strtoupper($options['country_black'])
107
+ );
108
+ }
109
+
110
+ /* Whitelist reinigen */
111
+ if ( !empty($options['country_white']) ) {
112
+ $options['country_white'] = preg_replace(
113
+ '/[^A-Z ]/',
114
+ '',
115
+ strtoupper($options['country_white'])
116
+ );
117
+ }
118
+
119
+ /* Kein IPInfoDB Key? */
120
+ if ( empty($options['ipinfodb_key']) ) {
121
+ $options['country_code'] = 0;
122
+ }
123
+
124
+ /* Leere Listen? */
125
+ if ( empty($options['country_black']) && empty($options['country_white']) ) {
126
+ $options['country_code'] = 0;
127
+ }
128
+
129
+
130
+ /* Cron stoppen? */
131
+ if ( $options['cronjob_enable'] && !self::get_option('cronjob_enable') ) {
132
+ self::init_scheduled_hook();
133
+ } else if ( !$options['cronjob_enable'] && self::get_option('cronjob_enable') ) {
134
+ self::clear_scheduled_hook();
135
+ }
136
+
137
+ /* Optionen speichern */
138
+ self::update_options($options);
139
+
140
+ /* Redirect */
141
+ wp_safe_redirect(
142
+ add_query_arg(
143
+ array(
144
+ 'updated' => 'true'
145
+ ),
146
+ wp_get_referer()
147
+ )
148
+ );
149
+
150
+ die();
151
+ }
152
+
153
+
154
+ /**
155
+ * Der aktive Tab
156
+ *
157
+ * @since 2.4
158
+ * @change 2.4
159
+ */
160
+
161
+ private static function _tab_index()
162
+ {
163
+ echo ( empty($_GET['updated']) ? 0 : (int)self::get_option('tab_index') );
164
+ }
165
+
166
+
167
+ /**
168
+ * Anzeige der GUI
169
+ *
170
+ * @since 0.1
171
+ * @change 2.4
172
+ */
173
+
174
+ function options_page() { ?>
175
+ <div class="wrap" id="ab_main">
176
+ <form action="<?php echo admin_url('admin-post.php') ?>" method="post">
177
+ <?php $options = self::get_options() ?>
178
+
179
+ <?php wp_nonce_field(self::$short) ?>
180
+
181
+ <input type="hidden" name="action" value="ab_save_changes" />
182
+ <input type="hidden" name="ab_tab_index" id="ab_tab_index" value="<?php self::_tab_index() ?>" />
183
+
184
+ <?php screen_icon('ab') ?>
185
+
186
+ <ul class="nav-tab-wrapper">
187
+ <li class="ui-tabs-selected">
188
+ <h2><a href="#ab-tab-general" class="nav-tab"><?php esc_html_e('General', self::$short) ?></a></h2>
189
+ </li>
190
+ <li>
191
+ <h2><a href="#ab-tab-filter" class="nav-tab"><?php esc_html_e('Filter', self::$short) ?></a></h2>
192
+ </li>
193
+ <li>
194
+ <h2><a href="#ab-tab-advanced" class="nav-tab"><?php esc_html_e('Advanced', self::$short) ?></a></h2>
195
+ </li>
196
+ </ul>
197
+
198
+ <!-- Allgemein -->
199
+ <div class="table ui-tabs-hide" id="ab-tab-general">
200
+ <table class="form-table">
201
+ <tr>
202
+ <th>
203
+ <label for="ab_advanced_check">
204
+ <?php esc_html_e('Stricter inspection for comments and pings', self::$short) ?>
205
+ </label>
206
+ </th>
207
+ <td>
208
+ <input type="checkbox" name="ab_advanced_check" id="ab_advanced_check" value="1" <?php checked($options['advanced_check'], 1) ?> />
209
+ </td>
210
+ </tr>
211
+
212
+ <tr>
213
+ <th>
214
+ <label for="ab_spam_ip">
215
+ <?php esc_html_e('Consider comments which are already marked as spam', self::$short) ?>
216
+ </label>
217
+ </th>
218
+ <td>
219
+ <input type="checkbox" name="ab_spam_ip" id="ab_spam_ip" value="1" <?php checked($options['spam_ip'], 1) ?> />
220
+ </td>
221
+ </tr>
222
+
223
+ <tr>
224
+ <th>
225
+ <label for="ab_already_commented">
226
+ <?php esc_html_e('Do not check if the comment author has already approved', self::$short) ?>
227
+ </label>
228
+ </th>
229
+ <td>
230
+ <input type="checkbox" name="ab_already_commented" id="ab_already_commented" value="1" <?php checked($options['already_commented'], 1) ?> />
231
+ </td>
232
+ </tr>
233
+
234
+ <tr>
235
+ <th>
236
+ <label for="ab_ignore_pings">
237
+ <?php esc_html_e('Do not check trackbacks / pingbacks', self::$short) ?>
238
+ </label>
239
+ </th>
240
+ <td>
241
+ <input type="checkbox" name="ab_ignore_pings" id="ab_ignore_pings" value="1" <?php checked($options['ignore_pings'], 1) ?> />
242
+ </td>
243
+ </tr>
244
+
245
+ <tr>
246
+ <th>
247
+ <label for="ab_always_allowed">
248
+ <?php esc_html_e('Comment form used outside of posts', self::$short) ?>
249
+ </label>
250
+ </th>
251
+ <td>
252
+ <input type="checkbox" name="ab_always_allowed" id="ab_always_allowed" value="1" <?php checked($options['always_allowed'], 1) ?> />
253
+ </td>
254
+ </tr>
255
+ </table>
256
+
257
+ <p class="hr"></p>
258
+
259
+ <table class="form-table">
260
+ <tr>
261
+ <th>
262
+ <label for="ab_dashboard_chart">
263
+ <?php esc_html_e('Statistics on the dashboard', self::$short) ?>
264
+ </label>
265
+ </th>
266
+ <td>
267
+ <input type="checkbox" name="ab_dashboard_chart" id="ab_dashboard_chart" value="1" <?php checked($options['dashboard_chart'], 1) ?> />
268
+ </td>
269
+ </tr>
270
+
271
+ <tr>
272
+ <th>
273
+ <label for="ab_dashboard_count">
274
+ <?php esc_html_e('Spam counter on the dashboard', self::$short) ?>
275
+ </label>
276
+ </th>
277
+ <td>
278
+ <input type="checkbox" name="ab_dashboard_count" id="ab_dashboard_count" value="1" <?php checked($options['dashboard_count'], 1) ?> />
279
+ </td>
280
+ </tr>
281
+ </table>
282
+ </div>
283
+
284
+
285
+ <!-- Filter -->
286
+ <div class="table ui-tabs-hide" id="ab-tab-filter">
287
+ <!-- IP info DB -->
288
+ <table class="form-table related">
289
+ <tr>
290
+ <th>
291
+ <label for="ab_country_code">
292
+ <?php esc_html_e('Block comments and pings from specific countries', self::$short) ?>
293
+ </label>
294
+ </th>
295
+ <td>
296
+ <input type="checkbox" name="ab_country_code" id="ab_country_code" value="1" <?php checked($options['country_code'], 1) ?> />
297
+ </td>
298
+ </tr>
299
+
300
+ <tr>
301
+ <th>
302
+ <label for="ab_ipinfodb_key">
303
+ IPInfoDB <a href="http://www.ipinfodb.com/register.php" target="_blank">API Key</a>
304
+ </label>
305
+ </th>
306
+ <td>
307
+ <input type="text" name="ab_ipinfodb_key" id="ab_ipinfodb_key" value="<?php echo esc_attr($options['ipinfodb_key']); ?>" class="maxi-text code" />
308
+ </td>
309
+ </tr>
310
+
311
+ <tr>
312
+ <th>
313
+ <label for="ab_country_black">
314
+ <?php esc_html_e('Blacklist', self::$short) ?> <?php esc_html_e('as', self::$short) ?> <a href="http://www.iso.org/iso/country_names_and_code_elements" target="_blank"><?php esc_html_e('iso codes', self::$short) ?></a>
315
+ </label>
316
+ </th>
317
+ <td>
318
+ <input type="text" name="ab_country_black" id="ab_country_black" value="<?php echo esc_attr($options['country_black']); ?>" class="maxi-text code" />
319
+ </td>
320
+ </tr>
321
+
322
+ <tr>
323
+ <th>
324
+ <label for="ab_country_white">
325
+ <?php esc_html_e('Whitelist', self::$short) ?> <?php esc_html_e('as', self::$short) ?> <a href="http://www.iso.org/iso/country_names_and_code_elements" target="_blank"><?php esc_html_e('iso codes', self::$short) ?></a>
326
+ </label>
327
+ </th>
328
+ <td>
329
+ <input type="text" name="ab_country_white" id="ab_country_white" value="<?php echo esc_attr($options['country_white']); ?>" class="maxi-text code" />
330
+ </td>
331
+ </tr>
332
+ </table>
333
+
334
+ <p class="hr"></p>
335
+
336
+ <!-- Translate API -->
337
+ <table class="form-table related">
338
+ <tr>
339
+ <th>
340
+ <label for="ab_translate_api">
341
+ <?php esc_html_e('Allow comments only in certain language', self::$short) ?>
342
+ </label>
343
+ </th>
344
+ <td>
345
+ <input type="checkbox" name="ab_translate_api" id="ab_translate_api" value="1" <?php checked($options['translate_api'], 1) ?> />
346
+ </td>
347
+ </tr>
348
+
349
+ <tr>
350
+ <th>
351
+ <label for="ab_translate_lang">
352
+ <?php esc_html_e('Language', self::$short) ?>
353
+ </label>
354
+ </th>
355
+ <td>
356
+ <select name="ab_translate_lang" class="maxi-select">
357
+ <?php foreach(array('de' => 'German', 'en' => 'English') as $k => $v) { ?>
358
+ <option <?php selected($options['translate_lang'], $k); ?> value="<?php echo esc_attr($k) ?>"><?php esc_html_e($v, self::$short) ?></option>
359
+ <?php } ?>
360
+ </select>
361
+ </td>
362
+ </tr>
363
+ </table>
364
+
365
+ <p class="hr"></p>
366
+
367
+ <!-- Honey Pot -->
368
+ <table class="form-table related">
369
+ <tr>
370
+ <th>
371
+ <label for="ab_honey_pot">
372
+ <?php esc_html_e('Search comment spammers in the Project Honey Pot', self::$short) ?>
373
+ </label>
374
+ </th>
375
+ <td>
376
+ <input type="checkbox" name="ab_honey_pot" id="ab_honey_pot" value="1" <?php checked($options['honey_pot'], 1) ?> />
377
+ </td>
378
+ </tr>
379
+
380
+ <tr>
381
+ <th>
382
+ <label for="ab_honey_key">
383
+ Project Honey Pot <a href="http://www.projecthoneypot.org/httpbl_configure.php" target="_blank">API Key</a>
384
+ </label>
385
+ </th>
386
+ <td>
387
+ <input type="text" name="ab_honey_key" id="ab_honey_key" value="<?php echo esc_attr($options['honey_key']); ?>" class="maxi-text code" />
388
+ </td>
389
+ </tr>
390
+ </table>
391
+ </div>
392
+
393
+
394
+ <!-- Erweitert -->
395
+ <div class="table ui-tabs-hide" id="ab-tab-advanced">
396
+ <table class="form-table related">
397
+ <tr>
398
+ <th>
399
+ <label for="ab_flag_spam">
400
+ <?php esc_html_e('Mark as Spam, do not delete', self::$short) ?>
401
+ </label>
402
+ </th>
403
+ <td>
404
+ <input type="checkbox" name="ab_flag_spam" id="ab_flag_spam" value="1" <?php checked($options['flag_spam'], 1) ?> />
405
+ </td>
406
+ </tr>
407
+
408
+ <tr>
409
+ <th>
410
+ <label for="ab_email_notify">
411
+ <?php esc_html_e('Notification by email', self::$short) ?>
412
+ </label>
413
+ </th>
414
+ <td>
415
+ <input type="checkbox" name="ab_email_notify" id="ab_email_notify" value="1" <?php checked($options['email_notify'], 1) ?> />
416
+ </td>
417
+ </tr>
418
+
419
+ <tr>
420
+ <th>
421
+ <?php echo sprintf(esc_html__('Spam will be automatically deleted after %s days', self::$short), '<input type="text" name="ab_cronjob_interval" value="' .esc_attr($options['cronjob_interval']). '" class="small-text" />') ?>
422
+ <?php if ( $options['cronjob_enable'] && $options['cronjob_timestamp'] ) {
423
+ echo sprintf(
424
+ '<br /><small>%s @ %s</small>',
425
+ esc_html__('Last check', self::$short),
426
+ date_i18n('d.m.Y H:i:s', ($options['cronjob_timestamp'] + get_option('gmt_offset') * 3600))
427
+ );
428
+ } ?>
429
+ </th>
430
+ <td>
431
+ <input type="checkbox" name="ab_cronjob_enable" id="ab_cronjob_enable" value="1" <?php checked($options['cronjob_enable'], 1) ?> />
432
+ </td>
433
+ </tr>
434
+
435
+ <tr>
436
+ <th>
437
+ <label for="ab_no_notice">
438
+ <?php esc_html_e('Hide the &quot;MARKED AS SPAM&quot; note', self::$short) ?>
439
+ </label>
440
+ </th>
441
+ <td>
442
+ <input type="checkbox" name="ab_no_notice" id="ab_no_notice" value="1" <?php checked($options['no_notice'], 1) ?> />
443
+ </td>
444
+ </tr>
445
+
446
+ <tr>
447
+ <th>
448
+ <?php esc_html_e('Limit on', self::$short) ?> <select name="ab_ignore_type" class="mini-select"><?php foreach(array(1 => 'Comments', 2 => 'Pings') as $key => $value) {
449
+ echo '<option value="' .esc_attr($key). '" ';
450
+ selected($options['ignore_type'], $key);
451
+ echo '>' .esc_html__($value). '</option>';
452
+ } ?>
453
+ </select>
454
+ </th>
455
+ <td>
456
+ <input type="checkbox" name="ab_ignore_filter" id="ab_ignore_filter" value="1" <?php checked($options['ignore_filter'], 1) ?> />
457
+ </td>
458
+ </tr>
459
+
460
+ <tr>
461
+ <th style="vertical-align: top">
462
+ <label for="ab_ignore_reasons">
463
+ <?php esc_html_e('Delete comments by spam reasons', self::$short) ?>
464
+ <small><?php esc_html_e('Multiple choice or deselection by pressing Ctrl/CMD', self::$short) ?></small>
465
+ </label>
466
+ </th>
467
+ <td>
468
+ <select name="ab_ignore_reasons[]" id="ab_ignore_reasons" size="2" multiple="multiple" class="maxi-select">
469
+ <?php foreach ( self::$default['reasons'] as $k => $v) { ?>
470
+ <option <?php selected(in_array($k, $options['ignore_reasons']), true); ?> value="<?php echo $k ?>"><?php esc_html_e($v, self::$short) ?></option>
471
+ <?php } ?>
472
+ </select>
473
+ </td>
474
+ </tr>
475
+ </table>
476
+ </div>
477
+
478
+
479
+ <p class="submit">
480
+ <?php if ( get_locale() == 'de_DE' ) { ?>
481
+ <a href="http://playground.ebiene.de/antispam-bee-wordpress-plugin/" class="help" target="_blank">
482
+ Dokumentation
483
+ </a>
484
+ <?php } ?>
485
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
486
+ </p>
487
+ </form>
488
+ </div>
489
+ <?php }
490
+ }
js/dashboard.dev.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ google.load("visualization", "1", {packages:["corechart"]});
2
+ google.setOnLoadCallback(drawChart);
3
+
4
+ function drawChart() {
5
+ /* Init */
6
+ var id,
7
+ rows = [],
8
+ output = document.getElementById('ab_chart'),
9
+ data = new google.visualization.DataTable();
10
+
11
+ /* Leer? */
12
+ if ( !output || !antispambee.created.length ) {
13
+ return;
14
+ }
15
+
16
+ /* Extrahieren */
17
+ var created = antispambee.created.split(','),
18
+ count = antispambee.count.split(',');
19
+
20
+ /* Loopen */
21
+ for (id in created) {
22
+ rows[id] = [created[id], parseInt(count[id], 10)];
23
+ }
24
+
25
+ data.addColumn('string', 'Date');
26
+ data.addColumn('number', 'Spam');
27
+ data.addRows(rows);
28
+
29
+ var chart = new google.visualization.AreaChart(output);
30
+ chart.draw(
31
+ data,
32
+ {
33
+ width: parseInt(jQuery('#ab_chart').parent().width(), 10),
34
+ height: 120,
35
+ legend: 'none',
36
+ pointSize: 6,
37
+ lineWidth: 3,
38
+ gridlineColor: '#ececec',
39
+ colors:['#3399CC'],
40
+ reverseCategories: true,
41
+ backgroundColor: 'transparent',
42
+ vAxis: {
43
+ baselineColor: 'transparent',
44
+ textPosition: 'in',
45
+ textStyle: {
46
+ color: '#8F8F8F',
47
+ fontSize: 10
48
+ }
49
+ },
50
+ hAxis: {
51
+ textStyle: {
52
+ color: '#3399CC',
53
+ fontSize: 10
54
+ }
55
+ },
56
+ chartArea: {
57
+ width: "100%",
58
+ height: "100%"
59
+ }
60
+ }
61
+ );
62
+ }
js/dashboard.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ google.load("visualization","1",{packages:["corechart"]});google.setOnLoadCallback(drawChart);
2
+ function drawChart(){var a,c=[],d=document.getElementById("ab_chart"),b=new google.visualization.DataTable;if(d&&antispambee.created.length){var e=antispambee.created.split(","),f=antispambee.count.split(",");for(a in e)c[a]=[e[a],parseInt(f[a],10)];b.addColumn("string","Date");b.addColumn("number","Spam");b.addRows(c);(new google.visualization.AreaChart(d)).draw(b,{width:parseInt(jQuery("#ab_chart").parent().width(),10),height:120,legend:"none",pointSize:6,lineWidth:3,gridlineColor:"#ececec",colors:["#3399CC"],
3
+ reverseCategories:!0,backgroundColor:"transparent",vAxis:{baselineColor:"transparent",textPosition:"in",textStyle:{color:"#8F8F8F",fontSize:10}},hAxis:{textStyle:{color:"#3399CC",fontSize:10}},chartArea:{width:"100%",height:"100%"}})}};
js/script.dev.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(
2
+ function($) {
3
+ /* Mini Plugin */
4
+ $.fn.abManageOptions = function() {
5
+ var $$ = this,
6
+ obj = $$.parents('tr').nextAll('tr');
7
+
8
+ obj.toggle(
9
+ 0,
10
+ function() {
11
+ obj.children().find(':input').attr('disabled', !$$.attr('checked'));
12
+ }
13
+ );
14
+ }
15
+
16
+ /* Event abwickeln */
17
+ $('#ab_main .related tr:first-child :checkbox').click(
18
+ function() {
19
+ $(this).abManageOptions();
20
+ }
21
+ ).filter(':checked').abManageOptions();
22
+
23
+
24
+ /* Tabs steuern */
25
+ $('#ab_main').tabs(
26
+ {
27
+ 'select': function(event, ui) {
28
+ $('#ab_tab_index').val(ui.index);
29
+ },
30
+ 'selected': parseInt($('#ab_tab_index').val())
31
+ }
32
+ );
33
+
34
+ /* Alert ausblenden */
35
+ if ( typeof $.fn.delay === 'function' ) {
36
+ $('#setting-error-settings_updated').delay(5000).fadeOut();
37
+ }
38
+ }
39
+ );
js/script.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){a.fn.abManageOptions=function(){var a=this,b=a.parents("tr").nextAll("tr");b.toggle(0,function(){b.children().find(":input").attr("disabled",!a.attr("checked"))})};a("#ab_main .related tr:first-child :checkbox").click(function(){a(this).abManageOptions()}).filter(":checked").abManageOptions();a("#ab_main").tabs({select:function(c,b){a("#ab_tab_index").val(b.index)},selected:parseInt(a("#ab_tab_index").val())});"function"===typeof a.fn.delay&&a("#setting-error-settings_updated").delay(5E3).fadeOut()});
lang/antispam_bee-de_DE.mo ADDED
Binary file
lang/antispam_bee-de_DE.po ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Antispam Bee\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: \n"
6
+ "Last-Translator: Sergej Müller\n"
7
+ "Language-Team: Sergej Müller\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: German\n"
12
+ "X-Poedit-Country: GERMANY\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ msgid "No data available."
19
+ msgstr "Noch keine Daten vorhanden."
20
+
21
+ msgid "New spam comment on your post"
22
+ msgstr "Neuer Spam zum Artikel"
23
+
24
+ msgid "Advanced"
25
+ msgstr "Erweitert"
26
+
27
+ msgid "Filter"
28
+ msgstr "Filter"
29
+
30
+ msgid "General"
31
+ msgstr "Allgemein"
32
+
33
+ msgid "Comment"
34
+ msgstr "Kommentar"
35
+
36
+ msgid "Type"
37
+ msgstr "Typ"
38
+
39
+ msgid "Spam Reason"
40
+ msgstr "Spamgrund"
41
+
42
+ msgid "Empty Data"
43
+ msgstr "Leere Daten"
44
+
45
+ msgid "CSS Hack"
46
+ msgstr "CSS Hack"
47
+
48
+ msgid "Server IP"
49
+ msgstr "Server IP"
50
+
51
+ msgid "Spam IP"
52
+ msgstr "Spam IP"
53
+
54
+ msgid "Comment Language"
55
+ msgstr "Kommentarsprache"
56
+
57
+ msgid "Country Check"
58
+ msgstr "Ländercode"
59
+
60
+ msgid "Honey Pot"
61
+ msgstr "Honey Pot"
62
+
63
+ msgid "as"
64
+ msgstr "als"
65
+
66
+ msgid "iso codes"
67
+ msgstr "ISO Codes"
68
+
69
+ msgid "Approve it"
70
+ msgstr "Freigeben"
71
+
72
+ msgid "Delete it"
73
+ msgstr "Löschen"
74
+
75
+ msgid "Trash it"
76
+ msgstr "In Papierkorb"
77
+
78
+ msgid "Spam list"
79
+ msgstr "Spamliste"
80
+
81
+ msgid "Notify message by Antispam Bee"
82
+ msgstr "Benachrichtigung von Antispam Bee"
83
+
84
+ msgid "Content removed by Antispam Bee"
85
+ msgstr "Inhalt entfernt von Antispam Bee"
86
+
87
+ msgid "Last check"
88
+ msgstr "Zuletzt"
89
+
90
+ msgid "Antispam Bee requires at least PHP 5.1.2 and WordPress 3.0"
91
+ msgstr "Antispam Bee benötigt mindestens PHP 5.1.2 und WordPress 3.0"
92
+
93
+ msgid "Blocked"
94
+ msgstr "Blockiert"
95
+
96
+ msgid "Today"
97
+ msgstr "Heute"
98
+
99
+ msgid "Easy and extremely productive spam-fighting plugin with many sophisticated solutions. Includes protection again trackback spam."
100
+ msgstr "Simples, äußerst effektives Plugin zur Bekämpfung von Spam-Kommentaren. Datenschutzkonform, funktionsreich und unkompliziert."
101
+
102
+ msgid "http://antispambee.com"
103
+ msgstr "http://antispambee.de"
104
+
105
+ # Spam detection
106
+ msgid "Mark as Spam, do not delete"
107
+ msgstr "Spam markieren, nicht löschen"
108
+
109
+ msgid "Limit on"
110
+ msgstr "Beschränken auf"
111
+
112
+ msgid "Spam will be automatically deleted after %s days"
113
+ msgstr "Löschung nach %s Tagen"
114
+
115
+ msgid "Notification by email"
116
+ msgstr "Benachrichtigung via E-Mail"
117
+
118
+ msgid "Delete comments by spam reasons"
119
+ msgstr "Bei gewählten Spamgründen sofort löschen"
120
+
121
+ msgid "Multiple choice or deselection by pressing Ctrl/CMD"
122
+ msgstr "Mehrfachauswahl bzw. Abwahl mit Strg/CMD"
123
+
124
+ msgid "Hide the &quot;MARKED AS SPAM&quot; note"
125
+ msgstr "&quot;MARKED AS SPAM&quot; unterdrücken"
126
+
127
+ msgid "Comment marked as spam"
128
+ msgstr "Spam-Benachrichtigung"
129
+
130
+ # Block countries
131
+ msgid "Block comments and pings from specific countries"
132
+ msgstr "Länder blockieren bzw. erlauben"
133
+
134
+ msgid "Blacklist"
135
+ msgstr "Blacklist"
136
+
137
+ msgid "Whitelist"
138
+ msgstr "Whitelist"
139
+
140
+ # Project Honey Pot
141
+ msgid "Search comment spammers in the Project Honey Pot"
142
+ msgstr "Project Honey Pot als Quelle für Spam"
143
+
144
+ msgid "English"
145
+ msgstr "Englisch"
146
+
147
+ msgid "German"
148
+ msgstr "Deutsch"
149
+
150
+ # Translate API
151
+ msgid "Allow comments only in certain language"
152
+ msgstr "Inhalte nur in einer Sprache zulassen"
153
+
154
+ msgid "Language"
155
+ msgstr "Sprache"
156
+
157
+ # Extended
158
+ msgid "Stricter inspection for comments and pings"
159
+ msgstr "Zusatzchecks für Kommentare und Pings"
160
+
161
+ msgid "Consider comments which are already marked as spam"
162
+ msgstr "Lernfähigkeit für aktuellen Datenbestand"
163
+
164
+ msgid "Do not check if the comment author has already approved"
165
+ msgstr "Genehmigten Kommentatoren vertrauen"
166
+
167
+ # Misc
168
+ msgid "Spam counter on the dashboard"
169
+ msgstr "Spam-Anzahl auf dem Dashboard"
170
+
171
+ msgid "Statistics on the dashboard"
172
+ msgstr "Verlauf-Statistik auf dem Dashboard"
173
+
174
+ msgid "Do not check trackbacks / pingbacks"
175
+ msgstr "Keine Prüfung der Ping- und Trackbacks"
176
+
177
+ msgid "Comment form used outside of posts"
178
+ msgstr "Kommentarformular auf Archivseiten"
179
+
lang/antispam_bee-ru_RU.mo ADDED
Binary file
lang/antispam_bee-ru_RU.po ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Antispam Bee\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: \n"
6
+ "Last-Translator: Sergej Müller\n"
7
+ "Language-Team: Sergej Müller\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: German\n"
12
+ "X-Poedit-Country: GERMANY\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ msgid "No data available."
19
+ msgstr "Нет данных."
20
+
21
+ msgid "New spam comment on your post"
22
+ msgstr "Новый спам комментарий"
23
+
24
+ msgid "Advanced"
25
+ msgstr "Расширенные"
26
+
27
+ msgid "Filter"
28
+ msgstr "Фильтры"
29
+
30
+ msgid "General"
31
+ msgstr "Общие"
32
+
33
+ msgid "Comment"
34
+ msgstr "Kомментарий"
35
+
36
+ msgid "Type"
37
+ msgstr "Tип"
38
+
39
+ msgid "Spam Reason"
40
+ msgstr "Причина спама"
41
+
42
+ msgid "Empty Data"
43
+ msgstr "Нет данных"
44
+
45
+ msgid "CSS Hack"
46
+ msgstr "CSS Hack"
47
+
48
+ msgid "Server IP"
49
+ msgstr "Server IP"
50
+
51
+ msgid "Spam IP"
52
+ msgstr "Spam IP"
53
+
54
+ msgid "Comment Language"
55
+ msgstr "Язык комментария"
56
+
57
+ msgid "Country Check"
58
+ msgstr "Проверка страны"
59
+
60
+ msgid "Honey Pot"
61
+ msgstr "Honey Pot"
62
+
63
+ msgid "as"
64
+ msgstr "как"
65
+
66
+ msgid "iso codes"
67
+ msgstr "ISO Codes"
68
+
69
+ msgid "Approve it"
70
+ msgstr "Разрешить его"
71
+
72
+ msgid "Delete it"
73
+ msgstr "Удалить его"
74
+
75
+ msgid "Trash it"
76
+ msgstr "В помойку его"
77
+
78
+ msgid "Spam list"
79
+ msgstr "Список спама"
80
+
81
+ msgid "Notify message by Antispam Bee"
82
+ msgstr "Сообщение от Antispam Bee"
83
+
84
+ msgid "Content removed by Antispam Bee"
85
+ msgstr "Содержимое удалено"
86
+
87
+ msgid "Last check"
88
+ msgstr "Последний раз"
89
+
90
+ msgid "Antispam Bee requires at least PHP 5.1.2 and WordPress 3.0"
91
+ msgstr "Antispam Bee требует по крайней мере PHP 5.1.2 и WordPress 3.0"
92
+
93
+ msgid "Blocked"
94
+ msgstr "Заблокировано"
95
+
96
+ msgid "Today"
97
+ msgstr "Сегодня"
98
+
99
+ msgid "Easy and extremely productive spam-fighting plugin with many sophisticated solutions. Includes protection again trackback spam."
100
+ msgstr "Простой и очень продуктивный антиспам плагин. Включает в себя защиту от trackback спама."
101
+
102
+ msgid "http://antispambee.com"
103
+ msgstr "http://antispambee.de"
104
+
105
+ # Spam detection
106
+ msgid "Mark as Spam, do not delete"
107
+ msgstr "Отметить как спам, не удалять"
108
+
109
+ msgid "Limit on"
110
+ msgstr "Ограничить на"
111
+
112
+ msgid "Spam will be automatically deleted after %s days"
113
+ msgstr "Спам машинально удалять через %s дней"
114
+
115
+ msgid "Notification by email"
116
+ msgstr "Отправить емайл при новом спаме"
117
+
118
+ msgid "Delete comments by spam reasons"
119
+ msgstr "Удаление спама в комментариях по причинам"
120
+
121
+ msgid "Multiple choice or deselection by pressing Ctrl/CMD"
122
+ msgstr "Выбор или отменa нажав клавиши Strg/CMD"
123
+
124
+ msgid "Hide the &quot;MARKED AS SPAM&quot; note"
125
+ msgstr "Скрыть замечание &quot;MARKED AS SPAM&quot;"
126
+
127
+ msgid "Comment marked as spam"
128
+ msgstr "Kомментарий помечен как спам"
129
+
130
+ # Block countries
131
+ msgid "Block comments and pings from specific countries"
132
+ msgstr "Банить или разрешать страны"
133
+
134
+ msgid "Blacklist"
135
+ msgstr "Черный список"
136
+
137
+ msgid "Whitelist"
138
+ msgstr "Белый список"
139
+
140
+ # Project Honey Pot
141
+ msgid "Search comment spammers in the Project Honey Pot"
142
+ msgstr "Поиск спамеров в Project Honey Pot"
143
+
144
+ msgid "English"
145
+ msgstr "English"
146
+
147
+ msgid "German"
148
+ msgstr "Deutsch"
149
+
150
+ # Translate API
151
+ msgid "Allow comments only in certain language"
152
+ msgstr "Разрешить комментарии только в одном языке"
153
+
154
+ msgid "Language"
155
+ msgstr "Язык"
156
+
157
+ # Extended
158
+ msgid "Stricter inspection for comments and pings"
159
+ msgstr "Строгий контроль на входящие комментарии"
160
+
161
+ msgid "Consider comments which are already marked as spam"
162
+ msgstr "Учитывать сpам из базы данных"
163
+
164
+ msgid "Do not check if the comment author has already approved"
165
+ msgstr "Не проверять, если автор уже комментировал и был утвержден"
166
+
167
+ # Misc
168
+ msgid "Spam counter on the dashboard"
169
+ msgstr "Заблокированный спам показать на панели инструментов"
170
+
171
+ msgid "Statistics on the dashboard"
172
+ msgstr "Статистикa на панели инструментов"
173
+
174
+ msgid "Do not check trackbacks / pingbacks"
175
+ msgstr "Не проверять trackbacks и pingbacks"
176
+
177
+ msgid "Comment form used outside of posts"
178
+ msgstr "Комментарии также используются вне постов и страниц"
179
+
readme.txt ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Antispam Bee ===
2
+ Contributors: sergej.mueller
3
+ Tags: antispam, spam, comments, trackback
4
+ Donate link: http://flattr.com/profile/sergej.mueller
5
+ Requires at least: 3.0
6
+ Tested up to: 3.3
7
+ Stable tag: trunk
8
+
9
+
10
+
11
+ Anonymous and independent antispam solution. Detect comment and trackback spam. Includes statistics and notifications.
12
+
13
+
14
+
15
+ == Description ==
16
+
17
+ = Kill spam =
18
+ Antispam Bee is simple to use, has many options and filters. Does not store data on remote servers. Really.
19
+
20
+ = Features =
21
+ * Very fast execution
22
+ * Spam counter on dashboard
23
+ * Anonymous and confidential
24
+ * Trackback and pingback check
25
+ * Saves no data on remote servers
26
+ * No need to adjust any templates
27
+ * Cleaning up after plugin removal
28
+ * Support for the Project Honey Pot
29
+ * Accordingly no outgoing connection
30
+ * Interactive statistics on dashboard
31
+ * Automatically cleanup the spam folder
32
+ * Allow comments only in certain language
33
+ * Spam may be marked or deleted immediately
34
+ * Email notifications about new spam comments
35
+ * Quick & Dirty: activate, set settings, done!
36
+ * Optional strict check for incomming comments
37
+ * Block comments and pings from specific countries
38
+ * WordPress 3.x ready: Design as well as technical
39
+ * Consider comments which are already marked as spam
40
+
41
+ = Counter =
42
+ `<?php do_action('antispam_bee_count') ?> spam comments blocked by
43
+ <a href="http://antispambee.com">Antispam Bee</a>`
44
+
45
+ = Documentation =
46
+ * [Antispam Bee: Antispam für WordPress](http://playground.ebiene.de/antispam-bee-wordpress-plugin/ "Antispam für WordPress") (DE)
47
+
48
+ = Author =
49
+ * [Google+](https://plus.google.com/110569673423509816572 "Google+")
50
+ * [Portfolio](http://ebiene.de "Portfolio")
51
+
52
+
53
+
54
+ == Changelog ==
55
+
56
+ = 2.4.1 =
57
+ * Add russian translation
58
+ * Fix for the textarea replace
59
+ * Detect and hide admin notices
60
+
61
+ = 2.4 =
62
+ * Support for IPv6
63
+ * Source code revision
64
+ * Delete spam by reason
65
+ * Changing the user interface
66
+ * Requirements: PHP 5.1.2 and WordPress 3.0
67
+
68
+ = 2.3 =
69
+ * Xmas Edition
70
+
71
+ = 2.2 =
72
+ * Interactive Dashboard Stats
73
+
74
+ = 2.1 =
75
+ * Remove Google Translate API support
76
+
77
+ = 2.0 =
78
+ * Allow comments only in certain language (English/German)
79
+ * Consider comments which are already marked as spam
80
+ * Dashboard Stats: Change from canvas to image format
81
+ * System requirements: WordPress 2.8
82
+ * Removal of the migration script
83
+ * Increase plugin security
84
+
85
+ = 1.9 =
86
+ * Dashboard History Stats (HTML5 Canvas)
87
+
88
+ = 1.8 =
89
+ * Support for the new IPInfoDB API (including API Key)
90
+
91
+ = 1.7 =
92
+ * Black and whitelisting for specific countries
93
+ * "Project Honey Pot" as a optional spammer source
94
+ * Spam reason in the notification email
95
+ * Visual refresh of the notification email
96
+ * Advanced GUI changes + Fold-out options
97
+
98
+ = 1.6 =
99
+ * Support for WordPress 3.0
100
+ * System requirements: WordPress 2.7
101
+ * Code optimization
102
+
103
+ = 1.5 =
104
+ * Compatibility with WPtouch
105
+ * Add support for do_action
106
+ * Translation to Portuguese of Brazil
107
+
108
+ = 1.4 =
109
+ * Enable stricter inspection for incomming comments
110
+ * Do not check if the author has already commented and approved
111
+
112
+ = 1.3 =
113
+ * New code structure
114
+ * Email notifications about new spam comments
115
+ * Novel Algorithm: Advanced spam checking
116
+
117
+ = 1.2 =
118
+ * Antispam Bee spam counter on dashboard
119
+
120
+ = 1.1 =
121
+ * Adds support for WordPress new changelog readme.txt standard
122
+ * Various changes for more speed, usability and security
123
+
124
+ = 1.0 =
125
+ * Adds WordPress 2.8 support
126
+
127
+ = 0.9 =
128
+ * Mark as spam only comments or only pings
129
+
130
+ = 0.8 =
131
+ * Optical adjustments of the settings page
132
+ * Translation for Simplified Chinese, Spanish and Catalan
133
+
134
+ = 0.7 =
135
+ * Spam folder cleanup after X days
136
+ * Optional hide the &quot;MARKED AS SPAM&quot; note
137
+ * Language support for Italian and Turkish
138
+
139
+ = 0.6 =
140
+ * Language support for English, German, Russian
141
+
142
+ = 0.5 =
143
+ * Workaround for empty comments
144
+
145
+ = 0.4 =
146
+ * Option for trackback and pingback protection
147
+
148
+ = 0.3 =
149
+ * Trackback and Pingback spam protection
150
+
151
+
152
+
153
+ == Screenshots ==
154
+
155
+ 1. Antispam Bee settings
screenshot-1.png ADDED
Binary file