Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.120

Version Description

June 5 2019 = * Fix: bbPress false positives. * Fix: SpamFireWall check condition. * Fix: SpamFireWall block page. * Fix: Catch admin action via search form test. * Fix: Catch admin action (AJAX). * Mod: Using minified version of JS and CSS. * Mod: Date format in statistics.

Download this release

Release Info

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

Code changes from version 5.119.1 to 5.120

Files changed (67) hide show
  1. apbct-fingerprint.js +293 -0
  2. cleantalk.php +115 -17
  3. css/cleantalk-admin-settings-page.css +0 -151
  4. css/cleantalk-admin-settings-page.min.css +1 -0
  5. css/cleantalk-admin.css +0 -31
  6. css/cleantalk-admin.min.css +1 -0
  7. css/cleantalk-dashboard-widget.css +0 -114
  8. css/cleantalk-dashboard-widget.min.css +1 -0
  9. css/cleantalk-public-admin.css +0 -58
  10. css/cleantalk-public-admin.min.css +1 -0
  11. css/cleantalk-spam-check.css +0 -64
  12. css/cleantalk-spam-check.min.css +1 -0
  13. inc/cleantalk-admin.php +13 -13
  14. inc/cleantalk-ajax.php +22 -34
  15. inc/cleantalk-common.php +3 -0
  16. inc/cleantalk-public.php +10 -9
  17. inc/cleantalk-settings.php +4 -4
  18. inc/sfw_die_page.html +2 -2
  19. js/apbct-fingerprint.min.js +2 -0
  20. js/apbct-fingerprint.min.js.map +1 -0
  21. js/apbct-md5.min.js +24 -0
  22. js/apbct-public--alt.min.js +2 -0
  23. js/apbct-public--alt.min.js.map +1 -0
  24. js/apbct-public--gdpr.js +0 -32
  25. js/apbct-public--gdpr.min.js +2 -0
  26. js/apbct-public--gdpr.min.js.map +1 -0
  27. js/apbct-public.js +0 -214
  28. js/apbct-public.min.js +2 -0
  29. js/apbct-public.min.js.map +1 -0
  30. js/cleantalk-admin-settings-page.js +0 -61
  31. js/cleantalk-admin-settings-page.min.js +2 -0
  32. js/cleantalk-admin-settings-page.min.js.map +1 -0
  33. js/cleantalk-admin.js +0 -11
  34. js/cleantalk-admin.min.js +2 -0
  35. js/cleantalk-admin.min.js.map +1 -0
  36. js/cleantalk-comments-checkspam.js +0 -529
  37. js/cleantalk-comments-checkspam.min.js +2 -0
  38. js/cleantalk-comments-checkspam.min.js.map +1 -0
  39. js/cleantalk-comments-editscreen.js +0 -137
  40. js/cleantalk-comments-editscreen.min.js +2 -0
  41. js/cleantalk-comments-editscreen.min.js.map +1 -0
  42. js/{cleantalk-dashboard-widget--google-charts.js → cleantalk-dashboard-widget--google-charts.min.js} +0 -0
  43. js/cleantalk-dashboard-widget.js +0 -60
  44. js/cleantalk-dashboard-widget.min.js +2 -0
  45. js/cleantalk-dashboard-widget.min.js.map +1 -0
  46. js/cleantalk-debug-ajax.js +0 -18
  47. js/cleantalk-debug-ajax.min.js +2 -0
  48. js/cleantalk-debug-ajax.min.js.map +1 -0
  49. js/cleantalk-public-admin.js +0 -89
  50. js/cleantalk-public-admin.min.js +2 -0
  51. js/cleantalk-public-admin.min.js.map +1 -0
  52. js/cleantalk-users-checkspam.js +0 -541
  53. js/cleantalk-users-checkspam.min.js +2 -0
  54. js/cleantalk-users-checkspam.min.js.map +1 -0
  55. js/cleantalk-users-editscreen.js +0 -21
  56. js/cleantalk-users-editscreen.min.js +2 -0
  57. js/cleantalk-users-editscreen.min.js.map +1 -0
  58. js/cleantalk_external.js +0 -44
  59. js/cleantalk_external.min.js +2 -0
  60. js/cleantalk_external.min.js.map +1 -0
  61. js/cleantalk_internal.js +0 -54
  62. js/cleantalk_internal.min.js +2 -0
  63. js/cleantalk_internal.min.js.map +1 -0
  64. lib/CleantalkSFW.php +5 -1
  65. lib/CleantalkState.php +6 -0
  66. lib/CleantalkUpgrader.php +49 -0
  67. readme.txt +20 -1
apbct-fingerprint.js ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * fingerprintJS 0.5.5 - Fast browser fingerprint library
3
+ * https://github.com/Valve/fingerprintjs
4
+ * Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)
5
+ * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
6
+ *
7
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
8
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
9
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
10
+ * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
11
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
12
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
13
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
14
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
16
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
+ */
18
+ console.log('some1');
19
+ ;(function (name, context, definition) {
20
+ if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }
21
+ else if (typeof define === 'function' && define.amd) { define(definition); }
22
+ else { context[name] = definition(); }
23
+ })('Fingerprint', this, function () {
24
+ 'use strict';
25
+
26
+ var Fingerprint = function (options) {
27
+ var nativeForEach, nativeMap;
28
+ nativeForEach = Array.prototype.forEach;
29
+ nativeMap = Array.prototype.map;
30
+
31
+ this.each = function (obj, iterator, context) {
32
+ if (obj === null) {
33
+ return;
34
+ }
35
+ if (nativeForEach && obj.forEach === nativeForEach) {
36
+ obj.forEach(iterator, context);
37
+ } else if (obj.length === +obj.length) {
38
+ for (var i = 0, l = obj.length; i < l; i++) {
39
+ if (iterator.call(context, obj[i], i, obj) === {}) return;
40
+ }
41
+ } else {
42
+ for (var key in obj) {
43
+ if (obj.hasOwnProperty(key)) {
44
+ if (iterator.call(context, obj[key], key, obj) === {}) return;
45
+ }
46
+ }
47
+ }
48
+ };
49
+
50
+ this.map = function(obj, iterator, context) {
51
+ var results = [];
52
+ // Not using strict equality so that this acts as a
53
+ // shortcut to checking for `null` and `undefined`.
54
+ if (obj == null) return results;
55
+ if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
56
+ this.each(obj, function(value, index, list) {
57
+ results[results.length] = iterator.call(context, value, index, list);
58
+ });
59
+ return results;
60
+ };
61
+
62
+ if (typeof options == 'object'){
63
+ this.hasher = options.hasher;
64
+ this.screen_resolution = options.screen_resolution;
65
+ this.screen_orientation = options.screen_orientation;
66
+ this.canvas = options.canvas;
67
+ this.ie_activex = options.ie_activex;
68
+ } else if(typeof options == 'function'){
69
+ this.hasher = options;
70
+ }
71
+ };
72
+
73
+ Fingerprint.prototype = {
74
+ get: function(){
75
+ var keys = [];
76
+ keys.push(navigator.userAgent);
77
+ keys.push(navigator.language);
78
+ keys.push(screen.colorDepth);
79
+ if (this.screen_resolution) {
80
+ var resolution = this.getScreenResolution();
81
+ if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs
82
+ keys.push(resolution.join('x'));
83
+ }
84
+ }
85
+ keys.push(new Date().getTimezoneOffset());
86
+ keys.push(this.hasSessionStorage());
87
+ keys.push(this.hasLocalStorage());
88
+ keys.push(this.hasIndexDb());
89
+ //body might not be defined at this point or removed programmatically
90
+ if(document.body){
91
+ keys.push(typeof(document.body.addBehavior));
92
+ } else {
93
+ keys.push(typeof undefined);
94
+ }
95
+ keys.push(typeof(window.openDatabase));
96
+ keys.push(navigator.cpuClass);
97
+ keys.push(navigator.platform);
98
+ keys.push(navigator.doNotTrack);
99
+ keys.push(this.getPluginsString());
100
+ if(this.canvas && this.isCanvasSupported()){
101
+ keys.push(this.getCanvasFingerprint());
102
+ }
103
+ if(this.hasher){
104
+ return this.hasher(keys.join('###'), 31);
105
+ } else {
106
+ return this.murmurhash3_32_gc(keys.join('###'), 31);
107
+ }
108
+ },
109
+
110
+ /**
111
+ * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
112
+ *
113
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
114
+ * @see http://github.com/garycourt/murmurhash-js
115
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
116
+ * @see http://sites.google.com/site/murmurhash/
117
+ *
118
+ * @param {string} key ASCII only
119
+ * @param {number} seed Positive integer only
120
+ * @return {number} 32-bit positive integer hash
121
+ */
122
+
123
+ murmurhash3_32_gc: function(key, seed) {
124
+ var remainder, bytes, h1, h1b, c1, c2, k1, i;
125
+
126
+ remainder = key.length & 3; // key.length % 4
127
+ bytes = key.length - remainder;
128
+ h1 = seed;
129
+ c1 = 0xcc9e2d51;
130
+ c2 = 0x1b873593;
131
+ i = 0;
132
+
133
+ while (i < bytes) {
134
+ k1 =
135
+ ((key.charCodeAt(i) & 0xff)) |
136
+ ((key.charCodeAt(++i) & 0xff) << 8) |
137
+ ((key.charCodeAt(++i) & 0xff) << 16) |
138
+ ((key.charCodeAt(++i) & 0xff) << 24);
139
+ ++i;
140
+
141
+ k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
142
+ k1 = (k1 << 15) | (k1 >>> 17);
143
+ k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
144
+
145
+ h1 ^= k1;
146
+ h1 = (h1 << 13) | (h1 >>> 19);
147
+ h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
148
+ h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
149
+ }
150
+
151
+ k1 = 0;
152
+
153
+ switch (remainder) {
154
+ case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
155
+ case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
156
+ case 1: k1 ^= (key.charCodeAt(i) & 0xff);
157
+
158
+ k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
159
+ k1 = (k1 << 15) | (k1 >>> 17);
160
+ k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
161
+ h1 ^= k1;
162
+ }
163
+
164
+ h1 ^= key.length;
165
+
166
+ h1 ^= h1 >>> 16;
167
+ h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
168
+ h1 ^= h1 >>> 13;
169
+ h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
170
+ h1 ^= h1 >>> 16;
171
+
172
+ return h1 >>> 0;
173
+ },
174
+
175
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=781447
176
+ hasLocalStorage: function () {
177
+ try{
178
+ return !!window.localStorage;
179
+ } catch(e) {
180
+ return true; // SecurityError when referencing it means it exists
181
+ }
182
+ },
183
+
184
+ hasSessionStorage: function () {
185
+ try{
186
+ return !!window.sessionStorage;
187
+ } catch(e) {
188
+ return true; // SecurityError when referencing it means it exists
189
+ }
190
+ },
191
+
192
+ hasIndexDb: function () {
193
+ try{
194
+ return !!window.indexedDB;
195
+ } catch(e) {
196
+ return true; // SecurityError when referencing it means it exists
197
+ }
198
+ },
199
+
200
+ isCanvasSupported: function () {
201
+ var elem = document.createElement('canvas');
202
+ return !!(elem.getContext && elem.getContext('2d'));
203
+ },
204
+
205
+ isIE: function () {
206
+ if(navigator.appName === 'Microsoft Internet Explorer') {
207
+ return true;
208
+ } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11
209
+ return true;
210
+ }
211
+ return false;
212
+ },
213
+
214
+ getPluginsString: function () {
215
+ if(this.isIE() && this.ie_activex){
216
+ return this.getIEPluginsString();
217
+ } else {
218
+ return this.getRegularPluginsString();
219
+ }
220
+ },
221
+
222
+ getRegularPluginsString: function () {
223
+ return this.map(navigator.plugins, function (p) {
224
+ var mimeTypes = this.map(p, function(mt){
225
+ return [mt.type, mt.suffixes].join('~');
226
+ }).join(',');
227
+ return [p.name, p.description, mimeTypes].join('::');
228
+ }, this).join(';');
229
+ },
230
+
231
+ getIEPluginsString: function () {
232
+ if(window.ActiveXObject){
233
+ var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin
234
+ 'AcroPDF.PDF', // Adobe PDF reader 7+
235
+ 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr
236
+ 'QuickTime.QuickTime', // QuickTime
237
+ // 5 versions of real players
238
+ 'rmocx.RealPlayer G2 Control',
239
+ 'rmocx.RealPlayer G2 Control.1',
240
+ 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',
241
+ 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',
242
+ 'RealPlayer',
243
+ 'SWCtl.SWCtl', // ShockWave player
244
+ 'WMPlayer.OCX', // Windows media player
245
+ 'AgControl.AgControl', // Silverlight
246
+ 'Skype.Detection'];
247
+
248
+ // starting to detect plugins in IE
249
+ return this.map(names, function(name){
250
+ try{
251
+ new ActiveXObject(name);
252
+ return name;
253
+ } catch(e){
254
+ return null;
255
+ }
256
+ }).join(';');
257
+ } else {
258
+ return ""; // behavior prior version 0.5.0, not breaking backwards compat.
259
+ }
260
+ },
261
+
262
+ getScreenResolution: function () {
263
+ var resolution;
264
+ if(this.screen_orientation){
265
+ resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];
266
+ }else{
267
+ resolution = [screen.height, screen.width];
268
+ }
269
+ return resolution;
270
+ },
271
+
272
+ getCanvasFingerprint: function () {
273
+ var canvas = document.createElement('canvas');
274
+ var ctx = canvas.getContext('2d');
275
+ // https://www.browserleaks.com/canvas#how-does-it-work
276
+ var txt = 'http://valve.github.io';
277
+ ctx.textBaseline = "top";
278
+ ctx.font = "14px 'Arial'";
279
+ ctx.textBaseline = "alphabetic";
280
+ ctx.fillStyle = "#f60";
281
+ ctx.fillRect(125,1,62,20);
282
+ ctx.fillStyle = "#069";
283
+ ctx.fillText(txt, 2, 15);
284
+ ctx.fillStyle = "rgba(102, 204, 0, 0.7)";
285
+ ctx.fillText(txt, 4, 17);
286
+ return canvas.toDataURL();
287
+ }
288
+ };
289
+
290
+
291
+ return Fingerprint;
292
+
293
+ });
cleantalk.php CHANGED
@@ -3,7 +3,7 @@
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.119.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
@@ -128,13 +128,14 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
128
  add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
129
 
130
  // Set cookie only for public pages and for non-AJAX requests
131
- if (!is_admin() && !apbct_is_ajax() && !defined('DOING_CRON') && !headers_sent()
132
  && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
133
  && empty($_GET['ct_checkjs_search_default']) // Search form fix
 
134
  ){
135
  add_action('template_redirect','apbct_cookie', 2);
136
  add_action('template_redirect','apbct_store__urls', 2);
137
- if (empty($_POST) && empty($_GET['action'])){
138
  apbct_cookie();
139
  apbct_store__urls();
140
  }
@@ -153,11 +154,7 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
153
  }
154
 
155
  }
156
-
157
- // Default search
158
- //add_filter( 'get_search_form', 'apbct_forms__search__addField' );
159
- add_filter( 'get_search_query', 'apbct_forms__search__testSpam' );
160
-
161
  // Ninja Forms. Making GET action to POST action
162
  if(isset($_SERVER['REQUEST_URI']) && stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') !== false && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
163
  $_POST['action']='ninja_forms_ajax_submit';
@@ -168,19 +165,28 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
168
  add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
169
  add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
170
 
171
- if(!is_admin() && !defined('DOING_AJAX')){
 
 
 
 
 
172
 
173
  // Remote calls
174
  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'))){
175
  apbct_remote_call__perform();
176
  }
 
 
 
 
 
 
 
 
 
177
  }
178
 
179
- // SpamFireWall check
180
- if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
181
- $apbct->settings['spam_firewall'] == 1 && !is_admin() || $apbct->settings['spam_firewall'] ==1 && defined( 'DOING_AJAX' ) && DOING_AJAX && $_SERVER["REQUEST_METHOD"] == 'GET'){
182
- apbct_sfw__check();
183
- }
184
 
185
  // Activation/deactivation functions must be in main plugin file.
186
  // http://codex.wordpress.org/Function_Reference/register_activation_hook
@@ -413,7 +419,17 @@ function apbct_remote_call__perform()
413
  case 'update_plugin':
414
  add_action('wp', 'apbct_update', 1);
415
  break;
416
-
 
 
 
 
 
 
 
 
 
 
417
  // Update settins
418
  case 'update_settings':
419
  $result = apbct_rc__update_settings($_GET);
@@ -800,6 +816,79 @@ function ct_sfw_send_logs()
800
  return array('error' => true, 'error_string' => 'SFW_DISABLED');
801
  }
