Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.130.1

Version Description

November 20 2019 = * Fix: Plugin autoupdate issues. * FIx: Woocommerce checking. * Fix: Correct IP detection. * Fix: CSV export not working after update. * Fix: QuickForms duplicates issues.

Download this release

Release Info

Developer Safronik
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.130.1
Comparing to
See all releases

Code changes from version 5.130 to 5.130.1

cleantalk.php CHANGED
@@ -1,1873 +1,1894 @@
1
- <?php
2
- /*
3
- Plugin Name: Anti-Spam by CleanTalk
4
- Plugin URI: http://cleantalk.org
5
- Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.130
7
- Author: СleanTalk <welcome@cleantalk.org>
8
- Author URI: http://cleantalk.org
9
- Text Domain: cleantalk
10
- Domain Path: /i18n
11
- */
12
-
13
- $cleantalk_executed = false;
14
-
15
- // Getting version form main file (look above)
16
- $plugin_info = get_file_data(__FILE__, array('Version' => 'Version', 'Name' => 'Plugin Name',));
17
-
18
- // Common params
19
- define('APBCT_NAME', $plugin_info['Name']);
20
- define('APBCT_VERSION', $plugin_info['Version']);
21
- define('APBCT_URL_PATH', plugins_url('', __FILE__)); //HTTP path. Plugin root folder without '/'.
22
- define('APBCT_DIR_PATH', dirname(__FILE__ ) . '/'); //System path. Plugin root folder with '/'.
23
- define('APBCT_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); //Plugin base name.
24
- define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt') ? ABSPATH . WPINC . '/certificates/ca-bundle.crt' : ''); // SSL Serttificate path
25
-
26
- // API params
27
- define('APBCT_AGENT', 'wordpress-'.str_replace('.', '', $plugin_info['Version']));
28
- define('APBCT_MODERATE_URL', 'http://moderate.cleantalk.org'); //Api URL
29
-
30
- // Option names
31
- define('APBCT_DATA', 'cleantalk_data'); //Option name with different plugin data.
32
- define('APBCT_SETTINGS', 'cleantalk_settings'); //Option name with plugin settings.
33
- define('APBCT_NETWORK_SETTINGS', 'cleantalk_network_settings'); //Option name with plugin network settings.
34
- define('APBCT_DEBUG', 'cleantalk_debug'); //Option name with a debug data. Empty by default.
35
-
36
- // Multisite
37
- define('APBCT_WPMS', (is_multisite() ? true : false)); // WMPS is enabled
38
-
39
- // Sessions
40
- define('APBCT_SEESION__LIVE_TIME', 86400*2);
41
- define('APBCT_SEESION__CHANCE_TO_CLEAN', 100);
42
-
43
- // Different params
44
- define('APBCT_REMOTE_CALL_SLEEP', 5); // Minimum time between remote call
45
-
46
- if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
47
-
48
- define('CLEANTALK_PLUGIN_DIR', dirname(__FILE__ ) . '/');
49
-
50
- // PHP functions patches
51
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/cleantalk-php-patch.php'); // Pathces fpr different functions which not exists
52
-
53
- // Base classes
54
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/API.php'); // API
55
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/DB.php'); // Database driver
56
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/Helper.php'); // Helper
57
- include_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/SFW.php'); // SpamFireWall
58
- include_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Arr.php'); // Array functions
59
-
60
- // Child classes
61
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkAPI.php'); // API for Wordpress
62
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkDB.php'); // Database class for Wordpress
63
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkHelper.php'); // Helper for Worpdress
64
- include_once(CLEANTALK_PLUGIN_DIR . "lib/CleantalkSFW.php"); // SpamFireWall for Wordpress
65
-
66
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk.php'); // Main class for request
67
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkRequest.php'); // Holds request data
68
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkResponse.php'); // Holds response data
69
-
70
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkCron.php'); // Cron handling
71
- require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkState.php'); // State class
72
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-pluggable.php'); // Pluggable functions
73
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
74
-
75
- // Global ArrayObject with settings and other global varables
76
- global $apbct;
77
- $apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors', 'remote_calls', 'stats'));
78
-
79
- $apbct->base_name = 'cleantalk-spam-protect/cleantalk.php';
80
-
81
- $apbct->logo = plugin_dir_url(__FILE__) . 'inc/images/logo.png';
82
- $apbct->logo__small = plugin_dir_url(__FILE__) . 'inc/images/logo_small.png';
83
- $apbct->logo__small__colored = plugin_dir_url(__FILE__) . 'inc/images/logo_color.png';
84
-
85
- // Customize CleantalkState
86
- // Account status
87
-
88
- $apbct->white_label = $apbct->network_settings['white_label'];
89
- $apbct->allow_custom_key = $apbct->network_settings['allow_custom_key'];
90
- $apbct->plugin_name = $apbct->network_settings['white_label__plugin_name'] ? $apbct->network_settings['white_label__plugin_name'] : APBCT_NAME;
91
- $apbct->api_key = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->settings['apikey'] : $apbct->network_settings['apikey'];
92
- $apbct->key_is_ok = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['key_is_ok'] : $apbct->network_data['key_is_ok'];
93
- $apbct->moderate = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['moderate'] : $apbct->network_data['moderate'];
94
-
95
- $apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
96
- $apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
97
-
98
- $apbct->settings_link = is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk';
99
-
100
- if(!$apbct->white_label){
101
- require_once( CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
102
- }
103
-
104
- // Passing JS key to frontend
105
- add_action('wp_ajax_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
106
- add_action('wp_ajax_nopriv_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
107
-
108
- // Database prefix
109
- global $wpdb;
110
- $apbct->db_prefix = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $wpdb->prefix : $wpdb->base_prefix;
111
- $apbct->db_prefix = !$apbct->white_label && defined('CLEANTALK_ACCESS_KEY') ? $wpdb->base_prefix : $wpdb->prefix;
112
- // Database constants
113
- define('APBCT_TBL_FIREWALL_DATA', $apbct->db_prefix . 'cleantalk_sfw'); // Table with firewall data.
114
- define('APBCT_TBL_FIREWALL_LOG', $apbct->db_prefix . 'cleantalk_sfw_logs'); // Table with firewall logs.
115
- define('APBCT_TBL_SESSIONS', $apbct->db_prefix . 'cleantalk_sessions'); // Table with session data.
116
- define('APBCT_SELECT_LIMIT', 5000); // Select limit for logs.
117
- define('APBCT_WRITE_LIMIT', 5000); // Write limit for firewall data.
118
-
119
- /** @todo HARDCODE FIX */
120
- if($apbct->plugin_version === '1.0.0')
121
- $apbct->plugin_version = '5.100';
122
-
123
- // Do update actions if version is changed
124
- apbct_update_actions();
125
-
126
- // Self cron
127
- if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
128
-
129
- $ct_cron = new CleantalkCron();
130
- $ct_cron->checkTasks();
131
-
132
- if(!empty($ct_cron->tasks_to_run)){
133
-
134
- define('CT_CRON', true); // Letting know functions that they are running under CT_CRON
135
- $ct_cron->runTasks();
136
- unset($ct_cron);
137
-
138
- }
139
- }
140
-
141
- //Delete cookie for admin trial notice
142
- add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
143
-
144
- // Set cookie only for public pages and for non-AJAX requests
145
- if (!is_admin() && !apbct_is_ajax() && !defined('DOING_CRON')
146
- && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
147
- && empty($_GET['ct_checkjs_search_default']) // Search form fix
148
- && empty($_POST['action']) //bbPress
149
- ){
150
- add_action('template_redirect','apbct_cookie', 2);
151
- add_action('template_redirect','apbct_store__urls', 2);
152
- if (empty($_POST) && empty($_GET)){
153
- apbct_cookie();
154
- apbct_store__urls();
155
- }
156
- }
157
-
158
- // Early checks
159
-
160
- // Iphorm
161
- if( isset( $_POST['iphorm_ajax'], $_POST['iphorm_id'], $_POST['iphorm_uid'] ) ){
162
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
163
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
164
- ct_ajax_hook();
165
- }
166
-
167
- // Facebook
168
- if ($apbct->settings['general_contact_forms_test'] == 1
169
- && (!empty($_POST['action']) && $_POST['action'] == 'fb_intialize')
170
- && !empty($_POST['FB_userdata'])
171
- ){
172
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
173
- if (apbct_is_user_enable()){
174
- $ct_check_post_result=false;
175
- ct_registration_errors(null);
176
- }
177
-
178
- }
179
-
180
- // Ninja Forms. Making GET action to POST action
181
- if( apbct_is_in_uri( 'admin-ajax.php' ) && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit' )
182
- $_POST['action']='ninja_forms_ajax_submit';
183
-
184
- add_action( 'wp_ajax_nopriv_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
185
- add_action( 'wp_ajax_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
186
- add_action( 'wp_ajax_nopriv_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
187
- add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
188
- add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
189
-
190
- // SeedProd Coming Soon Page Pro integration
191
- add_action( 'wp_ajax_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
192
- add_action( 'wp_ajax_nopriv_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
193
- add_action( 'wp_ajax_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
194
- add_action( 'wp_ajax_nopriv_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
195
-
196
- // The 7 theme contact form integration
197
- add_action( 'wp_ajax_nopriv_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
198
- add_action( 'wp_ajax_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
199
-
200
- // Elementor Pro page builder forms
201
- add_action( 'wp_ajax_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
202
- add_action( 'wp_ajax_nopriv_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
203
-
204
- // Public actions
205
- if(!is_admin() && !apbct_is_ajax()){
206
-
207
- // Default search
208
- //add_filter( 'get_search_form', 'apbct_forms__search__addField' );
209
- add_filter( 'get_search_query', 'apbct_forms__search__testSpam' );
210
-
211
- // Remote calls
212
- if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) && in_array($_GET['plugin_name'], array('antispam','anti-spam', 'apbct'))){
213
- apbct_remote_call__perform();
214
- }
215
-
216
- // SpamFireWall check
217
- if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
218
- $apbct->settings['spam_firewall'] == 1 &&
219
- apbct_is_get()
220
- ){
221
- apbct_sfw__check();
222
- }
223
-
224
- }
225
-
226
-
227
- // Activation/deactivation functions must be in main plugin file.
228
- // http://codex.wordpress.org/Function_Reference/register_activation_hook
229
- register_activation_hook( __FILE__, 'apbct_activation' );
230
- register_deactivation_hook( __FILE__, 'apbct_deactivation' );
231
-
232
- // Hook for newly added blog
233
- add_action('wpmu_new_blog', 'apbct_activation__new_blog', 10, 6);
234
-
235
- // Async loading for JavaScript
236
- add_filter('script_loader_tag', 'apbct_add_async_attribute', 10, 3);
237
-
238
- // Redirect admin to plugin settings.
239
- if(!defined('WP_ALLOW_MULTISITE') || defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE == false)
240
- add_action('admin_init', 'apbct_plugin_redirect');
241
-
242
- // Deleting SFW tables when deleting websites
243
- if(defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE === true)
244
- add_action( 'delete_blog', 'apbct_sfw__delete_tables', 10, 2 );
245
-
246
- // After plugin loaded - to load locale as described in manual
247
- add_action('plugins_loaded', 'apbct_plugin_loaded' );
248
-
249
- if( !empty($apbct->settings['use_ajax']) &&
250
- ! apbct_is_in_uri( '.xml' ) &&
251
- ! apbct_is_in_uri( '.xsl' ) )
252
- {
253
- add_action( 'wp_ajax_nopriv_ct_get_cookie', 'ct_get_cookie',1 );
254
- add_action( 'wp_ajax_ct_get_cookie', 'ct_get_cookie',1 );
255
- }
256
-
257
- // Admin panel actions
258
- if (is_admin() || is_network_admin()){
259
-
260
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-comments.php');
261
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-users.php');
262
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-admin.php');
263
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-settings.php');
264
-
265
- if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)){
266
-
267
- add_action('admin_enqueue_scripts', 'apbct_admin__enqueue_scripts');
268
-
269
- add_action('admin_init', 'apbct_admin__init', 1);
270
- add_action('admin_menu', 'apbct_settings_add_page');
271
- add_action('network_admin_menu', 'apbct_settings_add_page');
272
- add_action('admin_notices', 'apbct_admin__notice_message');
273
- add_action('network_admin_notices', 'apbct_admin__notice_message');
274
-
275
- //Show widget only if not IP license
276
- if(!$apbct->moderate_ip)
277
- add_action('wp_dashboard_setup', 'ct_dashboard_statistics_widget' );
278
- }
279
-
280
- if(apbct_is_ajax() || isset($_POST['cma-action'])){
281
-
282
- $cleantalk_hooked_actions = array();
283
- $cleantalk_ajax_actions_to_check = array();
284
-
285
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
286
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
287
-
288
- // Feedback for comments
289
- if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_comment'){
290
- add_action( 'wp_ajax_nopriv_ct_feedback_comment', 'apbct_comment__send_feedback',1 );
291
- add_action( 'wp_ajax_ct_feedback_comment', 'apbct_comment__send_feedback',1 );
292
- }
293
- if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_user'){
294
- add_action( 'wp_ajax_nopriv_ct_feedback_user', 'apbct_user__send_feedback',1 );
295
- add_action( 'wp_ajax_ct_feedback_user', 'apbct_user__send_feedback',1 );
296
- }
297
-
298
- // Check AJAX requests
299
- // if User is not logged in
300
- // if Unknown action or Known action with mandatory check
301
- if( (!apbct_is_user_logged_in() || $apbct->settings['protect_logged_in'] == 1) &&
302
- isset($_POST['action']) && (!in_array($_POST['action'], $cleantalk_hooked_actions) || in_array($_POST['action'], $cleantalk_ajax_actions_to_check))
303
- ){
304
- ct_ajax_hook();
305
- }
306
-
307
- //QAEngine Theme answers
308
- if (intval($apbct->settings['general_contact_forms_test']))
309
- add_filter('et_pre_insert_question', 'ct_ajax_hook', 1, 1); // Questions
310
- add_filter('et_pre_insert_answer', 'ct_ajax_hook', 1, 1); // Answers
311
-
312
- // Formidable
313
- add_filter( 'frm_entries_before_create', 'apbct_rorm__formidable__testSpam', 10, 2 );
314
- add_action( 'frm_entries_footer_scripts', 'apbct_rorm__formidable__footerScripts', 20, 2 );
315
-
316
- // Some of plugins to register a users use AJAX context.
317
- add_filter('registration_errors', 'ct_registration_errors', 1, 3);
318
- add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
319
- add_action('user_register', 'apbct_user_register');
320
-
321
- if(class_exists('BuddyPress')){
322
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
323
- add_filter('bp_activity_is_spam_before_save', 'apbct_integration__buddyPres__activityWall', 999 ,2); /* ActivityWall */
324
- add_action('bp_locate_template', 'apbct_integration__buddyPres__getTemplateName', 10, 6);
325
- }
326
-
327
- }
328
-
329
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
330
- //Bitrix24 contact form
331
- if ($apbct->settings['general_contact_forms_test'] == 1 &&
332
- !empty($_POST['your-phone']) &&
333
- !empty($_POST['your-email']) &&
334
- !empty($_POST['your-message'])
335
- ){
336
- $ct_check_post_result=false;
337
- ct_contact_form_validate();
338
- }
339
-
340
- // Sends feedback to the cloud about comments
341
- // add_action('wp_set_comment_status', 'ct_comment_send_feedback', 10, 2);
342
-
343
- // Sends feedback to the cloud about deleted users
344
- global $pagenow;
345
- if($pagenow=='users.php')
346
- add_action('delete_user', 'apbct_user__delete__hook', 10, 2);
347
-
348
- if( $pagenow=='plugins.php' || apbct_is_in_uri( 'plugins.php' ) ){
349
-
350
- add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
351
- add_filter('network_admin_plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
352
-
353
- add_filter('plugin_row_meta', 'apbct_admin__register_plugin_links', 10, 2);
354
- }
355
-
356
- // Public pages actions
357
- }else{
358
-
359
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
360
-
361
- add_action('wp_enqueue_scripts', 'ct_enqueue_scripts_public');
362
-
363
- // Init action.
364
- add_action('plugins_loaded', 'apbct_init', 1);
365
-
366
- // Comments
367
- add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
368
- add_filter('comment_text', 'ct_comment_text' );
369
- add_filter('wp_die_handler', 'apbct_comment__sanitize_data__before_wp_die', 1); // Check comments after validation
370
-
371
- // Registrations
372
- if(!isset($_POST['wp-submit'])){
373
- add_action('login_form_register', 'apbct_cookie');
374
- add_action('login_form_register', 'apbct_store__urls');
375
- }
376
- add_action('login_enqueue_scripts', 'apbct_login__scripts');
377
- add_action('register_form', 'ct_register_form');
378
- add_filter('registration_errors', 'ct_registration_errors', 1, 3);
379
- add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
380
- add_action('user_register', 'apbct_user_register');
381
-
382
- // Multisite registrations
383
- add_action('signup_extra_fields','ct_register_form');
384
- add_filter('wpmu_validate_user_signup', 'ct_registration_errors_wpmu', 10, 3);
385
-
386
- // Login form - for notifications only
387
- add_filter('login_message', 'ct_login_message');
388
-
389
- // Comments output hook
390
- add_filter('wp_list_comments_args', 'ct_wp_list_comments_args');
391
-
392
- // Ait-Themes fix
393
- if(isset($_GET['ait-action']) && $_GET['ait-action']=='register'){
394
- $tmp=$_POST['redirect_to'];
395
- unset($_POST['redirect_to']);
396
- ct_contact_form_validate();
397
- $_POST['redirect_to']=$tmp;
398
- }
399
- }
400
-
401
- // Short code for GDPR
402
- if($apbct->settings['gdpr_enabled'])
403
- add_shortcode('cleantalk_gdpr_form', 'apbct_shrotcode_handler__GDPR_public_notice__form');
404
-
405
- }
406
-
407
- /**
408
- * Function preforms remote call
409
- */
410
- function apbct_remote_call__perform()
411
- {
412
- global $apbct;
413
-
414
- $remote_action = $_GET['spbc_remote_call_action'];
415
-
416
- if(array_key_exists($remote_action, $apbct->remote_calls)){
417
-
418
- if(time() - $apbct->remote_calls[$remote_action]['last_call'] > APBCT_REMOTE_CALL_SLEEP){
419
-
420
- $apbct->remote_calls[$remote_action]['last_call'] = time();
421
- $apbct->save('remote_calls');
422
-
423
- if(strtolower($_GET['spbc_remote_call_token']) == strtolower(md5($apbct->api_key))){
424
-
425
- // Flag to let plugin know that Remote Call is running.
426
- $apbct->rc_running = true;
427
-
428
- switch ($_GET['spbc_remote_call_action']) {
429
-
430
- // Close renew banner
431
- case 'close_renew_banner':
432
- $apbct->data['notice_trial'] = 0;
433
- $apbct->data['notice_renew'] = 0;
434
- $apbct->saveData();
435
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
436
- die('OK');
437
- break;
438
-
439
- // SFW update
440
- case 'sfw_update':
441
- $result = ct_sfw_update(true);
442
- /**
443
- * @todo CRUNCH
444
- */
445
- if(is_string($result) && strpos($result, 'FAIL') !== false){
446
- $result = json_decode(substr($result, 5), true);
447
- }
448
- die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error'])));
449
- break;
450
-
451
- // SFW send logs
452
- case 'sfw_send_logs':
453
- $result = ct_sfw_send_logs();
454
- die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error'])));
455
- break;
456
-
457
- // Update plugin
458
- case 'update_plugin':
459
- add_action('wp', 'apbct_rc__update', 1);
460
- break;
461
-
462
- // Install plugin
463
- case 'install_plugin':
464
- add_action('wp', 'apbct_rc__install_plugin', 1);
465
- break;
466
- // Activate plugin
467
- case 'activate_plugin':
468
- $result = apbct_rc__activate_plugin($_GET['plugin']);
469
- die(empty($result['error'])
470
- ? 'OK'
471
- : 'FAIL '.json_encode(array('error' => $result['error'])));
472
- break;
473
-
474
- // Insert API key
475
- case 'insert_auth_key':
476
- $result = apbct_rc__insert_auth_key($_GET['auth_key'], $_GET['plugin']);
477
- die(empty($result['error'])
478
- ? 'OK'
479
- : 'FAIL '.json_encode(array('error' => $result['error'])));
480
- break;
481
-
482
- // Update settins
483
- case 'update_settings':
484
- $result = apbct_rc__update_settings($_GET);
485
- die(empty($result['error'])
486
- ? 'OK'
487
- : 'FAIL '.json_encode(array('error' => $result['error'])));
488
- break;
489
- // Deactivate plugin
490
- case 'deactivate_plugin':
491
- add_action('plugins_loaded', 'apbct_rc__deactivate_plugin', 1);
492
- break;
493
-
494
- // Uninstall plugin
495
- case 'uninstall_plugin':
496
- add_action('plugins_loaded', 'apbct_rc__uninstall_plugin', 1);
497
- break;
498
- // No action found
499
- default:
500
- die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION_2')));
501
- break;
502
- }
503
-
504
- }else
505
- die('FAIL '.json_encode(array('error' => 'WRONG_TOKEN')));
506
- }else
507
- die('FAIL '.json_encode(array('error' => 'TOO_MANY_ATTEMPTS')));
508
- }else
509
- die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION')));
510
- }
511
-
512
- /**
513
- * Function for SpamFireWall check
514
- */
515
- function apbct_sfw__check()
516
- {
517
- global $apbct, $spbc, $cleantalk_url_exclusions;
518
-
519
- // Turn off the SpamFireWall if current url in the exceptions list and WordPress core pages
520
- if (!empty($cleantalk_url_exclusions) && is_array($cleantalk_url_exclusions)) {
521
- $core_page_to_skip_check = array('/feed');
522
- foreach (array_merge($cleantalk_url_exclusions, $core_page_to_skip_check) as $v) {
523
- if ( apbct_is_in_uri( $v ) ) {
524
- return;
525
- }
526
- }
527
- }
528
-
529
- // Turn off the SpamFireWall if Remote Call is in progress
530
- if($apbct->rc_running || (!empty($spbc) && $spbc->rc_running))
531
- return;
532
-
533
- $is_sfw_check = true;
534
- $sfw = new CleantalkSFW();
535
- $sfw->ip_array = (array)$sfw->ip__get(array('real'), true);
536
-
537
- // Skip by cookie
538
- foreach($sfw->ip_array as $ct_cur_ip){
539
- if(isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key'] == md5($ct_cur_ip.$apbct->api_key)){
540
- $is_sfw_check=false;
541
- if(isset($_COOKIE['ct_sfw_passed'])){
542
- $sfw->logs__update($ct_cur_ip, 'passed');
543
- $apbct->data['sfw_counter']['all']++;
544
- $apbct->saveData();
545
- if(!headers_sent())
546
- setcookie ('ct_sfw_passed', '0', time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST) ,false, true);
547
- }
548
- break;
549
- }else{
550
- $is_sfw_check = true;
551
- }
552
- }
553
-
554
- // Skip the check
555
- if(!empty($_GET['access'])){
556
- $spbc_settings = get_option('spbc_settings');
557
- $spbc_key = !empty($spbc_settings['spbc_key']) ? $spbc_settings['spbc_key'] : false;
558
- if($_GET['access'] === $apbct->api_key || ($spbc_key !== false && $_GET['access'] === $spbc_key)){
559
- $is_sfw_check = false;
560
- setcookie ('spbc_firewall_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $spbc_key), time()+1200, '/');
561
- setcookie ('ct_sfw_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $apbct->api_key), time()+1200, '/');
562
- }
563
- unset($spbc_settings, $spbc_key);
564
- }
565
-
566
- if($is_sfw_check){
567
-
568
- $sfw->ip_check();
569
-
570
- // Pass remote calls
571
- if($sfw->pass === false){
572
- if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name'])){
573
- foreach($sfw->blocked_ips as $ip){
574
- $resolved = CleantalkHelper::ip__resolve($ip['ip']);
575
- if($resolved && preg_match('/cleantalk\.org/', $resolved) === 1 || $resolved === 'back'){
576
- $sfw->pass = true;
577
- }
578
- } unset($ip);
579
- }
580
- }
581
-
582
- if($sfw->test){
583
- $sfw->sfw_die($apbct->api_key, '', parse_url(get_option('siteurl'),PHP_URL_HOST), 'test');
584
- }
585
-
586
- if($sfw->pass === false){
587
- foreach($sfw->blocked_ips as $ip){
588
- $sfw->logs__update($ip['ip'], 'blocked');
589
- }
590
- $apbct->data['sfw_counter']['blocked']++;
591
- $apbct->saveData();
592
- $sfw->sfw_die($apbct->api_key, '', parse_url(get_option('siteurl'),PHP_URL_HOST));
593
- }else{
594
- reset($sfw->passed_ips);
595
- if(!empty($apbct->settings['set_cookies']) && !headers_sent() && key($sfw->passed_ips))
596
- setcookie ('ct_sfw_pass_key', md5($sfw->passed_ips[key($sfw->passed_ips)]['ip'].$apbct->api_key), time()+86400*30, '/', parse_url(get_option('siteurl'),PHP_URL_HOST) ,false);
597
- }
598
- }
599
- unset($is_sfw_check, $sfw, $sfw_ip, $ct_cur_ip);
600
- }
601
-
602
- /**
603
- * On activation, set a time, frequency and name of an action hook to be scheduled.
604
- */
605
- function apbct_activation( $network = false ) {
606
-
607
- global $wpdb;
608
-
609
- // SFW data
610
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw` (
611
- `network` int(11) unsigned NOT NULL,
612
- `mask` int(11) unsigned NOT NULL,
613
- INDEX ( `network` , `mask` )
614
- );';
615
-
616
- // SFW log
617
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw_logs` (
618
- `ip` VARCHAR(15) NOT NULL,
619
- `all_entries` INT NOT NULL,
620
- `blocked_entries` INT NOT NULL,
621
- `entries_timestamp` INT NOT NULL,
622
- PRIMARY KEY (`ip`));';
623
-
624
- // Sessions
625
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sessions` (
626
- `id` VARCHAR(64) NOT NULL,
627
- `name` VARCHAR(40) NOT NULL,
628
- `value` TEXT NULL DEFAULT NULL,
629
- `last_update` DATETIME NULL DEFAULT NULL,
630
- PRIMARY KEY (`name`(40), `id`(64)));';
631
-
632
- if($network && !defined('CLEANTALK_ACCESS_KEY')){
633
- $initial_blog = get_current_blog_id();
634
- $blogs = array_keys($wpdb->get_results('SELECT blog_id FROM '. $wpdb->blogs, OBJECT_K));
635
- foreach ($blogs as $blog) {
636
- switch_to_blog($blog);
637
- apbct_activation__create_tables($sqls);
638
- // Cron tasks
639
- CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
640
- CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
641
- CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
642
- CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+300); // SFW update
643
- CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
644
- CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
645
- CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
646
- }
647
- switch_to_blog($initial_blog);
648
- }else{
649
-
650
- // Cron tasks
651
- CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
652
- CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
653
- CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
654
- CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+43200); // SFW update
655
- CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
656
- CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
657
- CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
658
-
659
- apbct_activation__create_tables($sqls);
660
- ct_sfw_update(); // Updating SFW
661
- ct_account_status_check(null, false);
662
- }
663
-
664
- // Additional options
665
- add_option('ct_plugin_do_activation_redirect', true);
666
- }
667
-
668
- function apbct_activation__create_tables($sqls) {
669
- global $wpdb;
670
- $wpdb->show_errors = false;
671
- foreach($sqls as $sql){
672
- $sql = sprintf($sql, $wpdb->prefix); // Adding current blog prefix
673
- $result = $wpdb->query($sql);
674
- if($result === false)
675
- $errors[] = "Failed.\nQuery: {$wpdb->last_query}\nError: {$wpdb->last_error}";
676
- }
677
- $wpdb->show_errors = true;
678
-
679
- // Logging errors
680
- if(!empty($errors))
681
- apbct_log($errors);
682
- }
683
-
684
- function apbct_activation__new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) {
685
- if (apbct_is_plugin_active_for_network('cleantalk-spam-protect/cleantalk.php')){
686
-
687
- switch_to_blog($blog_id);
688
-
689
- global $wpdb;
690
-
691
- // SFW data
692
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw` (
693
- `network` int(11) unsigned NOT NULL,
694
- `mask` int(11) unsigned NOT NULL,
695
- INDEX ( `network` , `mask` )
696
- );';
697
-
698
- // SFW log
699
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw_logs` (
700
- `ip` VARCHAR(15) NOT NULL,
701
- `all_entries` INT NOT NULL,
702
- `blocked_entries` INT NOT NULL,
703
- `entries_timestamp` INT NOT NULL,
704
- PRIMARY KEY (`ip`));';
705
-
706
- // Sessions
707
- $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sessions` (
708
- `id` VARCHAR(64) NOT NULL,
709
- `name` TEXT NOT NULL,
710
- `value` TEXT NULL DEFAULT NULL,
711
- `last_update` DATETIME NULL DEFAULT NULL,
712
- PRIMARY KEY (`id`(64), `name`(64)));';
713
-
714
- // Cron tasks
715
- CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
716
- CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
717
- CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
718
- CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+43200); // SFW update
719
- CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
720
- CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
721
- CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
722
- apbct_activation__create_tables($sqls);
723
- ct_sfw_update(); // Updating SFW
724
- ct_account_status_check(null, false);
725
- restore_current_blog();
726
- }
727
- }
728
-
729
- /**
730
- * On deactivation, clear schedule.
731
- */
732
- function apbct_deactivation( $network ) {
733
-
734
- global $apbct, $wpdb;
735
-
736
- // Deactivation for network
737
- if(is_multisite() && $network){
738
-
739
- $initial_blog = get_current_blog_id();
740
- $blogs = array_keys($wpdb->get_results('SELECT blog_id FROM '. $wpdb->blogs, OBJECT_K));
741
- foreach ($blogs as $blog) {
742
- switch_to_blog($blog);
743
- apbct_deactivation__delete_blog_tables();
744
- delete_option('cleantalk_cron'); // Deleting cron entries
745
-
746
- if($apbct->settings['complete_deactivation']){
747
- apbct_deactivation__delete_all_options();
748
- apbct_deactivation__delete_all_options__in_network();
749
- }
750
-
751
- }
752
- switch_to_blog($initial_blog);
753
-
754
- // Deactivation for blog
755
- }elseif(is_multisite()){
756
-
757
- apbct_deactivation__delete_common_tables();
758
- delete_option('cleantalk_cron'); // Deleting cron entries
759
-
760
- if($apbct->settings['complete_deactivation'])
761
- apbct_deactivation__delete_all_options();
762
-
763
- // Deactivation on standalone blog
764
- }elseif(!is_multisite()){
765
-
766
- apbct_deactivation__delete_common_tables();
767
- delete_option('cleantalk_cron'); // Deleting cron entries
768
-
769
- if($apbct->settings['complete_deactivation'])
770
- apbct_deactivation__delete_all_options();
771
-
772
- }
773
- }
774
-
775
- /**
776
- * Delete all cleantalk_* entries from _options table
777
- */
778
- function apbct_deactivation__delete_all_options(){
779
- delete_option('cleantalk_settings');
780
- delete_option('cleantalk_data');
781
- delete_option('cleantalk_cron');
782
- delete_option('cleantalk_errors');
783
- delete_option('cleantalk_remote_calls');
784
- delete_option('cleantalk_server');
785
- delete_option('cleantalk_stats');
786
- delete_option('cleantalk_timelabel_reg');
787
- }
788
-
789
- /**
790
- * Delete all cleantalk_* entries from _sitemeta table
791
- */
792
- function apbct_deactivation__delete_all_options__in_network(){
793
- delete_site_option('cleantalk_network_settings');
794
- delete_site_option('cleantalk_network_data');
795
- }
796
-
797
- function apbct_deactivation__delete_common_tables() {
798
- global $wpdb;
799
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sfw`;'); // Deleting SFW data
800
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
801
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sessions`;'); // Deleting session table
802
- }
803
-
804
- function apbct_deactivation__delete_blog_tables() {
805
- global $wpdb;
806
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw`;'); // Deleting SFW data
807
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
808
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sessions`;'); // Deleting session table
809
- }
810
-
811
- /**
812
- * Redirects admin to plugin settings after activation.
813
- */
814
- function apbct_plugin_redirect()
815
- {
816
- global $apbct;
817
- if (get_option('ct_plugin_do_activation_redirect', false) && !isset($_GET['activate-multi'])){
818
- delete_option('ct_plugin_do_activation_redirect');
819
- wp_redirect($apbct->settings_link);
820
- }
821
- }
822
-
823
- function ct_add_event($event_type)
824
- {
825
- global $apbct, $cleantalk_executed;
826
-
827
- //
828
- // To migrate on the new version of ct_add_event().
829
- //
830
- switch ($event_type) {
831
- case '0': $event_type = 'no';break;
832
- case '1': $event_type = 'yes';break;
833
- }
834
-
835
- $current_hour = intval(date('G'));
836
-
837
- // Updating current hour
838
- if($current_hour!=$apbct->data['current_hour']){
839
- $apbct->data['current_hour'] = $current_hour;
840
- $apbct->data['array_accepted'][$current_hour] = 0;
841
- $apbct->data['array_blocked'][$current_hour] = 0;
842
- }
843
-
844
- //Add 1 to counters
845
- if($event_type=='yes'){
846
- $apbct->data['array_accepted'][$current_hour]++;
847
- $apbct->data['all_time_counter']['accepted']++;
848
- $apbct->data['user_counter']['accepted']++;
849
- }
850
- if($event_type=='no'){
851
- $apbct->data['array_blocked'][$current_hour]++;
852
- $apbct->data['all_time_counter']['blocked']++;
853
- $apbct->data['user_counter']['blocked']++;
854
- }
855
-
856
- $apbct->saveData();
857
-
858
- $cleantalk_executed=true;
859
- }
860
-
861
- /**
862
- * return new cookie value
863
- */
864
- function ct_get_cookie()
865
- {
866
- global $ct_checkjs_def;
867
- $ct_checkjs_key = ct_get_checkjs_value();
868
- print $ct_checkjs_key;
869
- die();
870
- }
871
-
872
- function ct_sfw_update($immediate = false){
873
-
874
- global $apbct;
875
-
876
- if($apbct->settings['spam_firewall'] == 1){
877
-
878
- $sfw = new CleantalkSFW();
879
-
880
- $file_url = isset($_GET['file_url']) ? $_GET['file_url'] : null;
881
- $result = $sfw->sfw_update($apbct->api_key, $file_url, $immediate);
882
-
883
- if(empty($result['error'])){
884
- $apbct->stats['sfw']['last_update_time'] = time();
885
- $apbct->stats['sfw']['entries'] = $result;
886
- $apbct->save('stats');
887
- }
888
-
889
- return $result;
890
- }
891
-
892
- return array('error' => 'SFW_DISABLED');
893
-
894
- }
895
-
896
- function ct_sfw_send_logs()
897
- {
898
- global $apbct;
899
-
900
- if($apbct->settings['spam_firewall'] == 1){
901
-
902
- $sfw = new CleantalkSFW();
903
- $result = $sfw->logs__send($apbct->api_key);
904
-
905
- if(empty($result['error'])){
906
- $apbct->stats['sfw']['last_send_time'] = time();
907
- $apbct->stats['sfw']['last_send_amount'] = $result['rows'];
908
- $apbct->save('stats');
909
- }
910
-
911
- return $result;
912
-
913
- }
914
-
915
- return array('error' => 'SFW_DISABLED');
916
- }
917
-
918
- /**
919
- * Wrapper for Cleantalk's remote calls
920
- *
921
- * @param string $action What you want to do?
922
- * @param array $additional_params Additional GET parameters for RC
923
- * @param string $presets Presets for CleantalkHelper::http__request(). 'async' maybe?
924
- * @param string $plugin_name Plugin name 'antispam' by default
925
- * @param string $call_token RC securirty token
926
- * @param string $url Current site URL by default
927
- *
928
- * @return array|bool
929
- */
930
- function apbct_rc__send($action, $additional_params = array(), $presets = 'get', $plugin_name = 'antispam', $call_token = '', $url = ''){
931
-
932
- global $apbct;
933
-
934
- $default_params = array(
935
- 'plugin_name' => $plugin_name,
936
- 'spbc_remote_call_token' => $call_token ? $call_token : md5($apbct->api_key),
937
- 'spbc_remote_call_action' => $action,
938
- );
939
-
940
- $params = array_merge($additional_params, $default_params);
941
-
942
- return apbct_rc__parse_result(
943
- CleantalkHelper::http__request(
944
- $url ? $url : get_option('siteurl'),
945
- $params,
946
- $presets
947
- )
948
- );
949
- }
950
-
951
- /**
952
- * Parse different types of remote call results
953
- *
954
- * @param array|string $rc_result
955
- * string - 'FAIL {"some":"result}'
956
- * string - 'OK {"some":"result}'
957
- *
958
- * @return array|string
959
- */
960
- function apbct_rc__parse_result($rc_result){
961
- if(is_string($rc_result)){
962
- $rc_result = preg_replace('/^(OK\s?|FAIL\s?)(.*)/', '$2', $rc_result, 1);
963
- $rc_result = json_decode($rc_result, true);
964
- $rc_result = $rc_result
965
- ? $rc_result
966
- : array('error' => 'FAIL_TO_PARSE_RC_RESULT');
967
- }
968
- return $rc_result;
969
- }
970
-
971
- /**
972
- * Install plugin from wordpress catalog
973
- *
974
- * @param WP $wp
975
- * @param string $plugin_slug
976
- */
977
- function apbct_rc__install_plugin($wp = null, $plugin = null){
978
-
979
- $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
980
-
981
- if($plugin){
982
-
983
- if(preg_match('/[a-zA-Z-\d]+[\/\\][a-zA-Z-\d]+\.php/', $plugin)){
984
-
985
- $plugin_slug = preg_replace('@([a-zA-Z-\d]+)[\\\/].*@', '$1', $plugin);
986
-
987
- if($plugin_slug){
988
-
989
- require_once(ABSPATH.'wp-admin/includes/plugin-install.php');
990
- $result = plugins_api(
991
- 'plugin_information',
992
- array(
993
- 'slug' => $plugin_slug,
994
- 'fileds' => array('version' => true, 'download_link' => true,),
995
- )
996
- );
997
-
998
- if(!is_wp_error($result)){
999
-
1000
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1001
- include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1002
- include_once( ABSPATH . 'wp-admin/includes/file.php' );
1003
- include_once( ABSPATH . 'wp-admin/includes/misc.php' );
1004
- include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
1005
- include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
1006
-
1007
- $installer= new CleantalkUpgrader( new CleantalkUpgraderSkin() );
1008
- $installer->install($result->download_link);
1009
-
1010
- if($installer->apbct_result === 'OK'){
1011
- die('OK');
1012
-
1013
- }else
1014
- die('FAIL '. json_encode(array('error' => $installer->apbct_result)));
1015
- }else
1016
- die('FAIL '. json_encode(array('error' => 'FAIL_TO_GET_LATEST_VERSION', 'details' => $result->get_error_message(),)));
1017
- }else
1018
- die('FAIL '. json_encode(array('error' => 'PLUGIN_SLUG_INCORRECT')));
1019
- }else
1020
- die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_INCORRECT')));
1021
- }else
1022
- die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1023
- }
1024
-
1025
- function apbct_rc__activate_plugin($plugin){
1026
-
1027
- $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1028
-
1029
- if($plugin){
1030
-
1031
- if(preg_match('@[a-zA-Z-\d]+[\\\/][a-zA-Z-\d]+\.php@', $plugin)){
1032
-
1033
- require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1034
-
1035
- $result = activate_plugins($plugin);
1036
-
1037
- if($result && !is_wp_error($result)){
1038
- return array('success' => true);
1039
- }else
1040
- return array('error' => 'FAIL_TO_ACTIVATE', 'details' => (is_wp_error($result) ? ' '.$result->get_error_message() : ''));
1041
- }else
1042
- return array('error' => 'PLUGIN_NAME_IS_INCORRECT');
1043
- }else
1044
- return array('error' => 'PLUGIN_NAME_IS_UNSET');
1045
- }
1046
-
1047
- /**
1048
- * Uninstall plugin from wordpress catalog
1049
- *
1050
- * @param null $plugin_name
1051
- */
1052
- function apbct_rc__deactivate_plugin($plugin = null){
1053
-
1054
- global $apbct;
1055
-
1056
- $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1057
-
1058
- if($plugin){
1059
-
1060
- // Switching complete deactivation for security
1061
- if($plugin == 'security-malware-firewall/security-malware-firewall.php' && !empty($_GET['complete_deactivation'])){
1062
- $spbc_settings = get_option('spbc_settings');
1063
- $spbc_settings['complete_deactivation'] = intval($_GET['complete_deactivation']);
1064
- update_option('spbc_settings', $spbc_settings);
1065
- }
1066
-
1067
- require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1068
-
1069
- if(is_plugin_active( $plugin )){
1070
- // Hook to set flag if the plugin is deactivated
1071
- add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1072
- deactivate_plugins($plugin, false, is_multisite() ? true : false);
1073
- }else{
1074
- $apbct->plugin_deactivated = true;
1075
- }
1076
-
1077
- // Hook to set flag if the plugin is deactivated
1078
- add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1079
- deactivate_plugins($plugin, false, is_multisite() ? true : false);
1080
-
1081
- if($apbct->plugin_deactivated){
1082
- die('OK');
1083
- }else
1084
- die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_ACTIVE')));
1085
- }else
1086
- die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1087
- }
1088
-
1089
-
1090
- /**
1091
- * Uninstall plugin from wordpress catalog
1092
- *
1093
- * @param null $plugin
1094
- */
1095
- function apbct_rc__uninstall_plugin($plugin = null){
1096
-
1097
- global $apbct;
1098
-
1099
- $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1100
-
1101
- if($plugin){
1102
-
1103
- // Switching complete deactivation for security
1104
- if($plugin == 'security-malware-firewall/security-malware-firewall.php' && !empty($_GET['complete_deactivation'])){
1105
- $spbc_settings = get_option('spbc_settings');
1106
- $spbc_settings['complete_deactivation'] = intval($_GET['complete_deactivation']);
1107
- update_option('spbc_settings', $spbc_settings);
1108
- }
1109
-
1110
- require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1111
-
1112
- if(is_plugin_active( $plugin )){
1113
- // Hook to set flag if the plugin is deactivated
1114
- add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1115
- deactivate_plugins($plugin, false, is_multisite() ? true : false);
1116
- }else{
1117
- $apbct->plugin_deactivated = true;
1118
- }
1119
-
1120
- if($apbct->plugin_deactivated){
1121
-
1122
- require_once (ABSPATH .'/wp-admin/includes/file.php');
1123
-
1124
- $result = delete_plugins(array($plugin));
1125
-
1126
- if($result && !is_wp_error($result)){
1127
- die('OK');
1128
- }else
1129
- die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_EXISTS', 'details' => (is_wp_error($result) ? ' '.$result->get_error_message() : ''))));
1130
- }else
1131
- die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_ACTIVE')));
1132
- }else
1133
- die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1134
- }
1135
-
1136
- function apbct_rc__uninstall_plugin__check_deactivate(){
1137
- global $apbct;
1138
- $apbct->plugin_deactivated = true;
1139
- }
1140
-
1141
- function apbct_rc__update(){
1142
-
1143
- //Upgrade params
1144
- $plugin = 'cleantalk-spam-protect/cleantalk.php';
1145
- $plugin_slug = 'cleantalk-spam-protect';
1146
- $title = __('Update Plugin');
1147
- $nonce = 'upgrade-plugin_' . $plugin;
1148
- $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
1149
-
1150
- $prev_version = APBCT_VERSION;
1151
-
1152
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1153
- include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1154
- include_once( ABSPATH . 'wp-admin/includes/file.php' );
1155
- include_once( ABSPATH . 'wp-admin/includes/misc.php' );
1156
-
1157
- include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
1158
- include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
1159
-
1160
- apbct_maintance_mode__enable( 30 );
1161
-
1162
- $upgrader = new CleantalkUpgrader( new CleantalkUpgraderSkin( compact('title', 'nonce', 'url', 'plugin') ) );
1163
- $upgrader->upgrade($plugin);
1164
-
1165
- apbct_maintance_mode__disable();
1166
-
1167
- $result = activate_plugins( $plugin );
1168
-
1169
- // Changing response UP_TO_DATE to OK
1170
- if($upgrader->apbct_result === 'UP_TO_DATE')
1171
- $upgrader->apbct_result = 'OK';
1172
-
1173
- if($upgrader->apbct_result === 'OK'){
1174
-
1175
- if(is_wp_error($result)){
1176
- die('FAIL '. json_encode(array('error' => 'COULD_NOT_ACTIVATE', 'wp_error' => $result->get_error_message())));
1177
- }
1178
-
1179
- $httpResponseCode = CleantalkHelper::http__request(get_option('siteurl'), array(), 'get_code');
1180
-
1181
- if( strpos($httpResponseCode, '200') === false ){
1182
-
1183
- apbct_maintance_mode__enable( 30 );
1184
-
1185
- // Rollback
1186
- $rollback = new CleantalkUpgrader( new CleantalkUpgraderSkin( compact('title', 'nonce', 'url', 'plugin_slug', 'prev_version') ) );
1187
- $rollback->rollback($plugin);
1188
-
1189
- apbct_maintance_mode__disable();
1190
-
1191
- $response = array(
1192
- 'error' => 'BAD_HTTP_CODE',
1193
- 'http_code' => $httpResponseCode,
1194
- 'output' => substr(file_get_contents(get_option('siteurl')), 0, 900),
1195
- 'rollback_result' => $rollback->apbct_result,
1196
- );
1197
-
1198
- die('FAIL '.json_encode($response));
1199
- }
1200
-
1201
- $plugin_data = get_plugin_data(__FILE__);
1202
- $apbct_agent = 'wordpress-'.str_replace('.', '', $plugin_data['Version']);
1203
- ct_send_feedback('0:' . $apbct_agent);
1204
-
1205
- die('OK '.json_encode(array('agent' => $apbct_agent)));
1206
-
1207
- }else{
1208
- die('FAIL '. json_encode(array('error' => $upgrader->apbct_result)));
1209
- }
1210
- }
1211
-
1212
- function apbct_rc__update_settings($source) {
1213
-
1214
- global $apbct;
1215
-
1216
- foreach($apbct->def_settings as $setting => $def_value){
1217
- if(array_key_exists($setting, $source)){
1218
- $var = $source[$setting];
1219
- $type = gettype($def_value);
1220
- settype($var, $type);
1221
- if($type == 'string')
1222
- $var = preg_replace(array('/=/', '/`/'), '', $var);
1223
- $apbct->settings[$setting] = $var;
1224
- }
1225
- }
1226
-
1227
- $apbct->save('settings');
1228
-
1229
- return true;
1230
- }
1231
-
1232
- function apbct_rc__insert_auth_key($key, $plugin){
1233
-
1234
- global $apbct;
1235
-
1236
- if($plugin === 'security-malware-firewall/security-malware-firewall.php'){
1237
-
1238
- require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1239
-
1240
- if(is_plugin_active( $plugin )){
1241
-
1242
- $key = trim($key);
1243
-
1244
- if($key && preg_match('/^[a-z\d]{3,15}$/', $key)){
1245
-
1246
- $result = CleantalkAPI::method__notice_paid_till(
1247
- $key,
1248
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1249
- 'antispam'
1250
- );
1251
-
1252
- if( empty( $result['error'] ) ) {
1253
-
1254
- if( $result['valid'] ){
1255
-
1256
- // Set account params
1257
- $data = get_option('spbc_data', array());
1258
- $data['user_token'] = $result['user_token'];
1259
- $data['notice_show'] = $result['show_notice'];
1260
- $data['notice_renew'] = $result['renew'];
1261
- $data['notice_trial'] = $result['trial'];
1262
- $data['auto_update_app'] = isset($result['show_auto_update_notice']) ? $result['show_auto_update_notice'] : 0;
1263
- $data['service_id'] = $result['service_id'];
1264
- $data['moderate'] = $result['moderate'];
1265
- $data['auto_update_app '] = isset($result['auto_update_app']) ? $result['auto_update_app'] : 0;
1266
- $data['license_trial'] = isset($result['license_trial']) ? $result['license_trial'] : 0;
1267
- $data['account_name_ob'] = isset($result['account_name_ob']) ? $result['account_name_ob'] : '';
1268
- $data['key_is_ok'] = true;
1269
- update_option('spbc_data', $data);
1270
-
1271
- // Set key
1272
- $settings = get_option('spbc_settings', array());
1273
- $settings['spbc_key'] = $key;
1274
- update_option('spbc_settings', $settings);
1275
-
1276
- return 'OK';
1277
- }else
1278
- return array('error' => 'KEY_IS_NOT_VALID');
1279
- }else
1280
- return array('error' => $result);
1281
- }else
1282
- return array('error' => 'KEY_IS_NOT_CORRECT');
1283
- }else
1284
- return array('error' => 'PLUGIN_IS_NOT_ACTIVE_OR_NOT_INSTALLED');
1285
- }else
1286
- return array('error' => 'PLUGIN_SLUG_INCORRECT');
1287
- }
1288
-
1289
- /**
1290
- * Putting Wordpress to maintenance mode.
1291
- * For given duration in seconds
1292
- *
1293
- * @param $duration
1294
- *
1295
- * @return bool
1296
- */
1297
- function apbct_maintance_mode__enable( $duration ) {
1298
- apbct_maintance_mode__disable();
1299
- $content = "<?php\n\n"
1300
- . '$upgrading = ' . (time() - ( 60 * 10 ) + $duration) . ';';
1301
-
1302
- return (bool)file_put_contents( ABSPATH . '.maintenance', $content );
1303
- }
1304
-
1305
- /**
1306
- * Disabling maintenance mode by deleting .maintenance file.
1307
- *
1308
- * @return void
1309
- */
1310
- function apbct_maintance_mode__disable() {
1311
- $maintenance_file = ABSPATH . '.maintenance';
1312
- if ( file_exists( $maintenance_file ) ) {
1313
- unlink( $maintenance_file );
1314
- }
1315
- }
1316
-
1317
- function cleantalk_get_brief_data(){
1318
-
1319
- global $apbct;
1320
-
1321
- $apbct->data['brief_data'] = CleantalkAPI::method__get_antispam_report_breif($apbct->api_key);
1322
- $apbct->saveData();
1323
-
1324
- return;
1325
- }
1326
-
1327
- //Delete cookie for admin trial notice
1328
- function apbct__hook__wp_logout__delete_trial_notice_cookie(){
1329
- if(!headers_sent())
1330
- setcookie('ct_trial_banner_closed', '', time()-3600);
1331
- }
1332
-
1333
- function apbct_alt_session__id__get(){
1334
- $id = CleantalkHelper::ip__get(array('real'))
1335
- .apbct_get_server_variable( 'HTTP_USER_AGENT' )
1336
- .apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
1337
- return hash('sha256', $id);
1338
- }
1339
-
1340
- function apbct_alt_sessions__remove_old(){
1341
- if(rand(0, 1000) < APBCT_SEESION__CHANCE_TO_CLEAN){
1342
- global $wpdb;
1343
- $wpdb->query(
1344
- 'DELETE
1345
- FROM `'. APBCT_TBL_SESSIONS .'`
1346
- WHERE last_update < NOW() - INTERVAL '. APBCT_SEESION__LIVE_TIME .' SECOND
1347
- LIMIT 100000;'
1348
- );
1349
- }
1350
- }
1351
-
1352
- function apbct_alt_session__save($name, $value){
1353
-
1354
- global $wpdb;
1355
-
1356
- $session_id = apbct_alt_session__id__get();
1357
-
1358
- $wpdb->query(
1359
- $wpdb->prepare(
1360
- 'INSERT INTO '. APBCT_TBL_SESSIONS .'
1361
- (id, name, value, last_update)
1362
- VALUES (%s, %s, %s, %s)
1363
- ON DUPLICATE KEY UPDATE
1364
- value = %s,
1365
- last_update = %s',
1366
- $session_id, $name, $value, date('Y-m-d H:i:s'), $value, date('Y-m-d H:i:s')
1367
- )
1368
- );
1369
-
1370
- }
1371
-
1372
- function apbct_alt_session__get($name){
1373
- global $wpdb;
1374
- $session_id = apbct_alt_session__id__get();
1375
- $result = $wpdb->get_row(
1376
- $wpdb->prepare(
1377
- 'SELECT value
1378
- FROM `'. APBCT_TBL_SESSIONS .'`
1379
- WHERE id = %s AND name = %s;',
1380
- $session_id, $name
1381
- ),
1382
- OBJECT
1383
- );
1384
-
1385
- $result = isset($result->value)
1386
- ? strpos($result->value, '{') === 0
1387
- ? (array)json_decode($result->value, true) // JSON
1388
- : $result->value
1389
- : false;
1390
-
1391
- return $result ? $result : null;
1392
- }
1393
-
1394
- function apbct_store__urls(){
1395
-
1396
- global $apbct;
1397
-
1398
- if($apbct->settings['store_urls'] && empty($apbct->flags__url_stored) && !headers_sent()){
1399
-
1400
- // URLs HISTORY
1401
- // Get current url
1402
- $current_url = apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' );
1403
-
1404
- $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1405
-
1406
- // Get already stored URLs
1407
- $urls = $apbct->settings['store_urls__sessions']
1408
- ? (array)apbct_alt_session__get('apbct_urls')
1409
- : (array)json_decode(filter_input(INPUT_COOKIE, 'apbct_urls'), true);
1410
-
1411
- $urls[$current_url][] = time();
1412
-
1413
- // Rotating. Saving only latest 10
1414
- $urls[$current_url] = count($urls[$current_url]) > 10 ? array_slice($urls[$current_url], 1, 10) : $urls[$current_url];
1415
- $urls = count($urls) > 10 ? array_slice($urls, 1, 10) : $urls;
1416
-
1417
- // Saving
1418
- $apbct->settings['store_urls__sessions']
1419
- ? apbct_alt_session__save('apbct_urls', json_encode($urls))
1420
- : setcookie('apbct_urls', json_encode($urls), time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1421
-
1422
- // REFERER
1423
- // Get current fererer
1424
- $new_site_referer = apbct_get_server_variable( 'HTTP_REFERER' );
1425
- $new_site_referer = $new_site_referer ? $new_site_referer : 'UNKNOWN';
1426
-
1427
- // Get already stored referer
1428
- $site_referer = $apbct->settings['store_urls__sessions']
1429
- ? apbct_alt_session__get('apbct_site_referer')
1430
- : filter_input(INPUT_COOKIE, 'apbct_site_referer');
1431
-
1432
- // Save if empty
1433
- if( !$site_referer || parse_url($new_site_referer, PHP_URL_HOST) !== apbct_get_server_variable( 'HTTP_HOST' ) ){
1434
-
1435
- $apbct->settings['store_urls__sessions']
1436
- ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
1437
- : setcookie('apbct_site_referer', $new_site_referer, time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1438
- }
1439
-
1440
- $apbct->flags__url_stored = true;
1441
-
1442
- }
1443
- }
1444
-
1445
- /*
1446
- * Set Cookies test for cookie test
1447
- * Sets cookies with pararms timestamp && landing_timestamp && pervious_referer
1448
- * Sets test cookie with all other cookies
1449
- */
1450
- function apbct_cookie(){
1451
-
1452
- global $apbct;
1453
-
1454
- if($apbct->settings['store_urls__sessions'] || $apbct->settings['set_cookies__sessions'])
1455
- apbct_alt_sessions__remove_old();
1456
-
1457
- if(
1458
- empty($apbct->settings['set_cookies']) || // Do not set cookies if option is disabled (for Varnish cache).
1459
- !empty($apbct->flags__cookies_setuped) || // Cookies already set
1460
- !empty($apbct->headers_sent) // Headers sent
1461
- )
1462
- return false;
1463
-
1464
- // Prevent headers sent error
1465
- if(headers_sent($file, $line)){
1466
- $apbct->headers_sent = true;
1467
- $apbct->headers_sent__hook = current_action();
1468
- $apbct->headers_sent__where = $file.':'.$line;
1469
- return false;
1470
- }
1471
-
1472
-
1473
- // Cookie names to validate
1474
- $cookie_test_value = array(
1475
- 'cookies_names' => array(),
1476
- 'check_value' => $apbct->api_key,
1477
- );
1478
-
1479
- $domain = parse_url(get_option('siteurl'),PHP_URL_HOST);
1480
-
1481
- // Submit time
1482
- if(empty($_POST['ct_multipage_form'])){ // Do not start/reset page timer if it is multipage form (Gravitiy forms))
1483
- $apbct_timestamp = time();
1484
- $apbct->settings['set_cookies__sessions']
1485
- ? apbct_alt_session__save('apbct_timestamp', $apbct_timestamp)
1486
- : setcookie('apbct_timestamp', $apbct_timestamp, 0, '/', $domain, false, true);
1487
- $cookie_test_value['cookies_names'][] = 'apbct_timestamp';
1488
- $cookie_test_value['check_value'] .= $apbct_timestamp;
1489
- }
1490
-
1491
- // Pervious referer
1492
- if(apbct_get_server_variable( 'HTTP_REFERER' )){
1493
- $apbct->settings['set_cookies__sessions']
1494
- ? apbct_alt_session__save('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ))
1495
- : setcookie('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ), 0, '/', $domain, false, true);
1496
- $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1497
- $cookie_test_value['check_value'] .= apbct_get_server_variable( 'HTTP_REFERER' );
1498
- }
1499
-
1500
- // Landing time
1501
- $site_landing_timestamp = $apbct->settings['set_cookies__sessions']
1502
- ? apbct_alt_session__get('apbct_site_landing_ts')
1503
- : filter_input(INPUT_COOKIE, 'apbct_site_landing_ts');
1504
- if(!$site_landing_timestamp){
1505
- $site_landing_timestamp = time();
1506
- $apbct->settings['set_cookies__sessions']
1507
- ? apbct_alt_session__save('apbct_site_landing_ts', $site_landing_timestamp)
1508
- : setcookie('apbct_site_landing_ts', $site_landing_timestamp, 0, '/', $domain, false, true);
1509
- }
1510
- $cookie_test_value['cookies_names'][] = 'apbct_site_landing_ts';
1511
- $cookie_test_value['check_value'] .= $site_landing_timestamp;
1512
-
1513
- // Page hits
1514
- // Get
1515
- $page_hits = $apbct->settings['set_cookies__sessions']
1516
- ? apbct_alt_session__get('apbct_page_hits')
1517
- : filter_input(INPUT_COOKIE, 'apbct_page_hits');
1518
- // Set / Increase
1519
- $page_hits = intval($page_hits) ? $page_hits + 1 : 1;
1520
-
1521
- $apbct->settings['set_cookies__sessions']
1522
- ? apbct_alt_session__save('apbct_page_hits', $page_hits)
1523
- : setcookie('apbct_page_hits', $page_hits, 0, '/', $domain, false, true);
1524
-
1525
- $cookie_test_value['cookies_names'][] = 'apbct_page_hits';
1526
- $cookie_test_value['check_value'] .= $page_hits;
1527
-
1528
- // Cookies test
1529
- $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
1530
- if(!$apbct->settings['set_cookies__sessions'])
1531
- setcookie('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/', $domain, false, true);
1532
-
1533
- $apbct->flags__cookies_setuped = true;
1534
-
1535
- }
1536
-
1537
- /**
1538
- * Cookies test for sender
1539
- * Also checks for valid timestamp in $_COOKIE['apbct_timestamp'] and other apbct_ COOKIES
1540
- * @return null|0|1;
1541
- */
1542
- function apbct_cookies_test()
1543
- {
1544
- global $apbct;
1545
-
1546
- if($apbct->settings['set_cookies__sessions'])
1547
- return 1;
1548
-
1549
- if(isset($_COOKIE['apbct_cookies_test'])){
1550
-
1551
- $cookie_test = json_decode(urldecode($_COOKIE['apbct_cookies_test']),true);
1552
-
1553
- if(!is_array($cookie_test))
1554
- return 0;
1555
-
1556
- $check_srting = $apbct->api_key;
1557
- foreach($cookie_test['cookies_names'] as $cookie_name){
1558
- $check_srting .= isset($_COOKIE[$cookie_name]) ? $_COOKIE[$cookie_name] : '';
1559
- } unset($cookie_name);
1560
-
1561
- if($cookie_test['check_value'] == md5($check_srting)){
1562
- return 1;
1563
- }else{
1564
- return 0;
1565
- }
1566
- }else{
1567
- return null;
1568
- }
1569
- }
1570
-
1571
- function apbct_cookies__delete($cookie){
1572
- if(isset($_COOKIE[$cookie]))
1573
- setcookie($cookie, '', time()-3600);
1574
- }
1575
-
1576
- function apbct_cookies__delete_all(){
1577
- if(count($_COOKIE)){
1578
- foreach($_COOKIE as $key => $val){
1579
- if(preg_match("/apbct_|ct_/", $key)){
1580
- setcookie($key, '', time()-3600);
1581
- }
1582
- } unset($key, $val);
1583
- }
1584
- return false;
1585
- }
1586
-
1587
- /**
1588
- * Gets submit time
1589
- * Uses Cookies with check via apbct_cookies_test()
1590
- * @return null|int;
1591
- */
1592
- function apbct_get_submit_time()
1593
- {
1594
- global $apbct;
1595
- $apbct_timestamp = $apbct->settings['set_cookies__sessions']
1596
- ? apbct_alt_session__get('apbct_timestamp')
1597
- : filter_input(INPUT_COOKIE, 'apbct_timestamp');
1598
- return apbct_cookies_test() == 1 ? time() - (int)$apbct_timestamp : null;
1599
- }
1600
-
1601
- /*
1602
- * Inner function - Account status check
1603
- * Scheduled in 1800 seconds for default!
1604
- */
1605
- function ct_account_status_check($api_key = null, $process_errors = true){
1606
-
1607
- global $apbct;
1608
-
1609
- $api_key = $api_key ? $api_key : $apbct->api_key;
1610
- $result = CleantalkAPI::method__notice_paid_till(
1611
- $api_key,
1612
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
1613
- 'antispam'
1614
- );
1615
-
1616
- if(empty($result['error']) || !empty($result['valid'])){
1617
-
1618
- // Notices
1619
- $apbct->data['notice_show'] = isset($result['show_notice']) ? (int)$result['show_notice'] : 0;
1620
- $apbct->data['notice_renew'] = isset($result['renew']) ? (int)$result['renew'] : 0;
1621
- $apbct->data['notice_trial'] = isset($result['trial']) ? (int)$result['trial'] : 0;
1622
- $apbct->data['notice_review'] = isset($result['show_review']) ? (int)$result['show_review'] : 0;
1623
- $apbct->data['notice_auto_update'] = isset($result['show_auto_update_notice']) ? (int)$result['show_auto_update_notice'] : 0;
1624
-
1625
- // Other
1626
- $apbct->data['service_id'] = isset($result['service_id']) ? (int)$result['service_id'] : 0;
1627
- $apbct->data['valid'] = isset($result['valid']) ? (int)$result['valid'] : 0;
1628
- $apbct->data['moderate'] = isset($result['moderate']) ? (int)$result['moderate'] : 0;
1629
- $apbct->data['ip_license'] = isset($result['ip_license']) ? (int)$result['ip_license'] : 0;
1630
- $apbct->data['moderate_ip'] = isset($result['moderate_ip'], $result['ip_license']) ? (int)$result['moderate_ip'] : 0;
1631
- $apbct->data['spam_count'] = isset($result['spam_count']) ? (int)$result['spam_count'] : 0;
1632
- $apbct->data['auto_update'] = isset($result['auto_update_app']) ? (int)$result['auto_update_app'] : 0;
1633
- $apbct->data['user_token'] = isset($result['user_token']) ? (string)$result['user_token'] : '';
1634
- $apbct->data['license_trial'] = isset($result['license_trial']) ? (int)$result['license_trial'] : 0;
1635
- $apbct->data['account_name_ob'] = isset($result['account_name_ob']) ? (string)$result['account_name_ob'] : '';
1636
-
1637
- if($apbct->data['notice_show'] == 1 && $apbct->data['notice_trial'] == 1)
1638
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
1639
-
1640
- if($apbct->data['notice_show'] == 1 && $apbct->data['notice_renew'] == 1)
1641
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 1800);
1642
-
1643
- if($apbct->data['notice_show'] == 0)
1644
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
1645
-
1646
- $apbct->error_delete('account_check', 'save');
1647
-
1648
- $apbct->saveData();
1649
-
1650
- }elseif($process_errors){
1651
- $apbct->error_add('account_check', $result);
1652
- }
1653
-
1654
- if(!empty($result['valid'])){
1655
- $apbct->data['key_is_ok'] = true;
1656
- $result = true;
1657
- }else{
1658
- $apbct->data['key_is_ok'] = false;
1659
- $result = false;
1660
- }
1661
-
1662
- return $result;
1663
- }
1664
-
1665
- function ct_mail_send_connection_report() {
1666
-
1667
- global $apbct;
1668
-
1669
- if (($apbct->settings['send_connection_reports'] == 1 && $apbct->connection_reports['negative'] > 0) || !empty($_GET['ct_send_connection_report']))
1670
- {
1671
- $to = "welcome@cleantalk.org" ;
1672
- $subject = "Connection report for " . apbct_get_server_variable( 'HTTP_HOST' );
1673
- $message = '
1674
- <html>
1675
- <head>
1676
- <title></title>
1677
- </head>
1678
- <body>
1679
- <p>From '.$apbct->connection_reports['since'].' to '.date('d M').' has been made '.($apbct->connection_reports['success']+$apbct->connection_reports['negative']).' calls, where '.$apbct->connection_reports['success'].' were success and '.$apbct->connection_reports['negative'].' were negative</p>
1680
- <p>Negative report:</p>
1681
- <table> <tr>
1682
- <td>&nbsp;</td>
1683
- <td><b>Date</b></td>
1684
- <td><b>Page URL</b></td>
1685
- <td><b>Library report</b></td>
1686
- <td><b>Server IP</b></td>
1687
- </tr>
1688
- ';
1689
- foreach ($apbct->connection_reports['negative_report'] as $key => $report)
1690
- {
1691
- $message.= '<tr>'
1692
- . '<td>'.($key+1).'.</td>'
1693
- . '<td>'.$report['date'].'</td>'
1694
- . '<td>'.$report['page_url'].'</td>'
1695
- . '<td>'.$report['lib_report'].'</td>'
1696
- . '<td>'.$report['work_url'].'</td>'
1697
- . '</tr>';
1698
- }
1699
- $message.='</table></body></html>';
1700
-
1701
- $headers = 'Content-type: text/html; charset=windows-1251 \r\n';
1702
- $headers .= 'From: '.get_option('admin_email');
1703
- mail($to, $subject, $message, $headers);
1704
- }
1705
-
1706
- $apbct->data['connection_reports'] = $apbct->def_data['connection_reports'];
1707
- $apbct->data['connection_reports']['since'] = date('d M');
1708
- $apbct->saveData();
1709
- }
1710
-
1711
- //* Write $message to the plugin's debug option
1712
- function apbct_log($message = 'empty', $func = null, $params = array())
1713
- {
1714
- global $apbct;
1715
-
1716
- $debug = get_option( APBCT_DEBUG );
1717
-
1718
- $function = $func ? $func : '';
1719
- $cron = in_array('cron', $params) ? true : false;
1720
- $data = in_array('data', $params) ? true : false;
1721
- $settings = in_array('settings', $params) ? true : false;
1722
-
1723
- if(is_array($message) or is_object($message))
1724
- $message = print_r($message, true);
1725
-
1726
- if($message) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func)] = $message;
1727
- if($cron) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_cron'] = $apbct->cron;
1728
- if($data) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_data'] = $apbct->data;
1729
- if($settings) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_settings'] = $apbct->settings;
1730
-
1731
- update_option(APBCT_DEBUG, $debug);
1732
- }
1733
-
1734
- function apbct_sfw__delete_tables( $blog_id, $drop ) {
1735
-
1736
- global $wpdb;
1737
-
1738
- $initial_blog = get_current_blog_id();
1739
-
1740
- switch_to_blog($blog_id);
1741
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw`;'); // Deleting SFW data
1742
- $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
1743
-
1744
- switch_to_blog($initial_blog);
1745
- }
1746
-
1747
- /**
1748
- * Is enable for user group
1749
- *
1750
- * @param WP_User $user
1751
- *
1752
- * @return boolean
1753
- */
1754
- function apbct_is_user_enable($user = null) {
1755
-
1756
- global $current_user;
1757
-
1758
- $user = !empty($user) ? $user : $current_user;
1759
-
1760
- return apbct_is_user_role_in(array('administrator', 'editor', 'author'), $user)
1761
- ? false
1762
- : true;
1763
- }
1764
-
1765
- /**
1766
- * Checks if the current user has role
1767
- *
1768
- * @param array $roles array of strings
1769
- * @param int|string|WP_User|mixed $user User ID to check|user_login|WP_User
1770
- *
1771
- * @return boolean Does the user has this role|roles
1772
- */
1773
- function apbct_is_user_role_in( $roles, $user = false ){
1774
-
1775
- if( is_numeric($user) && function_exists('get_userdata')) $user = get_userdata( $user );
1776
- if( is_string($user) && function_exists('get_user_by')) $user = get_user_by('login', $user );
1777
- if( ! $user && function_exists('wp_get_current_user')) $user = wp_get_current_user();
1778
- if( ! $user ) $user = apbct_wp_get_current_user();
1779
-
1780
- if( empty($user->ID) )
1781
- return false;
1782
-
1783
- foreach( (array) $roles as $role ){
1784
- if( isset($user->caps[ strtolower($role) ]) || in_array(strtolower($role), $user->roles) )
1785
- return true;
1786
- }
1787
-
1788
- return false;
1789
- }
1790
-
1791
- /**
1792
- * Update and rotate statistics with requests exection time
1793
- *
1794
- * @param $exec_time
1795
- */
1796
- function apbct_statistics__rotate($exec_time){
1797
-
1798
- global $apbct;
1799
-
1800
- // Delete old stats
1801
- if(min(array_keys($apbct->stats['requests'])) < time() - (86400 * 7))
1802
- unset($apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]);
1803
-
1804
- // Create new if newest older than 1 day
1805
- if(empty($apbct->stats['requests']) || max(array_keys($apbct->stats['requests'])) < time() - (86400 * 1))
1806
- $apbct->stats['requests'][time()] = array('amount' => 0, 'average_time' => 0);
1807
-
1808
- // Update all existing stats
1809
- foreach($apbct->stats['requests'] as &$weak_stat){
1810
- $weak_stat['average_time'] = ($weak_stat['average_time'] * $weak_stat['amount'] + $exec_time) / ++$weak_stat['amount'];
1811
- }
1812
-
1813
- $apbct->save('stats');
1814
- }
1815
-
1816
- /**
1817
- * Runs update actions for new version.
1818
- *
1819
- * @global CleantalkState $apbct
1820
- */
1821
- function apbct_update_actions(){
1822
-
1823
- global $apbct;
1824
-
1825
- // Update logic
1826
- if($apbct->plugin_version != APBCT_VERSION){
1827
-
1828
- // Main blog
1829
- if(is_main_site()){
1830
-
1831
- require_once(CLEANTALK_PLUGIN_DIR.'inc/cleantalk-updater.php');
1832
-
1833
- $result = apbct_run_update_actions($apbct->plugin_version, APBCT_VERSION);
1834
-
1835
- //If update is successfull
1836
- if($result === true)
1837
- apbct_update__set_version__from_plugin('from_plugin');
1838
-
1839
- ct_send_feedback('0:' . APBCT_AGENT ); // Send feedback to let cloud know about updated version.
1840
-
1841
- // Side blogs
1842
- }else{
1843
- apbct_update__set_version__from_plugin('from_plugin');
1844
- }
1845
- }
1846
-
1847
- }
1848
-
1849
- /**
1850
- * Set version of plugin in database
1851
- *
1852
- * @param string $ver
1853
- *
1854
- * @return bool
1855
- * @global CleantalkState $apbct
1856
- *
1857
- */
1858
- function apbct_update__set_version__from_plugin($ver){
1859
- global $apbct;
1860
- switch (true){
1861
- case $ver === 'from_plugin':
1862
- $apbct->data['plugin_version'] = APBCT_VERSION;
1863
- break;
1864
- case preg_match('/^\d+\.\d+(\.\d+)?(-[a-zA-Z0-9-_]+)?$/', $ver) === 1;
1865
- $apbct->data['plugin_version'] = $ver;
1866
- break;
1867
- default:
1868
- return false;
1869
- break;
1870
- }
1871
- $apbct->saveData();
1872
- return true;
1873
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Anti-Spam by CleanTalk
4
+ Plugin URI: http://cleantalk.org
5
+ Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.130.1
7
+ Author: СleanTalk <welcome@cleantalk.org>
8
+ Author URI: http://cleantalk.org
9
+ Text Domain: cleantalk
10
+ Domain Path: /i18n
11
+ */
12
+
13
+ $cleantalk_executed = false;
14
+
15
+ // Getting version form main file (look above)
16
+ $plugin_info = get_file_data(__FILE__, array('Version' => 'Version', 'Name' => 'Plugin Name',));
17
+
18
+ // Common params
19
+ define('APBCT_NAME', $plugin_info['Name']);
20
+ define('APBCT_VERSION', $plugin_info['Version']);
21
+ define('APBCT_URL_PATH', plugins_url('', __FILE__)); //HTTP path. Plugin root folder without '/'.
22
+ define('APBCT_DIR_PATH', dirname(__FILE__ ) . '/'); //System path. Plugin root folder with '/'.
23
+ define('APBCT_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); //Plugin base name.
24
+ define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt') ? ABSPATH . WPINC . '/certificates/ca-bundle.crt' : ''); // SSL Serttificate path
25
+
26
+ // API params
27
+ define('APBCT_AGENT', 'wordpress-'.str_replace('.', '', $plugin_info['Version']));
28
+ define('APBCT_MODERATE_URL', 'http://moderate.cleantalk.org'); //Api URL
29
+
30
+ // Option names
31
+ define('APBCT_DATA', 'cleantalk_data'); //Option name with different plugin data.
32
+ define('APBCT_SETTINGS', 'cleantalk_settings'); //Option name with plugin settings.
33
+ define('APBCT_NETWORK_SETTINGS', 'cleantalk_network_settings'); //Option name with plugin network settings.
34
+ define('APBCT_DEBUG', 'cleantalk_debug'); //Option name with a debug data. Empty by default.
35
+
36
+ // Multisite
37
+ define('APBCT_WPMS', (is_multisite() ? true : false)); // WMPS is enabled
38
+
39
+ // Sessions
40
+ define('APBCT_SEESION__LIVE_TIME', 86400*2);
41
+ define('APBCT_SEESION__CHANCE_TO_CLEAN', 100);
42
+
43
+ // Different params
44
+ define('APBCT_REMOTE_CALL_SLEEP', 5); // Minimum time between remote call
45
+
46
+ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
47
+
48
+ define('CLEANTALK_PLUGIN_DIR', dirname(__FILE__ ) . '/');
49
+
50
+ // PHP functions patches
51
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/cleantalk-php-patch.php'); // Pathces fpr different functions which not exists
52
+
53
+ // Base classes
54
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/API.php'); // API
55
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/DB.php'); // Database driver
56
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/Helper.php'); // Helper
57
+ include_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Antispam/SFW.php'); // SpamFireWall
58
+ include_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/Arr.php'); // Array functions
59
+
60
+ // Child classes
61
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkAPI.php'); // API for Wordpress
62
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkDB.php'); // Database class for Wordpress
63
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkHelper.php'); // Helper for Worpdress
64
+ include_once(CLEANTALK_PLUGIN_DIR . "lib/CleantalkSFW.php"); // SpamFireWall for Wordpress
65
+
66
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk.php'); // Main class for request
67
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkRequest.php'); // Holds request data
68
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkResponse.php'); // Holds response data
69
+
70
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkCron.php'); // Cron handling
71
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkState.php'); // State class
72
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-pluggable.php'); // Pluggable functions
73
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
74
+
75
+ // Global ArrayObject with settings and other global varables
76
+ global $apbct;
77
+ $apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors', 'remote_calls', 'stats'));
78
+
79
+ $apbct->base_name = 'cleantalk-spam-protect/cleantalk.php';
80
+
81
+ $apbct->logo = plugin_dir_url(__FILE__) . 'inc/images/logo.png';
82
+ $apbct->logo__small = plugin_dir_url(__FILE__) . 'inc/images/logo_small.png';
83
+ $apbct->logo__small__colored = plugin_dir_url(__FILE__) . 'inc/images/logo_color.png';
84
+
85
+ // Customize CleantalkState
86
+ // Account status
87
+
88
+ $apbct->white_label = $apbct->network_settings['white_label'];
89
+ $apbct->allow_custom_key = $apbct->network_settings['allow_custom_key'];
90
+ $apbct->plugin_name = $apbct->network_settings['white_label__plugin_name'] ? $apbct->network_settings['white_label__plugin_name'] : APBCT_NAME;
91
+ $apbct->api_key = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->settings['apikey'] : $apbct->network_settings['apikey'];
92
+ $apbct->key_is_ok = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['key_is_ok'] : $apbct->network_data['key_is_ok'];
93
+ $apbct->moderate = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['moderate'] : $apbct->network_data['moderate'];
94
+
95
+ $apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
96
+ $apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
97
+
98
+ $apbct->settings_link = is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk';
99
+
100
+ if(!$apbct->white_label){
101
+ require_once( CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
102
+ }
103
+
104
+ // Passing JS key to frontend
105
+ add_action('wp_ajax_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
106
+ add_action('wp_ajax_nopriv_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
107
+
108
+ // Database prefix
109
+ global $wpdb;
110
+ $apbct->db_prefix = !APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $wpdb->prefix : $wpdb->base_prefix;
111
+ $apbct->db_prefix = !$apbct->white_label && defined('CLEANTALK_ACCESS_KEY') ? $wpdb->base_prefix : $wpdb->prefix;
112
+ // Database constants
113
+ define('APBCT_TBL_FIREWALL_DATA', $apbct->db_prefix . 'cleantalk_sfw'); // Table with firewall data.
114
+ define('APBCT_TBL_FIREWALL_LOG', $apbct->db_prefix . 'cleantalk_sfw_logs'); // Table with firewall logs.
115
+ define('APBCT_TBL_SESSIONS', $apbct->db_prefix . 'cleantalk_sessions'); // Table with session data.
116
+ define('APBCT_SELECT_LIMIT', 5000); // Select limit for logs.
117
+ define('APBCT_WRITE_LIMIT', 5000); // Write limit for firewall data.
118
+
119
+ /** @todo HARDCODE FIX */
120
+ if($apbct->plugin_version === '1.0.0')
121
+ $apbct->plugin_version = '5.100';
122
+
123
+ // Do update actions if version is changed
124
+ apbct_update_actions();
125
+
126
+ // Self cron
127
+ if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
128
+
129
+ $ct_cron = new CleantalkCron();
130
+ $ct_cron->checkTasks();
131
+
132
+ if(!empty($ct_cron->tasks_to_run)){
133
+
134
+ define('CT_CRON', true); // Letting know functions that they are running under CT_CRON
135
+ $ct_cron->runTasks();
136
+ unset($ct_cron);
137
+
138
+ }
139
+ }
140
+
141
+ //Delete cookie for admin trial notice
142
+ add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
143
+
144
+ // Set cookie only for public pages and for non-AJAX requests
145
+ if (!is_admin() && !apbct_is_ajax() && !defined('DOING_CRON')
146
+ && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
147
+ && empty($_GET['ct_checkjs_search_default']) // Search form fix
148
+ && empty($_POST['action']) //bbPress
149
+ ){
150
+ add_action('template_redirect','apbct_cookie', 2);
151
+ add_action('template_redirect','apbct_store__urls', 2);
152
+ if (empty($_POST) && empty($_GET)){
153
+ apbct_cookie();
154
+ apbct_store__urls();
155
+ }
156
+ }
157
+
158
+ // Early checks
159
+
160
+ // Iphorm
161
+ if( isset( $_POST['iphorm_ajax'], $_POST['iphorm_id'], $_POST['iphorm_uid'] ) ){
162
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
163
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
164
+ ct_ajax_hook();
165
+ }
166
+
167
+ // Facebook
168
+ if ($apbct->settings['general_contact_forms_test'] == 1
169
+ && (!empty($_POST['action']) && $_POST['action'] == 'fb_intialize')
170
+ && !empty($_POST['FB_userdata'])
171
+ ){
172
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
173
+ if (apbct_is_user_enable()){
174
+ $ct_check_post_result=false;
175
+ ct_registration_errors(null);
176
+ }
177
+
178
+ }
179
+
180
+ // Ninja Forms. Making GET action to POST action
181
+ if( apbct_is_in_uri( 'admin-ajax.php' ) && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit' )
182
+ $_POST['action']='ninja_forms_ajax_submit';
183
+
184
+ add_action( 'wp_ajax_nopriv_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
185
+ add_action( 'wp_ajax_ninja_forms_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
186
+ add_action( 'wp_ajax_nopriv_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
187
+ add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
188
+ add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
189
+
190
+ // SeedProd Coming Soon Page Pro integration
191
+ add_action( 'wp_ajax_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
192
+ add_action( 'wp_ajax_nopriv_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
193
+ add_action( 'wp_ajax_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
194
+ add_action( 'wp_ajax_nopriv_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
195
+
196
+ // The 7 theme contact form integration
197
+ add_action( 'wp_ajax_nopriv_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
198
+ add_action( 'wp_ajax_dt_send_mail', 'apbct_form__the7_contact_form', 1 );
199
+
200
+ // Elementor Pro page builder forms
201
+ add_action( 'wp_ajax_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
202
+ add_action( 'wp_ajax_nopriv_elementor_pro_forms_send_form', 'apbct_form__elementor_pro__testSpam' );
203
+
204
+ // Custom register form (ticket_id=13668)
205
+ add_action('website_neotrends_signup_fields_check',function( $username, $fields ){
206
+ $ip = CleantalkHelper::ip__get( array('real'), false );
207
+ $ct_result = ct_test_registration( $username, $fields['email'], $ip );
208
+ if( $ct_result['allow'] == 0 ) {
209
+ ct_die_extended( $ct_result['comment'] );
210
+ }
211
+ }, 1, 2);
212
+
213
+ // Public actions
214
+ if(!is_admin() && !apbct_is_ajax()){
215
+
216
+ // Default search
217
+ //add_filter( 'get_search_form', 'apbct_forms__search__addField' );
218
+ add_filter( 'get_search_query', 'apbct_forms__search__testSpam' );
219
+
220
+ // Remote calls
221
+ if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) && in_array($_GET['plugin_name'], array('antispam','anti-spam', 'apbct'))){
222
+ apbct_remote_call__perform();
223
+ }
224
+
225
+ // SpamFireWall check
226
+ if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
227
+ $apbct->settings['spam_firewall'] == 1 &&
228
+ apbct_is_get() &&
229
+ ! wp_doing_cron()
230
+ ){
231
+ apbct_sfw__check();
232
+ }
233
+
234
+ }
235
+
236
+
237
+ // Activation/deactivation functions must be in main plugin file.
238
+ // http://codex.wordpress.org/Function_Reference/register_activation_hook
239
+ register_activation_hook( __FILE__, 'apbct_activation' );
240
+ register_deactivation_hook( __FILE__, 'apbct_deactivation' );
241
+
242
+ // Hook for newly added blog
243
+ add_action('wpmu_new_blog', 'apbct_activation__new_blog', 10, 6);
244
+
245
+ // Async loading for JavaScript
246
+ add_filter('script_loader_tag', 'apbct_add_async_attribute', 10, 3);
247
+
248
+ // Redirect admin to plugin settings.
249
+ if(!defined('WP_ALLOW_MULTISITE') || defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE == false)
250
+ add_action('admin_init', 'apbct_plugin_redirect');
251
+
252
+ // Deleting SFW tables when deleting websites
253
+ if(defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE === true)
254
+ add_action( 'delete_blog', 'apbct_sfw__delete_tables', 10, 2 );
255
+
256
+ // After plugin loaded - to load locale as described in manual
257
+ add_action('plugins_loaded', 'apbct_plugin_loaded' );
258
+
259
+ if( !empty($apbct->settings['use_ajax']) &&
260
+ ! apbct_is_in_uri( '.xml' ) &&
261
+ ! apbct_is_in_uri( '.xsl' ) )
262
+ {
263
+ add_action( 'wp_ajax_nopriv_ct_get_cookie', 'ct_get_cookie',1 );
264
+ add_action( 'wp_ajax_ct_get_cookie', 'ct_get_cookie',1 );
265
+ }
266
+
267
+ // Admin panel actions
268
+ if (is_admin() || is_network_admin()){
269
+
270
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-comments.php');
271
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-users.php');
272
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-admin.php');
273
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-settings.php');
274
+
275
+ if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)){
276
+
277
+ add_action('admin_enqueue_scripts', 'apbct_admin__enqueue_scripts');
278
+
279
+ add_action('admin_init', 'apbct_admin__init', 1);
280
+ add_action('admin_menu', 'apbct_settings_add_page');
281
+ add_action('network_admin_menu', 'apbct_settings_add_page');
282
+ add_action('admin_notices', 'apbct_admin__notice_message');
283
+ add_action('network_admin_notices', 'apbct_admin__notice_message');
284
+
285
+ //Show widget only if not IP license
286
+ if(!$apbct->moderate_ip)
287
+ add_action('wp_dashboard_setup', 'ct_dashboard_statistics_widget' );
288
+ }
289
+
290
+ if(apbct_is_ajax() || isset($_POST['cma-action'])){
291
+
292
+ $cleantalk_hooked_actions = array();
293
+ $cleantalk_ajax_actions_to_check = array();
294
+
295
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
296
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
297
+
298
+ // Feedback for comments
299
+ if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_comment'){
300
+ add_action( 'wp_ajax_nopriv_ct_feedback_comment', 'apbct_comment__send_feedback',1 );
301
+ add_action( 'wp_ajax_ct_feedback_comment', 'apbct_comment__send_feedback',1 );
302
+ }
303
+ if(isset($_POST['action']) && $_POST['action'] == 'ct_feedback_user'){
304
+ add_action( 'wp_ajax_nopriv_ct_feedback_user', 'apbct_user__send_feedback',1 );
305
+ add_action( 'wp_ajax_ct_feedback_user', 'apbct_user__send_feedback',1 );
306
+ }
307
+
308
+ // Check AJAX requests
309
+ // if User is not logged in
310
+ // if Unknown action or Known action with mandatory check
311
+ if( (!apbct_is_user_logged_in() || $apbct->settings['protect_logged_in'] == 1) &&
312
+ isset($_POST['action']) && (!in_array($_POST['action'], $cleantalk_hooked_actions) || in_array($_POST['action'], $cleantalk_ajax_actions_to_check))
313
+ ){
314
+ ct_ajax_hook();
315
+ }
316
+
317
+ //QAEngine Theme answers
318
+ if (intval($apbct->settings['general_contact_forms_test']))
319
+ add_filter('et_pre_insert_question', 'ct_ajax_hook', 1, 1); // Questions
320
+ add_filter('et_pre_insert_answer', 'ct_ajax_hook', 1, 1); // Answers
321
+
322
+ // Formidable
323
+ add_filter( 'frm_entries_before_create', 'apbct_rorm__formidable__testSpam', 10, 2 );
324
+ add_action( 'frm_entries_footer_scripts', 'apbct_rorm__formidable__footerScripts', 20, 2 );
325
+
326
+ // Some of plugins to register a users use AJAX context.
327
+ add_filter('registration_errors', 'ct_registration_errors', 1, 3);
328
+ add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
329
+ add_action('user_register', 'apbct_user_register');
330
+
331
+ if(class_exists('BuddyPress')){
332
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
333
+ add_filter('bp_activity_is_spam_before_save', 'apbct_integration__buddyPres__activityWall', 999 ,2); /* ActivityWall */
334
+ add_action('bp_locate_template', 'apbct_integration__buddyPres__getTemplateName', 10, 6);
335
+ }
336
+
337
+ }
338
+
339
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
340
+ //Bitrix24 contact form
341
+ if ($apbct->settings['general_contact_forms_test'] == 1 &&
342
+ !empty($_POST['your-phone']) &&
343
+ !empty($_POST['your-email']) &&
344
+ !empty($_POST['your-message'])
345
+ ){
346
+ $ct_check_post_result=false;
347
+ ct_contact_form_validate();
348
+ }
349
+
350
+ // Sends feedback to the cloud about comments
351
+ // add_action('wp_set_comment_status', 'ct_comment_send_feedback', 10, 2);
352
+
353
+ // Sends feedback to the cloud about deleted users
354
+ global $pagenow;
355
+ if($pagenow=='users.php')
356
+ add_action('delete_user', 'apbct_user__delete__hook', 10, 2);
357
+
358
+ if( $pagenow=='plugins.php' || apbct_is_in_uri( 'plugins.php' ) ){
359
+
360
+ add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
361
+ add_filter('network_admin_plugin_action_links_'.plugin_basename(__FILE__), 'apbct_admin__plugin_action_links', 10, 2);
362
+
363
+ add_filter('plugin_row_meta', 'apbct_admin__register_plugin_links', 10, 2);
364
+ }
365
+
366
+ // Public pages actions
367
+ }else{
368
+
369
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
370
+
371
+ add_action('wp_enqueue_scripts', 'ct_enqueue_scripts_public');
372
+
373
+ // Init action.
374
+ add_action('plugins_loaded', 'apbct_init', 1);
375
+
376
+ // Comments
377
+ add_filter('preprocess_comment', 'ct_preprocess_comment', 1, 1); // param - comment data array
378
+ add_filter('comment_text', 'ct_comment_text' );
379
+ add_filter('wp_die_handler', 'apbct_comment__sanitize_data__before_wp_die', 1); // Check comments after validation
380
+
381
+ // Registrations
382
+ if(!isset($_POST['wp-submit'])){
383
+ add_action('login_form_register', 'apbct_cookie');
384
+ add_action('login_form_register', 'apbct_store__urls');
385
+ }
386
+ add_action('login_enqueue_scripts', 'apbct_login__scripts');
387
+ add_action('register_form', 'ct_register_form');
388
+ add_filter('registration_errors', 'ct_registration_errors', 1, 3);
389
+ add_filter('registration_errors', 'ct_check_registration_erros', 999999, 3);
390
+ add_action('user_register', 'apbct_user_register');
391
+
392
+ // Multisite registrations
393
+ add_action('signup_extra_fields','ct_register_form');
394
+ add_filter('wpmu_validate_user_signup', 'ct_registration_errors_wpmu', 10, 3);
395
+
396
+ // Login form - for notifications only
397
+ add_filter('login_message', 'ct_login_message');
398
+
399
+ // Comments output hook
400
+ add_filter('wp_list_comments_args', 'ct_wp_list_comments_args');
401
+
402
+ // Ait-Themes fix
403
+ if(isset($_GET['ait-action']) && $_GET['ait-action']=='register'){
404
+ $tmp=$_POST['redirect_to'];
405
+ unset($_POST['redirect_to']);
406
+ ct_contact_form_validate();
407
+ $_POST['redirect_to']=$tmp;
408
+ }
409
+ }
410
+
411
+ // Short code for GDPR
412
+ if($apbct->settings['gdpr_enabled'])
413
+ add_shortcode('cleantalk_gdpr_form', 'apbct_shrotcode_handler__GDPR_public_notice__form');
414
+
415
+ }
416
+
417
+ /**
418
+ * Function preforms remote call
419
+ */
420
+ function apbct_remote_call__perform()
421
+ {
422
+ global $apbct;
423
+
424
+ $remote_action = $_GET['spbc_remote_call_action'];
425
+
426
+ if(array_key_exists($remote_action, $apbct->remote_calls)){
427
+
428
+ if(time() - $apbct->remote_calls[$remote_action]['last_call'] > APBCT_REMOTE_CALL_SLEEP){
429
+
430
+ $apbct->remote_calls[$remote_action]['last_call'] = time();
431
+ $apbct->save('remote_calls');
432
+
433
+ if(strtolower($_GET['spbc_remote_call_token']) == strtolower(md5($apbct->api_key))){
434
+
435
+ // Flag to let plugin know that Remote Call is running.
436
+ $apbct->rc_running = true;
437
+
438
+ switch ($_GET['spbc_remote_call_action']) {
439
+
440
+ // Close renew banner
441
+ case 'close_renew_banner':
442
+ $apbct->data['notice_trial'] = 0;
443
+ $apbct->data['notice_renew'] = 0;
444
+ $apbct->saveData();
445
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
446
+ die('OK');
447
+ break;
448
+
449
+ // SFW update
450
+ case 'sfw_update':
451
+ $result = ct_sfw_update(true);
452
+ /**
453
+ * @todo CRUNCH
454
+ */
455
+ if(is_string($result) && strpos($result, 'FAIL') !== false){
456
+ $result = json_decode(substr($result, 5), true);
457
+ }
458
+ die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error'])));
459
+ break;
460
+
461
+ // SFW send logs
462
+ case 'sfw_send_logs':
463
+ $result = ct_sfw_send_logs();
464
+ die(empty($result['error']) ? 'OK' : 'FAIL '.json_encode(array('error' => $result['error'])));
465
+ break;
466
+
467
+ // Update plugin
468
+ case 'update_plugin':
469
+ add_action('wp', 'apbct_rc__update', 1);
470
+ break;
471
+
472
+ // Install plugin
473
+ case 'install_plugin':
474
+ add_action('wp', 'apbct_rc__install_plugin', 1);
475
+ break;
476
+ // Activate plugin
477
+ case 'activate_plugin':
478
+ $result = apbct_rc__activate_plugin($_GET['plugin']);
479
+ die(empty($result['error'])
480
+ ? 'OK'
481
+ : 'FAIL '.json_encode(array('error' => $result['error'])));
482
+ break;
483
+
484
+ // Insert API key
485
+ case 'insert_auth_key':
486
+ $result = apbct_rc__insert_auth_key($_GET['auth_key'], $_GET['plugin']);
487
+ die(empty($result['error'])
488
+ ? 'OK'
489
+ : 'FAIL '.json_encode(array('error' => $result['error'])));
490
+ break;
491
+
492
+ // Update settins
493
+ case 'update_settings':
494
+ $result = apbct_rc__update_settings($_GET);
495
+ die(empty($result['error'])
496
+ ? 'OK'
497
+ : 'FAIL '.json_encode(array('error' => $result['error'])));
498
+ break;
499
+ // Deactivate plugin
500
+ case 'deactivate_plugin':
501
+ add_action('plugins_loaded', 'apbct_rc__deactivate_plugin', 1);
502
+ break;
503
+
504
+ // Uninstall plugin
505
+ case 'uninstall_plugin':
506
+ add_action('plugins_loaded', 'apbct_rc__uninstall_plugin', 1);
507
+ break;
508
+ // No action found
509
+ default:
510
+ die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION_2')));
511
+ break;
512
+ }
513
+
514
+ }else
515
+ die('FAIL '.json_encode(array('error' => 'WRONG_TOKEN')));
516
+ }else
517
+ die('FAIL '.json_encode(array('error' => 'TOO_MANY_ATTEMPTS')));
518
+ }else
519
+ die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION')));
520
+ }
521
+
522
+ /**
523
+ * Function for SpamFireWall check
524
+ */
525
+ function apbct_sfw__check()
526
+ {
527
+ global $apbct, $spbc, $cleantalk_url_exclusions;
528
+
529
+ // Turn off the SpamFireWall if current url in the exceptions list and WordPress core pages
530
+ if (!empty($cleantalk_url_exclusions) && is_array($cleantalk_url_exclusions)) {
531
+ $core_page_to_skip_check = array('/feed');
532
+ foreach (array_merge($cleantalk_url_exclusions, $core_page_to_skip_check) as $v) {
533
+ if ( apbct_is_in_uri( $v ) ) {
534
+ return;
535
+ }
536
+ }
537
+ }
538
+
539
+ // Turn off the SpamFireWall if Remote Call is in progress
540
+ if($apbct->rc_running || (!empty($spbc) && $spbc->rc_running))
541
+ return;
542
+
543
+ $is_sfw_check = true;
544
+ $sfw = new CleantalkSFW();
545
+ $sfw->ip_array = (array)$sfw->ip__get(array('real'), true);
546
+
547
+ // Skip by cookie
548
+ foreach($sfw->ip_array as $ct_cur_ip){
549
+ if(isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key'] == md5($ct_cur_ip.$apbct->api_key)){
550
+ $is_sfw_check=false;
551
+ if(isset($_COOKIE['ct_sfw_passed'])){
552
+ $sfw->logs__update($ct_cur_ip, 'passed');
553
+ $apbct->data['sfw_counter']['all']++;
554
+ $apbct->saveData();
555
+ if(!headers_sent())
556
+ setcookie ('ct_sfw_passed', '0', time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST) ,false, true);
557
+ }
558
+ break;
559
+ }else{
560
+ $is_sfw_check = true;
561
+ }
562
+ }
563
+
564
+ // Skip the check
565
+ if(!empty($_GET['access'])){
566
+ $spbc_settings = get_option('spbc_settings');
567
+ $spbc_key = !empty($spbc_settings['spbc_key']) ? $spbc_settings['spbc_key'] : false;
568
+ if($_GET['access'] === $apbct->api_key || ($spbc_key !== false && $_GET['access'] === $spbc_key)){
569
+ $is_sfw_check = false;
570
+ setcookie ('spbc_firewall_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $spbc_key), time()+1200, '/');
571
+ setcookie ('ct_sfw_pass_key', md5(apbct_get_server_variable( 'REMOTE_ADDR' ) . $apbct->api_key), time()+1200, '/');
572
+ }
573
+ unset($spbc_settings, $spbc_key);
574
+ }
575
+
576
+ if($is_sfw_check){
577
+
578
+ $sfw->ip_check();
579
+
580
+ // Pass remote calls
581
+ if($sfw->pass === false){
582
+ if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name'])){
583
+ foreach($sfw->blocked_ips as $ip){
584
+ $resolved = CleantalkHelper::ip__resolve($ip['ip']);
585
+ if($resolved && preg_match('/cleantalk\.org/', $resolved) === 1 || $resolved === 'back'){
586
+ $sfw->pass = true;
587
+ }
588
+ } unset($ip);
589
+ }
590
+ }
591
+
592
+ if($sfw->test){
593
+ $sfw->sfw_die($apbct->api_key, '', parse_url(get_option('siteurl'),PHP_URL_HOST), 'test');
594
+ }
595
+
596
+ if($sfw->pass === false){
597
+ foreach($sfw->blocked_ips as $ip){
598
+ $sfw->logs__update($ip['ip'], 'blocked');
599
+ }
600
+ $apbct->data['sfw_counter']['blocked']++;
601
+ $apbct->saveData();
602
+ $sfw->sfw_die($apbct->api_key, '', parse_url(get_option('siteurl'),PHP_URL_HOST));
603
+ }else{
604
+ reset($sfw->passed_ips);
605
+ if(!empty($apbct->settings['set_cookies']) && !headers_sent() && key($sfw->passed_ips))
606
+ setcookie ('ct_sfw_pass_key', md5($sfw->passed_ips[key($sfw->passed_ips)]['ip'].$apbct->api_key), time()+86400*30, '/', parse_url(get_option('siteurl'),PHP_URL_HOST) ,false);
607
+ }
608
+ }
609
+ unset($is_sfw_check, $sfw, $sfw_ip, $ct_cur_ip);
610
+ }
611
+
612
+ /**
613
+ * On activation, set a time, frequency and name of an action hook to be scheduled.
614
+ */
615
+ function apbct_activation( $network = false ) {
616
+
617
+ global $wpdb;
618
+
619
+ // SFW data
620
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw` (
621
+ `network` int(11) unsigned NOT NULL,
622
+ `mask` int(11) unsigned NOT NULL,
623
+ INDEX ( `network` , `mask` )
624
+ );';
625
+
626
+ // SFW log
627
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw_logs` (
628
+ `ip` VARCHAR(15) NOT NULL,
629
+ `all_entries` INT NOT NULL,
630
+ `blocked_entries` INT NOT NULL,
631
+ `entries_timestamp` INT NOT NULL,
632
+ PRIMARY KEY (`ip`));';
633
+
634
+ // Sessions
635
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sessions` (
636
+ `id` VARCHAR(64) NOT NULL,
637
+ `name` VARCHAR(40) NOT NULL,
638
+ `value` TEXT NULL DEFAULT NULL,
639
+ `last_update` DATETIME NULL DEFAULT NULL,
640
+ PRIMARY KEY (`name`(40), `id`(64)));';
641
+
642
+ if($network && !defined('CLEANTALK_ACCESS_KEY')){
643
+ $initial_blog = get_current_blog_id();
644
+ $blogs = array_keys($wpdb->get_results('SELECT blog_id FROM '. $wpdb->blogs, OBJECT_K));
645
+ foreach ($blogs as $blog) {
646
+ switch_to_blog($blog);
647
+ apbct_activation__create_tables($sqls);
648
+ // Cron tasks
649
+ CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
650
+ CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
651
+ CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
652
+ CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+300); // SFW update
653
+ CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
654
+ CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
655
+ CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
656
+ }
657
+ switch_to_blog($initial_blog);
658
+ }else{
659
+
660
+ // Cron tasks
661
+ CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
662
+ CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
663
+ CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
664
+ CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+43200); // SFW update
665
+ CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
666
+ CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
667
+ CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
668
+
669
+ apbct_activation__create_tables($sqls);
670
+ ct_sfw_update(); // Updating SFW
671
+ ct_account_status_check(null, false);
672
+ }
673
+
674
+ // Additional options
675
+ add_option('ct_plugin_do_activation_redirect', true);
676
+ }
677
+
678
+ function apbct_activation__create_tables($sqls) {
679
+ global $wpdb;
680
+ $wpdb->show_errors = false;
681
+ foreach($sqls as $sql){
682
+ $sql = sprintf($sql, $wpdb->prefix); // Adding current blog prefix
683
+ $result = $wpdb->query($sql);
684
+ if($result === false)
685
+ $errors[] = "Failed.\nQuery: {$wpdb->last_query}\nError: {$wpdb->last_error}";
686
+ }
687
+ $wpdb->show_errors = true;
688
+
689
+ // Logging errors
690
+ if(!empty($errors))
691
+ apbct_log($errors);
692
+ }
693
+
694
+ function apbct_activation__new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) {
695
+ if (apbct_is_plugin_active_for_network('cleantalk-spam-protect/cleantalk.php')){
696
+
697
+ switch_to_blog($blog_id);
698
+
699
+ global $wpdb;
700
+
701
+ // SFW data
702
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw` (
703
+ `network` int(11) unsigned NOT NULL,
704
+ `mask` int(11) unsigned NOT NULL,
705
+ INDEX ( `network` , `mask` )
706
+ );';
707
+
708
+ // SFW log
709
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sfw_logs` (
710
+ `ip` VARCHAR(15) NOT NULL,
711
+ `all_entries` INT NOT NULL,
712
+ `blocked_entries` INT NOT NULL,
713
+ `entries_timestamp` INT NOT NULL,
714
+ PRIMARY KEY (`ip`));';
715
+
716
+ // Sessions
717
+ $sqls[] = 'CREATE TABLE IF NOT EXISTS `%scleantalk_sessions` (
718
+ `id` VARCHAR(64) NOT NULL,
719
+ `name` TEXT NOT NULL,
720
+ `value` TEXT NULL DEFAULT NULL,
721
+ `last_update` DATETIME NULL DEFAULT NULL,
722
+ PRIMARY KEY (`id`(64), `name`(64)));';
723
+
724
+ // Cron tasks
725
+ CleantalkCron::addTask('check_account_status', 'ct_account_status_check', 3600, time()+1800); // Checks account status
726
+ CleantalkCron::addTask('delete_spam_comments', 'ct_delete_spam_comments', 3600, time()+3500); // Formerly ct_hourly_event_hook()
727
+ CleantalkCron::addTask('send_feedback', 'ct_send_feedback', 3600, time()+3500); // Formerly ct_hourly_event_hook()
728
+ CleantalkCron::addTask('sfw_update', 'ct_sfw_update', 86400, time()+43200); // SFW update
729
+ CleantalkCron::addTask('send_sfw_logs', 'ct_sfw_send_logs', 3600, time()+1800); // SFW send logs
730
+ CleantalkCron::addTask('get_brief_data', 'cleantalk_get_brief_data', 86400, time()+3500); // Get data for dashboard widget
731
+ CleantalkCron::addTask('send_connection_report','ct_mail_send_connection_report', 86400, time()+3500); // Send connection report to welcome@cleantalk.org
732
+ apbct_activation__create_tables($sqls);
733
+ ct_sfw_update(); // Updating SFW
734
+ ct_account_status_check(null, false);
735
+ restore_current_blog();
736
+ }
737
+ }
738
+
739
+ /**
740
+ * On deactivation, clear schedule.
741
+ */
742
+ function apbct_deactivation( $network ) {
743
+
744
+ global $apbct, $wpdb;
745
+
746
+ // Deactivation for network
747
+ if(is_multisite() && $network){
748
+
749
+ $initial_blog = get_current_blog_id();
750
+ $blogs = array_keys($wpdb->get_results('SELECT blog_id FROM '. $wpdb->blogs, OBJECT_K));
751
+ foreach ($blogs as $blog) {
752
+ switch_to_blog($blog);
753
+ apbct_deactivation__delete_blog_tables();
754
+ delete_option('cleantalk_cron'); // Deleting cron entries
755
+
756
+ if($apbct->settings['complete_deactivation']){
757
+ apbct_deactivation__delete_all_options();
758
+ apbct_deactivation__delete_all_options__in_network();
759
+ }
760
+
761
+ }
762
+ switch_to_blog($initial_blog);
763
+
764
+ // Deactivation for blog
765
+ }elseif(is_multisite()){
766
+
767
+ apbct_deactivation__delete_common_tables();
768
+ delete_option('cleantalk_cron'); // Deleting cron entries
769
+
770
+ if($apbct->settings['complete_deactivation'])
771
+ apbct_deactivation__delete_all_options();
772
+
773
+ // Deactivation on standalone blog
774
+ }elseif(!is_multisite()){
775
+
776
+ apbct_deactivation__delete_common_tables();
777
+ delete_option('cleantalk_cron'); // Deleting cron entries
778
+
779
+ if($apbct->settings['complete_deactivation'])
780
+ apbct_deactivation__delete_all_options();
781
+
782
+ }
783
+ }
784
+
785
+ /**
786
+ * Delete all cleantalk_* entries from _options table
787
+ */
788
+ function apbct_deactivation__delete_all_options(){
789
+ delete_option('cleantalk_settings');
790
+ delete_option('cleantalk_data');
791
+ delete_option('cleantalk_cron');
792
+ delete_option('cleantalk_errors');
793
+ delete_option('cleantalk_remote_calls');
794
+ delete_option('cleantalk_server');
795
+ delete_option('cleantalk_stats');
796
+ delete_option('cleantalk_timelabel_reg');
797
+ }
798
+
799
+ /**
800
+ * Delete all cleantalk_* entries from _sitemeta table
801
+ */
802
+ function apbct_deactivation__delete_all_options__in_network(){
803
+ delete_site_option('cleantalk_network_settings');
804
+ delete_site_option('cleantalk_network_data');
805
+ }
806
+
807
+ function apbct_deactivation__delete_common_tables() {
808
+ global $wpdb;
809
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sfw`;'); // Deleting SFW data
810
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
811
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->base_prefix.'cleantalk_sessions`;'); // Deleting session table
812
+ }
813
+
814
+ function apbct_deactivation__delete_blog_tables() {
815
+ global $wpdb;
816
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw`;'); // Deleting SFW data
817
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
818
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sessions`;'); // Deleting session table
819
+ }
820
+
821
+ /**
822
+ * Redirects admin to plugin settings after activation.
823
+ */
824
+ function apbct_plugin_redirect()
825
+ {
826
+ global $apbct;
827
+ if (get_option('ct_plugin_do_activation_redirect', false) && !isset($_GET['activate-multi'])){
828
+ delete_option('ct_plugin_do_activation_redirect');
829
+ wp_redirect($apbct->settings_link);
830
+ }
831
+ }
832
+
833
+ function ct_add_event($event_type)
834
+ {
835
+ global $apbct, $cleantalk_executed;
836
+
837
+ //
838
+ // To migrate on the new version of ct_add_event().
839
+ //
840
+ switch ($event_type) {
841
+ case '0': $event_type = 'no';break;
842
+ case '1': $event_type = 'yes';break;
843
+ }
844
+
845
+ $current_hour = intval(date('G'));
846
+
847
+ // Updating current hour
848
+ if($current_hour!=$apbct->data['current_hour']){
849
+ $apbct->data['current_hour'] = $current_hour;
850
+ $apbct->data['array_accepted'][$current_hour] = 0;
851
+ $apbct->data['array_blocked'][$current_hour] = 0;
852
+ }
853
+
854
+ //Add 1 to counters
855
+ if($event_type=='yes'){
856
+ $apbct->data['array_accepted'][$current_hour]++;
857
+ $apbct->data['all_time_counter']['accepted']++;
858
+ $apbct->data['user_counter']['accepted']++;
859
+ }
860
+ if($event_type=='no'){
861
+ $apbct->data['array_blocked'][$current_hour]++;
862
+ $apbct->data['all_time_counter']['blocked']++;
863
+ $apbct->data['user_counter']['blocked']++;
864
+ }
865
+
866
+ $apbct->saveData();
867
+
868
+ $cleantalk_executed=true;
869
+ }
870
+
871
+ /**
872
+ * return new cookie value
873
+ */
874
+ function ct_get_cookie()
875
+ {
876
+ global $ct_checkjs_def;
877
+ $ct_checkjs_key = ct_get_checkjs_value();
878
+ print $ct_checkjs_key;
879
+ die();
880
+ }
881
+
882
+ function ct_sfw_update($immediate = false){
883
+
884
+ global $apbct;
885
+
886
+ if($apbct->settings['spam_firewall'] == 1){
887
+
888
+ $sfw = new CleantalkSFW();
889
+
890
+ $file_url = isset($_GET['file_url']) ? $_GET['file_url'] : null;
891
+ $result = $sfw->sfw_update($apbct->api_key, $file_url, $immediate);
892
+
893
+ if(empty($result['error'])){
894
+ $apbct->stats['sfw']['last_update_time'] = time();
895
+ $apbct->stats['sfw']['entries'] = $result;
896
+ $apbct->save('stats');
897
+ }
898
+
899
+ return $result;
900
+ }
901
+
902
+ return array('error' => 'SFW_DISABLED');
903
+
904
+ }
905
+
906
+ function ct_sfw_send_logs()
907
+ {
908
+ global $apbct;
909
+
910
+ if($apbct->settings['spam_firewall'] == 1){
911
+
912
+ $sfw = new CleantalkSFW();
913
+ $result = $sfw->logs__send($apbct->api_key);
914
+
915
+ if(empty($result['error'])){
916
+ $apbct->stats['sfw']['last_send_time'] = time();
917
+ $apbct->stats['sfw']['last_send_amount'] = $result['rows'];
918
+ $apbct->save('stats');
919
+ }
920
+
921
+ return $result;
922
+
923
+ }
924
+
925
+ return array('error' => 'SFW_DISABLED');
926
+ }
927
+
928
+ /**
929
+ * Wrapper for Cleantalk's remote calls
930
+ *
931
+ * @param string $action What you want to do?
932
+ * @param array $additional_params Additional GET parameters for RC
933
+ * @param string $presets Presets for CleantalkHelper::http__request(). 'async' maybe?
934
+ * @param string $plugin_name Plugin name 'antispam' by default
935
+ * @param string $call_token RC securirty token
936
+ * @param string $url Current site URL by default
937
+ *
938
+ * @return array|bool
939
+ */
940
+ function apbct_rc__send($action, $additional_params = array(), $presets = 'get', $plugin_name = 'antispam', $call_token = '', $url = ''){
941
+
942
+ global $apbct;
943
+
944
+ $default_params = array(
945
+ 'plugin_name' => $plugin_name,
946
+ 'spbc_remote_call_token' => $call_token ? $call_token : md5($apbct->api_key),
947
+ 'spbc_remote_call_action' => $action,
948
+ );
949
+
950
+ $params = array_merge($additional_params, $default_params);
951
+
952
+ return apbct_rc__parse_result(
953
+ CleantalkHelper::http__request(
954
+ $url ? $url : get_option('siteurl'),
955
+ $params,
956
+ $presets
957
+ )
958
+ );
959
+ }
960
+
961
+ /**
962
+ * Parse different types of remote call results
963
+ *
964
+ * @param array|string $rc_result
965
+ * string - 'FAIL {"some":"result}'
966
+ * string - 'OK {"some":"result}'
967
+ *
968
+ * @return array|string
969
+ */
970
+ function apbct_rc__parse_result($rc_result){
971
+ if(is_string($rc_result)){
972
+ $rc_result = preg_replace('/^(OK\s?|FAIL\s?)(.*)/', '$2', $rc_result, 1);
973
+ $rc_result = json_decode($rc_result, true);
974
+ $rc_result = $rc_result
975
+ ? $rc_result
976
+ : array('error' => 'FAIL_TO_PARSE_RC_RESULT');
977
+ }
978
+ return $rc_result;
979
+ }
980
+
981
+ /**
982
+ * Install plugin from wordpress catalog
983
+ *
984
+ * @param WP $wp
985
+ * @param string $plugin_slug
986
+ */
987
+ function apbct_rc__install_plugin($wp = null, $plugin = null){
988
+ global $wp_version;
989
+
990
+ $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
991
+
992
+ if($plugin){
993
+
994
+ if(preg_match('/[a-zA-Z-\d]+[\/\\][a-zA-Z-\d]+\.php/', $plugin)){
995
+
996
+ $plugin_slug = preg_replace('@([a-zA-Z-\d]+)[\\\/].*@', '$1', $plugin);
997
+
998
+ if($plugin_slug){
999
+
1000
+ require_once(ABSPATH.'wp-admin/includes/plugin-install.php');
1001
+ $result = plugins_api(
1002
+ 'plugin_information',
1003
+ array(
1004
+ 'slug' => $plugin_slug,
1005
+ 'fileds' => array('version' => true, 'download_link' => true,),
1006
+ )
1007
+ );
1008
+
1009
+ if(!is_wp_error($result)){
1010
+
1011
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1012
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1013
+ include_once( ABSPATH . 'wp-admin/includes/file.php' );
1014
+ include_once( ABSPATH . 'wp-admin/includes/misc.php' );
1015
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
1016
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
1017
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin_Deprecated.php' );
1018
+ if (version_compare(PHP_VERSION, '5.6.0') >= 0 && version_compare($wp_version, '5.3') >= 0)
1019
+ $installer= new CleantalkUpgrader( new CleantalkUpgraderSkin() );
1020
+ else
1021
+ $installer= new CleantalkUpgrader( new CleantalkUpgraderSkin_Deprecated() );
1022
+ $installer->install($result->download_link);
1023
+
1024
+ if($installer->apbct_result === 'OK'){
1025
+ die('OK');
1026
+
1027
+ }else
1028
+ die('FAIL '. json_encode(array('error' => $installer->apbct_result)));
1029
+ }else
1030
+ die('FAIL '. json_encode(array('error' => 'FAIL_TO_GET_LATEST_VERSION', 'details' => $result->get_error_message(),)));
1031
+ }else
1032
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_SLUG_INCORRECT')));
1033
+ }else
1034
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_INCORRECT')));
1035
+ }else
1036
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1037
+ }
1038
+
1039
+ function apbct_rc__activate_plugin($plugin){
1040
+
1041
+ $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1042
+
1043
+ if($plugin){
1044
+
1045
+ if(preg_match('@[a-zA-Z-\d]+[\\\/][a-zA-Z-\d]+\.php@', $plugin)){
1046
+
1047
+ require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1048
+
1049
+ $result = activate_plugins($plugin);
1050
+
1051
+ if($result && !is_wp_error($result)){
1052
+ return array('success' => true);
1053
+ }else
1054
+ return array('error' => 'FAIL_TO_ACTIVATE', 'details' => (is_wp_error($result) ? ' '.$result->get_error_message() : ''));
1055
+ }else
1056
+ return array('error' => 'PLUGIN_NAME_IS_INCORRECT');
1057
+ }else
1058
+ return array('error' => 'PLUGIN_NAME_IS_UNSET');
1059
+ }
1060
+
1061
+ /**
1062
+ * Uninstall plugin from wordpress catalog
1063
+ *
1064
+ * @param null $plugin_name
1065
+ */
1066
+ function apbct_rc__deactivate_plugin($plugin = null){
1067
+
1068
+ global $apbct;
1069
+
1070
+ $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1071
+
1072
+ if($plugin){
1073
+
1074
+ // Switching complete deactivation for security
1075
+ if($plugin == 'security-malware-firewall/security-malware-firewall.php' && !empty($_GET['complete_deactivation'])){
1076
+ $spbc_settings = get_option('spbc_settings');
1077
+ $spbc_settings['complete_deactivation'] = intval($_GET['complete_deactivation']);
1078
+ update_option('spbc_settings', $spbc_settings);
1079
+ }
1080
+
1081
+ require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1082
+
1083
+ if(is_plugin_active( $plugin )){
1084
+ // Hook to set flag if the plugin is deactivated
1085
+ add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1086
+ deactivate_plugins($plugin, false, is_multisite() ? true : false);
1087
+ }else{
1088
+ $apbct->plugin_deactivated = true;
1089
+ }
1090
+
1091
+ // Hook to set flag if the plugin is deactivated
1092
+ add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1093
+ deactivate_plugins($plugin, false, is_multisite() ? true : false);
1094
+
1095
+ if($apbct->plugin_deactivated){
1096
+ die('OK');
1097
+ }else
1098
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_ACTIVE')));
1099
+ }else
1100
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1101
+ }
1102
+
1103
+
1104
+ /**
1105
+ * Uninstall plugin from wordpress catalog
1106
+ *
1107
+ * @param null $plugin
1108
+ */
1109
+ function apbct_rc__uninstall_plugin($plugin = null){
1110
+
1111
+ global $apbct;
1112
+
1113
+ $plugin = $plugin ? $plugin : (isset($_GET['plugin']) ? $_GET['plugin'] : null);
1114
+
1115
+ if($plugin){
1116
+
1117
+ // Switching complete deactivation for security
1118
+ if($plugin == 'security-malware-firewall/security-malware-firewall.php' && !empty($_GET['complete_deactivation'])){
1119
+ $spbc_settings = get_option('spbc_settings');
1120
+ $spbc_settings['complete_deactivation'] = intval($_GET['complete_deactivation']);
1121
+ update_option('spbc_settings', $spbc_settings);
1122
+ }
1123
+
1124
+ require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1125
+
1126
+ if(is_plugin_active( $plugin )){
1127
+ // Hook to set flag if the plugin is deactivated
1128
+ add_action( 'deactivate_'.$plugin, 'apbct_rc__uninstall_plugin__check_deactivate' );
1129
+ deactivate_plugins($plugin, false, is_multisite() ? true : false);
1130
+ }else{
1131
+ $apbct->plugin_deactivated = true;
1132
+ }
1133
+
1134
+ if($apbct->plugin_deactivated){
1135
+
1136
+ require_once (ABSPATH .'/wp-admin/includes/file.php');
1137
+
1138
+ $result = delete_plugins(array($plugin));
1139
+
1140
+ if($result && !is_wp_error($result)){
1141
+ die('OK');
1142
+ }else
1143
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_EXISTS', 'details' => (is_wp_error($result) ? ' '.$result->get_error_message() : ''))));
1144
+ }else
1145
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_ACTIVE')));
1146
+ }else
1147
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
1148
+ }
1149
+
1150
+ function apbct_rc__uninstall_plugin__check_deactivate(){
1151
+ global $apbct;
1152
+ $apbct->plugin_deactivated = true;
1153
+ }
1154
+
1155
+ function apbct_rc__update(){
1156
+ global $wp_version;
1157
+
1158
+ //Upgrade params
1159
+ $plugin = 'cleantalk-spam-protect/cleantalk.php';
1160
+ $plugin_slug = 'cleantalk-spam-protect';
1161
+ $title = __('Update Plugin');
1162
+ $nonce = 'upgrade-plugin_' . $plugin;
1163
+ $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
1164
+
1165
+ $prev_version = APBCT_VERSION;
1166
+
1167
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1168
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1169
+ include_once( ABSPATH . 'wp-admin/includes/file.php' );
1170
+ include_once( ABSPATH . 'wp-admin/includes/misc.php' );
1171
+
1172
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
1173
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
1174
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin_Deprecated.php' );
1175
+
1176
+ apbct_maintance_mode__enable( 30 );
1177
+ if (version_compare(PHP_VERSION, '5.6.0') >= 0 && version_compare($wp_version, '5.3') >= 0)
1178
+ $upgrader = new CleantalkUpgrader( new CleantalkUpgraderSkin( compact('title', 'nonce', 'url', 'plugin') ) );
1179
+ else
1180
+ $upgrader = new CleantalkUpgrader( new CleantalkUpgraderSkin_Deprecated( compact('title', 'nonce', 'url', 'plugin') ) );
1181
+ $upgrader->upgrade($plugin);
1182
+
1183
+ apbct_maintance_mode__disable();
1184
+
1185
+ $result = activate_plugins( $plugin );
1186
+
1187
+ // Changing response UP_TO_DATE to OK
1188
+ if($upgrader->apbct_result === 'UP_TO_DATE')
1189
+ $upgrader->apbct_result = 'OK';
1190
+
1191
+ if($upgrader->apbct_result === 'OK'){
1192
+
1193
+ if(is_wp_error($result)){
1194
+ die('FAIL '. json_encode(array('error' => 'COULD_NOT_ACTIVATE', 'wp_error' => $result->get_error_message())));
1195
+ }
1196
+
1197
+ $httpResponseCode = CleantalkHelper::http__request(get_option('siteurl'), array(), 'get_code');
1198
+
1199
+ if( strpos($httpResponseCode, '200') === false ){
1200
+
1201
+ apbct_maintance_mode__enable( 30 );
1202
+
1203
+ // Rollback
1204
+ if (version_compare(PHP_VERSION, '5.6.0') >= 0 && version_compare($wp_version, '5.3') >= 0)
1205
+ $rollback = new CleantalkUpgrader( new CleantalkUpgraderSkin( compact('title', 'nonce', 'url', 'plugin_slug', 'prev_version') ) );
1206
+ else
1207
+ $rollback = new CleantalkUpgrader( new CleantalkUpgraderSkin_Deprecated( compact('title', 'nonce', 'url', 'plugin_slug', 'prev_version') ) );
1208
+ $rollback->rollback($plugin);
1209
+
1210
+ apbct_maintance_mode__disable();
1211
+
1212
+ $response = array(
1213
+ 'error' => 'BAD_HTTP_CODE',
1214
+ 'http_code' => $httpResponseCode,
1215
+ 'output' => substr(file_get_contents(get_option('siteurl')), 0, 900),
1216
+ 'rollback_result' => $rollback->apbct_result,
1217
+ );
1218
+
1219
+ die('FAIL '.json_encode($response));
1220
+ }
1221
+
1222
+ $plugin_data = get_plugin_data(__FILE__);
1223
+ $apbct_agent = 'wordpress-'.str_replace('.', '', $plugin_data['Version']);
1224
+ ct_send_feedback('0:' . $apbct_agent);
1225
+
1226
+ die('OK '.json_encode(array('agent' => $apbct_agent)));
1227
+
1228
+ }else{
1229
+ die('FAIL '. json_encode(array('error' => $upgrader->apbct_result)));
1230
+ }
1231
+ }
1232
+
1233
+ function apbct_rc__update_settings($source) {
1234
+
1235
+ global $apbct;
1236
+
1237
+ foreach($apbct->def_settings as $setting => $def_value){
1238
+ if(array_key_exists($setting, $source)){
1239
+ $var = $source[$setting];
1240
+ $type = gettype($def_value);
1241
+ settype($var, $type);
1242
+ if($type == 'string')
1243
+ $var = preg_replace(array('/=/', '/`/'), '', $var);
1244
+ $apbct->settings[$setting] = $var;
1245
+ }
1246
+ }
1247
+
1248
+ $apbct->save('settings');
1249
+
1250
+ return true;
1251
+ }
1252
+
1253
+ function apbct_rc__insert_auth_key($key, $plugin){
1254
+
1255
+ global $apbct;
1256
+
1257
+ if($plugin === 'security-malware-firewall/security-malware-firewall.php'){
1258
+
1259
+ require_once (ABSPATH .'/wp-admin/includes/plugin.php');
1260
+
1261
+ if(is_plugin_active( $plugin )){
1262
+
1263
+ $key = trim($key);
1264
+
1265
+ if($key && preg_match('/^[a-z\d]{3,15}$/', $key)){
1266
+
1267
+ $result = CleantalkAPI::method__notice_paid_till(
1268
+ $key,
1269
+ preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1270
+ 'antispam'
1271
+ );
1272
+
1273
+ if( empty( $result['error'] ) ) {
1274
+
1275
+ if( $result['valid'] ){
1276
+
1277
+ // Set account params
1278
+ $data = get_option('spbc_data', array());
1279
+ $data['user_token'] = $result['user_token'];
1280
+ $data['notice_show'] = $result['show_notice'];
1281
+ $data['notice_renew'] = $result['renew'];
1282
+ $data['notice_trial'] = $result['trial'];
1283
+ $data['auto_update_app'] = isset($result['show_auto_update_notice']) ? $result['show_auto_update_notice'] : 0;
1284
+ $data['service_id'] = $result['service_id'];
1285
+ $data['moderate'] = $result['moderate'];
1286
+ $data['auto_update_app '] = isset($result['auto_update_app']) ? $result['auto_update_app'] : 0;
1287
+ $data['license_trial'] = isset($result['license_trial']) ? $result['license_trial'] : 0;
1288
+ $data['account_name_ob'] = isset($result['account_name_ob']) ? $result['account_name_ob'] : '';
1289
+ $data['key_is_ok'] = true;
1290
+ update_option('spbc_data', $data);
1291
+
1292
+ // Set key
1293
+ $settings = get_option('spbc_settings', array());
1294
+ $settings['spbc_key'] = $key;
1295
+ update_option('spbc_settings', $settings);
1296
+
1297
+ return 'OK';
1298
+ }else
1299
+ return array('error' => 'KEY_IS_NOT_VALID');
1300
+ }else
1301
+ return array('error' => $result);
1302
+ }else
1303
+ return array('error' => 'KEY_IS_NOT_CORRECT');
1304
+ }else
1305
+ return array('error' => 'PLUGIN_IS_NOT_ACTIVE_OR_NOT_INSTALLED');
1306
+ }else
1307
+ return array('error' => 'PLUGIN_SLUG_INCORRECT');
1308
+ }
1309
+
1310
+ /**
1311
+ * Putting Wordpress to maintenance mode.
1312
+ * For given duration in seconds
1313
+ *
1314
+ * @param $duration
1315
+ *
1316
+ * @return bool
1317
+ */
1318
+ function apbct_maintance_mode__enable( $duration ) {
1319
+ apbct_maintance_mode__disable();
1320
+ $content = "<?php\n\n"
1321
+ . '$upgrading = ' . (time() - ( 60 * 10 ) + $duration) . ';';
1322
+
1323
+ return (bool)file_put_contents( ABSPATH . '.maintenance', $content );
1324
+ }
1325
+
1326
+ /**
1327
+ * Disabling maintenance mode by deleting .maintenance file.
1328
+ *
1329
+ * @return void
1330
+ */
1331
+ function apbct_maintance_mode__disable() {
1332
+ $maintenance_file = ABSPATH . '.maintenance';
1333
+ if ( file_exists( $maintenance_file ) ) {
1334
+ unlink( $maintenance_file );
1335
+ }
1336
+ }
1337
+
1338
+ function cleantalk_get_brief_data(){
1339
+
1340
+ global $apbct;
1341
+
1342
+ $apbct->data['brief_data'] = CleantalkAPI::method__get_antispam_report_breif($apbct->api_key);
1343
+ $apbct->saveData();
1344
+
1345
+ return;
1346
+ }
1347
+
1348
+ //Delete cookie for admin trial notice
1349
+ function apbct__hook__wp_logout__delete_trial_notice_cookie(){
1350
+ if(!headers_sent())
1351
+ setcookie('ct_trial_banner_closed', '', time()-3600);
1352
+ }
1353
+
1354
+ function apbct_alt_session__id__get(){
1355
+ $id = CleantalkHelper::ip__get(array('real'))
1356
+ .apbct_get_server_variable( 'HTTP_USER_AGENT' )
1357
+ .apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
1358
+ return hash('sha256', $id);
1359
+ }
1360
+
1361
+ function apbct_alt_sessions__remove_old(){
1362
+ if(rand(0, 1000) < APBCT_SEESION__CHANCE_TO_CLEAN){
1363
+ global $wpdb;
1364
+ $wpdb->query(
1365
+ 'DELETE
1366
+ FROM `'. APBCT_TBL_SESSIONS .'`
1367
+ WHERE last_update < NOW() - INTERVAL '. APBCT_SEESION__LIVE_TIME .' SECOND
1368
+ LIMIT 100000;'
1369
+ );
1370
+ }
1371
+ }
1372
+
1373
+ function apbct_alt_session__save($name, $value){
1374
+
1375
+ global $wpdb;
1376
+
1377
+ $session_id = apbct_alt_session__id__get();
1378
+
1379
+ $wpdb->query(
1380
+ $wpdb->prepare(
1381
+ 'INSERT INTO '. APBCT_TBL_SESSIONS .'
1382
+ (id, name, value, last_update)
1383
+ VALUES (%s, %s, %s, %s)
1384
+ ON DUPLICATE KEY UPDATE
1385
+ value = %s,
1386
+ last_update = %s',
1387
+ $session_id, $name, $value, date('Y-m-d H:i:s'), $value, date('Y-m-d H:i:s')
1388
+ )
1389
+ );
1390
+
1391
+ }
1392
+
1393
+ function apbct_alt_session__get($name){
1394
+ global $wpdb;
1395
+ $session_id = apbct_alt_session__id__get();
1396
+ $result = $wpdb->get_row(
1397
+ $wpdb->prepare(
1398
+ 'SELECT value
1399
+ FROM `'. APBCT_TBL_SESSIONS .'`
1400
+ WHERE id = %s AND name = %s;',
1401
+ $session_id, $name
1402
+ ),
1403
+ OBJECT
1404
+ );
1405
+
1406
+ $result = isset($result->value)
1407
+ ? strpos($result->value, '{') === 0
1408
+ ? (array)json_decode($result->value, true) // JSON
1409
+ : $result->value
1410
+ : false;
1411
+
1412
+ return $result ? $result : null;
1413
+ }
1414
+
1415
+ function apbct_store__urls(){
1416
+
1417
+ global $apbct;
1418
+
1419
+ if($apbct->settings['store_urls'] && empty($apbct->flags__url_stored) && !headers_sent()){
1420
+
1421
+ // URLs HISTORY
1422
+ // Get current url
1423
+ $current_url = apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' );
1424
+
1425
+ $current_url = $current_url ? substr($current_url, 0,256) : 'UNKNOWN';
1426
+
1427
+ // Get already stored URLs
1428
+ $urls = $apbct->settings['store_urls__sessions']
1429
+ ? (array)apbct_alt_session__get('apbct_urls')
1430
+ : (array)json_decode(filter_input(INPUT_COOKIE, 'apbct_urls'), true);
1431
+
1432
+ $urls[$current_url][] = time();
1433
+
1434
+ // Rotating. Saving only latest 10
1435
+ $urls[$current_url] = count($urls[$current_url]) > 10 ? array_slice($urls[$current_url], 1, 10) : $urls[$current_url];
1436
+ $urls = count($urls) > 10 ? array_slice($urls, 1, 10) : $urls;
1437
+
1438
+ // Saving
1439
+ $apbct->settings['store_urls__sessions']
1440
+ ? apbct_alt_session__save('apbct_urls', json_encode($urls))
1441
+ : setcookie('apbct_urls', json_encode($urls), time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1442
+
1443
+ // REFERER
1444
+ // Get current fererer
1445
+ $new_site_referer = apbct_get_server_variable( 'HTTP_REFERER' );
1446
+ $new_site_referer = $new_site_referer ? $new_site_referer : 'UNKNOWN';
1447
+
1448
+ // Get already stored referer
1449
+ $site_referer = $apbct->settings['store_urls__sessions']
1450
+ ? apbct_alt_session__get('apbct_site_referer')
1451
+ : filter_input(INPUT_COOKIE, 'apbct_site_referer');
1452
+
1453
+ // Save if empty
1454
+ if( !$site_referer || parse_url($new_site_referer, PHP_URL_HOST) !== apbct_get_server_variable( 'HTTP_HOST' ) ){
1455
+
1456
+ $apbct->settings['store_urls__sessions']
1457
+ ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
1458
+ : setcookie('apbct_site_referer', $new_site_referer, time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1459
+ }
1460
+
1461
+ $apbct->flags__url_stored = true;
1462
+
1463
+ }
1464
+ }
1465
+
1466
+ /*
1467
+ * Set Cookies test for cookie test
1468
+ * Sets cookies with pararms timestamp && landing_timestamp && pervious_referer
1469
+ * Sets test cookie with all other cookies
1470
+ */
1471
+ function apbct_cookie(){
1472
+
1473
+ global $apbct;
1474
+
1475
+ if($apbct->settings['store_urls__sessions'] || $apbct->settings['set_cookies__sessions'])
1476
+ apbct_alt_sessions__remove_old();
1477
+
1478
+ if(
1479
+ empty($apbct->settings['set_cookies']) || // Do not set cookies if option is disabled (for Varnish cache).
1480
+ !empty($apbct->flags__cookies_setuped) || // Cookies already set
1481
+ !empty($apbct->headers_sent) // Headers sent
1482
+ )
1483
+ return false;
1484
+
1485
+ // Prevent headers sent error
1486
+ if(headers_sent($file, $line)){
1487
+ $apbct->headers_sent = true;
1488
+ $apbct->headers_sent__hook = current_action();
1489
+ $apbct->headers_sent__where = $file.':'.$line;
1490
+ return false;
1491
+ }
1492
+
1493
+
1494
+ // Cookie names to validate
1495
+ $cookie_test_value = array(
1496
+ 'cookies_names' => array(),
1497
+ 'check_value' => $apbct->api_key,
1498
+ );
1499
+
1500
+ $domain = parse_url(get_option('siteurl'),PHP_URL_HOST);
1501
+
1502
+ // Submit time
1503
+ if(empty($_POST['ct_multipage_form'])){ // Do not start/reset page timer if it is multipage form (Gravitiy forms))
1504
+ $apbct_timestamp = time();
1505
+ $apbct->settings['set_cookies__sessions']
1506
+ ? apbct_alt_session__save('apbct_timestamp', $apbct_timestamp)
1507
+ : setcookie('apbct_timestamp', $apbct_timestamp, 0, '/', $domain, false, true);
1508
+ $cookie_test_value['cookies_names'][] = 'apbct_timestamp';
1509
+ $cookie_test_value['check_value'] .= $apbct_timestamp;
1510
+ }
1511
+
1512
+ // Pervious referer
1513
+ if(apbct_get_server_variable( 'HTTP_REFERER' )){
1514
+ $apbct->settings['set_cookies__sessions']
1515
+ ? apbct_alt_session__save('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ))
1516
+ : setcookie('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ), 0, '/', $domain, false, true);
1517
+ $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1518
+ $cookie_test_value['check_value'] .= apbct_get_server_variable( 'HTTP_REFERER' );
1519
+ }
1520
+
1521
+ // Landing time
1522
+ $site_landing_timestamp = $apbct->settings['set_cookies__sessions']
1523
+ ? apbct_alt_session__get('apbct_site_landing_ts')
1524
+ : filter_input(INPUT_COOKIE, 'apbct_site_landing_ts');
1525
+ if(!$site_landing_timestamp){
1526
+ $site_landing_timestamp = time();
1527
+ $apbct->settings['set_cookies__sessions']
1528
+ ? apbct_alt_session__save('apbct_site_landing_ts', $site_landing_timestamp)
1529
+ : setcookie('apbct_site_landing_ts', $site_landing_timestamp, 0, '/', $domain, false, true);
1530
+ }
1531
+ $cookie_test_value['cookies_names'][] = 'apbct_site_landing_ts';
1532
+ $cookie_test_value['check_value'] .= $site_landing_timestamp;
1533
+
1534
+ // Page hits
1535
+ // Get
1536
+ $page_hits = $apbct->settings['set_cookies__sessions']
1537
+ ? apbct_alt_session__get('apbct_page_hits')
1538
+ : filter_input(INPUT_COOKIE, 'apbct_page_hits');
1539
+ // Set / Increase
1540
+ $page_hits = intval($page_hits) ? $page_hits + 1 : 1;
1541
+
1542
+ $apbct->settings['set_cookies__sessions']
1543
+ ? apbct_alt_session__save('apbct_page_hits', $page_hits)
1544
+ : setcookie('apbct_page_hits', $page_hits, 0, '/', $domain, false, true);
1545
+
1546
+ $cookie_test_value['cookies_names'][] = 'apbct_page_hits';
1547
+ $cookie_test_value['check_value'] .= $page_hits;
1548
+
1549
+ // Cookies test
1550
+ $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
1551
+ if(!$apbct->settings['set_cookies__sessions'])
1552
+ setcookie('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/', $domain, false, true);
1553
+
1554
+ $apbct->flags__cookies_setuped = true;
1555
+
1556
+ }
1557
+
1558
+ /**
1559
+ * Cookies test for sender
1560
+ * Also checks for valid timestamp in $_COOKIE['apbct_timestamp'] and other apbct_ COOKIES
1561
+ * @return null|0|1;
1562
+ */
1563
+ function apbct_cookies_test()
1564
+ {
1565
+ global $apbct;
1566
+
1567
+ if($apbct->settings['set_cookies__sessions'])
1568
+ return 1;
1569
+
1570
+ if(isset($_COOKIE['apbct_cookies_test'])){
1571
+
1572
+ $cookie_test = json_decode(urldecode($_COOKIE['apbct_cookies_test']),true);
1573
+
1574
+ if(!is_array($cookie_test))
1575
+ return 0;
1576
+
1577
+ $check_srting = $apbct->api_key;
1578
+ foreach($cookie_test['cookies_names'] as $cookie_name){
1579
+ $check_srting .= isset($_COOKIE[$cookie_name]) ? $_COOKIE[$cookie_name] : '';
1580
+ } unset($cookie_name);
1581
+
1582
+ if($cookie_test['check_value'] == md5($check_srting)){
1583
+ return 1;
1584
+ }else{
1585
+ return 0;
1586
+ }
1587
+ }else{
1588
+ return null;
1589
+ }
1590
+ }
1591
+
1592
+ function apbct_cookies__delete($cookie){
1593
+ if(isset($_COOKIE[$cookie]))
1594
+ setcookie($cookie, '', time()-3600);
1595
+ }
1596
+
1597
+ function apbct_cookies__delete_all(){
1598
+ if(count($_COOKIE)){
1599
+ foreach($_COOKIE as $key => $val){
1600
+ if(preg_match("/apbct_|ct_/", $key)){
1601
+ setcookie($key, '', time()-3600);
1602
+ }
1603
+ } unset($key, $val);
1604
+ }
1605
+ return false;
1606
+ }
1607
+
1608
+ /**
1609
+ * Gets submit time
1610
+ * Uses Cookies with check via apbct_cookies_test()
1611
+ * @return null|int;
1612
+ */
1613
+ function apbct_get_submit_time()
1614
+ {
1615
+ global $apbct;
1616
+ $apbct_timestamp = $apbct->settings['set_cookies__sessions']
1617
+ ? apbct_alt_session__get('apbct_timestamp')
1618
+ : filter_input(INPUT_COOKIE, 'apbct_timestamp');
1619
+ return apbct_cookies_test() == 1 ? time() - (int)$apbct_timestamp : null;
1620
+ }
1621
+
1622
+ /*
1623
+ * Inner function - Account status check
1624
+ * Scheduled in 1800 seconds for default!
1625
+ */
1626
+ function ct_account_status_check($api_key = null, $process_errors = true){
1627
+
1628
+ global $apbct;
1629
+
1630
+ $api_key = $api_key ? $api_key : $apbct->api_key;
1631
+ $result = CleantalkAPI::method__notice_paid_till(
1632
+ $api_key,
1633
+ preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
1634
+ 'antispam'
1635
+ );
1636
+
1637
+ if(empty($result['error']) || !empty($result['valid'])){
1638
+
1639
+ // Notices
1640
+ $apbct->data['notice_show'] = isset($result['show_notice']) ? (int)$result['show_notice'] : 0;
1641
+ $apbct->data['notice_renew'] = isset($result['renew']) ? (int)$result['renew'] : 0;
1642
+ $apbct->data['notice_trial'] = isset($result['trial']) ? (int)$result['trial'] : 0;
1643
+ $apbct->data['notice_review'] = isset($result['show_review']) ? (int)$result['show_review'] : 0;
1644
+ $apbct->data['notice_auto_update'] = isset($result['show_auto_update_notice']) ? (int)$result['show_auto_update_notice'] : 0;
1645
+
1646
+ // Other
1647
+ $apbct->data['service_id'] = isset($result['service_id']) ? (int)$result['service_id'] : 0;
1648
+ $apbct->data['valid'] = isset($result['valid']) ? (int)$result['valid'] : 0;
1649
+ $apbct->data['moderate'] = isset($result['moderate']) ? (int)$result['moderate'] : 0;
1650
+ $apbct->data['ip_license'] = isset($result['ip_license']) ? (int)$result['ip_license'] : 0;
1651
+ $apbct->data['moderate_ip'] = isset($result['moderate_ip'], $result['ip_license']) ? (int)$result['moderate_ip'] : 0;
1652
+ $apbct->data['spam_count'] = isset($result['spam_count']) ? (int)$result['spam_count'] : 0;
1653
+ $apbct->data['auto_update'] = isset($result['auto_update_app']) ? (int)$result['auto_update_app'] : 0;
1654
+ $apbct->data['user_token'] = isset($result['user_token']) ? (string)$result['user_token'] : '';
1655
+ $apbct->data['license_trial'] = isset($result['license_trial']) ? (int)$result['license_trial'] : 0;
1656
+ $apbct->data['account_name_ob'] = isset($result['account_name_ob']) ? (string)$result['account_name_ob'] : '';
1657
+
1658
+ if($apbct->data['notice_show'] == 1 && $apbct->data['notice_trial'] == 1)
1659
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
1660
+
1661
+ if($apbct->data['notice_show'] == 1 && $apbct->data['notice_renew'] == 1)
1662
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 1800);
1663
+
1664
+ if($apbct->data['notice_show'] == 0)
1665
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
1666
+
1667
+ $apbct->error_delete('account_check', 'save');
1668
+
1669
+ $apbct->saveData();
1670
+
1671
+ }elseif($process_errors){
1672
+ $apbct->error_add('account_check', $result);
1673
+ }
1674
+
1675
+ if(!empty($result['valid'])){
1676
+ $apbct->data['key_is_ok'] = true;
1677
+ $result = true;
1678
+ }else{
1679
+ $apbct->data['key_is_ok'] = false;
1680
+ $result = false;
1681
+ }
1682
+
1683
+ return $result;
1684
+ }
1685
+
1686
+ function ct_mail_send_connection_report() {
1687
+
1688
+ global $apbct;
1689
+
1690
+ if (($apbct->settings['send_connection_reports'] == 1 && $apbct->connection_reports['negative'] > 0) || !empty($_GET['ct_send_connection_report']))
1691
+ {
1692
+ $to = "welcome@cleantalk.org" ;
1693
+ $subject = "Connection report for " . apbct_get_server_variable( 'HTTP_HOST' );
1694
+ $message = '
1695
+ <html>
1696
+ <head>
1697
+ <title></title>
1698
+ </head>
1699
+ <body>
1700
+ <p>From '.$apbct->connection_reports['since'].' to '.date('d M').' has been made '.($apbct->connection_reports['success']+$apbct->connection_reports['negative']).' calls, where '.$apbct->connection_reports['success'].' were success and '.$apbct->connection_reports['negative'].' were negative</p>
1701
+ <p>Negative report:</p>
1702
+ <table> <tr>
1703
+ <td>&nbsp;</td>
1704
+ <td><b>Date</b></td>
1705
+ <td><b>Page URL</b></td>
1706
+ <td><b>Library report</b></td>
1707
+ <td><b>Server IP</b></td>
1708
+ </tr>
1709
+ ';
1710
+ foreach ($apbct->connection_reports['negative_report'] as $key => $report)
1711
+ {
1712
+ $message.= '<tr>'
1713
+ . '<td>'.($key+1).'.</td>'
1714
+ . '<td>'.$report['date'].'</td>'
1715
+ . '<td>'.$report['page_url'].'</td>'
1716
+ . '<td>'.$report['lib_report'].'</td>'
1717
+ . '<td>'.$report['work_url'].'</td>'
1718
+ . '</tr>';
1719
+ }
1720
+ $message.='</table></body></html>';
1721
+
1722
+ $headers = 'Content-type: text/html; charset=windows-1251 \r\n';
1723
+ $headers .= 'From: '.get_option('admin_email');
1724
+ mail($to, $subject, $message, $headers);
1725
+ }
1726
+
1727
+ $apbct->data['connection_reports'] = $apbct->def_data['connection_reports'];
1728
+ $apbct->data['connection_reports']['since'] = date('d M');
1729
+ $apbct->saveData();
1730
+ }
1731
+
1732
+ //* Write $message to the plugin's debug option
1733
+ function apbct_log($message = 'empty', $func = null, $params = array())
1734
+ {
1735
+ global $apbct;
1736
+
1737
+ $debug = get_option( APBCT_DEBUG );
1738
+
1739
+ $function = $func ? $func : '';
1740
+ $cron = in_array('cron', $params) ? true : false;
1741
+ $data = in_array('data', $params) ? true : false;
1742
+ $settings = in_array('settings', $params) ? true : false;
1743
+
1744
+ if(is_array($message) or is_object($message))
1745
+ $message = print_r($message, true);
1746
+
1747
+ if($message) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func)] = $message;
1748
+ if($cron) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_cron'] = $apbct->cron;
1749
+ if($data) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_data'] = $apbct->data;
1750
+ if($settings) $debug[date("H:i:s", microtime(true))."_ACTION_".strval(current_action())."_FUNCTION_".strval($func).'_settings'] = $apbct->settings;
1751
+
1752
+ update_option(APBCT_DEBUG, $debug);
1753
+ }
1754
+
1755
+ function apbct_sfw__delete_tables( $blog_id, $drop ) {
1756
+
1757
+ global $wpdb;
1758
+
1759
+ $initial_blog = get_current_blog_id();
1760
+
1761
+ switch_to_blog($blog_id);
1762
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw`;'); // Deleting SFW data
1763
+ $wpdb->query('DROP TABLE IF EXISTS `'. $wpdb->prefix.'cleantalk_sfw_logs`;'); // Deleting SFW logs
1764
+
1765
+ switch_to_blog($initial_blog);
1766
+ }
1767
+
1768
+ /**
1769
+ * Is enable for user group
1770
+ *
1771
+ * @param WP_User $user
1772
+ *
1773
+ * @return boolean
1774
+ */
1775
+ function apbct_is_user_enable($user = null) {
1776
+
1777
+ global $current_user;
1778
+
1779
+ $user = !empty($user) ? $user : $current_user;
1780
+
1781
+ return apbct_is_user_role_in(array('administrator', 'editor', 'author'), $user)
1782
+ ? false
1783
+ : true;
1784
+ }
1785
+
1786
+ /**
1787
+ * Checks if the current user has role
1788
+ *
1789
+ * @param array $roles array of strings
1790
+ * @param int|string|WP_User|mixed $user User ID to check|user_login|WP_User
1791
+ *
1792
+ * @return boolean Does the user has this role|roles
1793
+ */
1794
+ function apbct_is_user_role_in( $roles, $user = false ){
1795
+
1796
+ if( is_numeric($user) && function_exists('get_userdata')) $user = get_userdata( $user );
1797
+ if( is_string($user) && function_exists('get_user_by')) $user = get_user_by('login', $user );
1798
+ if( ! $user && function_exists('wp_get_current_user')) $user = wp_get_current_user();
1799
+ if( ! $user ) $user = apbct_wp_get_current_user();
1800
+
1801
+ if( empty($user->ID) )
1802
+ return false;
1803
+
1804
+ foreach( (array) $roles as $role ){
1805
+ if( isset($user->caps[ strtolower($role) ]) || in_array(strtolower($role), $user->roles) )
1806
+ return true;
1807
+ }
1808
+
1809
+ return false;
1810
+ }
1811
+
1812
+ /**
1813
+ * Update and rotate statistics with requests exection time
1814
+ *
1815
+ * @param $exec_time
1816
+ */
1817
+ function apbct_statistics__rotate($exec_time){
1818
+
1819
+ global $apbct;
1820
+
1821
+ // Delete old stats
1822
+ if(min(array_keys($apbct->stats['requests'])) < time() - (86400 * 7))
1823
+ unset($apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]);
1824
+
1825
+ // Create new if newest older than 1 day
1826
+ if(empty($apbct->stats['requests']) || max(array_keys($apbct->stats['requests'])) < time() - (86400 * 1))
1827
+ $apbct->stats['requests'][time()] = array('amount' => 0, 'average_time' => 0);
1828
+
1829
+ // Update all existing stats
1830
+ foreach($apbct->stats['requests'] as &$weak_stat){
1831
+ $weak_stat['average_time'] = ($weak_stat['average_time'] * $weak_stat['amount'] + $exec_time) / ++$weak_stat['amount'];
1832
+ }
1833
+
1834
+ $apbct->save('stats');
1835
+ }
1836
+
1837
+ /**
1838
+ * Runs update actions for new version.
1839
+ *
1840
+ * @global CleantalkState $apbct
1841
+ */
1842
+ function apbct_update_actions(){
1843
+
1844
+ global $apbct;
1845
+
1846
+ // Update logic
1847
+ if($apbct->plugin_version != APBCT_VERSION){
1848
+
1849
+ // Main blog
1850
+ if(is_main_site()){
1851
+
1852
+ require_once(CLEANTALK_PLUGIN_DIR.'inc/cleantalk-updater.php');
1853
+
1854
+ $result = apbct_run_update_actions($apbct->plugin_version, APBCT_VERSION);
1855
+
1856
+ //If update is successfull
1857
+ if($result === true)
1858
+ apbct_update__set_version__from_plugin('from_plugin');
1859
+
1860
+ ct_send_feedback('0:' . APBCT_AGENT ); // Send feedback to let cloud know about updated version.
1861
+
1862
+ // Side blogs
1863
+ }else{
1864
+ apbct_update__set_version__from_plugin('from_plugin');
1865
+ }
1866
+ }
1867
+
1868
+ }
1869
+
1870
+ /**
1871
+ * Set version of plugin in database
1872
+ *
1873
+ * @param string $ver
1874
+ *
1875
+ * @return bool
1876
+ * @global CleantalkState $apbct
1877
+ *
1878
+ */
1879
+ function apbct_update__set_version__from_plugin($ver){
1880
+ global $apbct;
1881
+ switch (true){
1882
+ case $ver === 'from_plugin':
1883
+ $apbct->data['plugin_version'] = APBCT_VERSION;
1884
+ break;
1885
+ case preg_match('/^\d+\.\d+(\.\d+)?(-[a-zA-Z0-9-_]+)?$/', $ver) === 1;
1886
+ $apbct->data['plugin_version'] = $ver;
1887
+ break;
1888
+ default:
1889
+ return false;
1890
+ break;
1891
+ }
1892
+ $apbct->saveData();
1893
+ return true;
1894
+ }
css/fonts/icons/icons.svg CHANGED
@@ -1,240 +1,240 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2019 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="fontello" horiz-adv-x="1000" >
7
- <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="download" unicode="&#xe800;" d="M714 590q15-15 15-37t-15-36l-245-244-245 244q-15 15-15 36t15 37 36 15q23 0 38-15l118-120 0 349q0 21 16 37t37 16 37-16 15-37l0-349 119 120q14 14 38 14 22 0 36-14z m222-448l2-261q0-21-16-36t-37-16l-832 0q-22 0-37 16t-16 36q0 261 1 261 0 11 2 16l105 312q12 37 48 37l12 0q8-18 18-28l78-76-70 0-86-261 722 0-86 261-70 0 77 76q10 10 19 28l11 0q37 0 49-37l105-312q1-5 1-16z" horiz-adv-x="938" />
10
-
11
- <glyph glyph-name="glass" unicode="&#xe801;" d="M948 746q0-19-24-43l-353-353v-429h179q15 0 25-10t11-25-11-25-25-11h-500q-14 0-25 11t-11 25 11 25 25 10h179v429l-353 353q-24 24-24 43 0 13 10 21t21 9 24 3h786q13 0 24-3t21-9 10-21z" horiz-adv-x="1000" />
12
-
13
- <glyph glyph-name="emo-happy" unicode="&#xe802;" d="M261 800c-60 0-109-65-109-144 0-80 49-145 109-145s110 65 110 145c0 79-49 144-110 144z m477 0c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m208-599c-13 0-27-5-37-16-4-4-8-8-12-12-111-109-253-164-396-165-142-2-285 50-396 155l-3 3-12 12c-21 21-54 20-75-1-20-21-20-55 1-76 3-4 8-8 14-14l3-3c132-124 301-186 469-184 169 1 337 67 468 195 5 5 9 10 14 14 20 22 20 56-1 77-10 10-23 15-37 15z" horiz-adv-x="999" />
14
-
15
- <glyph glyph-name="search" unicode="&#xe803;" d="M643 386q0 103-73 176t-177 74-177-74-73-176 73-177 177-73 177 73 73 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69-80 0-153 31t-125 84-84 125-31 153 31 152 84 126 125 84 153 31 153-31 125-84 84-126 31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
16
-
17
- <glyph glyph-name="emo-unhappy" unicode="&#xe804;" d="M261 800c-60 0-109-65-109-144 0-80 49-145 109-145s110 65 110 145c0 79-49 144-110 144z m477 0c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m-244-599c-165 0-331-62-461-184l-3-3c-6-5-11-10-14-14-21-21-21-55-1-76 21-21 54-21 75-1l12 12 3 3c111 105 254 157 396 155 143-1 285-56 396-165 4-4 8-8 12-12 20-21 54-21 74-1 21 21 21 55 1 77-5 5-9 10-14 14-131 129-299 194-468 195-3 0-6 0-8 0z" horiz-adv-x="999" />
18
-
19
- <glyph glyph-name="mail" unicode="&#xe805;" d="M929 11v428q-18-20-39-36-149-115-238-189-28-24-46-37t-48-28-57-13h-2q-26 0-57 13t-48 28-46 37q-88 74-238 189-21 16-39 36v-428q0-7 6-13t12-5h822q7 0 12 5t6 13z m0 586v14t-1 7-1 7-3 5-5 4-8 2h-822q-7 0-12-6t-6-12q0-94 83-159 107-84 223-176 4-3 20-17t25-21 25-17 28-16 24-5h2q11 0 24 5t28 16 25 17 25 21 20 17q116 92 224 176 30 24 56 65t26 73z m71 21v-607q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v607q0 37 26 63t63 26h822q37 0 63-26t26-63z" horiz-adv-x="1000" />
20
-
21
- <glyph glyph-name="info-circled" unicode="&#xe806;" d="M571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
22
-
23
- <glyph glyph-name="help-circled" unicode="&#xe807;" d="M500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-13 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-15-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
24
-
25
- <glyph glyph-name="heart" unicode="&#xe808;" d="M500-79q-14 0-25 10l-348 336q-5 5-15 15t-31 37-38 54-30 67-13 77q0 123 71 192t196 70q34 0 70-12t67-33 54-38 42-38q20 20 42 38t54 38 67 33 70 12q125 0 196-70t71-192q0-123-128-251l-347-335q-10-10-25-10z" horiz-adv-x="1000" />
26
-
27
- <glyph glyph-name="heart-empty" unicode="&#xe809;" d="M929 517q0 46-12 80t-31 55-46 33-52 18-55 4-62-14-62-36-48-40-34-34q-10-13-27-13t-27 13q-14 15-34 34t-48 40-62 36-62 14-55-4-52-18-46-33-31-55-12-80q0-93 105-198l324-312 324 312q105 105 105 198z m71 0q0-123-128-251l-347-335q-10-10-25-10t-25 10l-348 336q-5 5-15 15t-31 37-38 54-30 67-13 77q0 123 71 192t196 70q34 0 70-12t67-33 54-38 42-38q20 20 42 38t54 38 67 33 70 12q125 0 196-70t71-192z" horiz-adv-x="1000" />
28
-
29
- <glyph glyph-name="star" unicode="&#xe80a;" d="M929 489q0-12-15-27l-202-197 48-279q0-4 0-12 0-11-6-19t-17-9q-10 0-22 7l-251 132-250-132q-12-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27 0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26z" horiz-adv-x="928.6" />
30
-
31
- <glyph glyph-name="star-empty" unicode="&#xe80b;" d="M635 290l170 166-235 34-106 213-105-213-236-34 171-166-41-235 211 111 211-111z m294 199q0-12-15-27l-202-197 48-279q0-4 0-12 0-28-23-28-10 0-22 7l-251 132-250-132q-12-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27 0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26z" horiz-adv-x="928.6" />
32
-
33
- <glyph glyph-name="user" unicode="&#xe80c;" d="M714 69q0-60-35-104t-84-44h-476q-49 0-84 44t-35 104q0 48 5 90t17 85 33 73 52 50 76 19q73-72 174-72t175 72q42 0 75-19t52-50 33-73 18-85 4-90z m-143 495q0-88-62-151t-152-63-151 63-63 151 63 152 151 63 152-63 62-152z" horiz-adv-x="714.3" />
34
-
35
- <glyph glyph-name="users" unicode="&#xe80d;" d="M331 350q-90-3-148-71h-75q-45 0-77 22t-31 66q0 197 69 197 4 0 25-11t54-24 66-12q38 0 75 13-3-21-3-37 0-78 45-143z m598-356q0-66-41-105t-108-39h-488q-68 0-108 39t-41 105q0 30 2 58t8 61 14 61 24 54 35 45 48 30 62 11q6 0 24-12t41-26 59-27 76-12 75 12 60 27 41 26 24 12q34 0 62-11t47-30 35-45 24-54 15-61 8-61 2-58z m-572 713q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m393-214q0-89-63-152t-151-62-152 62-63 152 63 151 152 63 151-63 63-151z m321-126q0-43-31-66t-77-22h-75q-57 68-147 71 45 65 45 143 0 16-3 37 37-13 74-13 33 0 67 12t54 24 24 11q69 0 69-197z m-71 340q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z" horiz-adv-x="1071.4" />
36
-
37
- <glyph glyph-name="th-large" unicode="&#xe80e;" d="M429 279v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z m500-428v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z" horiz-adv-x="928.6" />
38
-
39
- <glyph glyph-name="th" unicode="&#xe80f;" d="M286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-22 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-22 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-178q-22 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z" horiz-adv-x="1000" />
40
-
41
- <glyph glyph-name="th-list" unicode="&#xe810;" d="M286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m714-285v-108q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v108q0 22 16 38t38 15h535q23 0 38-15t16-38z m-714 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m714-286v-107q0-22-16-38t-38-15h-535q-23 0-38 15t-16 38v107q0 23 16 38t38 16h535q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-535q-23 0-38 16t-16 38v107q0 22 16 38t38 16h535q23 0 38-16t16-38z" horiz-adv-x="1000" />
42
-
43
- <glyph glyph-name="to-end" unicode="&#xe811;" d="M25-71q-10-11-18-8t-7 18v822q0 14 7 18t18-8l396-396q5-5 8-10v378q0 14 10 25t25 11h72q14 0 25-11t10-25v-786q0-14-10-25t-25-11h-72q-14 0-25 11t-10 25v379q-3-6-8-11z" horiz-adv-x="571.4" />
44
-
45
- <glyph glyph-name="to-start" unicode="&#xe812;" d="M546 771q11 11 18 8t7-18v-822q0-14-7-18t-18 8l-396 396q-5 5-7 11v-379q0-14-11-25t-25-11h-71q-15 0-25 11t-11 25v786q0 14 11 25t25 11h71q15 0 25-11t11-25v-378q2 5 7 10z" horiz-adv-x="571.4" />
46
-
47
- <glyph glyph-name="fast-fw" unicode="&#xe813;" d="M25-71q-10-11-18-8t-7 18v822q0 14 7 18t18-8l396-396q5-5 8-10v396q0 14 7 18t18-8l396-396q11-10 11-25t-11-25l-396-396q-11-11-18-8t-7 18v397q-3-6-8-11z" horiz-adv-x="928.6" />
48
-
49
- <glyph glyph-name="fast-bw" unicode="&#xe814;" d="M904 771q10 11 17 8t8-18v-822q0-14-8-18t-17 8l-397 396q-5 5-7 11v-397q0-14-7-18t-18 8l-396 396q-11 11-11 25t11 25l396 396q11 11 18 8t7-18v-396q2 5 7 10z" horiz-adv-x="928.6" />
50
-
51
- <glyph glyph-name="off" unicode="&#xe815;" d="M857 350q0-87-34-166t-91-137-137-92-166-34-167 34-136 92-92 137-34 166q0 102 45 191t126 151q24 18 54 14t46-28q18-23 14-53t-28-47q-54-41-84-101t-30-127q0-58 23-111t61-91 91-61 111-23 110 23 92 61 61 91 22 111q0 68-30 127t-84 101q-23 18-28 47t14 53q17 24 47 28t53-14q81-61 126-151t45-191z m-357 429v-358q0-29-21-50t-50-21-51 21-21 50v358q0 29 21 50t51 21 50-21 21-50z" horiz-adv-x="857.1" />
52
-
53
- <glyph glyph-name="chart-bar" unicode="&#xe816;" d="M357 350v-286h-143v286h143z m214 286v-572h-142v572h142z m572-643v-72h-1143v858h71v-786h1072z m-357 500v-429h-143v429h143z m214 214v-643h-143v643h143z" horiz-adv-x="1142.9" />
54
-
55
- <glyph glyph-name="home" unicode="&#xe817;" d="M786 296v-267q0-15-11-25t-25-11h-214v214h-143v-214h-214q-15 0-25 11t-11 25v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-3-7 1-12 6l-35 41q-4 6-3 13t6 12l401 334q18 15 42 15t43-15l136-113v108q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q6-4 6-12t-4-13z" horiz-adv-x="928.6" />
56
-
57
- <glyph glyph-name="link-1" unicode="&#xe818;" d="M813 171q0 23-16 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40 0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q16 16 16 37z m-393 394q0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 11-8 12-12 10-11q18 17 18 41z m500-394q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46 67 0 114-47l115-116q46-46 46-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
58
-
59
- <glyph glyph-name="lock-open" unicode="&#xe819;" d="M929 529v-143q0-15-11-25t-25-11h-36q-14 0-25 11t-11 25v143q0 59-41 101t-101 41-101-41-42-101v-108h53q23 0 38-15t16-38v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h375v108q0 103 73 176t177 74 176-74 74-176z" horiz-adv-x="928.6" />
60
-
61
- <glyph glyph-name="eye" unicode="&#xe81a;" d="M929 314q-85 132-213 197 34-58 34-125 0-103-73-177t-177-73-177 73-73 177q0 67 34 125-128-65-213-197 75-114 187-182t242-68 243 68 186 182z m-402 215q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m473-215q0-19-11-38-78-129-210-206t-279-77-279 77-210 206q-11 19-11 38t11 39q78 128 210 205t279 78 279-78 210-205q11-20 11-39z" horiz-adv-x="1000" />
62
-
63
- <glyph glyph-name="eye-off" unicode="&#xe81b;" d="M310 105l43 79q-48 35-76 88t-27 114q0 67 34 125-128-65-213-197 94-144 239-209z m217 424q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m202 106q0-4 0-5-59-105-176-316t-176-316l-28-50q-5-9-15-9-7 0-75 39-9 6-9 16 0 7 25 49-80 36-147 96t-117 137q-11 17-11 38t11 39q86 131 212 207t277 76q50 0 100-10l31 54q5 9 15 9 3 0 10-3t18-9 18-10 18-10 10-7q9-5 9-15z m21-249q0-78-44-142t-117-91l157 280q4-25 4-47z m250-72q0-19-11-38-22-36-61-81-84-96-194-149t-234-53l41 74q119 10 219 76t169 171q-65 100-158 164l35 63q53-36 102-85t81-103q11-19 11-39z" horiz-adv-x="1000" />
64
-
65
- <glyph glyph-name="download-1" unicode="&#xe81c;" d="M714 100q0 15-10 25t-25 11-25-11-11-25 11-25 25-11 25 11 10 25z m143 0q0 15-10 25t-26 11-25-11-10-25 10-25 25-11 26 11 10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-39l-250-250q-10-11-25-11t-25 11l-250 250q-17 16-8 39 10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
66
-
67
- <glyph glyph-name="chat" unicode="&#xe81d;" d="M786 421q0-77-53-143t-143-104-197-38q-48 0-98 9-70-49-155-72-21-5-48-9h-2q-6 0-12 5t-6 12q-1 1-1 3t1 4 1 3l1 3t2 3 2 3 3 3 2 2q3 3 13 14t15 16 12 17 14 21 11 25q-69 40-108 98t-40 125q0 78 53 144t143 104 197 38 197-38 143-104 53-144z m214-142q0-67-40-126t-108-98q5-14 11-25t14-21 13-16 14-17 13-14q0 0 2-2t3-3 2-3 2-3l1-3t1-3 1-4-1-3q-2-8-7-13t-12-4q-28 4-48 9-86 23-156 72-50-9-98-9-151 0-263 74 32-3 49-3 90 0 172 25t148 72q69 52 107 119t37 141q0 43-13 85 72-39 114-99t42-128z" horiz-adv-x="1000" />
68
-
69
- <glyph glyph-name="comment" unicode="&#xe81e;" d="M1000 350q0-97-67-179t-182-130-251-48q-39 0-81 4-110-97-257-135-27-8-63-12-10-1-17 5t-10 16v1q-2 2 0 6t1 6 2 5l4 5t4 5 4 5q4 5 17 19t20 22 17 22 18 28 15 33 15 42q-88 50-138 123t-51 157q0 73 40 139t106 114 160 76 194 28q136 0 251-48t182-130 67-179z" horiz-adv-x="1000" />
70
-
71
- <glyph glyph-name="doc" unicode="&#xe81f;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z" horiz-adv-x="857.1" />
72
-
73
- <glyph glyph-name="lock" unicode="&#xe820;" d="M179 421h285v108q0 59-42 101t-101 41-101-41-41-101v-108z m464-53v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h17v108q0 102 74 176t176 74 177-74 73-176v-108h18q23 0 38-15t16-38z" horiz-adv-x="642.9" />
74
-
75
- <glyph glyph-name="emo-wink2" unicode="&#xe821;" d="M664 800c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m-343-98l-267 0c-30 0-54-24-54-54 0-30 24-54 54-54l267 0c30 0 54 24 54 54 0 30-24 54-54 54z m-262-361c-6 0-13-1-19-3-27-10-41-41-31-68 46-127 136-228 249-289 22-12 45-22 69-31 58-21 120-33 184-33 57 0 113 9 166 27 10 3 20 7 30 11 11 4 22 8 31 12l0 1 0 0 0 0c26 12 38 44 25 71-13 26-44 37-70 25l0 0c-9-4-17-8-24-11-8-3-17-6-25-8-43-14-88-22-133-22-51 0-101 10-148 27-19 7-37 15-55 25-90 48-163 130-200 231-8 21-28 35-49 35z" horiz-adv-x="774" />
76
-
77
- <glyph glyph-name="plus" unicode="&#xe822;" d="M786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q23 0 38-16t16-38z" horiz-adv-x="785.7" />
78
-
79
- <glyph glyph-name="upload" unicode="&#xe823;" d="M936 128l2-260q0-21-16-37t-37-15l-832 0q-22 0-37 15t-16 37q0 260 1 260 0 12 2 17l105 312q12 36 48 36l209 0 0-103-171 0-86-262 722 0-86 262-171 0 0 103 208 0q37 0 49-36l105-312q1-5 1-17z m-258 423q-24 0-38 14l-119 120 0-348q0-21-15-37t-37-15-37 15-16 37l0 348-118-120q-14-14-38-14-22 0-36 14-15 15-15 36t15 37l245 247 245-247q15-15 15-37t-15-36q-14-14-36-14z" horiz-adv-x="938" />
80
-
81
- <glyph glyph-name="picture" unicode="&#xe824;" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
82
-
83
- <glyph glyph-name="ok" unicode="&#xe825;" d="M933 534q0-22-16-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q16-15 16-38z" horiz-adv-x="1000" />
84
-
85
- <glyph glyph-name="cancel" unicode="&#xe826;" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
86
-
87
- <glyph glyph-name="pencil" unicode="&#xe827;" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
88
-
89
- <glyph glyph-name="edit" unicode="&#xe828;" d="M496 189l64 65-85 85-64-65v-31h53v-54h32z m245 402q-9 9-18 0l-196-196q-9-9 0-18t18 0l196 196q9 9 0 18z m45-331v-106q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q35 0 65-14 9-4 10-13 2-10-5-16l-27-28q-8-8-18-4-13 3-25 3h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v70q0 7 5 12l36 36q8 8 20 4t11-16z m-54 411l161-160-375-375h-161v160z m248-73l-51-52-161 161 51 52q16 15 38 15t38-15l85-85q16-16 16-38t-16-38z" horiz-adv-x="1000" />
90
-
91
- <glyph glyph-name="forward" unicode="&#xe829;" d="M1000 493q0-15-11-25l-285-286q-11-11-25-11t-25 11-11 25v143h-125q-55 0-98-3t-86-12-74-24-59-39-45-56-27-77-10-101q0-31 3-69 0-4 2-13t1-15q0-8-5-14t-13-6q-9 0-15 10-4 5-8 12t-7 17-6 13q-71 159-71 252 0 111 30 186 90 225 488 225h125v143q0 14 11 25t25 10 25-10l285-286q11-11 11-25z" horiz-adv-x="1000" />
92
-
93
- <glyph glyph-name="export" unicode="&#xe82a;" d="M750 60l0 56 100 82 0-188q0-20-15-35t-35-15l-750 0q-20 0-35 15t-15 35l0 550q0 22 14 36t36 14l288 0q-32-24-59-49t-39-39l-10-12-130 0 0-450 650 0z m-82 348q-166 0-242-41t-160-181q0 8 1 22t9 56 22 79 44 83 70 79 107 56 149 23l0 156 332-250-332-260 0 178z" horiz-adv-x="1000" />
94
-
95
- <glyph glyph-name="trash-empty" unicode="&#xe82b;" d="M286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
96
-
97
- <glyph glyph-name="down-dir" unicode="&#xe82c;" d="M571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
98
-
99
- <glyph glyph-name="up-dir" unicode="&#xe82d;" d="M571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25 11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
100
-
101
- <glyph glyph-name="left-dir" unicode="&#xe82e;" d="M357 600v-500q0-14-10-25t-26-11-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11 10-25z" horiz-adv-x="357.1" />
102
-
103
- <glyph glyph-name="right-dir" unicode="&#xe82f;" d="M321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11-11 25v500q0 15 11 25t25 11 25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
104
-
105
- <glyph glyph-name="spin1" unicode="&#xe830;" d="M496 850c-176 0-331-90-421-226-18-27-33-55-46-85-12-29-21-60-28-92 0 0 0-1 0-1l0 0 0 0c0-1 0-2 0-2 0-7 5-12 11-12l101 0c5 0 10 4 11 9 29 113 109 206 214 253 20 10 41 17 63 23 31 7 62 11 95 11l0 0 0 0 0 0c25 0 50-2 74-7 5-1 10-2 14-3 6-1 10-3 14-4l0 0c5-1 11 1 13 6l51 87c0 0 1 1 1 2 2 6-1 13-7 15-22 7-43 13-65 17-5 1-9 1-13 2-27 5-54 7-82 7l0 0 0 0z m327-114c-5 0-9-2-11-6l-50-87c-3-4-2-10 2-14 29-29 54-63 73-101 4-7 7-14 11-22 19-46 30-97 30-151l0 0 0 0c0-77-22-149-62-209-7-11-15-23-24-33-9-11-18-21-28-31l0 0 0 0 0 0c-4-4-5-10-2-14l50-87c0-1 1-2 2-3 4-5 11-5 16-1 58 52 104 117 134 190 6 15 11 29 15 44 14 46 21 94 21 144 0 108-34 209-92 291-11 16-23 31-37 46-13 14-26 28-41 41l0 0c-1 1-1 1-2 1-2 1-4 2-5 2z m-811-468l0 0c-1 0-2 0-3 0-6-1-10-8-9-14 34-166 149-302 302-366 30-12 61-21 93-28 32-6 66-10 100-10l0 0 0 0c40 0 79 5 117 14 7 1 14 3 22 5 6 2 13 5 20 7 1 0 2 1 3 1 6 3 8 10 4 16l-50 87c-3 5-8 7-13 6-14-4-28-7-42-9-3-1-6-1-8-2-18-2-35-3-53-3l0 0 0 0c-128 0-242 63-311 160-1 0-1 0-1 0-13 19-25 40-35 61-10 21-18 43-24 65-1 6-6 10-11 10l-101 0z" horiz-adv-x="1000" />
106
-
107
- <glyph glyph-name="spin2" unicode="&#xe831;" d="M46 144l0 0c0 0-1 0-1 0-8 18-15 37-21 55-6 19-11 38-15 58-19 99-8 203 35 298 3 6 10 8 15 5 1 0 2 0 2-1l0 0 80-59c5-3 6-9 4-14-5-12-9-25-12-37-4-13-7-26-9-40-11-67-3-137 23-201 2-5 0-10-4-13l0 0-80-56c-5-4-12-2-16 3-1 0-1 1-1 2l0 0z m120 574l0 0c0 1 0 1 0 1 15 13 30 25 46 37 16 11 33 22 51 31 89 50 192 72 297 60 6-1 10-6 10-13 0-1-1-1-1-2l0 0-31-94c-2-5-8-8-13-7-13 0-27 0-40 0-14-1-27-2-40-4-68-11-133-40-186-84-4-3-10-3-14 0l0 0-79 58c-5 3-6 11-2 16 0 0 1 1 2 1l0 0z m588 65l0 0c0 0 1 0 1 0 17-10 34-21 50-32 16-12 31-25 46-38 74-69 127-160 148-262 2-6-2-12-9-13-1 0-1 0-2 0l0 0-100 1c-5 0-10 4-11 9-3 13-8 26-12 38-5 12-10 25-17 36-31 61-78 113-137 150-5 3-6 8-5 13l0 0 31 92c2 6 9 9 15 7 1 0 2-1 2-1l0 0z m244-535l0 0c0 0 0 0 0 0-4-20-9-39-15-57-7-19-14-37-22-55-44-92-114-170-205-221-6-3-13-1-16 4 0 1-1 2-1 2l0 0-30 94c-2 6 1 12 6 14 11 7 22 15 32 23 11 9 21 18 30 27 49 48 84 109 101 176 2 5 6 8 11 8l0 0 98-1c6 0 11-5 11-11 0-1 0-2 0-3l0 0z m-438-395l0 0c0 0 0 0 0 0-20-2-40-3-60-3-20 0-40 1-59 4-102 12-198 54-276 125-5 4-5 11 0 16 0 0 1 1 1 1l0 0 81 58c5 3 12 2 16-2 10-8 20-16 32-23 11-7 22-14 34-20 62-31 131-45 200-41 6 0 10-3 12-8l0 0 29-92c2-6-1-12-7-14-1-1-2-1-3-1l0 0z" horiz-adv-x="1000" />
108
-
109
- <glyph glyph-name="mobile" unicode="&#xe832;" d="M480 840q42 0 71-29t29-71l0-780q0-40-29-70t-71-30l-380 0q-40 0-70 30t-30 70l0 780q0 42 30 71t70 29l380 0z m-190-940q30 0 50 15t20 35q0 22-20 36t-50 14q-28 0-49-15t-21-35 21-35 49-15z m210 150l0 660-420 0 0-660 420 0z" horiz-adv-x="580" />
110
-
111
- <glyph glyph-name="bell" unicode="&#xe833;" d="M509-96q0 8-9 8-33 0-57 24t-23 57q0 9-9 9t-9-9q0-41 29-70t69-28q9 0 9 9z m-372 160h726q-149 168-149 465 0 28-13 58t-39 58-67 45-95 17-95-17-67-45-39-58-13-58q0-297-149-465z m827 0q0-29-21-50t-50-21h-250q0-59-42-101t-101-42-101 42-42 101h-250q-29 0-50 21t-21 50q28 24 51 49t47 67 42 89 27 115 11 145q0 84 66 157t171 89q-5 10-5 21 0 23 16 38t38 16 38-16 16-38q0-11-5-21 106-16 171-89t66-157q0-78 11-145t28-115 41-89 48-67 50-49z" horiz-adv-x="1000" />
112
-
113
- <glyph glyph-name="ccw" unicode="&#xe834;" d="M857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z" horiz-adv-x="857.1" />
114
-
115
- <glyph glyph-name="wrench" unicode="&#xe835;" d="M214 29q0 14-10 25t-25 10-25-10-11-25 11-25 25-11 25 11 10 25z m360 234l-381-381q-21-20-50-20-29 0-51 20l-59 61q-21 20-21 50 0 29 21 51l380 380q22-55 64-97t97-64z m354 243q0-22-13-59-27-75-92-122t-144-46q-104 0-177 73t-73 177 73 176 177 74q32 0 67-10t60-26q9-6 9-15t-9-16l-163-94v-125l108-60q2 2 44 27t75 45 40 20q8 0 13-5t5-14z" horiz-adv-x="928.6" />
116
-
117
- <glyph glyph-name="stop-1" unicode="&#xe837;" d="M857 743v-786q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v786q0 14 11 25t25 11h785q15 0 26-11t10-25z" horiz-adv-x="857.1" />
118
-
119
- <glyph glyph-name="spin5" unicode="&#xe838;" d="M462 850c-6 0-11-5-11-11l0-183 0 0c0-6 5-11 11-11l69 0c1 0 1 0 1 0 7 0 12 5 12 11l0 183 0 0c0 6-5 11-12 11l-69 0c0 0 0 0-1 0z m250-47c-4 1-8-2-10-5l-91-158 0 0c-4-6-2-13 4-16l60-34c0-1 0-1 0-1 6-3 13-1 16 4l91 158c3 6 2 13-4 16l-61 35c-1 1-3 1-5 1z m-428-2c-2 0-4-1-6-2l-61-35c-5-3-7-10-4-16l91-157c0 0 0 0 0 0 3-6 10-8 16-5l61 35c5 4 7 11 4 16l-91 157c0 1 0 1 0 1-2 4-6 6-10 6z m620-163c-2 0-4 0-6-1l-157-91c0 0 0 0 0 0-6-3-8-10-5-16l35-61c4-5 11-7 16-4l157 91c1 0 1 0 1 0 6 3 7 11 4 16l-35 61c-2 4-6 6-10 5z m-810-4c-5 0-9-2-11-6l-35-61c-3-5-1-12 4-15l158-91 0 0c6-4 13-2 16 4l35 60c0 0 0 0 0 0 3 6 1 13-4 16l-158 91c-2 1-4 2-5 2z m712-235l0 0c-6 0-11-5-11-11l0-69c0-1 0-1 0-1 0-7 5-12 11-12l183 0 0 0c6 0 11 5 11 12l0 69c0 0 0 0 0 1 0 6-5 11-11 11l-183 0z m-794-5l0 0c-7 0-12-5-12-12l0-69c0 0 0 0 0-1 0-6 5-11 12-11l182 0 0 0c6 0 11 5 11 11l0 69c0 1 0 1 0 1 0 7-5 12-11 12l-182 0z m772-153c-4 0-8-2-10-6l-34-60c-1 0-1 0-1 0-3-6-1-13 4-16l158-91c6-3 13-1 16 4l35 61c3 5 1 12-4 15l-158 92 0 0c-2 1-4 1-6 1z m-566-5c-1 0-3 0-5-1l-157-91c0 0-1 0-1 0-5-3-7-10-4-16l35-61c3-5 10-7 16-4l157 91c0 0 0 0 0 0 6 3 8 10 5 16l-35 61c-3 3-7 6-11 5z m468-121c-2 0-4 0-6-1l-61-35c-5-4-7-11-4-16l91-157c0-1 0-1 0-1 3-6 11-7 16-4l61 35c5 3 7 10 4 16l-91 157c0 0 0 0 0 0-2 4-6 6-10 6z m-367-2c-4 0-8-2-10-6l-91-158c-3-6-1-13 4-16l61-35c5-3 12-1 15 4l92 158 0 0c3 6 1 13-5 16l-60 35c0 0 0 0 0 0-2 1-4 1-6 2z m149-58c-7 0-12-5-12-11l0-183 0 0c0-6 5-11 12-11l69 0c0 0 0 0 1 0 6 0 11 5 11 11l0 183 0 0c0 6-5 11-11 11l-69 0c-1 0-1 0-1 0z" horiz-adv-x="1000" />
120
-
121
- <glyph glyph-name="pause-1" unicode="&#xe839;" d="M857 743v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z m-500 0v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z" horiz-adv-x="857.1" />
122
-
123
- <glyph glyph-name="play-1" unicode="&#xe83a;" d="M772 333l-741-412q-13-7-22-2t-9 20v822q0 14 9 20t22-2l741-412q13-7 13-17t-13-17z" horiz-adv-x="785.7" />
124
-
125
- <glyph glyph-name="link-ext" unicode="&#xf08e;" d="M786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-25t-25-11-25 11l-98 98-364-364q-5-6-13-6t-12 6l-64 64q-6 5-6 12t6 13l364 364-98 98q-11 11-11 25t11 25 25 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
126
-
127
- <glyph glyph-name="menu" unicode="&#xf0c9;" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
128
-
129
- <glyph glyph-name="sort" unicode="&#xf0dc;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z m0 214q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25 11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.4" />
130
-
131
- <glyph glyph-name="mail-alt" unicode="&#xf0e0;" d="M1000 454v-443q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v443q25-27 56-49 202-137 278-192 32-24 51-37t53-27 61-13h2q28 0 61 13t53 27 51 37q95 68 278 192 32 22 56 49z m0 164q0-44-27-84t-68-69q-210-146-262-181-5-4-23-17t-30-22-29-18-32-15-28-5h-2q-12 0-27 5t-32 15-30 18-30 22-23 17q-51 35-147 101t-114 80q-35 23-65 64t-31 77q0 43 23 72t66 29h822q36 0 63-26t26-63z" horiz-adv-x="1000" />
132
-
133
- <glyph glyph-name="lightbulb" unicode="&#xf0eb;" d="M411 529q0-8-6-13t-12-5-13 5-5 13q0 25-30 39t-59 14q-7 0-13 5t-5 13 5 13 13 5q28 0 55-9t49-30 21-50z m89 0q0 40-19 74t-50 57-69 35-76 12-76-12-69-35-50-57-20-74q0-57 38-101 6-6 17-18t17-19q72-85 79-166h127q8 81 79 166 6 6 17 19t17 18q38 44 38 101z m71 0q0-87-57-150-25-27-42-48t-33-54-19-60q26-15 26-46 0-20-13-35 13-15 13-36 0-29-25-45 8-13 8-26 0-26-18-40t-43-14q-11-25-34-39t-48-15-49 15-33 39q-26 0-44 14t-17 40q0 13 7 26-25 16-25 45 0 21 14 36-14 15-14 35 0 31 26 46-2 28-19 60t-33 54-41 48q-58 63-58 150 0 55 25 103t65 79 92 49 104 19 104-19 91-49 66-79 24-103z" horiz-adv-x="571.4" />
134
-
135
- <glyph glyph-name="exchange" unicode="&#xf0ec;" d="M1000 189v-107q0-7-5-12t-13-6h-768v-107q0-7-5-12t-13-6q-6 0-13 6l-178 178q-5 6-5 13 0 8 5 13l179 178q5 5 12 5 8 0 13-5t5-13v-107h768q7 0 13-5t5-13z m0 304q0-8-5-13l-179-178q-5-6-12-6-8 0-13 6t-5 12v107h-768q-7 0-13 6t-5 12v107q0 8 5 13t13 5h768v107q0 8 5 13t13 5q6 0 13-5l178-178q5-5 5-13z" horiz-adv-x="1000" />
136
-
137
- <glyph glyph-name="upload-cloud" unicode="&#xf0ee;" d="M714 368q0 8-5 13l-196 196q-5 5-13 5t-13-5l-196-196q-5-6-5-13 0-8 5-13t13-5h125v-196q0-8 5-13t12-5h108q7 0 12 5t5 13v196h125q8 0 13 5t5 13z m357-161q0-89-62-151t-152-63h-607q-103 0-177 73t-73 177q0 72 39 134t105 92q-1 17-1 24 0 118 84 202t202 84q87 0 159-49t105-129q40 35 93 35 59 0 101-42t42-101q0-43-23-77 72-17 119-76t46-133z" horiz-adv-x="1071.4" />
138
-
139
- <glyph glyph-name="bell-alt" unicode="&#xf0f3;" d="M509-96q0 8-9 8-33 0-57 24t-23 57q0 9-9 9t-9-9q0-41 29-70t69-28q9 0 9 9z m455 160q0-29-21-50t-50-21h-250q0-59-42-101t-101-42-101 42-42 101h-250q-29 0-50 21t-21 50q28 24 51 49t47 67 42 89 27 115 11 145q0 84 66 157t171 89q-5 10-5 21 0 23 16 38t38 16 38-16 16-38q0-11-5-21 106-16 171-89t66-157q0-78 11-145t28-115 41-89 48-67 50-49z" horiz-adv-x="1000" />
140
-
141
- <glyph glyph-name="doc-text" unicode="&#xf0f6;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z m-572 483q0 7 5 12t13 5h393q8 0 13-5t5-12v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36z m411-125q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z m0-143q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z" horiz-adv-x="857.1" />
142
-
143
- <glyph glyph-name="angle-double-left" unicode="&#xf100;" d="M350 82q0-7-6-13l-28-28q-5-5-12-5t-13 5l-260 261q-6 5-6 12t6 13l260 260q5 6 13 6t12-6l28-28q6-5 6-13t-6-12l-219-220 219-219q6-6 6-13z m214 0q0-7-5-13l-28-28q-6-5-13-5t-13 5l-260 261q-6 5-6 12t6 13l260 260q6 6 13 6t13-6l28-28q5-5 5-13t-5-12l-220-220 220-219q5-6 5-13z" horiz-adv-x="571.4" />
144
-
145
- <glyph glyph-name="angle-double-right" unicode="&#xf101;" d="M332 314q0-7-5-12l-261-261q-5-5-12-5t-13 5l-28 28q-6 6-6 13t6 13l219 219-219 220q-6 5-6 12t6 13l28 28q5 6 13 6t12-6l261-260q5-5 5-13z m214 0q0-7-5-12l-260-261q-6-5-13-5t-13 5l-28 28q-5 6-5 13t5 13l219 219-219 220q-5 5-5 12t5 13l28 28q6 6 13 6t13-6l260-260q5-5 5-13z" horiz-adv-x="571.4" />
146
-
147
- <glyph glyph-name="angle-double-up" unicode="&#xf102;" d="M600 118q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 219-219-219q-5-5-13-5t-12 5l-28 28q-6 6-6 13t6 13l260 260q5 5 12 5t13-5l260-260q6-6 6-13z m0 214q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 220-219-220q-5-5-13-5t-12 5l-28 28q-6 6-6 13t6 13l260 260q5 6 12 6t13-6l260-260q6-6 6-13z" horiz-adv-x="642.9" />
148
-
149
- <glyph glyph-name="angle-double-down" unicode="&#xf103;" d="M600 368q0-7-6-13l-260-260q-5-6-13-6t-12 6l-260 260q-6 6-6 13t6 13l28 28q5 5 12 5t13-5l219-220 220 220q5 5 13 5t12-5l28-28q6-6 6-13z m0 214q0-7-6-13l-260-260q-5-5-13-5t-12 5l-260 260q-6 6-6 13t6 13l28 28q5 6 12 6t13-6l219-219 220 219q5 6 13 6t12-6l28-28q6-6 6-13z" horiz-adv-x="642.9" />
150
-
151
- <glyph glyph-name="desktop" unicode="&#xf108;" d="M1000 296v465q0 7-5 12t-13 6h-893q-7 0-12-6t-6-12v-465q0-7 6-12t12-5h893q7 0 13 5t5 12z m71 465v-607q0-37-26-63t-63-27h-303q0-20 9-43t17-40 9-24q0-14-10-25t-25-11h-286q-15 0-25 11t-11 25q0 8 9 25t18 39 9 43h-304q-36 0-63 27t-26 63v607q0 37 26 63t63 26h893q37 0 63-26t26-63z" horiz-adv-x="1071.4" />
152
-
153
- <glyph glyph-name="laptop" unicode="&#xf109;" d="M232 136q-37 0-63 26t-26 63v393q0 37 26 63t63 26h607q37 0 63-26t27-63v-393q0-37-27-63t-63-26h-607z m-18 482v-393q0-7 6-13t12-5h607q8 0 13 5t5 13v393q0 7-5 12t-13 6h-607q-7 0-12-6t-6-12z m768-518h89v-54q0-22-26-37t-63-16h-893q-36 0-63 16t-26 37v54h982z m-402-54q9 0 9 9t-9 9h-89q-9 0-9-9t9-9h89z" horiz-adv-x="1071.4" />
154
-
155
- <glyph glyph-name="tablet" unicode="&#xf10a;" d="M357 64q0 15-10 25t-26 11-25-11-10-25 10-25 25-10 26 10 10 25z m214 90v535q0 8-5 13t-12 5h-465q-7 0-12-5t-6-13v-535q0-8 6-13t12-5h465q7 0 12 5t5 13z m72 535v-607q0-37-26-63t-63-26h-465q-36 0-63 26t-26 63v607q0 37 26 63t63 27h465q36 0 63-27t26-63z" horiz-adv-x="642.9" />
156
-
157
- <glyph glyph-name="circle-empty" unicode="&#xf10c;" d="M429 654q-83 0-153-41t-110-111-41-152 41-152 110-111 153-41 152 41 110 111 41 152-41 152-110 111-152 41z m428-304q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
158
-
159
- <glyph glyph-name="circle" unicode="&#xf111;" d="M857 350q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
160
-
161
- <glyph glyph-name="unlink" unicode="&#xf127;" d="M245 141l-143-143q-6-5-13-5t-12 5q-6 6-6 13t6 13l142 142q6 5 13 5t13-5q5-5 5-12t-5-13z m94-23v-179q0-8-5-13t-13-5-12 5-5 13v179q0 8 5 13t12 5 13-5 5-13z m-125 125q0-8-5-13t-13-5h-178q-8 0-13 5t-5 13 5 13 13 5h178q8 0 13-5t5-13z m706-72q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-186 187q-12 12-24 31l134 10 152-153q15-15 38-15t38 15l82 81q16 16 16 37 0 23-16 38l-153 154 10 133q20-11 31-23l188-188q47-48 47-114z m-345 404l-133-10-152 153q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l153-153-10-134q-20 12-32 24l-187 187q-47 48-47 114 0 67 47 113l82 82q47 46 114 46 67 0 114-47l186-187q12-12 23-32z m354-46q0-8-5-13t-13-5h-179q-8 0-13 5t-5 13 5 12 13 5h179q8 0 13-5t5-12z m-304 303v-178q0-8-5-13t-13-5-13 5-5 13v178q0 8 5 13t13 5 13-5 5-13z m227-84l-143-143q-6-5-13-5t-12 5q-5 6-5 13t5 13l143 143q5 5 12 5t13-5q5-6 5-13t-5-13z" horiz-adv-x="928.6" />
162
-
163
- <glyph glyph-name="help" unicode="&#xf128;" d="M393 149v-134q0-9-7-15t-15-7h-134q-9 0-16 7t-7 15v134q0 9 7 16t16 6h134q9 0 15-6t7-16z m176 335q0-30-8-56t-20-43-31-33-32-25-34-19q-23-13-38-37t-15-37q0-10-7-18t-16-9h-134q-8 0-14 11t-6 20v26q0 46 37 87t79 60q33 16 47 32t14 42q0 24-26 41t-60 18q-36 0-60-16-20-14-60-64-7-9-17-9-7 0-14 4l-91 70q-8 6-9 14t3 16q89 148 259 148 45 0 90-17t81-46 59-72 23-88z" horiz-adv-x="571.4" />
164
-
165
- <glyph glyph-name="info" unicode="&#xf129;" d="M357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
166
-
167
- <glyph glyph-name="attention-alt" unicode="&#xf12a;" d="M286 154v-125q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v125q0 14 11 25t25 10h143q15 0 25-10t11-25z m17 589l-16-429q-1-14-12-25t-25-10h-143q-14 0-25 10t-12 25l-15 429q-1 14 10 25t24 11h179q14 0 25-11t10-25z" horiz-adv-x="357.1" />
168
-
169
- <glyph glyph-name="ellipsis" unicode="&#xf141;" d="M214 439v-107q0-22-15-38t-38-15h-107q-23 0-38 15t-16 38v107q0 23 16 38t38 16h107q22 0 38-16t15-38z m286 0v-107q0-22-16-38t-38-15h-107q-22 0-38 15t-15 38v107q0 23 15 38t38 16h107q23 0 38-16t16-38z m286 0v-107q0-22-16-38t-38-15h-107q-22 0-38 15t-16 38v107q0 23 16 38t38 16h107q23 0 38-16t16-38z" horiz-adv-x="785.7" />
170
-
171
- <glyph glyph-name="ellipsis-vert" unicode="&#xf142;" d="M214 154v-108q0-22-15-37t-38-16h-107q-23 0-38 16t-16 37v108q0 22 16 38t38 15h107q22 0 38-15t15-38z m0 285v-107q0-22-15-38t-38-15h-107q-23 0-38 15t-16 38v107q0 23 16 38t38 16h107q22 0 38-16t15-38z m0 286v-107q0-22-15-38t-38-16h-107q-23 0-38 16t-16 38v107q0 22 16 38t38 16h107q22 0 38-16t15-38z" horiz-adv-x="214.3" />
172
-
173
- <glyph glyph-name="euro" unicode="&#xf153;" d="M545 121l19-89q2-7-1-13t-10-8l-3 0q-2-1-6-2t-9-3-12-3-14-3-16-2-19-3-21-2-21 0q-131 0-228 73t-133 196h-53q-7 0-13 5t-5 13v63q0 7 5 12t13 6h37q-1 31 0 58h-37q-8 0-13 5t-5 13v64q0 8 5 13t13 5h55q37 117 135 188t224 72q57 0 108-13 6-2 11-9 4-6 2-13l-24-89q-2-7-8-11t-13-1l-2 1q-3 0-7 1l-10 2t-12 2-15 2-16 1-16 1q-71 0-126-36t-84-98h261q9 0 14-7 6-7 4-15l-13-63q-3-15-18-15h-273q-1-20 0-58h257q8 0 13-7 5-7 4-15l-14-63q-1-6-6-10t-11-4h-216q27-65 84-104t127-38q10 0 20 1t19 2 16 2 14 3 10 3l7 1 3 2q7 2 14-2 7-3 9-11z" horiz-adv-x="571.4" />
174
-
175
- <glyph glyph-name="pound" unicode="&#xf154;" d="M569 216v-205q0-8-5-13t-13-5h-533q-8 0-13 5t-5 13v83q0 8 5 13t13 5h54v214h-53q-8 0-13 5t-5 13v73q0 8 5 13t13 5h53v124q0 96 69 158t175 62q104 0 187-70 5-5 6-12t-4-12l-57-71q-5-6-13-7-7-1-13 4-2 3-14 11t-39 18-51 10q-48 0-77-27t-29-68v-120h170q8 0 13-5t5-13v-73q0-7-5-13t-13-5h-170v-211h231v101q0 7 5 12t13 5h90q8 0 13-5t5-12z" horiz-adv-x="571.4" />
176
-
177
- <glyph glyph-name="dollar" unicode="&#xf155;" d="M546 189q0-86-56-147t-144-77v-97q0-8-5-13t-13-5h-75q-7 0-13 5t-5 13v97q-37 5-71 18t-57 25-41 26-26 21-10 10q-9 12-1 23l58 76q3 5 12 6 9 1 14-5l1-1q63-55 135-70 21-4 42-4 45 0 79 24t35 68q0 16-9 30t-18 23-33 21-37 18-45 18q-21 9-34 14t-34 15-35 17-32 20-29 24-25 27-20 32-11 37-5 44q0 77 55 135t142 75v100q0 7 5 13t13 5h75q8 0 13-5t5-13v-98q32-3 62-13t48-19 36-20 21-17 9-7q9-11 3-22l-46-81q-4-9-12-9-8-2-15 4-2 2-9 7t-21 14-33 18-42 15-47 6q-53 0-87-24t-33-62q0-14 4-27t17-23 22-18 31-18 34-15 39-15q30-11 45-17t43-20 42-24 34-28 30-35 18-43 7-52z" horiz-adv-x="571.4" />
178
-
179
- <glyph glyph-name="rupee" unicode="&#xf156;" d="M501 588v-57q0-8-5-13t-13-5h-93q-13-80-72-131t-154-61q93-99 256-299 8-9 2-19-5-10-16-10h-109q-9 0-14 7-171 204-278 318-5 5-5 13v70q0 8 5 13t13 5h62q74 0 119 24t57 70h-238q-8 0-13 5t-5 13v57q0 8 5 13t13 5h230q-31 63-149 63h-81q-7 0-13 5t-5 13v74q0 8 5 13t13 5h464q8 0 13-5t5-13v-57q0-8-5-13t-13-5h-130q26-34 36-80h95q8 0 13-5t5-13z" horiz-adv-x="501.1" />
180
-
181
- <glyph glyph-name="yen" unicode="&#xf157;" d="M337-7h-96q-8 0-13 5t-5 13v184h-161q-7 0-13 5t-5 13v57q0 8 5 13t13 5h161v48h-161q-7 0-13 5t-5 12v58q0 8 5 13t13 5h119l-179 323q-4 9 0 18 6 9 16 9h108q11 0 16-10l120-238q11-21 32-69 5 13 17 38t15 34l107 234q4 11 16 11h106q10 0 15-9 5-8 1-18l-175-323h120q7 0 13-5t5-13v-58q0-7-5-12t-13-5h-162v-48h162q7 0 13-5t5-13v-57q0-8-5-13t-13-5h-162v-184q0-7-5-13t-12-5z" horiz-adv-x="573.1" />
182
-
183
- <glyph glyph-name="rouble" unicode="&#xf158;" d="M582 535q0 56-36 90t-96 35h-178v-250h178q60 0 96 34t36 91z m132 0q0-108-70-176t-182-68h-190v-66h282q7 0 12-5t5-13v-71q0-8-5-13t-12-5h-282v-107q0-8-5-13t-13-5h-93q-8 0-13 5t-5 13v107h-125q-8 0-13 5t-5 13v71q0 8 5 13t13 5h125v66h-125q-8 0-13 5t-5 13v83q0 7 5 12t13 6h125v351q0 8 5 13t13 5h301q111 0 182-68t70-176z" horiz-adv-x="714.3" />
184
-
185
- <glyph glyph-name="won" unicode="&#xf159;" d="M287 183l45 167h-89l42-167q1-1 1-2t0-2q0 1 1 2t0 2z m65 238l19 72h-163l18-72h126z m107 0h77l-19 72h-39z m250-238l44 167h-91l46-167q0 0 0-2t1-2q0 1 0 2t0 2z m62 238l19 72h-166l19-72h128z m229-17v-36q0-8-5-13t-13-5h-119l-91-344q-4-13-17-13h-89q-14 0-18 13l-92 344h-117l-93-344q-4-13-17-13h-89q-6 0-11 4t-6 9l-89 344h-116q-8 0-13 5t-5 13v36q0 7 5 12t13 5h98l-19 72h-79q-8 0-13 5t-5 13v35q0 8 5 13t13 5h61l-50 192q-3 9 3 16 5 7 14 7h77q14 0 17-14l50-201h201l54 201q4 14 17 14h70q14 0 18-14l54-201h204l52 201q3 14 17 14h77q9 0 14-7 6-7 3-16l-51-192h62q8 0 13-5t5-13v-35q0-8-5-13t-13-5h-81l-19-72h100q8 0 13-5t5-12z" horiz-adv-x="1000" />
186
-
187
- <glyph glyph-name="bitcoin" unicode="&#xf15a;" d="M651 493q10-102-73-144 65-16 98-58t25-119q-4-40-18-70t-36-49-54-33-68-19-81-9v-142h-86v140q-45 0-68 1v-141h-86v142q-10 0-30 1t-31 0h-112l18 102h62q27 0 32 28v225h9q-4 0-9 0v161q-7 37-50 37h-62v92l119-1q35 0 54 1v141h86v-138q45 1 68 1v137h86v-141q44-4 78-13t63-25 46-43 20-64z m-120-304q0 20-8 35t-21 26-32 17-36 11-42 5-38 1-36 0-27-1v-189q5 0 21 0t27 0 29 1 33 2 32 5 31 8 26 11 22 17 14 22 5 29z m-39 265q0 19-7 33t-17 23-27 16-31 9-34 5-32 1-31 0-22-1v-171q3 0 20 0t26 0 27 1 31 3 29 6 27 10 21 15 15 22 5 28z" horiz-adv-x="714.3" />
188
-
189
- <glyph glyph-name="sort-alt-up" unicode="&#xf160;" d="M411 46q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m589-71v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-357q-8 0-13 5t-5 13v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m-107 285v-107q0-7-5-12t-13-6h-250q-8 0-13 6t-5 12v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z" horiz-adv-x="1000" />
190
-
191
- <glyph glyph-name="sort-alt-down" unicode="&#xf161;" d="M679-25v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z m-268 71q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m375 215v-107q0-8-5-13t-13-5h-250q-8 0-13 5t-5 13v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m107 285v-107q0-7-5-12t-13-6h-357q-8 0-13 6t-5 12v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m107 286v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z" horiz-adv-x="1000" />
192
-
193
- <glyph glyph-name="bug" unicode="&#xf188;" d="M911 314q0-14-11-25t-25-10h-125q0-96-37-162l116-117q10-11 10-25t-10-25q-10-11-25-11t-25 11l-111 110q-3-3-8-7t-24-16-36-21-46-16-54-7v500h-71v-500q-29 0-57 7t-49 19-36 22-25 18l-8 8-102-116q-11-12-27-12-13 0-24 9-11 10-11 25t8 26l113 127q-32 63-32 153h-125q-15 0-25 10t-11 25 11 25 25 11h125v164l-97 97q-11 10-11 25t11 25 25 10 25-10l97-97h471l96 97q11 10 25 10t26-10 10-25-10-25l-97-97v-164h125q15 0 25-11t11-25z m-268 322h-357q0 74 52 126t126 52 127-52 52-126z" horiz-adv-x="928.6" />
194
-
195
- <glyph glyph-name="try" unicode="&#xf195;" d="M643 386q0-107-53-197t-143-143-197-53h-89q-8 0-13 5t-5 13v341l-120-37q-2-1-5-1-6 0-11 4-7 5-7 14v72q0 12 13 17l130 40v51l-120-36q-2-1-5-1-6 0-11 3-7 6-7 15v71q0 13 13 18l130 39v140q0 8 5 13t13 5h89q8 0 13-5t5-13v-101l209 64q9 3 16-2t7-15v-71q0-13-13-18l-219-67v-52l209 65q9 3 16-3t7-15v-71q0-13-13-17l-219-68v-272q105 8 177 85t73 183q0 8 5 13t13 5h89q8 0 13-5t5-13z" horiz-adv-x="642.9" />
196
-
197
- <glyph glyph-name="wordpress" unicode="&#xf19a;" d="M71 350q0 91 37 175l205-561q-109 53-176 157t-66 229z m719 22q0-11-2-22t-5-27-7-25-9-33-10-32l-43-143-155 461q26 2 49 4 11 2 15 11t-2 17-15 8l-115-6q-42 1-113 6-6 0-11-3t-6-9-1-10 5-9 11-5l44-4 67-183-94-281-156 464q26 2 49 4 11 2 15 11t-2 17-15 8l-115-6q-4 0-13 0t-14 1q58 89 153 141t205 52q82 0 157-29t133-84h-6q-31 0-51-22t-21-53q0-7 1-14t2-12 5-13 5-11 7-13 7-12 8-13 8-13q35-60 35-118z m-283-59l133-361q0-4 2-7-70-24-142-24-62 0-121 18z m369 243q53-97 53-206 0-117-58-215t-156-156l132 379q33 94 33 154 0 23-4 44z m-376 294q102 0 194-40t160-106 106-160 40-194-40-194-106-160-160-106-194-40-194 40-160 106-106 160-40 194 40 194 106 160 160 106 194 40z m0-977q97 0 185 38t152 102 102 152 38 185-38 185-102 152-152 102-185 38-185-38-152-102-102-152-38-185 38-185 102-152 152-102 185-38z" horiz-adv-x="1000" />
198
-
199
- <glyph glyph-name="cubes" unicode="&#xf1b3;" d="M357-61l214 107v176l-214-92v-191z m-36 254l226 96-226 97-225-97z m608-254l214 107v176l-214-92v-191z m-36 254l225 96-225 97-226-97z m-250 163l214 92v149l-214-92v-149z m-36 212l246 105-246 106-246-106z m607-289v-233q0-20-10-37t-29-26l-250-125q-14-8-32-8t-32 8l-250 125q-2 1-4 2-1-1-4-2l-250-125q-14-8-32-8t-31 8l-250 125q-19 9-29 26t-11 37v233q0 21 12 39t32 26l242 104v223q0 22 12 40t31 26l250 107q13 6 28 6t28-6l250-107q20-9 32-26t12-40v-223l242-104q20-8 32-26t11-39z" horiz-adv-x="1285.7" />
200
-
201
- <glyph glyph-name="database" unicode="&#xf1c0;" d="M429 421q132 0 247 24t181 71v-95q0-38-57-71t-157-52-214-19-215 19-156 52-58 71v95q66-47 181-71t248-24z m0-428q132 0 247 24t181 71v-95q0-39-57-72t-157-52-214-19-215 19-156 52-58 72v95q66-47 181-71t248-24z m0 214q132 0 247 24t181 71v-95q0-38-57-71t-157-52-214-20-215 20-156 52-58 71v95q66-47 181-71t248-24z m0 643q116 0 214-19t157-52 57-72v-71q0-39-57-72t-157-52-214-19-215 19-156 52-58 72v71q0 39 58 72t156 52 215 19z" horiz-adv-x="857.1" />
202
-
203
- <glyph glyph-name="circle-thin" unicode="&#xf1db;" d="M429 707q-73 0-139-28t-114-76-76-114-29-139 29-139 76-113 114-77 139-28 138 28 114 77 76 113 29 139-29 139-76 114-114 76-138 28z m428-357q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
204
-
205
- <glyph glyph-name="sliders" unicode="&#xf1de;" d="M196 64v-71h-196v71h196z m197 72q14 0 25-11t11-25v-143q0-14-11-25t-25-11h-143q-14 0-25 11t-11 25v143q0 15 11 25t25 11h143z m89 214v-71h-482v71h482z m-357 286v-72h-125v72h125z m732-572v-71h-411v71h411z m-536 643q15 0 26-10t10-26v-142q0-15-10-25t-26-11h-142q-15 0-25 11t-11 25v142q0 15 11 26t25 10h142z m358-286q14 0 25-10t10-25v-143q0-15-10-25t-25-11h-143q-15 0-25 11t-11 25v143q0 14 11 25t25 10h143z m178-71v-71h-125v71h125z m0 286v-72h-482v72h482z" horiz-adv-x="857.1" />
206
-
207
- <glyph glyph-name="share" unicode="&#xf1e0;" d="M679 279q74 0 126-53t52-126-52-126-126-53-127 53-52 126q0 7 1 19l-201 100q-51-48-121-48-75 0-127 53t-52 126 52 126 127 53q70 0 121-48l201 100q-1 12-1 19 0 74 52 126t127 53 126-53 52-126-52-126-126-53q-71 0-122 48l-201-100q1-12 1-19t-1-19l201-100q51 48 122 48z" horiz-adv-x="857.1" />
208
-
209
- <glyph glyph-name="plug" unicode="&#xf1e6;" d="M979 597q21-21 21-50t-21-51l-223-223 83-84-89-89q-91-91-217-104t-230 56l-202-202h-101v101l202 202q-69 103-56 230t104 217l89 89 84-83 223 223q21 21 51 21t50-21 21-50-21-51l-223-223 131-131 223 223q22 21 51 21t50-21z" horiz-adv-x="1000" />
210
-
211
- <glyph glyph-name="trash" unicode="&#xf1f8;" d="M286 82v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m143 0v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m142 0v393q0 8-5 13t-12 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q7 0 12 5t5 13z m-303 554h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
212
-
213
- <glyph glyph-name="chart-line" unicode="&#xf201;" d="M1143-7v-72h-1143v858h71v-786h1072z m-72 696v-242q0-12-10-17t-20 4l-68 68-353-353q-6-6-13-6t-13 6l-130 130-232-233-107 108 327 326q5 6 12 6t13-6l130-130 259 259-67 68q-9 8-5 19t17 11h243q7 0 12-5t5-13z" horiz-adv-x="1142.9" />
214
-
215
- <glyph glyph-name="shekel" unicode="&#xf20b;" d="M554 502v-277q0-8-5-13t-13-5h-90q-7 0-12 5t-5 13v277q0 62-45 107t-107 45h-152v-643q0-8-5-13t-13-5h-89q-8 0-13 5t-5 13v750q0 8 5 13t13 5h259q75 0 139-37t101-101 37-139z m214 259v-491q0-76-37-139t-101-101-139-37h-259q-8 0-13 5t-5 13v535q0 8 5 13t13 5h89q8 0 13-5t5-13v-428h152q63 0 107 45t45 107v491q0 8 5 13t13 5h89q8 0 13-5t5-13z" horiz-adv-x="857.1" />
216
-
217
- <glyph glyph-name="user-secret" unicode="&#xf21b;" d="M321-7l54 250-54 71-71 36z m143 0l72 357-72-36-53-71z m90 564q-1 2-3 3-5 4-53 4-39 0-93-10-4-1-12-1t-12 1q-54 10-93 10-48 0-54-4-1-1-2-3 1-11 2-16 2-1 5-3t4-6q1-2 4-11t4-12 4-9 5-10 5-8 7-7 7-6 10-4 12-2 13-1q20 0 33 7t18 16 8 20 7 16 10 7h6q6 0 10-7t6-16 9-20 18-16 33-7q7 0 13 1t12 2 9 4 8 6 7 7 5 8 5 10 4 9 4 12 4 11q1 4 4 6t4 3q2 5 3 16z m232-491q0-68-41-106t-108-39h-488q-67 0-108 39t-41 106q0 34 3 66t10 70 21 69 36 58 52 41l-51 123h120q-12 36-12 71 0 7 1 18-109 23-109 54 0 32 118 55 9 35 28 75t40 63q18 21 42 21 17 0 47-17t47-18 47 18 47 17q24 0 42-21 20-23 39-63t29-75q117-23 117-55 0-31-108-54 4-45-11-89h119l-45-126q35-18 60-54t36-80 16-84 5-83z" horiz-adv-x="857.1" />
218
-
219
- <glyph glyph-name="user-plus" unicode="&#xf234;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m536-71h196q7 0 13-6t5-12v-107q0-8-5-13t-13-5h-196v-197q0-7-6-12t-12-6h-107q-8 0-13 6t-5 12v197h-197q-7 0-12 5t-6 13v107q0 7 6 12t12 6h197v196q0 7 5 13t13 5h107q7 0 12-5t6-13v-196z m-411-125q0-29 21-51t50-21h143v-133q-38-28-95-28h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 44-34 86-51t92-17 92 17 86 51q11 10 22 10 73 0 121-54h-125q-29 0-50-21t-21-50v-107z" horiz-adv-x="1142.9" />
220
-
221
- <glyph glyph-name="user-times" unicode="&#xf235;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m601-179l139-138q5-5 5-13 0-8-5-13l-76-76q-5-5-12-5-8 0-13 5l-139 139-139-139q-5-5-13-5-7 0-12 5l-76 76q-5 5-5 13 0 8 5 13l139 138-139 139q-5 5-5 13 0 8 5 13l76 75q5 5 12 5 8 0 13-5l139-139 139 139q5 5 13 5 7 0 12-5l76-75q5-5 5-13 0-8-5-13z m-278 0l-101-101q-21-20-21-50 0-30 21-51l46-46q-11-2-24-2h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 86-68 178-68t178 68q11 10 22 10 15 0 31-4-15-15-22-27t-8-32q0-30 21-51z" horiz-adv-x="1142.9" />
222
-
223
- <glyph glyph-name="viacoin" unicode="&#xf237;" d="M857 850l-107-250h107v-107h-153l-30-72h183v-107h-229l-199-464-200 464h-229v107h184l-31 72h-153v107h107l-107 250h143l180-429h211l180 429h143z m-428-679l60 143h-121z" horiz-adv-x="857.1" />
224
-
225
- <glyph glyph-name="safari" unicode="&#xf267;" d="M530 352q0-15-10-25t-23-11q-14 0-25 9t-10 23q0 15 9 25t23 11 25-9 11-23z m8-33l195 325q-5-5-37-35t-70-65-77-71-65-62-28-29l-195-323q4 4 38 34t70 65 76 71 65 62 28 28z m361 31q0-112-58-207-2 1-9 6t-15 9-9 5q-8 0-8-8 0-5 33-24-41-63-103-107t-135-61l-8 37q-1 6-9 6-3 0-4-3t-1-6l9-38q-41-8-82-8-111 0-208 59 1 1 8 11t12 19 5 10q0 8-7 8-4 0-10-8t-12-20-8-13q-63 42-107 105t-61 137l38 8q6 2 6 8 0 3-3 5t-6 1l-38-9q-8 41-8 78 0 115 61 212 1-1 10-7t17-11 10-4q7 0 7 6 0 4-7 9t-18 12l-11 7q43 62 105 105t136 60l9-37q1-6 8-6 3 0 5 3t1 6l-9 37q40 7 75 7 114 0 212-61-22-31-22-36 0-7 6-7 7 0 27 35 62-41 105-103t60-135l-31-7q-6-1-6-8 0-3 3-5t5-1l32 7q8-40 8-78z m47 0q0 91-35 174t-95 142-142 95-174 35-173-35-143-95-95-142-35-174 35-173 95-143 143-95 173-35 174 35 142 95 95 143 35 173z m54 0q0-102-40-194t-106-160-160-106-194-40-194 40-160 106-106 160-40 194 40 194 106 160 160 106 194 40 194-40 160-106 106-160 40-194z" horiz-adv-x="1000" />
226
-
227
- <glyph glyph-name="chrome" unicode="&#xf268;" d="M498 850q134 1 252-67 130-75 196-208l-414 22q-89 5-164-41t-103-128l-154 236q72 89 174 137t213 49z m-416-226l188-370q40-80 117-121t164-25l-129-252q-118 19-214 88t-152 176-56 230q0 149 82 274z m885-94q32-84 33-174t-27-170-86-152-137-117q-128-74-278-66l226 347q49 73 46 162t-59 155z m-467-11q70 0 119-50t50-119-50-119-119-49-119 49-49 119 49 119 119 50z" horiz-adv-x="1000" />
228
-
229
- <glyph glyph-name="firefox" unicode="&#xf269;" d="M504-150q-158 0-282 84t-183 222q-33 74-38 168t15 186 62 174 100 135l-7-156q7 7 38 8t39-8q24 45 90 77t131 32q-30-25-67-82t-33-92q14-4 35-7t36-4 37-3 29-1q8-3 5-26t-17-42q-3-4-9-10t-32-20-56-19l8-105-77 37q-10-24-5-45t21-38 36-23 45-3q29 5 55 19t47 25 41 10q34-2 50-19t10-36q0-1-1-3t-5-7-10-9-17-5-26-1q-34-53-81-76t-117-16q41-34 91-46t94-3 86 29 71 48 45 58q24 51 22 108t-21 105-44 70q49-21 77-45t43-62q8 95-32 191t-117 159q148-43 230-156t84-289q1-71-23-143t-68-132-106-110-138-75-161-28z" horiz-adv-x="1000" />
230
-
231
- <glyph glyph-name="opera" unicode="&#xf26a;" d="M833 723q-92 61-200 61-87 0-164-41t-134-111q-41-52-66-122t-27-148v-24q2-78 27-148t66-122q57-71 134-111t164-41q108 0 200 61-67-60-153-94t-180-33q-16 0-24 1-98 4-186 45t-152 108-101 157-37 189q0 102 40 194t106 160 160 106 194 40h2q93-1 179-34t152-93z m167-373q0-107-43-202t-119-166q-58-35-124-35-76 0-142 47 86 31 141 130t56 226q0 127-55 225t-141 131q66 46 141 46 67 0 126-36 76-70 118-164t42-202z" horiz-adv-x="1000" />
232
-
233
- <glyph glyph-name="internet-explorer" unicode="&#xf26b;" d="M1000 327q0-31-4-58h-642q0-81 61-136t144-55q55 0 103 26t76 73h236q-31-89-95-157t-149-106-179-37q-105 0-199 47-127-65-220-65-132 0-132 147 0 64 25 153 10 34 61 128 111 201 265 338-103-44-238-197 35 153 158 250t280 98q17 0 25 0 142 65 242 65 35 0 64-7t53-23 37-42 14-65q0-64-42-159 56-102 56-218z m-39 357q0 47-30 74t-76 27q-60 0-142-39 68-26 124-73t96-109q28 75 28 120z m-890-690q0-48 28-74t75-26q64 0 148 46-68 41-119 103t-77 136q-55-114-55-185z m282 398h406q-3 79-63 132t-140 53q-81 0-140-53t-63-132z" horiz-adv-x="1000" />
234
-
235
- <glyph glyph-name="television" unicode="&#xf26c;" d="M1000 154v535q0 8-5 13t-13 5h-893q-7 0-12-5t-6-13v-535q0-8 6-13t12-5h893q7 0 13 5t5 13z m71 535v-535q0-37-26-63t-63-27h-411v-71h197q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v36q0 8 5 13t13 5h196v71h-411q-36 0-63 27t-26 63v535q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1142.9" />
236
-
237
- <glyph glyph-name="percent" unicode="&#xf295;" d="M714 136q0 29-21 50t-50 21-50-21-22-50 22-50 50-22 50 22 21 50z m-428 428q0 29-21 51t-51 21-50-21-21-51 21-50 50-21 51 21 21 50z m571-428q0-89-63-152t-151-63-152 63-62 152 62 151 152 63 151-63 63-151z m-53 607q0-11-8-21l-589-786q-11-15-28-15h-90q-14 0-25 11t-10 25q0 11 7 21l589 786q11 15 29 15h89q14 0 25-11t11-25z m-375-179q0-88-63-151t-152-63-151 63-63 151 63 152 151 63 152-63 63-152z" horiz-adv-x="857.1" />
238
- </font>
239
- </defs>
240
  </svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2019 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="fontello" horiz-adv-x="1000" >
7
+ <font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="download" unicode="&#xe800;" d="M714 590q15-15 15-37t-15-36l-245-244-245 244q-15 15-15 36t15 37 36 15q23 0 38-15l118-120 0 349q0 21 16 37t37 16 37-16 15-37l0-349 119 120q14 14 38 14 22 0 36-14z m222-448l2-261q0-21-16-36t-37-16l-832 0q-22 0-37 16t-16 36q0 261 1 261 0 11 2 16l105 312q12 37 48 37l12 0q8-18 18-28l78-76-70 0-86-261 722 0-86 261-70 0 77 76q10 10 19 28l11 0q37 0 49-37l105-312q1-5 1-16z" horiz-adv-x="938" />
10
+
11
+ <glyph glyph-name="glass" unicode="&#xe801;" d="M948 746q0-19-24-43l-353-353v-429h179q15 0 25-10t11-25-11-25-25-11h-500q-14 0-25 11t-11 25 11 25 25 10h179v429l-353 353q-24 24-24 43 0 13 10 21t21 9 24 3h786q13 0 24-3t21-9 10-21z" horiz-adv-x="1000" />
12
+
13
+ <glyph glyph-name="emo-happy" unicode="&#xe802;" d="M261 800c-60 0-109-65-109-144 0-80 49-145 109-145s110 65 110 145c0 79-49 144-110 144z m477 0c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m208-599c-13 0-27-5-37-16-4-4-8-8-12-12-111-109-253-164-396-165-142-2-285 50-396 155l-3 3-12 12c-21 21-54 20-75-1-20-21-20-55 1-76 3-4 8-8 14-14l3-3c132-124 301-186 469-184 169 1 337 67 468 195 5 5 9 10 14 14 20 22 20 56-1 77-10 10-23 15-37 15z" horiz-adv-x="999" />
14
+
15
+ <glyph glyph-name="search" unicode="&#xe803;" d="M643 386q0 103-73 176t-177 74-177-74-73-176 73-177 177-73 177 73 73 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69-80 0-153 31t-125 84-84 125-31 153 31 152 84 126 125 84 153 31 153-31 125-84 84-126 31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
16
+
17
+ <glyph glyph-name="emo-unhappy" unicode="&#xe804;" d="M261 800c-60 0-109-65-109-144 0-80 49-145 109-145s110 65 110 145c0 79-49 144-110 144z m477 0c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m-244-599c-165 0-331-62-461-184l-3-3c-6-5-11-10-14-14-21-21-21-55-1-76 21-21 54-21 75-1l12 12 3 3c111 105 254 157 396 155 143-1 285-56 396-165 4-4 8-8 12-12 20-21 54-21 74-1 21 21 21 55 1 77-5 5-9 10-14 14-131 129-299 194-468 195-3 0-6 0-8 0z" horiz-adv-x="999" />
18
+
19
+ <glyph glyph-name="mail" unicode="&#xe805;" d="M929 11v428q-18-20-39-36-149-115-238-189-28-24-46-37t-48-28-57-13h-2q-26 0-57 13t-48 28-46 37q-88 74-238 189-21 16-39 36v-428q0-7 6-13t12-5h822q7 0 12 5t6 13z m0 586v14t-1 7-1 7-3 5-5 4-8 2h-822q-7 0-12-6t-6-12q0-94 83-159 107-84 223-176 4-3 20-17t25-21 25-17 28-16 24-5h2q11 0 24 5t28 16 25 17 25 21 20 17q116 92 224 176 30 24 56 65t26 73z m71 21v-607q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v607q0 37 26 63t63 26h822q37 0 63-26t26-63z" horiz-adv-x="1000" />
20
+
21
+ <glyph glyph-name="info-circled" unicode="&#xe806;" d="M571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
22
+
23
+ <glyph glyph-name="help-circled" unicode="&#xe807;" d="M500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-13 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-15-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
24
+
25
+ <glyph glyph-name="heart" unicode="&#xe808;" d="M500-79q-14 0-25 10l-348 336q-5 5-15 15t-31 37-38 54-30 67-13 77q0 123 71 192t196 70q34 0 70-12t67-33 54-38 42-38q20 20 42 38t54 38 67 33 70 12q125 0 196-70t71-192q0-123-128-251l-347-335q-10-10-25-10z" horiz-adv-x="1000" />
26
+
27
+ <glyph glyph-name="heart-empty" unicode="&#xe809;" d="M929 517q0 46-12 80t-31 55-46 33-52 18-55 4-62-14-62-36-48-40-34-34q-10-13-27-13t-27 13q-14 15-34 34t-48 40-62 36-62 14-55-4-52-18-46-33-31-55-12-80q0-93 105-198l324-312 324 312q105 105 105 198z m71 0q0-123-128-251l-347-335q-10-10-25-10t-25 10l-348 336q-5 5-15 15t-31 37-38 54-30 67-13 77q0 123 71 192t196 70q34 0 70-12t67-33 54-38 42-38q20 20 42 38t54 38 67 33 70 12q125 0 196-70t71-192z" horiz-adv-x="1000" />
28
+
29
+ <glyph glyph-name="star" unicode="&#xe80a;" d="M929 489q0-12-15-27l-202-197 48-279q0-4 0-12 0-11-6-19t-17-9q-10 0-22 7l-251 132-250-132q-12-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27 0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26z" horiz-adv-x="928.6" />
30
+
31
+ <glyph glyph-name="star-empty" unicode="&#xe80b;" d="M635 290l170 166-235 34-106 213-105-213-236-34 171-166-41-235 211 111 211-111z m294 199q0-12-15-27l-202-197 48-279q0-4 0-12 0-28-23-28-10 0-22 7l-251 132-250-132q-12-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27 0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26z" horiz-adv-x="928.6" />
32
+
33
+ <glyph glyph-name="user" unicode="&#xe80c;" d="M714 69q0-60-35-104t-84-44h-476q-49 0-84 44t-35 104q0 48 5 90t17 85 33 73 52 50 76 19q73-72 174-72t175 72q42 0 75-19t52-50 33-73 18-85 4-90z m-143 495q0-88-62-151t-152-63-151 63-63 151 63 152 151 63 152-63 62-152z" horiz-adv-x="714.3" />
34
+
35
+ <glyph glyph-name="users" unicode="&#xe80d;" d="M331 350q-90-3-148-71h-75q-45 0-77 22t-31 66q0 197 69 197 4 0 25-11t54-24 66-12q38 0 75 13-3-21-3-37 0-78 45-143z m598-356q0-66-41-105t-108-39h-488q-68 0-108 39t-41 105q0 30 2 58t8 61 14 61 24 54 35 45 48 30 62 11q6 0 24-12t41-26 59-27 76-12 75 12 60 27 41 26 24 12q34 0 62-11t47-30 35-45 24-54 15-61 8-61 2-58z m-572 713q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m393-214q0-89-63-152t-151-62-152 62-63 152 63 151 152 63 151-63 63-151z m321-126q0-43-31-66t-77-22h-75q-57 68-147 71 45 65 45 143 0 16-3 37 37-13 74-13 33 0 67 12t54 24 24 11q69 0 69-197z m-71 340q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z" horiz-adv-x="1071.4" />
36
+
37
+ <glyph glyph-name="th-large" unicode="&#xe80e;" d="M429 279v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z m500-428v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z" horiz-adv-x="928.6" />
38
+
39
+ <glyph glyph-name="th" unicode="&#xe80f;" d="M286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m357-285v-108q0-22-16-37t-38-16h-178q-22 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m-357 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m357-286v-107q0-22-16-38t-38-15h-178q-22 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-178q-22 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z" horiz-adv-x="1000" />
40
+
41
+ <glyph glyph-name="th-list" unicode="&#xe810;" d="M286 154v-108q0-22-16-37t-38-16h-178q-23 0-38 16t-16 37v108q0 22 16 38t38 15h178q23 0 38-15t16-38z m0 285v-107q0-22-16-38t-38-15h-178q-23 0-38 15t-16 38v107q0 23 16 38t38 16h178q23 0 38-16t16-38z m714-285v-108q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v108q0 22 16 38t38 15h535q23 0 38-15t16-38z m-714 571v-107q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v107q0 22 16 38t38 16h178q23 0 38-16t16-38z m714-286v-107q0-22-16-38t-38-15h-535q-23 0-38 15t-16 38v107q0 23 16 38t38 16h535q23 0 38-16t16-38z m0 286v-107q0-22-16-38t-38-16h-535q-23 0-38 16t-16 38v107q0 22 16 38t38 16h535q23 0 38-16t16-38z" horiz-adv-x="1000" />
42
+
43
+ <glyph glyph-name="to-end" unicode="&#xe811;" d="M25-71q-10-11-18-8t-7 18v822q0 14 7 18t18-8l396-396q5-5 8-10v378q0 14 10 25t25 11h72q14 0 25-11t10-25v-786q0-14-10-25t-25-11h-72q-14 0-25 11t-10 25v379q-3-6-8-11z" horiz-adv-x="571.4" />
44
+
45
+ <glyph glyph-name="to-start" unicode="&#xe812;" d="M546 771q11 11 18 8t7-18v-822q0-14-7-18t-18 8l-396 396q-5 5-7 11v-379q0-14-11-25t-25-11h-71q-15 0-25 11t-11 25v786q0 14 11 25t25 11h71q15 0 25-11t11-25v-378q2 5 7 10z" horiz-adv-x="571.4" />
46
+
47
+ <glyph glyph-name="fast-fw" unicode="&#xe813;" d="M25-71q-10-11-18-8t-7 18v822q0 14 7 18t18-8l396-396q5-5 8-10v396q0 14 7 18t18-8l396-396q11-10 11-25t-11-25l-396-396q-11-11-18-8t-7 18v397q-3-6-8-11z" horiz-adv-x="928.6" />
48
+
49
+ <glyph glyph-name="fast-bw" unicode="&#xe814;" d="M904 771q10 11 17 8t8-18v-822q0-14-8-18t-17 8l-397 396q-5 5-7 11v-397q0-14-7-18t-18 8l-396 396q-11 11-11 25t11 25l396 396q11 11 18 8t7-18v-396q2 5 7 10z" horiz-adv-x="928.6" />
50
+
51
+ <glyph glyph-name="off" unicode="&#xe815;" d="M857 350q0-87-34-166t-91-137-137-92-166-34-167 34-136 92-92 137-34 166q0 102 45 191t126 151q24 18 54 14t46-28q18-23 14-53t-28-47q-54-41-84-101t-30-127q0-58 23-111t61-91 91-61 111-23 110 23 92 61 61 91 22 111q0 68-30 127t-84 101q-23 18-28 47t14 53q17 24 47 28t53-14q81-61 126-151t45-191z m-357 429v-358q0-29-21-50t-50-21-51 21-21 50v358q0 29 21 50t51 21 50-21 21-50z" horiz-adv-x="857.1" />
52
+
53
+ <glyph glyph-name="chart-bar" unicode="&#xe816;" d="M357 350v-286h-143v286h143z m214 286v-572h-142v572h142z m572-643v-72h-1143v858h71v-786h1072z m-357 500v-429h-143v429h143z m214 214v-643h-143v643h143z" horiz-adv-x="1142.9" />
54
+
55
+ <glyph glyph-name="home" unicode="&#xe817;" d="M786 296v-267q0-15-11-25t-25-11h-214v214h-143v-214h-214q-15 0-25 11t-11 25v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-3-7 1-12 6l-35 41q-4 6-3 13t6 12l401 334q18 15 42 15t43-15l136-113v108q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q6-4 6-12t-4-13z" horiz-adv-x="928.6" />
56
+
57
+ <glyph glyph-name="link-1" unicode="&#xe818;" d="M813 171q0 23-16 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40 0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q16 16 16 37z m-393 394q0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 11-8 12-12 10-11q18 17 18 41z m500-394q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46 67 0 114-47l115-116q46-46 46-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
58
+
59
+ <glyph glyph-name="lock-open" unicode="&#xe819;" d="M929 529v-143q0-15-11-25t-25-11h-36q-14 0-25 11t-11 25v143q0 59-41 101t-101 41-101-41-42-101v-108h53q23 0 38-15t16-38v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h375v108q0 103 73 176t177 74 176-74 74-176z" horiz-adv-x="928.6" />
60
+
61
+ <glyph glyph-name="eye" unicode="&#xe81a;" d="M929 314q-85 132-213 197 34-58 34-125 0-103-73-177t-177-73-177 73-73 177q0 67 34 125-128-65-213-197 75-114 187-182t242-68 243 68 186 182z m-402 215q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m473-215q0-19-11-38-78-129-210-206t-279-77-279 77-210 206q-11 19-11 38t11 39q78 128 210 205t279 78 279-78 210-205q11-20 11-39z" horiz-adv-x="1000" />
62
+
63
+ <glyph glyph-name="eye-off" unicode="&#xe81b;" d="M310 105l43 79q-48 35-76 88t-27 114q0 67 34 125-128-65-213-197 94-144 239-209z m217 424q0 11-8 19t-19 7q-70 0-120-50t-50-119q0-11 8-19t19-8 19 8 8 19q0 48 34 82t82 34q11 0 19 8t8 19z m202 106q0-4 0-5-59-105-176-316t-176-316l-28-50q-5-9-15-9-7 0-75 39-9 6-9 16 0 7 25 49-80 36-147 96t-117 137q-11 17-11 38t11 39q86 131 212 207t277 76q50 0 100-10l31 54q5 9 15 9 3 0 10-3t18-9 18-10 18-10 10-7q9-5 9-15z m21-249q0-78-44-142t-117-91l157 280q4-25 4-47z m250-72q0-19-11-38-22-36-61-81-84-96-194-149t-234-53l41 74q119 10 219 76t169 171q-65 100-158 164l35 63q53-36 102-85t81-103q11-19 11-39z" horiz-adv-x="1000" />
64
+
65
+ <glyph glyph-name="download-1" unicode="&#xe81c;" d="M714 100q0 15-10 25t-25 11-25-11-11-25 11-25 25-11 25 11 10 25z m143 0q0 15-10 25t-26 11-25-11-10-25 10-25 25-11 26 11 10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-39l-250-250q-10-11-25-11t-25 11l-250 250q-17 16-8 39 10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
66
+
67
+ <glyph glyph-name="chat" unicode="&#xe81d;" d="M786 421q0-77-53-143t-143-104-197-38q-48 0-98 9-70-49-155-72-21-5-48-9h-2q-6 0-12 5t-6 12q-1 1-1 3t1 4 1 3l1 3t2 3 2 3 3 3 2 2q3 3 13 14t15 16 12 17 14 21 11 25q-69 40-108 98t-40 125q0 78 53 144t143 104 197 38 197-38 143-104 53-144z m214-142q0-67-40-126t-108-98q5-14 11-25t14-21 13-16 14-17 13-14q0 0 2-2t3-3 2-3 2-3l1-3t1-3 1-4-1-3q-2-8-7-13t-12-4q-28 4-48 9-86 23-156 72-50-9-98-9-151 0-263 74 32-3 49-3 90 0 172 25t148 72q69 52 107 119t37 141q0 43-13 85 72-39 114-99t42-128z" horiz-adv-x="1000" />
68
+
69
+ <glyph glyph-name="comment" unicode="&#xe81e;" d="M1000 350q0-97-67-179t-182-130-251-48q-39 0-81 4-110-97-257-135-27-8-63-12-10-1-17 5t-10 16v1q-2 2 0 6t1 6 2 5l4 5t4 5 4 5q4 5 17 19t20 22 17 22 18 28 15 33 15 42q-88 50-138 123t-51 157q0 73 40 139t106 114 160 76 194 28q136 0 251-48t182-130 67-179z" horiz-adv-x="1000" />
70
+
71
+ <glyph glyph-name="doc" unicode="&#xe81f;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z" horiz-adv-x="857.1" />
72
+
73
+ <glyph glyph-name="lock" unicode="&#xe820;" d="M179 421h285v108q0 59-42 101t-101 41-101-41-41-101v-108z m464-53v-322q0-22-16-37t-38-16h-535q-23 0-38 16t-16 37v322q0 22 16 38t38 15h17v108q0 102 74 176t176 74 177-74 73-176v-108h18q23 0 38-15t16-38z" horiz-adv-x="642.9" />
74
+
75
+ <glyph glyph-name="emo-wink2" unicode="&#xe821;" d="M664 800c-61 0-110-65-110-144 0-80 49-145 110-145 60 0 110 65 110 145 0 79-50 144-110 144z m-343-98l-267 0c-30 0-54-24-54-54 0-30 24-54 54-54l267 0c30 0 54 24 54 54 0 30-24 54-54 54z m-262-361c-6 0-13-1-19-3-27-10-41-41-31-68 46-127 136-228 249-289 22-12 45-22 69-31 58-21 120-33 184-33 57 0 113 9 166 27 10 3 20 7 30 11 11 4 22 8 31 12l0 1 0 0 0 0c26 12 38 44 25 71-13 26-44 37-70 25l0 0c-9-4-17-8-24-11-8-3-17-6-25-8-43-14-88-22-133-22-51 0-101 10-148 27-19 7-37 15-55 25-90 48-163 130-200 231-8 21-28 35-49 35z" horiz-adv-x="774" />
76
+
77
+ <glyph glyph-name="plus" unicode="&#xe822;" d="M786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q23 0 38-16t16-38z" horiz-adv-x="785.7" />
78
+
79
+ <glyph glyph-name="upload" unicode="&#xe823;" d="M936 128l2-260q0-21-16-37t-37-15l-832 0q-22 0-37 15t-16 37q0 260 1 260 0 12 2 17l105 312q12 36 48 36l209 0 0-103-171 0-86-262 722 0-86 262-171 0 0 103 208 0q37 0 49-36l105-312q1-5 1-17z m-258 423q-24 0-38 14l-119 120 0-348q0-21-15-37t-37-15-37 15-16 37l0 348-118-120q-14-14-38-14-22 0-36 14-15 15-15 36t15 37l245 247 245-247q15-15 15-37t-15-36q-14-14-36-14z" horiz-adv-x="938" />
80
+
81
+ <glyph glyph-name="picture" unicode="&#xe824;" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
82
+
83
+ <glyph glyph-name="ok" unicode="&#xe825;" d="M933 534q0-22-16-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q16-15 16-38z" horiz-adv-x="1000" />
84
+
85
+ <glyph glyph-name="cancel" unicode="&#xe826;" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
86
+
87
+ <glyph glyph-name="pencil" unicode="&#xe827;" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
88
+
89
+ <glyph glyph-name="edit" unicode="&#xe828;" d="M496 189l64 65-85 85-64-65v-31h53v-54h32z m245 402q-9 9-18 0l-196-196q-9-9 0-18t18 0l196 196q9 9 0 18z m45-331v-106q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q35 0 65-14 9-4 10-13 2-10-5-16l-27-28q-8-8-18-4-13 3-25 3h-464q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v70q0 7 5 12l36 36q8 8 20 4t11-16z m-54 411l161-160-375-375h-161v160z m248-73l-51-52-161 161 51 52q16 15 38 15t38-15l85-85q16-16 16-38t-16-38z" horiz-adv-x="1000" />
90
+
91
+ <glyph glyph-name="forward" unicode="&#xe829;" d="M1000 493q0-15-11-25l-285-286q-11-11-25-11t-25 11-11 25v143h-125q-55 0-98-3t-86-12-74-24-59-39-45-56-27-77-10-101q0-31 3-69 0-4 2-13t1-15q0-8-5-14t-13-6q-9 0-15 10-4 5-8 12t-7 17-6 13q-71 159-71 252 0 111 30 186 90 225 488 225h125v143q0 14 11 25t25 10 25-10l285-286q11-11 11-25z" horiz-adv-x="1000" />
92
+
93
+ <glyph glyph-name="export" unicode="&#xe82a;" d="M750 60l0 56 100 82 0-188q0-20-15-35t-35-15l-750 0q-20 0-35 15t-15 35l0 550q0 22 14 36t36 14l288 0q-32-24-59-49t-39-39l-10-12-130 0 0-450 650 0z m-82 348q-166 0-242-41t-160-181q0 8 1 22t9 56 22 79 44 83 70 79 107 56 149 23l0 156 332-250-332-260 0 178z" horiz-adv-x="1000" />
94
+
95
+ <glyph glyph-name="trash-empty" unicode="&#xe82b;" d="M286 439v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m143 0v-321q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q8 0 13-5t5-13z m142 0v-321q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v321q0 8 5 13t13 5h36q7 0 12-5t5-13z m72-404v529h-500v-529q0-12 4-22t8-15 6-5h464q2 0 6 5t8 15 4 22z m-375 601h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
96
+
97
+ <glyph glyph-name="down-dir" unicode="&#xe82c;" d="M571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25 25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
98
+
99
+ <glyph glyph-name="up-dir" unicode="&#xe82d;" d="M571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25 11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
100
+
101
+ <glyph glyph-name="left-dir" unicode="&#xe82e;" d="M357 600v-500q0-14-10-25t-26-11-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11 10-25z" horiz-adv-x="357.1" />
102
+
103
+ <glyph glyph-name="right-dir" unicode="&#xe82f;" d="M321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11-11 25v500q0 15 11 25t25 11 25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
104
+
105
+ <glyph glyph-name="spin1" unicode="&#xe830;" d="M496 850c-176 0-331-90-421-226-18-27-33-55-46-85-12-29-21-60-28-92 0 0 0-1 0-1l0 0 0 0c0-1 0-2 0-2 0-7 5-12 11-12l101 0c5 0 10 4 11 9 29 113 109 206 214 253 20 10 41 17 63 23 31 7 62 11 95 11l0 0 0 0 0 0c25 0 50-2 74-7 5-1 10-2 14-3 6-1 10-3 14-4l0 0c5-1 11 1 13 6l51 87c0 0 1 1 1 2 2 6-1 13-7 15-22 7-43 13-65 17-5 1-9 1-13 2-27 5-54 7-82 7l0 0 0 0z m327-114c-5 0-9-2-11-6l-50-87c-3-4-2-10 2-14 29-29 54-63 73-101 4-7 7-14 11-22 19-46 30-97 30-151l0 0 0 0c0-77-22-149-62-209-7-11-15-23-24-33-9-11-18-21-28-31l0 0 0 0 0 0c-4-4-5-10-2-14l50-87c0-1 1-2 2-3 4-5 11-5 16-1 58 52 104 117 134 190 6 15 11 29 15 44 14 46 21 94 21 144 0 108-34 209-92 291-11 16-23 31-37 46-13 14-26 28-41 41l0 0c-1 1-1 1-2 1-2 1-4 2-5 2z m-811-468l0 0c-1 0-2 0-3 0-6-1-10-8-9-14 34-166 149-302 302-366 30-12 61-21 93-28 32-6 66-10 100-10l0 0 0 0c40 0 79 5 117 14 7 1 14 3 22 5 6 2 13 5 20 7 1 0 2 1 3 1 6 3 8 10 4 16l-50 87c-3 5-8 7-13 6-14-4-28-7-42-9-3-1-6-1-8-2-18-2-35-3-53-3l0 0 0 0c-128 0-242 63-311 160-1 0-1 0-1 0-13 19-25 40-35 61-10 21-18 43-24 65-1 6-6 10-11 10l-101 0z" horiz-adv-x="1000" />
106
+
107
+ <glyph glyph-name="spin2" unicode="&#xe831;" d="M46 144l0 0c0 0-1 0-1 0-8 18-15 37-21 55-6 19-11 38-15 58-19 99-8 203 35 298 3 6 10 8 15 5 1 0 2 0 2-1l0 0 80-59c5-3 6-9 4-14-5-12-9-25-12-37-4-13-7-26-9-40-11-67-3-137 23-201 2-5 0-10-4-13l0 0-80-56c-5-4-12-2-16 3-1 0-1 1-1 2l0 0z m120 574l0 0c0 1 0 1 0 1 15 13 30 25 46 37 16 11 33 22 51 31 89 50 192 72 297 60 6-1 10-6 10-13 0-1-1-1-1-2l0 0-31-94c-2-5-8-8-13-7-13 0-27 0-40 0-14-1-27-2-40-4-68-11-133-40-186-84-4-3-10-3-14 0l0 0-79 58c-5 3-6 11-2 16 0 0 1 1 2 1l0 0z m588 65l0 0c0 0 1 0 1 0 17-10 34-21 50-32 16-12 31-25 46-38 74-69 127-160 148-262 2-6-2-12-9-13-1 0-1 0-2 0l0 0-100 1c-5 0-10 4-11 9-3 13-8 26-12 38-5 12-10 25-17 36-31 61-78 113-137 150-5 3-6 8-5 13l0 0 31 92c2 6 9 9 15 7 1 0 2-1 2-1l0 0z m244-535l0 0c0 0 0 0 0 0-4-20-9-39-15-57-7-19-14-37-22-55-44-92-114-170-205-221-6-3-13-1-16 4 0 1-1 2-1 2l0 0-30 94c-2 6 1 12 6 14 11 7 22 15 32 23 11 9 21 18 30 27 49 48 84 109 101 176 2 5 6 8 11 8l0 0 98-1c6 0 11-5 11-11 0-1 0-2 0-3l0 0z m-438-395l0 0c0 0 0 0 0 0-20-2-40-3-60-3-20 0-40 1-59 4-102 12-198 54-276 125-5 4-5 11 0 16 0 0 1 1 1 1l0 0 81 58c5 3 12 2 16-2 10-8 20-16 32-23 11-7 22-14 34-20 62-31 131-45 200-41 6 0 10-3 12-8l0 0 29-92c2-6-1-12-7-14-1-1-2-1-3-1l0 0z" horiz-adv-x="1000" />
108
+
109
+ <glyph glyph-name="mobile" unicode="&#xe832;" d="M480 840q42 0 71-29t29-71l0-780q0-40-29-70t-71-30l-380 0q-40 0-70 30t-30 70l0 780q0 42 30 71t70 29l380 0z m-190-940q30 0 50 15t20 35q0 22-20 36t-50 14q-28 0-49-15t-21-35 21-35 49-15z m210 150l0 660-420 0 0-660 420 0z" horiz-adv-x="580" />
110
+
111
+ <glyph glyph-name="bell" unicode="&#xe833;" d="M509-96q0 8-9 8-33 0-57 24t-23 57q0 9-9 9t-9-9q0-41 29-70t69-28q9 0 9 9z m-372 160h726q-149 168-149 465 0 28-13 58t-39 58-67 45-95 17-95-17-67-45-39-58-13-58q0-297-149-465z m827 0q0-29-21-50t-50-21h-250q0-59-42-101t-101-42-101 42-42 101h-250q-29 0-50 21t-21 50q28 24 51 49t47 67 42 89 27 115 11 145q0 84 66 157t171 89q-5 10-5 21 0 23 16 38t38 16 38-16 16-38q0-11-5-21 106-16 171-89t66-157q0-78 11-145t28-115 41-89 48-67 50-49z" horiz-adv-x="1000" />
112
+
113
+ <glyph glyph-name="ccw" unicode="&#xe834;" d="M857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z" horiz-adv-x="857.1" />
114
+
115
+ <glyph glyph-name="wrench" unicode="&#xe835;" d="M214 29q0 14-10 25t-25 10-25-10-11-25 11-25 25-11 25 11 10 25z m360 234l-381-381q-21-20-50-20-29 0-51 20l-59 61q-21 20-21 50 0 29 21 51l380 380q22-55 64-97t97-64z m354 243q0-22-13-59-27-75-92-122t-144-46q-104 0-177 73t-73 177 73 176 177 74q32 0 67-10t60-26q9-6 9-15t-9-16l-163-94v-125l108-60q2 2 44 27t75 45 40 20q8 0 13-5t5-14z" horiz-adv-x="928.6" />
116
+
117
+ <glyph glyph-name="stop-1" unicode="&#xe837;" d="M857 743v-786q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v786q0 14 11 25t25 11h785q15 0 26-11t10-25z" horiz-adv-x="857.1" />
118
+
119
+ <glyph glyph-name="spin5" unicode="&#xe838;" d="M462 850c-6 0-11-5-11-11l0-183 0 0c0-6 5-11 11-11l69 0c1 0 1 0 1 0 7 0 12 5 12 11l0 183 0 0c0 6-5 11-12 11l-69 0c0 0 0 0-1 0z m250-47c-4 1-8-2-10-5l-91-158 0 0c-4-6-2-13 4-16l60-34c0-1 0-1 0-1 6-3 13-1 16 4l91 158c3 6 2 13-4 16l-61 35c-1 1-3 1-5 1z m-428-2c-2 0-4-1-6-2l-61-35c-5-3-7-10-4-16l91-157c0 0 0 0 0 0 3-6 10-8 16-5l61 35c5 4 7 11 4 16l-91 157c0 1 0 1 0 1-2 4-6 6-10 6z m620-163c-2 0-4 0-6-1l-157-91c0 0 0 0 0 0-6-3-8-10-5-16l35-61c4-5 11-7 16-4l157 91c1 0 1 0 1 0 6 3 7 11 4 16l-35 61c-2 4-6 6-10 5z m-810-4c-5 0-9-2-11-6l-35-61c-3-5-1-12 4-15l158-91 0 0c6-4 13-2 16 4l35 60c0 0 0 0 0 0 3 6 1 13-4 16l-158 91c-2 1-4 2-5 2z m712-235l0 0c-6 0-11-5-11-11l0-69c0-1 0-1 0-1 0-7 5-12 11-12l183 0 0 0c6 0 11 5 11 12l0 69c0 0 0 0 0 1 0 6-5 11-11 11l-183 0z m-794-5l0 0c-7 0-12-5-12-12l0-69c0 0 0 0 0-1 0-6 5-11 12-11l182 0 0 0c6 0 11 5 11 11l0 69c0 1 0 1 0 1 0 7-5 12-11 12l-182 0z m772-153c-4 0-8-2-10-6l-34-60c-1 0-1 0-1 0-3-6-1-13 4-16l158-91c6-3 13-1 16 4l35 61c3 5 1 12-4 15l-158 92 0 0c-2 1-4 1-6 1z m-566-5c-1 0-3 0-5-1l-157-91c0 0-1 0-1 0-5-3-7-10-4-16l35-61c3-5 10-7 16-4l157 91c0 0 0 0 0 0 6 3 8 10 5 16l-35 61c-3 3-7 6-11 5z m468-121c-2 0-4 0-6-1l-61-35c-5-4-7-11-4-16l91-157c0-1 0-1 0-1 3-6 11-7 16-4l61 35c5 3 7 10 4 16l-91 157c0 0 0 0 0 0-2 4-6 6-10 6z m-367-2c-4 0-8-2-10-6l-91-158c-3-6-1-13 4-16l61-35c5-3 12-1 15 4l92 158 0 0c3 6 1 13-5 16l-60 35c0 0 0 0 0 0-2 1-4 1-6 2z m149-58c-7 0-12-5-12-11l0-183 0 0c0-6 5-11 12-11l69 0c0 0 0 0 1 0 6 0 11 5 11 11l0 183 0 0c0 6-5 11-11 11l-69 0c-1 0-1 0-1 0z" horiz-adv-x="1000" />
120
+
121
+ <glyph glyph-name="pause-1" unicode="&#xe839;" d="M857 743v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z m-500 0v-786q0-14-10-25t-26-11h-285q-15 0-25 11t-11 25v786q0 14 11 25t25 11h285q15 0 26-11t10-25z" horiz-adv-x="857.1" />
122
+
123
+ <glyph glyph-name="play-1" unicode="&#xe83a;" d="M772 333l-741-412q-13-7-22-2t-9 20v822q0 14 9 20t22-2l741-412q13-7 13-17t-13-17z" horiz-adv-x="785.7" />
124
+
125
+ <glyph glyph-name="link-ext" unicode="&#xf08e;" d="M786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-25t-25-11-25 11l-98 98-364-364q-5-6-13-6t-12 6l-64 64q-6 5-6 12t6 13l364 364-98 98q-11 11-11 25t11 25 25 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
126
+
127
+ <glyph glyph-name="menu" unicode="&#xf0c9;" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
128
+
129
+ <glyph glyph-name="sort" unicode="&#xf0dc;" d="M571 243q0-15-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 10-11 25t11 25 25 11h500q14 0 25-11t10-25z m0 214q0-14-10-25t-25-11h-500q-15 0-25 11t-11 25 11 25l250 250q10 11 25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="571.4" />
130
+
131
+ <glyph glyph-name="mail-alt" unicode="&#xf0e0;" d="M1000 454v-443q0-37-26-63t-63-27h-822q-36 0-63 27t-26 63v443q25-27 56-49 202-137 278-192 32-24 51-37t53-27 61-13h2q28 0 61 13t53 27 51 37q95 68 278 192 32 22 56 49z m0 164q0-44-27-84t-68-69q-210-146-262-181-5-4-23-17t-30-22-29-18-32-15-28-5h-2q-12 0-27 5t-32 15-30 18-30 22-23 17q-51 35-147 101t-114 80q-35 23-65 64t-31 77q0 43 23 72t66 29h822q36 0 63-26t26-63z" horiz-adv-x="1000" />
132
+
133
+ <glyph glyph-name="lightbulb" unicode="&#xf0eb;" d="M411 529q0-8-6-13t-12-5-13 5-5 13q0 25-30 39t-59 14q-7 0-13 5t-5 13 5 13 13 5q28 0 55-9t49-30 21-50z m89 0q0 40-19 74t-50 57-69 35-76 12-76-12-69-35-50-57-20-74q0-57 38-101 6-6 17-18t17-19q72-85 79-166h127q8 81 79 166 6 6 17 19t17 18q38 44 38 101z m71 0q0-87-57-150-25-27-42-48t-33-54-19-60q26-15 26-46 0-20-13-35 13-15 13-36 0-29-25-45 8-13 8-26 0-26-18-40t-43-14q-11-25-34-39t-48-15-49 15-33 39q-26 0-44 14t-17 40q0 13 7 26-25 16-25 45 0 21 14 36-14 15-14 35 0 31 26 46-2 28-19 60t-33 54-41 48q-58 63-58 150 0 55 25 103t65 79 92 49 104 19 104-19 91-49 66-79 24-103z" horiz-adv-x="571.4" />
134
+
135
+ <glyph glyph-name="exchange" unicode="&#xf0ec;" d="M1000 189v-107q0-7-5-12t-13-6h-768v-107q0-7-5-12t-13-6q-6 0-13 6l-178 178q-5 6-5 13 0 8 5 13l179 178q5 5 12 5 8 0 13-5t5-13v-107h768q7 0 13-5t5-13z m0 304q0-8-5-13l-179-178q-5-6-12-6-8 0-13 6t-5 12v107h-768q-7 0-13 6t-5 12v107q0 8 5 13t13 5h768v107q0 8 5 13t13 5q6 0 13-5l178-178q5-5 5-13z" horiz-adv-x="1000" />
136
+
137
+ <glyph glyph-name="upload-cloud" unicode="&#xf0ee;" d="M714 368q0 8-5 13l-196 196q-5 5-13 5t-13-5l-196-196q-5-6-5-13 0-8 5-13t13-5h125v-196q0-8 5-13t12-5h108q7 0 12 5t5 13v196h125q8 0 13 5t5 13z m357-161q0-89-62-151t-152-63h-607q-103 0-177 73t-73 177q0 72 39 134t105 92q-1 17-1 24 0 118 84 202t202 84q87 0 159-49t105-129q40 35 93 35 59 0 101-42t42-101q0-43-23-77 72-17 119-76t46-133z" horiz-adv-x="1071.4" />
138
+
139
+ <glyph glyph-name="bell-alt" unicode="&#xf0f3;" d="M509-96q0 8-9 8-33 0-57 24t-23 57q0 9-9 9t-9-9q0-41 29-70t69-28q9 0 9 9z m455 160q0-29-21-50t-50-21h-250q0-59-42-101t-101-42-101 42-42 101h-250q-29 0-50 21t-21 50q28 24 51 49t47 67 42 89 27 115 11 145q0 84 66 157t171 89q-5 10-5 21 0 23 16 38t38 16 38-16 16-38q0-11-5-21 106-16 171-89t66-157q0-78 11-145t28-115 41-89 48-67 50-49z" horiz-adv-x="1000" />
140
+
141
+ <glyph glyph-name="doc-text" unicode="&#xf0f6;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z m-572 483q0 7 5 12t13 5h393q8 0 13-5t5-12v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36z m411-125q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z m0-143q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z" horiz-adv-x="857.1" />
142
+
143
+ <glyph glyph-name="angle-double-left" unicode="&#xf100;" d="M350 82q0-7-6-13l-28-28q-5-5-12-5t-13 5l-260 261q-6 5-6 12t6 13l260 260q5 6 13 6t12-6l28-28q6-5 6-13t-6-12l-219-220 219-219q6-6 6-13z m214 0q0-7-5-13l-28-28q-6-5-13-5t-13 5l-260 261q-6 5-6 12t6 13l260 260q6 6 13 6t13-6l28-28q5-5 5-13t-5-12l-220-220 220-219q5-6 5-13z" horiz-adv-x="571.4" />
144
+
145
+ <glyph glyph-name="angle-double-right" unicode="&#xf101;" d="M332 314q0-7-5-12l-261-261q-5-5-12-5t-13 5l-28 28q-6 6-6 13t6 13l219 219-219 220q-6 5-6 12t6 13l28 28q5 6 13 6t12-6l261-260q5-5 5-13z m214 0q0-7-5-12l-260-261q-6-5-13-5t-13 5l-28 28q-5 6-5 13t5 13l219 219-219 220q-5 5-5 12t5 13l28 28q6 6 13 6t13-6l260-260q5-5 5-13z" horiz-adv-x="571.4" />
146
+
147
+ <glyph glyph-name="angle-double-up" unicode="&#xf102;" d="M600 118q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 219-219-219q-5-5-13-5t-12 5l-28 28q-6 6-6 13t6 13l260 260q5 5 12 5t13-5l260-260q6-6 6-13z m0 214q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 220-219-220q-5-5-13-5t-12 5l-28 28q-6 6-6 13t6 13l260 260q5 6 12 6t13-6l260-260q6-6 6-13z" horiz-adv-x="642.9" />
148
+
149
+ <glyph glyph-name="angle-double-down" unicode="&#xf103;" d="M600 368q0-7-6-13l-260-260q-5-6-13-6t-12 6l-260 260q-6 6-6 13t6 13l28 28q5 5 12 5t13-5l219-220 220 220q5 5 13 5t12-5l28-28q6-6 6-13z m0 214q0-7-6-13l-260-260q-5-5-13-5t-12 5l-260 260q-6 6-6 13t6 13l28 28q5 6 12 6t13-6l219-219 220 219q5 6 13 6t12-6l28-28q6-6 6-13z" horiz-adv-x="642.9" />
150
+
151
+ <glyph glyph-name="desktop" unicode="&#xf108;" d="M1000 296v465q0 7-5 12t-13 6h-893q-7 0-12-6t-6-12v-465q0-7 6-12t12-5h893q7 0 13 5t5 12z m71 465v-607q0-37-26-63t-63-27h-303q0-20 9-43t17-40 9-24q0-14-10-25t-25-11h-286q-15 0-25 11t-11 25q0 8 9 25t18 39 9 43h-304q-36 0-63 27t-26 63v607q0 37 26 63t63 26h893q37 0 63-26t26-63z" horiz-adv-x="1071.4" />
152
+
153
+ <glyph glyph-name="laptop" unicode="&#xf109;" d="M232 136q-37 0-63 26t-26 63v393q0 37 26 63t63 26h607q37 0 63-26t27-63v-393q0-37-27-63t-63-26h-607z m-18 482v-393q0-7 6-13t12-5h607q8 0 13 5t5 13v393q0 7-5 12t-13 6h-607q-7 0-12-6t-6-12z m768-518h89v-54q0-22-26-37t-63-16h-893q-36 0-63 16t-26 37v54h982z m-402-54q9 0 9 9t-9 9h-89q-9 0-9-9t9-9h89z" horiz-adv-x="1071.4" />
154
+
155
+ <glyph glyph-name="tablet" unicode="&#xf10a;" d="M357 64q0 15-10 25t-26 11-25-11-10-25 10-25 25-10 26 10 10 25z m214 90v535q0 8-5 13t-12 5h-465q-7 0-12-5t-6-13v-535q0-8 6-13t12-5h465q7 0 12 5t5 13z m72 535v-607q0-37-26-63t-63-26h-465q-36 0-63 26t-26 63v607q0 37 26 63t63 27h465q36 0 63-27t26-63z" horiz-adv-x="642.9" />
156
+
157
+ <glyph glyph-name="circle-empty" unicode="&#xf10c;" d="M429 654q-83 0-153-41t-110-111-41-152 41-152 110-111 153-41 152 41 110 111 41 152-41 152-110 111-152 41z m428-304q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
158
+
159
+ <glyph glyph-name="circle" unicode="&#xf111;" d="M857 350q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
160
+
161
+ <glyph glyph-name="unlink" unicode="&#xf127;" d="M245 141l-143-143q-6-5-13-5t-12 5q-6 6-6 13t6 13l142 142q6 5 13 5t13-5q5-5 5-12t-5-13z m94-23v-179q0-8-5-13t-13-5-12 5-5 13v179q0 8 5 13t12 5 13-5 5-13z m-125 125q0-8-5-13t-13-5h-178q-8 0-13 5t-5 13 5 13 13 5h178q8 0 13-5t5-13z m706-72q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-186 187q-12 12-24 31l134 10 152-153q15-15 38-15t38 15l82 81q16 16 16 37 0 23-16 38l-153 154 10 133q20-11 31-23l188-188q47-48 47-114z m-345 404l-133-10-152 153q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l153-153-10-134q-20 12-32 24l-187 187q-47 48-47 114 0 67 47 113l82 82q47 46 114 46 67 0 114-47l186-187q12-12 23-32z m354-46q0-8-5-13t-13-5h-179q-8 0-13 5t-5 13 5 12 13 5h179q8 0 13-5t5-12z m-304 303v-178q0-8-5-13t-13-5-13 5-5 13v178q0 8 5 13t13 5 13-5 5-13z m227-84l-143-143q-6-5-13-5t-12 5q-5 6-5 13t5 13l143 143q5 5 12 5t13-5q5-6 5-13t-5-13z" horiz-adv-x="928.6" />
162
+
163
+ <glyph glyph-name="help" unicode="&#xf128;" d="M393 149v-134q0-9-7-15t-15-7h-134q-9 0-16 7t-7 15v134q0 9 7 16t16 6h134q9 0 15-6t7-16z m176 335q0-30-8-56t-20-43-31-33-32-25-34-19q-23-13-38-37t-15-37q0-10-7-18t-16-9h-134q-8 0-14 11t-6 20v26q0 46 37 87t79 60q33 16 47 32t14 42q0 24-26 41t-60 18q-36 0-60-16-20-14-60-64-7-9-17-9-7 0-14 4l-91 70q-8 6-9 14t3 16q89 148 259 148 45 0 90-17t81-46 59-72 23-88z" horiz-adv-x="571.4" />
164
+
165
+ <glyph glyph-name="info" unicode="&#xf129;" d="M357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
166
+
167
+ <glyph glyph-name="attention-alt" unicode="&#xf12a;" d="M286 154v-125q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v125q0 14 11 25t25 10h143q15 0 25-10t11-25z m17 589l-16-429q-1-14-12-25t-25-10h-143q-14 0-25 10t-12 25l-15 429q-1 14 10 25t24 11h179q14 0 25-11t10-25z" horiz-adv-x="357.1" />
168
+
169
+ <glyph glyph-name="ellipsis" unicode="&#xf141;" d="M214 439v-107q0-22-15-38t-38-15h-107q-23 0-38 15t-16 38v107q0 23 16 38t38 16h107q22 0 38-16t15-38z m286 0v-107q0-22-16-38t-38-15h-107q-22 0-38 15t-15 38v107q0 23 15 38t38 16h107q23 0 38-16t16-38z m286 0v-107q0-22-16-38t-38-15h-107q-22 0-38 15t-16 38v107q0 23 16 38t38 16h107q23 0 38-16t16-38z" horiz-adv-x="785.7" />
170
+
171
+ <glyph glyph-name="ellipsis-vert" unicode="&#xf142;" d="M214 154v-108q0-22-15-37t-38-16h-107q-23 0-38 16t-16 37v108q0 22 16 38t38 15h107q22 0 38-15t15-38z m0 285v-107q0-22-15-38t-38-15h-107q-23 0-38 15t-16 38v107q0 23 16 38t38 16h107q22 0 38-16t15-38z m0 286v-107q0-22-15-38t-38-16h-107q-23 0-38 16t-16 38v107q0 22 16 38t38 16h107q22 0 38-16t15-38z" horiz-adv-x="214.3" />
172
+
173
+ <glyph glyph-name="euro" unicode="&#xf153;" d="M545 121l19-89q2-7-1-13t-10-8l-3 0q-2-1-6-2t-9-3-12-3-14-3-16-2-19-3-21-2-21 0q-131 0-228 73t-133 196h-53q-7 0-13 5t-5 13v63q0 7 5 12t13 6h37q-1 31 0 58h-37q-8 0-13 5t-5 13v64q0 8 5 13t13 5h55q37 117 135 188t224 72q57 0 108-13 6-2 11-9 4-6 2-13l-24-89q-2-7-8-11t-13-1l-2 1q-3 0-7 1l-10 2t-12 2-15 2-16 1-16 1q-71 0-126-36t-84-98h261q9 0 14-7 6-7 4-15l-13-63q-3-15-18-15h-273q-1-20 0-58h257q8 0 13-7 5-7 4-15l-14-63q-1-6-6-10t-11-4h-216q27-65 84-104t127-38q10 0 20 1t19 2 16 2 14 3 10 3l7 1 3 2q7 2 14-2 7-3 9-11z" horiz-adv-x="571.4" />
174
+
175
+ <glyph glyph-name="pound" unicode="&#xf154;" d="M569 216v-205q0-8-5-13t-13-5h-533q-8 0-13 5t-5 13v83q0 8 5 13t13 5h54v214h-53q-8 0-13 5t-5 13v73q0 8 5 13t13 5h53v124q0 96 69 158t175 62q104 0 187-70 5-5 6-12t-4-12l-57-71q-5-6-13-7-7-1-13 4-2 3-14 11t-39 18-51 10q-48 0-77-27t-29-68v-120h170q8 0 13-5t5-13v-73q0-7-5-13t-13-5h-170v-211h231v101q0 7 5 12t13 5h90q8 0 13-5t5-12z" horiz-adv-x="571.4" />
176
+
177
+ <glyph glyph-name="dollar" unicode="&#xf155;" d="M546 189q0-86-56-147t-144-77v-97q0-8-5-13t-13-5h-75q-7 0-13 5t-5 13v97q-37 5-71 18t-57 25-41 26-26 21-10 10q-9 12-1 23l58 76q3 5 12 6 9 1 14-5l1-1q63-55 135-70 21-4 42-4 45 0 79 24t35 68q0 16-9 30t-18 23-33 21-37 18-45 18q-21 9-34 14t-34 15-35 17-32 20-29 24-25 27-20 32-11 37-5 44q0 77 55 135t142 75v100q0 7 5 13t13 5h75q8 0 13-5t5-13v-98q32-3 62-13t48-19 36-20 21-17 9-7q9-11 3-22l-46-81q-4-9-12-9-8-2-15 4-2 2-9 7t-21 14-33 18-42 15-47 6q-53 0-87-24t-33-62q0-14 4-27t17-23 22-18 31-18 34-15 39-15q30-11 45-17t43-20 42-24 34-28 30-35 18-43 7-52z" horiz-adv-x="571.4" />
178
+
179
+ <glyph glyph-name="rupee" unicode="&#xf156;" d="M501 588v-57q0-8-5-13t-13-5h-93q-13-80-72-131t-154-61q93-99 256-299 8-9 2-19-5-10-16-10h-109q-9 0-14 7-171 204-278 318-5 5-5 13v70q0 8 5 13t13 5h62q74 0 119 24t57 70h-238q-8 0-13 5t-5 13v57q0 8 5 13t13 5h230q-31 63-149 63h-81q-7 0-13 5t-5 13v74q0 8 5 13t13 5h464q8 0 13-5t5-13v-57q0-8-5-13t-13-5h-130q26-34 36-80h95q8 0 13-5t5-13z" horiz-adv-x="501.1" />
180
+
181
+ <glyph glyph-name="yen" unicode="&#xf157;" d="M337-7h-96q-8 0-13 5t-5 13v184h-161q-7 0-13 5t-5 13v57q0 8 5 13t13 5h161v48h-161q-7 0-13 5t-5 12v58q0 8 5 13t13 5h119l-179 323q-4 9 0 18 6 9 16 9h108q11 0 16-10l120-238q11-21 32-69 5 13 17 38t15 34l107 234q4 11 16 11h106q10 0 15-9 5-8 1-18l-175-323h120q7 0 13-5t5-13v-58q0-7-5-12t-13-5h-162v-48h162q7 0 13-5t5-13v-57q0-8-5-13t-13-5h-162v-184q0-7-5-13t-12-5z" horiz-adv-x="573.1" />
182
+
183
+ <glyph glyph-name="rouble" unicode="&#xf158;" d="M582 535q0 56-36 90t-96 35h-178v-250h178q60 0 96 34t36 91z m132 0q0-108-70-176t-182-68h-190v-66h282q7 0 12-5t5-13v-71q0-8-5-13t-12-5h-282v-107q0-8-5-13t-13-5h-93q-8 0-13 5t-5 13v107h-125q-8 0-13 5t-5 13v71q0 8 5 13t13 5h125v66h-125q-8 0-13 5t-5 13v83q0 7 5 12t13 6h125v351q0 8 5 13t13 5h301q111 0 182-68t70-176z" horiz-adv-x="714.3" />
184
+
185
+ <glyph glyph-name="won" unicode="&#xf159;" d="M287 183l45 167h-89l42-167q1-1 1-2t0-2q0 1 1 2t0 2z m65 238l19 72h-163l18-72h126z m107 0h77l-19 72h-39z m250-238l44 167h-91l46-167q0 0 0-2t1-2q0 1 0 2t0 2z m62 238l19 72h-166l19-72h128z m229-17v-36q0-8-5-13t-13-5h-119l-91-344q-4-13-17-13h-89q-14 0-18 13l-92 344h-117l-93-344q-4-13-17-13h-89q-6 0-11 4t-6 9l-89 344h-116q-8 0-13 5t-5 13v36q0 7 5 12t13 5h98l-19 72h-79q-8 0-13 5t-5 13v35q0 8 5 13t13 5h61l-50 192q-3 9 3 16 5 7 14 7h77q14 0 17-14l50-201h201l54 201q4 14 17 14h70q14 0 18-14l54-201h204l52 201q3 14 17 14h77q9 0 14-7 6-7 3-16l-51-192h62q8 0 13-5t5-13v-35q0-8-5-13t-13-5h-81l-19-72h100q8 0 13-5t5-12z" horiz-adv-x="1000" />
186
+
187
+ <glyph glyph-name="bitcoin" unicode="&#xf15a;" d="M651 493q10-102-73-144 65-16 98-58t25-119q-4-40-18-70t-36-49-54-33-68-19-81-9v-142h-86v140q-45 0-68 1v-141h-86v142q-10 0-30 1t-31 0h-112l18 102h62q27 0 32 28v225h9q-4 0-9 0v161q-7 37-50 37h-62v92l119-1q35 0 54 1v141h86v-138q45 1 68 1v137h86v-141q44-4 78-13t63-25 46-43 20-64z m-120-304q0 20-8 35t-21 26-32 17-36 11-42 5-38 1-36 0-27-1v-189q5 0 21 0t27 0 29 1 33 2 32 5 31 8 26 11 22 17 14 22 5 29z m-39 265q0 19-7 33t-17 23-27 16-31 9-34 5-32 1-31 0-22-1v-171q3 0 20 0t26 0 27 1 31 3 29 6 27 10 21 15 15 22 5 28z" horiz-adv-x="714.3" />
188
+
189
+ <glyph glyph-name="sort-alt-up" unicode="&#xf160;" d="M411 46q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m589-71v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-357q-8 0-13 5t-5 13v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m-107 285v-107q0-7-5-12t-13-6h-250q-8 0-13 6t-5 12v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m-107 286v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z" horiz-adv-x="1000" />
190
+
191
+ <glyph glyph-name="sort-alt-down" unicode="&#xf161;" d="M679-25v-107q0-8-5-13t-13-5h-143q-8 0-13 5t-5 13v107q0 8 5 13t13 5h143q8 0 13-5t5-13z m-268 71q0-6-6-13l-178-178q-5-5-13-5-6 0-12 5l-179 179q-8 9-4 19 4 11 17 11h107v768q0 8 5 13t13 5h107q8 0 13-5t5-13v-768h107q8 0 13-5t5-13z m375 215v-107q0-8-5-13t-13-5h-250q-8 0-13 5t-5 13v107q0 8 5 13t13 5h250q8 0 13-5t5-13z m107 285v-107q0-7-5-12t-13-6h-357q-8 0-13 6t-5 12v107q0 8 5 13t13 5h357q8 0 13-5t5-13z m107 286v-107q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v107q0 8 5 13t13 5h464q8 0 13-5t5-13z" horiz-adv-x="1000" />
192
+
193
+ <glyph glyph-name="bug" unicode="&#xf188;" d="M911 314q0-14-11-25t-25-10h-125q0-96-37-162l116-117q10-11 10-25t-10-25q-10-11-25-11t-25 11l-111 110q-3-3-8-7t-24-16-36-21-46-16-54-7v500h-71v-500q-29 0-57 7t-49 19-36 22-25 18l-8 8-102-116q-11-12-27-12-13 0-24 9-11 10-11 25t8 26l113 127q-32 63-32 153h-125q-15 0-25 10t-11 25 11 25 25 11h125v164l-97 97q-11 10-11 25t11 25 25 10 25-10l97-97h471l96 97q11 10 25 10t26-10 10-25-10-25l-97-97v-164h125q15 0 25-11t11-25z m-268 322h-357q0 74 52 126t126 52 127-52 52-126z" horiz-adv-x="928.6" />
194
+
195
+ <glyph glyph-name="try" unicode="&#xf195;" d="M643 386q0-107-53-197t-143-143-197-53h-89q-8 0-13 5t-5 13v341l-120-37q-2-1-5-1-6 0-11 4-7 5-7 14v72q0 12 13 17l130 40v51l-120-36q-2-1-5-1-6 0-11 3-7 6-7 15v71q0 13 13 18l130 39v140q0 8 5 13t13 5h89q8 0 13-5t5-13v-101l209 64q9 3 16-2t7-15v-71q0-13-13-18l-219-67v-52l209 65q9 3 16-3t7-15v-71q0-13-13-17l-219-68v-272q105 8 177 85t73 183q0 8 5 13t13 5h89q8 0 13-5t5-13z" horiz-adv-x="642.9" />
196
+
197
+ <glyph glyph-name="wordpress" unicode="&#xf19a;" d="M71 350q0 91 37 175l205-561q-109 53-176 157t-66 229z m719 22q0-11-2-22t-5-27-7-25-9-33-10-32l-43-143-155 461q26 2 49 4 11 2 15 11t-2 17-15 8l-115-6q-42 1-113 6-6 0-11-3t-6-9-1-10 5-9 11-5l44-4 67-183-94-281-156 464q26 2 49 4 11 2 15 11t-2 17-15 8l-115-6q-4 0-13 0t-14 1q58 89 153 141t205 52q82 0 157-29t133-84h-6q-31 0-51-22t-21-53q0-7 1-14t2-12 5-13 5-11 7-13 7-12 8-13 8-13q35-60 35-118z m-283-59l133-361q0-4 2-7-70-24-142-24-62 0-121 18z m369 243q53-97 53-206 0-117-58-215t-156-156l132 379q33 94 33 154 0 23-4 44z m-376 294q102 0 194-40t160-106 106-160 40-194-40-194-106-160-160-106-194-40-194 40-160 106-106 160-40 194 40 194 106 160 160 106 194 40z m0-977q97 0 185 38t152 102 102 152 38 185-38 185-102 152-152 102-185 38-185-38-152-102-102-152-38-185 38-185 102-152 152-102 185-38z" horiz-adv-x="1000" />
198
+
199
+ <glyph glyph-name="cubes" unicode="&#xf1b3;" d="M357-61l214 107v176l-214-92v-191z m-36 254l226 96-226 97-225-97z m608-254l214 107v176l-214-92v-191z m-36 254l225 96-225 97-226-97z m-250 163l214 92v149l-214-92v-149z m-36 212l246 105-246 106-246-106z m607-289v-233q0-20-10-37t-29-26l-250-125q-14-8-32-8t-32 8l-250 125q-2 1-4 2-1-1-4-2l-250-125q-14-8-32-8t-31 8l-250 125q-19 9-29 26t-11 37v233q0 21 12 39t32 26l242 104v223q0 22 12 40t31 26l250 107q13 6 28 6t28-6l250-107q20-9 32-26t12-40v-223l242-104q20-8 32-26t11-39z" horiz-adv-x="1285.7" />
200
+
201
+ <glyph glyph-name="database" unicode="&#xf1c0;" d="M429 421q132 0 247 24t181 71v-95q0-38-57-71t-157-52-214-19-215 19-156 52-58 71v95q66-47 181-71t248-24z m0-428q132 0 247 24t181 71v-95q0-39-57-72t-157-52-214-19-215 19-156 52-58 72v95q66-47 181-71t248-24z m0 214q132 0 247 24t181 71v-95q0-38-57-71t-157-52-214-20-215 20-156 52-58 71v95q66-47 181-71t248-24z m0 643q116 0 214-19t157-52 57-72v-71q0-39-57-72t-157-52-214-19-215 19-156 52-58 72v71q0 39 58 72t156 52 215 19z" horiz-adv-x="857.1" />
202
+
203
+ <glyph glyph-name="circle-thin" unicode="&#xf1db;" d="M429 707q-73 0-139-28t-114-76-76-114-29-139 29-139 76-113 114-77 139-28 138 28 114 77 76 113 29 139-29 139-76 114-114 76-138 28z m428-357q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z" horiz-adv-x="857.1" />
204
+
205
+ <glyph glyph-name="sliders" unicode="&#xf1de;" d="M196 64v-71h-196v71h196z m197 72q14 0 25-11t11-25v-143q0-14-11-25t-25-11h-143q-14 0-25 11t-11 25v143q0 15 11 25t25 11h143z m89 214v-71h-482v71h482z m-357 286v-72h-125v72h125z m732-572v-71h-411v71h411z m-536 643q15 0 26-10t10-26v-142q0-15-10-25t-26-11h-142q-15 0-25 11t-11 25v142q0 15 11 26t25 10h142z m358-286q14 0 25-10t10-25v-143q0-15-10-25t-25-11h-143q-15 0-25 11t-11 25v143q0 14 11 25t25 10h143z m178-71v-71h-125v71h125z m0 286v-72h-482v72h482z" horiz-adv-x="857.1" />
206
+
207
+ <glyph glyph-name="share" unicode="&#xf1e0;" d="M679 279q74 0 126-53t52-126-52-126-126-53-127 53-52 126q0 7 1 19l-201 100q-51-48-121-48-75 0-127 53t-52 126 52 126 127 53q70 0 121-48l201 100q-1 12-1 19 0 74 52 126t127 53 126-53 52-126-52-126-126-53q-71 0-122 48l-201-100q1-12 1-19t-1-19l201-100q51 48 122 48z" horiz-adv-x="857.1" />
208
+
209
+ <glyph glyph-name="plug" unicode="&#xf1e6;" d="M979 597q21-21 21-50t-21-51l-223-223 83-84-89-89q-91-91-217-104t-230 56l-202-202h-101v101l202 202q-69 103-56 230t104 217l89 89 84-83 223 223q21 21 51 21t50-21 21-50-21-51l-223-223 131-131 223 223q22 21 51 21t50-21z" horiz-adv-x="1000" />
210
+
211
+ <glyph glyph-name="trash" unicode="&#xf1f8;" d="M286 82v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m143 0v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m142 0v393q0 8-5 13t-12 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q7 0 12 5t5 13z m-303 554h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
212
+
213
+ <glyph glyph-name="chart-line" unicode="&#xf201;" d="M1143-7v-72h-1143v858h71v-786h1072z m-72 696v-242q0-12-10-17t-20 4l-68 68-353-353q-6-6-13-6t-13 6l-130 130-232-233-107 108 327 326q5 6 12 6t13-6l130-130 259 259-67 68q-9 8-5 19t17 11h243q7 0 12-5t5-13z" horiz-adv-x="1142.9" />
214
+
215
+ <glyph glyph-name="shekel" unicode="&#xf20b;" d="M554 502v-277q0-8-5-13t-13-5h-90q-7 0-12 5t-5 13v277q0 62-45 107t-107 45h-152v-643q0-8-5-13t-13-5h-89q-8 0-13 5t-5 13v750q0 8 5 13t13 5h259q75 0 139-37t101-101 37-139z m214 259v-491q0-76-37-139t-101-101-139-37h-259q-8 0-13 5t-5 13v535q0 8 5 13t13 5h89q8 0 13-5t5-13v-428h152q63 0 107 45t45 107v491q0 8 5 13t13 5h89q8 0 13-5t5-13z" horiz-adv-x="857.1" />
216
+
217
+ <glyph glyph-name="user-secret" unicode="&#xf21b;" d="M321-7l54 250-54 71-71 36z m143 0l72 357-72-36-53-71z m90 564q-1 2-3 3-5 4-53 4-39 0-93-10-4-1-12-1t-12 1q-54 10-93 10-48 0-54-4-1-1-2-3 1-11 2-16 2-1 5-3t4-6q1-2 4-11t4-12 4-9 5-10 5-8 7-7 7-6 10-4 12-2 13-1q20 0 33 7t18 16 8 20 7 16 10 7h6q6 0 10-7t6-16 9-20 18-16 33-7q7 0 13 1t12 2 9 4 8 6 7 7 5 8 5 10 4 9 4 12 4 11q1 4 4 6t4 3q2 5 3 16z m232-491q0-68-41-106t-108-39h-488q-67 0-108 39t-41 106q0 34 3 66t10 70 21 69 36 58 52 41l-51 123h120q-12 36-12 71 0 7 1 18-109 23-109 54 0 32 118 55 9 35 28 75t40 63q18 21 42 21 17 0 47-17t47-18 47 18 47 17q24 0 42-21 20-23 39-63t29-75q117-23 117-55 0-31-108-54 4-45-11-89h119l-45-126q35-18 60-54t36-80 16-84 5-83z" horiz-adv-x="857.1" />
218
+
219
+ <glyph glyph-name="user-plus" unicode="&#xf234;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m536-71h196q7 0 13-6t5-12v-107q0-8-5-13t-13-5h-196v-197q0-7-6-12t-12-6h-107q-8 0-13 6t-5 12v197h-197q-7 0-12 5t-6 13v107q0 7 6 12t12 6h197v196q0 7 5 13t13 5h107q7 0 12-5t6-13v-196z m-411-125q0-29 21-51t50-21h143v-133q-38-28-95-28h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 44-34 86-51t92-17 92 17 86 51q11 10 22 10 73 0 121-54h-125q-29 0-50-21t-21-50v-107z" horiz-adv-x="1142.9" />
220
+
221
+ <glyph glyph-name="user-times" unicode="&#xf235;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m601-179l139-138q5-5 5-13 0-8-5-13l-76-76q-5-5-12-5-8 0-13 5l-139 139-139-139q-5-5-13-5-7 0-12 5l-76 76q-5 5-5 13 0 8 5 13l139 138-139 139q-5 5-5 13 0 8 5 13l76 75q5 5 12 5 8 0 13-5l139-139 139 139q5 5 13 5 7 0 12-5l76-75q5-5 5-13 0-8-5-13z m-278 0l-101-101q-21-20-21-50 0-30 21-51l46-46q-11-2-24-2h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 86-68 178-68t178 68q11 10 22 10 15 0 31-4-15-15-22-27t-8-32q0-30 21-51z" horiz-adv-x="1142.9" />
222
+
223
+ <glyph glyph-name="viacoin" unicode="&#xf237;" d="M857 850l-107-250h107v-107h-153l-30-72h183v-107h-229l-199-464-200 464h-229v107h184l-31 72h-153v107h107l-107 250h143l180-429h211l180 429h143z m-428-679l60 143h-121z" horiz-adv-x="857.1" />
224
+
225
+ <glyph glyph-name="safari" unicode="&#xf267;" d="M530 352q0-15-10-25t-23-11q-14 0-25 9t-10 23q0 15 9 25t23 11 25-9 11-23z m8-33l195 325q-5-5-37-35t-70-65-77-71-65-62-28-29l-195-323q4 4 38 34t70 65 76 71 65 62 28 28z m361 31q0-112-58-207-2 1-9 6t-15 9-9 5q-8 0-8-8 0-5 33-24-41-63-103-107t-135-61l-8 37q-1 6-9 6-3 0-4-3t-1-6l9-38q-41-8-82-8-111 0-208 59 1 1 8 11t12 19 5 10q0 8-7 8-4 0-10-8t-12-20-8-13q-63 42-107 105t-61 137l38 8q6 2 6 8 0 3-3 5t-6 1l-38-9q-8 41-8 78 0 115 61 212 1-1 10-7t17-11 10-4q7 0 7 6 0 4-7 9t-18 12l-11 7q43 62 105 105t136 60l9-37q1-6 8-6 3 0 5 3t1 6l-9 37q40 7 75 7 114 0 212-61-22-31-22-36 0-7 6-7 7 0 27 35 62-41 105-103t60-135l-31-7q-6-1-6-8 0-3 3-5t5-1l32 7q8-40 8-78z m47 0q0 91-35 174t-95 142-142 95-174 35-173-35-143-95-95-142-35-174 35-173 95-143 143-95 173-35 174 35 142 95 95 143 35 173z m54 0q0-102-40-194t-106-160-160-106-194-40-194 40-160 106-106 160-40 194 40 194 106 160 160 106 194 40 194-40 160-106 106-160 40-194z" horiz-adv-x="1000" />
226
+
227
+ <glyph glyph-name="chrome" unicode="&#xf268;" d="M498 850q134 1 252-67 130-75 196-208l-414 22q-89 5-164-41t-103-128l-154 236q72 89 174 137t213 49z m-416-226l188-370q40-80 117-121t164-25l-129-252q-118 19-214 88t-152 176-56 230q0 149 82 274z m885-94q32-84 33-174t-27-170-86-152-137-117q-128-74-278-66l226 347q49 73 46 162t-59 155z m-467-11q70 0 119-50t50-119-50-119-119-49-119 49-49 119 49 119 119 50z" horiz-adv-x="1000" />
228
+
229
+ <glyph glyph-name="firefox" unicode="&#xf269;" d="M504-150q-158 0-282 84t-183 222q-33 74-38 168t15 186 62 174 100 135l-7-156q7 7 38 8t39-8q24 45 90 77t131 32q-30-25-67-82t-33-92q14-4 35-7t36-4 37-3 29-1q8-3 5-26t-17-42q-3-4-9-10t-32-20-56-19l8-105-77 37q-10-24-5-45t21-38 36-23 45-3q29 5 55 19t47 25 41 10q34-2 50-19t10-36q0-1-1-3t-5-7-10-9-17-5-26-1q-34-53-81-76t-117-16q41-34 91-46t94-3 86 29 71 48 45 58q24 51 22 108t-21 105-44 70q49-21 77-45t43-62q8 95-32 191t-117 159q148-43 230-156t84-289q1-71-23-143t-68-132-106-110-138-75-161-28z" horiz-adv-x="1000" />
230
+
231
+ <glyph glyph-name="opera" unicode="&#xf26a;" d="M833 723q-92 61-200 61-87 0-164-41t-134-111q-41-52-66-122t-27-148v-24q2-78 27-148t66-122q57-71 134-111t164-41q108 0 200 61-67-60-153-94t-180-33q-16 0-24 1-98 4-186 45t-152 108-101 157-37 189q0 102 40 194t106 160 160 106 194 40h2q93-1 179-34t152-93z m167-373q0-107-43-202t-119-166q-58-35-124-35-76 0-142 47 86 31 141 130t56 226q0 127-55 225t-141 131q66 46 141 46 67 0 126-36 76-70 118-164t42-202z" horiz-adv-x="1000" />
232
+
233
+ <glyph glyph-name="internet-explorer" unicode="&#xf26b;" d="M1000 327q0-31-4-58h-642q0-81 61-136t144-55q55 0 103 26t76 73h236q-31-89-95-157t-149-106-179-37q-105 0-199 47-127-65-220-65-132 0-132 147 0 64 25 153 10 34 61 128 111 201 265 338-103-44-238-197 35 153 158 250t280 98q17 0 25 0 142 65 242 65 35 0 64-7t53-23 37-42 14-65q0-64-42-159 56-102 56-218z m-39 357q0 47-30 74t-76 27q-60 0-142-39 68-26 124-73t96-109q28 75 28 120z m-890-690q0-48 28-74t75-26q64 0 148 46-68 41-119 103t-77 136q-55-114-55-185z m282 398h406q-3 79-63 132t-140 53q-81 0-140-53t-63-132z" horiz-adv-x="1000" />
234
+
235
+ <glyph glyph-name="television" unicode="&#xf26c;" d="M1000 154v535q0 8-5 13t-13 5h-893q-7 0-12-5t-6-13v-535q0-8 6-13t12-5h893q7 0 13 5t5 13z m71 535v-535q0-37-26-63t-63-27h-411v-71h197q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v36q0 8 5 13t13 5h196v71h-411q-36 0-63 27t-26 63v535q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1142.9" />
236
+
237
+ <glyph glyph-name="percent" unicode="&#xf295;" d="M714 136q0 29-21 50t-50 21-50-21-22-50 22-50 50-22 50 22 21 50z m-428 428q0 29-21 51t-51 21-50-21-21-51 21-50 50-21 51 21 21 50z m571-428q0-89-63-152t-151-63-152 63-62 152 62 151 152 63 151-63 63-151z m-53 607q0-11-8-21l-589-786q-11-15-28-15h-90q-14 0-25 11t-10 25q0 11 7 21l589 786q11 15 29 15h89q14 0 25-11t11-25z m-375-179q0-88-63-151t-152-63-151 63-63 151 63 152 151 63 152-63 63-152z" horiz-adv-x="857.1" />
238
+ </font>
239
+ </defs>
240
  </svg>
css/jquery-ui.min.css CHANGED
@@ -1,7 +1,7 @@
1
- /*! jQuery UI - v1.12.1 - 2018-05-17
2
- * http://jqueryui.com
3
- * Includes: draggable.css, core.css, resizable.css, accordion.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=custom-theme&bgImgOpacityError=&bgImgOpacityHighlight=&bgImgOpacityActive=&bgImgOpacityHover=&bgImgOpacityDefault=&bgImgOpacityContent=&bgImgOpacityHeader=&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=%23666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=%23aaaaaa&iconColorError=%23cc0000&fcError=%235f3f3f&borderColorError=%23f1a899&bgTextureError=flat&bgColorError=%23fddfdf&iconColorHighlight=%23777620&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgTextureHighlight=flat&bgColorHighlight=%23fffa90&iconColorActive=%23ffffff&fcActive=%23ffffff&borderColorActive=%23246b85&bgTextureActive=flat&bgColorActive=%232ea2cc&iconColorHover=%23555555&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgTextureHover=flat&bgColorHover=%23ededed&iconColorDefault=%23777777&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgTextureDefault=flat&bgColorDefault=%23f6f6f6&iconColorContent=%23444444&fcContent=%23333333&borderColorContent=%23dddddd&bgTextureContent=flat&bgColorContent=%23ffffff&iconColorHeader=%23444444&fcHeader=%23333333&borderColorHeader=%23dddddd&bgTextureHeader=flat&bgColorHeader=%23e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
5
- * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
-
7
  .ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #246b85;background:#2ea2cc;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#246b85;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
1
+ /*! jQuery UI - v1.12.1 - 2018-05-17
2
+ * http://jqueryui.com
3
+ * Includes: draggable.css, core.css, resizable.css, accordion.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=custom-theme&bgImgOpacityError=&bgImgOpacityHighlight=&bgImgOpacityActive=&bgImgOpacityHover=&bgImgOpacityDefault=&bgImgOpacityContent=&bgImgOpacityHeader=&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=%23666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=%23aaaaaa&iconColorError=%23cc0000&fcError=%235f3f3f&borderColorError=%23f1a899&bgTextureError=flat&bgColorError=%23fddfdf&iconColorHighlight=%23777620&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgTextureHighlight=flat&bgColorHighlight=%23fffa90&iconColorActive=%23ffffff&fcActive=%23ffffff&borderColorActive=%23246b85&bgTextureActive=flat&bgColorActive=%232ea2cc&iconColorHover=%23555555&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgTextureHover=flat&bgColorHover=%23ededed&iconColorDefault=%23777777&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgTextureDefault=flat&bgColorDefault=%23f6f6f6&iconColorContent=%23444444&fcContent=%23333333&borderColorContent=%23dddddd&bgTextureContent=flat&bgColorContent=%23ffffff&iconColorHeader=%23444444&fcHeader=%23333333&borderColorHeader=%23dddddd&bgTextureHeader=flat&bgColorHeader=%23e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
  .ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #246b85;background:#2ea2cc;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#246b85;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
i18n/cleantalk-ru_RU.po CHANGED
@@ -1,1540 +1,1540 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Anti-Spam by CleanTalk\n"
4
- "POT-Creation-Date: 2019-10-27 16:02+0000\n"
5
- "PO-Revision-Date: 2019-10-27 16:39+0000\n"
6
- "Last-Translator: admin <ievlev@cleantalk.org>\n"
7
- "Language-Team: Русский\n"
8
- "Language: ru_RU\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Loco https://localise.biz/\n"
13
- "X-Poedit-Basepath: ..\n"
14
- "X-Poedit-WPHeader: cleantalk.php\n"
15
- "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
16
- "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
- "X-Poedit-SearchPathExcluded-0: *.js\n"
23
- "Report-Msgid-Bugs-To: \n"
24
- "X-Loco-Version: 2.3.0; wp-5.2.4"
25
-
26
- #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
27
- #: inc/cleantalk-users.php:15
28
- msgid "Check for spam"
29
- msgstr "Проверить на спам"
30
-
31
- #: inc/classCleantalkComments.php:33 inc/cleantalk-admin.php:350
32
- #: inc/cleantalk-comments.php:16
33
- msgid "Find spam comments"
34
- msgstr "Найти спам в комментариях"
35
-
36
- #: inc/classCleantalkComments.php:66 inc/cleantalk-comments.php:26
37
- #: inc/cleantalk-users.php:25
38
- msgid "Plugin Settings"
39
- msgstr "Настройки плагина"
40
-
41
- #: inc/classCleantalkComments.php:76 inc/cleantalk-comments.php:35
42
- #: inc/cleantalk-users.php:34
43
- #, php-format
44
- msgid ""
45
- "Antispam hosting tariff does not allow you to use this feature. To do so, "
46
- "you need to enter an Access Key in the %splugin settings%s."
47
- msgstr ""
48
- "Тариф на антиспам хостинг не позволяет использовать эту функцию. Для этого "
49
- "вам необходимо ввести ключ доступа в %sнастройках плагина%s."
50
-
51
- #: inc/classCleantalkComments.php:101 inc/cleantalk-comments.php:60
52
- #: inc/cleantalk-users.php:60
53
- msgid ""
54
- "Ajax error. Process will be automatically restarted in 3 seconds. Status: "
55
- msgstr ""
56
- "Ajax ошибка. Процесс проверки будет автоматически возобновлен через 3 "
57
- "секунды. Статус:"
58
-
59
- #: inc/classCleantalkComments.php:108 inc/cleantalk-comments.php:67
60
- msgid ""
61
- "Please wait for a while. CleanTalk is deleting spam comments. Comments left: "
62
- msgstr "Пожалуйста, подождите. CleanTalk удаляет спам-комментарии. Осталось:"
63
-
64
- #: inc/classCleantalkComments.php:118 inc/cleantalk-comments.php:77
65
- #: inc/cleantalk-users.php:77
66
- msgid "Start check"
67
- msgstr "Начать проверку"
68
-
69
- #: inc/classCleantalkComments.php:119 inc/cleantalk-comments.php:78
70
- #: inc/cleantalk-users.php:78
71
- msgid "Continue check"
72
- msgstr "Продолжить проверку"
73
-
74
- #: inc/classCleantalkComments.php:120 inc/cleantalk-comments.php:79
75
- msgid ""
76
- "The plugin will check all comments against blacklists database and show you "
77
- "senders that have spam activity on other websites."
78
- msgstr ""
79
- "Пожалуйста, подождите. CleanTalk проверяет комментарии по черным спискам на "
80
- "cleantalk.org. Вы сможете удалить комментарии со спамом после окончания "
81
- "работы."
82
-
83
- #: inc/classCleantalkComments.php:123 inc/cleantalk-comments.php:82
84
- #: inc/cleantalk-users.php:82
85
- msgid "Accurate check"
86
- msgstr "Точная проверка"
87
-
88
- #: inc/classCleantalkComments.php:125 inc/cleantalk-comments.php:84
89
- msgid ""
90
- "Allows to use comment's dates to perform more accurate check. Could "
91
- "seriously slow down the check."
92
- msgstr ""
93
- "Позволяет использовать даты комментариев для выполения более тщательной "
94
- "проверки. Может серьезно замедлить проверку."
95
-
96
- #: inc/classCleantalkComments.php:128 inc/cleantalk-comments.php:87
97
- #: inc/cleantalk-users.php:87
98
- msgid "Specify date range"
99
- msgstr "Указать диапазон дат"
100
-
101
- #: inc/classCleantalkComments.php:149 inc/cleantalk-comments.php:108
102
- msgid ""
103
- "Please wait! CleanTalk is checking all approved and pending comments via "
104
- "blacklist database at cleantalk.org. You will have option to delete found "
105
- "spam comments after plugin finish."
106
- msgstr ""
107
- "Пожалуйста, подождите! CleanTalk проверяет комментарии по черным спискам на "
108
- "cleantalk.org. Вы сможете удалить комментарии со спамом после окончания "
109
- "работы."
110
-
111
- #: inc/classCleantalkCommentsListTable.php:24
112
- msgid "Author"
113
- msgstr "Автор"
114
-
115
- #: inc/classCleantalkCommentsListTable.php:25 inc/cleantalk-comments.php:158
116
- msgid "Comment"
117
- msgstr "Комментарий"
118
-
119
- #: inc/classCleantalkCommentsListTable.php:26 inc/cleantalk-comments.php:159
120
- msgid "In Response To"
121
- msgstr "В ответ на"
122
-
123
- #: inc/classCleantalkCommentsListTable.php:33
124
- msgid "No spam comments."
125
- msgstr "Нет спам комментариев."
126
-
127
- #: inc/cleantalk-admin.php:27
128
- #, php-format
129
- msgid "Find spam %s"
130
- msgstr "Найти спам %s"
131
-
132
- #: inc/cleantalk-admin.php:31
133
- msgid "CleanTalk Anti-Spam Log"
134
- msgstr "CleanTalk Anti-Spam лог"
135
-
136
- #: inc/cleantalk-admin.php:50
137
- #, php-format
138
- msgid "%sRefresh%s"
139
- msgstr "%sОбновить%s"
140
-
141
- #: inc/cleantalk-admin.php:51
142
- #, php-format
143
- msgid "%sConfigure%s"
144
- msgstr "%sКонфигурация%s"
145
-
146
- #: inc/cleantalk-admin.php:68
147
- msgid "7 days anti-spam stats"
148
- msgstr "Статистика атак за 7 дней"
149
-
150
- #: inc/cleantalk-admin.php:72
151
- msgid "Top 5 spam IPs blocked"
152
- msgstr "Топ 5 cамых заблокированных IP"
153
-
154
- #: inc/cleantalk-admin.php:78
155
- msgid "Get Access key to activate Anti-Spam protection!"
156
- msgstr "Получите ключ доступа для активации спам защиты!"
157
-
158
- #: inc/cleantalk-admin.php:86
159
- #, php-format
160
- msgid "Something went wrong! Error: \"%s\"."
161
- msgstr "Что-то пошло не так: Ошибка: \"%s\"."
162
-
163
- #: inc/cleantalk-admin.php:90
164
- msgid "Please, visit your dashboard."
165
- msgstr "Пожалуйста, посетите панель управления."
166
-
167
- #: inc/cleantalk-admin.php:104
168
- msgid "IP"
169
- msgstr "IP"
170
-
171
- #: inc/cleantalk-admin.php:105
172
- msgid "Country"
173
- msgstr "Страна"
174
-
175
- #: inc/cleantalk-admin.php:106
176
- msgid "Block Count"
177
- msgstr "Заблкирован раз"
178
-
179
- #: inc/cleantalk-admin.php:134
180
- #, php-format
181
- msgid ""
182
- "This is the count from the %s's cloud and could be different to admin bar "
183
- "counters"
184
- msgstr ""
185
- "Это счетчик из %s облака, эти данные могут отличаться от данных счетчика в "
186
- "админ-баре."
187
-
188
- #. %s: Number of spam messages
189
- #: inc/cleantalk-admin.php:137
190
- #, php-format
191
- msgid ""
192
- "%s%s%s has blocked %s spam for all time. The statistics are automatically "
193
- "updated every 24 hours."
194
- msgstr ""
195
- "%s%s%s заблокировал %s спама за все время. Статистика автоматически "
196
- "обновляется каждый 24 часа."
197
-
198
- #: inc/cleantalk-admin.php:148 inc/cleantalk-settings.php:544
199
- #, php-format
200
- msgid "Do you like CleanTalk? %sPost your feedback here%s."
201
- msgstr "Вам понравился CleanTalk?%s Напишите свой отзыв здесь%s."
202
-
203
- #: inc/cleantalk-admin.php:234
204
- msgid "Translate"
205
- msgstr "Перевести"
206
-
207
- #: inc/cleantalk-admin.php:237
208
- msgid "Start here"
209
- msgstr "Начать здесь"
210
-
211
- #: inc/cleantalk-admin.php:238
212
- msgid "FAQ"
213
- msgstr "FAQ"
214
-
215
- #: inc/cleantalk-admin.php:239 inc/cleantalk-admin.php:644
216
- #: inc/cleantalk-settings.php:575
217
- msgid "Support"
218
- msgstr "Поддержка"
219
-
220
- #: inc/cleantalk-admin.php:306 inc/cleantalk-settings.php:523
221
- msgid "Hosting AntiSpam"
222
- msgstr "Hosting AntiSpam"
223
-
224
- #: inc/cleantalk-admin.php:333
225
- msgid "Failed from timeout. Going to check comments again."
226
- msgstr "Ошибка по таймауту. Попробовать еще раз?"
227
-
228
- #: inc/cleantalk-admin.php:334
229
- msgid "Added"
230
- msgstr "Добавлены"
231
-
232
- #: inc/cleantalk-admin.php:335 inc/cleantalk-admin.php:386
233
- msgid "Deleted"
234
- msgstr "Удалено"
235
-
236
- #: inc/cleantalk-admin.php:336
237
- msgid "comments"
238
- msgstr "комментарии"
239
-
240
- #: inc/cleantalk-admin.php:337
241
- msgid "Delete all spam comments?"
242
- msgstr "Удалить ВСЕ найденные спам-комментарии?"
243
-
244
- #: inc/cleantalk-admin.php:338
245
- msgid "Delete checked comments?"
246
- msgstr "Удалить отмеченые спам-комментарии?"
247
-
248
- #: inc/cleantalk-admin.php:339
249
- #, php-format
250
- msgid ""
251
- "Total comments %s. Checked %s. Found %s spam comments. %s bad comments "
252
- "(without IP or email)."
253
- msgstr ""
254
- "Всего комментариев %s. Проверено %s. Найдено %s спам комментариев. %s плохих "
255
- "комментариев (без IP и Email'а)."
256
-
257
- #: inc/cleantalk-admin.php:340 inc/cleantalk-admin.php:393
258
- #: inc/cleantalk-users.php:531
259
- msgid "Please do backup of WordPress database before delete any accounts!"
260
- msgstr ""
261
- "Пожалуйста, сделайте резервную копию базы данных Wordpress перед удалением "
262
- "аккаунтов."
263
-
264
- #: inc/cleantalk-admin.php:351
265
- msgid "The sender has been whitelisted."
266
- msgstr "Отправитель был добавлен в белый список."
267
-
268
- #: inc/cleantalk-admin.php:352
269
- msgid "The sender has been blacklisted."
270
- msgstr "Отправитель был добавлен в черный список."
271
-
272
- #: inc/cleantalk-admin.php:353 inc/cleantalk-public.php:3321
273
- #, php-format
274
- msgid "Feedback has been sent to %sCleanTalk Dashboard%s."
275
- msgstr "Обратная связь отправлена в панель управления %sCleanTalk%s."
276
-
277
- #: inc/cleantalk-admin.php:383
278
- msgid "Failed from timeout. Going to check users again."
279
- msgstr "Ошибка по таймауту. Попробовать еще раз?"
280
-
281
- #: inc/cleantalk-admin.php:384
282
- msgid "Failed from timeout. Going to run a new attempt to delete spam users."
283
- msgstr "Ошибка по таймауту. Попробовать еще раз?"
284
-
285
- #: inc/cleantalk-admin.php:385
286
- msgid "Inserted"
287
- msgstr "Добавлено"
288
-
289
- #: inc/cleantalk-admin.php:387
290
- msgid "users."
291
- msgstr "пользователей."
292
-
293
- #: inc/cleantalk-admin.php:388
294
- msgid "Delete all spam users?"
295
- msgstr "Удалить ВСЕХ найденых спам-пользователей?"
296
-
297
- #: inc/cleantalk-admin.php:389
298
- msgid "Delete checked users?"
299
- msgstr "Удалить отмеченых спам-пользователей?"
300
-
301
- #: inc/cleantalk-admin.php:392
302
- #, php-format
303
- msgid ""
304
- "Total users %s, checked %s, found %s spam users and %s bad users (without IP "
305
- "or email)"
306
- msgstr ""
307
- "Всего пользователей %s, проверено %s, найдено %s спам пользователей и %s "
308
- "плохих пользователей (без IP и Email'а)"
309
-
310
- #: inc/cleantalk-admin.php:401
311
- msgid "Find spam-users"
312
- msgstr "Найти спам-пользователей"
313
-
314
- #: inc/cleantalk-admin.php:449
315
- #, php-format
316
- msgid "Unable to get Access key automatically: %s"
317
- msgstr "Невозможно получить ключ автоматически: %s"
318
-
319
- #: inc/cleantalk-admin.php:450
320
- msgid "Get the Access key"
321
- msgstr "Получить ключ вручную"
322
-
323
- #: inc/cleantalk-admin.php:459
324
- #, php-format
325
- msgid "Please enter Access Key in %s settings to enable anti spam protection!"
326
- msgstr ""
327
- "Пожалуйста, укажите Ключ доступа в настройках %s для активации защиты от "
328
- "спама!"
329
-
330
- #: inc/cleantalk-admin.php:469
331
- #, php-format
332
- msgid "%s trial period ends, please upgrade to %s!"
333
- msgstr ""
334
- "%s заканчивается ознакомительный срок пользования антиспам плагином "
335
- "CleanTalk, пожалуйста продлите подключение %s."
336
-
337
- #: inc/cleantalk-admin.php:481
338
- msgid "RENEW ANTI-SPAM"
339
- msgstr "ПРОДЛИТЬ АНТИСПАМ"
340
-
341
- #: inc/cleantalk-admin.php:482
342
- msgid "next year"
343
- msgstr "следующий год"
344
-
345
- #: inc/cleantalk-admin.php:486
346
- #, php-format
347
- msgid "Please renew your anti-spam license for %s."
348
- msgstr "Пожалуйста, продлите свою антиспам-лицензию на %s."
349
-
350
- #: inc/cleantalk-admin.php:511
351
- msgid "Make it right!"
352
- msgstr "Сделай все правильно!"
353
-
354
- #: inc/cleantalk-admin.php:513
355
- #, php-format
356
- msgid "%sGet premium%s"
357
- msgstr "%sПолучить премиум%s"
358
-
359
- #: inc/cleantalk-admin.php:552
360
- msgid "Since"
361
- msgstr "От"
362
-
363
- #: inc/cleantalk-admin.php:558
364
- msgid ""
365
- "All / Allowed / Blocked submissions. The number of submissions is being "
366
- "counted since CleanTalk plugin installation."
367
- msgstr "Все / Разрешенные / Запрещенные запросы с момента установки CleanTalk."
368
-
369
- #: inc/cleantalk-admin.php:558
370
- msgid "All"
371
- msgstr "Все"
372
-
373
- #: inc/cleantalk-admin.php:566
374
- msgid ""
375
- "Allowed / Blocked submissions. The number of submissions for past 24 hours. "
376
- msgstr "Разрешенные / Запрещенные запросы за последние 24 часа."
377
-
378
- #: inc/cleantalk-admin.php:566
379
- msgid "Day"
380
- msgstr "За день"
381
-
382
- #: inc/cleantalk-admin.php:572
383
- msgid ""
384
- "All / Blocked events. Access attempts regitred by SpamFireWall counted since "
385
- "the last plugin activation."
386
- msgstr ""
387
- "Все / Запрещенные попытки просмотра сайта. Отображет попытки с момента "
388
- "последней активации плагина."
389
-
390
- #: inc/cleantalk-admin.php:582
391
- msgid ""
392
- "Allowed / Blocked submissions. The number of submissions is being counted "
393
- "since "
394
- msgstr "Разрешенные / Запрещенные попытки."
395
-
396
- #: inc/cleantalk-admin.php:593
397
- msgid "dashboard"
398
- msgstr "панель управления"
399
-
400
- #: inc/cleantalk-admin.php:600
401
- msgid "Settings"
402
- msgstr "Настройки"
403
-
404
- #: inc/cleantalk-admin.php:608
405
- msgid "Bulk spam comments removal tool."
406
- msgstr "Инструмент массового удаления пользователей."
407
-
408
- #: inc/cleantalk-admin.php:608 inc/cleantalk-settings.php:882
409
- msgid "Check comments for spam"
410
- msgstr "Проверка комментариев"
411
-
412
- #: inc/cleantalk-admin.php:618 inc/cleantalk-settings.php:885
413
- msgid "Check users for spam"
414
- msgstr "Проверить пользователей на спам"
415
-
416
- #: inc/cleantalk-admin.php:627
417
- msgid "Reset first counter"
418
- msgstr "Сбросить первый счетчик"
419
-
420
- #: inc/cleantalk-admin.php:635
421
- msgid "Reset all counters"
422
- msgstr "Сбросить все счетчики"
423
-
424
- #: inc/cleantalk-comments.php:221 inc/cleantalk-users.php:220
425
- msgid "Approve"
426
- msgstr "Одобрить"
427
-
428
- #: inc/cleantalk-comments.php:223 inc/cleantalk-users.php:222
429
- msgid "Delete"
430
- msgstr "Удалить"
431
-
432
- #: inc/cleantalk-comments.php:265
433
- msgid "Delete all comments from the list"
434
- msgstr "Удалить все сообщения в списке"
435
-
436
- #: inc/cleantalk-comments.php:266 inc/cleantalk-users.php:268
437
- msgid "Delete selected"
438
- msgstr "Удалить отмеченные"
439
-
440
- #: inc/cleantalk-comments.php:270
441
- msgid "Insert comments"
442
- msgstr "Добавить комментарии"
443
-
444
- #: inc/cleantalk-comments.php:271
445
- msgid "Delete comments"
446
- msgstr "Удалить тестовые спам-комментарии?"
447
-
448
- #: inc/cleantalk-comments.php:276 inc/cleantalk-users.php:279
449
- msgid ""
450
- "There is some differencies between blacklists database and our API "
451
- "mechanisms. Blacklists shows all history of spam activity, but our API (that "
452
- "used in spam checking) used another parameters, too: last day of activity, "
453
- "number of spam attacks during last days etc. This mechanisms help us to "
454
- "reduce number of false positivitie. So, there is nothing strange, if some "
455
- "emails/IPs will be not found by this checking."
456
- msgstr ""
457
- "Есть некоторые отличия между проверкой через базу данных черных списков и "
458
- "через механизм API. В черных списках отображается вся история о спам-"
459
- "активности, но наш API используетс другие механизмы: последний день "
460
- "активности, количество спам-атак в течение последних дней и т. д. Эти "
461
- "механизмы помогают нам сократить количество ложных обнаружений. Поэтому, нет "
462
- "ничего странного, если некоторые письма/IP не будут обнаружены при этой "
463
- "проверке."
464
-
465
- #: inc/cleantalk-comments.php:281 inc/cleantalk-users.php:284
466
- msgid "Stop deletion"
467
- msgstr "Остановить удаление"
468
-
469
- #: inc/cleantalk-comments.php:495
470
- #, php-format
471
- msgid ""
472
- "Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad "
473
- "comments (without IP or email)."
474
- msgstr ""
475
- "Всего комментариев %s. Проверено %s. Последняя проверка %s. Найдено %s спам-"
476
- "комментариев. %s плохие комментарии (без IP или электронной почты)."
477
-
478
- #: inc/cleantalk-comments.php:499
479
- msgid "Please do backup of WordPress database before delete any comments!"
480
- msgstr ""
481
- "Пожалуйста, сделайте резервную копию базы данных Wordpress перед удалением "
482
- "комментариев."
483
-
484
- #: inc/cleantalk-public.php:500 inc/cleantalk-public.php:641
485
- #: inc/cleantalk-public.php:743 inc/cleantalk-public.php:2363
486
- #: inc/cleantalk-public.php:3052
487
- msgid "Spam protection by CleanTalk"
488
- msgstr "Спам защита CleanTalk"
489
-
490
- #: inc/cleantalk-public.php:1233 inc/cleantalk-public.php:1361
491
- #: inc/cleantalk-public.php:1379
492
- msgid "Spam protection"
493
- msgstr "Защита от спама"
494
-
495
- #: inc/cleantalk-public.php:1332
496
- msgid "CleanTalk AntiSpam: This message is possible spam."
497
- msgstr "CleanTalk AntiSpam: Это сообщение, возможно, является спамом."
498
-
499
- #: inc/cleantalk-public.php:1333
500
- msgid "You could check it in CleanTalk's anti-spam database:"
501
- msgstr "Вы можете проверить это по антиспам-базе CleanTalk:"
502
-
503
- #: inc/cleantalk-public.php:1569
504
- #, php-format
505
- msgid "Registration approved by %s."
506
- msgstr "Регистрация одобрена %s."
507
-
508
- #: inc/cleantalk-public.php:1849
509
- msgid "CleanTalk AntiSpam: This registration is spam."
510
- msgstr "CleanTalk AntiSpam: Эта регистрация - спам."
511
-
512
- #: inc/cleantalk-public.php:1850 inc/cleantalk-public.php:2219
513
- #: inc/cleantalk-public.php:2387 inc/cleantalk-public.php:2542
514
- msgid "CleanTalk's anti-spam database:"
515
- msgstr "Антиспам-база CleanTalk:"
516
-
517
- #: inc/cleantalk-public.php:2218 inc/cleantalk-public.php:2386
518
- #: inc/cleantalk-public.php:2541
519
- msgid "CleanTalk AntiSpam: This message is spam."
520
- msgstr "CleanTalk AntiSpam: Это сообщение - спам."
521
-
522
- #: inc/cleantalk-public.php:2666
523
- msgid "Comment approved. Anti-spam by CleanTalk."
524
- msgstr "Комментарий одобрен. Антиспам от CleanTalk."
525
-
526
- #: inc/cleantalk-public.php:3219
527
- msgid "Attention, please!"
528
- msgstr "Внимание!"
529
-
530
- #: inc/cleantalk-public.php:3220
531
- #, php-format
532
- msgid "\"%s\" plugin error on your site \"%s\":"
533
- msgstr "\"%s\" ошибка плагина на сайте \"%s\":"
534
-
535
- #: inc/cleantalk-public.php:3222
536
- #, php-format
537
- msgid "[%s] \"%s\" error!"
538
- msgstr "[%s] \"%s\" ошибка!"
539
-
540
- #: inc/cleantalk-public.php:3271
541
- msgid ""
542
- "By using this form you agree with the storage and processing of your data by "
543
- "using the Privacy Policy on this website."
544
- msgstr ""
545
- "Используя эту форму, вы соглашаетесь с хранением и обработкой ваших данных, "
546
- "в соответствии с Политикой конфиденциальности на этом сайте."
547
-
548
- #: inc/cleantalk-public.php:3319
549
- msgid "Error occured while sending feedback."
550
- msgstr "Случилась ошибка при отправке обратной связи."
551
-
552
- #: inc/cleantalk-public.php:3320
553
- msgid "Feedback wasn't sent. There is no associated request."
554
- msgstr "Обратная связь не была отправлена. Нет связанного запроса."
555
-
556
- #: inc/cleantalk-public.php:3364
557
- msgid "Sender info"
558
- msgstr "Информация об отправителе"
559
-
560
- #: inc/cleantalk-public.php:3367
561
- msgid "by"
562
- msgstr " от"
563
-
564
- #: inc/cleantalk-public.php:3378
565
- msgid "No email"
566
- msgstr "Email отсутствует"
567
-
568
- #: inc/cleantalk-public.php:3388
569
- msgid "No IP"
570
- msgstr "IP отсутствует"
571
-
572
- #: inc/cleantalk-public.php:3391
573
- msgid "Mark as spam"
574
- msgstr "Отметить как спам"
575
-
576
- #: inc/cleantalk-public.php:3392
577
- msgid "Unspam"
578
- msgstr "Вернуть из спама"
579
-
580
- #: inc/cleantalk-public.php:3394
581
- msgid "Marked as spam."
582
- msgstr "Отмечено как спам."
583
-
584
- #: inc/cleantalk-public.php:3395
585
- msgid "Marked as not spam."
586
- msgstr "Отмечено как не спам."
587
-
588
- #: inc/cleantalk-settings.php:96
589
- msgid "SpamFireWall"
590
- msgstr "SpamFireWall"
591
-
592
- #: inc/cleantalk-settings.php:97
593
- msgid ""
594
- "This option allows to filter spam bots before they access website. Also "
595
- "reduces CPU usage on hosting server and accelerates pages load time."
596
- msgstr ""
597
- "Эта опция позволяет фильтровать спам-ботов прежде, чем они войдут на сайт. "
598
- "Также уменьшает загрузку процессора на хостинге и ускоряет время загрузки "
599
- "страниц."
600
-
601
- #: inc/cleantalk-settings.php:104
602
- msgid "Forms to protect"
603
- msgstr "Защищаемые формы"
604
-
605
- #: inc/cleantalk-settings.php:110
606
- msgid "Advanced settings"
607
- msgstr "Продвинутые настройки"
608
-
609
- #: inc/cleantalk-settings.php:117
610
- msgid "Registration Forms"
611
- msgstr "Формы регистрации"
612
-
613
- #: inc/cleantalk-settings.php:118
614
- msgid "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
615
- msgstr "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
616
-
617
- #: inc/cleantalk-settings.php:121
618
- msgid "Comments form"
619
- msgstr "Комментарии в блоге"
620
-
621
- #: inc/cleantalk-settings.php:122
622
- msgid "WordPress, JetPack, WooCommerce."
623
- msgstr "WordPress, JetPack, WooCommerce."
624
-
625
- #: inc/cleantalk-settings.php:125 inc/cleantalk-settings.php:761
626
- msgid "Contact forms"
627
- msgstr "Контактные формы"
628
-
629
- #: inc/cleantalk-settings.php:126
630
- msgid ""
631
- "Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, "
632
- "WordPress Landing Pages, Gravity Forms."
633
- msgstr ""
634
- "Contact Form 7, Formidable Forms, Jetpack, Fast Secure Contact Form, "
635
- "WordPress Landing Pages, Gravity Forms."
636
-
637
- #: inc/cleantalk-settings.php:129 inc/cleantalk-settings.php:762
638
- msgid "Custom contact forms"
639
- msgstr "Произвольные контактные формы"
640
-
641
- #: inc/cleantalk-settings.php:130
642
- msgid "Anti spam test for any WordPress themes or contacts forms."
643
- msgstr "Защита от спама любой контактной формы или темы."
644
-
645
- #: inc/cleantalk-settings.php:133 inc/cleantalk-settings.php:775
646
- msgid "WooCommerce checkout form"
647
- msgstr "Форма заказа WooCommerce"
648
-
649
- #: inc/cleantalk-settings.php:134
650
- msgid "Anti spam test for WooCommerce checkout form."
651
- msgstr "Спам тест для формы заказа WooCommerce"
652
-
653
- #: inc/cleantalk-settings.php:138
654
- msgid "Spam test for registration during checkout"
655
- msgstr "Регистрация на странице заказа"
656
-
657
- #: inc/cleantalk-settings.php:139
658
- msgid ""
659
- "Enable anti spam test for registration process which during woocommerce's "
660
- "checkout."
661
- msgstr ""
662
- "Включить защиту от спама в регистрациях, которые проходят во время "
663
- "оформления заказа."
664
-
665
- #: inc/cleantalk-settings.php:145
666
- msgid "Test default Wordpress search form for spam"
667
- msgstr "Стандартная форма поиска Wordpress"
668
-
669
- #: inc/cleantalk-settings.php:146
670
- msgid "Spam protection for Search form."
671
- msgstr "Защита от спама для Форм поиска."
672
-
673
- #: inc/cleantalk-settings.php:148
674
- #, php-format
675
- msgid "Read more about %sspam protection for Search form%s on our blog."
676
- msgstr "Прочтите о %sспам-защите для Форм поиска%s на нашем блоге."
677
-
678
- #: inc/cleantalk-settings.php:156
679
- msgid "Protect external forms"
680
- msgstr "Защита внешних форм"
681
-
682
- #: inc/cleantalk-settings.php:157
683
- msgid ""
684
- "Turn this option on to protect forms on your WordPress that send data to "
685
- "third-part servers (like MailChimp)."
686
- msgstr ""
687
- "Включите эту опцию, что бы защитить формы, которые отсылают данные на "
688
- "сторонние ресурсы, например MailChimp."
689
-
690
- #: inc/cleantalk-settings.php:161
691
- msgid "Capture buffer"
692
- msgstr "Захват буфера"
693
-
694
- #: inc/cleantalk-settings.php:162
695
- msgid ""
696
- "This setting gives you more sophisticated and strengthened protection for "
697
- "external forms. But it could break plugins which use a buffer like Ninja "
698
- "Forms."
699
- msgstr ""
700
- "Этот параметр дает вам более сложную и усиленную защиту для внешних форм. Но "
701
- "это может сломать плагины, которые используют буфер, такой как Ninja Forms."
702
-
703
- #: inc/cleantalk-settings.php:167
704
- msgid "Protect internal forms"
705
- msgstr "Защита внутренних форм"
706
-
707
- #: inc/cleantalk-settings.php:168
708
- msgid ""
709
- "This option will enable protection for custom (hand-made) AJAX forms with "
710
- "PHP scripts handlers on your WordPress."
711
- msgstr "Эта опция обеспечит защиту созданных вручную форм, использующих AJAX."
712
-
713
- #: inc/cleantalk-settings.php:175
714
- msgid "Comments and Messages"
715
- msgstr "Комментарии и сообщения"
716
-
717
- #: inc/cleantalk-settings.php:178
718
- msgid "BuddyPress Private Messages"
719
- msgstr "Личные сообщения buddyPress"
720
-
721
- #: inc/cleantalk-settings.php:179
722
- msgid "Check buddyPress private messages."
723
- msgstr "Проверять личные сообщения buddyPress "
724
-
725
- #: inc/cleantalk-settings.php:182
726
- msgid "Don't check trusted user's comments"
727
- msgstr "Не проверять доверенных пользователей"
728
-
729
- #: inc/cleantalk-settings.php:183
730
- #, php-format
731
- msgid "Don't check comments for users with above %d comments."
732
- msgstr "Не проверять комментарии пользователей с более %d комментариями."
733
-
734
- #: inc/cleantalk-settings.php:186
735
- msgid "Automatically delete spam comments"
736
- msgstr "Автоматически удалять спам-комментарии"
737
-
738
- #: inc/cleantalk-settings.php:187
739
- #, php-format
740
- msgid "Delete spam comments older than %d days."
741
- msgstr "Удалять комментарии старше %d дней."
742
-
743
- #: inc/cleantalk-settings.php:190
744
- msgid "Remove links from approved comments"
745
- msgstr "Удалять ссылки из одобреных комментариев"
746
-
747
- #: inc/cleantalk-settings.php:191
748
- msgid "Remove links from approved comments. Replace it with \"[Link deleted]\""
749
- msgstr "Удалять ссылки из одобренных сообщений"
750
-
751
- #: inc/cleantalk-settings.php:194
752
- msgid "Show links to check Emails, IPs for spam."
753
- msgstr "Отобразить ссылки для проверки Email'ов и IP адресов."
754
-
755
- #: inc/cleantalk-settings.php:195
756
- msgid ""
757
- "Shows little icon near IP addresses and Emails allowing you to check it via "
758
- "CleanTalk's database. Also allowing you to manage comments from the public "
759
- "post's page."
760
- msgstr ""
761
- "Показывает маленькую иконку около IP и Email'a позволяющую проверить их "
762
- "через базу данных. Так же позволяет управлять комментариями с публичной "
763
- "страницы записи."
764
-
765
- #: inc/cleantalk-settings.php:203
766
- msgid "Data Processing"
767
- msgstr "Обработка данных"
768
-
769
- #: inc/cleantalk-settings.php:206
770
- msgid "Protect logged in Users"
771
- msgstr "Проверять залогиненых пользователей"
772
-
773
- #: inc/cleantalk-settings.php:207
774
- msgid ""
775
- "Turn this option on to check for spam any submissions (comments, contact "
776
- "forms and etc.) from registered Users."
777
- msgstr "Включите, чтобы проверять зарегистрированных пользователей."
778
-
779
- #: inc/cleantalk-settings.php:210
780
- msgid "Use AJAX for JavaScript check"
781
- msgstr "Использовать AJAX для проверки JavaScript"
782
-
783
- #: inc/cleantalk-settings.php:211
784
- msgid ""
785
- "Options helps protect WordPress against spam with any caching plugins. Turn "
786
- "this option on to avoid issues with caching plugins."
787
- msgstr "Данная настройка помогает избежать конфликтов с кеширующими плагинами."
788
-
789
- #: inc/cleantalk-settings.php:214
790
- msgid "Use static keys for JS check."
791
- msgstr "Использовать постоянный (статичный) ключ для проверки JS."
792
-
793
- #: inc/cleantalk-settings.php:215
794
- msgid ""
795
- "Could help if you have cache for AJAX requests and you are dealing with "
796
- "false positives. Slightly decreases protection quality. Auto - Static key "
797
- "will be used if caching plugin is spotted."
798
- msgstr ""
799
- "Может помочь, если у вас кешируются запросы AJAX и вы имеете дело с ложными "
800
- "срабатываниями. Немного снижает качество защиты. Статический ключ будет "
801
- "использоваться автоматически, если обнаружен плагин кэширования."
802
-
803
- #: inc/cleantalk-settings.php:223
804
- msgid "Check all post data"
805
- msgstr "Проверять все POST-данные"
806
-
807
- #: inc/cleantalk-settings.php:224
808
- msgid ""
809
- "Check all POST submissions from website visitors. Enable this option if you "
810
- "have spam misses on website."
811
- msgstr ""
812
- "Проверять все POST-данные, отправляемые посетителями. Активируйте, если у "
813
- "вас есть спам на сайте."
814
-
815
- #: inc/cleantalk-settings.php:226
816
- msgid " Or you don`t have records about missed spam here:"
817
- msgstr " Или у вас нет записей о спаме здесь:"
818
-
819
- #: inc/cleantalk-settings.php:226
820
- msgid "CleanTalk dashboard"
821
- msgstr "панель управления CleanTalk"
822
-
823
- #: inc/cleantalk-settings.php:229
824
- msgid "СAUTION! Option can catch POST requests in WordPress backend"
825
- msgstr ""
826
- "ВНИМАНИЕ! Опция может перехватывать все POST запросы в панели управления "
827
- "Wordpress. Отключите, если возникают проблемы/ошибки."
828
-
829
- #: inc/cleantalk-settings.php:232
830
- msgid "Set cookies"
831
- msgstr "Устанавливать куки"
832
-
833
- #: inc/cleantalk-settings.php:233
834
- msgid ""
835
- "Turn this option off to deny plugin generates any cookies on website front-"
836
- "end. This option is helpful if you use Varnish. But most of contact forms "
837
- "will not be protected if the option is turned off! <b>Warning: We strongly "
838
- "recommend you to enable this otherwise it could cause false positives spam "
839
- "detection.</b>"
840
- msgstr ""
841
- "Отключите эту опцию, чтобы запретить плагину создавать любые файлы cookies "
842
- "на веб-сайте. Эта опция полезна, если вы используете Varnish. Но большинство "
843
- "контактных форм не будут защищены, если опция отключена! <b>ВНИМАНИЕ! Мы "
844
- "настоятельно рекомендуем не отключать опцию, иначе это может привести к "
845
- "ложному обнаружению спама.</b>"
846
-
847
- #: inc/cleantalk-settings.php:237
848
- msgid "Use alternative mechanism for cookies"
849
- msgstr "Использовать альтернативный механизм хранения файлов cookie"
850
-
851
- #: inc/cleantalk-settings.php:238 inc/cleantalk-settings.php:360
852
- msgid "Doesn't use cookie or PHP sessions. Collect data for all types of bots."
853
- msgstr ""
854
- "Не использовать файлы cookies или PHP-сессии. Собирать данные обо всех типах "
855
- "ботов."
856
-
857
- #: inc/cleantalk-settings.php:243
858
- msgid "Use SSL"
859
- msgstr "Использовать SSL"
860
-
861
- #: inc/cleantalk-settings.php:244
862
- msgid "Turn this option on to use encrypted (SSL) connection with servers."
863
- msgstr ""
864
- "Включите эту опцию для использования защищенного (SSL) соединения между "
865
- "серверами."
866
-
867
- #: inc/cleantalk-settings.php:247
868
- msgid "Use Wordpress HTTP API"
869
- msgstr "Использовать стандартное Wordpress HTTP API"
870
-
871
- #: inc/cleantalk-settings.php:248
872
- msgid ""
873
- "Alternative way to connect the Cloud. Use this if you have connection "
874
- "problems."
875
- msgstr ""
876
- "Альтернативный способ подключения к CleanTalk Cloud. Используйте, если вы "
877
- "имеете проблемы с подключением."
878
-
879
- #: inc/cleantalk-settings.php:255
880
- msgid "Exclusions"
881
- msgstr "Исключения"
882
-
883
- #: inc/cleantalk-settings.php:259
884
- msgid "URL exclusions"
885
- msgstr "Исключения по URL"
886
-
887
- #: inc/cleantalk-settings.php:260
888
- msgid "You could type here URL you want to exclude. Use comma as separator."
889
- msgstr ""
890
- "Вы можете ввести здесь URL, который вы хотите исключить. Используйте запятую "
891
- "в качестве разделителя."
892
-
893
- #: inc/cleantalk-settings.php:264
894
- msgid "Use Regular Expression in URL Exclusions"
895
- msgstr "Использовать регулярное выражение в исключении по URL"
896
-
897
- #: inc/cleantalk-settings.php:268
898
- msgid "Field name exclusions"
899
- msgstr "Исключение по имени поля"
900
-
901
- #: inc/cleantalk-settings.php:269
902
- msgid ""
903
- "You could type here fields names you want to exclude. Use comma as separator."
904
- msgstr ""
905
- "Вы можете ввести здесь имена полей, которые вы хотите исключить. Используйте "
906
- "запятую в качестве разделителя."
907
-
908
- #: inc/cleantalk-settings.php:273
909
- msgid "Use Regular Expression in Field Exclusions"
910
- msgstr "Использовать регулярное выражение в исключении по полю формы."
911
-
912
- #: inc/cleantalk-settings.php:280
913
- msgid "Roles which bypass spam test. Hold CTRL to select multiple roles."
914
- msgstr ""
915
- "Роли, которые обходят проверку на спам. Удерживайте CTRL, чтобы выбрать "
916
- "несколько ролей."
917
-
918
- #: inc/cleantalk-settings.php:287
919
- msgid "Admin bar"
920
- msgstr "Админ-бар"
921
-
922
- #: inc/cleantalk-settings.php:294
923
- msgid "Show statistics in admin bar"
924
- msgstr "Показывать статистику в админбаре"
925
-
926
- #: inc/cleantalk-settings.php:295
927
- msgid ""
928
- "Show/hide icon in top level menu in WordPress backend. The number of "
929
- "submissions is being counted for past 24 hours."
930
- msgstr ""
931
- "Показать/скрыть иконку CleanTalk в админ-баре WordPress. Статистика "
932
- "подсчитывается за последние 24 часа."
933
-
934
- #: inc/cleantalk-settings.php:299
935
- msgid "Show All-time counter"
936
- msgstr "Счетчик за все время"
937
-
938
- #: inc/cleantalk-settings.php:300
939
- msgid ""
940
- "Display all-time requests counter in the admin bar. Counter displays number "
941
- "of requests since plugin installation."
942
- msgstr ""
943
- "Отображать счетчик запросов за все время в админ-баре. Счетчик показывает "
944
- "записи с момента установки."
945
-
946
- #: inc/cleantalk-settings.php:305
947
- msgid "Show 24 hours counter"
948
- msgstr "24-х часовой счетчик"
949
-
950
- #: inc/cleantalk-settings.php:306
951
- msgid ""
952
- "Display daily requests counter in the admin bar. Counter displays number of "
953
- "requests of the past 24 hours."
954
- msgstr ""
955
- "Отображать 24-х часовой счетчик запросов в админ-баре. Отображает запросы за "
956
- "последние 24 часа."
957
-
958
- #: inc/cleantalk-settings.php:311
959
- msgid "SpamFireWall counter"
960
- msgstr "Счетчик SpamFireWall"
961
-
962
- #: inc/cleantalk-settings.php:312
963
- msgid ""
964
- "Display SpamFireWall requests in the admin bar. Counter displays number of "
965
- "requests since plugin installation."
966
- msgstr ""
967
- "Отображать счетчик SpamFireWall запросов в админ-баре. Отображает количество "
968
- "запросов с момента установки плагина."
969
-
970
- #: inc/cleantalk-settings.php:325
971
- msgid "Collect details about browsers"
972
- msgstr "Собирать данные браузера"
973
-
974
- #: inc/cleantalk-settings.php:326
975
- msgid ""
976
- "Checking this box you allow plugin store information about screen size and "
977
- "browser plugins of website visitors. The option in a beta state."
978
- msgstr ""
979
- "Включая эту опцию, Вы разрешаете плагину хранить информацию о размере экрана "
980
- "и плагинах браузера посетителей. Бета опция."
981
-
982
- #: inc/cleantalk-settings.php:330
983
- msgid "Send connection reports"
984
- msgstr "Отправлять отчеты о соединении"
985
-
986
- #: inc/cleantalk-settings.php:331
987
- msgid ""
988
- "Checking this box you allow plugin to send the information about your "
989
- "connection. The option in a beta state."
990
- msgstr ""
991
- "Ставя эту галочку вы разрешаете плагину отрпавлять информацию о интернет-"
992
- "соединении. Опция находится на бета-тестировании."
993
-
994
- #: inc/cleantalk-settings.php:335
995
- msgid "Async JavaScript loading"
996
- msgstr "Асинхронная загрузка JavaScript"
997
-
998
- #: inc/cleantalk-settings.php:336
999
- msgid ""
1000
- "Use async loading for scripts. Warning: This could reduce filtration quality."
1001
- msgstr ""
1002
- "Использовать асинхронную загрузку JS-скриптов. ВНИМАНИЕ! это может понизить "
1003
- "качество спам-фильтра."
1004
-
1005
- #: inc/cleantalk-settings.php:340
1006
- msgid "Allow to add GDPR notice via shortcode"
1007
- msgstr "Разрешить добавление GDPR-уведомления с помощью шордкода"
1008
-
1009
- #: inc/cleantalk-settings.php:341
1010
- msgid ""
1011
- " Adds small checkbox under your website form. To add it you should use the "
1012
- "shortcode on the form's page: [cleantalk_gdpr_form id=\"FORM_ID\"]"
1013
- msgstr ""
1014
- "Добавить не большой чекбокс в форму. Для добавления уведомления вставьте на "
1015
- "странице с формой этот шорткод: [cleantalk_gdpr_form id=\"FORM_ID\"]"
1016
-
1017
- #: inc/cleantalk-settings.php:346
1018
- msgid "GDPR text notice"
1019
- msgstr "Текст GDPR-уведомления"
1020
-
1021
- #: inc/cleantalk-settings.php:347
1022
- msgid "This text will be added as a description to the GDPR checkbox."
1023
- msgstr "Этот текст будет добавлен к чекбоксу как описание."
1024
-
1025
- #: inc/cleantalk-settings.php:353
1026
- msgid "Store visited URLs"
1027
- msgstr "Хранить посещенные URL-ы"
1028
-
1029
- #: inc/cleantalk-settings.php:354
1030
- msgid ""
1031
- "Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits "
1032
- "form on the site. You can see stored visited URLS for each visitor in your "
1033
- "Dashboard. Turn the option on to improve Anti-Spam protection."
1034
- msgstr ""
1035
- "Плагин хранит последние 10 посещенных URL (HTTP REFFERERS) до того, как "
1036
- "посетитель отправит форму на сайт. Вы можете видеть сохраненные посещенные "
1037
- "URL-адреса для каждого посетителя на своей панели инструментов. Включите эту "
1038
- "опцию, чтобы улучшить защиту от спама."
1039
-
1040
- #: inc/cleantalk-settings.php:359
1041
- msgid "Use cookies less sessions"
1042
- msgstr "Использовать сеансы без cookies"
1043
-
1044
- #: inc/cleantalk-settings.php:366
1045
- msgid ""
1046
- "Notify users with selected roles about new approved comments. Hold CTRL to "
1047
- "select multiple roles."
1048
- msgstr ""
1049
- "Уведомлять пользователей с выбранными ролями о новых одобренных комментариях."
1050
- " Удерживайте CTRL для выбора нескольких ролей."
1051
-
1052
- #: inc/cleantalk-settings.php:367
1053
- #, php-format
1054
- msgid "If enabled, overrides similar Wordpress %sdiscussion settings%s."
1055
- msgstr "Если включено, переопределяет аналогичные %sнастройки Wordpress%s."
1056
-
1057
- #: inc/cleantalk-settings.php:380
1058
- msgid "Complete deactivation"
1059
- msgstr "Полная деактивация"
1060
-
1061
- #: inc/cleantalk-settings.php:381
1062
- msgid "Leave no trace in the system after deactivation."
1063
- msgstr "Не оставлять следов в системе после деактивации."
1064
-
1065
- #: inc/cleantalk-settings.php:398
1066
- msgid "Enable White Label Mode"
1067
- msgstr "Активировать White Label Mode."
1068
-
1069
- #: inc/cleantalk-settings.php:399
1070
- #, php-format
1071
- msgid "Learn more information %shere%s."
1072
- msgstr "Узнать болье информации %sздесь%s"
1073
-
1074
- #: inc/cleantalk-settings.php:404
1075
- msgid "Hoster API Key"
1076
- msgstr "Хостинг API ключ"
1077
-
1078
- #: inc/cleantalk-settings.php:405
1079
- #, php-format
1080
- msgid "You can get it in %sCleantalk's Control Panel%s"
1081
- msgstr "Вы можете получить это в вашей %sпанели управления CleanTalk%s"
1082
-
1083
- #: inc/cleantalk-settings.php:413
1084
- msgid "Plugin name"
1085
- msgstr "Наименование плагина"
1086
-
1087
- #: inc/cleantalk-settings.php:414
1088
- #, php-format
1089
- msgid "Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s"
1090
- msgstr ""
1091
- "Укажите название плагина. Оставьте пустым для названия по умолчанию "
1092
- "%sAntispam by Cleantalk%s"
1093
-
1094
- #: inc/cleantalk-settings.php:423
1095
- msgid "Allow users to use other key"
1096
- msgstr "Позволяет пользователям использовать другой ключ."
1097
-
1098
- #: inc/cleantalk-settings.php:424
1099
- msgid ""
1100
- "Allow users to use different Access key in their plugin settings on child "
1101
- "blogs. They could use different CleanTalk account."
1102
- msgstr ""
1103
- "Позволяет пользователям использовать разные Ключи доступа в настройках "
1104
- "плагина на их дочерних блогах. Они могут использовать разные аккаунты "
1105
- "CleanTalk."
1106
-
1107
- #: inc/cleantalk-settings.php:427
1108
- msgid ""
1109
- "Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key "
1110
- "from this constant. Look into wp-config.php"
1111
- msgstr ""
1112
- "Константа <b>CLEANTALK_ACCESS_KEY</b> установлена. Все дочерние сайты будут "
1113
- "использовать ключ доступа из этой контсанты. Смотри в wp-config.php"
1114
-
1115
- #: inc/cleantalk-settings.php:533
1116
- msgid "CleanTalk's tech support:"
1117
- msgstr "Техническия поддержка CleanTalk: "
1118
-
1119
- #: inc/cleantalk-settings.php:539
1120
- msgid "Plugin Homepage at"
1121
- msgstr "Домашняя страница плагина на"
1122
-
1123
- #: inc/cleantalk-settings.php:540
1124
- msgid "GDPR compliance"
1125
- msgstr "Соответствие GDPR"
1126
-
1127
- #: inc/cleantalk-settings.php:541
1128
- msgid "Use s@cleantalk.org to test plugin in any WordPress form."
1129
- msgstr ""
1130
- "Используйте s@cleantalk.org чтобы проверить плагин в любой форме в WordPress."
1131
-
1132
- #: inc/cleantalk-settings.php:542
1133
- msgid "CleanTalk is registered Trademark. All rights reserved."
1134
- msgstr "CleanTalk - это зарегистрированая торговая марка. Все права защищены."
1135
-
1136
- #: inc/cleantalk-settings.php:559
1137
- #, php-format
1138
- msgid "%s has blocked <b>%s</b> spam."
1139
- msgstr "%s заблокировал <b>%s</b> спама."
1140
-
1141
- #: inc/cleantalk-settings.php:571
1142
- msgid "Click here to get anti-spam statistics"
1143
- msgstr "Щелкните, чтобы получить статистику"
1144
-
1145
- #: inc/cleantalk-settings.php:614
1146
- #, php-format
1147
- msgid "Please, enter the %splugin settings%s in main site dashboard."
1148
- msgstr ""
1149
- "Пожалуйста, перейдите в %sнастройки плагина%s в панели управления на главном "
1150
- "сайте."
1151
-
1152
- #: inc/cleantalk-settings.php:633
1153
- msgid "Error occured while API key validating. Error: "
1154
- msgstr "Произошла ошибка при проверке ключа API. Ошибка: "
1155
-
1156
- #: inc/cleantalk-settings.php:634
1157
- msgid "Error occured while automatically gettings access key. Error: "
1158
- msgstr "Произошла ошибка при автоматическом получении ключа доступа. Ошибка: "
1159
-
1160
- #: inc/cleantalk-settings.php:635
1161
- msgid "Error occured while sending sending SpamFireWall logs. Error: "
1162
- msgstr "Произошла ошибка при отправке логов Spam FireWall. Ошибка: "
1163
-
1164
- #: inc/cleantalk-settings.php:636
1165
- msgid "Error occured while updating SpamFireWall local base. Error: "
1166
- msgstr "Произошла ошибка при обновлении локальной базы Spam FireWall. Ошибка: "
1167
-
1168
- #: inc/cleantalk-settings.php:637
1169
- msgid "Error occured while checking account status. Error: "
1170
- msgstr "Произошла ошибка при проверке статуса аккаунта. Ошибка: "
1171
-
1172
- #: inc/cleantalk-settings.php:638
1173
- msgid "Error occured while excuting API call. Error: "
1174
- msgstr "Произошла ошибка при выполнении вызова API. Ошибка: "
1175
-
1176
- #: inc/cleantalk-settings.php:646
1177
- msgid "Unknown error. Error: "
1178
- msgstr "Неизвестная ошибка. Ошибка: "
1179
-
1180
- #: inc/cleantalk-settings.php:677
1181
- msgid "Errors:"
1182
- msgstr "Ошибки: "
1183
-
1184
- #: inc/cleantalk-settings.php:682
1185
- #, php-format
1186
- msgid "You can get support any time here: %s."
1187
- msgstr "Вы всегда можете получить техническую поддержку здесь: %s."
1188
-
1189
- #: inc/cleantalk-settings.php:757
1190
- msgid "Protection is active"
1191
- msgstr "Защита включена"
1192
-
1193
- #: inc/cleantalk-settings.php:759
1194
- msgid "Registration forms"
1195
- msgstr "Регистрации пользователей"
1196
-
1197
- #: inc/cleantalk-settings.php:760
1198
- msgid "Comments forms"
1199
- msgstr "Формы комментариев"
1200
-
1201
- #: inc/cleantalk-settings.php:765
1202
- msgid "Validate email for existence"
1203
- msgstr "Проверка e-mail на существование"
1204
-
1205
- #: inc/cleantalk-settings.php:769
1206
- msgid "Auto update"
1207
- msgstr "Автообновлние"
1208
-
1209
- #: inc/cleantalk-settings.php:793
1210
- msgid "<h3>Key is provided by Super Admin.</h3>"
1211
- msgstr "<h3>Ключ доступа предоставлен Супер Администратором.</h3>"
1212
-
1213
- #: inc/cleantalk-settings.php:797
1214
- msgid "Access key"
1215
- msgstr "Ключ доступа"
1216
-
1217
- #: inc/cleantalk-settings.php:812
1218
- msgid "Enter the key"
1219
- msgstr "Введите ключ"
1220
-
1221
- #: inc/cleantalk-settings.php:818
1222
- #, php-format
1223
- msgid "Account at cleantalk.org is %s."
1224
- msgstr "Аккаунт на cleantalk.org %s."
1225
-
1226
- #: inc/cleantalk-settings.php:827
1227
- msgid "Show the access key"
1228
- msgstr "Показать ключ доступа"
1229
-
1230
- #: inc/cleantalk-settings.php:838
1231
- msgid "Get Access Key Automatically"
1232
- msgstr "Получить ключ доступа автоматически"
1233
-
1234
- #: inc/cleantalk-settings.php:846
1235
- #, php-format
1236
- msgid ""
1237
- "Admin e-mail (%s) will be used for registration, if you want to use other "
1238
- "email please %sGet Access Key Manually%s."
1239
- msgstr ""
1240
- "E-mail администратора (%s) будет использован для регистрации. Если вы хотите "
1241
- "использовать другой e-mail, пожлуйста, %sполучите ключ доступа "
1242
- "самостоятельно%s."
1243
-
1244
- #: inc/cleantalk-settings.php:862
1245
- #, php-format
1246
- msgid "I accept %sLicense Agreement%s."
1247
- msgstr "Я принимаю %sЛицензионно Соглашение%s."
1248
-
1249
- #: inc/cleantalk-settings.php:888
1250
- msgid "Statistics & Reports"
1251
- msgstr "Статистика и отчеты"
1252
-
1253
- #: inc/cleantalk-settings.php:904
1254
- #, php-format
1255
- msgid "Last spam check request to %s server was at %s."
1256
- msgstr "Последний запрос проверки спама на сервере %s был произведен %s."
1257
-
1258
- #: inc/cleantalk-settings.php:905 inc/cleantalk-settings.php:906
1259
- #: inc/cleantalk-settings.php:915 inc/cleantalk-settings.php:922
1260
- #: inc/cleantalk-settings.php:923 inc/cleantalk-settings.php:931
1261
- #: inc/cleantalk-settings.php:932 inc/cleantalk-settings.php:939
1262
- #: inc/cleantalk-settings.php:940
1263
- msgid "unknown"
1264
- msgstr "неизвестно"
1265
-
1266
- #: inc/cleantalk-settings.php:912
1267
- #, php-format
1268
- msgid "Average request time for past 7 days: %s seconds."
1269
- msgstr "Среднее время запроса за последние 7 дней: %s секунд."
1270
-
1271
- #: inc/cleantalk-settings.php:921
1272
- #, php-format
1273
- msgid "Last time SpamFireWall was triggered for %s IP at %s"
1274
- msgstr "В последний раз SpamFireWall сработал на %s IP %s"
1275
-
1276
- #: inc/cleantalk-settings.php:930
1277
- #, php-format
1278
- msgid "SpamFireWall was updated %s. Now contains %s entries."
1279
- msgstr "SpamFireWall был обновлен %s. Содержится %s записей."
1280
-
1281
- #: inc/cleantalk-settings.php:938
1282
- #, php-format
1283
- msgid "SpamFireWall sent %s events at %s."
1284
- msgstr "SpamFireWall отправил %s событий %s."
1285
-
1286
- #: inc/cleantalk-settings.php:948
1287
- msgid "There are no failed connections to server."
1288
- msgstr "Проблем с подключением к серверу нет."
1289
-
1290
- #: inc/cleantalk-settings.php:975
1291
- msgid "Send report"
1292
- msgstr "Отправить отчет"
1293
-
1294
- #: inc/cleantalk-settings.php:979
1295
- msgid ""
1296
- "Please, enable \"Send connection reports\" setting to be able to send reports"
1297
- msgstr ""
1298
- "Пожалуйста, активируйте опцию \"Отправлять отчеты о соединении\" для "
1299
- "возможности отправлять отчеты."
1300
-
1301
- #: inc/cleantalk-settings.php:1327
1302
- msgid "Testing is failed. Please check the Access key."
1303
- msgstr "Ошибка тестирования. Пожалуйста, проверьте ключ доступа."
1304
-
1305
- #: inc/cleantalk-settings.php:1442
1306
- msgid "XSS check"
1307
- msgstr "Проверка XSS уязвимости"
1308
-
1309
- #: inc/cleantalk-settings.php:1443
1310
- msgid ""
1311
- "Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to "
1312
- "any user. As a result malicious scripts can not get access to the cookie "
1313
- "files, session tokens and any other confidential information browsers use "
1314
- "and store. Such scripts can even overwrite content of HTML pages. CleanTalk "
1315
- "WAF monitors for patterns of these parameters and block them."
1316
- msgstr ""
1317
- "Межсайтовый скриптинг (XSS) - предотвращает выполнение / отправку "
1318
- "вредоносного кода любому пользователю. В результате вредоносные сценарии не "
1319
- "могут получить доступ к файлам cookie, токенам сеансов и любой другой "
1320
- "конфиденциальной информации, которую используют и хранят браузеры. Такие "
1321
- "сценарии могут даже перезаписывать содержимое HTML-страниц. CleanTalk WAF "
1322
- "отслеживает шаблоны этих параметров и блокирует их."
1323
-
1324
- #: inc/cleantalk-settings.php:1446
1325
- msgid "SQL-injection check"
1326
- msgstr "Проверка на наличие SQL-injection"
1327
-
1328
- #: inc/cleantalk-settings.php:1447
1329
- msgid ""
1330
- "SQL Injection — one of the most popular ways to hack websites and programs "
1331
- "that work with databases. It is based on injection of a custom SQL code into "
1332
- "database queries. It could transmit data through GET, POST requests or "
1333
- "cookie files in an SQL code. If a website is vulnerable and execute such "
1334
- "injections then it would allow attackers to apply changes to the website's "
1335
- "MySQL database."
1336
- msgstr ""
1337
- "SQL-инъекция - один из самых популярных способов взлома сайтов и программ, "
1338
- "работающих с базами данных. Он основан на внедрении пользовательского кода "
1339
- "SQL в запросы к базе данных. Он может передавать данные через запросы GET, "
1340
- "POST или файлы cookie в коде SQL. Если веб-сайт уязвим и выполняет такие "
1341
- "инъекции, это позволит злоумышленникам применить изменения к базе данных "
1342
- "MySQL веб-сайта."
1343
-
1344
- #: inc/cleantalk-settings.php:1450
1345
- msgid "Check uploaded files"
1346
- msgstr "Проверка загруженных файлов"
1347
-
1348
- #: inc/cleantalk-settings.php:1451
1349
- msgid ""
1350
- "The option checks each uploaded file to a website for malicious code. If "
1351
- "it's possible for visitors to upload files to a website, for instance a work "
1352
- "resume, then attackers could abuse it and upload an infected file to execute "
1353
- "it later and get access to your website."
1354
- msgstr ""
1355
- "Опция проверяет каждый загруженный файл на веб-сайт на наличие вредоносного "
1356
- "кода. Если посетители могут загружать на сайт файлы, например, резюме, то "
1357
- "злоумышленники могут злоупотреблять им и загружать зараженный файл, чтобы "
1358
- "выполнить его позднее и получить доступ к вашему сайту."
1359
-
1360
- #: inc/cleantalk-users.php:15
1361
- msgid "Find spam users"
1362
- msgstr "Найти спам-пользователей"
1363
-
1364
- #: inc/cleantalk-users.php:67
1365
- msgid "Please wait for a while. CleanTalk is deleting spam users. Users left: "
1366
- msgstr "Пожалуйста, подождите. CleanTalk удаляет спам-пользователей. Осталось:"
1367
-
1368
- #: inc/cleantalk-users.php:79
1369
- msgid ""
1370
- "The plugin will check all users against blacklists database and show you "
1371
- "senders that have spam activity on other websites."
1372
- msgstr ""
1373
- "Плагин проверит всех пользователей по базе данных чёрных списков и покажет "
1374
- "отправителей, которые занимаются спамом на других сайтах."
1375
-
1376
- #: inc/cleantalk-users.php:84
1377
- msgid ""
1378
- "Allows to use user's dates to perform more accurate check. Could seriously "
1379
- "slow down the check."
1380
- msgstr ""
1381
- "Позволяет использовать даты пользователей для выполения более тщательной "
1382
- "проверки. Может серьезно замедлить проверку."
1383
-
1384
- #: inc/cleantalk-users.php:108
1385
- msgid ""
1386
- "Please wait for a while. CleanTalk is checking all users via blacklist "
1387
- "database at cleantalk.org. You will have option to delete found spam users "
1388
- "after plugin finish."
1389
- msgstr ""
1390
- "Пожалуйста, подождите. ClenTalk проверяет всех пользователей по чёрным "
1391
- "спискам на cleantalk.org. У вас появится возможность удалить обнаруженных "
1392
- "спам-пользователей как только плагин закончит."
1393
-
1394
- #: inc/cleantalk-users.php:267
1395
- msgid "Delete all users from list"
1396
- msgstr "Удалить всех пользователей в списке"
1397
-
1398
- #: inc/cleantalk-users.php:269
1399
- msgid "Download results in CSV"
1400
- msgstr "Загрузить результаты (CSV)"
1401
-
1402
- #: inc/cleantalk-users.php:273
1403
- msgid "Insert accounts"
1404
- msgstr "Добавить аккаунты"
1405
-
1406
- #: inc/cleantalk-users.php:274
1407
- msgid "Delete accounts"
1408
- msgstr "Удалить тестовые спам-аккаунты"
1409
-
1410
- #: inc/cleantalk-users.php:527
1411
- #, php-format
1412
- msgid ""
1413
- "Total users %s, checked %s, last check %s, found %s spam users and %s bad "
1414
- "users (without IP or email)"
1415
- msgstr ""
1416
- "Всего пользователей %s, проверено %s, последняя проверка %s, найдено %s спам-"
1417
- "пользователей и %s плохих пользователей (без IP или электронной почты)"
1418
-
1419
- #: inc/cleantalk-widget.php:22
1420
- msgid "CleanTalk Widget"
1421
- msgstr "Виджет CleanTalk"
1422
-
1423
- #: inc/cleantalk-widget.php:25
1424
- msgid "CleanTalk widget"
1425
- msgstr "виджет CleanTalk"
1426
-
1427
- #: inc/cleantalk-widget.php:72
1428
- msgid "CleanTalk's main page"
1429
- msgstr "Главная страница CleanTalk"
1430
-
1431
- #: inc/cleantalk-widget.php:73
1432
- msgid "spam"
1433
- msgstr "спама"
1434
-
1435
- #: inc/cleantalk-widget.php:73
1436
- msgid "blocked by"
1437
- msgstr "заблокировано"
1438
-
1439
- #: inc/cleantalk-widget.php:85
1440
- msgid "Spam blocked"
1441
- msgstr "Спама заблокировано"
1442
-
1443
- #: inc/cleantalk-widget.php:90
1444
- msgid "Title:"
1445
- msgstr "Заголовок:"
1446
-
1447
- #: inc/cleantalk-widget.php:95
1448
- msgid "Style:"
1449
- msgstr "Стиль:"
1450
-
1451
- #: inc/cleantalk-widget.php:97
1452
- msgid "CleanTalk's Style"
1453
- msgstr "Фирменный стиль CleanTalk"
1454
-
1455
- #: inc/cleantalk-widget.php:98
1456
- msgid "Light"
1457
- msgstr "Лёгкий"
1458
-
1459
- #: inc/cleantalk-widget.php:99
1460
- msgid "Extremely Light"
1461
- msgstr "Очень легкий"
1462
-
1463
- #: inc/cleantalk-widget.php:100
1464
- msgid "Dark"
1465
- msgstr "Темный"
1466
-
1467
- #: inc/cleantalk-widget.php:105
1468
- msgid "Referal link ID:"
1469
- msgstr "ID партнера:"
1470
-
1471
- #: lib/CleantalkSFW.php:71
1472
- msgid "SpamFireWall is activated for your IP "
1473
- msgstr "Спам Фаервол заблокировал ваш IP"
1474
-
1475
- #: lib/CleantalkSFW.php:72
1476
- msgid ""
1477
- "To continue working with web site, please make sure that you have enabled "
1478
- "JavaScript."
1479
- msgstr ""
1480
- "Что бы продолжить работу с сайтом, пожалуйста, убедитесь что у вас включен "
1481
- "JavaScript."
1482
-
1483
- #: lib/CleantalkSFW.php:73
1484
- msgid "Please click below to pass protection,"
1485
- msgstr "Пожалуйста, нажмите, чтобы пройти защиту,"
1486
-
1487
- #: lib/CleantalkSFW.php:74
1488
- #, php-format
1489
- msgid ""
1490
- "Or you will be automatically redirected to the requested page after %d "
1491
- "seconds."
1492
- msgstr ""
1493
- "Или вы будете автоматически переадресованы на запрашиваемую страницу через "
1494
- "%d секунд."
1495
-
1496
- #: lib/CleantalkSFW.php:75
1497
- msgid "Antispam by CleanTalk"
1498
- msgstr "Антиспам от CleanTalk"
1499
-
1500
- #: lib/CleantalkSFW.php:76
1501
- msgid "This is the testing page for SpamFireWall"
1502
- msgstr "Это тестовая страница SpamFireWall"
1503
-
1504
- #: templates/translate_banner.php:6
1505
- msgid "Help others use the plugin in your language."
1506
- msgstr "Помогите другим пользователям использовать плагин на их языке."
1507
-
1508
- #: templates/translate_banner.php:7
1509
- msgid ""
1510
- "We ask you to help with the translation of the plugin in your language. "
1511
- "Please take a few minutes to make the plugin more comfortable."
1512
- msgstr ""
1513
- "Мы просим Вас помочь с переводом плагина на ваш язык. Пожалуйста, потратьте "
1514
- "несколько минут, чтобы сделать плагин более удобным."
1515
-
1516
- #: templates/translate_banner.php:10
1517
- msgid "TRANSLATE"
1518
- msgstr "ПЕРЕВЕСТИ"
1519
-
1520
- #. Plugin Name of the plugin/theme
1521
- msgid "Anti-Spam by CleanTalk"
1522
- msgstr "Антиспам от CleanTalk"
1523
-
1524
- #. Description of the plugin/theme
1525
- msgid ""
1526
- "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam,"
1527
- " no registration spam, no contact spam, protects any WordPress forms."
1528
- msgstr ""
1529
- "Максимальная эффективность, проверка всех форм, без Сaptcha, премиум "
1530
- "антиспам плагин. Нет спаму в комментариях, нет спаму в регистрациях, нету "
1531
- "спаму в контактных формах, защита любых форм в WordPress."
1532
-
1533
- #. Plugin URI of the plugin/theme
1534
- #. Author URI of the plugin/theme
1535
- msgid "http://cleantalk.org"
1536
- msgstr "http://cleantalk.org"
1537
-
1538
- #. Author of the plugin/theme
1539
- msgid "СleanTalk <welcome@cleantalk.org>"
1540
- msgstr "СleanTalk <welcome@cleantalk.org>"
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Anti-Spam by CleanTalk\n"
4
+ "POT-Creation-Date: 2019-10-27 16:02+0000\n"
5
+ "PO-Revision-Date: 2019-10-27 16:39+0000\n"
6
+ "Last-Translator: admin <ievlev@cleantalk.org>\n"
7
+ "Language-Team: Русский\n"
8
+ "Language: ru_RU\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Loco https://localise.biz/\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-WPHeader: cleantalk.php\n"
15
+ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
16
+ "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
23
+ "Report-Msgid-Bugs-To: \n"
24
+ "X-Loco-Version: 2.3.0; wp-5.2.4"
25
+
26
+ #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
27
+ #: inc/cleantalk-users.php:15
28
+ msgid "Check for spam"
29
+ msgstr "Проверить на спам"
30
+
31
+ #: inc/classCleantalkComments.php:33 inc/cleantalk-admin.php:350
32
+ #: inc/cleantalk-comments.php:16
33
+ msgid "Find spam comments"
34
+ msgstr "Найти спам в комментариях"
35
+
36
+ #: inc/classCleantalkComments.php:66 inc/cleantalk-comments.php:26
37
+ #: inc/cleantalk-users.php:25
38
+ msgid "Plugin Settings"
39
+ msgstr "Настройки плагина"
40
+
41
+ #: inc/classCleantalkComments.php:76 inc/cleantalk-comments.php:35
42
+ #: inc/cleantalk-users.php:34
43
+ #, php-format
44
+ msgid ""
45
+ "Antispam hosting tariff does not allow you to use this feature. To do so, "
46
+ "you need to enter an Access Key in the %splugin settings%s."
47
+ msgstr ""
48
+ "Тариф на антиспам хостинг не позволяет использовать эту функцию. Для этого "
49
+ "вам необходимо ввести ключ доступа в %sнастройках плагина%s."
50
+
51
+ #: inc/classCleantalkComments.php:101 inc/cleantalk-comments.php:60
52
+ #: inc/cleantalk-users.php:60
53
+ msgid ""
54
+ "Ajax error. Process will be automatically restarted in 3 seconds. Status: "
55
+ msgstr ""
56
+ "Ajax ошибка. Процесс проверки будет автоматически возобновлен через 3 "
57
+ "секунды. Статус:"
58
+
59
+ #: inc/classCleantalkComments.php:108 inc/cleantalk-comments.php:67
60
+ msgid ""
61
+ "Please wait for a while. CleanTalk is deleting spam comments. Comments left: "
62
+ msgstr "Пожалуйста, подождите. CleanTalk удаляет спам-комментарии. Осталось:"
63
+
64
+ #: inc/classCleantalkComments.php:118 inc/cleantalk-comments.php:77
65
+ #: inc/cleantalk-users.php:77
66
+ msgid "Start check"
67
+ msgstr "Начать проверку"
68
+
69
+ #: inc/classCleantalkComments.php:119 inc/cleantalk-comments.php:78
70
+ #: inc/cleantalk-users.php:78
71
+ msgid "Continue check"
72
+ msgstr "Продолжить проверку"
73
+
74
+ #: inc/classCleantalkComments.php:120 inc/cleantalk-comments.php:79
75
+ msgid ""
76
+ "The plugin will check all comments against blacklists database and show you "
77
+ "senders that have spam activity on other websites."
78
+ msgstr ""
79
+ "Пожалуйста, подождите. CleanTalk проверяет комментарии по черным спискам на "
80
+ "cleantalk.org. Вы сможете удалить комментарии со спамом после окончания "
81
+ "работы."
82
+
83
+ #: inc/classCleantalkComments.php:123 inc/cleantalk-comments.php:82
84
+ #: inc/cleantalk-users.php:82
85
+ msgid "Accurate check"
86
+ msgstr "Точная проверка"
87
+
88
+ #: inc/classCleantalkComments.php:125 inc/cleantalk-comments.php:84
89
+ msgid ""
90
+ "Allows to use comment's dates to perform more accurate check. Could "
91
+ "seriously slow down the check."
92
+ msgstr ""
93
+ "Позволяет использовать даты комментариев для выполения более тщательной "
94
+ "проверки. Может серьезно замедлить проверку."
95
+
96
+ #: inc/classCleantalkComments.php:128 inc/cleantalk-comments.php:87
97
+ #: inc/cleantalk-users.php:87
98
+ msgid "Specify date range"
99
+ msgstr "Указать диапазон дат"
100
+
101
+ #: inc/classCleantalkComments.php:149 inc/cleantalk-comments.php:108
102
+ msgid ""
103
+ "Please wait! CleanTalk is checking all approved and pending comments via "
104
+ "blacklist database at cleantalk.org. You will have option to delete found "
105
+ "spam comments after plugin finish."
106
+ msgstr ""
107
+ "Пожалуйста, подождите! CleanTalk проверяет комментарии по черным спискам на "
108
+ "cleantalk.org. Вы сможете удалить комментарии со спамом после окончания "
109
+ "работы."
110
+
111
+ #: inc/classCleantalkCommentsListTable.php:24
112
+ msgid "Author"
113
+ msgstr "Автор"
114
+
115
+ #: inc/classCleantalkCommentsListTable.php:25 inc/cleantalk-comments.php:158
116
+ msgid "Comment"
117
+ msgstr "Комментарий"
118
+
119
+ #: inc/classCleantalkCommentsListTable.php:26 inc/cleantalk-comments.php:159
120
+ msgid "In Response To"
121
+ msgstr "В ответ на"
122
+
123
+ #: inc/classCleantalkCommentsListTable.php:33
124
+ msgid "No spam comments."
125
+ msgstr "Нет спам комментариев."
126
+
127
+ #: inc/cleantalk-admin.php:27
128
+ #, php-format
129
+ msgid "Find spam %s"
130
+ msgstr "Найти спам %s"
131
+
132
+ #: inc/cleantalk-admin.php:31
133
+ msgid "CleanTalk Anti-Spam Log"
134
+ msgstr "CleanTalk Anti-Spam лог"
135
+
136
+ #: inc/cleantalk-admin.php:50
137
+ #, php-format
138
+ msgid "%sRefresh%s"
139
+ msgstr "%sОбновить%s"
140
+
141
+ #: inc/cleantalk-admin.php:51
142
+ #, php-format
143
+ msgid "%sConfigure%s"
144
+ msgstr "%sКонфигурация%s"
145
+
146
+ #: inc/cleantalk-admin.php:68
147
+ msgid "7 days anti-spam stats"
148
+ msgstr "Статистика атак за 7 дней"
149
+
150
+ #: inc/cleantalk-admin.php:72
151
+ msgid "Top 5 spam IPs blocked"
152
+ msgstr "Топ 5 cамых заблокированных IP"
153
+
154
+ #: inc/cleantalk-admin.php:78
155
+ msgid "Get Access key to activate Anti-Spam protection!"
156
+ msgstr "Получите ключ доступа для активации спам защиты!"
157
+
158
+ #: inc/cleantalk-admin.php:86
159
+ #, php-format
160
+ msgid "Something went wrong! Error: \"%s\"."
161
+ msgstr "Что-то пошло не так: Ошибка: \"%s\"."
162
+
163
+ #: inc/cleantalk-admin.php:90
164
+ msgid "Please, visit your dashboard."
165
+ msgstr "Пожалуйста, посетите панель управления."
166
+
167
+ #: inc/cleantalk-admin.php:104
168
+ msgid "IP"
169
+ msgstr "IP"
170
+
171
+ #: inc/cleantalk-admin.php:105
172
+ msgid "Country"
173
+ msgstr "Страна"
174
+
175
+ #: inc/cleantalk-admin.php:106
176
+ msgid "Block Count"
177
+ msgstr "Заблкирован раз"
178
+
179
+ #: inc/cleantalk-admin.php:134
180
+ #, php-format
181
+ msgid ""
182
+ "This is the count from the %s's cloud and could be different to admin bar "
183
+ "counters"
184
+ msgstr ""
185
+ "Это счетчик из %s облака, эти данные могут отличаться от данных счетчика в "
186
+ "админ-баре."
187
+
188
+ #. %s: Number of spam messages
189
+ #: inc/cleantalk-admin.php:137
190
+ #, php-format
191
+ msgid ""
192
+ "%s%s%s has blocked %s spam for all time. The statistics are automatically "
193
+ "updated every 24 hours."
194
+ msgstr ""
195
+ "%s%s%s заблокировал %s спама за все время. Статистика автоматически "
196
+ "обновляется каждый 24 часа."
197
+
198
+ #: inc/cleantalk-admin.php:148 inc/cleantalk-settings.php:544
199
+ #, php-format
200
+ msgid "Do you like CleanTalk? %sPost your feedback here%s."
201
+ msgstr "Вам понравился CleanTalk?%s Напишите свой отзыв здесь%s."
202
+
203
+ #: inc/cleantalk-admin.php:234
204
+ msgid "Translate"
205
+ msgstr "Перевести"
206
+
207
+ #: inc/cleantalk-admin.php:237
208
+ msgid "Start here"
209
+ msgstr "Начать здесь"
210
+
211
+ #: inc/cleantalk-admin.php:238
212
+ msgid "FAQ"
213
+ msgstr "FAQ"
214
+
215
+ #: inc/cleantalk-admin.php:239 inc/cleantalk-admin.php:644
216
+ #: inc/cleantalk-settings.php:575
217
+ msgid "Support"
218
+ msgstr "Поддержка"
219
+
220
+ #: inc/cleantalk-admin.php:306 inc/cleantalk-settings.php:523
221
+ msgid "Hosting AntiSpam"
222
+ msgstr "Hosting AntiSpam"
223
+
224
+ #: inc/cleantalk-admin.php:333
225
+ msgid "Failed from timeout. Going to check comments again."
226
+ msgstr "Ошибка по таймауту. Попробовать еще раз?"
227
+
228
+ #: inc/cleantalk-admin.php:334
229
+ msgid "Added"
230
+ msgstr "Добавлены"
231
+
232
+ #: inc/cleantalk-admin.php:335 inc/cleantalk-admin.php:386
233
+ msgid "Deleted"
234
+ msgstr "Удалено"
235
+
236
+ #: inc/cleantalk-admin.php:336
237
+ msgid "comments"
238
+ msgstr "комментарии"
239
+
240
+ #: inc/cleantalk-admin.php:337
241
+ msgid "Delete all spam comments?"
242
+ msgstr "Удалить ВСЕ найденные спам-комментарии?"
243
+
244
+ #: inc/cleantalk-admin.php:338
245
+ msgid "Delete checked comments?"
246
+ msgstr "Удалить отмеченые спам-комментарии?"
247
+
248
+ #: inc/cleantalk-admin.php:339
249
+ #, php-format
250
+ msgid ""
251
+ "Total comments %s. Checked %s. Found %s spam comments. %s bad comments "
252
+ "(without IP or email)."
253
+ msgstr ""
254
+ "Всего комментариев %s. Проверено %s. Найдено %s спам комментариев. %s плохих "
255
+ "комментариев (без IP и Email'а)."
256
+
257
+ #: inc/cleantalk-admin.php:340 inc/cleantalk-admin.php:393
258
+ #: inc/cleantalk-users.php:531
259
+ msgid "Please do backup of WordPress database before delete any accounts!"
260
+ msgstr ""
261
+ "Пожалуйста, сделайте резервную копию базы данных Wordpress перед удалением "
262
+ "аккаунтов."
263
+
264
+ #: inc/cleantalk-admin.php:351
265
+ msgid "The sender has been whitelisted."
266
+ msgstr "Отправитель был добавлен в белый список."
267
+
268
+ #: inc/cleantalk-admin.php:352
269
+ msgid "The sender has been blacklisted."
270
+ msgstr "Отправитель был добавлен в черный список."
271
+
272
+ #: inc/cleantalk-admin.php:353 inc/cleantalk-public.php:3321
273
+ #, php-format
274
+ msgid "Feedback has been sent to %sCleanTalk Dashboard%s."
275
+ msgstr "Обратная связь отправлена в панель управления %sCleanTalk%s."
276
+
277
+ #: inc/cleantalk-admin.php:383
278
+ msgid "Failed from timeout. Going to check users again."
279
+ msgstr "Ошибка по таймауту. Попробовать еще раз?"
280
+
281
+ #: inc/cleantalk-admin.php:384
282
+ msgid "Failed from timeout. Going to run a new attempt to delete spam users."
283
+ msgstr "Ошибка по таймауту. Попробовать еще раз?"
284
+
285
+ #: inc/cleantalk-admin.php:385
286
+ msgid "Inserted"
287
+ msgstr "Добавлено"
288
+
289
+ #: inc/cleantalk-admin.php:387
290
+ msgid "users."
291
+ msgstr "пользователей."
292
+
293
+ #: inc/cleantalk-admin.php:388
294
+ msgid "Delete all spam users?"
295
+ msgstr "Удалить ВСЕХ найденых спам-пользователей?"
296
+
297
+ #: inc/cleantalk-admin.php:389
298
+ msgid "Delete checked users?"
299
+ msgstr "Удалить отмеченых спам-пользователей?"
300
+
301
+ #: inc/cleantalk-admin.php:392
302
+ #, php-format
303
+ msgid ""
304
+ "Total users %s, checked %s, found %s spam users and %s bad users (without IP "
305
+ "or email)"
306
+ msgstr ""
307
+ "Всего пользователей %s, проверено %s, найдено %s спам пользователей и %s "
308
+ "плохих пользователей (без IP и Email'а)"
309
+
310
+ #: inc/cleantalk-admin.php:401
311
+ msgid "Find spam-users"
312
+ msgstr "Найти спам-пользователей"
313
+
314
+ #: inc/cleantalk-admin.php:449
315
+ #, php-format
316
+ msgid "Unable to get Access key automatically: %s"
317
+ msgstr "Невозможно получить ключ автоматически: %s"
318
+
319
+ #: inc/cleantalk-admin.php:450
320
+ msgid "Get the Access key"
321
+ msgstr "Получить ключ вручную"
322
+
323
+ #: inc/cleantalk-admin.php:459
324
+ #, php-format
325
+ msgid "Please enter Access Key in %s settings to enable anti spam protection!"
326
+ msgstr ""
327
+ "Пожалуйста, укажите Ключ доступа в настройках %s для активации защиты от "
328
+ "спама!"
329
+
330
+ #: inc/cleantalk-admin.php:469
331
+ #, php-format
332
+ msgid "%s trial period ends, please upgrade to %s!"
333
+ msgstr ""
334
+ "%s заканчивается ознакомительный срок пользования антиспам плагином "
335
+ "CleanTalk, пожалуйста продлите подключение %s."
336
+
337
+ #: inc/cleantalk-admin.php:481
338
+ msgid "RENEW ANTI-SPAM"
339
+ msgstr "ПРОДЛИТЬ АНТИСПАМ"
340
+
341
+ #: inc/cleantalk-admin.php:482
342
+ msgid "next year"
343
+ msgstr "следующий год"
344
+
345
+ #: inc/cleantalk-admin.php:486
346
+ #, php-format
347
+ msgid "Please renew your anti-spam license for %s."
348
+ msgstr "Пожалуйста, продлите свою антиспам-лицензию на %s."
349
+
350
+ #: inc/cleantalk-admin.php:511
351
+ msgid "Make it right!"
352
+ msgstr "Сделай все правильно!"
353
+
354
+ #: inc/cleantalk-admin.php:513
355
+ #, php-format
356
+ msgid "%sGet premium%s"
357
+ msgstr "%sПолучить премиум%s"
358
+
359
+ #: inc/cleantalk-admin.php:552
360
+ msgid "Since"
361
+ msgstr "От"
362
+
363
+ #: inc/cleantalk-admin.php:558
364
+ msgid ""
365
+ "All / Allowed / Blocked submissions. The number of submissions is being "
366
+ "counted since CleanTalk plugin installation."
367
+ msgstr "Все / Разрешенные / Запрещенные запросы с момента установки CleanTalk."
368
+
369
+ #: inc/cleantalk-admin.php:558
370
+ msgid "All"
371
+ msgstr "Все"
372
+
373
+ #: inc/cleantalk-admin.php:566
374
+ msgid ""
375
+ "Allowed / Blocked submissions. The number of submissions for past 24 hours. "
376
+ msgstr "Разрешенные / Запрещенные запросы за последние 24 часа."
377
+
378
+ #: inc/cleantalk-admin.php:566
379
+ msgid "Day"
380
+ msgstr "За день"
381
+
382
+ #: inc/cleantalk-admin.php:572
383
+ msgid ""
384
+ "All / Blocked events. Access attempts regitred by SpamFireWall counted since "
385
+ "the last plugin activation."
386
+ msgstr ""
387
+ "Все / Запрещенные попытки просмотра сайта. Отображет попытки с момента "
388
+ "последней активации плагина."
389
+
390
+ #: inc/cleantalk-admin.php:582
391
+ msgid ""
392
+ "Allowed / Blocked submissions. The number of submissions is being counted "
393
+ "since "
394
+ msgstr "Разрешенные / Запрещенные попытки."
395
+
396
+ #: inc/cleantalk-admin.php:593
397
+ msgid "dashboard"
398
+ msgstr "панель управления"
399
+
400
+ #: inc/cleantalk-admin.php:600
401
+ msgid "Settings"
402
+ msgstr "Настройки"
403
+
404
+ #: inc/cleantalk-admin.php:608
405
+ msgid "Bulk spam comments removal tool."
406
+ msgstr "Инструмент массового удаления пользователей."
407
+
408
+ #: inc/cleantalk-admin.php:608 inc/cleantalk-settings.php:882
409
+ msgid "Check comments for spam"
410
+ msgstr "Проверка комментариев"
411
+
412
+ #: inc/cleantalk-admin.php:618 inc/cleantalk-settings.php:885
413
+ msgid "Check users for spam"
414
+ msgstr "Проверить пользователей на спам"
415
+
416
+ #: inc/cleantalk-admin.php:627
417
+ msgid "Reset first counter"
418
+ msgstr "Сбросить первый счетчик"
419
+
420
+ #: inc/cleantalk-admin.php:635
421
+ msgid "Reset all counters"
422
+ msgstr "Сбросить все счетчики"
423
+
424
+ #: inc/cleantalk-comments.php:221 inc/cleantalk-users.php:220
425
+ msgid "Approve"
426
+ msgstr "Одобрить"
427
+
428
+ #: inc/cleantalk-comments.php:223 inc/cleantalk-users.php:222
429
+ msgid "Delete"
430
+ msgstr "Удалить"
431
+
432
+ #: inc/cleantalk-comments.php:265
433
+ msgid "Delete all comments from the list"
434
+ msgstr "Удалить все сообщения в списке"
435
+
436
+ #: inc/cleantalk-comments.php:266 inc/cleantalk-users.php:268
437
+ msgid "Delete selected"
438
+ msgstr "Удалить отмеченные"
439
+
440
+ #: inc/cleantalk-comments.php:270
441
+ msgid "Insert comments"
442
+ msgstr "Добавить комментарии"
443
+
444
+ #: inc/cleantalk-comments.php:271
445
+ msgid "Delete comments"
446
+ msgstr "Удалить тестовые спам-комментарии?"
447
+
448
+ #: inc/cleantalk-comments.php:276 inc/cleantalk-users.php:279
449
+ msgid ""
450
+ "There is some differencies between blacklists database and our API "
451
+ "mechanisms. Blacklists shows all history of spam activity, but our API (that "
452
+ "used in spam checking) used another parameters, too: last day of activity, "
453
+ "number of spam attacks during last days etc. This mechanisms help us to "
454
+ "reduce number of false positivitie. So, there is nothing strange, if some "
455
+ "emails/IPs will be not found by this checking."
456
+ msgstr ""
457
+ "Есть некоторые отличия между проверкой через базу данных черных списков и "
458
+ "через механизм API. В черных списках отображается вся история о спам-"
459
+ "активности, но наш API используетс другие механизмы: последний день "
460
+ "активности, количество спам-атак в течение последних дней и т. д. Эти "
461
+ "механизмы помогают нам сократить количество ложных обнаружений. Поэтому, нет "
462
+ "ничего странного, если некоторые письма/IP не будут обнаружены при этой "
463
+ "проверке."
464
+
465
+ #: inc/cleantalk-comments.php:281 inc/cleantalk-users.php:284
466
+ msgid "Stop deletion"
467
+ msgstr "Остановить удаление"
468
+
469
+ #: inc/cleantalk-comments.php:495
470
+ #, php-format
471
+ msgid ""
472
+ "Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad "
473
+ "comments (without IP or email)."
474
+ msgstr ""
475
+ "Всего комментариев %s. Проверено %s. Последняя проверка %s. Найдено %s спам-"
476
+ "комментариев. %s плохие комментарии (без IP или электронной почты)."
477
+
478
+ #: inc/cleantalk-comments.php:499
479
+ msgid "Please do backup of WordPress database before delete any comments!"
480
+ msgstr ""
481
+ "Пожалуйста, сделайте резервную копию базы данных Wordpress перед удалением "
482
+ "комментариев."
483
+
484
+ #: inc/cleantalk-public.php:500 inc/cleantalk-public.php:641
485
+ #: inc/cleantalk-public.php:743 inc/cleantalk-public.php:2363
486
+ #: inc/cleantalk-public.php:3052
487
+ msgid "Spam protection by CleanTalk"
488
+ msgstr "Спам защита CleanTalk"
489
+
490
+ #: inc/cleantalk-public.php:1233 inc/cleantalk-public.php:1361
491
+ #: inc/cleantalk-public.php:1379
492
+ msgid "Spam protection"
493
+ msgstr "Защита от спама"
494
+
495
+ #: inc/cleantalk-public.php:1332
496
+ msgid "CleanTalk AntiSpam: This message is possible spam."
497
+ msgstr "CleanTalk AntiSpam: Это сообщение, возможно, является спамом."
498
+
499
+ #: inc/cleantalk-public.php:1333
500
+ msgid "You could check it in CleanTalk's anti-spam database:"
501
+ msgstr "Вы можете проверить это по антиспам-базе CleanTalk:"
502
+
503
+ #: inc/cleantalk-public.php:1569
504
+ #, php-format
505
+ msgid "Registration approved by %s."
506
+ msgstr "Регистрация одобрена %s."
507
+
508
+ #: inc/cleantalk-public.php:1849
509
+ msgid "CleanTalk AntiSpam: This registration is spam."
510
+ msgstr "CleanTalk AntiSpam: Эта регистрация - спам."
511
+
512
+ #: inc/cleantalk-public.php:1850 inc/cleantalk-public.php:2219
513
+ #: inc/cleantalk-public.php:2387 inc/cleantalk-public.php:2542
514
+ msgid "CleanTalk's anti-spam database:"
515
+ msgstr "Антиспам-база CleanTalk:"
516
+
517
+ #: inc/cleantalk-public.php:2218 inc/cleantalk-public.php:2386
518
+ #: inc/cleantalk-public.php:2541
519
+ msgid "CleanTalk AntiSpam: This message is spam."
520
+ msgstr "CleanTalk AntiSpam: Это сообщение - спам."
521
+
522
+ #: inc/cleantalk-public.php:2666
523
+ msgid "Comment approved. Anti-spam by CleanTalk."
524
+ msgstr "Комментарий одобрен. Антиспам от CleanTalk."
525
+
526
+ #: inc/cleantalk-public.php:3219
527
+ msgid "Attention, please!"
528
+ msgstr "Внимание!"
529
+
530
+ #: inc/cleantalk-public.php:3220
531
+ #, php-format
532
+ msgid "\"%s\" plugin error on your site \"%s\":"
533
+ msgstr "\"%s\" ошибка плагина на сайте \"%s\":"
534
+
535
+ #: inc/cleantalk-public.php:3222
536
+ #, php-format
537
+ msgid "[%s] \"%s\" error!"
538
+ msgstr "[%s] \"%s\" ошибка!"
539
+
540
+ #: inc/cleantalk-public.php:3271
541
+ msgid ""
542
+ "By using this form you agree with the storage and processing of your data by "
543
+ "using the Privacy Policy on this website."
544
+ msgstr ""
545
+ "Используя эту форму, вы соглашаетесь с хранением и обработкой ваших данных, "
546
+ "в соответствии с Политикой конфиденциальности на этом сайте."
547
+
548
+ #: inc/cleantalk-public.php:3319
549
+ msgid "Error occured while sending feedback."
550
+ msgstr "Случилась ошибка при отправке обратной связи."
551
+
552
+ #: inc/cleantalk-public.php:3320
553
+ msgid "Feedback wasn't sent. There is no associated request."
554
+ msgstr "Обратная связь не была отправлена. Нет связанного запроса."
555
+
556
+ #: inc/cleantalk-public.php:3364
557
+ msgid "Sender info"
558
+ msgstr "Информация об отправителе"
559
+
560
+ #: inc/cleantalk-public.php:3367
561
+ msgid "by"
562
+ msgstr " от"
563
+
564
+ #: inc/cleantalk-public.php:3378
565
+ msgid "No email"
566
+ msgstr "Email отсутствует"
567
+
568
+ #: inc/cleantalk-public.php:3388
569
+ msgid "No IP"
570
+ msgstr "IP отсутствует"
571
+
572
+ #: inc/cleantalk-public.php:3391
573
+ msgid "Mark as spam"
574
+ msgstr "Отметить как спам"
575
+
576
+ #: inc/cleantalk-public.php:3392
577
+ msgid "Unspam"
578
+ msgstr "Вернуть из спама"
579
+
580
+ #: inc/cleantalk-public.php:3394
581
+ msgid "Marked as spam."
582
+ msgstr "Отмечено как спам."
583
+
584
+ #: inc/cleantalk-public.php:3395
585
+ msgid "Marked as not spam."
586
+ msgstr "Отмечено как не спам."
587
+
588
+ #: inc/cleantalk-settings.php:96
589
+ msgid "SpamFireWall"
590
+ msgstr "SpamFireWall"
591
+
592
+ #: inc/cleantalk-settings.php:97
593
+ msgid ""
594
+ "This option allows to filter spam bots before they access website. Also "
595
+ "reduces CPU usage on hosting server and accelerates pages load time."
596
+ msgstr ""
597
+ "Эта опция позволяет фильтровать спам-ботов прежде, чем они войдут на сайт. "
598
+ "Также уменьшает загрузку процессора на хостинге и ускоряет время загрузки "
599
+ "страниц."
600
+
601
+ #: inc/cleantalk-settings.php:104
602
+ msgid "Forms to protect"
603
+ msgstr "Защищаемые формы"
604
+
605
+ #: inc/cleantalk-settings.php:110
606
+ msgid "Advanced settings"
607
+ msgstr "Продвинутые настройки"
608
+
609
+ #: inc/cleantalk-settings.php:117
610
+ msgid "Registration Forms"
611
+ msgstr "Формы регистрации"
612
+
613
+ #: inc/cleantalk-settings.php:118
614
+ msgid "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
615
+ msgstr "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
616
+
617
+ #: inc/cleantalk-settings.php:121
618
+ msgid "Comments form"
619
+ msgstr "Комментарии в блоге"
620
+
621
+ #: inc/cleantalk-settings.php:122
622
+ msgid "WordPress, JetPack, WooCommerce."
623
+ msgstr "WordPress, JetPack, WooCommerce."
624
+
625
+ #: inc/cleantalk-settings.php:125 inc/cleantalk-settings.php:761
626
+ msgid "Contact forms"
627
+ msgstr "Контактные формы"
628
+
629
+ #: inc/cleantalk-settings.php:126
630
+ msgid ""
631
+ "Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, "
632
+ "WordPress Landing Pages, Gravity Forms."
633
+ msgstr ""
634
+ "Contact Form 7, Formidable Forms, Jetpack, Fast Secure Contact Form, "
635
+ "WordPress Landing Pages, Gravity Forms."
636
+
637
+ #: inc/cleantalk-settings.php:129 inc/cleantalk-settings.php:762
638
+ msgid "Custom contact forms"
639
+ msgstr "Произвольные контактные формы"
640
+
641
+ #: inc/cleantalk-settings.php:130
642
+ msgid "Anti spam test for any WordPress themes or contacts forms."
643
+ msgstr "Защита от спама любой контактной формы или темы."
644
+
645
+ #: inc/cleantalk-settings.php:133 inc/cleantalk-settings.php:775
646
+ msgid "WooCommerce checkout form"
647
+ msgstr "Форма заказа WooCommerce"
648
+
649
+ #: inc/cleantalk-settings.php:134
650
+ msgid "Anti spam test for WooCommerce checkout form."
651
+ msgstr "Спам тест для формы заказа WooCommerce"
652
+
653
+ #: inc/cleantalk-settings.php:138
654
+ msgid "Spam test for registration during checkout"
655
+ msgstr "Регистрация на странице заказа"
656
+
657
+ #: inc/cleantalk-settings.php:139
658
+ msgid ""
659
+ "Enable anti spam test for registration process which during woocommerce's "
660
+ "checkout."
661
+ msgstr ""
662
+ "Включить защиту от спама в регистрациях, которые проходят во время "
663
+ "оформления заказа."
664
+
665
+ #: inc/cleantalk-settings.php:145
666
+ msgid "Test default Wordpress search form for spam"
667
+ msgstr "Стандартная форма поиска Wordpress"
668
+
669
+ #: inc/cleantalk-settings.php:146
670
+ msgid "Spam protection for Search form."
671
+ msgstr "Защита от спама для Форм поиска."
672
+
673
+ #: inc/cleantalk-settings.php:148
674
+ #, php-format
675
+ msgid "Read more about %sspam protection for Search form%s on our blog."
676
+ msgstr "Прочтите о %sспам-защите для Форм поиска%s на нашем блоге."
677
+
678
+ #: inc/cleantalk-settings.php:156
679
+ msgid "Protect external forms"
680
+ msgstr "Защита внешних форм"
681
+
682
+ #: inc/cleantalk-settings.php:157
683
+ msgid ""
684
+ "Turn this option on to protect forms on your WordPress that send data to "
685
+ "third-part servers (like MailChimp)."
686
+ msgstr ""
687
+ "Включите эту опцию, что бы защитить формы, которые отсылают данные на "
688
+ "сторонние ресурсы, например MailChimp."
689
+
690
+ #: inc/cleantalk-settings.php:161
691
+ msgid "Capture buffer"
692
+ msgstr "Захват буфера"
693
+
694
+ #: inc/cleantalk-settings.php:162
695
+ msgid ""
696
+ "This setting gives you more sophisticated and strengthened protection for "
697
+ "external forms. But it could break plugins which use a buffer like Ninja "
698
+ "Forms."
699
+ msgstr ""
700
+ "Этот параметр дает вам более сложную и усиленную защиту для внешних форм. Но "
701
+ "это может сломать плагины, которые используют буфер, такой как Ninja Forms."
702
+
703
+ #: inc/cleantalk-settings.php:167
704
+ msgid "Protect internal forms"
705
+ msgstr "Защита внутренних форм"
706
+
707
+ #: inc/cleantalk-settings.php:168
708
+ msgid ""
709
+ "This option will enable protection for custom (hand-made) AJAX forms with "
710
+ "PHP scripts handlers on your WordPress."
711
+ msgstr "Эта опция обеспечит защиту созданных вручную форм, использующих AJAX."
712
+
713
+ #: inc/cleantalk-settings.php:175
714
+ msgid "Comments and Messages"
715
+ msgstr "Комментарии и сообщения"
716
+
717
+ #: inc/cleantalk-settings.php:178
718
+ msgid "BuddyPress Private Messages"
719
+ msgstr "Личные сообщения buddyPress"
720
+
721
+ #: inc/cleantalk-settings.php:179
722
+ msgid "Check buddyPress private messages."
723
+ msgstr "Проверять личные сообщения buddyPress "
724
+
725
+ #: inc/cleantalk-settings.php:182
726
+ msgid "Don't check trusted user's comments"
727
+ msgstr "Не проверять доверенных пользователей"
728
+
729
+ #: inc/cleantalk-settings.php:183
730
+ #, php-format
731
+ msgid "Don't check comments for users with above %d comments."
732
+ msgstr "Не проверять комментарии пользователей с более %d комментариями."
733
+
734
+ #: inc/cleantalk-settings.php:186
735
+ msgid "Automatically delete spam comments"
736
+ msgstr "Автоматически удалять спам-комментарии"
737
+
738
+ #: inc/cleantalk-settings.php:187
739
+ #, php-format
740
+ msgid "Delete spam comments older than %d days."
741
+ msgstr "Удалять комментарии старше %d дней."
742
+
743
+ #: inc/cleantalk-settings.php:190
744
+ msgid "Remove links from approved comments"
745
+ msgstr "Удалять ссылки из одобреных комментариев"
746
+
747
+ #: inc/cleantalk-settings.php:191
748
+ msgid "Remove links from approved comments. Replace it with \"[Link deleted]\""
749
+ msgstr "Удалять ссылки из одобренных сообщений"
750
+
751
+ #: inc/cleantalk-settings.php:194
752
+ msgid "Show links to check Emails, IPs for spam."
753
+ msgstr "Отобразить ссылки для проверки Email'ов и IP адресов."
754
+
755
+ #: inc/cleantalk-settings.php:195
756
+ msgid ""
757
+ "Shows little icon near IP addresses and Emails allowing you to check it via "
758
+ "CleanTalk's database. Also allowing you to manage comments from the public "
759
+ "post's page."
760
+ msgstr ""
761
+ "Показывает маленькую иконку около IP и Email'a позволяющую проверить их "
762
+ "через базу данных. Так же позволяет управлять комментариями с публичной "
763
+ "страницы записи."
764
+
765
+ #: inc/cleantalk-settings.php:203
766
+ msgid "Data Processing"
767
+ msgstr "Обработка данных"
768
+
769
+ #: inc/cleantalk-settings.php:206
770
+ msgid "Protect logged in Users"
771
+ msgstr "Проверять залогиненых пользователей"
772
+
773
+ #: inc/cleantalk-settings.php:207
774
+ msgid ""
775
+ "Turn this option on to check for spam any submissions (comments, contact "
776
+ "forms and etc.) from registered Users."
777
+ msgstr "Включите, чтобы проверять зарегистрированных пользователей."
778
+
779
+ #: inc/cleantalk-settings.php:210
780
+ msgid "Use AJAX for JavaScript check"
781
+ msgstr "Использовать AJAX для проверки JavaScript"
782
+
783
+ #: inc/cleantalk-settings.php:211
784
+ msgid ""
785
+ "Options helps protect WordPress against spam with any caching plugins. Turn "
786
+ "this option on to avoid issues with caching plugins."
787
+ msgstr "Данная настройка помогает избежать конфликтов с кеширующими плагинами."
788
+
789
+ #: inc/cleantalk-settings.php:214
790
+ msgid "Use static keys for JS check."
791
+ msgstr "Использовать постоянный (статичный) ключ для проверки JS."
792
+
793
+ #: inc/cleantalk-settings.php:215
794
+ msgid ""
795
+ "Could help if you have cache for AJAX requests and you are dealing with "
796
+ "false positives. Slightly decreases protection quality. Auto - Static key "
797
+ "will be used if caching plugin is spotted."
798
+ msgstr ""
799
+ "Может помочь, если у вас кешируются запросы AJAX и вы имеете дело с ложными "
800
+ "срабатываниями. Немного снижает качество защиты. Статический ключ будет "
801
+ "использоваться автоматически, если обнаружен плагин кэширования."
802
+
803
+ #: inc/cleantalk-settings.php:223
804
+ msgid "Check all post data"
805
+ msgstr "Проверять все POST-данные"
806
+
807
+ #: inc/cleantalk-settings.php:224
808
+ msgid ""
809
+ "Check all POST submissions from website visitors. Enable this option if you "
810
+ "have spam misses on website."
811
+ msgstr ""
812
+ "Проверять все POST-данные, отправляемые посетителями. Активируйте, если у "
813
+ "вас есть спам на сайте."
814
+
815
+ #: inc/cleantalk-settings.php:226
816
+ msgid " Or you don`t have records about missed spam here:"
817
+ msgstr " Или у вас нет записей о спаме здесь:"
818
+
819
+ #: inc/cleantalk-settings.php:226
820
+ msgid "CleanTalk dashboard"
821
+ msgstr "панель управления CleanTalk"
822
+
823
+ #: inc/cleantalk-settings.php:229
824
+ msgid "СAUTION! Option can catch POST requests in WordPress backend"
825
+ msgstr ""
826
+ "ВНИМАНИЕ! Опция может перехватывать все POST запросы в панели управления "
827
+ "Wordpress. Отключите, если возникают проблемы/ошибки."
828
+
829
+ #: inc/cleantalk-settings.php:232
830
+ msgid "Set cookies"
831
+ msgstr "Устанавливать куки"
832
+
833
+ #: inc/cleantalk-settings.php:233
834
+ msgid ""
835
+ "Turn this option off to deny plugin generates any cookies on website front-"
836
+ "end. This option is helpful if you use Varnish. But most of contact forms "
837
+ "will not be protected if the option is turned off! <b>Warning: We strongly "
838
+ "recommend you to enable this otherwise it could cause false positives spam "
839
+ "detection.</b>"
840
+ msgstr ""
841
+ "Отключите эту опцию, чтобы запретить плагину создавать любые файлы cookies "
842
+ "на веб-сайте. Эта опция полезна, если вы используете Varnish. Но большинство "
843
+ "контактных форм не будут защищены, если опция отключена! <b>ВНИМАНИЕ! Мы "
844
+ "настоятельно рекомендуем не отключать опцию, иначе это может привести к "
845
+ "ложному обнаружению спама.</b>"
846
+
847
+ #: inc/cleantalk-settings.php:237
848
+ msgid "Use alternative mechanism for cookies"
849
+ msgstr "Использовать альтернативный механизм хранения файлов cookie"
850
+
851
+ #: inc/cleantalk-settings.php:238 inc/cleantalk-settings.php:360
852
+ msgid "Doesn't use cookie or PHP sessions. Collect data for all types of bots."
853
+ msgstr ""
854
+ "Не использовать файлы cookies или PHP-сессии. Собирать данные обо всех типах "
855
+ "ботов."
856
+
857
+ #: inc/cleantalk-settings.php:243
858
+ msgid "Use SSL"
859
+ msgstr "Использовать SSL"
860
+
861
+ #: inc/cleantalk-settings.php:244
862
+ msgid "Turn this option on to use encrypted (SSL) connection with servers."
863
+ msgstr ""
864
+ "Включите эту опцию для использования защищенного (SSL) соединения между "
865
+ "серверами."
866
+
867
+ #: inc/cleantalk-settings.php:247
868
+ msgid "Use Wordpress HTTP API"
869
+ msgstr "Использовать стандартное Wordpress HTTP API"
870
+
871
+ #: inc/cleantalk-settings.php:248
872
+ msgid ""
873
+ "Alternative way to connect the Cloud. Use this if you have connection "
874
+ "problems."
875
+ msgstr ""
876
+ "Альтернативный способ подключения к CleanTalk Cloud. Используйте, если вы "
877
+ "имеете проблемы с подключением."
878
+
879
+ #: inc/cleantalk-settings.php:255
880
+ msgid "Exclusions"
881
+ msgstr "Исключения"
882
+
883
+ #: inc/cleantalk-settings.php:259
884
+ msgid "URL exclusions"
885
+ msgstr "Исключения по URL"
886
+
887
+ #: inc/cleantalk-settings.php:260
888
+ msgid "You could type here URL you want to exclude. Use comma as separator."
889
+ msgstr ""
890
+ "Вы можете ввести здесь URL, который вы хотите исключить. Используйте запятую "
891
+ "в качестве разделителя."
892
+
893
+ #: inc/cleantalk-settings.php:264
894
+ msgid "Use Regular Expression in URL Exclusions"
895
+ msgstr "Использовать регулярное выражение в исключении по URL"
896
+
897
+ #: inc/cleantalk-settings.php:268
898
+ msgid "Field name exclusions"
899
+ msgstr "Исключение по имени поля"
900
+
901
+ #: inc/cleantalk-settings.php:269
902
+ msgid ""
903
+ "You could type here fields names you want to exclude. Use comma as separator."
904
+ msgstr ""
905
+ "Вы можете ввести здесь имена полей, которые вы хотите исключить. Используйте "
906
+ "запятую в качестве разделителя."
907
+
908
+ #: inc/cleantalk-settings.php:273
909
+ msgid "Use Regular Expression in Field Exclusions"
910
+ msgstr "Использовать регулярное выражение в исключении по полю формы."
911
+
912
+ #: inc/cleantalk-settings.php:280
913
+ msgid "Roles which bypass spam test. Hold CTRL to select multiple roles."
914
+ msgstr ""
915
+ "Роли, которые обходят проверку на спам. Удерживайте CTRL, чтобы выбрать "
916
+ "несколько ролей."
917
+
918
+ #: inc/cleantalk-settings.php:287
919
+ msgid "Admin bar"
920
+ msgstr "Админ-бар"
921
+
922
+ #: inc/cleantalk-settings.php:294
923
+ msgid "Show statistics in admin bar"
924
+ msgstr "Показывать статистику в админбаре"
925
+
926
+ #: inc/cleantalk-settings.php:295
927
+ msgid ""
928
+ "Show/hide icon in top level menu in WordPress backend. The number of "
929
+ "submissions is being counted for past 24 hours."
930
+ msgstr ""
931
+ "Показать/скрыть иконку CleanTalk в админ-баре WordPress. Статистика "
932
+ "подсчитывается за последние 24 часа."
933
+
934
+ #: inc/cleantalk-settings.php:299
935
+ msgid "Show All-time counter"
936
+ msgstr "Счетчик за все время"
937
+
938
+ #: inc/cleantalk-settings.php:300
939
+ msgid ""
940
+ "Display all-time requests counter in the admin bar. Counter displays number "
941
+ "of requests since plugin installation."
942
+ msgstr ""
943
+ "Отображать счетчик запросов за все время в админ-баре. Счетчик показывает "
944
+ "записи с момента установки."
945
+
946
+ #: inc/cleantalk-settings.php:305
947
+ msgid "Show 24 hours counter"
948
+ msgstr "24-х часовой счетчик"
949
+
950
+ #: inc/cleantalk-settings.php:306
951
+ msgid ""
952
+ "Display daily requests counter in the admin bar. Counter displays number of "
953
+ "requests of the past 24 hours."
954
+ msgstr ""
955
+ "Отображать 24-х часовой счетчик запросов в админ-баре. Отображает запросы за "
956
+ "последние 24 часа."
957
+
958
+ #: inc/cleantalk-settings.php:311
959
+ msgid "SpamFireWall counter"
960
+ msgstr "Счетчик SpamFireWall"
961
+
962
+ #: inc/cleantalk-settings.php:312
963
+ msgid ""
964
+ "Display SpamFireWall requests in the admin bar. Counter displays number of "
965
+ "requests since plugin installation."
966
+ msgstr ""
967
+ "Отображать счетчик SpamFireWall запросов в админ-баре. Отображает количество "
968
+ "запросов с момента установки плагина."
969
+
970
+ #: inc/cleantalk-settings.php:325
971
+ msgid "Collect details about browsers"
972
+ msgstr "Собирать данные браузера"
973
+
974
+ #: inc/cleantalk-settings.php:326
975
+ msgid ""
976
+ "Checking this box you allow plugin store information about screen size and "
977
+ "browser plugins of website visitors. The option in a beta state."
978
+ msgstr ""
979
+ "Включая эту опцию, Вы разрешаете плагину хранить информацию о размере экрана "
980
+ "и плагинах браузера посетителей. Бета опция."
981
+
982
+ #: inc/cleantalk-settings.php:330
983
+ msgid "Send connection reports"
984
+ msgstr "Отправлять отчеты о соединении"
985
+
986
+ #: inc/cleantalk-settings.php:331
987
+ msgid ""
988
+ "Checking this box you allow plugin to send the information about your "
989
+ "connection. The option in a beta state."
990
+ msgstr ""
991
+ "Ставя эту галочку вы разрешаете плагину отрпавлять информацию о интернет-"
992
+ "соединении. Опция находится на бета-тестировании."
993
+
994
+ #: inc/cleantalk-settings.php:335
995
+ msgid "Async JavaScript loading"
996
+ msgstr "Асинхронная загрузка JavaScript"
997
+
998
+ #: inc/cleantalk-settings.php:336
999
+ msgid ""
1000
+ "Use async loading for scripts. Warning: This could reduce filtration quality."
1001
+ msgstr ""
1002
+ "Использовать асинхронную загрузку JS-скриптов. ВНИМАНИЕ! это может понизить "
1003
+ "качество спам-фильтра."
1004
+
1005
+ #: inc/cleantalk-settings.php:340
1006
+ msgid "Allow to add GDPR notice via shortcode"
1007
+ msgstr "Разрешить добавление GDPR-уведомления с помощью шордкода"
1008
+
1009
+ #: inc/cleantalk-settings.php:341
1010
+ msgid ""
1011
+ " Adds small checkbox under your website form. To add it you should use the "
1012
+ "shortcode on the form's page: [cleantalk_gdpr_form id=\"FORM_ID\"]"
1013
+ msgstr ""
1014
+ "Добавить не большой чекбокс в форму. Для добавления уведомления вставьте на "
1015
+ "странице с формой этот шорткод: [cleantalk_gdpr_form id=\"FORM_ID\"]"
1016
+
1017
+ #: inc/cleantalk-settings.php:346
1018
+ msgid "GDPR text notice"
1019
+ msgstr "Текст GDPR-уведомления"
1020
+
1021
+ #: inc/cleantalk-settings.php:347
1022
+ msgid "This text will be added as a description to the GDPR checkbox."
1023
+ msgstr "Этот текст будет добавлен к чекбоксу как описание."
1024
+
1025
+ #: inc/cleantalk-settings.php:353
1026
+ msgid "Store visited URLs"
1027
+ msgstr "Хранить посещенные URL-ы"
1028
+
1029
+ #: inc/cleantalk-settings.php:354
1030
+ msgid ""
1031
+ "Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits "
1032
+ "form on the site. You can see stored visited URLS for each visitor in your "
1033
+ "Dashboard. Turn the option on to improve Anti-Spam protection."
1034
+ msgstr ""
1035
+ "Плагин хранит последние 10 посещенных URL (HTTP REFFERERS) до того, как "
1036
+ "посетитель отправит форму на сайт. Вы можете видеть сохраненные посещенные "
1037
+ "URL-адреса для каждого посетителя на своей панели инструментов. Включите эту "
1038
+ "опцию, чтобы улучшить защиту от спама."
1039
+
1040
+ #: inc/cleantalk-settings.php:359
1041
+ msgid "Use cookies less sessions"
1042
+ msgstr "Использовать сеансы без cookies"
1043
+
1044
+ #: inc/cleantalk-settings.php:366
1045
+ msgid ""
1046
+ "Notify users with selected roles about new approved comments. Hold CTRL to "
1047
+ "select multiple roles."
1048
+ msgstr ""
1049
+ "Уведомлять пользователей с выбранными ролями о новых одобренных комментариях."
1050
+ " Удерживайте CTRL для выбора нескольких ролей."
1051
+
1052
+ #: inc/cleantalk-settings.php:367
1053
+ #, php-format
1054
+ msgid "If enabled, overrides similar Wordpress %sdiscussion settings%s."
1055
+ msgstr "Если включено, переопределяет аналогичные %sнастройки Wordpress%s."
1056
+
1057
+ #: inc/cleantalk-settings.php:380
1058
+ msgid "Complete deactivation"
1059
+ msgstr "Полная деактивация"
1060
+
1061
+ #: inc/cleantalk-settings.php:381
1062
+ msgid "Leave no trace in the system after deactivation."
1063
+ msgstr "Не оставлять следов в системе после деактивации."
1064
+
1065
+ #: inc/cleantalk-settings.php:398
1066
+ msgid "Enable White Label Mode"
1067
+ msgstr "Активировать White Label Mode."
1068
+
1069
+ #: inc/cleantalk-settings.php:399
1070
+ #, php-format
1071
+ msgid "Learn more information %shere%s."
1072
+ msgstr "Узнать болье информации %sздесь%s"
1073
+
1074
+ #: inc/cleantalk-settings.php:404
1075
+ msgid "Hoster API Key"
1076
+ msgstr "Хостинг API ключ"
1077
+
1078
+ #: inc/cleantalk-settings.php:405
1079
+ #, php-format
1080
+ msgid "You can get it in %sCleantalk's Control Panel%s"
1081
+ msgstr "Вы можете получить это в вашей %sпанели управления CleanTalk%s"
1082
+
1083
+ #: inc/cleantalk-settings.php:413
1084
+ msgid "Plugin name"
1085
+ msgstr "Наименование плагина"
1086
+
1087
+ #: inc/cleantalk-settings.php:414
1088
+ #, php-format
1089
+ msgid "Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s"
1090
+ msgstr ""
1091
+ "Укажите название плагина. Оставьте пустым для названия по умолчанию "
1092
+ "%sAntispam by Cleantalk%s"
1093
+
1094
+ #: inc/cleantalk-settings.php:423
1095
+ msgid "Allow users to use other key"
1096
+ msgstr "Позволяет пользователям использовать другой ключ."
1097
+
1098
+ #: inc/cleantalk-settings.php:424
1099
+ msgid ""
1100
+ "Allow users to use different Access key in their plugin settings on child "
1101
+ "blogs. They could use different CleanTalk account."
1102
+ msgstr ""
1103
+ "Позволяет пользователям использовать разные Ключи доступа в настройках "
1104
+ "плагина на их дочерних блогах. Они могут использовать разные аккаунты "
1105
+ "CleanTalk."
1106
+
1107
+ #: inc/cleantalk-settings.php:427
1108
+ msgid ""
1109
+ "Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key "
1110
+ "from this constant. Look into wp-config.php"
1111
+ msgstr ""
1112
+ "Константа <b>CLEANTALK_ACCESS_KEY</b> установлена. Все дочерние сайты будут "
1113
+ "использовать ключ доступа из этой контсанты. Смотри в wp-config.php"
1114
+
1115
+ #: inc/cleantalk-settings.php:533
1116
+ msgid "CleanTalk's tech support:"
1117
+ msgstr "Техническия поддержка CleanTalk: "
1118
+
1119
+ #: inc/cleantalk-settings.php:539
1120
+ msgid "Plugin Homepage at"
1121
+ msgstr "Домашняя страница плагина на"
1122
+
1123
+ #: inc/cleantalk-settings.php:540
1124
+ msgid "GDPR compliance"
1125
+ msgstr "Соответствие GDPR"
1126
+
1127
+ #: inc/cleantalk-settings.php:541
1128
+ msgid "Use s@cleantalk.org to test plugin in any WordPress form."
1129
+ msgstr ""
1130
+ "Используйте s@cleantalk.org чтобы проверить плагин в любой форме в WordPress."
1131
+
1132
+ #: inc/cleantalk-settings.php:542
1133
+ msgid "CleanTalk is registered Trademark. All rights reserved."
1134
+ msgstr "CleanTalk - это зарегистрированая торговая марка. Все права защищены."
1135
+
1136
+ #: inc/cleantalk-settings.php:559
1137
+ #, php-format
1138
+ msgid "%s has blocked <b>%s</b> spam."
1139
+ msgstr "%s заблокировал <b>%s</b> спама."
1140
+
1141
+ #: inc/cleantalk-settings.php:571
1142
+ msgid "Click here to get anti-spam statistics"
1143
+ msgstr "Щелкните, чтобы получить статистику"
1144
+
1145
+ #: inc/cleantalk-settings.php:614
1146
+ #, php-format
1147
+ msgid "Please, enter the %splugin settings%s in main site dashboard."
1148
+ msgstr ""
1149
+ "Пожалуйста, перейдите в %sнастройки плагина%s в панели управления на главном "
1150
+ "сайте."
1151
+
1152
+ #: inc/cleantalk-settings.php:633
1153
+ msgid "Error occured while API key validating. Error: "
1154
+ msgstr "Произошла ошибка при проверке ключа API. Ошибка: "
1155
+
1156
+ #: inc/cleantalk-settings.php:634
1157
+ msgid "Error occured while automatically gettings access key. Error: "
1158
+ msgstr "Произошла ошибка при автоматическом получении ключа доступа. Ошибка: "
1159
+
1160
+ #: inc/cleantalk-settings.php:635
1161
+ msgid "Error occured while sending sending SpamFireWall logs. Error: "
1162
+ msgstr "Произошла ошибка при отправке логов Spam FireWall. Ошибка: "
1163
+
1164
+ #: inc/cleantalk-settings.php:636
1165
+ msgid "Error occured while updating SpamFireWall local base. Error: "
1166
+ msgstr "Произошла ошибка при обновлении локальной базы Spam FireWall. Ошибка: "
1167
+
1168
+ #: inc/cleantalk-settings.php:637
1169
+ msgid "Error occured while checking account status. Error: "
1170
+ msgstr "Произошла ошибка при проверке статуса аккаунта. Ошибка: "
1171
+
1172
+ #: inc/cleantalk-settings.php:638
1173
+ msgid "Error occured while excuting API call. Error: "
1174
+ msgstr "Произошла ошибка при выполнении вызова API. Ошибка: "
1175
+
1176
+ #: inc/cleantalk-settings.php:646
1177
+ msgid "Unknown error. Error: "
1178
+ msgstr "Неизвестная ошибка. Ошибка: "
1179
+
1180
+ #: inc/cleantalk-settings.php:677
1181
+ msgid "Errors:"
1182
+ msgstr "Ошибки: "
1183
+
1184
+ #: inc/cleantalk-settings.php:682
1185
+ #, php-format
1186
+ msgid "You can get support any time here: %s."
1187
+ msgstr "Вы всегда можете получить техническую поддержку здесь: %s."
1188
+
1189
+ #: inc/cleantalk-settings.php:757
1190
+ msgid "Protection is active"
1191
+ msgstr "Защита включена"
1192
+
1193
+ #: inc/cleantalk-settings.php:759
1194
+ msgid "Registration forms"
1195
+ msgstr "Регистрации пользователей"
1196
+
1197
+ #: inc/cleantalk-settings.php:760
1198
+ msgid "Comments forms"
1199
+ msgstr "Формы комментариев"
1200
+
1201
+ #: inc/cleantalk-settings.php:765
1202
+ msgid "Validate email for existence"
1203
+ msgstr "Проверка e-mail на существование"
1204
+
1205
+ #: inc/cleantalk-settings.php:769
1206
+ msgid "Auto update"
1207
+ msgstr "Автообновлние"
1208
+
1209
+ #: inc/cleantalk-settings.php:793
1210
+ msgid "<h3>Key is provided by Super Admin.</h3>"
1211
+ msgstr "<h3>Ключ доступа предоставлен Супер Администратором.</h3>"
1212
+
1213
+ #: inc/cleantalk-settings.php:797
1214
+ msgid "Access key"
1215
+ msgstr "Ключ доступа"
1216
+
1217
+ #: inc/cleantalk-settings.php:812
1218
+ msgid "Enter the key"
1219
+ msgstr "Введите ключ"
1220
+
1221
+ #: inc/cleantalk-settings.php:818
1222
+ #, php-format
1223
+ msgid "Account at cleantalk.org is %s."
1224
+ msgstr "Аккаунт на cleantalk.org %s."
1225
+
1226
+ #: inc/cleantalk-settings.php:827
1227
+ msgid "Show the access key"
1228
+ msgstr "Показать ключ доступа"
1229
+
1230
+ #: inc/cleantalk-settings.php:838
1231
+ msgid "Get Access Key Automatically"
1232
+ msgstr "Получить ключ доступа автоматически"
1233
+
1234
+ #: inc/cleantalk-settings.php:846
1235
+ #, php-format
1236
+ msgid ""
1237
+ "Admin e-mail (%s) will be used for registration, if you want to use other "
1238
+ "email please %sGet Access Key Manually%s."
1239
+ msgstr ""
1240
+ "E-mail администратора (%s) будет использован для регистрации. Если вы хотите "
1241
+ "использовать другой e-mail, пожлуйста, %sполучите ключ доступа "
1242
+ "самостоятельно%s."
1243
+
1244
+ #: inc/cleantalk-settings.php:862
1245
+ #, php-format
1246
+ msgid "I accept %sLicense Agreement%s."
1247
+ msgstr "Я принимаю %sЛицензионно Соглашение%s."
1248
+
1249
+ #: inc/cleantalk-settings.php:888
1250
+ msgid "Statistics & Reports"
1251
+ msgstr "Статистика и отчеты"
1252
+
1253
+ #: inc/cleantalk-settings.php:904
1254
+ #, php-format
1255
+ msgid "Last spam check request to %s server was at %s."
1256
+ msgstr "Последний запрос проверки спама на сервере %s был произведен %s."
1257
+
1258
+ #: inc/cleantalk-settings.php:905 inc/cleantalk-settings.php:906
1259
+ #: inc/cleantalk-settings.php:915 inc/cleantalk-settings.php:922
1260
+ #: inc/cleantalk-settings.php:923 inc/cleantalk-settings.php:931
1261
+ #: inc/cleantalk-settings.php:932 inc/cleantalk-settings.php:939
1262
+ #: inc/cleantalk-settings.php:940
1263
+ msgid "unknown"
1264
+ msgstr "неизвестно"
1265
+
1266
+ #: inc/cleantalk-settings.php:912
1267
+ #, php-format
1268
+ msgid "Average request time for past 7 days: %s seconds."
1269
+ msgstr "Среднее время запроса за последние 7 дней: %s секунд."
1270
+
1271
+ #: inc/cleantalk-settings.php:921
1272
+ #, php-format
1273
+ msgid "Last time SpamFireWall was triggered for %s IP at %s"
1274
+ msgstr "В последний раз SpamFireWall сработал на %s IP %s"
1275
+
1276
+ #: inc/cleantalk-settings.php:930
1277
+ #, php-format
1278
+ msgid "SpamFireWall was updated %s. Now contains %s entries."
1279
+ msgstr "SpamFireWall был обновлен %s. Содержится %s записей."
1280
+
1281
+ #: inc/cleantalk-settings.php:938
1282
+ #, php-format
1283
+ msgid "SpamFireWall sent %s events at %s."
1284
+ msgstr "SpamFireWall отправил %s событий %s."
1285
+
1286
+ #: inc/cleantalk-settings.php:948
1287
+ msgid "There are no failed connections to server."
1288
+ msgstr "Проблем с подключением к серверу нет."
1289
+
1290
+ #: inc/cleantalk-settings.php:975
1291
+ msgid "Send report"
1292
+ msgstr "Отправить отчет"
1293
+
1294
+ #: inc/cleantalk-settings.php:979
1295
+ msgid ""
1296
+ "Please, enable \"Send connection reports\" setting to be able to send reports"
1297
+ msgstr ""
1298
+ "Пожалуйста, активируйте опцию \"Отправлять отчеты о соединении\" для "
1299
+ "возможности отправлять отчеты."
1300
+
1301
+ #: inc/cleantalk-settings.php:1327
1302
+ msgid "Testing is failed. Please check the Access key."
1303
+ msgstr "Ошибка тестирования. Пожалуйста, проверьте ключ доступа."
1304
+
1305
+ #: inc/cleantalk-settings.php:1442
1306
+ msgid "XSS check"
1307
+ msgstr "Проверка XSS уязвимости"
1308
+
1309
+ #: inc/cleantalk-settings.php:1443
1310
+ msgid ""
1311
+ "Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to "
1312
+ "any user. As a result malicious scripts can not get access to the cookie "
1313
+ "files, session tokens and any other confidential information browsers use "
1314
+ "and store. Such scripts can even overwrite content of HTML pages. CleanTalk "
1315
+ "WAF monitors for patterns of these parameters and block them."
1316
+ msgstr ""
1317
+ "Межсайтовый скриптинг (XSS) - предотвращает выполнение / отправку "
1318
+ "вредоносного кода любому пользователю. В результате вредоносные сценарии не "
1319
+ "могут получить доступ к файлам cookie, токенам сеансов и любой другой "
1320
+ "конфиденциальной информации, которую используют и хранят браузеры. Такие "
1321
+ "сценарии могут даже перезаписывать содержимое HTML-страниц. CleanTalk WAF "
1322
+ "отслеживает шаблоны этих параметров и блокирует их."
1323
+
1324
+ #: inc/cleantalk-settings.php:1446
1325
+ msgid "SQL-injection check"
1326
+ msgstr "Проверка на наличие SQL-injection"
1327
+
1328
+ #: inc/cleantalk-settings.php:1447
1329
+ msgid ""
1330
+ "SQL Injection — one of the most popular ways to hack websites and programs "
1331
+ "that work with databases. It is based on injection of a custom SQL code into "
1332
+ "database queries. It could transmit data through GET, POST requests or "
1333
+ "cookie files in an SQL code. If a website is vulnerable and execute such "
1334
+ "injections then it would allow attackers to apply changes to the website's "
1335
+ "MySQL database."
1336
+ msgstr ""
1337
+ "SQL-инъекция - один из самых популярных способов взлома сайтов и программ, "
1338
+ "работающих с базами данных. Он основан на внедрении пользовательского кода "
1339
+ "SQL в запросы к базе данных. Он может передавать данные через запросы GET, "
1340
+ "POST или файлы cookie в коде SQL. Если веб-сайт уязвим и выполняет такие "
1341
+ "инъекции, это позволит злоумышленникам применить изменения к базе данных "
1342
+ "MySQL веб-сайта."
1343
+
1344
+ #: inc/cleantalk-settings.php:1450
1345
+ msgid "Check uploaded files"
1346
+ msgstr "Проверка загруженных файлов"
1347
+
1348
+ #: inc/cleantalk-settings.php:1451
1349
+ msgid ""
1350
+ "The option checks each uploaded file to a website for malicious code. If "
1351
+ "it's possible for visitors to upload files to a website, for instance a work "
1352
+ "resume, then attackers could abuse it and upload an infected file to execute "
1353
+ "it later and get access to your website."
1354
+ msgstr ""
1355
+ "Опция проверяет каждый загруженный файл на веб-сайт на наличие вредоносного "
1356
+ "кода. Если посетители могут загружать на сайт файлы, например, резюме, то "
1357
+ "злоумышленники могут злоупотреблять им и загружать зараженный файл, чтобы "
1358
+ "выполнить его позднее и получить доступ к вашему сайту."
1359
+
1360
+ #: inc/cleantalk-users.php:15
1361
+ msgid "Find spam users"
1362
+ msgstr "Найти спам-пользователей"
1363
+
1364
+ #: inc/cleantalk-users.php:67
1365
+ msgid "Please wait for a while. CleanTalk is deleting spam users. Users left: "
1366
+ msgstr "Пожалуйста, подождите. CleanTalk удаляет спам-пользователей. Осталось:"
1367
+
1368
+ #: inc/cleantalk-users.php:79
1369
+ msgid ""
1370
+ "The plugin will check all users against blacklists database and show you "
1371
+ "senders that have spam activity on other websites."
1372
+ msgstr ""
1373
+ "Плагин проверит всех пользователей по базе данных чёрных списков и покажет "
1374
+ "отправителей, которые занимаются спамом на других сайтах."
1375
+
1376
+ #: inc/cleantalk-users.php:84
1377
+ msgid ""
1378
+ "Allows to use user's dates to perform more accurate check. Could seriously "
1379
+ "slow down the check."
1380
+ msgstr ""
1381
+ "Позволяет использовать даты пользователей для выполения более тщательной "
1382
+ "проверки. Может серьезно замедлить проверку."
1383
+
1384
+ #: inc/cleantalk-users.php:108
1385
+ msgid ""
1386
+ "Please wait for a while. CleanTalk is checking all users via blacklist "
1387
+ "database at cleantalk.org. You will have option to delete found spam users "
1388
+ "after plugin finish."
1389
+ msgstr ""
1390
+ "Пожалуйста, подождите. ClenTalk проверяет всех пользователей по чёрным "
1391
+ "спискам на cleantalk.org. У вас появится возможность удалить обнаруженных "
1392
+ "спам-пользователей как только плагин закончит."
1393
+
1394
+ #: inc/cleantalk-users.php:267
1395
+ msgid "Delete all users from list"
1396
+ msgstr "Удалить всех пользователей в списке"
1397
+
1398
+ #: inc/cleantalk-users.php:269
1399
+ msgid "Download results in CSV"
1400
+ msgstr "Загрузить результаты (CSV)"
1401
+
1402
+ #: inc/cleantalk-users.php:273
1403
+ msgid "Insert accounts"
1404
+ msgstr "Добавить аккаунты"
1405
+
1406
+ #: inc/cleantalk-users.php:274
1407
+ msgid "Delete accounts"
1408
+ msgstr "Удалить тестовые спам-аккаунты"
1409
+
1410
+ #: inc/cleantalk-users.php:527
1411
+ #, php-format
1412
+ msgid ""
1413
+ "Total users %s, checked %s, last check %s, found %s spam users and %s bad "
1414
+ "users (without IP or email)"
1415
+ msgstr ""
1416
+ "Всего пользователей %s, проверено %s, последняя проверка %s, найдено %s спам-"
1417
+ "пользователей и %s плохих пользователей (без IP или электронной почты)"
1418
+
1419
+ #: inc/cleantalk-widget.php:22
1420
+ msgid "CleanTalk Widget"
1421
+ msgstr "Виджет CleanTalk"
1422
+
1423
+ #: inc/cleantalk-widget.php:25
1424
+ msgid "CleanTalk widget"
1425
+ msgstr "виджет CleanTalk"
1426
+
1427
+ #: inc/cleantalk-widget.php:72
1428
+ msgid "CleanTalk's main page"
1429
+ msgstr "Главная страница CleanTalk"
1430
+
1431
+ #: inc/cleantalk-widget.php:73
1432
+ msgid "spam"
1433
+ msgstr "спама"
1434
+
1435
+ #: inc/cleantalk-widget.php:73
1436
+ msgid "blocked by"
1437
+ msgstr "заблокировано"
1438
+
1439
+ #: inc/cleantalk-widget.php:85
1440
+ msgid "Spam blocked"
1441
+ msgstr "Спама заблокировано"
1442
+
1443
+ #: inc/cleantalk-widget.php:90
1444
+ msgid "Title:"
1445
+ msgstr "Заголовок:"
1446
+
1447
+ #: inc/cleantalk-widget.php:95
1448
+ msgid "Style:"
1449
+ msgstr "Стиль:"
1450
+
1451
+ #: inc/cleantalk-widget.php:97
1452
+ msgid "CleanTalk's Style"
1453
+ msgstr "Фирменный стиль CleanTalk"
1454
+
1455
+ #: inc/cleantalk-widget.php:98
1456
+ msgid "Light"
1457
+ msgstr "Лёгкий"
1458
+
1459
+ #: inc/cleantalk-widget.php:99
1460
+ msgid "Extremely Light"
1461
+ msgstr "Очень легкий"
1462
+
1463
+ #: inc/cleantalk-widget.php:100
1464
+ msgid "Dark"
1465
+ msgstr "Темный"
1466
+
1467
+ #: inc/cleantalk-widget.php:105
1468
+ msgid "Referal link ID:"
1469
+ msgstr "ID партнера:"
1470
+
1471
+ #: lib/CleantalkSFW.php:71
1472
+ msgid "SpamFireWall is activated for your IP "
1473
+ msgstr "Спам Фаервол заблокировал ваш IP"
1474
+
1475
+ #: lib/CleantalkSFW.php:72
1476
+ msgid ""
1477
+ "To continue working with web site, please make sure that you have enabled "
1478
+ "JavaScript."
1479
+ msgstr ""
1480
+ "Что бы продолжить работу с сайтом, пожалуйста, убедитесь что у вас включен "
1481
+ "JavaScript."
1482
+
1483
+ #: lib/CleantalkSFW.php:73
1484
+ msgid "Please click below to pass protection,"
1485
+ msgstr "Пожалуйста, нажмите, чтобы пройти защиту,"
1486
+
1487
+ #: lib/CleantalkSFW.php:74
1488
+ #, php-format
1489
+ msgid ""
1490
+ "Or you will be automatically redirected to the requested page after %d "
1491
+ "seconds."
1492
+ msgstr ""
1493
+ "Или вы будете автоматически переадресованы на запрашиваемую страницу через "
1494
+ "%d секунд."
1495
+
1496
+ #: lib/CleantalkSFW.php:75
1497
+ msgid "Antispam by CleanTalk"
1498
+ msgstr "Антиспам от CleanTalk"
1499
+
1500
+ #: lib/CleantalkSFW.php:76
1501
+ msgid "This is the testing page for SpamFireWall"
1502
+ msgstr "Это тестовая страница SpamFireWall"
1503
+
1504
+ #: templates/translate_banner.php:6
1505
+ msgid "Help others use the plugin in your language."
1506
+ msgstr "Помогите другим пользователям использовать плагин на их языке."
1507
+
1508
+ #: templates/translate_banner.php:7
1509
+ msgid ""
1510
+ "We ask you to help with the translation of the plugin in your language. "
1511
+ "Please take a few minutes to make the plugin more comfortable."
1512
+ msgstr ""
1513
+ "Мы просим Вас помочь с переводом плагина на ваш язык. Пожалуйста, потратьте "
1514
+ "несколько минут, чтобы сделать плагин более удобным."
1515
+
1516
+ #: templates/translate_banner.php:10
1517
+ msgid "TRANSLATE"
1518
+ msgstr "ПЕРЕВЕСТИ"
1519
+
1520
+ #. Plugin Name of the plugin/theme
1521
+ msgid "Anti-Spam by CleanTalk"
1522
+ msgstr "Антиспам от CleanTalk"
1523
+
1524
+ #. Description of the plugin/theme
1525
+ msgid ""
1526
+ "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam,"
1527
+ " no registration spam, no contact spam, protects any WordPress forms."
1528
+ msgstr ""
1529
+ "Максимальная эффективность, проверка всех форм, без Сaptcha, премиум "
1530
+ "антиспам плагин. Нет спаму в комментариях, нет спаму в регистрациях, нету "
1531
+ "спаму в контактных формах, защита любых форм в WordPress."
1532
+
1533
+ #. Plugin URI of the plugin/theme
1534
+ #. Author URI of the plugin/theme
1535
+ msgid "http://cleantalk.org"
1536
+ msgstr "http://cleantalk.org"
1537
+
1538
+ #. Author of the plugin/theme
1539
+ msgid "СleanTalk <welcome@cleantalk.org>"
1540
+ msgstr "СleanTalk <welcome@cleantalk.org>"
i18n/cleantalk.pot CHANGED
@@ -1,1388 +1,1388 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
- "Project-Id-Version: Anti-Spam by CleanTalk\n"
6
- "POT-Creation-Date: 2019-10-27 16:02+0000\n"
7
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
- "Last-Translator: \n"
9
- "Language-Team: \n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Loco https://localise.biz/\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-WPHeader: cleantalk.php\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
- "Language: "
23
-
24
- #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
25
- #: inc/cleantalk-users.php:15
26
- msgid "Check for spam"
27
- msgstr ""
28
-
29
- #: inc/classCleantalkComments.php:33 inc/cleantalk-admin.php:350
30
- #: inc/cleantalk-comments.php:16
31
- msgid "Find spam comments"
32
- msgstr ""
33
-
34
- #: inc/classCleantalkComments.php:66 inc/cleantalk-comments.php:26
35
- #: inc/cleantalk-users.php:25
36
- msgid "Plugin Settings"
37
- msgstr ""
38
-
39
- #: inc/classCleantalkComments.php:76 inc/cleantalk-comments.php:35
40
- #: inc/cleantalk-users.php:34
41
- #, php-format
42
- msgid ""
43
- "Antispam hosting tariff does not allow you to use this feature. To do so, "
44
- "you need to enter an Access Key in the %splugin settings%s."
45
- msgstr ""
46
-
47
- #: inc/classCleantalkComments.php:101 inc/cleantalk-comments.php:60
48
- #: inc/cleantalk-users.php:60
49
- msgid ""
50
- "Ajax error. Process will be automatically restarted in 3 seconds. Status: "
51
- msgstr ""
52
-
53
- #: inc/classCleantalkComments.php:108 inc/cleantalk-comments.php:67
54
- msgid ""
55
- "Please wait for a while. CleanTalk is deleting spam comments. Comments left: "
56
- msgstr ""
57
-
58
- #: inc/classCleantalkComments.php:118 inc/cleantalk-comments.php:77
59
- #: inc/cleantalk-users.php:77
60
- msgid "Start check"
61
- msgstr ""
62
-
63
- #: inc/classCleantalkComments.php:119 inc/cleantalk-comments.php:78
64
- #: inc/cleantalk-users.php:78
65
- msgid "Continue check"
66
- msgstr ""
67
-
68
- #: inc/classCleantalkComments.php:120 inc/cleantalk-comments.php:79
69
- msgid ""
70
- "The plugin will check all comments against blacklists database and show you "
71
- "senders that have spam activity on other websites."
72
- msgstr ""
73
-
74
- #: inc/classCleantalkComments.php:123 inc/cleantalk-comments.php:82
75
- #: inc/cleantalk-users.php:82
76
- msgid "Accurate check"
77
- msgstr ""
78
-
79
- #: inc/classCleantalkComments.php:125 inc/cleantalk-comments.php:84
80
- msgid ""
81
- "Allows to use comment's dates to perform more accurate check. Could "
82
- "seriously slow down the check."
83
- msgstr ""
84
-
85
- #: inc/classCleantalkComments.php:128 inc/cleantalk-comments.php:87
86
- #: inc/cleantalk-users.php:87
87
- msgid "Specify date range"
88
- msgstr ""
89
-
90
- #: inc/classCleantalkComments.php:149 inc/cleantalk-comments.php:108
91
- msgid ""
92
- "Please wait! CleanTalk is checking all approved and pending comments via "
93
- "blacklist database at cleantalk.org. You will have option to delete found "
94
- "spam comments after plugin finish."
95
- msgstr ""
96
-
97
- #: inc/classCleantalkCommentsListTable.php:24
98
- msgid "Author"
99
- msgstr ""
100
-
101
- #: inc/classCleantalkCommentsListTable.php:25 inc/cleantalk-comments.php:158
102
- msgid "Comment"
103
- msgstr ""
104
-
105
- #: inc/classCleantalkCommentsListTable.php:26 inc/cleantalk-comments.php:159
106
- msgid "In Response To"
107
- msgstr ""
108
-
109
- #: inc/classCleantalkCommentsListTable.php:33
110
- msgid "No spam comments."
111
- msgstr ""
112
-
113
- #: inc/cleantalk-admin.php:27
114
- #, php-format
115
- msgid "Find spam %s"
116
- msgstr ""
117
-
118
- #: inc/cleantalk-admin.php:31
119
- msgid "CleanTalk Anti-Spam Log"
120
- msgstr ""
121
-
122
- #: inc/cleantalk-admin.php:50
123
- #, php-format
124
- msgid "%sRefresh%s"
125
- msgstr ""
126
-
127
- #: inc/cleantalk-admin.php:51
128
- #, php-format
129
- msgid "%sConfigure%s"
130
- msgstr ""
131
-
132
- #: inc/cleantalk-admin.php:68
133
- msgid "7 days anti-spam stats"
134
- msgstr ""
135
-
136
- #: inc/cleantalk-admin.php:72
137
- msgid "Top 5 spam IPs blocked"
138
- msgstr ""
139
-
140
- #: inc/cleantalk-admin.php:78
141
- msgid "Get Access key to activate Anti-Spam protection!"
142
- msgstr ""
143
-
144
- #: inc/cleantalk-admin.php:86
145
- #, php-format
146
- msgid "Something went wrong! Error: \"%s\"."
147
- msgstr ""
148
-
149
- #: inc/cleantalk-admin.php:90
150
- msgid "Please, visit your dashboard."
151
- msgstr ""
152
-
153
- #: inc/cleantalk-admin.php:104
154
- msgid "IP"
155
- msgstr ""
156
-
157
- #: inc/cleantalk-admin.php:105
158
- msgid "Country"
159
- msgstr ""
160
-
161
- #: inc/cleantalk-admin.php:106
162
- msgid "Block Count"
163
- msgstr ""
164
-
165
- #: inc/cleantalk-admin.php:134
166
- #, php-format
167
- msgid ""
168
- "This is the count from the %s's cloud and could be different to admin bar "
169
- "counters"
170
- msgstr ""
171
-
172
- #. %s: Number of spam messages
173
- #: inc/cleantalk-admin.php:137
174
- #, php-format
175
- msgid ""
176
- "%s%s%s has blocked %s spam for all time. The statistics are automatically "
177
- "updated every 24 hours."
178
- msgstr ""
179
-
180
- #: inc/cleantalk-admin.php:148 inc/cleantalk-settings.php:544
181
- #, php-format
182
- msgid "Do you like CleanTalk? %sPost your feedback here%s."
183
- msgstr ""
184
-
185
- #: inc/cleantalk-admin.php:234
186
- msgid "Translate"
187
- msgstr ""
188
-
189
- #: inc/cleantalk-admin.php:237
190
- msgid "Start here"
191
- msgstr ""
192
-
193
- #: inc/cleantalk-admin.php:238
194
- msgid "FAQ"
195
- msgstr ""
196
-
197
- #: inc/cleantalk-admin.php:239 inc/cleantalk-admin.php:644
198
- #: inc/cleantalk-settings.php:575
199
- msgid "Support"
200
- msgstr ""
201
-
202
- #: inc/cleantalk-admin.php:306 inc/cleantalk-settings.php:523
203
- msgid "Hosting AntiSpam"
204
- msgstr ""
205
-
206
- #: inc/cleantalk-admin.php:333
207
- msgid "Failed from timeout. Going to check comments again."
208
- msgstr ""
209
-
210
- #: inc/cleantalk-admin.php:334
211
- msgid "Added"
212
- msgstr ""
213
-
214
- #: inc/cleantalk-admin.php:335 inc/cleantalk-admin.php:386
215
- msgid "Deleted"
216
- msgstr ""
217
-
218
- #: inc/cleantalk-admin.php:336
219
- msgid "comments"
220
- msgstr ""
221
-
222
- #: inc/cleantalk-admin.php:337
223
- msgid "Delete all spam comments?"
224
- msgstr ""
225
-
226
- #: inc/cleantalk-admin.php:338
227
- msgid "Delete checked comments?"
228
- msgstr ""
229
-
230
- #: inc/cleantalk-admin.php:339
231
- #, php-format
232
- msgid ""
233
- "Total comments %s. Checked %s. Found %s spam comments. %s bad comments "
234
- "(without IP or email)."
235
- msgstr ""
236
-
237
- #: inc/cleantalk-admin.php:340 inc/cleantalk-admin.php:393
238
- #: inc/cleantalk-users.php:531
239
- msgid "Please do backup of WordPress database before delete any accounts!"
240
- msgstr ""
241
-
242
- #: inc/cleantalk-admin.php:351
243
- msgid "The sender has been whitelisted."
244
- msgstr ""
245
-
246
- #: inc/cleantalk-admin.php:352
247
- msgid "The sender has been blacklisted."
248
- msgstr ""
249
-
250
- #: inc/cleantalk-admin.php:353 inc/cleantalk-public.php:3321
251
- #, php-format
252
- msgid "Feedback has been sent to %sCleanTalk Dashboard%s."
253
- msgstr ""
254
-
255
- #: inc/cleantalk-admin.php:383
256
- msgid "Failed from timeout. Going to check users again."
257
- msgstr ""
258
-
259
- #: inc/cleantalk-admin.php:384
260
- msgid "Failed from timeout. Going to run a new attempt to delete spam users."
261
- msgstr ""
262
-
263
- #: inc/cleantalk-admin.php:385
264
- msgid "Inserted"
265
- msgstr ""
266
-
267
- #: inc/cleantalk-admin.php:387
268
- msgid "users."
269
- msgstr ""
270
-
271
- #: inc/cleantalk-admin.php:388
272
- msgid "Delete all spam users?"
273
- msgstr ""
274
-
275
- #: inc/cleantalk-admin.php:389
276
- msgid "Delete checked users?"
277
- msgstr ""
278
-
279
- #: inc/cleantalk-admin.php:392
280
- #, php-format
281
- msgid ""
282
- "Total users %s, checked %s, found %s spam users and %s bad users (without IP "
283
- "or email)"
284
- msgstr ""
285
-
286
- #: inc/cleantalk-admin.php:401
287
- msgid "Find spam-users"
288
- msgstr ""
289
-
290
- #: inc/cleantalk-admin.php:449
291
- #, php-format
292
- msgid "Unable to get Access key automatically: %s"
293
- msgstr ""
294
-
295
- #: inc/cleantalk-admin.php:450
296
- msgid "Get the Access key"
297
- msgstr ""
298
-
299
- #: inc/cleantalk-admin.php:459
300
- #, php-format
301
- msgid "Please enter Access Key in %s settings to enable anti spam protection!"
302
- msgstr ""
303
-
304
- #: inc/cleantalk-admin.php:469
305
- #, php-format
306
- msgid "%s trial period ends, please upgrade to %s!"
307
- msgstr ""
308
-
309
- #: inc/cleantalk-admin.php:481
310
- msgid "RENEW ANTI-SPAM"
311
- msgstr ""
312
-
313
- #: inc/cleantalk-admin.php:482
314
- msgid "next year"
315
- msgstr ""
316
-
317
- #: inc/cleantalk-admin.php:486
318
- #, php-format
319
- msgid "Please renew your anti-spam license for %s."
320
- msgstr ""
321
-
322
- #: inc/cleantalk-admin.php:511
323
- msgid "Make it right!"
324
- msgstr ""
325
-
326
- #: inc/cleantalk-admin.php:513
327
- #, php-format
328
- msgid "%sGet premium%s"
329
- msgstr ""
330
-
331
- #: inc/cleantalk-admin.php:552
332
- msgid "Since"
333
- msgstr ""
334
-
335
- #: inc/cleantalk-admin.php:558
336
- msgid ""
337
- "All / Allowed / Blocked submissions. The number of submissions is being "
338
- "counted since CleanTalk plugin installation."
339
- msgstr ""
340
-
341
- #: inc/cleantalk-admin.php:558
342
- msgid "All"
343
- msgstr ""
344
-
345
- #: inc/cleantalk-admin.php:566
346
- msgid ""
347
- "Allowed / Blocked submissions. The number of submissions for past 24 hours. "
348
- msgstr ""
349
-
350
- #: inc/cleantalk-admin.php:566
351
- msgid "Day"
352
- msgstr ""
353
-
354
- #: inc/cleantalk-admin.php:572
355
- msgid ""
356
- "All / Blocked events. Access attempts regitred by SpamFireWall counted since "
357
- "the last plugin activation."
358
- msgstr ""
359
-
360
- #: inc/cleantalk-admin.php:582
361
- msgid ""
362
- "Allowed / Blocked submissions. The number of submissions is being counted "
363
- "since "
364
- msgstr ""
365
-
366
- #: inc/cleantalk-admin.php:593
367
- msgid "dashboard"
368
- msgstr ""
369
-
370
- #: inc/cleantalk-admin.php:600
371
- msgid "Settings"
372
- msgstr ""
373
-
374
- #: inc/cleantalk-admin.php:608
375
- msgid "Bulk spam comments removal tool."
376
- msgstr ""
377
-
378
- #: inc/cleantalk-admin.php:608 inc/cleantalk-settings.php:882
379
- msgid "Check comments for spam"
380
- msgstr ""
381
-
382
- #: inc/cleantalk-admin.php:618 inc/cleantalk-settings.php:885
383
- msgid "Check users for spam"
384
- msgstr ""
385
-
386
- #: inc/cleantalk-admin.php:627
387
- msgid "Reset first counter"
388
- msgstr ""
389
-
390
- #: inc/cleantalk-admin.php:635
391
- msgid "Reset all counters"
392
- msgstr ""
393
-
394
- #: inc/cleantalk-comments.php:221 inc/cleantalk-users.php:220
395
- msgid "Approve"
396
- msgstr ""
397
-
398
- #: inc/cleantalk-comments.php:223 inc/cleantalk-users.php:222
399
- msgid "Delete"
400
- msgstr ""
401
-
402
- #: inc/cleantalk-comments.php:265
403
- msgid "Delete all comments from the list"
404
- msgstr ""
405
-
406
- #: inc/cleantalk-comments.php:266 inc/cleantalk-users.php:268
407
- msgid "Delete selected"
408
- msgstr ""
409
-
410
- #: inc/cleantalk-comments.php:270
411
- msgid "Insert comments"
412
- msgstr ""
413
-
414
- #: inc/cleantalk-comments.php:271
415
- msgid "Delete comments"
416
- msgstr ""
417
-
418
- #: inc/cleantalk-comments.php:276 inc/cleantalk-users.php:279
419
- msgid ""
420
- "There is some differencies between blacklists database and our API "
421
- "mechanisms. Blacklists shows all history of spam activity, but our API (that "
422
- "used in spam checking) used another parameters, too: last day of activity, "
423
- "number of spam attacks during last days etc. This mechanisms help us to "
424
- "reduce number of false positivitie. So, there is nothing strange, if some "
425
- "emails/IPs will be not found by this checking."
426
- msgstr ""
427
-
428
- #: inc/cleantalk-comments.php:281 inc/cleantalk-users.php:284
429
- msgid "Stop deletion"
430
- msgstr ""
431
-
432
- #: inc/cleantalk-comments.php:495
433
- #, php-format
434
- msgid ""
435
- "Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad "
436
- "comments (without IP or email)."
437
- msgstr ""
438
-
439
- #: inc/cleantalk-comments.php:499
440
- msgid "Please do backup of WordPress database before delete any comments!"
441
- msgstr ""
442
-
443
- #: inc/cleantalk-public.php:500 inc/cleantalk-public.php:641
444
- #: inc/cleantalk-public.php:743 inc/cleantalk-public.php:2363
445
- #: inc/cleantalk-public.php:3052
446
- msgid "Spam protection by CleanTalk"
447
- msgstr ""
448
-
449
- #: inc/cleantalk-public.php:1233 inc/cleantalk-public.php:1361
450
- #: inc/cleantalk-public.php:1379
451
- msgid "Spam protection"
452
- msgstr ""
453
-
454
- #: inc/cleantalk-public.php:1332
455
- msgid "CleanTalk AntiSpam: This message is possible spam."
456
- msgstr ""
457
-
458
- #: inc/cleantalk-public.php:1333
459
- msgid "You could check it in CleanTalk's anti-spam database:"
460
- msgstr ""
461
-
462
- #: inc/cleantalk-public.php:1569
463
- #, php-format
464
- msgid "Registration approved by %s."
465
- msgstr ""
466
-
467
- #: inc/cleantalk-public.php:1849
468
- msgid "CleanTalk AntiSpam: This registration is spam."
469
- msgstr ""
470
-
471
- #: inc/cleantalk-public.php:1850 inc/cleantalk-public.php:2219
472
- #: inc/cleantalk-public.php:2387 inc/cleantalk-public.php:2542
473
- msgid "CleanTalk's anti-spam database:"
474
- msgstr ""
475
-
476
- #: inc/cleantalk-public.php:2218 inc/cleantalk-public.php:2386
477
- #: inc/cleantalk-public.php:2541
478
- msgid "CleanTalk AntiSpam: This message is spam."
479
- msgstr ""
480
-
481
- #: inc/cleantalk-public.php:2666
482
- msgid "Comment approved. Anti-spam by CleanTalk."
483
- msgstr ""
484
-
485
- #: inc/cleantalk-public.php:3219
486
- msgid "Attention, please!"
487
- msgstr ""
488
-
489
- #: inc/cleantalk-public.php:3220
490
- #, php-format
491
- msgid "\"%s\" plugin error on your site \"%s\":"
492
- msgstr ""
493
-
494
- #: inc/cleantalk-public.php:3222
495
- #, php-format
496
- msgid "[%s] \"%s\" error!"
497
- msgstr ""
498
-
499
- #: inc/cleantalk-public.php:3271
500
- msgid ""
501
- "By using this form you agree with the storage and processing of your data by "
502
- "using the Privacy Policy on this website."
503
- msgstr ""
504
-
505
- #: inc/cleantalk-public.php:3319
506
- msgid "Error occured while sending feedback."
507
- msgstr ""
508
-
509
- #: inc/cleantalk-public.php:3320
510
- msgid "Feedback wasn't sent. There is no associated request."
511
- msgstr ""
512
-
513
- #: inc/cleantalk-public.php:3364
514
- msgid "Sender info"
515
- msgstr ""
516
-
517
- #: inc/cleantalk-public.php:3367
518
- msgid "by"
519
- msgstr ""
520
-
521
- #: inc/cleantalk-public.php:3378
522
- msgid "No email"
523
- msgstr ""
524
-
525
- #: inc/cleantalk-public.php:3388
526
- msgid "No IP"
527
- msgstr ""
528
-
529
- #: inc/cleantalk-public.php:3391
530
- msgid "Mark as spam"
531
- msgstr ""
532
-
533
- #: inc/cleantalk-public.php:3392
534
- msgid "Unspam"
535
- msgstr ""
536
-
537
- #: inc/cleantalk-public.php:3394
538
- msgid "Marked as spam."
539
- msgstr ""
540
-
541
- #: inc/cleantalk-public.php:3395
542
- msgid "Marked as not spam."
543
- msgstr ""
544
-
545
- #: inc/cleantalk-settings.php:96
546
- msgid "SpamFireWall"
547
- msgstr ""
548
-
549
- #: inc/cleantalk-settings.php:97
550
- msgid ""
551
- "This option allows to filter spam bots before they access website. Also "
552
- "reduces CPU usage on hosting server and accelerates pages load time."
553
- msgstr ""
554
-
555
- #: inc/cleantalk-settings.php:104
556
- msgid "Forms to protect"
557
- msgstr ""
558
-
559
- #: inc/cleantalk-settings.php:110
560
- msgid "Advanced settings"
561
- msgstr ""
562
-
563
- #: inc/cleantalk-settings.php:117
564
- msgid "Registration Forms"
565
- msgstr ""
566
-
567
- #: inc/cleantalk-settings.php:118
568
- msgid "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
569
- msgstr ""
570
-
571
- #: inc/cleantalk-settings.php:121
572
- msgid "Comments form"
573
- msgstr ""
574
-
575
- #: inc/cleantalk-settings.php:122
576
- msgid "WordPress, JetPack, WooCommerce."
577
- msgstr ""
578
-
579
- #: inc/cleantalk-settings.php:125 inc/cleantalk-settings.php:761
580
- msgid "Contact forms"
581
- msgstr ""
582
-
583
- #: inc/cleantalk-settings.php:126
584
- msgid ""
585
- "Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, "
586
- "WordPress Landing Pages, Gravity Forms."
587
- msgstr ""
588
-
589
- #: inc/cleantalk-settings.php:129 inc/cleantalk-settings.php:762
590
- msgid "Custom contact forms"
591
- msgstr ""
592
-
593
- #: inc/cleantalk-settings.php:130
594
- msgid "Anti spam test for any WordPress themes or contacts forms."
595
- msgstr ""
596
-
597
- #: inc/cleantalk-settings.php:133 inc/cleantalk-settings.php:775
598
- msgid "WooCommerce checkout form"
599
- msgstr ""
600
-
601
- #: inc/cleantalk-settings.php:134
602
- msgid "Anti spam test for WooCommerce checkout form."
603
- msgstr ""
604
-
605
- #: inc/cleantalk-settings.php:138
606
- msgid "Spam test for registration during checkout"
607
- msgstr ""
608
-
609
- #: inc/cleantalk-settings.php:139
610
- msgid ""
611
- "Enable anti spam test for registration process which during woocommerce's "
612
- "checkout."
613
- msgstr ""
614
-
615
- #: inc/cleantalk-settings.php:145
616
- msgid "Test default Wordpress search form for spam"
617
- msgstr ""
618
-
619
- #: inc/cleantalk-settings.php:146
620
- msgid "Spam protection for Search form."
621
- msgstr ""
622
-
623
- #: inc/cleantalk-settings.php:148
624
- #, php-format
625
- msgid "Read more about %sspam protection for Search form%s on our blog."
626
- msgstr ""
627
-
628
- #: inc/cleantalk-settings.php:156
629
- msgid "Protect external forms"
630
- msgstr ""
631
-
632
- #: inc/cleantalk-settings.php:157
633
- msgid ""
634
- "Turn this option on to protect forms on your WordPress that send data to "
635
- "third-part servers (like MailChimp)."
636
- msgstr ""
637
-
638
- #: inc/cleantalk-settings.php:161
639
- msgid "Capture buffer"
640
- msgstr ""
641
-
642
- #: inc/cleantalk-settings.php:162
643
- msgid ""
644
- "This setting gives you more sophisticated and strengthened protection for "
645
- "external forms. But it could break plugins which use a buffer like Ninja "
646
- "Forms."
647
- msgstr ""
648
-
649
- #: inc/cleantalk-settings.php:167
650
- msgid "Protect internal forms"
651
- msgstr ""
652
-
653
- #: inc/cleantalk-settings.php:168
654
- msgid ""
655
- "This option will enable protection for custom (hand-made) AJAX forms with "
656
- "PHP scripts handlers on your WordPress."
657
- msgstr ""
658
-
659
- #: inc/cleantalk-settings.php:175
660
- msgid "Comments and Messages"
661
- msgstr ""
662
-
663
- #: inc/cleantalk-settings.php:178
664
- msgid "BuddyPress Private Messages"
665
- msgstr ""
666
-
667
- #: inc/cleantalk-settings.php:179
668
- msgid "Check buddyPress private messages."
669
- msgstr ""
670
-
671
- #: inc/cleantalk-settings.php:182
672
- msgid "Don't check trusted user's comments"
673
- msgstr ""
674
-
675
- #: inc/cleantalk-settings.php:183
676
- #, php-format
677
- msgid "Don't check comments for users with above %d comments."
678
- msgstr ""
679
-
680
- #: inc/cleantalk-settings.php:186
681
- msgid "Automatically delete spam comments"
682
- msgstr ""
683
-
684
- #: inc/cleantalk-settings.php:187
685
- #, php-format
686
- msgid "Delete spam comments older than %d days."
687
- msgstr ""
688
-
689
- #: inc/cleantalk-settings.php:190
690
- msgid "Remove links from approved comments"
691
- msgstr ""
692
-
693
- #: inc/cleantalk-settings.php:191
694
- msgid "Remove links from approved comments. Replace it with \"[Link deleted]\""
695
- msgstr ""
696
-
697
- #: inc/cleantalk-settings.php:194
698
- msgid "Show links to check Emails, IPs for spam."
699
- msgstr ""
700
-
701
- #: inc/cleantalk-settings.php:195
702
- msgid ""
703
- "Shows little icon near IP addresses and Emails allowing you to check it via "
704
- "CleanTalk's database. Also allowing you to manage comments from the public "
705
- "post's page."
706
- msgstr ""
707
-
708
- #: inc/cleantalk-settings.php:203
709
- msgid "Data Processing"
710
- msgstr ""
711
-
712
- #: inc/cleantalk-settings.php:206
713
- msgid "Protect logged in Users"
714
- msgstr ""
715
-
716
- #: inc/cleantalk-settings.php:207
717
- msgid ""
718
- "Turn this option on to check for spam any submissions (comments, contact "
719
- "forms and etc.) from registered Users."
720
- msgstr ""
721
-
722
- #: inc/cleantalk-settings.php:210
723
- msgid "Use AJAX for JavaScript check"
724
- msgstr ""
725
-
726
- #: inc/cleantalk-settings.php:211
727
- msgid ""
728
- "Options helps protect WordPress against spam with any caching plugins. Turn "
729
- "this option on to avoid issues with caching plugins."
730
- msgstr ""
731
-
732
- #: inc/cleantalk-settings.php:214
733
- msgid "Use static keys for JS check."
734
- msgstr ""
735
-
736
- #: inc/cleantalk-settings.php:215
737
- msgid ""
738
- "Could help if you have cache for AJAX requests and you are dealing with "
739
- "false positives. Slightly decreases protection quality. Auto - Static key "
740
- "will be used if caching plugin is spotted."
741
- msgstr ""
742
-
743
- #: inc/cleantalk-settings.php:223
744
- msgid "Check all post data"
745
- msgstr ""
746
-
747
- #: inc/cleantalk-settings.php:224
748
- msgid ""
749
- "Check all POST submissions from website visitors. Enable this option if you "
750
- "have spam misses on website."
751
- msgstr ""
752
-
753
- #: inc/cleantalk-settings.php:226
754
- msgid " Or you don`t have records about missed spam here:"
755
- msgstr ""
756
-
757
- #: inc/cleantalk-settings.php:226
758
- msgid "CleanTalk dashboard"
759
- msgstr ""
760
-
761
- #: inc/cleantalk-settings.php:229
762
- msgid "СAUTION! Option can catch POST requests in WordPress backend"
763
- msgstr ""
764
-
765
- #: inc/cleantalk-settings.php:232
766
- msgid "Set cookies"
767
- msgstr ""
768
-
769
- #: inc/cleantalk-settings.php:233
770
- msgid ""
771
- "Turn this option off to deny plugin generates any cookies on website front-"
772
- "end. This option is helpful if you use Varnish. But most of contact forms "
773
- "will not be protected if the option is turned off! <b>Warning: We strongly "
774
- "recommend you to enable this otherwise it could cause false positives spam "
775
- "detection.</b>"
776
- msgstr ""
777
-
778
- #: inc/cleantalk-settings.php:237
779
- msgid "Use alternative mechanism for cookies"
780
- msgstr ""
781
-
782
- #: inc/cleantalk-settings.php:238 inc/cleantalk-settings.php:360
783
- msgid "Doesn't use cookie or PHP sessions. Collect data for all types of bots."
784
- msgstr ""
785
-
786
- #: inc/cleantalk-settings.php:243
787
- msgid "Use SSL"
788
- msgstr ""
789
-
790
- #: inc/cleantalk-settings.php:244
791
- msgid "Turn this option on to use encrypted (SSL) connection with servers."
792
- msgstr ""
793
-
794
- #: inc/cleantalk-settings.php:247
795
- msgid "Use Wordpress HTTP API"
796
- msgstr ""
797
-
798
- #: inc/cleantalk-settings.php:248
799
- msgid ""
800
- "Alternative way to connect the Cloud. Use this if you have connection "
801
- "problems."
802
- msgstr ""
803
-
804
- #: inc/cleantalk-settings.php:255
805
- msgid "Exclusions"
806
- msgstr ""
807
-
808
- #: inc/cleantalk-settings.php:259
809
- msgid "URL exclusions"
810
- msgstr ""
811
-
812
- #: inc/cleantalk-settings.php:260
813
- msgid "You could type here URL you want to exclude. Use comma as separator."
814
- msgstr ""
815
-
816
- #: inc/cleantalk-settings.php:264
817
- msgid "Use Regular Expression in URL Exclusions"
818
- msgstr ""
819
-
820
- #: inc/cleantalk-settings.php:268
821
- msgid "Field name exclusions"
822
- msgstr ""
823
-
824
- #: inc/cleantalk-settings.php:269
825
- msgid ""
826
- "You could type here fields names you want to exclude. Use comma as separator."
827
- msgstr ""
828
-
829
- #: inc/cleantalk-settings.php:273
830
- msgid "Use Regular Expression in Field Exclusions"
831
- msgstr ""
832
-
833
- #: inc/cleantalk-settings.php:280
834
- msgid "Roles which bypass spam test. Hold CTRL to select multiple roles."
835
- msgstr ""
836
-
837
- #: inc/cleantalk-settings.php:287
838
- msgid "Admin bar"
839
- msgstr ""
840
-
841
- #: inc/cleantalk-settings.php:294
842
- msgid "Show statistics in admin bar"
843
- msgstr ""
844
-
845
- #: inc/cleantalk-settings.php:295
846
- msgid ""
847
- "Show/hide icon in top level menu in WordPress backend. The number of "
848
- "submissions is being counted for past 24 hours."
849
- msgstr ""
850
-
851
- #: inc/cleantalk-settings.php:299
852
- msgid "Show All-time counter"
853
- msgstr ""
854
-
855
- #: inc/cleantalk-settings.php:300
856
- msgid ""
857
- "Display all-time requests counter in the admin bar. Counter displays number "
858
- "of requests since plugin installation."
859
- msgstr ""
860
-
861
- #: inc/cleantalk-settings.php:305
862
- msgid "Show 24 hours counter"
863
- msgstr ""
864
-
865
- #: inc/cleantalk-settings.php:306
866
- msgid ""
867
- "Display daily requests counter in the admin bar. Counter displays number of "
868
- "requests of the past 24 hours."
869
- msgstr ""
870
-
871
- #: inc/cleantalk-settings.php:311
872
- msgid "SpamFireWall counter"
873
- msgstr ""
874
-
875
- #: inc/cleantalk-settings.php:312
876
- msgid ""
877
- "Display SpamFireWall requests in the admin bar. Counter displays number of "
878
- "requests since plugin installation."
879
- msgstr ""
880
-
881
- #: inc/cleantalk-settings.php:325
882
- msgid "Collect details about browsers"
883
- msgstr ""
884
-
885
- #: inc/cleantalk-settings.php:326
886
- msgid ""
887
- "Checking this box you allow plugin store information about screen size and "
888
- "browser plugins of website visitors. The option in a beta state."
889
- msgstr ""
890
-
891
- #: inc/cleantalk-settings.php:330
892
- msgid "Send connection reports"
893
- msgstr ""
894
-
895
- #: inc/cleantalk-settings.php:331
896
- msgid ""
897
- "Checking this box you allow plugin to send the information about your "
898
- "connection. The option in a beta state."
899
- msgstr ""
900
-
901
- #: inc/cleantalk-settings.php:335
902
- msgid "Async JavaScript loading"
903
- msgstr ""
904
-
905
- #: inc/cleantalk-settings.php:336
906
- msgid ""
907
- "Use async loading for scripts. Warning: This could reduce filtration quality."
908
- msgstr ""
909
-
910
- #: inc/cleantalk-settings.php:340
911
- msgid "Allow to add GDPR notice via shortcode"
912
- msgstr ""
913
-
914
- #: inc/cleantalk-settings.php:341
915
- msgid ""
916
- " Adds small checkbox under your website form. To add it you should use the "
917
- "shortcode on the form's page: [cleantalk_gdpr_form id=\"FORM_ID\"]"
918
- msgstr ""
919
-
920
- #: inc/cleantalk-settings.php:346
921
- msgid "GDPR text notice"
922
- msgstr ""
923
-
924
- #: inc/cleantalk-settings.php:347
925
- msgid "This text will be added as a description to the GDPR checkbox."
926
- msgstr ""
927
-
928
- #: inc/cleantalk-settings.php:353
929
- msgid "Store visited URLs"
930
- msgstr ""
931
-
932
- #: inc/cleantalk-settings.php:354
933
- msgid ""
934
- "Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits "
935
- "form on the site. You can see stored visited URLS for each visitor in your "
936
- "Dashboard. Turn the option on to improve Anti-Spam protection."
937
- msgstr ""
938
-
939
- #: inc/cleantalk-settings.php:359
940
- msgid "Use cookies less sessions"
941
- msgstr ""
942
-
943
- #: inc/cleantalk-settings.php:366
944
- msgid ""
945
- "Notify users with selected roles about new approved comments. Hold CTRL to "
946
- "select multiple roles."
947
- msgstr ""
948
-
949
- #: inc/cleantalk-settings.php:367
950
- #, php-format
951
- msgid "If enabled, overrides similar Wordpress %sdiscussion settings%s."
952
- msgstr ""
953
-
954
- #: inc/cleantalk-settings.php:380
955
- msgid "Complete deactivation"
956
- msgstr ""
957
-
958
- #: inc/cleantalk-settings.php:381
959
- msgid "Leave no trace in the system after deactivation."
960
- msgstr ""
961
-
962
- #: inc/cleantalk-settings.php:398
963
- msgid "Enable White Label Mode"
964
- msgstr ""
965
-
966
- #: inc/cleantalk-settings.php:399
967
- #, php-format
968
- msgid "Learn more information %shere%s."
969
- msgstr ""
970
-
971
- #: inc/cleantalk-settings.php:404
972
- msgid "Hoster API Key"
973
- msgstr ""
974
-
975
- #: inc/cleantalk-settings.php:405
976
- #, php-format
977
- msgid "You can get it in %sCleantalk's Control Panel%s"
978
- msgstr ""
979
-
980
- #: inc/cleantalk-settings.php:413
981
- msgid "Plugin name"
982
- msgstr ""
983
-
984
- #: inc/cleantalk-settings.php:414
985
- #, php-format
986
- msgid "Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s"
987
- msgstr ""
988
-
989
- #: inc/cleantalk-settings.php:423
990
- msgid "Allow users to use other key"
991
- msgstr ""
992
-
993
- #: inc/cleantalk-settings.php:424
994
- msgid ""
995
- "Allow users to use different Access key in their plugin settings on child "
996
- "blogs. They could use different CleanTalk account."
997
- msgstr ""
998
-
999
- #: inc/cleantalk-settings.php:427
1000
- msgid ""
1001
- "Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key "
1002
- "from this constant. Look into wp-config.php"
1003
- msgstr ""
1004
-
1005
- #: inc/cleantalk-settings.php:533
1006
- msgid "CleanTalk's tech support:"
1007
- msgstr ""
1008
-
1009
- #: inc/cleantalk-settings.php:539
1010
- msgid "Plugin Homepage at"
1011
- msgstr ""
1012
-
1013
- #: inc/cleantalk-settings.php:540
1014
- msgid "GDPR compliance"
1015
- msgstr ""
1016
-
1017
- #: inc/cleantalk-settings.php:541
1018
- msgid "Use s@cleantalk.org to test plugin in any WordPress form."
1019
- msgstr ""
1020
-
1021
- #: inc/cleantalk-settings.php:542
1022
- msgid "CleanTalk is registered Trademark. All rights reserved."
1023
- msgstr ""
1024
-
1025
- #: inc/cleantalk-settings.php:559
1026
- #, php-format
1027
- msgid "%s has blocked <b>%s</b> spam."
1028
- msgstr ""
1029
-
1030
- #: inc/cleantalk-settings.php:571
1031
- msgid "Click here to get anti-spam statistics"
1032
- msgstr ""
1033
-
1034
- #: inc/cleantalk-settings.php:614
1035
- #, php-format
1036
- msgid "Please, enter the %splugin settings%s in main site dashboard."
1037
- msgstr ""
1038
-
1039
- #: inc/cleantalk-settings.php:633
1040
- msgid "Error occured while API key validating. Error: "
1041
- msgstr ""
1042
-
1043
- #: inc/cleantalk-settings.php:634
1044
- msgid "Error occured while automatically gettings access key. Error: "
1045
- msgstr ""
1046
-
1047
- #: inc/cleantalk-settings.php:635
1048
- msgid "Error occured while sending sending SpamFireWall logs. Error: "
1049
- msgstr ""
1050
-
1051
- #: inc/cleantalk-settings.php:636
1052
- msgid "Error occured while updating SpamFireWall local base. Error: "
1053
- msgstr ""
1054
-
1055
- #: inc/cleantalk-settings.php:637
1056
- msgid "Error occured while checking account status. Error: "
1057
- msgstr ""
1058
-
1059
- #: inc/cleantalk-settings.php:638
1060
- msgid "Error occured while excuting API call. Error: "
1061
- msgstr ""
1062
-
1063
- #: inc/cleantalk-settings.php:646
1064
- msgid "Unknown error. Error: "
1065
- msgstr ""
1066
-
1067
- #: inc/cleantalk-settings.php:677
1068
- msgid "Errors:"
1069
- msgstr ""
1070
-
1071
- #: inc/cleantalk-settings.php:682
1072
- #, php-format
1073
- msgid "You can get support any time here: %s."
1074
- msgstr ""
1075
-
1076
- #: inc/cleantalk-settings.php:757
1077
- msgid "Protection is active"
1078
- msgstr ""
1079
-
1080
- #: inc/cleantalk-settings.php:759
1081
- msgid "Registration forms"
1082
- msgstr ""
1083
-
1084
- #: inc/cleantalk-settings.php:760
1085
- msgid "Comments forms"
1086
- msgstr ""
1087
-
1088
- #: inc/cleantalk-settings.php:765
1089
- msgid "Validate email for existence"
1090
- msgstr ""
1091
-
1092
- #: inc/cleantalk-settings.php:769
1093
- msgid "Auto update"
1094
- msgstr ""
1095
-
1096
- #: inc/cleantalk-settings.php:793
1097
- msgid "<h3>Key is provided by Super Admin.</h3>"
1098
- msgstr ""
1099
-
1100
- #: inc/cleantalk-settings.php:797
1101
- msgid "Access key"
1102
- msgstr ""
1103
-
1104
- #: inc/cleantalk-settings.php:812
1105
- msgid "Enter the key"
1106
- msgstr ""
1107
-
1108
- #: inc/cleantalk-settings.php:818
1109
- #, php-format
1110
- msgid "Account at cleantalk.org is %s."
1111
- msgstr ""
1112
-
1113
- #: inc/cleantalk-settings.php:827
1114
- msgid "Show the access key"
1115
- msgstr ""
1116
-
1117
- #: inc/cleantalk-settings.php:838
1118
- msgid "Get Access Key Automatically"
1119
- msgstr ""
1120
-
1121
- #: inc/cleantalk-settings.php:846
1122
- #, php-format
1123
- msgid ""
1124
- "Admin e-mail (%s) will be used for registration, if you want to use other "
1125
- "email please %sGet Access Key Manually%s."
1126
- msgstr ""
1127
-
1128
- #: inc/cleantalk-settings.php:862
1129
- #, php-format
1130
- msgid "I accept %sLicense Agreement%s."
1131
- msgstr ""
1132
-
1133
- #: inc/cleantalk-settings.php:888
1134
- msgid "Statistics & Reports"
1135
- msgstr ""
1136
-
1137
- #: inc/cleantalk-settings.php:904
1138
- #, php-format
1139
- msgid "Last spam check request to %s server was at %s."
1140
- msgstr ""
1141
-
1142
- #: inc/cleantalk-settings.php:905 inc/cleantalk-settings.php:906
1143
- #: inc/cleantalk-settings.php:915 inc/cleantalk-settings.php:922
1144
- #: inc/cleantalk-settings.php:923 inc/cleantalk-settings.php:931
1145
- #: inc/cleantalk-settings.php:932 inc/cleantalk-settings.php:939
1146
- #: inc/cleantalk-settings.php:940
1147
- msgid "unknown"
1148
- msgstr ""
1149
-
1150
- #: inc/cleantalk-settings.php:912
1151
- #, php-format
1152
- msgid "Average request time for past 7 days: %s seconds."
1153
- msgstr ""
1154
-
1155
- #: inc/cleantalk-settings.php:921
1156
- #, php-format
1157
- msgid "Last time SpamFireWall was triggered for %s IP at %s"
1158
- msgstr ""
1159
-
1160
- #: inc/cleantalk-settings.php:930
1161
- #, php-format
1162
- msgid "SpamFireWall was updated %s. Now contains %s entries."
1163
- msgstr ""
1164
-
1165
- #: inc/cleantalk-settings.php:938
1166
- #, php-format
1167
- msgid "SpamFireWall sent %s events at %s."
1168
- msgstr ""
1169
-
1170
- #: inc/cleantalk-settings.php:948
1171
- msgid "There are no failed connections to server."
1172
- msgstr ""
1173
-
1174
- #: inc/cleantalk-settings.php:975
1175
- msgid "Send report"
1176
- msgstr ""
1177
-
1178
- #: inc/cleantalk-settings.php:979
1179
- msgid ""
1180
- "Please, enable \"Send connection reports\" setting to be able to send reports"
1181
- msgstr ""
1182
-
1183
- #: inc/cleantalk-settings.php:1327
1184
- msgid "Testing is failed. Please check the Access key."
1185
- msgstr ""
1186
-
1187
- #: inc/cleantalk-settings.php:1442
1188
- msgid "XSS check"
1189
- msgstr ""
1190
-
1191
- #: inc/cleantalk-settings.php:1443
1192
- msgid ""
1193
- "Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to "
1194
- "any user. As a result malicious scripts can not get access to the cookie "
1195
- "files, session tokens and any other confidential information browsers use "
1196
- "and store. Such scripts can even overwrite content of HTML pages. CleanTalk "
1197
- "WAF monitors for patterns of these parameters and block them."
1198
- msgstr ""
1199
-
1200
- #: inc/cleantalk-settings.php:1446
1201
- msgid "SQL-injection check"
1202
- msgstr ""
1203
-
1204
- #: inc/cleantalk-settings.php:1447
1205
- msgid ""
1206
- "SQL Injection — one of the most popular ways to hack websites and programs "
1207
- "that work with databases. It is based on injection of a custom SQL code into "
1208
- "database queries. It could transmit data through GET, POST requests or "
1209
- "cookie files in an SQL code. If a website is vulnerable and execute such "
1210
- "injections then it would allow attackers to apply changes to the website's "
1211
- "MySQL database."
1212
- msgstr ""
1213
-
1214
- #: inc/cleantalk-settings.php:1450
1215
- msgid "Check uploaded files"
1216
- msgstr ""
1217
-
1218
- #: inc/cleantalk-settings.php:1451
1219
- msgid ""
1220
- "The option checks each uploaded file to a website for malicious code. If "
1221
- "it's possible for visitors to upload files to a website, for instance a work "
1222
- "resume, then attackers could abuse it and upload an infected file to execute "
1223
- "it later and get access to your website."
1224
- msgstr ""
1225
-
1226
- #: inc/cleantalk-users.php:15
1227
- msgid "Find spam users"
1228
- msgstr ""
1229
-
1230
- #: inc/cleantalk-users.php:67
1231
- msgid "Please wait for a while. CleanTalk is deleting spam users. Users left: "
1232
- msgstr ""
1233
-
1234
- #: inc/cleantalk-users.php:79
1235
- msgid ""
1236
- "The plugin will check all users against blacklists database and show you "
1237
- "senders that have spam activity on other websites."
1238
- msgstr ""
1239
-
1240
- #: inc/cleantalk-users.php:84
1241
- msgid ""
1242
- "Allows to use user's dates to perform more accurate check. Could seriously "
1243
- "slow down the check."
1244
- msgstr ""
1245
-
1246
- #: inc/cleantalk-users.php:108
1247
- msgid ""
1248
- "Please wait for a while. CleanTalk is checking all users via blacklist "
1249
- "database at cleantalk.org. You will have option to delete found spam users "
1250
- "after plugin finish."
1251
- msgstr ""
1252
-
1253
- #: inc/cleantalk-users.php:267
1254
- msgid "Delete all users from list"
1255
- msgstr ""
1256
-
1257
- #: inc/cleantalk-users.php:269
1258
- msgid "Download results in CSV"
1259
- msgstr ""
1260
-
1261
- #: inc/cleantalk-users.php:273
1262
- msgid "Insert accounts"
1263
- msgstr ""
1264
-
1265
- #: inc/cleantalk-users.php:274
1266
- msgid "Delete accounts"
1267
- msgstr ""
1268
-
1269
- #: inc/cleantalk-users.php:527
1270
- #, php-format
1271
- msgid ""
1272
- "Total users %s, checked %s, last check %s, found %s spam users and %s bad "
1273
- "users (without IP or email)"
1274
- msgstr ""
1275
-
1276
- #: inc/cleantalk-widget.php:22
1277
- msgid "CleanTalk Widget"
1278
- msgstr ""
1279
-
1280
- #: inc/cleantalk-widget.php:25
1281
- msgid "CleanTalk widget"
1282
- msgstr ""
1283
-
1284
- #: inc/cleantalk-widget.php:72
1285
- msgid "CleanTalk's main page"
1286
- msgstr ""
1287
-
1288
- #: inc/cleantalk-widget.php:73
1289
- msgid "spam"
1290
- msgstr ""
1291
-
1292
- #: inc/cleantalk-widget.php:73
1293
- msgid "blocked by"
1294
- msgstr ""
1295
-
1296
- #: inc/cleantalk-widget.php:85
1297
- msgid "Spam blocked"
1298
- msgstr ""
1299
-
1300
- #: inc/cleantalk-widget.php:90
1301
- msgid "Title:"
1302
- msgstr ""
1303
-
1304
- #: inc/cleantalk-widget.php:95
1305
- msgid "Style:"
1306
- msgstr ""
1307
-
1308
- #: inc/cleantalk-widget.php:97
1309
- msgid "CleanTalk's Style"
1310
- msgstr ""
1311
-
1312
- #: inc/cleantalk-widget.php:98
1313
- msgid "Light"
1314
- msgstr ""
1315
-
1316
- #: inc/cleantalk-widget.php:99
1317
- msgid "Extremely Light"
1318
- msgstr ""
1319
-
1320
- #: inc/cleantalk-widget.php:100
1321
- msgid "Dark"
1322
- msgstr ""
1323
-
1324
- #: inc/cleantalk-widget.php:105
1325
- msgid "Referal link ID:"
1326
- msgstr ""
1327
-
1328
- #: lib/CleantalkSFW.php:71
1329
- msgid "SpamFireWall is activated for your IP "
1330
- msgstr ""
1331
-
1332
- #: lib/CleantalkSFW.php:72
1333
- msgid ""
1334
- "To continue working with web site, please make sure that you have enabled "
1335
- "JavaScript."
1336
- msgstr ""
1337
-
1338
- #: lib/CleantalkSFW.php:73
1339
- msgid "Please click below to pass protection,"
1340
- msgstr ""
1341
-
1342
- #: lib/CleantalkSFW.php:74
1343
- #, php-format
1344
- msgid ""
1345
- "Or you will be automatically redirected to the requested page after %d "
1346
- "seconds."
1347
- msgstr ""
1348
-
1349
- #: lib/CleantalkSFW.php:75
1350
- msgid "Antispam by CleanTalk"
1351
- msgstr ""
1352
-
1353
- #: lib/CleantalkSFW.php:76
1354
- msgid "This is the testing page for SpamFireWall"
1355
- msgstr ""
1356
-
1357
- #: templates/translate_banner.php:6
1358
- msgid "Help others use the plugin in your language."
1359
- msgstr ""
1360
-
1361
- #: templates/translate_banner.php:7
1362
- msgid ""
1363
- "We ask you to help with the translation of the plugin in your language. "
1364
- "Please take a few minutes to make the plugin more comfortable."
1365
- msgstr ""
1366
-
1367
- #: templates/translate_banner.php:10
1368
- msgid "TRANSLATE"
1369
- msgstr ""
1370
-
1371
- #. Plugin Name of the plugin/theme
1372
- msgid "Anti-Spam by CleanTalk"
1373
- msgstr ""
1374
-
1375
- #. Description of the plugin/theme
1376
- msgid ""
1377
- "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam,"
1378
- " no registration spam, no contact spam, protects any WordPress forms."
1379
- msgstr ""
1380
-
1381
- #. Plugin URI of the plugin/theme
1382
- #. Author URI of the plugin/theme
1383
- msgid "http://cleantalk.org"
1384
- msgstr ""
1385
-
1386
- #. Author of the plugin/theme
1387
- msgid "СleanTalk <welcome@cleantalk.org>"
1388
- msgstr ""
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: Anti-Spam by CleanTalk\n"
6
+ "POT-Creation-Date: 2019-10-27 16:02+0000\n"
7
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Loco https://localise.biz/\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: cleantalk.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
22
+ "Language: "
23
+
24
+ #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
25
+ #: inc/cleantalk-users.php:15
26
+ msgid "Check for spam"
27
+ msgstr ""
28
+
29
+ #: inc/classCleantalkComments.php:33 inc/cleantalk-admin.php:350
30
+ #: inc/cleantalk-comments.php:16
31
+ msgid "Find spam comments"
32
+ msgstr ""
33
+
34
+ #: inc/classCleantalkComments.php:66 inc/cleantalk-comments.php:26
35
+ #: inc/cleantalk-users.php:25
36
+ msgid "Plugin Settings"
37
+ msgstr ""
38
+
39
+ #: inc/classCleantalkComments.php:76 inc/cleantalk-comments.php:35
40
+ #: inc/cleantalk-users.php:34
41
+ #, php-format
42
+ msgid ""
43
+ "Antispam hosting tariff does not allow you to use this feature. To do so, "
44
+ "you need to enter an Access Key in the %splugin settings%s."
45
+ msgstr ""
46
+
47
+ #: inc/classCleantalkComments.php:101 inc/cleantalk-comments.php:60
48
+ #: inc/cleantalk-users.php:60
49
+ msgid ""
50
+ "Ajax error. Process will be automatically restarted in 3 seconds. Status: "
51
+ msgstr ""
52
+
53
+ #: inc/classCleantalkComments.php:108 inc/cleantalk-comments.php:67
54
+ msgid ""
55
+ "Please wait for a while. CleanTalk is deleting spam comments. Comments left: "
56
+ msgstr ""
57
+
58
+ #: inc/classCleantalkComments.php:118 inc/cleantalk-comments.php:77
59
+ #: inc/cleantalk-users.php:77
60
+ msgid "Start check"
61
+ msgstr ""
62
+
63
+ #: inc/classCleantalkComments.php:119 inc/cleantalk-comments.php:78
64
+ #: inc/cleantalk-users.php:78
65
+ msgid "Continue check"
66
+ msgstr ""
67
+
68
+ #: inc/classCleantalkComments.php:120 inc/cleantalk-comments.php:79
69
+ msgid ""
70
+ "The plugin will check all comments against blacklists database and show you "
71
+ "senders that have spam activity on other websites."
72
+ msgstr ""
73
+
74
+ #: inc/classCleantalkComments.php:123 inc/cleantalk-comments.php:82
75
+ #: inc/cleantalk-users.php:82
76
+ msgid "Accurate check"
77
+ msgstr ""
78
+
79
+ #: inc/classCleantalkComments.php:125 inc/cleantalk-comments.php:84
80
+ msgid ""
81
+ "Allows to use comment's dates to perform more accurate check. Could "
82
+ "seriously slow down the check."
83
+ msgstr ""
84
+
85
+ #: inc/classCleantalkComments.php:128 inc/cleantalk-comments.php:87
86
+ #: inc/cleantalk-users.php:87
87
+ msgid "Specify date range"
88
+ msgstr ""
89
+
90
+ #: inc/classCleantalkComments.php:149 inc/cleantalk-comments.php:108
91
+ msgid ""
92
+ "Please wait! CleanTalk is checking all approved and pending comments via "
93
+ "blacklist database at cleantalk.org. You will have option to delete found "
94
+ "spam comments after plugin finish."
95
+ msgstr ""
96
+
97
+ #: inc/classCleantalkCommentsListTable.php:24
98
+ msgid "Author"
99
+ msgstr ""
100
+
101
+ #: inc/classCleantalkCommentsListTable.php:25 inc/cleantalk-comments.php:158
102
+ msgid "Comment"
103
+ msgstr ""
104
+
105
+ #: inc/classCleantalkCommentsListTable.php:26 inc/cleantalk-comments.php:159
106
+ msgid "In Response To"
107
+ msgstr ""
108
+
109
+ #: inc/classCleantalkCommentsListTable.php:33
110
+ msgid "No spam comments."
111
+ msgstr ""
112
+
113
+ #: inc/cleantalk-admin.php:27
114
+ #, php-format
115
+ msgid "Find spam %s"
116
+ msgstr ""
117
+
118
+ #: inc/cleantalk-admin.php:31
119
+ msgid "CleanTalk Anti-Spam Log"
120
+ msgstr ""
121
+
122
+ #: inc/cleantalk-admin.php:50
123
+ #, php-format
124
+ msgid "%sRefresh%s"
125
+ msgstr ""
126
+
127
+ #: inc/cleantalk-admin.php:51
128
+ #, php-format
129
+ msgid "%sConfigure%s"
130
+ msgstr ""
131
+
132
+ #: inc/cleantalk-admin.php:68
133
+ msgid "7 days anti-spam stats"
134
+ msgstr ""
135
+
136
+ #: inc/cleantalk-admin.php:72
137
+ msgid "Top 5 spam IPs blocked"
138
+ msgstr ""
139
+
140
+ #: inc/cleantalk-admin.php:78
141
+ msgid "Get Access key to activate Anti-Spam protection!"
142
+ msgstr ""
143
+
144
+ #: inc/cleantalk-admin.php:86
145
+ #, php-format
146
+ msgid "Something went wrong! Error: \"%s\"."
147
+ msgstr ""
148
+
149
+ #: inc/cleantalk-admin.php:90
150
+ msgid "Please, visit your dashboard."
151
+ msgstr ""
152
+
153
+ #: inc/cleantalk-admin.php:104
154
+ msgid "IP"
155
+ msgstr ""
156
+
157
+ #: inc/cleantalk-admin.php:105
158
+ msgid "Country"
159
+ msgstr ""
160
+
161
+ #: inc/cleantalk-admin.php:106
162
+ msgid "Block Count"
163
+ msgstr ""
164
+
165
+ #: inc/cleantalk-admin.php:134
166
+ #, php-format
167
+ msgid ""
168
+ "This is the count from the %s's cloud and could be different to admin bar "
169
+ "counters"
170
+ msgstr ""
171
+
172
+ #. %s: Number of spam messages
173
+ #: inc/cleantalk-admin.php:137
174
+ #, php-format
175
+ msgid ""
176
+ "%s%s%s has blocked %s spam for all time. The statistics are automatically "
177
+ "updated every 24 hours."
178
+ msgstr ""
179
+
180
+ #: inc/cleantalk-admin.php:148 inc/cleantalk-settings.php:544
181
+ #, php-format
182
+ msgid "Do you like CleanTalk? %sPost your feedback here%s."
183
+ msgstr ""
184
+
185
+ #: inc/cleantalk-admin.php:234
186
+ msgid "Translate"
187
+ msgstr ""
188
+
189
+ #: inc/cleantalk-admin.php:237
190
+ msgid "Start here"
191
+ msgstr ""
192
+
193
+ #: inc/cleantalk-admin.php:238
194
+ msgid "FAQ"
195
+ msgstr ""
196
+
197
+ #: inc/cleantalk-admin.php:239 inc/cleantalk-admin.php:644
198
+ #: inc/cleantalk-settings.php:575
199
+ msgid "Support"
200
+ msgstr ""
201
+
202
+ #: inc/cleantalk-admin.php:306 inc/cleantalk-settings.php:523
203
+ msgid "Hosting AntiSpam"
204
+ msgstr ""
205
+
206
+ #: inc/cleantalk-admin.php:333
207
+ msgid "Failed from timeout. Going to check comments again."
208
+ msgstr ""
209
+
210
+ #: inc/cleantalk-admin.php:334
211
+ msgid "Added"
212
+ msgstr ""
213
+
214
+ #: inc/cleantalk-admin.php:335 inc/cleantalk-admin.php:386
215
+ msgid "Deleted"
216
+ msgstr ""
217
+
218
+ #: inc/cleantalk-admin.php:336
219
+ msgid "comments"
220
+ msgstr ""
221
+
222
+ #: inc/cleantalk-admin.php:337
223
+ msgid "Delete all spam comments?"
224
+ msgstr ""
225
+
226
+ #: inc/cleantalk-admin.php:338
227
+ msgid "Delete checked comments?"
228
+ msgstr ""
229
+
230
+ #: inc/cleantalk-admin.php:339
231
+ #, php-format
232
+ msgid ""
233
+ "Total comments %s. Checked %s. Found %s spam comments. %s bad comments "
234
+ "(without IP or email)."
235
+ msgstr ""
236
+
237
+ #: inc/cleantalk-admin.php:340 inc/cleantalk-admin.php:393
238
+ #: inc/cleantalk-users.php:531
239
+ msgid "Please do backup of WordPress database before delete any accounts!"
240
+ msgstr ""
241
+
242
+ #: inc/cleantalk-admin.php:351
243
+ msgid "The sender has been whitelisted."
244
+ msgstr ""
245
+
246
+ #: inc/cleantalk-admin.php:352
247
+ msgid "The sender has been blacklisted."
248
+ msgstr ""
249
+
250
+ #: inc/cleantalk-admin.php:353 inc/cleantalk-public.php:3321
251
+ #, php-format
252
+ msgid "Feedback has been sent to %sCleanTalk Dashboard%s."
253
+ msgstr ""
254
+
255
+ #: inc/cleantalk-admin.php:383
256
+ msgid "Failed from timeout. Going to check users again."
257
+ msgstr ""
258
+
259
+ #: inc/cleantalk-admin.php:384
260
+ msgid "Failed from timeout. Going to run a new attempt to delete spam users."
261
+ msgstr ""
262
+
263
+ #: inc/cleantalk-admin.php:385
264
+ msgid "Inserted"
265
+ msgstr ""
266
+
267
+ #: inc/cleantalk-admin.php:387
268
+ msgid "users."
269
+ msgstr ""
270
+
271
+ #: inc/cleantalk-admin.php:388
272
+ msgid "Delete all spam users?"
273
+ msgstr ""
274
+
275
+ #: inc/cleantalk-admin.php:389
276
+ msgid "Delete checked users?"
277
+ msgstr ""
278
+
279
+ #: inc/cleantalk-admin.php:392
280
+ #, php-format
281
+ msgid ""
282
+ "Total users %s, checked %s, found %s spam users and %s bad users (without IP "
283
+ "or email)"
284
+ msgstr ""
285
+
286
+ #: inc/cleantalk-admin.php:401
287
+ msgid "Find spam-users"
288
+ msgstr ""
289
+
290
+ #: inc/cleantalk-admin.php:449
291
+ #, php-format
292
+ msgid "Unable to get Access key automatically: %s"
293
+ msgstr ""
294
+
295
+ #: inc/cleantalk-admin.php:450
296
+ msgid "Get the Access key"
297
+ msgstr ""
298
+
299
+ #: inc/cleantalk-admin.php:459
300
+ #, php-format
301
+ msgid "Please enter Access Key in %s settings to enable anti spam protection!"
302
+ msgstr ""
303
+
304
+ #: inc/cleantalk-admin.php:469
305
+ #, php-format
306
+ msgid "%s trial period ends, please upgrade to %s!"
307
+ msgstr ""
308
+
309
+ #: inc/cleantalk-admin.php:481
310
+ msgid "RENEW ANTI-SPAM"
311
+ msgstr ""
312
+
313
+ #: inc/cleantalk-admin.php:482
314
+ msgid "next year"
315
+ msgstr ""
316
+
317
+ #: inc/cleantalk-admin.php:486
318
+ #, php-format
319
+ msgid "Please renew your anti-spam license for %s."
320
+ msgstr ""
321
+
322
+ #: inc/cleantalk-admin.php:511
323
+ msgid "Make it right!"
324
+ msgstr ""
325
+
326
+ #: inc/cleantalk-admin.php:513
327
+ #, php-format
328
+ msgid "%sGet premium%s"
329
+ msgstr ""
330
+
331
+ #: inc/cleantalk-admin.php:552
332
+ msgid "Since"
333
+ msgstr ""
334
+
335
+ #: inc/cleantalk-admin.php:558
336
+ msgid ""
337
+ "All / Allowed / Blocked submissions. The number of submissions is being "
338
+ "counted since CleanTalk plugin installation."
339
+ msgstr ""
340
+
341
+ #: inc/cleantalk-admin.php:558
342
+ msgid "All"
343
+ msgstr ""
344
+
345
+ #: inc/cleantalk-admin.php:566
346
+ msgid ""
347
+ "Allowed / Blocked submissions. The number of submissions for past 24 hours. "
348
+ msgstr ""
349
+
350
+ #: inc/cleantalk-admin.php:566
351
+ msgid "Day"
352
+ msgstr ""
353
+
354
+ #: inc/cleantalk-admin.php:572
355
+ msgid ""
356
+ "All / Blocked events. Access attempts regitred by SpamFireWall counted since "
357
+ "the last plugin activation."
358
+ msgstr ""
359
+
360
+ #: inc/cleantalk-admin.php:582
361
+ msgid ""
362
+ "Allowed / Blocked submissions. The number of submissions is being counted "
363
+ "since "
364
+ msgstr ""
365
+
366
+ #: inc/cleantalk-admin.php:593
367
+ msgid "dashboard"
368
+ msgstr ""
369
+
370
+ #: inc/cleantalk-admin.php:600
371
+ msgid "Settings"
372
+ msgstr ""
373
+
374
+ #: inc/cleantalk-admin.php:608
375
+ msgid "Bulk spam comments removal tool."
376
+ msgstr ""
377
+
378
+ #: inc/cleantalk-admin.php:608 inc/cleantalk-settings.php:882
379
+ msgid "Check comments for spam"
380
+ msgstr ""
381
+
382
+ #: inc/cleantalk-admin.php:618 inc/cleantalk-settings.php:885
383
+ msgid "Check users for spam"
384
+ msgstr ""
385
+
386
+ #: inc/cleantalk-admin.php:627
387
+ msgid "Reset first counter"
388
+ msgstr ""
389
+
390
+ #: inc/cleantalk-admin.php:635
391
+ msgid "Reset all counters"
392
+ msgstr ""
393
+
394
+ #: inc/cleantalk-comments.php:221 inc/cleantalk-users.php:220
395
+ msgid "Approve"
396
+ msgstr ""
397
+
398
+ #: inc/cleantalk-comments.php:223 inc/cleantalk-users.php:222
399
+ msgid "Delete"
400
+ msgstr ""
401
+
402
+ #: inc/cleantalk-comments.php:265
403
+ msgid "Delete all comments from the list"
404
+ msgstr ""
405
+
406
+ #: inc/cleantalk-comments.php:266 inc/cleantalk-users.php:268
407
+ msgid "Delete selected"
408
+ msgstr ""
409
+
410
+ #: inc/cleantalk-comments.php:270
411
+ msgid "Insert comments"
412
+ msgstr ""
413
+
414
+ #: inc/cleantalk-comments.php:271
415
+ msgid "Delete comments"
416
+ msgstr ""
417
+
418
+ #: inc/cleantalk-comments.php:276 inc/cleantalk-users.php:279
419
+ msgid ""
420
+ "There is some differencies between blacklists database and our API "
421
+ "mechanisms. Blacklists shows all history of spam activity, but our API (that "
422
+ "used in spam checking) used another parameters, too: last day of activity, "
423
+ "number of spam attacks during last days etc. This mechanisms help us to "
424
+ "reduce number of false positivitie. So, there is nothing strange, if some "
425
+ "emails/IPs will be not found by this checking."
426
+ msgstr ""
427
+
428
+ #: inc/cleantalk-comments.php:281 inc/cleantalk-users.php:284
429
+ msgid "Stop deletion"
430
+ msgstr ""
431
+
432
+ #: inc/cleantalk-comments.php:495
433
+ #, php-format
434
+ msgid ""
435
+ "Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad "
436
+ "comments (without IP or email)."
437
+ msgstr ""
438
+
439
+ #: inc/cleantalk-comments.php:499
440
+ msgid "Please do backup of WordPress database before delete any comments!"
441
+ msgstr ""
442
+
443
+ #: inc/cleantalk-public.php:500 inc/cleantalk-public.php:641
444
+ #: inc/cleantalk-public.php:743 inc/cleantalk-public.php:2363
445
+ #: inc/cleantalk-public.php:3052
446
+ msgid "Spam protection by CleanTalk"
447
+ msgstr ""
448
+
449
+ #: inc/cleantalk-public.php:1233 inc/cleantalk-public.php:1361
450
+ #: inc/cleantalk-public.php:1379
451
+ msgid "Spam protection"
452
+ msgstr ""
453
+
454
+ #: inc/cleantalk-public.php:1332
455
+ msgid "CleanTalk AntiSpam: This message is possible spam."
456
+ msgstr ""
457
+
458
+ #: inc/cleantalk-public.php:1333
459
+ msgid "You could check it in CleanTalk's anti-spam database:"
460
+ msgstr ""
461
+
462
+ #: inc/cleantalk-public.php:1569
463
+ #, php-format
464
+ msgid "Registration approved by %s."
465
+ msgstr ""
466
+
467
+ #: inc/cleantalk-public.php:1849
468
+ msgid "CleanTalk AntiSpam: This registration is spam."
469
+ msgstr ""
470
+
471
+ #: inc/cleantalk-public.php:1850 inc/cleantalk-public.php:2219
472
+ #: inc/cleantalk-public.php:2387 inc/cleantalk-public.php:2542
473
+ msgid "CleanTalk's anti-spam database:"
474
+ msgstr ""
475
+
476
+ #: inc/cleantalk-public.php:2218 inc/cleantalk-public.php:2386
477
+ #: inc/cleantalk-public.php:2541
478
+ msgid "CleanTalk AntiSpam: This message is spam."
479
+ msgstr ""
480
+
481
+ #: inc/cleantalk-public.php:2666
482
+ msgid "Comment approved. Anti-spam by CleanTalk."
483
+ msgstr ""
484
+
485
+ #: inc/cleantalk-public.php:3219
486
+ msgid "Attention, please!"
487
+ msgstr ""
488
+
489
+ #: inc/cleantalk-public.php:3220
490
+ #, php-format
491
+ msgid "\"%s\" plugin error on your site \"%s\":"
492
+ msgstr ""
493
+
494
+ #: inc/cleantalk-public.php:3222
495
+ #, php-format
496
+ msgid "[%s] \"%s\" error!"
497
+ msgstr ""
498
+
499
+ #: inc/cleantalk-public.php:3271
500
+ msgid ""
501
+ "By using this form you agree with the storage and processing of your data by "
502
+ "using the Privacy Policy on this website."
503
+ msgstr ""
504
+
505
+ #: inc/cleantalk-public.php:3319
506
+ msgid "Error occured while sending feedback."
507
+ msgstr ""
508
+
509
+ #: inc/cleantalk-public.php:3320
510
+ msgid "Feedback wasn't sent. There is no associated request."
511
+ msgstr ""
512
+
513
+ #: inc/cleantalk-public.php:3364
514
+ msgid "Sender info"
515
+ msgstr ""
516
+
517
+ #: inc/cleantalk-public.php:3367
518
+ msgid "by"
519
+ msgstr ""
520
+
521
+ #: inc/cleantalk-public.php:3378
522
+ msgid "No email"
523
+ msgstr ""
524
+
525
+ #: inc/cleantalk-public.php:3388
526
+ msgid "No IP"
527
+ msgstr ""
528
+
529
+ #: inc/cleantalk-public.php:3391
530
+ msgid "Mark as spam"
531
+ msgstr ""
532
+
533
+ #: inc/cleantalk-public.php:3392
534
+ msgid "Unspam"
535
+ msgstr ""
536
+
537
+ #: inc/cleantalk-public.php:3394
538
+ msgid "Marked as spam."
539
+ msgstr ""
540
+
541
+ #: inc/cleantalk-public.php:3395
542
+ msgid "Marked as not spam."
543
+ msgstr ""
544
+
545
+ #: inc/cleantalk-settings.php:96
546
+ msgid "SpamFireWall"
547
+ msgstr ""
548
+
549
+ #: inc/cleantalk-settings.php:97
550
+ msgid ""
551
+ "This option allows to filter spam bots before they access website. Also "
552
+ "reduces CPU usage on hosting server and accelerates pages load time."
553
+ msgstr ""
554
+
555
+ #: inc/cleantalk-settings.php:104
556
+ msgid "Forms to protect"
557
+ msgstr ""
558
+
559
+ #: inc/cleantalk-settings.php:110
560
+ msgid "Advanced settings"
561
+ msgstr ""
562
+
563
+ #: inc/cleantalk-settings.php:117
564
+ msgid "Registration Forms"
565
+ msgstr ""
566
+
567
+ #: inc/cleantalk-settings.php:118
568
+ msgid "WordPress, BuddyPress, bbPress, S2Member, WooCommerce."
569
+ msgstr ""
570
+
571
+ #: inc/cleantalk-settings.php:121
572
+ msgid "Comments form"
573
+ msgstr ""
574
+
575
+ #: inc/cleantalk-settings.php:122
576
+ msgid "WordPress, JetPack, WooCommerce."
577
+ msgstr ""
578
+
579
+ #: inc/cleantalk-settings.php:125 inc/cleantalk-settings.php:761
580
+ msgid "Contact forms"
581
+ msgstr ""
582
+
583
+ #: inc/cleantalk-settings.php:126
584
+ msgid ""
585
+ "Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, "
586
+ "WordPress Landing Pages, Gravity Forms."
587
+ msgstr ""
588
+
589
+ #: inc/cleantalk-settings.php:129 inc/cleantalk-settings.php:762
590
+ msgid "Custom contact forms"
591
+ msgstr ""
592
+
593
+ #: inc/cleantalk-settings.php:130
594
+ msgid "Anti spam test for any WordPress themes or contacts forms."
595
+ msgstr ""
596
+
597
+ #: inc/cleantalk-settings.php:133 inc/cleantalk-settings.php:775
598
+ msgid "WooCommerce checkout form"
599
+ msgstr ""
600
+
601
+ #: inc/cleantalk-settings.php:134
602
+ msgid "Anti spam test for WooCommerce checkout form."
603
+ msgstr ""
604
+
605
+ #: inc/cleantalk-settings.php:138
606
+ msgid "Spam test for registration during checkout"
607
+ msgstr ""
608
+
609
+ #: inc/cleantalk-settings.php:139
610
+ msgid ""
611
+ "Enable anti spam test for registration process which during woocommerce's "
612
+ "checkout."
613
+ msgstr ""
614
+
615
+ #: inc/cleantalk-settings.php:145
616
+ msgid "Test default Wordpress search form for spam"
617
+ msgstr ""
618
+
619
+ #: inc/cleantalk-settings.php:146
620
+ msgid "Spam protection for Search form."
621
+ msgstr ""
622
+
623
+ #: inc/cleantalk-settings.php:148
624
+ #, php-format
625
+ msgid "Read more about %sspam protection for Search form%s on our blog."
626
+ msgstr ""
627
+
628
+ #: inc/cleantalk-settings.php:156
629
+ msgid "Protect external forms"
630
+ msgstr ""
631
+
632
+ #: inc/cleantalk-settings.php:157
633
+ msgid ""
634
+ "Turn this option on to protect forms on your WordPress that send data to "
635
+ "third-part servers (like MailChimp)."
636
+ msgstr ""
637
+
638
+ #: inc/cleantalk-settings.php:161
639
+ msgid "Capture buffer"
640
+ msgstr ""
641
+
642
+ #: inc/cleantalk-settings.php:162
643
+ msgid ""
644
+ "This setting gives you more sophisticated and strengthened protection for "
645
+ "external forms. But it could break plugins which use a buffer like Ninja "
646
+ "Forms."
647
+ msgstr ""
648
+
649
+ #: inc/cleantalk-settings.php:167
650
+ msgid "Protect internal forms"
651
+ msgstr ""
652
+
653
+ #: inc/cleantalk-settings.php:168
654
+ msgid ""
655
+ "This option will enable protection for custom (hand-made) AJAX forms with "
656
+ "PHP scripts handlers on your WordPress."
657
+ msgstr ""
658
+
659
+ #: inc/cleantalk-settings.php:175
660
+ msgid "Comments and Messages"
661
+ msgstr ""
662
+
663
+ #: inc/cleantalk-settings.php:178
664
+ msgid "BuddyPress Private Messages"
665
+ msgstr ""
666
+
667
+ #: inc/cleantalk-settings.php:179
668
+ msgid "Check buddyPress private messages."
669
+ msgstr ""
670
+
671
+ #: inc/cleantalk-settings.php:182
672
+ msgid "Don't check trusted user's comments"
673
+ msgstr ""
674
+
675
+ #: inc/cleantalk-settings.php:183
676
+ #, php-format
677
+ msgid "Don't check comments for users with above %d comments."
678
+ msgstr ""
679
+
680
+ #: inc/cleantalk-settings.php:186
681
+ msgid "Automatically delete spam comments"
682
+ msgstr ""
683
+
684
+ #: inc/cleantalk-settings.php:187
685
+ #, php-format
686
+ msgid "Delete spam comments older than %d days."
687
+ msgstr ""
688
+
689
+ #: inc/cleantalk-settings.php:190
690
+ msgid "Remove links from approved comments"
691
+ msgstr ""
692
+
693
+ #: inc/cleantalk-settings.php:191
694
+ msgid "Remove links from approved comments. Replace it with \"[Link deleted]\""
695
+ msgstr ""
696
+
697
+ #: inc/cleantalk-settings.php:194
698
+ msgid "Show links to check Emails, IPs for spam."
699
+ msgstr ""
700
+
701
+ #: inc/cleantalk-settings.php:195
702
+ msgid ""
703
+ "Shows little icon near IP addresses and Emails allowing you to check it via "
704
+ "CleanTalk's database. Also allowing you to manage comments from the public "
705
+ "post's page."
706
+ msgstr ""
707
+
708
+ #: inc/cleantalk-settings.php:203
709
+ msgid "Data Processing"
710
+ msgstr ""
711
+
712
+ #: inc/cleantalk-settings.php:206
713
+ msgid "Protect logged in Users"
714
+ msgstr ""
715
+
716
+ #: inc/cleantalk-settings.php:207
717
+ msgid ""
718
+ "Turn this option on to check for spam any submissions (comments, contact "
719
+ "forms and etc.) from registered Users."
720
+ msgstr ""
721
+
722
+ #: inc/cleantalk-settings.php:210
723
+ msgid "Use AJAX for JavaScript check"
724
+ msgstr ""
725
+
726
+ #: inc/cleantalk-settings.php:211
727
+ msgid ""
728
+ "Options helps protect WordPress against spam with any caching plugins. Turn "
729
+ "this option on to avoid issues with caching plugins."
730
+ msgstr ""
731
+
732
+ #: inc/cleantalk-settings.php:214
733
+ msgid "Use static keys for JS check."
734
+ msgstr ""
735
+
736
+ #: inc/cleantalk-settings.php:215
737
+ msgid ""
738
+ "Could help if you have cache for AJAX requests and you are dealing with "
739
+ "false positives. Slightly decreases protection quality. Auto - Static key "
740
+ "will be used if caching plugin is spotted."
741
+ msgstr ""
742
+
743
+ #: inc/cleantalk-settings.php:223
744
+ msgid "Check all post data"
745
+ msgstr ""
746
+
747
+ #: inc/cleantalk-settings.php:224
748
+ msgid ""
749
+ "Check all POST submissions from website visitors. Enable this option if you "
750
+ "have spam misses on website."
751
+ msgstr ""
752
+
753
+ #: inc/cleantalk-settings.php:226
754
+ msgid " Or you don`t have records about missed spam here:"
755
+ msgstr ""
756
+
757
+ #: inc/cleantalk-settings.php:226
758
+ msgid "CleanTalk dashboard"
759
+ msgstr ""
760
+
761
+ #: inc/cleantalk-settings.php:229
762
+ msgid "СAUTION! Option can catch POST requests in WordPress backend"
763
+ msgstr ""
764
+
765
+ #: inc/cleantalk-settings.php:232
766
+ msgid "Set cookies"
767
+ msgstr ""
768
+
769
+ #: inc/cleantalk-settings.php:233
770
+ msgid ""
771
+ "Turn this option off to deny plugin generates any cookies on website front-"
772
+ "end. This option is helpful if you use Varnish. But most of contact forms "
773
+ "will not be protected if the option is turned off! <b>Warning: We strongly "
774
+ "recommend you to enable this otherwise it could cause false positives spam "
775
+ "detection.</b>"
776
+ msgstr ""
777
+
778
+ #: inc/cleantalk-settings.php:237
779
+ msgid "Use alternative mechanism for cookies"
780
+ msgstr ""
781
+
782
+ #: inc/cleantalk-settings.php:238 inc/cleantalk-settings.php:360
783
+ msgid "Doesn't use cookie or PHP sessions. Collect data for all types of bots."
784
+ msgstr ""
785
+
786
+ #: inc/cleantalk-settings.php:243
787
+ msgid "Use SSL"
788
+ msgstr ""
789
+
790
+ #: inc/cleantalk-settings.php:244
791
+ msgid "Turn this option on to use encrypted (SSL) connection with servers."
792
+ msgstr ""
793
+
794
+ #: inc/cleantalk-settings.php:247
795
+ msgid "Use Wordpress HTTP API"
796
+ msgstr ""
797
+
798
+ #: inc/cleantalk-settings.php:248
799
+ msgid ""
800
+ "Alternative way to connect the Cloud. Use this if you have connection "
801
+ "problems."
802
+ msgstr ""
803
+
804
+ #: inc/cleantalk-settings.php:255
805
+ msgid "Exclusions"
806
+ msgstr ""
807
+
808
+ #: inc/cleantalk-settings.php:259
809
+ msgid "URL exclusions"
810
+ msgstr ""
811
+
812
+ #: inc/cleantalk-settings.php:260
813
+ msgid "You could type here URL you want to exclude. Use comma as separator."
814
+ msgstr ""
815
+
816
+ #: inc/cleantalk-settings.php:264
817
+ msgid "Use Regular Expression in URL Exclusions"
818
+ msgstr ""
819
+
820
+ #: inc/cleantalk-settings.php:268
821
+ msgid "Field name exclusions"
822
+ msgstr ""
823
+
824
+ #: inc/cleantalk-settings.php:269
825
+ msgid ""
826
+ "You could type here fields names you want to exclude. Use comma as separator."
827
+ msgstr ""
828
+
829
+ #: inc/cleantalk-settings.php:273
830
+ msgid "Use Regular Expression in Field Exclusions"
831
+ msgstr ""
832
+
833
+ #: inc/cleantalk-settings.php:280
834
+ msgid "Roles which bypass spam test. Hold CTRL to select multiple roles."
835
+ msgstr ""
836
+
837
+ #: inc/cleantalk-settings.php:287
838
+ msgid "Admin bar"
839
+ msgstr ""
840
+
841
+ #: inc/cleantalk-settings.php:294
842
+ msgid "Show statistics in admin bar"
843
+ msgstr ""
844
+
845
+ #: inc/cleantalk-settings.php:295
846
+ msgid ""
847
+ "Show/hide icon in top level menu in WordPress backend. The number of "
848
+ "submissions is being counted for past 24 hours."
849
+ msgstr ""
850
+
851
+ #: inc/cleantalk-settings.php:299
852
+ msgid "Show All-time counter"
853
+ msgstr ""
854
+
855
+ #: inc/cleantalk-settings.php:300
856
+ msgid ""
857
+ "Display all-time requests counter in the admin bar. Counter displays number "
858
+ "of requests since plugin installation."
859
+ msgstr ""
860
+
861
+ #: inc/cleantalk-settings.php:305
862
+ msgid "Show 24 hours counter"
863
+ msgstr ""
864
+
865
+ #: inc/cleantalk-settings.php:306
866
+ msgid ""
867
+ "Display daily requests counter in the admin bar. Counter displays number of "
868
+ "requests of the past 24 hours."
869
+ msgstr ""
870
+
871
+ #: inc/cleantalk-settings.php:311
872
+ msgid "SpamFireWall counter"
873
+ msgstr ""
874
+
875
+ #: inc/cleantalk-settings.php:312
876
+ msgid ""
877
+ "Display SpamFireWall requests in the admin bar. Counter displays number of "
878
+ "requests since plugin installation."
879
+ msgstr ""
880
+
881
+ #: inc/cleantalk-settings.php:325
882
+ msgid "Collect details about browsers"
883
+ msgstr ""
884
+
885
+ #: inc/cleantalk-settings.php:326
886
+ msgid ""
887
+ "Checking this box you allow plugin store information about screen size and "
888
+ "browser plugins of website visitors. The option in a beta state."
889
+ msgstr ""
890
+
891
+ #: inc/cleantalk-settings.php:330
892
+ msgid "Send connection reports"
893
+ msgstr ""
894
+
895
+ #: inc/cleantalk-settings.php:331
896
+ msgid ""
897
+ "Checking this box you allow plugin to send the information about your "
898
+ "connection. The option in a beta state."
899
+ msgstr ""
900
+
901
+ #: inc/cleantalk-settings.php:335
902
+ msgid "Async JavaScript loading"
903
+ msgstr ""
904
+
905
+ #: inc/cleantalk-settings.php:336
906
+ msgid ""
907
+ "Use async loading for scripts. Warning: This could reduce filtration quality."
908
+ msgstr ""
909
+
910
+ #: inc/cleantalk-settings.php:340
911
+ msgid "Allow to add GDPR notice via shortcode"
912
+ msgstr ""
913
+
914
+ #: inc/cleantalk-settings.php:341
915
+ msgid ""
916
+ " Adds small checkbox under your website form. To add it you should use the "
917
+ "shortcode on the form's page: [cleantalk_gdpr_form id=\"FORM_ID\"]"
918
+ msgstr ""
919
+
920
+ #: inc/cleantalk-settings.php:346
921
+ msgid "GDPR text notice"
922
+ msgstr ""
923
+
924
+ #: inc/cleantalk-settings.php:347
925
+ msgid "This text will be added as a description to the GDPR checkbox."
926
+ msgstr ""
927
+
928
+ #: inc/cleantalk-settings.php:353
929
+ msgid "Store visited URLs"
930
+ msgstr ""
931
+
932
+ #: inc/cleantalk-settings.php:354
933
+ msgid ""
934
+ "Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits "
935
+ "form on the site. You can see stored visited URLS for each visitor in your "
936
+ "Dashboard. Turn the option on to improve Anti-Spam protection."
937
+ msgstr ""
938
+
939
+ #: inc/cleantalk-settings.php:359
940
+ msgid "Use cookies less sessions"
941
+ msgstr ""
942
+
943
+ #: inc/cleantalk-settings.php:366
944
+ msgid ""
945
+ "Notify users with selected roles about new approved comments. Hold CTRL to "
946
+ "select multiple roles."
947
+ msgstr ""
948
+
949
+ #: inc/cleantalk-settings.php:367
950
+ #, php-format
951
+ msgid "If enabled, overrides similar Wordpress %sdiscussion settings%s."
952
+ msgstr ""
953
+
954
+ #: inc/cleantalk-settings.php:380
955
+ msgid "Complete deactivation"
956
+ msgstr ""
957
+
958
+ #: inc/cleantalk-settings.php:381
959
+ msgid "Leave no trace in the system after deactivation."
960
+ msgstr ""
961
+
962
+ #: inc/cleantalk-settings.php:398
963
+ msgid "Enable White Label Mode"
964
+ msgstr ""
965
+
966
+ #: inc/cleantalk-settings.php:399
967
+ #, php-format
968
+ msgid "Learn more information %shere%s."
969
+ msgstr ""
970
+
971
+ #: inc/cleantalk-settings.php:404
972
+ msgid "Hoster API Key"
973
+ msgstr ""
974
+
975
+ #: inc/cleantalk-settings.php:405
976
+ #, php-format
977
+ msgid "You can get it in %sCleantalk's Control Panel%s"
978
+ msgstr ""
979
+
980
+ #: inc/cleantalk-settings.php:413
981
+ msgid "Plugin name"
982
+ msgstr ""
983
+
984
+ #: inc/cleantalk-settings.php:414
985
+ #, php-format
986
+ msgid "Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s"
987
+ msgstr ""
988
+
989
+ #: inc/cleantalk-settings.php:423
990
+ msgid "Allow users to use other key"
991
+ msgstr ""
992
+
993
+ #: inc/cleantalk-settings.php:424
994
+ msgid ""
995
+ "Allow users to use different Access key in their plugin settings on child "
996
+ "blogs. They could use different CleanTalk account."
997
+ msgstr ""
998
+
999
+ #: inc/cleantalk-settings.php:427
1000
+ msgid ""
1001
+ "Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key "
1002
+ "from this constant. Look into wp-config.php"
1003
+ msgstr ""
1004
+
1005
+ #: inc/cleantalk-settings.php:533
1006
+ msgid "CleanTalk's tech support:"
1007
+ msgstr ""
1008
+
1009
+ #: inc/cleantalk-settings.php:539
1010
+ msgid "Plugin Homepage at"
1011
+ msgstr ""
1012
+
1013
+ #: inc/cleantalk-settings.php:540
1014
+ msgid "GDPR compliance"
1015
+ msgstr ""
1016
+
1017
+ #: inc/cleantalk-settings.php:541
1018
+ msgid "Use s@cleantalk.org to test plugin in any WordPress form."
1019
+ msgstr ""
1020
+
1021
+ #: inc/cleantalk-settings.php:542
1022
+ msgid "CleanTalk is registered Trademark. All rights reserved."
1023
+ msgstr ""
1024
+
1025
+ #: inc/cleantalk-settings.php:559
1026
+ #, php-format
1027
+ msgid "%s has blocked <b>%s</b> spam."
1028
+ msgstr ""
1029
+
1030
+ #: inc/cleantalk-settings.php:571
1031
+ msgid "Click here to get anti-spam statistics"
1032
+ msgstr ""
1033
+
1034
+ #: inc/cleantalk-settings.php:614
1035
+ #, php-format
1036
+ msgid "Please, enter the %splugin settings%s in main site dashboard."
1037
+ msgstr ""
1038
+
1039
+ #: inc/cleantalk-settings.php:633
1040
+ msgid "Error occured while API key validating. Error: "
1041
+ msgstr ""
1042
+
1043
+ #: inc/cleantalk-settings.php:634
1044
+ msgid "Error occured while automatically gettings access key. Error: "
1045
+ msgstr ""
1046
+
1047
+ #: inc/cleantalk-settings.php:635
1048
+ msgid "Error occured while sending sending SpamFireWall logs. Error: "
1049
+ msgstr ""
1050
+
1051
+ #: inc/cleantalk-settings.php:636
1052
+ msgid "Error occured while updating SpamFireWall local base. Error: "
1053
+ msgstr ""
1054
+
1055
+ #: inc/cleantalk-settings.php:637
1056
+ msgid "Error occured while checking account status. Error: "
1057
+ msgstr ""
1058
+
1059
+ #: inc/cleantalk-settings.php:638
1060
+ msgid "Error occured while excuting API call. Error: "
1061
+ msgstr ""
1062
+
1063
+ #: inc/cleantalk-settings.php:646
1064
+ msgid "Unknown error. Error: "
1065
+ msgstr ""
1066
+
1067
+ #: inc/cleantalk-settings.php:677
1068
+ msgid "Errors:"
1069
+ msgstr ""
1070
+
1071
+ #: inc/cleantalk-settings.php:682
1072
+ #, php-format
1073
+ msgid "You can get support any time here: %s."
1074
+ msgstr ""
1075
+
1076
+ #: inc/cleantalk-settings.php:757
1077
+ msgid "Protection is active"
1078
+ msgstr ""
1079
+
1080
+ #: inc/cleantalk-settings.php:759
1081
+ msgid "Registration forms"
1082
+ msgstr ""
1083
+
1084
+ #: inc/cleantalk-settings.php:760
1085
+ msgid "Comments forms"
1086
+ msgstr ""
1087
+
1088
+ #: inc/cleantalk-settings.php:765
1089
+ msgid "Validate email for existence"
1090
+ msgstr ""
1091
+
1092
+ #: inc/cleantalk-settings.php:769
1093
+ msgid "Auto update"
1094
+ msgstr ""
1095
+
1096
+ #: inc/cleantalk-settings.php:793
1097
+ msgid "<h3>Key is provided by Super Admin.</h3>"
1098
+ msgstr ""
1099
+
1100
+ #: inc/cleantalk-settings.php:797
1101
+ msgid "Access key"
1102
+ msgstr ""
1103
+
1104
+ #: inc/cleantalk-settings.php:812
1105
+ msgid "Enter the key"
1106
+ msgstr ""
1107
+
1108
+ #: inc/cleantalk-settings.php:818
1109
+ #, php-format
1110
+ msgid "Account at cleantalk.org is %s."
1111
+ msgstr ""
1112
+
1113
+ #: inc/cleantalk-settings.php:827
1114
+ msgid "Show the access key"
1115
+ msgstr ""
1116
+
1117
+ #: inc/cleantalk-settings.php:838
1118
+ msgid "Get Access Key Automatically"
1119
+ msgstr ""
1120
+
1121
+ #: inc/cleantalk-settings.php:846
1122
+ #, php-format
1123
+ msgid ""
1124
+ "Admin e-mail (%s) will be used for registration, if you want to use other "
1125
+ "email please %sGet Access Key Manually%s."
1126
+ msgstr ""
1127
+
1128
+ #: inc/cleantalk-settings.php:862
1129
+ #, php-format
1130
+ msgid "I accept %sLicense Agreement%s."
1131
+ msgstr ""
1132
+
1133
+ #: inc/cleantalk-settings.php:888
1134
+ msgid "Statistics & Reports"
1135
+ msgstr ""
1136
+
1137
+ #: inc/cleantalk-settings.php:904
1138
+ #, php-format
1139
+ msgid "Last spam check request to %s server was at %s."
1140
+ msgstr ""
1141
+
1142
+ #: inc/cleantalk-settings.php:905 inc/cleantalk-settings.php:906
1143
+ #: inc/cleantalk-settings.php:915 inc/cleantalk-settings.php:922
1144
+ #: inc/cleantalk-settings.php:923 inc/cleantalk-settings.php:931
1145
+ #: inc/cleantalk-settings.php:932 inc/cleantalk-settings.php:939
1146
+ #: inc/cleantalk-settings.php:940
1147
+ msgid "unknown"
1148
+ msgstr ""
1149
+
1150
+ #: inc/cleantalk-settings.php:912
1151
+ #, php-format
1152
+ msgid "Average request time for past 7 days: %s seconds."
1153
+ msgstr ""
1154
+
1155
+ #: inc/cleantalk-settings.php:921
1156
+ #, php-format
1157
+ msgid "Last time SpamFireWall was triggered for %s IP at %s"
1158
+ msgstr ""
1159
+
1160
+ #: inc/cleantalk-settings.php:930
1161
+ #, php-format
1162
+ msgid "SpamFireWall was updated %s. Now contains %s entries."
1163
+ msgstr ""
1164
+
1165
+ #: inc/cleantalk-settings.php:938
1166
+ #, php-format
1167
+ msgid "SpamFireWall sent %s events at %s."
1168
+ msgstr ""
1169
+
1170
+ #: inc/cleantalk-settings.php:948
1171
+ msgid "There are no failed connections to server."
1172
+ msgstr ""
1173
+
1174
+ #: inc/cleantalk-settings.php:975
1175
+ msgid "Send report"
1176
+ msgstr ""
1177
+
1178
+ #: inc/cleantalk-settings.php:979
1179
+ msgid ""
1180
+ "Please, enable \"Send connection reports\" setting to be able to send reports"
1181
+ msgstr ""
1182
+
1183
+ #: inc/cleantalk-settings.php:1327
1184
+ msgid "Testing is failed. Please check the Access key."
1185
+ msgstr ""
1186
+
1187
+ #: inc/cleantalk-settings.php:1442
1188
+ msgid "XSS check"
1189
+ msgstr ""
1190
+
1191
+ #: inc/cleantalk-settings.php:1443
1192
+ msgid ""
1193
+ "Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to "
1194
+ "any user. As a result malicious scripts can not get access to the cookie "
1195
+ "files, session tokens and any other confidential information browsers use "
1196
+ "and store. Such scripts can even overwrite content of HTML pages. CleanTalk "
1197
+ "WAF monitors for patterns of these parameters and block them."
1198
+ msgstr ""
1199
+
1200
+ #: inc/cleantalk-settings.php:1446
1201
+ msgid "SQL-injection check"
1202
+ msgstr ""
1203
+
1204
+ #: inc/cleantalk-settings.php:1447
1205
+ msgid ""
1206
+ "SQL Injection — one of the most popular ways to hack websites and programs "
1207
+ "that work with databases. It is based on injection of a custom SQL code into "
1208
+ "database queries. It could transmit data through GET, POST requests or "
1209
+ "cookie files in an SQL code. If a website is vulnerable and execute such "
1210
+ "injections then it would allow attackers to apply changes to the website's "
1211
+ "MySQL database."
1212
+ msgstr ""
1213
+
1214
+ #: inc/cleantalk-settings.php:1450
1215
+ msgid "Check uploaded files"
1216
+ msgstr ""
1217
+
1218
+ #: inc/cleantalk-settings.php:1451
1219
+ msgid ""
1220
+ "The option checks each uploaded file to a website for malicious code. If "
1221
+ "it's possible for visitors to upload files to a website, for instance a work "
1222
+ "resume, then attackers could abuse it and upload an infected file to execute "
1223
+ "it later and get access to your website."
1224
+ msgstr ""
1225
+
1226
+ #: inc/cleantalk-users.php:15
1227
+ msgid "Find spam users"
1228
+ msgstr ""
1229
+
1230
+ #: inc/cleantalk-users.php:67
1231
+ msgid "Please wait for a while. CleanTalk is deleting spam users. Users left: "
1232
+ msgstr ""
1233
+
1234
+ #: inc/cleantalk-users.php:79
1235
+ msgid ""
1236
+ "The plugin will check all users against blacklists database and show you "
1237
+ "senders that have spam activity on other websites."
1238
+ msgstr ""
1239
+
1240
+ #: inc/cleantalk-users.php:84
1241
+ msgid ""
1242
+ "Allows to use user's dates to perform more accurate check. Could seriously "
1243
+ "slow down the check."
1244
+ msgstr ""
1245
+
1246
+ #: inc/cleantalk-users.php:108
1247
+ msgid ""
1248
+ "Please wait for a while. CleanTalk is checking all users via blacklist "
1249
+ "database at cleantalk.org. You will have option to delete found spam users "
1250
+ "after plugin finish."
1251
+ msgstr ""
1252
+
1253
+ #: inc/cleantalk-users.php:267
1254
+ msgid "Delete all users from list"
1255
+ msgstr ""
1256
+
1257
+ #: inc/cleantalk-users.php:269
1258
+ msgid "Download results in CSV"
1259
+ msgstr ""
1260
+
1261
+ #: inc/cleantalk-users.php:273
1262
+ msgid "Insert accounts"
1263
+ msgstr ""
1264
+
1265
+ #: inc/cleantalk-users.php:274
1266
+ msgid "Delete accounts"
1267
+ msgstr ""
1268
+
1269
+ #: inc/cleantalk-users.php:527
1270
+ #, php-format
1271
+ msgid ""
1272
+ "Total users %s, checked %s, last check %s, found %s spam users and %s bad "
1273
+ "users (without IP or email)"
1274
+ msgstr ""
1275
+
1276
+ #: inc/cleantalk-widget.php:22
1277
+ msgid "CleanTalk Widget"
1278
+ msgstr ""
1279
+
1280
+ #: inc/cleantalk-widget.php:25
1281
+ msgid "CleanTalk widget"
1282
+ msgstr ""
1283
+
1284
+ #: inc/cleantalk-widget.php:72
1285
+ msgid "CleanTalk's main page"
1286
+ msgstr ""
1287
+
1288
+ #: inc/cleantalk-widget.php:73
1289
+ msgid "spam"
1290
+ msgstr ""
1291
+
1292
+ #: inc/cleantalk-widget.php:73
1293
+ msgid "blocked by"
1294
+ msgstr ""
1295
+
1296
+ #: inc/cleantalk-widget.php:85
1297
+ msgid "Spam blocked"
1298
+ msgstr ""
1299
+
1300
+ #: inc/cleantalk-widget.php:90
1301
+ msgid "Title:"
1302
+ msgstr ""
1303
+
1304
+ #: inc/cleantalk-widget.php:95
1305
+ msgid "Style:"
1306
+ msgstr ""
1307
+
1308
+ #: inc/cleantalk-widget.php:97
1309
+ msgid "CleanTalk's Style"
1310
+ msgstr ""
1311
+
1312
+ #: inc/cleantalk-widget.php:98
1313
+ msgid "Light"
1314
+ msgstr ""
1315
+
1316
+ #: inc/cleantalk-widget.php:99
1317
+ msgid "Extremely Light"
1318
+ msgstr ""
1319
+
1320
+ #: inc/cleantalk-widget.php:100
1321
+ msgid "Dark"
1322
+ msgstr ""
1323
+
1324
+ #: inc/cleantalk-widget.php:105
1325
+ msgid "Referal link ID:"
1326
+ msgstr ""
1327
+
1328
+ #: lib/CleantalkSFW.php:71
1329
+ msgid "SpamFireWall is activated for your IP "
1330
+ msgstr ""
1331
+
1332
+ #: lib/CleantalkSFW.php:72
1333
+ msgid ""
1334
+ "To continue working with web site, please make sure that you have enabled "
1335
+ "JavaScript."
1336
+ msgstr ""
1337
+
1338
+ #: lib/CleantalkSFW.php:73
1339
+ msgid "Please click below to pass protection,"
1340
+ msgstr ""
1341
+
1342
+ #: lib/CleantalkSFW.php:74
1343
+ #, php-format
1344
+ msgid ""
1345
+ "Or you will be automatically redirected to the requested page after %d "
1346
+ "seconds."
1347
+ msgstr ""
1348
+
1349
+ #: lib/CleantalkSFW.php:75
1350
+ msgid "Antispam by CleanTalk"
1351
+ msgstr ""
1352
+
1353
+ #: lib/CleantalkSFW.php:76
1354
+ msgid "This is the testing page for SpamFireWall"
1355
+ msgstr ""
1356
+
1357
+ #: templates/translate_banner.php:6
1358
+ msgid "Help others use the plugin in your language."
1359
+ msgstr ""
1360
+
1361
+ #: templates/translate_banner.php:7
1362
+ msgid ""
1363
+ "We ask you to help with the translation of the plugin in your language. "
1364
+ "Please take a few minutes to make the plugin more comfortable."
1365
+ msgstr ""
1366
+
1367
+ #: templates/translate_banner.php:10
1368
+ msgid "TRANSLATE"
1369
+ msgstr ""
1370
+
1371
+ #. Plugin Name of the plugin/theme
1372
+ msgid "Anti-Spam by CleanTalk"
1373
+ msgstr ""
1374
+
1375
+ #. Description of the plugin/theme
1376
+ msgid ""
1377
+ "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam,"
1378
+ " no registration spam, no contact spam, protects any WordPress forms."
1379
+ msgstr ""
1380
+
1381
+ #. Plugin URI of the plugin/theme
1382
+ #. Author URI of the plugin/theme
1383
+ msgid "http://cleantalk.org"
1384
+ msgstr ""
1385
+
1386
+ #. Author of the plugin/theme
1387
+ msgid "СleanTalk <welcome@cleantalk.org>"
1388
+ msgstr ""
inc/classCleantalkAdmin.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
-
4
- class classCleantalkAdmin {
5
-
6
- /**
7
- * Flag: hooks was initiated or not
8
- */
9
- private static $launched = false;
10
-
11
- /**
12
- * Init method
13
- * Launched once by 'init' wp hook
14
- */
15
- public static function init()
16
- {
17
-
18
- if ( ! self::$launched ) {
19
- self::init_hooks();
20
- }
21
-
22
- }
23
-
24
- /**
25
- * Plugging Up WordPress hooks
26
- * Contains native WP functionality and Integrations
27
- */
28
- private static function init_hooks()
29
- {
30
-
31
- self::$launched = true;
32
-
33
- // Admin side hooks will be placed here
34
- }
35
-
36
- /**
37
- * Methods accepted by public hooks in init_hooks()
38
- * The methods have to be staic
39
- */
40
-
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/classCleantalkPublic.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
-
3
-
4
- class classCleantalkPublic {
5
-
6
- /**
7
- * Flag: hooks was initiated or not
8
- */
9
- private static $launched = false;
10
-
11
- private static $apbct;
12
-
13
- /**
14
- * Init method
15
- * Launched once by 'init' wp hook
16
- */
17
- public static function init()
18
- {
19
-
20
- if ( ! self::$launched ) {
21
- self::init_hooks();
22
- }
23
-
24
- global $apbct;
25
- self::$apbct = $apbct;
26
-
27
- }
28
-
29
- /**
30
- * Plugging Up WordPress hooks
31
- * Contains native WP functionality and Integrations
32
- */
33
- private static function init_hooks()
34
- {
35
-
36
- self::$launched = true;
37
-
38
- // Public side hooks will be placed here
39
-
40
- }
41
-
42
- /**
43
- * Methods accepted by public hooks in init_hooks()
44
- * The methods have to be staic
45
- */
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cleantalk-ajax.php CHANGED
@@ -1,726 +1,727 @@
1
- <?php
2
- global $cleantalk_hooked_actions;
3
-
4
- /*
5
- AJAX functions
6
- */
7
-
8
- //$cleantalk_ajax_actions_to_check - array for POST 'actions' we should check.
9
-
10
- $cleantalk_ajax_actions_to_check[] = 'qcf_validate_form'; //Quick Contact Form
11
- $cleantalk_ajax_actions_to_check[] = 'amoforms_submit'; //amoForms
12
-
13
- //cleantalk_hooked_actions[] - array for POST 'actions' which were direct hooked.
14
-
15
- $cleantalk_hooked_actions[] = 'rwp_ajax_action_rating'; //Don't check Reviewer plugin
16
-
17
- $cleantalk_hooked_actions[] = 'ct_feedback_comment';
18
-
19
- /* MailChimp Premium*/
20
- add_filter('mc4wp_form_errors', 'ct_mc4wp_ajax_hook');
21
-
22
- /*hooks for Usernoise Form*/
23
- add_action('un_feedback_form_body', 'ct_add_hidden_fields',1);
24
- add_filter('un_validate_feedback', 'ct_ajax_hook', 1, 2);
25
-
26
- /*hooks for AJAX Login & Register email validation*/
27
- add_action( 'wp_ajax_nopriv_validate_email', 'ct_validate_email_ajaxlogin',1 );
28
- add_action( 'wp_ajax_validate_email', 'ct_validate_email_ajaxlogin',1 );
29
- $cleantalk_hooked_actions[]='validate_email';
30
-
31
- /*hooks for user registration*/
32
- add_action( 'user_register', 'ct_user_register_ajaxlogin',1 );
33
-
34
- /*hooks for WPUF pro */
35
- //add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
36
- //add_action( 'wp_ajax_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
37
- add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_ajax_hook',1 );
38
- add_action( 'wp_ajax_wpuf_submit_register', 'ct_ajax_hook',1 );
39
- $cleantalk_hooked_actions[]='submit_register';
40
-
41
- /*hooks for MyMail */
42
- //add_action( 'wp_ajax_nopriv_mymail_form_submit', 'ct_mymail_form_submit',1 );
43
- //add_action( 'wp_ajax_mymail_form_submit', 'ct_mymail_form_submit',1 );
44
- add_action( 'wp_ajax_nopriv_mymail_form_submit', 'ct_ajax_hook',1 );
45
- add_action( 'wp_ajax_mymail_form_submit', 'ct_ajax_hook',1 );
46
- $cleantalk_hooked_actions[]='form_submit';
47
-
48
- /*hooks for MailPoet */
49
- //add_action( 'wp_ajax_nopriv_wysija_ajax', 'ct_wysija_ajax',1 );
50
- //add_action( 'wp_ajax_wysija_ajax', 'ct_wysija_ajax',1 );
51
- add_action( 'wp_ajax_nopriv_wysija_ajax', 'ct_ajax_hook',1 );
52
- add_action( 'wp_ajax_wysija_ajax', 'ct_ajax_hook',1 );
53
- $cleantalk_hooked_actions[]='wysija_ajax';
54
-
55
- /*hooks for cs_registration_validation */
56
- //add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_cs_registration_validation',1 );
57
- //add_action( 'wp_ajax_cs_registration_validation', 'ct_cs_registration_validation',1 );
58
- add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_ajax_hook',1 );
59
- add_action( 'wp_ajax_cs_registration_validation', 'ct_ajax_hook',1 );
60
- $cleantalk_hooked_actions[]='cs_registration_validation';
61
-
62
- /*hooks for send_message and request_appointment */
63
- //add_action( 'wp_ajax_nopriv_send_message', 'ct_sm_ra',1 );
64
- //add_action( 'wp_ajax_send_message', 'ct_sm_ra',1 );
65
- //add_action( 'wp_ajax_nopriv_request_appointment', 'ct_sm_ra',1 );
66
- //add_action( 'wp_ajax_request_appointment', 'ct_sm_ra',1 );
67
- add_action( 'wp_ajax_nopriv_send_message', 'ct_ajax_hook',1 );
68
- add_action( 'wp_ajax_send_message', 'ct_ajax_hook',1 );
69
- add_action( 'wp_ajax_nopriv_request_appointment', 'ct_ajax_hook',1 );
70
- add_action( 'wp_ajax_request_appointment', 'ct_ajax_hook',1 );
71
- $cleantalk_hooked_actions[]='send_message';
72
- $cleantalk_hooked_actions[]='request_appointment';
73
-
74
- /*hooks for zn_do_login */
75
- //add_action( 'wp_ajax_nopriv_zn_do_login', 'ct_zn_do_login',1 );
76
- //add_action( 'wp_ajax_zn_do_login', 'ct_zn_do_login',1 );
77
- add_action( 'wp_ajax_nopriv_zn_do_login', 'ct_ajax_hook',1 );
78
- add_action( 'wp_ajax_zn_do_login', 'ct_ajax_hook',1 );
79
- $cleantalk_hooked_actions[]='zn_do_login';
80
-
81
- /*hooks for zn_do_login */
82
- //add_action( 'wp_ajax_nopriv_cscf-submitform', 'ct_cscf_submitform',1 );
83
- //add_action( 'wp_ajax_cscf-submitform', 'ct_cscf_submitform',1 );
84
- if(isset($_POST['action']) && $_POST['action'] == 'cscf-submitform'){
85
- add_filter('preprocess_comment', 'ct_ajax_hook', 1);
86
- //add_action( 'wp_ajax_nopriv_cscf-submitform', 'ct_ajax_hook',1 );
87
- //add_action( 'wp_ajax_cscf-submitform', 'ct_ajax_hook',1 );
88
- $cleantalk_hooked_actions[]='cscf-submitform';
89
- }
90
-
91
-
92
- /*hooks for visual form builder */
93
- //add_action( 'wp_ajax_nopriv_vfb_submit', 'ct_vfb_submit',1 );
94
- //add_action( 'wp_ajax_vfb_submit', 'ct_vfb_submit',1 );
95
- add_action( 'wp_ajax_nopriv_vfb_submit', 'ct_ajax_hook',1 );
96
- add_action( 'wp_ajax_vfb_submit', 'ct_ajax_hook',1 );
97
- $cleantalk_hooked_actions[]='vfb_submit';
98
-
99
- /*hooks for woocommerce_checkout*/
100
- add_action( 'wp_ajax_nopriv_woocommerce_checkout', 'ct_ajax_hook',1 );
101
- add_action( 'wp_ajax_woocommerce_checkout', 'ct_ajax_hook',1 );
102
- $cleantalk_hooked_actions[]='woocommerce_checkout';
103
- $cleantalk_hooked_actions[]='wcfm_ajax_controller';
104
-
105
- /*hooks for frm_action*/
106
- add_action( 'wp_ajax_nopriv_frm_entries_create', 'ct_ajax_hook',1 );
107
- add_action( 'wp_ajax_frm_entries_create', 'ct_ajax_hook',1 );
108
- $cleantalk_hooked_actions[]='frm_entries_create';
109
-
110
- add_action( 'wp_ajax_nopriv_td_mod_register', 'ct_ajax_hook',1 );
111
- add_action( 'wp_ajax_td_mod_register', 'ct_ajax_hook',1 );
112
- $cleantalk_hooked_actions[]='td_mod_register';
113
-
114
- /*hooks for tevolution theme*/
115
- add_action( 'wp_ajax_nopriv_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
116
- add_action( 'wp_ajax_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
117
- add_action( 'wp_ajax_nopriv_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
118
- add_action( 'wp_ajax_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
119
- add_action( 'wp_ajax_nopriv_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
120
- add_action( 'wp_ajax_tmpl_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
121
- $cleantalk_hooked_actions[]='tmpl_ajax_check_user_email';
122
- $cleantalk_hooked_actions[]='tevolution_submit_from_preview';
123
- $cleantalk_hooked_actions[]='submit_form_recaptcha_validation';
124
-
125
- /* hooks for contact forms by web settler ajax*/
126
- add_action( 'wp_ajax_nopriv_smuzform-storage', 'ct_ajax_hook',1 );
127
- $cleantalk_hooked_actions[]='smuzform_form_submit';
128
-
129
- /* hooks for reviewer plugin*/
130
- add_action( 'wp_ajax_nopriv_rwp_ajax_action_rating', 'ct_ajax_hook',1 );
131
- $cleantalk_hooked_actions[]='rwp-submit-wrap';
132
-
133
- $cleantalk_hooked_actions[]='post_update';
134
-
135
- /* Ninja Forms hoocked actions */
136
- $cleantalk_hooked_actions[]='ninja_forms_ajax_submit';
137
- $cleantalk_hooked_actions[]='nf_ajax_submit';
138
- $cleantalk_hooked_actions[]='ninja_forms_process'; // Depricated ?
139
-
140
- /* Follow-Up Emails */
141
- $cleantalk_hooked_actions[] = 'fue_wc_set_cart_email'; // Don't check email via this plugin
142
-
143
- /* Follow-Up Emails */
144
- $cleantalk_hooked_actions[] = 'fue_wc_set_cart_email'; // Don't check email via this plugin
145
-
146
- function ct_validate_email_ajaxlogin($email=null, $is_ajax=true){
147
-
148
- $email = is_null( $email ) ? $email : $_POST['email'];
149
- $email = sanitize_email($email);
150
- $is_good = !filter_var($email, FILTER_VALIDATE_EMAIL) || email_exists($email) ? false : true;
151
-
152
- if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='validate_email'){
153
-
154
- $checkjs = apbct_js_test('ct_checkjs', $_POST);
155
- $sender_info['post_checkjs_passed'] = $checkjs;
156
- if ($checkjs === null){
157
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
158
- $sender_info['cookie_checkjs_passed'] = $checkjs;
159
- }
160
-
161
- //Making a call
162
- $base_call_result = apbct_base_call(
163
- array(
164
- 'sender_email' => $email,
165
- 'sender_nickname' => '',
166
- 'sender_info' => $sender_info,
167
- 'js_on' => $checkjs,
168
- ),
169
- true
170
- );
171
-
172
- $ct_result = $base_call_result['ct_result'];
173
-
174
- if ($ct_result->allow===0){
175
- $is_good=false;
176
- }
177
- }
178
-
179
- if($is_good){
180
- $ajaxresult=array(
181
- 'description' => null,
182
- 'cssClass' => 'noon',
183
- 'code' => 'success'
184
- );
185
- }else{
186
- $ajaxresult=array(
187
- 'description' => 'Invalid Email',
188
- 'cssClass' => 'error-container',
189
- 'code' => 'error'
190
- );
191
- }
192
-
193
- $ajaxresult = json_encode($ajaxresult);
194
- print $ajaxresult;
195
- wp_die();
196
- }
197
-
198
- function ct_user_register_ajaxlogin($user_id)
199
- {
200
- if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='register_submit')
201
- {
202
-
203
- $checkjs = apbct_js_test('ct_checkjs', $_POST);
204
- $sender_info['post_checkjs_passed'] = $checkjs;
205
- if ($checkjs === null){
206
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
207
- $sender_info['cookie_checkjs_passed'] = $checkjs;
208
- }
209
-
210
- //Making a call
211
- $base_call_result = apbct_base_call(
212
- array(
213
- 'sender_email' => sanitize_email($_POST['email']),
214
- 'sender_nickname' => sanitize_email($_POST['login']),
215
- 'sender_info' => $sender_info,
216
- 'js_on' => $checkjs,
217
- ),
218
- true
219
- );
220
-
221
- $ct_result = $base_call_result['ct_result'];
222
-
223
- if ($ct_result->allow === 0)
224
- {
225
- wp_delete_user($user_id);
226
- }
227
- }
228
- return $user_id;
229
- }
230
-
231
- /**
232
- * Hook into MailChimp for WordPress `mc4wp_form_errors` filter.
233
- *
234
- * @param array $errors
235
- * @return array
236
- */
237
- function ct_mc4wp_ajax_hook( array $errors )
238
- {
239
- $result = ct_ajax_hook();
240
-
241
- // only return modified errors array when function returned a string value (the message key)
242
- if( is_string( $result ) ) {
243
- $errors[] = $result;
244
- }
245
-
246
- return $errors;
247
- }
248
-
249
- function ct_ajax_hook($message_obj = false, $additional = false)
250
- {
251
- global $apbct, $current_user;
252
-
253
- $message_obj = (array)$message_obj;
254
-
255
- // Get current_user and set it globaly
256
- apbct_wp_set_current_user($current_user instanceof WP_User ? $current_user : apbct_wp_get_current_user() );
257
-
258
- // Go out because of not spam data
259
- $skip_post = array(
260
- 'apbct_js_keys__get', // Our service code
261
- 'gmaps_display_info_window', // Geo My WP pop-up windows.
262
- 'gmw_ps_display_info_window', // Geo My WP pop-up windows.
263
- 'the_champ_user_auth', // Super Socializer
264
- 'simbatfa-init-otp', //Two-Factor Auth
265
- 'wppb_msf_check_required_fields', //ProfileBuilder skip step checking
266
- 'boss_we_login', //Login form
267
- 'sidebar_login_process', // Login CF7
268
- 'cp_update_style_settings', // Convert Pro. Saving settings
269
- 'updraft_savesettings', // UpdraftPlus
270
- 'wpdUpdateAutomatically', //Comments update
271
- 'upload-attachment', // Skip ulpload attachments
272
- 'iwj_update_profile', //Skip profile page checker
273
- 'st_partner_create_service', //Skip add hotel via admin
274
- 'vp_ajax_vpt_option_save', // https://themeforest.net/item/motor-vehicles-parts-equipments-accessories-wordpress-woocommerce-theme/16829946
275
- 'mailster_send_test', //Mailster send test admin
276
- 'acf/validate_save_post', //ACF validate post admin
277
- 'admin:saveThemeOptions', //Ait-theme admin checking
278
- 'save_tourmaster_option', //Tourmaster admin save
279
- 'validate_register_email', // Service id #313320
280
- 'elementor_pro_forms_send_form', //Elementor Pro
281
- 'phone-orders-for-woocommerce', //Phone orders for woocommerce backend
282
- 'ihc_check_reg_field_ajax', //Ajax check required fields
283
- 'OSTC_lostPassword', //Lost password ajax form
284
- 'check_retina_image_availability', //There are too many ajax requests from mobile
285
- 'uap_check_reg_field_ajax', // Ultimate Affiliate Pro. Form validation.
286
- 'edit-comment', // Edit comments by admin ??? that shouldn't happen
287
- 'formcraft3_save_form_progress', // FormCraft – Contact Form Builder for WordPress. Save progress.
288
- 'wpdmpp_save_settings', // PayPal save settings.
289
- );
290
-
291
- // Skip test if
292
- if( !$apbct->settings['general_contact_forms_test'] || // Test disabled
293
- !apbct_is_user_enable($apbct->user) || // User is admin, editor, author
294
- // (function_exists('get_current_user_id') && get_current_user_id() != 0) || // Check with default wp_* function if it's admin
295
- (!$apbct->settings['protect_logged_in'] && ($apbct->user instanceof WP_User) && $apbct->user->ID !== 0 ) || // Logged in user
296
- apbct_exclusions_check__url() || // url exclusions
297
- (isset($_POST['action']) && in_array($_POST['action'], $skip_post)) || // Special params
298
- (isset($_GET['action']) && in_array($_GET['action'], $skip_post)) || // Special params
299
- isset($_POST['quform_submit']) || //QForms multi-paged form skip
300
- // QAEngine Theme fix
301
- ( strval(current_action()) != 'et_pre_insert_answer' &&
302
- (
303
- (isset($message_obj['author']) && intval($message_obj['author']) == 0) ||
304
- (isset($message_obj['post_author']) && intval($message_obj['post_author']) == 0)
305
- )
306
- )
307
- )
308
- {
309
- return false;
310
- }
311
-
312
- //General post_info for all ajax calls
313
- $post_info = array('comment_type' => 'feedback_ajax');
314
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
315
-
316
- if(isset($_POST['user_login']))
317
- $sender_nickname = $_POST['user_login'];
318
- else
319
- $sender_nickname = '';
320
-
321
- //QAEngine Theme answers
322
- if( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
323
- $curr_user = get_user_by('id', $message_obj['author']);
324
- if (!$curr_user)
325
- $curr_user = get_user_by('id', $message_obj['post_author']);
326
- $ct_post_temp['comment'] = $message_obj['post_content'];
327
- $ct_post_temp['email'] = $curr_user->data->user_email;
328
- $ct_post_temp['name'] = $curr_user->data->user_login;
329
- }
330
-
331
- //CSCF fix
332
- if(isset($_POST['action']) && $_POST['action']== 'cscf-submitform'){
333
- $ct_post_temp[] = $message_obj['comment_author'];
334
- $ct_post_temp[] = $message_obj['comment_author_email'];
335
- $ct_post_temp[] = $message_obj['comment_content'];
336
- }
337
-
338
- //??? fix
339
- if(isset($_POST['action'], $_POST['target']) && ($_POST['action']=='request_appointment'||$_POST['action']=='send_message')){
340
- $ct_post_temp=$_POST;
341
- $ct_post_temp['target']=1;
342
- }
343
-
344
- //UserPro fix
345
- if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register'){
346
- $ct_post_temp = $_POST;
347
- $ct_post_temp['shortcode'] = '';
348
- }
349
- //Reviewer fix
350
- if(isset($_POST['action']) && $_POST['action'] == 'rwp_ajax_action_rating')
351
- {
352
- $ct_post_temp['name'] = $_POST['user_name'];
353
- $ct_post_temp['email'] = $_POST['user_email'];
354
- $ct_post_temp['comment'] = $_POST['comment'];
355
- }
356
- //Woocommerce checkout
357
- if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout'){
358
- $post_info['comment_type'] = 'order';
359
- }
360
- //Easy Forms for Mailchimp
361
- if( isset($_POST['action']) && $_POST['action']=='process_form_submission' ){
362
- $post_info['comment_type'] = 'contact_enquire_wordpress_easy_forms_for_mailchimp';
363
- if( isset($_POST['form_data']) ) {
364
- $form_data = explode( '&', $_POST['form_data'] );
365
- $form_data_arr = array();
366
- foreach ( $form_data as $val ) {
367
- $form_data_element = explode( '=', $val );
368
- $form_data_arr[$form_data_element[0]] = @$form_data_element[1];
369
- }
370
- if( isset( $form_data_arr['EMAIL'] ) ) {
371
- $ct_post_temp['email'] = $form_data_arr['EMAIL'];
372
- }
373
- }
374
- }
375
-
376
- $ct_temp_msg_data = isset($ct_post_temp)
377
- ? ct_get_fields_any($ct_post_temp)
378
- : ct_get_fields_any($_POST);
379
-
380
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
381
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
382
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
383
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
384
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
385
- if($subject != '') {
386
- $message['subject'] = $subject;
387
- }
388
-
389
- // Skip submission if no data found
390
- if ($sender_email === ''|| !$contact_form)
391
- return false;
392
-
393
- // Mailpoet fix
394
- if (isset($message['wysijaData'], $message['wysijaplugin'], $message['task'], $message['controller']) && $message['wysijaplugin'] == 'wysija-newsletters' && $message['controller'] == 'campaigns')
395
- return false;
396
- // Mailpoet3 admin skip fix
397
- if (isset($_POST['action'], $_POST['method']) && $_POST['action'] == 'mailpoet' && $_POST['method'] =='save')
398
- return false;
399
-
400
- // WP Foto Vote Fix
401
- if (!empty($_FILES)){
402
- foreach($message as $key => $value){
403
- if(strpos($key, 'oje') !== false)
404
- return;
405
- } unset($key ,$value);
406
- }
407
-
408
- /**
409
- * @todo Contact form detect
410
- */
411
- // Detect contact form an set it's name to $contact_form to use later
412
- $contact_form = null;
413
- foreach($_POST as $param => $value){
414
- if(strpos($param, 'et_pb_contactform_submit') === 0){
415
- $contact_form = 'contact_form_divi_theme';
416
- $contact_form_additional = str_replace($param, '', $param);
417
- }
418
- if(strpos($param, 'avia_generated_form') === 0){
419
- $contact_form = 'contact_form_enfold_theme';
420
- $contact_form_additional = str_replace('avia_generated_form', '', $param);
421
- }
422
- if(!empty($contact_form))
423
- break;
424
- }
425
-
426
- $base_call_result = apbct_base_call(
427
- array(
428
- 'message' => $message,
429
- 'sender_email' => $sender_email,
430
- 'sender_nickname' => $sender_nickname,
431
- 'sender_info' => array('post_checkjs_passed' => $checkjs),
432
- 'post_info' => $post_info,
433
- 'js_on' => $checkjs,
434
- )
435
- );
436
- $ct_result = $base_call_result['ct_result'];
437
-
438
- if ($ct_result->allow == 0)
439
- {
440
- if(isset($_POST['action']) && $_POST['action']=='wpuf_submit_register'){
441
- $result=Array('success'=>false,'error'=>$ct_result->comment);
442
- @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
443
- print json_encode($result);
444
- die();
445
- }
446
- else if(isset($_POST['action']) && $_POST['action']=='mymail_form_submit')
447
- {
448
- $result=Array('success'=>false,'html'=>$ct_result->comment);
449
- @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
450
- print json_encode($result);
451
- die();
452
- }
453
- else if(isset($_POST['action'], $_POST['task']) && $_POST['action'] == 'wysija_ajax' && $_POST['task'] != 'send_preview' && $_POST['task'] != 'send_test_mail')
454
- {
455
- $result=Array('result'=>false,'msgs'=>Array('updated'=>Array($ct_result->comment)));
456
- //@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
457
- print $_GET['callback'].'('.json_encode($result).');';
458
- die();
459
- }
460
- else if(isset($_POST['action']) && $_POST['action']=='cs_registration_validation')
461
- {
462
- $result=Array("type"=>"error","message"=>$ct_result->comment);
463
- print json_encode($result);
464
- die();
465
- }
466
- else if(isset($_POST['action']) && ($_POST['action']=='request_appointment' || $_POST['action']=='send_message'))
467
- {
468
- print $ct_result->comment;
469
- die();
470
- }
471
- else if(isset($_POST['action']) && $_POST['action']=='zn_do_login')
472
- {
473
- print '<div id="login_error">'.$ct_result->comment.'</div>';
474
- die();
475
- }
476
- else if(isset($_POST['action']) && $_POST['action']=='vfb_submit')
477
- {
478
- $result=Array('result'=>false,'message'=>$ct_result->comment);
479
- @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
480
- print json_encode($result);
481
- die();
482
- }
483
- else if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout')
484
- {
485
- print $ct_result->comment;
486
- die();
487
- }
488
- else if(isset($_POST['action']) && $_POST['action']=='frm_entries_create')
489
- {
490
- $result=Array('112'=>$ct_result->comment);
491
- print json_encode($result);
492
- die();
493
- }
494
- else if(isset($_POST['cma-action']) && $_POST['cma-action']=='add')
495
- {
496
- $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
497
- print json_encode($result);
498
- die();
499
- }
500
- else if(isset($_POST['action']) && $_POST['action']=='td_mod_register')
501
- {
502
- print json_encode(array('register', 0, $ct_result->comment));
503
- die();
504
- }
505
- else if(isset($_POST['action']) && $_POST['action']=='tmpl_ajax_check_user_email')
506
- {
507
- print "17,email";
508
- die();
509
- }
510
- else if(isset($_POST['action']) && ($_POST['action']=='tevolution_submit_from_preview' || $_POST['action']=='submit_form_recaptcha_validation'))
511
- {
512
- print $ct_result->comment;
513
- die();
514
- }
515
- // WooWaitList
516
- // http://codecanyon.net/item/woowaitlist-woocommerce-back-in-stock-notifier/7103373
517
- else if(isset($_POST['action']) && $_POST['action']=='wew_save_to_db_callback')
518
- {
519
- $result = array();
520
- $result['error'] = 1;
521
- $result['message'] = $ct_result->comment;
522
- $result['code'] = 5; // Unused code number in WooWaitlist
523
- print json_encode($result);
524
- die();
525
- }
526
- // UserPro
527
- else if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register')
528
- {
529
- foreach($_POST as $key => $value){
530
- $output[$key]=$value;
531
- }unset($key, $value);
532
- $output['template'] = $ct_result->comment;
533
- $output=json_encode($output);
534
- print_r($output);
535
- die;
536
- }
537
- // Quick event manager
538
- else if(isset($_POST['action']) && $_POST['action']=='qem_validate_form'){
539
- $errors[] = 'registration_forbidden';
540
- $result = Array(
541
- 'success' => 'false',
542
- 'errors' => $errors,
543
- 'title' => $ct_result->comment
544
- );
545
- print json_encode($result);
546
- die();
547
- }
548
- // Quick Contact Form
549
- elseif(isset($_POST['action']) && $_POST['action'] == 'qcf_validate_form')
550
- {
551
- $result = Array(
552
- 'blurb' => "<h1>".$ct_result->comment."</h1>",
553
- 'display' => "Oops, got a few problems here",
554
- 'errors' => array(
555
- 0 => array(
556
- error => 'error',
557
- name => 'name'
558
- ),
559
- ),
560
- 'success' => 'false',
561
- );
562
- print json_encode($result);
563
- die();
564
- }
565
- // Usernoise Contact Form
566
- elseif(isset($_POST['title'], $_POST['email'], $_POST['type'], $_POST['ct_checkjs']))
567
- {
568
- return array($ct_result->comment);
569
- die();
570
- }
571
- // amoForms
572
- elseif(isset($_POST['action']) && $_POST['action'] == 'amoforms_submit')
573
- {
574
- $result = Array(
575
- 'result' => true,
576
- 'type' => "html",
577
- 'value' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
578
- 'fast' => false
579
- );
580
- print json_encode($result);
581
- die();
582
- }
583
- // MailChimp for Wordpress Premium
584
- elseif(!empty($_POST['_mc4wp_form_id']))
585
- {
586
- return 'ct_mc4wp_response';
587
- }
588
- // QAEngine Theme answers
589
- elseif ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
590
- throw new Exception($ct_result->comment);
591
- }
592
- //ES Add subscriber
593
- elseif(isset($_POST['action']) && $_POST['action'] == 'es_add_subscriber')
594
- {
595
- $result = Array(
596
- 'error' => 'unexpected-error',
597
- );
598
- print json_encode($result);
599
- die();
600
- }
601
- //Convertplug. Strpos because action value dynamically changes and depends on mailing service
602
- elseif (isset($_POST['action']) && strpos($_POST['action'], '_add_subscriber') !== false){
603
- $result = Array(
604
- 'action' => "message",
605
- 'detailed_msg' => "",
606
- 'email_status' => false,
607
- 'message' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
608
- 'status' => "error",
609
- 'url' => "none"
610
- );
611
- print json_encode($result);
612
- die();
613
- }
614
- // Ultimate Form Builder
615
- elseif (isset($_POST['action']) && $_POST['action'] == 'ufbl_front_form_action'){
616
- $result = Array(
617
- 'error_keys' => array(),
618
- 'error_flag' => 1,
619
- 'response_message' => $ct_result->comment
620
- );
621
- print json_encode($result);
622
- die();
623
- }
624
- // Smart Forms
625
- elseif (isset($_POST['action']) && $_POST['action'] == 'rednao_smart_forms_save_form_values'){
626
- $result = Array(
627
- 'message' => $ct_result->comment,
628
- 'refreshCaptcha' => 'n',
629
- 'success' => 'n'
630
- );
631
- print json_encode($result);
632
- die();
633
- }
634
- //cFormsII
635
- elseif(isset($_POST['action']) && $_POST['action'] == 'submitcform')
636
- {
637
- header('Content-Type: application/json');
638
- $result = Array(
639
- 'no' => "",
640
- 'result' => "failure",
641
- 'html' =>$ct_result->comment,
642
- 'hide' => false,
643
- 'redirection' => null
644
-
645
- );
646
- print json_encode($result);
647
- die();
648
- }
649
- //Contact Form by Web-Settler
650
- elseif(isset($_POST['smFieldData']))
651
- {
652
- $result = Array(
653
- 'signal' => true,
654
- 'code' => 0,
655
- 'thanksMsg' => $ct_result->comment,
656
- 'errors' => array(),
657
- 'isMsg' => true,
658
- 'redirectUrl' => null
659
- );
660
- print json_encode($result);
661
- die();
662
- }
663
- //Reviewer
664
- elseif(isset($_POST['action']) && $_POST['action'] == 'rwp_ajax_action_rating')
665
- {
666
- $result = Array(
667
- 'success' => false,
668
- 'data' => array(0=>$ct_result->comment)
669
- );
670
- print json_encode($result);
671
- die();
672
- }
673
- // CouponXXL Theme
674
- elseif(isset($_POST['_wp_http_referer'], $_POST['register_field'], $_POST['action']) && strpos($_POST['_wp_http_referer'],'/register/account') !== false && $_POST['action'] == 'register'){
675
- $result = array(
676
- 'message' => '<div class="alert alert-error">'.$ct_result->comment.'</div>',
677
- );
678
- die(json_encode($result));
679
- }
680
- //ConvertPro
681
- elseif(isset($_POST['action']) && $_POST['action'] == 'cp_v2_notify_admin' || $_POST['action'] == 'cpro_notify_via_email')
682
- {
683
- $result = Array(
684
- 'success' => false,
685
- 'data' => array('error'=>$ct_result->comment,'style_slug'=>'convertprot-form'),
686
- );
687
- print json_encode($result);
688
- die();
689
- }
690
- //Easy Forms for Mailchimp
691
- elseif( isset($_POST['action']) && $_POST['action']=='process_form_submission' ) {
692
- wp_send_json_error(
693
- array(
694
- 'error' => 1,
695
- 'response' => $ct_result->comment
696
- )
697
- );
698
- }
699
- //Optin wheel
700
- elseif( isset($_POST['action']) && ($_POST['action'] == 'wof-lite-email-optin' || $_POST['action'] == 'wof-email-optin')) {
701
- wp_send_json_error(__($ct_result->comment, 'wp-optin-wheel'));
702
- }
703
- // Forminator
704
- elseif( isset($_POST['action']) && strpos($_POST['action'], 'forminator_submit') !== false ){
705
- wp_send_json_error(
706
- array(
707
- 'message' => $ct_result->comment,
708
- 'success' => false,
709
- 'errors' => array(),
710
- 'behav' => 'behaviour-thankyou',
711
- )
712
- );
713
- }
714
- else
715
- {
716
- die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $ct_result->comment,))));
717
- }
718
- }
719
- //Allow == 1
720
- else{
721
- //QAEngine Theme answers
722
- if ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
723
- return $message_obj;
724
- }
725
- }
726
- }
 
1
+ <?php
2
+ global $cleantalk_hooked_actions;
3
+
4
+ /*
5
+ AJAX functions
6
+ */
7
+
8
+ //$cleantalk_ajax_actions_to_check - array for POST 'actions' we should check.
9
+
10
+ $cleantalk_ajax_actions_to_check[] = 'qcf_validate_form'; //Quick Contact Form
11
+ $cleantalk_ajax_actions_to_check[] = 'amoforms_submit'; //amoForms
12
+
13
+ //cleantalk_hooked_actions[] - array for POST 'actions' which were direct hooked.
14
+
15
+ $cleantalk_hooked_actions[] = 'rwp_ajax_action_rating'; //Don't check Reviewer plugin
16
+
17
+ $cleantalk_hooked_actions[] = 'ct_feedback_comment';
18
+
19
+ /* MailChimp Premium*/
20
+ add_filter('mc4wp_form_errors', 'ct_mc4wp_ajax_hook');
21
+
22
+ /*hooks for Usernoise Form*/
23
+ add_action('un_feedback_form_body', 'ct_add_hidden_fields',1);
24
+ add_filter('un_validate_feedback', 'ct_ajax_hook', 1, 2);
25
+
26
+ /*hooks for AJAX Login & Register email validation*/
27
+ add_action( 'wp_ajax_nopriv_validate_email', 'ct_validate_email_ajaxlogin',1 );
28
+ add_action( 'wp_ajax_validate_email', 'ct_validate_email_ajaxlogin',1 );
29
+ $cleantalk_hooked_actions[]='validate_email';
30
+
31
+ /*hooks for user registration*/
32
+ add_action( 'user_register', 'ct_user_register_ajaxlogin',1 );
33
+
34
+ /*hooks for WPUF pro */
35
+ //add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
36
+ //add_action( 'wp_ajax_wpuf_submit_register', 'ct_wpuf_submit_register',1 );
37
+ add_action( 'wp_ajax_nopriv_wpuf_submit_register', 'ct_ajax_hook',1 );
38
+ add_action( 'wp_ajax_wpuf_submit_register', 'ct_ajax_hook',1 );
39
+ $cleantalk_hooked_actions[]='submit_register';
40
+
41
+ /*hooks for MyMail */
42
+ //add_action( 'wp_ajax_nopriv_mymail_form_submit', 'ct_mymail_form_submit',1 );
43
+ //add_action( 'wp_ajax_mymail_form_submit', 'ct_mymail_form_submit',1 );
44
+ add_action( 'wp_ajax_nopriv_mymail_form_submit', 'ct_ajax_hook',1 );
45
+ add_action( 'wp_ajax_mymail_form_submit', 'ct_ajax_hook',1 );
46
+ $cleantalk_hooked_actions[]='form_submit';
47
+
48
+ /*hooks for MailPoet */
49
+ //add_action( 'wp_ajax_nopriv_wysija_ajax', 'ct_wysija_ajax',1 );
50
+ //add_action( 'wp_ajax_wysija_ajax', 'ct_wysija_ajax',1 );
51
+ add_action( 'wp_ajax_nopriv_wysija_ajax', 'ct_ajax_hook',1 );
52
+ add_action( 'wp_ajax_wysija_ajax', 'ct_ajax_hook',1 );
53
+ $cleantalk_hooked_actions[]='wysija_ajax';
54
+
55
+ /*hooks for cs_registration_validation */
56
+ //add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_cs_registration_validation',1 );
57
+ //add_action( 'wp_ajax_cs_registration_validation', 'ct_cs_registration_validation',1 );
58
+ add_action( 'wp_ajax_nopriv_cs_registration_validation', 'ct_ajax_hook',1 );
59
+ add_action( 'wp_ajax_cs_registration_validation', 'ct_ajax_hook',1 );
60
+ $cleantalk_hooked_actions[]='cs_registration_validation';
61
+
62
+ /*hooks for send_message and request_appointment */
63
+ //add_action( 'wp_ajax_nopriv_send_message', 'ct_sm_ra',1 );
64
+ //add_action( 'wp_ajax_send_message', 'ct_sm_ra',1 );
65
+ //add_action( 'wp_ajax_nopriv_request_appointment', 'ct_sm_ra',1 );
66
+ //add_action( 'wp_ajax_request_appointment', 'ct_sm_ra',1 );
67
+ add_action( 'wp_ajax_nopriv_send_message', 'ct_ajax_hook',1 );
68
+ add_action( 'wp_ajax_send_message', 'ct_ajax_hook',1 );
69
+ add_action( 'wp_ajax_nopriv_request_appointment', 'ct_ajax_hook',1 );
70
+ add_action( 'wp_ajax_request_appointment', 'ct_ajax_hook',1 );
71
+ $cleantalk_hooked_actions[]='send_message';
72
+ $cleantalk_hooked_actions[]='request_appointment';
73
+
74
+ /*hooks for zn_do_login */
75
+ //add_action( 'wp_ajax_nopriv_zn_do_login', 'ct_zn_do_login',1 );
76
+ //add_action( 'wp_ajax_zn_do_login', 'ct_zn_do_login',1 );
77
+ add_action( 'wp_ajax_nopriv_zn_do_login', 'ct_ajax_hook',1 );
78
+ add_action( 'wp_ajax_zn_do_login', 'ct_ajax_hook',1 );
79
+ $cleantalk_hooked_actions[]='zn_do_login';
80
+
81
+ /*hooks for zn_do_login */
82
+ //add_action( 'wp_ajax_nopriv_cscf-submitform', 'ct_cscf_submitform',1 );
83
+ //add_action( 'wp_ajax_cscf-submitform', 'ct_cscf_submitform',1 );
84
+ if(isset($_POST['action']) && $_POST['action'] == 'cscf-submitform'){
85
+ add_filter('preprocess_comment', 'ct_ajax_hook', 1);
86
+ //add_action( 'wp_ajax_nopriv_cscf-submitform', 'ct_ajax_hook',1 );
87
+ //add_action( 'wp_ajax_cscf-submitform', 'ct_ajax_hook',1 );
88
+ $cleantalk_hooked_actions[]='cscf-submitform';
89
+ }
90
+
91
+
92
+ /*hooks for visual form builder */
93
+ //add_action( 'wp_ajax_nopriv_vfb_submit', 'ct_vfb_submit',1 );
94
+ //add_action( 'wp_ajax_vfb_submit', 'ct_vfb_submit',1 );
95
+ add_action( 'wp_ajax_nopriv_vfb_submit', 'ct_ajax_hook',1 );
96
+ add_action( 'wp_ajax_vfb_submit', 'ct_ajax_hook',1 );
97
+ $cleantalk_hooked_actions[]='vfb_submit';
98
+
99
+ /*hooks for woocommerce_checkout*/
100
+ add_action( 'wp_ajax_nopriv_woocommerce_checkout', 'ct_ajax_hook',1 );
101
+ add_action( 'wp_ajax_woocommerce_checkout', 'ct_ajax_hook',1 );
102
+ $cleantalk_hooked_actions[]='woocommerce_checkout';
103
+ $cleantalk_hooked_actions[]='wcfm_ajax_controller';
104
+
105
+ /*hooks for frm_action*/
106
+ add_action( 'wp_ajax_nopriv_frm_entries_create', 'ct_ajax_hook',1 );
107
+ add_action( 'wp_ajax_frm_entries_create', 'ct_ajax_hook',1 );
108
+ $cleantalk_hooked_actions[]='frm_entries_create';
109
+
110
+ add_action( 'wp_ajax_nopriv_td_mod_register', 'ct_ajax_hook',1 );
111
+ add_action( 'wp_ajax_td_mod_register', 'ct_ajax_hook',1 );
112
+ $cleantalk_hooked_actions[]='td_mod_register';
113
+
114
+ /*hooks for tevolution theme*/
115
+ add_action( 'wp_ajax_nopriv_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
116
+ add_action( 'wp_ajax_tmpl_ajax_check_user_email', 'ct_ajax_hook',1 );
117
+ add_action( 'wp_ajax_nopriv_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
118
+ add_action( 'wp_ajax_tevolution_submit_from_preview', 'ct_ajax_hook',1 );
119
+ add_action( 'wp_ajax_nopriv_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
120
+ add_action( 'wp_ajax_tmpl_submit_form_recaptcha_validation', 'ct_ajax_hook',1 );
121
+ $cleantalk_hooked_actions[]='tmpl_ajax_check_user_email';
122
+ $cleantalk_hooked_actions[]='tevolution_submit_from_preview';
123
+ $cleantalk_hooked_actions[]='submit_form_recaptcha_validation';
124
+
125
+ /* hooks for contact forms by web settler ajax*/
126
+ add_action( 'wp_ajax_nopriv_smuzform-storage', 'ct_ajax_hook',1 );
127
+ $cleantalk_hooked_actions[]='smuzform_form_submit';
128
+
129
+ /* hooks for reviewer plugin*/
130
+ add_action( 'wp_ajax_nopriv_rwp_ajax_action_rating', 'ct_ajax_hook',1 );
131
+ $cleantalk_hooked_actions[]='rwp-submit-wrap';
132
+
133
+ $cleantalk_hooked_actions[]='post_update';
134
+
135
+ /* Ninja Forms hoocked actions */
136
+ $cleantalk_hooked_actions[]='ninja_forms_ajax_submit';
137
+ $cleantalk_hooked_actions[]='nf_ajax_submit';
138
+ $cleantalk_hooked_actions[]='ninja_forms_process'; // Depricated ?
139
+
140
+ /* Follow-Up Emails */
141
+ $cleantalk_hooked_actions[] = 'fue_wc_set_cart_email'; // Don't check email via this plugin
142
+
143
+ /* Follow-Up Emails */
144
+ $cleantalk_hooked_actions[] = 'fue_wc_set_cart_email'; // Don't check email via this plugin
145
+
146
+ function ct_validate_email_ajaxlogin($email=null, $is_ajax=true){
147
+
148
+ $email = is_null( $email ) ? $email : $_POST['email'];
149
+ $email = sanitize_email($email);
150
+ $is_good = !filter_var($email, FILTER_VALIDATE_EMAIL) || email_exists($email) ? false : true;
151
+
152
+ if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='validate_email'){
153
+
154
+ $checkjs = apbct_js_test('ct_checkjs', $_POST);
155
+ $sender_info['post_checkjs_passed'] = $checkjs;
156
+ if ($checkjs === null){
157
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
158
+ $sender_info['cookie_checkjs_passed'] = $checkjs;
159
+ }
160
+
161
+ //Making a call
162
+ $base_call_result = apbct_base_call(
163
+ array(
164
+ 'sender_email' => $email,
165
+ 'sender_nickname' => '',
166
+ 'sender_info' => $sender_info,
167
+ 'js_on' => $checkjs,
168
+ ),
169
+ true
170
+ );
171
+
172
+ $ct_result = $base_call_result['ct_result'];
173
+
174
+ if ($ct_result->allow===0){
175
+ $is_good=false;
176
+ }
177
+ }
178
+
179
+ if($is_good){
180
+ $ajaxresult=array(
181
+ 'description' => null,
182
+ 'cssClass' => 'noon',
183
+ 'code' => 'success'
184
+ );
185
+ }else{
186
+ $ajaxresult=array(
187
+ 'description' => 'Invalid Email',
188
+ 'cssClass' => 'error-container',
189
+ 'code' => 'error'
190
+ );
191
+ }
192
+
193
+ $ajaxresult = json_encode($ajaxresult);
194
+ print $ajaxresult;
195
+ wp_die();
196
+ }
197
+
198
+ function ct_user_register_ajaxlogin($user_id)
199
+ {
200
+ if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='register_submit')
201
+ {
202
+
203
+ $checkjs = apbct_js_test('ct_checkjs', $_POST);
204
+ $sender_info['post_checkjs_passed'] = $checkjs;
205
+ if ($checkjs === null){
206
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
207
+ $sender_info['cookie_checkjs_passed'] = $checkjs;
208
+ }
209
+
210
+ //Making a call
211
+ $base_call_result = apbct_base_call(
212
+ array(
213
+ 'sender_email' => sanitize_email($_POST['email']),
214
+ 'sender_nickname' => sanitize_email($_POST['login']),
215
+ 'sender_info' => $sender_info,
216
+ 'js_on' => $checkjs,
217
+ ),
218
+ true
219
+ );
220
+
221
+ $ct_result = $base_call_result['ct_result'];
222
+
223
+ if ($ct_result->allow === 0)
224
+ {
225
+ wp_delete_user($user_id);
226
+ }
227
+ }
228
+ return $user_id;
229
+ }
230
+
231
+ /**
232
+ * Hook into MailChimp for WordPress `mc4wp_form_errors` filter.
233
+ *
234
+ * @param array $errors
235
+ * @return array
236
+ */
237
+ function ct_mc4wp_ajax_hook( array $errors )
238
+ {
239
+ $result = ct_ajax_hook();
240
+
241
+ // only return modified errors array when function returned a string value (the message key)
242
+ if( is_string( $result ) ) {
243
+ $errors[] = $result;
244
+ }
245
+
246
+ return $errors;
247
+ }
248
+
249
+ function ct_ajax_hook($message_obj = false, $additional = false)
250
+ {
251
+ global $apbct, $current_user;
252
+
253
+ $message_obj = (array)$message_obj;
254
+
255
+ // Get current_user and set it globaly
256
+ apbct_wp_set_current_user($current_user instanceof WP_User ? $current_user : apbct_wp_get_current_user() );
257
+
258
+ // Go out because of not spam data
259
+ $skip_post = array(
260
+ 'apbct_js_keys__get', // Our service code
261
+ 'gmaps_display_info_window', // Geo My WP pop-up windows.
262
+ 'gmw_ps_display_info_window', // Geo My WP pop-up windows.
263
+ 'the_champ_user_auth', // Super Socializer
264
+ 'simbatfa-init-otp', //Two-Factor Auth
265
+ 'wppb_msf_check_required_fields', //ProfileBuilder skip step checking
266
+ 'boss_we_login', //Login form
267
+ 'sidebar_login_process', // Login CF7
268
+ 'cp_update_style_settings', // Convert Pro. Saving settings
269
+ 'updraft_savesettings', // UpdraftPlus
270
+ 'wpdUpdateAutomatically', //Comments update
271
+ 'upload-attachment', // Skip ulpload attachments
272
+ 'iwj_update_profile', //Skip profile page checker
273
+ 'st_partner_create_service', //Skip add hotel via admin
274
+ 'vp_ajax_vpt_option_save', // https://themeforest.net/item/motor-vehicles-parts-equipments-accessories-wordpress-woocommerce-theme/16829946
275
+ 'mailster_send_test', //Mailster send test admin
276
+ 'acf/validate_save_post', //ACF validate post admin
277
+ 'admin:saveThemeOptions', //Ait-theme admin checking
278
+ 'save_tourmaster_option', //Tourmaster admin save
279
+ 'validate_register_email', // Service id #313320
280
+ 'elementor_pro_forms_send_form', //Elementor Pro
281
+ 'phone-orders-for-woocommerce', //Phone orders for woocommerce backend
282
+ 'ihc_check_reg_field_ajax', //Ajax check required fields
283
+ 'OSTC_lostPassword', //Lost password ajax form
284
+ 'check_retina_image_availability', //There are too many ajax requests from mobile
285
+ 'uap_check_reg_field_ajax', // Ultimate Affiliate Pro. Form validation.
286
+ 'edit-comment', // Edit comments by admin ??? that shouldn't happen
287
+ 'formcraft3_save_form_progress', // FormCraft – Contact Form Builder for WordPress. Save progress.
288
+ 'wpdmpp_save_settings', // PayPal save settings.
289
+ 'give_process_donation', // GiveWP will be checked by feedback_general_contact_form
290
+ );
291
+
292
+ // Skip test if
293
+ if( !$apbct->settings['general_contact_forms_test'] || // Test disabled
294
+ !apbct_is_user_enable($apbct->user) || // User is admin, editor, author
295
+ // (function_exists('get_current_user_id') && get_current_user_id() != 0) || // Check with default wp_* function if it's admin
296
+ (!$apbct->settings['protect_logged_in'] && ($apbct->user instanceof WP_User) && $apbct->user->ID !== 0 ) || // Logged in user
297
+ apbct_exclusions_check__url() || // url exclusions
298
+ (isset($_POST['action']) && in_array($_POST['action'], $skip_post)) || // Special params
299
+ (isset($_GET['action']) && in_array($_GET['action'], $skip_post)) || // Special params
300
+ isset($_POST['quform_submit']) || //QForms multi-paged form skip
301
+ // QAEngine Theme fix
302
+ ( strval(current_action()) != 'et_pre_insert_answer' &&
303
+ (
304
+ (isset($message_obj['author']) && intval($message_obj['author']) == 0) ||
305
+ (isset($message_obj['post_author']) && intval($message_obj['post_author']) == 0)
306
+ )
307
+ )
308
+ )
309
+ {
310
+ return false;
311
+ }
312
+
313
+ //General post_info for all ajax calls
314
+ $post_info = array('comment_type' => 'feedback_ajax');
315
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
316
+
317
+ if(isset($_POST['user_login']))
318
+ $sender_nickname = $_POST['user_login'];
319
+ else
320
+ $sender_nickname = '';
321
+
322
+ //QAEngine Theme answers
323
+ if( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
324
+ $curr_user = get_user_by('id', $message_obj['author']);
325
+ if (!$curr_user)
326
+ $curr_user = get_user_by('id', $message_obj['post_author']);
327
+ $ct_post_temp['comment'] = $message_obj['post_content'];
328
+ $ct_post_temp['email'] = $curr_user->data->user_email;
329
+ $ct_post_temp['name'] = $curr_user->data->user_login;
330
+ }
331
+
332
+ //CSCF fix
333
+ if(isset($_POST['action']) && $_POST['action']== 'cscf-submitform'){
334
+ $ct_post_temp[] = $message_obj['comment_author'];
335
+ $ct_post_temp[] = $message_obj['comment_author_email'];
336
+ $ct_post_temp[] = $message_obj['comment_content'];
337
+ }
338
+
339
+ //??? fix
340
+ if(isset($_POST['action'], $_POST['target']) && ($_POST['action']=='request_appointment'||$_POST['action']=='send_message')){
341
+ $ct_post_temp=$_POST;
342
+ $ct_post_temp['target']=1;
343
+ }
344
+
345
+ //UserPro fix
346
+ if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register'){
347
+ $ct_post_temp = $_POST;
348
+ $ct_post_temp['shortcode'] = '';
349
+ }
350
+ //Reviewer fix
351
+ if(isset($_POST['action']) && $_POST['action'] == 'rwp_ajax_action_rating')
352
+ {
353
+ $ct_post_temp['name'] = $_POST['user_name'];
354
+ $ct_post_temp['email'] = $_POST['user_email'];
355
+ $ct_post_temp['comment'] = $_POST['comment'];
356
+ }
357
+ //Woocommerce checkout
358
+ if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout'){
359
+ $post_info['comment_type'] = 'order';
360
+ }
361
+ //Easy Forms for Mailchimp
362
+ if( isset($_POST['action']) && $_POST['action']=='process_form_submission' ){
363
+ $post_info['comment_type'] = 'contact_enquire_wordpress_easy_forms_for_mailchimp';
364
+ if( isset($_POST['form_data']) ) {
365
+ $form_data = explode( '&', $_POST['form_data'] );
366
+ $form_data_arr = array();
367
+ foreach ( $form_data as $val ) {
368
+ $form_data_element = explode( '=', $val );
369
+ $form_data_arr[$form_data_element[0]] = @$form_data_element[1];
370
+ }
371
+ if( isset( $form_data_arr['EMAIL'] ) ) {
372
+ $ct_post_temp['email'] = $form_data_arr['EMAIL'];
373
+ }
374
+ }
375
+ }
376
+
377
+ $ct_temp_msg_data = isset($ct_post_temp)
378
+ ? ct_get_fields_any($ct_post_temp)
379
+ : ct_get_fields_any($_POST);
380
+
381
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
382
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
383
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
384
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
385
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
386
+ if($subject != '') {
387
+ $message['subject'] = $subject;
388
+ }
389
+
390
+ // Skip submission if no data found
391
+ if ($sender_email === ''|| !$contact_form)
392
+ return false;
393
+
394
+ // Mailpoet fix
395
+ if (isset($message['wysijaData'], $message['wysijaplugin'], $message['task'], $message['controller']) && $message['wysijaplugin'] == 'wysija-newsletters' && $message['controller'] == 'campaigns')
396
+ return false;
397
+ // Mailpoet3 admin skip fix
398
+ if (isset($_POST['action'], $_POST['method']) && $_POST['action'] == 'mailpoet' && $_POST['method'] =='save')
399
+ return false;
400
+
401
+ // WP Foto Vote Fix
402
+ if (!empty($_FILES)){
403
+ foreach($message as $key => $value){
404
+ if(strpos($key, 'oje') !== false)
405
+ return;
406
+ } unset($key ,$value);
407
+ }
408
+
409
+ /**
410
+ * @todo Contact form detect
411
+ */
412
+ // Detect contact form an set it's name to $contact_form to use later
413
+ $contact_form = null;
414
+ foreach($_POST as $param => $value){
415
+ if(strpos($param, 'et_pb_contactform_submit') === 0){
416
+ $contact_form = 'contact_form_divi_theme';
417
+ $contact_form_additional = str_replace($param, '', $param);
418
+ }
419
+ if(strpos($param, 'avia_generated_form') === 0){
420
+ $contact_form = 'contact_form_enfold_theme';
421
+ $contact_form_additional = str_replace('avia_generated_form', '', $param);
422
+ }
423
+ if(!empty($contact_form))
424
+ break;
425
+ }
426
+
427
+ $base_call_result = apbct_base_call(
428
+ array(
429
+ 'message' => $message,
430
+ 'sender_email' => $sender_email,
431
+ 'sender_nickname' => $sender_nickname,
432
+ 'sender_info' => array('post_checkjs_passed' => $checkjs),
433
+ 'post_info' => $post_info,
434
+ 'js_on' => $checkjs,
435
+ )
436
+ );
437
+ $ct_result = $base_call_result['ct_result'];
438
+
439
+ if ($ct_result->allow == 0)
440
+ {
441
+ if(isset($_POST['action']) && $_POST['action']=='wpuf_submit_register'){
442
+ $result=Array('success'=>false,'error'=>$ct_result->comment);
443
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
444
+ print json_encode($result);
445
+ die();
446
+ }
447
+ else if(isset($_POST['action']) && $_POST['action']=='mymail_form_submit')
448
+ {
449
+ $result=Array('success'=>false,'html'=>$ct_result->comment);
450
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
451
+ print json_encode($result);
452
+ die();
453
+ }
454
+ else if(isset($_POST['action'], $_POST['task']) && $_POST['action'] == 'wysija_ajax' && $_POST['task'] != 'send_preview' && $_POST['task'] != 'send_test_mail')
455
+ {
456
+ $result=Array('result'=>false,'msgs'=>Array('updated'=>Array($ct_result->comment)));
457
+ //@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
458
+ print $_GET['callback'].'('.json_encode($result).');';
459
+ die();
460
+ }
461
+ else if(isset($_POST['action']) && $_POST['action']=='cs_registration_validation')
462
+ {
463
+ $result=Array("type"=>"error","message"=>$ct_result->comment);
464
+ print json_encode($result);
465
+ die();
466
+ }
467
+ else if(isset($_POST['action']) && ($_POST['action']=='request_appointment' || $_POST['action']=='send_message'))
468
+ {
469
+ print $ct_result->comment;
470
+ die();
471
+ }
472
+ else if(isset($_POST['action']) && $_POST['action']=='zn_do_login')
473
+ {
474
+ print '<div id="login_error">'.$ct_result->comment.'</div>';
475
+ die();
476
+ }
477
+ else if(isset($_POST['action']) && $_POST['action']=='vfb_submit')
478
+ {
479
+ $result=Array('result'=>false,'message'=>$ct_result->comment);
480
+ @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
481
+ print json_encode($result);
482
+ die();
483
+ }
484
+ else if(isset($_POST['action']) && $_POST['action']=='woocommerce_checkout')
485
+ {
486
+ print $ct_result->comment;
487
+ die();
488
+ }
489
+ else if(isset($_POST['action']) && $_POST['action']=='frm_entries_create')
490
+ {
491
+ $result=Array('112'=>$ct_result->comment);
492
+ print json_encode($result);
493
+ die();
494
+ }
495
+ else if(isset($_POST['cma-action']) && $_POST['cma-action']=='add')
496
+ {
497
+ $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
498
+ print json_encode($result);
499
+ die();
500
+ }
501
+ else if(isset($_POST['action']) && $_POST['action']=='td_mod_register')
502
+ {
503
+ print json_encode(array('register', 0, $ct_result->comment));
504
+ die();
505
+ }
506
+ else if(isset($_POST['action']) && $_POST['action']=='tmpl_ajax_check_user_email')
507
+ {
508
+ print "17,email";
509
+ die();
510
+ }
511
+ else if(isset($_POST['action']) && ($_POST['action']=='tevolution_submit_from_preview' || $_POST['action']=='submit_form_recaptcha_validation'))
512
+ {
513
+ print $ct_result->comment;
514
+ die();
515
+ }
516
+ // WooWaitList
517
+ // http://codecanyon.net/item/woowaitlist-woocommerce-back-in-stock-notifier/7103373
518
+ else if(isset($_POST['action']) && $_POST['action']=='wew_save_to_db_callback')
519
+ {
520
+ $result = array();
521
+ $result['error'] = 1;
522
+ $result['message'] = $ct_result->comment;
523
+ $result['code'] = 5; // Unused code number in WooWaitlist
524
+ print json_encode($result);
525
+ die();
526
+ }
527
+ // UserPro
528
+ else if(isset($_POST['action'], $_POST['template']) && $_POST['action']=='userpro_process_form' && $_POST['template']=='register')
529
+ {
530
+ foreach($_POST as $key => $value){
531
+ $output[$key]=$value;
532
+ }unset($key, $value);
533
+ $output['template'] = $ct_result->comment;
534
+ $output=json_encode($output);
535
+ print_r($output);
536
+ die;
537
+ }
538
+ // Quick event manager
539
+ else if(isset($_POST['action']) && $_POST['action']=='qem_validate_form'){
540
+ $errors[] = 'registration_forbidden';
541
+ $result = Array(
542
+ 'success' => 'false',
543
+ 'errors' => $errors,
544
+ 'title' => $ct_result->comment
545
+ );
546
+ print json_encode($result);
547
+ die();
548
+ }
549
+ // Quick Contact Form
550
+ elseif(isset($_POST['action']) && $_POST['action'] == 'qcf_validate_form')
551
+ {
552
+ $result = Array(
553
+ 'blurb' => "<h1>".$ct_result->comment."</h1>",
554
+ 'display' => "Oops, got a few problems here",
555
+ 'errors' => array(
556
+ 0 => array(
557
+ error => 'error',
558
+ name => 'name'
559
+ ),
560
+ ),
561
+ 'success' => 'false',
562
+ );
563
+ print json_encode($result);
564
+ die();
565
+ }
566
+ // Usernoise Contact Form
567
+ elseif(isset($_POST['title'], $_POST['email'], $_POST['type'], $_POST['ct_checkjs']))
568
+ {
569
+ return array($ct_result->comment);
570
+ die();
571
+ }
572
+ // amoForms
573
+ elseif(isset($_POST['action']) && $_POST['action'] == 'amoforms_submit')
574
+ {
575
+ $result = Array(
576
+ 'result' => true,
577
+ 'type' => "html",
578
+ 'value' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
579
+ 'fast' => false
580
+ );
581
+ print json_encode($result);
582
+ die();
583
+ }
584
+ // MailChimp for Wordpress Premium
585
+ elseif(!empty($_POST['_mc4wp_form_id']))
586
+ {
587
+ return 'ct_mc4wp_response';
588
+ }
589
+ // QAEngine Theme answers
590
+ elseif ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
591
+ throw new Exception($ct_result->comment);
592
+ }
593
+ //ES Add subscriber
594
+ elseif(isset($_POST['action']) && $_POST['action'] == 'es_add_subscriber')
595
+ {
596
+ $result = Array(
597
+ 'error' => 'unexpected-error',
598
+ );
599
+ print json_encode($result);
600
+ die();
601
+ }
602
+ //Convertplug. Strpos because action value dynamically changes and depends on mailing service
603
+ elseif (isset($_POST['action']) && strpos($_POST['action'], '_add_subscriber') !== false){
604
+ $result = Array(
605
+ 'action' => "message",
606
+ 'detailed_msg' => "",
607
+ 'email_status' => false,
608
+ 'message' => "<h1 style='font-size: 25px; color: red;'>".$ct_result->comment."</h1>",
609
+ 'status' => "error",
610
+ 'url' => "none"
611
+ );
612
+ print json_encode($result);
613
+ die();
614
+ }
615
+ // Ultimate Form Builder
616
+ elseif (isset($_POST['action']) && $_POST['action'] == 'ufbl_front_form_action'){
617
+ $result = Array(
618
+ 'error_keys' => array(),
619
+ 'error_flag' => 1,
620
+ 'response_message' => $ct_result->comment
621
+ );
622
+ print json_encode($result);
623
+ die();
624
+ }
625
+ // Smart Forms
626
+ elseif (isset($_POST['action']) && $_POST['action'] == 'rednao_smart_forms_save_form_values'){
627
+ $result = Array(
628
+ 'message' => $ct_result->comment,
629
+ 'refreshCaptcha' => 'n',
630
+ 'success' => 'n'
631
+ );
632
+ print json_encode($result);
633
+ die();
634
+ }
635
+ //cFormsII
636
+ elseif(isset($_POST['action']) && $_POST['action'] == 'submitcform')
637
+ {
638
+ header('Content-Type: application/json');
639
+ $result = Array(
640
+ 'no' => "",
641
+ 'result' => "failure",
642
+ 'html' =>$ct_result->comment,
643
+ 'hide' => false,
644
+ 'redirection' => null
645
+
646
+ );
647
+ print json_encode($result);
648
+ die();
649
+ }
650
+ //Contact Form by Web-Settler
651
+ elseif(isset($_POST['smFieldData']))
652
+ {
653
+ $result = Array(
654
+ 'signal' => true,
655
+ 'code' => 0,
656
+ 'thanksMsg' => $ct_result->comment,
657
+ 'errors' => array(),
658
+ 'isMsg' => true,
659
+ 'redirectUrl' => null
660
+ );
661
+ print json_encode($result);
662
+ die();
663
+ }
664
+ //Reviewer
665
+ elseif(isset($_POST['action']) && $_POST['action'] == 'rwp_ajax_action_rating')
666
+ {
667
+ $result = Array(
668
+ 'success' => false,
669
+ 'data' => array(0=>$ct_result->comment)
670
+ );
671
+ print json_encode($result);
672
+ die();
673
+ }
674
+ // CouponXXL Theme
675
+ elseif(isset($_POST['_wp_http_referer'], $_POST['register_field'], $_POST['action']) && strpos($_POST['_wp_http_referer'],'/register/account') !== false && $_POST['action'] == 'register'){
676
+ $result = array(
677
+ 'message' => '<div class="alert alert-error">'.$ct_result->comment.'</div>',
678
+ );
679
+ die(json_encode($result));
680
+ }
681
+ //ConvertPro
682
+ elseif(isset($_POST['action']) && $_POST['action'] == 'cp_v2_notify_admin' || $_POST['action'] == 'cpro_notify_via_email')
683
+ {
684
+ $result = Array(
685
+ 'success' => false,
686
+ 'data' => array('error'=>$ct_result->comment,'style_slug'=>'convertprot-form'),
687
+ );
688
+ print json_encode($result);
689
+ die();
690
+ }
691
+ //Easy Forms for Mailchimp
692
+ elseif( isset($_POST['action']) && $_POST['action']=='process_form_submission' ) {
693
+ wp_send_json_error(
694
+ array(
695
+ 'error' => 1,
696
+ 'response' => $ct_result->comment
697
+ )
698
+ );
699
+ }
700
+ //Optin wheel
701
+ elseif( isset($_POST['action']) && ($_POST['action'] == 'wof-lite-email-optin' || $_POST['action'] == 'wof-email-optin')) {
702
+ wp_send_json_error(__($ct_result->comment, 'wp-optin-wheel'));
703
+ }
704
+ // Forminator
705
+ elseif( isset($_POST['action']) && strpos($_POST['action'], 'forminator_submit') !== false ){
706
+ wp_send_json_error(
707
+ array(
708
+ 'message' => $ct_result->comment,
709
+ 'success' => false,
710
+ 'errors' => array(),
711
+ 'behav' => 'behaviour-thankyou',
712
+ )
713
+ );
714
+ }
715
+ else
716
+ {
717
+ die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $ct_result->comment,))));
718
+ }
719
+ }
720
+ //Allow == 1
721
+ else{
722
+ //QAEngine Theme answers
723
+ if ( !empty($message_obj) && isset($message_obj['post_type'], $message_obj['post_content']) ){
724
+ return $message_obj;
725
+ }
726
+ }
727
+ }
inc/cleantalk-autoloader.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Autoloader for \Cleantalk\* classes
5
+ *
6
+ * @param string $class
7
+ *
8
+ * @return void
9
+ */
10
+ function apbct_autoloader( $class ){
11
+ // Register class auto loader
12
+ // Custom modules
13
+ if( strpos( $class, 'Cleantalk' ) !== false && ! class_exists( '\\' . $class )) {
14
+ $class_file = CLEANTALK_PLUGIN_DIR . 'lib' . DIRECTORY_SEPARATOR . $class . '.php';
15
+ if( file_exists( $class_file ) ){
16
+ require_once( $class_file );
17
+ }
18
+ }
19
+ }
20
+
21
+ spl_autoload_register( 'apbct_autoloader' );
inc/cleantalk-comments.php CHANGED
@@ -1,726 +1,726 @@
1
- <?php
2
-
3
- add_action('admin_menu', 'ct_add_comments_menu');
4
- add_action( 'wp_ajax_ajax_check_comments', 'ct_ajax_check_comments' );
5
- add_action( 'wp_ajax_ajax_info_comments', 'ct_ajax_info_comments' );
6
- add_action( 'wp_ajax_ajax_insert_comments', 'ct_ajax_insert_comments' );
7
- add_action( 'wp_ajax_ajax_delete_checked', 'ct_ajax_delete_checked' );
8
- add_action( 'wp_ajax_ajax_delete_all', 'ct_ajax_delete_all' );
9
- add_action( 'wp_ajax_ajax_clear_comments', 'ct_ajax_clear_comments' );
10
- add_action( 'wp_ajax_ajax_ct_approve_comment', 'ct_comment_check_approve_comment' );
11
-
12
- function ct_add_comments_menu(){
13
- if(current_user_can('activate_plugins'))
14
- add_comments_page( __("Check for spam", 'cleantalk'), __("Find spam comments", 'cleantalk'), 'read', 'ct_check_spam', 'ct_show_checkspam_page');
15
- }
16
-
17
- function ct_show_checkspam_page(){
18
-
19
- global $apbct;
20
-
21
- ?>
22
- <div class="wrap">
23
- <h2><img src="<?php echo $apbct->logo__small__colored; ?>" /> <?php echo $apbct->plugin_name; ?></h2>
24
- <a style="color: gray; margin-left: 23px;" href="<?php echo $apbct->settings_link; ?>"><?php _e('Plugin Settings', 'cleantalk'); ?></a>
25
- <br />
26
- <?php
27
-
28
- // If access key is unset in
29
- if(!apbct_api_key__is_correct()){
30
- if($apbct->moderate_ip == 1){
31
- echo '<h3>'
32
- .sprintf(
33
- __('Antispam hosting tariff does not allow you to use this feature. To do so, you need to enter an Access Key in the %splugin settings%s.', 'cleantalk'),
34
- '<a href="' . (is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk').'">',
35
- '</a>'
36
- )
37
- .'</h3>';
38
- return;
39
- }
40
- }
41
-
42
- // Getting total spam comments
43
- $args_spam = array(
44
- 'meta_query' => array(
45
- Array(
46
- 'key' => 'ct_marked_as_spam',
47
- 'compare' => 'EXISTS'
48
- )
49
- ),
50
- 'count'=>true
51
- );
52
- $cnt_spam = get_comments($args_spam);
53
-
54
- ?>
55
- <!-- AJAX error message -->
56
- <div id="ct_error_message" style="display:none">
57
- <h3>
58
- <?php _e("Ajax error. Process will be automatically restarted in 3 seconds. Status: ", 'cleantalk'); ?><span id="cleantalk_ajax_error"></span> (<span id="cleantalk_js_func"></span>)
59
- </h3>
60
- <h4>Please, check for JavaScript errors in your dashboard and and repair it.</h4>
61
- </div>
62
-
63
- <!-- Deleting message -->
64
- <div id="ct_deleting_message" style="display:none;">
65
- <?php _e("Please wait for a while. CleanTalk is deleting spam comments. Comments left: ", 'cleantalk'); ?> <span id="cleantalk_comments_left">
66
- <?php echo $cnt_spam; ?>
67
- </span>
68
- </div>
69
-
70
- <!-- Main info -->
71
- <h3 id="ct_checking_status"><?php echo ct_ajax_info_comments(true);?></h3>
72
-
73
- <!-- Check options -->
74
- <div class="ct_to_hide" id="ct_check_params_wrapper">
75
- <button class="button ct_check_params_elem" id="ct_check_spam_button" <?php echo !$apbct->data['moderate'] ? 'disabled="disabled"' : ''; ?>><?php _e("Start check", 'cleantalk'); ?></button>
76
- <?php if(!empty($_COOKIE['ct_paused_comments_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk'); ?></button><?php } ?>
77
- <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
78
- <br />
79
- <div class="ct_check_params_elem ct_check_params_elem_sub">
80
- <input id="ct_accurate_check" type="checkbox" value="1" /><b><label for="ct_accurate_check"><?php _e("Accurate check", 'cleantalk'); ?></b></label>
81
- </div>
82
- <p class="ct_check_params_desc"><?php _e("Allows to use comment's dates to perform more accurate check. Could seriously slow down the check.", 'cleantalk'); ?></p>
83
- <br />
84
- <div class="ct_check_params_elem ct_check_params_elem_sub">
85
- <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
86
- </div>
87
- <div class="ct_check_params_desc">
88
- <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo ct_last_checked_comment(); ?>" disabled readonly />
89
- <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo date( "M j Y"); ?>" disabled readonly />
90
- </div>
91
- <div class="ct_check_params_desc">
92
- <p>Begin/end dates of creation comments to check. If no date is specified, the plugin uses the last comments check date.</p>
93
- </div>
94
- <br>
95
- <?php apbct_admin__badge__get_premium(); ?>
96
- </div>
97
-
98
- <!-- Cooling notice -->
99
- <h3 id="ct_cooling_notice"></h3>
100
-
101
- <!-- Preloader and working message -->
102
- <div id="ct_preloader">
103
- <img border=0 src="<?php print plugin_dir_url(__FILE__); ?>images/preloader.gif" />
104
- </div>
105
- <div id="ct_working_message">
106
- <?php _e("Please wait! CleanTalk is checking all approved and pending comments via blacklist database at cleantalk.org. You will have option to delete found spam comments after plugin finish.", 'cleantalk'); ?>
107
- </div>
108
-
109
- <!-- Pause button -->
110
- <button class="button" id="ct_pause">Pause check</button>
111
-
112
- <?php
113
-
114
- // Pagination
115
- $page = !empty($_GET['spam_page']) ? intval($_GET['spam_page']) : 1;
116
- $on_page = 20;
117
-
118
- $args_spam = array(
119
- 'meta_query' => array(
120
- Array(
121
- 'key' => 'ct_marked_as_spam',
122
- 'value' => '1',
123
- 'compare' => 'NUMERIC'
124
- )
125
- ),
126
- 'number'=>$on_page,
127
- 'offset'=>($page-1)*$on_page
128
- );
129
-
130
- $c_spam = get_comments($args_spam);
131
- if($cnt_spam>0){
132
-
133
- $pages = ceil(intval($cnt_spam)/$on_page);
134
- if($pages && $pages != 1){
135
- echo "<div class='ct_to_hide pagination'>"
136
- ."<b>Pages:</b>"
137
- ."<ul class='pagination'>";
138
- for($i = 1; $i <= $pages; $i++){
139
- echo "<li class='pagination'>"
140
- ."<a href='edit-comments.php?page=ct_check_spam&spam_page=$i&ct_worked=1'>"
141
- .($i == $page ? "<span class='current_page'>$i</span>" : $i)
142
- ."</a>"
143
- ."</li>";
144
- }
145
- echo "</ul>";
146
- echo "</div>";
147
- }
148
- ?>
149
- <table class="ct_to_hide widefat fixed comments" id="ct_check_comments_table">
150
- <thead>
151
- <th scope="col" id="cb" class="manage-column column-cb check-column">
152
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
153
- <input id="cb-select-all-1" type="checkbox" style="margin-top:0;"/>
154
- </th>
155
- <th scope="col" id="author" class="manage-column column-slug"><?php print _e( 'Author' ); ?></th>
156
- <th scope="col" id="comment" class="manage-column column-comment"><?php _e( 'Comment', 'cleantalk'); ?></th>
157
- <th scope="col" id="response" class="manage-column column-response sortable desc"><?php _e( 'In Response To', 'cleantalk' );?></th>
158
- </thead>
159
- <tbody id="the-comment-list" data-wp-lists="list:comment">
160
- <?php
161
- for($i=0;$i<sizeof($c_spam);$i++){
162
- $id = $c_spam[$i]->comment_ID;
163
- $post_id = $c_spam[$i]->comment_post_ID;
164
- $login = $c_spam[$i]->comment_author;
165
- $email = $c_spam[$i]->comment_author_email;
166
- $ip = $c_spam[$i]->comment_author_IP;
167
-
168
- echo "<tr id='comment-$id' class='comment even thread-even depth-1 approved cleantalk_comment' data-id='$id'>"
169
- ."<th scope='row' class='check-column'>"
170
- ."<label class='screen-reader-text' for='cb-select-$id'>Select comment</label>"
171
- ."<input id='cb-select-$id' type='checkbox' name='del_comments[]' value='$id'/>"
172
- ."</th>"
173
- ."<td class='author column-author' nowrap>"
174
- ."<strong>"
175
- .get_avatar( $c_spam[$i]->user_id , 32)
176
- ."$login"
177
- ."</strong>"
178
- ."<br />"
179
- ."<br />";
180
-
181
- // Outputs email if exists
182
- if($email)
183
- echo "<a href='mailto:$email'>$email</a>"
184
- .(!$apbct->white_label
185
- ? "<a href='https://cleantalk.org/blacklists/$email' target='_blank'>"
186
- ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none' />"
187
- ."</a>"
188
- : '');
189
- else
190
- echo "No email";
191
- echo "<br/>";
192
-
193
- // Outputs IP if exists
194
- if($ip)
195
- echo "<a href='edit-comments.php?s=$ip&mode=detail'>$ip </a>"
196
- .(!$apbct->white_label
197
- ?"<a href='https://cleantalk.org/blacklists/$ip ' target='_blank'>"
198
- ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none'/>"
199
- ."</a>"
200
- : '');
201
- else
202
- echo "No IP adress";
203
- echo "</td>";
204
- ?>
205
- <td class="comment column-comment">
206
- <div class="submitted-on">
207
- <?php printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), get_comment_link($id),
208
- /* translators: comment date format. See http://php.net/date */
209
- get_comment_date( __( 'Y/m/d' ),$id ),
210
- get_comment_date( get_option( 'time_format' ),$id )
211
- );
212
- ?>
213
-
214
- </div>
215
- <p>
216
- <?php print $c_spam[$i]->comment_content; ?>
217
- </p>
218
- <div style="height:16px; display: none;" id='cleantalk_button_set_<?php print $id; ?>'>
219
- <a href="#" class="cleantalk_delete_from_list_button" data-id="<?php print $id; ?>" style="color:#0a0;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Approve", "cleantalk"); ?></a>
220
- &nbsp;|&nbsp;
221
- <a href="#" class="cleantalk_delete_button" data-id="<?php print $id; ?>" style="color:#a00;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Delete", "cleantalk"); ?></a>
222
- </div>
223
- </td>
224
- <td class="response column-response">
225
- <div>
226
- <span>
227
- <a href="/wp-admin/post.php?post=<?php print $post_id; ?>&action=edit"><?php print get_the_title($post_id); ?></a>
228
- <br/>
229
- <a href="/wp-admin/edit-comments.php?p=<?php print $post_id; ?>" class="post-com-count">
230
- <span class="comment-count"><?php
231
- $p_cnt=wp_count_comments();
232
- print $p_cnt->total_comments;
233
- ?></span>
234
- </a>
235
- </span>
236
- <a href="<?php print get_permalink($post_id); ?>"><?php print _e('View Post');?></a>
237
- </div>
238
- </td>
239
- </tr>
240
- <?php
241
- }
242
- ?>
243
- </tbody>
244
- </table>
245
- <?php
246
- // Pagination
247
- if($pages && $pages != 1){
248
- echo "<div class='ct_to_hide pagination'>"
249
- ."<b>Pages:</b>"
250
- ."<ul class='pagination'>";
251
- for($i = 1; $i <= $pages; $i++){
252
- echo "<li class='pagination'>"
253
- ."<a href='edit-comments.php?page=ct_check_spam&spam_page=$i&ct_worked=1'>"
254
- .($i == $page ? "<span class='current_page'>$i</span>" : $i)
255
- ."</a>"
256
- ."</li>";
257
- }
258
- echo "</ul>";
259
- echo "</div>";
260
- }
261
- ?>
262
- <div class="ct_to_hide" id="ct_tools_buttons" style="margin-top: 10px;">
263
- <button class= "button" id="ct_delete_all"><?php _e('Delete all comments from the list', 'cleantalk'); ?></button>
264
- <button class="button" id="ct_delete_checked"><?php _e('Delete selected', 'cleantalk'); ?></button><br /><br />
265
- </div>
266
- <?php
267
- }
268
- echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_insert_comments">'. __('Insert comments', 'cleantalk') .' (100)</button> ' : '';
269
- echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_delete_comments">'. __('Delete comments', 'cleantalk') .' (110)</button>' : '';
270
-
271
- if($cnt_spam > 0){
272
- echo "<div id='ct_search_info'>"
273
- ."<br />"
274
- .__('There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.', 'cleantalk')
275
- ."</div>";
276
- }
277
- ?>
278
- <div>
279
- <button class="button" id="ct_stop_deletion" style="display:none;"><?php _e("Stop deletion", 'cleantalk'); ?></button>
280
- </div>
281
- </div>
282
- <?php
283
- }
284
-
285
- function ct_ajax_check_comments(){
286
-
287
- check_ajax_referer( 'ct_secret_nonce', 'security' );
288
-
289
- global $wpdb, $apbct;
290
-
291
- if(isset($_POST['from'], $_POST['till'])){
292
- $from_date = date('Y-m-d', intval(strtotime($_POST['from'])));
293
- $till_date = date('Y-m-d', intval(strtotime($_POST['till'])));
294
- }
295
-
296
- // Gettings comments 100 unchecked comments
297
- if(isset($_COOKIE['ct_comments_safe_check'])){
298
- $c = $wpdb->get_results("
299
- SELECT comment_ID, comment_date_gmt, comment_author_IP, comment_author_email
300
- FROM {$wpdb->comments} as comm
301
- WHERE
302
- (comm.comment_approved = '1' OR comm.comment_approved = '0')
303
- AND NOT EXISTS(
304
- SELECT comment_id, meta_key
305
- FROM {$wpdb->commentmeta} as meta
306
- WHERE comm.comment_ID = meta.comment_id AND (meta_key = 'ct_checked' OR meta_key = 'ct_bad')
307
- )
308
- ORDER BY comment_date_gmt
309
- LIMIT 100",
310
- ARRAY_A
311
- );
312
- }else{
313
- $params = array(
314
- 'meta_query' => array(
315
- 'relation' => 'AND',
316
- array(
317
- 'key' => 'ct_checked',
318
- 'compare' => 'NOT EXISTS'
319
- ),
320
- array(
321
- 'key' => 'ct_bad',
322
- 'compare' => 'NOT EXISTS'
323
- )
324
- ),
325
- 'orderby' => 'comment_date_gmt',
326
- 'order' => 'ASC',
327
- 'number' => 100
328
- );
329
- if(isset($from_date, $till_date)){
330
- $params['date_query'] = array(
331
- 'column' => 'comment_date_gmt',
332
- 'after' => $from_date,
333
- 'before' => $till_date,
334
- 'inclusive' => true,
335
- );
336
- }
337
- $c = get_comments( $params );
338
- }
339
-
340
- $check_result = array(
341
- 'end' => 0,
342
- 'checked' => 0,
343
- 'spam' => 0,
344
- 'bad' => 0,
345
- 'error' => 0
346
- );
347
-
348
- if(sizeof($c)>0){
349
-
350
- // Coverting $c to objects
351
- if(is_array($c[0])){
352
- foreach($c as $key => $value){
353
- $c[$key] = (object)$value;
354
- } unset($key, $value);
355
- }
356
-
357
- if(!empty($_POST['accurate_check'])){
358
- // Leaving comments only with first comment's date. Unsetting others.
359
-
360
- foreach($c as $comment_index => $comment){
361
-
362
- if(!isset($curr_date))
363
- $curr_date = (substr($comment->comment_date_gmt, 0, 10) ? substr($comment->comment_date_gmt, 0, 10) : '');
364
-
365
- if(substr($comment->comment_date_gmt, 0, 10) != $curr_date)
366
- unset($c[$comment_index]);
367
-
368
- }
369
- unset($comment_index, $comment);
370
- }
371
-
372
- // Checking comments IP/Email. Gathering $data for check.
373
- $data = Array();
374
- for($i=0;$i<sizeof($c);$i++){
375
-
376
- $curr_ip = $c[$i]->comment_author_IP;
377
- $curr_email = $c[$i]->comment_author_email;
378
-
379
- // Check for identity
380
- $curr_ip = preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $curr_ip) === 1 ? $curr_ip : null;
381
- $curr_email = preg_match('/^\S+@\S+\.\S+$/', $curr_email) === 1 ? $curr_email : null;
382
-
383
- if(empty($curr_ip) && empty($curr_email)){
384
- $check_result['bad']++;
385
- update_comment_meta($c[$i]->comment_ID,'ct_bad','1');
386
- unset($c[$i]);
387
- }else{
388
- if(!empty($curr_ip))
389
- $data[] = $curr_ip;
390
- if(!empty($curr_email))
391
- $data[] = $curr_email;
392
- // Patch for empty IP/Email
393
- $c[$i]->comment_author_IP = empty($curr_ip) ? 'none' : $curr_ip;
394
- $c[$i]->comment_author_email = empty($curr_email) ? 'none' : $curr_email;
395
- }
396
- }
397
-
398
- // Recombining after checking and unsettting
399
- $c = array_values($c);
400
-
401
- // Drop if data empty and there's no comments to check
402
- if(count($data) == 0){
403
- if($_POST['unchecked'] === 0)
404
- $check_result['end'] = 1;
405
- print json_encode($check_result);
406
- die();
407
- }
408
-
409
- $result = CleantalkAPI::method__spam_check_cms($apbct->api_key, $data, !empty($_POST['accurate_check']) ? $curr_date : null);
410
-
411
- if(empty($result['error'])){
412
-
413
- for($i=0;$i<sizeof($c);$i++){
414
-
415
- $mark_spam_ip = false;
416
- $mark_spam_email = false;
417
-
418
- $check_result['checked']++;
419
- update_comment_meta($c[$i]->comment_ID,'ct_checked',date("Y-m-d H:m:s"));
420
- $uip=$c[$i]->comment_author_IP;
421
- $uim=$c[$i]->comment_author_email;
422
-
423
- if(isset($result[$uip]) && $result[$uip]['appears'] == 1)
424
- $mark_spam_ip = true;
425
-
426
- if(isset($result[$uim]) && $result[$uim]['appears'] == 1)
427
- $mark_spam_email = true;
428
-
429
- if ($mark_spam_ip || $mark_spam_email){
430
- $check_result['spam']++;
431
- update_comment_meta($c[$i]->comment_ID,'ct_marked_as_spam','1');
432
- }
433
- }
434
- print json_encode($check_result);
435
-
436
- }else{
437
- $check_result['error'] = 1;
438
- $check_result['error_message'] = $result['error'];
439
- echo json_encode($check_result);
440
- }
441
- }else{
442
- $check_result['end'] = 1;
443
- print json_encode($check_result);
444
- }
445
-
446
- die;
447
- }
448
-
449
- function ct_ajax_info_comments($direct_call = false){
450
-
451
- if (!$direct_call)
452
- check_ajax_referer( 'ct_secret_nonce', 'security' );
453
-
454
- global $wpdb;
455
-
456
- $metas = array('', 'ct_marked_as_spam', 'ct_checked', 'ct_bad');
457
-
458
- $result = array();
459
- foreach($metas as $meta){
460
- if(isset($_COOKIE['ct_comments_safe_check'])){
461
- $res = $wpdb->get_results("
462
- SELECT COUNT(DISTINCT comment_ID) AS cnt
463
- FROM {$wpdb->comments} AS comm
464
- WHERE comm.comment_approved IN ('1','0')".
465
- (!empty($meta)
466
- ? " AND EXISTS (SELECT comment_id, meta_key
467
- FROM {$wpdb->commentmeta} meta
468
- WHERE comm.comment_ID = meta.comment_id AND meta_key = '$meta')"
469
- : ''),
470
- ARRAY_A);
471
- $result[] = $res[0]['cnt'];
472
- }else{
473
- $params = array('fields' => 'ids', 'count' => true);
474
- if(!empty($meta))
475
- $params['meta_key'] = $meta;
476
- $result[] = get_comments( $params );
477
- }
478
- }
479
-
480
- $cnt = $result[0]; // Total comments
481
- $cnt_spam = $result[1]; // Spam comments
482
- $cnt_checked = $result[2]; // Checked comments
483
- $cnt_bad = $result[3]; // Bad comments (without IP and Email)
484
-
485
- $return = array(
486
- 'message' => '',
487
- 'total' => $cnt,
488
- 'spam' => $cnt_spam,
489
- 'checked' => $cnt_checked,
490
- 'bad' => $cnt_bad,
491
- );
492
-
493
- $return['message'] .= sprintf (__("Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad comments (without IP or email).", 'cleantalk'), $cnt, $cnt_checked, ct_get_last_comment_check_date(), $cnt_spam, $cnt_bad);
494
-
495
- $backup_notice = '&nbsp;';
496
- if ($cnt_spam > 0){
497
- $backup_notice = __("Please do backup of WordPress database before delete any comments!", 'cleantalk');
498
- }
499
- $return['message'] .= "<p>$backup_notice</p>";
500
-
501
- if($direct_call){
502
- return $return['message'];
503
- }else{
504
- echo json_encode($return);
505
- die();
506
- }
507
-
508
- }
509
-
510
-
511
- function ct_ajax_insert_comments(){
512
-
513
- check_ajax_referer( 'ct_secret_nonce', 'security' );
514
-
515
- //* DELETION
516
- if(!empty($_POST['delete'])){
517
- $comments = get_comments(array('author_email' => 'stop_email@example.com'));
518
- $deleted = 0;
519
- $amount_to_delete = 15;
520
- foreach($comments as $comment){
521
- if($deleted >= $amount_to_delete)
522
- break;
523
- if(wp_delete_comment($comment->comment_ID, true))
524
- $deleted++;
525
- }
526
- print "$deleted";
527
- die();
528
- }
529
-
530
- //* INSERTION
531
- global $wpdb;
532
-
533
- $to_insert = 100;
534
- $time = current_time('timestamp')-(730*86400);
535
-
536
- $result = $wpdb->get_results('SELECT network FROM `'. APBCT_TBL_FIREWALL_DATA .'` LIMIT '. $to_insert .';', ARRAY_A);
537
-
538
- if($result){
539
- $ip = array();
540
- foreach($result as $value){
541
- $ips[] = long2ip($value['network']);
542
- }
543
- unset($value);
544
-
545
- $inserted = 0;
546
- for($i=0, $j=0; $i<$to_insert; $i++, $j++){
547
-
548
- if(!isset($ips[$j]))
549
- $j=0;
550
-
551
- $rnd=mt_rand(1,100);
552
-
553
- $email="stop_email@example.com";
554
-
555
- $data = array(
556
- 'comment_post_ID' => 1,
557
- 'comment_author' => "author_$rnd",
558
- 'comment_author_email' => $email,
559
- 'comment_author_url' => 'http://',
560
- 'comment_content' => "comment content ".mt_rand(1,10000)." ".mt_rand(1,10000)." ".mt_rand(1,10000),
561
- 'comment_type' => '',
562
- 'comment_parent' => 0,
563
- 'user_id' => 1,
564
- 'comment_author_IP' => $ips[$j],
565
- 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
566
- 'comment_date' => date('Y-m-d H:i:s', $time),
567
- 'comment_approved' => 1,
568
- );
569
-
570
- wp_insert_comment($data);
571
- $time = $time + 86400;
572
- $inserted++;
573
- }
574
- }else{
575
- $inserted = '0';
576
- }
577
-
578
- print $inserted;
579
- die();
580
- }
581
-
582
- function ct_ajax_delete_checked(){
583
- check_ajax_referer( 'ct_secret_nonce', 'security' );
584
- foreach($_POST['ids'] as $key=>$value){
585
- wp_delete_comment($value, false);
586
- }
587
- die();
588
- }
589
-
590
- function ct_ajax_delete_all(){
591
- check_ajax_referer( 'ct_secret_nonce', 'security' );
592
- $args_spam = array(
593
- 'number'=>100,
594
- 'meta_query' => array(
595
- Array(
596
- 'key' => 'ct_marked_as_spam',
597
- 'value' => '1',
598
- 'compare' => 'NUMERIC'
599
- )
600
- )
601
- );
602
- $c_spam=get_comments($args_spam);
603
-
604
- $cnt=sizeof($c_spam);
605
-
606
- $args_spam = array(
607
- 'count'=>true,
608
- 'meta_query' => array(
609
- Array(
610
- 'key' => 'ct_marked_as_spam',
611
- 'value' => '1',
612
- 'compare' => 'NUMERIC'
613
- )
614
- )
615
- );
616
- $cnt_all=get_comments($args_spam);
617
-
618
- for($i=0;$i<sizeof($c_spam);$i++){
619
- wp_delete_comment($c_spam[$i]->comment_ID, false);
620
- usleep(10000);
621
- }
622
- print $cnt_all;
623
- die();
624
- }
625
-
626
- function ct_ajax_clear_comments(){
627
-
628
- check_ajax_referer( 'ct_secret_nonce', 'security' );
629
-
630
- if ( isset($_POST['from']) && isset($_POST['till']) ) {
631
- if ( preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['from'] ) && preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['till'] ) ) {
632
-
633
- $from = date('Y-m-d', intval(strtotime($_POST['from']))) . ' 00:00:00';
634
- $till = date('Y-m-d', intval(strtotime($_POST['till']))) . ' 23:59:59';
635
-
636
- global $wpdb;
637
- $query_result = $wpdb->query("DELETE FROM {$wpdb->commentmeta} WHERE
638
- meta_key IN ('ct_checked', 'ct_marked_as_spam', 'ct_bad')
639
- AND meta_value >= '{$from}'
640
- AND meta_value <= '{$till}';");
641
-
642
- die();
643
-
644
- }
645
- }
646
-
647
- }
648
-
649
- /**
650
- * Admin action 'comment_unapproved_to_approved' - Approve comment, delete from the deleting list
651
- */
652
- function ct_comment_check_approve_comment(){
653
-
654
- check_ajax_referer( 'ct_secret_nonce', 'security' );
655
-
656
- $id=$_POST['id'];
657
- $comment = get_comment($id, 'ARRAY_A');
658
- $comment['comment_content'] = apbct_comment__unmark_red($comment['comment_content']);
659
- $comment['comment_approved'] = 1;
660
- update_comment_meta($id, 'ct_marked_as_spam', 0);
661
- wp_update_comment($comment);
662
-
663
- die();
664
- }
665
-
666
- /**
667
- * Get date last checked comment or date of the first comment
668
- *
669
- * @return string date "M j Y"
670
- */
671
- function ct_last_checked_comment() {
672
-
673
- $params = array(
674
- 'fields' => 'ids',
675
- 'meta_key' => 'ct_checked',
676
- 'orderby' => 'ct_checked',
677
- 'order' => 'ASC'
678
- );
679
- $checked_comments = get_comments( $params );
680
-
681
- if ( ! empty($checked_comments) ) {
682
-
683
- return get_comment_date( "M j Y", end( $checked_comments ) );
684
-
685
- } else {
686
-
687
- $params = array(
688
- 'fields' => 'ids',
689
- 'orderby' => 'comment_date_gmt',
690
- 'order' => 'ASC',
691
- 'number' => 1
692
- );
693
- $first_comment = get_comments( $params );
694
-
695
- return get_comment_date( "M j Y", current( $first_comment ) );
696
-
697
- }
698
-
699
- }
700
-
701
- /**
702
- * Get last comments check date.
703
- *
704
- * @return string|null Date format"M j Y" or datetime format or null
705
- */
706
- function ct_get_last_comment_check_date( $timestamp = false ) {
707
-
708
- $params = array(
709
- 'fields' => 'ids',
710
- 'meta_key' => 'ct_checked',
711
- 'orderby' => 'comment_date_gmt',
712
- 'order' => 'ASC'
713
- );
714
- $checked_comments = get_comments( $params );
715
-
716
- $last_check = null;
717
-
718
- if( ! empty( $checked_comments ) ) {
719
-
720
- $last_check = $timestamp ? get_comment_meta( end( $checked_comments ), 'ct_checked', true ) : date( "M j Y", strtotime( get_comment_meta( end( $checked_comments ), 'ct_checked', true ) ) );
721
-
722
- }
723
-
724
- return $last_check;
725
-
726
  }
1
+ <?php
2
+
3
+ add_action('admin_menu', 'ct_add_comments_menu');
4
+ add_action( 'wp_ajax_ajax_check_comments', 'ct_ajax_check_comments' );
5
+ add_action( 'wp_ajax_ajax_info_comments', 'ct_ajax_info_comments' );
6
+ add_action( 'wp_ajax_ajax_insert_comments', 'ct_ajax_insert_comments' );
7
+ add_action( 'wp_ajax_ajax_delete_checked', 'ct_ajax_delete_checked' );
8
+ add_action( 'wp_ajax_ajax_delete_all', 'ct_ajax_delete_all' );
9
+ add_action( 'wp_ajax_ajax_clear_comments', 'ct_ajax_clear_comments' );
10
+ add_action( 'wp_ajax_ajax_ct_approve_comment', 'ct_comment_check_approve_comment' );
11
+
12
+ function ct_add_comments_menu(){
13
+ if(current_user_can('activate_plugins'))
14
+ add_comments_page( __("Check for spam", 'cleantalk'), __("Find spam comments", 'cleantalk'), 'read', 'ct_check_spam', 'ct_show_checkspam_page');
15
+ }
16
+
17
+ function ct_show_checkspam_page(){
18
+
19
+ global $apbct;
20
+
21
+ ?>
22
+ <div class="wrap">
23
+ <h2><img src="<?php echo $apbct->logo__small__colored; ?>" /> <?php echo $apbct->plugin_name; ?></h2>
24
+ <a style="color: gray; margin-left: 23px;" href="<?php echo $apbct->settings_link; ?>"><?php _e('Plugin Settings', 'cleantalk'); ?></a>
25
+ <br />
26
+ <?php
27
+
28
+ // If access key is unset in
29
+ if(!apbct_api_key__is_correct()){
30
+ if($apbct->moderate_ip == 1){
31
+ echo '<h3>'
32
+ .sprintf(
33
+ __('Antispam hosting tariff does not allow you to use this feature. To do so, you need to enter an Access Key in the %splugin settings%s.', 'cleantalk'),
34
+ '<a href="' . (is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk').'">',
35
+ '</a>'
36
+ )
37
+ .'</h3>';
38
+ return;
39
+ }
40
+ }
41
+
42
+ // Getting total spam comments
43
+ $args_spam = array(
44
+ 'meta_query' => array(
45
+ Array(
46
+ 'key' => 'ct_marked_as_spam',
47
+ 'compare' => 'EXISTS'
48
+ )
49
+ ),
50
+ 'count'=>true
51
+ );
52
+ $cnt_spam = get_comments($args_spam);
53
+
54
+ ?>
55
+ <!-- AJAX error message -->
56
+ <div id="ct_error_message" style="display:none">
57
+ <h3>
58
+ <?php _e("Ajax error. Process will be automatically restarted in 3 seconds. Status: ", 'cleantalk'); ?><span id="cleantalk_ajax_error"></span> (<span id="cleantalk_js_func"></span>)
59
+ </h3>
60
+ <h4>Please, check for JavaScript errors in your dashboard and and repair it.</h4>
61
+ </div>
62
+
63
+ <!-- Deleting message -->
64
+ <div id="ct_deleting_message" style="display:none;">
65
+ <?php _e("Please wait for a while. CleanTalk is deleting spam comments. Comments left: ", 'cleantalk'); ?> <span id="cleantalk_comments_left">
66
+ <?php echo $cnt_spam; ?>
67
+ </span>
68
+ </div>
69
+
70
+ <!-- Main info -->
71
+ <h3 id="ct_checking_status"><?php echo ct_ajax_info_comments(true);?></h3>
72
+
73
+ <!-- Check options -->
74
+ <div class="ct_to_hide" id="ct_check_params_wrapper">
75
+ <button class="button ct_check_params_elem" id="ct_check_spam_button" <?php echo !$apbct->data['moderate'] ? 'disabled="disabled"' : ''; ?>><?php _e("Start check", 'cleantalk'); ?></button>
76
+ <?php if(!empty($_COOKIE['ct_paused_comments_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk'); ?></button><?php } ?>
77
+ <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
78
+ <br />
79
+ <div class="ct_check_params_elem ct_check_params_elem_sub">
80
+ <input id="ct_accurate_check" type="checkbox" value="1" /><b><label for="ct_accurate_check"><?php _e("Accurate check", 'cleantalk'); ?></b></label>
81
+ </div>
82
+ <p class="ct_check_params_desc"><?php _e("Allows to use comment's dates to perform more accurate check. Could seriously slow down the check.", 'cleantalk'); ?></p>
83
+ <br />
84
+ <div class="ct_check_params_elem ct_check_params_elem_sub">
85
+ <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
86
+ </div>
87
+ <div class="ct_check_params_desc">
88
+ <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo ct_last_checked_comment(); ?>" disabled readonly />
89
+ <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo date( "M j Y"); ?>" disabled readonly />
90
+ </div>
91
+ <div class="ct_check_params_desc">
92
+ <p>Begin/end dates of creation comments to check. If no date is specified, the plugin uses the last comments check date.</p>
93
+ </div>
94
+ <br>
95
+ <?php apbct_admin__badge__get_premium(); ?>
96
+ </div>
97
+
98
+ <!-- Cooling notice -->
99
+ <h3 id="ct_cooling_notice"></h3>
100
+
101
+ <!-- Preloader and working message -->
102
+ <div id="ct_preloader">
103
+ <img border=0 src="<?php print plugin_dir_url(__FILE__); ?>images/preloader.gif" />
104
+ </div>
105
+ <div id="ct_working_message">
106
+ <?php _e("Please wait! CleanTalk is checking all approved and pending comments via blacklist database at cleantalk.org. You will have option to delete found spam comments after plugin finish.", 'cleantalk'); ?>
107
+ </div>
108
+
109
+ <!-- Pause button -->
110
+ <button class="button" id="ct_pause">Pause check</button>
111
+
112
+ <?php
113
+
114
+ // Pagination
115
+ $page = !empty($_GET['spam_page']) ? intval($_GET['spam_page']) : 1;
116
+ $on_page = 20;
117
+
118
+ $args_spam = array(
119
+ 'meta_query' => array(
120
+ Array(
121
+ 'key' => 'ct_marked_as_spam',
122
+ 'value' => '1',
123
+ 'compare' => 'NUMERIC'
124
+ )
125
+ ),
126
+ 'number'=>$on_page,
127
+ 'offset'=>($page-1)*$on_page
128
+ );
129
+
130
+ $c_spam = get_comments($args_spam);
131
+ if($cnt_spam>0){
132
+
133
+ $pages = ceil(intval($cnt_spam)/$on_page);
134
+ if($pages && $pages != 1){
135
+ echo "<div class='ct_to_hide pagination'>"
136
+ ."<b>Pages:</b>"
137
+ ."<ul class='pagination'>";
138
+ for($i = 1; $i <= $pages; $i++){
139
+ echo "<li class='pagination'>"
140
+ ."<a href='edit-comments.php?page=ct_check_spam&spam_page=$i&ct_worked=1'>"
141
+ .($i == $page ? "<span class='current_page'>$i</span>" : $i)
142
+ ."</a>"
143
+ ."</li>";
144
+ }
145
+ echo "</ul>";
146
+ echo "</div>";
147
+ }
148
+ ?>
149
+ <table class="ct_to_hide widefat fixed comments" id="ct_check_comments_table">
150
+ <thead>
151
+ <th scope="col" id="cb" class="manage-column column-cb check-column">
152
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
153
+ <input id="cb-select-all-1" type="checkbox" style="margin-top:0;"/>
154
+ </th>
155
+ <th scope="col" id="author" class="manage-column column-slug"><?php print _e( 'Author' ); ?></th>
156
+ <th scope="col" id="comment" class="manage-column column-comment"><?php _e( 'Comment', 'cleantalk'); ?></th>
157
+ <th scope="col" id="response" class="manage-column column-response sortable desc"><?php _e( 'In Response To', 'cleantalk' );?></th>
158
+ </thead>
159
+ <tbody id="the-comment-list" data-wp-lists="list:comment">
160
+ <?php
161
+ for($i=0;$i<sizeof($c_spam);$i++){
162
+ $id = $c_spam[$i]->comment_ID;
163
+ $post_id = $c_spam[$i]->comment_post_ID;
164
+ $login = $c_spam[$i]->comment_author;
165
+ $email = $c_spam[$i]->comment_author_email;
166
+ $ip = $c_spam[$i]->comment_author_IP;
167
+
168
+ echo "<tr id='comment-$id' class='comment even thread-even depth-1 approved cleantalk_comment' data-id='$id'>"
169
+ ."<th scope='row' class='check-column'>"
170
+ ."<label class='screen-reader-text' for='cb-select-$id'>Select comment</label>"
171
+ ."<input id='cb-select-$id' type='checkbox' name='del_comments[]' value='$id'/>"
172
+ ."</th>"
173
+ ."<td class='author column-author' nowrap>"
174
+ ."<strong>"
175
+ .get_avatar( $c_spam[$i]->user_id , 32)
176
+ ."$login"
177
+ ."</strong>"
178
+ ."<br />"
179
+ ."<br />";
180
+
181
+ // Outputs email if exists
182
+ if($email)
183
+ echo "<a href='mailto:$email'>$email</a>"
184
+ .(!$apbct->white_label
185
+ ? "<a href='https://cleantalk.org/blacklists/$email' target='_blank'>"
186
+ ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none' />"
187
+ ."</a>"
188
+ : '');
189
+ else
190
+ echo "No email";
191
+ echo "<br/>";
192
+
193
+ // Outputs IP if exists
194
+ if($ip)
195
+ echo "<a href='edit-comments.php?s=$ip&mode=detail'>$ip </a>"
196
+ .(!$apbct->white_label
197
+ ?"<a href='https://cleantalk.org/blacklists/$ip ' target='_blank'>"
198
+ ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none'/>"
199
+ ."</a>"
200
+ : '');
201
+ else
202
+ echo "No IP adress";
203
+ echo "</td>";
204
+ ?>
205
+ <td class="comment column-comment">
206
+ <div class="submitted-on">
207
+ <?php printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), get_comment_link($id),
208
+ /* translators: comment date format. See http://php.net/date */
209
+ get_comment_date( __( 'Y/m/d' ),$id ),
210
+ get_comment_date( get_option( 'time_format' ),$id )
211
+ );
212
+ ?>
213
+
214
+ </div>
215
+ <p>
216
+ <?php print $c_spam[$i]->comment_content; ?>
217
+ </p>
218
+ <div style="height:16px; display: none;" id='cleantalk_button_set_<?php print $id; ?>'>
219
+ <a href="#" class="cleantalk_delete_from_list_button" data-id="<?php print $id; ?>" style="color:#0a0;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Approve", "cleantalk"); ?></a>
220
+ &nbsp;|&nbsp;
221
+ <a href="#" class="cleantalk_delete_button" data-id="<?php print $id; ?>" style="color:#a00;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Delete", "cleantalk"); ?></a>
222
+ </div>
223
+ </td>
224
+ <td class="response column-response">
225
+ <div>
226
+ <span>
227
+ <a href="/wp-admin/post.php?post=<?php print $post_id; ?>&action=edit"><?php print get_the_title($post_id); ?></a>
228
+ <br/>
229
+ <a href="/wp-admin/edit-comments.php?p=<?php print $post_id; ?>" class="post-com-count">
230
+ <span class="comment-count"><?php
231
+ $p_cnt=wp_count_comments();
232
+ print $p_cnt->total_comments;
233
+ ?></span>
234
+ </a>
235
+ </span>
236
+ <a href="<?php print get_permalink($post_id); ?>"><?php print _e('View Post');?></a>
237
+ </div>
238
+ </td>
239
+ </tr>
240
+ <?php
241
+ }
242
+ ?>
243
+ </tbody>
244
+ </table>
245
+ <?php
246
+ // Pagination
247
+ if($pages && $pages != 1){
248
+ echo "<div class='ct_to_hide pagination'>"
249
+ ."<b>Pages:</b>"
250
+ ."<ul class='pagination'>";
251
+ for($i = 1; $i <= $pages; $i++){
252
+ echo "<li class='pagination'>"
253
+ ."<a href='edit-comments.php?page=ct_check_spam&spam_page=$i&ct_worked=1'>"
254
+ .($i == $page ? "<span class='current_page'>$i</span>" : $i)
255
+ ."</a>"
256
+ ."</li>";
257
+ }
258
+ echo "</ul>";
259
+ echo "</div>";
260
+ }
261
+ ?>
262
+ <div class="ct_to_hide" id="ct_tools_buttons" style="margin-top: 10px;">
263
+ <button class= "button" id="ct_delete_all"><?php _e('Delete all comments from the list', 'cleantalk'); ?></button>
264
+ <button class="button" id="ct_delete_checked"><?php _e('Delete selected', 'cleantalk'); ?></button><br /><br />
265
+ </div>
266
+ <?php
267
+ }
268
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_insert_comments">'. __('Insert comments', 'cleantalk') .' (100)</button> ' : '';
269
+ echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="button ct_to_hide" id="ct_delete_comments">'. __('Delete comments', 'cleantalk') .' (110)</button>' : '';
270
+
271
+ if($cnt_spam > 0){
272
+ echo "<div id='ct_search_info'>"
273
+ ."<br />"
274
+ .__('There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.', 'cleantalk')
275
+ ."</div>";
276
+ }
277
+ ?>
278
+ <div>
279
+ <button class="button" id="ct_stop_deletion" style="display:none;"><?php _e("Stop deletion", 'cleantalk'); ?></button>
280
+ </div>
281
+ </div>
282
+ <?php
283
+ }
284
+
285
+ function ct_ajax_check_comments(){
286
+
287
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
288
+
289
+ global $wpdb, $apbct;
290
+
291
+ if(isset($_POST['from'], $_POST['till'])){
292
+ $from_date = date('Y-m-d', intval(strtotime($_POST['from'])));
293
+ $till_date = date('Y-m-d', intval(strtotime($_POST['till'])));
294
+ }
295
+
296
+ // Gettings comments 100 unchecked comments
297
+ if(isset($_COOKIE['ct_comments_safe_check'])){
298
+ $c = $wpdb->get_results("
299
+ SELECT comment_ID, comment_date_gmt, comment_author_IP, comment_author_email
300
+ FROM {$wpdb->comments} as comm
301
+ WHERE
302
+ (comm.comment_approved = '1' OR comm.comment_approved = '0')
303
+ AND NOT EXISTS(
304
+ SELECT comment_id, meta_key
305
+ FROM {$wpdb->commentmeta} as meta
306
+ WHERE comm.comment_ID = meta.comment_id AND (meta_key = 'ct_checked' OR meta_key = 'ct_bad')
307
+ )
308
+ ORDER BY comment_date_gmt
309
+ LIMIT 100",
310
+ ARRAY_A
311
+ );
312
+ }else{
313
+ $params = array(
314
+ 'meta_query' => array(
315
+ 'relation' => 'AND',
316
+ array(
317
+ 'key' => 'ct_checked',
318
+ 'compare' => 'NOT EXISTS'
319
+ ),
320
+ array(
321
+ 'key' => 'ct_bad',
322
+ 'compare' => 'NOT EXISTS'
323
+ )
324
+ ),
325
+ 'orderby' => 'comment_date_gmt',
326
+ 'order' => 'ASC',
327
+ 'number' => 100
328
+ );
329
+ if(isset($from_date, $till_date)){
330
+ $params['date_query'] = array(
331
+ 'column' => 'comment_date_gmt',
332
+ 'after' => $from_date,
333
+ 'before' => $till_date,
334
+ 'inclusive' => true,
335
+ );
336
+ }
337
+ $c = get_comments( $params );
338
+ }
339
+
340
+ $check_result = array(
341
+ 'end' => 0,
342
+ 'checked' => 0,
343
+ 'spam' => 0,
344
+ 'bad' => 0,
345
+ 'error' => 0
346
+ );
347
+
348
+ if(sizeof($c)>0){
349
+
350
+ // Coverting $c to objects
351
+ if(is_array($c[0])){
352
+ foreach($c as $key => $value){
353
+ $c[$key] = (object)$value;
354
+ } unset($key, $value);
355
+ }
356
+
357
+ if(!empty($_POST['accurate_check'])){
358
+ // Leaving comments only with first comment's date. Unsetting others.
359
+
360
+ foreach($c as $comment_index => $comment){
361
+
362
+ if(!isset($curr_date))
363
+ $curr_date = (substr($comment->comment_date_gmt, 0, 10) ? substr($comment->comment_date_gmt, 0, 10) : '');
364
+
365
+ if(substr($comment->comment_date_gmt, 0, 10) != $curr_date)
366
+ unset($c[$comment_index]);
367
+
368
+ }
369
+ unset($comment_index, $comment);
370
+ }
371
+
372
+ // Checking comments IP/Email. Gathering $data for check.
373
+ $data = Array();
374
+ for($i=0;$i<sizeof($c);$i++){
375
+
376
+ $curr_ip = $c[$i]->comment_author_IP;
377
+ $curr_email = $c[$i]->comment_author_email;
378
+
379
+ // Check for identity
380
+ $curr_ip = preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $curr_ip) === 1 ? $curr_ip : null;
381
+ $curr_email = preg_match('/^\S+@\S+\.\S+$/', $curr_email) === 1 ? $curr_email : null;
382
+
383
+ if(empty($curr_ip) && empty($curr_email)){
384
+ $check_result['bad']++;
385
+ update_comment_meta($c[$i]->comment_ID,'ct_bad','1');
386
+ unset($c[$i]);
387
+ }else{
388
+ if(!empty($curr_ip))
389
+ $data[] = $curr_ip;
390
+ if(!empty($curr_email))
391
+ $data[] = $curr_email;
392
+ // Patch for empty IP/Email
393
+ $c[$i]->comment_author_IP = empty($curr_ip) ? 'none' : $curr_ip;
394
+ $c[$i]->comment_author_email = empty($curr_email) ? 'none' : $curr_email;
395
+ }
396
+ }
397
+
398
+ // Recombining after checking and unsettting
399
+ $c = array_values($c);
400
+
401
+ // Drop if data empty and there's no comments to check
402
+ if(count($data) == 0){
403
+ if($_POST['unchecked'] === 0)
404
+ $check_result['end'] = 1;
405
+ print json_encode($check_result);
406
+ die();
407
+ }
408
+
409
+ $result = CleantalkAPI::method__spam_check_cms($apbct->api_key, $data, !empty($_POST['accurate_check']) ? $curr_date : null);
410
+
411
+ if(empty($result['error'])){
412
+
413
+ for($i=0;$i<sizeof($c);$i++){
414
+
415
+ $mark_spam_ip = false;
416
+ $mark_spam_email = false;
417
+
418
+ $check_result['checked']++;
419
+ update_comment_meta($c[$i]->comment_ID,'ct_checked',date("Y-m-d H:m:s"));
420
+ $uip=$c[$i]->comment_author_IP;
421
+ $uim=$c[$i]->comment_author_email;
422
+
423
+ if(isset($result[$uip]) && $result[$uip]['appears'] == 1)
424
+ $mark_spam_ip = true;
425
+
426
+ if(isset($result[$uim]) && $result[$uim]['appears'] == 1)
427
+ $mark_spam_email = true;
428
+
429
+ if ($mark_spam_ip || $mark_spam_email){
430
+ $check_result['spam']++;
431
+ update_comment_meta($c[$i]->comment_ID,'ct_marked_as_spam','1');
432
+ }
433
+ }
434
+ print json_encode($check_result);
435
+
436
+ }else{
437
+ $check_result['error'] = 1;
438
+ $check_result['error_message'] = $result['error'];
439
+ echo json_encode($check_result);
440
+ }
441
+ }else{
442
+ $check_result['end'] = 1;
443
+ print json_encode($check_result);
444
+ }
445
+
446
+ die;
447
+ }
448
+
449
+ function ct_ajax_info_comments($direct_call = false){
450
+
451
+ if (!$direct_call)
452
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
453
+
454
+ global $wpdb;
455
+
456
+ $metas = array('', 'ct_marked_as_spam', 'ct_checked', 'ct_bad');
457
+
458
+ $result = array();
459
+ foreach($metas as $meta){
460
+ if(isset($_COOKIE['ct_comments_safe_check'])){
461
+ $res = $wpdb->get_results("
462
+ SELECT COUNT(DISTINCT comment_ID) AS cnt
463
+ FROM {$wpdb->comments} AS comm
464
+ WHERE comm.comment_approved IN ('1','0')".
465
+ (!empty($meta)
466
+ ? " AND EXISTS (SELECT comment_id, meta_key
467
+ FROM {$wpdb->commentmeta} meta
468
+ WHERE comm.comment_ID = meta.comment_id AND meta_key = '$meta')"
469
+ : ''),
470
+ ARRAY_A);
471
+ $result[] = $res[0]['cnt'];
472
+ }else{
473
+ $params = array('fields' => 'ids', 'count' => true);
474
+ if(!empty($meta))
475
+ $params['meta_key'] = $meta;
476
+ $result[] = get_comments( $params );
477
+ }
478
+ }
479
+
480
+ $cnt = $result[0]; // Total comments
481
+ $cnt_spam = $result[1]; // Spam comments
482
+ $cnt_checked = $result[2]; // Checked comments
483
+ $cnt_bad = $result[3]; // Bad comments (without IP and Email)
484
+
485
+ $return = array(
486
+ 'message' => '',
487
+ 'total' => $cnt,
488
+ 'spam' => $cnt_spam,
489
+ 'checked' => $cnt_checked,
490
+ 'bad' => $cnt_bad,
491
+ );
492
+
493
+ $return['message'] .= sprintf (__("Total comments %s. Checked %s. Last check %s. Found %s spam comments. %s bad comments (without IP or email).", 'cleantalk'), $cnt, $cnt_checked, ct_get_last_comment_check_date(), $cnt_spam, $cnt_bad);
494
+
495
+ $backup_notice = '&nbsp;';
496
+ if ($cnt_spam > 0){
497
+ $backup_notice = __("Please do backup of WordPress database before delete any comments!", 'cleantalk');
498
+ }
499
+ $return['message'] .= "<p>$backup_notice</p>";
500
+
501
+ if($direct_call){
502
+ return $return['message'];
503
+ }else{
504
+ echo json_encode($return);
505
+ die();
506
+ }
507
+
508
+ }
509
+
510
+
511
+ function ct_ajax_insert_comments(){
512
+
513
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
514
+
515
+ //* DELETION
516
+ if(!empty($_POST['delete'])){
517
+ $comments = get_comments(array('author_email' => 'stop_email@example.com'));
518
+ $deleted = 0;
519
+ $amount_to_delete = 15;
520
+ foreach($comments as $comment){
521
+ if($deleted >= $amount_to_delete)
522
+ break;
523
+ if(wp_delete_comment($comment->comment_ID, true))
524
+ $deleted++;
525
+ }
526
+ print "$deleted";
527
+ die();
528
+ }
529
+
530
+ //* INSERTION
531
+ global $wpdb;
532
+
533
+ $to_insert = 100;
534
+ $time = current_time('timestamp')-(730*86400);
535
+
536
+ $result = $wpdb->get_results('SELECT network FROM `'. APBCT_TBL_FIREWALL_DATA .'` LIMIT '. $to_insert .';', ARRAY_A);
537
+
538
+ if($result){
539
+ $ip = array();
540
+ foreach($result as $value){
541
+ $ips[] = long2ip($value['network']);
542
+ }
543
+ unset($value);
544
+
545
+ $inserted = 0;
546
+ for($i=0, $j=0; $i<$to_insert; $i++, $j++){
547
+
548
+ if(!isset($ips[$j]))
549
+ $j=0;
550
+
551
+ $rnd=mt_rand(1,100);
552
+
553
+ $email="stop_email@example.com";
554
+
555
+ $data = array(
556
+ 'comment_post_ID' => 1,
557
+ 'comment_author' => "author_$rnd",
558
+ 'comment_author_email' => $email,
559
+ 'comment_author_url' => 'http://',
560
+ 'comment_content' => "comment content ".mt_rand(1,10000)." ".mt_rand(1,10000)." ".mt_rand(1,10000),
561
+ 'comment_type' => '',
562
+ 'comment_parent' => 0,
563
+ 'user_id' => 1,
564
+ 'comment_author_IP' => $ips[$j],
565
+ 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
566
+ 'comment_date' => date('Y-m-d H:i:s', $time),
567
+ 'comment_approved' => 1,
568
+ );
569
+
570
+ wp_insert_comment($data);
571
+ $time = $time + 86400;
572
+ $inserted++;
573
+ }
574
+ }else{
575
+ $inserted = '0';
576
+ }
577
+
578
+ print $inserted;
579
+ die();
580
+ }
581
+
582
+ function ct_ajax_delete_checked(){
583
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
584
+ foreach($_POST['ids'] as $key=>$value){
585
+ wp_delete_comment($value, false);
586
+ }
587
+ die();
588
+ }
589
+
590
+ function ct_ajax_delete_all(){
591
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
592
+ $args_spam = array(
593
+ 'number'=>100,
594
+ 'meta_query' => array(
595
+ Array(
596
+ 'key' => 'ct_marked_as_spam',
597
+ 'value' => '1',
598
+ 'compare' => 'NUMERIC'
599
+ )
600
+ )
601
+ );
602
+ $c_spam=get_comments($args_spam);
603
+
604
+ $cnt=sizeof($c_spam);
605
+
606
+ $args_spam = array(
607
+ 'count'=>true,
608
+ 'meta_query' => array(
609
+ Array(
610
+ 'key' => 'ct_marked_as_spam',
611
+ 'value' => '1',
612
+ 'compare' => 'NUMERIC'
613
+ )
614
+ )
615
+ );
616
+ $cnt_all=get_comments($args_spam);
617
+
618
+ for($i=0;$i<sizeof($c_spam);$i++){
619
+ wp_delete_comment($c_spam[$i]->comment_ID, false);
620
+ usleep(10000);
621
+ }
622
+ print $cnt_all;
623
+ die();
624
+ }
625
+
626
+ function ct_ajax_clear_comments(){
627
+
628
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
629
+
630
+ if ( isset($_POST['from']) && isset($_POST['till']) ) {
631
+ if ( preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['from'] ) && preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['till'] ) ) {
632
+
633
+ $from = date('Y-m-d', intval(strtotime($_POST['from']))) . ' 00:00:00';
634
+ $till = date('Y-m-d', intval(strtotime($_POST['till']))) . ' 23:59:59';
635
+
636
+ global $wpdb;
637
+ $query_result = $wpdb->query("DELETE FROM {$wpdb->commentmeta} WHERE
638
+ meta_key IN ('ct_checked', 'ct_marked_as_spam', 'ct_bad')
639
+ AND meta_value >= '{$from}'
640
+ AND meta_value <= '{$till}';");
641
+
642
+ die();
643
+
644
+ }
645
+ }
646
+
647
+ }
648
+
649
+ /**
650
+ * Admin action 'comment_unapproved_to_approved' - Approve comment, delete from the deleting list
651
+ */
652
+ function ct_comment_check_approve_comment(){
653
+
654
+ check_ajax_referer( 'ct_secret_nonce', 'security' );
655
+
656
+ $id=$_POST['id'];
657
+ $comment = get_comment($id, 'ARRAY_A');
658
+ $comment['comment_content'] = apbct_comment__unmark_red($comment['comment_content']);
659
+ $comment['comment_approved'] = 1;
660
+ update_comment_meta($id, 'ct_marked_as_spam', 0);
661
+ wp_update_comment($comment);
662
+
663
+ die();
664
+ }
665
+
666
+ /**
667
+ * Get date last checked comment or date of the first comment
668
+ *
669
+ * @return string date "M j Y"
670
+ */
671
+ function ct_last_checked_comment() {
672
+
673
+ $params = array(
674
+ 'fields' => 'ids',
675
+ 'meta_key' => 'ct_checked',
676
+ 'orderby' => 'ct_checked',
677
+ 'order' => 'ASC'
678
+ );
679
+ $checked_comments = get_comments( $params );
680
+
681
+ if ( ! empty($checked_comments) ) {
682
+
683
+ return get_comment_date( "M j Y", end( $checked_comments ) );
684
+
685
+ } else {
686
+
687
+ $params = array(
688
+ 'fields' => 'ids',
689
+ 'orderby' => 'comment_date_gmt',
690
+ 'order' => 'ASC',
691
+ 'number' => 1
692
+ );
693
+ $first_comment = get_comments( $params );
694
+
695
+ return get_comment_date( "M j Y", current( $first_comment ) );
696
+
697
+ }
698
+
699
+ }
700
+
701
+ /**
702
+ * Get last comments check date.
703
+ *
704
+ * @return string|null Date format"M j Y" or datetime format or null
705
+ */
706
+ function ct_get_last_comment_check_date( $timestamp = false ) {
707
+
708
+ $params = array(
709
+ 'fields' => 'ids',
710
+ 'meta_key' => 'ct_checked',
711
+ 'orderby' => 'comment_date_gmt',
712
+ 'order' => 'ASC'
713
+ );
714
+ $checked_comments = get_comments( $params );
715
+
716
+ $last_check = null;
717
+
718
+ if( ! empty( $checked_comments ) ) {
719
+
720
+ $last_check = $timestamp ? get_comment_meta( end( $checked_comments ), 'ct_checked', true ) : date( "M j Y", strtotime( get_comment_meta( end( $checked_comments ), 'ct_checked', true ) ) );
721
+
722
+ }
723
+
724
+ return $last_check;
725
+
726
  }
inc/cleantalk-common.php CHANGED
@@ -1,992 +1,992 @@
1
- <?php
2
-
3
- function apbct_array( $array ){
4
- return new Cleantalk\Arr( $array );
5
- }
6
-
7
- $ct_checkjs_frm = 'ct_checkjs_frm';
8
- $ct_checkjs_register_form = 'ct_checkjs_register_form';
9
-
10
- $apbct_cookie_request_id_label = 'request_id';
11
- $apbct_cookie_register_ok_label = 'register_ok';
12
-
13
- $ct_checkjs_cf7 = 'ct_checkjs_cf7';
14
- $ct_cf7_comment = '';
15
-
16
- $ct_checkjs_jpcf = 'ct_checkjs_jpcf';
17
- $ct_jpcf_patched = false;
18
- $ct_jpcf_fields = array('name', 'email');
19
-
20
- // Comment already proccessed
21
- $ct_comment_done = false;
22
-
23
- // Comment already proccessed
24
- $ct_signup_done = false;
25
-
26
- //Contains registration error
27
- $ct_registration_error_comment = false;
28
-
29
- // Default value for JS test
30
- $ct_checkjs_def = 0;
31
-
32
- // COOKIE label to store request id for last approved
33
- $ct_approved_request_id_label = 'ct_approved_request_id';
34
-
35
- // Last request id approved for publication
36
- $ct_approved_request_id = null;
37
-
38
- // Trial notice show time in minutes
39
- $trial_notice_showtime = 10;
40
-
41
- // Renew notice show time in minutes
42
- $renew_notice_showtime = 10;
43
-
44
- // COOKIE label for WP Landing Page proccessing result
45
- $ct_wplp_result_label = 'ct_wplp_result';
46
-
47
- // Flag indicates active JetPack comments
48
- $ct_jp_comments = false;
49
-
50
- // WP admin email notice interval in seconds
51
- $ct_admin_notoice_period = 21600;
52
-
53
- // Sevice negative comment to visitor.
54
- // It uses for BuddyPress registrations to avoid double checks
55
- $ct_negative_comment = null;
56
-
57
- // Set globals to NULL to avoid massive DB requests. Globals will be set when needed only and by accessors only.
58
- $ct_server = NULL;
59
- $admin_email = NULL;
60
-
61
- /**
62
- * Public action 'plugins_loaded' - Loads locale, see http://codex.wordpress.org/Function_Reference/load_plugin_textdomain
63
- */
64
- function apbct_plugin_loaded() {
65
- $dir=plugin_basename( dirname( __FILE__ ) ) . '/../i18n';
66
- $loaded=load_plugin_textdomain('cleantalk', false, $dir);
67
- }
68
-
69
- /**
70
- * Inner function - Request's wrapper for anything
71
- * @param array Array of parameters:
72
- * 'message' - string
73
- * 'example' - string
74
- * 'checkjs' - int
75
- * 'sender_email' - string
76
- * 'sender_nickname' - string
77
- * 'sender_info' - array
78
- * 'post_info' - string
79
- * @return array array('ct'=> Cleantalk, 'ct_result' => CleantalkResponse)
80
- */
81
- function apbct_base_call($params = array(), $reg_flag = false){
82
-
83
- global $apbct, $cleantalk_executed;
84
-
85
- $cleantalk_executed = true;
86
-
87
- $sender_info = !empty($params['sender_info'])
88
- ? CleantalkHelper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
89
- : apbct_get_sender_info();
90
-
91
- // Fileds exclusions
92
- if( ! empty( $params['message'] ) && is_array( $params['message'] ) ){
93
-
94
- $params['message'] = apbct_array( $params['message'] )
95
- ->get_keys( $apbct->settings['exclusions__fields'], $apbct->settings['exclusions__fields__use_regexp'] )
96
- ->delete();
97
- }
98
-
99
- $default_params = array(
100
-
101
- // IPs
102
- 'sender_ip' => defined('CT_TEST_IP') ? CT_TEST_IP : (isset($params['sender_ip']) ? $params['sender_ip'] : CleantalkHelper::ip__get(array('real'), false)),
103
- 'x_forwarded_for' => CleantalkHelper::ip__get(array('x_forwarded_for'), false),
104
- 'x_real_ip' => CleantalkHelper::ip__get(array('x_real_ip'), false),
105
-
106
- // Misc
107
- 'auth_key' => $apbct->api_key,
108
- 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE) ? 1 : apbct_js_test('ct_checkjs', $_POST),
109
-
110
- 'agent' => APBCT_AGENT,
111
- 'sender_info' => $sender_info,
112
- 'submit_time' => apbct_get_submit_time(),
113
- );
114
-
115
- // Send $_SERVER if couldn't find IP
116
- if(empty($default_params['sender_ip']))
117
- $default_params['sender_info']['server_info'] = $_SERVER;
118
-
119
- $ct_request = new CleantalkRequest(
120
- CleantalkHelper::array_merge__save_numeric_keys__recursive($default_params, $params)
121
- );
122
-
123
- $ct = new Cleantalk();
124
-
125
- $ct->use_bultin_api = $apbct->settings['use_buitin_http_api'] ? true : false;
126
- $ct->ssl_on = $apbct->settings['ssl_on'];
127
- $ct->ssl_path = APBCT_CASERT_PATH;
128
-
129
- // Options store url without shceme because of DB error with ''://'
130
- $config = ct_get_server();
131
- $ct->server_url = APBCT_MODERATE_URL;
132
- $ct->work_url = preg_match('/http:\/\/.+/', $config['ct_work_url']) ? $config['ct_work_url'] : null;
133
- $ct->server_ttl = $config['ct_server_ttl'];
134
- $ct->server_changed = $config['ct_server_changed'];
135
-
136
- $start = microtime(true);
137
- $ct_result = $reg_flag
138
- ? @$ct->isAllowUser($ct_request)
139
- : @$ct->isAllowMessage($ct_request);
140
- $exec_time = microtime(true) - $start;
141
-
142
- // Statistics
143
- // Average request time
144
- apbct_statistics__rotate($exec_time);
145
- // Last request
146
- $apbct->stats['last_request']['time'] = time();
147
- $apbct->stats['last_request']['server'] = $ct->work_url;
148
- $apbct->save('stats');
149
-
150
- // Connection reports
151
- if ($ct_result->errno === 0 && empty($ct_result->errstr))
152
- $apbct->data['connection_reports']['success']++;
153
- else
154
- {
155
- $apbct->data['connection_reports']['negative']++;
156
- $apbct->data['connection_reports']['negative_report'][] = array(
157
- 'date' => date("Y-m-d H:i:s"),
158
- 'page_url' => apbct_get_server_variable( 'REQUEST_URI' ),
159
- 'lib_report' => $ct_result->errstr,
160
- 'work_url' => $ct->work_url,
161
- );
162
-
163
- if(count($apbct->data['connection_reports']['negative_report']) > 20)
164
- $apbct->data['connection_reports']['negative_report'] = array_slice($apbct->data['connection_reports']['negative_report'], -20, 20);
165
-
166
- }
167
-
168
- if ($ct->server_change) {
169
- update_option(
170
- 'cleantalk_server',
171
- array(
172
- 'ct_work_url' => $ct->work_url,
173
- 'ct_server_ttl' => $ct->server_ttl,
174
- 'ct_server_changed' => time(),
175
- )
176
- );
177
- }
178
-
179
- $ct_result = ct_change_plugin_resonse($ct_result, $ct_request->js_on);
180
-
181
- // Restart submit form counter for failed requests
182
- if ($ct_result->allow == 0){
183
- apbct_cookie(); // Setting page timer and cookies
184
- ct_add_event('no');
185
- }else{
186
- ct_add_event('yes');
187
- }
188
-
189
- // Set cookies if it's not.
190
- if(empty($apbct->flags__cookies_setuped))
191
- apbct_cookie();
192
-
193
- return array('ct' => $ct, 'ct_result' => $ct_result);
194
-
195
- }
196
-
197
- function apbct_exclusions_check($func = null){
198
-
199
- global $apbct, $cleantalk_executed;
200
-
201
- // Common exclusions
202
- if(
203
- apbct_exclusions_check__ip() ||
204
- apbct_exclusions_check__url() ||
205
- apbct_is_user_role_in( $apbct->settings['exclusions__roles'] ) ||
206
- $cleantalk_executed
207
- )
208
- return true;
209
-
210
- // Personal exclusions
211
- switch ($func){
212
- case 'ct_contact_form_validate_postdata':
213
- if(
214
- (defined( 'DOING_AJAX' ) && DOING_AJAX) ||
215
- apbct_array( $_POST )->get_keys( 'members_search_submit' )->result()
216
- )
217
- return true;
218
- break;
219
- case 'ct_contact_form_validate':
220
- if(
221
- apbct_array( $_POST )->get_keys( 'members_search_submit' )->result()
222
- )
223
- return true;
224
- break;
225
- default:
226
- return false;
227
- break;
228
- }
229
-
230
- return false;
231
- }
232
-
233
- /**
234
- * Checks if reuqest URI is in exclusion list
235
- *
236
- * @return bool
237
- */
238
- function apbct_exclusions_check__url() {
239
-
240
- global $apbct;
241
-
242
- if ( ! empty( $apbct->settings['exclusions__urls'] ) ) {
243
-
244
- $exclusions = explode( ',', $apbct->settings['exclusions__urls'] );
245
-
246
- // Fix for AJAX forms
247
- $haystack = apbct_get_server_variable( 'REQUEST_URI' ) == '/wp-admin/admin-ajax.php' && ! apbct_get_server_variable( 'HTTP_REFERER' )
248
- ? apbct_get_server_variable( 'HTTP_REFERER' )
249
- : apbct_get_server_variable( 'REQUEST_URI' );
250
-
251
- foreach ( $exclusions as $exclusion ) {
252
- if (
253
- ($apbct->settings['exclusions__urls__use_regexp'] && preg_match( '/' . $exclusion . '/', $haystack ) === 1) ||
254
- stripos( $haystack, $exclusion ) !== false
255
- ){
256
- return true;
257
- }
258
- }
259
- return false;
260
- }
261
- }
262
- /**
263
- * @deprecated 5.128 Using IP white-lists instead
264
- * @deprecated since 18.09.2019
265
- * Checks if sender_ip is in exclusion list
266
- *
267
- * @return bool
268
- */
269
- function apbct_exclusions_check__ip(){
270
-
271
- global $cleantalk_ip_exclusions;
272
-
273
- if( apbct_get_server_variable( 'REMOTE_ADDR' ) ){
274
-
275
- if( CleantalkHelper::ip__is_cleantalks( apbct_get_server_variable( 'REMOTE_ADDR' ) ) ){
276
- return true;
277
- }
278
-
279
- if( ! empty( $cleantalk_ip_exclusions ) && is_array( $cleantalk_ip_exclusions ) ){
280
- foreach ( $cleantalk_ip_exclusions as $exclusion ){
281
- if( stripos( apbct_get_server_variable( 'REMOTE_ADDR' ), $exclusion ) !== false ){
282
- return true;
283
- }
284
- }
285
- }
286
- }
287
-
288
- return false;
289
- }
290
-
291
- /**
292
- * Inner function - Default data array for senders
293
- * @return array
294
- */
295
- function apbct_get_sender_info() {
296
-
297
- global $apbct;
298
-
299
- // Validate cookie from the backend
300
- $cookie_is_ok = apbct_cookies_test();
301
-
302
- $referer_previous = $apbct->settings['set_cookies__sessions']
303
- ? apbct_alt_session__get('apbct_prev_referer')
304
- : filter_input(INPUT_COOKIE, 'apbct_prev_referer');
305
-
306
- $site_landing_ts = $apbct->settings['set_cookies__sessions']
307
- ? apbct_alt_session__get('apbct_site_landing_ts')
308
- : filter_input(INPUT_COOKIE, 'apbct_site_landing_ts');
309
-
310
- $page_hits = $apbct->settings['set_cookies__sessions']
311
- ? apbct_alt_session__get('apbct_page_hits')
312
- : filter_input(INPUT_COOKIE, 'apbct_page_hits');
313
-
314
- if (count($_POST) > 0) {
315
- foreach ($_POST as $k => $v) {
316
- if (preg_match("/^(ct_check|checkjs).+/", $k)) {
317
- $checkjs_data_post = $v;
318
- }
319
- }
320
- }
321
-
322
- // AMP check
323
- $amp_detected = apbct_get_server_variable( 'HTTP_REFERER' )
324
- ? strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '/amp/') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '?amp=1') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '&amp=1') !== false
325
- ? 1
326
- : 0
327
- : null;
328
-
329
- $site_referer = $apbct->settings['store_urls__sessions']
330
- ? apbct_alt_session__get('apbct_site_referer')
331
- : filter_input(INPUT_COOKIE, 'apbct_site_referer');
332
-
333
- $urls = $apbct->settings['store_urls__sessions']
334
- ? (array)apbct_alt_session__get('apbct_urls')
335
- : (array)json_decode(filter_input(INPUT_COOKIE, 'apbct_urls'), true);
336
-
337
- return array(
338
- 'remote_addr' => CleantalkHelper::ip__get(array('remote_addr'), false),
339
- 'REFFERRER' => apbct_get_server_variable( 'HTTP_REFERER' ),
340
- 'USER_AGENT' => apbct_get_server_variable( 'HTTP_USER_AGENT' ),
341
- 'page_url' => apbct_get_server_variable( 'SERVER_NAME' ) . apbct_get_server_variable( 'REQUEST_URI' ),
342
- 'cms_lang' => substr(get_locale(), 0, 2),
343
- 'ct_options' => json_encode($apbct->settings),
344
- 'fields_number' => sizeof($_POST),
345
- 'direct_post' => $cookie_is_ok === null && apbct_is_post() ? 1 : 0,
346
- // Raw data to validated JavaScript test in the cloud
347
- 'checkjs_data_cookies' => !empty($_COOKIE['ct_checkjs']) ? $_COOKIE['ct_checkjs'] : null,
348
- 'checkjs_data_post' => !empty($checkjs_data_post) ? $checkjs_data_post : null,
349
- // PHP cookies
350
- 'cookies_enabled' => $cookie_is_ok,
351
- 'REFFERRER_PREVIOUS' => !empty($referer_previous) && $cookie_is_ok ? $referer_previous : null,
352
- 'site_landing_ts' => !empty($site_landing_ts) && $cookie_is_ok ? $site_landing_ts : null,
353
- 'page_hits' => !empty($page_hits) ? $page_hits : null,
354
- // JS cookies
355
- 'js_info' => !empty($_COOKIE['ct_user_info']) ? json_decode(stripslashes($_COOKIE['ct_user_info']), true) : null,
356
- 'mouse_cursor_positions' => !empty($_COOKIE['ct_pointer_data']) ? json_decode(stripslashes($_COOKIE['ct_pointer_data']), true) : null,
357
- 'js_timezone' => !empty($_COOKIE['ct_timezone']) ? $_COOKIE['ct_timezone'] : null,
358
- 'key_press_timestamp' => !empty($_COOKIE['ct_fkp_timestamp']) ? $_COOKIE['ct_fkp_timestamp'] : null,
359
- 'page_set_timestamp' => !empty($_COOKIE['ct_ps_timestamp']) ? $_COOKIE['ct_ps_timestamp'] : null,
360
- 'form_visible_inputs' => !empty($_COOKIE['apbct_visible_fields_count']) ? $_COOKIE['apbct_visible_fields_count'] : null,
361
- 'apbct_visible_fields' => !empty($_COOKIE['apbct_visible_fields']) ? apbct_visibile_fields__process($_COOKIE['apbct_visible_fields']) : null,
362
- // Misc
363
- 'site_referer' => !empty($site_referer) ? $site_referer : null,
364
- 'source_url' => !empty($urls) ? json_encode($urls) : null,
365
- // Debug stuff
366
- 'amp_detected' => $amp_detected,
367
- 'hook' => current_action(),
368
- 'headers_sent' => !empty($apbct->headers_sent) ? $apbct->headers_sent : false,
369
- 'headers_sent__hook' => !empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : false,
370
- 'headers_sent__where' => !empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
371
- 'request_type' => apbct_get_server_variable('REQUEST_METHOD') ? apbct_get_server_variable('REQUEST_METHOD') : 'UNKNOWN',
372
- 'abpct_hyro_acc_collect' => !empty($_COOKIE['abpct_hyro_acc_collect']) ? json_decode(stripslashes($_COOKIE['abpct_hyro_acc_collect']), true): null,
373
- );
374
- }
375
-
376
- /**
377
- * Process visible fields for specific form to match the fields from request
378
- *
379
- * @param string $visible_fields
380
- *
381
- * @return string
382
- */
383
- function apbct_visibile_fields__process($visible_fields) {
384
- if(strpos($visible_fields, 'wpforms') !== false){
385
- $visible_fields = preg_replace(
386
- array('/\[/', '/\]/'),
387
- '',
388
- str_replace(
389
- '][',
390
- '_',
391
- str_replace(
392
- 'wpforms[fields]',
393
- '',
394
- $visible_fields
395
- )
396
- )
397
- );
398
- }
399
-
400
- return $visible_fields;
401
- }
402
-
403
- /*
404
- * Outputs JS key for AJAX-use only. Stops script.
405
- */
406
- function apbct_js_keys__get__ajax($direct_call = false){
407
- if(!$direct_call){
408
- if(isset($_POST['_ajax_nonce'])){
409
- if(!wp_verify_nonce($_POST['_ajax_nonce'], 'ct_secret_stuff')){
410
- wp_doing_ajax()
411
- ? wp_die( -1, 403 )
412
- : die( '-1' );
413
- }
414
- }else{
415
- wp_doing_ajax()
416
- ? wp_die( -1, 403 )
417
- : die( '-1' );
418
- }
419
- }
420
- die(json_encode(array(
421
- 'js_key' => ct_get_checkjs_value()
422
- )));
423
- }
424
-
425
- /**
426
- * Get ct_get_checkjs_value
427
- *
428
- * @param bool $random_key
429
- *
430
- * @return int|string|null
431
- */
432
- function ct_get_checkjs_value(){
433
-
434
- global $apbct;
435
-
436
- // Use static JS keys
437
- if($apbct->settings['use_static_js_key'] == 1){
438
-
439
- $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
440
-
441
- // Auto detecting. Detected.
442
- }elseif(
443
- $apbct->settings['use_static_js_key'] == - 1 &&
444
- ( apbct_is_cache_plugins_exists() ||
445
- ( apbct_is_post() && $apbct->data['cache_detected'] == 1 )
446
- )
447
- ){
448
- $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
449
- if( apbct_is_cache_plugins_exists() )
450
- $apbct->data['cache_detected'] = 1;
451
-
452
- // Using dynamic JS keys
453
- }else{
454
-
455
- $keys = $apbct->data['js_keys'];
456
- $keys_checksum = md5(json_encode($keys));
457
-
458
- $key = null;
459
- $latest_key_time = 0;
460
-
461
- foreach ($keys as $k => $t) {
462
-
463
- // Removing key if it's to old
464
- if (time() - $t > $apbct->data['js_keys_store_days'] * 86400 * 7) {
465
- unset($keys[$k]);
466
- continue;
467
- }
468
-
469
- if ($t > $latest_key_time) {
470
- $latest_key_time = $t;
471
- $key = $k;
472
- }
473
- }
474
-
475
- // Set new key if the latest key is too old
476
- if (time() - $latest_key_time > $apbct->data['js_key_lifetime']) {
477
- $key = rand();
478
- $keys[$key] = time();
479
- }
480
-
481
- // Save keys if they were changed
482
- if (md5(json_encode($keys)) != $keys_checksum) {
483
- $apbct->data['js_keys'] = $keys;
484
- // $apbct->saveData();
485
- }
486
-
487
- $apbct->data['cache_detected'] = 0;
488
- }
489
-
490
- $apbct->saveData();
491
-
492
- return $key;
493
- }
494
-
495
- function apbct_is_cache_plugins_exists(){
496
- return
497
- defined('WP_ROCKET_VERSION') || // WPRocket
498
- defined('LSCWP_DIR') || // LiteSpeed Cache
499
- defined('WPFC_WP_CONTENT_BASENAME') || // WP Fastest Cache
500
- defined('W3TC') || // W3 Total Cache
501
- defined('WPO_VERSION') || // WP-Optimize – Clean, Compress, Cache
502
- defined('AUTOPTIMIZE_PLUGIN_VERSION') || // Autoptimize
503
- defined('WPCACHEHOME') || // WP Super Cache
504
- defined('WPHB_VERSION') || // Hummingbird – Speed up, Cache, Optimize Your CSS and JS
505
- defined('CE_FILE') || // Cache Enabler – WordPress Cache
506
- class_exists('RedisObjectCache') || // Redis Object Cache
507
- defined('SiteGround_Optimizer\VERSION') || // SG Optimizer
508
- class_exists('WP_Rest_Cache_Plugin\Includes\Plugin'); // WP REST Cache
509
- }
510
-
511
- /**
512
- * Inner function - Current site admin e-mail
513
- * @return string Admin e-mail
514
- */
515
- function ct_get_admin_email() {
516
- global $admin_email;
517
- if(!isset($admin_email))
518
- {
519
- $admin_email = get_option('admin_email');
520
- }
521
- return $admin_email;
522
- }
523
-
524
- /**
525
- * Inner function - Current Cleantalk working server info
526
- * @return mixed[] Array of server data
527
- */
528
- function ct_get_server($force=false) {
529
- global $ct_server;
530
- if(!$force && isset($ct_server) && isset($ct_server['ct_work_url']) && !empty($ct_server['ct_work_url'])){
531
-
532
- return $ct_server;
533
-
534
- }else{
535
-
536
- $ct_server = get_option('cleantalk_server');
537
- if (!is_array($ct_server)){
538
- $ct_server = array(
539
- 'ct_work_url' => NULL,
540
- 'ct_server_ttl' => NULL,
541
- 'ct_server_changed' => NULL
542
- );
543
- }
544
- return $ct_server;
545
- }
546
- }
547
-
548
- /**
549
- * Inner function - Stores ang returns cleantalk hash of current comment
550
- * @param string New hash or NULL
551
- * @return string New hash or current hash depending on parameter
552
- */
553
- function ct_hash($new_hash = '') {
554
- /**
555
- * Current hash
556
- */
557
- static $hash;
558
-
559
- if (!empty($new_hash)) {
560
- $hash = $new_hash;
561
- }
562
- return $hash;
563
- }
564
-
565
- /**
566
- * Inner function - Write manual moderation results to PHP sessions
567
- * @param string $hash Cleantalk comment hash
568
- * @param string $message comment_content
569
- * @param int $allow flag good comment (1) or bad (0)
570
- * @return string comment_content w\o cleantalk resume
571
- */
572
- function ct_feedback($hash, $allow) {
573
- global $apbct;
574
-
575
- $ct_feedback = $hash . ':' . $allow . ';';
576
- if($apbct->data['feedback_request'])
577
- $apbct->data['feedback_request'] = $ct_feedback;
578
- else
579
- $apbct->data['feedback_request'] .= $ct_feedback;
580
-
581
- $apbct->saveData();
582
- }
583
-
584
- /**
585
- * Inner function - Sends the results of moderation
586
- * Scheduled in 3600 seconds!
587
- * @param string $feedback_request
588
- * @return bool
589
- */
590
- function ct_send_feedback($feedback_request = null) {
591
-
592
- global $apbct;
593
-
594
- if (empty($feedback_request) && isset($apbct->data['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $apbct->data['feedback_request'])){
595
- $feedback_request = $apbct->data['feedback_request'];
596
- $apbct->data['feedback_request'] = '';
597
- $apbct->saveData();
598
- }
599
-
600
- if ($feedback_request !== null) {
601
-
602
- $ct_request = new CleantalkRequest(array(
603
- // General
604
- 'auth_key' => $apbct->api_key,
605
- // Additional
606
- 'feedback' => $feedback_request,
607
- ));
608
-
609
- $ct = new Cleantalk();
610
-
611
- // Server URL handling
612
- $config = ct_get_server();
613
- $ct->server_url = APBCT_MODERATE_URL;
614
- $ct->work_url = preg_match('/http:\/\/.+/', $config['ct_work_url']) ? $config['ct_work_url'] : null;
615
- $ct->server_ttl = $config['ct_server_ttl'];
616
- $ct->server_changed = $config['ct_server_changed'];
617
-
618
- $ct->sendFeedback($ct_request);
619
-
620
- if ($ct->server_change) {
621
- update_option(
622
- 'cleantalk_server',
623
- array(
624
- 'ct_work_url' => $ct->work_url,
625
- 'ct_server_ttl' => $ct->server_ttl,
626
- 'ct_server_changed' => time(),
627
- )
628
- );
629
- }
630
-
631
- return true;
632
- }
633
-
634
- return false;
635
- }
636
-
637
- /**
638
- * Delete old spam comments
639
- * Scheduled in 3600 seconds!
640
- * @return null
641
- */
642
- function ct_delete_spam_comments() {
643
-
644
- global $apbct;
645
-
646
- if ($apbct->settings['remove_old_spam'] == 1) {
647
- $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
648
- foreach ($last_comments as $c) {
649
- $comment_date_gmt = strtotime($c->comment_date_gmt);
650
- if ($comment_date_gmt && is_numeric($comment_date_gmt)) {
651
- if (time() - $comment_date_gmt > 86400 * $apbct->data['spam_store_days']) {
652
- // Force deletion old spam comments
653
- wp_delete_comment($c->comment_ID, true);
654
- }
655
- }
656
- }
657
- }
658
-
659
- return null;
660
- }
661
-
662
- /*
663
- * Get data from an ARRAY recursively
664
- * @return array
665
- */
666
- function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = array('nick' => '', 'first' => '', 'last' => ''), $subject = null, $contact = true, $prev_name = ''){
667
-
668
- //Skip request if fields exists
669
- $skip_params = array(
670
- 'ipn_track_id', // PayPal IPN #
671
- 'txn_type', // PayPal transaction type
672
- 'payment_status', // PayPal payment status
673
- 'ccbill_ipn', // CCBill IPN
674
- 'ct_checkjs', // skip ct_checkjs field
675
- 'api_mode', // DigiStore-API
676
- 'loadLastCommentId' // Plugin: WP Discuz. ticket_id=5571
677
- );
678
-
679
- // Fields to replace with ****
680
- $obfuscate_params = array(
681
- 'password',
682
- 'pass',
683
- 'pwd',
684
- 'pswd'
685
- );
686
-
687
- // Skip feilds with these strings and known service fields
688
- $skip_fields_with_strings = array(
689
- // Common
690
- 'ct_checkjs', //Do not send ct_checkjs
691
- 'nonce', //nonce for strings such as 'rsvp_nonce_name'
692
- 'security',
693
- // 'action',
694
- 'http_referer',
695
- 'referer-page',
696
- 'timestamp',
697
- 'captcha',
698
- // Formidable Form
699
- 'form_key',
700
- 'submit_entry',
701
- // Custom Contact Forms
702
- 'form_id',
703
- 'ccf_form',
704
- 'form_page',
705
- // Qu Forms
706
- 'iphorm_uid',
707
- 'form_url',
708
- 'post_id',
709
- 'iphorm_ajax',
710
- 'iphorm_id',
711
- // Fast SecureContact Froms
712
- 'fs_postonce_1',
713
- 'fscf_submitted',
714
- 'mailto_id',
715
- 'si_contact_action',
716
- // Ninja Forms
717
- 'formData_id',
718
- 'formData_settings',
719
- 'formData_fields_\d+_id',
720
- 'formData_fields_\d+_files.*',
721
- // E_signature
722
- 'recipient_signature',
723
- 'output_\d+_\w{0,2}',
724
- // Contact Form by Web-Settler protection
725
- '_formId',
726
- '_returnLink',
727
- // Social login and more
728
- '_save',
729
- '_facebook',
730
- '_social',
731
- 'user_login-',
732
- // Contact Form 7
733
- '_wpcf7',
734
- 'ebd_settings',
735
- 'ebd_downloads_',
736
- 'ecole_origine',
737
- );
738
-
739
- // Reset $message if we have a sign-up data
740
- $skip_message_post = array(
741
- 'edd_action', // Easy Digital Downloads
742
- );
743
-
744
- if( apbct_array( array( $_POST, $_GET ) )->get_keys( $skip_params )->result() )
745
- $contact = false;
746
-
747
- if(count($arr)){
748
-
749
- foreach($arr as $key => $value){
750
-
751
- if(gettype($value) == 'string'){
752
-
753
- $tmp = strpos($value, '\\') !== false ? stripslashes($value) : $value;
754
- $decoded_json_value = json_decode($tmp, true);
755
-
756
- // Decoding JSON
757
- if($decoded_json_value !== null){
758
- $value = $decoded_json_value;
759
-
760
- // Ajax Contact Forms. Get data from such strings:
761
- // acfw30_name %% Blocked~acfw30_email %% s@cleantalk.org
762
- // acfw30_textarea %% msg
763
- }elseif(preg_match('/^\S+\s%%\s\S+.+$/', $value)){
764
- $value = explode('~', $value);
765
- foreach ($value as &$val){
766
- $tmp = explode(' %% ', $val);
767
- $val = array($tmp[0] => $tmp[1]);
768
- }
769
- }
770
- }
771
-
772
- if(!is_array($value) && !is_object($value)){
773
-
774
- if (in_array($key, $skip_params, true) && $key != 0 && $key != '' || preg_match("/^ct_checkjs/", $key))
775
- $contact = false;
776
-
777
- if($value === '')
778
- continue;
779
-
780
- // Skipping fields names with strings from (array)skip_fields_with_strings
781
- foreach($skip_fields_with_strings as $needle){
782
- if (preg_match("/".$needle."/", $prev_name.$key) == 1){
783
- continue(2);
784
- }
785
- }unset($needle);
786
-
787
- // Obfuscating params
788
- foreach($obfuscate_params as $needle){
789
- if (strpos($key, $needle) !== false){
790
- $value = ct_obfuscate_param($value);
791
- continue(2);
792
- }
793
- }unset($needle);
794
-
795
- // Removes whitespaces
796
- $value = urldecode( trim( strip_shortcodes( $value ) ) ); // Fully cleaned message
797
- $value_for_email = trim( strip_shortcodes( $value ) ); // Removes shortcodes to do better spam filtration on server side.
798
-
799
- // Email
800
- if ( ! $email && preg_match( "/^\S+@\S+\.\S+$/", $value_for_email ) ) {
801
- $email = $value_for_email;
802
-
803
- // Names
804
- }elseif (preg_match("/name/i", $key)){
805
-
806
- preg_match("/((name.?)?(your|first|for)(.?name)?)/", $key, $match_forename);
807
- preg_match("/((name.?)?(last|family|second|sur)(.?name)?)/", $key, $match_surname);
808
- preg_match("/(name.?)?(nick|user)(.?name)?/", $key, $match_nickname);
809
-
810
- if(count($match_forename) > 1)
811
- $nickname['first'] = $value;
812
- elseif(count($match_surname) > 1)
813
- $nickname['last'] = $value;
814
- elseif(count($match_nickname) > 1)
815
- $nickname['nick'] = $value;
816
- else
817
- $message[$prev_name.$key] = $value;
818
-
819
- // Subject
820
- }elseif ($subject === null && preg_match("/subject/i", $key)){
821
- $subject = $value;
822
-
823
- // Message
824
- }else{
825
- $message[$prev_name.$key] = $value;
826
- }
827
-
828
- }elseif(!is_object($value)){
829
-
830
- $prev_name_original = $prev_name;
831
- $prev_name = ($prev_name === '' ? $key.'_' : $prev_name.$key.'_');
832
-
833
- $temp = ct_get_fields_any($value, $message, $email, $nickname, $subject, $contact, $prev_name);
834
-
835
- $message = $temp['message'];
836
- $email = ($temp['email'] ? $temp['email'] : null);
837
- $nickname = ($temp['nickname'] ? $temp['nickname'] : null);
838
- $subject = ($temp['subject'] ? $temp['subject'] : null);
839
- if($contact === true)
840
- $contact = ($temp['contact'] === false ? false : true);
841
- $prev_name = $prev_name_original;
842
- }
843
- } unset($key, $value);
844
- }
845
-
846
- foreach ($skip_message_post as $v) {
847
- if (isset($_POST[$v])) {
848
- $message = null;
849
- break;
850
- }
851
- } unset($v);
852
-
853
- //If top iteration, returns compiled name field. Example: "Nickname Firtsname Lastname".
854
- if($prev_name === ''){
855
- if(!empty($nickname)){
856
- $nickname_str = '';
857
- foreach($nickname as $value){
858
- $nickname_str .= ($value ? $value." " : "");
859
- }unset($value);
860
- }
861
- $nickname = $nickname_str;
862
- }
863
-
864
- $return_param = array(
865
- 'email' => $email,
866
- 'nickname' => $nickname,
867
- 'subject' => $subject,
868
- 'contact' => $contact,
869
- 'message' => $message
870
- );
871
- return $return_param;
872
- }
873
-
874
- /**
875
- * Masks a value with asterisks (*)
876
- * @return string
877
- */
878
- function ct_obfuscate_param($value = null) {
879
- if ($value && (!is_object($value) || !is_array($value))) {
880
- $length = strlen($value);
881
- $value = str_repeat('*', $length);
882
- }
883
-
884
- return $value;
885
- }
886
-
887
- //New ct_get_fields_any_postdata
888
- function ct_get_fields_any_postdata($arr, $message=array()){
889
- $skip_params = array(
890
- 'ipn_track_id', // PayPal IPN #
891
- 'txn_type', // PayPal transaction type
892
- 'payment_status', // PayPal payment status
893
- );
894
-
895
- foreach($arr as $key => $value){
896
- if(!is_array($value)){
897
- if($value == '')
898
- continue;
899
- if (!(in_array($key, $skip_params) || preg_match("/^ct_checkjs/", $key)) && $value!='')
900
- $message[$key] = $value;
901
- }else{
902
- $temp = ct_get_fields_any_postdata($value);
903
- $message = (count($temp) == 0 ? $message : array_merge($message, $temp));
904
- }
905
- }
906
- return $message;
907
- }
908
-
909
- /**
910
- * Checks if given string is valid regular expression
911
- *
912
- * @param string $regexp
913
- *
914
- * @return bool
915
- */
916
- function apbct_is_regexp($regexp){
917
- return @preg_match('/' . $regexp . '/', null) !== false;
918
- }
919
-
920
- function cleantalk_debug($key,$value)
921
- {
922
- if(isset($_COOKIE) && isset($_COOKIE['cleantalk_debug']))
923
- {
924
- @header($key.": ".$value);
925
- }
926
- }
927
-
928
- /**
929
- * Function changes CleanTalk result object if an error occured.
930
- * @return object
931
- */
932
- function ct_change_plugin_resonse($ct_result = null, $checkjs = null) {
933
-
934
- global $apbct;
935
-
936
- if (!$ct_result) {
937
- return $ct_result;
938
- }
939
-
940
- if(@intval($ct_result->errno) != 0)
941
- {
942
- if($checkjs === null || $checkjs != 1)
943
- {
944
- $ct_result->allow = 0;
945
- $ct_result->spam = 1;
946
- $ct_result->comment = sprintf('We\'ve got an issue: %s. Forbidden. Please, enable Javascript. %s.',
947
- $ct_result->comment,
948
- $apbct->plugin_name
949
- );
950
- }
951
- else
952
- {
953
- $ct_result->allow = 1;
954
- $ct_result->comment = 'Allow';
955
- }
956
- }
957
-
958
- return $ct_result;
959
- }
960
-
961
- /**
962
- * Does key has correct symbols? Checks against regexp ^[a-z\d]{3,15}$
963
- * @param api_key
964
- * @return bool
965
- */
966
- function apbct_api_key__is_correct($api_key = null)
967
- {
968
- global $apbct;
969
- $api_key = $api_key !== null ? $api_key : $apbct->api_key;
970
- return $api_key && preg_match('/^[a-z\d]{3,15}$/', $api_key) ? true : false;
971
- }
972
-
973
- function apbct_add_async_attribute($tag, $handle, $src) {
974
-
975
- global $apbct;
976
-
977
- if(
978
- $apbct->settings['async_js'] &&
979
- (
980
- $handle === 'ct_public'
981
- || $handle === 'ct_public_gdpr'
982
- || $handle === 'ct_debug_js'
983
- || $handle === 'ct_public_admin_js'
984
- || $handle === 'ct_internal'
985
- || $handle === 'ct_external'
986
- || $handle === 'ct_nocache'
987
- )
988
- )
989
- return str_replace( ' src', ' async="async" src', $tag );
990
- else
991
- return $tag;
992
  }
1
+ <?php
2
+
3
+ function apbct_array( $array ){
4
+ return new Cleantalk\Arr( $array );
5
+ }
6
+
7
+ $ct_checkjs_frm = 'ct_checkjs_frm';
8
+ $ct_checkjs_register_form = 'ct_checkjs_register_form';
9
+
10
+ $apbct_cookie_request_id_label = 'request_id';
11
+ $apbct_cookie_register_ok_label = 'register_ok';
12
+
13
+ $ct_checkjs_cf7 = 'ct_checkjs_cf7';
14
+ $ct_cf7_comment = '';
15
+
16
+ $ct_checkjs_jpcf = 'ct_checkjs_jpcf';
17
+ $ct_jpcf_patched = false;
18
+ $ct_jpcf_fields = array('name', 'email');
19
+
20
+ // Comment already proccessed
21
+ $ct_comment_done = false;
22
+
23
+ // Comment already proccessed
24
+ $ct_signup_done = false;
25
+
26
+ //Contains registration error
27
+ $ct_registration_error_comment = false;
28
+
29
+ // Default value for JS test
30
+ $ct_checkjs_def = 0;
31
+
32
+ // COOKIE label to store request id for last approved
33
+ $ct_approved_request_id_label = 'ct_approved_request_id';
34
+
35
+ // Last request id approved for publication
36
+ $ct_approved_request_id = null;
37
+
38
+ // Trial notice show time in minutes
39
+ $trial_notice_showtime = 10;
40
+
41
+ // Renew notice show time in minutes
42
+ $renew_notice_showtime = 10;
43
+
44
+ // COOKIE label for WP Landing Page proccessing result
45
+ $ct_wplp_result_label = 'ct_wplp_result';
46
+
47
+ // Flag indicates active JetPack comments
48
+ $ct_jp_comments = false;
49
+
50
+ // WP admin email notice interval in seconds
51
+ $ct_admin_notoice_period = 21600;
52
+
53
+ // Sevice negative comment to visitor.
54
+ // It uses for BuddyPress registrations to avoid double checks
55
+ $ct_negative_comment = null;
56
+
57
+ // Set globals to NULL to avoid massive DB requests. Globals will be set when needed only and by accessors only.
58
+ $ct_server = NULL;
59
+ $admin_email = NULL;
60
+
61
+ /**
62
+ * Public action 'plugins_loaded' - Loads locale, see http://codex.wordpress.org/Function_Reference/load_plugin_textdomain
63
+ */
64
+ function apbct_plugin_loaded() {
65
+ $dir=plugin_basename( dirname( __FILE__ ) ) . '/../i18n';
66
+ $loaded=load_plugin_textdomain('cleantalk', false, $dir);
67
+ }
68
+
69
+ /**
70
+ * Inner function - Request's wrapper for anything
71
+ * @param array Array of parameters:
72
+ * 'message' - string
73
+ * 'example' - string
74
+ * 'checkjs' - int
75
+ * 'sender_email' - string
76
+ * 'sender_nickname' - string
77
+ * 'sender_info' - array
78
+ * 'post_info' - string
79
+ * @return array array('ct'=> Cleantalk, 'ct_result' => CleantalkResponse)
80
+ */
81
+ function apbct_base_call($params = array(), $reg_flag = false){
82
+
83
+ global $apbct, $cleantalk_executed;
84
+
85
+ $cleantalk_executed = true;
86
+
87
+ $sender_info = !empty($params['sender_info'])
88
+ ? CleantalkHelper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
89
+ : apbct_get_sender_info();
90
+
91
+ // Fileds exclusions
92
+ if( ! empty( $params['message'] ) && is_array( $params['message'] ) ){
93
+
94
+ $params['message'] = apbct_array( $params['message'] )
95
+ ->get_keys( $apbct->settings['exclusions__fields'], $apbct->settings['exclusions__fields__use_regexp'] )
96
+ ->delete();
97
+ }
98
+
99
+ $default_params = array(
100
+
101
+ // IPs
102
+ 'sender_ip' => defined('CT_TEST_IP') ? CT_TEST_IP : (isset($params['sender_ip']) ? $params['sender_ip'] : CleantalkHelper::ip__get(array('real'), false)),
103
+ 'x_forwarded_for' => CleantalkHelper::ip__get(array('x_forwarded_for'), false),
104
+ 'x_real_ip' => CleantalkHelper::ip__get(array('x_real_ip'), false),
105
+
106
+ // Misc
107
+ 'auth_key' => $apbct->api_key,
108
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE) ? 1 : apbct_js_test('ct_checkjs', $_POST),
109
+
110
+ 'agent' => APBCT_AGENT,
111
+ 'sender_info' => $sender_info,
112
+ 'submit_time' => apbct_get_submit_time(),
113
+ );
114
+
115
+ // Send $_SERVER if couldn't find IP
116
+ if(empty($default_params['sender_ip']))
117
+ $default_params['sender_info']['server_info'] = $_SERVER;
118
+
119
+ $ct_request = new CleantalkRequest(
120
+ CleantalkHelper::array_merge__save_numeric_keys__recursive($default_params, $params)
121
+ );
122
+
123
+ $ct = new Cleantalk();
124
+
125
+ $ct->use_bultin_api = $apbct->settings['use_buitin_http_api'] ? true : false;
126
+ $ct->ssl_on = $apbct->settings['ssl_on'];
127
+ $ct->ssl_path = APBCT_CASERT_PATH;
128
+
129
+ // Options store url without shceme because of DB error with ''://'
130
+ $config = ct_get_server();
131
+ $ct->server_url = APBCT_MODERATE_URL;
132
+ $ct->work_url = preg_match('/http:\/\/.+/', $config['ct_work_url']) ? $config['ct_work_url'] : null;
133
+ $ct->server_ttl = $config['ct_server_ttl'];
134
+ $ct->server_changed = $config['ct_server_changed'];
135
+
136
+ $start = microtime(true);
137
+ $ct_result = $reg_flag
138
+ ? @$ct->isAllowUser($ct_request)
139
+ : @$ct->isAllowMessage($ct_request);
140
+ $exec_time = microtime(true) - $start;
141
+
142
+ // Statistics
143
+ // Average request time
144
+ apbct_statistics__rotate($exec_time);
145
+ // Last request
146
+ $apbct->stats['last_request']['time'] = time();
147
+ $apbct->stats['last_request']['server'] = $ct->work_url;
148
+ $apbct->save('stats');
149
+
150
+ // Connection reports
151
+ if ($ct_result->errno === 0 && empty($ct_result->errstr))
152
+ $apbct->data['connection_reports']['success']++;
153
+ else
154
+ {
155
+ $apbct->data['connection_reports']['negative']++;
156
+ $apbct->data['connection_reports']['negative_report'][] = array(
157
+ 'date' => date("Y-m-d H:i:s"),
158
+ 'page_url' => apbct_get_server_variable( 'REQUEST_URI' ),
159
+ 'lib_report' => $ct_result->errstr,
160
+ 'work_url' => $ct->work_url,
161
+ );
162
+
163
+ if(count($apbct->data['connection_reports']['negative_report']) > 20)
164
+ $apbct->data['connection_reports']['negative_report'] = array_slice($apbct->data['connection_reports']['negative_report'], -20, 20);
165
+
166
+ }
167
+
168
+ if ($ct->server_change) {
169
+ update_option(
170
+ 'cleantalk_server',
171
+ array(
172
+ 'ct_work_url' => $ct->work_url,
173
+ 'ct_server_ttl' => $ct->server_ttl,
174
+ 'ct_server_changed' => time(),
175
+ )
176
+ );
177
+ }
178
+
179
+ $ct_result = ct_change_plugin_resonse($ct_result, $ct_request->js_on);
180
+
181
+ // Restart submit form counter for failed requests
182
+ if ($ct_result->allow == 0){
183
+ apbct_cookie(); // Setting page timer and cookies
184
+ ct_add_event('no');
185
+ }else{
186
+ ct_add_event('yes');
187
+ }
188
+
189
+ // Set cookies if it's not.
190
+ if(empty($apbct->flags__cookies_setuped))
191
+ apbct_cookie();
192
+
193
+ return array('ct' => $ct, 'ct_result' => $ct_result);
194
+
195
+ }
196
+
197
+ function apbct_exclusions_check($func = null){
198
+
199
+ global $apbct, $cleantalk_executed;
200
+
201
+ // Common exclusions
202
+ if(
203
+ apbct_exclusions_check__ip() ||
204
+ apbct_exclusions_check__url() ||
205
+ apbct_is_user_role_in( $apbct->settings['exclusions__roles'] ) ||
206
+ $cleantalk_executed
207
+ )
208
+ return true;
209
+
210
+ // Personal exclusions
211
+ switch ($func){
212
+ case 'ct_contact_form_validate_postdata':
213
+ if(
214
+ (defined( 'DOING_AJAX' ) && DOING_AJAX) ||
215
+ apbct_array( $_POST )->get_keys( 'members_search_submit' )->result()
216
+ )
217
+ return true;
218
+ break;
219
+ case 'ct_contact_form_validate':
220
+ if(
221
+ apbct_array( $_POST )->get_keys( 'members_search_submit' )->result()
222
+ )
223
+ return true;
224
+ break;
225
+ default:
226
+ return false;
227
+ break;
228
+ }
229
+
230
+ return false;
231
+ }
232
+
233
+ /**
234
+ * Checks if reuqest URI is in exclusion list
235
+ *
236
+ * @return bool
237
+ */
238
+ function apbct_exclusions_check__url() {
239
+
240
+ global $apbct;
241
+
242
+ if ( ! empty( $apbct->settings['exclusions__urls'] ) ) {
243
+
244
+ $exclusions = explode( ',', $apbct->settings['exclusions__urls'] );
245
+
246
+ // Fix for AJAX forms
247
+ $haystack = apbct_get_server_variable( 'REQUEST_URI' ) == '/wp-admin/admin-ajax.php' && ! apbct_get_server_variable( 'HTTP_REFERER' )
248
+ ? apbct_get_server_variable( 'HTTP_REFERER' )
249
+ : apbct_get_server_variable( 'REQUEST_URI' );
250
+
251
+ foreach ( $exclusions as $exclusion ) {
252
+ if (
253
+ ($apbct->settings['exclusions__urls__use_regexp'] && preg_match( '/' . $exclusion . '/', $haystack ) === 1) ||
254
+ stripos( $haystack, $exclusion ) !== false
255
+ ){
256
+ return true;
257
+ }
258
+ }
259
+ return false;
260
+ }
261
+ }
262
+ /**
263
+ * @deprecated 5.128 Using IP white-lists instead
264
+ * @deprecated since 18.09.2019
265
+ * Checks if sender_ip is in exclusion list
266
+ *
267
+ * @return bool
268
+ */
269
+ function apbct_exclusions_check__ip(){
270
+
271
+ global $cleantalk_ip_exclusions;
272
+
273
+ if( apbct_get_server_variable( 'REMOTE_ADDR' ) ){
274
+
275
+ if( CleantalkHelper::ip__is_cleantalks( apbct_get_server_variable( 'REMOTE_ADDR' ) ) ){
276
+ return true;
277
+ }
278
+
279
+ if( ! empty( $cleantalk_ip_exclusions ) && is_array( $cleantalk_ip_exclusions ) ){
280
+ foreach ( $cleantalk_ip_exclusions as $exclusion ){
281
+ if( stripos( apbct_get_server_variable( 'REMOTE_ADDR' ), $exclusion ) !== false ){
282
+ return true;
283
+ }
284
+ }
285
+ }
286
+ }
287
+
288
+ return false;
289
+ }
290
+
291
+ /**
292
+ * Inner function - Default data array for senders
293
+ * @return array
294
+ */
295
+ function apbct_get_sender_info() {
296
+
297
+ global $apbct;
298
+
299
+ // Validate cookie from the backend
300
+ $cookie_is_ok = apbct_cookies_test();
301
+
302
+ $referer_previous = $apbct->settings['set_cookies__sessions']
303
+ ? apbct_alt_session__get('apbct_prev_referer')
304
+ : filter_input(INPUT_COOKIE, 'apbct_prev_referer');
305
+
306
+ $site_landing_ts = $apbct->settings['set_cookies__sessions']
307
+ ? apbct_alt_session__get('apbct_site_landing_ts')
308
+ : filter_input(INPUT_COOKIE, 'apbct_site_landing_ts');
309
+
310
+ $page_hits = $apbct->settings['set_cookies__sessions']
311
+ ? apbct_alt_session__get('apbct_page_hits')
312
+ : filter_input(INPUT_COOKIE, 'apbct_page_hits');
313
+
314
+ if (count($_POST) > 0) {
315
+ foreach ($_POST as $k => $v) {
316
+ if (preg_match("/^(ct_check|checkjs).+/", $k)) {
317
+ $checkjs_data_post = $v;
318
+ }
319
+ }
320
+ }
321
+
322
+ // AMP check
323
+ $amp_detected = apbct_get_server_variable( 'HTTP_REFERER' )
324
+ ? strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '/amp/') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '?amp=1') !== false || strpos(apbct_get_server_variable( 'HTTP_REFERER' ), '&amp=1') !== false
325
+ ? 1
326
+ : 0
327
+ : null;
328
+
329
+ $site_referer = $apbct->settings['store_urls__sessions']
330
+ ? apbct_alt_session__get('apbct_site_referer')
331
+ : filter_input(INPUT_COOKIE, 'apbct_site_referer');
332
+
333
+ $urls = $apbct->settings['store_urls__sessions']
334
+ ? (array)apbct_alt_session__get('apbct_urls')
335
+ : (array)json_decode(filter_input(INPUT_COOKIE, 'apbct_urls'), true);
336
+
337
+ return array(
338
+ 'remote_addr' => CleantalkHelper::ip__get(array('remote_addr'), false),
339
+ 'REFFERRER' => apbct_get_server_variable( 'HTTP_REFERER' ),
340
+ 'USER_AGENT' => apbct_get_server_variable( 'HTTP_USER_AGENT' ),
341
+ 'page_url' => apbct_get_server_variable( 'SERVER_NAME' ) . apbct_get_server_variable( 'REQUEST_URI' ),
342
+ 'cms_lang' => substr(get_locale(), 0, 2),
343
+ 'ct_options' => json_encode($apbct->settings),
344
+ 'fields_number' => sizeof($_POST),
345
+ 'direct_post' => $cookie_is_ok === null && apbct_is_post() ? 1 : 0,
346
+ // Raw data to validated JavaScript test in the cloud
347
+ 'checkjs_data_cookies' => !empty($_COOKIE['ct_checkjs']) ? $_COOKIE['ct_checkjs'] : null,
348
+ 'checkjs_data_post' => !empty($checkjs_data_post) ? $checkjs_data_post : null,
349
+ // PHP cookies
350
+ 'cookies_enabled' => $cookie_is_ok,
351
+ 'REFFERRER_PREVIOUS' => !empty($referer_previous) && $cookie_is_ok ? $referer_previous : null,
352
+ 'site_landing_ts' => !empty($site_landing_ts) && $cookie_is_ok ? $site_landing_ts : null,
353
+ 'page_hits' => !empty($page_hits) ? $page_hits : null,
354
+ // JS cookies
355
+ 'js_info' => !empty($_COOKIE['ct_user_info']) ? json_decode(stripslashes($_COOKIE['ct_user_info']), true) : null,
356
+ 'mouse_cursor_positions' => !empty($_COOKIE['ct_pointer_data']) ? json_decode(stripslashes($_COOKIE['ct_pointer_data']), true) : null,
357
+ 'js_timezone' => !empty($_COOKIE['ct_timezone']) ? $_COOKIE['ct_timezone'] : null,
358
+ 'key_press_timestamp' => !empty($_COOKIE['ct_fkp_timestamp']) ? $_COOKIE['ct_fkp_timestamp'] : null,
359
+ 'page_set_timestamp' => !empty($_COOKIE['ct_ps_timestamp']) ? $_COOKIE['ct_ps_timestamp'] : null,
360
+ 'form_visible_inputs' => !empty($_COOKIE['apbct_visible_fields_count']) ? $_COOKIE['apbct_visible_fields_count'] : null,
361
+ 'apbct_visible_fields' => !empty($_COOKIE['apbct_visible_fields']) ? apbct_visibile_fields__process($_COOKIE['apbct_visible_fields']) : null,
362
+ // Misc
363
+ 'site_referer' => !empty($site_referer) ? $site_referer : null,
364
+ 'source_url' => !empty($urls) ? json_encode($urls) : null,
365
+ // Debug stuff
366
+ 'amp_detected' => $amp_detected,
367
+ 'hook' => current_action(),
368
+ 'headers_sent' => !empty($apbct->headers_sent) ? $apbct->headers_sent : false,
369
+ 'headers_sent__hook' => !empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : false,
370
+ 'headers_sent__where' => !empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
371
+ 'request_type' => apbct_get_server_variable('REQUEST_METHOD') ? apbct_get_server_variable('REQUEST_METHOD') : 'UNKNOWN',
372
+ 'abpct_hyro_acc_collect' => !empty($_COOKIE['abpct_hyro_acc_collect']) ? json_decode(stripslashes($_COOKIE['abpct_hyro_acc_collect']), true): null,
373
+ );
374
+ }
375
+
376
+ /**
377
+ * Process visible fields for specific form to match the fields from request
378
+ *
379
+ * @param string $visible_fields
380
+ *
381
+ * @return string
382
+ */
383
+ function apbct_visibile_fields__process($visible_fields) {
384
+ if(strpos($visible_fields, 'wpforms') !== false){
385
+ $visible_fields = preg_replace(
386
+ array('/\[/', '/\]/'),
387
+ '',
388
+ str_replace(
389
+ '][',
390
+ '_',
391
+ str_replace(
392
+ 'wpforms[fields]',
393
+ '',
394
+ $visible_fields
395
+ )
396
+ )
397
+ );
398
+ }
399
+
400
+ return $visible_fields;
401
+ }
402
+
403
+ /*
404
+ * Outputs JS key for AJAX-use only. Stops script.
405
+ */
406
+ function apbct_js_keys__get__ajax($direct_call = false){
407
+ if(!$direct_call){
408
+ if(isset($_POST['_ajax_nonce'])){
409
+ if(!wp_verify_nonce($_POST['_ajax_nonce'], 'ct_secret_stuff')){
410
+ wp_doing_ajax()
411
+ ? wp_die( -1, 403 )
412
+ : die( '-1' );
413
+ }
414
+ }else{
415
+ wp_doing_ajax()
416
+ ? wp_die( -1, 403 )
417
+ : die( '-1' );
418
+ }
419
+ }
420
+ die(json_encode(array(
421
+ 'js_key' => ct_get_checkjs_value()
422
+ )));
423
+ }
424
+
425
+ /**
426
+ * Get ct_get_checkjs_value
427
+ *
428
+ * @param bool $random_key
429
+ *
430
+ * @return int|string|null
431
+ */
432
+ function ct_get_checkjs_value(){
433
+
434
+ global $apbct;
435
+
436
+ // Use static JS keys
437
+ if($apbct->settings['use_static_js_key'] == 1){
438
+
439
+ $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
440
+
441
+ // Auto detecting. Detected.
442
+ }elseif(
443
+ $apbct->settings['use_static_js_key'] == - 1 &&
444
+ ( apbct_is_cache_plugins_exists() ||
445
+ ( apbct_is_post() && $apbct->data['cache_detected'] == 1 )
446
+ )
447
+ ){
448
+ $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
449
+ if( apbct_is_cache_plugins_exists() )
450
+ $apbct->data['cache_detected'] = 1;
451
+
452
+ // Using dynamic JS keys
453
+ }else{
454
+
455
+ $keys = $apbct->data['js_keys'];
456
+ $keys_checksum = md5(json_encode($keys));
457
+
458
+ $key = null;
459
+ $latest_key_time = 0;
460
+
461
+ foreach ($keys as $k => $t) {
462
+
463
+ // Removing key if it's to old
464
+ if (time() - $t > $apbct->data['js_keys_store_days'] * 86400 * 7) {
465
+ unset($keys[$k]);
466
+ continue;
467
+ }
468
+
469
+ if ($t > $latest_key_time) {
470
+ $latest_key_time = $t;
471
+ $key = $k;
472
+ }
473
+ }
474
+
475
+ // Set new key if the latest key is too old
476
+ if (time() - $latest_key_time > $apbct->data['js_key_lifetime']) {
477
+ $key = rand();
478
+ $keys[$key] = time();
479
+ }
480
+
481
+ // Save keys if they were changed
482
+ if (md5(json_encode($keys)) != $keys_checksum) {
483
+ $apbct->data['js_keys'] = $keys;
484
+ // $apbct->saveData();
485
+ }
486
+
487
+ $apbct->data['cache_detected'] = 0;
488
+ }
489
+
490
+ $apbct->saveData();
491
+
492
+ return $key;
493
+ }
494
+
495
+ function apbct_is_cache_plugins_exists(){
496
+ return
497
+ defined('WP_ROCKET_VERSION') || // WPRocket
498
+ defined('LSCWP_DIR') || // LiteSpeed Cache
499
+ defined('WPFC_WP_CONTENT_BASENAME') || // WP Fastest Cache
500
+ defined('W3TC') || // W3 Total Cache
501
+ defined('WPO_VERSION') || // WP-Optimize – Clean, Compress, Cache
502
+ defined('AUTOPTIMIZE_PLUGIN_VERSION') || // Autoptimize
503
+ defined('WPCACHEHOME') || // WP Super Cache
504
+ defined('WPHB_VERSION') || // Hummingbird – Speed up, Cache, Optimize Your CSS and JS
505
+ defined('CE_FILE') || // Cache Enabler – WordPress Cache
506
+ class_exists('RedisObjectCache') || // Redis Object Cache
507
+ defined('SiteGround_Optimizer\VERSION') || // SG Optimizer
508
+ class_exists('WP_Rest_Cache_Plugin\Includes\Plugin'); // WP REST Cache
509
+ }
510
+
511
+ /**
512
+ * Inner function - Current site admin e-mail
513
+ * @return string Admin e-mail
514
+ */
515
+ function ct_get_admin_email() {
516
+ global $admin_email;
517
+ if(!isset($admin_email))
518
+ {
519
+ $admin_email = get_option('admin_email');
520
+ }
521
+ return $admin_email;
522
+ }
523
+
524
+ /**
525
+ * Inner function - Current Cleantalk working server info
526
+ * @return mixed[] Array of server data
527
+ */
528
+ function ct_get_server($force=false) {
529
+ global $ct_server;
530
+ if(!$force && isset($ct_server) && isset($ct_server['ct_work_url']) && !empty($ct_server['ct_work_url'])){
531
+
532
+ return $ct_server;
533
+
534
+ }else{
535
+
536
+ $ct_server = get_option('cleantalk_server');
537
+ if (!is_array($ct_server)){
538
+ $ct_server = array(
539
+ 'ct_work_url' => NULL,
540
+ 'ct_server_ttl' => NULL,
541
+ 'ct_server_changed' => NULL
542
+ );
543
+ }
544
+ return $ct_server;
545
+ }
546
+ }
547
+
548
+ /**
549
+ * Inner function - Stores ang returns cleantalk hash of current comment
550
+ * @param string New hash or NULL
551
+ * @return string New hash or current hash depending on parameter
552
+ */
553
+ function ct_hash($new_hash = '') {
554
+ /**
555
+ * Current hash
556
+ */
557
+ static $hash;
558
+
559
+ if (!empty($new_hash)) {
560
+ $hash = $new_hash;
561
+ }
562
+ return $hash;
563
+ }
564
+
565
+ /**
566
+ * Inner function - Write manual moderation results to PHP sessions
567
+ * @param string $hash Cleantalk comment hash
568
+ * @param string $message comment_content
569
+ * @param int $allow flag good comment (1) or bad (0)
570
+ * @return string comment_content w\o cleantalk resume
571
+ */
572
+ function ct_feedback($hash, $allow) {
573
+ global $apbct;
574
+
575
+ $ct_feedback = $hash . ':' . $allow . ';';
576
+ if($apbct->data['feedback_request'])
577
+ $apbct->data['feedback_request'] = $ct_feedback;
578
+ else
579
+ $apbct->data['feedback_request'] .= $ct_feedback;
580
+
581
+ $apbct->saveData();
582
+ }
583
+
584
+ /**
585
+ * Inner function - Sends the results of moderation
586
+ * Scheduled in 3600 seconds!
587
+ * @param string $feedback_request
588
+ * @return bool
589
+ */
590
+ function ct_send_feedback($feedback_request = null) {
591
+
592
+ global $apbct;
593
+
594
+ if (empty($feedback_request) && isset($apbct->data['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $apbct->data['feedback_request'])){
595
+ $feedback_request = $apbct->data['feedback_request'];
596
+ $apbct->data['feedback_request'] = '';
597
+ $apbct->saveData();
598
+ }
599
+
600
+ if ($feedback_request !== null) {
601
+
602
+ $ct_request = new CleantalkRequest(array(
603
+ // General
604
+ 'auth_key' => $apbct->api_key,
605
+ // Additional
606
+ 'feedback' => $feedback_request,
607
+ ));
608
+
609
+ $ct = new Cleantalk();
610
+
611
+ // Server URL handling
612
+ $config = ct_get_server();
613
+ $ct->server_url = APBCT_MODERATE_URL;
614
+ $ct->work_url = preg_match('/http:\/\/.+/', $config['ct_work_url']) ? $config['ct_work_url'] : null;
615
+ $ct->server_ttl = $config['ct_server_ttl'];
616
+ $ct->server_changed = $config['ct_server_changed'];
617
+
618
+ $ct->sendFeedback($ct_request);
619
+
620
+ if ($ct->server_change) {
621
+ update_option(
622
+ 'cleantalk_server',
623
+ array(
624
+ 'ct_work_url' => $ct->work_url,
625
+ 'ct_server_ttl' => $ct->server_ttl,
626
+ 'ct_server_changed' => time(),
627
+ )
628
+ );
629
+ }
630
+
631
+ return true;
632
+ }
633
+
634
+ return false;
635
+ }
636
+
637
+ /**
638
+ * Delete old spam comments
639
+ * Scheduled in 3600 seconds!
640
+ * @return null
641
+ */
642
+ function ct_delete_spam_comments() {
643
+
644
+ global $apbct;
645
+
646
+ if ($apbct->settings['remove_old_spam'] == 1) {
647
+ $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
648
+ foreach ($last_comments as $c) {
649
+ $comment_date_gmt = strtotime($c->comment_date_gmt);
650
+ if ($comment_date_gmt && is_numeric($comment_date_gmt)) {
651
+ if (time() - $comment_date_gmt > 86400 * $apbct->data['spam_store_days']) {
652
+ // Force deletion old spam comments
653
+ wp_delete_comment($c->comment_ID, true);
654
+ }
655
+ }
656
+ }
657
+ }
658
+
659
+ return null;
660
+ }
661
+
662
+ /*
663
+ * Get data from an ARRAY recursively
664
+ * @return array
665
+ */
666
+ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = array('nick' => '', 'first' => '', 'last' => ''), $subject = null, $contact = true, $prev_name = ''){
667
+
668
+ //Skip request if fields exists
669
+ $skip_params = array(
670
+ 'ipn_track_id', // PayPal IPN #
671
+ 'txn_type', // PayPal transaction type
672
+ 'payment_status', // PayPal payment status
673
+ 'ccbill_ipn', // CCBill IPN
674
+ 'ct_checkjs', // skip ct_checkjs field
675
+ 'api_mode', // DigiStore-API
676
+ 'loadLastCommentId' // Plugin: WP Discuz. ticket_id=5571
677
+ );
678
+
679
+ // Fields to replace with ****
680
+ $obfuscate_params = array(
681
+ 'password',
682
+ 'pass',
683
+ 'pwd',
684
+ 'pswd'
685
+ );
686
+
687
+ // Skip feilds with these strings and known service fields
688
+ $skip_fields_with_strings = array(
689
+ // Common
690
+ 'ct_checkjs', //Do not send ct_checkjs
691
+ 'nonce', //nonce for strings such as 'rsvp_nonce_name'
692
+ 'security',
693
+ // 'action',
694
+ 'http_referer',
695
+ 'referer-page',
696
+ 'timestamp',
697
+ 'captcha',
698
+ // Formidable Form
699
+ 'form_key',
700
+ 'submit_entry',
701
+ // Custom Contact Forms
702
+ 'form_id',
703
+ 'ccf_form',
704
+ 'form_page',
705
+ // Qu Forms
706
+ 'iphorm_uid',
707
+ 'form_url',
708
+ 'post_id',
709
+ 'iphorm_ajax',
710
+ 'iphorm_id',
711
+ // Fast SecureContact Froms
712
+ 'fs_postonce_1',
713
+ 'fscf_submitted',
714
+ 'mailto_id',
715
+ 'si_contact_action',
716
+ // Ninja Forms
717
+ 'formData_id',
718
+ 'formData_settings',
719
+ 'formData_fields_\d+_id',
720
+ 'formData_fields_\d+_files.*',
721
+ // E_signature
722
+ 'recipient_signature',
723
+ 'output_\d+_\w{0,2}',
724
+ // Contact Form by Web-Settler protection
725
+ '_formId',
726
+ '_returnLink',
727
+ // Social login and more
728
+ '_save',
729
+ '_facebook',
730
+ '_social',
731
+ 'user_login-',
732
+ // Contact Form 7
733
+ '_wpcf7',
734
+ 'ebd_settings',
735
+ 'ebd_downloads_',
736
+ 'ecole_origine',
737
+ );
738
+
739
+ // Reset $message if we have a sign-up data
740
+ $skip_message_post = array(
741
+ 'edd_action', // Easy Digital Downloads
742
+ );
743
+
744
+ if( apbct_array( array( $_POST, $_GET ) )->get_keys( $skip_params )->result() )
745
+ $contact = false;
746
+
747
+ if(count($arr)){
748
+
749
+ foreach($arr as $key => $value){
750
+
751
+ if(gettype($value) == 'string'){
752
+
753
+ $tmp = strpos($value, '\\') !== false ? stripslashes($value) : $value;
754
+ $decoded_json_value = json_decode($tmp, true);
755
+
756
+ // Decoding JSON
757
+ if($decoded_json_value !== null){
758
+ $value = $decoded_json_value;
759
+
760
+ // Ajax Contact Forms. Get data from such strings:
761
+ // acfw30_name %% Blocked~acfw30_email %% s@cleantalk.org
762
+ // acfw30_textarea %% msg
763
+ }elseif(preg_match('/^\S+\s%%\s\S+.+$/', $value)){
764
+ $value = explode('~', $value);
765
+ foreach ($value as &$val){
766
+ $tmp = explode(' %% ', $val);
767
+ $val = array($tmp[0] => $tmp[1]);
768
+ }
769
+ }
770
+ }
771
+
772
+ if(!is_array($value) && !is_object($value)){
773
+
774
+ if (in_array($key, $skip_params, true) && $key != 0 && $key != '' || preg_match("/^ct_checkjs/", $key))
775
+ $contact = false;
776
+
777
+ if($value === '')
778
+ continue;
779
+
780
+ // Skipping fields names with strings from (array)skip_fields_with_strings
781
+ foreach($skip_fields_with_strings as $needle){
782
+ if (preg_match("/".$needle."/", $prev_name.$key) == 1){
783
+ continue(2);
784
+ }
785
+ }unset($needle);
786
+
787
+ // Obfuscating params
788
+ foreach($obfuscate_params as $needle){
789
+ if (strpos($key, $needle) !== false){
790
+ $value = ct_obfuscate_param($value);
791
+ continue(2);
792
+ }
793
+ }unset($needle);
794
+
795
+ // Removes whitespaces
796
+ $value = urldecode( trim( strip_shortcodes( $value ) ) ); // Fully cleaned message
797
+ $value_for_email = trim( strip_shortcodes( $value ) ); // Removes shortcodes to do better spam filtration on server side.
798
+
799
+ // Email
800
+ if ( ! $email && preg_match( "/^\S+@\S+\.\S+$/", $value_for_email ) ) {
801
+ $email = $value_for_email;
802
+
803
+ // Names
804
+ }elseif (preg_match("/name/i", $key)){
805
+
806
+ preg_match("/((name.?)?(your|first|for)(.?name)?)/", $key, $match_forename);
807
+ preg_match("/((name.?)?(last|family|second|sur)(.?name)?)/", $key, $match_surname);
808
+ preg_match("/(name.?)?(nick|user)(.?name)?/", $key, $match_nickname);
809
+
810
+ if(count($match_forename) > 1)
811
+ $nickname['first'] = $value;
812
+ elseif(count($match_surname) > 1)
813
+ $nickname['last'] = $value;
814
+ elseif(count($match_nickname) > 1)
815
+ $nickname['nick'] = $value;
816
+ else
817
+ $message[$prev_name.$key] = $value;
818
+
819
+ // Subject
820
+ }elseif ($subject === null && preg_match("/subject/i", $key)){
821
+ $subject = $value;
822
+
823
+ // Message
824
+ }else{
825
+ $message[$prev_name.$key] = $value;
826
+ }
827
+
828
+ }elseif(!is_object($value)){
829
+
830
+ $prev_name_original = $prev_name;
831
+ $prev_name = ($prev_name === '' ? $key.'_' : $prev_name.$key.'_');
832
+
833
+ $temp = ct_get_fields_any($value, $message, $email, $nickname, $subject, $contact, $prev_name);
834
+
835
+ $message = $temp['message'];
836
+ $email = ($temp['email'] ? $temp['email'] : null);
837
+ $nickname = ($temp['nickname'] ? $temp['nickname'] : null);
838
+ $subject = ($temp['subject'] ? $temp['subject'] : null);
839
+ if($contact === true)
840
+ $contact = ($temp['contact'] === false ? false : true);
841
+ $prev_name = $prev_name_original;
842
+ }
843
+ } unset($key, $value);
844
+ }
845
+
846
+ foreach ($skip_message_post as $v) {
847
+ if (isset($_POST[$v])) {
848
+ $message = null;
849
+ break;
850
+ }
851
+ } unset($v);
852
+
853
+ //If top iteration, returns compiled name field. Example: "Nickname Firtsname Lastname".
854
+ if($prev_name === ''){
855
+ if(!empty($nickname)){
856
+ $nickname_str = '';
857
+ foreach($nickname as $value){
858
+ $nickname_str .= ($value ? $value." " : "");
859
+ }unset($value);
860
+ }
861
+ $nickname = $nickname_str;
862
+ }
863
+
864
+ $return_param = array(
865
+ 'email' => $email,
866
+ 'nickname' => $nickname,
867
+ 'subject' => $subject,
868
+ 'contact' => $contact,
869
+ 'message' => $message
870
+ );
871
+ return $return_param;
872
+ }
873
+
874
+ /**
875
+ * Masks a value with asterisks (*)
876
+ * @return string
877
+ */
878
+ function ct_obfuscate_param($value = null) {
879
+ if ($value && (!is_object($value) || !is_array($value))) {
880
+ $length = strlen($value);
881
+ $value = str_repeat('*', $length);
882
+ }
883
+
884
+ return $value;
885
+ }
886
+
887
+ //New ct_get_fields_any_postdata
888
+ function ct_get_fields_any_postdata($arr, $message=array()){
889
+ $skip_params = array(
890
+ 'ipn_track_id', // PayPal IPN #
891
+ 'txn_type', // PayPal transaction type
892
+ 'payment_status', // PayPal payment status
893
+ );
894
+
895
+ foreach($arr as $key => $value){
896
+ if(!is_array($value)){
897
+ if($value == '')
898
+ continue;
899
+ if (!(in_array($key, $skip_params) || preg_match("/^ct_checkjs/", $key)) && $value!='')
900
+ $message[$key] = $value;
901
+ }else{
902
+ $temp = ct_get_fields_any_postdata($value);
903
+ $message = (count($temp) == 0 ? $message : array_merge($message, $temp));
904
+ }
905
+ }
906
+ return $message;
907
+ }
908
+
909
+ /**
910
+ * Checks if given string is valid regular expression
911
+ *
912
+ * @param string $regexp
913
+ *
914
+ * @return bool
915
+ */
916
+ function apbct_is_regexp($regexp){
917
+ return @preg_match('/' . $regexp . '/', null) !== false;
918
+ }
919
+
920
+ function cleantalk_debug($key,$value)
921
+ {
922
+ if(isset($_COOKIE) && isset($_COOKIE['cleantalk_debug']))
923
+ {
924
+ @header($key.": ".$value);
925
+ }
926
+ }
927
+
928
+ /**
929
+ * Function changes CleanTalk result object if an error occured.
930
+ * @return object
931
+ */
932
+ function ct_change_plugin_resonse($ct_result = null, $checkjs = null) {
933
+
934
+ global $apbct;
935
+
936
+ if (!$ct_result) {
937
+ return $ct_result;
938
+ }
939
+
940
+ if(@intval($ct_result->errno) != 0)
941
+ {
942
+ if($checkjs === null || $checkjs != 1)
943
+ {
944
+ $ct_result->allow = 0;
945
+ $ct_result->spam = 1;
946
+ $ct_result->comment = sprintf('We\'ve got an issue: %s. Forbidden. Please, enable Javascript. %s.',
947
+ $ct_result->comment,
948
+ $apbct->plugin_name
949
+ );
950
+ }
951
+ else
952
+ {
953
+ $ct_result->allow = 1;
954
+ $ct_result->comment = 'Allow';
955
+ }
956
+ }
957
+
958
+ return $ct_result;
959
+ }
960
+
961
+ /**
962
+ * Does key has correct symbols? Checks against regexp ^[a-z\d]{3,15}$
963
+ * @param api_key
964
+ * @return bool
965
+ */
966
+ function apbct_api_key__is_correct($api_key = null)
967
+ {
968
+ global $apbct;
969
+ $api_key = $api_key !== null ? $api_key : $apbct->api_key;
970
+ return $api_key && preg_match('/^[a-z\d]{3,15}$/', $api_key) ? true : false;
971
+ }
972
+
973
+ function apbct_add_async_attribute($tag, $handle, $src) {
974
+
975
+ global $apbct;
976
+
977
+ if(
978
+ $apbct->settings['async_js'] &&
979
+ (
980
+ $handle === 'ct_public'
981
+ || $handle === 'ct_public_gdpr'
982
+ || $handle === 'ct_debug_js'
983
+ || $handle === 'ct_public_admin_js'
984
+ || $handle === 'ct_internal'
985
+ || $handle === 'ct_external'
986
+ || $handle === 'ct_nocache'
987
+ )
988
+ )
989
+ return str_replace( ' src', ' async="async" src', $tag );
990
+ else
991
+ return $tag;
992
  }
inc/cleantalk-pluggable.php CHANGED
@@ -1,272 +1,272 @@
1
- <?php
2
-
3
- /**
4
- * Getting current user by cookie
5
- *
6
- * @return WP_User|null
7
- */
8
- function apbct_wp_get_current_user(){
9
-
10
- global $apbct, $current_user;
11
-
12
- $user = null;
13
-
14
- if(!(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
15
-
16
- if(!empty($apbct->user)){
17
- $user_id = is_object($current_user) && isset($current_user->ID) && !($current_user instanceof WP_User)
18
- ? $current_user->ID
19
- : null;
20
- }else{
21
- $user_id = empty($user_id) && defined('LOGGED_IN_COOKIE') && !empty($_COOKIE[LOGGED_IN_COOKIE])
22
- ? apbct_wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in')
23
- : null;
24
- }
25
-
26
- if($user_id){
27
- $user = new WP_User($user_id);
28
- }
29
-
30
- }
31
-
32
- return $user ? $user : $current_user;
33
- }
34
-
35
- function apbct_wp_set_current_user($user = null){
36
-
37
- global $apbct;
38
-
39
- if( $user instanceof WP_User ){
40
- $apbct->user = $user;
41
- return true;
42
- }
43
-
44
- return false;
45
- }
46
-
47
- /**
48
- * Validates authentication cookie.
49
- *
50
- * The checks include making sure that the authentication cookie is set and
51
- * pulling in the contents (if $cookie is not used).
52
- *
53
- * Makes sure the cookie is not expired. Verifies the hash in cookie is what is
54
- * should be and compares the two.
55
- *
56
- * @param string $cookie Optional. If used, will validate contents instead of cookie's
57
- * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
58
- *
59
- * @return false|int False if invalid cookie, User ID if valid.
60
- * @global int $login_grace_period
61
- *
62
- */
63
- function apbct_wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
64
-
65
- $cookie_elements = apbct_wp_parse_auth_cookie($cookie, $scheme);
66
-
67
- $scheme = $cookie_elements['scheme'];
68
- $username = $cookie_elements['username'];
69
- $hmac = $cookie_elements['hmac'];
70
- $token = $cookie_elements['token'];
71
- $expiration = $cookie_elements['expiration'];
72
-
73
- // Allow a grace period for POST and Ajax requests
74
- $expired = apbct_is_ajax() || apbct_is_post()
75
- ? $expiration + HOUR_IN_SECONDS
76
- : $cookie_elements['expiration'];
77
-
78
- // Quick check to see if an honest cookie has expired
79
- if($expired >= time()){
80
- $user = apbct_wp_get_user_by('login', $username);
81
- if($user){
82
- $pass_frag = substr($user->user_pass, 8, 4);
83
- $key = apbct_wp_hash($username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme);
84
- // If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
85
- $algo = function_exists('hash') ? 'sha256' : 'sha1';
86
- $hash = hash_hmac($algo, $username . '|' . $expiration . '|' . $token, $key);
87
- if(hash_equals($hash, $hmac)){
88
- $sessions = get_user_meta($user->ID, 'session_tokens', true);
89
- $sessions = current($sessions);
90
- if(is_array($sessions)){
91
- if(is_int($sessions['expiration']) && $sessions['expiration'] > time()){
92
- return $user->ID;
93
- }else
94
- return false;
95
- }else
96
- return false;
97
- }else
98
- return false;
99
- }else
100
- return false;
101
- }else
102
- return false;
103
- }
104
-
105
- /**
106
- * Gets user by filed
107
- *
108
- * @param $field
109
- * @param $value
110
- *
111
- * @return bool|WP_User
112
- */
113
- function apbct_wp_get_user_by($field, $value){
114
-
115
- $userdata = WP_User::get_data_by($field, $value);
116
-
117
- if(!$userdata)
118
- return false;
119
-
120
- $user = new WP_User;
121
- $user->init($userdata);
122
-
123
- return $user;
124
- }
125
-
126
- /**
127
- * Get hash of given string.
128
- *
129
- * @param string $data Plain text to hash
130
- * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)
131
- * @return string Hash of $data
132
- */
133
- function apbct_wp_hash( $data, $scheme = 'auth' ) {
134
-
135
- $values = array(
136
- 'key' => '',
137
- 'salt' => '',
138
- );
139
-
140
- foreach(array('key', 'salt') as $type){
141
- $const = strtoupper( "{$scheme}_{$type}");
142
- if ( defined($const) && constant($const)){
143
- $values[$type] = constant($const);
144
- }elseif(!$values[$type]){
145
- $values[$type] = get_site_option( "{$scheme}_{$type}");
146
- if (!$values[$type]){
147
- $values[$type] = '';
148
- }
149
- }
150
- }
151
-
152
- $salt = $values['key'] . $values['salt'];
153
-
154
- return hash_hmac('md5', $data, $salt);
155
- }
156
-
157
- /**
158
- * Parse a cookie into its components
159
- *
160
- * @param string $cookie
161
- * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
162
- *
163
- * @return array|false Authentication cookie components
164
- *
165
- */
166
- function apbct_wp_parse_auth_cookie($cookie = '', $scheme = '')
167
- {
168
- $cookie_elements = explode('|', $cookie);
169
- if(count($cookie_elements) !== 4){
170
- return false;
171
- }
172
-
173
- list($username, $expiration, $token, $hmac) = $cookie_elements;
174
-
175
- return compact('username', 'expiration', 'token', 'hmac', 'scheme');
176
- }
177
-
178
- /**
179
- * Checks if the plugin is active
180
- *
181
- * @param string $plugin relative path from plugin folder like cleantalk-spam-protect/cleantalk.php
182
- *
183
- * @return bool
184
- */
185
- function apbct_is_plugin_active( $plugin ) {
186
- return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || apbct_is_plugin_active_for_network( $plugin );
187
- }
188
-
189
- /**
190
- * Checks if the plugin is active for network
191
- *
192
- * @param string $plugin relative path from plugin folder like cleantalk-spam-protect/cleantalk.php
193
- *
194
- * @return bool
195
- */
196
- function apbct_is_plugin_active_for_network( $plugin ){
197
-
198
- if ( ! APBCT_WPMS )
199
- return false;
200
-
201
- $plugins = get_site_option( 'active_sitewide_plugins' );
202
-
203
- return isset( $plugins[ $plugin ] )
204
- ? true
205
- : false;
206
- }
207
-
208
- /**
209
- * Checks if the request is AJAX
210
- *
211
- * @return boolean
212
- */
213
- function apbct_is_ajax() {
214
-
215
- return
216
- (defined( 'DOING_AJAX' ) && DOING_AJAX) || // by standart WP functions
217
- (apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' ) && strtolower(apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' )) == 'xmlhttprequest') || // by Request type
218
- !empty($_POST['quform_ajax']) || // special. QForms
219
- !empty($_POST['iphorm_ajax']); // special. IPHorm
220
-
221
- }
222
-
223
- /**
224
- * Checks if the user is logged in
225
- *
226
- * @return bool
227
- */
228
- function apbct_is_user_logged_in(){
229
- $siteurl = get_site_option( 'siteurl' );
230
- $cookiehash = $siteurl ? md5( $siteurl ) : '';
231
- return count($_COOKIE) && isset($_COOKIE['wordpress_logged_in_'.$cookiehash]);
232
- }
233
-
234
- /*
235
- * GETTING SERVER VARIABLES BY VARIOUS WAYS
236
- */
237
- function apbct_get_server_variable( $server_variable_name ){
238
-
239
- $var_name = strtoupper( $server_variable_name );
240
-
241
- if( function_exists( 'filter_input' ) )
242
- $value = filter_input( INPUT_SERVER, $var_name );
243
-
244
- if( empty( $value ) )
245
- $value = isset( $_SERVER[ $var_name ] ) ? $_SERVER[ $var_name ] : '';
246
-
247
- // Convert to upper case for REQUEST_METHOD
248
- if( in_array( $server_variable_name, array( 'REQUEST_METHOD' ) ) )
249
- $value = strtoupper( $value );
250
-
251
- // Convert HTML chars for HTTP_USER_AGENT, HTTP_USER_AGENT, SERVER_NAME
252
- if( in_array( $server_variable_name, array( 'HTTP_USER_AGENT', 'HTTP_USER_AGENT', 'SERVER_NAME' ) ) )
253
- $value = htmlspecialchars( $value );
254
-
255
- return $value;
256
- }
257
-
258
- function apbct_is_post(){
259
- return apbct_get_server_variable('REQUEST_METHOD') === 'POST';
260
- }
261
-
262
- function apbct_is_get(){
263
- return apbct_get_server_variable('REQUEST_METHOD') === 'GET';
264
- }
265
-
266
- function apbct_is_in_referer( $str ){
267
- return stripos( apbct_get_server_variable('HTTP_REFERER'), $str ) !== false;
268
- }
269
-
270
- function apbct_is_in_uri( $str ){
271
- return stripos( apbct_get_server_variable('REQUEST_URI'), $str ) !== false;
272
  }
1
+ <?php
2
+
3
+ /**
4
+ * Getting current user by cookie
5
+ *
6
+ * @return WP_User|null
7
+ */
8
+ function apbct_wp_get_current_user(){
9
+
10
+ global $apbct, $current_user;
11
+
12
+ $user = null;
13
+
14
+ if(!(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
15
+
16
+ if(!empty($apbct->user)){
17
+ $user_id = is_object($current_user) && isset($current_user->ID) && !($current_user instanceof WP_User)
18
+ ? $current_user->ID
19
+ : null;
20
+ }else{
21
+ $user_id = empty($user_id) && defined('LOGGED_IN_COOKIE') && !empty($_COOKIE[LOGGED_IN_COOKIE])
22
+ ? apbct_wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in')
23
+ : null;
24
+ }
25
+
26
+ if($user_id){
27
+ $user = new WP_User($user_id);
28
+ }
29
+
30
+ }
31
+
32
+ return $user ? $user : $current_user;
33
+ }
34
+
35
+ function apbct_wp_set_current_user($user = null){
36
+
37
+ global $apbct;
38
+
39
+ if( $user instanceof WP_User ){
40
+ $apbct->user = $user;
41
+ return true;
42
+ }
43
+
44
+ return false;
45
+ }
46
+
47
+ /**
48
+ * Validates authentication cookie.
49
+ *
50
+ * The checks include making sure that the authentication cookie is set and
51
+ * pulling in the contents (if $cookie is not used).
52
+ *
53
+ * Makes sure the cookie is not expired. Verifies the hash in cookie is what is
54
+ * should be and compares the two.
55
+ *
56
+ * @param string $cookie Optional. If used, will validate contents instead of cookie's
57
+ * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
58
+ *
59
+ * @return false|int False if invalid cookie, User ID if valid.
60
+ * @global int $login_grace_period
61
+ *
62
+ */
63
+ function apbct_wp_validate_auth_cookie( $cookie = '', $scheme = '' ) {
64
+
65
+ $cookie_elements = apbct_wp_parse_auth_cookie($cookie, $scheme);
66
+
67
+ $scheme = $cookie_elements['scheme'];
68
+ $username = $cookie_elements['username'];
69
+ $hmac = $cookie_elements['hmac'];
70
+ $token = $cookie_elements['token'];
71
+ $expiration = $cookie_elements['expiration'];
72
+
73
+ // Allow a grace period for POST and Ajax requests
74
+ $expired = apbct_is_ajax() || apbct_is_post()
75
+ ? $expiration + HOUR_IN_SECONDS
76
+ : $cookie_elements['expiration'];
77
+
78
+ // Quick check to see if an honest cookie has expired
79
+ if($expired >= time()){
80
+ $user = apbct_wp_get_user_by('login', $username);
81
+ if($user){
82
+ $pass_frag = substr($user->user_pass, 8, 4);
83
+ $key = apbct_wp_hash($username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme);
84
+ // If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
85
+ $algo = function_exists('hash') ? 'sha256' : 'sha1';
86
+ $hash = hash_hmac($algo, $username . '|' . $expiration . '|' . $token, $key);
87
+ if(hash_equals($hash, $hmac)){
88
+ $sessions = get_user_meta($user->ID, 'session_tokens', true);
89
+ $sessions = current($sessions);
90
+ if(is_array($sessions)){
91
+ if(is_int($sessions['expiration']) && $sessions['expiration'] > time()){
92
+ return $user->ID;
93
+ }else
94
+ return false;
95
+ }else
96
+ return false;
97
+ }else
98
+ return false;
99
+ }else
100
+ return false;
101
+ }else
102
+ return false;
103
+ }
104
+
105
+ /**
106
+ * Gets user by filed
107
+ *
108
+ * @param $field
109
+ * @param $value
110
+ *
111
+ * @return bool|WP_User
112
+ */
113
+ function apbct_wp_get_user_by($field, $value){
114
+
115
+ $userdata = WP_User::get_data_by($field, $value);
116
+
117
+ if(!$userdata)
118
+ return false;
119
+
120
+ $user = new WP_User;
121
+ $user->init($userdata);
122
+
123
+ return $user;
124
+ }
125
+
126
+ /**
127
+ * Get hash of given string.
128
+ *
129
+ * @param string $data Plain text to hash
130
+ * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce)
131
+ * @return string Hash of $data
132
+ */
133
+ function apbct_wp_hash( $data, $scheme = 'auth' ) {
134
+
135
+ $values = array(
136
+ 'key' => '',
137
+ 'salt' => '',
138
+ );
139
+
140
+ foreach(array('key', 'salt') as $type){
141
+ $const = strtoupper( "{$scheme}_{$type}");
142
+ if ( defined($const) && constant($const)){
143
+ $values[$type] = constant($const);
144
+ }elseif(!$values[$type]){
145
+ $values[$type] = get_site_option( "{$scheme}_{$type}");
146
+ if (!$values[$type]){
147
+ $values[$type] = '';
148
+ }
149
+ }
150
+ }
151
+
152
+ $salt = $values['key'] . $values['salt'];
153
+
154
+ return hash_hmac('md5', $data, $salt);
155
+ }
156
+
157
+ /**
158
+ * Parse a cookie into its components
159
+ *
160
+ * @param string $cookie
161
+ * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
162
+ *
163
+ * @return array|false Authentication cookie components
164
+ *
165
+ */
166
+ function apbct_wp_parse_auth_cookie($cookie = '', $scheme = '')
167
+ {
168
+ $cookie_elements = explode('|', $cookie);
169
+ if(count($cookie_elements) !== 4){
170
+ return false;
171
+ }
172
+
173
+ list($username, $expiration, $token, $hmac) = $cookie_elements;
174
+
175
+ return compact('username', 'expiration', 'token', 'hmac', 'scheme');
176
+ }
177
+
178
+ /**
179
+ * Checks if the plugin is active
180
+ *
181
+ * @param string $plugin relative path from plugin folder like cleantalk-spam-protect/cleantalk.php
182
+ *
183
+ * @return bool
184
+ */
185
+ function apbct_is_plugin_active( $plugin ) {
186
+ return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || apbct_is_plugin_active_for_network( $plugin );
187
+ }
188
+
189
+ /**
190
+ * Checks if the plugin is active for network
191
+ *
192
+ * @param string $plugin relative path from plugin folder like cleantalk-spam-protect/cleantalk.php
193
+ *
194
+ * @return bool
195
+ */
196
+ function apbct_is_plugin_active_for_network( $plugin ){
197
+
198
+ if ( ! APBCT_WPMS )
199
+ return false;
200
+
201
+ $plugins = get_site_option( 'active_sitewide_plugins' );
202
+
203
+ return isset( $plugins[ $plugin ] )
204
+ ? true
205
+ : false;
206
+ }
207
+
208
+ /**
209
+ * Checks if the request is AJAX
210
+ *
211
+ * @return boolean
212
+ */
213
+ function apbct_is_ajax() {
214
+
215
+ return
216
+ (defined( 'DOING_AJAX' ) && DOING_AJAX) || // by standart WP functions
217
+ (apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' ) && strtolower(apbct_get_server_variable( 'HTTP_X_REQUESTED_WITH' )) == 'xmlhttprequest') || // by Request type
218
+ !empty($_POST['quform_ajax']) || // special. QForms
219
+ !empty($_POST['iphorm_ajax']); // special. IPHorm
220
+
221
+ }
222
+
223
+ /**
224
+ * Checks if the user is logged in
225
+ *
226
+ * @return bool
227
+ */
228
+ function apbct_is_user_logged_in(){
229
+ $siteurl = get_site_option( 'siteurl' );
230
+ $cookiehash = $siteurl ? md5( $siteurl ) : '';
231
+ return count($_COOKIE) && isset($_COOKIE['wordpress_logged_in_'.$cookiehash]);
232
+ }
233
+
234
+ /*
235
+ * GETTING SERVER VARIABLES BY VARIOUS WAYS
236
+ */
237
+ function apbct_get_server_variable( $server_variable_name ){
238
+
239
+ $var_name = strtoupper( $server_variable_name );
240
+
241
+ if( function_exists( 'filter_input' ) )
242
+ $value = filter_input( INPUT_SERVER, $var_name );
243
+
244
+ if( empty( $value ) )
245
+ $value = isset( $_SERVER[ $var_name ] ) ? $_SERVER[ $var_name ] : '';
246
+
247
+ // Convert to upper case for REQUEST_METHOD
248
+ if( in_array( $server_variable_name, array( 'REQUEST_METHOD' ) ) )
249
+ $value = strtoupper( $value );
250
+
251
+ // Convert HTML chars for HTTP_USER_AGENT, HTTP_USER_AGENT, SERVER_NAME
252
+ if( in_array( $server_variable_name, array( 'HTTP_USER_AGENT', 'HTTP_USER_AGENT', 'SERVER_NAME' ) ) )
253
+ $value = htmlspecialchars( $value );
254
+
255
+ return $value;
256
+ }
257
+
258
+ function apbct_is_post(){
259
+ return apbct_get_server_variable('REQUEST_METHOD') === 'POST';
260
+ }
261
+
262
+ function apbct_is_get(){
263
+ return apbct_get_server_variable('REQUEST_METHOD') === 'GET';
264
+ }
265
+
266
+ function apbct_is_in_referer( $str ){
267
+ return stripos( apbct_get_server_variable('HTTP_REFERER'), $str ) !== false;
268
+ }
269
+
270
+ function apbct_is_in_uri( $str ){
271
+ return stripos( apbct_get_server_variable('REQUEST_URI'), $str ) !== false;
272
  }
inc/cleantalk-public.php CHANGED
@@ -1,3566 +1,3571 @@
1
- <?php
2
-
3
- /**
4
- * Init functions
5
- * @return mixed[] Array of options
6
- */
7
- function apbct_init() {
8
-
9
- global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $test_external_forms, $cleantalk_executed, $wpdb;
10
-
11
- //Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
12
- if((isset($_POST['action']) && $_POST['action'] == 'ct_check_internal') &&
13
- $apbct->settings['check_internal']
14
- ){
15
- $ct_result = ct_contact_form_validate();
16
- if($ct_result == null){
17
- echo 'true';
18
- die();
19
- }else{
20
- echo $ct_result;
21
- die();
22
- }
23
- }
24
-
25
- //fix for EPM registration form
26
- if(isset($_POST) && isset($_POST['reg_email']) && shortcode_exists( 'epm_registration_form' ))
27
- {
28
- unset($_POST['ct_checkjs_register_form']);
29
- }
30
-
31
- if(isset($_POST['_wpnonce-et-pb-contact-form-submitted']))
32
- {
33
- add_shortcode( 'et_pb_contact_form', 'ct_contact_form_validate' );
34
- }
35
-
36
- if($apbct->settings['check_external']){
37
-
38
- // Fixing form and directs it this site
39
- if($apbct->settings['check_external__capture_buffer'] && !is_admin() && !apbct_is_ajax() && apbct_is_user_enable() && !(defined('DOING_CRON') && DOING_CRON) && !(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
40
- add_action('wp', 'apbct_buffer__start');
41
- add_action('shutdown', 'apbct_buffer__end', 0);
42
- add_action('shutdown', 'apbct_buffer__output', 2);
43
- }
44
-
45
- // Check and redirecct
46
- if( apbct_is_post()
47
- && isset($_POST['cleantalk_hidden_method'])
48
- && isset($_POST['cleantalk_hidden_action'])
49
- ){
50
- $action = htmlspecialchars($_POST['cleantalk_hidden_action']);
51
- $method = htmlspecialchars($_POST['cleantalk_hidden_method']);
52
- unset($_POST['cleantalk_hidden_action']);
53
- unset($_POST['cleantalk_hidden_method']);
54
- ct_contact_form_validate();
55
- if(!apbct_is_ajax()){
56
- print "<html><body><form method='$method' action='$action'>";
57
- ct_print_form($_POST, '');
58
- print "</form></body></html>";
59
- print "<script>
60
- if(document.forms[0].submit !== 'undefined'){
61
- var objects = document.getElementsByName('submit');
62
- if(objects.length > 0)
63
- document.forms[0].removeChild(objects[0]);
64
- }
65
- document.forms[0].submit();
66
- </script>";
67
- die();
68
- }
69
- }
70
- }
71
-
72
- if(isset($_POST['quform_ajax'], $_POST['quform_csrf_token'], $_POST['quform_form_id'])){
73
- require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
74
- ct_ajax_hook();
75
- }
76
-
77
- /**hooks for cm answers pro */
78
- if(defined('CMA_PLUGIN_FILE')){
79
- add_action( 'wp', 'ct_ajax_hook',1 );
80
- }
81
-
82
- //hook for Anonymous Post
83
- if($apbct->settings['general_postdata_test'] == 1 && empty($_POST['ct_checkjs_cf7']))
84
- add_action('wp', 'ct_contact_form_validate_postdata',1);
85
-
86
- if($apbct->settings['general_contact_forms_test'] == 1 && empty($_POST['ct_checkjs_cf7'])){
87
- add_action('CMA_custom_post_type_nav', 'ct_contact_form_validate_postdata',1);
88
- //add_action('init','ct_contact_form_validate',1);
89
- ct_contact_form_validate();
90
- if(isset($_POST['reg_redirect_link'])&&isset($_POST['tmpl_registration_nonce_field']))
91
- {
92
- unset($_POST['ct_checkjs_register_form']);
93
- ct_contact_form_validate();
94
- }
95
- /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
96
- {
97
- $tmp=$_POST['redirect_to'];
98
- unset($_POST['redirect_to']);
99
- ct_contact_form_validate();
100
- $_POST['redirect_to']=$tmp;
101
- }*/
102
- }
103
-
104
- if($apbct->settings['general_postdata_test'] == 1 && empty($_POST['ct_checkjs_cf7']))
105
- add_action('CMA_custom_post_type_nav', 'ct_contact_form_validate_postdata',1);
106
-
107
- //add_action('wp_footer','ct_ajaxurl');
108
-
109
- // Fast Secure contact form
110
- if(defined('FSCF_VERSION')){
111
- add_filter('si_contact_display_after_fields', 'ct_si_contact_display_after_fields');
112
- add_filter('si_contact_form_validate', 'ct_si_contact_form_validate');
113
- }
114
-
115
- // WooCommerce registration
116
- if(class_exists('WooCommerce')){
117
- if( $apbct->settings['wc_register_from_order'] == 1 ){
118
- add_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1, 3 );
119
- }
120
- }
121
-
122
- // WooCommerce whishlist
123
- if(class_exists('WC_Wishlists_Wishlist'))
124
- add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
125
-
126
-
127
- // JetPack Contact form
128
- $jetpack_active_modules = false;
129
- if(defined('JETPACK__VERSION'))
130
- {
131
- if(isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form' ){
132
- if(JETPACK__VERSION=='3.4-beta')
133
- {
134
- add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
135
- }
136
- else if(JETPACK__VERSION=='3.4-beta2'||JETPACK__VERSION>='3.4')
137
- {
138
- add_filter('jetpack_contact_form_is_spam', 'ct_contact_form_is_spam_jetpack',50,2);
139
- }
140
- else
141
- {
142
- add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
143
- }
144
- $jetpack_active_modules = get_option('jetpack_active_modules');
145
- if ((class_exists( 'Jetpack', false) && $jetpack_active_modules && in_array('comments', $jetpack_active_modules)))
146
- {
147
- $ct_jp_comments = true;
148
- }
149
- }else
150
- add_filter('grunion_contact_form_field_html', 'ct_grunion_contact_form_field_html', 10, 2);
151
- }
152
-
153
- // WP Maintenance Mode (wpmm)
154
- add_action('wpmm_head', 'apbct_form__wpmm__addField', 1);
155
-
156
- // Contact Form7
157
- if(defined('WPCF7_VERSION')){
158
- add_filter('wpcf7_form_elements', 'apbct_form__contactForm7__addField');
159
- add_filter('wpcf7_validate', 'apbct_form__contactForm7__tesSpam__before_validate', 999, 2);
160
- add_filter(WPCF7_VERSION >= '3.0.0' ? 'wpcf7_spam' : 'wpcf7_acceptance', 'apbct_form__contactForm7__testSpam');
161
- }
162
-
163
- // Formidable
164
- add_filter( 'frm_entries_before_create', 'apbct_rorm__formidable__testSpam', 10, 2 );
165
- add_action( 'frm_entries_footer_scripts', 'apbct_rorm__formidable__footerScripts', 20, 2 );
166
-
167
- // BuddyPress
168
- if(class_exists('BuddyPress')){
169
- add_action('bp_before_registration_submit_buttons','ct_register_form',1);
170
- add_action('messages_message_before_save', 'apbct_integration__buddyPres__private_msg_check', 1);
171
- add_filter('bp_signup_validate', 'ct_registration_errors',1);
172
- add_filter('bp_signup_validate', 'ct_check_registration_erros', 999999);
173
- }
174
-
175
- if(defined('PROFILEPRESS_SYSTEM_FILE_PATH')){
176
- add_filter('pp_registration_validation', 'ct_registration_errors_ppress', 11, 2);
177
- }
178
-
179
-
180
- // bbPress
181
- if(class_exists('bbPress')){
182
- add_filter('bbp_new_topic_pre_title', 'ct_bbp_get_topic', 1);
183
- add_filter('bbp_new_topic_pre_content', 'ct_bbp_new_pre_content', 1);
184
- add_filter('bbp_new_reply_pre_content', 'ct_bbp_new_pre_content', 1);
185
- add_action('bbp_theme_before_topic_form_content', 'ct_comment_form');
186
- add_action('bbp_theme_before_reply_form_content', 'ct_comment_form');
187
- }
188
-
189
- //Custom Contact Forms
190
- if(defined('CCF_VERSION'))
191
- add_filter('ccf_field_validator', 'ct_ccf', 1, 4);
192
-
193
- add_action('comment_form', 'ct_comment_form');
194
-
195
- // intercept WordPress Landing Pages POST
196
- if (defined('LANDINGPAGES_CURRENT_VERSION') && !empty($_POST)){
197
- if(array_key_exists('action', $_POST) && $_POST['action'] === 'inbound_store_lead'){ // AJAX action(s)
198
- ct_check_wplp();
199
- }else if(array_key_exists('inbound_submitted', $_POST) && $_POST['inbound_submitted'] == '1'){ // Final submit
200
- ct_check_wplp();
201
- }
202
- }
203
-
204
- // S2member. intercept POST
205
- if (defined('WS_PLUGIN__S2MEMBER_PRO_VERSION')){
206
- $post_keys = array_keys($_POST);
207
- foreach($post_keys as $post_key){
208
-
209
- // Detect POST keys like /s2member_pro.*registration/
210
- if(strpos($post_key, 's2member') !== false && strpos($post_key, 'registration') !== false){
211
- ct_s2member_registration_test($post_key);
212
- break;
213
- }
214
- }
215
- }
216
-
217
- // New user approve hack
218
- // https://wordpress.org/plugins/new-user-approve/
219
- if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
220
- add_action('register_post', 'ct_register_post', 1, 3);
221
- }
222
-
223
- // Wilcity theme registration validation fix
224
- add_filter( 'wilcity/filter/wiloke-listing-tools/validate-before-insert-account', 'apbct_wilcity_reg_validation', 10, 2 );
225
-
226
-
227
- // Gravity forms
228
- if (defined('GF_MIN_WP_VERSION')) {
229
- add_filter('gform_get_form_filter', 'apbct_form__gravityForms__addField', 10, 2);
230
- add_filter('gform_entry_is_spam', 'apbct_form__gravityForms__testSpam', 999, 3);
231
- add_filter('gform_confirmation', 'apbct_form__gravityForms__showResponse', 999, 4 );
232
- }
233
-
234
- //Pirate forms
235
- if(defined('PIRATE_FORMS_VERSION')){
236
- if(isset($_POST['pirate-forms-contact-name']) && $_POST['pirate-forms-contact-name'] && isset($_POST['pirate-forms-contact-email']) && $_POST['pirate-forms-contact-email'])
237
- apbct_form__piratesForm__testSpam();
238
- }
239
-
240
- // WPForms
241
- // Adding fields
242
- add_action('wpforms_frontend_output', 'apbct_form__WPForms__addField', 1000, 5);
243
- // Gathering data to validate
244
- add_filter('wpforms_process_before_filter', 'apbct_from__WPForms__gatherData', 100, 2);
245
- // Do spam check
246
- add_filter('wpforms_process_initial_errors', 'apbct_form__WPForms__showResponse', 100, 2);
247
-
248
- // QForms integration
249
- add_filter( 'quform_post_validate', 'ct_quform_post_validate', 10, 2 );
250
-
251
- // Ultimate Members
252
- if (class_exists('UM')) {
253
- add_action('um_main_register_fields','ct_register_form',100); // Add hidden fileds
254
- add_action( 'um_submit_form_register', 'apbct_registration__UltimateMembers__check', 9, 1 ); // Check submition
255
- }
256
-
257
- // Paid Memberships Pro integration
258
- add_filter( 'pmpro_required_user_fields', function( $pmpro_required_user_fields ){
259
-
260
- if(
261
- ! empty( $pmpro_required_user_fields['username'] ) &&
262
- ! empty( $pmpro_required_user_fields['bemail'] ) &&
263
- ! empty( $pmpro_required_user_fields['bconfirmemail'] ) &&
264
- $pmpro_required_user_fields['bemail'] == $pmpro_required_user_fields['bconfirmemail']
265
- ) {
266
- $check = ct_test_registration( $pmpro_required_user_fields['username'], $pmpro_required_user_fields['bemail'], apbct_http_remote_addr() );
267
- if( $check['allow'] == 0 ) {
268
- pmpro_setMessage( $check['comment'], 'pmpro_error' );
269
- }
270
- }
271
-
272
- return $pmpro_required_user_fields;
273
-
274
- } );
275
-
276
- //
277
- // Load JS code to website footer
278
- //
279
- if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
280
- add_action('wp_head', 'apbct_hook__wp_head__set_cookie__ct_checkjs', 1);
281
- add_action('wp_footer', 'apbct_hook__wp_footer', 1);
282
- }
283
-
284
- if ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) {
285
- ct_contact_form_validate();
286
- }
287
-
288
- if (apbct_is_user_enable()) {
289
-
290
- if ($apbct->settings['general_contact_forms_test'] == 1 && !isset($_POST['comment_post_ID']) && !isset($_GET['for'])){
291
- add_action( 'init', 'ct_contact_form_validate', 999 );
292
- }
293
- if( apbct_is_post() &&
294
- $apbct->settings['general_postdata_test'] == 1 &&
295
- !isset($_POST['ct_checkjs_cf7']) &&
296
- !is_admin() &&
297
- !apbct_is_user_role_in(array('administrator', 'moderator'))
298
- ){
299
- ct_contact_form_validate_postdata();
300
- }
301
- }
302
- }
303
-
304
- function apbct_buffer__start(){
305
- ob_start();
306
- }
307
-
308
- function apbct_buffer__end(){
309
-
310
- if(!ob_get_level())
311
- return;
312
-
313
- global $apbct;
314
- $apbct->buffer = ob_get_contents();
315
- ob_end_clean();
316
- }
317
-
318
- /**
319
- * Outputs changed buffer
320
- *
321
- * @global $apbct
322
- */
323
- function apbct_buffer__output(){
324
-
325
- global $apbct;
326
-
327
- if(empty($apbct->buffer))
328
- return;
329
-
330
- $site_url = get_option('siteurl');
331
- $site__host = parse_url($site_url, PHP_URL_HOST);
332
-
333
- $dom = new DOMDocument();
334
- @$dom->loadHTML($apbct->buffer);
335
-
336
- $forms = $dom->getElementsByTagName('form');
337
-
338
- foreach($forms as $form){
339
-
340
- $action = $form->getAttribute('action');
341
- $action = $action ? $action : $site_url;
342
- $action__host = parse_url($action, PHP_URL_HOST);
343
-
344
- // Check if the form directed to the third party site
345
- if($site__host != $action__host){
346
-
347
- $method = $form->getAttribute('method');
348
- $method = $method ? $method : 'get';
349
- // Directs form to our site
350
- $form->setAttribute('method', 'POST');
351
- $form->setAttribute('action', $site_url);
352
-
353
- // Add cleantalk_hidden_action
354
- $new_input = $dom->createElement('input');
355
- $new_input->setAttribute('type', 'hidden');
356
- $new_input->setAttribute('name', 'cleantalk_hidden_action');
357
- $new_input->setAttribute('value', $action);
358
- $form->appendChild($new_input);
359
-
360
- // Add cleantalk_hidden_method
361
- $new_input = $dom->createElement('input');
362
- $new_input->setAttribute('type', 'hidden');
363
- $new_input->setAttribute('name', 'cleantalk_hidden_method');
364
- $new_input->setAttribute('value', $method);
365
- $form->appendChild($new_input);
366
-
367
- }
368
- } unset($form);
369
-
370
- $html = $dom->getElementsByTagName('html');
371
-
372
- echo gettype($html) == 'object' && !isset( $html[0], $html[0]->childNodes, $html[0]->childNodes[0] )
373
- ? $html[0]
374
- ->childNodes[0]
375
- ->ownerDocument
376
- ->saveHTML()
377
- : $apbct->buffer;
378
- }
379
-
380
- // MailChimp Premium for Wordpress
381
- function ct_add_mc4wp_error_message($messages){
382
-
383
- $messages['ct_mc4wp_response'] = array(
384
- 'type' => 'error',
385
- 'text' => 'Your message looks like spam.'
386
- );
387
- return $messages;
388
- }
389
- add_filter( 'mc4wp_form_messages', 'ct_add_mc4wp_error_message' );
390
-
391
- /*
392
- * Function to set validate fucntion for CCF form
393
- * Input - Сonsistently each form field
394
- * Returns - String. Validate function
395
- */
396
- function ct_ccf($callback, $value, $field_id, $type){
397
- /*
398
- if($type == 'name')
399
- $ct_global_temporary_data['name'] = $value;
400
- elseif($type == 'email')
401
- $ct_global_temporary_data['email'] = $value;
402
- else
403
- $ct_global_temporary_data[] = $value;
404
- //*/
405
- return 'ct_validate_ccf_submission';
406
- }
407
- /*
408
- * Validate function for CCF form. Gatheering data. Multiple calls.
409
- * Input - void. Global $ct_global_temporary_data
410
- * Returns - String. CleanTalk comment.
411
- */
412
- $ct_global_temporary_data = array();
413
- function ct_validate_ccf_submission($value, $field_id, $required){
414
- global $ct_global_temporary_data, $apbct;
415
-
416
-
417
-
418
- //If the check for contact forms enabled
419
- if(!$apbct->settings['contact_forms_test'])
420
- return true;
421
- //If the check for logged in users enabled
422
- if($apbct->settings['protect_logged_in'] == 1 && is_user_logged_in())
423
- return true;
424
-
425
- //Accumulate data
426
- $ct_global_temporary_data[] = $value;
427
-
428
- //If it's the last field of the form
429
- (!isset($ct_global_temporary_data['count']) ? $ct_global_temporary_data['count'] = 1 : $ct_global_temporary_data['count']++);
430
- $form_id = $_POST['form_id'];
431
- if($ct_global_temporary_data['count'] != count(get_post_meta( $form_id, 'ccf_attached_fields', true )))
432
- return true;
433
- unset($ct_global_temporary_data['count']);
434
-
435
- //Getting request params
436
- $ct_temp_msg_data = ct_get_fields_any($_POST);
437
-
438
- unset($ct_global_temporary_data);
439
-
440
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
441
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
442
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
443
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
444
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
445
-
446
- if ($subject != '')
447
- $message['subject'] = $subject;
448
-
449
- $post_info['comment_type'] = 'feedback_custom_contact_forms';
450
- $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
451
-
452
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
453
- ? apbct_js_test('ct_checkjs', $_COOKIE)
454
- : apbct_js_test('ct_checkjs', $_POST);
455
-
456
- //Making a call
457
- $base_call_result = apbct_base_call(
458
- array(
459
- 'message' => $message,
460
- 'sender_email' => $sender_email,
461
- 'sender_nickname' => $sender_nickname,
462
- 'post_info' => $post_info,
463
- 'js_on' => $checkjs,
464
- 'sender_info' => array('sender_url' => null),
465
- )
466
- );
467
-
468
- $ct_result = $base_call_result['ct_result'];
469
-
470
- return $ct_result->allow == 0 ? $ct_result->comment : true;;
471
- }
472
-
473
- function ct_woocommerce_wishlist_check($args){
474
- global $apbct;
475
-
476
-
477
-
478
- //Protect logged in users
479
- if($args['wishlist_status'])
480
- if($apbct->settings['protect_logged_in'] == 0)
481
- return $args;
482
-
483
- //If the IP is a Google bot
484
- $hostname = gethostbyaddr( apbct_get_server_variable( 'REMOTE_ADDR' ) );
485
- if(!strpos($hostname, 'googlebot.com'))
486
- return $args;
487
-
488
- //Getting request params
489
- $message = '';
490
- $subject = '';
491
- $email = $args['wishlist_owner_email'];
492
- if($args['wishlist_first_name']!='' || $args['wishlist_last_name']!='')
493
- $nickname = trim($args['wishlist_first_name']." ".$args['wishlist_last_name']);
494
- else
495
- $nickname = '';
496
-
497
- $post_info['comment_type'] = 'feedback';
498
- $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
499
-
500
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
501
- ? apbct_js_test('ct_checkjs', $_COOKIE)
502
- : apbct_js_test('ct_checkjs', $_POST);
503
-
504
- //Making a call
505
- $base_call_result = apbct_base_call(
506
- array(
507
- 'message' => $subject." ".$message,
508
- 'sender_email' => $email,
509
- 'sender_nickname' => $nickname,
510
- 'post_info' => $post_info,
511
- 'js_on' => $checkjs,
512
- 'sender_info' => array('sender_url' => null),
513
- )
514
- );
515
-
516
- $ct_result = $base_call_result['ct_result'];
517
-
518
- if ($ct_result->allow == 0)
519
- wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
520
- else
521
- return $args;
522
- }
523
-
524
- function apbct_integration__buddyPres__getTemplateName( $located, $template_name, $template_names, $template_locations, $load, $require_once ) {
525
- global $apbct;
526
- preg_match("/\/([a-z-_]+)\/buddypress-functions\.php$/", $located, $matches);
527
- $apbct->buddy_press_tmpl = isset($matches[1]) ? $matches[1] : 'unknown';
528
- }
529
-
530
- /**
531
- * Test BuddyPress activity for spam (post update only)
532
- *
533
- * @global SpbcState $apbct
534
- * @param bool $is_spam
535
- * @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
536
- * @return boolean Spam flag
537
- */
538
- function apbct_integration__buddyPres__activityWall( $is_spam, $activity_obj = null ){
539
-
540
- global $apbct;
541
-
542
- if($activity_obj === null || !isset($_POST['action']) || $_POST['action'] && $_POST['action'] !== 'post_update')
543
- return;
544
-
545
- $curr_user = get_user_by('id', $activity_obj->user_id);
546
-
547
- //Making a call
548
- $base_call_result = apbct_base_call(
549
- array(
550
- 'message' => is_string($activity_obj->content) ? $activity_obj->content : '',
551
- 'sender_email' => $curr_user->data->user_email,
552
- 'sender_nickname' => $curr_user->data->user_login,
553
- 'post_info' => array(
554
- 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
555
- 'comment_type' => 'buddypress_activitywall',
556
- ),
557
- 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
558
- 'sender_info' => array('sender_url' => null),
559
- )
560
- );
561
-
562
- $ct_result = $base_call_result['ct_result'];
563
-
564
- if ($ct_result->allow == 0){
565
- add_action('bp_activity_after_save', 'apbct_integration__buddyPres__activityWall_showResponse', 1, 1);
566
- $apbct->spam_notification = $ct_result->comment;
567
- return true;
568
- }else
569
- return $is_spam;
570
- }
571
-
572
- /**
573
- * Outputs message to AJAX frontend handler
574
- *
575
- * @global SpbcState $apbct
576
- * @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
577
- */
578
- function apbct_integration__buddyPres__activityWall_showResponse( $activity_obj ){
579
-
580
- global $apbct;
581
-
582
- // Legacy template
583
- if($apbct->buddy_press_tmpl === 'bp-legacy'){
584
- die('<div id="message" class="error bp-ajax-message"><p>'. $apbct->spam_notification .'</p></div>');
585
- // Nouveau tamplate and others
586
- }else{
587
- @header( 'Content-Type: application/json; charset=' . get_option('blog_charset'));
588
- die(json_encode(array(
589
- 'success' => false,
590
- 'data' => array('message' => $apbct->spam_notification),
591
- )));
592
- }
593
- }
594
-
595
- /**
596
- * Public function - Tests new private messages (dialogs)
597
- *
598
- * @global SpbcState $apbct
599
- * @param type $bp_message_obj
600
- * @return array with errors if spam has found
601
- */
602
- function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
603
-
604
- global $apbct;
605
-
606
- //Check for enabled option
607
- if($apbct->settings['bp_private_messages'] == 0)
608
- return;
609
-
610
- //Check for quantity of comments
611
- $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER')
612
- ? CLEANTALK_CHECK_COMMENTS_NUMBER
613
- : 3;
614
-
615
- if($apbct->settings['check_comments_number']){
616
- $args = array(
617
- 'user_id' => $bp_message_obj->sender_id,
618
- 'box' => 'sentbox',
619
- 'type' => 'all',
620
- 'limit' => $comments_check_number,
621
- 'page' => null,
622
- 'search_terms' => '',
623
- 'meta_query' => array()
624
- );
625
- $sentbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
626
- $cnt_sentbox_msgs = $sentbox_msgs['total'];
627
- $args['box'] = 'inbox';
628
- $inbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
629
- $cnt_inbox_msgs = $inbox_msgs['total'];
630
-
631
- if(($cnt_inbox_msgs + $cnt_sentbox_msgs) >= $comments_check_number)
632
- $is_max_comments = true;
633
- }
634
-
635
- if(!empty($is_max_comments))
636
- return;
637
-
638
- $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
639
-
640
- //Making a call
641
- $base_call_result = apbct_base_call(
642
- array(
643
- 'message' => $bp_message_obj->subject." ".$bp_message_obj->message,
644
- 'sender_email' => $sender_user_obj->data->user_email,
645
- 'sender_nickname' => $sender_user_obj->data->user_login,
646
- 'post_info' => array(
647
- 'comment_type' => 'buddypress_comment',
648
- 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
649
- ),
650
- 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE)
651
- ? apbct_js_test('ct_checkjs', $_COOKIE)
652
- : apbct_js_test('ct_checkjs', $_POST),
653
- 'sender_info' => array('sender_url' => null),
654
- )
655
- );
656
-
657
- $ct_result = $base_call_result['ct_result'];
658
-
659
- if ($ct_result->allow == 0)
660
- wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
661
- }
662
-
663
- /**
664
- * Adds hiden filed to deafualt serach form
665
- *
666
- * @param $form string
667
- * @return string
668
- */
669
- function apbct_forms__search__addField( $form ){
670
- global $apbct;
671
- if($apbct->settings['search_test'] == 1){
672
- $js_filed = ct_add_hidden_fields('ct_checkjs_search_default', true, false, false, false);
673
- $form = str_replace('</form>', $js_filed, $form);
674
- }
675
- return $form;
676
- }
677
-
678
- /**
679
- * Test default search string for spam
680
- *
681
- * @param $search string
682
- * @return string
683
- */
684
- function apbct_forms__search__testSpam( $search ){
685
-
686
- global $apbct, $cleantalk_executed;
687
-
688
- if(
689
- empty($search) ||
690
- $cleantalk_executed ||
691
- $apbct->settings['search_test'] == 0 ||
692
- $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
693
- ){
694
- return $search;
695
- }
696
-
697
- if(apbct_is_user_logged_in())
698
- $user = wp_get_current_user();
699
-
700
- $base_call_result = apbct_base_call(
701
- array(
702
- 'message' => $search,
703
- 'sender_email' => !empty($user) ? $user->user_email : null,
704
- 'sender_nickname' => !empty($user) ? $user->user_login : null,
705
- 'post_info' => array('comment_type' => 'site_search_wordpress'),
706
- //'js_on' => apbct_js_test('ct_checkjs_search_default', $_GET, true),
707
- )
708
- );
709
- $ct_result = $base_call_result['ct_result'];
710
-
711
- $cleantalk_executed = true;
712
-
713
- if ($ct_result->allow == 0){
714
- die($ct_result->comment);
715
- }
716
-
717
- return $search;
718
- }
719
-
720
- /**
721
- * Public function - Tests for Pirate contact froms
722
- * return NULL
723
- */
724
- function apbct_form__piratesForm__testSpam(){
725
-
726
- global $apbct;
727
-
728
- //Check for enabled option
729
- if( !$apbct->settings['contact_forms_test'])
730
- return;
731
-
732
- //Getting request params
733
- $ct_temp_msg_data = ct_get_fields_any($_POST);
734
-
735
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
736
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
737
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
738
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
739
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
740
-
741
- if($subject != '')
742
- $message = array_merge(array('subject' => $subject), $message);
743
-
744
- $post_info['comment_type'] = 'contact_form_wordpress_feedback_pirate';
745
- $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
746
-
747
- //Making a call
748
- $base_call_result = apbct_base_call(
749
- array(
750
- 'message' => $message,
751
- 'sender_email' => $sender_email,
752
- 'sender_nickname' => $sender_nickname,
753
- 'post_info' => $post_info,
754
- 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
755
- 'sender_info' => array('sender_url' => null),
756
- )
757
- );
758
-
759
- $ct_result = $base_call_result['ct_result'];
760
-
761
- if ($ct_result->allow == 0)
762
- wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
763
- }
764
-
765
- /**
766
- * Adds hidden filed to comment form
767
- */
768
- function ct_comment_form($post_id){
769
-
770
- global $apbct;
771
-
772
- if (apbct_is_user_enable() === false) {
773
- return false;
774
- }
775
-
776
- if ( !$apbct->settings['comments_test']) {
777
- return false;
778
- }
779
-
780
- ct_add_hidden_fields('ct_checkjs', false, false);
781
-
782
- return null;
783
- }
784
-
785
- /**
786
- * Adds cookie script filed to head
787
- */
788
- function apbct_hook__wp_head__set_cookie__ct_checkjs() {
789
-
790
- ct_add_hidden_fields('ct_checkjs', false, true, true);
791
-
792
- return null;
793
- }
794
-
795
- /**
796
- * Adds cookie script filed to footer
797
- */
798
- function apbct_hook__wp_footer() {
799
-
800
- //ct_add_hidden_fields(true, 'ct_checkjs', false, true, true);
801
-
802
- return null;
803
- }
804
-
805
- /**
806
- * Adds hidden filed to define avaialbility of client's JavaScript
807
- * @param bool $random_key switch on generation random key for every page load
808
- */
809
- function ct_add_hidden_fields($field_name = 'ct_checkjs', $return_string = false, $cookie_check = false, $no_print = false, $ajax = true) {
810
-
811
- global $ct_checkjs_def, $apbct;
812
-
813
- $ct_checkjs_key = ct_get_checkjs_value();
814
- $field_id_hash = md5(rand(0, 1000));
815
-
816
- // Using only cookies
817
- if ($cookie_check && $apbct->settings['set_cookies'] == 1) {
818
-
819
- $html = "<script type='text/javascript'>
820
- function ctSetCookie(c_name, value, def_value){
821
- document.cookie = c_name + '=' + escape(value) + '; path=/';
822
- }
823
- ctSetCookie('{$field_name}', '{$ct_checkjs_key}', '{$ct_checkjs_def}');
824
- </script>";
825
-
826
- // Using AJAX to get key
827
- }elseif($apbct->settings['use_ajax'] && $ajax){
828
-
829
- // Fix only for wp_footer -> apbct_hook__wp_head__set_cookie__ct_checkjs()
830
- if($no_print)
831
- return;
832
-
833
- $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
834
- $field_id = $field_name . '_' . $field_id_hash;
835
- $html = "<input type='hidden' id='{$field_id}' name='{$field_name}' value='{$ct_checkjs_def}' />
836
- <script type='text/javascript'>
837
- setTimeout(function(){
838
- apbct_sendAJAXRequest(
839
- {action: 'apbct_js_keys__get'},
840
- {callback: apbct_js_keys__set_input_value, input_name: '{$field_id}'}
841
- );
842
- }, 1000);
843
- </script>";
844
-
845
- // Set KEY from backend
846
- }else{
847
- // Fix only for wp_footer -> apbct_hook__wp_head__set_cookie__ct_checkjs()
848
- if($no_print)
849
- return;
850
-
851
- $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
852
- $field_id = $field_name . '_' . $field_id_hash;
853
- $html = "<input type='hidden' id='{$field_id}' name='{$field_name}' value='{$ct_checkjs_def}' />
854
- <script type='text/javascript'>
855
- setTimeout(function(){
856
- var ct_input_name = '{$field_id}';
857
- if (document.getElementById(ct_input_name) !== null) {
858
- var ct_input_value = document.getElementById(ct_input_name).value;
859
- document.getElementById(ct_input_name).value = document.getElementById(ct_input_name).value.replace(ct_input_value, {$ct_input_challenge});
860
- }
861
- }, 1000);
862
- </script>";
863
- }
864
-
865
- // Simplify JS code and Fixing issue with wpautop()
866
- $html = str_replace(array("\n","\r","\t"),'', $html);
867
-
868
- if ($return_string === true) {
869
- return $html;
870
- } else {
871
- echo $html;
872
- }
873
- }
874
-
875
- /**
876
- * Public function - Insert JS code for spam tests
877
- * return null;
878
- */
879
- function apbct_rorm__formidable__footerScripts($fields, $form) {
880
-
881
- global $apbct, $ct_checkjs_frm;
882
-
883
- if ( !$apbct->settings['contact_forms_test'])
884
- return false;
885
-
886
- $ct_checkjs_key = ct_get_checkjs_value();
887
- $ct_frm_base_name = 'form_';
888
- $ct_frm_name = $ct_frm_base_name . $form->form_key;
889
-
890
- echo "var input = document.createElement('input');
891
- input.setAttribute('type', 'hidden');
892
- input.setAttribute('name', '$ct_checkjs_frm');
893
- input.setAttribute('value', '$ct_checkjs_key');
894
- for (i = 0; i < document.forms.length; i++) {
895
- if (typeof document.forms[i].id == 'string'){
896
- if(document.forms[i].id.search('$ct_frm_name') != -1) {
897
- document.forms[i].appendChild(input);
898
- }
899
- }
900
- }";
901
-
902
- /* Excessive cookie set
903
- $js_code = ct_add_hidden_fields(true, 'ct_checkjs', true, true);
904
- $js_code = strip_tags($js_code); // Removing <script> tag
905
- echo $js_code;
906
- //*/
907
- }
908
-
909
- /**
910
- * Public function - Test Formidable data for spam activity
911
- * @param $errors
912
- * @param $form
913
- *
914
- * @return array with errors if spam has found
915
- */
916
- function apbct_rorm__formidable__testSpam ( $errors, $form ) {
917
-
918
- global $apbct;
919
-
920
- if ( !$apbct->settings['contact_forms_test']) {
921
- return $errors;
922
- }
923
-
924
- // Skip processing for logged in users.
925
- if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in()) {
926
- return $errors;
927
- }
928
-
929
- $ct_temp_msg_data = ct_get_fields_any($_POST['item_meta']);
930
-
931
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
932
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
933
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
934
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
935
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
936
-
937
- // Adding 'input_meta[]' to every field /Formidable fix/
938
- $message = array_flip($message);
939
- foreach($message as &$value){
940
- $value = 'item_meta['.$value.']';
941
- } unset($value);
942
- $message = array_flip($message);
943
-
944
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
945
- ? apbct_js_test('ct_checkjs', $_COOKIE)
946
- : apbct_js_test('ct_checkjs', $_POST);
947
-
948
- $base_call_result = apbct_base_call(
949
- array(
950
- 'message' => $message,
951
- 'sender_email' => $sender_email,
952
- 'sender_nickname' => $sender_nickname,
953
- 'post_info' => array('comment_type' => 'contact_form_wordpress_formidable'),
954
- 'js_on' => $checkjs
955
- )
956
- );
957
- $ct_result = $base_call_result['ct_result'];
958
-
959
- if ($ct_result->allow == 0) {
960
- $errors['ct_error'] = '<br /><b>' . $ct_result->comment . '</b><br /><br />';
961
- }
962
-
963
- return $errors;
964
- }
965
-
966
- /**
967
- * Public filter 'bbp_*' - Get new topic name to global $ct_bbp_topic
968
- * @param mixed[] $comment Comment string
969
- * @return mixed[] $comment Comment string
970
- */
971
- function ct_bbp_get_topic($topic){
972
- global $ct_bbp_topic;
973
-
974
- $ct_bbp_topic=$topic;
975
-
976
- return $topic;
977
- }
978
-
979
- /**
980
- * Public filter 'bbp_*' - Checks topics, replies by cleantalk
981
- * @param mixed[] $comment Comment string
982
- * @return mixed[] $comment Comment string
983
- */
984
- function ct_bbp_new_pre_content ($comment) {
985
-
986
- global $apbct, $current_user;
987
-
988
- if ( !$apbct->settings['comments_test']) {
989
- return $comment;
990
- }
991
-
992
- // Skip processing for logged in users and admin.
993
- if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in() ||
994
- in_array("administrator", $current_user->roles))
995
- return $comment;
996
-
997
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
998
- ? apbct_js_test('ct_checkjs', $_COOKIE)
999
- : apbct_js_test('ct_checkjs', $_POST);
1000
-
1001
- $post_info['comment_type'] = 'bbpress_comment';
1002
- $post_info['post_url'] = bbp_get_topic_permalink();
1003
-
1004
- if( is_user_logged_in() ) {
1005
- $sender_email = $current_user->user_email;
1006
- $sender_nickname = $current_user->display_name;
1007
- } else {
1008
- $sender_email = isset($_POST['bbp_anonymous_email']) ? $_POST['bbp_anonymous_email'] : null;
1009
- $sender_nickname = isset($_POST['bbp_anonymous_name']) ? $_POST['bbp_anonymous_name'] : null;
1010
- }
1011
-
1012
- $base_call_result = apbct_base_call(
1013
- array(
1014
- 'message' => $comment,
1015
- 'sender_email' => $sender_email,
1016
- 'sender_nickname' => $sender_nickname,
1017
- 'post_info' => $post_info,
1018
- 'js_on' => $checkjs,
1019
- 'sender_info' => array('sender_url' => isset($_POST['bbp_anonymous_website']) ? $_POST['bbp_anonymous_website'] : null),
1020
- )
1021
- );
1022
- $ct_result = $base_call_result['ct_result'];
1023
-
1024
- if ($ct_result->allow == 0) {
1025
- bbp_add_error('bbp_reply_content', $ct_result->comment);
1026
- }
1027
-
1028
- return $comment;
1029
- }
1030
-
1031
- function apbct_comment__sanitize_data__before_wp_die($function){
1032
-
1033
- global $apbct;
1034
-
1035
- $comment_data = wp_unslash($_POST);
1036
-
1037
- $user_ID = 0;
1038
-
1039
- $comment_type = '';
1040
-
1041
- $comment_content = isset($comment_data['comment']) ? (string) $comment_data['comment'] : null;
1042
- $comment_parent = isset($comment_data['comment_parent']) ? (int) absint($comment_data['comment_parent']) : null;
1043
-
1044
- $comment_author = isset($comment_data['author']) ? (string) trim(strip_tags($comment_data['author'])) : null;
1045
- $comment_author_email = isset($comment_data['email']) ? (string) trim($comment_data['email']) : null;
1046
- $comment_author_url = isset($comment_data['url']) ? (string) trim($comment_data['url']) : null;
1047
- $comment_post_ID = isset($comment_data['comment_post_ID']) ? (int) $comment_data['comment_post_ID'] : null;
1048
-
1049
- if(isset($comment_content, $comment_parent)){
1050
-
1051
- $user = wp_get_current_user();
1052
-
1053
- if($user->exists()){
1054
- $comment_author = empty($user->display_name) ? $user->user_login : $user->display_name;
1055
- $comment_author_email = $user->user_email;
1056
- $comment_author_url = $user->user_url;
1057
- $user_ID = $user->ID;
1058
- }
1059
-
1060
- $apbct->comment_data = compact(
1061
- 'comment_post_ID',
1062
- 'comment_author',
1063
- 'comment_author_email',
1064
- 'comment_author_url',
1065
- 'comment_content',
1066
- 'comment_type',
1067
- 'comment_parent',
1068
- 'user_ID'
1069
- );
1070
-
1071
- $function = 'apbct_comment__check_via_wp_die';
1072
-
1073
- }
1074
-
1075
- return $function;
1076
- }
1077
-
1078
- function apbct_comment__check_via_wp_die($message, $title, $args){
1079
- if($title == __('Comment Submission Failure')){
1080
- global $apbct;
1081
- $apbct->validation_error = $message;
1082
- ct_preprocess_comment($apbct->comment_data);
1083
- }
1084
- _default_wp_die_handler($message, $title, $args);
1085
- }
1086
-
1087
- /**
1088
- * Public filter 'preprocess_comment' - Checks comment by cleantalk server
1089
- * @param mixed[] $comment Comment data array
1090
- * @return mixed[] New data array of comment
1091
- */
1092
- function ct_preprocess_comment($comment) {
1093
- // this action is called just when WP process POST request (adds new comment)
1094
- // this action is called by wp-comments-post.php
1095
- // after processing WP makes redirect to post page with comment's form by GET request (see above)
1096
- global $current_user, $comment_post_id, $ct_comment_done, $ct_jp_comments, $apbct;
1097
-
1098
- // Send email notification for chosen groups of users
1099
- if($apbct->settings['comment_notify'] && !empty($apbct->settings['comment_notify__roles']) && $apbct->data['moderate']){
1100
-
1101
- add_filter('notify_post_author', 'apbct_comment__Wordpress__doNotify', 100, 2);
1102
-
1103
- $users = get_users(array(
1104
- 'role__in' => $apbct->settings['comment_notify__roles'],
1105
- 'fileds' => array('user_email')
1106
- ));
1107
-
1108
- if($users){
1109
- add_filter('comment_notification_text', 'apbct_comment__Wordpress__changeMailNotificationGroups', 100, 2);
1110
- add_filter('comment_notification_recipients', 'apbct_comment__Wordpress__changeMailNotificationRecipients', 100, 2);
1111
- foreach($users as $user){
1112
- $emails[] = $user->user_email;
1113
- }
1114
- $apbct->comment_notification_recipients = json_encode($emails);
1115
- }
1116
- }
1117
-
1118
- // Skip processing admin.
1119
- if (in_array("administrator", $current_user->roles))
1120
- return $comment;
1121
-
1122
- $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3;
1123
-
1124
- if($apbct->settings['check_comments_number']){
1125
- $args = array(
1126
- 'author_email' => $comment['comment_author_email'],
1127
- 'status' => 'approve',
1128
- 'count' => false,
1129
- 'number' => $comments_check_number,
1130
- );
1131
- $cnt = count(get_comments($args));
1132
- $is_max_comments = $cnt >= $comments_check_number ? true : false;
1133
- }
1134
-
1135
- if (
1136
- ($comment['comment_type']!='trackback') &&
1137
- (
1138
- apbct_is_user_enable() === false ||
1139
- $apbct->settings['comments_test'] == 0 ||
1140
- $ct_comment_done ||
1141
- (isset($_SERVER['HTTP_REFERER']) && stripos($_SERVER['HTTP_REFERER'],'page=wysija_campaigns&action=editTemplate')!==false) ||
1142
- (isset($is_max_comments) && $is_max_comments) ||
1143
- (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false)
1144
- )
1145
- )
1146
- {
1147
- return $comment;
1148
- }
1149
-
1150
- $local_blacklists = wp_blacklist_check(
1151
- $comment['comment_author'],
1152
- $comment['comment_author_email'],
1153
- $comment['comment_author_url'],
1154
- $comment['comment_content'],
1155
- apbct_get_server_variable( 'REMOTE_ADDR' ),
1156
- apbct_get_server_variable( 'HTTP_USER_AGENT' )
1157
- );
1158
-
1159
- // Go out if author in local blacklists
1160
- if ($comment['comment_type']!='trackback' && $local_blacklists === true) {
1161
- return $comment;
1162
- }
1163
-
1164
- // Skip pingback anti-spam test
1165
- /*if ($comment['comment_type'] == 'pingback') {
1166
- return $comment;
1167
- }*/
1168
-
1169
- $ct_comment_done = true;
1170
-
1171
- $comment_post_id = $comment['comment_post_ID'];
1172
-
1173
- // JetPack comments logic
1174
- $post_info['comment_type'] = $ct_jp_comments ? 'jetpack_comment' : $comment['comment_type'];
1175
- $post_info['post_url'] = ct_post_url(null, $comment_post_id);
1176
-
1177
- // Comment type
1178
- $post_info['comment_type'] = empty($post_info['comment_type']) ? 'general_comment' : $post_info['comment_type'];
1179
-
1180
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
1181
- ? apbct_js_test('ct_checkjs', $_COOKIE)
1182
- : apbct_js_test('ct_checkjs', $_POST);
1183
-
1184
-
1185
- $example = null;
1186
- if ($apbct->data['relevance_test']) {
1187
- $post = get_post($comment_post_id);
1188
- if ($post !== null){
1189
- $example['title'] = $post->post_title;
1190
- $example['body'] = $post->post_content;
1191
- $example['comments'] = null;
1192
-
1193
- $last_comments = get_comments(array('status' => 'approve', 'number' => 10, 'post_id' => $comment_post_id));
1194
- foreach ($last_comments as $post_comment){
1195
- $example['comments'] .= "\n\n" . $post_comment->comment_content;
1196
- }
1197
-
1198
- $example = json_encode($example);
1199
- }
1200
-
1201
- // Use plain string format if've failed with JSON
1202
- if ($example === false || $example === null){
1203
- $example = ($post->post_title !== null) ? $post->post_title : '';
1204
- $example .= ($post->post_content !== null) ? "\n\n" . $post->post_content : '';
1205
- }
1206
- }
1207
-
1208
- $base_call_result = apbct_base_call(
1209
- array(
1210
- 'message' => $comment['comment_content'],
1211
- 'example' => $example,
1212
- 'sender_email' => $comment['comment_author_email'],
1213
- 'sender_nickname' => $comment['comment_author'],
1214
- 'post_info' => $post_info,
1215
- 'js_on' => $checkjs,
1216
- 'sender_info' => array(
1217
- 'sender_url' => @$comment['comment_author_url'],
1218
- 'form_validation' => !isset($apbct->validation_error)
1219
- ? null
1220
- : json_encode(array(
1221
- 'validation_notice' => $apbct->validation_error,
1222
- 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1223
- ))
1224
- ),
1225
- )
1226
- );
1227
- $ct_result = $base_call_result['ct_result'];
1228
-
1229
- ct_hash($ct_result->id);
1230
-
1231
- //Don't check trusted users
1232
- if (isset($comment['comment_author_email'])){
1233
- $approved_comments = get_comments(array('status' => 'approve', 'count' => true, 'author_email' => $comment['comment_author_email']));
1234
- $new_user = $approved_comments == 0 ? true : false;
1235
- }
1236
-
1237
- // Change comment flow only for new authors
1238
- if (!empty($new_user) || $ct_result->stop_words !== null || $ct_result->spam == 1)
1239
- add_action('comment_post', 'ct_set_meta', 10, 2);
1240
-
1241
- if($ct_result->allow){ // Pass if allowed
1242
- if(get_option('comment_moderation') === '1') // Wordpress moderation flag
1243
- add_filter('pre_comment_approved', 'ct_set_not_approved', 999, 2);
1244
- else
1245
- add_filter('pre_comment_approved', 'ct_set_approved', 999, 2);
1246
- }else{
1247
-
1248
- global $ct_comment, $ct_stop_words;
1249
-
1250
- $ct_comment = $ct_result->comment;
1251
- $ct_stop_words = $ct_result->stop_words;
1252
-
1253
- $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
1254
- $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1255
-
1256
- // Terminate. Definitely spam.
1257
- if($ct_result->stop_queue == 1)
1258
- wp_die($err_text, 'Blacklisted', array('back_link' => true));
1259
-
1260
- // Terminate by user's setting.
1261
- if($ct_result->spam == 3)
1262
- wp_die($err_text, 'Blacklisted', array('back_link' => true));
1263
-
1264
- // Trash comment.
1265
- if($ct_result->spam == 2){
1266
- add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1267
- add_action('comment_post', 'ct_wp_trash_comment', 997, 2);
1268
- }
1269
-
1270
- // Spam comment
1271
- if($ct_result->spam == 1)
1272
- add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1273
-
1274
- // Move to pending folder. Contains stop_words.
1275
- if($ct_result->stop_words){
1276
- add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
1277
- add_action('comment_post', 'ct_mark_red', 998, 2);
1278
- }
1279
-
1280
- add_action('comment_post', 'ct_die', 999, 2);
1281
- }
1282
-
1283
- if($apbct->settings['remove_comments_links'] == 1){
1284
- $comment['comment_content'] = preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", '[Link deleted]', $comment['comment_content']);
1285
- }
1286
-
1287
- // Change mail notification if license is out of date
1288
- if($apbct->data['moderate'] == 0){
1289
- $apbct->sender_email = $comment['comment_author_email'];
1290
- $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
1291
- add_filter('comment_moderation_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment sent to moderation
1292
- add_filter('comment_notification_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment approved
1293
- }
1294
-
1295
- return $comment;
1296
- }
1297
-
1298
- /**
1299
- * Changes whether notify admin/athor or not.
1300
- *
1301
- * @param bool $maybe_notify notify flag
1302
- * @param int $comment_ID Comment id
1303
- * @return bool flag
1304
- */
1305
- function apbct_comment__Wordpress__doNotify($maybe_notify, $comment_ID){
1306
- return true;
1307
- }
1308
-
1309
- /**
1310
- * Add notification setting link
1311
- *
1312
- * @param string $notify_message
1313
- * @param integer $comment_id
1314
- *
1315
- * @return string
1316
- */
1317
- function apbct_comment__Wordpress__changeMailNotificationGroups($notify_message, $comment_id){
1318
- $website = parse_url(get_option('siteurl'),PHP_URL_HOST);
1319
- return $notify_message
1320
- .PHP_EOL
1321
- .'---'.PHP_EOL
1322
- .'Manage notifications settings: http://'.$website.'/wp-admin/options-general.php?page=cleantalk';
1323
- }
1324
-
1325
- /**
1326
- * Change email notification recipients
1327
- *
1328
- * @param array $emails
1329
- * @param integer $comment_id
1330
- *
1331
- * @return array
1332
- * @global SpbcState $apbct
1333
- */
1334
- function apbct_comment__Wordpress__changeMailNotificationRecipients($emails, $comment_id){
1335
- global $apbct;
1336
- return array_unique(array_merge($emails, (array)json_decode($apbct->comment_notification_recipients, true)));
1337
- }
1338
-
1339
- /**
1340
- * Changes email notification for spam comment for native Wordpress comment system
1341
- *
1342
- * @param string $notify_message Body of email notification
1343
- * @param int $comment_id Comment id
1344
- * @return string Body for email notification
1345
- */
1346
- function apbct_comment__Wordpress__changeMailNotification($notify_message, $comment_id){
1347
-
1348
- global $apbct;
1349
-
1350
- $notify_message =
1351
- PHP_EOL
1352
- .__('CleanTalk AntiSpam: This message is possible spam.', 'cleantalk')
1353
- ."\n".__('You could check it in CleanTalk\'s anti-spam database:', 'cleantalk')
1354
- ."\n".'IP: https://cleantalk.org/blacklists/' . $apbct->sender_ip
1355
- ."\n".'Email: https://cleantalk.org/blacklists/' . $apbct->sender_email
1356
- ."\n".PHP_EOL . sprintf(
1357
- __('Activate protection in your Anti-Spam Dashboard: %s.', 'clentalk'),
1358
- 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_comment_passed'
1359
- .($apbct->data['user_token']
1360
- ? '&iser_token='.$apbct->data['user_token']
1361
- : ''
1362
- )
1363
- )
1364
- .PHP_EOL . '---'
1365
- .PHP_EOL
1366
- .PHP_EOL
1367
- .$notify_message;
1368
-
1369
- return $notify_message;
1370
-
1371
- }
1372
-
1373
- /**
1374
- * Set die page with Cleantalk comment.
1375
- * @global array $ct_comment
1376
- $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1377
- * @param type $comment_status
1378
- */
1379
- function ct_die($comment_id, $comment_status) {
1380
- global $ct_comment;
1381
- $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1382
- $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1383
- if(isset($_POST['et_pb_contact_email']))
1384
- {
1385
- $mes='<div id="et_pb_contact_form_1" class="et_pb_contact_form_container clearfix"><h1 class="et_pb_contact_main_title">Blacklisted</h1><div class="et-pb-contact-message"><p>'.$ct_comment.'</p></div></div>';
1386
- wp_die($mes, 'Blacklisted', array('back_link' => true,'response'=>200));
1387
- }
1388
- else
1389
- {
1390
- wp_die($err_text, 'Blacklisted', array('back_link' => true));
1391
- }
1392
- }
1393
-
1394
- /**
1395
- * Set die page with Cleantalk comment from parameter.
1396
- * @param type $comment_body
1397
- */
1398
- function ct_die_extended($comment_body) {
1399
- $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $comment_body;
1400
- $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1401
- wp_die($err_text, 'Blacklisted', array('back_link' => true));
1402
- }
1403
-
1404
- /**
1405
- * Validates JavaScript anti-spam test
1406
- *
1407
- * @param string $field_name filed to serach in data
1408
- * @param null $data Data to search in
1409
- * @param bool $random_key
1410
- *
1411
- * @return int|null
1412
- */
1413
- function apbct_js_test($field_name = 'ct_checkjs', $data = null) {
1414
-
1415
- global $apbct;
1416
-
1417
- $out = null;
1418
-
1419
- if($data && isset($data[$field_name])){
1420
-
1421
- $js_key = trim($data[$field_name]);
1422
-
1423
- // Check static key
1424
- if(
1425
- $apbct->settings['use_static_js_key'] == 1 ||
1426
- ( $apbct->settings['use_static_js_key'] == - 1 &&
1427
- ( apbct_is_cache_plugins_exists() ||
1428
- ( apbct_is_post() && $apbct->data['cache_detected'] == 1 )
1429
- )
1430
- )
1431
- ){
1432
- $out = ct_get_checkjs_value() === $js_key ? 1 : 0;
1433
-
1434
- // Random key check
1435
- }else{
1436
- $out = array_key_exists( $js_key, $apbct->js_keys ) ? 1 : 0;
1437
- }
1438
- }
1439
-
1440
- return $out;
1441
- }
1442
-
1443
- /**
1444
- * Get post url
1445
- * @param int $comment_id
1446
- * @param int $comment_post_id
1447
- * @return string|bool
1448
- */
1449
- function ct_post_url($comment_id = null, $comment_post_id) {
1450
-
1451
- if (empty($comment_post_id))
1452
- return null;
1453
-
1454
- if ($comment_id === null) {
1455
- $last_comment = get_comments('number=1');
1456
- $comment_id = isset($last_comment[0]->comment_ID) ? (int) $last_comment[0]->comment_ID + 1 : 1;
1457
- }
1458
- $permalink = get_permalink($comment_post_id);
1459
-
1460
- $post_url = null;
1461
- if ($permalink !== null)
1462
- $post_url = $permalink . '#comment-' . $comment_id;
1463
-
1464
- return $post_url;
1465
- }
1466
-
1467
- /**
1468
- * Public filter 'pre_comment_approved' - Mark comment unapproved always
1469
- * @return int Zero
1470
- */
1471
- function ct_set_not_approved() {
1472
- return 0;
1473
- }
1474
-
1475
- /**
1476
- * @author Artem Leontiev
1477
- * Public filter 'pre_comment_approved' - Mark comment approved if it's not 'spam' only
1478
- * @return int 1
1479
- */
1480
- function ct_set_approved($approved, $comment) {
1481
- if ($approved == 'spam'){
1482
- return $approved;
1483
- } else {
1484
- return 1;
1485
- }
1486
- }
1487
-
1488
- /**
1489
- * Public filter 'pre_comment_approved' - Mark comment unapproved always
1490
- * @return int Zero
1491
- */
1492
- function ct_set_comment_spam() {
1493
- return 'spam';
1494
- }
1495
-
1496
- /**
1497
- * Public action 'comment_post' - Store cleantalk hash in comment meta 'ct_hash'
1498
- * @param int $comment_id Comment ID
1499
- * @param mixed $comment_status Approval status ("spam", or 0/1), not used
1500
- */
1501
- function ct_set_meta($comment_id, $comment_status) {
1502
- global $comment_post_id;
1503
- $hash1 = ct_hash();
1504
- if (!empty($hash1)) {
1505
- update_comment_meta($comment_id, 'ct_hash', $hash1);
1506
- if (function_exists('base64_encode') && isset($comment_status) && $comment_status != 'spam') {
1507
- $post_url = ct_post_url($comment_id, $comment_post_id);
1508
- $post_url = base64_encode($post_url);
1509
- if ($post_url === false)
1510
- return false;
1511
- // 01 - URL to approved comment
1512
- $feedback_request = $hash1 . ':' . '01' . ':' . $post_url . ';';
1513
- ct_send_feedback($feedback_request);
1514
- }
1515
- }
1516
- return true;
1517
- }
1518
-
1519
- /**
1520
- * Mark bad words
1521
- * @global string $ct_stop_words
1522
- * @param int $comment_id
1523
- * @param int $comment_status Not use
1524
- */
1525
- function ct_mark_red($comment_id, $comment_status) {
1526
- global $ct_stop_words;
1527
-
1528
- $comment = get_comment($comment_id, 'ARRAY_A');
1529
- $message = $comment['comment_content'];
1530
- foreach (explode(':', $ct_stop_words) as $word) {
1531
- $message = preg_replace("/($word)/ui", '<font rel="cleantalk" color="#FF1000">' . "$1" . '</font>', $message);
1532
-
1533
- }
1534
- $comment['comment_content'] = $message;
1535
- kses_remove_filters();
1536
- wp_update_comment($comment);
1537
- }
1538
-
1539
- //
1540
- //Send post to trash
1541
- //
1542
- function ct_wp_trash_comment($comment_id, $comment_status){
1543
- wp_trash_comment($comment_id);
1544
- }
1545
-
1546
- /**
1547
- * Tests plugin activation status
1548
- * @return bool
1549
- */
1550
- function ct_plugin_active($plugin_name){
1551
- foreach (get_option('active_plugins') as $k => $v) {
1552
- if ($plugin_name == $v)
1553
- return true;
1554
- }
1555
- return false;
1556
- }
1557
-
1558
- /**
1559
- * Insert a hidden field to registration form
1560
- * @return null
1561
- */
1562
- function ct_register_form() {
1563
-
1564
- global $ct_checkjs_register_form, $apbct;
1565
-
1566
- if ($apbct->settings['registrations_test'] == 0) {
1567
- return false;
1568
- }
1569
-
1570
- ct_add_hidden_fields($ct_checkjs_register_form, false, false, false, false);
1571
-
1572
- return null;
1573
- }
1574
-
1575
- function apbct_login__scripts(){
1576
- echo '<script src="'.APBCT_URL_PATH.'/js/apbct-public.min.js"></script>';
1577
- }
1578
-
1579
- /**
1580
- * Adds notification text to login form - to inform about approved registration
1581
- * @return null
1582
- */
1583
- function ct_login_message($message) {
1584
-
1585
- global $errors, $apbct, $apbct_cookie_register_ok_label;
1586
-
1587
-
1588
-
1589
- if ($apbct->settings['registrations_test'] != 0){
1590
- if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ){
1591
- if (isset($_COOKIE[$apbct_cookie_register_ok_label])){
1592
- if(is_wp_error($errors)){
1593
- $errors->add('ct_message',sprintf(__('Registration approved by %s.', 'cleantalk'), '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk</b>'), 'message');
1594
- }
1595
- }
1596
- }
1597
- }
1598
- return $message;
1599
- }
1600
-
1601
- /**
1602
- * Test users registration for pPress
1603
- * @return array with errors
1604
- */
1605
- function ct_registration_errors_ppress($reg_errors, $form_id) {
1606
-
1607
- $email = $_POST['reg_email'];
1608
- $login = $_POST['reg_username'];
1609
-
1610
- $reg_errors = ct_registration_errors($reg_errors, $login, $email);
1611
-
1612
- return $reg_errors;
1613
- }
1614
-
1615
- /**
1616
- * Test users registration for multisite enviroment
1617
- * @return array with errors
1618
- */
1619
- function ct_registration_errors_wpmu($errors) {
1620
- global $ct_signup_done;
1621
-
1622
- //
1623
- // Multisite actions
1624
- //
1625
- $sanitized_user_login = null;
1626
- if (isset($errors['user_name'])) {
1627
- $sanitized_user_login = $errors['user_name'];
1628
- $wpmu = true;
1629
- }
1630
- $user_email = null;
1631
- if (isset($errors['user_email'])) {
1632
- $user_email = $errors['user_email'];
1633
- $wpmu = true;
1634
- }
1635
-
1636
- if ($wpmu && isset($errors['errors']->errors) && count($errors['errors']->errors) > 0) {
1637
- return $errors;
1638
- }
1639
-
1640
- $errors['errors'] = ct_registration_errors($errors['errors'], $sanitized_user_login, $user_email);
1641
-
1642
- // Show CleanTalk errors in user_name field
1643
- if (isset($errors['errors']->errors['ct_error'])) {
1644
- $errors['errors']->errors['user_name'] = $errors['errors']->errors['ct_error'];
1645
- unset($errors['errors']->errors['ct_error']);
1646
- }
1647
-
1648
- return $errors;
1649
- }
1650
-
1651
- /**
1652
- * Shell for action register_post
1653
- * @return array with errors
1654
- */
1655
- function ct_register_post($sanitized_user_login = null, $user_email = null, $errors) {
1656
- return ct_registration_errors($errors, $sanitized_user_login, $user_email);
1657
- }
1658
-
1659
- /**
1660
- * Check messages for external plugins
1661
- * @return array with checking result;
1662
- */
1663
-
1664
- function ct_test_message($nickname, $email, $ip, $text){
1665
-
1666
- $base_call_result = apbct_base_call(
1667
- array(
1668
- 'message' => $text,
1669
- 'sender_email' => $email,
1670
- 'sender_nickname' => $nickname,
1671
- 'post_info' => array('comment_type' => 'feedback_plugin_check'),
1672
- 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
1673
- )
1674
- );
1675
-
1676
- $ct_result = $base_call_result['ct_result'];
1677
-
1678
- $result=Array(
1679
- 'allow' => $ct_result->allow,
1680
- 'comment' => $ct_result->comment,
1681
- );
1682
- return $result;
1683
- }
1684
-
1685
- /**
1686
- * Check registrations for external plugins
1687
- * @return array with checking result;
1688
- */
1689
- function ct_test_registration($nickname, $email, $ip){
1690
-
1691
- global $ct_checkjs_register_form, $apbct;
1692
-
1693
- if(apbct_js_test($ct_checkjs_register_form, $_POST)){
1694
- $checkjs = apbct_js_test($ct_checkjs_register_form, $_POST);
1695
- $sender_info['post_checkjs_passed'] = $checkjs;
1696
- }else{
1697
- $checkjs = $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1698
- $sender_info['cookie_checkjs_passed'] = $checkjs;
1699
- }
1700
-
1701
- //Making a call
1702
- $base_call_result = apbct_base_call(
1703
- array(
1704
- 'sender_ip' => $ip,
1705
- 'sender_email' => $email,
1706
- 'sender_nickname' => $nickname,
1707
- 'sender_info' => $sender_info,
1708
- 'js_on' => $checkjs,
1709
- ),
1710
- true
1711
- );
1712
- $ct_result = $base_call_result['ct_result'];
1713
-
1714
- $result = array(
1715
- 'allow' => $ct_result->allow,
1716
- 'comment' => $ct_result->comment,
1717
- );
1718
- return $result;
1719
- }
1720
-
1721
- /**
1722
- * Test users registration
1723
- *
1724
- * @param $errors
1725
- * @param null $sanitized_user_login
1726
- * @param null $user_email
1727
- *
1728
- * @return void with errors
1729
- */
1730
- function ct_registration_errors($errors, $sanitized_user_login = null, $user_email = null) {
1731
-
1732
- global $ct_checkjs_register_form, $apbct_cookie_request_id_label, $apbct_cookie_register_ok_label, $bp, $ct_signup_done, $ct_negative_comment, $apbct, $ct_registration_error_comment, $cleantalk_executed;
1733
-
1734
- // Go out if a registrered user action
1735
- if (apbct_is_user_enable() === false) {
1736
- return $errors;
1737
- }
1738
-
1739
- if ($apbct->settings['registrations_test'] == 0) {
1740
- return $errors;
1741
- }
1742
-
1743
- // The function already executed
1744
- // It happens when used ct_register_post();
1745
- if ($ct_signup_done && is_object($errors) && count($errors->errors) > 0) {
1746
- return $errors;
1747
- }
1748
-
1749
- // Facebook registration
1750
- if ($sanitized_user_login === null && isset($_POST['FB_userdata'])){
1751
- $sanitized_user_login = $_POST['FB_userdata']['name'];
1752
- $facebook = true;
1753
- }
1754
- if ($user_email === null && isset($_POST['FB_userdata'])){
1755
- $user_email = $_POST['FB_userdata']['email'];
1756
- $facebook = true;
1757
- }
1758
-
1759
- // BuddyPress actions
1760
- $buddypress = false;
1761
- if ($sanitized_user_login === null && isset($_POST['signup_username'])) {
1762
- $sanitized_user_login = $_POST['signup_username'];
1763
- $buddypress = true;
1764
- }
1765
- if ($user_email === null && isset($_POST['signup_email'])) {
1766
- $user_email = $_POST['signup_email'];
1767
- $buddypress = true;
1768
- }
1769
-
1770
- //
1771
- // Break tests because we already have servers response
1772
- //
1773
- if ($buddypress && $ct_signup_done) {
1774
- if ($ct_negative_comment) {
1775
- $bp->signup->errors['signup_username'] = $ct_negative_comment;
1776
- }
1777
- return $errors;
1778
- }
1779
-
1780
-
1781
- if(current_filter() == 'woocommerce_registration_errors'){
1782
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1783
- $checkjs_post = null;
1784
- $checkjs_cookie = $checkjs;
1785
- }else{
1786
- // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1787
- $checkjs_post = apbct_js_test($ct_checkjs_register_form, $_POST);
1788
- $checkjs_cookie = apbct_js_test($ct_checkjs_register_form, $_COOKIE);
1789
- $checkjs = $checkjs_cookie ? $checkjs_cookie : $checkjs_post;
1790
- }
1791
-
1792
- $sender_info = array(
1793
- 'post_checkjs_passed' => $checkjs_post,
1794
- 'cookie_checkjs_passed' => $checkjs_cookie,
1795
- 'form_validation' => ! empty( $errors )
1796
- ? json_encode( array(
1797
- 'validation_notice' => $errors->get_error_message(),
1798
- 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1799
- ) )
1800
- : null,
1801
- );
1802
-
1803
- $base_call_result = apbct_base_call(
1804
- array(
1805
- 'sender_email' => $user_email,
1806
- 'sender_nickname' => $sanitized_user_login,
1807
- 'sender_info' => $sender_info,
1808
- 'js_on' => $checkjs,
1809
- ),
1810
- true
1811
- );
1812
- $ct_result = $base_call_result['ct_result'];
1813
-
1814
- // Change mail notification if license is out of date
1815
- if($apbct->data['moderate'] == 0 &&
1816
- ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
1817
- ){
1818
- $apbct->sender_email = $user_email;
1819
- $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
1820
- add_filter('wp_new_user_notification_email_admin', 'apbct_registration__Wordpress__changeMailNotification', 100, 3);
1821
- }
1822
-
1823
- $ct_signup_done = true;
1824
-
1825
- $ct_result = ct_change_plugin_resonse($ct_result, $checkjs);
1826
-
1827
- $cleantalk_executed = true;
1828
-
1829
- if ($ct_result->inactive != 0) {
1830
- ct_send_error_notice($ct_result->comment);
1831
- return $errors;
1832
- }
1833
-
1834
- if ($ct_result->allow == 0) {
1835
-
1836
- if ($buddypress === true) {
1837
- $bp->signup->errors['signup_username'] = $ct_result->comment;
1838
- }elseif(!empty($facebook)){
1839
- $_POST['FB_userdata']['email'] = '';
1840
- $_POST['FB_userdata']['name'] = '';
1841
- return;
1842
- }else{
1843
- if(is_wp_error($errors))
1844
- $errors->add('ct_error', $ct_result->comment);
1845
- $ct_negative_comment = $ct_result->comment;
1846
- }
1847
-
1848
- $ct_registration_error_comment = $ct_result->comment;
1849
-
1850
- } else {
1851
- if ($ct_result->id !== null) {
1852
- setcookie($apbct_cookie_register_ok_label, $ct_result->id, time()+10, '/');
1853
- setcookie($apbct_cookie_request_id_label, $ct_result->id, time()+10, '/');
1854
- }
1855
- }
1856
-
1857
- return $errors;
1858
- }
1859
-
1860
- /**
1861
- * Changes email notification for newly registred user
1862
- *
1863
- * @param string $wp_new_user_notification_email_admin Body of email notification
1864
- * @param array $user User inof
1865
- * @param string $blogname Blog name
1866
- * @return string Body for email notification
1867
- */
1868
- function apbct_registration__Wordpress__changeMailNotification($wp_new_user_notification_email_admin, $user, $blogname){
1869
-
1870
- global $apbct;
1871
-
1872
- $wp_new_user_notification_email_admin['message'] = PHP_EOL
1873
- .__('CleanTalk AntiSpam: This registration is spam.', 'cleantalk')
1874
- ."\n" . __('CleanTalk\'s anti-spam database:', 'cleantalk')
1875
- ."\n" . 'IP: ' . $apbct->sender_ip
1876
- ."\n" . 'Email: ' . $apbct->sender_email
1877
- .PHP_EOL . PHP_EOL .
1878
- __('Activate protection in your Anti-Spam Dashboard: ', 'clentalk')
1879
- .'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_registration_passed'
1880
- .($apbct->data['user_token']
1881
- ? '&iser_token='.$apbct->data['user_token']
1882
- : ''
1883
- )
1884
- .PHP_EOL . '---'
1885
- .PHP_EOL
1886
- .$wp_new_user_notification_email_admin['message'];
1887
-
1888
- return $wp_new_user_notification_email_admin;
1889
-
1890
-
1891
- }
1892
-
1893
- /**
1894
- * Checks Ultimate Members registration for spam
1895
- *
1896
- * @param $args forms arguments with names and values
1897
- *
1898
- * @return mixed
1899
- *
1900
- */
1901
- function apbct_registration__UltimateMembers__check( $args ){
1902
-
1903
- global $apbct, $cleantalk_executed;
1904
-
1905
- if ($apbct->settings['registrations_test'] == 0)
1906
- return $args;
1907
-
1908
- $checkjs = apbct_js_test('ct_checkjs_register_form', $args);
1909
- $sender_info['post_checkjs_passed'] = $checkjs;
1910
-
1911
- // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1912
- if ($checkjs == 0) {
1913
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1914
- $sender_info['cookie_checkjs_passed'] = $checkjs;
1915
- }
1916
-
1917
- $base_call_result = apbct_base_call(
1918
- array(
1919
- 'sender_email' => $args['user_email'],
1920
- 'sender_nickname' => $args['user_login'],
1921
- 'sender_info' => $sender_info,
1922
- 'js_on' => $checkjs,
1923
- ),
1924
- true
1925
- );
1926
- $ct_result = $base_call_result['ct_result'];
1927
-
1928
- $cleantalk_executed = true;
1929
-
1930
- if ($ct_result->inactive != 0) {
1931
- ct_send_error_notice($ct_result->comment);
1932
- return $args;
1933
- }
1934
-
1935
- if ($ct_result->allow == 0)
1936
- UM()->form()->add_error('user_password', $ct_result->comment );
1937
-
1938
- return $args;
1939
- }
1940
-
1941
- /**
1942
- * Checks registration error and set it if it was dropped
1943
- * @return errors
1944
- */
1945
- function ct_check_registration_erros($errors, $sanitized_user_login = null, $user_email = null) {
1946
- global $bp, $ct_registration_error_comment;
1947
-
1948
- if($ct_registration_error_comment){
1949
-
1950
- if(isset($bp))
1951
- if(method_exists($bp, 'signup'))
1952
- if(method_exists($bp->signup, 'errors'))
1953
- if(isset($bp->signup->errors['signup_username']))
1954
- if($bp->signup->errors['signup_username'] != $ct_registration_error_comment)
1955
- $bp->signup->errors['signup_username'] = $ct_registration_error_comment;
1956
-
1957
- if(isset($errors))
1958
- if(method_exists($errors, 'errors'))
1959
- if(isset($errors->errors['ct_error']))
1960
- if($errors->errors['ct_error'][0] != $ct_registration_error_comment)
1961
- $errors->add('ct_error', $ct_registration_error_comment);
1962
-
1963
- }
1964
- return $errors;
1965
- }
1966
-
1967
- /**
1968
- * Set user meta (ct_hash) for successed registration
1969
- * @return null
1970
- */
1971
- function apbct_user_register($user_id) {
1972
- global $apbct_cookie_request_id_label;
1973
- if (isset($_COOKIE[$apbct_cookie_request_id_label])) {
1974
- if(update_user_meta($user_id, 'ct_hash', $_COOKIE[$apbct_cookie_request_id_label])){
1975
- setcookie($apbct_cookie_request_id_label, '0', 1, '/');
1976
- }
1977
- }
1978
- }
1979
-
1980
-
1981
- /**
1982
- * Test for JetPack contact form
1983
- */
1984
- function ct_grunion_contact_form_field_html($r, $field_label) {
1985
-
1986
- global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $apbct;
1987
-
1988
- if ($apbct->settings['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match( "/(text|email)/i", $r)) {
1989
-
1990
- // Looking for element name prefix
1991
- $name_patched = false;
1992
- foreach ($ct_jpcf_fields as $v) {
1993
- if ($name_patched === false && preg_match("/(g\d-)$v/", $r, $matches)) {
1994
- $ct_checkjs_jpcf = $matches[1] . $ct_checkjs_jpcf;
1995
- $name_patched = true;
1996
- }
1997
- }
1998
-
1999
- $r .= ct_add_hidden_fields($ct_checkjs_jpcf, true);
2000
- $ct_jpcf_patched = true;
2001
- }
2002
-
2003
- return $r;
2004
- }
2005
- /**
2006
- * Test for JetPack contact form
2007
- */
2008
- function ct_contact_form_is_spam($form) {
2009
-
2010
- global $ct_checkjs_jpcf, $apbct;
2011
-
2012
- if ($apbct->settings['contact_forms_test'] == 0) {
2013
- return null;
2014
- }
2015
-
2016
- $js_field_name = $ct_checkjs_jpcf;
2017
- foreach ($_POST as $k => $v) {
2018
- if (preg_match("/^.+$ct_checkjs_jpcf$/", $k))
2019
- $js_field_name = $k;
2020
- }
2021
-
2022
- $sender_email = null;
2023
- $sender_nickname = null;
2024
- $message = '';
2025
- if (isset($form['comment_author_email']))
2026
- $sender_email = $form['comment_author_email'];
2027
-
2028
- if (isset($form['comment_author']))
2029
- $sender_nickname = $form['comment_author'];
2030
-
2031
- if (isset($form['comment_content']))
2032
- $message = $form['comment_content'];
2033
-
2034
- $base_call_result = apbct_base_call(
2035
- array(
2036
- 'message' => $message,
2037
- 'sender_email' => $sender_email,
2038
- 'sender_nickname' => $sender_nickname,
2039
- 'post_info' => array('comment_type' => 'contact_form_wordpress_grunion'),
2040
- 'sender_info' => array('sender_url' => @$form['comment_author_url']),
2041
- 'js_on' => apbct_js_test($js_field_name, $_POST),
2042
- )
2043
- );
2044
- $ct_result = $base_call_result['ct_result'];
2045
-
2046
- if ($ct_result->allow == 0) {
2047
- global $ct_comment;
2048
- $ct_comment = $ct_result->comment;
2049
- ct_die(null, null);
2050
- exit;
2051
- }
2052
-
2053
- return (bool) !$ct_result->allow;
2054
- }
2055
-
2056
- function ct_contact_form_is_spam_jetpack($is_spam,$form) {
2057
- global $ct_checkjs_jpcf, $apbct;
2058
-
2059
- if ($apbct->settings['contact_forms_test'] == 0) {
2060
- return null;
2061
- }
2062
-
2063
- $js_field_name = $ct_checkjs_jpcf;
2064
- foreach ($_POST as $k => $v) {
2065
- if (preg_match("/^.+$ct_checkjs_jpcf$/", $k))
2066
- $js_field_name = $k;
2067
- }
2068
-
2069
- $base_call_result = apbct_base_call(
2070
- array(
2071
- 'message' => isset($form['comment_content']) ? $form['comment_content'] : '',
2072
- 'sender_email' => isset($form['comment_author_email']) ? $form['comment_author_email'] : null,
2073
- 'sender_nickname' => isset($form['comment_author']) ? $form['comment_author'] : null,
2074
- 'post_info' => array('comment_type' => 'contact_form_wordpress_grunion'),
2075
- 'sender_info' => array('sender_url' => @$form['comment_author_url']),
2076
- )
2077
- );
2078
- $ct_result = $base_call_result['ct_result'];
2079
-
2080
- if ($ct_result->allow == 0) {
2081
- global $ct_comment;
2082
- $ct_comment = $ct_result->comment;
2083
- ct_die(null, null);
2084
- exit;
2085
- }
2086
-
2087
- return (bool) !$ct_result->allow;
2088
- }
2089
-
2090
- /**
2091
- * Inserts anti-spam hidden to WP Maintenance Mode (wpmm)
2092
- */
2093
- function apbct_form__wpmm__addField(){
2094
- ct_add_hidden_fields('ct_checkjs', false, true, true);
2095
- }
2096
-
2097
- /**
2098
- * Inserts anti-spam hidden to CF7
2099
- */
2100
- function apbct_form__contactForm7__addField($html) {
2101
- global $ct_checkjs_cf7, $apbct;
2102
-
2103
-
2104
-
2105
- if ($apbct->settings['contact_forms_test'] == 0) {
2106
- return $html;
2107
- }
2108
-
2109
- $html .= ct_add_hidden_fields($ct_checkjs_cf7, true);
2110
-
2111
- return $html;
2112
- }
2113
-
2114
- /**
2115
- * Test spam for Contact Fomr 7 (CF7) right before validation
2116
- *
2117
- * @global SpbcState $apbct
2118
- * @param type $result
2119
- * @param type $tags
2120
- * @return type
2121
- */
2122
- function apbct_form__contactForm7__tesSpam__before_validate($result = null, $tags = null) {
2123
- global $apbct;
2124
-
2125
- if ($result && method_exists($result, 'get_invalid_fields')){
2126
- $invalid_fields = $result->get_invalid_fields();
2127
- if(!empty($invalid_fields) && is_array($invalid_fields)){
2128
- $apbct->validation_error = $invalid_fields[key($invalid_fields)]['reason'];
2129
- apbct_form__contactForm7__testSpam(false);
2130
- }
2131
- }
2132
-
2133
- return $result;
2134
- }
2135
-
2136
- /**
2137
- * Test CF7 message for spam
2138
- */
2139
- function apbct_form__contactForm7__testSpam($param) {
2140
-
2141
- global $ct_checkjs_cf7, $apbct;
2142
-
2143
- if(
2144
- $apbct->settings['contact_forms_test'] == 0 ||
2145
- $param == false && WPCF7_VERSION < '3.0.0' ||
2146
- $param === true && WPCF7_VERSION >= '3.0.0' ||
2147
- $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() || // Skip processing for logged in users.
2148
- apbct_exclusions_check__url() ||
2149
- apbct_exclusions_check__ip() ||
2150
- isset($apbct->cf7_checked)
2151
- ){
2152
- return $param;
2153
- }
2154
-
2155
- $checkjs = apbct_js_test($ct_checkjs_cf7, $_POST)
2156
- ? apbct_js_test($ct_checkjs_cf7, $_POST)
2157
- : apbct_js_test('ct_checkjs', $_COOKIE);
2158
-
2159
- $ct_temp_msg_data = ct_get_fields_any($_POST);
2160
-
2161
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2162
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2163
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2164
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2165
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2166
- if ($subject != '') {
2167
- $message = array_merge(array('subject' => $subject), $message);
2168
- }
2169
-
2170
- $base_call_result = apbct_base_call(
2171
- array(
2172
- 'message' => $message,
2173
- 'sender_email' => $sender_email,
2174
- 'sender_nickname' => $sender_nickname,
2175
- 'js_on' => $checkjs,
2176
- 'post_info' => array('comment_type' => 'contact_form_wordpress_cf7'),
2177
- 'sender_info' => array(
2178
- 'form_validation' => !isset($apbct->validation_error)
2179
- ? null
2180
- : json_encode(array(
2181
- 'validation_notice' => $apbct->validation_error,
2182
- 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
2183
- ))
2184
- ),
2185
- )
2186
- );
2187
-
2188
- $ct_result = $base_call_result['ct_result'];
2189
-
2190
- // Change mail notification if license is out of date
2191
- if($apbct->data['moderate'] == 0 &&
2192
- ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2193
- ){
2194
- $apbct->sender_email = $sender_email;
2195
- $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2196
- add_filter('wpcf7_mail_components', 'apbct_form__contactForm7__changeMailNotification');
2197
- }
2198
-
2199
- if ($ct_result->allow == 0) {
2200
-
2201
- global $ct_cf7_comment;
2202
- $ct_cf7_comment = $ct_result->comment;
2203
-
2204
- add_filter('wpcf7_display_message', 'apbct_form__contactForm7__showResponse', 10, 2);
2205
-
2206
- $param = WPCF7_VERSION >= '3.0.0' ? true : false;
2207
-
2208
- }
2209
-
2210
- $apbct->cf7_checked = true;
2211
-
2212
- return $param;
2213
- }
2214
-
2215
- /**
2216
- * Changes CF7 status message
2217
- * @param string $hook URL of hooked page
2218
- */
2219
- function apbct_form__contactForm7__showResponse($message, $status = 'spam') {
2220
- global $ct_cf7_comment;
2221
-
2222
- if ($status == 'spam') {
2223
- $message = $ct_cf7_comment;
2224
- }
2225
-
2226
- return $message;
2227
- }
2228
-
2229
- /**
2230
- * Changes email notification for succes subscription for Contact Form 7
2231
- *
2232
- * @param array $component Arguments for email notification
2233
- * @return array Arguments for email notification
2234
- */
2235
- function apbct_form__contactForm7__changeMailNotification($component){
2236
-
2237
- global $apbct;
2238
-
2239
- $component['body'] =
2240
- __('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2241
- .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2242
- .PHP_EOL . 'IP: ' . $apbct->sender_ip
2243
- .PHP_EOL . 'Email: ' . $apbct->sender_email
2244
- .PHP_EOL . sprintf(
2245
- __('Activate protection in your Anti-Spam Dashboard: %s.', 'clentalk'),
2246
- 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam&user_token='.$apbct->user_token
2247
- )
2248
- .PHP_EOL . '---' . PHP_EOL . PHP_EOL
2249
- .$component['body'];
2250
-
2251
- return (array) $component;
2252
- }
2253
-
2254
- /**
2255
- * Test Ninja Forms message for spam
2256
- *
2257
- * @global SpbcState $apbct
2258
- * @return void
2259
- */
2260
- function apbct_form__ninjaForms__testSpam() {
2261
-
2262
- global $apbct;
2263
-
2264
- if(
2265
- $apbct->settings['contact_forms_test'] == 0
2266
- || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2267
- || apbct_exclusions_check__url()
2268
- ){
2269
- return;
2270
- }
2271
-
2272
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
2273
-
2274
- // Choosing between POST and GET
2275
- $params = ct_get_fields_any(isset($_GET['ninja_forms_ajax_submit']) || isset($_GET['nf_ajax_submit']) ? $_GET : $_POST);
2276
-
2277
- $sender_email = ($params['email'] ? $params['email'] : '');
2278
- $sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
2279
- $subject = ($params['subject'] ? $params['subject'] : '');
2280
- $message = ($params['message'] ? $params['message'] : array());
2281
- if ($subject != '') {
2282
- $message = array_merge(array('subject' => $subject), $message);
2283
- }
2284
-
2285
- //Ninja Forms xml fix
2286
- foreach ($message as $key => $value){
2287
- if (strpos($value, '<xml>') !== false)
2288
- unset($message[$key]);
2289
- }
2290
-
2291
- $base_call_result = apbct_base_call(
2292
- array(
2293
- 'message' => $message,
2294
- 'sender_email' => $sender_email,
2295
- 'sender_nickname' => $sender_nickname,
2296
- 'post_info' => array('comment_type' => 'contact_form_wordpress_ninja_froms'),
2297
- 'js_on' => $checkjs,
2298
- )
2299
- );
2300
- $ct_result = $base_call_result['ct_result'];
2301
-
2302
- // Change mail notification if license is out of date
2303
- if($apbct->data['moderate'] == 0 &&
2304
- ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2305
- ){
2306
- $apbct->sender_email = $sender_email;
2307
- $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2308
- add_filter('ninja_forms_action_email_message', 'apbct_form__ninjaForms__changeMailNotification', 1, 3);
2309
- }
2310
-
2311
- if ($ct_result->allow == 0) {
2312
-
2313
- // We have to use GLOBAL variable to transfer the comment to apbct_form__ninjaForms__changeResponse() function :(
2314
- $apbct->response = $ct_result->comment;
2315
- add_action( 'ninja_forms_before_response', 'apbct_form__ninjaForms__changeResponse', 10, 1 );
2316
- }
2317
- }
2318
-
2319
- function apbct_form__ninjaForms__changeResponse( $data ) {
2320
-
2321
- global $apbct;
2322
-
2323
- // Show error message below field found by ID
2324
- if(array_key_exists('email', $data['fields_by_key'])){
2325
- // Find ID of EMAIL field
2326
- $nf_field_id = $data['fields_by_key']['email']['id'];
2327
- }else{
2328
- // Find ID of last field (usually SUBMIT)
2329
- $nf_field_id = array_pop(array_keys($data['fields']));
2330
- }
2331
-
2332
- // Below is modified NJ logic
2333
- $error = array(
2334
- 'fields' => array(
2335
- $nf_field_id => $apbct->response,
2336
- ),
2337
- );
2338
-
2339
- $response = array( 'data' => $data, 'errors' => $error, 'debug' => '' );
2340
-
2341
- die(wp_json_encode( $response, JSON_FORCE_OBJECT ));
2342
-
2343
- }
2344
-
2345
- function apbct_form__seedprod_coming_soon__testSpam() {
2346
-
2347
- global $apbct;
2348
-
2349
- if(
2350
- $apbct->settings['contact_forms_test'] == 0
2351
- || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2352
- || apbct_exclusions_check__url()
2353
- ){
2354
- return;
2355
- }
2356
-
2357
- $ct_temp_msg_data = ct_get_fields_any($_REQUEST);
2358
-
2359
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2360
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2361
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2362
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2363
- if ($subject != '') {
2364
- $message = array_merge(array('subject' => $subject), $message);
2365
- }
2366
-
2367
- $post_info['comment_type'] = 'contact_form_wordpress_seedprod_coming_soon';
2368
-
2369
- $base_call_result = apbct_base_call(
2370
- array(
2371
- 'message' => $message,
2372
- 'sender_email' => $sender_email,
2373
- 'sender_nickname' => $sender_nickname,
2374
- 'post_info' => $post_info,
2375
- )
2376
- );
2377
-
2378
- $ct_result = $base_call_result['ct_result'];
2379
- if ($ct_result->allow == 0) {
2380
- global $ct_comment;
2381
- $ct_comment = $ct_result->comment;
2382
-
2383
- $response = array(
2384
- 'status' => 200,
2385
- 'html' => "<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>"
2386
- );
2387
-
2388
- echo sanitize_text_field($_GET['callback']) . '(' . json_encode($response) . ')';
2389
- exit();
2390
- }
2391
-
2392
- }
2393
-
2394
- /**
2395
- * Changes email notification for succes subscription for Ninja Forms
2396
- *
2397
- * @param string $message Body of email notification
2398
- * @return string Body for email notification
2399
- */
2400
- function apbct_form__ninjaForms__changeMailNotification($message, $data, $action_settings){
2401
-
2402
- global $apbct;
2403
-
2404
- if($action_settings['to'] !== $apbct->sender_email){
2405
-
2406
- $message .= wpautop(PHP_EOL . '---'
2407
- .PHP_EOL
2408
- .__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2409
- .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2410
- .PHP_EOL . 'IP: ' . $apbct->sender_ip
2411
- .PHP_EOL . 'Email: ' . $apbct->sender_email
2412
- .PHP_EOL .
2413
- __('Activate protection in your Anti-Spam Dashboard: ', 'clentalk').
2414
- 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=ninjaform_activate_antispam'.$apbct->user_token
2415
- );
2416
- }
2417
-
2418
- return $message;
2419
- }
2420
-
2421
- /**
2422
- * Inserts anti-spam hidden to WPForms
2423
- *
2424
- * @global SpbcState $apbct
2425
- * @return void
2426
- */
2427
- function apbct_form__WPForms__addField($form_data, $some, $title, $description, $errors) {
2428
-
2429
- global $apbct;
2430
-
2431
- if($apbct->settings['contact_forms_test'] == 1)
2432
- ct_add_hidden_fields('checkjs_wpforms', false);
2433
-
2434
- }
2435
-
2436
- /**
2437
- * Gather fields data from submission and store it
2438
- *
2439
- * @param array $entry
2440
- * @param $form
2441
- *
2442
- * @return array
2443
- * @global SpbcState $apbct
2444
- */
2445
- function apbct_from__WPForms__gatherData($entry, $form){
2446
-
2447
- global $apbct;
2448
-
2449
- $data = array();
2450
- foreach($entry['fields'] as $key => $val){
2451
- $true_key = strtolower(str_replace(' ', '_', $form['fields'][$key]['label']));
2452
- $true_key = $true_key ? $true_key : $key;
2453
- $data[$true_key] = $val;
2454
- } unset($key, $val);
2455
-
2456
- $apbct->form_data = $data;
2457
-
2458
- return $entry;
2459
- }
2460
-
2461
- /**
2462
- * Adding error to form entry if message is spam
2463
- * Call spam test from here
2464
- *
2465
- * @param array $errors
2466
- * @param array $form_data
2467
- * @return array
2468
- */
2469
- function apbct_form__WPForms__showResponse($errors, $form_data) {
2470
-
2471
- if(empty($errors) || ( isset($form_data['id'], $errors[$form_data['id']]) && !count($errors[$form_data['id']]) ) ){
2472
-
2473
- $spam_comment = apbct_form__WPForms__testSpam();
2474
-
2475
- $filed_id = $form_data && !empty($form_data['fields']) && is_array($form_data['fields'])
2476
- ? key($form_data['fields'])
2477
- : 0;
2478
-
2479
- if($spam_comment)
2480
- $errors[ $form_data['id'] ][ $filed_id ] = $spam_comment;
2481
-
2482
- }
2483
-
2484
- return $errors;
2485
- }
2486
-
2487
- /**
2488
- * Test WPForms message for spam
2489
- * Doesn't hooked anywhere.
2490
- * Called directly from apbct_form__WPForms__showResponse()
2491
- *
2492
- * @global SpbcState $apbct
2493
- * @global array $apbct->form_data Contains form data
2494
- * @param array $errors Array of errors to write false result in
2495
- * @return void|array|null
2496
- */
2497
- function apbct_form__WPForms__testSpam() {
2498
-
2499
- global $apbct;
2500
-
2501
- if(
2502
- $apbct->settings['contact_forms_test'] == 0 ||
2503
- $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
2504
- ){
2505
- return;
2506
- }
2507
-
2508
- $checkjs = apbct_js_test('checkjs_wpforms', $_POST);
2509
-
2510
- $params = ct_get_fields_any($apbct->form_data);
2511
-
2512
- $sender_email = ($params['email'] ? $params['email'] : '');
2513
- $sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
2514
- $subject = ($params['subject'] ? $params['subject'] : '');
2515
- $message = ($params['message'] ? $params['message'] : array());
2516
- if ($subject != '') {
2517
- $message = array_merge(array('subject' => $subject), $message);
2518
- }
2519
-
2520
- $base_call_result = apbct_base_call(
2521
- array(
2522
- 'message' => $message,
2523
- 'sender_email' => $sender_email,
2524
- 'sender_nickname' => $sender_nickname,
2525
- 'post_info' => array('comment_type' => 'contact_form_wordpress_wp_forms'),
2526
- 'js_on' => $checkjs,
2527
- )
2528
- );
2529
- $ct_result = $base_call_result['ct_result'];
2530
-
2531
- // Change mail notification if license is out of date
2532
- if($apbct->data['moderate'] == 0 &&
2533
- ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2534
- ){
2535
- $apbct->sender_email = $sender_email;
2536
- $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2537
- add_filter('wpforms_email_message', 'apbct_form__WPForms__changeMailNotification', 100, 2);
2538
- }
2539
-
2540
- if ($ct_result->allow == 0){
2541
- return $ct_result->comment;
2542
- }
2543
-
2544
- return null;
2545
-
2546
- }
2547
-
2548
- /**
2549
- * Changes email notification for succes subscription for Ninja Forms
2550
- *
2551
- * @param string $message Body of email notification
2552
- * @param WPForms_WP_Emails $wpforms_email WPForms email class object
2553
- * @return string Body for email notification
2554
- */
2555
- function apbct_form__WPForms__changeMailNotification($message, $wpforms_email){
2556
-
2557
- global $apbct;
2558
-
2559
- $message = str_replace('</html>', '', $message);
2560
- $message = str_replace('</body>', '', $message);
2561
- $message .= wpautop(PHP_EOL . '---'
2562
- .PHP_EOL
2563
- .__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2564
- .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2565
- .PHP_EOL . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_ip . '</a>'
2566
- .PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
2567
- .PHP_EOL . sprintf(
2568
- __('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
2569
- '<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_activate_antispam" target="_blank">',
2570
- '</a>'
2571
- ))
2572
- .'</body></html>';
2573
-
2574
- return $message;
2575
-
2576
- }
2577
-
2578
- /*
2579
- * QuForms check spam
2580
- * works with singl-paged forms
2581
- * and with multi-paged forms - check only last step of the forms
2582
- */
2583
- function ct_quform_post_validate($result, $form) {
2584
-
2585
- if ( $form->hasPages() ) {
2586
- $comment_type = 'contact_form_wordpress_quforms_multipage';
2587
- } else {
2588
- $comment_type = 'contact_form_wordpress_quforms_singlepage';
2589
- }
2590
-
2591
- $ct_temp_msg_data = ct_get_fields_any( $form->getValues() );
2592
- // @ToDo If we have several emails at the form - will be used only the first detected!
2593
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2594
-
2595
- $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
2596
- $base_call_result = apbct_base_call(
2597
- array(
2598
- 'message' => $form->getValues(),
2599
- 'sender_email' => $sender_email,
2600
- 'post_info' => array('comment_type' => $comment_type),
2601
- 'js_on' => $checkjs,
2602
- )
2603
- );
2604
-
2605
- $ct_result = $base_call_result['ct_result'];
2606
- if ($ct_result->allow == 0) {
2607
- die(json_encode(array('type' => 'error', 'apbct' => array('blocked' => true, 'comment' => $ct_result->comment))));
2608
- } else {
2609
- return $result;
2610
- }
2611
-
2612
- return $result;
2613
-
2614
- }
2615
-
2616
- /**
2617
- * Inserts anti-spam hidden to Fast Secure contact form
2618
- */
2619
- function ct_si_contact_display_after_fields($string = '', $style = '', $form_errors = array(), $form_id_num = 0) {
2620
- $string .= ct_add_hidden_fields('ct_checkjs', true);
2621
- return $string;
2622
- }
2623
-
2624
- /**
2625
- * Test for Fast Secure contact form
2626
- */
2627
- function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
2628
- global $apbct, $cleantalk_executed;
2629
-
2630
- if (!empty($form_errors))
2631
- return $form_errors;
2632
-
2633
- if ($apbct->settings['contact_forms_test'] == 0)
2634
- return $form_errors;
2635
-
2636
- // Skip processing because data already processed.
2637
- if ($cleantalk_executed) {
2638
- return $form_errors;
2639
- }
2640
-
2641
- //getting info from custom fields
2642
- $ct_temp_msg_data = ct_get_fields_any($_POST);
2643
-
2644
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2645
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2646
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2647
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2648
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2649
- if($subject != '') {
2650
- $message['subject'] = $subject;
2651
- }
2652
-
2653
- $base_call_result = apbct_base_call(
2654
- array(
2655
- 'message' => $message,
2656
- 'sender_email' => $sender_email,
2657
- 'sender_nickname' => $sender_nickname,
2658
- 'post_info' => array('comment_type' => 'contact_form_wordpress_fscf'),
2659
- 'js_on' => apbct_js_test('ct_checkjs', $_POST),
2660
- )
2661
- );
2662
-
2663
- $ct_result = $base_call_result['ct_result'];
2664
-
2665
- $cleantalk_executed = true;
2666
-
2667
- if ($ct_result->allow == 0) {
2668
- global $ct_comment;
2669
- $ct_comment = $ct_result->comment;
2670
- ct_die(null, null);
2671
- exit;
2672
- }
2673
-
2674
- return $form_errors;
2675
- }
2676
-
2677
- /**
2678
- * Notice for commentators which comment has automatically approved by plugin
2679
- * @param string $hook URL of hooked page
2680
- */
2681
- function ct_comment_text($comment_text) {
2682
- global $comment, $ct_approved_request_id_label;
2683
-
2684
- if (isset($_COOKIE[$ct_approved_request_id_label]) && isset($comment->comment_ID)) {
2685
- $ct_hash = get_comment_meta($comment->comment_ID, 'ct_hash', true);
2686
-
2687
- if ($ct_hash !== '' && $_COOKIE[$ct_approved_request_id_label] == $ct_hash) {
2688
- $comment_text .= '<br /><br /> <em class="comment-awaiting-moderation">' . __('Comment approved. Anti-spam by CleanTalk.', 'cleantalk') . '</em>';
2689
- }
2690
- }
2691
-
2692
- return $comment_text;
2693
- }
2694
-
2695
-
2696
- /**
2697
- * Checks WordPress Landing Pages raw $_POST values
2698
- */
2699
- function ct_check_wplp(){
2700
-
2701
- global $ct_wplp_result_label, $apbct;
2702
-
2703
- if (!isset($_COOKIE[$ct_wplp_result_label])) {
2704
- // First AJAX submit of WPLP form
2705
- if ($apbct->settings['contact_forms_test'] == 0)
2706
- return;
2707
-
2708
- $post_info['comment_type'] = 'feedback';
2709
- $post_info = json_encode($post_info);
2710
- if ($post_info === false)
2711
- $post_info = '';
2712
-
2713
- $sender_email = '';
2714
- foreach ($_POST as $v) {
2715
- if (preg_match("/^\S+@\S+\.\S+$/", $v)) {
2716
- $sender_email = $v;
2717
- break;
2718
- }
2719
- }
2720
-
2721
- $message = '';
2722
- if(array_key_exists('form_input_values', $_POST)){
2723
- $form_input_values = json_decode(stripslashes($_POST['form_input_values']), true);
2724
- if (is_array($form_input_values) && array_key_exists('null', $form_input_values))
2725
- $message = $form_input_values['null'];
2726
- } else if (array_key_exists('null', $_POST)) {
2727
- $message = $_POST['null'];
2728
- }
2729
-
2730
- $base_call_result = apbct_base_call(
2731
- array(
2732
- 'message' => $message,
2733
- 'sender_email' => $sender_email,
2734
- 'post_info' => array('comment_type' => 'contact_form_wordpress_wplp'),
2735
- )
2736
- );
2737
-
2738
- $ct_result = $base_call_result['ct_result'];
2739
-
2740
- if ($ct_result->allow == 0) {
2741
- $cleantalk_comment = $ct_result->comment;
2742
- } else {
2743
- $cleantalk_comment = 'OK';
2744
- }
2745
-
2746
- setcookie($ct_wplp_result_label, $cleantalk_comment, strtotime("+5 seconds"), '/');
2747
- } else {
2748
- // Next POST/AJAX submit(s) of same WPLP form
2749
- $cleantalk_comment = $_COOKIE[$ct_wplp_result_label];
2750
- }
2751
- if ($cleantalk_comment !== 'OK')
2752
- ct_die_extended($cleantalk_comment);
2753
- }
2754
-
2755
- /**
2756
- * Places a hidding field to Gravity forms.
2757
- * @return string
2758
- */
2759
- function apbct_form__gravityForms__addField($form_string, $form){
2760
- $ct_hidden_field = 'ct_checkjs';
2761
-
2762
- // Do not add a hidden field twice.
2763
- if (preg_match("/$ct_hidden_field/", $form_string)) {
2764
- return $form_string;
2765
- }
2766
-
2767
- $search = "</form>";
2768
-
2769
- // Adding JS code
2770
- $js_code = ct_add_hidden_fields($ct_hidden_field, true, false);
2771
- $form_string = str_replace($search, $js_code . $search, $form_string);
2772
-
2773
- // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
2774
- $append_string = isset($form['lastPageButton']) ? "<input type='hidden' name='ct_multipage_form' value='yes'>" : '';
2775
- $form_string = str_replace($search, $append_string.$search, $form_string);
2776
-
2777
- return $form_string;
2778
- }
2779
-
2780
- /**
2781
- * Gravity forms anti-spam test.
2782
- * @return boolean
2783
- */
2784
- function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) {
2785
-
2786
- global $apbct, $cleantalk_executed, $ct_gform_is_spam, $ct_gform_response;
2787
-
2788
- if (
2789
- $apbct->settings['contact_forms_test'] == 0 ||
2790
- $is_spam ||
2791
- $cleantalk_executed // Return unchanged result if the submission was already tested.
2792
- )
2793
- return $is_spam;
2794
-
2795
- $ct_temp = array();
2796
- foreach($entry as $key => $value){
2797
- if(is_numeric($key))
2798
- $ct_temp[$key]=$value;
2799
- } unset($key, $value);
2800
-
2801
- $ct_temp_msg_data = ct_get_fields_any($ct_temp);
2802
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2803
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2804
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2805
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2806
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2807
-
2808
- // Adding 'input_' to every field /Gravity Forms fix/
2809
- $message = array_flip($message);
2810
- foreach($message as &$value){
2811
- $value = 'input_'.$value;
2812
- } unset($value);
2813
- $message = array_flip($message);
2814
-
2815
- if($subject != '')
2816
- $message['subject'] = $subject;
2817
-
2818
- $checkjs = apbct_js_test('ct_checkjs', $_POST)
2819
- ? apbct_js_test('ct_checkjs', $_POST)
2820
- : apbct_js_test('ct_checkjs', $_COOKIE);
2821
-
2822
- $base_call_result = apbct_base_call(
2823
- array(
2824
- 'message' => $message,
2825
- 'sender_email' => $sender_email,
2826
- 'sender_nickname' => $sender_nickname,
2827
- 'post_info' => array('comment_type' => 'contact_form_wordpress_gravity_forms'),
2828
- 'js_on' => $checkjs,
2829
- )
2830
- );
2831
-
2832
- $ct_result = $base_call_result['ct_result'];
2833
- if ($ct_result->allow == 0) {
2834
- $is_spam = true;
2835
- $ct_gform_is_spam = true;
2836
- $ct_gform_response = $ct_result->comment;
2837
- }
2838
-
2839
- return $is_spam;
2840
- }
2841
-
2842
- function apbct_form__gravityForms__showResponse( $confirmation, $form, $entry, $ajax ){
2843
-
2844
- global $ct_gform_is_spam, $ct_gform_response;
2845
-
2846
- if(!empty($ct_gform_is_spam)){
2847
- $confirmation = '<a id="gf_'.$form['id'].'" class="gform_anchor" ></a><div id="gform_confirmation_wrapper_'.$form['id'].'" class="gform_confirmation_wrapper "><div id="gform_confirmation_message_'.$form['id'].'" class="gform_confirmation_message_'.$form['id'].' gform_confirmation_message"><font style="color: red">'.$ct_gform_response.'</font></div></div>';
2848
- }
2849
-
2850
- return $confirmation;
2851
- }
2852
-
2853
- /**
2854
- * Test S2member registration
2855
- * @return array with errors
2856
- */
2857
- function ct_s2member_registration_test($post_key) {
2858
-
2859
- global $apbct;
2860
-
2861
- if ($apbct->settings['registrations_test'] == 0) {
2862
- return null;
2863
- }
2864
-
2865
- $sender_email = isset($_POST[$post_key]['email']) ? sanitize_email($_POST[$post_key]['email']) : null;
2866
- $sender_nickname = isset($_POST[$post_key]['username']) ? sanitize_email($_POST[$post_key]['username']) : null;
2867
-
2868
- //Making a call
2869
- $base_call_result = apbct_base_call(
2870
- array(
2871
- 'sender_email' => $sender_email,
2872
- 'sender_nickname' => $sender_nickname,
2873
- ),
2874
- true
2875
- );
2876
- $ct_result = $base_call_result['ct_result'];
2877
-
2878
- if ($ct_result->allow == 0) {
2879
- ct_die_extended($ct_result->comment);
2880
- }
2881
-
2882
- return true;
2883
- }
2884
-
2885
- function apbct_form__the7_contact_form() {
2886
-
2887
- global $cleantalk_executed;
2888
-
2889
- if ( check_ajax_referer( 'dt_contact_form', 'nonce', false ) && isset($_POST) ) {
2890
-
2891
- $post_info['comment_type'] = 'contact_the7_theme_contact_form';
2892
-
2893
- $ct_temp_msg_data = ct_get_fields_any($_POST);
2894
-
2895
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2896
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2897
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2898
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2899
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2900
- if ($subject != '') {
2901
- $message = array_merge(array('subject' => $subject), $message);
2902
- }
2903
-
2904
- // Skip submission if no data found
2905
- if ($sender_email === ''|| !$contact_form) {
2906
- return false;
2907
- }
2908
- $cleantalk_executed = true;
2909
-
2910
- $base_call_result = apbct_base_call(
2911
- array(
2912
- 'message' => $message,
2913
- 'sender_email' => $sender_email,
2914
- 'sender_nickname' => $sender_nickname,
2915
- 'post_info' => $post_info,
2916
- )
2917
- );
2918
-
2919
- $ct_result = $base_call_result['ct_result'];
2920
- if ($ct_result->allow == 0) {
2921
-
2922
- $response = json_encode(
2923
- array(
2924
- 'success' => false ,
2925
- 'errors' => $ct_result->comment,
2926
- 'nonce' => wp_create_nonce( 'dt_contact_form' )
2927
- )
2928
- );
2929
-
2930
- // response output
2931
- header( "Content-Type: application/json" );
2932
- echo $response;
2933
-
2934
- // IMPORTANT: don't forget to "exit"
2935
- exit;
2936
-
2937
- }
2938
-
2939
- }
2940
-
2941
- }
2942
-
2943
- function apbct_form__elementor_pro__testSpam() {
2944
-
2945
- global $apbct, $cleantalk_executed;
2946
-
2947
- if(
2948
- $apbct->settings['contact_forms_test'] == 0
2949
- || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2950
- || apbct_exclusions_check__url()
2951
- ){
2952
- return;
2953
- }
2954
-
2955
- $ct_temp_msg_data = ct_get_fields_any($_POST);
2956
-
2957
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2958
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2959
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2960
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2961
- if ($subject != '') {
2962
- $message = array_merge(array('subject' => $subject), $message);
2963
- }
2964
-
2965
- $post_info['comment_type'] = 'contact_form_wordpress_elementor_pro';
2966
-
2967
- $cleantalk_executed = true;
2968
- $base_call_result = apbct_base_call(
2969
- array(
2970
- 'message' => $message,
2971
- 'sender_email' => $sender_email,
2972
- 'sender_nickname' => $sender_nickname,
2973
- 'post_info' => $post_info,
2974
- )
2975
- );
2976
-
2977
- $ct_result = $base_call_result['ct_result'];
2978
-
2979
- if ($ct_result->allow == 0) {
2980
-
2981
- wp_send_json_error( array(
2982
- 'message' => $ct_result->comment,
2983
- 'data' => array()
2984
- ) );
2985
-
2986
- }
2987
-
2988
- }
2989
-
2990
- /**
2991
- * General test for any contact form
2992
- */
2993
- function ct_contact_form_validate() {
2994
-
2995
- global $pagenow,$cleantalk_executed ,$apbct, $ct_checkjs_frm;
2996
-
2997
- // Exclusios common function
2998
- if ( apbct_exclusions_check(__FUNCTION__) )
2999
- return null;
3000
-
3001
- if (@sizeof($_POST)==0 ||
3002
- (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3003
- (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3004
- (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3005
- apbct_is_in_referer( 'lostpassword' ) ||
3006
- apbct_is_in_referer( 'lost-password' ) || //Skip lost-password form check
3007
- (apbct_is_in_uri('/wp-admin/') && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
3008
- apbct_is_in_uri('wp-login.php') ||
3009
- apbct_is_in_uri('wp-comments-post.php') ||
3010
- apbct_is_in_uri('?provider=facebook&') ||
3011
- apbct_is_in_uri('reset-password/') || // Ticket #13668. Password reset.
3012
- apbct_is_in_referer( '/wp-admin/') ||
3013
- apbct_is_in_uri('/login/') ||
3014
- apbct_is_in_uri( '/my-account/edit-account/') || // WooCommerce edit account page
3015
- apbct_is_in_uri( '/my-account/edit-address/') || // WooCommerce edit account page
3016
- (isset($_POST['action']) && $_POST['action'] == 'save_account_details') || // WooCommerce edit account action
3017
- apbct_is_in_uri( '/peepsoajax/profilefieldsajax.validate_register') ||
3018
- isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3019
- isset($_POST['ct_checkjs_register_form']) ||
3020
- (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3021
- $apbct->settings['general_contact_forms_test'] == 0 ||
3022
- isset($_POST['bbp_topic_content']) ||
3023
- isset($_POST['bbp_reply_content']) ||
3024
- isset($_POST['fscf_submitted']) ||
3025
- apbct_is_in_uri('/wc-api/') ||
3026
- isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit']) ||
3027
- isset($_POST[$ct_checkjs_frm]) && $apbct->settings['contact_forms_test'] == 1 ||// Formidable forms
3028
- isset($_POST['comment_post_ID']) || // The comment form
3029
- isset($_GET['for']) ||
3030
- (isset($_POST['log'], $_POST['pwd'])) || //WooCommerce Sensei login form fix
3031
- (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || // WooCommerce recovery password form
3032
- ((isset($_POST['woocommerce-login-nonce']) || isset($_POST['_wpnonce'])) && isset($_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || // WooCommerce login form
3033
- (isset($_POST['wc-api']) && strtolower($_POST['wc-api']) == 'wc_gateway_systempay') || // Woo Systempay payment plugin
3034
- (isset($_POST['_wpcf7'], $_POST['_wpcf7_version'], $_POST['_wpcf7_locale'])) || //CF7 fix)
3035
- (isset($_POST['hash'], $_POST['device_unique_id'], $_POST['device_name'])) ||//Mobile Assistant Connector fix
3036
- isset($_POST['gform_submit']) || //Gravity form
3037
- apbct_is_in_uri( 'wc-ajax=get_refreshed_fragments') ||
3038
- (isset($_POST['ccf_form']) && intval($_POST['ccf_form']) == 1) ||
3039
- (isset($_POST['contact_tags']) && strpos($_POST['contact_tags'], 'MBR:') !== false) ||
3040
- (apbct_is_in_uri( 'bizuno.php') && !empty($_POST['bizPass'])) ||
3041
- apbct_is_in_referer( 'my-dashboard/' ) || // ticket_id=7885
3042
- isset($_POST['slm_action'], $_POST['license_key'], $_POST['secret_key'], $_POST['registered_domain']) || // ticket_id=9122
3043
- (isset($_POST['wpforms']['submit']) && $_POST['wpforms']['submit'] == 'wpforms-submit') || // WPForms
3044
- (isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form') || // JetPack
3045
- (isset($_POST['action']) && $_POST['action'] == 'bbp-update-user') || //BBP update user info page
3046
- apbct_is_in_referer( '?wc-api=WC_Gateway_Transferuj' ) || //WC Gateway
3047
- (isset($_GET['mbr'], $_GET['amp;appname'], $_GET['amp;master'])) || // ticket_id=10773
3048
- (isset($_POST['call_function']) && $_POST['call_function'] == 'push_notification_settings') || // Skip mobile requests (push settings)
3049
- apbct_is_in_uri('membership-login') || // Skip login form
3050
- (isset($_GET['cookie-state-change'])) || //skip GDPR plugin
3051
- ( apbct_get_server_variable( 'HTTP_USER_AGENT' ) == 'MailChimp' && apbct_is_in_uri( 'mc4wp-sync-api/webhook-listener') ) || // Mailchimp webhook skip
3052
- apbct_is_in_uri('researcher-log-in') || // Skip login form
3053
- apbct_is_in_uri('admin_aspcms/_system/AspCms_SiteSetting.asp?action=saves') || // Skip admin save callback
3054
- apbct_is_in_uri('?profile_tab=postjobs') || // Skip post vacancies
3055
- (isset($_POST['btn_insert_post_type_hotel']) && $_POST['btn_insert_post_type_hotel'] == 'SUBMIT HOTEL') || // Skip adding hotel
3056
- (isset($_POST['action']) && $_POST['action'] == 'updraft_savesettings') || // Updraft save settings
3057
- isset($_POST['quform_submit']) || //QForms multi-paged form skip
3058
- (isset($_POST['wpum_form']) && $_POST['wpum_form'] == 'login') || //WPUM login skip
3059
- isset($_POST['password']) || // Exception for login form. From Analysis uid=406596
3060
- (isset($_POST['action']) && $_POST['action'] == 'wilcity_reset_password') || // Exception for reset password form. From Analysis uid=430898
3061
- (isset($_POST['action']) && $_POST['action'] == 'wilcity_login') // Exception for login form. From Analysis uid=430898
3062
- ) {
3063
- return null;
3064
- }
3065
-
3066
- // Do not execute anti-spam test for logged in users.
3067
- if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
3068
- return null;
3069
-
3070
- $post_info['comment_type'] = 'feedback_general_contact_form';
3071
-
3072
- // Skip the test if it's WooCommerce and the checkout test unset
3073
- if( apbct_is_in_uri('wc-ajax=checkout') ||
3074
- apbct_is_in_referer('wc-ajax=update_order_review') ||
3075
- !empty($_POST['woocommerce_checkout_place_order']) ||
3076
- apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout')
3077
- ){
3078
- if($apbct->settings['wc_checkout_test'] == 0){
3079
- return null;
3080
- }
3081
- $post_info['comment_type'] = 'order';
3082
- }
3083
-
3084
- $ct_temp_msg_data = ct_get_fields_any($_POST);
3085
-
3086
- $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
3087
- $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
3088
- $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
3089
- $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
3090
- $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
3091
- if ($subject != '') {
3092
- $message = array_merge(array('subject' => $subject), $message);
3093
- }
3094
-
3095
- // Skip submission if no data found
3096
- if ($sender_email === ''|| !$contact_form) {
3097
- return false;
3098
- }
3099
- $cleantalk_executed=true;
3100
-
3101
- if(isset($_POST['TellAFriend_Link'])){
3102
- $tmp = $_POST['TellAFriend_Link'];
3103
- unset($_POST['TellAFriend_Link']);
3104
- }
3105
-
3106
- $base_call_result = apbct_base_call(
3107
- array(
3108
- 'message' => $message,
3109
- 'sender_email' => $sender_email,
3110
- 'sender_nickname' => $sender_nickname,
3111
- 'post_info' => $post_info,
3112
- )
3113
- );
3114
-
3115
- if(isset($_POST['TellAFriend_Link'])){
3116
- $_POST['TellAFriend_Link']=$tmp;
3117
- }
3118
-
3119
- $ct_result = $base_call_result['ct_result'];
3120
- if ($ct_result->allow == 0) {
3121
-
3122
- // Recognize contact form an set it's name to $contact_form to use later
3123
- $contact_form = null;
3124
- foreach($_POST as $param => $value){
3125
- if(strpos($param, 'et_pb_contactform_submit') === 0){
3126
- $contact_form = 'contact_form_divi_theme';
3127
- $contact_form_additional = str_replace('et_pb_contactform_submit', '', $param);
3128
- }
3129
- if(strpos($param, 'avia_generated_form') === 0){
3130
- $contact_form = 'contact_form_enfold_theme';
3131
- $contact_form_additional = str_replace('avia_generated_form', '', $param);
3132
- }
3133
- if(!empty($contact_form))
3134
- break;
3135
- }
3136
-
3137
- $ajax_call = false;
3138
- if ((defined( 'DOING_AJAX' ) && DOING_AJAX)
3139
- ) {
3140
- $ajax_call = true;
3141
- }
3142
- if ($ajax_call) {
3143
- echo $ct_result->comment;
3144
- } else {
3145
-
3146
- global $ct_comment;
3147
- $ct_comment = $ct_result->comment;
3148
- if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add'){
3149
- $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
3150
- header("Content-Type: application/json");
3151
- print json_encode($result);
3152
- die();
3153
-
3154
- }else if(isset($_POST['TellAFriend_email'])){
3155
- echo $ct_result->comment;
3156
- die();
3157
-
3158
- }else if(isset($_POST['gform_submit'])){ // Gravity forms submission
3159
- $response = sprintf("<!DOCTYPE html><html><head><meta charset='UTF-8' /></head><body class='GF_AJAX_POSTBACK'><div id='gform_confirmation_wrapper_1' class='gform_confirmation_wrapper '><div id='gform_confirmation_message_1' class='gform_confirmation_message_1
3160
- gform_confirmation_message'>%s</div></div></body></html>",
3161
- $ct_result->comment
3162
- );
3163
- echo $response;
3164
- die();
3165
-
3166
- }elseif(isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'],'wc-ajax=update_order_review')){ //WooCommerce checkout ("Place Oreder button")
3167
- $result = Array(
3168
- 'result' => 'failure',
3169
- 'messages' => "<ul class=\"woocommerce-error\"><li>".$ct_result->comment."</li></ul>",
3170
- 'refresh' => 'false',
3171
- 'reload' => 'false'
3172
- );
3173
- print json_encode($result);
3174
- die();
3175
-
3176
- }elseif(isset($_POST['action']) && $_POST['action'] == 'ct_check_internal'){
3177
- return $ct_result->comment;
3178
-
3179
- }elseif(isset($_POST['vfb-submit']) && defined('VFB_VERSION')){
3180
- wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
3181
- // Caldera Contact Forms
3182
- }elseif(isset($_POST['action']) && $_POST['action'] == 'cf_process_ajax_submit'){
3183
- print json_encode("<h3 style='color: red;'><red>".$ct_result->comment);
3184
- die();
3185
- // Mailster
3186
- }elseif(isset($_POST['_referer'], $_POST['formid'], $_POST['email'])){
3187
- $return = array(
3188
- 'success' => false,
3189
- 'html' => '<p>' . $ct_result->comment . '</p>',
3190
- );
3191
- print json_encode($return);
3192
- die();
3193
- // Divi Theme Contact Form. Using $contact_form
3194
- }elseif(!empty($contact_form) && $contact_form == 'contact_form_divi_theme'){
3195
- echo "<div id='et_pb_contact_form{$contact_form_additional}'><h1>Your request looks like spam.</h1><div><p>{$ct_result->comment}</p></div></div>";
3196
- die();
3197
- // Enfold Theme Contact Form. Using $contact_form
3198
- }elseif(!empty($contact_form) && $contact_form == 'contact_form_enfold_theme'){
3199
- echo "<div id='ajaxresponse_1' class='ajaxresponse ajaxresponse_1' style='display: block;'><div id='ajaxresponse_1' class='ajaxresponse ajaxresponse_1'><h3 class='avia-form-success'>Antispam by CleanTalk: ".$ct_result->comment."</h3><a href='.'><-Back</a></div></div>";
3200
- die();
3201
- }else{
3202
- ct_die(null, null);
3203
- }
3204
- }
3205
- exit;
3206
- }
3207
-
3208
- return null;
3209
- }
3210
-
3211
- /**
3212
- * General test for any post data
3213
- */
3214
- function ct_contact_form_validate_postdata() {
3215
-
3216
- global $apbct, $pagenow,$cleantalk_executed;
3217
-
3218
- // Exclusios common function
3219
- if ( apbct_exclusions_check(__FUNCTION__) )
3220
- return null;
3221
-
3222
- if (@sizeof($_POST)==0 ||
3223
- (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3224
- (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3225
- (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3226
- apbct_is_in_uri('/checkout/') ||
3227
- /* WooCommerce Service Requests - skip them */
3228
- isset($_GET['wc-ajax']) && (
3229
- $_GET['wc-ajax']=='checkout' ||
3230
- $_GET['wc-ajax']=='get_refreshed_fragments' ||
3231
- $_GET['wc-ajax']=='apply_coupon' ||
3232
- $_GET['wc-ajax']=='remove_coupon' ||
3233
- $_GET['wc-ajax']=='update_shipping_method' ||
3234
- $_GET['wc-ajax']=='get_cart_totals' ||
3235
- $_GET['wc-ajax']=='update_order_review' ||
3236
- $_GET['wc-ajax']=='add_to_cart' ||
3237
- $_GET['wc-ajax']=='remove_from_cart' ||
3238
- $_GET['wc-ajax']=='get_variation' ||
3239
- $_GET['wc-ajax']=='get_customer_location'
3240
- ) ||
3241
- /* END: WooCommerce Service Requests */
3242
- apbct_is_in_uri('/wp-admin/') ||
3243
- apbct_is_in_uri('wp-login.php') ||
3244
- apbct_is_in_uri('wp-comments-post.php') ||
3245
- apbct_is_in_referer('/wp-admin/') ||
3246
- apbct_is_in_uri('/login/') ||
3247
- apbct_is_in_uri('?provider=facebook&') ||
3248
- isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3249
- isset($_POST['ct_checkjs_register_form']) ||
3250
- (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3251
- $apbct->settings['general_contact_forms_test']==0 ||
3252
- isset($_POST['bbp_topic_content']) ||
3253
- isset($_POST['bbp_reply_content']) ||
3254
- isset($_POST['fscf_submitted']) ||
3255
- isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
3256
- apbct_is_in_uri('/wc-api/') ||
3257
- (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
3258
- (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
3259
- (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
3260
- (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
3261
- apbct_is_in_uri('/wp-json/wpstatistics/v1/hit') || //WPStatistics
3262
- (isset($_POST['ihcaction']) && $_POST['ihcaction'] == 'login') || //Skip login form
3263
- (isset($_POST['action']) && $_POST['action'] == 'infinite_scroll') //Scroll
3264
- ) {
3265
- return null;
3266
- }
3267
-
3268
- $message = ct_get_fields_any_postdata($_POST);
3269
-
3270
- // ???
3271
- if(strlen(json_encode($message))<10)
3272
- return null;
3273
-
3274
- // Skip if request contains params
3275
- $skip_params = array(
3276
- 'ipn_track_id', // PayPal IPN #
3277
- 'txn_type', // PayPal transaction type
3278
- 'payment_status', // PayPal payment status
3279
- );
3280
- foreach($skip_params as $key=>$value){
3281
- if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST))
3282
- return null;
3283
- }
3284
-
3285
- $base_call_result = apbct_base_call(
3286
- array(
3287
- 'message' => $message,
3288
- 'post_info' => array('comment_type' => 'feedback_general_postdata'),
3289
- )
3290
- );
3291
-
3292
- $cleantalk_executed=true;
3293
-
3294
- $ct_result = $base_call_result['ct_result'];
3295
-
3296
- if ($ct_result->allow == 0) {
3297
-
3298
- if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
3299
- global $ct_comment;
3300
- $ct_comment = $ct_result->comment;
3301
- if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add')
3302
- {
3303
- $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
3304
- header("Content-Type: application/json");
3305
- print json_encode($result);
3306
- die();
3307
- }
3308
- else
3309
- {
3310
- ct_die(null, null);
3311
- }
3312
- } else {
3313
- echo $ct_result->comment;
3314
- }
3315
- exit;
3316
- }
3317
-
3318
- return null;
3319
- }
3320
-
3321
-
3322
- /**
3323
- * Inner function - Finds and returns pattern in string
3324
- * @return null|bool
3325
- */
3326
- function ct_get_data_from_submit($value = null, $field_name = null) {
3327
- if (!$value || !$field_name || !is_string($value)) {
3328
- return false;
3329
- }
3330
- if (preg_match("/[a-z0-9_\-]*" . $field_name. "[a-z0-9_\-]*$/", $value)) {
3331
- return true;
3332
- }
3333
- }
3334
-
3335
- /**
3336
- * Sends error notice to admin
3337
- * @return null
3338
- */
3339
- function ct_send_error_notice ($comment = '') {
3340
- global $ct_admin_notoice_period, $apbct;
3341
-
3342
- $timelabel_reg = intval( get_option('cleantalk_timelabel_reg') );
3343
- if(time() - $ct_admin_notoice_period > $timelabel_reg){
3344
- update_option('cleantalk_timelabel_reg', time());
3345
-
3346
- $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
3347
- $message = __('Attention, please!', 'cleantalk') . "\r\n\r\n";
3348
- $message .= sprintf(__('"%s" plugin error on your site "%s":', 'cleantalk'), $apbct->plugin_name, $blogname) . "\r\n\r\n";
3349
- $message .= preg_replace('/^(.*?)<a.*?"(.*?)".*?>(.*?)<.a>(.*)$/', '$1. $3: $2?user_token='. $apbct->user_token .' $4', $comment) . "\r\n\r\n";
3350
- @wp_mail(ct_get_admin_email(), sprintf(__('[%s] "%s" error!', 'cleantalk'), $apbct->plugin_name, $blogname), $message);
3351
- }
3352
-
3353
- return null;
3354
- }
3355
-
3356
- function ct_print_form($arr, $k)
3357
- {
3358
- foreach($arr as $key => $value){
3359
- if(!is_array($value)){
3360
- if($k == ''){
3361
- print '<textarea name="' . $key . '" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
3362
- }else{
3363
- print '<textarea name="' . $k . '[' . $key . ']" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
3364
- }
3365
- }else{
3366
- if($k == ''){
3367
- ct_print_form($value, $key);
3368
- }else{
3369
- ct_print_form($value, $k . '[' . $key . ']');
3370
- }
3371
- }
3372
- }
3373
- }
3374
-
3375
- /**
3376
- * Attaches public scripts and styles.
3377
- */
3378
- function ct_enqueue_scripts_public($hook){
3379
-
3380
- global $current_user, $apbct;
3381
-
3382
- if($apbct->settings['registrations_test'] || $apbct->settings['comments_test'] || $apbct->settings['contact_forms_test'] || $apbct->settings['general_contact_forms_test'] || $apbct->settings['wc_checkout_test'] || $apbct->settings['check_external'] || $apbct->settings['check_internal'] || $apbct->settings['bp_private_messages'] || $apbct->settings['general_postdata_test']){
3383
-
3384
- // Differnt JS params
3385
- wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.min.js', array('jquery'), APBCT_VERSION, false /*in header*/);
3386
-
3387
- wp_localize_script('ct_public', 'ctPublic', array(
3388
- '_ajax_nonce' => wp_create_nonce('ct_secret_stuff'),
3389
- '_ajax_url' => admin_url('admin-ajax.php'),
3390
- ));
3391
-
3392
- // GDPR script
3393
- if($apbct->settings['gdpr_enabled']){
3394
-
3395
- wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.min.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
3396
-
3397
- wp_localize_script('ct_public_gdpr', 'ctPublicGDPR', array(
3398
- 'gdpr_forms' => array(),
3399
- 'gdpr_text' => $apbct->settings['gdpr_text'] ? $apbct->settings['gdpr_text'] : __('By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.', 'cleantalk'),
3400
- ));
3401
- }
3402
-
3403
- }
3404
-
3405
- if(!defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') || (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') && CLEANTALK_AJAX_USE_FOOTER_HEADER)){
3406
- if($apbct->settings['use_ajax'] && ! apbct_is_in_uri('.xml') && ! apbct_is_in_uri('.xsl')){
3407
- if( ! apbct_is_in_uri('jm-ajax') ){
3408
-
3409
- // Use AJAX for JavaScript check
3410
- if($apbct->settings['use_ajax']){
3411
-
3412
- wp_enqueue_script('ct_nocache', plugins_url('/cleantalk-spam-protect/js/cleantalk_nocache.min.js'), array(), APBCT_VERSION, false /*in header*/);
3413
-
3414
- wp_localize_script('ct_nocache', 'ctNocache', array(
3415
- 'ajaxurl' => admin_url('admin-ajax.php'),
3416
- 'info_flag' => $apbct->settings['collect_details'] && $apbct->settings['set_cookies'] ? true : false,
3417
- 'set_cookies_flag' => $apbct->settings['set_cookies'] ? false : true,
3418
- 'blog_home' => get_home_url().'/',
3419
- ));
3420
- }
3421
-
3422
- // External forms check
3423
- if($apbct->settings['check_external'])
3424
- wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/js/cleantalk_external.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3425
-
3426
- // Internal forms check
3427
- if($apbct->settings['check_internal'])
3428
- wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/js/cleantalk_internal.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3429
-
3430
- }
3431
- }
3432
- }
3433
-
3434
- // Show controls for commentaies
3435
- if(in_array("administrator", $current_user->roles)){
3436
-
3437
- if($apbct->settings['show_check_links']){
3438
-
3439
- $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
3440
-
3441
- wp_enqueue_style ('ct_public_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-public-admin.min.css'), array(), APBCT_VERSION, 'all');
3442
- wp_enqueue_script('ct_public_admin_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-public-admin.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3443
-
3444
- wp_localize_script('ct_public_admin_js', 'ctPublicAdmin', array(
3445
- 'ct_ajax_nonce' => $ajax_nonce,
3446
- 'ajaxurl' => admin_url('admin-ajax.php'),
3447
- 'ct_feedback_error' => __('Error occured while sending feedback.', 'cleantalk'),
3448
- 'ct_feedback_no_hash' => __('Feedback wasn\'t sent. There is no associated request.', 'cleantalk'),
3449
- 'ct_feedback_msg' => sprintf(__("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk'), $apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '', $apbct->user_token ? "</a>" : ''),
3450
- ));
3451
-
3452
- }
3453
- }
3454
-
3455
- // Debug
3456
- if($apbct->settings['debug_ajax']){
3457
- wp_enqueue_script('ct_debug_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-debug-ajax.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3458
-
3459
- wp_localize_script('ct_debug_js', 'apbctDebug', array(
3460
- 'reload' => false,
3461
- 'reload_time' => 10000,
3462
- ));
3463
- }
3464
- }
3465
-
3466
- /**
3467
- * Reassign callbackback function for the bootom of comment output.
3468
- */
3469
- function ct_wp_list_comments_args($options){
3470
-
3471
- global $current_user, $apbct;
3472
-
3473
- if(in_array("administrator", $current_user->roles))
3474
- if($apbct->settings['show_check_links'])
3475
- $options['end-callback'] = 'ct_comments_output';
3476
-
3477
- return $options;
3478
- }
3479
-
3480
- /**
3481
- * Callback function for the bootom comment output.
3482
- */
3483
- function ct_comments_output($curr_comment, $param2, $wp_list_comments_args){
3484
-
3485
- $email = $curr_comment->comment_author_email;
3486
- $ip = $curr_comment->comment_author_IP;
3487
- $id = $curr_comment->comment_ID;
3488
-
3489
- $settings_link = '/wp-admin/'.(is_network_admin() ? "settings.php?page=cleantalk" : "options-general.php?page=cleantalk");
3490
-
3491
- echo "<div class='ct_comment_info'><div class ='ct_comment_titles'>";
3492
- echo "<p class='ct_comment_info_title'>".__('Sender info', 'cleantalk')."</p>";
3493
-
3494
- echo "<p class='ct_comment_logo_title'>
3495
- ".__('by', 'cleantalk')
3496
- ." <a href='{$settings_link}' target='_blank'><img class='ct_comment_logo_img' src='".plugins_url()."/cleantalk-spam-protect/inc/images/logo_color.png'></a>"
3497
- ." <a href='{$settings_link}' target='_blank'>CleanTalk</a>"
3498
- ."</p></div>";
3499
- // Outputs email if exists
3500
- if($email)
3501
- echo "<a href='https://cleantalk.org/blacklists/$email' target='_blank' title='https://cleantalk.org/blacklists/$email'>"
3502
- ."$email"
3503
- ."&nbsp;<img src='".plugins_url()."/cleantalk-spam-protect/inc/images/new_window.gif' border='0' style='float:none; box-shadow: transparent 0 0 0 !important;'/>"
3504
- ."</a>";
3505
- else
3506
- echo __('No email', 'cleantalk');
3507
- echo "&nbsp;|&nbsp;";
3508
-
3509
- // Outputs IP if exists
3510
- if($ip)
3511
- echo "<a href='https://cleantalk.org/blacklists/$ip' target='_blank' title='https://cleantalk.org/blacklists/$ip'>"
3512
- ."$ip"
3513
- ."&nbsp;<img src='".plugins_url()."/cleantalk-spam-protect/inc/images/new_window.gif' border='0' style='float:none; box-shadow: transparent 0 0 0 !important;'/>"
3514
- ."</a>";
3515
- else
3516
- echo __('No IP', 'cleantalk');
3517
- echo '&nbsp;|&nbsp;';
3518
-
3519
- echo "<span commentid='$id' class='ct_this_is ct_this_is_spam' href='#'>".__('Mark as spam', 'cleantalk')."</span>";
3520
- echo "<span commentid='$id' class='ct_this_is ct_this_is_not_spam ct_hidden' href='#'>".__('Unspam', 'cleantalk')."</span>";
3521
- echo "<p class='ct_feedback_wrap'>";
3522
- echo "<span class='ct_feedback_result ct_feedback_result_spam'>".__('Marked as spam.', 'cleantalk')."</span>";
3523
- echo "<span class='ct_feedback_result ct_feedback_result_not_spam'>".__('Marked as not spam.', 'cleantalk')."</span>";
3524
- echo "&nbsp;<span class='ct_feedback_msg'><span>";
3525
- echo "</p>";
3526
-
3527
- echo "</div>";
3528
-
3529
- // Ending comment output
3530
- echo "</{$wp_list_comments_args['style']}>";
3531
- }
3532
-
3533
- /**
3534
- * Callback function for the bootom comment output.
3535
- *
3536
- * attrs = array()
3537
- */
3538
- function apbct_shrotcode_handler__GDPR_public_notice__form( $attrs ){
3539
-
3540
- $out = '';
3541
-
3542
- if(isset($attrs['id']))
3543
- $out .= 'ctPublicGDPR.gdpr_forms.push("'.$attrs['id'].'");';
3544
-
3545
- if(isset($attrs['text']))
3546
- $out .= 'ctPublicGDPR.gdpr_text = "'.$attrs['text'].'";';
3547
-
3548
- $out = '<script>'.$out.'</script>';
3549
- return $out;
3550
- }
3551
-
3552
- /**
3553
- * Filters the 'status' array before register the user
3554
- * using only by WICITY theme
3555
- *
3556
- * @param $success array array( 'status' => 'success' )
3557
- * @param $data array ['username'] ['password'] ['email']
3558
- * @return array array( 'status' => 'error' ) or array( 'status' => 'success' ) by default
3559
- */
3560
- function apbct_wilcity_reg_validation( $success, $data ) {
3561
- $check = ct_test_registration( $data['username'], $data['email'], '' );
3562
- if( $check['allow'] == 0 ) {
3563
- return array( 'status' => 'error' );
3564
- }
3565
- return $success;
3566
- }
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Init functions
5
+ * @return mixed[] Array of options
6
+ */
7
+ function apbct_init() {
8
+
9
+ global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $test_external_forms, $cleantalk_executed, $wpdb;
10
+
11
+ //Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
12
+ if((isset($_POST['action']) && $_POST['action'] == 'ct_check_internal') &&
13
+ $apbct->settings['check_internal']
14
+ ){
15
+ $ct_result = ct_contact_form_validate();
16
+ if($ct_result == null){
17
+ echo 'true';
18
+ die();
19
+ }else{
20
+ echo $ct_result;
21
+ die();
22
+ }
23
+ }
24
+
25
+ //fix for EPM registration form
26
+ if(isset($_POST) && isset($_POST['reg_email']) && shortcode_exists( 'epm_registration_form' ))
27
+ {
28
+ unset($_POST['ct_checkjs_register_form']);
29
+ }
30
+
31
+ if(isset($_POST['_wpnonce-et-pb-contact-form-submitted']))
32
+ {
33
+ add_shortcode( 'et_pb_contact_form', 'ct_contact_form_validate' );
34
+ }
35
+
36
+ if($apbct->settings['check_external']){
37
+
38
+ // Fixing form and directs it this site
39
+ if($apbct->settings['check_external__capture_buffer'] && !is_admin() && !apbct_is_ajax() && apbct_is_user_enable() && !(defined('DOING_CRON') && DOING_CRON) && !(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
40
+ add_action('wp', 'apbct_buffer__start');
41
+ add_action('shutdown', 'apbct_buffer__end', 0);
42
+ add_action('shutdown', 'apbct_buffer__output', 2);
43
+ }
44
+
45
+ // Check and redirecct
46
+ if( apbct_is_post()
47
+ && isset($_POST['cleantalk_hidden_method'])
48
+ && isset($_POST['cleantalk_hidden_action'])
49
+ ){
50
+ $action = htmlspecialchars($_POST['cleantalk_hidden_action']);
51
+ $method = htmlspecialchars($_POST['cleantalk_hidden_method']);
52
+ unset($_POST['cleantalk_hidden_action']);
53
+ unset($_POST['cleantalk_hidden_method']);
54
+ ct_contact_form_validate();
55
+ if(!apbct_is_ajax()){
56
+ print "<html><body><form method='$method' action='$action'>";
57
+ ct_print_form($_POST, '');
58
+ print "</form></body></html>";
59
+ print "<script>
60
+ if(document.forms[0].submit !== 'undefined'){
61
+ var objects = document.getElementsByName('submit');
62
+ if(objects.length > 0)
63
+ document.forms[0].removeChild(objects[0]);
64
+ }
65
+ document.forms[0].submit();
66
+ </script>";
67
+ die();
68
+ }
69
+ }
70
+ }
71
+
72
+ if(isset($_POST['quform_ajax'], $_POST['quform_csrf_token'], $_POST['quform_form_id'])){
73
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-ajax.php');
74
+ ct_ajax_hook();
75
+ }
76
+
77
+ /**hooks for cm answers pro */
78
+ if(defined('CMA_PLUGIN_FILE')){
79
+ add_action( 'wp', 'ct_ajax_hook',1 );
80
+ }
81
+
82
+ //hook for Anonymous Post
83
+ if($apbct->settings['general_postdata_test'] == 1 && empty($_POST['ct_checkjs_cf7']))
84
+ add_action('wp', 'ct_contact_form_validate_postdata',1);
85
+
86
+ if($apbct->settings['general_contact_forms_test'] == 1 && empty($_POST['ct_checkjs_cf7'])){
87
+ add_action('CMA_custom_post_type_nav', 'ct_contact_form_validate_postdata',1);
88
+ //add_action('init','ct_contact_form_validate',1);
89
+ ct_contact_form_validate();
90
+ if(isset($_POST['reg_redirect_link'])&&isset($_POST['tmpl_registration_nonce_field']))
91
+ {
92
+ unset($_POST['ct_checkjs_register_form']);
93
+ ct_contact_form_validate();
94
+ }
95
+ /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
96
+ {
97
+ $tmp=$_POST['redirect_to'];
98
+ unset($_POST['redirect_to']);
99
+ ct_contact_form_validate();
100
+ $_POST['redirect_to']=$tmp;
101
+ }*/
102
+ }
103
+
104
+ if($apbct->settings['general_postdata_test'] == 1 && empty($_POST['ct_checkjs_cf7']))
105
+ add_action('CMA_custom_post_type_nav', 'ct_contact_form_validate_postdata',1);
106
+
107
+ //add_action('wp_footer','ct_ajaxurl');
108
+
109
+ // Fast Secure contact form
110
+ if(defined('FSCF_VERSION')){
111
+ add_filter('si_contact_display_after_fields', 'ct_si_contact_display_after_fields');
112
+ add_filter('si_contact_form_validate', 'ct_si_contact_form_validate');
113
+ }
114
+
115
+ // WooCommerce registration
116
+ if(class_exists('WooCommerce')){
117
+ add_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1, 3 );
118
+ if( isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] == 'checkout' && $apbct->settings['wc_checkout_test'] == 0 && $apbct->settings['wc_register_from_order'] == 0 ){
119
+ remove_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1 );
120
+ }
121
+ }
122
+
123
+ // WooCommerce whishlist
124
+ if(class_exists('WC_Wishlists_Wishlist'))
125
+ add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
126
+
127
+
128
+ // JetPack Contact form
129
+ $jetpack_active_modules = false;
130
+ if(defined('JETPACK__VERSION'))
131
+ {
132
+ if(isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form' ){
133
+ if(JETPACK__VERSION=='3.4-beta')
134
+ {
135
+ add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
136
+ }
137
+ else if(JETPACK__VERSION=='3.4-beta2'||JETPACK__VERSION>='3.4')
138
+ {
139
+ add_filter('jetpack_contact_form_is_spam', 'ct_contact_form_is_spam_jetpack',50,2);
140
+ }
141
+ else
142
+ {
143
+ add_filter('contact_form_is_spam', 'ct_contact_form_is_spam');
144
+ }
145
+ $jetpack_active_modules = get_option('jetpack_active_modules');
146
+ if ((class_exists( 'Jetpack', false) && $jetpack_active_modules && in_array('comments', $jetpack_active_modules)))
147
+ {
148
+ $ct_jp_comments = true;
149
+ }
150
+ }else
151
+ add_filter('grunion_contact_form_field_html', 'ct_grunion_contact_form_field_html', 10, 2);
152
+ }
153
+
154
+ // WP Maintenance Mode (wpmm)
155
+ add_action('wpmm_head', 'apbct_form__wpmm__addField', 1);
156
+
157
+ // Contact Form7
158
+ if(defined('WPCF7_VERSION')){
159
+ add_filter('wpcf7_form_elements', 'apbct_form__contactForm7__addField');
160
+ add_filter('wpcf7_validate', 'apbct_form__contactForm7__tesSpam__before_validate', 999, 2);
161
+ add_filter(WPCF7_VERSION >= '3.0.0' ? 'wpcf7_spam' : 'wpcf7_acceptance', 'apbct_form__contactForm7__testSpam');
162
+ }
163
+
164
+ // Formidable
165
+ add_filter( 'frm_entries_before_create', 'apbct_rorm__formidable__testSpam', 10, 2 );
166
+ add_action( 'frm_entries_footer_scripts', 'apbct_rorm__formidable__footerScripts', 20, 2 );
167
+
168
+ // BuddyPress
169
+ if(class_exists('BuddyPress')){
170
+ add_action('bp_before_registration_submit_buttons','ct_register_form',1);
171
+ add_action('messages_message_before_save', 'apbct_integration__buddyPres__private_msg_check', 1);
172
+ add_filter('bp_signup_validate', 'ct_registration_errors',1);
173
+ add_filter('bp_signup_validate', 'ct_check_registration_erros', 999999);
174
+ }
175
+
176
+ if(defined('PROFILEPRESS_SYSTEM_FILE_PATH')){
177
+ add_filter('pp_registration_validation', 'ct_registration_errors_ppress', 11, 2);
178
+ }
179
+
180
+
181
+ // bbPress
182
+ if(class_exists('bbPress')){
183
+ add_filter('bbp_new_topic_pre_title', 'ct_bbp_get_topic', 1);
184
+ add_filter('bbp_new_topic_pre_content', 'ct_bbp_new_pre_content', 1);
185
+ add_filter('bbp_new_reply_pre_content', 'ct_bbp_new_pre_content', 1);
186
+ add_action('bbp_theme_before_topic_form_content', 'ct_comment_form');
187
+ add_action('bbp_theme_before_reply_form_content', 'ct_comment_form');
188
+ }
189
+
190
+ //Custom Contact Forms
191
+ if(defined('CCF_VERSION'))
192
+ add_filter('ccf_field_validator', 'ct_ccf', 1, 4);
193
+
194
+ add_action('comment_form', 'ct_comment_form');
195
+
196
+ // intercept WordPress Landing Pages POST
197
+ if (defined('LANDINGPAGES_CURRENT_VERSION') && !empty($_POST)){
198
+ if(array_key_exists('action', $_POST) && $_POST['action'] === 'inbound_store_lead'){ // AJAX action(s)
199
+ ct_check_wplp();
200
+ }else if(array_key_exists('inbound_submitted', $_POST) && $_POST['inbound_submitted'] == '1'){ // Final submit
201
+ ct_check_wplp();
202
+ }
203
+ }
204
+
205
+ // S2member. intercept POST
206
+ if (defined('WS_PLUGIN__S2MEMBER_PRO_VERSION')){
207
+ $post_keys = array_keys($_POST);
208
+ foreach($post_keys as $post_key){
209
+
210
+ // Detect POST keys like /s2member_pro.*registration/
211
+ if(strpos($post_key, 's2member') !== false && strpos($post_key, 'registration') !== false){
212
+ ct_s2member_registration_test($post_key);
213
+ break;
214
+ }
215
+ }
216
+ }
217
+
218
+ // New user approve hack
219
+ // https://wordpress.org/plugins/new-user-approve/
220
+ if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
221
+ add_action('register_post', 'ct_register_post', 1, 3);
222
+ }
223
+
224
+ // Wilcity theme registration validation fix
225
+ add_filter( 'wilcity/filter/wiloke-listing-tools/validate-before-insert-account', 'apbct_wilcity_reg_validation', 10, 2 );
226
+
227
+
228
+ // Gravity forms
229
+ if (defined('GF_MIN_WP_VERSION')) {
230
+ add_filter('gform_get_form_filter', 'apbct_form__gravityForms__addField', 10, 2);
231
+ add_filter('gform_entry_is_spam', 'apbct_form__gravityForms__testSpam', 999, 3);
232
+ add_filter('gform_confirmation', 'apbct_form__gravityForms__showResponse', 999, 4 );
233
+ }
234
+
235
+ //Pirate forms
236
+ if(defined('PIRATE_FORMS_VERSION')){
237
+ if(isset($_POST['pirate-forms-contact-name']) && $_POST['pirate-forms-contact-name'] && isset($_POST['pirate-forms-contact-email']) && $_POST['pirate-forms-contact-email'])
238
+ apbct_form__piratesForm__testSpam();
239
+ }
240
+
241
+ // WPForms
242
+ // Adding fields
243
+ add_action('wpforms_frontend_output', 'apbct_form__WPForms__addField', 1000, 5);
244
+ // Gathering data to validate
245
+ add_filter('wpforms_process_before_filter', 'apbct_from__WPForms__gatherData', 100, 2);
246
+ // Do spam check
247
+ add_filter('wpforms_process_initial_errors', 'apbct_form__WPForms__showResponse', 100, 2);
248
+
249
+ // QForms integration
250
+ add_filter( 'quform_post_validate', 'ct_quform_post_validate', 10, 2 );
251
+
252
+ // Ultimate Members
253
+ if (class_exists('UM')) {
254
+ add_action('um_main_register_fields','ct_register_form',100); // Add hidden fileds
255
+ add_action( 'um_submit_form_register', 'apbct_registration__UltimateMembers__check', 9, 1 ); // Check submition
256
+ }
257
+
258
+ // Paid Memberships Pro integration
259
+ add_filter( 'pmpro_required_user_fields', function( $pmpro_required_user_fields ){
260
+
261
+ if(
262
+ ! empty( $pmpro_required_user_fields['username'] ) &&
263
+ ! empty( $pmpro_required_user_fields['bemail'] ) &&
264
+ ! empty( $pmpro_required_user_fields['bconfirmemail'] ) &&
265
+ $pmpro_required_user_fields['bemail'] == $pmpro_required_user_fields['bconfirmemail']
266
+ ) {
267
+ $check = ct_test_registration( $pmpro_required_user_fields['username'], $pmpro_required_user_fields['bemail'], apbct_get_server_variable( 'REMOTE_ADDR' ) );
268
+ if( $check['allow'] == 0 ) {
269
+ pmpro_setMessage( $check['comment'], 'pmpro_error' );
270
+ }
271
+ }
272
+
273
+ return $pmpro_required_user_fields;
274
+
275
+ } );
276
+
277
+ //
278
+ // Load JS code to website footer
279
+ //
280
+ if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
281
+ add_action('wp_head', 'apbct_hook__wp_head__set_cookie__ct_checkjs', 1);
282
+ add_action('wp_footer', 'apbct_hook__wp_footer', 1);
283
+ }
284
+
285
+ if ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) {
286
+ ct_contact_form_validate();
287
+ }
288
+
289
+ if (apbct_is_user_enable()) {
290
+
291
+ if ($apbct->settings['general_contact_forms_test'] == 1 && !isset($_POST['comment_post_ID']) && !isset($_GET['for'])){
292
+ add_action( 'init', 'ct_contact_form_validate', 999 );
293
+ }
294
+ if( apbct_is_post() &&
295
+ $apbct->settings['general_postdata_test'] == 1 &&
296
+ !isset($_POST['ct_checkjs_cf7']) &&
297
+ !is_admin() &&
298
+ !apbct_is_user_role_in(array('administrator', 'moderator'))
299
+ ){
300
+ ct_contact_form_validate_postdata();
301
+ }
302
+ }
303
+ }
304
+
305
+ function apbct_buffer__start(){
306
+ ob_start();
307
+ }
308
+
309
+ function apbct_buffer__end(){
310
+
311
+ if(!ob_get_level())
312
+ return;
313
+
314
+ global $apbct;
315
+ $apbct->buffer = ob_get_contents();
316
+ ob_end_clean();
317
+ }
318
+
319
+ /**
320
+ * Outputs changed buffer
321
+ *
322
+ * @global $apbct
323
+ */
324
+ function apbct_buffer__output(){
325
+
326
+ global $apbct;
327
+
328
+ if(empty($apbct->buffer))
329
+ return;
330
+
331
+ $site_url = get_option('siteurl');
332
+ $site__host = parse_url($site_url, PHP_URL_HOST);
333
+
334
+ $dom = new DOMDocument();
335
+ @$dom->loadHTML($apbct->buffer);
336
+
337
+ $forms = $dom->getElementsByTagName('form');
338
+
339
+ foreach($forms as $form){
340
+
341
+ $action = $form->getAttribute('action');
342
+ $action = $action ? $action : $site_url;
343
+ $action__host = parse_url($action, PHP_URL_HOST);
344
+
345
+ // Check if the form directed to the third party site
346
+ if($site__host != $action__host){
347
+
348
+ $method = $form->getAttribute('method');
349
+ $method = $method ? $method : 'get';
350
+ // Directs form to our site
351
+ $form->setAttribute('method', 'POST');
352
+ $form->setAttribute('action', $site_url);
353
+
354
+ // Add cleantalk_hidden_action
355
+ $new_input = $dom->createElement('input');
356
+ $new_input->setAttribute('type', 'hidden');
357
+ $new_input->setAttribute('name', 'cleantalk_hidden_action');
358
+ $new_input->setAttribute('value', $action);
359
+ $form->appendChild($new_input);
360
+
361
+ // Add cleantalk_hidden_method
362
+ $new_input = $dom->createElement('input');
363
+ $new_input->setAttribute('type', 'hidden');
364
+ $new_input->setAttribute('name', 'cleantalk_hidden_method');
365
+ $new_input->setAttribute('value', $method);
366
+ $form->appendChild($new_input);
367
+
368
+ }
369
+ } unset($form);
370
+
371
+ $html = $dom->getElementsByTagName('html');
372
+
373
+ echo gettype($html) == 'object' && !isset( $html[0], $html[0]->childNodes, $html[0]->childNodes[0] )
374
+ ? $html[0]
375
+ ->childNodes[0]
376
+ ->ownerDocument
377
+ ->saveHTML()
378
+ : $apbct->buffer;
379
+ }
380
+
381
+ // MailChimp Premium for Wordpress
382
+ function ct_add_mc4wp_error_message($messages){
383
+
384
+ $messages['ct_mc4wp_response'] = array(
385
+ 'type' => 'error',
386
+ 'text' => 'Your message looks like spam.'
387
+ );
388
+ return $messages;
389
+ }
390
+ add_filter( 'mc4wp_form_messages', 'ct_add_mc4wp_error_message' );
391
+
392
+ /*
393
+ * Function to set validate fucntion for CCF form
394
+ * Input - Сonsistently each form field
395
+ * Returns - String. Validate function
396
+ */
397
+ function ct_ccf($callback, $value, $field_id, $type){
398
+ /*
399
+ if($type == 'name')
400
+ $ct_global_temporary_data['name'] = $value;
401
+ elseif($type == 'email')
402
+ $ct_global_temporary_data['email'] = $value;
403
+ else
404
+ $ct_global_temporary_data[] = $value;
405
+ //*/
406
+ return 'ct_validate_ccf_submission';
407
+ }
408
+ /*
409
+ * Validate function for CCF form. Gatheering data. Multiple calls.
410
+ * Input - void. Global $ct_global_temporary_data
411
+ * Returns - String. CleanTalk comment.
412
+ */
413
+ $ct_global_temporary_data = array();
414
+ function ct_validate_ccf_submission($value, $field_id, $required){
415
+ global $ct_global_temporary_data, $apbct;
416
+
417
+
418
+
419
+ //If the check for contact forms enabled
420
+ if(!$apbct->settings['contact_forms_test'])
421
+ return true;
422
+ //If the check for logged in users enabled
423
+ if($apbct->settings['protect_logged_in'] == 1 && is_user_logged_in())
424
+ return true;
425
+
426
+ //Accumulate data
427
+ $ct_global_temporary_data[] = $value;
428
+
429
+ //If it's the last field of the form
430
+ (!isset($ct_global_temporary_data['count']) ? $ct_global_temporary_data['count'] = 1 : $ct_global_temporary_data['count']++);
431
+ $form_id = $_POST['form_id'];
432
+ if($ct_global_temporary_data['count'] != count(get_post_meta( $form_id, 'ccf_attached_fields', true )))
433
+ return true;
434
+ unset($ct_global_temporary_data['count']);
435
+
436
+ //Getting request params
437
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
438
+
439
+ unset($ct_global_temporary_data);
440
+
441
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
442
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
443
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
444
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
445
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
446
+
447
+ if ($subject != '')
448
+ $message['subject'] = $subject;
449
+
450
+ $post_info['comment_type'] = 'feedback_custom_contact_forms';
451
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
452
+
453
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
454
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
455
+ : apbct_js_test('ct_checkjs', $_POST);
456
+
457
+ //Making a call
458
+ $base_call_result = apbct_base_call(
459
+ array(
460
+ 'message' => $message,
461
+ 'sender_email' => $sender_email,
462
+ 'sender_nickname' => $sender_nickname,
463
+ 'post_info' => $post_info,
464
+ 'js_on' => $checkjs,
465
+ 'sender_info' => array('sender_url' => null),
466
+ )
467
+ );
468
+
469
+ $ct_result = $base_call_result['ct_result'];
470
+
471
+ return $ct_result->allow == 0 ? $ct_result->comment : true;;
472
+ }
473
+
474
+ function ct_woocommerce_wishlist_check($args){
475
+ global $apbct;
476
+
477
+
478
+
479
+ //Protect logged in users
480
+ if($args['wishlist_status'])
481
+ if($apbct->settings['protect_logged_in'] == 0)
482
+ return $args;
483
+
484
+ //If the IP is a Google bot
485
+ $hostname = gethostbyaddr( apbct_get_server_variable( 'REMOTE_ADDR' ) );
486
+ if(!strpos($hostname, 'googlebot.com'))
487
+ return $args;
488
+
489
+ //Getting request params
490
+ $message = '';
491
+ $subject = '';
492
+ $email = $args['wishlist_owner_email'];
493
+ if($args['wishlist_first_name']!='' || $args['wishlist_last_name']!='')
494
+ $nickname = trim($args['wishlist_first_name']." ".$args['wishlist_last_name']);
495
+ else
496
+ $nickname = '';
497
+
498
+ $post_info['comment_type'] = 'feedback';
499
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
500
+
501
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
502
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
503
+ : apbct_js_test('ct_checkjs', $_POST);
504
+
505
+ //Making a call
506
+ $base_call_result = apbct_base_call(
507
+ array(
508
+ 'message' => $subject." ".$message,
509
+ 'sender_email' => $email,
510
+ 'sender_nickname' => $nickname,
511
+ 'post_info' => $post_info,
512
+ 'js_on' => $checkjs,
513
+ 'sender_info' => array('sender_url' => null),
514
+ )
515
+ );
516
+
517
+ $ct_result = $base_call_result['ct_result'];
518
+
519
+ if ($ct_result->allow == 0)
520
+ wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
521
+ else
522
+ return $args;
523
+ }
524
+
525
+ function apbct_integration__buddyPres__getTemplateName( $located, $template_name, $template_names, $template_locations, $load, $require_once ) {
526
+ global $apbct;
527
+ preg_match("/\/([a-z-_]+)\/buddypress-functions\.php$/", $located, $matches);
528
+ $apbct->buddy_press_tmpl = isset($matches[1]) ? $matches[1] : 'unknown';
529
+ }
530
+
531
+ /**
532
+ * Test BuddyPress activity for spam (post update only)
533
+ *
534
+ * @global SpbcState $apbct
535
+ * @param bool $is_spam
536
+ * @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
537
+ * @return boolean Spam flag
538
+ */
539
+ function apbct_integration__buddyPres__activityWall( $is_spam, $activity_obj = null ){
540
+
541
+ global $apbct;
542
+
543
+ if($activity_obj === null || $activity_obj->privacy == 'media' || !isset($_POST['action']) || $_POST['action'] && $_POST['action'] !== 'post_update')
544
+ return;
545
+
546
+ $curr_user = get_user_by('id', $activity_obj->user_id);
547
+
548
+ //Making a call
549
+ $base_call_result = apbct_base_call(
550
+ array(
551
+ 'message' => is_string($activity_obj->content) ? $activity_obj->content : '',
552
+ 'sender_email' => $curr_user->data->user_email,
553
+ 'sender_nickname' => $curr_user->data->user_login,
554
+ 'post_info' => array(
555
+ 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
556
+ 'comment_type' => 'buddypress_activitywall',
557
+ ),
558
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
559
+ 'sender_info' => array('sender_url' => null),
560
+ )
561
+ );
562
+
563
+ $ct_result = $base_call_result['ct_result'];
564
+
565
+ if ($ct_result->allow == 0){
566
+ add_action('bp_activity_after_save', 'apbct_integration__buddyPres__activityWall_showResponse', 1, 1);
567
+ $apbct->spam_notification = $ct_result->comment;
568
+ return true;
569
+ }else
570
+ return $is_spam;
571
+ }
572
+
573
+ /**
574
+ * Outputs message to AJAX frontend handler
575
+ *
576
+ * @global SpbcState $apbct
577
+ * @param BP_Activity_Activity $activity_obj Activity object (\plugins\buddypress\bp-activity\classes\class-bp-activity-activity.php)
578
+ */
579
+ function apbct_integration__buddyPres__activityWall_showResponse( $activity_obj ){
580
+
581
+ global $apbct;
582
+
583
+ // Legacy template
584
+ if($apbct->buddy_press_tmpl === 'bp-legacy'){
585
+ die('<div id="message" class="error bp-ajax-message"><p>'. $apbct->spam_notification .'</p></div>');
586
+ // Nouveau tamplate and others
587
+ }else{
588
+ @header( 'Content-Type: application/json; charset=' . get_option('blog_charset'));
589
+ die(json_encode(array(
590
+ 'success' => false,
591
+ 'data' => array('message' => $apbct->spam_notification),
592
+ )));
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Public function - Tests new private messages (dialogs)
598
+ *
599
+ * @global SpbcState $apbct
600
+ * @param type $bp_message_obj
601
+ * @return array with errors if spam has found
602
+ */
603
+ function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
604
+
605
+ global $apbct;
606
+
607
+ //Check for enabled option
608
+ if($apbct->settings['bp_private_messages'] == 0)
609
+ return;
610
+
611
+ //Check for quantity of comments
612
+ $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER')
613
+ ? CLEANTALK_CHECK_COMMENTS_NUMBER
614
+ : 3;
615
+
616
+ if($apbct->settings['check_comments_number']){
617
+ $args = array(
618
+ 'user_id' => $bp_message_obj->sender_id,
619
+ 'box' => 'sentbox',
620
+ 'type' => 'all',
621
+ 'limit' => $comments_check_number,
622
+ 'page' => null,
623
+ 'search_terms' => '',
624
+ 'meta_query' => array()
625
+ );
626
+ $sentbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
627
+ $cnt_sentbox_msgs = $sentbox_msgs['total'];
628
+ $args['box'] = 'inbox';
629
+ $inbox_msgs = BP_Messages_Thread::get_current_threads_for_user($args);
630
+ $cnt_inbox_msgs = $inbox_msgs['total'];
631
+
632
+ if(($cnt_inbox_msgs + $cnt_sentbox_msgs) >= $comments_check_number)
633
+ $is_max_comments = true;
634
+ }
635
+
636
+ if(!empty($is_max_comments))
637
+ return;
638
+
639
+ $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
640
+
641
+ //Making a call
642
+ $base_call_result = apbct_base_call(
643
+ array(
644
+ 'message' => $bp_message_obj->subject." ".$bp_message_obj->message,
645
+ 'sender_email' => $sender_user_obj->data->user_email,
646
+ 'sender_nickname' => $sender_user_obj->data->user_login,
647
+ 'post_info' => array(
648
+ 'comment_type' => 'buddypress_comment',
649
+ 'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ),
650
+ ),
651
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE)
652
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
653
+ : apbct_js_test('ct_checkjs', $_POST),
654
+ 'sender_info' => array('sender_url' => null),
655
+ )
656
+ );
657
+
658
+ $ct_result = $base_call_result['ct_result'];
659
+
660
+ if ($ct_result->allow == 0)
661
+ wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
662
+ }
663
+
664
+ /**
665
+ * Adds hiden filed to deafualt serach form
666
+ *
667
+ * @param $form string
668
+ * @return string
669
+ */
670
+ function apbct_forms__search__addField( $form ){
671
+ global $apbct;
672
+ if($apbct->settings['search_test'] == 1){
673
+ $js_filed = ct_add_hidden_fields('ct_checkjs_search_default', true, false, false, false);
674
+ $form = str_replace('</form>', $js_filed, $form);
675
+ }
676
+ return $form;
677
+ }
678
+
679
+ /**
680
+ * Test default search string for spam
681
+ *
682
+ * @param $search string
683
+ * @return string
684
+ */
685
+ function apbct_forms__search__testSpam( $search ){
686
+
687
+ global $apbct, $cleantalk_executed;
688
+
689
+ if(
690
+ empty($search) ||
691
+ $cleantalk_executed ||
692
+ $apbct->settings['search_test'] == 0 ||
693
+ $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
694
+ ){
695
+ return $search;
696
+ }
697
+
698
+ if(apbct_is_user_logged_in())
699
+ $user = wp_get_current_user();
700
+
701
+ $base_call_result = apbct_base_call(
702
+ array(
703
+ 'message' => $search,
704
+ 'sender_email' => !empty($user) ? $user->user_email : null,
705
+ 'sender_nickname' => !empty($user) ? $user->user_login : null,
706
+ 'post_info' => array('comment_type' => 'site_search_wordpress'),
707
+ //'js_on' => apbct_js_test('ct_checkjs_search_default', $_GET, true),
708
+ )
709
+ );
710
+ $ct_result = $base_call_result['ct_result'];
711
+
712
+ $cleantalk_executed = true;
713
+
714
+ if ($ct_result->allow == 0){
715
+ die($ct_result->comment);
716
+ }
717
+
718
+ return $search;
719
+ }
720
+
721
+ /**
722
+ * Public function - Tests for Pirate contact froms
723
+ * return NULL
724
+ */
725
+ function apbct_form__piratesForm__testSpam(){
726
+
727
+ global $apbct;
728
+
729
+ //Check for enabled option
730
+ if( !$apbct->settings['contact_forms_test'])
731
+ return;
732
+
733
+ //Getting request params
734
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
735
+
736
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
737
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
738
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
739
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
740
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
741
+
742
+ if($subject != '')
743
+ $message = array_merge(array('subject' => $subject), $message);
744
+
745
+ $post_info['comment_type'] = 'contact_form_wordpress_feedback_pirate';
746
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
747
+
748
+ //Making a call
749
+ $base_call_result = apbct_base_call(
750
+ array(
751
+ 'message' => $message,
752
+ 'sender_email' => $sender_email,
753
+ 'sender_nickname' => $sender_nickname,
754
+ 'post_info' => $post_info,
755
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
756
+ 'sender_info' => array('sender_url' => null),
757
+ )
758
+ );
759
+
760
+ $ct_result = $base_call_result['ct_result'];
761
+
762
+ if ($ct_result->allow == 0)
763
+ wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
764
+ }
765
+
766
+ /**
767
+ * Adds hidden filed to comment form
768
+ */
769
+ function ct_comment_form($post_id){
770
+
771
+ global $apbct;
772
+
773
+ if (apbct_is_user_enable() === false) {
774
+ return false;
775
+ }
776
+
777
+ if ( !$apbct->settings['comments_test']) {
778
+ return false;
779
+ }
780
+
781
+ ct_add_hidden_fields('ct_checkjs', false, false);
782
+
783
+ return null;
784
+ }
785
+
786
+ /**
787
+ * Adds cookie script filed to head
788
+ */
789
+ function apbct_hook__wp_head__set_cookie__ct_checkjs() {
790
+
791
+ ct_add_hidden_fields('ct_checkjs', false, true, true);
792
+
793
+ return null;
794
+ }
795
+
796
+ /**
797
+ * Adds cookie script filed to footer
798
+ */
799
+ function apbct_hook__wp_footer() {
800
+
801
+ //ct_add_hidden_fields(true, 'ct_checkjs', false, true, true);
802
+
803
+ return null;
804
+ }
805
+
806
+ /**
807
+ * Adds hidden filed to define avaialbility of client's JavaScript
808
+ * @param bool $random_key switch on generation random key for every page load
809
+ */
810
+ function ct_add_hidden_fields($field_name = 'ct_checkjs', $return_string = false, $cookie_check = false, $no_print = false, $ajax = true) {
811
+
812
+ global $ct_checkjs_def, $apbct;
813
+
814
+ $ct_checkjs_key = ct_get_checkjs_value();
815
+ $field_id_hash = md5(rand(0, 1000));
816
+
817
+ // Using only cookies
818
+ if ($cookie_check && $apbct->settings['set_cookies'] == 1) {
819
+
820
+ $html = "<script type='text/javascript'>
821
+ function ctSetCookie(c_name, value, def_value){
822
+ document.cookie = c_name + '=' + escape(value) + '; path=/';
823
+ }
824
+ ctSetCookie('{$field_name}', '{$ct_checkjs_key}', '{$ct_checkjs_def}');
825
+ </script>";
826
+
827
+ // Using AJAX to get key
828
+ }elseif($apbct->settings['use_ajax'] && $ajax){
829
+
830
+ // Fix only for wp_footer -> apbct_hook__wp_head__set_cookie__ct_checkjs()
831
+ if($no_print)
832
+ return;
833
+
834
+ $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
835
+ $field_id = $field_name . '_' . $field_id_hash;
836
+ $html = "<input type='hidden' id='{$field_id}' name='{$field_name}' value='{$ct_checkjs_def}' />
837
+ <script type='text/javascript'>
838
+ window.addEventListener('load', function () {
839
+ setTimeout(function(){
840
+ apbct_sendAJAXRequest(
841
+ {action: 'apbct_js_keys__get'},
842
+ {callback: apbct_js_keys__set_input_value, input_name: '{$field_id}'}
843
+ );
844
+ }, 1000);
845
+ });
846
+ </script>";
847
+
848
+ // Set KEY from backend
849
+ }else{
850
+ // Fix only for wp_footer -> apbct_hook__wp_head__set_cookie__ct_checkjs()
851
+ if($no_print)
852
+ return;
853
+
854
+ $ct_input_challenge = sprintf("'%s'", $ct_checkjs_key);
855
+ $field_id = $field_name . '_' . $field_id_hash;
856
+ $html = "<input type='hidden' id='{$field_id}' name='{$field_name}' value='{$ct_checkjs_def}' />
857
+ <script type='text/javascript'>
858
+ setTimeout(function(){
859
+ var ct_input_name = '{$field_id}';
860
+ if (document.getElementById(ct_input_name) !== null) {
861
+ var ct_input_value = document.getElementById(ct_input_name).value;
862
+ document.getElementById(ct_input_name).value = document.getElementById(ct_input_name).value.replace(ct_input_value, {$ct_input_challenge});
863
+ }
864
+ }, 1000);
865
+ </script>";
866
+ }
867
+
868
+ // Simplify JS code and Fixing issue with wpautop()
869
+ $html = str_replace(array("\n","\r","\t"),'', $html);
870
+
871
+ if ($return_string === true) {
872
+ return $html;
873
+ } else {
874
+ echo $html;
875
+ }
876
+ }
877
+
878
+ /**
879
+ * Public function - Insert JS code for spam tests
880
+ * return null;
881
+ */
882
+ function apbct_rorm__formidable__footerScripts($fields, $form) {
883
+
884
+ global $apbct, $ct_checkjs_frm;
885
+
886
+ if ( !$apbct->settings['contact_forms_test'])
887
+ return false;
888
+
889
+ $ct_checkjs_key = ct_get_checkjs_value();
890
+ $ct_frm_base_name = 'form_';
891
+ $ct_frm_name = $ct_frm_base_name . $form->form_key;
892
+
893
+ echo "var input = document.createElement('input');
894
+ input.setAttribute('type', 'hidden');
895
+ input.setAttribute('name', '$ct_checkjs_frm');
896
+ input.setAttribute('value', '$ct_checkjs_key');
897
+ for (i = 0; i < document.forms.length; i++) {
898
+ if (typeof document.forms[i].id == 'string'){
899
+ if(document.forms[i].id.search('$ct_frm_name') != -1) {
900
+ document.forms[i].appendChild(input);
901
+ }
902
+ }
903
+ }";
904
+
905
+ /* Excessive cookie set
906
+ $js_code = ct_add_hidden_fields(true, 'ct_checkjs', true, true);
907
+ $js_code = strip_tags($js_code); // Removing <script> tag
908
+ echo $js_code;
909
+ //*/
910
+ }
911
+
912
+ /**
913
+ * Public function - Test Formidable data for spam activity
914
+ * @param $errors
915
+ * @param $form
916
+ *
917
+ * @return array with errors if spam has found
918
+ */
919
+ function apbct_rorm__formidable__testSpam ( $errors, $form ) {
920
+
921
+ global $apbct;
922
+
923
+ if ( !$apbct->settings['contact_forms_test']) {
924
+ return $errors;
925
+ }
926
+
927
+ // Skip processing for logged in users.
928
+ if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in()) {
929
+ return $errors;
930
+ }
931
+
932
+ $ct_temp_msg_data = ct_get_fields_any($_POST['item_meta']);
933
+
934
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
935
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
936
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
937
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
938
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
939
+
940
+ // Adding 'input_meta[]' to every field /Formidable fix/
941
+ $message = array_flip($message);
942
+ foreach($message as &$value){
943
+ $value = 'item_meta['.$value.']';
944
+ } unset($value);
945
+ $message = array_flip($message);
946
+
947
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
948
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
949
+ : apbct_js_test('ct_checkjs', $_POST);
950
+
951
+ $base_call_result = apbct_base_call(
952
+ array(
953
+ 'message' => $message,
954
+ 'sender_email' => $sender_email,
955
+ 'sender_nickname' => $sender_nickname,
956
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_formidable'),
957
+ 'js_on' => $checkjs
958
+ )
959
+ );
960
+ $ct_result = $base_call_result['ct_result'];
961
+
962
+ if ($ct_result->allow == 0) {
963
+ $errors['ct_error'] = '<br /><b>' . $ct_result->comment . '</b><br /><br />';
964
+ }
965
+
966
+ return $errors;
967
+ }
968
+
969
+ /**
970
+ * Public filter 'bbp_*' - Get new topic name to global $ct_bbp_topic
971
+ * @param mixed[] $comment Comment string
972
+ * @return mixed[] $comment Comment string
973
+ */
974
+ function ct_bbp_get_topic($topic){
975
+ global $ct_bbp_topic;
976
+
977
+ $ct_bbp_topic=$topic;
978
+
979
+ return $topic;
980
+ }
981
+
982
+ /**
983
+ * Public filter 'bbp_*' - Checks topics, replies by cleantalk
984
+ * @param mixed[] $comment Comment string
985
+ * @return mixed[] $comment Comment string
986
+ */
987
+ function ct_bbp_new_pre_content ($comment) {
988
+
989
+ global $apbct, $current_user;
990
+
991
+ if ( !$apbct->settings['comments_test']) {
992
+ return $comment;
993
+ }
994
+
995
+ // Skip processing for logged in users and admin.
996
+ if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in() ||
997
+ in_array("administrator", $current_user->roles))
998
+ return $comment;
999
+
1000
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
1001
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
1002
+ : apbct_js_test('ct_checkjs', $_POST);
1003
+
1004
+ $post_info['comment_type'] = 'bbpress_comment';
1005
+ $post_info['post_url'] = bbp_get_topic_permalink();
1006
+
1007
+ if( is_user_logged_in() ) {
1008
+ $sender_email = $current_user->user_email;
1009
+ $sender_nickname = $current_user->display_name;
1010
+ } else {
1011
+ $sender_email = isset($_POST['bbp_anonymous_email']) ? $_POST['bbp_anonymous_email'] : null;
1012
+ $sender_nickname = isset($_POST['bbp_anonymous_name']) ? $_POST['bbp_anonymous_name'] : null;
1013
+ }
1014
+
1015
+ $base_call_result = apbct_base_call(
1016
+ array(
1017
+ 'message' => $comment,
1018
+ 'sender_email' => $sender_email,
1019
+ 'sender_nickname' => $sender_nickname,
1020
+ 'post_info' => $post_info,
1021
+ 'js_on' => $checkjs,
1022
+ 'sender_info' => array('sender_url' => isset($_POST['bbp_anonymous_website']) ? $_POST['bbp_anonymous_website'] : null),
1023
+ )
1024
+ );
1025
+ $ct_result = $base_call_result['ct_result'];
1026
+
1027
+ if ($ct_result->allow == 0) {
1028
+ bbp_add_error('bbp_reply_content', $ct_result->comment);
1029
+ }
1030
+
1031
+ return $comment;
1032
+ }
1033
+
1034
+ function apbct_comment__sanitize_data__before_wp_die($function){
1035
+
1036
+ global $apbct;
1037
+
1038
+ $comment_data = wp_unslash($_POST);
1039
+
1040
+ $user_ID = 0;
1041
+
1042
+ $comment_type = '';
1043
+
1044
+ $comment_content = isset($comment_data['comment']) ? (string) $comment_data['comment'] : null;
1045
+ $comment_parent = isset($comment_data['comment_parent']) ? (int) absint($comment_data['comment_parent']) : null;
1046
+
1047
+ $comment_author = isset($comment_data['author']) ? (string) trim(strip_tags($comment_data['author'])) : null;
1048
+ $comment_author_email = isset($comment_data['email']) ? (string) trim($comment_data['email']) : null;
1049
+ $comment_author_url = isset($comment_data['url']) ? (string) trim($comment_data['url']) : null;
1050
+ $comment_post_ID = isset($comment_data['comment_post_ID']) ? (int) $comment_data['comment_post_ID'] : null;
1051
+
1052
+ if(isset($comment_content, $comment_parent)){
1053
+
1054
+ $user = wp_get_current_user();
1055
+
1056
+ if($user->exists()){
1057
+ $comment_author = empty($user->display_name) ? $user->user_login : $user->display_name;
1058
+ $comment_author_email = $user->user_email;
1059
+ $comment_author_url = $user->user_url;
1060
+ $user_ID = $user->ID;
1061
+ }
1062
+
1063
+ $apbct->comment_data = compact(
1064
+ 'comment_post_ID',
1065
+ 'comment_author',
1066
+ 'comment_author_email',
1067
+ 'comment_author_url',
1068
+ 'comment_content',
1069
+ 'comment_type',
1070
+ 'comment_parent',
1071
+ 'user_ID'
1072
+ );
1073
+
1074
+ $function = 'apbct_comment__check_via_wp_die';
1075
+
1076
+ }
1077
+
1078
+ return $function;
1079
+ }
1080
+
1081
+ function apbct_comment__check_via_wp_die($message, $title, $args){
1082
+ if($title == __('Comment Submission Failure')){
1083
+ global $apbct;
1084
+ $apbct->validation_error = $message;
1085
+ ct_preprocess_comment($apbct->comment_data);
1086
+ }
1087
+ _default_wp_die_handler($message, $title, $args);
1088
+ }
1089
+
1090
+ /**
1091
+ * Public filter 'preprocess_comment' - Checks comment by cleantalk server
1092
+ * @param mixed[] $comment Comment data array
1093
+ * @return mixed[] New data array of comment
1094
+ */
1095
+ function ct_preprocess_comment($comment) {
1096
+ // this action is called just when WP process POST request (adds new comment)
1097
+ // this action is called by wp-comments-post.php
1098
+ // after processing WP makes redirect to post page with comment's form by GET request (see above)
1099
+ global $current_user, $comment_post_id, $ct_comment_done, $ct_jp_comments, $apbct;
1100
+
1101
+ // Send email notification for chosen groups of users
1102
+ if($apbct->settings['comment_notify'] && !empty($apbct->settings['comment_notify__roles']) && $apbct->data['moderate']){
1103
+
1104
+ add_filter('notify_post_author', 'apbct_comment__Wordpress__doNotify', 100, 2);
1105
+
1106
+ $users = get_users(array(
1107
+ 'role__in' => $apbct->settings['comment_notify__roles'],
1108
+ 'fileds' => array('user_email')
1109
+ ));
1110
+
1111
+ if($users){
1112
+ add_filter('comment_notification_text', 'apbct_comment__Wordpress__changeMailNotificationGroups', 100, 2);
1113
+ add_filter('comment_notification_recipients', 'apbct_comment__Wordpress__changeMailNotificationRecipients', 100, 2);
1114
+ foreach($users as $user){
1115
+ $emails[] = $user->user_email;
1116
+ }
1117
+ $apbct->comment_notification_recipients = json_encode($emails);
1118
+ }
1119
+ }
1120
+
1121
+ // Skip processing admin.
1122
+ if (in_array("administrator", $current_user->roles))
1123
+ return $comment;
1124
+
1125
+ $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3;
1126
+
1127
+ if($apbct->settings['check_comments_number']){
1128
+ $args = array(
1129
+ 'author_email' => $comment['comment_author_email'],
1130
+ 'status' => 'approve',
1131
+ 'count' => false,
1132
+ 'number' => $comments_check_number,
1133
+ );
1134
+ $cnt = count(get_comments($args));
1135
+ $is_max_comments = $cnt >= $comments_check_number ? true : false;
1136
+ }
1137
+
1138
+ if (
1139
+ ($comment['comment_type']!='trackback') &&
1140
+ (
1141
+ apbct_is_user_enable() === false ||
1142
+ $apbct->settings['comments_test'] == 0 ||
1143
+ $ct_comment_done ||
1144
+ (isset($_SERVER['HTTP_REFERER']) && stripos($_SERVER['HTTP_REFERER'],'page=wysija_campaigns&action=editTemplate')!==false) ||
1145
+ (isset($is_max_comments) && $is_max_comments) ||
1146
+ (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false)
1147
+ )
1148
+ )
1149
+ {
1150
+ return $comment;
1151
+ }
1152
+
1153
+ $local_blacklists = wp_blacklist_check(
1154
+ $comment['comment_author'],
1155
+ $comment['comment_author_email'],
1156
+ $comment['comment_author_url'],
1157
+ $comment['comment_content'],
1158
+ apbct_get_server_variable( 'REMOTE_ADDR' ),
1159
+ apbct_get_server_variable( 'HTTP_USER_AGENT' )
1160
+ );
1161
+
1162
+ // Go out if author in local blacklists
1163
+ if ($comment['comment_type']!='trackback' && $local_blacklists === true) {
1164
+ return $comment;
1165
+ }
1166
+
1167
+ // Skip pingback anti-spam test
1168
+ /*if ($comment['comment_type'] == 'pingback') {
1169
+ return $comment;
1170
+ }*/
1171
+
1172
+ $ct_comment_done = true;
1173
+
1174
+ $comment_post_id = $comment['comment_post_ID'];
1175
+
1176
+ // JetPack comments logic
1177
+ $post_info['comment_type'] = $ct_jp_comments ? 'jetpack_comment' : $comment['comment_type'];
1178
+ $post_info['post_url'] = ct_post_url(null, $comment_post_id);
1179
+
1180
+ // Comment type
1181
+ $post_info['comment_type'] = empty($post_info['comment_type']) ? 'general_comment' : $post_info['comment_type'];
1182
+
1183
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
1184
+ ? apbct_js_test('ct_checkjs', $_COOKIE)
1185
+ : apbct_js_test('ct_checkjs', $_POST);
1186
+
1187
+
1188
+ $example = null;
1189
+ if ($apbct->data['relevance_test']) {
1190
+ $post = get_post($comment_post_id);
1191
+ if ($post !== null){
1192
+ $example['title'] = $post->post_title;
1193
+ $example['body'] = $post->post_content;
1194
+ $example['comments'] = null;
1195
+
1196
+ $last_comments = get_comments(array('status' => 'approve', 'number' => 10, 'post_id' => $comment_post_id));
1197
+ foreach ($last_comments as $post_comment){
1198
+ $example['comments'] .= "\n\n" . $post_comment->comment_content;
1199
+ }
1200
+
1201
+ $example = json_encode($example);
1202
+ }
1203
+
1204
+ // Use plain string format if've failed with JSON
1205
+ if ($example === false || $example === null){
1206
+ $example = ($post->post_title !== null) ? $post->post_title : '';
1207
+ $example .= ($post->post_content !== null) ? "\n\n" . $post->post_content : '';
1208
+ }
1209
+ }
1210
+
1211
+ $base_call_result = apbct_base_call(
1212
+ array(
1213
+ 'message' => $comment['comment_content'],
1214
+ 'example' => $example,
1215
+ 'sender_email' => $comment['comment_author_email'],
1216
+ 'sender_nickname' => $comment['comment_author'],
1217
+ 'post_info' => $post_info,
1218
+ 'js_on' => $checkjs,
1219
+ 'sender_info' => array(
1220
+ 'sender_url' => @$comment['comment_author_url'],
1221
+ 'form_validation' => !isset($apbct->validation_error)
1222
+ ? null
1223
+ : json_encode(array(
1224
+ 'validation_notice' => $apbct->validation_error,
1225
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1226
+ ))
1227
+ ),
1228
+ )
1229
+ );
1230
+ $ct_result = $base_call_result['ct_result'];
1231
+
1232
+ ct_hash($ct_result->id);
1233
+
1234
+ //Don't check trusted users
1235
+ if (isset($comment['comment_author_email'])){
1236
+ $approved_comments = get_comments(array('status' => 'approve', 'count' => true, 'author_email' => $comment['comment_author_email']));
1237
+ $new_user = $approved_comments == 0 ? true : false;
1238
+ }
1239
+
1240
+ // Change comment flow only for new authors
1241
+ if (!empty($new_user) || $ct_result->stop_words !== null || $ct_result->spam == 1)
1242
+ add_action('comment_post', 'ct_set_meta', 10, 2);
1243
+
1244
+ if($ct_result->allow){ // Pass if allowed
1245
+ if(get_option('comment_moderation') === '1') // Wordpress moderation flag
1246
+ add_filter('pre_comment_approved', 'ct_set_not_approved', 999, 2);
1247
+ else
1248
+ add_filter('pre_comment_approved', 'ct_set_approved', 999, 2);
1249
+ }else{
1250
+
1251
+ global $ct_comment, $ct_stop_words;
1252
+
1253
+ $ct_comment = $ct_result->comment;
1254
+ $ct_stop_words = $ct_result->stop_words;
1255
+
1256
+ $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
1257
+ $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1258
+
1259
+ // Terminate. Definitely spam.
1260
+ if($ct_result->stop_queue == 1)
1261
+ wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
1262
+
1263
+ // Terminate by user's setting.
1264
+ if($ct_result->spam == 3)
1265
+ wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
1266
+
1267
+ // Trash comment.
1268
+ if($ct_result->spam == 2){
1269
+ add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1270
+ add_action('comment_post', 'ct_wp_trash_comment', 997, 2);
1271
+ }
1272
+
1273
+ // Spam comment
1274
+ if($ct_result->spam == 1)
1275
+ add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
1276
+
1277
+ // Move to pending folder. Contains stop_words.
1278
+ if($ct_result->stop_words){
1279
+ add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
1280
+ add_action('comment_post', 'ct_mark_red', 998, 2);
1281
+ }
1282
+
1283
+ add_action('comment_post', 'ct_die', 999, 2);
1284
+ }
1285
+
1286
+ if($apbct->settings['remove_comments_links'] == 1){
1287
+ $comment['comment_content'] = preg_replace("~(http|https|ftp|ftps)://(.*?)(\s|\n|[,.?!](\s|\n)|$)~", '[Link deleted]', $comment['comment_content']);
1288
+ }
1289
+
1290
+ // Change mail notification if license is out of date
1291
+ if($apbct->data['moderate'] == 0){
1292
+ $apbct->sender_email = $comment['comment_author_email'];
1293
+ $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
1294
+ add_filter('comment_moderation_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment sent to moderation
1295
+ add_filter('comment_notification_text', 'apbct_comment__Wordpress__changeMailNotification', 100, 2); // Comment approved
1296
+ }
1297
+
1298
+ return $comment;
1299
+ }
1300
+
1301
+ /**
1302
+ * Changes whether notify admin/athor or not.
1303
+ *
1304
+ * @param bool $maybe_notify notify flag
1305
+ * @param int $comment_ID Comment id
1306
+ * @return bool flag
1307
+ */
1308
+ function apbct_comment__Wordpress__doNotify($maybe_notify, $comment_ID){
1309
+ return true;
1310
+ }
1311
+
1312
+ /**
1313
+ * Add notification setting link
1314
+ *
1315
+ * @param string $notify_message
1316
+ * @param integer $comment_id
1317
+ *
1318
+ * @return string
1319
+ */
1320
+ function apbct_comment__Wordpress__changeMailNotificationGroups($notify_message, $comment_id){
1321
+ $website = parse_url(get_option('siteurl'),PHP_URL_HOST);
1322
+ return $notify_message
1323
+ .PHP_EOL
1324
+ .'---'.PHP_EOL
1325
+ .'Manage notifications settings: http://'.$website.'/wp-admin/options-general.php?page=cleantalk';
1326
+ }
1327
+
1328
+ /**
1329
+ * Change email notification recipients
1330
+ *
1331
+ * @param array $emails
1332
+ * @param integer $comment_id
1333
+ *
1334
+ * @return array
1335
+ * @global SpbcState $apbct
1336
+ */
1337
+ function apbct_comment__Wordpress__changeMailNotificationRecipients($emails, $comment_id){
1338
+ global $apbct;
1339
+ return array_unique(array_merge($emails, (array)json_decode($apbct->comment_notification_recipients, true)));
1340
+ }
1341
+
1342
+ /**
1343
+ * Changes email notification for spam comment for native Wordpress comment system
1344
+ *
1345
+ * @param string $notify_message Body of email notification
1346
+ * @param int $comment_id Comment id
1347
+ * @return string Body for email notification
1348
+ */
1349
+ function apbct_comment__Wordpress__changeMailNotification($notify_message, $comment_id){
1350
+
1351
+ global $apbct;
1352
+
1353
+ $notify_message =
1354
+ PHP_EOL
1355
+ .__('CleanTalk AntiSpam: This message is possible spam.', 'cleantalk')
1356
+ ."\n".__('You could check it in CleanTalk\'s anti-spam database:', 'cleantalk')
1357
+ ."\n".'IP: https://cleantalk.org/blacklists/' . $apbct->sender_ip
1358
+ ."\n".'Email: https://cleantalk.org/blacklists/' . $apbct->sender_email
1359
+ ."\n".PHP_EOL . sprintf(
1360
+ __('Activate protection in your Anti-Spam Dashboard: %s.', 'clentalk'),
1361
+ 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_comment_passed'
1362
+ .($apbct->data['user_token']
1363
+ ? '&iser_token='.$apbct->data['user_token']
1364
+ : ''
1365
+ )
1366
+ )
1367
+ .PHP_EOL . '---'
1368
+ .PHP_EOL
1369
+ .PHP_EOL
1370
+ .$notify_message;
1371
+
1372
+ return $notify_message;
1373
+
1374
+ }
1375
+
1376
+ /**
1377
+ * Set die page with Cleantalk comment.
1378
+ * @global array $ct_comment
1379
+ $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1380
+ * @param type $comment_status
1381
+ */
1382
+ function ct_die($comment_id, $comment_status) {
1383
+ global $ct_comment;
1384
+ $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1385
+ $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1386
+ if(isset($_POST['et_pb_contact_email']))
1387
+ {
1388
+ $mes='<div id="et_pb_contact_form_1" class="et_pb_contact_form_container clearfix"><h1 class="et_pb_contact_main_title">Blacklisted</h1><div class="et-pb-contact-message"><p>'.$ct_comment.'</p></div></div>';
1389
+ wp_die($mes, 'Blacklisted', array('back_link' => true,'response'=>200));
1390
+ }
1391
+ else
1392
+ {
1393
+ wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
1394
+ }
1395
+ }
1396
+
1397
+ /**
1398
+ * Set die page with Cleantalk comment from parameter.
1399
+ * @param type $comment_body
1400
+ */
1401
+ function ct_die_extended($comment_body) {
1402
+ $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $comment_body;
1403
+ $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1404
+ wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
1405
+ }
1406
+
1407
+ /**
1408
+ * Validates JavaScript anti-spam test
1409
+ *
1410
+ * @param string $field_name filed to serach in data
1411
+ * @param null $data Data to search in
1412
+ * @param bool $random_key
1413
+ *
1414
+ * @return int|null
1415
+ */
1416
+ function apbct_js_test($field_name = 'ct_checkjs', $data = null) {
1417
+
1418
+ global $apbct;
1419
+
1420
+ $out = null;
1421
+
1422
+ if($data && isset($data[$field_name])){
1423
+
1424
+ $js_key = trim($data[$field_name]);
1425
+
1426
+ // Check static key
1427
+ if(
1428
+ $apbct->settings['use_static_js_key'] == 1 ||
1429
+ ( $apbct->settings['use_static_js_key'] == - 1 &&
1430
+ ( apbct_is_cache_plugins_exists() ||
1431
+ ( apbct_is_post() && $apbct->data['cache_detected'] == 1 )
1432
+ )
1433
+ )
1434
+ ){
1435
+ $out = ct_get_checkjs_value() === $js_key ? 1 : 0;
1436
+
1437
+ // Random key check
1438
+ }else{
1439
+ $out = array_key_exists( $js_key, $apbct->js_keys ) ? 1 : 0;
1440
+ }
1441
+ }
1442
+
1443
+ return $out;
1444
+ }
1445
+
1446
+ /**
1447
+ * Get post url
1448
+ * @param int $comment_id
1449
+ * @param int $comment_post_id
1450
+ * @return string|bool
1451
+ */
1452
+ function ct_post_url($comment_id = null, $comment_post_id) {
1453
+
1454
+ if (empty($comment_post_id))
1455
+ return null;
1456
+
1457
+ if ($comment_id === null) {
1458
+ $last_comment = get_comments('number=1');
1459
+ $comment_id = isset($last_comment[0]->comment_ID) ? (int) $last_comment[0]->comment_ID + 1 : 1;
1460
+ }
1461
+ $permalink = get_permalink($comment_post_id);
1462
+
1463
+ $post_url = null;
1464
+ if ($permalink !== null)
1465
+ $post_url = $permalink . '#comment-' . $comment_id;
1466
+
1467
+ return $post_url;
1468
+ }
1469
+
1470
+ /**
1471
+ * Public filter 'pre_comment_approved' - Mark comment unapproved always
1472
+ * @return int Zero
1473
+ */
1474
+ function ct_set_not_approved() {
1475
+ return 0;
1476
+ }
1477
+
1478
+ /**
1479
+ * @author Artem Leontiev
1480
+ * Public filter 'pre_comment_approved' - Mark comment approved if it's not 'spam' only
1481
+ * @return int 1
1482
+ */
1483
+ function ct_set_approved($approved, $comment) {
1484
+ if ($approved == 'spam'){
1485
+ return $approved;
1486
+ } else {
1487
+ return 1;
1488
+ }
1489
+ }
1490
+
1491
+ /**
1492
+ * Public filter 'pre_comment_approved' - Mark comment unapproved always
1493
+ * @return int Zero
1494
+ */
1495
+ function ct_set_comment_spam() {
1496
+ return 'spam';
1497
+ }
1498
+
1499
+ /**
1500
+ * Public action 'comment_post' - Store cleantalk hash in comment meta 'ct_hash'
1501
+ * @param int $comment_id Comment ID
1502
+ * @param mixed $comment_status Approval status ("spam", or 0/1), not used
1503
+ */
1504
+ function ct_set_meta($comment_id, $comment_status) {
1505
+ global $comment_post_id;
1506
+ $hash1 = ct_hash();
1507
+ if (!empty($hash1)) {
1508
+ update_comment_meta($comment_id, 'ct_hash', $hash1);
1509
+ if (function_exists('base64_encode') && isset($comment_status) && $comment_status != 'spam') {
1510
+ $post_url = ct_post_url($comment_id, $comment_post_id);
1511
+ $post_url = base64_encode($post_url);
1512
+ if ($post_url === false)
1513
+ return false;
1514
+ // 01 - URL to approved comment
1515
+ $feedback_request = $hash1 . ':' . '01' . ':' . $post_url . ';';
1516
+ ct_send_feedback($feedback_request);
1517
+ }
1518
+ }
1519
+ return true;
1520
+ }
1521
+
1522
+ /**
1523
+ * Mark bad words
1524
+ * @global string $ct_stop_words
1525
+ * @param int $comment_id
1526
+ * @param int $comment_status Not use
1527
+ */
1528
+ function ct_mark_red($comment_id, $comment_status) {
1529
+ global $ct_stop_words;
1530
+
1531
+ $comment = get_comment($comment_id, 'ARRAY_A');
1532
+ $message = $comment['comment_content'];
1533
+ foreach (explode(':', $ct_stop_words) as $word) {
1534
+ $message = preg_replace("/($word)/ui", '<font rel="cleantalk" color="#FF1000">' . "$1" . '</font>', $message);
1535
+
1536
+ }
1537
+ $comment['comment_content'] = $message;
1538
+ kses_remove_filters();
1539
+ wp_update_comment($comment);
1540
+ }
1541
+
1542
+ //
1543
+ //Send post to trash
1544
+ //
1545
+ function ct_wp_trash_comment($comment_id, $comment_status){
1546
+ wp_trash_comment($comment_id);
1547
+ }
1548
+
1549
+ /**
1550
+ * Tests plugin activation status
1551
+ * @return bool
1552
+ */
1553
+ function ct_plugin_active($plugin_name){
1554
+ foreach (get_option('active_plugins') as $k => $v) {
1555
+ if ($plugin_name == $v)
1556
+ return true;
1557
+ }
1558
+ return false;
1559
+ }
1560
+
1561
+ /**
1562
+ * Insert a hidden field to registration form
1563
+ * @return null
1564
+ */
1565
+ function ct_register_form() {
1566
+
1567
+ global $ct_checkjs_register_form, $apbct;
1568
+
1569
+ if ($apbct->settings['registrations_test'] == 0) {
1570
+ return false;
1571
+ }
1572
+
1573
+ ct_add_hidden_fields($ct_checkjs_register_form, false, false, false, false);
1574
+
1575
+ return null;
1576
+ }
1577
+
1578
+ function apbct_login__scripts(){
1579
+ echo '<script src="'.APBCT_URL_PATH.'/js/apbct-public.min.js"></script>';
1580
+ }
1581
+
1582
+ /**
1583
+ * Adds notification text to login form - to inform about approved registration
1584
+ * @return null
1585
+ */
1586
+ function ct_login_message($message) {
1587
+
1588
+ global $errors, $apbct, $apbct_cookie_register_ok_label;
1589
+
1590
+
1591
+
1592
+ if ($apbct->settings['registrations_test'] != 0){
1593
+ if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ){
1594
+ if (isset($_COOKIE[$apbct_cookie_register_ok_label])){
1595
+ if(is_wp_error($errors)){
1596
+ $errors->add('ct_message',sprintf(__('Registration approved by %s.', 'cleantalk'), '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk</b>'), 'message');
1597
+ }
1598
+ }
1599
+ }
1600
+ }
1601
+ return $message;
1602
+ }
1603
+
1604
+ /**
1605
+ * Test users registration for pPress
1606
+ * @return array with errors
1607
+ */
1608
+ function ct_registration_errors_ppress($reg_errors, $form_id) {
1609
+
1610
+ $email = $_POST['reg_email'];
1611
+ $login = $_POST['reg_username'];
1612
+
1613
+ $reg_errors = ct_registration_errors($reg_errors, $login, $email);
1614
+
1615
+ return $reg_errors;
1616
+ }
1617
+
1618
+ /**
1619
+ * Test users registration for multisite enviroment
1620
+ * @return array with errors
1621
+ */
1622
+ function ct_registration_errors_wpmu($errors) {
1623
+ global $ct_signup_done;
1624
+
1625
+ //
1626
+ // Multisite actions
1627
+ //
1628
+ $sanitized_user_login = null;
1629
+ if (isset($errors['user_name'])) {
1630
+ $sanitized_user_login = $errors['user_name'];
1631
+ $wpmu = true;
1632
+ }
1633
+ $user_email = null;
1634
+ if (isset($errors['user_email'])) {
1635
+ $user_email = $errors['user_email'];
1636
+ $wpmu = true;
1637
+ }
1638
+
1639
+ if ($wpmu && isset($errors['errors']->errors) && count($errors['errors']->errors) > 0) {
1640
+ return $errors;
1641
+ }
1642
+
1643
+ $errors['errors'] = ct_registration_errors($errors['errors'], $sanitized_user_login, $user_email);
1644
+
1645
+ // Show CleanTalk errors in user_name field
1646
+ if (isset($errors['errors']->errors['ct_error'])) {
1647
+ $errors['errors']->errors['user_name'] = $errors['errors']->errors['ct_error'];
1648
+ unset($errors['errors']->errors['ct_error']);
1649
+ }
1650
+
1651
+ return $errors;
1652
+ }
1653
+
1654
+ /**
1655
+ * Shell for action register_post
1656
+ * @return array with errors
1657
+ */
1658
+ function ct_register_post($sanitized_user_login = null, $user_email = null, $errors) {
1659
+ return ct_registration_errors($errors, $sanitized_user_login, $user_email);
1660
+ }
1661
+
1662
+ /**
1663
+ * Check messages for external plugins
1664
+ * @return array with checking result;
1665
+ */
1666
+
1667
+ function ct_test_message($nickname, $email, $ip, $text){
1668
+
1669
+ $base_call_result = apbct_base_call(
1670
+ array(
1671
+ 'message' => $text,
1672
+ 'sender_email' => $email,
1673
+ 'sender_nickname' => $nickname,
1674
+ 'post_info' => array('comment_type' => 'feedback_plugin_check'),
1675
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
1676
+ )
1677
+ );
1678
+
1679
+ $ct_result = $base_call_result['ct_result'];
1680
+
1681
+ $result=Array(
1682
+ 'allow' => $ct_result->allow,
1683
+ 'comment' => $ct_result->comment,
1684
+ );
1685
+ return $result;
1686
+ }
1687
+
1688
+ /**
1689
+ * Check registrations for external plugins
1690
+ * @return array with checking result;
1691
+ */
1692
+ function ct_test_registration($nickname, $email, $ip){
1693
+
1694
+ global $ct_checkjs_register_form, $apbct;
1695
+
1696
+ if(apbct_js_test($ct_checkjs_register_form, $_POST)){
1697
+ $checkjs = apbct_js_test($ct_checkjs_register_form, $_POST);
1698
+ $sender_info['post_checkjs_passed'] = $checkjs;
1699
+ }else{
1700
+ $checkjs = $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1701
+ $sender_info['cookie_checkjs_passed'] = $checkjs;
1702
+ }
1703
+
1704
+ //Making a call
1705
+ $base_call_result = apbct_base_call(
1706
+ array(
1707
+ 'sender_ip' => $ip,
1708
+ 'sender_email' => $email,
1709
+ 'sender_nickname' => $nickname,
1710
+ 'sender_info' => $sender_info,
1711
+ 'js_on' => $checkjs,
1712
+ ),
1713
+ true
1714
+ );
1715
+ $ct_result = $base_call_result['ct_result'];
1716
+
1717
+ $result = array(
1718
+ 'allow' => $ct_result->allow,
1719
+ 'comment' => $ct_result->comment,
1720
+ );
1721
+ return $result;
1722
+ }
1723
+
1724
+ /**
1725
+ * Test users registration
1726
+ *
1727
+ * @param $errors
1728
+ * @param null $sanitized_user_login
1729
+ * @param null $user_email
1730
+ *
1731
+ * @return void with errors
1732
+ */
1733
+ function ct_registration_errors($errors, $sanitized_user_login = null, $user_email = null) {
1734
+
1735
+ global $ct_checkjs_register_form, $apbct_cookie_request_id_label, $apbct_cookie_register_ok_label, $bp, $ct_signup_done, $ct_negative_comment, $apbct, $ct_registration_error_comment, $cleantalk_executed;
1736
+
1737
+ // Go out if a registrered user action
1738
+ if (apbct_is_user_enable() === false) {
1739
+ return $errors;
1740
+ }
1741
+
1742
+ if ($apbct->settings['registrations_test'] == 0) {
1743
+ return $errors;
1744
+ }
1745
+
1746
+ // The function already executed
1747
+ // It happens when used ct_register_post();
1748
+ if ($ct_signup_done && is_object($errors) && count($errors->errors) > 0) {
1749
+ return $errors;
1750
+ }
1751
+
1752
+ // Facebook registration
1753
+ if ($sanitized_user_login === null && isset($_POST['FB_userdata'])){
1754
+ $sanitized_user_login = $_POST['FB_userdata']['name'];
1755
+ $facebook = true;
1756
+ }
1757
+ if ($user_email === null && isset($_POST['FB_userdata'])){
1758
+ $user_email = $_POST['FB_userdata']['email'];
1759
+ $facebook = true;
1760
+ }
1761
+
1762
+ // BuddyPress actions
1763
+ $buddypress = false;
1764
+ if ($sanitized_user_login === null && isset($_POST['signup_username'])) {
1765
+ $sanitized_user_login = $_POST['signup_username'];
1766
+ $buddypress = true;
1767
+ }
1768
+ if ($user_email === null && isset($_POST['signup_email'])) {
1769
+ $user_email = $_POST['signup_email'];
1770
+ $buddypress = true;
1771
+ }
1772
+
1773
+ //
1774
+ // Break tests because we already have servers response
1775
+ //
1776
+ if ($buddypress && $ct_signup_done) {
1777
+ if ($ct_negative_comment) {
1778
+ $bp->signup->errors['signup_username'] = $ct_negative_comment;
1779
+ }
1780
+ return $errors;
1781
+ }
1782
+
1783
+
1784
+ if(current_filter() == 'woocommerce_registration_errors'){
1785
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1786
+ $checkjs_post = null;
1787
+ $checkjs_cookie = $checkjs;
1788
+ }else{
1789
+ // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1790
+ $checkjs_post = apbct_js_test($ct_checkjs_register_form, $_POST);
1791
+ $checkjs_cookie = apbct_js_test($ct_checkjs_register_form, $_COOKIE);
1792
+ $checkjs = $checkjs_cookie ? $checkjs_cookie : $checkjs_post;
1793
+ }
1794
+
1795
+ $sender_info = array(
1796
+ 'post_checkjs_passed' => $checkjs_post,
1797
+ 'cookie_checkjs_passed' => $checkjs_cookie,
1798
+ 'form_validation' => ! empty( $errors )
1799
+ ? json_encode( array(
1800
+ 'validation_notice' => $errors->get_error_message(),
1801
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
1802
+ ) )
1803
+ : null,
1804
+ );
1805
+
1806
+ $base_call_result = apbct_base_call(
1807
+ array(
1808
+ 'sender_email' => $user_email,
1809
+ 'sender_nickname' => $sanitized_user_login,
1810
+ 'sender_info' => $sender_info,
1811
+ 'js_on' => $checkjs,
1812
+ ),
1813
+ true
1814
+ );
1815
+ $ct_result = $base_call_result['ct_result'];
1816
+
1817
+ // Change mail notification if license is out of date
1818
+ if($apbct->data['moderate'] == 0 &&
1819
+ ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
1820
+ ){
1821
+ $apbct->sender_email = $user_email;
1822
+ $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
1823
+ add_filter('wp_new_user_notification_email_admin', 'apbct_registration__Wordpress__changeMailNotification', 100, 3);
1824
+ }
1825
+
1826
+ $ct_signup_done = true;
1827
+
1828
+ $ct_result = ct_change_plugin_resonse($ct_result, $checkjs);
1829
+
1830
+ $cleantalk_executed = true;
1831
+
1832
+ if ($ct_result->inactive != 0) {
1833
+ ct_send_error_notice($ct_result->comment);
1834
+ return $errors;
1835
+ }
1836
+
1837
+ if ($ct_result->allow == 0) {
1838
+
1839
+ if ($buddypress === true) {
1840
+ $bp->signup->errors['signup_username'] = $ct_result->comment;
1841
+ }elseif(!empty($facebook)){
1842
+ $_POST['FB_userdata']['email'] = '';
1843
+ $_POST['FB_userdata']['name'] = '';
1844
+ return;
1845
+ }else{
1846
+ if(is_wp_error($errors))
1847
+ $errors->add('ct_error', $ct_result->comment);
1848
+ $ct_negative_comment = $ct_result->comment;
1849
+ }
1850
+
1851
+ $ct_registration_error_comment = $ct_result->comment;
1852
+
1853
+ } else {
1854
+ if ($ct_result->id !== null) {
1855
+ setcookie($apbct_cookie_register_ok_label, $ct_result->id, time()+10, '/');
1856
+ setcookie($apbct_cookie_request_id_label, $ct_result->id, time()+10, '/');
1857
+ }
1858
+ }
1859
+
1860
+ return $errors;
1861
+ }
1862
+
1863
+ /**
1864
+ * Changes email notification for newly registred user
1865
+ *
1866
+ * @param string $wp_new_user_notification_email_admin Body of email notification
1867
+ * @param array $user User inof
1868
+ * @param string $blogname Blog name
1869
+ * @return string Body for email notification
1870
+ */
1871
+ function apbct_registration__Wordpress__changeMailNotification($wp_new_user_notification_email_admin, $user, $blogname){
1872
+
1873
+ global $apbct;
1874
+
1875
+ $wp_new_user_notification_email_admin['message'] = PHP_EOL
1876
+ .__('CleanTalk AntiSpam: This registration is spam.', 'cleantalk')
1877
+ ."\n" . __('CleanTalk\'s anti-spam database:', 'cleantalk')
1878
+ ."\n" . 'IP: ' . $apbct->sender_ip
1879
+ ."\n" . 'Email: ' . $apbct->sender_email
1880
+ .PHP_EOL . PHP_EOL .
1881
+ __('Activate protection in your Anti-Spam Dashboard: ', 'clentalk')
1882
+ .'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wp_spam_registration_passed'
1883
+ .($apbct->data['user_token']
1884
+ ? '&iser_token='.$apbct->data['user_token']
1885
+ : ''
1886
+ )
1887
+ .PHP_EOL . '---'
1888
+ .PHP_EOL
1889
+ .$wp_new_user_notification_email_admin['message'];
1890
+
1891
+ return $wp_new_user_notification_email_admin;
1892
+
1893
+
1894
+ }
1895
+
1896
+ /**
1897
+ * Checks Ultimate Members registration for spam
1898
+ *
1899
+ * @param $args forms arguments with names and values
1900
+ *
1901
+ * @return mixed
1902
+ *
1903
+ */
1904
+ function apbct_registration__UltimateMembers__check( $args ){
1905
+
1906
+ global $apbct, $cleantalk_executed;
1907
+
1908
+ if ($apbct->settings['registrations_test'] == 0)
1909
+ return $args;
1910
+
1911
+ $checkjs = apbct_js_test('ct_checkjs_register_form', $args);
1912
+ $sender_info['post_checkjs_passed'] = $checkjs;
1913
+
1914
+ // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1915
+ if ($checkjs == 0) {
1916
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1917
+ $sender_info['cookie_checkjs_passed'] = $checkjs;
1918
+ }
1919
+
1920
+ $base_call_result = apbct_base_call(
1921
+ array(
1922
+ 'sender_email' => $args['user_email'],
1923
+ 'sender_nickname' => $args['user_login'],
1924
+ 'sender_info' => $sender_info,
1925
+ 'js_on' => $checkjs,
1926
+ ),
1927
+ true
1928
+ );
1929
+ $ct_result = $base_call_result['ct_result'];
1930
+
1931
+ $cleantalk_executed = true;
1932
+
1933
+ if ($ct_result->inactive != 0) {
1934
+ ct_send_error_notice($ct_result->comment);
1935
+ return $args;
1936
+ }
1937
+
1938
+ if ($ct_result->allow == 0)
1939
+ UM()->form()->add_error('user_password', $ct_result->comment );
1940
+
1941
+ return $args;
1942
+ }
1943
+
1944
+ /**
1945
+ * Checks registration error and set it if it was dropped
1946
+ * @return errors
1947
+ */
1948
+ function ct_check_registration_erros($errors, $sanitized_user_login = null, $user_email = null) {
1949
+ global $bp, $ct_registration_error_comment;
1950
+
1951
+ if($ct_registration_error_comment){
1952
+
1953
+ if(isset($bp))
1954
+ if(method_exists($bp, 'signup'))
1955
+ if(method_exists($bp->signup, 'errors'))
1956
+ if(isset($bp->signup->errors['signup_username']))
1957
+ if($bp->signup->errors['signup_username'] != $ct_registration_error_comment)
1958
+ $bp->signup->errors['signup_username'] = $ct_registration_error_comment;
1959
+
1960
+ if(isset($errors))
1961
+ if(method_exists($errors, 'errors'))
1962
+ if(isset($errors->errors['ct_error']))
1963
+ if($errors->errors['ct_error'][0] != $ct_registration_error_comment)
1964
+ $errors->add('ct_error', $ct_registration_error_comment);
1965
+
1966
+ }
1967
+ return $errors;
1968
+ }
1969
+
1970
+ /**
1971
+ * Set user meta (ct_hash) for successed registration
1972
+ * @return null
1973
+ */
1974
+ function apbct_user_register($user_id) {
1975
+ global $apbct_cookie_request_id_label;
1976
+ if (isset($_COOKIE[$apbct_cookie_request_id_label])) {
1977
+ if(update_user_meta($user_id, 'ct_hash', $_COOKIE[$apbct_cookie_request_id_label])){
1978
+ setcookie($apbct_cookie_request_id_label, '0', 1, '/');
1979
+ }
1980
+ }
1981
+ }
1982
+
1983
+
1984
+ /**
1985
+ * Test for JetPack contact form
1986
+ */
1987
+ function ct_grunion_contact_form_field_html($r, $field_label) {
1988
+
1989
+ global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $apbct;
1990
+
1991
+ if ($apbct->settings['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match( "/(text|email)/i", $r)) {
1992
+
1993
+ // Looking for element name prefix
1994
+ $name_patched = false;
1995
+ foreach ($ct_jpcf_fields as $v) {
1996
+ if ($name_patched === false && preg_match("/(g\d-)$v/", $r, $matches)) {
1997
+ $ct_checkjs_jpcf = $matches[1] . $ct_checkjs_jpcf;
1998
+ $name_patched = true;
1999
+ }
2000
+ }
2001
+
2002
+ $r .= ct_add_hidden_fields($ct_checkjs_jpcf, true);
2003
+ $ct_jpcf_patched = true;
2004
+ }
2005
+
2006
+ return $r;
2007
+ }
2008
+ /**
2009
+ * Test for JetPack contact form
2010
+ */
2011
+ function ct_contact_form_is_spam($form) {
2012
+
2013
+ global $ct_checkjs_jpcf, $apbct;
2014
+
2015
+ if ($apbct->settings['contact_forms_test'] == 0) {
2016
+ return null;
2017
+ }
2018
+
2019
+ $js_field_name = $ct_checkjs_jpcf;
2020
+ foreach ($_POST as $k => $v) {
2021
+ if (preg_match("/^.+$ct_checkjs_jpcf$/", $k))
2022
+ $js_field_name = $k;
2023
+ }
2024
+
2025
+ $sender_email = null;
2026
+ $sender_nickname = null;
2027
+ $message = '';
2028
+ if (isset($form['comment_author_email']))
2029
+ $sender_email = $form['comment_author_email'];
2030
+
2031
+ if (isset($form['comment_author']))
2032
+ $sender_nickname = $form['comment_author'];
2033
+
2034
+ if (isset($form['comment_content']))
2035
+ $message = $form['comment_content'];
2036
+
2037
+ $base_call_result = apbct_base_call(
2038
+ array(
2039
+ 'message' => $message,
2040
+ 'sender_email' => $sender_email,
2041
+ 'sender_nickname' => $sender_nickname,
2042
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_grunion'),
2043
+ 'sender_info' => array('sender_url' => @$form['comment_author_url']),
2044
+ 'js_on' => apbct_js_test($js_field_name, $_POST),
2045
+ )
2046
+ );
2047
+ $ct_result = $base_call_result['ct_result'];
2048
+
2049
+ if ($ct_result->allow == 0) {
2050
+ global $ct_comment;
2051
+ $ct_comment = $ct_result->comment;
2052
+ ct_die(null, null);
2053
+ exit;
2054
+ }
2055
+
2056
+ return (bool) !$ct_result->allow;
2057
+ }
2058
+
2059
+ function ct_contact_form_is_spam_jetpack($is_spam,$form) {
2060
+ global $ct_checkjs_jpcf, $apbct;
2061
+
2062
+ if ($apbct->settings['contact_forms_test'] == 0) {
2063
+ return null;
2064
+ }
2065
+
2066
+ $js_field_name = $ct_checkjs_jpcf;
2067
+ foreach ($_POST as $k => $v) {
2068
+ if (preg_match("/^.+$ct_checkjs_jpcf$/", $k))
2069
+ $js_field_name = $k;
2070
+ }
2071
+
2072
+ $base_call_result = apbct_base_call(
2073
+ array(
2074
+ 'message' => isset($form['comment_content']) ? $form['comment_content'] : '',
2075
+ 'sender_email' => isset($form['comment_author_email']) ? $form['comment_author_email'] : null,
2076
+ 'sender_nickname' => isset($form['comment_author']) ? $form['comment_author'] : null,
2077
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_grunion'),
2078
+ 'sender_info' => array('sender_url' => @$form['comment_author_url']),
2079
+ )
2080
+ );
2081
+ $ct_result = $base_call_result['ct_result'];
2082
+
2083
+ if ($ct_result->allow == 0) {
2084
+ global $ct_comment;
2085
+ $ct_comment = $ct_result->comment;
2086
+ ct_die(null, null);
2087
+ exit;
2088
+ }
2089
+
2090
+ return (bool) !$ct_result->allow;
2091
+ }
2092
+
2093
+ /**
2094
+ * Inserts anti-spam hidden to WP Maintenance Mode (wpmm)
2095
+ */
2096
+ function apbct_form__wpmm__addField(){
2097
+ ct_add_hidden_fields('ct_checkjs', false, true, true);
2098
+ }
2099
+
2100
+ /**
2101
+ * Inserts anti-spam hidden to CF7
2102
+ */
2103
+ function apbct_form__contactForm7__addField($html) {
2104
+ global $ct_checkjs_cf7, $apbct;
2105
+
2106
+
2107
+
2108
+ if ($apbct->settings['contact_forms_test'] == 0) {
2109
+ return $html;
2110
+ }
2111
+
2112
+ $html .= ct_add_hidden_fields($ct_checkjs_cf7, true);
2113
+
2114
+ return $html;
2115
+ }
2116
+
2117
+ /**
2118
+ * Test spam for Contact Fomr 7 (CF7) right before validation
2119
+ *
2120
+ * @global SpbcState $apbct
2121
+ * @param type $result
2122
+ * @param type $tags
2123
+ * @return type
2124
+ */
2125
+ function apbct_form__contactForm7__tesSpam__before_validate($result = null, $tags = null) {
2126
+ global $apbct;
2127
+
2128
+ if ($result && method_exists($result, 'get_invalid_fields')){
2129
+ $invalid_fields = $result->get_invalid_fields();
2130
+ if(!empty($invalid_fields) && is_array($invalid_fields)){
2131
+ $apbct->validation_error = $invalid_fields[key($invalid_fields)]['reason'];
2132
+ apbct_form__contactForm7__testSpam(false);
2133
+ }
2134
+ }
2135
+
2136
+ return $result;
2137
+ }
2138
+
2139
+ /**
2140
+ * Test CF7 message for spam
2141
+ */
2142
+ function apbct_form__contactForm7__testSpam($param) {
2143
+
2144
+ global $ct_checkjs_cf7, $apbct;
2145
+
2146
+ if(
2147
+ $apbct->settings['contact_forms_test'] == 0 ||
2148
+ $param == false && WPCF7_VERSION < '3.0.0' ||
2149
+ $param === true && WPCF7_VERSION >= '3.0.0' ||
2150
+ $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() || // Skip processing for logged in users.
2151
+ apbct_exclusions_check__url() ||
2152
+ apbct_exclusions_check__ip() ||
2153
+ isset($apbct->cf7_checked)
2154
+ ){
2155
+ return $param;
2156
+ }
2157
+
2158
+ $checkjs = apbct_js_test($ct_checkjs_cf7, $_POST)
2159
+ ? apbct_js_test($ct_checkjs_cf7, $_POST)
2160
+ : apbct_js_test('ct_checkjs', $_COOKIE);
2161
+
2162
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
2163
+
2164
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2165
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2166
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2167
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2168
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2169
+ if ($subject != '') {
2170
+ $message = array_merge(array('subject' => $subject), $message);
2171
+ }
2172
+
2173
+ $base_call_result = apbct_base_call(
2174
+ array(
2175
+ 'message' => $message,
2176
+ 'sender_email' => $sender_email,
2177
+ 'sender_nickname' => $sender_nickname,
2178
+ 'js_on' => $checkjs,
2179
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_cf7'),
2180
+ 'sender_info' => array(
2181
+ 'form_validation' => !isset($apbct->validation_error)
2182
+ ? null
2183
+ : json_encode(array(
2184
+ 'validation_notice' => $apbct->validation_error,
2185
+ 'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
2186
+ ))
2187
+ ),
2188
+ )
2189
+ );
2190
+
2191
+ $ct_result = $base_call_result['ct_result'];
2192
+
2193
+ // Change mail notification if license is out of date
2194
+ if($apbct->data['moderate'] == 0 &&
2195
+ ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2196
+ ){
2197
+ $apbct->sender_email = $sender_email;
2198
+ $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2199
+ add_filter('wpcf7_mail_components', 'apbct_form__contactForm7__changeMailNotification');
2200
+ }
2201
+
2202
+ if ($ct_result->allow == 0) {
2203
+
2204
+ global $ct_cf7_comment;
2205
+ $ct_cf7_comment = $ct_result->comment;
2206
+
2207
+ add_filter('wpcf7_display_message', 'apbct_form__contactForm7__showResponse', 10, 2);
2208
+
2209
+ $param = WPCF7_VERSION >= '3.0.0' ? true : false;
2210
+
2211
+ }
2212
+
2213
+ $apbct->cf7_checked = true;
2214
+
2215
+ return $param;
2216
+ }
2217
+
2218
+ /**
2219
+ * Changes CF7 status message
2220
+ * @param string $hook URL of hooked page
2221
+ */
2222
+ function apbct_form__contactForm7__showResponse($message, $status = 'spam') {
2223
+ global $ct_cf7_comment;
2224
+
2225
+ if ($status == 'spam') {
2226
+ $message = $ct_cf7_comment;
2227
+ }
2228
+
2229
+ return $message;
2230
+ }
2231
+
2232
+ /**
2233
+ * Changes email notification for succes subscription for Contact Form 7
2234
+ *
2235
+ * @param array $component Arguments for email notification
2236
+ * @return array Arguments for email notification
2237
+ */
2238
+ function apbct_form__contactForm7__changeMailNotification($component){
2239
+
2240
+ global $apbct;
2241
+
2242
+ $component['body'] =
2243
+ __('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2244
+ .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2245
+ .PHP_EOL . 'IP: ' . $apbct->sender_ip
2246
+ .PHP_EOL . 'Email: ' . $apbct->sender_email
2247
+ .PHP_EOL . sprintf(
2248
+ __('Activate protection in your Anti-Spam Dashboard: %s.', 'clentalk'),
2249
+ 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=cf7_activate_antispam&user_token='.$apbct->user_token
2250
+ )
2251
+ .PHP_EOL . '---' . PHP_EOL . PHP_EOL
2252
+ .$component['body'];
2253
+
2254
+ return (array) $component;
2255
+ }
2256
+
2257
+ /**
2258
+ * Test Ninja Forms message for spam
2259
+ *
2260
+ * @global SpbcState $apbct
2261
+ * @return void
2262
+ */
2263
+ function apbct_form__ninjaForms__testSpam() {
2264
+
2265
+ global $apbct;
2266
+
2267
+ if(
2268
+ $apbct->settings['contact_forms_test'] == 0
2269
+ || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2270
+ || apbct_exclusions_check__url()
2271
+ ){
2272
+ return;
2273
+ }
2274
+
2275
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
2276
+
2277
+ // Choosing between POST and GET
2278
+ $params = ct_get_fields_any(isset($_GET['ninja_forms_ajax_submit']) || isset($_GET['nf_ajax_submit']) ? $_GET : $_POST);
2279
+
2280
+ $sender_email = ($params['email'] ? $params['email'] : '');
2281
+ $sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
2282
+ $subject = ($params['subject'] ? $params['subject'] : '');
2283
+ $message = ($params['message'] ? $params['message'] : array());
2284
+ if ($subject != '') {
2285
+ $message = array_merge(array('subject' => $subject), $message);
2286
+ }
2287
+
2288
+ //Ninja Forms xml fix
2289
+ foreach ($message as $key => $value){
2290
+ if (strpos($value, '<xml>') !== false)
2291
+ unset($message[$key]);
2292
+ }
2293
+
2294
+ $base_call_result = apbct_base_call(
2295
+ array(
2296
+ 'message' => $message,
2297
+ 'sender_email' => $sender_email,
2298
+ 'sender_nickname' => $sender_nickname,
2299
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_ninja_froms'),
2300
+ 'js_on' => $checkjs,
2301
+ )
2302
+ );
2303
+ $ct_result = $base_call_result['ct_result'];
2304
+
2305
+ // Change mail notification if license is out of date
2306
+ if($apbct->data['moderate'] == 0 &&
2307
+ ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2308
+ ){
2309
+ $apbct->sender_email = $sender_email;
2310
+ $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2311
+ add_filter('ninja_forms_action_email_message', 'apbct_form__ninjaForms__changeMailNotification', 1, 3);
2312
+ }
2313
+
2314
+ if ($ct_result->allow == 0) {
2315
+
2316
+ // We have to use GLOBAL variable to transfer the comment to apbct_form__ninjaForms__changeResponse() function :(
2317
+ $apbct->response = $ct_result->comment;
2318
+ add_action( 'ninja_forms_before_response', 'apbct_form__ninjaForms__changeResponse', 10, 1 );
2319
+ }
2320
+ }
2321
+
2322
+ function apbct_form__ninjaForms__changeResponse( $data ) {
2323
+
2324
+ global $apbct;
2325
+
2326
+ // Show error message below field found by ID
2327
+ if(array_key_exists('email', $data['fields_by_key'])){
2328
+ // Find ID of EMAIL field
2329
+ $nf_field_id = $data['fields_by_key']['email']['id'];
2330
+ }else{
2331
+ // Find ID of last field (usually SUBMIT)
2332
+ $nf_field_id = array_pop(array_keys($data['fields']));
2333
+ }
2334
+
2335
+ // Below is modified NJ logic
2336
+ $error = array(
2337
+ 'fields' => array(
2338
+ $nf_field_id => $apbct->response,
2339
+ ),
2340
+ );
2341
+
2342
+ $response = array( 'data' => $data, 'errors' => $error, 'debug' => '' );
2343
+
2344
+ die(wp_json_encode( $response, JSON_FORCE_OBJECT ));
2345
+
2346
+ }
2347
+
2348
+ function apbct_form__seedprod_coming_soon__testSpam() {
2349
+
2350
+ global $apbct;
2351
+
2352
+ if(
2353
+ $apbct->settings['contact_forms_test'] == 0
2354
+ || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2355
+ || apbct_exclusions_check__url()
2356
+ ){
2357
+ return;
2358
+ }
2359
+
2360
+ $ct_temp_msg_data = ct_get_fields_any($_REQUEST);
2361
+
2362
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2363
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2364
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2365
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2366
+ if ($subject != '') {
2367
+ $message = array_merge(array('subject' => $subject), $message);
2368
+ }
2369
+
2370
+ $post_info['comment_type'] = 'contact_form_wordpress_seedprod_coming_soon';
2371
+
2372
+ $base_call_result = apbct_base_call(
2373
+ array(
2374
+ 'message' => $message,
2375
+ 'sender_email' => $sender_email,
2376
+ 'sender_nickname' => $sender_nickname,
2377
+ 'post_info' => $post_info,
2378
+ )
2379
+ );
2380
+
2381
+ $ct_result = $base_call_result['ct_result'];
2382
+ if ($ct_result->allow == 0) {
2383
+ global $ct_comment;
2384
+ $ct_comment = $ct_result->comment;
2385
+
2386
+ $response = array(
2387
+ 'status' => 200,
2388
+ 'html' => "<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>"
2389
+ );
2390
+
2391
+ echo sanitize_text_field($_GET['callback']) . '(' . json_encode($response) . ')';
2392
+ exit();
2393
+ }
2394
+
2395
+ }
2396
+
2397
+ /**
2398
+ * Changes email notification for succes subscription for Ninja Forms
2399
+ *
2400
+ * @param string $message Body of email notification
2401
+ * @return string Body for email notification
2402
+ */
2403
+ function apbct_form__ninjaForms__changeMailNotification($message, $data, $action_settings){
2404
+
2405
+ global $apbct;
2406
+
2407
+ if($action_settings['to'] !== $apbct->sender_email){
2408
+
2409
+ $message .= wpautop(PHP_EOL . '---'
2410
+ .PHP_EOL
2411
+ .__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2412
+ .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2413
+ .PHP_EOL . 'IP: ' . $apbct->sender_ip
2414
+ .PHP_EOL . 'Email: ' . $apbct->sender_email
2415
+ .PHP_EOL .
2416
+ __('Activate protection in your Anti-Spam Dashboard: ', 'clentalk').
2417
+ 'https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=ninjaform_activate_antispam'.$apbct->user_token
2418
+ );
2419
+ }
2420
+
2421
+ return $message;
2422
+ }
2423
+
2424
+ /**
2425
+ * Inserts anti-spam hidden to WPForms
2426
+ *
2427
+ * @global SpbcState $apbct
2428
+ * @return void
2429
+ */
2430
+ function apbct_form__WPForms__addField($form_data, $some, $title, $description, $errors) {
2431
+
2432
+ global $apbct;
2433
+
2434
+ if($apbct->settings['contact_forms_test'] == 1)
2435
+ ct_add_hidden_fields('checkjs_wpforms', false);
2436
+
2437
+ }
2438
+
2439
+ /**
2440
+ * Gather fields data from submission and store it
2441
+ *
2442
+ * @param array $entry
2443
+ * @param $form
2444
+ *
2445
+ * @return array
2446
+ * @global SpbcState $apbct
2447
+ */
2448
+ function apbct_from__WPForms__gatherData($entry, $form){
2449
+
2450
+ global $apbct;
2451
+
2452
+ $data = array();
2453
+ foreach($entry['fields'] as $key => $val){
2454
+ $true_key = strtolower(str_replace(' ', '_', $form['fields'][$key]['label']));
2455
+ $true_key = $true_key ? $true_key : $key;
2456
+ $data[$true_key] = $val;
2457
+ } unset($key, $val);
2458
+
2459
+ $apbct->form_data = $data;
2460
+
2461
+ return $entry;
2462
+ }
2463
+
2464
+ /**
2465
+ * Adding error to form entry if message is spam
2466
+ * Call spam test from here
2467
+ *
2468
+ * @param array $errors
2469
+ * @param array $form_data
2470
+ * @return array
2471
+ */
2472
+ function apbct_form__WPForms__showResponse($errors, $form_data) {
2473
+
2474
+ if(empty($errors) || ( isset($form_data['id'], $errors[$form_data['id']]) && !count($errors[$form_data['id']]) ) ){
2475
+
2476
+ $spam_comment = apbct_form__WPForms__testSpam();
2477
+
2478
+ $filed_id = $form_data && !empty($form_data['fields']) && is_array($form_data['fields'])
2479
+ ? key($form_data['fields'])
2480
+ : 0;
2481
+
2482
+ if($spam_comment)
2483
+ $errors[ $form_data['id'] ][ $filed_id ] = $spam_comment;
2484
+
2485
+ }
2486
+
2487
+ return $errors;
2488
+ }
2489
+
2490
+ /**
2491
+ * Test WPForms message for spam
2492
+ * Doesn't hooked anywhere.
2493
+ * Called directly from apbct_form__WPForms__showResponse()
2494
+ *
2495
+ * @global SpbcState $apbct
2496
+ * @global array $apbct->form_data Contains form data
2497
+ * @param array $errors Array of errors to write false result in
2498
+ * @return void|array|null
2499
+ */
2500
+ function apbct_form__WPForms__testSpam() {
2501
+
2502
+ global $apbct;
2503
+
2504
+ if(
2505
+ $apbct->settings['contact_forms_test'] == 0 ||
2506
+ $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
2507
+ ){
2508
+ return;
2509
+ }
2510
+
2511
+ $checkjs = apbct_js_test('checkjs_wpforms', $_POST);
2512
+
2513
+ $params = ct_get_fields_any($apbct->form_data);
2514
+
2515
+ $sender_email = ($params['email'] ? $params['email'] : '');
2516
+ $sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
2517
+ $subject = ($params['subject'] ? $params['subject'] : '');
2518
+ $message = ($params['message'] ? $params['message'] : array());
2519
+ if ($subject != '') {
2520
+ $message = array_merge(array('subject' => $subject), $message);
2521
+ }
2522
+
2523
+ $base_call_result = apbct_base_call(
2524
+ array(
2525
+ 'message' => $message,
2526
+ 'sender_email' => $sender_email,
2527
+ 'sender_nickname' => $sender_nickname,
2528
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_wp_forms'),
2529
+ 'js_on' => $checkjs,
2530
+ )
2531
+ );
2532
+ $ct_result = $base_call_result['ct_result'];
2533
+
2534
+ // Change mail notification if license is out of date
2535
+ if($apbct->data['moderate'] == 0 &&
2536
+ ($ct_result->fast_submit == 1 || $ct_result->blacklisted == 1 || $ct_result->js_disabled == 1)
2537
+ ){
2538
+ $apbct->sender_email = $sender_email;
2539
+ $apbct->sender_ip = CleantalkHelper::ip__get(array('real'));
2540
+ add_filter('wpforms_email_message', 'apbct_form__WPForms__changeMailNotification', 100, 2);
2541
+ }
2542
+
2543
+ if ($ct_result->allow == 0){
2544
+ return $ct_result->comment;
2545
+ }
2546
+
2547
+ return null;
2548
+
2549
+ }
2550
+
2551
+ /**
2552
+ * Changes email notification for succes subscription for Ninja Forms
2553
+ *
2554
+ * @param string $message Body of email notification
2555
+ * @param WPForms_WP_Emails $wpforms_email WPForms email class object
2556
+ * @return string Body for email notification
2557
+ */
2558
+ function apbct_form__WPForms__changeMailNotification($message, $wpforms_email){
2559
+
2560
+ global $apbct;
2561
+
2562
+ $message = str_replace('</html>', '', $message);
2563
+ $message = str_replace('</body>', '', $message);
2564
+ $message .= wpautop(PHP_EOL . '---'
2565
+ .PHP_EOL
2566
+ .__('CleanTalk AntiSpam: This message is spam.', 'cleantalk')
2567
+ .PHP_EOL . __('CleanTalk\'s anti-spam database:', 'cleantalk')
2568
+ .PHP_EOL . 'IP: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_ip . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_ip . '</a>'
2569
+ .PHP_EOL . 'Email: ' . '<a href="https://cleantalk.org/blacklists/' . $apbct->sender_email . '?utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_spam_passed" target="_blank">' . $apbct->sender_email . '</a>'
2570
+ .PHP_EOL . sprintf(
2571
+ __('Activate protection in your %sAnti-Spam Dashboard%s.', 'clentalk'),
2572
+ '<a href="https://cleantalk.org/my/?cp_mode=antispam&utm_source=newsletter&utm_medium=email&utm_campaign=wpforms_activate_antispam" target="_blank">',
2573
+ '</a>'
2574
+ ))
2575
+ .'</body></html>';
2576
+
2577
+ return $message;
2578
+
2579
+ }
2580
+
2581
+ /*
2582
+ * QuForms check spam
2583
+ * works with singl-paged forms
2584
+ * and with multi-paged forms - check only last step of the forms
2585
+ */
2586
+ function ct_quform_post_validate($result, $form) {
2587
+
2588
+ if ( $form->hasPages() ) {
2589
+ $comment_type = 'contact_form_wordpress_quforms_multipage';
2590
+ } else {
2591
+ $comment_type = 'contact_form_wordpress_quforms_singlepage';
2592
+ }
2593
+
2594
+ $ct_temp_msg_data = ct_get_fields_any( $form->getValues() );
2595
+ // @ToDo If we have several emails at the form - will be used only the first detected!
2596
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2597
+
2598
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
2599
+ $base_call_result = apbct_base_call(
2600
+ array(
2601
+ 'message' => $form->getValues(),
2602
+ 'sender_email' => $sender_email,
2603
+ 'post_info' => array('comment_type' => $comment_type),
2604
+ 'js_on' => $checkjs,
2605
+ )
2606
+ );
2607
+
2608
+ $ct_result = $base_call_result['ct_result'];
2609
+ if ($ct_result->allow == 0) {
2610
+ die(json_encode(array('type' => 'error', 'apbct' => array('blocked' => true, 'comment' => $ct_result->comment))));
2611
+ } else {
2612
+ return $result;
2613
+ }
2614
+
2615
+ return $result;
2616
+
2617
+ }
2618
+
2619
+ /**
2620
+ * Inserts anti-spam hidden to Fast Secure contact form
2621
+ */
2622
+ function ct_si_contact_display_after_fields($string = '', $style = '', $form_errors = array(), $form_id_num = 0) {
2623
+ $string .= ct_add_hidden_fields('ct_checkjs', true);
2624
+ return $string;
2625
+ }
2626
+
2627
+ /**
2628
+ * Test for Fast Secure contact form
2629
+ */
2630
+ function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
2631
+ global $apbct, $cleantalk_executed;
2632
+
2633
+ if (!empty($form_errors))
2634
+ return $form_errors;
2635
+
2636
+ if ($apbct->settings['contact_forms_test'] == 0)
2637
+ return $form_errors;
2638
+
2639
+ // Skip processing because data already processed.
2640
+ if ($cleantalk_executed) {
2641
+ return $form_errors;
2642
+ }
2643
+
2644
+ //getting info from custom fields
2645
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
2646
+
2647
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2648
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2649
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2650
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2651
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2652
+ if($subject != '') {
2653
+ $message['subject'] = $subject;
2654
+ }
2655
+
2656
+ $base_call_result = apbct_base_call(
2657
+ array(
2658
+ 'message' => $message,
2659
+ 'sender_email' => $sender_email,
2660
+ 'sender_nickname' => $sender_nickname,
2661
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_fscf'),
2662
+ 'js_on' => apbct_js_test('ct_checkjs', $_POST),
2663
+ )
2664
+ );
2665
+
2666
+ $ct_result = $base_call_result['ct_result'];
2667
+
2668
+ $cleantalk_executed = true;
2669
+
2670
+ if ($ct_result->allow == 0) {
2671
+ global $ct_comment;
2672
+ $ct_comment = $ct_result->comment;
2673
+ ct_die(null, null);
2674
+ exit;
2675
+ }
2676
+
2677
+ return $form_errors;
2678
+ }
2679
+
2680
+ /**
2681
+ * Notice for commentators which comment has automatically approved by plugin
2682
+ * @param string $hook URL of hooked page
2683
+ */
2684
+ function ct_comment_text($comment_text) {
2685
+ global $comment, $ct_approved_request_id_label;
2686
+
2687
+ if (isset($_COOKIE[$ct_approved_request_id_label]) && isset($comment->comment_ID)) {
2688
+ $ct_hash = get_comment_meta($comment->comment_ID, 'ct_hash', true);
2689
+
2690
+ if ($ct_hash !== '' && $_COOKIE[$ct_approved_request_id_label] == $ct_hash) {
2691
+ $comment_text .= '<br /><br /> <em class="comment-awaiting-moderation">' . __('Comment approved. Anti-spam by CleanTalk.', 'cleantalk') . '</em>';
2692
+ }
2693
+ }
2694
+
2695
+ return $comment_text;
2696
+ }
2697
+
2698
+
2699
+ /**
2700
+ * Checks WordPress Landing Pages raw $_POST values
2701
+ */
2702
+ function ct_check_wplp(){
2703
+
2704
+ global $ct_wplp_result_label, $apbct;
2705
+
2706
+ if (!isset($_COOKIE[$ct_wplp_result_label])) {
2707
+ // First AJAX submit of WPLP form
2708
+ if ($apbct->settings['contact_forms_test'] == 0)
2709
+ return;
2710
+
2711
+ $post_info['comment_type'] = 'feedback';
2712
+ $post_info = json_encode($post_info);
2713
+ if ($post_info === false)
2714
+ $post_info = '';
2715
+
2716
+ $sender_email = '';
2717
+ foreach ($_POST as $v) {
2718
+ if (preg_match("/^\S+@\S+\.\S+$/", $v)) {
2719
+ $sender_email = $v;
2720
+ break;
2721
+ }
2722
+ }
2723
+
2724
+ $message = '';
2725
+ if(array_key_exists('form_input_values', $_POST)){
2726
+ $form_input_values = json_decode(stripslashes($_POST['form_input_values']), true);
2727
+ if (is_array($form_input_values) && array_key_exists('null', $form_input_values))
2728
+ $message = $form_input_values['null'];
2729
+ } else if (array_key_exists('null', $_POST)) {
2730
+ $message = $_POST['null'];
2731
+ }
2732
+
2733
+ $base_call_result = apbct_base_call(
2734
+ array(
2735
+ 'message' => $message,
2736
+ 'sender_email' => $sender_email,
2737
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_wplp'),
2738
+ )
2739
+ );
2740
+
2741
+ $ct_result = $base_call_result['ct_result'];
2742
+
2743
+ if ($ct_result->allow == 0) {
2744
+ $cleantalk_comment = $ct_result->comment;
2745
+ } else {
2746
+ $cleantalk_comment = 'OK';
2747
+ }
2748
+
2749
+ setcookie($ct_wplp_result_label, $cleantalk_comment, strtotime("+5 seconds"), '/');
2750
+ } else {
2751
+ // Next POST/AJAX submit(s) of same WPLP form
2752
+ $cleantalk_comment = $_COOKIE[$ct_wplp_result_label];
2753
+ }
2754
+ if ($cleantalk_comment !== 'OK')
2755
+ ct_die_extended($cleantalk_comment);
2756
+ }
2757
+
2758
+ /**
2759
+ * Places a hidding field to Gravity forms.
2760
+ * @return string
2761
+ */
2762
+ function apbct_form__gravityForms__addField($form_string, $form){
2763
+ $ct_hidden_field = 'ct_checkjs';
2764
+
2765
+ // Do not add a hidden field twice.
2766
+ if (preg_match("/$ct_hidden_field/", $form_string)) {
2767
+ return $form_string;
2768
+ }
2769
+
2770
+ $search = "</form>";
2771
+
2772
+ // Adding JS code
2773
+ $js_code = ct_add_hidden_fields($ct_hidden_field, true, false);
2774
+ $form_string = str_replace($search, $js_code . $search, $form_string);
2775
+
2776
+ // Adding field for multipage form. Look for cleantalk.php -> apbct_cookie();
2777
+ $append_string = isset($form['lastPageButton']) ? "<input type='hidden' name='ct_multipage_form' value='yes'>" : '';
2778
+ $form_string = str_replace($search, $append_string.$search, $form_string);
2779
+
2780
+ return $form_string;
2781
+ }
2782
+
2783
+ /**
2784
+ * Gravity forms anti-spam test.
2785
+ * @return boolean
2786
+ */
2787
+ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) {
2788
+
2789
+ global $apbct, $cleantalk_executed, $ct_gform_is_spam, $ct_gform_response;
2790
+
2791
+ if (
2792
+ $apbct->settings['contact_forms_test'] == 0 ||
2793
+ $is_spam ||
2794
+ $cleantalk_executed // Return unchanged result if the submission was already tested.
2795
+ )
2796
+ return $is_spam;
2797
+
2798
+ $ct_temp = array();
2799
+ foreach($entry as $key => $value){
2800
+ if(is_numeric($key))
2801
+ $ct_temp[$key]=$value;
2802
+ } unset($key, $value);
2803
+
2804
+ $ct_temp_msg_data = ct_get_fields_any($ct_temp);
2805
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2806
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2807
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2808
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2809
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2810
+
2811
+ // Adding 'input_' to every field /Gravity Forms fix/
2812
+ $message = array_flip($message);
2813
+ foreach($message as &$value){
2814
+ $value = 'input_'.$value;
2815
+ } unset($value);
2816
+ $message = array_flip($message);
2817
+
2818
+ if($subject != '')
2819
+ $message['subject'] = $subject;
2820
+
2821
+ $checkjs = apbct_js_test('ct_checkjs', $_POST)
2822
+ ? apbct_js_test('ct_checkjs', $_POST)
2823
+ : apbct_js_test('ct_checkjs', $_COOKIE);
2824
+
2825
+ $base_call_result = apbct_base_call(
2826
+ array(
2827
+ 'message' => $message,
2828
+ 'sender_email' => $sender_email,
2829
+ 'sender_nickname' => $sender_nickname,
2830
+ 'post_info' => array('comment_type' => 'contact_form_wordpress_gravity_forms'),
2831
+ 'js_on' => $checkjs,
2832
+ )
2833
+ );
2834
+
2835
+ $ct_result = $base_call_result['ct_result'];
2836
+ if ($ct_result->allow == 0) {
2837
+ $is_spam = true;
2838
+ $ct_gform_is_spam = true;
2839
+ $ct_gform_response = $ct_result->comment;
2840
+ }
2841
+
2842
+ return $is_spam;
2843
+ }
2844
+
2845
+ function apbct_form__gravityForms__showResponse( $confirmation, $form, $entry, $ajax ){
2846
+
2847
+ global $ct_gform_is_spam, $ct_gform_response;
2848
+
2849
+ if(!empty($ct_gform_is_spam)){
2850
+ $confirmation = '<a id="gf_'.$form['id'].'" class="gform_anchor" ></a><div id="gform_confirmation_wrapper_'.$form['id'].'" class="gform_confirmation_wrapper "><div id="gform_confirmation_message_'.$form['id'].'" class="gform_confirmation_message_'.$form['id'].' gform_confirmation_message"><font style="color: red">'.$ct_gform_response.'</font></div></div>';
2851
+ }
2852
+
2853
+ return $confirmation;
2854
+ }
2855
+
2856
+ /**
2857
+ * Test S2member registration
2858
+ * @return array with errors
2859
+ */
2860
+ function ct_s2member_registration_test($post_key) {
2861
+
2862
+ global $apbct;
2863
+
2864
+ if ($apbct->settings['registrations_test'] == 0) {
2865
+ return null;
2866
+ }
2867
+
2868
+ $sender_email = isset($_POST[$post_key]['email']) ? sanitize_email($_POST[$post_key]['email']) : null;
2869
+ $sender_nickname = isset($_POST[$post_key]['username']) ? sanitize_email($_POST[$post_key]['username']) : null;
2870
+
2871
+ //Making a call
2872
+ $base_call_result = apbct_base_call(
2873
+ array(
2874
+ 'sender_email' => $sender_email,
2875
+ 'sender_nickname' => $sender_nickname,
2876
+ ),
2877
+ true
2878
+ );
2879
+ $ct_result = $base_call_result['ct_result'];
2880
+
2881
+ if ($ct_result->allow == 0) {
2882
+ ct_die_extended($ct_result->comment);
2883
+ }
2884
+
2885
+ return true;
2886
+ }
2887
+
2888
+ function apbct_form__the7_contact_form() {
2889
+
2890
+ global $cleantalk_executed;
2891
+
2892
+ if ( check_ajax_referer( 'dt_contact_form', 'nonce', false ) && isset($_POST) ) {
2893
+
2894
+ $post_info['comment_type'] = 'contact_the7_theme_contact_form';
2895
+
2896
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
2897
+
2898
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2899
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2900
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2901
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
2902
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2903
+ if ($subject != '') {
2904
+ $message = array_merge(array('subject' => $subject), $message);
2905
+ }
2906
+
2907
+ // Skip submission if no data found
2908
+ if ($sender_email === ''|| !$contact_form) {
2909
+ return false;
2910
+ }
2911
+ $cleantalk_executed = true;
2912
+
2913
+ $base_call_result = apbct_base_call(
2914
+ array(
2915
+ 'message' => $message,
2916
+ 'sender_email' => $sender_email,
2917
+ 'sender_nickname' => $sender_nickname,
2918
+ 'post_info' => $post_info,
2919
+ )
2920
+ );
2921
+
2922
+ $ct_result = $base_call_result['ct_result'];
2923
+ if ($ct_result->allow == 0) {
2924
+
2925
+ $response = json_encode(
2926
+ array(
2927
+ 'success' => false ,
2928
+ 'errors' => $ct_result->comment,
2929
+ 'nonce' => wp_create_nonce( 'dt_contact_form' )
2930
+ )
2931
+ );
2932
+
2933
+ // response output
2934
+ header( "Content-Type: application/json" );
2935
+ echo $response;
2936
+
2937
+ // IMPORTANT: don't forget to "exit"
2938
+ exit;
2939
+
2940
+ }
2941
+
2942
+ }
2943
+
2944
+ }
2945
+
2946
+ function apbct_form__elementor_pro__testSpam() {
2947
+
2948
+ global $apbct, $cleantalk_executed;
2949
+
2950
+ if(
2951
+ $apbct->settings['contact_forms_test'] == 0
2952
+ || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2953
+ || apbct_exclusions_check__url()
2954
+ ){
2955
+ return;
2956
+ }
2957
+
2958
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
2959
+
2960
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2961
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2962
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2963
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2964
+ if ($subject != '') {
2965
+ $message = array_merge(array('subject' => $subject), $message);
2966
+ }
2967
+
2968
+ $post_info['comment_type'] = 'contact_form_wordpress_elementor_pro';
2969
+
2970
+ $cleantalk_executed = true;
2971
+ $base_call_result = apbct_base_call(
2972
+ array(
2973
+ 'message' => $message,
2974
+ 'sender_email' => $sender_email,
2975
+ 'sender_nickname' => $sender_nickname,
2976
+ 'post_info' => $post_info,
2977
+ )
2978
+ );
2979
+
2980
+ $ct_result = $base_call_result['ct_result'];
2981
+
2982
+ if ($ct_result->allow == 0) {
2983
+
2984
+ wp_send_json_error( array(
2985
+ 'message' => $ct_result->comment,
2986
+ 'data' => array()
2987
+ ) );
2988
+
2989
+ }
2990
+
2991
+ }
2992
+
2993
+ /**
2994
+ * General test for any contact form
2995
+ */
2996
+ function ct_contact_form_validate() {
2997
+
2998
+ global $pagenow,$cleantalk_executed ,$apbct, $ct_checkjs_frm;
2999
+
3000
+ // Exclusios common function
3001
+ if ( apbct_exclusions_check(__FUNCTION__) )
3002
+ return null;
3003
+
3004
+ if (@sizeof($_POST)==0 ||
3005
+ (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3006
+ (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3007
+ (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3008
+ apbct_is_in_referer( 'lostpassword' ) ||
3009
+ apbct_is_in_referer( 'lost-password' ) || //Skip lost-password form check
3010
+ (apbct_is_in_uri('/wp-admin/') && (empty($_POST['your-phone']) && empty($_POST['your-email']) && empty($_POST['your-message']))) || //Bitrix24 Contact
3011
+ apbct_is_in_uri('wp-login.php') ||
3012
+ apbct_is_in_uri('wp-comments-post.php') ||
3013
+ apbct_is_in_uri('?provider=facebook&') ||
3014
+ apbct_is_in_uri('reset-password/') || // Ticket #13668. Password reset.
3015
+ apbct_is_in_referer( '/wp-admin/') ||
3016
+ apbct_is_in_uri('/login/') ||
3017
+ apbct_is_in_uri( '/my-account/edit-account/') || // WooCommerce edit account page
3018
+ apbct_is_in_uri( '/my-account/edit-address/') || // WooCommerce edit account page
3019
+ (isset($_POST['action']) && $_POST['action'] == 'save_account_details') || // WooCommerce edit account action
3020
+ apbct_is_in_uri( '/peepsoajax/profilefieldsajax.validate_register') ||
3021
+ isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3022
+ isset($_POST['ct_checkjs_register_form']) ||
3023
+ (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3024
+ $apbct->settings['general_contact_forms_test'] == 0 ||
3025
+ isset($_POST['bbp_topic_content']) ||
3026
+ isset($_POST['bbp_reply_content']) ||
3027
+ isset($_POST['fscf_submitted']) ||
3028
+ apbct_is_in_uri('/wc-api/') ||
3029
+ isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit']) ||
3030
+ isset($_POST[$ct_checkjs_frm]) && $apbct->settings['contact_forms_test'] == 1 ||// Formidable forms
3031
+ isset($_POST['comment_post_ID']) || // The comment form
3032
+ isset($_GET['for']) ||
3033
+ (isset($_POST['log'], $_POST['pwd'])) || //WooCommerce Sensei login form fix
3034
+ (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || // WooCommerce recovery password form
3035
+ ((isset($_POST['woocommerce-login-nonce']) || isset($_POST['_wpnonce'])) && isset($_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || // WooCommerce login form
3036
+ (isset($_POST['wc-api']) && strtolower($_POST['wc-api']) == 'wc_gateway_systempay') || // Woo Systempay payment plugin
3037
+ (isset($_POST['_wpcf7'], $_POST['_wpcf7_version'], $_POST['_wpcf7_locale'])) || //CF7 fix)
3038
+ (isset($_POST['hash'], $_POST['device_unique_id'], $_POST['device_name'])) ||//Mobile Assistant Connector fix
3039
+ isset($_POST['gform_submit']) || //Gravity form
3040
+ apbct_is_in_uri( 'wc-ajax=get_refreshed_fragments') ||
3041
+ (isset($_POST['ccf_form']) && intval($_POST['ccf_form']) == 1) ||
3042
+ (isset($_POST['contact_tags']) && strpos($_POST['contact_tags'], 'MBR:') !== false) ||
3043
+ (apbct_is_in_uri( 'bizuno.php') && !empty($_POST['bizPass'])) ||
3044
+ apbct_is_in_referer( 'my-dashboard/' ) || // ticket_id=7885
3045
+ isset($_POST['slm_action'], $_POST['license_key'], $_POST['secret_key'], $_POST['registered_domain']) || // ticket_id=9122
3046
+ (isset($_POST['wpforms']['submit']) && $_POST['wpforms']['submit'] == 'wpforms-submit') || // WPForms
3047
+ (isset($_POST['action']) && $_POST['action'] == 'grunion-contact-form') || // JetPack
3048
+ (isset($_POST['action']) && $_POST['action'] == 'bbp-update-user') || //BBP update user info page
3049
+ apbct_is_in_referer( '?wc-api=WC_Gateway_Transferuj' ) || //WC Gateway
3050
+ (isset($_GET['mbr'], $_GET['amp;appname'], $_GET['amp;master'])) || // ticket_id=10773
3051
+ (isset($_POST['call_function']) && $_POST['call_function'] == 'push_notification_settings') || // Skip mobile requests (push settings)
3052
+ apbct_is_in_uri('membership-login') || // Skip login form
3053
+ (isset($_GET['cookie-state-change'])) || //skip GDPR plugin
3054
+ ( apbct_get_server_variable( 'HTTP_USER_AGENT' ) == 'MailChimp' && apbct_is_in_uri( 'mc4wp-sync-api/webhook-listener') ) || // Mailchimp webhook skip
3055
+ apbct_is_in_uri('researcher-log-in') || // Skip login form
3056
+ apbct_is_in_uri('admin_aspcms/_system/AspCms_SiteSetting.asp?action=saves') || // Skip admin save callback
3057
+ apbct_is_in_uri('?profile_tab=postjobs') || // Skip post vacancies
3058
+ (isset($_POST['btn_insert_post_type_hotel']) && $_POST['btn_insert_post_type_hotel'] == 'SUBMIT HOTEL') || // Skip adding hotel
3059
+ (isset($_POST['action']) && $_POST['action'] == 'updraft_savesettings') || // Updraft save settings
3060
+ isset($_POST['quform_submit']) || //QForms multi-paged form skip
3061
+ (isset($_POST['wpum_form']) && $_POST['wpum_form'] == 'login') || //WPUM login skip
3062
+ isset($_POST['password']) || // Exception for login form. From Analysis uid=406596
3063
+ (isset($_POST['action']) && $_POST['action'] == 'wilcity_reset_password') || // Exception for reset password form. From Analysis uid=430898
3064
+ (isset($_POST['action']) && $_POST['action'] == 'wilcity_login') || // Exception for login form. From Analysis uid=430898
3065
+ (isset($_POST['qcfsubmit'])) || //Exception for submit quick forms - duplicates with qcfvalidate
3066
+ apbct_is_in_uri('wc-ajax=update_order_review')
3067
+ ) {
3068
+ return null;
3069
+ }
3070
+
3071
+ // Do not execute anti-spam test for logged in users.
3072
+ if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
3073
+ return null;
3074
+
3075
+ $post_info['comment_type'] = 'feedback_general_contact_form';
3076
+
3077
+ // Skip the test if it's WooCommerce and the checkout test unset
3078
+ if( apbct_is_in_uri('wc-ajax=checkout') ||
3079
+ apbct_is_in_referer('wc-ajax=update_order_review') ||
3080
+ !empty($_POST['woocommerce_checkout_place_order']) ||
3081
+ apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout')
3082
+ ){
3083
+ if($apbct->settings['wc_checkout_test'] == 0){
3084
+ return null;
3085
+ }
3086
+ $post_info['comment_type'] = 'order';
3087
+ }
3088
+
3089
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
3090
+
3091
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
3092
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
3093
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
3094
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
3095
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
3096
+ if ($subject != '') {
3097
+ $message = array_merge(array('subject' => $subject), $message);
3098
+ }
3099
+
3100
+ // Skip submission if no data found
3101
+ if ($sender_email === ''|| !$contact_form) {
3102
+ return false;
3103
+ }
3104
+ $cleantalk_executed=true;
3105
+
3106
+ if(isset($_POST['TellAFriend_Link'])){
3107
+ $tmp = $_POST['TellAFriend_Link'];
3108
+ unset($_POST['TellAFriend_Link']);
3109
+ }
3110
+
3111
+ $base_call_result = apbct_base_call(
3112
+ array(
3113
+ 'message' => $message,
3114
+ 'sender_email' => $sender_email,
3115
+ 'sender_nickname' => $sender_nickname,
3116
+ 'post_info' => $post_info,
3117
+ )
3118
+ );
3119
+
3120
+ if(isset($_POST['TellAFriend_Link'])){
3121
+ $_POST['TellAFriend_Link']=$tmp;
3122
+ }
3123
+
3124
+ $ct_result = $base_call_result['ct_result'];
3125
+ if ($ct_result->allow == 0) {
3126
+
3127
+ // Recognize contact form an set it's name to $contact_form to use later
3128
+ $contact_form = null;
3129
+ foreach($_POST as $param => $value){
3130
+ if(strpos($param, 'et_pb_contactform_submit') === 0){
3131
+ $contact_form = 'contact_form_divi_theme';
3132
+ $contact_form_additional = str_replace('et_pb_contactform_submit', '', $param);
3133
+ }
3134
+ if(strpos($param, 'avia_generated_form') === 0){
3135
+ $contact_form = 'contact_form_enfold_theme';
3136
+ $contact_form_additional = str_replace('avia_generated_form', '', $param);
3137
+ }
3138
+ if(!empty($contact_form))
3139
+ break;
3140
+ }
3141
+
3142
+ $ajax_call = false;
3143
+ if ((defined( 'DOING_AJAX' ) && DOING_AJAX)
3144
+ ) {
3145
+ $ajax_call = true;
3146
+ }
3147
+ if ($ajax_call) {
3148
+ echo $ct_result->comment;
3149
+ } else {
3150
+
3151
+ global $ct_comment;
3152
+ $ct_comment = $ct_result->comment;
3153
+ if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add'){
3154
+ $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
3155
+ header("Content-Type: application/json");
3156
+ print json_encode($result);
3157
+ die();
3158
+
3159
+ }else if(isset($_POST['TellAFriend_email'])){
3160
+ echo $ct_result->comment;
3161
+ die();
3162
+
3163
+ }else if(isset($_POST['gform_submit'])){ // Gravity forms submission
3164
+ $response = sprintf("<!DOCTYPE html><html><head><meta charset='UTF-8' /></head><body class='GF_AJAX_POSTBACK'><div id='gform_confirmation_wrapper_1' class='gform_confirmation_wrapper '><div id='gform_confirmation_message_1' class='gform_confirmation_message_1
3165
+ gform_confirmation_message'>%s</div></div></body></html>",
3166
+ $ct_result->comment
3167
+ );
3168
+ echo $response;
3169
+ die();
3170
+
3171
+ }elseif(isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'],'wc-ajax=update_order_review')){ //WooCommerce checkout ("Place Oreder button")
3172
+ $result = Array(
3173
+ 'result' => 'failure',
3174
+ 'messages' => "<ul class=\"woocommerce-error\"><li>".$ct_result->comment."</li></ul>",
3175
+ 'refresh' => 'false',
3176
+ 'reload' => 'false'
3177
+ );
3178
+ print json_encode($result);
3179
+ die();
3180
+
3181
+ }elseif(isset($_POST['action']) && $_POST['action'] == 'ct_check_internal'){
3182
+ return $ct_result->comment;
3183
+
3184
+ }elseif(isset($_POST['vfb-submit']) && defined('VFB_VERSION')){
3185
+ wp_die("<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>", '', array('response' => 403, "back_link" => true, "text_direction" => 'ltr'));
3186
+ // Caldera Contact Forms
3187
+ }elseif(isset($_POST['action']) && $_POST['action'] == 'cf_process_ajax_submit'){
3188
+ print json_encode("<h3 style='color: red;'><red>".$ct_result->comment);
3189
+ die();
3190
+ // Mailster
3191
+ }elseif(isset($_POST['_referer'], $_POST['formid'], $_POST['email'])){
3192
+ $return = array(
3193
+ 'success' => false,
3194
+ 'html' => '<p>' . $ct_result->comment . '</p>',
3195
+ );
3196
+ print json_encode($return);
3197
+ die();
3198
+ // Divi Theme Contact Form. Using $contact_form
3199
+ }elseif(!empty($contact_form) && $contact_form == 'contact_form_divi_theme'){
3200
+ echo "<div id='et_pb_contact_form{$contact_form_additional}'><h1>Your request looks like spam.</h1><div><p>{$ct_result->comment}</p></div></div>";
3201
+ die();
3202
+ // Enfold Theme Contact Form. Using $contact_form
3203
+ }elseif(!empty($contact_form) && $contact_form == 'contact_form_enfold_theme'){
3204
+ echo "<div id='ajaxresponse_1' class='ajaxresponse ajaxresponse_1' style='display: block;'><div id='ajaxresponse_1' class='ajaxresponse ajaxresponse_1'><h3 class='avia-form-success'>Antispam by CleanTalk: ".$ct_result->comment."</h3><a href='.'><-Back</a></div></div>";
3205
+ die();
3206
+ }else{
3207
+ ct_die(null, null);
3208
+ }
3209
+ }
3210
+ exit;
3211
+ }
3212
+
3213
+ return null;
3214
+ }
3215
+
3216
+ /**
3217
+ * General test for any post data
3218
+ */
3219
+ function ct_contact_form_validate_postdata() {
3220
+
3221
+ global $apbct, $pagenow,$cleantalk_executed;
3222
+
3223
+ // Exclusios common function
3224
+ if ( apbct_exclusions_check(__FUNCTION__) )
3225
+ return null;
3226
+
3227
+ if (@sizeof($_POST)==0 ||
3228
+ (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3229
+ (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
3230
+ (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
3231
+ apbct_is_in_uri('/checkout/') ||
3232
+ /* WooCommerce Service Requests - skip them */
3233
+ isset($_GET['wc-ajax']) && (
3234
+ $_GET['wc-ajax']=='checkout' ||
3235
+ $_GET['wc-ajax']=='get_refreshed_fragments' ||
3236
+ $_GET['wc-ajax']=='apply_coupon' ||
3237
+ $_GET['wc-ajax']=='remove_coupon' ||
3238
+ $_GET['wc-ajax']=='update_shipping_method' ||
3239
+ $_GET['wc-ajax']=='get_cart_totals' ||
3240
+ $_GET['wc-ajax']=='update_order_review' ||
3241
+ $_GET['wc-ajax']=='add_to_cart' ||
3242
+ $_GET['wc-ajax']=='remove_from_cart' ||
3243
+ $_GET['wc-ajax']=='get_variation' ||
3244
+ $_GET['wc-ajax']=='get_customer_location'
3245
+ ) ||
3246
+ /* END: WooCommerce Service Requests */
3247
+ apbct_is_in_uri('/wp-admin/') ||
3248
+ apbct_is_in_uri('wp-login.php') ||
3249
+ apbct_is_in_uri('wp-comments-post.php') ||
3250
+ apbct_is_in_referer('/wp-admin/') ||
3251
+ apbct_is_in_uri('/login/') ||
3252
+ apbct_is_in_uri('?provider=facebook&') ||
3253
+ isset($_GET['ptype']) && $_GET['ptype']=='login' ||
3254
+ isset($_POST['ct_checkjs_register_form']) ||
3255
+ (isset($_POST['signup_username']) && isset($_POST['signup_password_confirm']) && isset($_POST['signup_submit']) ) ||
3256
+ $apbct->settings['general_contact_forms_test']==0 ||
3257
+ isset($_POST['bbp_topic_content']) ||
3258
+ isset($_POST['bbp_reply_content']) ||
3259
+ isset($_POST['fscf_submitted']) ||
3260
+ isset($_POST['log']) && isset($_POST['pwd']) && isset($_POST['wp-submit'])||
3261
+ apbct_is_in_uri('/wc-api/') ||
3262
+ (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])) || //WooCommerce recovery password form
3263
+ (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
3264
+ (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
3265
+ (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
3266
+ apbct_is_in_uri('/wp-json/wpstatistics/v1/hit') || //WPStatistics
3267
+ (isset($_POST['ihcaction']) && $_POST['ihcaction'] == 'login') || //Skip login form
3268
+ (isset($_POST['action']) && $_POST['action'] == 'infinite_scroll') //Scroll
3269
+ ) {
3270
+ return null;
3271
+ }
3272
+
3273
+ $message = ct_get_fields_any_postdata($_POST);
3274
+
3275
+ // ???
3276
+ if(strlen(json_encode($message))<10)
3277
+ return null;
3278
+
3279
+ // Skip if request contains params
3280
+ $skip_params = array(
3281
+ 'ipn_track_id', // PayPal IPN #
3282
+ 'txn_type', // PayPal transaction type
3283
+ 'payment_status', // PayPal payment status
3284
+ );
3285
+ foreach($skip_params as $key=>$value){
3286
+ if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST))
3287
+ return null;
3288
+ }
3289
+
3290
+ $base_call_result = apbct_base_call(
3291
+ array(
3292
+ 'message' => $message,
3293
+ 'post_info' => array('comment_type' => 'feedback_general_postdata'),
3294
+ )
3295
+ );
3296
+
3297
+ $cleantalk_executed=true;
3298
+
3299
+ $ct_result = $base_call_result['ct_result'];
3300
+
3301
+ if ($ct_result->allow == 0) {
3302
+
3303
+ if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
3304
+ global $ct_comment;
3305
+ $ct_comment = $ct_result->comment;
3306
+ if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add')
3307
+ {
3308
+ $result=Array('success'=>0, 'thread_id'=>null,'messages'=>Array($ct_result->comment));
3309
+ header("Content-Type: application/json");
3310
+ print json_encode($result);
3311
+ die();
3312
+ }
3313
+ else
3314
+ {
3315
+ ct_die(null, null);
3316
+ }
3317
+ } else {
3318
+ echo $ct_result->comment;
3319
+ }
3320
+ exit;
3321
+ }
3322
+
3323
+ return null;
3324
+ }
3325
+
3326
+
3327
+ /**
3328
+ * Inner function - Finds and returns pattern in string
3329
+ * @return null|bool
3330
+ */
3331
+ function ct_get_data_from_submit($value = null, $field_name = null) {
3332
+ if (!$value || !$field_name || !is_string($value)) {
3333
+ return false;
3334
+ }
3335
+ if (preg_match("/[a-z0-9_\-]*" . $field_name. "[a-z0-9_\-]*$/", $value)) {
3336
+ return true;
3337
+ }
3338
+ }
3339
+
3340
+ /**
3341
+ * Sends error notice to admin
3342
+ * @return null
3343
+ */
3344
+ function ct_send_error_notice ($comment = '') {
3345
+ global $ct_admin_notoice_period, $apbct;
3346
+
3347
+ $timelabel_reg = intval( get_option('cleantalk_timelabel_reg') );
3348
+ if(time() - $ct_admin_notoice_period > $timelabel_reg){
3349
+ update_option('cleantalk_timelabel_reg', time());
3350
+
3351
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
3352
+ $message = __('Attention, please!', 'cleantalk') . "\r\n\r\n";
3353
+ $message .= sprintf(__('"%s" plugin error on your site "%s":', 'cleantalk'), $apbct->plugin_name, $blogname) . "\r\n\r\n";
3354
+ $message .= preg_replace('/^(.*?)<a.*?"(.*?)".*?>(.*?)<.a>(.*)$/', '$1. $3: $2?user_token='. $apbct->user_token .' $4', $comment) . "\r\n\r\n";
3355
+ @wp_mail(ct_get_admin_email(), sprintf(__('[%s] "%s" error!', 'cleantalk'), $apbct->plugin_name, $blogname), $message);
3356
+ }
3357
+
3358
+ return null;
3359
+ }
3360
+
3361
+ function ct_print_form($arr, $k)
3362
+ {
3363
+ foreach($arr as $key => $value){
3364
+ if(!is_array($value)){
3365
+ if($k == ''){
3366
+ print '<textarea name="' . $key . '" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
3367
+ }else{
3368
+ print '<textarea name="' . $k . '[' . $key . ']" style="display:none;">' . htmlspecialchars($value) . '</textarea>';
3369
+ }
3370
+ }else{
3371
+ if($k == ''){
3372
+ ct_print_form($value, $key);
3373
+ }else{
3374
+ ct_print_form($value, $k . '[' . $key . ']');
3375
+ }
3376
+ }
3377
+ }
3378
+ }
3379
+
3380
+ /**
3381
+ * Attaches public scripts and styles.
3382
+ */
3383
+ function ct_enqueue_scripts_public($hook){
3384
+
3385
+ global $current_user, $apbct;
3386
+
3387
+ if($apbct->settings['registrations_test'] || $apbct->settings['comments_test'] || $apbct->settings['contact_forms_test'] || $apbct->settings['general_contact_forms_test'] || $apbct->settings['wc_checkout_test'] || $apbct->settings['check_external'] || $apbct->settings['check_internal'] || $apbct->settings['bp_private_messages'] || $apbct->settings['general_postdata_test']){
3388
+
3389
+ // Differnt JS params
3390
+ wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.min.js', array('jquery'), APBCT_VERSION, false /*in header*/);
3391
+
3392
+ wp_localize_script('ct_public', 'ctPublic', array(
3393
+ '_ajax_nonce' => wp_create_nonce('ct_secret_stuff'),
3394
+ '_ajax_url' => admin_url('admin-ajax.php'),
3395
+ ));
3396
+
3397
+ // GDPR script
3398
+ if($apbct->settings['gdpr_enabled']){
3399
+
3400
+ wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.min.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
3401
+
3402
+ wp_localize_script('ct_public_gdpr', 'ctPublicGDPR', array(
3403
+ 'gdpr_forms' => array(),
3404
+ 'gdpr_text' => $apbct->settings['gdpr_text'] ? $apbct->settings['gdpr_text'] : __('By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.', 'cleantalk'),
3405
+ ));
3406
+ }
3407
+
3408
+ }
3409
+
3410
+ if(!defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') || (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') && CLEANTALK_AJAX_USE_FOOTER_HEADER)){
3411
+ if($apbct->settings['use_ajax'] && ! apbct_is_in_uri('.xml') && ! apbct_is_in_uri('.xsl')){
3412
+ if( ! apbct_is_in_uri('jm-ajax') ){
3413
+
3414
+ // Use AJAX for JavaScript check
3415
+ if($apbct->settings['use_ajax']){
3416
+
3417
+ wp_enqueue_script('ct_nocache', plugins_url('/cleantalk-spam-protect/js/cleantalk_nocache.min.js'), array(), APBCT_VERSION, false /*in header*/);
3418
+
3419
+ wp_localize_script('ct_nocache', 'ctNocache', array(
3420
+ 'ajaxurl' => admin_url('admin-ajax.php'),
3421
+ 'info_flag' => $apbct->settings['collect_details'] && $apbct->settings['set_cookies'] ? true : false,
3422
+ 'set_cookies_flag' => $apbct->settings['set_cookies'] ? false : true,
3423
+ 'blog_home' => get_home_url().'/',
3424
+ ));
3425
+ }
3426
+
3427
+ // External forms check
3428
+ if($apbct->settings['check_external'])
3429
+ wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/js/cleantalk_external.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3430
+
3431
+ // Internal forms check
3432
+ if($apbct->settings['check_internal'])
3433
+ wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/js/cleantalk_internal.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3434
+
3435
+ }
3436
+ }
3437
+ }
3438
+
3439
+ // Show controls for commentaies
3440
+ if(in_array("administrator", $current_user->roles)){
3441
+
3442
+ if($apbct->settings['show_check_links']){
3443
+
3444
+ $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
3445
+
3446
+ wp_enqueue_style ('ct_public_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-public-admin.min.css'), array(), APBCT_VERSION, 'all');
3447
+ wp_enqueue_script('ct_public_admin_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-public-admin.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3448
+
3449
+ wp_localize_script('ct_public_admin_js', 'ctPublicAdmin', array(
3450
+ 'ct_ajax_nonce' => $ajax_nonce,
3451
+ 'ajaxurl' => admin_url('admin-ajax.php'),
3452
+ 'ct_feedback_error' => __('Error occured while sending feedback.', 'cleantalk'),
3453
+ 'ct_feedback_no_hash' => __('Feedback wasn\'t sent. There is no associated request.', 'cleantalk'),
3454
+ 'ct_feedback_msg' => sprintf(__("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk'), $apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '', $apbct->user_token ? "</a>" : ''),
3455
+ ));
3456
+
3457
+ }
3458
+ }
3459
+
3460
+ // Debug
3461
+ if($apbct->settings['debug_ajax']){
3462
+ wp_enqueue_script('ct_debug_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-debug-ajax.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3463
+
3464
+ wp_localize_script('ct_debug_js', 'apbctDebug', array(
3465
+ 'reload' => false,
3466
+ 'reload_time' => 10000,
3467
+ ));
3468
+ }
3469
+ }
3470
+
3471
+ /**
3472
+ * Reassign callbackback function for the bootom of comment output.
3473
+ */
3474
+ function ct_wp_list_comments_args($options){
3475
+
3476
+ global $current_user, $apbct;
3477
+
3478
+ if(in_array("administrator", $current_user->roles))
3479
+ if($apbct->settings['show_check_links'])
3480
+ $options['end-callback'] = 'ct_comments_output';
3481
+
3482
+ return $options;
3483
+ }
3484
+
3485
+ /**
3486
+ * Callback function for the bootom comment output.
3487
+ */
3488
+ function ct_comments_output($curr_comment, $param2, $wp_list_comments_args){
3489
+
3490
+ $email = $curr_comment->comment_author_email;
3491
+ $ip = $curr_comment->comment_author_IP;
3492
+ $id = $curr_comment->comment_ID;
3493
+
3494
+ $settings_link = '/wp-admin/'.(is_network_admin() ? "settings.php?page=cleantalk" : "options-general.php?page=cleantalk");
3495
+
3496
+ echo "<div class='ct_comment_info'><div class ='ct_comment_titles'>";
3497
+ echo "<p class='ct_comment_info_title'>".__('Sender info', 'cleantalk')."</p>";
3498
+
3499
+ echo "<p class='ct_comment_logo_title'>
3500
+ ".__('by', 'cleantalk')
3501
+ ." <a href='{$settings_link}' target='_blank'><img class='ct_comment_logo_img' src='".plugins_url()."/cleantalk-spam-protect/inc/images/logo_color.png'></a>"
3502
+ ." <a href='{$settings_link}' target='_blank'>CleanTalk</a>"
3503
+ ."</p></div>";
3504
+ // Outputs email if exists
3505
+ if($email)
3506
+ echo "<a href='https://cleantalk.org/blacklists/$email' target='_blank' title='https://cleantalk.org/blacklists/$email'>"
3507
+ ."$email"
3508
+ ."&nbsp;<img src='".plugins_url()."/cleantalk-spam-protect/inc/images/new_window.gif' border='0' style='float:none; box-shadow: transparent 0 0 0 !important;'/>"
3509
+ ."</a>";
3510
+ else
3511
+ echo __('No email', 'cleantalk');
3512
+ echo "&nbsp;|&nbsp;";
3513
+
3514
+ // Outputs IP if exists
3515
+ if($ip)
3516
+ echo "<a href='https://cleantalk.org/blacklists/$ip' target='_blank' title='https://cleantalk.org/blacklists/$ip'>"
3517
+ ."$ip"
3518
+ ."&nbsp;<img src='".plugins_url()."/cleantalk-spam-protect/inc/images/new_window.gif' border='0' style='float:none; box-shadow: transparent 0 0 0 !important;'/>"
3519
+ ."</a>";
3520
+ else
3521
+ echo __('No IP', 'cleantalk');
3522
+ echo '&nbsp;|&nbsp;';
3523
+
3524
+ echo "<span commentid='$id' class='ct_this_is ct_this_is_spam' href='#'>".__('Mark as spam', 'cleantalk')."</span>";
3525
+ echo "<span commentid='$id' class='ct_this_is ct_this_is_not_spam ct_hidden' href='#'>".__('Unspam', 'cleantalk')."</span>";
3526
+ echo "<p class='ct_feedback_wrap'>";
3527
+ echo "<span class='ct_feedback_result ct_feedback_result_spam'>".__('Marked as spam.', 'cleantalk')."</span>";
3528
+ echo "<span class='ct_feedback_result ct_feedback_result_not_spam'>".__('Marked as not spam.', 'cleantalk')."</span>";
3529
+ echo "&nbsp;<span class='ct_feedback_msg'><span>";
3530
+ echo "</p>";
3531
+
3532
+ echo "</div>";
3533
+
3534
+ // Ending comment output
3535
+ echo "</{$wp_list_comments_args['style']}>";
3536
+ }
3537
+
3538
+ /**
3539
+ * Callback function for the bootom comment output.
3540
+ *
3541
+ * attrs = array()
3542
+ */
3543
+ function apbct_shrotcode_handler__GDPR_public_notice__form( $attrs ){
3544
+
3545
+ $out = '';
3546
+
3547
+ if(isset($attrs['id']))
3548
+ $out .= 'ctPublicGDPR.gdpr_forms.push("'.$attrs['id'].'");';
3549
+
3550
+ if(isset($attrs['text']))
3551
+ $out .= 'ctPublicGDPR.gdpr_text = "'.$attrs['text'].'";';
3552
+
3553
+ $out = '<script>'.$out.'</script>';
3554
+ return $out;
3555
+ }
3556
+
3557
+ /**
3558
+ * Filters the 'status' array before register the user
3559
+ * using only by WICITY theme
3560
+ *
3561
+ * @param $success array array( 'status' => 'success' )
3562
+ * @param $data array ['username'] ['password'] ['email']
3563
+ * @return array array( 'status' => 'error' ) or array( 'status' => 'success' ) by default
3564
+ */
3565
+ function apbct_wilcity_reg_validation( $success, $data ) {
3566
+ $check = ct_test_registration( $data['username'], $data['email'], '' );
3567
+ if( $check['allow'] == 0 ) {
3568
+ return array( 'status' => 'error' );
3569
+ }
3570
+ return $success;
3571
+ }
inc/cleantalk-settings.php CHANGED
@@ -1,1456 +1,1456 @@
1
- <?php
2
-
3
- /**
4
- * Admin action 'admin_menu' - Add the admin options page
5
- */
6
- function apbct_settings_add_page() {
7
-
8
- global $apbct, $pagenow;
9
-
10
- $parent_slug = is_network_admin() ? 'settings.php' : 'options-general.php';
11
- $callback = is_network_admin() ? 'apbct_settings__display__network' : 'apbct_settings__display';
12
-
13
- // Adding settings page
14
- add_submenu_page(
15
- $parent_slug,
16
- $apbct->plugin_name.' '.__('settings'),
17
- $apbct->plugin_name,
18
- 'manage_options',
19
- 'cleantalk',
20
- $callback
21
- );
22
-
23
- if(!in_array($pagenow, array('options.php', 'options-general.php', 'settings.php', 'admin.php')))
24
- return;
25
-
26
- register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
27
-
28
- $fields = array();
29
- $fields = apbct_settings__set_fileds($fields);
30
- $fields = APBCT_WPMS && is_main_site() ? apbct_settings__set_fileds__network($fields) : $fields;
31
- apbct_settings__add_groups_and_fields($fields);
32
-
33
- }
34
-
35
- function apbct_settings__set_fileds( $fields ){
36
- global $apbct;
37
-
38
- $fields = array(
39
-
40
- 'main' => array(
41
- 'title' => '',
42
- 'default_params' => array(),
43
- 'description' => '',
44
- 'html_before' => '',
45
- 'html_after' => '',
46
- 'fields' => array(
47
- 'action_buttons' => array(
48
- 'callback' => 'apbct_settings__field__action_buttons',
49
- ),
50
- 'connection_reports' => array(
51
- 'callback' => 'apbct_settings__field__statistics',
52
- ),
53
- 'api_key' => array(
54
- 'display' => !$apbct->white_label || is_main_site(),
55
- 'callback' => 'apbct_settings__field__apikey',
56
- ),
57
- ),
58
- ),
59
-
60
- 'state' => array(
61
- 'title' => '',
62
- 'default_params' => array(),
63
- 'description' => '',
64
- 'html_before' => '<hr style="width: 100%;">',
65
- 'html_after' => '',
66
- 'fields' => array(
67
- 'state' => array(
68
- 'callback' => 'apbct_settings__field__state',
69
- ),
70
- ),
71
- ),
72
-
73
- 'debug' => array(
74
- 'title' => '',
75
- 'default_params' => array(),
76
- 'description' => '',
77
- 'html_before' => '',
78
- 'html_after' => '',
79
- 'fields' => array(
80
- 'state' => array(
81
- 'callback' => 'apbct_settings__field__debug',
82
- ),
83
- ),
84
- ),
85
-
86
- // Different
87
- 'different' => array(
88
- 'title' => '',
89
- 'default_params' => array(),
90
- 'description' => '',
91
- 'html_before' => '<hr>',
92
- 'html_after' => '',
93
- 'fields' => array(
94
- 'spam_firewall' => array(
95
- 'type' => 'checkbox',
96
- 'title' => __('SpamFireWall', 'cleantalk'),
97
- 'description' => __("This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'),
98
- ),
99
- ),
100
- ),
101
-
102
- // Forms protection
103
- 'forms_protection' => array(
104
- 'title' => __('Forms to protect', 'cleantalk'),
105
- 'default_params' => array(),
106
- 'description' => '',
107
- 'html_before' => '<hr><br>'
108
- .'<span id="ct_adv_showhide">'
109
- .'<a href="#" class="apbct_color--gray" onclick="event.preventDefault(); apbct_show_hide_elem(\'apbct_settings__davanced_settings\');">'
110
- .__('Advanced settings', 'cleantalk')
111
- .'</a>'
112
- .'</span>'
113
- .'<div id="apbct_settings__davanced_settings" style="display: none;">',
114
- 'html_after' => '',
115
- 'fields' => array(
116
- 'registrations_test' => array(
117
- 'title' => __('Registration Forms', 'cleantalk'),
118
- 'description' => __('WordPress, BuddyPress, bbPress, S2Member, WooCommerce.', 'cleantalk'),
119
- ),
120
- 'comments_test' => array(
121
- 'title' => __('Comments form', 'cleantalk'),
122
- 'description' => __('WordPress, JetPack, WooCommerce.', 'cleantalk'),
123
- ),
124
- 'contact_forms_test' => array(
125
- 'title' => __('Contact forms', 'cleantalk'),
126
- 'description' => __('Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, WordPress Landing Pages, Gravity Forms.', 'cleantalk'),
127
- ),
128
- 'general_contact_forms_test' => array(
129
- 'title' => __('Custom contact forms', 'cleantalk'),
130
- 'description' => __('Anti spam test for any WordPress themes or contacts forms.', 'cleantalk'),
131
- ),
132
- 'wc_checkout_test' => array(
133
- 'title' => __('WooCommerce checkout form', 'cleantalk'),
134
- 'description' => __('Anti spam test for WooCommerce checkout form.', 'cleantalk'),
135
- 'childrens' => array('wc_register_from_order')
136
- ),
137
- 'wc_register_from_order' => array(
138
- 'title' => __('Spam test for registration during checkout', 'cleantalk'),
139
- 'description' => __('Enable anti spam test for registration process which during woocommerce\'s checkout.', 'cleantalk'),
140
- 'parent' => 'wc_checkout_test',
141
- 'class' => 'apbct_settings-field_wrapper--sub',
142
- 'reverse_trigger' => true
143
- ),
144
- 'search_test' => array(
145
- 'title' => __('Test default Wordpress search form for spam', 'cleantalk'),
146
- 'description' => __('Spam protection for Search form.', 'cleantalk')
147
- . (!$apbct->white_label || is_main_site()
148
- ? sprintf(__('Read more about %sspam protection for Search form%s on our blog.', 'cleantalk'),
149
- '<a href="https://blog.cleantalk.org/how-to-protect-website-search-from-spambots/" target="_blank">',
150
- '</a>'
151
- )
152
- : ''
153
- )
154
- ),
155
- 'check_external' => array(
156
- 'title' => __('Protect external forms', 'cleantalk'),
157
- 'description' => __('Turn this option on to protect forms on your WordPress that send data to third-part servers (like MailChimp).', 'cleantalk'),
158
- 'childrens' => array('check_external__capture_buffer'),
159
- ),
160
- 'check_external__capture_buffer' => array(
161
- 'title' => __('Capture buffer', 'cleantalk'),
162
- 'description' => __('This setting gives you more sophisticated and strengthened protection for external forms. But it could break plugins which use a buffer like Ninja Forms.', 'cleantalk'),
163
- 'class' => 'apbct_settings-field_wrapper--sub',
164
- 'parent' => 'check_external',
165
- ),
166
- 'check_internal' => array(
167
- 'title' => __('Protect internal forms', 'cleantalk'),
168
- 'description' => __('This option will enable protection for custom (hand-made) AJAX forms with PHP scripts handlers on your WordPress.', 'cleantalk'),
169
- ),
170
- ),
171
- ),
172
-
173
- // Comments and Messages
174
- 'comments_and_messages' => array(
175
- 'title' => __('Comments and Messages', 'cleantalk'),
176
- 'fields' => array(
177
- 'bp_private_messages' => array(
178
- 'title' => __('BuddyPress Private Messages', 'cleantalk'),
179
- 'description' => __('Check buddyPress private messages.', 'cleantalk'),
180
- ),
181
- 'check_comments_number' => array(
182
- 'title' => __("Don't check trusted user's comments", 'cleantalk'),
183
- 'description' => sprintf(__("Don't check comments for users with above %d comments.", 'cleantalk'), defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3),
184
- ),
185
- 'remove_old_spam' => array(
186
- 'title' => __('Automatically delete spam comments', 'cleantalk'),
187
- 'description' => sprintf(__('Delete spam comments older than %d days.', 'cleantalk'), $apbct->data['spam_store_days']),
188
- ),
189
- 'remove_comments_links' => array(
190
- 'title' => __('Remove links from approved comments', 'cleantalk'),
191
- 'description' => __('Remove links from approved comments. Replace it with "[Link deleted]"', 'cleantalk'),
192
- ),
193
- 'show_check_links' => array(
194
- 'title' => __('Show links to check Emails, IPs for spam.', 'cleantalk'),
195
- 'description' => __('Shows little icon near IP addresses and Emails allowing you to check it via CleanTalk\'s database. Also allowing you to manage comments from the public post\'s page.', 'cleantalk'),
196
- 'display' => !$apbct->white_label,
197
- ),
198
- ),
199
- ),
200
-
201
- // Data Processing
202
- 'data_processing' => array(
203
- 'title' => __('Data Processing', 'cleantalk'),
204
- 'fields' => array(
205
- 'protect_logged_in' => array(
206
- 'title' => __("Protect logged in Users", 'cleantalk'),
207
- 'description' => __('Turn this option on to check for spam any submissions (comments, contact forms and etc.) from registered Users.', 'cleantalk'),
208
- ),
209
- 'use_ajax' => array(
210
- 'title' => __('Use AJAX for JavaScript check', 'cleantalk'),
211
- 'description' => __('Options helps protect WordPress against spam with any caching plugins. Turn this option on to avoid issues with caching plugins.', 'cleantalk'),
212
- ),
213
- 'use_static_js_key' => array(
214
- 'title' => __('Use static keys for JS check.', 'cleantalk'),
215
- 'description' => __('Could help if you have cache for AJAX requests and you are dealing with false positives. Slightly decreases protection quality. Auto - Static key will be used if caching plugin is spotted.', 'cleantalk'),
216
- 'options' => array(
217
- array('val' => 1, 'label' => __('On'), ),
218
- array('val' => 0, 'label' => __('Off'), ),
219
- array('val' => -1, 'label' => __('Auto'),),
220
- ),
221
- ),
222
- 'general_postdata_test' => array(
223
- 'title' => __('Check all post data', 'cleantalk'),
224
- 'description' => __('Check all POST submissions from website visitors. Enable this option if you have spam misses on website.', 'cleantalk')
225
- .(!$apbct->white_label
226
- ? __(' Or you don`t have records about missed spam here:', 'cleantalk') . '&nbsp;' . '<a href="https://cleantalk.org/my/?user_token='.$apbct->user_token.'&utm_source=wp-backend&utm_medium=admin-bar&cp_mode=antispam" target="_blank">' . __('CleanTalk dashboard', 'cleantalk') . '</a>.'
227
- : ''
228
- )
229
- .'<br />' . __('СAUTION! Option can catch POST requests in WordPress backend', 'cleantalk'),
230
- ),
231
- 'set_cookies' => array(
232
- 'title' => __("Set cookies", 'cleantalk'),
233
- 'description' => __('Turn this option off to deny plugin generates any cookies on website front-end. This option is helpful if you use Varnish. But most of contact forms will not be protected if the option is turned off! <b>Warning: We strongly recommend you to enable this otherwise it could cause false positives spam detection.</b>', 'cleantalk'),
234
- 'childrens' => array('set_cookies__sessions'),
235
- ),
236
- 'set_cookies__sessions' => array(
237
- 'title' => __('Use alternative mechanism for cookies', 'cleantalk'),
238
- 'description' => __('Doesn\'t use cookie or PHP sessions. Collect data for all types of bots.', 'cleantalk'),
239
- 'parent' => 'set_cookies',
240
- 'class' => 'apbct_settings-field_wrapper--sub',
241
- ),
242
- 'ssl_on' => array(
243
- 'title' => __("Use SSL", 'cleantalk'),
244
- 'description' => __('Turn this option on to use encrypted (SSL) connection with servers.', 'cleantalk'),
245
- ),
246
- 'use_buitin_http_api' => array(
247
- 'title' => __("Use Wordpress HTTP API", 'cleantalk'),
248
- 'description' => __('Alternative way to connect the Cloud. Use this if you have connection problems.', 'cleantalk'),
249
- ),
250
- ),
251
- ),
252
-
253
- // Exclusions
254
- 'exclusions' => array(
255
- 'title' => __('Exclusions', 'cleantalk'),
256
- 'fields' => array(
257
- 'exclusions__urls' => array(
258
- 'type' => 'text',
259
- 'title' => __('URL exclusions', 'cleantalk'),
260
- 'description' => __('You could type here URL you want to exclude. Use comma as separator.', 'cleantalk'),
261
- ),
262
- 'exclusions__urls__use_regexp' => array(
263
- 'type' => 'checkbox',
264
- 'title' => __('Use Regular Expression in URL Exclusions', 'cleantalk'),
265
- ),
266
- 'exclusions__fields' => array(
267
- 'type' => 'text',
268
- 'title' => __('Field name exclusions', 'cleantalk'),
269
- 'description' => __('You could type here fields names you want to exclude. Use comma as separator.', 'cleantalk'),
270
- ),
271
- 'exclusions__fields__use_regexp' => array(
272
- 'type' => 'checkbox',
273
- 'title' => __('Use Regular Expression in Field Exclusions', 'cleantalk'),
274
- ),
275
- 'exclusions__roles' => array(
276
- 'type' => 'select',
277
- 'multiple' => true,
278
- 'options_callback' => 'apbct_get_all_roles',
279
- 'options_callback_params' => array(true),
280
- 'description' => __('Roles which bypass spam test. Hold CTRL to select multiple roles.', 'cleantalk'),
281
- ),
282
- ),
283
- ),
284
-
285
- // Admin bar
286
- 'admin_bar' => array(
287
- 'title' => __('Admin bar', 'cleantalk'),
288
- 'default_params' => array(),
289
- 'description' => '',
290
- 'html_before' => '',
291
- 'html_after' => '',
292
- 'fields' => array(
293
- 'show_adminbar' => array(
294
- 'title' => __('Show statistics in admin bar', 'cleantalk'),
295
- 'description' => __('Show/hide icon in top level menu in WordPress backend. The number of submissions is being counted for past 24 hours.', 'cleantalk'),
296
- 'childrens' => array('all_time_counter','daily_counter','sfw_counter'),
297
- ),
298
- 'all_time_counter' => array(
299
- 'title' => __('Show All-time counter', 'cleantalk'),
300
- 'description' => __('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'),
301
- 'parent' => 'show_adminbar',
302
- 'class' => 'apbct_settings-field_wrapper--sub',
303
- ),
304
- 'daily_counter' => array(
305
- 'title' => __('Show 24 hours counter', 'cleantalk'),
306
- 'description' => __('Display daily requests counter in the admin bar. Counter displays number of requests of the past 24 hours.', 'cleantalk'),
307
- 'parent' => 'show_adminbar',
308
- 'class' => 'apbct_settings-field_wrapper--sub',
309
- ),
310
- 'sfw_counter' => array(
311
- 'title' => __('SpamFireWall counter', 'cleantalk'),
312
- 'description' => __('Display SpamFireWall requests in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'),
313
- 'parent' => 'show_adminbar',
314
- 'class' => 'apbct_settings-field_wrapper--sub',
315
- ),
316
- ),
317
- ),
318
-
319
- // Misc
320
- 'misc' => array(
321
- 'html_after' => '</div><br>',
322
- 'fields' => array(
323
- 'collect_details' => array(
324
- 'type' => 'checkbox',
325
- 'title' => __('Collect details about browsers', 'cleantalk'),
326
- 'description' => __("Checking this box you allow plugin store information about screen size and browser plugins of website visitors. The option in a beta state.", 'cleantalk'),
327
- ),
328
- 'send_connection_reports' => array(
329
- 'type' => 'checkbox',
330
- 'title' => __('Send connection reports', 'cleantalk'),
331
- 'description' => __("Checking this box you allow plugin to send the information about your connection. The option in a beta state.", 'cleantalk'),
332
- ),
333
- 'async_js' => array(
334
- 'type' => 'checkbox',
335
- 'title' => __('Async JavaScript loading', 'cleantalk'),
336
- 'description' => __('Use async loading for scripts. Warning: This could reduce filtration quality.', 'cleantalk'),
337
- ),
338
- 'gdpr_enabled' => array(
339
- 'type' => 'checkbox',
340
- 'title' => __('Allow to add GDPR notice via shortcode', 'cleantalk'),
341
- 'description' => __(' Adds small checkbox under your website form. To add it you should use the shortcode on the form\'s page: [cleantalk_gdpr_form id="FORM_ID"]', 'cleantalk'),
342
- 'childrens' => array('gdpr_text'),
343
- ),
344
- 'gdpr_text' => array(
345
- 'type' => 'text',
346
- 'title' => __('GDPR text notice', 'cleantalk'),
347
- 'description' => __('This text will be added as a description to the GDPR checkbox.', 'cleantalk'),
348
- 'parent' => 'gdpr_enabled',
349
- 'class' => 'apbct_settings-field_wrapper--sub',
350
- ),
351
- 'store_urls' => array(
352
- 'type' => 'checkbox',
353
- 'title' => __('Store visited URLs', 'cleantalk'),
354
- 'description' => __("Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits form on the site. You can see stored visited URLS for each visitor in your Dashboard. Turn the option on to improve Anti-Spam protection.", 'cleantalk'),
355
- 'childrens' => array('store_urls__sessions'),
356
- ),
357
- 'store_urls__sessions' => array(
358
- 'type' => 'checkbox',
359
- 'title' => __('Use cookies less sessions', 'cleantalk'),
360
- 'description' => __('Doesn\'t use cookie or PHP sessions. Collect data for all types of bots.', 'cleantalk'),
361
- 'parent' => 'store_urls',
362
- 'class' => 'apbct_settings-field_wrapper--sub',
363
- ),
364
- 'comment_notify' => array(
365
- 'type' => 'checkbox',
366
- 'title' => __('Notify users with selected roles about new approved comments. Hold CTRL to select multiple roles.', 'cleantalk'),
367
- 'description' => sprintf(__("If enabled, overrides similar Wordpress %sdiscussion settings%s.", 'cleantalk'), '<a href="options-discussion.php">','</a>'),
368
- 'childrens' => array('comment_notify__roles'),
369
- ),
370
- 'comment_notify__roles' => array(
371
- 'type' => 'select',
372
- 'multiple' => true,
373
- 'parent' => 'comment_notify',
374
- 'options_callback' => 'apbct_get_all_roles',
375
- 'options_callback_params' => array(true),
376
- 'class' => 'apbct_settings-field_wrapper--sub',
377
- ),
378
- 'complete_deactivation' => array(
379
- 'type' => 'checkbox',
380
- 'title' => __('Complete deactivation', 'cleantalk'),
381
- 'description' => __('Leave no trace in the system after deactivation.', 'cleantalk'),
382
- ),
383
-
384
- ),
385
- ),
386
- );
387
-
388
- return $fields;
389
- }
390
-
391
- function apbct_settings__set_fileds__network( $fields ){
392
- global $apbct;
393
- $additional_fields = array(
394
- 'main' => array(
395
- 'fields' => array(
396
- 'white_label' => array(
397
- 'type' => 'checkbox',
398
- 'title' => __('Enable White Label Mode', 'cleantalk'),
399
- 'description' => sprintf(__("Learn more information %shere%s.", 'cleantalk'), '<a tearget="_blank" href="https://cleantalk.org/ru/help/hosting-white-label">', '</a>'),
400
- 'childrens' => array('white_label__hoster_key', 'white_label__plugin_name', 'allow_custom_key'),
401
- 'network' => true,
402
- ),
403
- 'white_label__hoster_key' => array(
404
- 'title' => __('Hoster API Key', 'cleantalk'),
405
- 'description' => sprintf(__("You can get it in %sCleantalk's Control Panel%s", 'cleantalk'), '<a tearget="_blank" href="https://cleantalk.org/my/?cp_mode=hosting-antispam">', '</a>'),
406
- 'type' => 'text',
407
- 'parent' => 'white_label',
408
- 'class' => 'apbct_settings-field_wrapper--sub',
409
- 'network' => true,
410
- 'required' => true,
411
- ),
412
- 'white_label__plugin_name' => array(
413
- 'title' => __('Plugin name', 'cleantalk'),
414
- 'description' => sprintf(__("Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s", 'cleantalk'), '<b>', '</b>'),
415
- 'type' => 'text',
416
- 'parent' => 'white_label',
417
- 'class' => 'apbct_settings-field_wrapper--sub',
418
- 'network' => true,
419
- 'required' => true,
420
- ),
421
- 'allow_custom_key' => array(
422
- 'type' => 'checkbox',
423
- 'title' => __('Allow users to use other key', 'cleantalk'),
424
- 'description' => __('Allow users to use different Access key in their plugin settings on child blogs. They could use different CleanTalk account.', 'cleantalk')
425
- . (defined('CLEANTALK_ACCESS_KEY')
426
- ? ' <span style="color: red">'
427
- . __('Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key from this constant. Look into wp-config.php', 'cleantalk')
428
- . '</span>'
429
- : ''
430
- ),
431
- 'display' => APBCT_WPMS && is_main_site(),
432
- 'disabled' => $apbct->network_settings['white_label'],
433
- 'network' => true,
434
- ),
435
- )
436
- )
437
- );
438
-
439
- $fields = array_merge_recursive($fields, $additional_fields);
440
-
441
- return $fields;
442
-
443
- }
444
-
445
- function apbct_settings__add_groups_and_fields( $fields ){
446
-
447
- global $apbct;
448
-
449
- $apbct->settings_fields_in_groups = $fields;
450
-
451
- $field_default_params = array(
452
- 'callback' => 'apbct_settings__field__draw',
453
- 'type' => 'radio',
454
- 'options' => array(
455
- array('val' => 1, 'label' => __('On'),),
456
- array('val' => 0, 'label' => __('Off'),),
457
- ),
458
- 'def_class' => 'apbct_settings-field_wrapper',
459
- 'class' => '',
460
- 'parent' => '',
461
- 'childrens' => array(),
462
- 'hide' => array(),
463
- // 'title' => 'Default title',
464
- // 'description' => 'Default description',
465
- 'display' => true, // Draw settings or not
466
- 'reverse_trigger' => false, // How to allow child settings. Childrens are opened when the parent triggered "ON". This is overrides by this option
467
- 'multiple' => false,
468
- 'description' => '',
469
- 'network' => false,
470
- 'disabled' => false,
471
- 'required' => false,
472
- );
473
-
474
- foreach($apbct->settings_fields_in_groups as $group_name => $group){
475
-
476
- add_settings_section('apbct_section__'.$group_name, '', 'apbct_section__'.$group_name, 'cleantalk');
477
-
478
- foreach($group['fields'] as $field_name => $field){
479
-
480
- // Normalize $field['options'] from callback function to this type array( array( 'val' => 1, 'label' => __('On'), ), )
481
- if(!empty($field['options_callback'])){
482
- $options = call_user_func_array($field['options_callback'], !empty($field['options_callback_params']) ? $field['options_callback_params'] : array());
483
- foreach ($options as &$option){
484
- $option = array('val' => $option, 'label' => $option);
485
- } unset($option);
486
- $field['options'] = $options;
487
- }
488
-
489
- $params = !empty($group['default_params'])
490
- ? array_merge($group['default_params'], $field)
491
- : array_merge($field_default_params, $field);
492
-
493
- $params['name'] = $field_name;
494
-
495
- if(!$params['display'])
496
- continue;
497
-
498
- add_settings_field(
499
- 'apbct_field__'.$field_name,
500
- '',
501
- $params['callback'],
502
- 'cleantalk',
503
- 'apbct_section__'.$group_name,
504
- $params
505
- );
506
-
507
- }
508
- }
509
- }
510
-
511
- /**
512
- * Admin callback function - Displays plugin options page
513
- */
514
- function apbct_settings__display() {
515
-
516
- global $apbct;
517
-
518
- // Title
519
- echo '<h2 class="apbct_settings-title">'.__($apbct->plugin_name, 'cleantalk').'</h2>';
520
-
521
- // Subtitle for IP license
522
- if($apbct->moderate_ip)
523
- echo '<h4 class="apbct_settings-subtitle apbct_color--gray">'. __('Hosting AntiSpam', 'cleantalk').'</h4>';
524
-
525
- echo '<form action="options.php" method="post">';
526
-
527
- apbct_settings__error__output();
528
-
529
- // Top info
530
- if(!$apbct->white_label){
531
- echo '<div style="float: right; padding: 15px 15px 5px 15px; font-size: 13px; position: relative; top: -55px; background: #f1f1f1;">';
532
-
533
- echo __('CleanTalk\'s tech support:', 'cleantalk')
534
- .'&nbsp;'
535
- .'<a target="_blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">Wordpress.org</a>.'
536
- // .' <a href="https://community.cleantalk.org/viewforum.php?f=25" target="_blank">'.__("Tech forum", 'cleantalk').'</a>'
537
- // .($user_token ? ", <a href='https://cleantalk.org/my/support?user_token=$user_token&cp_mode=antispam' target='_blank'>".__("Service support ", 'cleantalk').'</a>' : '').
538
- .'<br>';
539
- echo __('Plugin Homepage at', 'cleantalk').' <a href="http://cleantalk.org" target="_blank">cleantalk.org</a>.<br/>';
540
- echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
541
- echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
542
- echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
543
- if($apbct->key_is_ok)
544
- echo '<b style="display: inline-block; margin-top: 10px;">'.sprintf(__('Do you like CleanTalk? %sPost your feedback here%s.', 'cleantalk'), '<a href="https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post" target="_blank">', '</a>').'</b><br />';
545
- apbct_admin__badge__get_premium();
546
- echo '<div id="gdpr_dialog" style="display: none; padding: 7px;">';
547
- apbct_settings_show_gdpr_text('print');
548
- echo '</div>';
549
- echo '</div>';
550
- }
551
-
552
- // Output spam count
553
- if($apbct->key_is_ok && apbct_api_key__is_correct()){
554
- if($apbct->spam_count > 0){
555
- echo '<div class="apbct_settings-subtitle" style="top: 0; margin-bottom: 10px; width: 200px;">'
556
- .'<br>'
557
- .'<span>'
558
- .sprintf(
559
- __( '%s has blocked <b>%s</b> spam.', 'cleantalk' ),
560
- $apbct->plugin_name,
561
- number_format($apbct->spam_count, 0, ',', ' ')
562
- )
563
- .'</span>'
564
- .'<br>'
565
- .'<br>'
566
- .'</div>';
567
- }
568
- if(!$apbct->white_label){
569
- // CP button
570
- echo '<a class="cleantalk_link cleantalk_link-manual" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
571
- .__('Click here to get anti-spam statistics', 'cleantalk')
572
- .'</a>';
573
- echo '&nbsp;&nbsp;';
574
- // Support button
575
- echo '<a class="cleantalk_link cleantalk_link-auto" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support', 'cleantalk').'</a>';
576
- echo '<br>'
577
- .'<br>';
578
- }
579
- }
580
-
581
- settings_fields('cleantalk_settings');
582
- do_settings_fields('cleantalk', 'cleantalk_section_settings_main');
583
-
584
- foreach($apbct->settings_fields_in_groups as $group_name => $group){
585
-
586
- echo !empty($group['html_before']) ? $group['html_before'] : '';
587
- echo !empty($group['title']) ? '<h3 style="margin-left: 220px;">'.$group['title'].'</h3>' : '';
588
-
589
- do_settings_fields('cleantalk', 'apbct_section__'.$group_name);
590
-
591
- echo !empty($group['html_after']) ? $group['html_after'] : '';
592
-
593
- }
594
-
595
- echo '<br>';
596
- echo '<button name="submit" class="cleantalk_link cleantalk_link-manual" value="save_changes">'.__('Save Changes').'</button>';
597
-
598
- echo "</form>";
599
-
600
- if(!$apbct->white_label){
601
- // Translate banner for non EN locale
602
- if(substr(get_locale(), 0, 2) != 'en'){
603
- global $ct_translate_banner_template;
604
- require_once(CLEANTALK_PLUGIN_DIR.'templates/translate_banner.php');
605
- printf($ct_translate_banner_template, substr(get_locale(), 0, 2));
606
- }
607
- }
608
- }
609
-
610
- function apbct_settings__display__network(){
611
- // If it's network admin dashboard
612
- if(is_network_admin()){
613
- $link = get_site_option('siteurl').'wp-admin/options-general.php?page=cleantalk';
614
- printf("<h2>" . __("Please, enter the %splugin settings%s in main site dashboard.", 'cleantalk') . "</h2>", "<a href='$link'>", "</a>");
615
- return;
616
- }
617
- }
618
-
619
- function apbct_settings__error__output($return = false){
620
-
621
- global $apbct;
622
-
623
- // If have error message output error block.
624
-
625
- $out = '';
626
-
627
- if(!empty($apbct->errors) && !defined('CLEANTALK_ACCESS_KEY')){
628
-
629
- $errors = $apbct->errors;
630
-
631
- $error_texts = array(
632
- // Misc
633
- 'key_invalid' => __('Error occured while API key validating. Error: ', 'cleantalk'),
634
- 'key_get' => __('Error occured while automatically gettings access key. Error: ', 'cleantalk'),
635
- 'sfw_send_logs' => __('Error occured while sending sending SpamFireWall logs. Error: ', 'cleantalk'),
636
- 'sfw_update' => __('Error occured while updating SpamFireWall local base. Error: ' , 'cleantalk'),
637
- 'account_check' => __('Error occured while checking account status. Error: ', 'cleantalk'),
638
- 'api' => __('Error occured while excuting API call. Error: ', 'cleantalk'),
639
-
640
- // Validating settings
641
- 'settings_validate' => 'Validate Settings',
642
- 'exclusions_urls' => 'URL Exclusions',
643
- 'exclusions_fields' => 'Field Exclusions',
644
-
645
- // Unknown
646
- 'unknown' => __('Unknown error. Error: ', 'cleantalk'),
647
- );
648
-
649
- $errors_out = array();
650
-
651
- foreach($errors as $type => $error){
652
-
653
- if(!empty($error)){
654
-
655
- if(is_array(current($error))){
656
-
657
- foreach($error as $sub_type => $sub_error){
658
- $errors_out[$sub_type] = '';
659
- if(isset($sub_error['error_time']))
660
- $errors_out[$sub_type] .= date('Y-m-d H:i:s', $sub_error['error_time']) . ': ';
661
- $errors_out[$sub_type] .= (isset($error_texts[$type]) ? $error_texts[$type] : ucfirst($type)) . ': ';
662
- $errors_out[$sub_type] .= (isset($error_texts[$sub_type]) ? $error_texts[$sub_type] : $error_texts['unknown']) . ' ' . $sub_error['error'];
663
- }
664
- continue;
665
- }
666
-
667
- $errors_out[$type] = '';
668
- if(isset($error['error_time']))
669
- $errors_out[$type] .= date('Y-m-d H:i:s', $error['error_time']) . ': ';
670
- $errors_out[$type] .= (isset($error_texts[$type]) ? $error_texts[$type] : $error_texts['unknown']) . ' ' . (isset($error['error']) ? $error['error'] : '');
671
-
672
- }
673
- }
674
-
675
- if(!empty($errors_out)){
676
- $out .= '<div id="apbctTopWarning" class="error" style="position: relative;">'
677
- .'<h3 style="display: inline-block;">'.__('Errors:', 'cleantalk').'</h3>';
678
- foreach($errors_out as $value){
679
- $out .= '<h4>'.$value.'</h4>';
680
- }
681
- $out .= !$apbct->white_label
682
- ? '<h4 style="text-align: unset;">'.sprintf(__('You can get support any time here: %s.', 'cleantalk'), '<a target="blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">https://wordpress.org/support/plugin/cleantalk-spam-protect</a>').'</h4>'
683
- : '';
684
- $out .= '</div>';
685
- }
686
- }
687
-
688
- if($return) return $out; else echo $out;
689
- }
690
-
691
- function apbct_settings__field__debug(){
692
-
693
- global $apbct;
694
-
695
- if($apbct->debug){
696
-
697
- echo '<hr /><h2>Debug:</h2>';
698
- echo '<h4>Constants:</h4>';
699
- echo 'CLEANTALK_AJAX_USE_BUFFER '. (defined('CLEANTALK_AJAX_USE_BUFFER') ? (CLEANTALK_AJAX_USE_BUFFER ? 'true' : 'flase') : 'NOT_DEFINED')."<br>";
700
- echo 'CLEANTALK_AJAX_USE_FOOTER_HEADER '. (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') ? (CLEANTALK_AJAX_USE_FOOTER_HEADER ? 'true' : 'flase') : 'NOT_DEFINED')."<br>";
701
- echo 'CLEANTALK_ACCESS_KEY '. (defined('CLEANTALK_ACCESS_KEY') ? (CLEANTALK_ACCESS_KEY ? CLEANTALK_ACCESS_KEY : 'flase') : 'NOT_DEFINED')."<br>";
702
- echo 'CLEANTALK_CHECK_COMMENTS_NUMBER '. (defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? (CLEANTALK_CHECK_COMMENTS_NUMBER ? CLEANTALK_CHECK_COMMENTS_NUMBER : 0) : 'NOT_DEFINED')."<br>";
703
- echo 'CLEANTALK_CHECK_MESSAGES_NUMBER '. (defined('CLEANTALK_CHECK_MESSAGES_NUMBER') ? (CLEANTALK_CHECK_MESSAGES_NUMBER ? CLEANTALK_CHECK_MESSAGES_NUMBER : 0) : 'NOT_DEFINED')."<br>";
704
- echo 'CLEANTALK_PLUGIN_DIR '. (defined('CLEANTALK_PLUGIN_DIR') ? (CLEANTALK_PLUGIN_DIR ? CLEANTALK_PLUGIN_DIR : 'flase') : 'NOT_DEFINED')."<br>";
705
- echo 'WP_ALLOW_MULTISITE '. (defined('WP_ALLOW_MULTISITE') ? (WP_ALLOW_MULTISITE ? 'true' : 'flase') : 'NOT_DEFINED');
706
-
707
- echo "<h4>Debug log: <button type='submit' value='debug_drop' name='submit' style='font-size: 11px; padding: 1px;'>Drop debug data</button></h4>";
708
- echo "<div style='height: 500px; width: 80%; overflow: auto;'>";
709
-
710
- $output = print_r($apbct->debug, true);
711
- $output = str_replace("\n", "<br>", $output);
712
- $output = preg_replace("/[^\S]{4}/", "&nbsp;&nbsp;&nbsp;&nbsp;", $output);
713
- echo "$output";
714
-
715
- echo "</div>";
716
-
717
- }
718
- }
719
-
720
- function apbct_settings__field__state(){
721
-
722
- global $apbct;
723
-
724
- $path_to_img = plugin_dir_url(__FILE__) . "images/";
725
-
726
- $img = $path_to_img."yes.png";
727
- $img_no = $path_to_img."no.png";
728
- $img_no_gray = $path_to_img."no_gray.png";
729
- $color="black";
730
-
731
- if(!$apbct->key_is_ok){
732
- $img=$path_to_img."no.png";
733
- $img_no=$path_to_img."no.png";
734
- $color="black";
735
- }
736
-
737
- if(!apbct_api_key__is_correct($apbct->api_key)){
738
- $img = $path_to_img."yes_gray.png";
739
- $img_no = $path_to_img."no_gray.png";
740
- $color="gray";
741
- }
742
-
743
- if($apbct->moderate_ip){
744
- $img = $path_to_img."yes.png";
745
- $img_no = $path_to_img."no.png";
746
- $color="black";
747
- }
748
-
749
- if($apbct->moderate == 0){
750
- $img = $path_to_img."no.png";
751
- $img_no = $path_to_img."no.png";
752
- $color="black";
753
- }
754
-
755
- print '<div class="apbct_settings-field_wrapper" style="color:'.$color.'">';
756
-
757
- print '<h2>'.__('Protection is active', 'cleantalk').'</h2>';
758
-
759
- echo '<img class="apbct_status_icon" src="'.($apbct->settings['registrations_test'] == 1 ? $img : $img_no).'"/>'.__('Registration forms', 'cleantalk');
760
- echo '<img class="apbct_status_icon" src="'.($apbct->settings['comments_test']==1 ? $img : $img_no).'"/>'.__('Comments forms', 'cleantalk');
761
- echo '<img class="apbct_status_icon" src="'.($apbct->settings['contact_forms_test']==1 ? $img : $img_no).'"/>'.__('Contact forms', 'cleantalk');
762
- echo '<img class="apbct_status_icon" src="'.($apbct->settings['general_contact_forms_test']==1 ? $img : $img_no).'"/>'.__('Custom contact forms', 'cleantalk');
763
- if(!$apbct->white_label || is_main_site())
764
- echo '<img class="apbct_status_icon" src="'.($apbct->data['moderate'] == 1 ? $img : $img_no).'"/>'
765
- .'<a style="color: black" href="https://blog.cleantalk.org/real-time-email-address-existence-validation/">'.__('Validate email for existence', 'cleantalk').'</a>';
766
-
767
- // Autoupdate status
768
- if($apbct->notice_auto_update && (!$apbct->white_label || is_main_site())){
769
- echo '<img class="apbct_status_icon" src="'.($apbct->auto_update == 1 ? $img : ($apbct->auto_update == -1 ? $img_no : $img_no_gray)).'"/>'.__('Auto update', 'cleantalk')
770
- .' <sup><a href="http://cleantalk.org/help/cleantalk-auto-update" target="_blank">?</a></sup>';
771
- }
772
-
773
- // WooCommerce
774
- if(class_exists('WooCommerce'))
775
- echo '<img class="apbct_status_icon" src="'.($apbct->settings['wc_checkout_test'] == 1 ? $img : $img_no).'"/>'.__('WooCommerce checkout form', 'cleantalk');
776
- if($apbct->moderate_ip)
777
- print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$apbct->data['ip_license'].".<br />";
778
-
779
- print "</div>";
780
- }
781
-
782
- /**
783
- * Admin callback function - Displays inputs of 'apikey' plugin parameter
784
- */
785
- function apbct_settings__field__apikey(){
786
-
787
- global $apbct;
788
-
789
- echo '<div id="cleantalk_apikey_wrapper" class="apbct_settings-field_wrapper">';
790
-
791
- // Using key from Main site, or from CLEANTALK_ACCESS_KEY constant
792
- if(APBCT_WPMS && !is_main_site() && (!$apbct->allow_custom_key || defined('CLEANTALK_ACCESS_KEY'))){
793
- _e('<h3>Key is provided by Super Admin.</h3>', 'cleantalk');
794
- return;
795
- }
796
-
797
- echo '<label class="apbct_settings__label" for="cleantalk_apkey">' . __('Access key', 'cleantalk') . '</label>';
798
-
799
- echo '<input
800
- id="apbct_setting_apikey"
801
- class="apbct_setting_text apbct_setting---apikey"
802
- type="text"
803
- name="cleantalk_settings[apikey]"
804
- value="'
805
- . ($apbct->key_is_ok
806
- ? str_repeat('*', strlen($apbct->api_key))
807
- : $apbct->api_key
808
- )
809
- . '"
810
- key="' . $apbct->api_key . '"
811
- size="20"
812
- placeholder="' . __('Enter the key', 'cleantalk') . '"'
813
- . ' />';
814
-
815
- // Show account name associated with key
816
- if(!empty($apbct->data['account_name_ob'])){
817
- echo '<div class="apbct_display--none">'
818
- . sprintf( __('Account at cleantalk.org is %s.', 'cleantalk'),
819
- '<b>'.$apbct->data['account_name_ob'].'</b>'
820
- )
821
- . '</div>';
822
- };
823
-
824
- // Show key button
825
- if((apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok)){
826
- echo '<a id="apbct_showApiKey" class="ct_support_link" style="display: block" href="#">'
827
- . __('Show the access key', 'cleantalk')
828
- . '</a>';
829
-
830
- // "Auto Get Key" buttons. License agreement
831
- }else{
832
-
833
- echo '<br /><br />';
834
-
835
- // Auto get key
836
- if(!$apbct->ip_license){
837
- echo '<button class="cleantalk_link cleantalk_link-manual apbct_setting---get_key_auto" name="submit" type="submit" value="get_key_auto">'
838
- .__('Get Access Key Automatically', 'cleantalk')
839
- .'</button>';
840
- echo '<input type="hidden" id="ct_admin_timezone" name="ct_admin_timezone" value="null" />';
841
- echo '<br />';
842
- echo '<br />';
843
- }
844
-
845
- // Warnings and GDPR
846
- printf( __('Admin e-mail (%s) will be used for registration, if you want to use other email please %sGet Access Key Manually%s.', 'cleantalk'),
847
- ct_get_admin_email(),
848
- '<a class="apbct_color--gray" target="__blank" href="'
849
- . sprintf( 'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
850
- urlencode(ct_get_admin_email()),
851
- urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))
852
- )
853
- . '">',
854
- '</a>'
855
- );
856
-
857
- // License agreement
858
- if(!$apbct->ip_license){
859
- echo '<div>';
860
- echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
861
- echo '<label for="spbc_license_agreed">';
862
- printf( __('I accept %sLicense Agreement%s.', 'cleantalk'),
863
- '<a href="https://cleantalk.org/publicoffer" target="_blank" style="color:#66b;">',
864
- '</a>'
865
- );
866
- echo "</label>";
867
- echo '</div>';
868
- }
869
- }
870
-
871
- echo '</div>';
872
- }
873
-
874
- function apbct_settings__field__action_buttons(){
875
-
876
- global $apbct;
877
-
878
- echo '<div class="apbct_settings-field_wrapper">';
879
-
880
- if(apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok){
881
- echo '<div>'
882
- .'<a href="edit-comments.php?page=ct_check_spam" class="ct_support_link">' . __('Check comments for spam', 'cleantalk') . '</a>'
883
- .'&nbsp;&nbsp;'
884
- .'&nbsp;&nbsp;'
885
- .'<a href="users.php?page=ct_check_users" class="ct_support_link">' . __('Check users for spam', 'cleantalk') . '</a>'
886
- .'&nbsp;&nbsp;'
887
- .'&nbsp;&nbsp;'
888
- .'<a href="#" class="ct_support_link" onclick="apbct_show_hide_elem(\'apbct_statistics\')">' . __('Statistics & Reports', 'cleantalk') . '</a>'
889
- .'</div>';
890
-
891
- }
892
-
893
- echo '</div>';
894
- }
895
-
896
- function apbct_settings__field__statistics() {
897
-
898
- global $apbct, $wpdb;
899
-
900
- echo '<div id="apbct_statistics" class="apbct_settings-field_wrapper" style="display: none;">';
901
-
902
- // Last request
903
- printf(
904
- __('Last spam check request to %s server was at %s.', 'cleantalk'),
905
- $apbct->stats['last_request']['server'] ? $apbct->stats['last_request']['server'] : __('unknown', 'cleantalk'),
906
- $apbct->stats['last_request']['time'] ? date('M d Y H:i:s', $apbct->stats['last_request']['time']) : __('unknown', 'cleantalk')
907
- );
908
- echo '<br>';
909
-
910
- // Avarage time request
911
- printf(
912
- __('Average request time for past 7 days: %s seconds.', 'cleantalk'),
913
- $apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]['average_time']
914
- ? round($apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]['average_time'], 3)
915
- : __('unknown', 'cleantalk')
916
- );
917
- echo '<br>';
918
-
919
- // SFW last die
920
- printf(
921
- __('Last time SpamFireWall was triggered for %s IP at %s', 'cleantalk'),
922
- $apbct->stats['last_sfw_block']['ip'] ? $apbct->stats['last_sfw_block']['ip'] : __('unknown', 'cleantalk'),
923
- $apbct->stats['last_sfw_block']['time'] ? date('M d Y H:i:s', $apbct->stats['last_sfw_block']['time']) : __('unknown', 'cleantalk')
924
- );
925
- echo '<br>';
926
-
927
- // SFW last update
928
- $sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->prefix."cleantalk_sfw`", ARRAY_A);
929
- printf(
930
- __('SpamFireWall was updated %s. Now contains %s entries.', 'cleantalk'),
931
- $apbct->stats['sfw']['last_update_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_update_time']) : __('unknown', 'cleantalk'),
932
- isset($sfw_netwoks_amount[0]['cnt']) ? $sfw_netwoks_amount[0]['cnt'] : __('unknown', 'cleantalk')
933
- );
934
- echo '<br>';
935
-
936
- // SFW last sent logs
937
- printf(
938
- __('SpamFireWall sent %s events at %s.', 'cleantalk'),
939
- $apbct->stats['sfw']['last_send_amount'] ? $apbct->stats['sfw']['last_send_amount'] : __('unknown', 'cleantalk'),
940
- $apbct->stats['sfw']['last_send_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_send_time']) : __('unknown', 'cleantalk')
941
- );
942
- echo '<br>';
943
-
944
- // Connection reports
945
- if ($apbct->connection_reports){
946
-
947
- if ($apbct->connection_reports['negative'] == 0){
948
- _e('There are no failed connections to server.', 'cleantalk');
949
- }else{
950
- echo "<table id='negative_reports_table''>
951
- <tr>
952
- <td>#</td>
953
- <td><b>Date</b></td>
954
- <td><b>Page URL</b></td>
955
- <td><b>Report</b></td>
956
- <td><b>Server IP</b></td>
957
- </tr>";
958
- foreach($apbct->connection_reports['negative_report'] as $key => $report){
959
- echo '<tr>'
960
- . '<td>'.($key+1).'.</td>'
961
- . '<td>'.$report['date'].'</td>'
962
- . '<td>'.$report['page_url'].'</td>'
963
- . '<td>'.$report['lib_report'].'</td>'
964
- . '<td>'.$report['work_url'].'</td>'
965
- . '</tr>';
966
- }
967
- echo "</table>";
968
- echo '<br/>';
969
- echo '<button'
970
- . ' name="submit"'
971
- . ' class="cleantalk_link cleantalk_link-manual"'
972
- . ' value="ct_send_connection_report"'
973
- . (!$apbct->settings['send_connection_reports'] ? ' disabled="disabled"' : '')
974
- . '>'
975
- .__('Send report', 'cleantalk')
976
- .'</button>';
977
- if (!$apbct->settings['send_connection_reports']){
978
- echo '<br><br>';
979
- _e('Please, enable "Send connection reports" setting to be able to send reports', 'cleantalk');
980
- }
981
- }
982
-
983
- }
984
-
985
- echo '</div>';
986
- }
987
-
988
- /**
989
- * Get all current Wordpress roles, could except 'subscriber' role
990
- *
991
- * @param bool $except_subscriber
992
- *
993
- * @return array
994
- */
995
- function apbct_get_all_roles($except_subscriber = false) {
996
-
997
- global $wp_roles;
998
-
999
- $wp_roles = new WP_Roles();
1000
- $roles = $wp_roles->get_names();
1001
-
1002
- if($except_subscriber) {
1003
- $key = array_search( 'Subscriber', $roles );
1004
- if ( $key !== false ) {
1005
- unset( $roles[ $key ] );
1006
- }
1007
- }
1008
-
1009
- return $roles;
1010
- }
1011
-
1012
- function apbct_settings__field__draw($params = array()){
1013
-
1014
- global $apbct;
1015
-
1016
- $value = $params['network'] ? $apbct->network_settings[$params['name']] : $apbct->settings[$params['name']];
1017
- $value_parent = $params['parent']
1018
- ? ($params['network'] ? $apbct->network_settings[$params['parent']] : $apbct->settings[$params['parent']])
1019
- : false;
1020
-
1021
- $disabled = $params['parent'] && !$value_parent ? ' disabled="disabled"' : '';
1022
- $disabled = $params['disabled'] ? ' disabled="disabled"' : $disabled;
1023
-
1024
- $childrens = $params['childrens'] ? 'apbct_setting---' . implode(",apbct_setting---",$params['childrens']) : '';
1025
- $hide = $params['hide'] ? implode(",",$params['hide']) : '';
1026
-
1027
- echo '<div class="'.$params['def_class'].(isset($params['class']) ? ' '.$params['class'] : '').'">';
1028
-
1029
- switch($params['type']){
1030
-
1031
- // Checkbox type
1032
- case 'checkbox':
1033
- echo '<input
1034
- type="checkbox"
1035
- name="cleantalk_settings['.$params['name'].']"
1036
- id="apbct_setting_'.$params['name'].'"
1037
- value="1" '
1038
- ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1039
- .($value == '1' ? ' checked' : '')
1040
- .$disabled
1041
- .($params['required'] ? ' required="required"' : '')
1042
- .' onchange="'
1043
- . ($params['childrens'] ? ' apbctSettingsDependencies(\''. $childrens .'\');' : '')
1044
- . ($params['hide'] ? ' apbct_show_hide_elem(\''. $hide . '\');' : '')
1045
- . '"'
1046
- .' />'
1047
- .'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
1048
- .$params['title']
1049
- .'</label>';
1050
- echo isset($params['long_description'])
1051
- ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1052
- : '';
1053
- echo '<div class="apbct_settings-field_description">'
1054
- .$params['description']
1055
- .'</div>';
1056
- break;
1057
-
1058
- // Radio type
1059
- case 'radio':
1060
-
1061
- // Title
1062
- echo isset($params['title'])
1063
- ? '<h4 class="apbct_settings-field_title apbct_settings-field_title--'.$params['type'].'">'.$params['title'].'</h4>'
1064
- : '';
1065
-
1066
- // Popup description
1067
- echo isset($params['long_description'])
1068
- ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1069
- : '';
1070
-
1071
- echo '<div class="apbct_settings-field_content apbct_settings-field_content--'.$params['type'].'">';
1072
-
1073
- $disabled = '';
1074
-
1075
- // Disable child option if parent is ON
1076
- if($params['reverse_trigger']){
1077
- if($params['parent'] && $apbct->settings[$params['parent']]){
1078
- $disabled = ' disabled="disabled"';
1079
- }
1080
-
1081
- // Disable child option if parent if OFF
1082
- }else{
1083
- if($params['parent'] && !$apbct->settings[$params['parent']]){
1084
- $disabled = ' disabled="disabled"';
1085
- }
1086
- }
1087
-
1088
- foreach($params['options'] as $option){
1089
- echo '<input'
1090
- .' type="radio"'
1091
- ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1092
- ." id='apbct_setting_{$params['name']}__{$option['label']}'"
1093
- .' name="cleantalk_settings['.$params['name'].']"'
1094
- .' value="'.$option['val'].'"'
1095
- .($params['parent'] ? $disabled : '')
1096
- .($params['childrens']
1097
- ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\')"'
1098
- : ''
1099
- )
1100
- .($value == $option['val'] ? ' checked' : '')
1101
- .($params['required'] ? ' required="required"' : '')
1102
- .' />';
1103
- echo '<label for="apbct_setting_'.$params['name'].'__'.$option['label'].'"> ' . $option['label'] . '</label>';
1104
- echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
1105
- }
1106
-
1107
- echo isset($params['description'])
1108
- ? '<div class="apbct_settings-field_description">'.$params['description'].'</div>'
1109
- : '';
1110
-
1111
- echo '</div>';
1112
- break;
1113
-
1114
- // Dropdown list type
1115
- case 'select':
1116
- echo isset($params['title'])
1117
- ? '<h4 class="apbct_settings-field_title apbct_settings-field_title--'.$params['type'].'">'.$params['title'].'</h4>'
1118
- : '';
1119
- echo isset($params['long_description'])
1120
- ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1121
- : '';
1122
- echo '<select'
1123
- . ' id="apbct_setting_'.$params['name'].'"'
1124
- . " class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1125
- . ' name="cleantalk_settings['.$params['name'].']'.($params['multiple'] ? '[]"' : '"')
1126
- . ($params['multiple'] ? ' size="'. count($params['options']). '""' : '')
1127
- . ($params['multiple'] ? ' multiple="multiple"' : '')
1128
- . $disabled
1129
- . ($params['required'] ? ' required="required"' : '')
1130
- . ' >';
1131
-
1132
- foreach($params['options'] as $option){
1133
- echo '<option'
1134
- . ' value="' . $option['val'] . '"'
1135
- . ($params['multiple']
1136
- ? (in_array($option['val'], $value) ? ' selected="selected"' : '')
1137
- : ($value == $option['val'] ? 'selected="selected"' : '')
1138
- )
1139
- .'>'
1140
- . $option['label']
1141
- . '</option>';
1142
- }
1143
-
1144
- echo '</select>';
1145
- echo isset($params['long_description'])
1146
- ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1147
- : '';
1148
- echo isset($params['description'])
1149
- ? '<div class="apbct_settings-field_description">'.$params['description'].'</div>'
1150
- : '';
1151
-
1152
- break;
1153
-
1154
- // Text type
1155
- case 'text':
1156
-
1157
- echo '<input
1158
- type="text"
1159
- id="apbct_setting_'.$params['name'].'"
1160
- name="cleantalk_settings['.$params['name'].']"'
1161
- ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1162
- .' value="'. $value .'" '
1163
- .$disabled
1164
- .($params['required'] ? ' required="required"' : '')
1165
- .($params['childrens'] ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\')"' : '')
1166
- .' />'
1167
- . '&nbsp;'
1168
- .'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
1169
- .$params['title']
1170
- .'</label>';
1171
- echo '<div class="apbct_settings-field_description">'
1172
- .$params['description']
1173
- .'</div>';
1174
- break;
1175
- }
1176
-
1177
- echo '</div>';
1178
- }
1179
-
1180
- /**
1181
- * Admin callback function - Plugin parameters validator
1182
- *
1183
- * @global CleantalkState $apbct
1184
- * @param array $settings Array with passed settings
1185
- * @return array Array with processed settings
1186
- */
1187
- function apbct_settings__validate($settings) {
1188
-
1189
- global $apbct;
1190
-
1191
- // Set missing settings.
1192
- foreach($apbct->def_settings as $setting => $value){
1193
- if(!isset($settings[$setting])){
1194
- $settings[$setting] = null;
1195
- settype($settings[$setting], gettype($value));
1196
- }
1197
- } unset($setting, $value);
1198
-
1199
- // Set missing settings.
1200
- foreach($apbct->def_network_settings as $setting => $value){
1201
- if(!isset($settings[$setting])){
1202
- $settings[$setting] = null;
1203
- settype($settings[$setting], gettype($value));
1204
- }
1205
- } unset($setting, $value);
1206
-
1207
- // Validating API key
1208
- $settings['apikey'] = !empty($settings['apikey']) ? trim($settings['apikey']) : '';
1209
- $settings['apikey'] = defined('CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $settings['apikey'];
1210
- $settings['apikey'] = is_main_site() || $apbct->allow_custom_key ? $settings['apikey'] : $apbct->network_settings['apikey'];
1211
- $settings['apikey'] = is_main_site() || !$settings['white_label'] ? $settings['apikey'] : $apbct->settings['apikey'];
1212
- $settings['apikey'] = strpos($settings['apikey'], '*') === false ? $settings['apikey'] : $apbct->settings['apikey'];
1213
-
1214
- // Validate Exclusions
1215
- // URLs
1216
- $result = apbct_settings__sanitize__exclusions($settings['exclusions__urls'], $settings['exclusions__urls__use_regexp']);
1217
- $result === false
1218
- ? $apbct->error_add( 'exclusions_urls', 'is not valid: "' . $settings['exclusions__urls'] . '"', 'settings_validate' )
1219
- : $apbct->error_delete( 'exclusions_urls', true, 'settings_validate' );
1220
- $settings['exclusions_urls'] = $result ? $result: '';
1221
-
1222
- // Fields
1223
- $result = apbct_settings__sanitize__exclusions($settings['exclusions__fields'], $settings['exclusions__fields__use_regexp']);
1224
- $result === false
1225
- ? $apbct->error_add( 'exclusions_fields', 'is not valid: "' . $settings['exclusions__fields'] . '"', 'settings_validate' )
1226
- : $apbct->error_delete( 'exclusions_fields', true, 'settings_validate' );
1227
- $settings['exclusions__fields'] = $result ? $result: '';
1228
-
1229
- // WPMS Logic.
1230
- if(APBCT_WPMS && is_main_site()){
1231
- $network_settings = array(
1232
- 'allow_custom_key' => $settings['allow_custom_key'],
1233
- 'white_label' => $settings['white_label'],
1234
- 'white_label__hoster_key' => $settings['white_label__hoster_key'],
1235
- 'white_label__plugin_name' => $settings['white_label__plugin_name'],
1236
- );
1237
- unset( $settings['allow_custom_key'], $settings['white_label'], $settings['white_label__hoster_key'], $settings['white_label__plugin_name'] );
1238
- }
1239
-
1240
- // Drop debug data
1241
- if (isset($_POST['submit']) && $_POST['submit'] == 'debug_drop'){
1242
- $apbct->debug = false;
1243
- delete_option('cleantalk_debug');
1244
- return $settings;
1245
- }
1246
-
1247
- // Send connection reports
1248
- if (isset($_POST['submit']) && $_POST['submit'] == 'ct_send_connection_report'){
1249
- ct_mail_send_connection_report();
1250
- return $settings;
1251
- }
1252
-
1253
- // Auto getting key
1254
- if (isset($_POST['submit']) && $_POST['submit'] == 'get_key_auto'){
1255
-
1256
- $website = parse_url(get_option('siteurl'), PHP_URL_HOST).parse_url(get_option('siteurl'), PHP_URL_PATH);
1257
- $platform = 'wordpress';
1258
- $user_ip = CleantalkHelper::ip__get(array('real'), false);
1259
- $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
1260
- $language = apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
1261
- $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && !SUBDOMAIN_INSTALL ? true : false;
1262
- $white_label = $apbct->network_settings['white_label'] ? 1 : 0;
1263
- $hoster_api_key = $apbct->network_settings['white_label__hoster_key'] ? $apbct->network_settings['white_label__hoster_key'] : '';
1264
-
1265
- $result = CleantalkAPI::method__get_api_key(
1266
- 'antispam',
1267
- ct_get_admin_email(),
1268
- $website,
1269
- $platform,
1270
- $timezone,
1271
- $language,
1272
- $user_ip,
1273
- $wpms,
1274
- $white_label,
1275
- $hoster_api_key
1276
- );
1277
-
1278
- if(empty($result['error'])){
1279
-
1280
- if(isset($result['user_token'])){
1281
- $apbct->data['user_token'] = $result['user_token'];
1282
- }
1283
-
1284
- if(!empty($result['auth_key'])){
1285
- $settings['apikey'] = $result['auth_key'];
1286
- }
1287
-
1288
- }else{
1289
- $apbct->error_add(
1290
- 'key_get',
1291
- $result['error']
1292
- . ($apbct->white_label
1293
- ? ' <button name="submit" type="submit" class="cleantalk_link cleantalk_link-manual" value="get_key_auto">'
1294
- : ''
1295
- )
1296
- );
1297
- }
1298
- }
1299
-
1300
- // Feedback with app_agent
1301
- ct_send_feedback('0:' . APBCT_AGENT); // 0 - request_id, agent version.
1302
-
1303
- // Key is good by default
1304
- $apbct->data['key_is_ok'] = true;
1305
-
1306
- // Check account status and validate key. Even if it's not correct because of IP license.
1307
- $result = ct_account_status_check($settings['apikey']);
1308
-
1309
- // Is key valid?
1310
- if($result){
1311
-
1312
- // Deleting errors about invalid key
1313
- $apbct->error_delete('key_invalid key_get', 'save');
1314
-
1315
- // SFW actions
1316
- if($apbct->settings['spam_firewall'] == 1){
1317
- ct_sfw_update($settings['apikey']);
1318
- ct_sfw_send_logs($settings['apikey']);
1319
- }
1320
-
1321
- // Updating brief data for dashboard widget
1322
- $apbct->data['brief_data'] = CleantalkAPI::method__get_antispam_report_breif($settings['apikey']);
1323
-
1324
- // Key is not valid
1325
- }else{
1326
- $apbct->data['key_is_ok'] = false;
1327
- $apbct->error_add('key_invalid', __('Testing is failed. Please check the Access key.', 'cleantalk'));
1328
- }
1329
-
1330
- // WPMS Logic.
1331
- if(APBCT_WPMS){
1332
- if(is_main_site()){
1333
-
1334
- // Network settings
1335
- $network_settings['apikey'] = $settings['apikey'];
1336
- $apbct->network_settings = $network_settings;
1337
- $apbct->saveNetworkSettings();
1338
-
1339
- // Network data
1340
- $apbct->network_data = array(
1341
- 'key_is_ok' => $apbct->data['key_is_ok'],
1342
- 'moderate' => $apbct->data['moderate'],
1343
- 'valid' => $apbct->data['valid'],
1344
- 'auto_update' => $apbct->data['auto_update'],
1345
- 'user_token' => $apbct->data['user_token'],
1346
- 'service_id' => $apbct->data['service_id'],
1347
- );
1348
- $apbct->saveNetworkData();
1349
- }
1350
- if(!$apbct->white_label && !is_main_site() && !$apbct->allow_custom_key){
1351
- $settings['apikey'] = '';
1352
- }
1353
- }
1354
-
1355
- if($apbct->data['key_is_ok'] == false && $apbct->data['moderate_ip'] == 0){
1356
-
1357
- // Notices
1358
- $apbct->data['notice_show'] = 1;
1359
- $apbct->data['notice_renew'] = 0;
1360
- $apbct->data['notice_trial'] = 0;
1361
- $apbct->data['notice_review'] = 0;
1362
- $apbct->data['notice_auto_update'] = 0;
1363
-
1364
- // Other
1365
- $apbct->data['service_id'] = 0;
1366
- $apbct->data['valid'] = 0;
1367
- $apbct->data['moderate'] = 0;
1368
- $apbct->data['ip_license'] = 0;
1369
- $apbct->data['moderate_ip'] = 0;
1370
- $apbct->data['spam_count'] = 0;
1371
- $apbct->data['auto_update'] = 0;
1372
- $apbct->data['user_token'] = '';
1373
- $apbct->data['license_trial'] = 0;
1374
- $apbct->data['account_name_ob'] = '';
1375
- }
1376
-
1377
- $apbct->saveData();
1378
-
1379
- return $settings;
1380
- }
1381
-
1382
- /**
1383
- * Sanitize and validate exclusions.
1384
- * Explode given string by commas and trim each string.
1385
- * Skip element if it's empty.
1386
- *
1387
- * Return false if exclusion is bad
1388
- * Return sanitized string if all is ok
1389
- *
1390
- * @param string $exclusions
1391
- * @param bool $regexp
1392
- *
1393
- * @return bool|string
1394
- */
1395
- function apbct_settings__sanitize__exclusions($exclusions, $regexp = false){
1396
- $result = array();
1397
- if( ! empty( $exclusions ) ){
1398
- $exclusions = explode( ',', $exclusions );
1399
- foreach ( $exclusions as $exclusion ){
1400
- $sanitized_exclusion = trim( $exclusion );
1401
- if ( ! empty( $sanitized_exclusion ) ) {
1402
- if( $regexp && ! apbct_is_regexp( $exclusion ) )
1403
- return false;
1404
- $result[] = $sanitized_exclusion;
1405
- }
1406
- }
1407
- }
1408
- return implode( ',', $result );
1409
- }
1410
-
1411
- function apbct_settings_show_gdpr_text($print = false){
1412
-
1413
- $out = wpautop('The notice requirements remain and are expanded. They must include the retention time for personal data, and contact information for data controller and data protection officer has to be provided.
1414
- Automated individual decision-making, including profiling (Article 22) is contestable, similarly to the Data Protection Directive (Article 15). Citizens have rights to question and fight significant decisions that affect them that have been made on a solely-algorithmic basis. Many media outlets have commented on the introduction of a "right to explanation" of algorithmic decisions, but legal scholars have since argued that the existence of such a right is highly unclear without judicial tests and is limited at best.
1415
- To be able to demonstrate compliance with the GDPR, the data controller should implement measures, which meet the principles of data protection by design and data protection by default. Privacy by design and by default (Article 25) require data protection measures to be designed into the development of business processes for products and services. Such measures include pseudonymising personal data, by the controller, as soon as possible (Recital 78).
1416
- It is the responsibility and the liability of the data controller to implement effective measures and be able to demonstrate the compliance of processing activities even if the processing is carried out by a data processor on behalf of the controller (Recital 74).
1417
- Data Protection Impact Assessments (Article 35) have to be conducted when specific risks occur to the rights and freedoms of data subjects. Risk assessment and mitigation is required and prior approval of the national data protection authorities (DPAs) is required for high risks. Data protection officers (Articles 37–39) are required to ensure compliance within organisations.
1418
- They have to be appointed:')
1419
- .'<ul style="padding: 0px 25px; list-style: disc;">'
1420
- .'<li>for all public authorities, except for courts acting in their judicial capacity</li>'
1421
- .'<li>if the core activities of the controller or the processor are:</li>'
1422
- .'<ul style="padding: 0px 25px; list-style: disc;">'
1423
- .'<li>processing operations, which, by virtue of their nature, their scope and/or their purposes, require regular and systematic monitoring of data subjects on a large scale</li>'
1424
- .'<li>processing on a large scale of special categories of data pursuant to Article 9 and personal data relating to criminal convictions and offences referred to in Article 10;</li>'
1425
- .'</ul>'
1426
- .'</li>'
1427
- .'</ul>';
1428
-
1429
- if($print) echo $out; else return $out;
1430
- }
1431
-
1432
- function apbct_settings__get__long_description(){
1433
-
1434
- global $apbct;
1435
-
1436
- check_ajax_referer('ct_secret_nonce' );
1437
-
1438
- $setting_id = $_POST['setting_id'] ? $_POST['setting_id'] : '';
1439
-
1440
- $descriptions = array(
1441
- 'white_label' => array(
1442
- 'title' => __( 'XSS check', 'cleantalk' ),
1443
- 'desc' => __( 'Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to any user. As a result malicious scripts can not get access to the cookie files, session tokens and any other confidential information browsers use and store. Such scripts can even overwrite content of HTML pages. CleanTalk WAF monitors for patterns of these parameters and block them.', 'cleantalk' ),
1444
- ),
1445
- 'white_label__hoster_key' => array(
1446
- 'title' => __( 'SQL-injection check', 'cleantalk' ),
1447
- 'desc' => __( 'SQL Injection — one of the most popular ways to hack websites and programs that work with databases. It is based on injection of a custom SQL code into database queries. It could transmit data through GET, POST requests or cookie files in an SQL code. If a website is vulnerable and execute such injections then it would allow attackers to apply changes to the website\'s MySQL database.', 'cleantalk' ),
1448
- ),
1449
- 'white_label__plugin_name' => array(
1450
- 'title' => __( 'Check uploaded files', 'cleantalk' ),
1451
- 'desc' => __( 'The option checks each uploaded file to a website for malicious code. If it\'s possible for visitors to upload files to a website, for instance a work resume, then attackers could abuse it and upload an infected file to execute it later and get access to your website.', 'cleantalk' ),
1452
- ),
1453
- );
1454
-
1455
- die(json_encode($descriptions[$setting_id]));
1456
  }
1
+ <?php
2
+
3
+ /**
4
+ * Admin action 'admin_menu' - Add the admin options page
5
+ */
6
+ function apbct_settings_add_page() {
7
+
8
+ global $apbct, $pagenow;
9
+
10
+ $parent_slug = is_network_admin() ? 'settings.php' : 'options-general.php';
11
+ $callback = is_network_admin() ? 'apbct_settings__display__network' : 'apbct_settings__display';
12
+
13
+ // Adding settings page
14
+ add_submenu_page(
15
+ $parent_slug,
16
+ $apbct->plugin_name.' '.__('settings'),
17
+ $apbct->plugin_name,
18
+ 'manage_options',
19
+ 'cleantalk',
20
+ $callback
21
+ );
22
+
23
+ if(!in_array($pagenow, array('options.php', 'options-general.php', 'settings.php', 'admin.php')))
24
+ return;
25
+
26
+ register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
27
+
28
+ $fields = array();
29
+ $fields = apbct_settings__set_fileds($fields);
30
+ $fields = APBCT_WPMS && is_main_site() ? apbct_settings__set_fileds__network($fields) : $fields;
31
+ apbct_settings__add_groups_and_fields($fields);
32
+
33
+ }
34
+
35
+ function apbct_settings__set_fileds( $fields ){
36
+ global $apbct;
37
+
38
+ $fields = array(
39
+
40
+ 'main' => array(
41
+ 'title' => '',
42
+ 'default_params' => array(),
43
+ 'description' => '',
44
+ 'html_before' => '',
45
+ 'html_after' => '',
46
+ 'fields' => array(
47
+ 'action_buttons' => array(
48
+ 'callback' => 'apbct_settings__field__action_buttons',
49
+ ),
50
+ 'connection_reports' => array(
51
+ 'callback' => 'apbct_settings__field__statistics',
52
+ ),
53
+ 'api_key' => array(
54
+ 'display' => !$apbct->white_label || is_main_site(),
55
+ 'callback' => 'apbct_settings__field__apikey',
56
+ ),
57
+ ),
58
+ ),
59
+
60
+ 'state' => array(
61
+ 'title' => '',
62
+ 'default_params' => array(),
63
+ 'description' => '',
64
+ 'html_before' => '<hr style="width: 100%;">',
65
+ 'html_after' => '',
66
+ 'fields' => array(
67
+ 'state' => array(
68
+ 'callback' => 'apbct_settings__field__state',
69
+ ),
70
+ ),
71
+ ),
72
+
73
+ 'debug' => array(
74
+ 'title' => '',
75
+ 'default_params' => array(),
76
+ 'description' => '',
77
+ 'html_before' => '',
78
+ 'html_after' => '',
79
+ 'fields' => array(
80
+ 'state' => array(
81
+ 'callback' => 'apbct_settings__field__debug',
82
+ ),
83
+ ),
84
+ ),
85
+
86
+ // Different
87
+ 'different' => array(
88
+ 'title' => '',
89
+ 'default_params' => array(),
90
+ 'description' => '',
91
+ 'html_before' => '<hr>',
92
+ 'html_after' => '',
93
+ 'fields' => array(
94
+ 'spam_firewall' => array(
95
+ 'type' => 'checkbox',
96
+ 'title' => __('SpamFireWall', 'cleantalk'),
97
+ 'description' => __("This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'),
98
+ ),
99
+ ),
100
+ ),
101
+
102
+ // Forms protection
103
+ 'forms_protection' => array(
104
+ 'title' => __('Forms to protect', 'cleantalk'),
105
+ 'default_params' => array(),
106
+ 'description' => '',
107
+ 'html_before' => '<hr><br>'
108
+ .'<span id="ct_adv_showhide">'
109
+ .'<a href="#" class="apbct_color--gray" onclick="event.preventDefault(); apbct_show_hide_elem(\'apbct_settings__davanced_settings\');">'
110
+ .__('Advanced settings', 'cleantalk')
111
+ .'</a>'
112
+ .'</span>'
113
+ .'<div id="apbct_settings__davanced_settings" style="display: none;">',
114
+ 'html_after' => '',
115
+ 'fields' => array(
116
+ 'registrations_test' => array(
117
+ 'title' => __('Registration Forms', 'cleantalk'),
118
+ 'description' => __('WordPress, BuddyPress, bbPress, S2Member, WooCommerce.', 'cleantalk'),
119
+ ),
120
+ 'comments_test' => array(
121
+ 'title' => __('Comments form', 'cleantalk'),
122
+ 'description' => __('WordPress, JetPack, WooCommerce.', 'cleantalk'),
123
+ ),
124
+ 'contact_forms_test' => array(
125
+ 'title' => __('Contact forms', 'cleantalk'),
126
+ 'description' => __('Contact Form 7, Formidable forms, JetPack, Fast Secure Contact Form, WordPress Landing Pages, Gravity Forms.', 'cleantalk'),
127
+ ),
128
+ 'general_contact_forms_test' => array(
129
+ 'title' => __('Custom contact forms', 'cleantalk'),
130
+ 'description' => __('Anti spam test for any WordPress themes or contacts forms.', 'cleantalk'),
131
+ ),
132
+ 'wc_checkout_test' => array(
133
+ 'title' => __('WooCommerce checkout form', 'cleantalk'),
134
+ 'description' => __('Anti spam test for WooCommerce checkout form.', 'cleantalk'),
135
+ 'childrens' => array('wc_register_from_order')
136
+ ),
137
+ 'wc_register_from_order' => array(
138
+ 'title' => __('Spam test for registration during checkout', 'cleantalk'),
139
+ 'description' => __('Enable anti spam test for registration process which during woocommerce\'s checkout.', 'cleantalk'),
140
+ 'parent' => 'wc_checkout_test',
141
+ 'class' => 'apbct_settings-field_wrapper--sub',
142
+ 'reverse_trigger' => true
143
+ ),
144
+ 'search_test' => array(
145
+ 'title' => __('Test default Wordpress search form for spam', 'cleantalk'),
146
+ 'description' => __('Spam protection for Search form.', 'cleantalk')
147
+ . (!$apbct->white_label || is_main_site()
148
+ ? sprintf(__('Read more about %sspam protection for Search form%s on our blog.', 'cleantalk'),
149
+ '<a href="https://blog.cleantalk.org/how-to-protect-website-search-from-spambots/" target="_blank">',
150
+ '</a>'
151
+ )
152
+ : ''
153
+ )
154
+ ),
155
+ 'check_external' => array(
156
+ 'title' => __('Protect external forms', 'cleantalk'),
157
+ 'description' => __('Turn this option on to protect forms on your WordPress that send data to third-part servers (like MailChimp).', 'cleantalk'),
158
+ 'childrens' => array('check_external__capture_buffer'),
159
+ ),
160
+ 'check_external__capture_buffer' => array(
161
+ 'title' => __('Capture buffer', 'cleantalk'),
162
+ 'description' => __('This setting gives you more sophisticated and strengthened protection for external forms. But it could break plugins which use a buffer like Ninja Forms.', 'cleantalk'),
163
+ 'class' => 'apbct_settings-field_wrapper--sub',
164
+ 'parent' => 'check_external',
165
+ ),
166
+ 'check_internal' => array(
167
+ 'title' => __('Protect internal forms', 'cleantalk'),
168
+ 'description' => __('This option will enable protection for custom (hand-made) AJAX forms with PHP scripts handlers on your WordPress.', 'cleantalk'),
169
+ ),
170
+ ),
171
+ ),
172
+
173
+ // Comments and Messages
174
+ 'comments_and_messages' => array(
175
+ 'title' => __('Comments and Messages', 'cleantalk'),
176
+ 'fields' => array(
177
+ 'bp_private_messages' => array(
178
+ 'title' => __('BuddyPress Private Messages', 'cleantalk'),
179
+ 'description' => __('Check buddyPress private messages.', 'cleantalk'),
180
+ ),
181
+ 'check_comments_number' => array(
182
+ 'title' => __("Don't check trusted user's comments", 'cleantalk'),
183
+ 'description' => sprintf(__("Don't check comments for users with above %d comments.", 'cleantalk'), defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3),
184
+ ),
185
+ 'remove_old_spam' => array(
186
+ 'title' => __('Automatically delete spam comments', 'cleantalk'),
187
+ 'description' => sprintf(__('Delete spam comments older than %d days.', 'cleantalk'), $apbct->data['spam_store_days']),
188
+ ),
189
+ 'remove_comments_links' => array(
190
+ 'title' => __('Remove links from approved comments', 'cleantalk'),
191
+ 'description' => __('Remove links from approved comments. Replace it with "[Link deleted]"', 'cleantalk'),
192
+ ),
193
+ 'show_check_links' => array(
194
+ 'title' => __('Show links to check Emails, IPs for spam.', 'cleantalk'),
195
+ 'description' => __('Shows little icon near IP addresses and Emails allowing you to check it via CleanTalk\'s database. Also allowing you to manage comments from the public post\'s page.', 'cleantalk'),
196
+ 'display' => !$apbct->white_label,
197
+ ),
198
+ ),
199
+ ),
200
+
201
+ // Data Processing
202
+ 'data_processing' => array(
203
+ 'title' => __('Data Processing', 'cleantalk'),
204
+ 'fields' => array(
205
+ 'protect_logged_in' => array(
206
+ 'title' => __("Protect logged in Users", 'cleantalk'),
207
+ 'description' => __('Turn this option on to check for spam any submissions (comments, contact forms and etc.) from registered Users.', 'cleantalk'),
208
+ ),
209
+ 'use_ajax' => array(
210
+ 'title' => __('Use AJAX for JavaScript check', 'cleantalk'),
211
+ 'description' => __('Options helps protect WordPress against spam with any caching plugins. Turn this option on to avoid issues with caching plugins.', 'cleantalk'),
212
+ ),
213
+ 'use_static_js_key' => array(
214
+ 'title' => __('Use static keys for JS check.', 'cleantalk'),
215
+ 'description' => __('Could help if you have cache for AJAX requests and you are dealing with false positives. Slightly decreases protection quality. Auto - Static key will be used if caching plugin is spotted.', 'cleantalk'),
216
+ 'options' => array(
217
+ array('val' => 1, 'label' => __('On'), ),
218
+ array('val' => 0, 'label' => __('Off'), ),
219
+ array('val' => -1, 'label' => __('Auto'),),
220
+ ),
221
+ ),
222
+ 'general_postdata_test' => array(
223
+ 'title' => __('Check all post data', 'cleantalk'),
224
+ 'description' => __('Check all POST submissions from website visitors. Enable this option if you have spam misses on website.', 'cleantalk')
225
+ .(!$apbct->white_label
226
+ ? __(' Or you don`t have records about missed spam here:', 'cleantalk') . '&nbsp;' . '<a href="https://cleantalk.org/my/?user_token='.$apbct->user_token.'&utm_source=wp-backend&utm_medium=admin-bar&cp_mode=antispam" target="_blank">' . __('CleanTalk dashboard', 'cleantalk') . '</a>.'
227
+ : ''
228
+ )
229
+ .'<br />' . __('СAUTION! Option can catch POST requests in WordPress backend', 'cleantalk'),
230
+ ),
231
+ 'set_cookies' => array(
232
+ 'title' => __("Set cookies", 'cleantalk'),
233
+ 'description' => __('Turn this option off to deny plugin generates any cookies on website front-end. This option is helpful if you use Varnish. But most of contact forms will not be protected if the option is turned off! <b>Warning: We strongly recommend you to enable this otherwise it could cause false positives spam detection.</b>', 'cleantalk'),
234
+ 'childrens' => array('set_cookies__sessions'),
235
+ ),
236
+ 'set_cookies__sessions' => array(
237
+ 'title' => __('Use alternative mechanism for cookies', 'cleantalk'),
238
+ 'description' => __('Doesn\'t use cookie or PHP sessions. Collect data for all types of bots.', 'cleantalk'),
239
+ 'parent' => 'set_cookies',
240
+ 'class' => 'apbct_settings-field_wrapper--sub',
241
+ ),
242
+ 'ssl_on' => array(
243
+ 'title' => __("Use SSL", 'cleantalk'),
244
+ 'description' => __('Turn this option on to use encrypted (SSL) connection with servers.', 'cleantalk'),
245
+ ),
246
+ 'use_buitin_http_api' => array(
247
+ 'title' => __("Use Wordpress HTTP API", 'cleantalk'),
248
+ 'description' => __('Alternative way to connect the Cloud. Use this if you have connection problems.', 'cleantalk'),
249
+ ),
250
+ ),
251
+ ),
252
+
253
+ // Exclusions
254
+ 'exclusions' => array(
255
+ 'title' => __('Exclusions', 'cleantalk'),
256
+ 'fields' => array(
257
+ 'exclusions__urls' => array(
258
+ 'type' => 'text',
259
+ 'title' => __('URL exclusions', 'cleantalk'),
260
+ 'description' => __('You could type here URL you want to exclude. Use comma as separator.', 'cleantalk'),
261
+ ),
262
+ 'exclusions__urls__use_regexp' => array(
263
+ 'type' => 'checkbox',
264
+ 'title' => __('Use Regular Expression in URL Exclusions', 'cleantalk'),
265
+ ),
266
+ 'exclusions__fields' => array(
267
+ 'type' => 'text',
268
+ 'title' => __('Field name exclusions', 'cleantalk'),
269
+ 'description' => __('You could type here fields names you want to exclude. Use comma as separator.', 'cleantalk'),
270
+ ),
271
+ 'exclusions__fields__use_regexp' => array(
272
+ 'type' => 'checkbox',
273
+ 'title' => __('Use Regular Expression in Field Exclusions', 'cleantalk'),
274
+ ),
275
+ 'exclusions__roles' => array(
276
+ 'type' => 'select',
277
+ 'multiple' => true,
278
+ 'options_callback' => 'apbct_get_all_roles',
279
+ 'options_callback_params' => array(true),
280
+ 'description' => __('Roles which bypass spam test. Hold CTRL to select multiple roles.', 'cleantalk'),
281
+ ),
282
+ ),
283
+ ),
284
+
285
+ // Admin bar
286
+ 'admin_bar' => array(
287
+ 'title' => __('Admin bar', 'cleantalk'),
288
+ 'default_params' => array(),
289
+ 'description' => '',
290
+ 'html_before' => '',
291
+ 'html_after' => '',
292
+ 'fields' => array(
293
+ 'show_adminbar' => array(
294
+ 'title' => __('Show statistics in admin bar', 'cleantalk'),
295
+ 'description' => __('Show/hide icon in top level menu in WordPress backend. The number of submissions is being counted for past 24 hours.', 'cleantalk'),
296
+ 'childrens' => array('all_time_counter','daily_counter','sfw_counter'),
297
+ ),
298
+ 'all_time_counter' => array(
299
+ 'title' => __('Show All-time counter', 'cleantalk'),
300
+ 'description' => __('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'),
301
+ 'parent' => 'show_adminbar',
302
+ 'class' => 'apbct_settings-field_wrapper--sub',
303
+ ),
304
+ 'daily_counter' => array(
305
+ 'title' => __('Show 24 hours counter', 'cleantalk'),
306
+ 'description' => __('Display daily requests counter in the admin bar. Counter displays number of requests of the past 24 hours.', 'cleantalk'),
307
+ 'parent' => 'show_adminbar',
308
+ 'class' => 'apbct_settings-field_wrapper--sub',
309
+ ),
310
+ 'sfw_counter' => array(
311
+ 'title' => __('SpamFireWall counter', 'cleantalk'),
312
+ 'description' => __('Display SpamFireWall requests in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'),
313
+ 'parent' => 'show_adminbar',
314
+ 'class' => 'apbct_settings-field_wrapper--sub',
315
+ ),
316
+ ),
317
+ ),
318
+
319
+ // Misc
320
+ 'misc' => array(
321
+ 'html_after' => '</div><br>',
322
+ 'fields' => array(
323
+ 'collect_details' => array(
324
+ 'type' => 'checkbox',
325
+ 'title' => __('Collect details about browsers', 'cleantalk'),
326
+ 'description' => __("Checking this box you allow plugin store information about screen size and browser plugins of website visitors. The option in a beta state.", 'cleantalk'),
327
+ ),
328
+ 'send_connection_reports' => array(
329
+ 'type' => 'checkbox',
330
+ 'title' => __('Send connection reports', 'cleantalk'),
331
+ 'description' => __("Checking this box you allow plugin to send the information about your connection. The option in a beta state.", 'cleantalk'),
332
+ ),
333
+ 'async_js' => array(
334
+ 'type' => 'checkbox',
335
+ 'title' => __('Async JavaScript loading', 'cleantalk'),
336
+ 'description' => __('Use async loading for scripts. Warning: This could reduce filtration quality.', 'cleantalk'),
337
+ ),
338
+ 'gdpr_enabled' => array(
339
+ 'type' => 'checkbox',
340
+ 'title' => __('Allow to add GDPR notice via shortcode', 'cleantalk'),
341
+ 'description' => __(' Adds small checkbox under your website form. To add it you should use the shortcode on the form\'s page: [cleantalk_gdpr_form id="FORM_ID"]', 'cleantalk'),
342
+ 'childrens' => array('gdpr_text'),
343
+ ),
344
+ 'gdpr_text' => array(
345
+ 'type' => 'text',
346
+ 'title' => __('GDPR text notice', 'cleantalk'),
347
+ 'description' => __('This text will be added as a description to the GDPR checkbox.', 'cleantalk'),
348
+ 'parent' => 'gdpr_enabled',
349
+ 'class' => 'apbct_settings-field_wrapper--sub',
350
+ ),
351
+ 'store_urls' => array(
352
+ 'type' => 'checkbox',
353
+ 'title' => __('Store visited URLs', 'cleantalk'),
354
+ 'description' => __("Plugin stores last 10 visited URLs (HTTP REFFERERS) before visitor submits form on the site. You can see stored visited URLS for each visitor in your Dashboard. Turn the option on to improve Anti-Spam protection.", 'cleantalk'),
355
+ 'childrens' => array('store_urls__sessions'),
356
+ ),
357
+ 'store_urls__sessions' => array(
358
+ 'type' => 'checkbox',
359
+ 'title' => __('Use cookies less sessions', 'cleantalk'),
360
+ 'description' => __('Doesn\'t use cookie or PHP sessions. Collect data for all types of bots.', 'cleantalk'),
361
+ 'parent' => 'store_urls',
362
+ 'class' => 'apbct_settings-field_wrapper--sub',
363
+ ),
364
+ 'comment_notify' => array(
365
+ 'type' => 'checkbox',
366
+ 'title' => __('Notify users with selected roles about new approved comments. Hold CTRL to select multiple roles.', 'cleantalk'),
367
+ 'description' => sprintf(__("If enabled, overrides similar Wordpress %sdiscussion settings%s.", 'cleantalk'), '<a href="options-discussion.php">','</a>'),
368
+ 'childrens' => array('comment_notify__roles'),
369
+ ),
370
+ 'comment_notify__roles' => array(
371
+ 'type' => 'select',
372
+ 'multiple' => true,
373
+ 'parent' => 'comment_notify',
374
+ 'options_callback' => 'apbct_get_all_roles',
375
+ 'options_callback_params' => array(true),
376
+ 'class' => 'apbct_settings-field_wrapper--sub',
377
+ ),
378
+ 'complete_deactivation' => array(
379
+ 'type' => 'checkbox',
380
+ 'title' => __('Complete deactivation', 'cleantalk'),
381
+ 'description' => __('Leave no trace in the system after deactivation.', 'cleantalk'),
382
+ ),
383
+
384
+ ),
385
+ ),
386
+ );
387
+
388
+ return $fields;
389
+ }
390
+
391
+ function apbct_settings__set_fileds__network( $fields ){
392
+ global $apbct;
393
+ $additional_fields = array(
394
+ 'main' => array(
395
+ 'fields' => array(
396
+ 'white_label' => array(
397
+ 'type' => 'checkbox',
398
+ 'title' => __('Enable White Label Mode', 'cleantalk'),
399
+ 'description' => sprintf(__("Learn more information %shere%s.", 'cleantalk'), '<a tearget="_blank" href="https://cleantalk.org/ru/help/hosting-white-label">', '</a>'),
400
+ 'childrens' => array('white_label__hoster_key', 'white_label__plugin_name', 'allow_custom_key'),
401
+ 'network' => true,
402
+ ),
403
+ 'white_label__hoster_key' => array(
404
+ 'title' => __('Hoster API Key', 'cleantalk'),
405
+ 'description' => sprintf(__("You can get it in %sCleantalk's Control Panel%s", 'cleantalk'), '<a tearget="_blank" href="https://cleantalk.org/my/?cp_mode=hosting-antispam">', '</a>'),
406
+ 'type' => 'text',
407
+ 'parent' => 'white_label',
408
+ 'class' => 'apbct_settings-field_wrapper--sub',
409
+ 'network' => true,
410
+ 'required' => true,
411
+ ),
412
+ 'white_label__plugin_name' => array(
413
+ 'title' => __('Plugin name', 'cleantalk'),
414
+ 'description' => sprintf(__("Specify plugin name. Leave empty for deafult %sAntispam by Cleantalk%s", 'cleantalk'), '<b>', '</b>'),
415
+ 'type' => 'text',
416
+ 'parent' => 'white_label',
417
+ 'class' => 'apbct_settings-field_wrapper--sub',
418
+ 'network' => true,
419
+ 'required' => true,
420
+ ),
421
+ 'allow_custom_key' => array(
422
+ 'type' => 'checkbox',
423
+ 'title' => __('Allow users to use other key', 'cleantalk'),
424
+ 'description' => __('Allow users to use different Access key in their plugin settings on child blogs. They could use different CleanTalk account.', 'cleantalk')
425
+ . (defined('CLEANTALK_ACCESS_KEY')
426
+ ? ' <span style="color: red">'
427
+ . __('Constant <b>CLEANTALK_ACCESS_KEY</b> is set. All websites will use API key from this constant. Look into wp-config.php', 'cleantalk')
428
+ . '</span>'
429
+ : ''
430
+ ),
431
+ 'display' => APBCT_WPMS && is_main_site(),
432
+ 'disabled' => $apbct->network_settings['white_label'],
433
+ 'network' => true,
434
+ ),
435
+ )
436
+ )
437
+ );
438
+
439
+ $fields = array_merge_recursive($fields, $additional_fields);
440
+
441
+ return $fields;
442
+
443
+ }
444
+
445
+ function apbct_settings__add_groups_and_fields( $fields ){
446
+
447
+ global $apbct;
448
+
449
+ $apbct->settings_fields_in_groups = $fields;
450
+
451
+ $field_default_params = array(
452
+ 'callback' => 'apbct_settings__field__draw',
453
+ 'type' => 'radio',
454
+ 'options' => array(
455
+ array('val' => 1, 'label' => __('On'),),
456
+ array('val' => 0, 'label' => __('Off'),),
457
+ ),
458
+ 'def_class' => 'apbct_settings-field_wrapper',
459
+ 'class' => '',
460
+ 'parent' => '',
461
+ 'childrens' => array(),
462
+ 'hide' => array(),
463
+ // 'title' => 'Default title',
464
+ // 'description' => 'Default description',
465
+ 'display' => true, // Draw settings or not
466
+ 'reverse_trigger' => false, // How to allow child settings. Childrens are opened when the parent triggered "ON". This is overrides by this option
467
+ 'multiple' => false,
468
+ 'description' => '',
469
+ 'network' => false,
470
+ 'disabled' => false,
471
+ 'required' => false,
472
+ );
473
+
474
+ foreach($apbct->settings_fields_in_groups as $group_name => $group){
475
+
476
+ add_settings_section('apbct_section__'.$group_name, '', 'apbct_section__'.$group_name, 'cleantalk');
477
+
478
+ foreach($group['fields'] as $field_name => $field){
479
+
480
+ // Normalize $field['options'] from callback function to this type array( array( 'val' => 1, 'label' => __('On'), ), )
481
+ if(!empty($field['options_callback'])){
482
+ $options = call_user_func_array($field['options_callback'], !empty($field['options_callback_params']) ? $field['options_callback_params'] : array());
483
+ foreach ($options as &$option){
484
+ $option = array('val' => $option, 'label' => $option);
485
+ } unset($option);
486
+ $field['options'] = $options;
487
+ }
488
+
489
+ $params = !empty($group['default_params'])
490
+ ? array_merge($group['default_params'], $field)
491
+ : array_merge($field_default_params, $field);
492
+
493
+ $params['name'] = $field_name;
494
+
495
+ if(!$params['display'])
496
+ continue;
497
+
498
+ add_settings_field(
499
+ 'apbct_field__'.$field_name,
500
+ '',
501
+ $params['callback'],
502
+ 'cleantalk',
503
+ 'apbct_section__'.$group_name,
504
+ $params
505
+ );
506
+
507
+ }
508
+ }
509
+ }
510
+
511
+ /**
512
+ * Admin callback function - Displays plugin options page
513
+ */
514
+ function apbct_settings__display() {
515
+
516
+ global $apbct;
517
+
518
+ // Title
519
+ echo '<h2 class="apbct_settings-title">'.__($apbct->plugin_name, 'cleantalk').'</h2>';
520
+
521
+ // Subtitle for IP license
522
+ if($apbct->moderate_ip)
523
+ echo '<h4 class="apbct_settings-subtitle apbct_color--gray">'. __('Hosting AntiSpam', 'cleantalk').'</h4>';
524
+
525
+ echo '<form action="options.php" method="post">';
526
+
527
+ apbct_settings__error__output();
528
+
529
+ // Top info
530
+ if(!$apbct->white_label){
531
+ echo '<div style="float: right; padding: 15px 15px 5px 15px; font-size: 13px; position: relative; top: -55px; background: #f1f1f1;">';
532
+
533
+ echo __('CleanTalk\'s tech support:', 'cleantalk')
534
+ .'&nbsp;'
535
+ .'<a target="_blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">Wordpress.org</a>.'
536
+ // .' <a href="https://community.cleantalk.org/viewforum.php?f=25" target="_blank">'.__("Tech forum", 'cleantalk').'</a>'
537
+ // .($user_token ? ", <a href='https://cleantalk.org/my/support?user_token=$user_token&cp_mode=antispam' target='_blank'>".__("Service support ", 'cleantalk').'</a>' : '').
538
+ .'<br>';
539
+ echo __('Plugin Homepage at', 'cleantalk').' <a href="http://cleantalk.org" target="_blank">cleantalk.org</a>.<br/>';
540
+ echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
541
+ echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
542
+ echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
543
+ if($apbct->key_is_ok)
544
+ echo '<b style="display: inline-block; margin-top: 10px;">'.sprintf(__('Do you like CleanTalk? %sPost your feedback here%s.', 'cleantalk'), '<a href="https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post" target="_blank">', '</a>').'</b><br />';
545
+ apbct_admin__badge__get_premium();
546
+ echo '<div id="gdpr_dialog" style="display: none; padding: 7px;">';
547
+ apbct_settings_show_gdpr_text('print');
548
+ echo '</div>';
549
+ echo '</div>';
550
+ }
551
+
552
+ // Output spam count
553
+ if($apbct->key_is_ok && apbct_api_key__is_correct()){
554
+ if($apbct->spam_count > 0){
555
+ echo '<div class="apbct_settings-subtitle" style="top: 0; margin-bottom: 10px; width: 200px;">'
556
+ .'<br>'
557
+ .'<span>'
558
+ .sprintf(
559
+ __( '%s has blocked <b>%s</b> spam.', 'cleantalk' ),
560
+ $apbct->plugin_name,
561
+ number_format($apbct->spam_count, 0, ',', ' ')
562
+ )
563
+ .'</span>'
564
+ .'<br>'
565
+ .'<br>'
566
+ .'</div>';
567
+ }
568
+ if(!$apbct->white_label){
569
+ // CP button
570
+ echo '<a class="cleantalk_link cleantalk_link-manual" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
571
+ .__('Click here to get anti-spam statistics', 'cleantalk')
572
+ .'</a>';
573
+ echo '&nbsp;&nbsp;';
574
+ // Support button
575
+ echo '<a class="cleantalk_link cleantalk_link-auto" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support', 'cleantalk').'</a>';
576
+ echo '<br>'
577
+ .'<br>';
578
+ }
579
+ }
580
+
581
+ settings_fields('cleantalk_settings');
582
+ do_settings_fields('cleantalk', 'cleantalk_section_settings_main');
583
+
584
+ foreach($apbct->settings_fields_in_groups as $group_name => $group){
585
+
586
+ echo !empty($group['html_before']) ? $group['html_before'] : '';
587
+ echo !empty($group['title']) ? '<h3 style="margin-left: 220px;">'.$group['title'].'</h3>' : '';
588
+
589
+ do_settings_fields('cleantalk', 'apbct_section__'.$group_name);
590
+
591
+ echo !empty($group['html_after']) ? $group['html_after'] : '';
592
+
593
+ }
594
+
595
+ echo '<br>';
596
+ echo '<button name="submit" class="cleantalk_link cleantalk_link-manual" value="save_changes">'.__('Save Changes').'</button>';
597
+
598
+ echo "</form>";
599
+
600
+ if(!$apbct->white_label){
601
+ // Translate banner for non EN locale
602
+ if(substr(get_locale(), 0, 2) != 'en'){
603
+ global $ct_translate_banner_template;
604
+ require_once(CLEANTALK_PLUGIN_DIR.'templates/translate_banner.php');
605
+ printf($ct_translate_banner_template, substr(get_locale(), 0, 2));
606
+ }
607
+ }
608
+ }
609
+
610
+ function apbct_settings__display__network(){
611
+ // If it's network admin dashboard
612
+ if(is_network_admin()){
613
+ $link = get_site_option('siteurl').'wp-admin/options-general.php?page=cleantalk';
614
+ printf("<h2>" . __("Please, enter the %splugin settings%s in main site dashboard.", 'cleantalk') . "</h2>", "<a href='$link'>", "</a>");
615
+ return;
616
+ }
617
+ }
618
+
619
+ function apbct_settings__error__output($return = false){
620
+
621
+ global $apbct;
622
+
623
+ // If have error message output error block.
624
+
625
+ $out = '';
626
+
627
+ if(!empty($apbct->errors) && !defined('CLEANTALK_ACCESS_KEY')){
628
+
629
+ $errors = $apbct->errors;
630
+
631
+ $error_texts = array(
632
+ // Misc
633
+ 'key_invalid' => __('Error occured while API key validating. Error: ', 'cleantalk'),
634
+ 'key_get' => __('Error occured while automatically gettings access key. Error: ', 'cleantalk'),
635
+ 'sfw_send_logs' => __('Error occured while sending sending SpamFireWall logs. Error: ', 'cleantalk'),
636
+ 'sfw_update' => __('Error occured while updating SpamFireWall local base. Error: ' , 'cleantalk'),
637
+ 'account_check' => __('Error occured while checking account status. Error: ', 'cleantalk'),
638
+ 'api' => __('Error occured while excuting API call. Error: ', 'cleantalk'),
639
+
640
+ // Validating settings
641
+ 'settings_validate' => 'Validate Settings',
642
+ 'exclusions_urls' => 'URL Exclusions',
643
+ 'exclusions_fields' => 'Field Exclusions',
644
+
645
+ // Unknown
646
+ 'unknown' => __('Unknown error. Error: ', 'cleantalk'),
647
+ );
648
+
649
+ $errors_out = array();
650
+
651
+ foreach($errors as $type => $error){
652
+
653
+ if(!empty($error)){
654
+
655
+ if(is_array(current($error))){
656
+
657
+ foreach($error as $sub_type => $sub_error){
658
+ $errors_out[$sub_type] = '';
659
+ if(isset($sub_error['error_time']))
660
+ $errors_out[$sub_type] .= date('Y-m-d H:i:s', $sub_error['error_time']) . ': ';
661
+ $errors_out[$sub_type] .= (isset($error_texts[$type]) ? $error_texts[$type] : ucfirst($type)) . ': ';
662
+ $errors_out[$sub_type] .= (isset($error_texts[$sub_type]) ? $error_texts[$sub_type] : $error_texts['unknown']) . ' ' . $sub_error['error'];
663
+ }
664
+ continue;
665
+ }
666
+
667
+ $errors_out[$type] = '';
668
+ if(isset($error['error_time']))
669
+ $errors_out[$type] .= date('Y-m-d H:i:s', $error['error_time']) . ': ';
670
+ $errors_out[$type] .= (isset($error_texts[$type]) ? $error_texts[$type] : $error_texts['unknown']) . ' ' . (isset($error['error']) ? $error['error'] : '');
671
+
672
+ }
673
+ }
674
+
675
+ if(!empty($errors_out)){
676
+ $out .= '<div id="apbctTopWarning" class="error" style="position: relative;">'
677
+ .'<h3 style="display: inline-block;">'.__('Errors:', 'cleantalk').'</h3>';
678
+ foreach($errors_out as $value){
679
+ $out .= '<h4>'.$value.'</h4>';
680
+ }
681
+ $out .= !$apbct->white_label
682
+ ? '<h4 style="text-align: unset;">'.sprintf(__('You can get support any time here: %s.', 'cleantalk'), '<a target="blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">https://wordpress.org/support/plugin/cleantalk-spam-protect</a>').'</h4>'
683
+ : '';
684
+ $out .= '</div>';
685
+ }
686
+ }
687
+
688
+ if($return) return $out; else echo $out;
689
+ }
690
+
691
+ function apbct_settings__field__debug(){
692
+
693
+ global $apbct;
694
+
695
+ if($apbct->debug){
696
+
697
+ echo '<hr /><h2>Debug:</h2>';
698
+ echo '<h4>Constants:</h4>';
699
+ echo 'CLEANTALK_AJAX_USE_BUFFER '. (defined('CLEANTALK_AJAX_USE_BUFFER') ? (CLEANTALK_AJAX_USE_BUFFER ? 'true' : 'flase') : 'NOT_DEFINED')."<br>";
700
+ echo 'CLEANTALK_AJAX_USE_FOOTER_HEADER '. (defined('CLEANTALK_AJAX_USE_FOOTER_HEADER') ? (CLEANTALK_AJAX_USE_FOOTER_HEADER ? 'true' : 'flase') : 'NOT_DEFINED')."<br>";
701
+ echo 'CLEANTALK_ACCESS_KEY '. (defined('CLEANTALK_ACCESS_KEY') ? (CLEANTALK_ACCESS_KEY ? CLEANTALK_ACCESS_KEY : 'flase') : 'NOT_DEFINED')."<br>";
702
+ echo 'CLEANTALK_CHECK_COMMENTS_NUMBER '. (defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? (CLEANTALK_CHECK_COMMENTS_NUMBER ? CLEANTALK_CHECK_COMMENTS_NUMBER : 0) : 'NOT_DEFINED')."<br>";
703
+ echo 'CLEANTALK_CHECK_MESSAGES_NUMBER '. (defined('CLEANTALK_CHECK_MESSAGES_NUMBER') ? (CLEANTALK_CHECK_MESSAGES_NUMBER ? CLEANTALK_CHECK_MESSAGES_NUMBER : 0) : 'NOT_DEFINED')."<br>";
704
+ echo 'CLEANTALK_PLUGIN_DIR '. (defined('CLEANTALK_PLUGIN_DIR') ? (CLEANTALK_PLUGIN_DIR ? CLEANTALK_PLUGIN_DIR : 'flase') : 'NOT_DEFINED')."<br>";
705
+ echo 'WP_ALLOW_MULTISITE '. (defined('WP_ALLOW_MULTISITE') ? (WP_ALLOW_MULTISITE ? 'true' : 'flase') : 'NOT_DEFINED');
706
+
707
+ echo "<h4>Debug log: <button type='submit' value='debug_drop' name='submit' style='font-size: 11px; padding: 1px;'>Drop debug data</button></h4>";
708
+ echo "<div style='height: 500px; width: 80%; overflow: auto;'>";
709
+
710
+ $output = print_r($apbct->debug, true);
711
+ $output = str_replace("\n", "<br>", $output);
712
+ $output = preg_replace("/[^\S]{4}/", "&nbsp;&nbsp;&nbsp;&nbsp;", $output);
713
+ echo "$output";
714
+
715
+ echo "</div>";
716
+
717
+ }
718
+ }
719
+
720
+ function apbct_settings__field__state(){
721
+
722
+ global $apbct;
723
+
724
+ $path_to_img = plugin_dir_url(__FILE__) . "images/";
725
+
726
+ $img = $path_to_img."yes.png";
727
+ $img_no = $path_to_img."no.png";
728
+ $img_no_gray = $path_to_img."no_gray.png";
729
+ $color="black";
730
+
731
+ if(!$apbct->key_is_ok){
732
+ $img=$path_to_img."no.png";
733
+ $img_no=$path_to_img."no.png";
734
+ $color="black";
735
+ }
736
+
737
+ if(!apbct_api_key__is_correct($apbct->api_key)){
738
+ $img = $path_to_img."yes_gray.png";
739
+ $img_no = $path_to_img."no_gray.png";
740
+ $color="gray";
741
+ }
742
+
743
+ if($apbct->moderate_ip){
744
+ $img = $path_to_img."yes.png";
745
+ $img_no = $path_to_img."no.png";
746
+ $color="black";
747
+ }
748
+
749
+ if($apbct->moderate == 0){
750
+ $img = $path_to_img."no.png";
751
+ $img_no = $path_to_img."no.png";
752
+ $color="black";
753
+ }
754
+
755
+ print '<div class="apbct_settings-field_wrapper" style="color:'.$color.'">';
756
+
757
+ print '<h2>'.__('Protection is active', 'cleantalk').'</h2>';
758
+
759
+ echo '<img class="apbct_status_icon" src="'.($apbct->settings['registrations_test'] == 1 ? $img : $img_no).'"/>'.__('Registration forms', 'cleantalk');
760
+ echo '<img class="apbct_status_icon" src="'.($apbct->settings['comments_test']==1 ? $img : $img_no).'"/>'.__('Comments forms', 'cleantalk');
761
+ echo '<img class="apbct_status_icon" src="'.($apbct->settings['contact_forms_test']==1 ? $img : $img_no).'"/>'.__('Contact forms', 'cleantalk');
762
+ echo '<img class="apbct_status_icon" src="'.($apbct->settings['general_contact_forms_test']==1 ? $img : $img_no).'"/>'.__('Custom contact forms', 'cleantalk');
763
+ if(!$apbct->white_label || is_main_site())
764
+ echo '<img class="apbct_status_icon" src="'.($apbct->data['moderate'] == 1 ? $img : $img_no).'"/>'
765
+ .'<a style="color: black" href="https://blog.cleantalk.org/real-time-email-address-existence-validation/">'.__('Validate email for existence', 'cleantalk').'</a>';
766
+
767
+ // Autoupdate status
768
+ if($apbct->notice_auto_update && (!$apbct->white_label || is_main_site())){
769
+ echo '<img class="apbct_status_icon" src="'.($apbct->auto_update == 1 ? $img : ($apbct->auto_update == -1 ? $img_no : $img_no_gray)).'"/>'.__('Auto update', 'cleantalk')
770
+ .' <sup><a href="http://cleantalk.org/help/cleantalk-auto-update" target="_blank">?</a></sup>';
771
+ }
772
+
773
+ // WooCommerce
774
+ if(class_exists('WooCommerce'))
775
+ echo '<img class="apbct_status_icon" src="'.($apbct->settings['wc_checkout_test'] == 1 ? $img : $img_no).'"/>'.__('WooCommerce checkout form', 'cleantalk');
776
+ if($apbct->moderate_ip)
777
+ print "<br /><br />The anti-spam service is paid by your hosting provider. License #".$apbct->data['ip_license'].".<br />";
778
+
779
+ print "</div>";
780
+ }
781
+
782
+ /**
783
+ * Admin callback function - Displays inputs of 'apikey' plugin parameter
784
+ */
785
+ function apbct_settings__field__apikey(){
786
+
787
+ global $apbct;
788
+
789
+ echo '<div id="cleantalk_apikey_wrapper" class="apbct_settings-field_wrapper">';
790
+
791
+ // Using key from Main site, or from CLEANTALK_ACCESS_KEY constant
792
+ if(APBCT_WPMS && !is_main_site() && (!$apbct->allow_custom_key || defined('CLEANTALK_ACCESS_KEY'))){
793
+ _e('<h3>Key is provided by Super Admin.</h3>', 'cleantalk');
794
+ return;
795
+ }
796
+
797
+ echo '<label class="apbct_settings__label" for="cleantalk_apkey">' . __('Access key', 'cleantalk') . '</label>';
798
+
799
+ echo '<input
800
+ id="apbct_setting_apikey"
801
+ class="apbct_setting_text apbct_setting---apikey"
802
+ type="text"
803
+ name="cleantalk_settings[apikey]"
804
+ value="'
805
+ . ($apbct->key_is_ok
806
+ ? str_repeat('*', strlen($apbct->api_key))
807
+ : $apbct->api_key
808
+ )
809
+ . '"
810
+ key="' . $apbct->api_key . '"
811
+ size="20"
812
+ placeholder="' . __('Enter the key', 'cleantalk') . '"'
813
+ . ' />';
814
+
815
+ // Show account name associated with key
816
+ if(!empty($apbct->data['account_name_ob'])){
817
+ echo '<div class="apbct_display--none">'
818
+ . sprintf( __('Account at cleantalk.org is %s.', 'cleantalk'),
819
+ '<b>'.$apbct->data['account_name_ob'].'</b>'
820
+ )
821
+ . '</div>';
822
+ };
823
+
824
+ // Show key button
825
+ if((apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok)){
826
+ echo '<a id="apbct_showApiKey" class="ct_support_link" style="display: block" href="#">'
827
+ . __('Show the access key', 'cleantalk')
828
+ . '</a>';
829
+
830
+ // "Auto Get Key" buttons. License agreement
831
+ }else{
832
+
833
+ echo '<br /><br />';
834
+
835
+ // Auto get key
836
+ if(!$apbct->ip_license){
837
+ echo '<button class="cleantalk_link cleantalk_link-manual apbct_setting---get_key_auto" name="submit" type="submit" value="get_key_auto">'
838
+ .__('Get Access Key Automatically', 'cleantalk')
839
+ .'</button>';
840
+ echo '<input type="hidden" id="ct_admin_timezone" name="ct_admin_timezone" value="null" />';
841
+ echo '<br />';
842
+ echo '<br />';
843
+ }
844
+
845
+ // Warnings and GDPR
846
+ printf( __('Admin e-mail (%s) will be used for registration, if you want to use other email please %sGet Access Key Manually%s.', 'cleantalk'),
847
+ ct_get_admin_email(),
848
+ '<a class="apbct_color--gray" target="__blank" href="'
849
+ . sprintf( 'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
850
+ urlencode(ct_get_admin_email()),
851
+ urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))
852
+ )
853
+ . '">',
854
+ '</a>'
855
+ );
856
+
857
+ // License agreement
858
+ if(!$apbct->ip_license){
859
+ echo '<div>';
860
+ echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
861
+ echo '<label for="spbc_license_agreed">';
862
+ printf( __('I accept %sLicense Agreement%s.', 'cleantalk'),
863
+ '<a href="https://cleantalk.org/publicoffer" target="_blank" style="color:#66b;">',
864
+ '</a>'
865
+ );
866
+ echo "</label>";
867
+ echo '</div>';
868
+ }
869
+ }
870
+
871
+ echo '</div>';
872
+ }
873
+
874
+ function apbct_settings__field__action_buttons(){
875
+
876
+ global $apbct;
877
+
878
+ echo '<div class="apbct_settings-field_wrapper">';
879
+
880
+ if(apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok){
881
+ echo '<div>'
882
+ .'<a href="edit-comments.php?page=ct_check_spam" class="ct_support_link">' . __('Check comments for spam', 'cleantalk') . '</a>'
883
+ .'&nbsp;&nbsp;'
884
+ .'&nbsp;&nbsp;'
885
+ .'<a href="users.php?page=ct_check_users" class="ct_support_link">' . __('Check users for spam', 'cleantalk') . '</a>'
886
+ .'&nbsp;&nbsp;'
887
+ .'&nbsp;&nbsp;'
888
+ .'<a href="#" class="ct_support_link" onclick="apbct_show_hide_elem(\'apbct_statistics\')">' . __('Statistics & Reports', 'cleantalk') . '</a>'
889
+ .'</div>';
890
+
891
+ }
892
+
893
+ echo '</div>';
894
+ }
895
+
896
+ function apbct_settings__field__statistics() {
897
+
898
+ global $apbct, $wpdb;
899
+
900
+ echo '<div id="apbct_statistics" class="apbct_settings-field_wrapper" style="display: none;">';
901
+
902
+ // Last request
903
+ printf(
904
+ __('Last spam check request to %s server was at %s.', 'cleantalk'),
905
+ $apbct->stats['last_request']['server'] ? $apbct->stats['last_request']['server'] : __('unknown', 'cleantalk'),
906
+ $apbct->stats['last_request']['time'] ? date('M d Y H:i:s', $apbct->stats['last_request']['time']) : __('unknown', 'cleantalk')
907
+ );
908
+ echo '<br>';
909
+
910
+ // Avarage time request
911
+ printf(
912
+ __('Average request time for past 7 days: %s seconds.', 'cleantalk'),
913
+ $apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]['average_time']
914
+ ? round($apbct->stats['requests'][min(array_keys($apbct->stats['requests']))]['average_time'], 3)
915
+ : __('unknown', 'cleantalk')
916
+ );
917
+ echo '<br>';
918
+
919
+ // SFW last die
920
+ printf(
921
+ __('Last time SpamFireWall was triggered for %s IP at %s', 'cleantalk'),
922
+ $apbct->stats['last_sfw_block']['ip'] ? $apbct->stats['last_sfw_block']['ip'] : __('unknown', 'cleantalk'),
923
+ $apbct->stats['last_sfw_block']['time'] ? date('M d Y H:i:s', $apbct->stats['last_sfw_block']['time']) : __('unknown', 'cleantalk')
924
+ );
925
+ echo '<br>';
926
+
927
+ // SFW last update
928
+ $sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->prefix."cleantalk_sfw`", ARRAY_A);
929
+ printf(
930
+ __('SpamFireWall was updated %s. Now contains %s entries.', 'cleantalk'),
931
+ $apbct->stats['sfw']['last_update_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_update_time']) : __('unknown', 'cleantalk'),
932
+ isset($sfw_netwoks_amount[0]['cnt']) ? $sfw_netwoks_amount[0]['cnt'] : __('unknown', 'cleantalk')
933
+ );
934
+ echo '<br>';
935
+
936
+ // SFW last sent logs
937
+ printf(
938
+ __('SpamFireWall sent %s events at %s.', 'cleantalk'),
939
+ $apbct->stats['sfw']['last_send_amount'] ? $apbct->stats['sfw']['last_send_amount'] : __('unknown', 'cleantalk'),
940
+ $apbct->stats['sfw']['last_send_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_send_time']) : __('unknown', 'cleantalk')
941
+ );
942
+ echo '<br>';
943
+
944
+ // Connection reports
945
+ if ($apbct->connection_reports){
946
+
947
+ if ($apbct->connection_reports['negative'] == 0){
948
+ _e('There are no failed connections to server.', 'cleantalk');
949
+ }else{
950
+ echo "<table id='negative_reports_table''>
951
+ <tr>
952
+ <td>#</td>
953
+ <td><b>Date</b></td>
954
+ <td><b>Page URL</b></td>
955
+ <td><b>Report</b></td>
956
+ <td><b>Server IP</b></td>
957
+ </tr>";
958
+ foreach($apbct->connection_reports['negative_report'] as $key => $report){
959
+ echo '<tr>'
960
+ . '<td>'.($key+1).'.</td>'
961
+ . '<td>'.$report['date'].'</td>'
962
+ . '<td>'.$report['page_url'].'</td>'
963
+ . '<td>'.$report['lib_report'].'</td>'
964
+ . '<td>'.$report['work_url'].'</td>'
965
+ . '</tr>';
966
+ }
967
+ echo "</table>";
968
+ echo '<br/>';
969
+ echo '<button'
970
+ . ' name="submit"'
971
+ . ' class="cleantalk_link cleantalk_link-manual"'
972
+ . ' value="ct_send_connection_report"'
973
+ . (!$apbct->settings['send_connection_reports'] ? ' disabled="disabled"' : '')
974
+ . '>'
975
+ .__('Send report', 'cleantalk')
976
+ .'</button>';
977
+ if (!$apbct->settings['send_connection_reports']){
978
+ echo '<br><br>';
979
+ _e('Please, enable "Send connection reports" setting to be able to send reports', 'cleantalk');
980
+ }
981
+ }
982
+
983
+ }
984
+
985
+ echo '</div>';
986
+ }
987
+
988
+ /**
989
+ * Get all current Wordpress roles, could except 'subscriber' role
990
+ *
991
+ * @param bool $except_subscriber
992
+ *
993
+ * @return array
994
+ */
995
+ function apbct_get_all_roles($except_subscriber = false) {
996
+
997
+ global $wp_roles;
998
+
999
+ $wp_roles = new WP_Roles();
1000
+ $roles = $wp_roles->get_names();
1001
+
1002
+ if($except_subscriber) {
1003
+ $key = array_search( 'Subscriber', $roles );
1004
+ if ( $key !== false ) {
1005
+ unset( $roles[ $key ] );
1006
+ }
1007
+ }
1008
+
1009
+ return $roles;
1010
+ }
1011
+
1012
+ function apbct_settings__field__draw($params = array()){
1013
+
1014
+ global $apbct;
1015
+
1016
+ $value = $params['network'] ? $apbct->network_settings[$params['name']] : $apbct->settings[$params['name']];
1017
+ $value_parent = $params['parent']
1018
+ ? ($params['network'] ? $apbct->network_settings[$params['parent']] : $apbct->settings[$params['parent']])
1019
+ : false;
1020
+
1021
+ $disabled = $params['parent'] && !$value_parent ? ' disabled="disabled"' : '';
1022
+ $disabled = $params['disabled'] ? ' disabled="disabled"' : $disabled;
1023
+
1024
+ $childrens = $params['childrens'] ? 'apbct_setting---' . implode(",apbct_setting---",$params['childrens']) : '';
1025
+ $hide = $params['hide'] ? implode(",",$params['hide']) : '';
1026
+
1027
+ echo '<div class="'.$params['def_class'].(isset($params['class']) ? ' '.$params['class'] : '').'">';
1028
+
1029
+ switch($params['type']){
1030
+
1031
+ // Checkbox type
1032
+ case 'checkbox':
1033
+ echo '<input
1034
+ type="checkbox"
1035
+ name="cleantalk_settings['.$params['name'].']"
1036
+ id="apbct_setting_'.$params['name'].'"
1037
+ value="1" '
1038
+ ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1039
+ .($value == '1' ? ' checked' : '')
1040
+ .$disabled
1041
+ .($params['required'] ? ' required="required"' : '')
1042
+ .' onchange="'
1043
+ . ($params['childrens'] ? ' apbctSettingsDependencies(\''. $childrens .'\');' : '')
1044
+ . ($params['hide'] ? ' apbct_show_hide_elem(\''. $hide . '\');' : '')
1045
+ . '"'
1046
+ .' />'
1047
+ .'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
1048
+ .$params['title']
1049
+ .'</label>';
1050
+ echo isset($params['long_description'])
1051
+ ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1052
+ : '';
1053
+ echo '<div class="apbct_settings-field_description">'
1054
+ .$params['description']
1055
+ .'</div>';
1056
+ break;
1057
+
1058
+ // Radio type
1059
+ case 'radio':
1060
+
1061
+ // Title
1062
+ echo isset($params['title'])
1063
+ ? '<h4 class="apbct_settings-field_title apbct_settings-field_title--'.$params['type'].'">'.$params['title'].'</h4>'
1064
+ : '';
1065
+
1066
+ // Popup description
1067
+ echo isset($params['long_description'])
1068
+ ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1069
+ : '';
1070
+
1071
+ echo '<div class="apbct_settings-field_content apbct_settings-field_content--'.$params['type'].'">';
1072
+
1073
+ $disabled = '';
1074
+
1075
+ // Disable child option if parent is ON
1076
+ if($params['reverse_trigger']){
1077
+ if($params['parent'] && $apbct->settings[$params['parent']]){
1078
+ $disabled = ' disabled="disabled"';
1079
+ }
1080
+
1081
+ // Disable child option if parent if OFF
1082
+ }else{
1083
+ if($params['parent'] && !$apbct->settings[$params['parent']]){
1084
+ $disabled = ' disabled="disabled"';
1085
+ }
1086
+ }
1087
+
1088
+ foreach($params['options'] as $option){
1089
+ echo '<input'
1090
+ .' type="radio"'
1091
+ ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1092
+ ." id='apbct_setting_{$params['name']}__{$option['label']}'"
1093
+ .' name="cleantalk_settings['.$params['name'].']"'
1094
+ .' value="'.$option['val'].'"'
1095
+ .($params['parent'] ? $disabled : '')
1096
+ .($params['childrens']
1097
+ ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\')"'
1098
+ : ''
1099
+ )
1100
+ .($value == $option['val'] ? ' checked' : '')
1101
+ .($params['required'] ? ' required="required"' : '')
1102
+ .' />';
1103
+ echo '<label for="apbct_setting_'.$params['name'].'__'.$option['label'].'"> ' . $option['label'] . '</label>';
1104
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
1105
+ }
1106
+
1107
+ echo isset($params['description'])
1108
+ ? '<div class="apbct_settings-field_description">'.$params['description'].'</div>'
1109
+ : '';
1110
+
1111
+ echo '</div>';
1112
+ break;
1113
+
1114
+ // Dropdown list type
1115
+ case 'select':
1116
+ echo isset($params['title'])
1117
+ ? '<h4 class="apbct_settings-field_title apbct_settings-field_title--'.$params['type'].'">'.$params['title'].'</h4>'
1118
+ : '';
1119
+ echo isset($params['long_description'])
1120
+ ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1121
+ : '';
1122
+ echo '<select'
1123
+ . ' id="apbct_setting_'.$params['name'].'"'
1124
+ . " class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1125
+ . ' name="cleantalk_settings['.$params['name'].']'.($params['multiple'] ? '[]"' : '"')
1126
+ . ($params['multiple'] ? ' size="'. count($params['options']). '""' : '')
1127
+ . ($params['multiple'] ? ' multiple="multiple"' : '')
1128
+ . $disabled
1129
+ . ($params['required'] ? ' required="required"' : '')
1130
+ . ' >';
1131
+
1132
+ foreach($params['options'] as $option){
1133
+ echo '<option'
1134
+ . ' value="' . $option['val'] . '"'
1135
+ . ($params['multiple']
1136
+ ? (in_array($option['val'], $value) ? ' selected="selected"' : '')
1137
+ : ($value == $option['val'] ? 'selected="selected"' : '')
1138
+ )
1139
+ .'>'
1140
+ . $option['label']
1141
+ . '</option>';
1142
+ }
1143
+
1144
+ echo '</select>';
1145
+ echo isset($params['long_description'])
1146
+ ? '<i setting="'.$params['name'].'" class="apbct_settings-long_description---show icon-help-circled"></i>'
1147
+ : '';
1148
+ echo isset($params['description'])
1149
+ ? '<div class="apbct_settings-field_description">'.$params['description'].'</div>'
1150
+ : '';
1151
+
1152
+ break;
1153
+
1154
+ // Text type
1155
+ case 'text':
1156
+
1157
+ echo '<input
1158
+ type="text"
1159
+ id="apbct_setting_'.$params['name'].'"
1160
+ name="cleantalk_settings['.$params['name'].']"'
1161
+ ." class='apbct_setting_{$params['type']} apbct_setting---{$params['name']}'"
1162
+ .' value="'. $value .'" '
1163
+ .$disabled
1164
+ .($params['required'] ? ' required="required"' : '')
1165
+ .($params['childrens'] ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\')"' : '')
1166
+ .' />'
1167
+ . '&nbsp;'
1168
+ .'<label for="apbct_setting_'.$params['name'].'" class="apbct_setting-field_title--'.$params['type'].'">'
1169
+ .$params['title']
1170
+ .'</label>';
1171
+ echo '<div class="apbct_settings-field_description">'
1172
+ .$params['description']
1173
+ .'</div>';
1174
+ break;
1175
+ }
1176
+
1177
+ echo '</div>';
1178
+ }
1179
+
1180
+ /**
1181
+ * Admin callback function - Plugin parameters validator
1182
+ *
1183
+ * @global CleantalkState $apbct
1184
+ * @param array $settings Array with passed settings
1185
+ * @return array Array with processed settings
1186
+ */
1187
+ function apbct_settings__validate($settings) {
1188
+
1189
+ global $apbct;
1190
+
1191
+ // Set missing settings.
1192
+ foreach($apbct->def_settings as $setting => $value){
1193
+ if(!isset($settings[$setting])){
1194
+ $settings[$setting] = null;
1195
+ settype($settings[$setting], gettype($value));
1196
+ }
1197
+ } unset($setting, $value);
1198
+
1199
+ // Set missing settings.
1200
+ foreach($apbct->def_network_settings as $setting => $value){
1201
+ if(!isset($settings[$setting])){
1202
+ $settings[$setting] = null;
1203
+ settype($settings[$setting], gettype($value));
1204
+ }
1205
+ } unset($setting, $value);
1206
+
1207
+ // Validating API key
1208
+ $settings['apikey'] = !empty($settings['apikey']) ? trim($settings['apikey']) : '';
1209
+ $settings['apikey'] = defined('CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $settings['apikey'];
1210
+ $settings['apikey'] = is_main_site() || $apbct->allow_custom_key ? $settings['apikey'] : $apbct->network_settings['apikey'];
1211
+ $settings['apikey'] = is_main_site() || !$settings['white_label'] ? $settings['apikey'] : $apbct->settings['apikey'];
1212
+ $settings['apikey'] = strpos($settings['apikey'], '*') === false ? $settings['apikey'] : $apbct->settings['apikey'];
1213
+
1214
+ // Validate Exclusions
1215
+ // URLs
1216
+ $result = apbct_settings__sanitize__exclusions($settings['exclusions__urls'], $settings['exclusions__urls__use_regexp']);
1217
+ $result === false
1218
+ ? $apbct->error_add( 'exclusions_urls', 'is not valid: "' . $settings['exclusions__urls'] . '"', 'settings_validate' )
1219
+ : $apbct->error_delete( 'exclusions_urls', true, 'settings_validate' );
1220
+ $settings['exclusions_urls'] = $result ? $result: '';
1221
+
1222
+ // Fields
1223
+ $result = apbct_settings__sanitize__exclusions($settings['exclusions__fields'], $settings['exclusions__fields__use_regexp']);
1224
+ $result === false
1225
+ ? $apbct->error_add( 'exclusions_fields', 'is not valid: "' . $settings['exclusions__fields'] . '"', 'settings_validate' )
1226
+ : $apbct->error_delete( 'exclusions_fields', true, 'settings_validate' );
1227
+ $settings['exclusions__fields'] = $result ? $result: '';
1228
+
1229
+ // WPMS Logic.
1230
+ if(APBCT_WPMS && is_main_site()){
1231
+ $network_settings = array(
1232
+ 'allow_custom_key' => $settings['allow_custom_key'],
1233
+ 'white_label' => $settings['white_label'],
1234
+ 'white_label__hoster_key' => $settings['white_label__hoster_key'],
1235
+ 'white_label__plugin_name' => $settings['white_label__plugin_name'],
1236
+ );
1237
+ unset( $settings['allow_custom_key'], $settings['white_label'], $settings['white_label__hoster_key'], $settings['white_label__plugin_name'] );
1238
+ }
1239
+
1240
+ // Drop debug data
1241
+ if (isset($_POST['submit']) && $_POST['submit'] == 'debug_drop'){
1242
+ $apbct->debug = false;
1243
+ delete_option('cleantalk_debug');
1244
+ return $settings;
1245
+ }
1246
+
1247
+ // Send connection reports
1248
+ if (isset($_POST['submit']) && $_POST['submit'] == 'ct_send_connection_report'){
1249
+ ct_mail_send_connection_report();
1250
+ return $settings;
1251
+ }
1252
+
1253
+ // Auto getting key
1254
+ if (isset($_POST['submit']) && $_POST['submit'] == 'get_key_auto'){
1255
+
1256
+ $website = parse_url(get_option('siteurl'), PHP_URL_HOST).parse_url(get_option('siteurl'), PHP_URL_PATH);
1257
+ $platform = 'wordpress';
1258
+ $user_ip = CleantalkHelper::ip__get(array('real'), false);
1259
+ $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
1260
+ $language = apbct_get_server_variable( 'HTTP_ACCEPT_LANGUAGE' );
1261
+ $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && !SUBDOMAIN_INSTALL ? true : false;
1262
+ $white_label = $apbct->network_settings['white_label'] ? 1 : 0;
1263
+ $hoster_api_key = $apbct->network_settings['white_label__hoster_key'] ? $apbct->network_settings['white_label__hoster_key'] : '';
1264
+
1265
+ $result = CleantalkAPI::method__get_api_key(
1266
+ 'antispam',
1267
+ ct_get_admin_email(),
1268
+ $website,
1269
+ $platform,
1270
+ $timezone,
1271
+ $language,
1272
+ $user_ip,
1273
+ $wpms,
1274
+ $white_label,
1275
+ $hoster_api_key
1276
+ );
1277
+
1278
+ if(empty($result['error'])){
1279
+
1280
+ if(isset($result['user_token'])){
1281
+ $apbct->data['user_token'] = $result['user_token'];
1282
+ }
1283
+
1284
+ if(!empty($result['auth_key'])){
1285
+ $settings['apikey'] = $result['auth_key'];
1286
+ }
1287
+
1288
+ }else{
1289
+ $apbct->error_add(
1290
+ 'key_get',
1291
+ $result['error']
1292
+ . ($apbct->white_label
1293
+ ? ' <button name="submit" type="submit" class="cleantalk_link cleantalk_link-manual" value="get_key_auto">'
1294
+ : ''
1295
+ )
1296
+ );
1297
+ }
1298
+ }
1299
+
1300
+ // Feedback with app_agent
1301
+ ct_send_feedback('0:' . APBCT_AGENT); // 0 - request_id, agent version.
1302
+
1303
+ // Key is good by default
1304
+ $apbct->data['key_is_ok'] = true;
1305
+
1306
+ // Check account status and validate key. Even if it's not correct because of IP license.
1307
+ $result = ct_account_status_check($settings['apikey']);
1308
+
1309
+ // Is key valid?
1310
+ if($result){
1311
+
1312
+ // Deleting errors about invalid key
1313
+ $apbct->error_delete('key_invalid key_get', 'save');
1314
+
1315
+ // SFW actions
1316
+ if($apbct->settings['spam_firewall'] == 1){
1317
+ ct_sfw_update($settings['apikey']);
1318
+ ct_sfw_send_logs($settings['apikey']);
1319
+ }
1320
+
1321
+ // Updating brief data for dashboard widget
1322
+ $apbct->data['brief_data'] = CleantalkAPI::method__get_antispam_report_breif($settings['apikey']);
1323
+
1324
+ // Key is not valid
1325
+ }else{
1326
+ $apbct->data['key_is_ok'] = false;
1327
+ $apbct->error_add('key_invalid', __('Testing is failed. Please check the Access key.', 'cleantalk'));
1328
+ }
1329
+
1330
+ // WPMS Logic.
1331
+ if(APBCT_WPMS){
1332
+ if(is_main_site()){
1333
+
1334
+ // Network settings
1335
+ $network_settings['apikey'] = $settings['apikey'];
1336
+ $apbct->network_settings = $network_settings;
1337
+ $apbct->saveNetworkSettings();
1338
+
1339
+ // Network data
1340
+ $apbct->network_data = array(
1341
+ 'key_is_ok' => $apbct->data['key_is_ok'],
1342
+ 'moderate' => $apbct->data['moderate'],
1343
+ 'valid' => $apbct->data['valid'],
1344
+ 'auto_update' => $apbct->data['auto_update'],
1345
+ 'user_token' => $apbct->data['user_token'],
1346
+ 'service_id' => $apbct->data['service_id'],
1347
+ );
1348
+ $apbct->saveNetworkData();
1349
+ }
1350
+ if(!$apbct->white_label && !is_main_site() && !$apbct->allow_custom_key){
1351
+ $settings['apikey'] = '';
1352
+ }
1353
+ }
1354
+
1355
+ if($apbct->data['key_is_ok'] == false && $apbct->data['moderate_ip'] == 0){
1356
+
1357
+ // Notices
1358
+ $apbct->data['notice_show'] = 1;
1359
+ $apbct->data['notice_renew'] = 0;
1360
+ $apbct->data['notice_trial'] = 0;
1361
+ $apbct->data['notice_review'] = 0;
1362
+ $apbct->data['notice_auto_update'] = 0;
1363
+
1364
+ // Other
1365
+ $apbct->data['service_id'] = 0;
1366
+ $apbct->data['valid'] = 0;
1367
+ $apbct->data['moderate'] = 0;
1368
+ $apbct->data['ip_license'] = 0;
1369
+ $apbct->data['moderate_ip'] = 0;
1370
+ $apbct->data['spam_count'] = 0;
1371
+ $apbct->data['auto_update'] = 0;
1372
+ $apbct->data['user_token'] = '';
1373
+ $apbct->data['license_trial'] = 0;
1374
+ $apbct->data['account_name_ob'] = '';
1375
+ }
1376
+
1377
+ $apbct->saveData();
1378
+
1379
+ return $settings;
1380
+ }
1381
+
1382
+ /**
1383
+ * Sanitize and validate exclusions.
1384
+ * Explode given string by commas and trim each string.
1385
+ * Skip element if it's empty.
1386
+ *
1387
+ * Return false if exclusion is bad
1388
+ * Return sanitized string if all is ok
1389
+ *
1390
+ * @param string $exclusions
1391
+ * @param bool $regexp
1392
+ *
1393
+ * @return bool|string
1394
+ */
1395
+ function apbct_settings__sanitize__exclusions($exclusions, $regexp = false){
1396
+ $result = array();
1397
+ if( ! empty( $exclusions ) ){
1398
+ $exclusions = explode( ',', $exclusions );
1399
+ foreach ( $exclusions as $exclusion ){
1400
+ $sanitized_exclusion = trim( $exclusion );
1401
+ if ( ! empty( $sanitized_exclusion ) ) {
1402
+ if( $regexp && ! apbct_is_regexp( $exclusion ) )
1403
+ return false;
1404
+ $result[] = $sanitized_exclusion;
1405
+ }
1406
+ }
1407
+ }
1408
+ return implode( ',', $result );
1409
+ }
1410
+
1411
+ function apbct_settings_show_gdpr_text($print = false){
1412
+
1413
+ $out = wpautop('The notice requirements remain and are expanded. They must include the retention time for personal data, and contact information for data controller and data protection officer has to be provided.
1414
+ Automated individual decision-making, including profiling (Article 22) is contestable, similarly to the Data Protection Directive (Article 15). Citizens have rights to question and fight significant decisions that affect them that have been made on a solely-algorithmic basis. Many media outlets have commented on the introduction of a "right to explanation" of algorithmic decisions, but legal scholars have since argued that the existence of such a right is highly unclear without judicial tests and is limited at best.
1415
+ To be able to demonstrate compliance with the GDPR, the data controller should implement measures, which meet the principles of data protection by design and data protection by default. Privacy by design and by default (Article 25) require data protection measures to be designed into the development of business processes for products and services. Such measures include pseudonymising personal data, by the controller, as soon as possible (Recital 78).
1416
+ It is the responsibility and the liability of the data controller to implement effective measures and be able to demonstrate the compliance of processing activities even if the processing is carried out by a data processor on behalf of the controller (Recital 74).
1417
+ Data Protection Impact Assessments (Article 35) have to be conducted when specific risks occur to the rights and freedoms of data subjects. Risk assessment and mitigation is required and prior approval of the national data protection authorities (DPAs) is required for high risks. Data protection officers (Articles 37–39) are required to ensure compliance within organisations.
1418
+ They have to be appointed:')
1419
+ .'<ul style="padding: 0px 25px; list-style: disc;">'
1420
+ .'<li>for all public authorities, except for courts acting in their judicial capacity</li>'
1421
+ .'<li>if the core activities of the controller or the processor are:</li>'
1422
+ .'<ul style="padding: 0px 25px; list-style: disc;">'
1423
+ .'<li>processing operations, which, by virtue of their nature, their scope and/or their purposes, require regular and systematic monitoring of data subjects on a large scale</li>'
1424
+ .'<li>processing on a large scale of special categories of data pursuant to Article 9 and personal data relating to criminal convictions and offences referred to in Article 10;</li>'
1425
+ .'</ul>'
1426
+ .'</li>'
1427
+ .'</ul>';
1428
+
1429
+ if($print) echo $out; else return $out;
1430
+ }
1431
+
1432
+ function apbct_settings__get__long_description(){
1433
+
1434
+ global $apbct;
1435
+
1436
+ check_ajax_referer('ct_secret_nonce' );
1437
+
1438
+ $setting_id = $_POST['setting_id'] ? $_POST['setting_id'] : '';
1439
+
1440
+ $descriptions = array(
1441
+ 'white_label' => array(
1442
+ 'title' => __( 'XSS check', 'cleantalk' ),
1443
+ 'desc' => __( 'Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to any user. As a result malicious scripts can not get access to the cookie files, session tokens and any other confidential information browsers use and store. Such scripts can even overwrite content of HTML pages. CleanTalk WAF monitors for patterns of these parameters and block them.', 'cleantalk' ),
1444
+ ),
1445
+ 'white_label__hoster_key' => array(
1446
+ 'title' => __( 'SQL-injection check', 'cleantalk' ),
1447
+ 'desc' => __( 'SQL Injection — one of the most popular ways to hack websites and programs that work with databases. It is based on injection of a custom SQL code into database queries. It could transmit data through GET, POST requests or cookie files in an SQL code. If a website is vulnerable and execute such injections then it would allow attackers to apply changes to the website\'s MySQL database.', 'cleantalk' ),
1448
+ ),
1449
+ 'white_label__plugin_name' => array(
1450
+ 'title' => __( 'Check uploaded files', 'cleantalk' ),
1451
+ 'desc' => __( 'The option checks each uploaded file to a website for malicious code. If it\'s possible for visitors to upload files to a website, for instance a work resume, then attackers could abuse it and upload an infected file to execute it later and get access to your website.', 'cleantalk' ),
1452
+ ),
1453
+ );
1454
+
1455
+ die(json_encode($descriptions[$setting_id]));
1456
  }
inc/cleantalk-users.php CHANGED
@@ -1,781 +1,802 @@
1
- <?php
2
-
3
- add_action('admin_menu', 'ct_add_users_menu');
4
- add_action( 'wp_ajax_ajax_check_users', 'ct_ajax_check_users' );
5
- add_action( 'wp_ajax_ajax_info_users', 'ct_ajax_info_users' );
6
- add_action( 'wp_ajax_ajax_insert_users', 'ct_ajax_insert_users' );
7
- add_action( 'wp_ajax_ajax_delete_checked_users', 'ct_ajax_delete_checked_users' );
8
- add_action( 'wp_ajax_ajax_delete_all_users', 'ct_ajax_delete_all_users' );
9
- add_action( 'wp_ajax_ajax_clear_users', 'ct_ajax_clear_users' );
10
- add_action( 'wp_ajax_ajax_ct_approve_user', 'ct_usercheck_approve_user' );
11
- add_action( 'wp_ajax_ajax_ct_get_csv_file', 'ct_usercheck_get_csv_file' );
12
-
13
- function ct_add_users_menu(){
14
- if(current_user_can('activate_plugins'))
15
- add_users_page( __("Check for spam", 'cleantalk'), __("Find spam users", 'cleantalk'), 'read', 'ct_check_users', 'ct_show_users_page');
16
- }
17
-
18
- function ct_show_users_page(){
19
-
20
- global $wpdb, $apbct;
21
-
22
- ?>
23
- <div class="wrap">
24
- <h2><img src="<?php echo $apbct->logo__small__colored; ?>" /> <?php echo $apbct->plugin_name; ?></h2>
25
- <a style="color: gray; margin-left: 23px;" href="<?php echo $apbct->settings_link; ?>"><?php _e('Plugin Settings', 'cleantalk'); ?></a>
26
- <br />
27
- <?php
28
-
29
- // If access key is unset in
30
- if(!apbct_api_key__is_correct()){
31
- if($apbct->moderate_ip == 1){
32
- echo '<h3>'
33
- .sprintf(
34
- __('Antispam hosting tariff does not allow you to use this feature. To do so, you need to enter an Access Key in the %splugin settings%s.', 'cleantalk'),
35
- '<a href="' . (is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk').'">',
36
- '</a>'
37
- )
38
- .'</h3>';
39
- return;
40
- }
41
- }
42
-
43
-
44
- // Getting total spam users
45
- $r = $wpdb->get_results("
46
- SELECT
47
- DISTINCT COUNT($wpdb->users.ID) AS cnt
48
- FROM $wpdb->users
49
- INNER JOIN $wpdb->usermeta
50
- ON $wpdb->users.ID = $wpdb->usermeta.user_id
51
- WHERE $wpdb->usermeta.meta_key='ct_marked_as_spam';"
52
- , ARRAY_A);
53
- $cnt_spam1=$r[0]['cnt'];
54
-
55
- ?>
56
-
57
- <!-- AJAX error message -->
58
- <div id="ct_error_message" style="display:none">
59
- <h3>
60
- <?php _e("Ajax error. Process will be automatically restarted in 3 seconds. Status: ", 'cleantalk'); ?><span id="cleantalk_ajax_error"></span> (<span id="cleantalk_js_func"></span>)
61
- </h3>
62
- <h4>Please, check for JavaScript errors in your dashboard and and repair it.</h4>
63
- </div>
64
-
65
- <!-- Deleting message -->
66
- <div id="ct_deleting_message" style="display:none">
67
- <?php _e("Please wait for a while. CleanTalk is deleting spam users. Users left: ", 'cleantalk'); ?> <span id="cleantalk_users_left">
68
- <?php echo $cnt_spam1;?>
69
- </span>
70
- </div>
71
-
72
- <!-- Main info -->
73
- <h3 id="ct_checking_status"><?php echo ct_ajax_info_users(true); ?></h3>
74
-
75
- <!-- Check options -->
76
- <div class="ct_to_hide" id="ct_check_params_wrapper">
77
- <button class="button ct_check_params_elem" id="ct_check_spam_button" <?php echo !$apbct->data['moderate'] ? 'disabled="disabled"' : ''; ?>><?php _e("Start check", 'cleantalk'); ?></button>
78
- <?php if(!empty($_COOKIE['ct_paused_users_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk'); ?></button><?php } ?>
79
- <p class="ct_check_params_desc"><?php _e("The plugin will check all users against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
80
- <br />
81
- <div class="ct_check_params_elem ct_check_params_elem_sub">
82
- <input id="ct_accurate_check" type="checkbox" value="1" /><b><label for="ct_accurate_check"><?php _e("Accurate check", 'cleantalk'); ?></b></label>
83
- </div>
84
- <p class="ct_check_params_desc"><?php _e("Allows to use user's dates to perform more accurate check. Could seriously slow down the check.", 'cleantalk'); ?></p>
85
- <br />
86
- <div class="ct_check_params_elem ct_check_params_elem_sub">
87
- <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
88
- </div>
89
- <div class="ct_check_params_desc">
90
- <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo ct_last_checked_user_register(); ?>" disabled readonly />
91
- <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo date( "M j Y"); ?>" disabled readonly />
92
- </div>
93
- <div class="ct_check_params_desc">
94
- <p>Begin/end dates of creation user to check. If no date is specified, the plugin uses the last users check date.</p>
95
- </div>
96
- <br>
97
- <?php apbct_admin__badge__get_premium(); ?>
98
- </div>
99
-
100
- <!-- Cooling notice -->
101
- <h3 id="ct_cooling_notice"></h3>
102
-
103
- <!-- Preloader and working message -->
104
- <div id="ct_preloader">
105
- <img border=0 src="<?php print plugin_dir_url(__FILE__); ?>images/preloader.gif" />
106
- </div>
107
- <div id="ct_working_message">
108
- <?php _e("Please wait for a while. CleanTalk is checking all users via blacklist database at cleantalk.org. You will have option to delete found spam users after plugin finish.", 'cleantalk'); ?>
109
- </div>
110
-
111
- <!-- Pause button -->
112
- <button class="button" id="ct_pause">Pause check</button>
113
-
114
- <?php
115
-
116
- // Pagination
117
- $page = !empty($_GET['spam_page']) ? intval($_GET['spam_page']) : 1;
118
- $on_page = 20;
119
-
120
- $args_spam = array(
121
- 'meta_query' => array(
122
- Array(
123
- 'key' => 'ct_marked_as_spam',
124
- 'value' => '1',
125
- 'compare' => 'NUMERIC'
126
- )
127
- ),
128
- 'number'=>$on_page,
129
- 'offset'=>($page-1)*$on_page
130
- );
131
-
132
- $c_spam=get_users($args_spam);
133
- if($cnt_spam1 > 0){
134
-
135
- $pages = ceil(intval($cnt_spam1)/$on_page);
136
- if($pages && $pages != 1){
137
- echo "<div class='ct_to_hide pagination'>"
138
- ."<b>Pages:</b>"
139
- ."<ul class='pagination'>";
140
- for($i = 1; $i <= $pages; $i++){
141
- echo "<li class='pagination'>"
142
- ."<a href='users.php?page=ct_check_users&spam_page=$i&ct_worked=1'>"
143
- .($i == $page ? "<span class='current_page'>$i</span>" : $i)
144
- ."</a>"
145
- ."</li>";
146
- }
147
- echo "</ul>";
148
- echo "</div>";
149
- }
150
- ?>
151
- <table class="ct_to_hide widefat fixed comments" id="ct_check_users_table">
152
- <thead>
153
- <th scope="col" id="cb" class="manage-column column-cb check-column">
154
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
155
- <input id="cb-select-all-1" type="checkbox"/>
156
- </th>
157
- <th scope="col" id="author" class="manage-column column-slug"><?php _e('Username');?></th>
158
- <th scope="col" id="comment" class="manage-column column-comment"><?php _e('Name');?></th>
159
- <th scope="col" id="response" class="manage-column column-comment"><?php _e('E-mail');?></th>
160
- <th scope="col" id="signed_up" class="manage-column column-comment"><?php _e('Signed up');?></th>
161
- <th scope="col" id="role" class="manage-column column-response sortable desc"><?php _e('Role');?></th>
162
- <th scope="col" id="posts" class="manage-column column-response sortable desc"><?php _e('Posts');?></th>
163
- </thead>
164
- <tbody id="the-comment-list" data-wp-lists="list:comment">
165
- <?php
166
- for($i=0;$i<sizeof($c_spam);$i++){
167
- $id = $c_spam[$i]->ID;
168
- $login = $c_spam[$i]->data->user_login;
169
- $email = $c_spam[$i]->data->user_email;
170
- $signed = substr($c_spam[$i]->data->user_registered, 0, -3);
171
-
172
- echo "<tr id='comment-$id' class='comment even thread-even depth-1 approved cleantalk_user' data-id='$id'>"
173
- ."<th scope='row' class='check-column'>"
174
- ."<label class='screen-reader-text' for='cb-select-$id'>Select user</label>"
175
- ."<input id='cb-select-$id' type='checkbox' name='del_comments[]' />"
176
- ."</th>"
177
- ."<td class='author column-author' nowrap>"
178
- ."<strong>"
179
- .get_avatar( $c_spam[$i]->data->ID , 32)
180
- .$login
181
- ."</strong>"
182
- ."<br/>"
183
- ."<br/>";
184
-
185
- // Outputs email if exists
186
- if(!empty($email)){
187
- echo "<a href='mailto:$email'>$email</a>"
188
- .(!$apbct->white_label
189
- ? "<a href='https://cleantalk.org/blacklists/$email' target='_blank'>"
190
- ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none' />"
191
- ."</a>"
192
- : '');
193
- }else{
194
- echo "No email";
195
- }
196
- echo "<br/>";
197
-
198
- // Outputs IP if exists
199
- $user_meta = get_user_meta($id, 'session_tokens', true);
200
- if(!empty($user_meta) && is_array($user_meta)){
201
- $user_meta=array_values($user_meta);
202
- if(!empty($user_meta[0]['ip'])){
203
- $ip = $user_meta[0]['ip'];
204
- echo "<a href='user-edit.php?user_id=$id'>$ip</a>"
205
- .(!$apbct->white_label
206
- ?"<a href='https://cleantalk.org/blacklists/$ip ' target='_blank'>"
207
- ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none' />"
208
- ."</a>"
209
- : '');
210
- }else
211
- echo "No IP adress";
212
- }else
213
- echo "No IP adress";
214
- echo "</td>";
215
- ?>
216
- <td class="comment column-comment">
217
- <div class="submitted-on">
218
- <?php print $c_spam[$i]->data->display_name; ?>
219
- <div style="height:16px; display: none;" id="cleantalk_button_set_<?php print $id; ?>">
220
- <a href="#" class="cleantalk_delete_from_list_button" data-id="<?php print $id; ?>" style="color:#0a0;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Approve", "cleantalk"); ?></a>
221
- &nbsp;|&nbsp;
222
- <a href="#" class="cleantalk_delete_user_button" id="cleantalk_delete_user_<?php print $id; ?>" data-id="<?php print $id; ?>" style="color:#a00;display:none;" onclick="return false;" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';"><?php _e("Delete", "cleantalk"); ?></a>
223
- </div>
224
- </div>
225
- </td>
226
- <td class="comment column-comment">
227
- <?php print $email; ?>
228
- </td>
229
- <td class="comment column-comment">
230
- <?php print $signed; ?>
231
- </td>
232
- <td class="comment column-comment">
233
- <?php
234
- $info=get_userdata( $id );
235
- print implode(', ', $info->roles);
236
- ?>
237
- </td>
238
- <td class="comment column-comment">
239
- <?php
240
- print count_user_posts($id);
241
- ?>
242
- </td>
243
- </tr>
244
- <?php
245
- }
246
- ?>
247
- </tbody>
248
- </table>
249
- <?php
250
- // Pagination
251
- if($pages && $pages != 1){
252
- echo "<div class='ct_to_hide pagination'>"
253
- ."<b>Pages:</b>"
254
- ."<ul class='pagination'>";
255
- for($i = 1; $i <= $pages; $i++){
256
- echo "<li class='pagination'>"
257
- ."<a href='users.php?page=ct_check_users&spam_page=$i&ct_worked=1'>"
258
- .($i == $page ? "<span class='current_page'>$i</span>" : $i)
259
- ."</a>"
260
- ."</li>";
261
- }
262
- echo "</ul>";
263
- echo "</div>";
264
- }
265
- ?>
266
- <div class="ct_to_hide" id="ct_tools_buttons" style="margin-top: 10px;">
267
- <button class="button" id="ct_delete_all_users"><?php _e('Delete all users from list', 'cleantalk'); ?></button>
268
- <button class="button" id="ct_delete_checked_users"><?php _e('Delete selected', 'cleantalk'); ?></button>
269
- <button class="button" id="ct_get_csv_file"><?php _e('Download results in CSV', 'cleantalk'); ?></button>
270
- </div>
271
- <?php
272
- }
273
- echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<br /><button class=" ct_to_hide button" id="ct_insert_users">'. __('Insert accounts', 'cleantalk'). ' (100)</button> ' : '';
274
- echo apbct_get_server_variable( 'REMOTE_ADDR' )=='127.0.0.1' ? '<button class="ct_to_hide button" id="ct_delete_users">'. __('Delete accounts', 'cleantalk'). ' (110)</button><br />' : '';
275
-
276
- if($cnt_spam1 > 0){
277
- echo "<div id='ct_search_info'>"
278
- ."<br />"
279
- .__("There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.", 'cleantalk')
280
- ."</div>";
281
- }
282
- ?>
283
- <div>
284
- <button class="button" id="ct_stop_deletion" style="display:none;"><?php _e("Stop deletion", 'cleantalk'); ?></button>
285
- </div>
286
- <div id='ct_csv_wrapper' style="display: none;"></div>
287
- </div>
288
- <?php
289
- }
290
-
291
- function ct_ajax_check_users(){
292
-
293
- check_ajax_referer('ct_secret_nonce', 'security');
294
-
295
- $amount = !empty($_POST['amount']) && intval($_POST['amount'])
296
- ? intval($_POST['amount'])
297
- : 100;
298
-
299
- global $apbct;
300
-
301
- $skip_roles = array(
302
- 'administrator'
303
- );
304
-
305
- $params = array(
306
- // 'fields' => array(
307
- // 'ID',
308
- // 'user_login',
309
- // 'user_email',
310
- // 'user_registered',
311
- // ),
312
- 'meta_query' => array(
313
- 'relation' => 'AND',
314
- array(
315
- 'key' => 'ct_checked',
316
- 'compare' => 'NOT EXISTS'
317
- ),
318
- array(
319
- 'key' => 'ct_bad',
320
- 'compare' => 'NOT EXISTS'
321
- ),
322
- ),
323
- 'orderby' => 'registered',
324
- 'order' => 'ASC',
325
- 'number' => $amount,
326
- );
327
-
328
- if(isset($_POST['from'], $_POST['till'])){
329
-
330
- $from_date = date('Y-m-d', intval(strtotime($_POST['from'])));
331
- $till_date = date('Y-m-d', intval(strtotime($_POST['till'])));
332
-
333
- $params['date_query'] = array(
334
- 'column' => 'user_registered',
335
- 'after' => $from_date,
336
- 'before' => $till_date,
337
- 'inclusive' => true,
338
- );
339
- }
340
-
341
- $u = get_users( $params );
342
-
343
- $check_result = array(
344
- 'end' => 0,
345
- 'checked' => 0,
346
- 'spam' => 0,
347
- 'bad' => 0,
348
- 'error' => 0
349
- );
350
-
351
- if(count($u) > 0){
352
-
353
- if(!empty($_POST['accurate_check'])){
354
- // Leaving users only with first comment's date. Unsetting others.
355
- foreach($u as $user_index => $user){
356
-
357
- if(!isset($curr_date))
358
- $curr_date = (substr($user->data->user_registered, 0, 10) ? substr($user->data->user_registered, 0, 10) : '');
359
-
360
- if(substr($user->data->user_registered, 0, 10) != $curr_date)
361
- unset($u[$user_index]);
362
-
363
- }
364
- unset($user_index, $user);
365
- }
366
-
367
- // Checking comments IP/Email. Gathering $data for check.
368
- $data=Array();
369
- for($i=0; $i < count($u); $i++){
370
-
371
- $user_meta = get_user_meta($u[$i]->ID, 'session_tokens', true);
372
- if(is_array($user_meta))
373
- $user_meta = array_values($user_meta);
374
-
375
- $curr_ip = !empty($user_meta[0]['ip']) ? trim($user_meta[0]['ip']) : '';
376
- $curr_email = !empty($u[$i]->data->user_email) ? trim($u[$i]->data->user_email) : '';
377
-
378
- // Check for identity
379
- $curr_ip = preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $curr_ip) === 1 ? $curr_ip : null;
380
- $curr_email = preg_match('/^\S+@\S+\.\S+$/', $curr_email) === 1 ? $curr_email : null;
381
-
382
- if(empty($curr_ip) && empty($curr_email)){
383
- $check_result['bad']++;
384
- update_user_meta($u[$i]->ID,'ct_bad','1',true);
385
- unset($u[$i]);
386
- }else{
387
- if(!empty($curr_ip))
388
- $data[] = $curr_ip;
389
- if(!empty($curr_email))
390
- $data[] = $curr_email;
391
- // Patch for empty IP/Email
392
- $u[$i]->data->user_ip = empty($curr_ip) ? 'none' : $curr_ip;
393
- $u[$i]->data->user_email = empty($curr_email) ? 'none' : $curr_email;
394
- }
395
- }
396
-
397
- // Recombining after checking and unsettting
398
- $u = array_values($u);
399
-
400
- // Drop if data empty and there's no users to check
401
- if(count($data) == 0){
402
- if($_POST['unchecked'] === 0)
403
- $check_result['end'] = 1;
404
- print json_encode($check_result);
405
- die();
406
- }
407
-
408
- $result = CleantalkAPI::method__spam_check_cms($apbct->api_key, $data, !empty($_POST['accurate_check']) ? $curr_date : null);
409
-
410
- if(empty($result['error'])){
411
-
412
- // Opening CSV file
413
- $current_user = wp_get_current_user();
414
- if(!is_dir(APBCT_DIR_PATH .'/check-results/'))
415
- mkdir(APBCT_DIR_PATH .'/check-results');
416
- $filename = APBCT_DIR_PATH ."/check-results/user_check_by_{$current_user->user_nicename}.csv";
417
- $text = '';
418
-
419
- if(isset($_POST['new_check']) && $_POST['new_check'] == 'true'){
420
- $file_desc = fopen($filename, 'w');
421
- $text .= 'login,email,ip'.PHP_EOL;
422
- }else
423
- $file_desc = fopen($filename, 'a+');
424
- // End of Opening CSV
425
-
426
- for($i=0;$i<sizeof($u);$i++){
427
-
428
- $check_result['checked']++;
429
- update_user_meta($u[$i]->ID,'ct_checked',date("Y-m-d H:m:s"),true);
430
-
431
- // Do not display forbidden roles.
432
- foreach ($skip_roles as $role) {
433
- if (in_array($role, $u[$i]->roles)){
434
- delete_user_meta($u[$i]->ID, 'ct_marked_as_spam');
435
- continue 2;
436
- }
437
- }
438
-
439
- $mark_spam_ip = false;
440
- $mark_spam_email = false;
441
-
442
- $uip = $u[$i]->data->user_ip;
443
- $uim = $u[$i]->data->user_email;
444
-
445
- if(isset($result[$uip]) && $result[$uip]['appears'] == 1)
446
- $mark_spam_ip = true;
447
-
448
- if(isset($result[$uim]) && $result[$uim]['appears'] == 1)
449
- $mark_spam_email = true;
450
-
451
- if ($mark_spam_ip || $mark_spam_email){
452
- $check_result['spam']++;
453
- update_user_meta($u[$i]->ID,'ct_marked_as_spam','1',true);
454
- $text .= $u[$i]->user_login.',';
455
- $text .= ($mark_spam_email ? $uim : '').',';
456
- $text .= ($mark_spam_ip ? $uip : '').PHP_EOL;
457
- }
458
-
459
- }
460
- if($file_desc){
461
- fwrite($file_desc, $text);
462
- fclose($file_desc);
463
- }
464
- print json_encode($check_result);
465
- }else{
466
- $check_result['error'] = 1;
467
- $check_result['error_message'] = $result['error'];
468
- echo json_encode($check_result);
469
- }
470
- }else{
471
- $check_result['end'] = 1;
472
- print json_encode($check_result);
473
- }
474
- die;
475
- }
476
-
477
- function ct_ajax_info_users($direct_call = false)
478
- {
479
- if (!$direct_call)
480
- check_ajax_referer( 'ct_secret_nonce', 'security' );
481
-
482
- // Total users
483
- $params_total = array(
484
- 'fields' => 'ID',
485
- 'count'=>true,
486
- 'orderby' => 'user_registered'
487
- );
488
- $total_users = new WP_User_Query($params_total);
489
- $cnt = $total_users->get_total();
490
-
491
- // Checked users
492
- $params_checked = array(
493
- 'fields' => 'ID',
494
- 'meta_key' => 'ct_checked',
495
- 'count_total' => true,
496
- 'orderby' => 'ct_checked'
497
- );
498
- $checked_users = new WP_User_Query($params_checked);
499
- $cnt_checked = $checked_users->get_total();
500
-
501
- // Spam users
502
- $params_spam = array(
503
- 'fields' => 'ID',
504
- 'meta_key' => 'ct_marked_as_spam',
505
- 'count_total' => true,
506
- );
507
- $spam_users = new WP_User_Query($params_spam);
508
- $cnt_spam = $spam_users->get_total();
509
-
510
- // Bad users (without IP and Email)
511
- $params_bad = array(
512
- 'fields' => 'ID',
513
- 'meta_key' => 'ct_bad',
514
- 'count_total' => true,
515
- );
516
- $bad_users = new WP_User_Query($params_bad);
517
- $cnt_bad = $bad_users->get_total();
518
-
519
- $return = array(
520
- 'message' => '',
521
- 'total' => $cnt,
522
- 'spam' => $cnt_spam,
523
- 'checked' => $cnt_checked,
524
- 'bad' => $cnt_bad,
525
- );
526
-
527
- $return['message'] .= sprintf (__("Total users %s, checked %s, last check %s, found %s spam users and %s bad users (without IP or email)", 'cleantalk'), $cnt, $cnt_checked, ct_get_last_check_date(), $cnt_spam, $cnt_bad);
528
-
529
- $backup_notice = '&nbsp;';
530
- if ($cnt_spam > 0) {
531
- $backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk');
532
- }
533
- $return['message'] .= "<p>$backup_notice</p>";
534
-
535
- if($direct_call){
536
- return $return['message'];
537
- }else{
538
- echo json_encode($return);
539
- die();
540
- }
541
-
542
- return null;
543
- }
544
-
545
- function ct_ajax_insert_users()
546
- {
547
- check_ajax_referer( 'ct_secret_nonce', 'security' );
548
-
549
- //* DELETION
550
- if(!empty($_POST['delete'])){
551
- $users = get_users(array('search' => '*user_*', 'search_columns' => array('login', 'nicename')));
552
- $deleted = 0;
553
- $amount_to_delete = 15;
554
- foreach($users as $user){
555
- if($deleted >= $amount_to_delete)
556
- break;
557
- if(wp_delete_user($user->ID))
558
- $deleted++;
559
- }
560
- print "$deleted";
561
- die();
562
- }
563
- //*/
564
-
565
- //* INSERTION
566
- global $wpdb;
567
- $to_insert = 100;
568
- $result = $wpdb->get_results('SELECT network FROM `'. APBCT_TBL_FIREWALL_DATA .'` LIMIT '. $to_insert .';', ARRAY_A);
569
-
570
- if($result){
571
- $ip = array();
572
- foreach($result as $value){
573
- $ips[] = long2ip($value['network']);
574
- }
575
- unset($value);
576
-
577
- $inserted = 0;
578
- for($i=0; $i<$to_insert; $i++){
579
- $rnd=mt_rand(1,10000000);
580
-
581
- $user_name = "user_$rnd";
582
- $email="stop_email_$rnd@example.com";
583
-
584
- $user_id = wp_create_user(
585
- $user_name,
586
- rand(),
587
- $email
588
- );
589
-
590
- $curr_user = get_user_by('email', $email);
591
-
592
- update_user_meta($curr_user->ID, 'session_tokens', array($rnd => array('ip' => $ips[$i])));
593
-
594
- if (is_int($user_id))
595
- $inserted++;
596
-
597
- }
598
- }else{
599
- $inserted = '0';
600
- }
601
- //*/
602
-
603
- print "$inserted";
604
- die();
605
- }
606
-
607
- function ct_ajax_delete_checked_users()
608
- {
609
- check_ajax_referer( 'ct_secret_nonce', 'security' );
610
- foreach($_POST['ids'] as $key=>$value)
611
- {
612
- wp_delete_user($value);
613
- }
614
- die();
615
- }
616
-
617
- function ct_ajax_delete_all_users($count_all = 0)
618
- {
619
- check_ajax_referer( 'ct_secret_nonce', 'security' );
620
-
621
- global $wpdb;
622
-
623
- $r = $wpdb->get_results("select count(*) as cnt from $wpdb->usermeta where meta_key='ct_marked_as_spam';", OBJECT );
624
-
625
- if(!empty($r)){
626
-
627
- $count_all = $r ? $r[0]->cnt : 0;
628
-
629
- $args = array(
630
- 'meta_key' => 'ct_marked_as_spam',
631
- 'meta_value' => '1',
632
- 'fields' => array('ID'),
633
- 'number' => 50
634
- );
635
- $users = get_users($args);
636
-
637
- if ($users){
638
- foreach($users as $user){
639
- wp_delete_user($user->ID);
640
- usleep(5000);
641
- }
642
- }
643
- }
644
-
645
- die($count_all);
646
- }
647
-
648
- function ct_ajax_clear_users()
649
- {
650
- check_ajax_referer( 'ct_secret_nonce', 'security' );
651
-
652
- if ( isset($_POST['from']) && isset($_POST['till']) ) {
653
- if ( preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['from'] ) && preg_match('/[a-zA-Z]{3}\s{1}\d{1,2}\s{1}\d{4}/', $_POST['till'] ) ) {
654
-
655
- $from = date('Y-m-d', intval(strtotime($_POST['from']))) . ' 00:00:00';
656
- $till = date('Y-m-d', intval(strtotime($_POST['till']))) . ' 23:59:59';
657
-
658
- global $wpdb;
659
- $query_result = $wpdb->query("DELETE FROM {$wpdb->usermeta} WHERE
660
- meta_key IN ('ct_checked', 'ct_marked_as_spam', 'ct_bad')
661
- AND meta_value >= '{$from}'
662
- AND meta_value <= '{$till}';");
663
-
664
- die();
665
-
666
- }
667
- }
668
- }
669
-
670
- /**
671
- * Admin action 'user_unapproved_to_approved' - Approve user, delete from the deleting list
672
- */
673
- function ct_usercheck_approve_user() {
674
-
675
- check_ajax_referer( 'ct_secret_nonce', 'security' );
676
-
677
- delete_metadata('user', $_POST['id'], 'ct_marked_as_spam');
678
-
679
- die();
680
- }
681
-
682
- /**
683
- * Admin action 'wp_ajax_ajax_ct_get_csv_file' - prints CSV file to AJAX
684
- */
685
- function ct_usercheck_get_csv_file() {
686
-
687
- check_ajax_referer( 'ct_secret_nonce', 'security' );
688
-
689
- $filename = !empty($_POST['filename']) ? $_POST['filename'] : false;
690
-
691
- if($filename !== false && file_exists(WP_PLUGIN_DIR."/cleantalk-spam-protect/check-results/{$filename}.csv"))
692
- $output = 1;
693
- else
694
- $output = 0;
695
-
696
- echo $output;
697
-
698
- die();
699
- }
700
-
701
- /**
702
- * Get date user reg