OwlCyberSecurity - MANAGER
Edit File: cleantalk-comments-checkspam.min.js
let ctWorking=!(String.prototype.printf=function(){let e=this;for(var t in arguments){var c=e.substring(0,e.indexOf("%s",0)),a=e.substring(e.indexOf("%s",0)+2,e.length);e=c+arguments[t]+a}return e}),ctNewCheck=!0,ctCoolingDownFlag=!1,ctCloseAnimate=!0,ctAccurateCheck=!1,ctPause=!1,ctPrevAccurate=ctCommentsCheck.ct_prev_accurate,ctPrevFrom=ctCommentsCheck.ct_prev_from,ctPrevTill=ctCommentsCheck.ct_prev_till,ctCoolDownTime=9e4,ctRequestsCounter=0,ctMaxRequests=60,ctAjaxNonce=ctCommentsCheck.ct_ajax_nonce,ctCommentsTotal=0,ctCommentsChecked=0,ctCommentsSpam=0,ctCommentsBad=0,ctUnchecked="unset",ctDateFrom=0,ctDateTill=0;function animateComment(e,t){ctCloseAnimate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animateComment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animateComment(.3,t)}):ctCloseAnimate=!0}function ctClearComments(){let e=0,t=0;jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val());var c="https:"===location.protocol?"; secure":"",c=(document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c,{action:"ajax_clear_comments",security:ctAjaxNonce,from:e,till:t});jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(e){ctShowInfo(),ctSendComments()}})}function ctCoolingDownToggle(){ctCoolingDownFlag=!1,ctSendComments(),ctShowInfo()}function ctSendComments(){var e;!0!==ctCoolingDownFlag&&(ctRequestsCounter>=ctMaxRequests?(setTimeout(ctCoolingDownToggle,ctCoolDownTime),ctRequestsCounter=0,ctCoolingDownFlag=!0):(ctRequestsCounter++,e={action:"ajax_check_comments",security:ctAjaxNonce,new_check:ctNewCheck,unchecked:ctUnchecked,offset:Number(ctGetCookie("apbct_check_comments_offset"))},ctAccurateCheck&&(e.accurate_check=!0),ctDateFrom&&ctDateTill&&(e.from=ctDateFrom,e.till=ctDateTill),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(t){if(t=jQuery.parseJSON(t),parseInt(t.error))if(ctWorking=!1,confirm(t.error_message+". Do you want to proceed?"))ctSendComments();else{let e="edit-comments.php?page=ct_check_spam";0!=ctDateFrom&&0!=ctDateTill&&(e+="&from="+ctDateFrom+"&till="+ctDateTill),location.href=e}else{ctNewCheck=!1;var c=Number(ctGetCookie("apbct_check_comments_offset"))+100;if(1==parseInt(t.end)||!0===ctPause){1==parseInt(t.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ctWorking=!1,jQuery("#ct_working_message").hide();let e="edit-comments.php?page=ct_check_spam";0!=ctDateFrom&&0!=ctDateTill&&(e+="&from="+ctDateFrom+"&till="+ctDateTill),document.cookie="apbct_check_comments_offset="+c+"; path=/; samesite=lax"+ctSecure,location.href=e}else if(0==parseInt(t.end)){ctCommentsChecked+=t.checked,ctCommentsSpam+=t.spam,ctCommentsBad+=t.bad,ctCommentsTotal+=t.total,ctUnchecked=ctCommentsTotal-ctCommentsChecked-ctCommentsBad;let e=String(ctCommentsCheck.ct_status_string);e=e.printf(ctCommentsChecked,ctCommentsSpam,ctCommentsBad),0<parseInt(ctCommentsSpam)&&(e+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(e),jQuery("#ct_error_message").hide(),+ctCommentsTotal<ctCommentsChecked+ctCommentsBad&&(document.cookie="ct_comments_start_check=1; path=/; samesite=lax",location.href="edit-comments.php?page=ct_check_spam"),document.cookie="apbct_check_comments_offset="+c+"; path=/; samesite=lax"+ctSecure,ctSendComments()}}},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ctSendComments(),3e3)},timeout:25e3})))}function ctShowInfo(){var e;ctWorking&&(1==ctCoolingDownFlag?(jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),jQuery("#ct_cooling_notice").show()):(jQuery("#ct_cooling_notice").hide(),ctCommentsTotal||(e={action:"ajax_info_comments",security:ctAjaxNonce},ctDateFrom&&ctDateTill&&(e.from=ctDateFrom,e.till=ctDateTill),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ctCommentsTotal=e.total,ctCommentsSpam=e.spam,ctCommentsChecked=e.checked,ctCommentsBad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ctShowInfo(),3e3)},timeout:15e3}))))}function ctToggleDepended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ctToggleDepended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ctTrashAll(a){var e={action:"ajax_trash_all",security:ctAjaxNonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ctTrashAll(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ctTrashAll(a),3e3)},timeout:25e3})}function ctSpamAll(a){var e={action:"ajax_spam_all",security:ctAjaxNonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ctSpamAll(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ctSpamAll(a),3e3)},timeout:25e3})}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}jQuery(document).ready(function(){ctPrevAccurate&&jQuery("#ct_accurate_check").prop("checked",!0),ctPrevFrom&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ctPrevFrom),jQuery("#ct_date_range_till").removeProp("disabled").val(ctPrevTill)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_spam_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_spam_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),e=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,e),document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ctDateFrom=jQuery("#ct_date_range_from").val(),ctDateTill=jQuery("#ct_date_range_till").val(),""==ctDateFrom||""==ctDateTill)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ctAccurateCheck=!0),jQuery("#ct_accurate_check").is(":checked")&&!jQuery("#ct_allow_date_range").is(":checked")?alert("Please, select a date range."):(jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ctWorking=!0,(e?(ctShowInfo(),ctSendComments):ctClearComments)()))}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ctPause=!0;var e={accurate:ctAccurateCheck,from:ctDateFrom,till:ctDateTill};document.cookie="ct_paused_spam_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/; samesite=lax",jQuery("#ct_check_spam_button").click()),jQuery(".ct_trash_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_trash_all))return!1;ctTrashAll(e)}),jQuery(".ct_spam_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_spam_all))return!1;ctSpamAll(e)}),jQuery("#ct_accurate_check").change(function(){this.checked&&(jQuery("#ct_allow_date_range").prop("checked",!0),jQuery(".ct_date").prop("checked",!0).attr("disabled",!1))})}); //# sourceMappingURL=cleantalk-comments-checkspam.min.js.map