802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
803
  function apbct_update(){
804
 
805
  //Upgrade params
@@ -966,7 +1055,7 @@ function apbct_store__urls(){
966
 
967
  global $apbct;
968
 
969
- if($apbct->settings['store_urls'] && empty($apbct->flags__url_stored)){
970
 
971
  // URLs HISTORY
972
  // Get current url
@@ -1023,10 +1112,19 @@ function apbct_cookie(){
1023
 
1024
  if(
1025
  empty($apbct->settings['set_cookies']) || // Do not set cookies if option is disabled (for Varnish cache).
1026
- !empty($apbct->flags__cookies_setuped) // Cookies already set
 
1027
  )
1028
  return false;
1029
 
 
 
 
 
 
 
 
 
1030
  if($apbct->settings['store_urls__sessions'])
1031
  apbct_alt_sessions__remove_old();
1032
 
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.120
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
128
  add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
129
 
130
  // Set cookie only for public pages and for non-AJAX requests
131
+ if (!is_admin() && !apbct_is_ajax() && !defined('DOING_CRON')
132
  && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
133
  && empty($_GET['ct_checkjs_search_default']) // Search form fix
134
+ && empty($_POST['action']) //bbPress
135
  ){
136
  add_action('template_redirect','apbct_cookie', 2);
137
  add_action('template_redirect','apbct_store__urls', 2);
138
+ if (empty($_POST) && empty($_GET)){
139
  apbct_cookie();
140
  apbct_store__urls();
141
  }
154
  }
155
 
156
  }
157
+
 
 
 
 
158
  // Ninja Forms. Making GET action to POST action
159
  if(isset($_SERVER['REQUEST_URI']) && stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') !== false && sizeof($_POST) > 0 && isset($_GET['action']) && $_GET['action']=='ninja_forms_ajax_submit')
160
  $_POST['action']='ninja_forms_ajax_submit';
165
  add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
166
  add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
167
 
168
+ // Public actions
169
+ if(!is_admin() && !apbct_is_ajax()){
170
+
171
+ // Default search
172
+ //add_filter( 'get_search_form', 'apbct_forms__search__addField' );
173
+ add_filter( 'get_search_query', 'apbct_forms__search__testSpam' );
174
 
175
  // Remote calls
176
  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'))){
177
  apbct_remote_call__perform();
178
  }
179
+
180
+ // SpamFireWall check
181
+ if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
182
+ $apbct->settings['spam_firewall'] == 1 &&
183
+ $_SERVER["REQUEST_METHOD"] == 'GET')
184
+ {
185
+ apbct_sfw__check();
186
+ }
187
+
188
  }
189
 
 
 
 
 
 
190
 
191
  // Activation/deactivation functions must be in main plugin file.
192
  // http://codex.wordpress.org/Function_Reference/register_activation_hook
419
  case 'update_plugin':
420
  add_action('wp', 'apbct_update', 1);
421
  break;
422
+
423
+ // Install plugin
424
+ case 'install_plugin':
425
+ add_action('wp', 'apbct_install_plugin', 1);
426
+ break;
427
+
428
+ // Uninstall plugin
429
+ case 'uninstall_plugin':
430
+ add_action('plugins_loaded', 'apbct_uninstall_plugin', 1);
431
+ break;
432
+
433
  // Update settins
434
  case 'update_settings':
435
  $result = apbct_rc__update_settings($_GET);
816
  return array('error' => true, 'error_string' => 'SFW_DISABLED');
817
  }
818
 
819
+ /**
820
+ * Install plugin from wordpress catalog
821
+ *
822
+ * @param null $plugin_name
823
+ */
824
+ function apbct_install_plugin($plugin_name = null){
825
+
826
+ global $apbct;
827
+
828
+ $plugin_name = $plugin_name ? $plugin_name : (isset($_GET['plugin_name']) ? $_GET['plugin_name'] : null);
829
+
830
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
831
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
832
+ include_once( ABSPATH . 'wp-admin/includes/file.php' );
833
+ include_once( ABSPATH . 'wp-admin/includes/misc.php' );
834
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgrader.php' );
835
+ include_once( CLEANTALK_PLUGIN_DIR . 'lib/CleantalkUpgraderSkin.php' );
836
+
837
+ if($plugin_name){
838
+ $installer= new CleantalkUpgrader( new CleantalkUpgraderSkin() );
839
+ $installer->install($plugin_name);
840
+
841
+ if($installer->apbct_result === 'OK'){
842
+ die('OK');
843
+ }else
844
+ die('FAIL '. json_encode(array('error' => $installer->apbct_result)));
845
+
846
+ }else
847
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
848
+ }
849
+
850
+ /**
851
+ * Install plugin from wordpress catalog
852
+ *
853
+ * @param null $plugin_name
854
+ */
855
+ function apbct_uninstall_plugin($plugin_name = null){
856
+
857
+ global $apbct;
858
+
859
+ $plugin_name = $plugin_name ? $plugin_name : (isset($_GET['plugin_name']) ? $_GET['plugin_name'] : null);
860
+
861
+ if($plugin_name){
862
+
863
+ // Hook to set flag if the plugin is deactivated
864
+ add_action( 'deactivate_'.$plugin_name, 'apbct_uninstall_plugin__check_deactivate' );
865
+ deactivate_plugins($plugin_name, false, is_multisite() ? true : false);
866
+
867
+ if($apbct->plugin_deactivated){
868
+
869
+ // Hook to set flag if the plugin is uninstalled
870
+ add_action( 'uninstall_'.$plugin_name, 'apbct_uninstall_plugin__check_uninstall' );
871
+ uninstall_plugin($plugin_name);
872
+
873
+ if($apbct->plugin_uninstalled){
874
+ die('OK');
875
+ }else
876
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_EXISTS')));
877
+ }else
878
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_STILL_ACTIVE')));
879
+ }else
880
+ die('FAIL '. json_encode(array('error' => 'PLUGIN_NAME_IS_UNSET')));
881
+ }
882
+
883
+ function apbct_uninstall_plugin__check_deactivate(){
884
+ global $apbct;
885
+ $apbct->plugin_deactivated = true;
886
+ }
887
+ function apbct_uninstall_plugin__check_uninstall(){
888
+ global $apbct;
889
+ $apbct->plugin_uninstalled = true;
890
+ }
891
+
892
  function apbct_update(){
893
 
894
  //Upgrade params
1055
 
1056
  global $apbct;
1057
 
1058
+ if($apbct->settings['store_urls'] && empty($apbct->flags__url_stored) && !headers_sent()){
1059
 
1060
  // URLs HISTORY
1061
  // Get current url
1112
 
1113
  if(
1114
  empty($apbct->settings['set_cookies']) || // Do not set cookies if option is disabled (for Varnish cache).
1115
+ !empty($apbct->flags__cookies_setuped) || // Cookies already set
1116
+ !empty($apbct->headers_sent) // Headers sent
1117
  )
1118
  return false;
1119
 
1120
+ // Prevent headers sent error
1121
+ if(headers_sent($file, $line)){
1122
+ $apbct->headers_sent = true;
1123
+ $apbct->headers_sent__hook = current_action();
1124
+ $apbct->headers_sent__where = $file.':'.$line;
1125
+ return false;
1126
+ }
1127
+
1128
  if($apbct->settings['store_urls__sessions'])
1129
  apbct_alt_sessions__remove_old();
1130
 
css/cleantalk-admin-settings-page.css DELETED
@@ -1,151 +0,0 @@
1
- #apbctTopWarning {margin-bottom: 5px;}
2
- #apbctTopWarning h3{margin: 10px 0 5px 0;}
3
- #apbctTopWarning h4{margin: 10px;}
4
- #apbctTopWarning h4 span{margin-top: 5px;}
5
-
6
- /* Main title */
7
- /*.apbct_settings-title{ display: inline-block; }*/
8
- .apbct_settings-subtitle{
9
- position: relative;
10
- top: -15px;
11
- margin: 0;
12
- }
13
-
14
- /* Setting fields */
15
- .apbct_settings-field_wrapper{ margin: 15px 0; }
16
- .apbct_settings-field_wrapper--sub{ margin-left: 30px !important; }
17
-
18
- .apbct_settings-field_title{ }
19
- .apbct_settings__label{
20
- margin-right: 10px;
21
- font-size: 17px;
22
- vertical-align: text-bottom;
23
- }
24
-
25
- .apbct_settings-field_content{ display: inline-block; }
26
- .apbct_settings-field_content--checkbox{ }
27
- .apbct_settings-field_content--radio{ width: 70%; }
28
- .apbct_settings-field_content--text{ }
29
-
30
- .apbct_settings-field_title{}
31
- .apbct_settings-field_title--checkbox{ }
32
- .apbct_settings-field_title--radio{
33
- display: inline-block;
34
- margin: 0;
35
- width: 210px;
36
- padding-right: 10px;
37
- font-size: 14px;
38
- vertical-align: top;
39
- }
40
- .apbct_input_text{min-width: 255px;}
41
- .apbct_input_text-width--500px{width: 500px;}
42
-
43
- .cleantalk_manual_link {padding: 10px; background: #3399FF; color: #fff; border:0 none;
44
- cursor:pointer;
45
- -webkit-border-radius: 5px;
46
- border-radius: 5px;
47
- font-size: 12pt;
48
- }
49
- .cleantalk_auto_link{
50
- background: #ccc;
51
- border-color: #999;
52
- -webkit-box-shadow: inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);
53
- box-shadow: inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);
54
- color: #000;
55
- text-decoration: none;
56
- display: inline-block;
57
- text-decoration: none;
58
- font-size: 13px;
59
- line-height: 26px;
60
- height: 28px;
61
- margin: 0;
62
- padding: 0 10px 1px;
63
- cursor: pointer;
64
- border-width: 1px;
65
- border-style: solid;
66
- -webkit-appearance: none;
67
- -webkit-border-radius: 2px;
68
- border-radius: 2px;
69
- white-space: nowrap;
70
- -webkit-box-sizing: border-box;
71
- -moz-box-sizing: border-box;
72
- box-sizing: border-box;
73
- }
74
- .cleantalk_auto_link:hover{
75
- color: #fff;
76
- }
77
- .cleantalk_manual_link
78
- {
79
- background: #2ea2cc;
80
- border-color: #0074a2;
81
- -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);
82
- box-shadow: inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);
83
- color: #fff;
84
- text-decoration: none;
85
- display: inline-block;
86
- text-decoration: none;
87
- font-size: 13px;
88
- line-height: 26px;
89
- margin: 0;
90
- padding: 0 10px 1px;
91
- cursor: pointer;
92
- border-width: 1px;
93
- border-style: solid;
94
- -webkit-appearance: none;
95
- -webkit-border-radius: 3px;
96
- border-radius: 3px;
97
- white-space: nowrap;
98
- -webkit-box-sizing: border-box;
99
- -moz-box-sizing: border-box;
100
- box-sizing: border-box;
101
- text-align: center;
102
- }
103
- .cleantalk_manual_link:hover
104
- {
105
- color:black;
106
- }
107
-
108
-
109
-
110
- .apbct_status_icon{
111
- vertical-align: text-bottom;
112
- margin: 0 5px 0 8px;
113
- }
114
-
115
- a.ct_support_link{
116
- color: #666;
117
- margin-right: 0.5em;
118
- font-size: 10pt;
119
- font-weight: normal;
120
- }
121
-
122
- .ct-warning-test-failed {
123
- display: inline-block;
124
- position: relative;
125
- padding: 5px;
126
- margin: 4px;
127
- border: 3px solid rgba(240,50,50,1);
128
- border-radius: 5px;
129
- background-color: rgba(255,200,200,1);
130
- }
131
-
132
- /* Settings banners */
133
- .ct_settings_banner{
134
- text-align: right;
135
- display:inline-block;
136
- width: 100%;
137
- margin: 1em 0;
138
- vertical-align: top;
139
- }
140
-
141
- #ct_translate_plugin {margin-left: 0px;}
142
- .ct_rate_block {
143
- display: inline-block;
144
- width: 370px;
145
- margin-right: 3em;
146
- padding: 0.8em;
147
- padding-bottom: 15px;
148
- text-align: center;
149
- border: 1px dashed #666;
150
- }
151
- #ct_translate_plugin .spbc_button_rate{margin-bottom: 10px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cleantalk-admin-settings-page.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content{display:inline-block}.apbct_settings-field_content--radio{width:70%}.apbct_settings-field_title--radio{display:inline-block;margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px}.apbct_input_text-width--500px{width:500px}.cleantalk_manual_link{border:0}.cleantalk_auto_link,.cleantalk_manual_link{text-decoration:none;font-size:13px;line-height:26px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap}.cleantalk_auto_link{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;display:inline-block;height:28px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_auto_link:hover{color:#fff}.cleantalk_manual_link{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;display:inline-block;-webkit-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;text-align:center}.cleantalk_manual_link:hover{color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{display:inline-block;position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;display:inline-block;width:100%;margin:1em 0;vertical-align:top}#ct_translate_plugin{margin-left:0}.ct_rate_block{display:inline-block;width:370px;margin-right:3em;padding:.8em .8em 15px;text-align:center;border:1px dashed #666}#ct_translate_plugin .spbc_button_rate{margin-bottom:10px}
css/cleantalk-admin.css DELETED
@@ -1,31 +0,0 @@
1
- /* Common styles for admin pages */
2
- :disabled{cursor: not-allowed !important;}
3
- .apbct_color--gray{color: gray;}
4
- .apbct_display--none{display: none;}
5
- .apbct_font-size--14pt{font-size: 14pt;}
6
-
7
- /* Additional styles for admin pages */
8
- .ct_meta_links{
9
-
10
- }
11
- .ct_translate_links{color: rgba(150, 150, 20, 1);}
12
- .ct_support_links {color: rgba(150, 20, 20, 1);}
13
- .ct_faq_links {color: rgba(20, 150, 20, 1);}
14
- .ct_setting_links {color: rgba(20, 20, 150, 1);}
15
-
16
- .ct_translate_links:hover{color: rgba(210, 210, 20, 1) !important;}
17
- .ct_support_links:hover {color: rgba(250, 20, 20, 1) !important;}
18
- .ct_faq_links:hover {color: rgba(20, 250, 20, 1) !important;}
19
- .ct_setting_links:hover {color: rgba(20, 20, 250, 1) !important;}
20
-
21
- .ct_link_new_tab img{
22
- float: none !important;
23
- margin: 0 2px;
24
- border: 0;
25
- }
26
-
27
- #negative_reports_table tr td{
28
- padding: 7px 5px !important;
29
- }
30
-
31
- #apbct_gdpr_open_modal:hover{cursor: pointer};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cleantalk-admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ :disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_font-size--14pt{font-size:14pt}.ct_translate_links{color:rgba(150,150,20,1)}.ct_support_links{color:rgba(150,20,20,1)}.ct_faq_links{color:rgba(20,150,20,1)}.ct_setting_links{color:rgba(20,20,150,1)}.ct_translate_links:hover{color:rgba(210,210,20,1)!important}.ct_support_links:hover{color:rgba(250,20,20,1)!important}.ct_faq_links:hover{color:rgba(20,250,20,1)!important}.ct_setting_links:hover{color:rgba(20,20,250,1)!important}.ct_link_new_tab img{float:none!important;margin:0 2px;border:0}#negative_reports_table tr td{padding:7px 5px!important}#apbct_gdpr_open_modal:hover{cursor:pointer};
css/cleantalk-dashboard-widget.css DELETED
@@ -1,114 +0,0 @@
1
- .ct_widget_top_links{
2
- position: absolute;
3
- top: 8px;
4
- right: 33px;
5
- }
6
- .ct_widget_settings_link{margin: 0 0 0 10px;}
7
- .ct_widget_refresh_link{}
8
-
9
- .ct_preloader{
10
- display: none;
11
- float: left;
12
- width: 20px; height: 20px;
13
- margin: 0 10px;
14
- }
15
-
16
- .ct_widget_wrapper{
17
- display: block; position: relative;
18
- width: 100%; height: 100%;
19
- }
20
- .ct_widget_hr{
21
- width: 100%;
22
- }
23
-
24
- .ct_widget_block_header{
25
- font-size: 18px !important;
26
- margin-left: 12px !important;
27
- }
28
-
29
- .ct_widget_block{
30
- display: block; position: relative;
31
- padding: 12px;
32
- }
33
- .ct_widget_chart_wrapper{
34
- height: 300px;
35
- margin-right: 10px;
36
- }
37
- #ct_widget_chart{}
38
-
39
- .bar {fill: steelblue;}
40
- .bar:nth-child(odd){fill: rgba(50,50,250,0.9);}
41
- .bar:hover {fill: brown;}
42
-
43
- .axis--x path {
44
- display: none;
45
- }
46
-
47
- .ct_widget_block table{
48
- width: 100%;
49
- text-align: left;
50
- }
51
- .ct_widget_block table tr{margin-bottom: 10px;}
52
- .ct_widget_block table th{
53
- text-align: left;
54
- padding: 10px 0 5px 10px;;
55
- border-bottom: 2px solid gray;
56
-
57
- }
58
- .ct_widget_block table td{
59
- text-align: left;
60
- padding: 10px 0 5px 10px;;
61
- border-bottom: 1px solid gray;
62
- }
63
-
64
- .ct_widget_button{
65
- display: block;
66
- margin: 10px auto;
67
- }
68
- .ct_widget_activate_button{
69
- display: block;
70
- margin: 10px auto; padding: 7px 15px;
71
- font-weight: 600;
72
- border-radius: 3px;
73
- border: 2px solid #aaa;
74
- background: rgba(250,50,50,0.9);
75
- }
76
- .ct_widget_resolve_button{
77
- background: rgba(50,250,50,0.9);
78
- }
79
- .ct_widget_activate_header{
80
- display: inline-block;
81
- width: 100%;
82
- text-align: center;
83
- font-size: 18px !important;
84
- }
85
- .ct_widget_wprapper_total_blocked{
86
- padding: 10px 0px 10px 10px;
87
- background: #f1f1f1;
88
- }
89
- .ct_widget_wprapper_total_blocked span{
90
- position: relative;
91
- top: 2px;
92
- }
93
- .ct_widget_small_logo{
94
- margin-right: 1em;
95
- vertical-align: middle;
96
- }
97
- #ct_widget_button_view_all{
98
- cursor: pointer;
99
- border: 1px solid #0074a2;
100
- -webkit-appearance: none;
101
- -webkit-border-radius: 2px;
102
- border-radius: 2px;
103
- white-space: nowrap;
104
- -webkit-box-sizing: border-box;
105
- -moz-box-sizing: border-box;
106
- box-sizing: border-box;
107
- background: #2ea2cc;
108
- background: #0085ba;
109
- -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
110
- box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
111
- color: #fff;
112
- }
113
- #ct_widget_button_view_all:hover{color: #000 !important;}
114
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cleantalk-dashboard-widget.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ct_widget_top_links{position:absolute;top:8px;right:33px}.ct_widget_settings_link{margin:0 0 0 10px}.ct_preloader{display:none;float:left;width:20px;height:20px;margin:0 10px}.ct_widget_wrapper{display:block;position:relative;width:100%;height:100%}.ct_widget_hr{width:100%}.ct_widget_block_header{font-size:18px!important;margin-left:12px!important}.ct_widget_block{display:block;position:relative;padding:12px}.ct_widget_chart_wrapper{height:300px;margin-right:10px}.bar{fill:#4682b4}.bar:nth-child(odd){fill:rgba(50,50,250,.9)}.bar:hover{fill:brown}.axis--x path{display:none}.ct_widget_block table{width:100%;text-align:left}.ct_widget_block table tr{margin-bottom:10px}.ct_widget_activate_button,.ct_widget_button{display:block;margin:10px auto}.ct_widget_block table th{text-align:left;padding:10px 0 5px 10px;border-bottom:2px solid gray}.ct_widget_block table td{text-align:left;padding:10px 0 5px 10px;border-bottom:1px solid gray}.ct_widget_activate_button{padding:7px 15px;font-weight:600;border-radius:3px;border:2px solid #aaa;background:rgba(250,50,50,.9)}.ct_widget_resolve_button{background:rgba(50,250,50,.9)}.ct_widget_activate_header{display:inline-block;width:100%;text-align:center;font-size:18px!important}.ct_widget_wprapper_total_blocked{padding:10px 0 10px 10px;background:#f1f1f1}.ct_widget_wprapper_total_blocked span{position:relative;top:2px}.ct_widget_small_logo{margin-right:1em;vertical-align:middle}#ct_widget_button_view_all{cursor:pointer;border:1px solid #0074a2;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#0085ba;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}#ct_widget_button_view_all:hover{color:#000!important}
css/cleantalk-public-admin.css DELETED
@@ -1,58 +0,0 @@
1
- .ct_hidden{
2
- display: none;
3
- }
4
-
5
- .ct_comment_info{
6
- font-size: 11px;
7
- line-height: 12px;
8
- margin-bottom: 15px;
9
- }
10
- .ct_comment_titles
11
- {
12
- border-bottom: 1px solid gray !important;
13
- background: inherit;
14
- margin-bottom: 15px;
15
- }
16
- p.ct_comment_info_title{
17
- display: inline-block;
18
- }
19
- p.ct_comment_logo_title{
20
- float:right;
21
- display: inline-block;
22
- }
23
- .ct_comment_logo_img{
24
- height: 12px;
25
- vertical-align: text-top;
26
- box-shadow: transparent 0 0 0 !important;
27
- }
28
-
29
- .ct_this_is{
30
- padding: 2px 3px;
31
- cursor: pointer;
32
- white-space: nowrap;
33
- color: black !important;
34
- background: rgba(230,230,230,1);
35
- border: 1px solid #777;
36
- border-radius: 4px;
37
- }
38
- .ct_this_is_spam{
39
-
40
- }
41
- p.ct_feedback_wrap{
42
- display: none;
43
- position: absolute;
44
- top: 5px; left: 0px;
45
- height: 100%;
46
- background: white;
47
- padding: 2px 6px;
48
- border-radius: 3px;
49
- }
50
- .ct_feedback_result{display: none; text-decoration: underline;}
51
- .ct_feedback_result_spam{color: red;}
52
- .ct_feedback_result_not_spam{color: green;}
53
-
54
- .ct_feedback_msg a{color: green !important; text-decoration: underline;}
55
-
56
- .ct_feedback_success{color: green;}
57
- .ct_feedback_error{color: red;}
58
- .ct_feedback_no_hash{color: blue;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cleantalk-public-admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ct_hidden{display:none}.ct_comment_info{font-size:11px;line-height:12px;margin-bottom:15px}.ct_comment_titles{border-bottom:1px solid gray!important;background:inherit;margin-bottom:15px}p.ct_comment_info_title{display:inline-block}p.ct_comment_logo_title{float:right;display:inline-block}.ct_comment_logo_img{height:12px;vertical-align:text-top;box-shadow:transparent 0 0 0!important}.ct_this_is{padding:2px 3px;cursor:pointer;white-space:nowrap;color:#000!important;background:rgba(230,230,230,1);border:1px solid #777;border-radius:4px}p.ct_feedback_wrap{display:none;position:absolute;top:5px;left:0;height:100%;background:#fff;padding:2px 6px;border-radius:3px}.ct_feedback_result{display:none;text-decoration:underline}.ct_feedback_result_spam{color:red}.ct_feedback_result_not_spam{color:green}.ct_feedback_msg a{color:green!important;text-decoration:underline}.ct_feedback_success{color:green}.ct_feedback_error{color:red}.ct_feedback_no_hash{color:#00f}
css/cleantalk-spam-check.css DELETED
@@ -1,64 +0,0 @@
1
- #ct_checking_status, #ct_cooling_notice, #ct_error_message h3, #ct_error_message h4{
2
- text-align: center;
3
- width:90%;
4
- }
5
-
6
- #ct_preloader{
7
- display:none;
8
- width:100%;
9
- text-align:center;
10
- }
11
- #ct_working_message{
12
- display:none;
13
- margin:auto;
14
- margin-top: 1em;
15
- padding:3px;
16
- width:70%;
17
- border:2px dotted gray;
18
- background:#ffff99;
19
- }
20
-
21
- #ct_pause{
22
- display:none;
23
- }
24
-
25
- div.ct_check_params_wrapper{}
26
- .ct_check_params_elem{}
27
- .ct_check_params_elem_sub{
28
- margin: 15px 0 0 25px;
29
- width: 150px;
30
- display: inline-block;
31
- }
32
- .ct_check_params_elem_sub_sub{ margin: 15px 0 0 50px; }
33
- button#ct_check_spam_button{
34
- background: #2ea2cc;
35
- border-color: #0074a2;
36
- color: #fff;
37
- -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
38
- box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
39
- }
40
- button#ct_check_spam_button:hover{ color: black; }
41
- .ct_date{
42
- display: inline;
43
- width: 150px;
44
- }
45
- .ct_check_params_desc{
46
- display: inline-block;
47
- margin: 5px 10px 10px 15px;
48
- }
49
-
50
- div.pagination{
51
- margin: 10px;
52
- }
53
- ul.pagination{
54
- display: inline-block;
55
- margin: 0;
56
- }
57
- li.pagination{
58
- display: inline-block;
59
- margin-left: 10px;
60
- }
61
- span.current_page{
62
- font-size: 1.3em;
63
- font-weight: 600;
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cleantalk-spam-check.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #ct_checking_status,#ct_cooling_notice,#ct_error_message h3,#ct_error_message h4{text-align:center;width:90%}#ct_preloader{display:none;width:100%;text-align:center}#ct_working_message{display:none;margin:1em auto auto;padding:3px;width:70%;border:2px dotted gray;background:#ff9}#ct_pause{display:none}.ct_check_params_elem_sub{margin:15px 0 0 25px;width:150px;display:inline-block}.ct_check_params_elem_sub_sub{margin:15px 0 0 50px}button#ct_check_spam_button{background:#2ea2cc;border-color:#0074a2;color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15)}button#ct_check_spam_button:hover{color:#000}.ct_date{display:inline;width:150px}.ct_check_params_desc{display:inline-block;margin:5px 10px 10px 15px}div.pagination{margin:10px}ul.pagination{display:inline-block;margin:0}li.pagination{display:inline-block;margin-left:10px}span.current_page{font-size:1.3em;font-weight:600}
inc/cleantalk-admin.php CHANGED
@@ -220,8 +220,8 @@ function apbct_admin__enqueue_scripts($hook){
220
  global $apbct;
221
 
222
  // Scripts to all admin pages
223
- wp_enqueue_script('ct_admin_js_notices', plugins_url('/cleantalk-spam-protect/js/cleantalk-admin.js'), array(), APBCT_VERSION);
224
- wp_enqueue_style ('ct_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-admin.css'), array(), APBCT_VERSION, 'all');
225
 
226
  wp_localize_script( 'jquery', 'ctAdminCommon', array(
227
  'plugin_name' => $apbct->plugin_name,
@@ -233,10 +233,10 @@ function apbct_admin__enqueue_scripts($hook){
233
  // DASHBOARD page JavaScript and CSS
234
  if($hook == 'index.php' && apbct_is_user_role_in(array('administrator'))){
235
 
236
- wp_enqueue_style('ct_admin_css_widget_dashboard', plugins_url('/cleantalk-spam-protect/css/cleantalk-dashboard-widget.css'), array(), APBCT_VERSION, 'all');
237
 
238
- wp_enqueue_script('ct_gstatic_charts_loader', plugins_url('/cleantalk-spam-protect/js/cleantalk-dashboard-widget--google-charts.js'), array(), APBCT_VERSION);
239
- wp_enqueue_script('ct_admin_js_widget_dashboard', plugins_url('/cleantalk-spam-protect/js/cleantalk-dashboard-widget.js'), array('ct_gstatic_charts_loader'), APBCT_VERSION);
240
 
241
  // Preparing widget data
242
  // Parsing brief data 'spam_stat' {"yyyy-mm-dd": spam_count, "yyyy-mm-dd": spam_count} to [["yyyy-mm-dd", "spam_count"], ["yyyy-mm-dd", "spam_count"]]
@@ -262,8 +262,8 @@ function apbct_admin__enqueue_scripts($hook){
262
  wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/js/jquery-ui.min.js'), array('jquery'), '1.12.1' );
263
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
264
 
265
- wp_enqueue_script('cleantalk_admin_js_settings_page', plugins_url('/cleantalk-spam-protect/js/cleantalk-admin-settings-page.js'), array(), APBCT_VERSION);
266
- wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-admin-settings-page.css'), array(), APBCT_VERSION, 'all');
267
 
268
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
269
  wp_localize_script( 'jquery', 'ctSettingsPage', array(
@@ -285,11 +285,11 @@ function apbct_admin__enqueue_scripts($hook){
285
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
286
 
287
  // CSS
288
- wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-spam-check.css'), array(), APBCT_VERSION, 'all');
289
 
290
  // CHECK COMMENTS page JavaScript
291
  if($hook == 'comments_page_ct_check_spam'){
292
- wp_enqueue_script('ct_comments_checkspam', plugins_url('/cleantalk-spam-protect/js/cleantalk-comments-checkspam.js'), array(), APBCT_VERSION);
293
  wp_localize_script( 'jquery', 'ctCommentsCheck', array(
294
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
295
  'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
@@ -309,7 +309,7 @@ function apbct_admin__enqueue_scripts($hook){
309
 
310
  // COMMENTS page JavaScript
311
  if($hook == 'edit-comments.php'){
312
- wp_enqueue_script('ct_comments_editscreen', plugins_url('/cleantalk-spam-protect/js/cleantalk-comments-editscreen.js'), array(), APBCT_VERSION);
313
  wp_localize_script( 'jquery', 'ctCommentsScreen', array(
314
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
315
  'spambutton_text' => __("Find spam-comments", 'cleantalk'),
@@ -335,11 +335,11 @@ function apbct_admin__enqueue_scripts($hook){
335
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
336
 
337
  // CSS
338
- wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/css/cleantalk-spam-check.css', array(), APBCT_VERSION, 'all');
339
 
340
  // CHECK USERS page JavaScript
341
  if($hook == 'users_page_ct_check_users'){
342
- wp_enqueue_script('ct_users_checkspam', plugins_url('/cleantalk-spam-protect/js/cleantalk-users-checkspam.js'), array(), APBCT_VERSION);
343
  wp_localize_script( 'jquery', 'ctUsersCheck', array(
344
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
345
  'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
@@ -361,7 +361,7 @@ function apbct_admin__enqueue_scripts($hook){
361
 
362
  // USERS page JavaScript
363
  if($hook == 'users.php'){
364
- wp_enqueue_script('ct_users_editscreen', plugins_url('/cleantalk-spam-protect/js/cleantalk-users-editscreen.js'), array(), APBCT_VERSION);
365
  wp_localize_script( 'jquery', 'ctUsersScreen', array(
366
  'spambutton_text' => __("Find spam-users", 'cleantalk'),
367
  'ct_show_check_links' => (bool)$apbct->settings['show_check_links'],
220
  global $apbct;
221
 
222
  // Scripts to all admin pages
223
+ wp_enqueue_script('ct_admin_js_notices', plugins_url('/cleantalk-spam-protect/js/cleantalk-admin.min.js'), array(), APBCT_VERSION);
224
+ wp_enqueue_style ('ct_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-admin.min..css'), array(), APBCT_VERSION, 'all');
225
 
226
  wp_localize_script( 'jquery', 'ctAdminCommon', array(
227
  'plugin_name' => $apbct->plugin_name,
233
  // DASHBOARD page JavaScript and CSS
234
  if($hook == 'index.php' && apbct_is_user_role_in(array('administrator'))){
235
 
236
+ wp_enqueue_style('ct_admin_css_widget_dashboard', plugins_url('/cleantalk-spam-protect/css/cleantalk-dashboard-widget.min.css'), array(), APBCT_VERSION, 'all');
237
 
238
+ wp_enqueue_script('ct_gstatic_charts_loader', plugins_url('/cleantalk-spam-protect/js/cleantalk-dashboard-widget--google-charts.min.js'), array(), APBCT_VERSION);
239
+ wp_enqueue_script('ct_admin_js_widget_dashboard', plugins_url('/cleantalk-spam-protect/js/cleantalk-dashboard-widget.min.js'), array('ct_gstatic_charts_loader'), APBCT_VERSION);
240
 
241
  // Preparing widget data
242
  // Parsing brief data 'spam_stat' {"yyyy-mm-dd": spam_count, "yyyy-mm-dd": spam_count} to [["yyyy-mm-dd", "spam_count"], ["yyyy-mm-dd", "spam_count"]]
262
  wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/js/jquery-ui.min.js'), array('jquery'), '1.12.1' );
263
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
264
 
265
+ wp_enqueue_script('cleantalk_admin_js_settings_page', plugins_url('/cleantalk-spam-protect/js/cleantalk-admin-settings-page.min.js'), array(), APBCT_VERSION);
266
+ wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-admin-settings-page.min.css'), array(), APBCT_VERSION, 'all');
267
 
268
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
269
  wp_localize_script( 'jquery', 'ctSettingsPage', array(
285
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
286
 
287
  // CSS
288
+ wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-spam-check.min.css'), array(), APBCT_VERSION, 'all');
289
 
290
  // CHECK COMMENTS page JavaScript
291
  if($hook == 'comments_page_ct_check_spam'){
292
+ wp_enqueue_script('ct_comments_checkspam', plugins_url('/cleantalk-spam-protect/js/cleantalk-comments-checkspam.min.js'), array(), APBCT_VERSION);
293
  wp_localize_script( 'jquery', 'ctCommentsCheck', array(
294
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
295
  'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
309
 
310
  // COMMENTS page JavaScript
311
  if($hook == 'edit-comments.php'){
312
+ wp_enqueue_script('ct_comments_editscreen', plugins_url('/cleantalk-spam-protect/js/cleantalk-comments-editscreen.min.js'), array(), APBCT_VERSION);
313
  wp_localize_script( 'jquery', 'ctCommentsScreen', array(
314
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
315
  'spambutton_text' => __("Find spam-comments", 'cleantalk'),
335
  wp_enqueue_style('jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'),array(), '1.21.1', 'all');
336
 
337
  // CSS
338
+ wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/css/cleantalk-spam-check.min.css', array(), APBCT_VERSION, 'all');
339
 
340
  // CHECK USERS page JavaScript
341
  if($hook == 'users_page_ct_check_users'){
342
+ wp_enqueue_script('ct_users_checkspam', plugins_url('/cleantalk-spam-protect/js/cleantalk-users-checkspam.min.js'), array(), APBCT_VERSION);
343
  wp_localize_script( 'jquery', 'ctUsersCheck', array(
344
  'ct_ajax_nonce' => wp_create_nonce('ct_secret_nonce'),
345
  'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
361
 
362
  // USERS page JavaScript
363
  if($hook == 'users.php'){
364
+ wp_enqueue_script('ct_users_editscreen', plugins_url('/cleantalk-spam-protect/js/cleantalk-users-editscreen.min.js'), array(), APBCT_VERSION);
365
  wp_localize_script( 'jquery', 'ctUsersScreen', array(
366
  'spambutton_text' => __("Find spam-users", 'cleantalk'),
367
  'ct_show_check_links' => (bool)$apbct->settings['show_check_links'],
inc/cleantalk-ajax.php CHANGED
@@ -256,32 +256,12 @@ function ct_ajax_hook($message_obj = false, $additional = false)
256
  apbct_wp_set_current_user(apbct_wp_get_current_user());
257
  }
258
 
259
- // Skip test if Custom contact forms is disabled.
260
- if( !$apbct->settings['general_contact_forms_test']
261
- || (!ct_is_user_enable())
262
- )
263
- {
264
- return false;
265
- }
266
-
267
- //
268
- // Go out because we call it on backend.
269
- //
270
- if( ct_is_user_enable() === false || (function_exists('get_current_user_id') && get_current_user_id() != 0)){
271
- if(strval(current_action()) != 'et_pre_insert_answer' && (isset($message_obj['author']) && intval($message_obj['author']) == 0) || (isset($message_obj['post_author']) && intval($message_obj['post_author']) == 0)) //QAEngine Theme fix
272
- {
273
- return false;
274
- }
275
- }
276
-
277
- //
278
- // Go out because of not spam data
279
- //
280
  $skip_post = array(
281
  'gmaps_display_info_window', // Geo My WP pop-up windows.
282
  'gmw_ps_display_info_window', // Geo My WP pop-up windows.
283
  'the_champ_user_auth', // Super Socializer
284
- 'simbatfa-init-otp', //Two-Factor Auth
285
  'wppb_msf_check_required_fields', //ProfileBuilder skip step checking
286
  'boss_we_login', //Login form
287
  'sidebar_login_process', // Login CF7
@@ -298,21 +278,29 @@ function ct_ajax_hook($message_obj = false, $additional = false)
298
  'save_tourmaster_option', //Tourmaster admin save
299
  );
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  //General post_info for all ajax calls
302
  $post_info = array('comment_type' => 'feedback_ajax');
303
-
304
- // Use exclusions
305
- if(check_url_exclusions()){
306
- return false;
307
- }
308
-
309
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE, true);
310
- if( (isset($_POST['action']) && in_array($_POST['action'], $skip_post))
311
- || (isset($_GET['action']) && in_array($_GET['action'], $skip_post))
312
- ) {
313
- return false;
314
- }
315
-
316
  if(isset($_POST['user_login']))
317
  $sender_nickname = $_POST['user_login'];
318
  else
256
  apbct_wp_set_current_user(apbct_wp_get_current_user());
257
  }
258
 
259
+ // Go out because of not spam data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  $skip_post = array(
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
278
  'save_tourmaster_option', //Tourmaster admin save
279
  );
280
 
281
+ // Skip test if
282
+ if( !$apbct->settings['general_contact_forms_test'] || // Test disabled
283
+ !ct_is_user_enable() || // User is admin, editor, author
284
+ ($apbct->settings['protect_logged_in'] && (isset($current_user->ID) && $current_user->ID !== 0 )) || // Logged in user
285
+ check_url_exclusions() || // url exclusions
286
+ (isset($_POST['action']) && in_array($_POST['action'], $skip_post)) || // Special params
287
+ (isset($_GET['action']) && in_array($_GET['action'], $skip_post)) || // Special params
288
+ // QAEngine Theme fix
289
+ ( strval(current_action()) != 'et_pre_insert_answer' &&
290
+ (
291
+ (isset($message_obj['author']) && intval($message_obj['author']) == 0) ||
292
+ (isset($message_obj['post_author']) && intval($message_obj['post_author']) == 0)
293
+ )
294
+ )
295
+ )
296
+ {
297
+ return false;
298
+ }
299
+
300
  //General post_info for all ajax calls
301
  $post_info = array('comment_type' => 'feedback_ajax');
 
 
 
 
 
 
302
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE, true);
303
+
 
 
 
 
 
304
  if(isset($_POST['user_login']))
305
  $sender_nickname = $_POST['user_login'];
306
  else
inc/cleantalk-common.php CHANGED
@@ -257,6 +257,9 @@ function apbct_get_sender_info() {
257
  // Debug stuff
258
  'amp_detected' => $amp_detected,
259
  'hook' => current_action(),
 
 
 
260
  'request_type' => isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'UNKNOWN',
261
  );
262
  }
257
  // Debug stuff
258
  'amp_detected' => $amp_detected,
259
  'hook' => current_action(),
260
+ 'headers_sent' => !empty($apbct->headers_sent) ? $apbct->headers_sent : false,
261
+ 'headers_sent__hook' => !empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : false,
262
+ 'headers_sent__hook' => !empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
263
  'request_type' => isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'UNKNOWN',
264
  );
265
  }
inc/cleantalk-public.php CHANGED
@@ -2849,7 +2849,8 @@ function ct_contact_form_validate_postdata() {
2849
  (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
2850
  (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
2851
  (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
2852
- strpos($_SERVER['REQUEST_URI'],'/wp-json/wpstatistics/v1/hit')!==false //WPStatistics
 
2853
  ) {
2854
  return null;
2855
  }
@@ -2981,7 +2982,7 @@ function ct_enqueue_scripts_public($hook){
2981
  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']){
2982
 
2983
  // Differnt JS params
2984
- wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.js', array('jquery'), APBCT_VERSION, false /*in header*/);
2985
 
2986
  wp_localize_script('ct_public', 'ctPublic', array(
2987
  '_ajax_nonce' => wp_create_nonce('ct_secret_stuff'),
@@ -2991,7 +2992,7 @@ function ct_enqueue_scripts_public($hook){
2991
  // GDPR script
2992
  if($apbct->settings['gdpr_enabled']){
2993
 
2994
- wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
2995
 
2996
  wp_localize_script('ct_public_gdpr', 'ctPublicGDPR', array(
2997
  'gdpr_forms' => array(),
@@ -3008,7 +3009,7 @@ function ct_enqueue_scripts_public($hook){
3008
  // Use AJAX for JavaScript check
3009
  if($apbct->settings['use_ajax']){
3010
 
3011
- wp_enqueue_script('ct_nocache', plugins_url('/cleantalk-spam-protect/inc/cleantalk_nocache.js'), array(), APBCT_VERSION, false /*in header*/);
3012
 
3013
  wp_localize_script('ct_nocache', 'ctNocache', array(
3014
  'ajaxurl' => admin_url('admin-ajax.php'),
@@ -3020,11 +3021,11 @@ function ct_enqueue_scripts_public($hook){
3020
 
3021
  // External forms check
3022
  if($apbct->settings['check_external'])
3023
- wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/js/cleantalk_external.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3024
 
3025
  // Internal forms check
3026
  if($apbct->settings['check_internal'])
3027
- wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/js/cleantalk_internal.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3028
 
3029
  }
3030
  }
@@ -3037,8 +3038,8 @@ function ct_enqueue_scripts_public($hook){
3037
 
3038
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
3039
 
3040
- wp_enqueue_style ('ct_public_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-public-admin.css'), array(), APBCT_VERSION, 'all');
3041
- wp_enqueue_script('ct_public_admin_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-public-admin.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3042
 
3043
  wp_localize_script('ct_public_admin_js', 'ctPublicAdmin', array(
3044
  'ct_ajax_nonce' => $ajax_nonce,
@@ -3053,7 +3054,7 @@ function ct_enqueue_scripts_public($hook){
3053
 
3054
  // Debug
3055
  if($apbct->settings['debug_ajax']){
3056
- wp_enqueue_script('ct_debug_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-debug-ajax.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3057
 
3058
  wp_localize_script('ct_debug_js', 'apbctDebug', array(
3059
  'reload' => false,
2849
  (isset($_POST['woocommerce-login-nonce'], $_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])) || //WooCommerce login form
2850
  (isset($_POST['provider'], $_POST['authcode']) && $_POST['provider'] == 'Two_Factor_Totp') || //TwoFactor authorization
2851
  (isset($_GET['wc-ajax']) && $_GET['wc-ajax'] == 'sa_wc_buy_now_get_ajax_buy_now_button') || //BuyNow add to cart
2852
+ strpos($_SERVER['REQUEST_URI'],'/wp-json/wpstatistics/v1/hit')!==false || //WPStatistics
2853
+ (isset($_POST['ihcaction']) && $_POST['ihcaction'] == 'login') //Skip login form
2854
  ) {
2855
  return null;
2856
  }
2982
  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']){
2983
 
2984
  // Differnt JS params
2985
+ wp_enqueue_script('ct_public', APBCT_URL_PATH.'/js/apbct-public.min.js', array('jquery'), APBCT_VERSION, false /*in header*/);
2986
 
2987
  wp_localize_script('ct_public', 'ctPublic', array(
2988
  '_ajax_nonce' => wp_create_nonce('ct_secret_stuff'),
2992
  // GDPR script
2993
  if($apbct->settings['gdpr_enabled']){
2994
 
2995
+ wp_enqueue_script('ct_public_gdpr', APBCT_URL_PATH.'/js/apbct-public--gdpr.min.js', array('jquery', 'ct_public'), APBCT_VERSION, false /*in header*/);
2996
 
2997
  wp_localize_script('ct_public_gdpr', 'ctPublicGDPR', array(
2998
  'gdpr_forms' => array(),
3009
  // Use AJAX for JavaScript check
3010
  if($apbct->settings['use_ajax']){
3011
 
3012
+ wp_enqueue_script('ct_nocache', plugins_url('/cleantalk-spam-protect/inc/cleantalk_nocache.min.js'), array(), APBCT_VERSION, false /*in header*/);
3013
 
3014
  wp_localize_script('ct_nocache', 'ctNocache', array(
3015
  'ajaxurl' => admin_url('admin-ajax.php'),
3021
 
3022
  // External forms check
3023
  if($apbct->settings['check_external'])
3024
+ wp_enqueue_script('ct_external', plugins_url('/cleantalk-spam-protect/js/cleantalk_external.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3025
 
3026
  // Internal forms check
3027
  if($apbct->settings['check_internal'])
3028
+ wp_enqueue_script('ct_internal', plugins_url('/cleantalk-spam-protect/js/cleantalk_internal.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3029
 
3030
  }
3031
  }
3038
 
3039
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
3040
 
3041
+ wp_enqueue_style ('ct_public_admin_css', plugins_url('/cleantalk-spam-protect/css/cleantalk-public-admin.min.css'), array(), APBCT_VERSION, 'all');
3042
+ 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*/);
3043
 
3044
  wp_localize_script('ct_public_admin_js', 'ctPublicAdmin', array(
3045
  'ct_ajax_nonce' => $ajax_nonce,
3054
 
3055
  // Debug
3056
  if($apbct->settings['debug_ajax']){
3057
+ wp_enqueue_script('ct_debug_js', plugins_url('/cleantalk-spam-protect/js/cleantalk-debug-ajax.min.js'), array('jquery'), APBCT_VERSION, false /*in header*/);
3058
 
3059
  wp_localize_script('ct_debug_js', 'apbctDebug', array(
3060
  'reload' => false,
inc/cleantalk-settings.php CHANGED
@@ -767,7 +767,7 @@ function apbct_settings__field__statistics() {
767
  printf(
768
  __('Last spam check request to %s server was at %s.', 'cleantalk'),
769
  $apbct->stats['last_request']['server'] ? $apbct->stats['last_request']['server'] : __('unknown', 'cleantalk'),
770
- $apbct->stats['last_request']['time'] ? date('Y-m-d H:i:s', $apbct->stats['last_request']['time']) : __('unknown', 'cleantalk')
771
  );
772
  echo '<br>';
773
 
@@ -784,7 +784,7 @@ function apbct_settings__field__statistics() {
784
  printf(
785
  __('Last SpamFireWall blocking page was showed to %s IP at %s.', 'cleantalk'),
786
  $apbct->stats['last_sfw_block']['ip'] ? $apbct->stats['last_sfw_block']['ip'] : __('unknown', 'cleantalk'),
787
- $apbct->stats['last_sfw_block']['time'] ? date('Y-m-d H:i:s', $apbct->stats['last_sfw_block']['time']) : __('unknown', 'cleantalk')
788
  );
789
  echo '<br>';
790
 
@@ -792,7 +792,7 @@ function apbct_settings__field__statistics() {
792
  $sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->base_prefix."cleantalk_sfw`", ARRAY_A);
793
  printf(
794
  __('SpamFireWall was updated %s. Now contains %s entries.', 'cleantalk'),
795
- $apbct->stats['sfw']['last_update_time'] ? date('Y-m-d H:i:s', $apbct->stats['sfw']['last_update_time']) : __('unknown', 'cleantalk'),
796
  isset($sfw_netwoks_amount[0]['cnt']) ? $sfw_netwoks_amount[0]['cnt'] : __('unknown', 'cleantalk')
797
  );
798
  echo '<br>';
@@ -801,7 +801,7 @@ function apbct_settings__field__statistics() {
801
  printf(
802
  __('SpamFireWall sent %s events at %s.', 'cleantalk'),
803
  $apbct->stats['sfw']['last_send_amount'] ? $apbct->stats['sfw']['last_send_amount'] : __('unknown', 'cleantalk'),
804
- $apbct->stats['sfw']['last_send_time'] ? date('Y-m-d H:i:s', $apbct->stats['sfw']['last_send_time']) : __('unknown', 'cleantalk')
805
  );
806
  echo '<br>';
807
 
767
  printf(
768
  __('Last spam check request to %s server was at %s.', 'cleantalk'),
769
  $apbct->stats['last_request']['server'] ? $apbct->stats['last_request']['server'] : __('unknown', 'cleantalk'),
770
+ $apbct->stats['last_request']['time'] ? date('M d Y H:i:s', $apbct->stats['last_request']['time']) : __('unknown', 'cleantalk')
771
  );
772
  echo '<br>';
773
 
784
  printf(
785
  __('Last SpamFireWall blocking page was showed to %s IP at %s.', 'cleantalk'),
786
  $apbct->stats['last_sfw_block']['ip'] ? $apbct->stats['last_sfw_block']['ip'] : __('unknown', 'cleantalk'),
787
+ $apbct->stats['last_sfw_block']['time'] ? date('M d Y H:i:s', $apbct->stats['last_sfw_block']['time']) : __('unknown', 'cleantalk')
788
  );
789
  echo '<br>';
790
 
792
  $sfw_netwoks_amount = $wpdb->get_results("SELECT count(*) AS cnt FROM `".$wpdb->base_prefix."cleantalk_sfw`", ARRAY_A);
793
  printf(
794
  __('SpamFireWall was updated %s. Now contains %s entries.', 'cleantalk'),
795
+ $apbct->stats['sfw']['last_update_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_update_time']) : __('unknown', 'cleantalk'),
796
  isset($sfw_netwoks_amount[0]['cnt']) ? $sfw_netwoks_amount[0]['cnt'] : __('unknown', 'cleantalk')
797
  );
798
  echo '<br>';
801
  printf(
802
  __('SpamFireWall sent %s events at %s.', 'cleantalk'),
803
  $apbct->stats['sfw']['last_send_amount'] ? $apbct->stats['sfw']['last_send_amount'] : __('unknown', 'cleantalk'),
804
+ $apbct->stats['sfw']['last_send_time'] ? date('M d Y H:i:s', $apbct->stats['sfw']['last_send_time']) : __('unknown', 'cleantalk')
805
  );
806
  echo '<br>';
807
 
inc/sfw_die_page.html CHANGED
@@ -41,8 +41,8 @@
41
  <div class='container'>
42
  <h1 class='main'>{SFW_DIE_NOTICE_IP}<a href='https://cleantalk.org/blacklists/{REMOTE_ADDRESS}' target='_blank'>{REMOTE_ADDRESS}</a></h1>
43
 
44
- <h3>Real IP: {REAL_IP} {REAL_IP_BLOCKED}</h3>
45
- <h3>Test IP: {TEST_IP} {TEST_IP_BLOCKED}</h3>
46
 
47
  <h2>{TEST_TITLE}</h2>
48
 
41
  <div class='container'>
42
  <h1 class='main'>{SFW_DIE_NOTICE_IP}<a href='https://cleantalk.org/blacklists/{REMOTE_ADDRESS}' target='_blank'>{REMOTE_ADDRESS}</a></h1>
43
 
44
+ <h3>{REAL_IP__HEADER} {REAL_IP} {REAL_IP_BLOCKED}</h3>
45
+ <h3>{TEST_IP__HEADER} {TEST_IP} {TEST_IP_BLOCKED}</h3>
46
 
47
  <h2>{TEST_TITLE}</h2>
48
 
js/apbct-fingerprint.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ console.log("some1"),function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define(n):t.Fingerprint=n()}(0,this,function(){"use strict";function e(e){var a,t;a=Array.prototype.forEach,t=Array.prototype.map,this.each=function(e,t,n){if(null!==e)if(a&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)==={})return}else for(var o in e)if(e.hasOwnProperty(o)&&t.call(n,e[o],o,e)==={})return},this.map=function(e,r,i){var o=[];return null==e?o:t&&e.map===t?e.map(r,i):(this.each(e,function(e,t,n){o[o.length]=r.call(i,e,t,n)}),o)},"object"==typeof e?(this.hasher=e.hasher,this.screen_resolution=e.screen_resolution,this.screen_orientation=e.screen_orientation,this.canvas=e.canvas,this.ie_activex=e.ie_activex):"function"==typeof e&&(this.hasher=e)}return e.prototype={get:function(){var e=[];if(e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),this.screen_resolution){var t=this.getScreenResolution();void 0!==t&&e.push(t.join("x"))}return e.push((new Date).getTimezoneOffset()),e.push(this.hasSessionStorage()),e.push(this.hasLocalStorage()),e.push(this.hasIndexDb()),document.body?e.push(typeof document.body.addBehavior):e.push("undefined"),e.push(typeof window.openDatabase),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack),e.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(e,t){var n,r,i,o,a,s,h,c;for(n=3&e.length,r=e.length-n,i=t,a=3432918353,s=461845907,c=0;c<r;)h=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=h=(65535&(h=(h=(65535&h)*a+(((h>>>16)*a&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(h=0,n){case 3:h^=(255&e.charCodeAt(c+2))<<16;case 2:h^=(255&e.charCodeAt(c+1))<<8;case 1:i^=h=(65535&(h=(h=(65535&(h^=255&e.charCodeAt(c)))*a+(((h>>>16)*a&65535)<<16)&4294967295)<<15|h>>>17))*s+(((h>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(e){return!0}},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(e){var t=this.map(e,function(e){return[e.type,e.suffixes].join("~")}).join(",");return[e.name,e.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(e){try{return new ActiveXObject(e),e}catch(e){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n="http://valve.github.io";return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17),e.toDataURL()}},e});
2
+ //# sourceMappingURL=apbct-fingerprint.min.js.map
js/apbct-fingerprint.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["apbct-fingerprint.js"],"names":["console","log","name","context","definition","module","exports","define","amd","this","Fingerprint","options","nativeForEach","nativeMap","Array","prototype","forEach","map","each","obj","iterator","length","i","l","call","key","hasOwnProperty","results","value","index","list","hasher","screen_resolution","screen_orientation","canvas","ie_activex","get","keys","push","navigator","userAgent","language","screen","colorDepth","resolution","getScreenResolution","join","Date","getTimezoneOffset","hasSessionStorage","hasLocalStorage","hasIndexDb","document","body","window","cpuClass","platform","doNotTrack","getPluginsString","isCanvasSupported","getCanvasFingerprint","murmurhash3_32_gc","seed","remainder","bytes","h1","h1b","c1","c2","k1","charCodeAt","localStorage","e","sessionStorage","indexedDB","elem","createElement","getContext","isIE","appName","test","getIEPluginsString","getRegularPluginsString","plugins","p","mimeTypes","mt","type","suffixes","description","ActiveXObject","height","width","ctx","txt","textBaseline","font","fillStyle","fillRect","fillText","toDataURL"],"mappings":"AAiBAA,QAAQC,IAAI,SACX,SAAWC,EAAMC,EAASC,GACH,oBAAXC,QAA0BA,OAAOC,QAAWD,OAAOC,QAAUF,IAC7C,mBAAXG,QAAyBA,OAAOC,IAAOD,OAAOH,GACvDD,EAAY,YAAIC,IAHxB,CAIE,EAAeK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G,SAASE,GACnC,MAAO,CAACA,EAAGC,KAAMD,EAAGE,UAAU1C,KAAK,OAClCA,KAAK,KACR,MAAO,CAACsC,EAAElF,KAAMkF,EAAEK,YAAaJ,GAAWvC,KAAK,OAC9CrC,MAAMqC,KAAK,MAGhBmC,mBAAoB,WAClB,GAAG3B,OAAOoC,cAAc,CAiBtB,OAAOjF,KAAKQ,IAhBA,CAAC,gCACX,cACA,cACA,sBAEA,8BACA,gCACA,qDACA,mDACA,aACA,cACA,eACA,sBACA,mBAGqB,SAASf,GAC9B,IAEE,OADA,IAAIwF,cAAcxF,GACXA,EACP,MAAMsE,GACN,OAAO,QAER1B,KAAK,KAER,MAAO,IAIXD,oBAAqB,WAOlB,OALGpC,KAAKwB,mBACQS,OAAOiD,OAASjD,OAAOkD,MAAS,CAAClD,OAAOiD,OAAQjD,OAAOkD,OAAS,CAAClD,OAAOkD,MAAOlD,OAAOiD,QAEvF,CAACjD,OAAOiD,OAAQjD,OAAOkD,QAKzChC,qBAAsB,WACpB,IAAI1B,EAASkB,SAASwB,cAAc,UAChCiB,EAAM3D,EAAO2C,WAAW,MAExBiB,EAAM,yBAUV,OATAD,EAAIE,aAAe,MACnBF,EAAIG,KAAO,eACXH,EAAIE,aAAe,aACnBF,EAAII,UAAY,OAChBJ,EAAIK,SAAS,IAAI,EAAE,GAAG,IACtBL,EAAII,UAAY,OAChBJ,EAAIM,SAASL,EAAK,EAAG,IACrBD,EAAII,UAAY,yBAChBJ,EAAIM,SAASL,EAAK,EAAG,IACd5D,EAAOkE,cAKX1F","file":"apbct-fingerprint.min.js","sourcesContent":["/*\n* fingerprintJS 0.5.5 - Fast browser fingerprint library\n* https://github.com/Valve/fingerprintjs\n* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)\n* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nconsole.log('some1');\n;(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }\n else if (typeof define === 'function' && define.amd) { define(definition); }\n else { context[name] = definition(); }\n})('Fingerprint', this, function () {\n 'use strict';\n\n var Fingerprint = function (options) {\n var nativeForEach, nativeMap;\n nativeForEach = Array.prototype.forEach;\n nativeMap = Array.prototype.map;\n\n this.each = function (obj, iterator, context) {\n if (obj === null) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === {}) return;\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (iterator.call(context, obj[key], key, obj) === {}) return;\n }\n }\n }\n };\n\n this.map = function(obj, iterator, context) {\n var results = [];\n // Not using strict equality so that this acts as a\n // shortcut to checking for `null` and `undefined`.\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n this.each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n if (typeof options == 'object'){\n this.hasher = options.hasher;\n this.screen_resolution = options.screen_resolution;\n this.screen_orientation = options.screen_orientation;\n this.canvas = options.canvas;\n this.ie_activex = options.ie_activex;\n } else if(typeof options == 'function'){\n this.hasher = options;\n }\n };\n\n Fingerprint.prototype = {\n get: function(){\n var keys = [];\n keys.push(navigator.userAgent);\n keys.push(navigator.language);\n keys.push(screen.colorDepth);\n if (this.screen_resolution) {\n var resolution = this.getScreenResolution();\n if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs\n keys.push(resolution.join('x'));\n }\n }\n keys.push(new Date().getTimezoneOffset());\n keys.push(this.hasSessionStorage());\n keys.push(this.hasLocalStorage());\n keys.push(this.hasIndexDb());\n //body might not be defined at this point or removed programmatically\n if(document.body){\n keys.push(typeof(document.body.addBehavior));\n } else {\n keys.push(typeof undefined);\n }\n keys.push(typeof(window.openDatabase));\n keys.push(navigator.cpuClass);\n keys.push(navigator.platform);\n keys.push(navigator.doNotTrack);\n keys.push(this.getPluginsString());\n if(this.canvas && this.isCanvasSupported()){\n keys.push(this.getCanvasFingerprint());\n }\n if(this.hasher){\n return this.hasher(keys.join('###'), 31);\n } else {\n return this.murmurhash3_32_gc(keys.join('###'), 31);\n }\n },\n\n /**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\n murmurhash3_32_gc: function(key, seed) {\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\n\n remainder = key.length & 3; // key.length % 4\n bytes = key.length - remainder;\n h1 = seed;\n c1 = 0xcc9e2d51;\n c2 = 0x1b873593;\n i = 0;\n\n while (i < bytes) {\n k1 =\n ((key.charCodeAt(i) & 0xff)) |\n ((key.charCodeAt(++i) & 0xff) << 8) |\n ((key.charCodeAt(++i) & 0xff) << 16) |\n ((key.charCodeAt(++i) & 0xff) << 24);\n ++i;\n\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n\n h1 ^= h1 >>> 16;\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n },\n\n // https://bugzilla.mozilla.org/show_bug.cgi?id=781447\n hasLocalStorage: function () {\n try{\n return !!window.localStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasSessionStorage: function () {\n try{\n return !!window.sessionStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasIndexDb: function () {\n try{\n return !!window.indexedDB;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n isCanvasSupported: function () {\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n },\n\n isIE: function () {\n if(navigator.appName === 'Microsoft Internet Explorer') {\n return true;\n } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11\n return true;\n }\n return false;\n },\n\n getPluginsString: function () {\n if(this.isIE() && this.ie_activex){\n return this.getIEPluginsString();\n } else {\n return this.getRegularPluginsString();\n }\n },\n\n getRegularPluginsString: function () {\n return this.map(navigator.plugins, function (p) {\n var mimeTypes = this.map(p, function(mt){\n return [mt.type, mt.suffixes].join('~');\n }).join(',');\n return [p.name, p.description, mimeTypes].join('::');\n }, this).join(';');\n },\n\n getIEPluginsString: function () {\n if(window.ActiveXObject){\n var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin\n 'AcroPDF.PDF', // Adobe PDF reader 7+\n 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr\n 'QuickTime.QuickTime', // QuickTime\n // 5 versions of real players\n 'rmocx.RealPlayer G2 Control',\n 'rmocx.RealPlayer G2 Control.1',\n 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',\n 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',\n 'RealPlayer',\n 'SWCtl.SWCtl', // ShockWave player\n 'WMPlayer.OCX', // Windows media player\n 'AgControl.AgControl', // Silverlight\n 'Skype.Detection'];\n\n // starting to detect plugins in IE\n return this.map(names, function(name){\n try{\n new ActiveXObject(name);\n return name;\n } catch(e){\n return null;\n }\n }).join(';');\n } else {\n return \"\"; // behavior prior version 0.5.0, not breaking backwards compat.\n }\n },\n\n getScreenResolution: function () {\n var resolution;\n if(this.screen_orientation){\n resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];\n }else{\n resolution = [screen.height, screen.width];\n }\n return resolution;\n },\n\n getCanvasFingerprint: function () {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n // https://www.browserleaks.com/canvas#how-does-it-work\n var txt = 'http://valve.github.io';\n ctx.textBaseline = \"top\";\n ctx.font = \"14px 'Arial'\";\n ctx.textBaseline = \"alphabetic\";\n ctx.fillStyle = \"#f60\";\n ctx.fillRect(125,1,62,20);\n ctx.fillStyle = \"#069\";\n ctx.fillText(txt, 2, 15);\n ctx.fillStyle = \"rgba(102, 204, 0, 0.7)\";\n ctx.fillText(txt, 4, 17);\n return canvas.toDataURL();\n }\n };\n\n\n return Fingerprint;\n\n});"]}
js/apbct-md5.min.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ CryptoJS v3.1.2
3
+ code.google.com/p/crypto-js
4
+ (c) 2009-2013 by Jeff Mott. All rights reserved.
5
+ code.google.com/p/crypto-js/wiki/License
6
+ */
7
+ var CryptoJS=CryptoJS||function(s,p){var m={},l=m.lib={},n=function(){},r=l.Base={extend:function(b){n.prototype=this;var h=new n;b&&h.mixIn(b);h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)});h.init.prototype=h;h.$super=this;return h},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var h in b)b.hasOwnProperty(h)&&(this[h]=b[h]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}},
8
+ q=l.WordArray=r.extend({init:function(b,h){b=this.words=b||[];this.sigBytes=h!=p?h:4*b.length},toString:function(b){return(b||t).stringify(this)},concat:function(b){var h=this.words,a=b.words,j=this.sigBytes;b=b.sigBytes;this.clamp();if(j%4)for(var g=0;g<b;g++)h[j+g>>>2]|=(a[g>>>2]>>>24-8*(g%4)&255)<<24-8*((j+g)%4);else if(65535<a.length)for(g=0;g<b;g+=4)h[j+g>>>2]=a[g>>>2];else h.push.apply(h,a);this.sigBytes+=b;return this},clamp:function(){var b=this.words,h=this.sigBytes;b[h>>>2]&=4294967295<<
9
+ 32-8*(h%4);b.length=s.ceil(h/4)},clone:function(){var b=r.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var h=[],a=0;a<b;a+=4)h.push(4294967296*s.random()|0);return new q.init(h,b)}}),v=m.enc={},t=v.Hex={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++){var k=a[j>>>2]>>>24-8*(j%4)&255;g.push((k>>>4).toString(16));g.push((k&15).toString(16))}return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j+=2)g[j>>>3]|=parseInt(b.substr(j,
10
+ 2),16)<<24-4*(j%8);return new q.init(g,a/2)}},a=v.Latin1={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++)g.push(String.fromCharCode(a[j>>>2]>>>24-8*(j%4)&255));return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j++)g[j>>>2]|=(b.charCodeAt(j)&255)<<24-8*(j%4);return new q.init(g,a)}},u=v.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(g){throw Error("Malformed UTF-8 data");}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},
11
+ g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=u.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,g=a.words,j=a.sigBytes,k=this.blockSize,m=j/(4*k),m=b?s.ceil(m):s.max((m|0)-this._minBufferSize,0);b=m*k;j=s.min(4*b,j);if(b){for(var l=0;l<b;l+=k)this._doProcessBlock(g,l);l=g.splice(0,b);a.sigBytes-=j}return new q.init(l,j)},clone:function(){var b=r.clone.call(this);
12
+ b._data=this._data.clone();return b},_minBufferSize:0});l.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b);this.reset()},reset:function(){g.reset.call(this);this._doReset()},update:function(b){this._append(b);this._process();return this},finalize:function(b){b&&this._append(b);return this._doFinalize()},blockSize:16,_createHelper:function(b){return function(a,g){return(new b.init(g)).finalize(a)}},_createHmacHelper:function(b){return function(a,g){return(new k.HMAC.init(b,
13
+ g)).finalize(a)}}});var k=m.algo={};return m}(Math);
14
+ (function(s){function p(a,k,b,h,l,j,m){a=a+(k&b|~k&h)+l+m;return(a<<j|a>>>32-j)+k}function m(a,k,b,h,l,j,m){a=a+(k&h|b&~h)+l+m;return(a<<j|a>>>32-j)+k}function l(a,k,b,h,l,j,m){a=a+(k^b^h)+l+m;return(a<<j|a>>>32-j)+k}function n(a,k,b,h,l,j,m){a=a+(b^(k|~h))+l+m;return(a<<j|a>>>32-j)+k}for(var r=CryptoJS,q=r.lib,v=q.WordArray,t=q.Hasher,q=r.algo,a=[],u=0;64>u;u++)a[u]=4294967296*s.abs(s.sin(u+1))|0;q=q.MD5=t.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])},
15
+ _doProcessBlock:function(g,k){for(var b=0;16>b;b++){var h=k+b,w=g[h];g[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var b=this._hash.words,h=g[k+0],w=g[k+1],j=g[k+2],q=g[k+3],r=g[k+4],s=g[k+5],t=g[k+6],u=g[k+7],v=g[k+8],x=g[k+9],y=g[k+10],z=g[k+11],A=g[k+12],B=g[k+13],C=g[k+14],D=g[k+15],c=b[0],d=b[1],e=b[2],f=b[3],c=p(c,d,e,f,h,7,a[0]),f=p(f,c,d,e,w,12,a[1]),e=p(e,f,c,d,j,17,a[2]),d=p(d,e,f,c,q,22,a[3]),c=p(c,d,e,f,r,7,a[4]),f=p(f,c,d,e,s,12,a[5]),e=p(e,f,c,d,t,17,a[6]),d=p(d,e,f,c,u,22,a[7]),
16
+ c=p(c,d,e,f,v,7,a[8]),f=p(f,c,d,e,x,12,a[9]),e=p(e,f,c,d,y,17,a[10]),d=p(d,e,f,c,z,22,a[11]),c=p(c,d,e,f,A,7,a[12]),f=p(f,c,d,e,B,12,a[13]),e=p(e,f,c,d,C,17,a[14]),d=p(d,e,f,c,D,22,a[15]),c=m(c,d,e,f,w,5,a[16]),f=m(f,c,d,e,t,9,a[17]),e=m(e,f,c,d,z,14,a[18]),d=m(d,e,f,c,h,20,a[19]),c=m(c,d,e,f,s,5,a[20]),f=m(f,c,d,e,y,9,a[21]),e=m(e,f,c,d,D,14,a[22]),d=m(d,e,f,c,r,20,a[23]),c=m(c,d,e,f,x,5,a[24]),f=m(f,c,d,e,C,9,a[25]),e=m(e,f,c,d,q,14,a[26]),d=m(d,e,f,c,v,20,a[27]),c=m(c,d,e,f,B,5,a[28]),f=m(f,c,
17
+ d,e,j,9,a[29]),e=m(e,f,c,d,u,14,a[30]),d=m(d,e,f,c,A,20,a[31]),c=l(c,d,e,f,s,4,a[32]),f=l(f,c,d,e,v,11,a[33]),e=l(e,f,c,d,z,16,a[34]),d=l(d,e,f,c,C,23,a[35]),c=l(c,d,e,f,w,4,a[36]),f=l(f,c,d,e,r,11,a[37]),e=l(e,f,c,d,u,16,a[38]),d=l(d,e,f,c,y,23,a[39]),c=l(c,d,e,f,B,4,a[40]),f=l(f,c,d,e,h,11,a[41]),e=l(e,f,c,d,q,16,a[42]),d=l(d,e,f,c,t,23,a[43]),c=l(c,d,e,f,x,4,a[44]),f=l(f,c,d,e,A,11,a[45]),e=l(e,f,c,d,D,16,a[46]),d=l(d,e,f,c,j,23,a[47]),c=n(c,d,e,f,h,6,a[48]),f=n(f,c,d,e,u,10,a[49]),e=n(e,f,c,d,
18
+ C,15,a[50]),d=n(d,e,f,c,s,21,a[51]),c=n(c,d,e,f,A,6,a[52]),f=n(f,c,d,e,q,10,a[53]),e=n(e,f,c,d,y,15,a[54]),d=n(d,e,f,c,w,21,a[55]),c=n(c,d,e,f,v,6,a[56]),f=n(f,c,d,e,D,10,a[57]),e=n(e,f,c,d,t,15,a[58]),d=n(d,e,f,c,B,21,a[59]),c=n(c,d,e,f,r,6,a[60]),f=n(f,c,d,e,z,10,a[61]),e=n(e,f,c,d,j,15,a[62]),d=n(d,e,f,c,x,21,a[63]);b[0]=b[0]+c|0;b[1]=b[1]+d|0;b[2]=b[2]+e|0;b[3]=b[3]+f|0},_doFinalize:function(){var a=this._data,k=a.words,b=8*this._nDataBytes,h=8*a.sigBytes;k[h>>>5]|=128<<24-h%32;var l=s.floor(b/
19
+ 4294967296);k[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360;k[(h+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(k.length+1);this._process();a=this._hash;k=a.words;for(b=0;4>b;b++)h=k[b],k[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return a},clone:function(){var a=t.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=t._createHelper(q);r.HmacMD5=t._createHmacHelper(q)})(Math);
20
+ // Creates string form CryptoJS.MD5
21
+ function apbct_md5(to_hash){
22
+ var hash = CryptoJS.MD5(to_hash);
23
+ return hash.toString();
24
+ }
js/apbct-public--alt.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ var apbct_fingerprint=new Fingerprint({canvas:!0,ie_activex:!0,hasher:apbct_md5}).get();function apbct_cookie__get(n,i){var s={};return"string"==typeof(n=n||null)&&(n=n.split()),"none"==(i=i||["apbct_","ct_"])&&(i=null),"string"==typeof i&&(i=i.split()),document.cookie.split(";").forEach(function(o,e,c){var t=o.trim().split("=");n&&n.forEach(function(o,e,c){t[0]===o&&(s[t[0]]=t[1])}),i&&i.forEach(function(o,e,c){0===t[0].indexOf(o)&&(s[t[0]]=t[1])})}),s}function apbct_cookie__delete(n,i){var s=new Date(0);"string"==typeof(n=n||null)&&(n=n.split()),"none"==(i=i||["apbct_","ct_"])&&(i=null),"string"==typeof i&&(i=i.split()),document.cookie.split(";").forEach(function(o,e,c){var t=o.trim().split("=");n&&n.forEach(function(o,e,c){t[0]===o&&(document.cookie=t[0]+"=; path=/; expires="+s.toUTCString())}),i&&i.forEach(function(o,e,c){0===t[0].indexOf(o)&&(document.cookie=t[0]+"=; path=/; expires="+s.toUTCString())})})}jQuery(document).ready(function(){jQuery.ajax({type:"POST",url:apbctPublicAlt.ajax_url,data:{apbct_action:"get_sessions",apbct_secret:apbctPublicAlt.nonce,session_id:apbct_fingerprint},async:!0,success:function(o){if(console.log("success"),(o=JSON.parse(o)).result)for(cookie in console.log(o),o.cookies)console.log(cookie),document.cookie=cookie+"="+o.cookies[cookie]+"; path=/;";else console.log(o),console.log("APBCT SESSIONS GET ERROR")},error:function(o){console.log("err"),console.log(o)}}),window.onunload=function(){cookies=apbct_cookie__get(),console.log("leave"),jQuery.ajax({type:"POST",url:apbctPublicAlt.ajax_url,data:{apbct_action:"set_sessions",apbct_secret:apbctPublicAlt.nonce,session_id:apbct_fingerprint,data:cookies},async:!1,success:function(o){(o=JSON.parse(o)).result?(console.log("success"),console.log(o),apbct_cookie__delete(),console.log("cookie DELETED")):(console.log("APBCT SESSIONS GET ERROR"),console.log(o))},error:function(o){console.log("err"),console.log(o)}})}});
2
+ //# sourceMappingURL=apbct-public--alt.min.js.map
js/apbct-public--alt.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["apbct-public--alt.js"],"names":["apbct_fingerprint","Fingerprint","canvas","ie_activex","hasher","apbct_md5","get","apbct_cookie__get","names","prefixes","cookie","split","document","forEach","item","i","arr","curr","trim","name","all","prefix","indexOf","apbct_cookie__delete","date","Date","toUTCString","jQuery","ready","ajax","type","url","apbctPublicAlt","ajax_url","data","apbct_action","apbct_secret","nonce","session_id","async","success","msg","console","log","JSON","parse","result","cookies","error","err","window","onunload"],"mappings":"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C,eAAeC,SACpBC,KAAM,CACLC,aAAc,eACdC,aAAcJ,eAAeK,MAC7BC,WAAYtC,mBAEbuC,OAAO,EACPC,QAAS,SAASC,GAIjB,GAHAC,QAAQC,IAAI,YACZF,EAAMG,KAAKC,MAAMJ,IAEVK,OAEN,IAAIpC,UADJgC,QAAQC,IAAIF,GACEA,EAAIM,QACjBL,QAAQC,IAAIjC,QAEZE,SAASF,OAASA,OAAS,IAAM+B,EAAIM,QAAQrC,QAAU,iBAGxDgC,QAAQC,IAAIF,GACZC,QAAQC,IAAI,6BAGdK,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM,MAIfC,OAAOC,SAAW,WAGhBJ,QAAUxC,oBAEXmC,QAAQC,IAAI,SAEXhB,OAAOE,KAAK,CACZC,KAAM,OACNC,IAAKC,eAAeC,SACpBC,KAAM,CACLC,aAAc,eACdC,aAAcJ,eAAeK,MAC7BC,WAAYtC,kBACZkC,KAAMa,SAEPR,OAAO,EACPC,QAAS,SAASC,IACjBA,EAAMG,KAAKC,MAAMJ,IACVK,QACNJ,QAAQC,IAAI,WACZD,QAAQC,IAAIF,GAEZlB,uBACAmB,QAAQC,IAAI,oBAEZD,QAAQC,IAAI,4BACZD,QAAQC,IAAIF,KAGdO,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM","file":"apbct-public--alt.min.js","sourcesContent":["// Fingerprint\nvar apbct_fingerprint = new Fingerprint({canvas: true, ie_activex: true, hasher: apbct_md5}).get();\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\n/* Function: Deletes cookie with prefix */\nfunction apbct_cookie__delete(names, prefixes){\n\tvar date = new Date(0);\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\t\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\n\t\t\t});\n\t\t}\n\t});\n}\n\njQuery(document).ready(function(){\n\t\n\t jQuery.ajax({\n\t\t type: \"POST\",\n\t\t url: apbctPublicAlt.ajax_url,\n\t\t data: {\n\t\t\t apbct_action: 'get_sessions',\n\t\t\t apbct_secret: apbctPublicAlt.nonce,\n\t\t\t session_id: apbct_fingerprint,\n\t\t },\n\t\t async: true,\n\t\t success: function(msg){\n\t\t\t console.log('success');\n\t\t\t msg = JSON.parse(msg);\n\t\t\t\n\t\t\t if(msg.result){\n\t\t\t\t console.log(msg);\n\t\t\t\t for(cookie in msg.cookies){\n\t\t\t\t\t console.log(cookie);\n//\t\t\t\t\t console.log(msg.cookies[cookie]);\n\t\t\t\t\t document.cookie = cookie + \"=\" + msg.cookies[cookie] + \"; path=/;\";\n\t\t\t\t };\n\t\t\t }else{\n\t\t\t\t console.log(msg);\n\t\t\t\t console.log('APBCT SESSIONS GET ERROR');\n\t\t\t }\n\t\t },\n\t\t error: function(err){\n\t\t\t console.log('err');\n\t\t\t console.log(err);\n\t\t }\n\t });\n\t\n\twindow.onunload = function(){\n\t\t\n\t\t// Getting ct_ and apbct_ cookies\n\t\t cookies = apbct_cookie__get();\n\t\t\n\t\tconsole.log('leave');\n\t\t\n\t\t jQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: apbctPublicAlt.ajax_url,\n\t\t\tdata: {\n\t\t\t\tapbct_action: 'set_sessions',\n\t\t\t\tapbct_secret: apbctPublicAlt.nonce,\n\t\t\t\tsession_id: apbct_fingerprint,\n\t\t\t\tdata: cookies,\n\t\t\t},\n\t\t\tasync: false,\n\t\t\tsuccess: function(msg){\n\t\t\t\tmsg = JSON.parse(msg);\n\t\t\t\tif(msg.result){\n\t\t\t\t\tconsole.log('success');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t\t// Deleting ct_ and apbct_ cookies on success\n\t\t\t\t\tapbct_cookie__delete();\n\t\t\t\t\tconsole.log('cookie DELETED');\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log('APBCT SESSIONS GET ERROR');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err){\n\t\t\t\tconsole.log('err');\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t}); \n\t}\n});"]}
js/apbct-public--gdpr.js DELETED
@@ -1,32 +0,0 @@
1
- jQuery(document).ready(function(){
2
-
3
- if(!ctPublicGDPR.gdpr_forms) return;
4
-
5
- ctPublicGDPR.gdpr_forms.forEach(function(item, i, arr){
6
-
7
- var elem = jQuery('#'+item+', .'+item);
8
-
9
- // Filter forms
10
- if(!elem.is('form')){
11
- // Caldera
12
- if(elem.find('form')[0])
13
- elem = elem.children('form').first();
14
- // Contact Form 7
15
- else if(jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]').attr('id').indexOf('wpcf7-f'+item) !== -1)
16
- elem = jQuery('.wpcf7[role=form]');
17
- // Formidable
18
- else if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)
19
- elem = jQuery('.frm_forms').first().children('form');
20
- // WPForms
21
- else if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)
22
- elem = jQuery('.wpforms-form');
23
- }
24
-
25
- // Adding notice
26
- if(elem.is('form') || elem.attr('role') === 'form'){
27
- elem.append('<input id="apbct_gdpr_'+i+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">')
28
- .append('<label style="display: inline;" for="apbct_gdpr_'+i+'">'+ctPublicGDPR.gdpr_text+'</label>');
29
- }
30
- });
31
-
32
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/apbct-public--gdpr.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(document).ready(function(){ctPublicGDPR.gdpr_forms&&ctPublicGDPR.gdpr_forms.forEach(function(r,f,e){var o=jQuery("#"+r+", ."+r);o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+r)?o=jQuery(".wpcf7[role=form]"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+r)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+r)&&(o=jQuery(".wpforms-form"))),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+f+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">').append('<label style="display: inline;" for="apbct_gdpr_'+f+'">'+ctPublicGDPR.gdpr_text+"</label>")})});
2
+ //# sourceMappingURL=apbct-public--gdpr.min.js.map
js/apbct-public--gdpr.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["apbct-public--gdpr.js"],"names":["jQuery","document","ready","ctPublicGDPR","gdpr_forms","forEach","item","i","arr","elem","is","find","children","first","attr","indexOf","append","gdpr_text"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAElBC,aAAaC,YAEjBD,aAAaC,WAAWC,QAAQ,SAASC,EAAMC,EAAGC,GAEjD,IAAIC,EAAOT,OAAO,IAAIM,EAAK,MAAMA,GAG7BG,EAAKC,GAAG,UAERD,EAAKE,KAAK,QAAQ,GACpBF,EAAOA,EAAKG,SAAS,QAAQC,QAEtBb,OAAO,qBAAqB,KAA0E,IAApEA,OAAO,qBAAqBc,KAAK,MAAMC,QAAQ,UAAUT,GAClGG,EAAOT,OAAO,qBAEPA,OAAO,cAAc,KAA6E,IAAvEA,OAAO,cAAca,QAAQC,KAAK,MAAMC,QAAQ,YAAYT,GAC9FG,EAAOT,OAAO,cAAca,QAAQD,SAAS,QAEtCZ,OAAO,iBAAiB,KAAoF,IAA9EA,OAAO,iBAAiBa,QAAQC,KAAK,MAAMC,QAAQ,gBAAgBT,KACxGG,EAAOT,OAAO,oBAIbS,EAAKC,GAAG,SAAiC,SAAtBD,EAAKK,KAAK,SAC/BL,EAAKO,OAAO,yBAAyBT,EAAE,wFACrCS,OAAO,mDAAmDT,EAAE,KAAKJ,aAAac,UAAU","file":"apbct-public--gdpr.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\tif(!ctPublicGDPR.gdpr_forms) return;\r\n\t\r\n\tctPublicGDPR.gdpr_forms.forEach(function(item, i, arr){\r\n\t\t\r\n\t\tvar elem = jQuery('#'+item+', .'+item);\r\n\t\t\r\n\t\t// Filter forms\r\n\t\tif(!elem.is('form')){\r\n\t\t\t// Caldera\r\n\t\t\tif(elem.find('form')[0])\r\n\t\t\t\telem = elem.children('form').first();\r\n\t\t\t// Contact Form 7\r\n\t\t\telse if(jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]').attr('id').indexOf('wpcf7-f'+item) !== -1)\r\n\t\t\t\telem = jQuery('.wpcf7[role=form]');\r\n\t\t\t// Formidable\r\n\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\r\n\t\t\t\telem = jQuery('.frm_forms').first().children('form');\r\n\t\t\t// WPForms\r\n\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\r\n\t\t\t\telem = jQuery('.wpforms-form');\r\n\t\t}\r\n\t\t\r\n\t\t// Adding notice\r\n\t\tif(elem.is('form') || elem.attr('role') === 'form'){\r\n\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required \" style=\"display: inline; margin-right: 10px;\">')\r\n\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\r\n\t\t}\r\n\t});\r\n\t\r\n});"]}
js/apbct-public.js DELETED
@@ -1,214 +0,0 @@
1
- var ct_date = new Date(),
2
- ctTimeMs = new Date().getTime(),
3
- ctMouseEventTimerFlag = true, //Reading interval flag
4
- ctMouseData = [],
5
- ctMouseDataCounter = 0;
6
-
7
- function ctSetCookieSec(c_name, value) {
8
- document.cookie = c_name + "=" + encodeURIComponent(value) + "; path=/";
9
- }
10
-
11
- function apbct_attach_event_handler(elem, event, callback){
12
- if(typeof window.addEventListener === "function") elem.addEventListener(event, callback);
13
- else elem.attachEvent(event, callback);
14
- }
15
-
16
- function apbct_remove_event_handler(elem, event, callback){
17
- if(typeof window.removeEventListener === "function") elem.removeEventListener(event, callback);
18
- else elem.detachEvent(event, callback);
19
- }
20
-
21
- ctSetCookieSec("ct_ps_timestamp", Math.floor(new Date().getTime()/1000));
22
- ctSetCookieSec("ct_fkp_timestamp", "0");
23
- ctSetCookieSec("ct_pointer_data", "0");
24
- ctSetCookieSec("ct_timezone", "0");
25
-
26
- setTimeout(function(){
27
- ctSetCookieSec("ct_timezone", ct_date.getTimezoneOffset()/60*(-1));
28
- },1000);
29
-
30
- //Writing first key press timestamp
31
- var ctFunctionFirstKey = function output(event){
32
- var KeyTimestamp = Math.floor(new Date().getTime()/1000);
33
- ctSetCookieSec("ct_fkp_timestamp", KeyTimestamp);
34
- ctKeyStopStopListening();
35
- };
36
-
37
- //Reading interval
38
- var ctMouseReadInterval = setInterval(function(){
39
- ctMouseEventTimerFlag = true;
40
- }, 150);
41
-
42
- //Writting interval
43
- var ctMouseWriteDataInterval = setInterval(function(){
44
- ctSetCookieSec("ct_pointer_data", JSON.stringify(ctMouseData));
45
- }, 1200);
46
-
47
- //Logging mouse position each 150 ms
48
- var ctFunctionMouseMove = function output(event){
49
- if(ctMouseEventTimerFlag === true){
50
-
51
- ctMouseData.push([
52
- Math.round(event.clientY),
53
- Math.round(event.clientX),
54
- Math.round(new Date().getTime() - ctTimeMs)
55
- ]);
56
-
57
- ctMouseDataCounter++;
58
- ctMouseEventTimerFlag = false;
59
- if(ctMouseDataCounter >= 50){
60
- ctMouseStopData();
61
- }
62
- }
63
- };
64
-
65
- //Stop mouse observing function
66
- function ctMouseStopData(){
67
- apbct_remove_event_handler(window, "mousemove", ctFunctionMouseMove);
68
- clearInterval(ctMouseReadInterval);
69
- clearInterval(ctMouseWriteDataInterval);
70
- }
71
-
72
- //Stop key listening function
73
- function ctKeyStopStopListening(){
74
- apbct_remove_event_handler(window, "mousedown", ctFunctionFirstKey);
75
- apbct_remove_event_handler(window, "keydown", ctFunctionFirstKey);
76
- }
77
-
78
- apbct_attach_event_handler(window, "mousemove", ctFunctionMouseMove);
79
- apbct_attach_event_handler(window, "mousedown", ctFunctionFirstKey);
80
- apbct_attach_event_handler(window, "keydown", ctFunctionFirstKey);
81
-
82
- // Ready function
83
- function apbct_ready(){
84
- ctSetCookieSec("apbct_visible_fields", 0);
85
- ctSetCookieSec("apbct_visible_fields_count", 0);
86
- setTimeout(function(){
87
- for(var i = 0; i < document.forms.length; i++){
88
- var form = document.forms[i];
89
-
90
- form.onsubmit_prev = form.onsubmit;
91
- form.onsubmit = function(event){
92
-
93
- // Get only fields
94
- var elements = [];
95
- for(var key in this.elements){
96
- if(!isNaN(+key))
97
- elements[key] = this.elements[key];
98
- }
99
-
100
- // Filter fields
101
- elements = elements.filter(function(elem){
102
-
103
- var pass = true;
104
-
105
- // Filter fields
106
- if( getComputedStyle(elem).display === "none" || // hidden
107
- getComputedStyle(elem).visibility === "hidden" || // hidden
108
- getComputedStyle(elem).opacity === "0" || // hidden
109
- elem.getAttribute("type") === "hidden" || // type == hidden
110
- elem.getAttribute("type") === "submit" || // type == submit
111
- elem.value === "" // empty value
112
- ){
113
- return false;
114
- }
115
-
116
- // Filter elements with same names for type == radio
117
- if(elem.getAttribute("type") === "radio"){
118
- elements.forEach(function(el, j, els){
119
- if(elem.getAttribute('name') === el.getAttribute('name')){
120
- pass = false;
121
- return;
122
- }
123
- });
124
- }
125
-
126
- return true;
127
- });
128
-
129
- // Visible fields count
130
- var visible_fields_count = elements.length;
131
-
132
- // Visible fields
133
- var visible_fields = '';
134
- elements.forEach(function(elem, i, elements){
135
- visible_fields += " " + elem.getAttribute("name");
136
- });
137
- visible_fields = visible_fields.trim();
138
-
139
- ctSetCookieSec("apbct_visible_fields", visible_fields);
140
- ctSetCookieSec("apbct_visible_fields_count", visible_fields_count);
141
-
142
- // Call previous submit action
143
- if(event.target.onsubmit_prev instanceof Function){
144
- setTimeout(function(){
145
- event.target.onsubmit_prev.call(event.target, event);
146
- }, 500);
147
- }
148
- };
149
- }
150
- }, 1000);
151
- }
152
- apbct_attach_event_handler(window, "DOMContentLoaded", apbct_ready);
153
-
154
- // Capturing responses and output block message for unknown AJAX forms
155
- jQuery(document).ajaxComplete(function(event, xhr, settings) {
156
- if(xhr.responseText && xhr.responseText.indexOf('"apbct') !== -1){
157
- var response = JSON.parse(xhr.responseText);
158
- if(typeof response.apbct !== 'undefined'){
159
- var response = response.apbct;
160
- if(response.blocked){
161
- alert(response.comment);
162
- }
163
- }
164
- }
165
- });
166
-
167
- function apbct_js_keys__set_input_value(result, data, params, obj){
168
- if (document.getElementById(params.input_name) !== null) {
169
- var ct_input_value = document.getElementById(params.input_name).value;
170
- document.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);
171
- }
172
- }
173
-
174
- function apbct_sendAJAXRequest(data, params, obj){
175
-
176
- // Default params
177
- var callback = params.callback || null;
178
- var notJson = params.notJson || null;
179
- var timeout = params.timeout || 15000;
180
- var obj = obj || null;
181
-
182
- data._ajax_nonce = ctPublic._ajax_nonce;
183
-
184
- jQuery.ajax({
185
- type: "POST",
186
- url: ctPublic._ajax_url,
187
- data: data,
188
- success: function(result){
189
- if(!notJson) result = JSON.parse(result);
190
- if(result.error){
191
-
192
- }else{
193
- if(callback)
194
- callback(result, data, params, obj);
195
- }
196
- },
197
- error: function(jqXHR, textStatus, errorThrown){
198
- console.log('APBCT_AJAX_ERROR');
199
- console.log(data);
200
- console.log(jqXHR);
201
- console.log(textStatus);
202
- console.log(errorThrown);
203
- },
204
- timeout: timeout
205
- });
206
- }
207
-
208
- //(function(open) {
209
- // XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
210
- // this.addEventListener("readystatechange", function() {
211
- // }, false);
212
- // open.call(this, method, url, async, user, pass);
213
- // };
214
- //})(XMLHttpRequest.prototype.open);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/apbct-public.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0;function ctSetCookieSec(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/"}function apbct_attach_event_handler(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function apbct_remove_event_handler(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}ctSetCookieSec("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),ctSetCookieSec("ct_fkp_timestamp","0"),ctSetCookieSec("ct_pointer_data","0"),ctSetCookieSec("ct_timezone","0"),setTimeout(function(){ctSetCookieSec("ct_timezone",ct_date.getTimezoneOffset()/60*-1)},1e3);var ctFunctionFirstKey=function(e){ctSetCookieSec("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookieSec("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function apbct_ready(){ctSetCookieSec("apbct_visible_fields",0),ctSetCookieSec("apbct_visible_fields_count",0),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t=document.forms[e];t.onsubmit_prev=t.onsubmit,t.onsubmit=function(e){var t=[];for(var n in this.elements)isNaN(+n)||(t[n]=this.elements[n]);var o=(t=t.filter(function(o){return"none"!==getComputedStyle(o).display&&"hidden"!==getComputedStyle(o).visibility&&"0"!==getComputedStyle(o).opacity&&"hidden"!==o.getAttribute("type")&&"submit"!==o.getAttribute("type")&&""!==o.value&&("radio"===o.getAttribute("type")&&t.forEach(function(e,t,n){o.getAttribute("name")!==e.getAttribute("name")||!1}),!0)})).length,c="";t.forEach(function(e,t,n){c+=" "+e.getAttribute("name")}),ctSetCookieSec("apbct_visible_fields",c=c.trim()),ctSetCookieSec("apbct_visible_fields_count",o),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)}}},1e3)}function apbct_js_keys__set_input_value(e,t,n,o){if(null!==document.getElementById(n.input_name)){var c=document.getElementById(n.input_name).value;document.getElementById(n.input_name).value=document.getElementById(n.input_name).value.replace(c,e.js_key)}}function apbct_sendAJAXRequest(o,t,n){var c=t.callback||null,a=t.notJson||null,e=t.timeout||15e3;n=n||null;o._ajax_nonce=ctPublic._ajax_nonce,jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:o,success:function(e){a||(e=JSON.parse(e)),e.error||c&&c(e,o,t,n)},error:function(e,t,n){console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(e),console.log(t),console.log(n)},timeout:e})}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),jQuery(document).ajaxComplete(function(e,t,n){var o;t.responseText&&-1!==t.responseText.indexOf('"apbct')&&void 0!==(o=JSON.parse(t.responseText)).apbct&&(o=o.apbct).blocked&&alert(o.comment)});
2
+ //# sourceMappingURL=apbct-public.min.js.map
js/apbct-public.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["apbct-public.js"],"names":["ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctSetCookieSec","c_name","value","document","cookie","encodeURIComponent","apbct_attach_event_handler","elem","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","Math","floor","setTimeout","getTimezoneOffset","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","JSON","stringify","ctFunctionMouseMove","push","round","clientY","clientX","ctMouseStopData","clearInterval","apbct_ready","i","forms","length","form","onsubmit_prev","onsubmit","elements","key","this","isNaN","visible_fields_count","filter","getComputedStyle","display","visibility","opacity","getAttribute","forEach","el","j","els","visible_fields","trim","target","Function","call","apbct_js_keys__set_input_value","result","data","params","obj","getElementById","input_name","ct_input_value","replace","js_key","apbct_sendAJAXRequest","notJson","timeout","_ajax_nonce","ctPublic","jQuery","ajax","type","url","_ajax_url","success","parse","error","jqXHR","textStatus","errorThrown","console","log","ajaxComplete","xhr","settings","response","responseText","indexOf","apbct","blocked","alert","comment"],"mappings":"AAAA,IAAIA,QAAU,IAAIC,KACjBC,UAAW,IAAID,MAAOE,UACtBC,uBAAwB,EACxBC,YAAc,GACdC,mBAAqB,EAEtB,SAASC,eAAeC,EAAQC,GAC/BC,SAASC,OAASH,EAAS,IAAMI,mBAAmBH,GAAS,WAG9D,SAASI,2BAA2BC,EAAMC,EAAOC,GACV,mBAA5BC,OAAOC,iBAA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djB,KAAMA,EACNkB,QAAS,SAASnB,GACbU,IAASV,EAASrC,KAAKyD,MAAMpB,IAC9BA,EAAOqB,OAGN1E,GACFA,EAASqD,EAAQC,EAAMC,EAAQC,IAGlCkB,MAAO,SAASC,EAAOC,EAAYC,GAClCC,QAAQC,IAAI,oBACZD,QAAQC,IAAIzB,GACZwB,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbb,QAASA,IA9HXnE,2BAA2BI,OAAQ,YAAaiB,qBAChDrB,2BAA2BI,OAAQ,YAAaU,oBAChDd,2BAA2BI,OAAQ,UAAWU,oBAwE9Cd,2BAA2BI,OAAQ,mBAAoBwB,aAGvD0C,OAAOzE,UAAUsF,aAAa,SAASjF,EAAOkF,EAAKC,GAEjD,IAEKC,EAHHF,EAAIG,eAAwD,IAAxCH,EAAIG,aAAaC,QAAQ,gBAElB,KADzBF,EAAWnE,KAAKyD,MAAMQ,EAAIG,eACXE,QACdH,EAAWA,EAASG,OACZC,SACXC,MAAML,EAASM","file":"apbct-public.min.js","sourcesContent":["var ct_date = new Date(), \r\n\tctTimeMs = new Date().getTime(),\r\n\tctMouseEventTimerFlag = true, //Reading interval flag\r\n\tctMouseData = [],\r\n\tctMouseDataCounter = 0;\r\n\r\nfunction ctSetCookieSec(c_name, value) {\r\n\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/\";\r\n}\r\n\r\nfunction apbct_attach_event_handler(elem, event, callback){\r\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\r\n\telse elem.attachEvent(event, callback);\r\n}\r\n\r\nfunction apbct_remove_event_handler(elem, event, callback){\r\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\r\n\telse elem.detachEvent(event, callback);\r\n}\r\n\r\nctSetCookieSec(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\r\nctSetCookieSec(\"ct_fkp_timestamp\", \"0\");\r\nctSetCookieSec(\"ct_pointer_data\", \"0\");\r\nctSetCookieSec(\"ct_timezone\", \"0\");\r\n\r\nsetTimeout(function(){\r\n\tctSetCookieSec(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\r\n},1000);\r\n\r\n//Writing first key press timestamp\r\nvar ctFunctionFirstKey = function output(event){\r\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\r\n\tctSetCookieSec(\"ct_fkp_timestamp\", KeyTimestamp);\r\n\tctKeyStopStopListening();\r\n};\r\n\r\n//Reading interval\r\nvar ctMouseReadInterval = setInterval(function(){\r\n\tctMouseEventTimerFlag = true;\r\n}, 150);\r\n\t\r\n//Writting interval\r\nvar ctMouseWriteDataInterval = setInterval(function(){\r\n\tctSetCookieSec(\"ct_pointer_data\", JSON.stringify(ctMouseData));\r\n}, 1200);\r\n\r\n//Logging mouse position each 150 ms\r\nvar ctFunctionMouseMove = function output(event){\r\n\tif(ctMouseEventTimerFlag === true){\r\n\t\t\r\n\t\tctMouseData.push([\r\n\t\t\tMath.round(event.clientY),\r\n\t\t\tMath.round(event.clientX),\r\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\r\n\t\t]);\r\n\t\t\r\n\t\tctMouseDataCounter++;\r\n\t\tctMouseEventTimerFlag = false;\r\n\t\tif(ctMouseDataCounter >= 50){\r\n\t\t\tctMouseStopData();\r\n\t\t}\r\n\t}\r\n};\r\n\r\n//Stop mouse observing function\r\nfunction ctMouseStopData(){\r\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\n\tclearInterval(ctMouseReadInterval);\r\n\tclearInterval(ctMouseWriteDataInterval);\t\t\t\t\r\n}\r\n\r\n//Stop key listening function\r\nfunction ctKeyStopStopListening(){\r\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n}\r\n\r\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n\r\n// Ready function\r\nfunction apbct_ready(){\r\n\tctSetCookieSec(\"apbct_visible_fields\", 0);\r\n\tctSetCookieSec(\"apbct_visible_fields_count\", 0);\r\n\tsetTimeout(function(){\r\n\t\tfor(var i = 0; i < document.forms.length; i++){\r\n\t\t\tvar form = document.forms[i];\r\n\r\n\t\t\tform.onsubmit_prev = form.onsubmit;\r\n\t\t\tform.onsubmit = function(event){\r\n\t\t\t\t\r\n\t\t\t\t// Get only fields\r\n\t\t\t\tvar elements = [];\r\n\t\t\t\tfor(var key in this.elements){\r\n\t\t\t\t\tif(!isNaN(+key))\r\n\t\t\t\t\t\telements[key] = this.elements[key];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Filter fields\r\n\t\t\t\telements = elements.filter(function(elem){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar pass = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Filter fields\r\n\t\t\t\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\r\n\t\t\t\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\r\n\t\t\t\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\r\n\t\t\t\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\r\n\t\t\t\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\r\n\t\t\t\t\t\telem.value === \"\" // empty value\r\n\t\t\t\t\t){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Filter elements with same names for type == radio\r\n\t\t\t\t\tif(elem.getAttribute(\"type\") === \"radio\"){\r\n\t\t\t\t\t\telements.forEach(function(el, j, els){\r\n\t\t\t\t\t\t\tif(elem.getAttribute('name') === el.getAttribute('name')){\r\n\t\t\t\t\t\t\t\tpass = false;\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// Visible fields count\r\n\t\t\t\tvar visible_fields_count = elements.length;\r\n\t\t\t\t\r\n\t\t\t\t// Visible fields\r\n\t\t\t\tvar visible_fields = '';\r\n\t\t\t\telements.forEach(function(elem, i, elements){\r\n\t\t\t\t\tvisible_fields += \" \" + elem.getAttribute(\"name\");\r\n\t\t\t\t});\r\n\t\t\t\tvisible_fields = visible_fields.trim();\r\n\t\t\t\t\r\n\t\t\t\tctSetCookieSec(\"apbct_visible_fields\", visible_fields);\r\n\t\t\t\tctSetCookieSec(\"apbct_visible_fields_count\", visible_fields_count);\r\n\t\t\t\t\r\n\t\t\t\t// Call previous submit action\r\n\t\t\t\tif(event.target.onsubmit_prev instanceof Function){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\r\n\t\t\t\t\t}, 500);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}\r\n\t}, 1000);\r\n}\r\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\r\n\r\n// Capturing responses and output block message for unknown AJAX forms\r\njQuery(document).ajaxComplete(function(event, xhr, settings) {\r\n\tif(xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1){\r\n\t\tvar response = JSON.parse(xhr.responseText);\r\n\t\tif(typeof response.apbct !== 'undefined'){\r\n\t\t\tvar response = response.apbct;\r\n\t\t\tif(response.blocked){\r\n\t\t\t\talert(response.comment);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\r\n\tif (document.getElementById(params.input_name) !== null) {\r\n\t\tvar ct_input_value = document.getElementById(params.input_name).value;\r\n\t\tdocument.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);\r\n\t}\r\n}\r\n\r\nfunction apbct_sendAJAXRequest(data, params, obj){\r\n\t\r\n\t// Default params\r\n\tvar callback = params.callback || null;\r\n\tvar notJson = params.notJson || null;\r\n\tvar timeout = params.timeout || 15000;\r\n\tvar obj = obj || null;\r\n\t\r\n\tdata._ajax_nonce = ctPublic._ajax_nonce;\r\n\t\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ctPublic._ajax_url,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(!notJson) result = JSON.parse(result);\r\n\t\t\tif(result.error){\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(callback)\r\n\t\t\t\t\tcallback(result, data, params, obj);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown){\r\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\r\n\t\t\tconsole.log(data);\r\n\t\t\tconsole.log(jqXHR);\r\n\t\t\tconsole.log(textStatus);\r\n\t\t\tconsole.log(errorThrown);\r\n\t\t},\r\n\t\ttimeout: timeout\r\n\t});\r\n}\r\n\r\n//(function(open) {\r\n// XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\r\n// this.addEventListener(\"readystatechange\", function() {\r\n// }, false);\r\n// open.call(this, method, url, async, user, pass);\r\n// };\r\n//})(XMLHttpRequest.prototype.open);"]}
js/cleantalk-admin-settings-page.js DELETED
@@ -1,61 +0,0 @@
1
- jQuery(document).ready(function(){
2
- var d = new Date();
3
- jQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));
4
-
5
- // GDPR modal window
6
- jQuery('#apbct_gdpr_open_modal').on('click', function(){
7
- jQuery('#gdpr_dialog').dialog({
8
- modal:true,
9
- show: true,
10
- position: { my: "center", at: "center", of: window },
11
- width: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody
12
- height: 'auto',
13
- title: 'GDPR compliance',
14
- draggable: false,
15
- resizable: false,
16
- closeText: "Close",
17
- });
18
- });
19
-
20
- });
21
-
22
- function apbct_show_hide_elem(elem){
23
- elem = jQuery(elem);
24
- var label = elem.next('label') || elem.prev('label') || null;
25
- if(elem.is(":visible")){
26
- elem.hide();
27
- if(label) label.hide();
28
- }else{
29
- elem.show();
30
- if(label) label.show();
31
- }
32
- }
33
-
34
- // Settings dependences
35
- function apbctSettingsDependencies(settingsIDs){
36
- console.log(settingsIDs);
37
- if(typeof settingsIDs === 'string'){
38
- tmp = [];
39
- tmp.push(settingsIDs);
40
- settingsIDs = tmp;
41
- }
42
- console.log(settingsIDs);
43
- settingsIDs.forEach(function(settingID, i, arr){
44
- console.log(settingID);
45
- var elem = document.getElementById('apbct_setting_'+settingID) || null;
46
- console.log(elem);
47
- if(elem){
48
- apbctSwitchDisabledAttr(elem);
49
- }else{
50
- apbctSwitchDisabledAttr(document.getElementById('apbct_setting_'+settingID+'_yes'));
51
- apbctSwitchDisabledAttr(document.getElementById('apbct_setting_'+settingID+'_no'));
52
- }
53
- });
54
- }
55
-
56
- function apbctSwitchDisabledAttr(elem){
57
- if(elem.getAttribute('disabled') === null)
58
- elem.setAttribute('disabled', 'disabled');
59
- else
60
- elem.removeAttribute('disabled');
61
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-admin-settings-page.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function apbct_show_hide_elem(e){var t=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),t&&t.hide()):(e.show(),t&&t.show())}function apbctSettingsDependencies(e){console.log(e),"string"==typeof e&&(tmp=[],tmp.push(e),e=tmp),console.log(e),e.forEach(function(e,t,i){console.log(e);var o=document.getElementById("apbct_setting_"+e)||null;console.log(o),o?apbctSwitchDisabledAttr(o):(apbctSwitchDisabledAttr(document.getElementById("apbct_setting_"+e+"_yes")),apbctSwitchDisabledAttr(document.getElementById("apbct_setting_"+e+"_no")))})}function apbctSwitchDisabledAttr(e){null===e.getAttribute("disabled")?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled")}jQuery(document).ready(function(){var e=new Date;jQuery("#ct_admin_timezone").val(e.getTimezoneOffset()/60*-1),jQuery("#apbct_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:+jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})})});
2
+ //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
js/cleantalk-admin-settings-page.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-admin-settings-page.js"],"names":["apbct_show_hide_elem","elem","label","jQuery","next","prev","is","hide","show","apbctSettingsDependencies","settingsIDs","console","log","tmp","push","forEach","settingID","i","arr","document","getElementById","apbctSwitchDisabledAttr","getAttribute","setAttribute","removeAttribute","ready","d","Date","val","getTimezoneOffset","on","dialog","modal","position","my","at","of","window","width","height","title","draggable","resizable","closeText"],"mappings":"AAqBA,SAASA,qBAAqBC,GAE7B,IAAIC,GADJD,EAAOE,OAAOF,IACGG,KAAK,UAAYH,EAAKI,KAAK,UAAY,KACrDJ,EAAKK,GAAG,aACVL,EAAKM,OACFL,GAAOA,EAAMK,SAEhBN,EAAKO,OACFN,GAAOA,EAAMM,QAKlB,SAASC,0BAA0BC,GAClCC,QAAQC,IAAIF,GACc,iBAAhBA,IACTG,IAAM,GACNA,IAAIC,KAAKJ,GACTA,EAAcG,KAEfF,QAAQC,IAAIF,GACZA,EAAYK,QAAQ,SAASC,EAAWC,EAAGC,GAC1CP,QAAQC,IAAII,GACZ,IAAIf,EAAOkB,SAASC,eAAe,iBAAiBJ,IAAc,KAClEL,QAAQC,IAAIX,GACTA,EACFoB,wBAAwBpB,IAExBoB,wBAAwBF,SAASC,eAAe,iBAAiBJ,EAAU,SAC3EK,wBAAwBF,SAASC,eAAe,iBAAiBJ,EAAU,WAK9E,SAASK,wBAAwBpB,GACK,OAAlCA,EAAKqB,aAAa,YACpBrB,EAAKsB,aAAa,WAAY,YAE9BtB,EAAKuB,gBAAgB,YA3DvBrB,OAAOgB,UAAUM,MAAM,WACtB,IAAIC,EAAI,IAAIC,KACZxB,OAAO,sBAAsByB,IAAIF,EAAEG,oBAAoB,IAAK,GAG5D1B,OAAO,0BAA0B2B,GAAG,QAAS,WAC5C3B,OAAO,gBAAgB4B,OAAO,CAC7BC,OAAM,EACNxB,MAAM,EACNyB,SAAU,CAAEC,GAAI,SAAUC,GAAI,SAAUC,GAAIC,QAC5CC,OAASnC,OAAO,WAAWmC,QAAU,IAAM,GAC3CC,OAAQ,OACRC,MAAO,kBACPC,WAAW,EACXC,WAAW,EACXC,UAAW","file":"cleantalk-admin-settings-page.min.js","sourcesContent":["jQuery(document).ready(function(){\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\t\n\t// GDPR modal window\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\n\t\tjQuery('#gdpr_dialog').dialog({\n\t\t\tmodal:true, \n\t\t\tshow: true,\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n\t\t\theight: 'auto',\n\t\t\ttitle: 'GDPR compliance',\n\t\t\tdraggable: false,\n\t\t\tresizable: false,\n\t\t\tcloseText: \"Close\",\n\t\t});\n\t});\n\t\n});\n\nfunction apbct_show_hide_elem(elem){\n\telem = jQuery(elem);\n\tvar label = elem.next('label') || elem.prev('label') || null;\n\tif(elem.is(\":visible\")){\n\t\telem.hide();\n\t\tif(label) label.hide();\n\t}else{\n\t\telem.show();\n\t\tif(label) label.show();\n\t}\n}\n\n// Settings dependences\nfunction apbctSettingsDependencies(settingsIDs){\n\tconsole.log(settingsIDs);\n\tif(typeof settingsIDs === 'string'){\n\t\ttmp = [];\n\t\ttmp.push(settingsIDs);\n\t\tsettingsIDs = tmp;\n\t}\n\tconsole.log(settingsIDs);\n\tsettingsIDs.forEach(function(settingID, i, arr){\n\t\tconsole.log(settingID);\n\t\tvar elem = document.getElementById('apbct_setting_'+settingID) || null;\n\t\tconsole.log(elem);\n\t\tif(elem){\n\t\t\tapbctSwitchDisabledAttr(elem);\n\t\t}else{\n\t\t\tapbctSwitchDisabledAttr(document.getElementById('apbct_setting_'+settingID+'_yes'));\n\t\t\tapbctSwitchDisabledAttr(document.getElementById('apbct_setting_'+settingID+'_no'));\n\t\t}\n\t});\n}\n\nfunction apbctSwitchDisabledAttr(elem){\n\tif(elem.getAttribute('disabled') === null)\n\t\telem.setAttribute('disabled', 'disabled');\n\telse\n\t\telem.removeAttribute('disabled');\n}"]}
js/cleantalk-admin.js DELETED
@@ -1,11 +0,0 @@
1
- jQuery(document).ready(function(){
2
-
3
- // Auto update banner close handler
4
- jQuery('.apbct_update_notice').on('click', 'button', function(){
5
- var ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );
6
- document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
7
- });
8
-
9
- jQuery('li a[href="options-general.php?page=cleantalk"]').css('white-space','nowrap');
10
-
11
- });
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-admin.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(document).ready(function(){jQuery(".apbct_update_notice").on("click","button",function(){var e=new Date((new Date).getTime()+2592e6);document.cookie="apbct_update_banner_closed=1; path=/; expires="+e.toUTCString()}),jQuery('li a[href="options-general.php?page=cleantalk"]').css("white-space","nowrap")});
2
+ //# sourceMappingURL=cleantalk-admin.min.js.map
js/cleantalk-admin.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-admin.js"],"names":["jQuery","document","ready","on","ct_date","Date","getTime","cookie","toUTCString","css"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGtBF,OAAO,wBAAwBG,GAAG,QAAS,SAAU,WACpD,IAAIC,EAAU,IAAIC,MAAK,IAAIA,MAAOC,UAAY,QAC9CL,SAASM,OAAS,iDAAmDH,EAAQI,gBAG9ER,OAAO,mDAAmDS,IAAI,cAAc","file":"cleantalk-admin.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString();\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap');\n\t\n});"]}
js/cleantalk-comments-checkspam.js DELETED
@@ -1,529 +0,0 @@
1
- // Printf for JS
2
- String.prototype.printf = function(){
3
- var formatted = this;
4
- for( var arg in arguments ) {
5
- var before_formatted = formatted.substring(0, formatted.indexOf("%s", 0));
6
- var after_formatted = formatted.substring(formatted.indexOf("%s", 0)+2, formatted.length);
7
- formatted = before_formatted + arguments[arg] + after_formatted;
8
- }
9
- return formatted;
10
- };
11
-
12
- // Flags
13
- var ct_working = false,
14
- ct_new_check = true,
15
- ct_cooling_down_flag = false,
16
- ct_close_animate = true,
17
- ct_accurate_check = false,
18
- ct_pause = false,
19
- ct_prev_accurate = ctCommentsCheck.ct_prev_accurate,
20
- ct_prev_from = ctCommentsCheck.ct_prev_from,
21
- ct_prev_till = ctCommentsCheck.ct_prev_till;
22
- // Settings
23
- var ct_cool_down_time = 90000,
24
- ct_requests_counter = 0,
25
- ct_max_requests = 60;
26
- // Variables
27
- var ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,
28
- ct_comments_total = 0,
29
- ct_comments_checked = 0,
30
- ct_comments_spam = 0,
31
- ct_comments_bad = 0,
32
- ct_unchecked = 'unset',
33
- ct_date_from = 0,
34
- ct_date_till = 0;
35
-
36
- function animate_comment(to,id){
37
- if(ct_close_animate){
38
- if(to==0.3){
39
- jQuery('#comment-'+id).fadeTo(200,to,function(){
40
- animate_comment(1,id)
41
- });
42
- }else{
43
- jQuery('#comment-'+id).fadeTo(200,to,function(){
44
- animate_comment(0.3,id)
45
- });
46
- }
47
- }else{
48
- ct_close_animate=true;
49
- }
50
- }
51
-
52
- function ct_clear_comments(){
53
-
54
- var data = {
55
- 'action': 'ajax_clear_comments',
56
- 'security': ct_ajax_nonce
57
- };
58
-
59
- jQuery.ajax({
60
- type: "POST",
61
- url: ajaxurl,
62
- data: data,
63
- success: function(msg){
64
- ct_show_info();
65
- ct_send_comments();
66
- }
67
- });
68
- }
69
-
70
- //Continues the check after cooldown time
71
- //Called by ct_send_users();
72
- function ct_cooling_down_toggle(){
73
- ct_cooling_down_flag = false;
74
- ct_send_comments();
75
- ct_show_info();
76
- }
77
-
78
- function ct_send_comments(){
79
-
80
- if(ct_cooling_down_flag == true)
81
- return;
82
-
83
- if(ct_requests_counter >= ct_max_requests){
84
- setTimeout(ct_cooling_down_toggle, ct_cool_down_time);
85
- ct_requests_counter = 0;
86
- ct_cooling_down_flag = true;
87
- return;
88
- }else{
89
- ct_requests_counter++;
90
- }
91
-
92
- var data = {
93
- 'action': 'ajax_check_comments',
94
- 'security': ct_ajax_nonce,
95
- 'new_check': ct_new_check,
96
- 'unchecked': ct_unchecked
97
- };
98
-
99
- if(ct_accurate_check)
100
- data['accurate_check'] = true;
101
-
102
- if(ct_date_from && ct_date_till){
103
- data['from'] = ct_date_from;
104
- data['till'] = ct_date_till;
105
- }
106
-
107
- jQuery.ajax({
108
- type: "POST",
109
- url: ajaxurl,
110
- data: data,
111
- success: function(msg){
112
-
113
- msg = jQuery.parseJSON(msg);
114
-
115
- if(parseInt(msg.error)){
116
- ct_working=false;
117
- if(!confirm(msg.error_message+". Do you want to proceed?")){
118
- var new_href = 'edit-comments.php?page=ct_check_spam';
119
- if(ct_date_from != 0 && ct_date_till != 0)
120
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
121
- location.href = new_href;
122
- }else
123
- ct_send_comments();
124
- }else{
125
- ct_new_check = false;
126
- if(parseInt(msg.end) == 1 || ct_pause === true){
127
- if(parseInt(msg.end) == 1)
128
- document.cookie = 'ct_paused_comments_check=0; path=/';
129
- ct_working=false;
130
- jQuery('#ct_working_message').hide();
131
- var new_href = 'edit-comments.php?page=ct_check_spam';
132
- if(ct_date_from != 0 && ct_date_till != 0)
133
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
134
- location.href = new_href;
135
- }else if(parseInt(msg.end) == 0){
136
- ct_comments_checked = +ct_comments_checked + +msg.checked;
137
- ct_comments_spam = +ct_comments_spam + +msg.spam;
138
- ct_comments_bad = +ct_comments_bad + +msg.bad;
139
- ct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;
140
- var status_string = String(ctCommentsCheck.ct_status_string);
141
- var status_string = status_string.printf(ct_comments_total, ct_comments_checked, ct_comments_spam, ct_comments_bad);
142
- if(parseInt(ct_comments_spam) > 0)
143
- status_string += ctCommentsCheck.ct_status_string_warning;
144
- jQuery('#ct_checking_status').html(status_string);
145
- jQuery('#ct_error_message').hide();
146
- // If DB woks not properly
147
- if(+ct_comments_total < ct_comments_checked + ct_comments_bad){
148
- document.cookie = 'ct_comments_start_check=1; path=/';
149
- document.cookie = 'ct_comments_safe_check=1; path=/';
150
- location.href = 'edit-comments.php?page=ct_check_spam';
151
- }
152
- ct_send_comments();
153
- }
154
- }
155
- },
156
- error: function(jqXHR, textStatus, errorThrown) {
157
- jQuery('#ct_error_message').show();
158
- jQuery('#cleantalk_ajax_error').html(textStatus);
159
- jQuery('#cleantalk_js_func').html('Check comments');
160
- setTimeout(ct_send_comments(), 3000);
161
- },
162
- timeout: 25000
163
- });
164
- }
165
- function ct_show_info(){
166
-
167
- if(ct_working){
168
-
169
- if(ct_cooling_down_flag == true){
170
- jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');
171
- jQuery('#ct_cooling_notice').show();
172
- return;
173
- }else{
174
- jQuery('#ct_cooling_notice').hide();
175
- }
176
-
177
- setTimeout(ct_show_info, 3000);
178
-
179
- if(!ct_comments_total){
180
-
181
- var data = {
182
- 'action': 'ajax_info_comments',
183
- 'security': ct_ajax_nonce
184
- };
185
-
186
- if(ct_date_from && ct_date_till){
187
- data['from'] = ct_date_from;
188
- data['till'] = ct_date_till;
189
- }
190
-
191
- jQuery.ajax({
192
- type: "POST",
193
- url: ajaxurl,
194
- data: data,
195
- success: function(msg){
196
- msg = jQuery.parseJSON(msg);
197
- jQuery('#ct_checking_status').html(msg.message);
198
- ct_comments_total = msg.total;
199
- ct_comments_spam = msg.spam;
200
- ct_comments_checked = msg.checked;
201
- ct_comments_bad = msg.bad;
202
- },
203
- error: function(jqXHR, textStatus, errorThrown) {
204
- jQuery('#ct_error_message').show();
205
- jQuery('#cleantalk_ajax_error').html(textStatus);
206
- jQuery('#cleantalk_js_func').html('Check comments');
207
- setTimeout(ct_show_info(), 3000);
208
- },
209
- timeout: 15000
210
- });
211
- }
212
- }
213
- }
214
- function ct_insert_comments(delete_comments = false){
215
-
216
- var data = {
217
- 'action': 'ajax_insert_comments',
218
- 'security': ct_ajax_nonce
219
- };
220
-
221
- if(delete_comments)
222
- data['delete'] = true;
223
-
224
- jQuery.ajax({
225
- type: "POST",
226
- url: ajaxurl,
227
- data: data,
228
- success: function(msg){
229
- if(delete_comments)
230
- alert(ctCommentsCheck.ct_comments_deleted + ' ' + msg + ' ' + ctCommentsCheck.ct_comments_added_after);
231
- else
232
- alert(ctCommentsCheck.ct_comments_added + ' ' + msg + ' ' + ctCommentsCheck.ct_comments_added_after);
233
- }
234
- });
235
- }
236
- function ct_delete_all(){
237
-
238
- var data = {
239
- 'action': 'ajax_delete_all',
240
- 'security': ct_ajax_nonce
241
- };
242
-
243
- jQuery.ajax({
244
- type: "POST",
245
- url: ajaxurl,
246
- data: data,
247
- success: function(msg){
248
- if(msg>0){
249
- jQuery('#cleantalk_comments_left').html(msg);
250
- ct_delete_all();
251
- }else{
252
- location.href='edit-comments.php?page=ct_check_spam';
253
- }
254
- },
255
- error: function(jqXHR, textStatus, errorThrown) {
256
- jQuery('#ct_error_message').show();
257
- jQuery('#cleantalk_ajax_error').html(textStatus);
258
- jQuery('#cleantalk_js_func').html('Check comments');
259
- setTimeout(ct_delete_all(), 3000);
260
- },
261
- timeout: 25000
262
- });
263
- }
264
- function ct_delete_checked(){
265
-
266
- ids=Array();
267
- var cnt=0;
268
- jQuery('input[id^=cb-select-][id!=cb-select-all-1]').each(function(){
269
- if(jQuery(this).prop('checked')){
270
- ids[cnt]=jQuery(this).attr('id').substring(10);
271
- cnt++;
272
- }
273
- });
274
- var data = {
275
- 'action': 'ajax_delete_checked',
276
- 'security': ct_ajax_nonce,
277
- 'ids':ids
278
- };
279
-
280
- jQuery.ajax({
281
- type: "POST",
282
- url: ajaxurl,
283
- data: data,
284
- success: function(msg){
285
- location.href='edit-comments.php?page=ct_check_spam';
286
- },
287
- error: function(jqXHR, textStatus, errorThrown) {
288
- jQuery('#ct_error_message').show();
289
- jQuery('#cleantalk_ajax_error').html(textStatus);
290
- jQuery('#cleantalk_js_func').html('Check comments');
291
- setTimeout(ct_delete_checked(), 3000);
292
- },
293
- timeout: 15000
294
- });
295
- }
296
-
297
- // Function to toggle dependences
298
- function ct_toggle_depended(obj, secondary = false){
299
-
300
- var depended = jQuery(obj.data('depended')),
301
- state = obj.data('state');
302
-
303
- if(!state && !secondary){
304
- obj.data('state', true);
305
- depended.removeProp('disabled');
306
- }else{
307
- obj.data('state', false);
308
- depended.prop('disabled', true);
309
- depended.removeProp('checked');
310
- if(depended.data('depended'))
311
- ct_toggle_depended(depended, true);
312
- }
313
- }
314
-
315
- jQuery(document).ready(function(){
316
-
317
- // Setting dependences
318
- // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
319
- jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
320
-
321
- // Prev check parameters
322
- if(ct_prev_accurate){
323
- jQuery("#ct_accurate_check").prop('checked', true);
324
- }
325
- if(ct_prev_from){
326
- jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
327
- jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
328
- jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
329
- }
330
-
331
- // Toggle dependences
332
- jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
333
- ct_toggle_depended(jQuery(this));
334
- });
335
-
336
- var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
337
- {
338
- dateFormat: 'yy-mm-dd',
339
- maxDate:"+0D",
340
- changeMonth:true,
341
- changeYear:true,
342
- showAnim: 'slideDown',
343
- onSelect: function(selectedDate){
344
- var option = this.id == "ct_date_range_from" ? "minDate" : "maxDate",
345
- instance = jQuery( this ).data( "datepicker" ),
346
- date = jQuery.datepicker.parseDate(
347
- instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,
348
- selectedDate, instance.settings);
349
- dates.not(this).datepicker("option", option, date);
350
- }
351
- }
352
- );
353
-
354
- function ct_start_check(continue_check = false){
355
-
356
- if(jQuery('#ct_allow_date_range').is(':checked')){
357
-
358
- ct_date_from = jQuery('#ct_date_range_from').val(),
359
- ct_date_till = jQuery('#ct_date_range_till').val();
360
-
361
- if(!(ct_date_from != '' && ct_date_till != '')){
362
- alert('Please, specify a date range.');
363
- return;
364
- }
365
- }
366
-
367
- if(jQuery('#ct_accurate_check').is(':checked')){
368
- ct_accurate_check = true;
369
- }
370
-
371
- jQuery('.ct_to_hide').hide();
372
- jQuery('#ct_working_message').show();
373
- jQuery('#ct_preloader').show();
374
- jQuery('#ct_pause').show();
375
-
376
- ct_working=true;
377
-
378
- if(continue_check){
379
- ct_show_info();
380
- ct_send_comments();
381
- }else
382
- ct_clear_comments();
383
-
384
- }
385
-
386
- // Check comments
387
- jQuery("#ct_check_spam_button").click(function(){
388
- document.cookie = 'ct_paused_comments_check=0; path=/';
389
- ct_start_check(false);
390
- });
391
- jQuery("#ct_proceed_check_button").click(function(){
392
- ct_start_check(true);
393
- });
394
-
395
- // Pause the check
396
- jQuery('#ct_pause').on('click', function(){
397
- ct_pause = true;
398
- var ct_check = {
399
- 'accurate': ct_accurate_check,
400
- 'from' : ct_date_from,
401
- 'till' : ct_date_till
402
- };
403
- document.cookie = 'ct_paused_comments_check=' + JSON.stringify(ct_check) + '; path=/';
404
- });
405
-
406
- jQuery("#ct_insert_comments").click(function(){
407
- ct_insert_comments();
408
- });
409
-
410
- jQuery("#ct_delete_comments").click(function(){
411
- ct_insert_comments(true);
412
- });
413
-
414
- // Delete all spam comments
415
- jQuery("#ct_delete_all").click(function(){
416
-
417
- if (!confirm(ctCommentsCheck.ct_confirm_deletion_all))
418
- return false;
419
-
420
- jQuery('.ct_to_hide').hide();
421
- jQuery('#ct_checking_status').hide();
422
- jQuery('#ct_search_info').hide();
423
- jQuery('#ct_preloader').show();
424
- jQuery('#ct_deleting_message').show();
425
- jQuery('#ct_stop_deletion').show();
426
- jQuery("html, body").animate({ scrollTop: 0 }, "slow");
427
- ct_delete_all();
428
- });
429
- jQuery("#ct_delete_checked").click(function(){
430
- if (!confirm(ctCommentsCheck.ct_confirm_deletion_checked))
431
- return false;
432
- ct_delete_checked();
433
- });
434
-
435
- jQuery("#ct_stop_deletion").click(function(){
436
- location.href='edit-comments.php?page=ct_check_spam';
437
- });
438
-
439
- jQuery(".cleantalk_delete_button").click(function(){
440
- id = jQuery(this).attr("data-id");
441
- ids=Array();
442
- ids[0]=id;
443
- var data = {
444
- 'action': 'ajax_delete_checked',
445
- 'security': ct_ajax_nonce,
446
- 'ids':ids
447
- };
448
- jQuery.ajax({
449
- type: "POST",
450
- url: ajaxurl,
451
- data: data,
452
- success: function(msg){
453
- ct_close_animate=false;
454
- jQuery("#comment-"+id).hide();
455
- jQuery("#comment-"+id).remove();
456
- ct_close_animate=true;
457
- }
458
- });
459
- });
460
-
461
- jQuery(".cleantalk_delete_button").click(function(){
462
- id = jQuery(this).attr("data-id");
463
- animate_comment(0.3, id);
464
- });
465
-
466
- //Show/hide action on mouse over/out
467
- jQuery(".cleantalk_comment").mouseover(function(){
468
- id = jQuery(this).attr("data-id");
469
- jQuery("#cleantalk_button_set_"+id).show();
470
- });
471
- jQuery(".cleantalk_comment").mouseout(function(){
472
- id = jQuery(this).attr("data-id");
473
- jQuery("#cleantalk_button_set_"+id).hide();
474
- });
475
-
476
- //Approve button
477
- jQuery(".cleantalk_delete_from_list_button").click(function(){
478
- var ct_id = jQuery(this).attr("data-id");
479
-
480
- // Approving
481
- var data = {
482
- 'action': 'ajax_ct_approve_comment',
483
- 'security': ct_ajax_nonce,
484
- 'id': ct_id
485
- };
486
- jQuery.ajax({
487
- type: "POST",
488
- url: ajaxurl,
489
- data: data,
490
- success: function(msg){
491
- jQuery("#comment-"+ct_id).fadeOut('slow', function(){
492
- jQuery("#comment-"+ct_id).remove();
493
- });
494
- },
495
- });
496
-
497
- // Positive feedback
498
- var data = {
499
- 'action': 'ct_feedback_comment',
500
- 'security': ct_ajax_nonce,
501
- 'comment_id': ct_id,
502
- 'comment_status': 'approve'
503
- };
504
- jQuery.ajax({
505
- type: "POST",
506
- url: ajaxurl,
507
- data: data,
508
- success: function(msg){
509
- if(msg == 1){
510
- // Success
511
- }
512
- if(msg == 0){
513
- // Error occurred
514
- }
515
- if(msg == 'no_hash'){
516
- // No hash
517
- }
518
- },
519
- error: function(jqXHR, textStatus, errorThrown) {
520
-
521
- },
522
- timeout: 5000
523
- });
524
- });
525
- if(ctCommentsCheck.start === '1'){
526
- document.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/';
527
- jQuery('#ct_check_spam_button').click();
528
- }
529
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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substring(0,e.indexOf("%s",0)),_=e.substring(e.indexOf("%s",0)+2,e.length);e=c+arguments[t]+_}return e}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e={action:"ajax_clear_comments",security:ct_ajax_nonce};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){if(1!=ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){if(e=jQuery.parseJSON(e),parseInt(e.error))if(ct_working=!1,confirm(e.error_message+". Do you want to proceed?"))ct_send_comments();else{var t="edit-comments.php?page=ct_check_spam";0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t}else if(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause){1==parseInt(e.end)&&(document.cookie="ct_paused_comments_check=0; path=/"),ct_working=!1,jQuery("#ct_working_message").hide();t="edit-comments.php?page=ct_check_spam";0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t}else if(0==parseInt(e.end)){ct_comments_checked=+ct_comments_checked+ +e.checked,ct_comments_spam=+ct_comments_spam+ +e.spam,ct_comments_bad=+ct_comments_bad+ +e.bad,ct_unchecked=ct_comments_total-ct_comments_checked-ct_comments_bad;var c=(c=String(ctCommentsCheck.ct_status_string)).printf(ct_comments_total,ct_comments_checked,ct_comments_spam,ct_comments_bad);0<parseInt(ct_comments_spam)&&(c+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(c),jQuery("#ct_error_message").hide(),+ct_comments_total<ct_comments_checked+ct_comments_bad&&(document.cookie="ct_comments_start_check=1; path=/",document.cookie="ct_comments_safe_check=1; path=/",location.href="edit-comments.php?page=ct_check_spam"),ct_send_comments()}},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_send_comments(),3e3)},timeout:25e3})}}function ct_show_info(){if(ct_working){if(1==ct_cooling_down_flag)return jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),void jQuery("#ct_cooling_notice").show();if(jQuery("#ct_cooling_notice").hide(),setTimeout(ct_show_info,3e3),!ct_comments_total){var e={action:"ajax_info_comments",security:ct_ajax_nonce};ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_comments_total=e.total,ct_comments_spam=e.spam,ct_comments_checked=e.checked,ct_comments_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_show_info(),3e3)},timeout:15e3})}}}function ct_insert_comments(t){var e={action:"ajax_insert_comments",security:ct_ajax_nonce};(t=t||null)&&(e.delete=!0),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){t?alert(ctCommentsCheck.ct_comments_deleted+" "+e+" "+ctCommentsCheck.ct_comments_added_after):alert(ctCommentsCheck.ct_comments_added+" "+e+" "+ctCommentsCheck.ct_comments_added_after)}})}function ct_delete_all(){var e={action:"ajax_delete_all",security:ct_ajax_nonce};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_delete_all()):location.href="edit-comments.php?page=ct_check_spam"},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_delete_all(),3e3)},timeout:25e3})}function ct_delete_checked(){ids=Array();var e=0;jQuery("input[id^=cb-select-][id!=cb-select-all-1]").each(function(){jQuery(this).prop("checked")&&(ids[e]=jQuery(this).attr("id").substring(10),e++)});var t={action:"ajax_delete_checked",security:ct_ajax_nonce,ids:ids};jQuery.ajax({type:"POST",url:ajaxurl,data:t,success:function(e){location.href="edit-comments.php?page=ct_check_spam"},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_delete_checked(),3e3)},timeout:15e3})}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}jQuery(document).ready(function(){jQuery("#ct_allow_date_range").data({depended:".ct_date",state:!1}),ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range, #ct_accurate_check").on("change",function(){ct_toggle_depended(jQuery(this))});var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"yy-mm-dd",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),_=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,_)}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_info(),ct_send_comments()):ct_clear_comments())}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_comments_check=0; path=/"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_comments_check="+JSON.stringify(e)+"; path=/"}),jQuery("#ct_insert_comments").click(function(){ct_insert_comments()}),jQuery("#ct_delete_comments").click(function(){ct_insert_comments(!0)}),jQuery("#ct_delete_all").click(function(){if(!confirm(ctCommentsCheck.ct_confirm_deletion_all))return!1;jQuery(".ct_to_hide").hide(),jQuery("#ct_checking_status").hide(),jQuery("#ct_search_info").hide(),jQuery("#ct_preloader").show(),jQuery("#ct_deleting_message").show(),jQuery("#ct_stop_deletion").show(),jQuery("html, body").animate({scrollTop:0},"slow"),ct_delete_all()}),jQuery("#ct_delete_checked").click(function(){if(!confirm(ctCommentsCheck.ct_confirm_deletion_checked))return!1;ct_delete_checked()}),jQuery("#ct_stop_deletion").click(function(){location.href="edit-comments.php?page=ct_check_spam"}),jQuery(".cleantalk_delete_button").click(function(){id=jQuery(this).attr("data-id"),ids=Array(),ids[0]=id;var e={action:"ajax_delete_checked",security:ct_ajax_nonce,ids:ids};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_close_animate=!1,jQuery("#comment-"+id).hide(),jQuery("#comment-"+id).remove(),ct_close_animate=!0}})}),jQuery(".cleantalk_delete_button").click(function(){id=jQuery(this).attr("data-id"),animate_comment(.3,id)}),jQuery(".cleantalk_comment").mouseover(function(){id=jQuery(this).attr("data-id"),jQuery("#cleantalk_button_set_"+id).show()}),jQuery(".cleantalk_comment").mouseout(function(){id=jQuery(this).attr("data-id"),jQuery("#cleantalk_button_set_"+id).hide()}),jQuery(".cleantalk_delete_from_list_button").click(function(){var t=jQuery(this).attr("data-id"),e={action:"ajax_ct_approve_comment",security:ct_ajax_nonce,id:t};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){jQuery("#comment-"+t).fadeOut("slow",function(){jQuery("#comment-"+t).remove()})}});e={action:"ct_feedback_comment",security:ct_ajax_nonce,comment_id:t,comment_status:"approve"};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){},error:function(e,t,c){},timeout:5e3})}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/",jQuery("#ct_check_spam_button").click())});
2
+ //# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
js/cleantalk-comments-checkspam.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-comments-checkspam.js"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","document","cookie","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_insert_comments","delete_comments","alert","ct_comments_deleted","ct_comments_added_after","ct_comments_added","ct_delete_all","ct_delete_checked","ids","Array","cnt","each","prop","attr","ct_toggle_depended","obj","secondary","depended","removeProp","ready","state","val","on","dates","datepicker","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","is","click","ct_check","accurate","from","till","JSON","stringify","ct_confirm_deletion_all","animate","scrollTop","ct_confirm_deletion_checked","remove","mouseover","mouseout","ct_id","fadeOut","comment_id","comment_status","start","Date","toUTCString"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,IAKVS,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAg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,sCAAwC,IAAI6E,KAAK,GAAGC,cAAgB,WACtF1G,OAAO,yBAAyBsF","file":"cleantalk-comments-checkspam.min.js","sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\t\n\tvar data = {\n\t\t'action': 'ajax_clear_comments',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag == true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked = +ct_comments_checked + +msg.checked;\n\t\t\t\t\tct_comments_spam = +ct_comments_spam + +msg.spam;\n\t\t\t\t\tct_comments_bad = +ct_comments_bad + +msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_total, ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/';\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_safe_check=1; path=/';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\t\n\t\t\n\t\tsetTimeout(ct_show_info, 3000);\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\nfunction ct_insert_comments(delete_comments){\n\n delete_comments = delete_comments || null;\n\n\tvar data = {\n\t\t'action': 'ajax_insert_comments',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tif(delete_comments)\n\t\tdata['delete'] = true;\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tif(delete_comments)\n\t\t\t\talert(ctCommentsCheck.ct_comments_deleted + ' ' + msg + ' ' + ctCommentsCheck.ct_comments_added_after);\n\t\t\telse\n\t\t\t\talert(ctCommentsCheck.ct_comments_added + ' ' + msg + ' ' + ctCommentsCheck.ct_comments_added_after);\n\t\t}\n\t});\n}\nfunction ct_delete_all(){\n\t\n\tvar data = {\n\t\t'action': 'ajax_delete_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tif(msg>0){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_delete_all();\n\t\t\t}else{\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\t\t\t\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_delete_all(), 3000); \n\t\t},\n\t\ttimeout: 25000\n\t});\n}\nfunction ct_delete_checked(){\n\t\n\tids=Array();\n\tvar cnt=0;\n\tjQuery('input[id^=cb-select-][id!=cb-select-all-1]').each(function(){\n\t\tif(jQuery(this).prop('checked')){\n\t\t\tids[cnt]=jQuery(this).attr('id').substring(10);\n\t\t\tcnt++;\n\t\t}\n\t});\n\tvar data = {\n\t\t'action': 'ajax_delete_checked',\n\t\t'security': ct_ajax_nonce,\n\t\t'ids':ids\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_delete_checked(), 3000); \n\t\t},\n\t\ttimeout: 15000\n\t});\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\njQuery(document).ready(function(){\n\t\n\t// Setting dependences\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\n\t\tct_toggle_depended(jQuery(this));\n\t});\n\t\t\t\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'yy-mm-dd',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val(),\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_comments_check=' + JSON.stringify(ct_check) + '; path=/';\n\t});\n\t\n\tjQuery(\"#ct_insert_comments\").click(function(){\n\t\tct_insert_comments();\n\t});\n\t\n\tjQuery(\"#ct_delete_comments\").click(function(){\n\t\tct_insert_comments(true);\n\t});\n\t\n\t// Delete all spam comments\n\tjQuery(\"#ct_delete_all\").click(function(){\n\t\t\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_deletion_all))\n\t\t\treturn false;\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_checking_status').hide();\n\t\tjQuery('#ct_search_info').hide();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_deleting_message').show();\n\t\tjQuery('#ct_stop_deletion').show();\n\t\tjQuery(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n\t\tct_delete_all();\n\t});\n\tjQuery(\"#ct_delete_checked\").click(function(){\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_deletion_checked))\n\t\t\treturn false;\n\t\tct_delete_checked();\n\t});\n\t\n\tjQuery(\"#ct_stop_deletion\").click(function(){\n\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t});\n\t\n\tjQuery(\".cleantalk_delete_button\").click(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tids=Array();\n\t\tids[0]=id;\n\t\tvar data = {\n\t\t\t'action': 'ajax_delete_checked',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'ids':ids\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_close_animate=false;\n\t\t\t\tjQuery(\"#comment-\"+id).hide();\n\t\t\t\tjQuery(\"#comment-\"+id).remove();\n\t\t\t\tct_close_animate=true;\n\t\t\t}\n\t\t});\n\t});\n\t\n\tjQuery(\".cleantalk_delete_button\").click(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tanimate_comment(0.3, id);\n\t});\n\t\n\t//Show/hide action on mouse over/out\n\tjQuery(\".cleantalk_comment\").mouseover(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tjQuery(\"#cleantalk_button_set_\"+id).show();\n\t});\n\tjQuery(\".cleantalk_comment\").mouseout(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tjQuery(\"#cleantalk_button_set_\"+id).hide();\n\t});\n\t\n\t//Approve button\t\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tvar ct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_comment',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'comment_id': ct_id,\n\t\t\t'comment_status': 'approve'\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t});\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n});"]}
js/cleantalk-comments-editscreen.js DELETED
@@ -1,137 +0,0 @@
1
- function ct_is_email(str){
2
- return str.search(/.*@.*\..*/);
3
- }
4
- function ct_is_ip(str){
5
- return str.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
6
- }
7
-
8
- jQuery(document).ready(function(){
9
-
10
- /* Shows "Find spam users" button */
11
- jQuery('#post-query-submit').after('<a href="edit-comments.php?page=ct_check_spam" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctCommentsScreen.spambutton_text+'</a>&nbsp;');
12
-
13
- /* Shows link to blacklists near every email and IP address */
14
- if(parseInt(ctCommentsScreen.ct_show_check_links))
15
- jQuery('.column-author a, .comment-author a').each(function(){
16
- var ct_curr_str = jQuery(this).html();
17
- if(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){
18
- jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+ct_curr_str+'" target="_blank" title="https://cleantalk.org/blacklists/'+ct_curr_str+'" class="ct_link_new_tab"><img src="'+ctCommentsScreen.ct_img_src_new_tab+'"></a>');
19
- }
20
- });
21
-
22
- /* Feedback for comments */
23
- var ct_comment_id;
24
-
25
- // For approved
26
- jQuery('span.approve').on('click', function(){
27
- var result = jQuery(this).children('a').attr('href');
28
- result = result.match(/^comment\.php\?.*c=(\d*).*/);
29
- ct_comment_id = result[1];
30
- undo_comment_id = ct_comment_id;
31
- ct_send_feedback_request(ct_comment_id, 'approve', 0);
32
- });
33
-
34
- // For unapprove
35
- jQuery('span.unapprove').on('click', function(){
36
- var result = jQuery(this).children('a').attr('href');
37
- result = result.match(/^comment\.php\?.*c=(\d*).*/);
38
- ct_comment_id = result[1];
39
- undo_comment_id = ct_comment_id;
40
- ct_send_feedback_request(ct_comment_id, 'spam', 0);
41
- });
42
-
43
- // For spammed
44
- jQuery('span.spam').on('click', function(){
45
- var result = jQuery(this).children('a').attr('href');
46
- result = result.match(/^comment\.php\?.*c=(\d*).*/);
47
- ct_comment_id = result[1];
48
- undo_comment_id = ct_comment_id;
49
- ct_send_feedback_request(ct_comment_id, 'spam', 0);
50
-
51
- setTimeout(function(){
52
- jQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){
53
- var result = jQuery(this).attr('href');
54
- result = result.match(/^comment\.php\?.*&c=(\d*).*/);
55
- ct_comment_id = result[1];
56
- ct_send_feedback_request(ct_comment_id, 'approve', 1);
57
- });
58
- }, 202);
59
-
60
- });
61
-
62
- // For unspammed
63
- jQuery('span.unspam').on('click', function(){
64
- var result = jQuery(this).children('a').attr('href');
65
- result = result.match(/^comment\.php\?.*c=(\d*).*/);
66
- ct_comment_id = result[1];
67
- ct_send_feedback_request(ct_comment_id, 'approve', 0);
68
- });
69
-
70
- // For untrashed
71
- jQuery('span.untrash a').on('click', function(){
72
- var result = jQuery(this).attr('href');
73
- result = result.match(/^comment\.php\?.*c=(\d*).*/);
74
- ct_comment_id = result[1];
75
- feedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);
76
- });
77
- });
78
-
79
- // Send feedback to backend
80
- function ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){
81
-
82
- var data = {
83
- 'action': 'ct_feedback_comment',
84
- 'security': ctCommentsScreen.ct_ajax_nonce,
85
- 'comment_id': ct_comment_id,
86
- 'comment_status': ct_comment_status
87
- };
88
-
89
- jQuery.ajax({
90
- type: "POST",
91
- url: ajaxurl,
92
- data: data,
93
- success: function(msg){
94
- ct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);
95
- },
96
- error: function(jqXHR, textStatus, errorThrown) {
97
- console.log(jqXHR);
98
- console.log(textStatus);
99
- console.log(errorThrown);
100
- },
101
- timeout: 5000
102
- });
103
- }
104
-
105
- // Outputs CT message about feedback
106
- function ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){
107
- if(ct_result == 1){
108
- if(ct_comment_status == 'approve' && !ct_undo){
109
- jQuery('tr#comment-'+ct_comment_id)
110
- .html('')
111
- .show()
112
- .append("<td colspan='5'></td>").children('td')
113
- .css('background', 'rgba(110,240,110,0.7)')
114
- .append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg_whitelisted+" "+ctCommentsScreen.ct_feedback_msg+"</div>");
115
- }
116
- if(ct_comment_status == 'spam'){
117
- if(jQuery('tr').is('#undo-'+ct_comment_id)){
118
- jQuery('tr#undo-'+ct_comment_id)
119
- .css('background', 'rgba(240,110,110,0.7)');
120
- jQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')
121
- .append(" "+ctCommentsScreen.ct_feedback_msg_blacklisted+" "+ctCommentsScreen.ct_feedback_msg);
122
- }else{
123
- jQuery('tr#comment-'+ct_comment_id)
124
- .html('')
125
- .show()
126
- .css('background', 'rgba(240,110,110,0.7)')
127
- .append("<td colspan='5'></td>").children('td')
128
- .append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg_blacklisted+" "+ctCommentsScreen.ct_feedback_msg+"</div>");
129
- }
130
- }
131
- }
132
- if(ct_result == 0){
133
- // Error occurred
134
- }if(ct_result == 'no_hash'){
135
- // No hash for this comment
136
- }
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-comments-editscreen.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function ct_is_email(e){return e.search(/.*@.*\..*/)}function ct_is_ip(e){return e.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}function ct_send_feedback_request(t,c,n){var e={action:"ct_feedback_comment",security:ctCommentsScreen.ct_ajax_nonce,comment_id:t,comment_status:c};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_feedback_message_output(t,c,e,n)},error:function(e,t,c){console.log(e),console.log(t),console.log(c)},timeout:5e3})}function ct_feedback_message_output(e,t,c,n){1==c&&("approve"!=t||n||jQuery("tr#comment-"+e).html("").show().append("<td colspan='5'></td>").children("td").css("background","rgba(110,240,110,0.7)").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg_whitelisted+" "+ctCommentsScreen.ct_feedback_msg+"</div>"),"spam"==t&&(jQuery("tr").is("#undo-"+e)?(jQuery("tr#undo-"+e).css("background","rgba(240,110,110,0.7)"),jQuery("tr#undo-"+e+" div.spam-undo-inside").append(" "+ctCommentsScreen.ct_feedback_msg_blacklisted+" "+ctCommentsScreen.ct_feedback_msg)):jQuery("tr#comment-"+e).html("").show().css("background","rgba(240,110,110,0.7)").append("<td colspan='5'></td>").children("td").append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg_blacklisted+" "+ctCommentsScreen.ct_feedback_msg+"</div>")))}jQuery(document).ready(function(){var t;jQuery("#post-query-submit").after('<a href="edit-comments.php?page=ct_check_spam" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+"&nbsp;"+ctCommentsScreen.spambutton_text+"</a>&nbsp;"),parseInt(ctCommentsScreen.ct_show_check_links)&&jQuery(".column-author a, .comment-author a").each(function(){var e=jQuery(this).html();-1==ct_is_email(e)&&-1==ct_is_ip(e)||jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+e+'" target="_blank" title="https://cleantalk.org/blacklists/'+e+'" class="ct_link_new_tab"><img src="'+ctCommentsScreen.ct_img_src_new_tab+'"></a>')}),jQuery("span.approve").on("click",function(){var e=jQuery(this).children("a").attr("href");e=e.match(/^comment\.php\?.*c=(\d*).*/),t=e[1],ct_send_feedback_request(undo_comment_id=t,"approve",0)}),jQuery("span.unapprove").on("click",function(){var e=jQuery(this).children("a").attr("href");e=e.match(/^comment\.php\?.*c=(\d*).*/),t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0)}),jQuery("span.spam").on("click",function(){var e=jQuery(this).children("a").attr("href");e=e.match(/^comment\.php\?.*c=(\d*).*/),t=e[1],ct_send_feedback_request(undo_comment_id=t,"spam",0),setTimeout(function(){jQuery("tr#undo-"+t+" span.unspam a").click(function(){var e=jQuery(this).attr("href");e=e.match(/^comment\.php\?.*&c=(\d*).*/),ct_send_feedback_request(t=e[1],"approve",1)})},202)}),jQuery("span.unspam").on("click",function(){var e=jQuery(this).children("a").attr("href");e=e.match(/^comment\.php\?.*c=(\d*).*/),ct_send_feedback_request(t=e[1],"approve",0)}),jQuery("span.untrash a").on("click",function(){var e=jQuery(this).attr("href");e=e.match(/^comment\.php\?.*c=(\d*).*/),t=e[1],feedback_result=ct_send_feedback_request(t,"approve",0)})});
2
+ //# sourceMappingURL=cleantalk-comments-editscreen.min.js.map
js/cleantalk-comments-editscreen.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-comments-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg_whitelisted","ct_feedback_msg","is","ct_feedback_msg_blacklisted","document","ready","after","ctAdminCommon","logo_small_colored","spambutton_text","parseInt","ct_show_check_links","each","ct_curr_str","this","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCA2EnB,SAASE,yBAAyBC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unction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\t\n\t/* Shows \"Find spam users\" button */\n\tjQuery('#post-query-submit').after('<a href=\"edit-comments.php?page=ct_check_spam\" class=\"button\" style=\"margin:1px 0 0 0; display: inline-block;\">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctCommentsScreen.spambutton_text+'</a>&nbsp;');\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_whitelisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"]}
js/{cleantalk-dashboard-widget--google-charts.js → cleantalk-dashboard-widget--google-charts.min.js} RENAMED
File without changes
js/cleantalk-dashboard-widget.js DELETED
@@ -1,60 +0,0 @@
1
- jQuery(document).ready(function(){
2
-
3
- // Set "refresh" link handler
4
- jQuery(".ct_widget_refresh_link").on('click', function(){
5
- jQuery('.ct_preloader').show();
6
- setTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);
7
- setTimeout(function(){jQuery("#ct_refresh_form").submit();}, 2500);
8
- });
9
-
10
- if(location.hash == '#ct_widget')
11
- setTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);
12
-
13
- // Fixing default wrapper style
14
- jQuery("#ct_widget_wrapper").parent().css('padding', 0);
15
-
16
- // Chart
17
- var ct_chart = document.getElementById('ct_widget_chart'),
18
- locale = navigator.language || navigator.userLanguage;
19
-
20
- function ctParseData(date){
21
- var date_formatter = new Intl.DateTimeFormat(locale, {
22
- month: "short",
23
- day: "numeric"
24
- });
25
- date.sort(function(a,b){
26
- return new Date(a[0]) - new Date(b[0])
27
- });
28
- date.forEach(function(d){
29
- d[0] = Date.parse(d[0]);
30
- d[0] = date_formatter.format(d[0]);
31
- });
32
- }
33
-
34
- google.charts.load('current', {packages:['corechart', 'bar']});
35
- google.charts.setOnLoadCallback(drawStuff);
36
-
37
- function drawStuff() {
38
- var data = new google.visualization.DataTable();
39
- data.addColumn('string', 'Spam Blocked');
40
- data.addColumn('number', 'Frequency');
41
-
42
- ctParseData(apbctDashboardWidget.data);
43
- data.addRows(apbctDashboardWidget.data);
44
-
45
- var options = {
46
- width: jQuery(".ct_widget_block").first().width(),
47
- height: 300,
48
- colors: ['steelblue'],
49
- legend: 'none',
50
- bar: {groupWidth: '95%'},
51
- chartArea:{left:30,top:20,width:'93%',height:'80%'},
52
- vAxis: { gridlines: { count: 5 } }
53
- };
54
-
55
- if(ct_chart){
56
- var chart = new google.visualization.ColumnChart(ct_chart);
57
- chart.draw(data, options);
58
- }
59
- };
60
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-dashboard-widget.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(document).ready(function(){jQuery(".ct_widget_refresh_link").on("click",function(){jQuery(".ct_preloader").show(),setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),setTimeout(function(){jQuery("#ct_refresh_form").submit()},2500)}),"#ct_widget"==location.hash&&setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),jQuery("#ct_widget_wrapper").parent().css("padding",0);var a=document.getElementById("ct_widget_chart"),o=navigator.language||navigator.userLanguage;google.charts.load("current",{packages:["corechart","bar"]}),google.charts.setOnLoadCallback(function(){var t=new google.visualization.DataTable;t.addColumn("string","Spam Blocked"),t.addColumn("number","Frequency"),function(t){var e=new Intl.DateTimeFormat(o,{month:"short",day:"numeric"});t.sort(function(t,e){return new Date(t[0])-new Date(e[0])}),t.forEach(function(t){t[0]=Date.parse(t[0]),t[0]=e.format(t[0])})}(apbctDashboardWidget.data),t.addRows(apbctDashboardWidget.data);var e={width:jQuery(".ct_widget_block").first().width(),height:300,colors:["steelblue"],legend:"none",bar:{groupWidth:"95%"},chartArea:{left:30,top:20,width:"93%",height:"80%"},vAxis:{gridlines:{count:5}}};if(a){new google.visualization.ColumnChart(a).draw(t,e)}})});
2
+ //# sourceMappingURL=cleantalk-dashboard-widget.min.js.map
js/cleantalk-dashboard-widget.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-dashboard-widget.js"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","ctParseData","apbctDashboardWidget","addRows","options","width","first","height","colors","legend","bar","groupWidth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MAAO,KAG9B,GAAG5C,EAAS,CACC,IAAIM,OAAOM,cAAciC,YAAY7C,GAC3C8C,KAAKnC,EAAMqB","file":"cleantalk-dashboard-widget.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"]}
js/cleantalk-debug-ajax.js DELETED
@@ -1,18 +0,0 @@
1
- jQuery(document).ready(function(){
2
-
3
- console.log('CT debug');
4
-
5
- // Debug. Console all AJAX requests.
6
- jQuery(document).ajaxComplete(function(event, xhr, settings, data) {
7
- console.log("Success!")
8
- console.log('Event:\n');
9
- console.log(event);
10
- console.log('Response:\n');
11
- console.log(xhr);
12
- console.log('Request settings:\n');
13
- console.log(settings);
14
- console.log('Data:\n');
15
- console.log(data);
16
- });
17
-
18
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-debug-ajax.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(document).ready(function(){console.log("CT debug"),jQuery(document).ajaxComplete(function(o,e,n,l){console.log("Success!"),console.log("Event:\n"),console.log(o),console.log("Response:\n"),console.log(e),console.log("Request settings:\n"),console.log(n),console.log("Data:\n"),console.log(l)})});
2
+ //# sourceMappingURL=cleantalk-debug-ajax.min.js.map
js/cleantalk-debug-ajax.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-debug-ajax.js"],"names":["jQuery","document","ready","console","log","ajaxComplete","event","xhr","settings","data"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAEtBC,QAAQC,IAAI,YAGZJ,OAAOC,UAAUI,aAAa,SAASC,EAAOC,EAAKC,EAAUC,GAC5DN,QAAQC,IAAI,YACZD,QAAQC,IAAI,YACZD,QAAQC,IAAIE,GACZH,QAAQC,IAAI,eACZD,QAAQC,IAAIG,GACZJ,QAAQC,IAAI,uBACZD,QAAQC,IAAII,GACZL,QAAQC,IAAI,WACZD,QAAQC,IAAIK","file":"cleantalk-debug-ajax.min.js","sourcesContent":["jQuery(document).ready(function(){\n\n\tconsole.log('CT debug');\n\n\t// Debug. Console all AJAX requests.\n\tjQuery(document).ajaxComplete(function(event, xhr, settings, data) {\n\t\tconsole.log(\"Success!\")\n\t\tconsole.log('Event:\\n');\n\t\tconsole.log(event);\n\t\tconsole.log('Response:\\n');\n\t\tconsole.log(xhr);\n\t\tconsole.log('Request settings:\\n');\n\t\tconsole.log(settings);\n\t\tconsole.log('Data:\\n');\n\t\tconsole.log(data);\n\t});\n\t\t\n});"]}
js/cleantalk-public-admin.js DELETED
@@ -1,89 +0,0 @@
1
- jQuery(document).ready(function(){
2
-
3
- // Set background-color similar to parents
4
- jQuery('.ct_comment_info').parents().each(function() {
5
- if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){
6
- jQuery('.ct_comment_info').css('background', e);
7
- return false;
8
- }
9
- });
10
-
11
- // Set same float style with article
12
- var ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');
13
- jQuery('.ct_comment_info').css('float', ct_post_float);
14
-
15
- var ct_posts = jQuery('.ct_comment_info');
16
-
17
- jQuery(ct_posts).each(function(indx, elem){
18
- curr_elem = jQuery(elem);
19
- curr_elem.parent().prepend(curr_elem);
20
- });
21
-
22
- // Handler for buttons
23
- jQuery('.ct_this_is').on('click', function(){
24
-
25
- var ct_current_button = jQuery(this),
26
- ct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),
27
- ct_feedback_msg = jQuery('.ct_feedback_msg'),
28
- ct_comment_status;
29
-
30
- if(ct_current_button.hasClass('ct_this_is_spam'))
31
- ct_comment_status = 'spam';
32
- else
33
- ct_comment_status = 'approve';
34
-
35
- var data = {
36
- 'action': 'ct_feedback_comment',
37
- 'security': ctPublicAdmin.ct_ajax_nonce,
38
- 'comment_id': ct_current_button.attr('commentid'),
39
- 'comment_status': ct_comment_status,
40
- 'change_status': 1
41
- };
42
-
43
- jQuery.ajax({
44
- type: "POST",
45
- url: ctPublicAdmin.ajaxurl,
46
- data: data,
47
- success: function(msg){
48
- ct_current_button.hide();
49
- ct_current_button.siblings('span.ct_this_is').show();
50
-
51
- jQuery('.ct_feedback_result').hide();
52
- if(ct_comment_status == 'approve')
53
- jQuery('.ct_feedback_result_not_spam').show();
54
- else
55
- jQuery('.ct_feedback_result_spam').show();
56
-
57
- if(msg == 1){
58
- ct_feedback_msg.addClass('ct_feedback_success');
59
- ct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);
60
- }else if(msg == 0){
61
- // Error occurred
62
- ct_feedback_msg.addClass('ct_feedback_error');
63
- ct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);
64
- }else if(msg == 'no_hash'){
65
- // No hash for this comment
66
- ct_feedback_msg.addClass('ct_feedback_no_hash');
67
- ct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);
68
- }
69
- // Hidding feedback message for every message type
70
- ct_feedback_wrap.show();
71
- ct_feedback_wrap.css('display', 'inline-block');
72
-
73
- var ct_timeout_id = ct_feedback_wrap.data('interval_id');
74
- clearInterval(ct_timeout_id);
75
- ct_timeout_id = setTimeout(function(){
76
- ct_feedback_wrap.fadeOut(1000);
77
- }, 5000);
78
- ct_feedback_wrap.data('interval_id', ct_timeout_id);
79
- },
80
- error: function(jqXHR, textStatus, errorThrown) {
81
- console.log(jqXHR);
82
- console.log(textStatus);
83
- console.log(errorThrown);
84
- },
85
- timeout: 5000
86
- });
87
- });
88
-
89
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-public-admin.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ jQuery(document).ready(function(){jQuery(".ct_comment_info").parents().each(function(){if(0<(e=jQuery(this).css("background-color")).length&&"rgba(0, 0, 0, 0)"!=e)return jQuery(".ct_comment_info").css("background",e),!1});var c=jQuery(".ct_comment_info").prev().last().css("float");jQuery(".ct_comment_info").css("float",c);var t=jQuery(".ct_comment_info");jQuery(t).each(function(e,c){curr_elem=jQuery(c),curr_elem.parent().prepend(curr_elem)}),jQuery(".ct_this_is").on("click",function(){var t,a=jQuery(this),s=jQuery(this).siblings(".ct_feedback_wrap"),r=jQuery(".ct_feedback_msg");t=a.hasClass("ct_this_is_spam")?"spam":"approve";var e={action:"ct_feedback_comment",security:ctPublicAdmin.ct_ajax_nonce,comment_id:a.attr("commentid"),comment_status:t,change_status:1};jQuery.ajax({type:"POST",url:ctPublicAdmin.ajaxurl,data:e,success:function(e){a.hide(),a.siblings("span.ct_this_is").show(),jQuery(".ct_feedback_result").hide(),"approve"==t?jQuery(".ct_feedback_result_not_spam").show():jQuery(".ct_feedback_result_spam").show(),1==e?(r.addClass("ct_feedback_success"),r.html(ctPublicAdmin.ct_feedback_msg)):0==e?(r.addClass("ct_feedback_error"),r.html(ctPublicAdmin.ct_feedback_error)):"no_hash"==e&&(r.addClass("ct_feedback_no_hash"),r.html(ctPublicAdmin.ct_feedback_no_hash)),s.show(),s.css("display","inline-block");var c=s.data("interval_id");clearInterval(c),c=setTimeout(function(){s.fadeOut(1e3)},5e3),s.data("interval_id",c)},error:function(e,c,t){console.log(e),console.log(c),console.log(t)},timeout:5e3})})});
2
+ //# sourceMappingURL=cleantalk-public-admin.min.js.map
js/cleantalk-public-admin.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-public-admin.js"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_comment_status","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGvBF,OAAO,oBAAoBG,UAAUC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,MAAMC,IAAI,qBAAqBC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,oBAAoBO,IAAI,aAAcF,IACtC,IAKT,IAAII,EAAgBT,OAAO,oBAAoBU,OAAOC,OAAOJ,IAAI,SACjEP,OAAO,oBAAoBO,IAAI,QAASE,GAExC,IAAIG,EAAWZ,OAAO,oBAEtBA,OAAOY,GAAUR,KAAK,SAASS,EAAMC,GACpCC,UAAYf,OAAOc,GACnBC,UAAUC,SAASC,QAAQF,aAI5Bf,OAAO,eAAekB,GAAG,QAAS,WAEjC,IAGCC,EAHGC,EAAoBpB,OAAOM,MAC9Be,EAAmBrB,OAAOM,MAAMgB,SAAS,qBACzCC,EAAkBvB,OAAO,oBAIzBmB,EADEC,EAAkBI,SAAS,mBACT,OAEA,UAErB,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,cAAcC,cAC1BC,WAAcV,EAAkBW,KAAK,aACrCC,eAAkBb,EAClBc,cAAiB,GAGlBjC,OAAOkC,KAAK,CACXC,KAAM,OACNC,IAAKR,cAAcS,QACnBZ,KAAMA,EACNa,QAAS,SAASC,GACjBnB,EAAkBoB,OAClBpB,EAAkBE,SAAS,mBAAmBmB,OAE9CzC,OAAO,uBAAuBwC,OACN,WAArBrB,EACFnB,OAAO,gCAAgCyC,OAEvCzC,OAAO,4BAA4ByC,OAE1B,GAAPF,GACFhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAcL,kBACpB,GAAPgB,GAERhB,EAAgBmB,SAAS,qBACzBnB,EAAgBoB,KAAKf,cAAcgB,oBACpB,WAAPL,IAERhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAciB,sBAGpCxB,EAAiBoB,OACjBpB,EAAiBd,IAAI,UAAW,gBAEhC,IAAIuC,EAAgBzB,EAAiBI,KAAK,eAC1CsB,cAAcD,GACdA,EAAgBE,WAAW,WAC1B3B,EAAiB4B,QAAQ,MACvB,KACH5B,EAAiBI,KAAK,cAAeqB,IAEtCI,MAAO,SAASC,EAAOC,EAAYC,GAClCC,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbG,QAAS","file":"cleantalk-public-admin.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t});\n\t\n});"]}
js/cleantalk-users-checkspam.js DELETED
@@ -1,541 +0,0 @@
1
- // Printf for JS
2
- String.prototype.printf = function(){
3
- var formatted = this;
4
- for( var arg in arguments ) {
5
- var before_formatted = formatted.substring(0, formatted.indexOf("%s", 0));
6
- var after_formatted = formatted.substring(formatted.indexOf("%s", 0)+2, formatted.length);
7
- formatted = before_formatted + arguments[arg] + after_formatted;
8
- }
9
- return formatted;
10
- };
11
-
12
- // Flags
13
- var ct_working = false,
14
- ct_new_check = true,
15
- ct_cooling_down_flag = false,
16
- ct_close_animate = true,
17
- ct_accurate_check = false,
18
- ct_pause = false,
19
- ct_prev_accurate = ctUsersCheck.ct_prev_accurate,
20
- ct_prev_from = ctUsersCheck.ct_prev_from,
21
- ct_prev_till = ctUsersCheck.ct_prev_till;
22
- // Settings
23
- var ct_cool_down_time = 90000,
24
- ct_requests_counter = 0,
25
- ct_max_requests = 60;
26
- // Variables
27
- var ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,
28
- ct_users_total = 0,
29
- ct_users_checked = 0,
30
- ct_users_spam = 0,
31
- ct_users_bad = 0,
32
- ct_unchecked = 'unset',
33
- ct_date_from = 0,
34
- ct_date_till = 0;
35
-
36
- function animate_comment(to,id){
37
- if(ct_close_animate){
38
- if(to==0.3){
39
- jQuery('#comment-'+id).fadeTo(200,to,function(){
40
- animate_comment(1,id)
41
- });
42
- }else{
43
- jQuery('#comment-'+id).fadeTo(200,to,function(){
44
- animate_comment(0.3,id)
45
- });
46
- }
47
- }else{
48
- ct_close_animate=true;
49
- }
50
- }
51
-
52
- function ct_clear_users(){
53
-
54
- var data = {
55
- 'action': 'ajax_clear_users',
56
- 'security': ct_ajax_nonce
57
- };
58
-
59
- jQuery.ajax({
60
- type: "POST",
61
- url: ajaxurl,
62
- data: data,
63
- success: function(msg){
64
- ct_show_users_info();
65
- ct_send_users();
66
- }
67
- });
68
- }
69
-
70
- //Continues the check after cooldown time
71
- //Called by ct_send_users();
72
- function ct_cooling_down_toggle(){
73
- ct_cooling_down_flag = false;
74
- ct_send_users();
75
- ct_show_users_info();
76
- }
77
-
78
- function ct_send_users(){
79
-
80
- if(ct_cooling_down_flag == true)
81
- return;
82
-
83
- if(ct_requests_counter >= ct_max_requests){
84
- setTimeout(ct_cooling_down_toggle, ct_cool_down_time);
85
- ct_requests_counter = 0;
86
- ct_cooling_down_flag = true;
87
- return;
88
- }else{
89
- ct_requests_counter++;
90
- }
91
-
92
- var data = {
93
- 'action': 'ajax_check_users',
94
- 'security': ct_ajax_nonce,
95
- 'new_check': ct_new_check,
96
- 'unchecked': ct_unchecked
97
- };
98
-
99
- if(ct_accurate_check)
100
- data['accurate_check'] = true;
101
-
102
- if(ct_date_from && ct_date_till){
103
- data['from'] = ct_date_from;
104
- data['till'] = ct_date_till;
105
- }
106
-
107
- jQuery.ajax({
108
- type: "POST",
109
- url: ajaxurl,
110
- data: data,
111
- success: function(msg){
112
-
113
- msg = jQuery.parseJSON(msg);
114
-
115
- if(parseInt(msg.error)){
116
- ct_working=false;
117
- if(!confirm(msg.error_message+". Do you want to proceed?")){
118
- var new_href = 'users.php?page=ct_check_users';
119
- if(ct_date_from != 0 && ct_date_till != 0)
120
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
121
- location.href = new_href;
122
- }else
123
- ct_send_users();
124
- }else{
125
- ct_new_check = false;
126
- if(parseInt(msg.end) == 1 || ct_pause == true){
127
- if(parseInt(msg.end) == 1)
128
- document.cookie = 'ct_paused_users_check=0; path=/';
129
- ct_working=false;
130
- jQuery('#ct_working_message').hide();
131
- var new_href = 'users.php?page=ct_check_users&ct_worked=1';
132
- if(ct_date_from != 0 && ct_date_till != 0)
133
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
134
- location.href = new_href;
135
- }else if(parseInt(msg.end) == 0){
136
- ct_users_checked += msg.checked;
137
- ct_users_spam += msg.spam;
138
- ct_users_bad += msg.bad;
139
- ct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;
140
- var status_string = String(ctUsersCheck.ct_status_string);
141
- var status_string = status_string.printf(ct_users_total, ct_users_checked, ct_users_spam, ct_users_bad);
142
- if(parseInt(ct_users_spam) > 0)
143
- status_string += ctUsersCheck.ct_status_string_warning;
144
- jQuery('#ct_checking_status').html(status_string);
145
- jQuery('#ct_error_message').hide();
146
- ct_send_users();
147
- }
148
- }
149
- },
150
- error: function(jqXHR, textStatus, errorThrown) {
151
- jQuery('#ct_error_message').show();
152
- jQuery('#cleantalk_ajax_error').html(textStatus);
153
- jQuery('#cleantalk_js_func').html('Check users');
154
- setTimeout(ct_send_users(), 3000);
155
- },
156
- timeout: 25000
157
- });
158
- }
159
- function ct_show_users_info(){
160
-
161
- if(ct_working){
162
-
163
- if(ct_cooling_down_flag == true){
164
- jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');
165
- jQuery('#ct_cooling_notice').show();
166
- return;
167
- }else{
168
- jQuery('#ct_cooling_notice').hide();
169
- }
170
-
171
- setTimeout(ct_show_users_info, 3000);
172
-
173
- if(!ct_users_total){
174
-
175
- var data = {
176
- 'action': 'ajax_info_users',
177
- 'security': ct_ajax_nonce
178
- };
179
-
180
- if(ct_date_from && ct_date_till){
181
- data['from'] = ct_date_from;
182
- data['till'] = ct_date_till;
183
- }
184
-
185
- jQuery.ajax({
186
- type: "POST",
187
- url: ajaxurl,
188
- data: data,
189
- success: function(msg){
190
- msg = jQuery.parseJSON(msg);
191
- jQuery('#ct_checking_status').html(msg.message);
192
- ct_users_total = msg.total;
193
- ct_users_spam = msg.spam;
194
- ct_users_checked = msg.checked;
195
- ct_users_bad = msg.bad;
196
- },
197
- error: function (jqXHR, textStatus, errorThrown){
198
- jQuery('#ct_error_message').show();
199
- jQuery('#cleantalk_ajax_error').html(textStatus);
200
- jQuery('#cleantalk_js_func').html('Show users');
201
- setTimeout(ct_show_users_info(), 3000);
202
- },
203
- timeout: 15000
204
- });
205
- }
206
- }
207
- }
208
- function ct_insert_users(delete_accounts = false){
209
-
210
- var data = {
211
- 'action': 'ajax_insert_users',
212
- 'security': ct_ajax_nonce
213
- };
214
-
215
- if(delete_accounts)
216
- data['delete'] = true;
217
-
218
- jQuery.ajax({
219
- type: "POST",
220
- url: ajaxurl,
221
- data: data,
222
- success: function(msg){
223
- if(delete_accounts)
224
- alert(ctUsersCheck.ct_deleted + ' ' + msg + ' ' + ctUsersCheck.ct_iusers);
225
- else
226
- alert(ctUsersCheck.ct_inserted + ' ' + msg + ' ' + ctUsersCheck.ct_iusers);
227
- }
228
- });
229
- }
230
- function ct_delete_all_users(){
231
-
232
- var data = {
233
- 'action': 'ajax_delete_all_users',
234
- 'security': ct_ajax_nonce
235
- };
236
-
237
- jQuery.ajax({
238
- type: "POST",
239
- url: ajaxurl,
240
- data: data,
241
- success: function(msg){
242
- if(msg>0){
243
- jQuery('#cleantalk_users_left').html(msg);
244
- ct_delete_all_users();
245
- }else{
246
- location.href='users.php?page=ct_check_users&ct_worked=1';
247
- }
248
- },
249
- error: function(jqXHR, textStatus, errorThrown) {
250
- jQuery('#ct_error_message').show();
251
- jQuery('#cleantalk_ajax_error').html(textStatus);
252
- jQuery('#cleantalk_js_func').html('All users deleteion');
253
- setTimeout(ct_delete_all_users(), 3000);
254
- },
255
- timeout: 25000
256
- });
257
- }
258
- function ct_delete_checked_users(){
259
-
260
- ids=Array();
261
- var cnt=0;
262
- jQuery('input[id^=cb-select-][id!=cb-select-all-1]').each(function(){
263
- if(jQuery(this).prop('checked')){
264
- ids[cnt]=jQuery(this).attr('id').substring(10);
265
- cnt++;
266
- }
267
- });
268
- var data = {
269
- 'action': 'ajax_delete_checked_users',
270
- 'security': ct_ajax_nonce,
271
- 'ids':ids
272
- };
273
-
274
- jQuery.ajax({
275
- type: "POST",
276
- url: ajaxurl,
277
- data: data,
278
- success: function(msg){
279
- location.href='users.php?page=ct_check_users&ct_worked=1';
280
- },
281
- error: function(jqXHR, textStatus, errorThrown) {
282
- jQuery('#ct_error_message').show();
283
- jQuery('#cleantalk_ajax_error').html(textStatus);
284
- jQuery('#cleantalk_js_func').html('All users deleteion');
285
- setTimeout(ct_delete_checked_users(), 3000);
286
- },
287
- timeout: 15000
288
- });
289
- }
290
-
291
- // Function to toggle dependences
292
- function ct_toggle_depended(obj, secondary = false){
293
-
294
- var depended = jQuery(obj.data('depended')),
295
- state = obj.data('state');
296
-
297
- if(!state && !secondary){
298
- obj.data('state', true);
299
- depended.removeProp('disabled');
300
- }else{
301
- obj.data('state', false);
302
- depended.prop('disabled', true);
303
- depended.removeProp('checked');
304
- if(depended.data('depended'))
305
- ct_toggle_depended(depended, true);
306
- }
307
- }
308
-
309
- jQuery(document).ready(function(){
310
-
311
- // Setting dependences
312
- // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
313
- jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
314
-
315
- // Prev check parameters
316
- if(ct_prev_accurate){
317
- jQuery("#ct_accurate_check").prop('checked', true);
318
- }
319
- if(ct_prev_from){
320
- jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
321
- jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
322
- jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
323
- }
324
-
325
- // Toggle dependences
326
- jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
327
- ct_toggle_depended(jQuery(this));
328
- });
329
-
330
- var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
331
- {
332
- dateFormat: 'yy-mm-dd',
333
- maxDate:"+0D",
334
- changeMonth:true,
335
- changeYear:true,
336
- showAnim: 'slideDown',
337
- onSelect: function(selectedDate){
338
- var option = this.id == "ct_date_range_from" ? "minDate" : "maxDate",
339
- instance = jQuery( this ).data( "datepicker" ),
340
- date = jQuery.datepicker.parseDate(
341
- instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,
342
- selectedDate, instance.settings);
343
- dates.not(this).datepicker("option", option, date);
344
- }
345
- }
346
- );
347
-
348
- function ct_start_check(continue_check = false){
349
-
350
- if(jQuery('#ct_allow_date_range').is(':checked')){
351
-
352
- ct_date_from = jQuery('#ct_date_range_from').val(),
353
- ct_date_till = jQuery('#ct_date_range_till').val();
354
-
355
- if(!(ct_date_from != '' && ct_date_till != '')){
356
- alert('Please, specify a date range.');
357
- return;
358
- }
359
- }
360
-
361
- if(jQuery('#ct_accurate_check').is(':checked')){
362
- ct_accurate_check = true;
363
- }
364
-
365
- jQuery('.ct_to_hide').hide();
366
- jQuery('#ct_working_message').show();
367
- jQuery('#ct_preloader').show();
368
- jQuery('#ct_pause').show();
369
-
370
- ct_working=true;
371
-
372
- if(continue_check){
373
- ct_show_users_info();
374
- ct_send_users();
375
- }else
376
- ct_clear_users();
377
-
378
- }
379
-
380
- // Check users
381
- jQuery("#ct_check_spam_button").click(function(){
382
- document.cookie = 'ct_paused_users_check=0; path=/';
383
- ct_start_check(false);
384
- });
385
- jQuery("#ct_proceed_check_button").click(function(){
386
- ct_start_check(true);
387
- });
388
-
389
- // Pause the check
390
- jQuery('#ct_pause').on('click', function(){
391
- ct_pause = true;
392
- var ct_check = {
393
- 'accurate': ct_accurate_check,
394
- 'from' : ct_date_from,
395
- 'till' : ct_date_till
396
- };
397
- document.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/';
398
- });
399
-
400
- jQuery("#ct_insert_users").click(function(){
401
- ct_insert_users();
402
- });
403
-
404
- jQuery("#ct_delete_users").click(function(){
405
- ct_insert_users(true);
406
- });
407
-
408
- // Delete all spam users
409
- jQuery("#ct_delete_all_users").click(function(){
410
-
411
- if (!confirm(ctUsersCheck.ct_confirm_deletion_all))
412
- return false;
413
-
414
- jQuery('.ct_to_hide').hide();
415
- jQuery('#ct_checking_status').hide();
416
- jQuery('#ct_search_info').hide();
417
- jQuery('#ct_preloader').show();
418
- jQuery('#ct_deleting_message').show();
419
- jQuery('#ct_stop_deletion').show();
420
- jQuery("html, body").animate({ scrollTop: 0 }, "slow");
421
- ct_delete_all_users();
422
- });
423
- jQuery("#ct_delete_checked_users").click(function(){
424
- if (!confirm(ctUsersCheck.ct_confirm_deletion_checked))
425
- return false;
426
- ct_delete_checked_users();
427
- });
428
-
429
- jQuery("#ct_stop_deletion").click(function(){
430
- location.href='users.php?page=ct_check_users';
431
- });
432
-
433
- jQuery(".cleantalk_delete_user_button").click(function(){
434
- id = jQuery(this).attr("data-id");
435
- ids=Array();
436
- ids[0]=id;
437
- var data = {
438
- 'action': 'ajax_delete_checked_users',
439
- 'security': ct_ajax_nonce,
440
- 'ids':ids
441
- };
442
- jQuery.ajax({
443
- type: "POST",
444
- url: ajaxurl,
445
- data: data,
446
- success: function(msg){
447
- ct_close_animate=false;
448
- jQuery("#comment-"+id).hide();
449
- jQuery("#comment-"+id).remove();
450
- ct_close_animate=true;
451
- },
452
- timeout: 15000
453
- });
454
- });
455
-
456
- jQuery(".cleantalk_delete_user_button").click(function(){
457
- id = jQuery(this).attr("data-id");
458
- animate_comment(0.3, id);
459
- });
460
-
461
- //Show/hide action on mouse over/out
462
- jQuery(".cleantalk_user").mouseover(function(){
463
- id = jQuery(this).attr("data-id");
464
- jQuery("#cleantalk_delete_user_"+id).show();
465
- });
466
- jQuery(".cleantalk_user").mouseout(function(){
467
- id = jQuery(this).attr("data-id");
468
- jQuery("#cleantalk_delete_user_"+id).hide();
469
- });
470
-
471
- //Approve button
472
- jQuery(".cleantalk_delete_from_list_button").click(function(){
473
- ct_id = jQuery(this).attr("data-id");
474
-
475
- // Approving
476
- var data = {
477
- 'action': 'ajax_ct_approve_user',
478
- 'security': ct_ajax_nonce,
479
- 'id': ct_id
480
- };
481
- jQuery.ajax({
482
- type: "POST",
483
- url: ajaxurl,
484
- data: data,
485
- success: function(msg){
486
- jQuery("#comment-"+ct_id).fadeOut('slow', function(){
487
- jQuery("#comment-"+ct_id).remove();
488
- });
489
- },
490
- });
491
-
492
- // Positive feedback
493
- var data = {
494
- 'action': 'ct_feedback_user',
495
- 'security': ct_ajax_nonce,
496
- 'user_id': ct_id,
497
- 'status': 'approve'
498
- };
499
- jQuery.ajax({
500
- type: "POST",
501
- url: ajaxurl,
502
- data: data,
503
- success: function(msg){
504
- if(msg == 1){
505
- // Success
506
- }
507
- if(msg == 0){
508
- // Error occurred
509
- }
510
- if(msg == 'no_hash'){
511
- // No hash
512
- }
513
- },
514
- error: function(jqXHR, textStatus, errorThrown) {
515
-
516
- },
517
- timeout: 5000
518
- });
519
-
520
- });
521
-
522
- // Request to Download CSV file.
523
- jQuery("#ct_get_csv_file").click(function(){
524
- var data = {
525
- 'action': 'ajax_ct_get_csv_file',
526
- 'security': ct_ajax_nonce,
527
- 'filename': ctUsersCheck.ct_csv_filename
528
- };
529
- jQuery.ajax({
530
- type: "POST",
531
- url: ajaxurl,
532
- data: data,
533
- success: function(msg){
534
- if(parseInt(msg)==0)
535
- alert(ctUsersCheck.ct_bad_csv);
536
- else
537
- jQuery("#ct_csv_wrapper").html("<iframe src='"+location.protocol+"//"+location.hostname+"/wp-content/plugins/cleantalk-spam-protect/check-results/"+ctUsersCheck.ct_csv_filename+".csv'></iframe>");
538
- },
539
- });
540
- });
541
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-users-checkspam.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ var ct_working=!(String.prototype.printf=function(){var e=this;for(var t in arguments){var c=e.substring(0,e.indexOf("%s",0)),_=e.substring(e.indexOf("%s",0)+2,e.length);e=c+arguments[t]+_}return e}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctUsersCheck.ct_prev_accurate,ct_prev_from=ctUsersCheck.ct_prev_from,ct_prev_till=ctUsersCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctUsersCheck.ct_ajax_nonce,ct_users_total=0,ct_users_checked=0,ct_users_spam=0,ct_users_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_users(){var e={action:"ajax_clear_users",security:ct_ajax_nonce};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_show_users_info(),ct_send_users()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_users(),ct_show_users_info()}function ct_send_users(){if(1!=ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var e={action:"ajax_check_users",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){if(e=jQuery.parseJSON(e),parseInt(e.error))if(ct_working=!1,confirm(e.error_message+". Do you want to proceed?"))ct_send_users();else{var t="users.php?page=ct_check_users";0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t}else if(ct_new_check=!1,1==parseInt(e.end)||1==ct_pause){1==parseInt(e.end)&&(document.cookie="ct_paused_users_check=0; path=/"),ct_working=!1,jQuery("#ct_working_message").hide();t="users.php?page=ct_check_users&ct_worked=1";0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t}else if(0==parseInt(e.end)){ct_users_checked+=e.checked,ct_users_spam+=e.spam,ct_users_bad+=e.bad,ct_unchecked=ct_users_total-ct_users_checked-ct_users_bad;var c=(c=String(ctUsersCheck.ct_status_string)).printf(ct_users_total,ct_users_checked,ct_users_spam,ct_users_bad);0<parseInt(ct_users_spam)&&(c+=ctUsersCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(c),jQuery("#ct_error_message").hide(),ct_send_users()}},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check users"),setTimeout(ct_send_users(),3e3)},timeout:25e3})}}function ct_show_users_info(){if(ct_working){if(1==ct_cooling_down_flag)return jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),void jQuery("#ct_cooling_notice").show();if(jQuery("#ct_cooling_notice").hide(),setTimeout(ct_show_users_info,3e3),!ct_users_total){var e={action:"ajax_info_users",security:ct_ajax_nonce};ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_users_total=e.total,ct_users_spam=e.spam,ct_users_checked=e.checked,ct_users_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Show users"),setTimeout(ct_show_users_info(),3e3)},timeout:15e3})}}}function ct_insert_users(t){var e={action:"ajax_insert_users",security:ct_ajax_nonce};(t=t||null)&&(e.delete=!0),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){t?alert(ctUsersCheck.ct_deleted+" "+e+" "+ctUsersCheck.ct_iusers):alert(ctUsersCheck.ct_inserted+" "+e+" "+ctUsersCheck.ct_iusers)}})}function ct_delete_all_users(){var e={action:"ajax_delete_all_users",security:ct_ajax_nonce};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_users_left").html(e),ct_delete_all_users()):location.href="users.php?page=ct_check_users&ct_worked=1"},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("All users deleteion"),setTimeout(ct_delete_all_users(),3e3)},timeout:25e3})}function ct_delete_checked_users(){ids=Array();var e=0;jQuery("input[id^=cb-select-][id!=cb-select-all-1]").each(function(){jQuery(this).prop("checked")&&(ids[e]=jQuery(this).attr("id").substring(10),e++)});var t={action:"ajax_delete_checked_users",security:ct_ajax_nonce,ids:ids};jQuery.ajax({type:"POST",url:ajaxurl,data:t,success:function(e){location.href="users.php?page=ct_check_users&ct_worked=1"},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("All users deleteion"),setTimeout(ct_delete_checked_users(),3e3)},timeout:15e3})}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}jQuery(document).ready(function(){jQuery("#ct_allow_date_range").data({depended:".ct_date",state:!1}),ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range, #ct_accurate_check").on("change",function(){ct_toggle_depended(jQuery(this))});var r=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"yy-mm-dd",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),_=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);r.not(this).datepicker("option",t,_)}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_users_info(),ct_send_users()):ct_clear_users())}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_users_check=0; path=/"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_users_check="+JSON.stringify(e)+"; path=/"}),jQuery("#ct_insert_users").click(function(){ct_insert_users()}),jQuery("#ct_delete_users").click(function(){ct_insert_users(!0)}),jQuery("#ct_delete_all_users").click(function(){if(!confirm(ctUsersCheck.ct_confirm_deletion_all))return!1;jQuery(".ct_to_hide").hide(),jQuery("#ct_checking_status").hide(),jQuery("#ct_search_info").hide(),jQuery("#ct_preloader").show(),jQuery("#ct_deleting_message").show(),jQuery("#ct_stop_deletion").show(),jQuery("html, body").animate({scrollTop:0},"slow"),ct_delete_all_users()}),jQuery("#ct_delete_checked_users").click(function(){if(!confirm(ctUsersCheck.ct_confirm_deletion_checked))return!1;ct_delete_checked_users()}),jQuery("#ct_stop_deletion").click(function(){location.href="users.php?page=ct_check_users"}),jQuery(".cleantalk_delete_user_button").click(function(){id=jQuery(this).attr("data-id"),ids=Array(),ids[0]=id;var e={action:"ajax_delete_checked_users",security:ct_ajax_nonce,ids:ids};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){ct_close_animate=!1,jQuery("#comment-"+id).hide(),jQuery("#comment-"+id).remove(),ct_close_animate=!0},timeout:15e3})}),jQuery(".cleantalk_delete_user_button").click(function(){id=jQuery(this).attr("data-id"),animate_comment(.3,id)}),jQuery(".cleantalk_user").mouseover(function(){id=jQuery(this).attr("data-id"),jQuery("#cleantalk_delete_user_"+id).show()}),jQuery(".cleantalk_user").mouseout(function(){id=jQuery(this).attr("data-id"),jQuery("#cleantalk_delete_user_"+id).hide()}),jQuery(".cleantalk_delete_from_list_button").click(function(){ct_id=jQuery(this).attr("data-id");var e={action:"ajax_ct_approve_user",security:ct_ajax_nonce,id:ct_id};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){jQuery("#comment-"+ct_id).fadeOut("slow",function(){jQuery("#comment-"+ct_id).remove()})}});e={action:"ct_feedback_user",security:ct_ajax_nonce,user_id:ct_id,status:"approve"};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){},error:function(e,t,c){},timeout:5e3})}),jQuery("#ct_get_csv_file").click(function(){var e={action:"ajax_ct_get_csv_file",security:ct_ajax_nonce,filename:ctUsersCheck.ct_csv_filename};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0==parseInt(e)?alert(ctUsersCheck.ct_bad_csv):jQuery("#ct_csv_wrapper").html("<iframe src='"+location.protocol+"//"+location.hostname+"/wp-content/plugins/cleantalk-spam-protect/check-results/"+ctUsersCheck.ct_csv_filename+".csv'></iframe>")}})})});
2
+ //# sourceMappingURL=cleantalk-users-checkspam.min.js.map
js/cleantalk-users-checkspam.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-users-checkspam.js"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","new_check","unchecked","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","document","cookie","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_insert_users","delete_accounts","alert","ct_deleted","ct_iusers","ct_inserted","ct_delete_all_users","ct_delete_checked_users","ids","Array","cnt","each","prop","attr","ct_toggle_depended","obj","secondary","depended","removeProp","ready","state","val","on","dates","datepicker","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","is","click","ct_check","accurate","from","till","JSON","stringify","ct_confirm_deletion_all","animate","scrollTop","ct_confirm_deletion_checked","remove","mouseover","mouseout","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","ct_bad_csv","protocol","hostname"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,IAKVS,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,aAAaD,iBAChCE,aAAmBD,aAAaC,aAChCC,aAAmBF,aAAaE,aAE7BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,aAAaM,cAChCC,eAAiB,EACjBC,iBAAmB,EACnBC,cAAgB,EAChBC,aAAe,EACfC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,EAAEE,KAGnBC,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,GAAIE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C,OAAO/B,MAAMwF,KAAK,WACvB5D,gBAAgB,GAAKE,MAItBC,OAAO,mBAAmBkG,UAAU,WACnCnG,GAAKC,OAAO/B,MAAMwF,KAAK,WACvBzD,OAAO,0BAA0BD,IAAIyC,SAEtCxC,OAAO,mBAAmBmG,SAAS,WAClCpG,GAAKC,OAAO/B,MAAMwF,KAAK,WACvBzD,OAAO,0BAA0BD,IAAI8B,SAItC7B,OAAO,sCAAsCsF,MAAM,WAClDc,MAAQpG,OAAO/B,MAAMwF,KAAK,WAG1B,IAAItD,EAAO,CACVC,OAAU,uBACVC,SAAYhB,cACZU,GAAMqG,OAEPpG,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,GACjBX,OAAO,YAAYoG,OAAOC,QAAQ,OAAQ,WACzCrG,OAAO,YAAYoG,OAAOH,cAMzB9F,EAAO,CACVC,OAAU,mBACVC,SAAYhB,cACZiH,QAAWF,MACXG,OAAU,WAEXvG,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,KAWlBS,MAAO,SAASiB,EAAOC,EAAYC,KAGnCE,QAAS,QAMXzC,OAAO,oBAAoBsF,MAAM,WAChC,IAAInF,EAAO,CACVC,OAAU,uBACVC,SAAYhB,cACZmH,SAAYzH,aAAa0H,iBAE1BzG,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,GACC,GAAfQ,SAASR,GACXmC,MAAM/D,aAAa2H,YAEnB1G,OAAO,mBAAmBoC,KAAK,gBAAgBZ,SAASmF,SAAS,KAAKnF,SAASoF,SAAS,4DAA4D7H,aAAa0H,gBAAgB","file":"cleantalk-users-checkspam.min.js","sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\t\n\tvar data = {\n\t\t'action': 'ajax_clear_users',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag == true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked += msg.checked;\n\t\t\t\t\tct_users_spam += msg.spam;\n\t\t\t\t\tct_users_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_total, ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tsetTimeout(ct_show_users_info, 3000);\n\t\t\n\t\tif(!ct_users_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_total = msg.total;\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\nfunction ct_insert_users(delete_accounts){\n\n delete_accounts = delete_accounts || null;\n\n\tvar data = {\n\t\t'action': 'ajax_insert_users',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tif(delete_accounts)\n\t\tdata['delete'] = true;\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tif(delete_accounts)\n\t\t\t\talert(ctUsersCheck.ct_deleted + ' ' + msg + ' ' + ctUsersCheck.ct_iusers);\n\t\t\telse\n\t\t\t\talert(ctUsersCheck.ct_inserted + ' ' + msg + ' ' + ctUsersCheck.ct_iusers);\n\t\t}\n\t});\n}\nfunction ct_delete_all_users(){\n\t\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tif(msg>0){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users();\n\t\t\t}else{\n\t\t\t\tlocation.href='users.php?page=ct_check_users&ct_worked=1';\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_delete_checked_users(){\n\t\n\tids=Array();\n\tvar cnt=0;\n\tjQuery('input[id^=cb-select-][id!=cb-select-all-1]').each(function(){\n\t\tif(jQuery(this).prop('checked')){\n\t\t\tids[cnt]=jQuery(this).attr('id').substring(10);\n\t\t\tcnt++;\n\t\t}\n\t});\n\tvar data = {\n\t\t'action': 'ajax_delete_checked_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'ids':ids\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tlocation.href='users.php?page=ct_check_users&ct_worked=1';\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_checked_users(), 3000);\n\t\t},\n\t\ttimeout: 15000\n\t});\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\njQuery(document).ready(function(){\n\t\n\t// Setting dependences\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\n\t\tct_toggle_depended(jQuery(this));\n\t});\n\t\t\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'yy-mm-dd',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t}\n\t\t}\n\t);\n\t\t\n\tfunction ct_start_check(continue_check){\n\n\t continue_check = continue_check || null;\n\t\t\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val(),\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\t\t\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}else\n\t\t\tct_clear_users();\n\t\t\n\t}\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/';\n\t});\n\t\n\tjQuery(\"#ct_insert_users\").click(function(){\n\t\tct_insert_users();\n\t});\n\t\n\tjQuery(\"#ct_delete_users\").click(function(){\n\t\tct_insert_users(true);\n\t});\n\t\n\t// Delete all spam users\n\tjQuery(\"#ct_delete_all_users\").click(function(){\n\t\t\n\t\tif (!confirm(ctUsersCheck.ct_confirm_deletion_all))\n\t\t\treturn false;\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_checking_status').hide();\n\t\tjQuery('#ct_search_info').hide();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_deleting_message').show();\n\t\tjQuery('#ct_stop_deletion').show();\n\t\tjQuery(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n\t\tct_delete_all_users();\n\t});\n\tjQuery(\"#ct_delete_checked_users\").click(function(){\n\t\tif (!confirm(ctUsersCheck.ct_confirm_deletion_checked))\n\t\t\treturn false;\n\t\tct_delete_checked_users();\n\t});\n\t\n\tjQuery(\"#ct_stop_deletion\").click(function(){\n\t\tlocation.href='users.php?page=ct_check_users';\n\t});\n\t\n\tjQuery(\".cleantalk_delete_user_button\").click(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tids=Array();\n\t\tids[0]=id;\n\t\tvar data = {\n\t\t\t'action': 'ajax_delete_checked_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'ids':ids\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_close_animate=false;\n\t\t\t\tjQuery(\"#comment-\"+id).hide();\n\t\t\t\tjQuery(\"#comment-\"+id).remove();\n\t\t\t\tct_close_animate=true;\n\t\t\t},\n\t\t\ttimeout: 15000\n\t\t});\n\t});\n\t\n\tjQuery(\".cleantalk_delete_user_button\").click(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tanimate_comment(0.3, id);\n\t});\n\t\t\n\t//Show/hide action on mouse over/out\n\tjQuery(\".cleantalk_user\").mouseover(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tjQuery(\"#cleantalk_delete_user_\"+id).show();\n\t});\n\tjQuery(\".cleantalk_user\").mouseout(function(){\n\t\tid = jQuery(this).attr(\"data-id\");\n\t\tjQuery(\"#cleantalk_delete_user_\"+id).hide();\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve'\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\"#ct_get_csv_file\").click(function(){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(parseInt(msg)==0)\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\telse\n\t\t\t\t\tjQuery(\"#ct_csv_wrapper\").html(\"<iframe src='\"+location.protocol+\"//\"+location.hostname+\"/wp-content/plugins/cleantalk-spam-protect/check-results/\"+ctUsersCheck.ct_csv_filename+\".csv'></iframe>\");\n\t\t\t},\n\t\t});\n\t});\n});"]}
js/cleantalk-users-editscreen.js DELETED
@@ -1,21 +0,0 @@
1
- function ct_is_email(str){
2
- return str.search(/.*@.*\..*/);
3
- }
4
- function ct_is_ip(str){
5
- return str.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
6
- }
7
-
8
- jQuery(document).ready(function(){
9
-
10
- /* Shows "Find spam users" Buttons */
11
- jQuery('#changeit').after(' <a href="users.php?page=ct_check_users" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctUsersScreen.spambutton_text+'</a>&nbsp;');
12
-
13
- /* Shows link to blacklists near every email and IP address */
14
- if(parseInt(ctUsersScreen.ct_show_check_links))
15
- jQuery('.column-email a').each(function(){
16
- var ct_curr_str = jQuery(this).html();
17
- if(ct_is_email(ct_curr_str) != -1){
18
- jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+ct_curr_str+'" target="_blank" title="https://cleantalk.org/blacklists/'+ct_curr_str+'" class="ct_link_new_tab"><img src="'+ctUsersScreen.ct_img_src_new_tab+'"></a>');
19
- }
20
- });
21
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk-users-editscreen.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function ct_is_email(t){return t.search(/.*@.*\..*/)}function ct_is_ip(t){return t.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}jQuery(document).ready(function(){jQuery("#changeit").after(' <a href="users.php?page=ct_check_users" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+"&nbsp;"+ctUsersScreen.spambutton_text+"</a>&nbsp;"),parseInt(ctUsersScreen.ct_show_check_links)&&jQuery(".column-email a").each(function(){var t=jQuery(this).html();-1!=ct_is_email(t)&&jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+t+'" target="_blank" title="https://cleantalk.org/blacklists/'+t+'" class="ct_link_new_tab"><img src="'+ctUsersScreen.ct_img_src_new_tab+'"></a>')})});
2
+ //# sourceMappingURL=cleantalk-users-editscreen.min.js.map
js/cleantalk-users-editscreen.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk-users-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","after","ctAdminCommon","logo_small_colored","ctUsersScreen","spambutton_text","parseInt","ct_show_check_links","each","ct_curr_str","this","html","ct_img_src_new_tab"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAGnBE,OAAOC,UAAUC,MAAM,WAGtBF,OAAO,aAAaG,MAAM,4GAA4GC,cAAcC,mBAAmB,SAASC,cAAcC,gBAAgB,cAG3MC,SAASF,cAAcG,sBACzBT,OAAO,mBAAmBU,KAAK,WAC9B,IAAIC,EAAcX,OAAOY,MAAMC,QACC,GAA7BjB,YAAYe,IACdX,OAAOY,MAAMT,MAAM,mDAAmDQ,EAAY,6DAA6DA,EAAY,uCAAuCL,cAAcQ,mBAAmB","file":"cleantalk-users-editscreen.min.js","sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\t\n\t/* Shows \"Find spam users\" Buttons */\n\tjQuery('#changeit').after(' <a href=\"users.php?page=ct_check_users\" class=\"button\" style=\"margin:1px 0 0 0; display: inline-block;\">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctUsersScreen.spambutton_text+'</a>&nbsp;');\n\t\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctUsersScreen.ct_show_check_links))\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n});"]}
js/cleantalk_external.js DELETED
@@ -1,44 +0,0 @@
1
- function ct_protect_external(){
2
-
3
- for(i=0;i<document.forms.length;i++){
4
-
5
- if(typeof(document.forms[i].action)=='string'){
6
-
7
- action=document.forms[i].action;
8
- if(action.indexOf('http://')!=-1||action.indexOf('https://')!=-1){
9
-
10
- tmp=action.split('//');
11
- tmp=tmp[1].split('/');
12
- host=tmp[0].toLowerCase();
13
- if(host!=location.hostname.toLowerCase()){
14
-
15
- var ct_action = document.createElement("input");
16
- ct_action.name='cleantalk_hidden_action';
17
- ct_action.value=action;
18
- ct_action.type='hidden';
19
- document.forms[i].appendChild(ct_action);
20
-
21
- var ct_method = document.createElement("input");
22
- ct_method.name='cleantalk_hidden_method';
23
- ct_method.value=document.forms[i].method;
24
- ct_method.type='hidden';
25
-
26
- document.forms[i].method='POST';
27
- document.forms[i].appendChild(ct_method);
28
-
29
- document.forms[i].action=ctNocache.blog_home;
30
- }
31
- }
32
- }
33
- }
34
- }
35
-
36
- jQuery(document).ready(function(){
37
-
38
- // Aigle CRM subscription form
39
- if(typeof _agile == 'object'){
40
- window.onload = function(){ setTimeout(function(){ ct_protect_external() }, 1500); };
41
- }else{
42
- ct_protect_external();
43
- }
44
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk_external.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function ct_protect_external(){for(i=0;i<document.forms.length;i++)if("string"==typeof document.forms[i].action&&(action=document.forms[i].action,(-1!=action.indexOf("http://")||-1!=action.indexOf("https://"))&&(tmp=action.split("//"),tmp=tmp[1].split("/"),host=tmp[0].toLowerCase(),host!=location.hostname.toLowerCase()))){var t=document.createElement("input");t.name="cleantalk_hidden_action",t.value=action,t.type="hidden",document.forms[i].appendChild(t);var e=document.createElement("input");e.name="cleantalk_hidden_method",e.value=document.forms[i].method,e.type="hidden",document.forms[i].method="POST",document.forms[i].appendChild(e),document.forms[i].action=ctNocache.blog_home}}jQuery(document).ready(function(){"object"==typeof _agile?window.onload=function(){setTimeout(function(){ct_protect_external()},1500)}:ct_protect_external()});
2
+ //# sourceMappingURL=cleantalk_external.min.js.map
js/cleantalk_external.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk_external.js"],"names":["ct_protect_external","i","document","forms","length","action","indexOf","tmp","split","host","toLowerCase","location","hostname","ct_action","createElement","name","value","type","appendChild","ct_method","method","ctNocache","blog_home","jQuery","ready","_agile","window","onload","setTimeout"],"mappings":"AAAA,SAASA,sBAER,IAAIC,EAAE,EAAEA,EAAEC,SAASC,MAAMC,OAAOH,IAE/B,GAAqC,iBAA3BC,SAASC,MAAMF,GAAS,SAEjCI,OAAOH,SAASC,MAAMF,GAAGI,SACM,GAA5BA,OAAOC,QAAQ,aAA6C,GAA7BD,OAAOC,QAAQ,eAEhDC,IAAIF,OAAOG,MAAM,MACjBD,IAAIA,IAAI,GAAGC,MAAM,KACjBC,KAAKF,IAAI,GAAGG,cACTD,MAAME,SAASC,SAASF,gBAAc,CAExC,IAAIG,EAAYX,SAASY,cAAc,SACvCD,EAAUE,KAAK,0BACfF,EAAUG,MAAMX,OAChBQ,EAAUI,KAAK,SACff,SAASC,MAAMF,GAAGiB,YAAYL,GAE9B,IAAIM,EAAYjB,SAASY,cAAc,SACvCK,EAAUJ,KAAK,0BACfI,EAAUH,MAAMd,SAASC,MAAMF,GAAGmB,OAClCD,EAAUF,KAAK,SAEff,SAASC,MAAMF,GAAGmB,OAAO,OACzBlB,SAASC,MAAMF,GAAGiB,YAAYC,GAE9BjB,SAASC,MAAMF,GAAGI,OAAOgB,UAAUC,WAOxCC,OAAOrB,UAAUsB,MAAM,WAGF,iBAAVC,OACTC,OAAOC,OAAS,WAAYC,WAAW,WAAY5B,uBAAyB,OAE5EA","file":"cleantalk_external.min.js","sourcesContent":["function ct_protect_external(){\n\t\t\t\n\tfor(i=0;i<document.forms.length;i++){\n\t\t\n\t\tif(typeof(document.forms[i].action)=='string'){\n\t\t\t\n\t\t\taction=document.forms[i].action;\n\t\t\tif(action.indexOf('http://')!=-1||action.indexOf('https://')!=-1){\n\t\t\t\t\n\t\t\t\ttmp=action.split('//');\n\t\t\t\ttmp=tmp[1].split('/');\n\t\t\t\thost=tmp[0].toLowerCase();\n\t\t\t\tif(host!=location.hostname.toLowerCase()){\n\t\t\t\t\t\n\t\t\t\t\tvar ct_action = document.createElement(\"input\");\n\t\t\t\t\tct_action.name='cleantalk_hidden_action';\n\t\t\t\t\tct_action.value=action;\n\t\t\t\t\tct_action.type='hidden';\n\t\t\t\t\tdocument.forms[i].appendChild(ct_action);\n\t\t\t\t\t\n\t\t\t\t\tvar ct_method = document.createElement(\"input\");\n\t\t\t\t\tct_method.name='cleantalk_hidden_method';\n\t\t\t\t\tct_method.value=document.forms[i].method;\n\t\t\t\t\tct_method.type='hidden';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tdocument.forms[i].method='POST';\n\t\t\t\t\tdocument.forms[i].appendChild(ct_method);\n\t\t\t\t\t\n\t\t\t\t\tdocument.forms[i].action=ctNocache.blog_home;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\njQuery(document).ready(function(){\n\t\t\t\n\t// Aigle CRM subscription form\n\tif(typeof _agile == 'object'){\n\t\twindow.onload = function(){ setTimeout(function(){ ct_protect_external() }, 1500); };\n\t}else{\n\t\tct_protect_external();\n\t}\n});"]}
js/cleantalk_internal.js DELETED
@@ -1,54 +0,0 @@
1
- function ct_check_internal(currForm){
2
-
3
- //Gathering data
4
- var ct_data = {},
5
- elems = currForm.elements;
6
-
7
- for (var key in elems) {
8
- if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')
9
- continue;
10
- ct_data[elems[key].name] = currForm.elements[key].value;
11
- }
12
- ct_data['action'] = 'ct_check_internal';
13
-
14
- //AJAX Request
15
- jQuery.ajax({
16
- type: 'POST',
17
- url: ctNocache.blog_home,
18
- datatype : 'text',
19
- data: ct_data,
20
- success: function(data){
21
- if(data == 'true'){
22
- currForm.submit();
23
- }else{
24
- alert(data);
25
- return false;
26
- }
27
- },
28
- error: function(){
29
- currForm.submit();
30
- }
31
- });
32
- }
33
-
34
- jQuery(document).ready( function(){
35
- var ct_currAction = '',
36
- ct_currForm = '';
37
- for(i=0;i<document.forms.length;i++){
38
- if(typeof(document.forms[i].action)=='string'){
39
- ct_currForm = document.forms[i];
40
- ct_currAction = ct_currForm.action;
41
- if(ct_currAction.indexOf('http://')!=-1||ct_currAction.indexOf('https://')!=-1){
42
- if(ct_currAction.search(/\/wp-content\/themes.*\.php$/) != (-1) && ct_currAction.indexOf(ctNocache.blog_home) != (-1)){
43
- ctPrevHandler = ct_currForm.click;
44
- jQuery(ct_currForm).off('**');
45
- jQuery(ct_currForm).off();
46
- jQuery(ct_currForm).on('submit', function(){
47
- ct_check_internal(ct_currForm);
48
- return false;
49
- });
50
- }
51
- }
52
- }
53
- }
54
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/cleantalk_internal.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function ct_check_internal(t){var e={},n=t.elements;for(var c in n)"submit"!=n[c].type&&null!=n[c].value&&""!=n[c].value&&(e[n[c].name]=t.elements[c].value);e.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctNocache.blog_home,datatype:"text",data:e,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}jQuery(document).ready(function(){var e="",t="";for(i=0;i<document.forms.length;i++)"string"==typeof document.forms[i].action&&(-1==(e=(t=document.forms[i]).action).indexOf("http://")&&-1==e.indexOf("https://")||-1!=e.search(/\/wp-content\/themes.*\.php$/)&&-1!=e.indexOf(ctNocache.blog_home)&&(ctPrevHandler=t.click,jQuery(t).off("**"),jQuery(t).off(),jQuery(t).on("submit",function(){return ct_check_internal(t),!1})))});
2
+ //# sourceMappingURL=cleantalk_internal.min.js.map
js/cleantalk_internal.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["cleantalk_internal.js"],"names":["ct_check_internal","currForm","ct_data","elems","elements","key","type","undefined","value","name","jQuery","ajax","url","ctNocache","blog_home","datatype","data","success","alert","submit","error","document","ready","ct_currAction","ct_currForm","i","forms","length","action","indexOf","search","ctPrevHandler","click","off","on"],"mappings":"AAAA,SAASA,kBAAkBC,GAGvB,IAAIC,EAAU,GACVC,EAAQF,EAASG,SAErB,IAAK,IAAIC,KAAOF,EACU,UAAnBA,EAAME,GAAKC,MAAwCC,MAApBJ,EAAME,GAAKG,OAA0C,IAApBL,EAAME,GAAKG,QAE9EN,EAAQC,EAAME,GAAKI,MAAQR,EAASG,SAASC,GAAKG,OAEtDN,EAAgB,OAAI,oBAGpBQ,OAAOC,KAAK,CACRL,KAAM,OACNM,IAAKC,UAAUC,UACfC,SAAW,OACXC,KAAMd,EACNe,QAAS,SAASD,GACd,GAAW,QAARA,EAIC,OADAE,MAAMF,IACC,EAHPf,EAASkB,UAMjBC,MAAO,WACHnB,EAASkB,YAKrBT,OAAOW,UAAUC,MAAO,WACpB,IAAIC,EAAgB,GAChBC,EAAc,GACrB,IAAIC,EAAE,EAAEA,EAAEJ,SAASK,MAAMC,OAAOF,IACM,iBAA3BJ,SAASK,MAAMD,GAAS,UAGK,IADtCF,GADSC,EAAcH,SAASK,MAAMD,IACVG,QACXC,QAAQ,aAAoD,GAApCN,EAAcM,QAAQ,cACW,GAA1DN,EAAcO,OAAO,kCAA2F,GAAhDP,EAAcM,QAAQhB,UAAUC,aAC/FiB,cAAgBP,EAAYQ,MAC5BtB,OAAOc,GAAaS,IAAI,MACxBvB,OAAOc,GAAaS,MACpBvB,OAAOc,GAAaU,GAAG,SAAU,WAE7B,OADAlC,kBAAkBwB,IACX","file":"cleantalk_internal.min.js","sourcesContent":["function ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n//AJAX Request\n jQuery.ajax({\n type: 'POST',\n url: ctNocache.blog_home,\n datatype : 'text',\n data: ct_data,\n success: function(data){\n if(data == 'true'){\n currForm.submit();\n }else{\n alert(data);\n return false;\n }\n },\n error: function(){\n currForm.submit();\n }\n }); \n}\n \njQuery(document).ready( function(){\n var ct_currAction = '',\n ct_currForm = '';\n\tfor(i=0;i<document.forms.length;i++){\n\t\tif(typeof(document.forms[i].action)=='string'){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n\t\t\tif(ct_currAction.indexOf('http://')!=-1||ct_currAction.indexOf('https://')!=-1){\n if(ct_currAction.search(/\\/wp-content\\/themes.*\\.php$/) != (-1) && ct_currAction.indexOf(ctNocache.blog_home) != (-1)){\n ctPrevHandler = ct_currForm.click;\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(){\n ct_check_internal(ct_currForm);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});"]}
lib/CleantalkSFW.php CHANGED
@@ -59,11 +59,15 @@ class CleantalkSFW extends CleantalkSFW_Base
59
  $sfw_die_page = str_replace('{TEST_TITLE}', ($this->test ? __('This is the testing page for SpamFireWall', 'cleantalk') : ''), $sfw_die_page);
60
 
61
  if($this->test){
 
 
62
  $sfw_die_page = str_replace('{TEST_IP}', $this->all_ips['sfw_test']['ip'], $sfw_die_page);
63
  $sfw_die_page = str_replace('{REAL_IP}', $this->all_ips['real']['ip'], $sfw_die_page);
64
  $sfw_die_page = str_replace('{TEST_IP_BLOCKED}', $this->all_ips['sfw_test']['status'] == 1 ? 'Passed' : 'Blocked', $sfw_die_page);
65
  $sfw_die_page = str_replace('{REAL_IP_BLOCKED}', $this->all_ips['real']['status'] == 1 ? 'Passed' : 'Blocked', $sfw_die_page);
66
  }else{
 
 
67
  $sfw_die_page = str_replace('{TEST_IP}', '', $sfw_die_page);
68
  $sfw_die_page = str_replace('{REAL_IP}', '', $sfw_die_page);
69
  $sfw_die_page = str_replace('{TEST_IP_BLOCKED}', '', $sfw_die_page);
@@ -76,7 +80,7 @@ class CleantalkSFW extends CleantalkSFW_Base
76
  $sfw_die_page = str_replace('{REQUEST_URI}', $request_uri, $sfw_die_page);
77
  $sfw_die_page = str_replace('{COOKIE_PREFIX}', $cookie_prefix, $sfw_die_page);
78
  $sfw_die_page = str_replace('{COOKIE_DOMAIN}', $cookie_domain, $sfw_die_page);
79
- $sfw_die_page = str_replace('{SFW_COOKIE}', md5($this->blocked_ip.$api_key), $sfw_die_page);
80
  $sfw_die_page = str_replace('{SERVICE_ID}', $apbct->data['service_id'], $sfw_die_page);
81
  $sfw_die_page = str_replace('{HOST}', $_SERVER['HTTP_HOST'], $sfw_die_page);
82
 
59
  $sfw_die_page = str_replace('{TEST_TITLE}', ($this->test ? __('This is the testing page for SpamFireWall', 'cleantalk') : ''), $sfw_die_page);
60
 
61
  if($this->test){
62
+ $sfw_die_page = str_replace('{REAL_IP__HEADER}', 'Real IP:', $sfw_die_page);
63
+ $sfw_die_page = str_replace('{TEST_IP__HEADER}', 'Test IP:', $sfw_die_page);
64
  $sfw_die_page = str_replace('{TEST_IP}', $this->all_ips['sfw_test']['ip'], $sfw_die_page);
65
  $sfw_die_page = str_replace('{REAL_IP}', $this->all_ips['real']['ip'], $sfw_die_page);
66
  $sfw_die_page = str_replace('{TEST_IP_BLOCKED}', $this->all_ips['sfw_test']['status'] == 1 ? 'Passed' : 'Blocked', $sfw_die_page);
67
  $sfw_die_page = str_replace('{REAL_IP_BLOCKED}', $this->all_ips['real']['status'] == 1 ? 'Passed' : 'Blocked', $sfw_die_page);
68
  }else{
69
+ $sfw_die_page = str_replace('{REAL_IP__HEADER}', '', $sfw_die_page);
70
+ $sfw_die_page = str_replace('{TEST_IP__HEADER}', '', $sfw_die_page);
71
  $sfw_die_page = str_replace('{TEST_IP}', '', $sfw_die_page);
72
  $sfw_die_page = str_replace('{REAL_IP}', '', $sfw_die_page);
73
  $sfw_die_page = str_replace('{TEST_IP_BLOCKED}', '', $sfw_die_page);
80
  $sfw_die_page = str_replace('{REQUEST_URI}', $request_uri, $sfw_die_page);
81
  $sfw_die_page = str_replace('{COOKIE_PREFIX}', $cookie_prefix, $sfw_die_page);
82
  $sfw_die_page = str_replace('{COOKIE_DOMAIN}', $cookie_domain, $sfw_die_page);
83
+ $sfw_die_page = str_replace('{SFW_COOKIE}', md5(current(end($this->blocked_ips)).$api_key), $sfw_die_page);
84
  $sfw_die_page = str_replace('{SERVICE_ID}', $apbct->data['service_id'], $sfw_die_page);
85
  $sfw_die_page = str_replace('{HOST}', $_SERVER['HTTP_HOST'], $sfw_die_page);
86
 
lib/CleantalkState.php CHANGED
@@ -172,6 +172,12 @@ class CleantalkState
172
  'update_plugin' => array(
173
  'last_call' => 0,
174
  ),
 
 
 
 
 
 
175
  'update_settings' => array(
176
  'last_call' => 0,
177
  ),
172
  'update_plugin' => array(
173
  'last_call' => 0,
174
  ),
175
+ 'install_plugin' => array(
176
+ 'last_call' => 0,
177
+ ),
178
+ 'uninstall_plugin' => array(
179
+ 'last_call' => 0,
180
+ ),
181
  'update_settings' => array(
182
  'last_call' => 0,
183
  ),
lib/CleantalkUpgrader.php CHANGED
@@ -25,6 +25,55 @@ class CleantalkUpgrader extends Plugin_Upgrader
25
  $this->strings['process_success'] = 'OK';
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  public function run( $options ) {
29
 
30
  $defaults = array(
25
  $this->strings['process_success'] = 'OK';
26
  }
27
 
28
+ public function install_strings() {
29
+ $this->strings['no_package'] = 'PACKAGE_NOT_AVAILABLE';
30
+ $this->strings['no_files'] = 'PACKAGE_EMPTY';
31
+ $this->strings['process_failed'] = 'INSTALLATION_FAILED';
32
+ $this->strings['process_success'] = 'OK';
33
+ }
34
+
35
+ public function install( $package, $args = array() ) {
36
+
37
+ $defaults = array(
38
+ 'clear_update_cache' => true,
39
+ );
40
+ $parsed_args = wp_parse_args( $args, $defaults );
41
+
42
+ $this->init();
43
+ $this->install_strings();
44
+
45
+ add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
46
+ if ( $parsed_args['clear_update_cache'] ) {
47
+ // Clear cache so wp_update_plugins() knows about the new plugin.
48
+ add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
49
+ }
50
+
51
+ $this->run(
52
+ array(
53
+ 'package' => $package,
54
+ 'destination' => WP_PLUGIN_DIR,
55
+ 'clear_destination' => false, // Do not overwrite files.
56
+ 'clear_working' => true,
57
+ 'hook_extra' => array(
58
+ 'type' => 'plugin',
59
+ 'action' => 'install',
60
+ ),
61
+ )
62
+ );
63
+
64
+ remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
65
+ remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
66
+
67
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
68
+ return $this->result;
69
+ }
70
+
71
+ // Force refresh of plugin update information
72
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
73
+
74
+ return true;
75
+ }
76
+
77
  public function run( $options ) {
78
 
79
  $defaults = array(
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
- Stable tag: 5.119.1
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -560,6 +560,15 @@ If your website has forms that send data to external sources, you can enable opt
560
  10. Website's options.
561
 
562
  == Changelog ==
 
 
 
 
 
 
 
 
 
563
  = 5.119.1 May 30 2019 =
564
  * Fix: Helper class error.
565
 
@@ -1895,6 +1904,16 @@ If your website has forms that send data to external sources, you can enable opt
1895
  * First version
1896
 
1897
  == Upgrade Notice ==
 
 
 
 
 
 
 
 
 
 
1898
  = 5.119.1 May 30 2019 =
1899
  * Fix: Helper class error.
1900
 
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 5.120
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
560
  10. Website's options.
561
 
562
  == Changelog ==
563
+ = 5.120 June 5 2019 =
564
+ * Fix: bbPress false positives.
565
+ * Fix: SpamFireWall check condition.
566
+ * Fix: SpamFireWall block page.
567
+ * Fix: Catch admin action via search form test.
568
+ * Fix: Catch admin action (AJAX).
569
+ * Mod: Using minified version of JS and CSS.
570
+ * Mod: Date format in statistics.
571
+
572
  = 5.119.1 May 30 2019 =
573
  * Fix: Helper class error.
574
 
1904
  * First version
1905
 
1906
  == Upgrade Notice ==
1907
+ = 5.120 June 5 2019 =
1908
+ * Fix: bbPress false positives.
1909
+ * Fix: SpamFireWall check condition.
1910
+ * Fix: SpamFireWall block page.
1911
+ * Fix: Catch admin action via search form test.
1912
+ * Fix: Catch admin action (AJAX).
1913
+ * Mod: Using minified version of JS and CSS.
1914
+ * Mod: Date format in statistics.
1915
+
1916
+
1917
  = 5.119.1 May 30 2019 =
1918
  * Fix: Helper class error.
1919
Â