From dcc73dff44e9a4dc86a1e1fe8e21e68930142564 Mon Sep 17 00:00:00 2001 From: alexandergull Date: Fri, 29 Nov 2024 14:24:15 +0500 Subject: [PATCH 1/2] New. UsersChecker. Sorting users implemented. --- css/cleantalk-admin.min.css | 2 +- css/src/cleantalk-admin.css | 26 ++- js/apbct-public-bundle.min.js | 2 +- js/cleantalk-dashboard-widget.min.js | 2 +- js/cleantalk-dashboard-widget.min.js.map | 2 +- js/cleantalk-users-checkspam.min.js | 2 +- js/cleantalk-users-checkspam.min.js.map | 2 +- js/src/cleantalk-users-checkspam.js | 17 +- lib/Cleantalk/ApbctWP/CleantalkListTable.php | 16 +- .../ApbctWP/FindSpam/ListTable/BadUsers.php | 4 + .../FindSpam/ListTable/CommentsScan.php | 4 +- .../ApbctWP/FindSpam/ListTable/Users.php | 200 +++++++++++++++--- .../ApbctWP/FindSpam/ListTable/UsersLogs.php | 3 - .../ApbctWP/FindSpam/ListTable/UsersScan.php | 90 +++++--- .../ApbctWP/FindSpam/UsersChecker.php | 7 +- 15 files changed, 288 insertions(+), 91 deletions(-) diff --git a/css/cleantalk-admin.min.css b/css/cleantalk-admin.min.css index fcf8ecc5f..804b9b84f 100644 --- a/css/cleantalk-admin.min.css +++ b/css/cleantalk-admin.min.css @@ -1 +1 @@ -.cleantalk_admin_bar__blocked div,:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.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}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1} \ No newline at end of file +.cleantalk_admin_bar__blocked div,:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.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}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-table-actions-wrapper{background:#FСFСFС;border-radius:2px;padding:5px!important;border:1px solid #d3d3d3;margin:0 5px 5px 0!important}@media screen and (max-width:1120px){.apbct-tablenav{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%;max-width:50%}} diff --git a/css/src/cleantalk-admin.css b/css/src/cleantalk-admin.css index 73d33a388..57dbaad32 100644 --- a/css/src/cleantalk-admin.css +++ b/css/src/cleantalk-admin.css @@ -11,18 +11,18 @@ } /* Additional styles for admin pages */ .ct_meta_links{ - + } .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; @@ -137,4 +137,22 @@ border-radius: 4px; z-index: 99999; opacity: 1; -} \ No newline at end of file +} + +.apbct-table-actions-wrapper { + background: #FСFСFС; + border-radius: 2px; + padding: 5px !important; + border: 1px solid lightgray; + margin: 0 5px 5px 0 !important; +} + +@media screen and (max-width: 1120px) { + .apbct-tablenav { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + height: 100%; + max-width: 50%; + } +} diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index 554fa4b00..14e5d6b2e 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))();function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");null===(n=localStorage.getItem(e))&&(n="[]");for(var n=JSON.parse(n),a=0;a{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;oMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2{var t=r.value;if("undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&("searchform"===t.getAttribute("id")||null!==t.getAttribute("class")&&-1!==t.getAttribute("class").indexOf("search-form")||null!==t.getAttribute("role")&&-1!==t.getAttribute("role").indexOf("search"))){if(t.querySelector("input.dgwt-wcas-search-input"))return;t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return ctSearchFormOnSubmitHandler(e,t)}}})()}catch(e){l.e(e)}finally{l.f()}apbctCatchXmlHttpRequest(),apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists)}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{var o,e,n;if(c.data.forEach(function(e){e.encoded_email===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};void 0!==a[t].href&&0===a[t].href.indexOf("mailto:")?(e=a[t].href.replace("mailto:",""),n=a[t].innerHTML,a[t].innerHTML=n.replace(e,o.decoded_email),a[t].href="mailto:"+o.decoded_email):(a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3)),a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))return e.v}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(){var e=0)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{var t=e.value;o.forEach(function(e){t.classList.contains(e)&&(n=!0)})})()}catch(e){t.e(e)}finally{t.f()}return n}function isFormThatNeedCatchXhr(e){return null==document.querySelector("div.elementor-widget[title='Login/Signup']")&&!(!e||!e.action||-1===e.action.toString().indexOf("mailpoet_subscription_form"))}function getNoCookieData(){var e=apbctLocalStorage.getCleanTalkData(),t=apbctSessionStorage.getCleanTalkData(),e=_objectSpread(_objectSpread({},e),t),e=JSON.stringify(e);return"_ct_no_cookie_data_"+btoa(e)}function apbctWriteReferrersToSessionStorage(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}function apbctCheckAddToCartByGet(){document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);var ctProtectOutsideIframeCheck,cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+n+"}",r.innerHTML+="#cleantalk-modal-close:before{"+a+"}",r.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(/(https?:\/\/[^\s]+)/g,'$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(var e,t,o=0;o strong')).length&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);oMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(var e,t,o=0;o strong')).length&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/cleantalk-dashboard-widget.min.js b/js/cleantalk-dashboard-widget.min.js index 09a5e06b9..bc663742a 100644 --- a/js/cleantalk-dashboard-widget.min.js +++ b/js/cleantalk-dashboard-widget.min.js @@ -1,2 +1,2 @@ -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),locale=navigator.language||navigator.userLanguage;var o=new Intl.DateTimeFormat(locale,{month:"short",day:"numeric"});var e=document.getElementById("ct_widget_chart"),t=(t=>{var a={labels:[],counts:[]};for(let e=0;e 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\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\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\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\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\n\tif( ct_working ){\n\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)').show();\n\t\t\treturn;\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\n\t\tif( ! ct_users_total ){\n\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\t'no_cache': Math.random()\n\t\t\t};\n\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\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_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}\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\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\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\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( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\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_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\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\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\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\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_pause = false;\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_pause = false;\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_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\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\t'no_cache': Math.random()\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\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\t'no_cache': Math.random()\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\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\n\t});\n\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\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\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\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\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tlet waitingPopup = document.createElement('div');\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\n\t\tdocument.body.append(waitingPopup);\n\t\tdocument.body.classList.add('apbct-popup-fade');\n\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(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// Binds the bulk action events to the submit buttons.\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\njQuery( '#doaction' ).on( 'click', function( event ) {\n\t/*\n * Handle the bulk action based on its value.\n */\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\n\t\tvar optionValue = jQuery( this ).val();\n\t\tif ( 'delete' === optionValue ) {\n\t\t\tif ( ! showNotice.warn() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t});\n});\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","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","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","css","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,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D,CAAC,CACF,CAAC,EAGDvE,OAAO,kBAAkB,EAAEiH,MAAM,SAAU7C,GAC1CgC,EAAgB,CACjB,CAAC,EAGDpG,OAAO,0BAA0B,EAAEiH,MAAM,SAAU7C,GAClDgC,EAAiB,CAAA,CAAK,CACvB,CAAC,EAGDpG,OAAO,sBAAsB,EAAEiH,MAAM,SAAU7C,GAE9C,GAAK,CAAE5B,QAASvE,aAAakK,uBAAwB,EACpD,MAAO,CAAA,EAERhE,oBAAqBC,CAAE,CAExB,CAAC,EA2CDpE,OAAO,oBAAoB,EAAEoI,OAAO,WAChCnL,KAAK0F,UACP3C,OAAO,sBAAsB,EAAE4D,KAAK,UAAW,CAAA,CAAI,EACnD5D,OAAO,UAAU,EAAE4D,KAAK,UAAW,CAAA,CAAI,EAAEqB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC,EAgBDjF,OAAQ,WAAY,EAAEgF,GAAI,QAAS,SAAUqD,GAI5CrI,OAAQ,uBAAwB,EAAEsI,KAAM,WAElC,WADatI,OAAQ/C,IAAK,EAAEsD,IAAI,GAE7BgI,WAAWC,KAAK,GACtBH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.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// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\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,\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\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\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\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\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\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\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\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\tif (ct_pause === true) {\n\t\tct_working=false;\n\t\tjQuery('#ct_working_message').hide();\n\t\tlet new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\tif(ct_date_from !== 0 && ct_date_till !== 0)\n\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\tlocation.href = new_href;\n\t\treturn;\n\t}\n\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\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\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\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\n\t\t\tmsg = jQuery.parseJSON(msg);\n\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){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\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 = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( 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\tstatus_string = status_string.printf(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\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\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\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\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\n\tif( ct_working ){\n\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)').show();\n\t\t\treturn;\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\n\t\tif( ! ct_users_total ){\n\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\t'no_cache': Math.random()\n\t\t\t};\n\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\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_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}\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\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\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\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( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\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_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\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\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\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\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_pause = false;\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_pause = false;\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_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\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// 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\t'no_cache': Math.random()\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\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\t'no_cache': Math.random()\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\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\n\t});\n\n\tfunction blinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(500, 0.25).fadeTo(500, 1);\n\t}\n\n\tfunction stopBlinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(1)\n\t}\n\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\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\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tblinkElement('ct_get_csv_file');\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\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tstopBlinkElement('ct_get_csv_file');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\t\tblinkElement('ct_delete_all_users');\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tlet waitingPopup = document.createElement('div');\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\n\t\tdocument.body.append(waitingPopup);\n\t\tdocument.body.classList.add('apbct-popup-fade');\n\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(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// Binds the bulk action events to the submit buttons.\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\njQuery( '#doaction' ).on( 'click', function( event ) {\n\t/*\n * Handle the bulk action based on its value.\n */\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\n\t\tvar optionValue = jQuery( this ).val();\n\t\tif ( 'delete' === optionValue ) {\n\t\t\tif ( ! showNotice.warn() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t});\n});\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","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","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","blinkElement","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,EAMA,IAAIQ,WAAa,EAHjBC,SAASC,OAAS,oDAIjBC,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB,CAAA,EACpBC,SAAW,CAAA,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,EAGhB,SAASC,kBAAkBC,EAAOC,GACjC,IAAIvB,EAAS,GAuBb,MArBmB,UAAhB,OADHsB,EAAQA,GAAS,QACYA,EAAQA,EAAME,MAAM,GAG3B,UAAnB,OAD8BD,EAAjB,UADhBA,EAAWA,GAAY,CAAC,SAAU,QACU,KAClCA,KAAsBA,EAAWA,EAASC,MAAM,GAC1DzB,SAASC,OAAOwB,MAAM,GAAG,EAAEC,QAAQ,SAASC,EAAMC,EAAGC,GACpD,IAAIC,EAAOH,EAAKI,KAAK,EAAEN,MAAM,GAAG,EAE7BF,GACFA,EAAMG,QAAQ,SAASM,EAAMJ,EAAGK,GAC5BH,EAAK,KAAOE,IACd/B,EAAO6B,EAAK,IAAOA,EAAK,GAC1B,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V,EACb0G,EAAMK,SAAWhK,aAAa0J,gBAAkB,OAEhDlK,SAASiJ,KAAKwB,YAAYN,CAAK,EAC/BA,EAAMX,MAAM,GAEbjH,OAAO,IAAMoE,EAAEC,OAAOtE,EAAE,EAAEwE,YAAY,UAAU,EA9BlDvE,OAAO,kBAAQ,EAAEC,OAAO,CAAC,CAgCxB,CACD,CAAC,CACF,CAAC,EAGDD,OAAO,kBAAkB,EAAEiH,MAAM,SAAU7C,GAC1CgC,EAAgB,CACjB,CAAC,EAGDpG,OAAO,0BAA0B,EAAEiH,MAAM,SAAU7C,GAClDgC,EAAiB,CAAA,CAAK,CACvB,CAAC,EAGDpG,OAAO,sBAAsB,EAAEiH,MAAM,SAAU7C,GAE9C,GAAK,CAAE5B,QAASvE,aAAakK,uBAAwB,EACpD,MAAO,CAAA,EACRhC,EAAa,qBAAqB,EAClChC,oBAAqBC,CAAE,CAExB,CAAC,EA2CDpE,OAAO,oBAAoB,EAAEoI,OAAO,WAChCnL,KAAK0F,UACP3C,OAAO,sBAAsB,EAAE4D,KAAK,UAAW,CAAA,CAAI,EACnD5D,OAAO,UAAU,EAAE4D,KAAK,UAAW,CAAA,CAAI,EAAEoB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC,EAgBDhF,OAAQ,WAAY,EAAE+E,GAAI,QAAS,SAAUsD,GAI5CrI,OAAQ,uBAAwB,EAAEsI,KAAM,WAElC,WADatI,OAAQ/C,IAAK,EAAEsD,IAAI,GAE7BgI,WAAWC,KAAK,GACtBH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} diff --git a/js/src/cleantalk-users-checkspam.js b/js/src/cleantalk-users-checkspam.js index b3cf9c4e9..e40eb5df2 100644 --- a/js/src/cleantalk-users-checkspam.js +++ b/js/src/cleantalk-users-checkspam.js @@ -351,7 +351,6 @@ function ct_delete_all_users( e ){ }; jQuery('.' + e.target.id).addClass('disabled'); - jQuery('.spinner').css('visibility', 'visible'); jQuery.ajax({ type: "POST", url: ajaxurl, @@ -362,7 +361,6 @@ function ct_delete_all_users( e ){ ct_delete_all_users( e, data ); }else{ jQuery('.' + e.target.id).removeClass('disabled'); - jQuery('.spinner').css('visibility', 'hidden'); location.href='users.php?page=ct_check_users'; } }, @@ -453,7 +451,6 @@ jQuery(document).ready(function(){ //Approve button jQuery(".cleantalk_delete_from_list_button").click(function(){ ct_id = jQuery(this).attr("data-id"); - // Approving var data = { 'action': 'ajax_ct_approve_user', @@ -503,6 +500,14 @@ jQuery(document).ready(function(){ }); + function blinkElement(id) { + jQuery("#" + id).fadeTo(500, 0.25).fadeTo(500, 1); + } + + function stopBlinkElement(id) { + jQuery("#" + id).fadeTo(1) + } + // Request to Download CSV file. jQuery(".ct_get_csv_file").click(function( e ){ var data = { @@ -512,7 +517,7 @@ jQuery(document).ready(function(){ 'no_cache': Math.random() }; jQuery('.' + e.target.id).addClass('disabled'); - jQuery('.spinner').css('visibility', 'visible'); + blinkElement('ct_get_csv_file'); jQuery.ajax({ type: "POST", url: ajaxurl, @@ -531,7 +536,7 @@ jQuery(document).ready(function(){ dummy.click(); } jQuery('.' + e.target.id).removeClass('disabled'); - jQuery('.spinner').css('visibility', 'hidden'); + stopBlinkElement('ct_get_csv_file'); } }); }); @@ -551,7 +556,7 @@ jQuery(document).ready(function(){ if ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) ) return false; - + blinkElement('ct_delete_all_users'); ct_delete_all_users( e ); }); diff --git a/lib/Cleantalk/ApbctWP/CleantalkListTable.php b/lib/Cleantalk/ApbctWP/CleantalkListTable.php index 4d3c22c88..157f72653 100644 --- a/lib/Cleantalk/ApbctWP/CleantalkListTable.php +++ b/lib/Cleantalk/ApbctWP/CleantalkListTable.php @@ -992,9 +992,9 @@ protected function pagination( $which ) { $output .= "\n" . implode( "\n", $page_links ) . ''; if ( $total_pages ) { - $page_class = $total_pages < 2 ? ' one-page' : ''; + $page_class = $total_pages < 2 ? ' one-page apbct-table-actions-wrapper' : ' apbct-table-actions-wrapper'; } else { - $page_class = ' no-pages'; + $page_class = ' no-pages apbct-table-actions-wrapper'; } $this->_pagination = "
$output
"; @@ -1249,7 +1249,13 @@ public function print_column_headers( $with_id = true ) { } $column_display_name = sprintf( - '%s', + ' + %s + + + + + ', esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ), $column_display_name ); @@ -1333,10 +1339,10 @@ protected function display_tablenav( $which ) { wp_nonce_field( 'bulk-' . $this->_args['plural'] ); } ?> -
+
has_items() ) : ?> -
+
bulk_actions( $which ); ?>
getSpamNow() to handle sorting. + **/ $columns = $this->get_columns(); $this->_column_headers = array($columns, array(), array()); diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/CommentsScan.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/CommentsScan.php index 85f6c0991..43b4bd331 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/CommentsScan.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/CommentsScan.php @@ -51,15 +51,15 @@ public function extra_tablenav($which) // phpcs:ignore PSR1.Methods.CamelCapsMet $button_id_spam = ($which) ? "ct_spam_all_$which" : "ct_spam_all"; $button_id_trash = ($which) ? "ct_trash_all_$which" : "ct_trash_all"; ?> -
+
-
+ 'spam', - 'plural' => 'spam' + 'plural' => 'spam', + 'screen' => str_replace('users_page_', '', current_action()) )); $this->bulk_actions_handler(); @@ -52,6 +53,27 @@ public function get_columns() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.N return $columns; } + /** + * @return array|array[] + */ + protected function get_sortable_columns() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps + { + $columns = array( + 'ct_username' => array('ct_username'), + 'ct_email' => array('ct_email'), + 'ct_name' => array('ct_name'), + 'ct_signed_up' => array('ct_signed_up','desc'), + 'ct_role' => array('ct_role'), + 'ct_posts' => array('ct_posts'), + ); + + if ( $this->wc_active ) { + $columns['ct_orders'] = array('ct_orders'); + } + + return $columns; + } + /** * CheckBox column * @@ -306,19 +328,152 @@ public function getCheckedNow() } /** - * @return \WP_User_Query + * Get spam users. + * @param integer|null $per_page if null - then just count users + * @param integer|null $current_page + * @param string $orderby + * @param string $order + * @return array */ - public function getSpamNow($per_page, $current_page) + public function getSpamNow($per_page, $current_page, $orderby = 'ct_signed_up', $order = 'ASC') { - $params_spam = array( - 'number' => $per_page, - 'offset' => ( $current_page - 1 ) * $per_page, - 'fields' => 'ID', - 'meta_key' => 'ct_marked_as_spam', - 'count_total' => true, - ); + global $wpdb; + //table names + $wc_orders_table = $wpdb->prefix . 'wc_orders'; + $wp_usermeta_table = $wpdb->usermeta; + $wp_posts_table = $wpdb->posts; + $wp_users = $wpdb->users; + $wp_capabilities = $wpdb->prefix . 'capabilities'; + + $wc_exists = $this->wc_active && $wpdb->get_row("SHOW TABLES LIKE '$wc_orders_table'"); + + // ordering + $orderby = !empty($orderby) ? $orderby : 'ct_signed_up'; + $order = !empty($order) ? $order : 'ASC'; + + // chunks + + //woo commerce orders + $wc_sql_chunk_count = $wc_exists ? " COUNT( DISTINCT $wc_orders_table.ID ) AS ct_orders, " : ''; + $wc_sql_chunk_join = $wc_exists + ? " LEFT JOIN $wc_orders_table ON + users.ID = $wc_orders_table.customer_id + AND $wc_orders_table.status LIKE '%wc_completed%' " + : ''; + + if (!isset($current_page)) { + $current_page = 1; + } - return new \WP_User_Query($params_spam); + if (is_null($per_page)) { // if null - just count users + //limit is no limit + $limit_sql_chunk = ''; + // global selector is count only + $selectors_sql_chunk = ' COUNT(*) as cnt '; + //ordering and group chunks empty + $group_by_chunk = ''; + $order_by_chunk = ''; + // drop wc_orders_join on count + $wc_sql_chunk_join = ''; + } else { // else - get users select with limit, group and order + //limit + $limit_sql_chunk = "LIMIT " . ($current_page - 1) * $per_page . ", " . $per_page; + + // global selector + $selectors_sql_chunk = ' user_login AS ct_username, + user_nicename AS ct_name, + user_email AS ct_email, + user_registered AS ct_signed_up, + users.ID AS user_id, + ' . $wc_sql_chunk_count . ' + ( SELECT meta_table.meta_value + FROM ' . $wp_usermeta_table . ' as meta_table + WHERE meta_table.meta_key LIKE \'' . $wp_capabilities . '\' + AND meta_table.user_id = users.ID + LIMIT 1 + ) AS ct_role, + ( SELECT COUNT( posts_table.ID ) + FROM ' . $wp_posts_table . ' as posts_table + WHERE posts_table.post_author = users.ID + AND posts_table.post_type = \'post\' + AND posts_table.post_status = \'publish\' + ) AS ct_posts'; + + //ordering chunks + $group_by_chunk = ' GROUP BY users.ID '; + $order_by_chunk = " ORDER BY $orderby $order "; + } + + $the_final_query = " + SELECT + $selectors_sql_chunk + FROM + $wp_users AS users + $wc_sql_chunk_join + LEFT JOIN + $wp_usermeta_table ON users.ID = $wp_usermeta_table.user_id + LEFT JOIN $wp_posts_table ON users.ID = $wp_posts_table.post_author + WHERE $wp_usermeta_table.meta_key LIKE '%ct_marked_as_spam%' + $group_by_chunk + $order_by_chunk + $limit_sql_chunk; + "; + + /** The final common SQL query looks LIKE + * SELECT + * user_login AS ct_username, + * user_nicename AS ct_name, + * user_email AS ct_email, + * user_registered AS ct_signed_up, + * users.ID AS user_id, + * COUNT( DISTINCT wp_wc_orders.ID ) AS ct_orders, + * ( SELECT meta_table.meta_value + * FROM wp_usermeta as meta_table + * WHERE meta_table.meta_key LIKE \'wp_capabilities\' + * AND meta_table.user_id = users.ID + * LIMIT 1 + * ) AS ct_role, + * ( SELECT COUNT( posts_table.ID ) + * FROM wp_posts as posts_table + * WHERE posts_table.post_author = users.ID + * AND posts_table.post_type = \'post\' + * AND posts_table.post_status = \'publish\' + * ) AS ct_posts + * FROM + * wp_users AS users + * LEFT JOIN wp_wc_orders ON + * users.ID = wp_wc_orders.customer_id + * AND wp_wc_orders.status LIKE \'%wc_completed%\' + * LEFT JOIN wp_usermeta ON + * users.ID = wp_usermeta.user_id + * LEFT JOIN wp_posts ON + * users.ID = wp_posts.post_author + * WHERE wp_usermeta.meta_key LIKE \'%ct_marked_as_spam%\' + * GROUP BY users.ID + * ORDER BY ct_posts desc + * LIMIT 0, 10; + */ + + /** + * The final count SQL looks like + * SELECT + * COUNT(*) as cnt + * FROM + * wp_users AS users + * LEFT JOIN wp_usermeta ON + * users.ID = wp_usermeta.user_id + * LEFT JOIN wp_posts ON + * users.ID = wp_posts.post_author + * WHERE wp_usermeta.meta_key LIKE \'%ct_marked_as_spam%\' + */ + + $result = $wpdb->get_results($the_final_query); + + if ( !is_array($result) ) { + $result = array(); + } + + return $result; } /** @@ -366,27 +521,4 @@ protected function removeLogs($ids) ID IN ($ids_string)" ); } - - /** - * @param int $user_id - * - * @return string - */ - protected function getWcOrdersCount($user_id) - { - $args = array( - 'post_type' => 'shop_order', - 'post_status' => 'wc-completed', - 'numberposts' => -1, - 'meta_key' => '_customer_user', - 'meta_value' => $user_id, - ); - - $description = ''; - if ( $count = count(get_posts($args)) ) { - $description = esc_html__('Do "accurate check" to skip checking this user', 'cleantalk-spam-protect'); - } - - return '

' . $count . '

' . $description . ''; - } } diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php index 39787659a..214526e57 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersLogs.php @@ -21,9 +21,6 @@ public function get_columns() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.N public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { - $columns = $this->get_columns(); - $this->_column_headers = array($columns, array(), array()); - $logs = $this->getScansLogs(); foreach ( $logs as $log ) { diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php index acd5fa9bf..a420ffc84 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php @@ -8,8 +8,6 @@ class UsersScan extends Users { public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { - $columns = $this->get_columns(); - $this->_column_headers = array($columns, array(), array()); $current_screen = get_current_screen(); $per_page_option = !is_null($current_screen) @@ -20,32 +18,44 @@ public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName $per_page = 10; } + $orderby = ''; + $order = 'ASC'; + if ( isset($_REQUEST['orderby']) ) { + $orderby = $_REQUEST['orderby']; + } + if ( isset($_REQUEST['order']) ) { + $order = $_REQUEST['order']; + } + $current_page = $this->get_pagenum(); - $scanned_users = $this->getSpamNow($per_page, $current_page); + $scanned_users = $this->getSpamNow($per_page, $current_page, $orderby, $order); + $total_items = $this->getSpamNow(null, null, $orderby, $order); + $total_items = isset($total_items[0]) && property_exists($total_items[0], 'cnt') ? $total_items[0]->cnt : 0; $this->set_pagination_args(array( - 'total_items' => $scanned_users->get_total(), + 'total_items' => $total_items, 'per_page' => $per_page, )); - foreach ( $scanned_users->get_results() as $user_id ) { - $user_obj = get_userdata($user_id); + foreach ( $scanned_users as $user_data ) { + $user_obj = get_userdata($user_data->user_id); if ( ! $user_obj ) { continue; } + $roles_prepare = implode(', ', array_keys(maybe_unserialize($user_data->ct_role))); $items = array( - 'ct_id' => $user_obj->ID, + 'ct_id' => $user_data->user_id, 'ct_username' => $user_obj, - 'ct_name' => $user_obj->display_name, - 'ct_email' => $user_obj->user_email, - 'ct_signed_up' => $user_obj->user_registered, - 'ct_role' => implode(', ', $user_obj->roles), - 'ct_posts' => count_user_posts($user_id), + 'ct_name' => $user_data->ct_name, + 'ct_email' => $user_data->ct_email, + 'ct_signed_up' => $user_data->ct_signed_up, + 'ct_role' => $roles_prepare, + 'ct_posts' => $user_data->ct_posts, ); if ( $this->wc_active ) { - $items['ct_orders'] = $this->getWcOrdersCount($user_obj->ID); + $items['ct_orders'] = $user_data->ct_orders; } $this->items[] = $items; @@ -54,27 +64,49 @@ public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName public function extra_tablenav($which) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { + if (empty($this->items)) { + return; + } + echo static::getExtraTableNav(); + } + + public static function getExtraTableNav() + { + //prepare sorting elements + $users = new UsersScan(); + $columns = $users->get_columns(); + unset($columns['cb']); + unset($columns['ct_id']); + unset($columns['ct_username']); + + $new_out = ' +
+ + +
+ '; + $new_out = sprintf( + $new_out, + __('Delete all users from list', 'cleantalk-spam-protect'), + __('Download results in CSV', 'cleantalk-spam-protect') + ); + return $new_out; + } + + public static function getExtraTableNavInsertDeleteUsers() + { + $out = ''; if ( isset($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] === '127.0.0.1' && in_array(Server::getDomain(), array('lc', 'loc', 'lh')) ) { - ?> - - - has_items() ) { - return; + $out .= '
'; + $out .= 'These actions available only for test purpose and buttons are visible only in local env:'; + $out .= ''; + $out .= ''; + $out .= '
'; } - ?> -
- - - -
- list_table = new UsersScan(); $this->getCurrentScanPanel($this); + echo UsersScan::getExtraTableNavInsertDeleteUsers(); echo '
'; $this->list_table->display(); echo '
'; @@ -577,8 +578,10 @@ public static function ctAjaxInsertUsers() // TEST INSERTION $to_insert = 500; + $query = 'SELECT network FROM `' . APBCT_TBL_FIREWALL_DATA . '` LIMIT ' . $to_insert . ';'; + $result = $wpdb->get_results( - 'SELECT network FROM `' . APBCT_TBL_FIREWALL_DATA . '` LIMIT ' . $to_insert . ';', + $query, ARRAY_A ); @@ -593,7 +596,7 @@ public static function ctAjaxInsertUsers() $rnd = mt_rand(1, 10000000); $user_name = "user_$rnd"; - $email = "stop_email_$rnd@example.com"; + $email = TT::toString($rnd - mt_rand(1, 10000)) . "_stop_email_$rnd@example.com"; $user_id = wp_create_user( $user_name, From 88c1cbff87eb4ce623e8d0a21bf524b83e260fcb Mon Sep 17 00:00:00 2001 From: alexandergull Date: Mon, 30 Dec 2024 22:21:34 +0500 Subject: [PATCH 2/2] Fix. UsersChecker. After dev merge and psalm. --- css/cleantalk-admin.min.css | 2 +- js/cleantalk-users-checkspam.min.js.map | 2 +- .../ApbctWP/FindSpam/ListTable/UsersScan.php | 13 +++---------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/css/cleantalk-admin.min.css b/css/cleantalk-admin.min.css index 804b9b84f..b83bc570a 100644 --- a/css/cleantalk-admin.min.css +++ b/css/cleantalk-admin.min.css @@ -1 +1 @@ -.cleantalk_admin_bar__blocked div,:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.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}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-table-actions-wrapper{background:#FСFСFС;border-radius:2px;padding:5px!important;border:1px solid #d3d3d3;margin:0 5px 5px 0!important}@media screen and (max-width:1120px){.apbct-tablenav{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%;max-width:50%}} +.cleantalk_admin_bar__blocked div,:disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.apbct_bottom_links--left{margin-right:2pc}.apbct_bottom_links--other{margin-right:2pc;margin-left:2pc}.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}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}.apbct-plugin-errors{margin-left:0;margin-bottom:20px}#cleantalk_notice_review .caption{margin:0 0 15px;color:gray}#cleantalk_notice_review .button{margin-bottom:20px}.apbct-restore-spam-order-button{cursor:pointer}.ct-modal-buttons{display:flex;align-items:center;padding:20px 0;justify-content:space-between}.ct-modal-message{font-weight:700;font-size:16px;line-height:2rem}.apbct-popup-fade:before{content:'';background:#000;position:fixed;left:0;top:0;width:100%;height:100%;opacity:.7;z-index:9999}.apbct-popup{position:fixed;top:20%;left:50%;padding:20px;width:360px;margin-left:-200px;background:#fff;border:1px solid;border-radius:4px;z-index:99999;opacity:1}.apbct-table-actions-wrapper{background:#FСFСFС;border-radius:2px;padding:5px!important;border:1px solid #d3d3d3;margin:0 5px 5px 0!important}@media screen and (max-width:1120px){.apbct-tablenav{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%;max-width:50%}} \ No newline at end of file diff --git a/js/cleantalk-users-checkspam.min.js.map b/js/cleantalk-users-checkspam.min.js.map index 072cfc696..1feb75dc8 100644 --- a/js/cleantalk-users-checkspam.min.js.map +++ b/js/cleantalk-users-checkspam.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.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// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\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,\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\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\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\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\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\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\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\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\tif (ct_pause === true) {\n\t\tct_working=false;\n\t\tjQuery('#ct_working_message').hide();\n\t\tlet new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\tif(ct_date_from !== 0 && ct_date_till !== 0)\n\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\tlocation.href = new_href;\n\t\treturn;\n\t}\n\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\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\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\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\n\t\t\tmsg = jQuery.parseJSON(msg);\n\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){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\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 = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( 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\tstatus_string = status_string.printf(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\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\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\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\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\n\tif( ct_working ){\n\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)').show();\n\t\t\treturn;\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\n\t\tif( ! ct_users_total ){\n\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\t'no_cache': Math.random()\n\t\t\t};\n\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\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_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}\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\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\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\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( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\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_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\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\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\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\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_pause = false;\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_pause = false;\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_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\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// 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\t'no_cache': Math.random()\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\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\t'no_cache': Math.random()\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\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\n\t});\n\n\tfunction blinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(500, 0.25).fadeTo(500, 1);\n\t}\n\n\tfunction stopBlinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(1)\n\t}\n\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\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\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tblinkElement('ct_get_csv_file');\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\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tstopBlinkElement('ct_get_csv_file');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\t\tblinkElement('ct_delete_all_users');\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tlet waitingPopup = document.createElement('div');\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\n\t\tdocument.body.append(waitingPopup);\n\t\tdocument.body.classList.add('apbct-popup-fade');\n\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(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// Binds the bulk action events to the submit buttons.\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\njQuery( '#doaction' ).on( 'click', function( event ) {\n\t/*\n * Handle the bulk action based on its value.\n */\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\n\t\tvar optionValue = jQuery( this ).val();\n\t\tif ( 'delete' === optionValue ) {\n\t\t\tif ( ! showNotice.warn() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t});\n});\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","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","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","blinkElement","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,EAMA,IAAIQ,WAAa,EAHjBC,SAASC,OAAS,oDAIjBC,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB,CAAA,EACpBC,SAAW,CAAA,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,EAGhB,SAASC,kBAAkBC,EAAOC,GACjC,IAAIvB,EAAS,GAuBb,MArBmB,UAAhB,OADHsB,EAAQA,GAAS,QACYA,EAAQA,EAAME,MAAM,GAG3B,UAAnB,OAD8BD,EAAjB,UADhBA,EAAWA,GAAY,CAA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BH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} +{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.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// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\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,\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\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\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\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\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\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\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\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\tif (ct_pause === true) {\n\t\tct_working=false;\n\t\tjQuery('#ct_working_message').hide();\n\t\tlet new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\tif(ct_date_from !== 0 && ct_date_till !== 0)\n\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\tlocation.href = new_href;\n\t\treturn;\n\t}\n\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\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\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\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\n\t\t\tmsg = jQuery.parseJSON(msg);\n\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){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\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 = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( 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\tstatus_string = status_string.printf(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\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\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\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\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\n\tif( ct_working ){\n\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)').show();\n\t\t\treturn;\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\n\t\tif( ! ct_users_total ){\n\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\t'no_cache': Math.random()\n\t\t\t};\n\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\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_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}\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\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\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\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( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\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_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\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\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\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\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_pause = false;\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_pause = false;\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_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\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// 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\t'no_cache': Math.random()\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\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\t'no_cache': Math.random()\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\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\n\t});\n\n\tfunction blinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(500, 0.25).fadeTo(500, 1);\n\t}\n\n\tfunction stopBlinkElement(id) {\n\t\tjQuery(\"#\" + id).fadeTo(1)\n\t}\n\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\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\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tblinkElement('ct_get_csv_file');\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\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tstopBlinkElement('ct_get_csv_file');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\t\tblinkElement('ct_delete_all_users');\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tlet waitingPopup = document.createElement('div');\n\t\twaitingPopup.setAttribute('class', 'apbct-popup');\n\t\twaitingPopup.setAttribute('id', 'apbct_popup');\n\t\twaitingPopup.setAttribute('style', 'font-size: 20px');\n\t\twaitingPopup.innerText = 'Wait for users handling!..'\n\t\tdocument.body.append(waitingPopup);\n\t\tdocument.body.classList.add('apbct-popup-fade');\n\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(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t\tjQuery('#apbct_popup')[0].remove()\n\t\t\t\tdocument.body.classList.remove('apbct-popup-fade');\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\n// Binds the bulk action events to the submit buttons.\n// This code has been copied from wordpress core js file wp-admin/js/media.js:184\njQuery( '#doaction' ).on( 'click', function( event ) {\n\t/*\n * Handle the bulk action based on its value.\n */\n\tjQuery( 'select[name=\"action\"]' ).each( function() {\n\t\tvar optionValue = jQuery( this ).val();\n\t\tif ( 'delete' === optionValue ) {\n\t\t\tif ( ! showNotice.warn() ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t});\n});\n"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","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","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","hide","let","new_href","href","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","end","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","blinkElement","ct_insert_users","delete_accounts","waitingPopup","createElement","setAttribute","innerText","body","append","classList","add","remove","window","reload","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","download","appendChild","ct_confirm_deletion_all","change","event","each","showNotice","warn","preventDefault"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,EAMA,IAAIQ,WAAa,EAHjBC,SAASC,OAAS,oDAIjBC,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB,CAAA,EACpBC,SAAW,CAAA,EACXC,iBAAmBC,aAAaD,iBAChCE,aAAmBD,aAAaC,aAChCC,aAAmBF,aAAaE,aAE7BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,aAAaM,cAChCC,eAAiB,EACjBC,iBAAmB,EAC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AAW,CAAA,CAAI,EAAEoB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC,EAgBDhF,OAAQ,WAAY,EAAE+E,GAAI,QAAS,SAAUsD,GAI5CrI,OAAQ,uBAAwB,EAAEsI,KAAM,WAElC,WADatI,OAAQ/C,IAAK,EAAEsD,IAAI,GAE7BgI,WAAWC,KAAK,GACtBH,EAAMI,eAAe,CAGxB,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php index 0b4c9d793..1661e46b8 100644 --- a/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php +++ b/lib/Cleantalk/ApbctWP/FindSpam/ListTable/UsersScan.php @@ -2,13 +2,12 @@ namespace Cleantalk\ApbctWP\FindSpam\ListTable; -use Cleantalk\ApbctWP\Variables\Server; +use Cleantalk\ApbctWP\Variables\Request; class UsersScan extends Users { public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { - $current_screen = get_current_screen(); $per_page_option = !is_null($current_screen) ? $current_screen->get_option('per_page', 'option') @@ -18,14 +17,8 @@ public function prepare_items() // phpcs:ignore PSR1.Methods.CamelCapsMethodName $per_page = 10; } - $orderby = ''; - $order = 'ASC'; - if ( isset($_REQUEST['orderby']) ) { - $orderby = $_REQUEST['orderby']; - } - if ( isset($_REQUEST['order']) ) { - $order = $_REQUEST['order']; - } + $orderby = Request::getString('orderby'); + $order = Request::getString('order', 'ASC'); $current_page = $this->get_pagenum();