)/, email + '$1');\n}\n\n// Listen clicks on encoded emails\ndocument.addEventListener('DOMContentLoaded', function() {\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n if (typeof ctPublic !== 'undefined') {\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n }\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n const node = encodedEmailNodes[i];\n if (\n node.parentNode &&\n node.parentNode.tagName === 'A' &&\n node.parentNode.getAttribute('href')?.includes('mailto:') &&\n node.parentNode.hasAttribute('data-original-string')\n ) {\n // This node was skipped from listeners\n continue;\n }\n node.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n"]}
\ No newline at end of file
+{"version":3,"sources":["cleantalk-admin.js","common-decoder.js"],"names":["apbct_admin_sendAJAX","data","params","obj","let","callback","callbackContext","callback_context","callbackParams","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","apbctSetEmailDecoderPopupAnimation","animationElements","animationWrapper","document","createElement","classList","i","length","apbctEEAnimationDogOne","innerText","append","ctFillDecodedEmailHandler","event","clickSource","ctWlBrandname","encodedEmail","ctPublic","this","removeEventListener","encodedEmailNodesIsMixed","wl_brandname","encodedEmailNodes","plugin_name","encodedEmailNode","body","add","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","ctPublicFunctions","text__ee_wait_for_decoding","innerHTML","waitingPopup","popupHeader","color","id","text__ee_decoding_process","apbctAjaxEmailDecodeBulk","post_url","location","href","referrer","encodedEmails","encodedEmailsCollection","bot_detector_enabled","event_token","apbctLocalStorage","get","event_javascript_data","getJavascriptClientData","indexOf","preventDefault","apbctTooltip","apbct","dataset","originalString","stringify","data__ajax_type","apbct_public_sendREST","method","ctSetCookie","emailEncoderPassKey","apbctEmailEncoderCallbackBulk","onErrorCallback","res","resetEncodedNodes","ctShowDecodeComment","action","apbct_public_sendAJAX","0","appendChild","is_allowed","popup","email","currentResultData","forEach","row","encoded_email","decoded_email","split","firstNode","querySelector","selectableEmail","wrapper","text__ee_click_to_select","title","text__ee_original_email","outerHTML","secondNode","remove","buttonWrapper","text__ee_got_it","addEventListener","fillDecodedNodes","click","comment","hasOwnProperty","text__ee_blocked","text__ee_cannot_connect","element","text__ee_cannot_decode","popupText","text__ee_email_decoder","encodedNodes","decodingResult","ctProcessDecodedDataResult","linkTypePrefix","replace","baseElementContent","querySelectorAll","encodedEmailTextInsideMailto","el","response","targetElement","ctFillDecodedEmail","target","ready","$","on","ctDate","Date","getTime","ctSecure","protocol","cookie","toUTCString","e","parent","after","apbctNoticeDismissSuccess","siblings","apbctNoticeName","attr","notice_id","confirm","notice_when_deleting_user_text","window","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","includes","node","parentNode","tagName","getAttribute","hasAttribute"],"mappings":"AA+FA,SAAAA,qBAAAC,EAAAC,EAAAC,GAEAC,IAAAC,EAAAH,EAAAG,UAAA,KACAC,EAAAJ,EAAAK,kBAAA,KACAC,EAAAN,EAAAO,iBAAA,KACAL,IAAAM,EAAAR,EAAAQ,OAAA,CAAA,EACAN,IAAAO,EAAAT,EAAAS,SAAA,KACAP,IAAAQ,EAAAV,EAAAU,SAAA,KACAT,EAAAA,GAAA,KACAC,IAAAS,EAAAX,EAAAW,QAAA,KACAC,EAAAZ,EAAAY,SAAA,KACAC,EAAAb,EAAAa,aAAA,KAEA,UAAA,OAAA,EACAd,EAAAA,EAAA,gBAAAe,cAAAC,YAAA,aAAAC,KAAAC,OAAA,GAEAlB,EAAAgB,YAAAD,cAAAC,YACAhB,EAAAmB,SAAAF,KAAAC,OAAA,GAGAN,IACAA,EAAAQ,aAAA,WAAA,UAAA,EAAAR,EAAAS,MAAAC,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GACAW,EAAAC,SACAJ,CAAAA,QAAA3K,cAAAgL,4BAAA,GAGAb,EAAA3E,eAAA,CAGA,CAAA,EAGAkE,EAAA,kCAAA,EAAAvB,MAAA,WACA,IAAA8C,EAAAvB,EAAAvG,IAAA,EAAAlE,KAAA,eAAA,EACAA,EAAA,CACAuH,OAAA,2BACAvG,YAAAD,cAAAC,YACAiL,SAAAD,CACA,EACAvB,EAAAhJ,KAAA,CACAC,KAAA,OACAC,IAAAZ,cAAAa,UACA5B,KAAAA,EACA6B,QAAA,SAAAC,GACAA,EAAAD,QACA+J,OAAAjG,SAAAuG,OAAA,EAEAzJ,MAAAX,EAAA9B,KAAAmM,OAAA,CAEA,CACA,CAAA,CACA,CAAA,EAGAP,OAAAjG,SAAAC,KAAAwG,SAAA,oCAAA,IACA5H,EAAApB,SAAAiF,cAAA,wBAAA,MAEAtH,cAAAyD,iBAAAA,GACAnD,MAAAC,OAAA,UACAkD,EAAAwE,iBAAA,QAAApF,yBAAA,EAGA,CAAA,ECuWAR,SAAA4F,iBAAA,mBAAA,WACA7I,IAAAmE,EAAAlB,SAAA6G,iBAAA,wBAAA,EAIA,GAHA,aAAA,OAAAhG,WACAA,SAAAK,kBAAAA,GAEAA,EAAAd,OACA,IAAArD,IAAAoD,EAAA,EAAAA,EAAAe,EAAAd,OAAA,EAAAD,EAAA,CACA,IAAA8I,EAAA/H,EAAAf,GAEA8I,EAAAC,YACA,MAAAD,EAAAC,WAAAC,SACAF,EAAAC,WAAAE,aAAA,MAAA,GAAAJ,SAAA,SAAA,GACAC,EAAAC,WAAAG,aAAA,sBAAA,GAKAJ,EAAArD,iBAAA,QAAApF,yBAAA,CACA,CAEA,CAAA","file":"cleantalk-admin.min.js","sourcesContent":["jQuery(document).ready(function($) {\n // Auto update banner close handler\n jQuery('.apbct_update_notice').on('click', 'button', function() {\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\n });\n\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\n .css('display', 'inline-block');\n\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\n jQuery(e.target).parent()\n .parent('.notice')\n .after('
' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '
');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n","/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler(event = false) {\n let clickSource = false;\n let ctWlBrandname = '';\n let encodedEmail = '';\n if (typeof ctPublic !== 'undefined') {\n this.removeEventListener('click', ctFillDecodedEmailHandler);\n // remember clickSource\n clickSource = this;\n // globally remember if emails is mixed with mailto\n ctPublic.encodedEmailNodesIsMixed = false;\n ctWlBrandname = ctPublic.wl_brandname;\n encodedEmail = ctPublic.encodedEmailNodes;\n } else if (typeof ctAdminCommon !== 'undefined') {\n ctWlBrandname = ctAdminCommon.plugin_name;\n encodedEmail = ctAdminCommon.encodedEmailNode;\n }\n\n // get fade\n document.body.classList.add('apbct-popup-fade');\n // popup show\n let encoderPopup = document.getElementById('apbct_popup');\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctWlBrandname;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n popupTextWaiting.innerText = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n popupTextWaiting.innerText = ctAdminCommon.text__ee_wait_for_decoding;\n }\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_decoding_process) {\n popupTextDecoding.innerText = ctPublicFunctions.text__ee_decoding_process;\n } else {\n popupTextDecoding.innerText = ctAdminCommon.text__ee_decoding_process;\n }\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_wait_for_decoding) {\n document.getElementById('apbct_popup_text').innerHTML = ctPublicFunctions.text__ee_wait_for_decoding;\n } else {\n document.getElementById('apbct_popup_text').innerHTML = ctAdminCommon.text__ee_wait_for_decoding;\n }\n }\n\n apbctAjaxEmailDecodeBulk(event, encodedEmail, clickSource);\n}\n\n/**\n * @param {mixed} event\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {\n if (event && clickSource) {\n // collect data\n let data = {\n post_url: document.location.href,\n referrer: document.referrer,\n encodedEmails: '',\n };\n if (+ctPublic.bot_detector_enabled) {\n data.event_token = apbctLocalStorage.get('bot_detector_event_token');\n } else {\n data.event_javascript_data = getJavascriptClientData();\n }\n\n let encodedEmailsCollection = {};\n for (let i = 0; i < encodedEmailNodes.length; i++) {\n // disable click for mailto\n if (\n typeof encodedEmailNodes[i].href !== 'undefined' &&\n encodedEmailNodes[i].href.indexOf('mailto:') === 0\n ) {\n event.preventDefault();\n ctPublic.encodedEmailNodesIsMixed = true;\n }\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n apbct(encodedEmailNodes[i]).append(apbctTooltip);\n\n // collect encoded email strings\n encodedEmailsCollection[i] = encodedEmailNodes[i].dataset.originalString;\n }\n\n // JSONify encoded email strings\n data.encodedEmails = JSON.stringify(encodedEmailsCollection);\n\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_decode_email',\n {\n data: data,\n method: 'POST',\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n\n // Using AJAX request and handler\n } else {\n data.action = 'apbct_decode_email';\n apbct_public_sendAJAX(\n data,\n {\n notJson: false,\n callback: function(result) {\n // set alternative cookie to skip next pages encoding\n ctSetCookie('apbct_email_encoder_passed', ctPublic.emailEncoderPassKey, '');\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource);\n },\n onErrorCallback: function(res) {\n resetEncodedNodes();\n ctShowDecodeComment(res);\n },\n },\n );\n }\n } else {\n const encodedEmail = encodedEmailNodes.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n encodedEmailNodes.appendChild(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, false);\n },\n 'notJson': true,\n },\n );\n }\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNodes\n * @param {mixed} clickSource\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNodes, clickSource = false) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n // popup remove\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n let email = '';\n if (clickSource) {\n let currentResultData;\n result.data.forEach((row) => {\n if (row.encoded_email === clickSource.dataset.originalString) {\n currentResultData = row;\n }\n });\n\n email = currentResultData.decoded_email.split(/[&?]/)[0];\n } else {\n email = result.data[0].decoded_email;\n }\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_click_to_select) {\n selectableEmail.title = ctPublicFunctions.text__ee_click_to_select;\n } else {\n selectableEmail.title = ctAdminCommon.text__ee_click_to_select;\n }\n // add email to the first node\n if (firstNode) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_original_email) {\n firstNode.innerHTML = ctPublicFunctions.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n } else {\n firstNode.innerHTML = ctAdminCommon.text__ee_original_email +\n ' ' + selectableEmail.outerHTML;\n }\n\n firstNode.setAttribute('style', 'flex-direction: row;');\n }\n // remove animation\n let wrapper = popup.querySelector('.apbct-ee-animation-wrapper');\n if (wrapper) {\n wrapper.remove();\n }\n // remove second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n if (secondNode) {\n secondNode.remove();\n }\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n if (!document.querySelector('.apbct-email-encoder-got-it-button')) {\n let button = document.createElement('button');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_got_it) {\n button.innerText = ctPublicFunctions.text__ee_got_it;\n } else {\n button.innerText = ctAdminCommon.text__ee_got_it;\n }\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedNodes(encodedEmailNodes, result);\n // click on mailto if so\n if (typeof ctPublic !== 'undefined' && ctPublic.encodedEmailNodesIsMixed && clickSource) {\n clickSource.click();\n }\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }\n }, 3000);\n } else {\n if (clickSource) {\n let comment = 'unknown_error';\n if (\n result.hasOwnProperty('data') &&\n result.data.length > 0 &&\n typeof result.data[0] === 'object' &&\n typeof result.data[0].comment === 'string'\n ) {\n comment = result.data[0].comment;\n }\n if (result.success) {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_blocked) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_blocked + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_blocked + ': ' + comment);\n }\n } else {\n resetEncodedNodes();\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_connect) {\n ctShowDecodeComment(ctPublicFunctions.text__ee_cannot_connect + ': ' + comment);\n } else {\n ctShowDecodeComment(ctAdminCommon.text__ee_cannot_connect + ': ' + comment);\n }\n }\n } else {\n console.log('result', result);\n }\n }\n}\n\n/**\n * Reset click event for encoded email\n */\nfunction resetEncodedNodes() {\n if (typeof ctPublic.encodedEmailNodes !== 'undefined') {\n ctPublic.encodedEmailNodes.forEach(function(element) {\n element.addEventListener('click', ctFillDecodedEmailHandler);\n });\n }\n}\n\n/**\n * Show Decode Comment\n * @param {string} comment\n */\nfunction ctShowDecodeComment(comment) {\n if ( ! comment ) {\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_cannot_decode) {\n comment = ctPublicFunctions.text__ee_cannot_decode;\n } else {\n comment = ctAdminCommon.text__ee_cannot_decode;\n }\n }\n\n let popup = document.getElementById('apbct_popup');\n let popupText = document.getElementById('apbct_popup_text');\n if (popup !== null) {\n document.body.classList.remove('apbct-popup-fade');\n if (typeof ctPublicFunctions !== 'undefined' && ctPublicFunctions.text__ee_email_decoder) {\n popupText.innerText = ctPublicFunctions.text__ee_email_decoder + ': ' + comment;\n } else {\n popupText.innerText = ctAdminCommon.text__ee_email_decoder + ': ' + comment;\n }\n setTimeout(function() {\n popup.setAttribute('style', 'display:none');\n }, 3000);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedNodes\n * @param {mixed} decodingResult\n */\nfunction fillDecodedNodes(encodedNodes, decodingResult) {\n if (encodedNodes.length > 0) {\n for (let i = 0; i < encodedNodes.length; i++) {\n // chek what is what\n let currentResultData;\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === encodedNodes[i].dataset.originalString) {\n currentResultData = row;\n }\n });\n // quit case on cloud block\n if (currentResultData.is_allowed === false) {\n return;\n }\n // handler for mailto\n if (\n typeof encodedNodes[i].href !== 'undefined' &&\n (\n encodedNodes[i].href.indexOf('mailto:') === 0 ||\n encodedNodes[i].href.indexOf('tel:') === 0\n )\n ) {\n let linkTypePrefix;\n if (encodedNodes[i].href.indexOf('mailto:') === 0) {\n linkTypePrefix = 'mailto:';\n } else if (encodedNodes[i].href.indexOf('tel:') === 0) {\n linkTypePrefix = 'tel:';\n } else {\n continue;\n }\n let encodedEmail = encodedNodes[i].href.replace(linkTypePrefix, '');\n let baseElementContent = encodedNodes[i].innerHTML;\n encodedNodes[i].innerHTML = baseElementContent.replace(\n encodedEmail,\n currentResultData.decoded_email,\n );\n encodedNodes[i].href = linkTypePrefix + currentResultData.decoded_email;\n\n encodedNodes[i].querySelectorAll('span.apbct-email-encoder').forEach((el) => {\n let encodedEmailTextInsideMailto = '';\n decodingResult.data.forEach((row) => {\n if (row.encoded_email === el.dataset.originalString) {\n encodedEmailTextInsideMailto = row.decoded_email;\n }\n });\n el.innerHTML = encodedEmailTextInsideMailto;\n });\n } else {\n encodedNodes[i].classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes[i]);\n }, 2000);\n }\n // remove listeners\n encodedNodes[i].removeEventListener('click', ctFillDecodedEmailHandler);\n }\n } else {\n let currentResultData = decodingResult.data[0];\n encodedNodes.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n ctProcessDecodedDataResult(currentResultData, encodedNodes);\n }, 2000);\n encodedNodes.removeEventListener('click', ctFillDecodedEmailHandler);\n }\n}\n\n/**\n * @param {mixed} response\n * @param {mixed} targetElement\n */\nfunction ctProcessDecodedDataResult(response, targetElement) {\n targetElement.setAttribute('title', '');\n targetElement.removeAttribute('style');\n ctFillDecodedEmail(targetElement, response.decoded_email);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n target.innerHTML = target.innerHTML.replace(/.+?(
)/, email + '$1');\n}\n\n// Listen clicks on encoded emails\ndocument.addEventListener('DOMContentLoaded', function() {\n let encodedEmailNodes = document.querySelectorAll('[data-original-string]');\n if (typeof ctPublic !== 'undefined') {\n ctPublic.encodedEmailNodes = encodedEmailNodes;\n }\n if (encodedEmailNodes.length) {\n for (let i = 0; i < encodedEmailNodes.length; ++i) {\n const node = encodedEmailNodes[i];\n if (\n node.parentNode &&\n node.parentNode.tagName === 'A' &&\n node.parentNode.getAttribute('href')?.includes('mailto:') &&\n node.parentNode.hasAttribute('data-original-string')\n ) {\n // This node was skipped from listeners\n continue;\n }\n node.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n});\n"]}
\ No newline at end of file
diff --git a/js/prebuild/apbct-public-bundle.js b/js/prebuild/apbct-public-bundle.js
index 73ae5bc18..745098e82 100644
--- a/js/prebuild/apbct-public-bundle.js
+++ b/js/prebuild/apbct-public-bundle.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4478,8 +4479,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_ext-protection.js b/js/prebuild/apbct-public-bundle_ext-protection.js
index fd5ea20e2..ede2b79e2 100644
--- a/js/prebuild/apbct-public-bundle_ext-protection.js
+++ b/js/prebuild/apbct-public-bundle_ext-protection.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4541,7 +4542,7 @@ function ctProtectExternal() {
// Trying to process external form into an iframe
apbctProcessIframes();
// if form is still not processed by fields listening, do it here
- if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
+ if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().startFieldsListening();
}
}
@@ -5818,8 +5819,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js
index 5312d70e8..0813322c9 100644
--- a/js/prebuild/apbct-public-bundle_ext-protection_gathering.js
+++ b/js/prebuild/apbct-public-bundle_ext-protection_gathering.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4541,7 +4542,7 @@ function ctProtectExternal() {
// Trying to process external form into an iframe
apbctProcessIframes();
// if form is still not processed by fields listening, do it here
- if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
+ if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().startFieldsListening();
}
}
@@ -6458,7 +6459,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no
* @return {bool}
*/
function ctIsDrawPixel() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -6472,7 +6473,7 @@ function ctIsDrawPixel() {
* @return {bool}
*/
function ctSetPixelImg(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
ctSetCookie('apbct_pixel_url', pixelUrl);
@@ -6494,7 +6495,7 @@ function ctSetPixelImg(pixelUrl) {
* @return {bool}
*/
function ctSetPixelImgFromLocalstorage(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
if ( ctIsDrawPixel() ) {
@@ -6516,7 +6517,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) {
*/
// eslint-disable-next-line no-unused-vars, require-jsdoc
function ctGetPixelUrl() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -6693,8 +6694,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_full-protection.js b/js/prebuild/apbct-public-bundle_full-protection.js
index 7dbec8a1c..3a99ab684 100644
--- a/js/prebuild/apbct-public-bundle_full-protection.js
+++ b/js/prebuild/apbct-public-bundle_full-protection.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4541,7 +4542,7 @@ function ctProtectExternal() {
// Trying to process external form into an iframe
apbctProcessIframes();
// if form is still not processed by fields listening, do it here
- if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
+ if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().startFieldsListening();
}
}
@@ -5849,7 +5850,7 @@ class ApbctForceProtection {
post_url: document.location.href,
referrer: document.referrer,
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -6062,8 +6063,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_full-protection_gathering.js b/js/prebuild/apbct-public-bundle_full-protection_gathering.js
index a0044256c..8118f4bf1 100644
--- a/js/prebuild/apbct-public-bundle_full-protection_gathering.js
+++ b/js/prebuild/apbct-public-bundle_full-protection_gathering.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4541,7 +4542,7 @@ function ctProtectExternal() {
// Trying to process external form into an iframe
apbctProcessIframes();
// if form is still not processed by fields listening, do it here
- if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
+ if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().startFieldsListening();
}
}
@@ -5849,7 +5850,7 @@ class ApbctForceProtection {
post_url: document.location.href,
referrer: document.referrer,
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -6598,7 +6599,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no
* @return {bool}
*/
function ctIsDrawPixel() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -6612,7 +6613,7 @@ function ctIsDrawPixel() {
* @return {bool}
*/
function ctSetPixelImg(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
ctSetCookie('apbct_pixel_url', pixelUrl);
@@ -6634,7 +6635,7 @@ function ctSetPixelImg(pixelUrl) {
* @return {bool}
*/
function ctSetPixelImgFromLocalstorage(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
if ( ctIsDrawPixel() ) {
@@ -6656,7 +6657,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) {
*/
// eslint-disable-next-line no-unused-vars, require-jsdoc
function ctGetPixelUrl() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -6937,8 +6938,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_gathering.js b/js/prebuild/apbct-public-bundle_gathering.js
index 3de1a78b1..98ea64622 100644
--- a/js/prebuild/apbct-public-bundle_gathering.js
+++ b/js/prebuild/apbct-public-bundle_gathering.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -5118,7 +5119,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no
* @return {bool}
*/
function ctIsDrawPixel() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -5132,7 +5133,7 @@ function ctIsDrawPixel() {
* @return {bool}
*/
function ctSetPixelImg(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
ctSetCookie('apbct_pixel_url', pixelUrl);
@@ -5154,7 +5155,7 @@ function ctSetPixelImg(pixelUrl) {
* @return {bool}
*/
function ctSetPixelImgFromLocalstorage(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
if ( ctIsDrawPixel() ) {
@@ -5176,7 +5177,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) {
*/
// eslint-disable-next-line no-unused-vars, require-jsdoc
function ctGetPixelUrl() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -5353,8 +5354,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_int-protection.js b/js/prebuild/apbct-public-bundle_int-protection.js
index 1e86ac0cc..bcd45fbf4 100644
--- a/js/prebuild/apbct-public-bundle_int-protection.js
+++ b/js/prebuild/apbct-public-bundle_int-protection.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -4582,8 +4583,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/prebuild/apbct-public-bundle_int-protection_gathering.js b/js/prebuild/apbct-public-bundle_int-protection_gathering.js
index 0136a312d..8fc412697 100644
--- a/js/prebuild/apbct-public-bundle_int-protection_gathering.js
+++ b/js/prebuild/apbct-public-bundle_int-protection_gathering.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
@@ -1924,7 +1924,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -2010,6 +2010,7 @@ class ApbctFetchProxyProtection {
return await this.checkRequest(match.formKey, match.config, bodyText);
}
}
+
/**
* Set init params
*/
@@ -2147,7 +2148,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -2185,7 +2186,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
@@ -2642,7 +2643,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -2712,7 +2713,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -3027,7 +3028,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -3097,7 +3098,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3114,7 +3115,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -3172,7 +3173,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -3332,7 +3333,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3348,7 +3349,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -3369,7 +3370,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -3699,7 +3700,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -3765,7 +3766,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -3780,7 +3781,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -4355,7 +4356,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -4374,7 +4375,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -4396,7 +4397,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -4405,7 +4406,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -4432,7 +4433,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -4452,7 +4453,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
@@ -5222,7 +5223,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no
* @return {bool}
*/
function ctIsDrawPixel() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -5236,7 +5237,7 @@ function ctIsDrawPixel() {
* @return {bool}
*/
function ctSetPixelImg(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
ctSetCookie('apbct_pixel_url', pixelUrl);
@@ -5258,7 +5259,7 @@ function ctSetPixelImg(pixelUrl) {
* @return {bool}
*/
function ctSetPixelImgFromLocalstorage(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
if ( ctIsDrawPixel() ) {
@@ -5280,7 +5281,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) {
*/
// eslint-disable-next-line no-unused-vars, require-jsdoc
function ctGetPixelUrl() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -5457,8 +5458,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/js/public-2-gathering-data.min.js b/js/public-2-gathering-data.min.js
index 6807272b9..4a31f85c1 100644
--- a/js/public-2-gathering-data.min.js
+++ b/js/public-2-gathering-data.min.js
@@ -1,2 +1,2 @@
-class ApbctGatheringData{setSessionId(){var t;apbctSessionStorage.isSet("apbct_session_id")?apbctLocalStorage.set("apbct_page_hits",Number(apbctLocalStorage.get("apbct_page_hits"))+1):(t=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(2,10),apbctSessionStorage.set("apbct_session_id",t,!1),apbctLocalStorage.set("apbct_page_hits",1),document.referrer&&new URL(document.referrer).host!==location.host&&apbctSessionStorage.set("apbct_site_referer",document.referrer,!1))}writeReferrersToSessionStorage(){var t=apbctSessionStorage.get("apbct_session_current_page");!1!==t&&document.location.href!==t&&apbctSessionStorage.set("apbct_prev_referer",t,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}setCookiesType(){var t=apbctLocalStorage.get("ct_cookies_type");t&&t===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled"))}startFieldsListening(){"alternative"!==ctPublic.data__cookies_type&&(this.startFieldsListening(),setTimeout(this.startFieldsListening,1e3))}listenAutocomplete(){window.addEventListener("animationstart",this.apbctOnAnimationStart,!0),window.addEventListener("input",this.apbctOnInput,!0)}gatheringTypoData(){document.ctTypoData=new CTTypoData,document.ctTypoData.gatheringFields(),document.ctTypoData.setListeners()}gatheringMouseData(){new ApbctCollectingUserMouseActivity}getScreenInfo(){var t=document.documentElement,e=document.body,e={scrollWidth:t.scrollWidth,bodyScrollHeight:e.scrollHeight,docScrollHeight:t.scrollHeight,bodyOffsetHeight:e.offsetHeight,docOffsetHeight:t.offsetHeight,bodyClientHeight:e.clientHeight,docClientHeight:t.clientHeight,docClientWidth:t.clientWidth};return JSON.stringify({fullWidth:e.scrollWidth,fullHeight:Math.max(e.bodyScrollHeight,e.docScrollHeight,e.bodyOffsetHeight,e.docOffsetHeight,e.bodyClientHeight,e.docClientHeight),visibleWidth:e.docClientWidth,visibleHeight:e.docClientHeight})}restartFieldsListening(){apbctLocalStorage.isSet("ct_has_input_focused")||apbctLocalStorage.isSet("ct_has_key_up")||this.startFieldsListening()}startFieldsListening(){if(!apbctLocalStorage.isSet("ct_has_key_up")&&!apbctLocalStorage.get("ct_has_key_up")||!apbctLocalStorage.isSet("ct_has_input_focused")&&!apbctLocalStorage.get("ct_has_input_focused")||"native"!==ctPublic.data__cookies_type||void 0===ctGetCookie("ct_has_input_focused")||void 0===ctGetCookie("ct_has_key_up")){var e=ctGetPageForms();if(ctPublic.handled_fields=[],0{this.checkElementInForms(t,"addClicks")}),this.elementBody.addEventListener("mouseup",t=>{"Range"==document.getSelection().type.toString()&&this.addSelected()}),this.elementBody.addEventListener("mousemove",t=>{this.checkElementInForms(t,"trackMouseMovement")})}checkElementInForms(e,t){let c;for(let t=0;t{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((t,e)=>{t.addEventListener("paste",()=>{this.data[e].isUseBuffer=!0})}),this.fields.forEach((t,e)=>{t.addEventListener("onautocomplete",()=>{this.data[e].isAutoFill=!0})}),this.fields.forEach((t,c)=>{t.addEventListener("input",()=>{this.data[c].countOfKey++;var t,e=+new Date;1===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].firstKeyTimestamp=e):(t=e-this.data[c].lastKeyTimestamp,2===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t):2{this.checkElementInForms(t,"addClicks")}),this.elementBody.addEventListener("mouseup",t=>{"Range"==document.getSelection().type.toString()&&this.addSelected()}),this.elementBody.addEventListener("mousemove",t=>{this.checkElementInForms(t,"trackMouseMovement")})}checkElementInForms(e,t){let c;for(let t=0;t{this.data.push(Object.assign({},this.fieldData))})}setListeners(){this.fields.forEach((t,e)=>{t.addEventListener("paste",()=>{this.data[e].isUseBuffer=!0})}),this.fields.forEach((t,e)=>{t.addEventListener("onautocomplete",()=>{this.data[e].isAutoFill=!0})}),this.fields.forEach((t,c)=>{t.addEventListener("input",()=>{this.data[c].countOfKey++;var t,e=+new Date;1===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].firstKeyTimestamp=e):(t=e-this.data[c].lastKeyTimestamp,2===this.data[c].countOfKey?(this.data[c].lastKeyTimestamp=e,this.data[c].lastDelta=t):2 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n }\n}\n\n/**\n * Class collecting user mouse activity data\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctCollectingUserMouseActivity {\n elementBody = document.querySelector('body');\n collectionForms = document.forms;\n /**\n * Constructor\n */\n constructor() {\n this.setListeners();\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elementBody.addEventListener('click', (event) => {\n this.checkElementInForms(event, 'addClicks');\n });\n\n this.elementBody.addEventListener('mouseup', (event) => {\n const selectedType = document.getSelection().type.toString();\n if (selectedType == 'Range') {\n this.addSelected();\n }\n });\n\n this.elementBody.addEventListener('mousemove', (event) => {\n this.checkElementInForms(event, 'trackMouseMovement');\n });\n }\n\n /**\n * Checking if there is an element in the form\n * @param {object} event\n * @param {string} addTarget\n */\n checkElementInForms(event, addTarget) {\n let resultCheck;\n for (let i = 0; i < this.collectionForms.length; i++) {\n if (\n event.target.outerHTML.length > 0 &&\n this.collectionForms[i].innerHTML.length > 0\n ) {\n resultCheck = this.collectionForms[i].innerHTML.indexOf(event.target.outerHTML);\n } else {\n resultCheck = -1;\n }\n }\n\n switch (addTarget) {\n case 'addClicks':\n if (resultCheck < 0) {\n this.addClicks();\n }\n break;\n case 'trackMouseMovement':\n if (resultCheck > -1) {\n this.trackMouseMovement();\n }\n break;\n default:\n break;\n }\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.clicks) {\n document.ctCollectingUserActivityData.clicks++;\n } else {\n document.ctCollectingUserActivityData.clicks = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.selected) {\n document.ctCollectingUserActivityData.selected++;\n } else {\n document.ctCollectingUserActivityData.selected = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctCollectingUserActivityData) {\n document.ctCollectingUserActivityData = {};\n }\n if (!document.ctCollectingUserActivityData.mouseMovementsInsideForm) {\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = false;\n }\n\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = true;\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\n\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) { // eslint-disable-line no-unused-vars\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if (typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImg(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n * @return {bool}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction ctGetPixelUrl() {\n if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {\n return false;\n }\n\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n/**\n * Handler for -webkit based browser that listen for a custom\n * animation create using the :pseudo-selector in the stylesheet.\n * Works with Chrome, Safari\n *\n * @param {AnimationEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnAnimationStart(event) {\n ('onautofillstart' === event.animationName) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Handler for non-webkit based browser that listen for input\n * event to trigger the autocomplete-cancel process.\n * Works with Firefox, Edge, IE11\n *\n * @param {InputEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnInput(event) {\n ('insertReplacementText' === event.inputType || !('data' in event)) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Manage an input element when its value is autocompleted\n * by the browser in the following steps:\n * - add [autocompleted] attribute from event.target\n * - create 'onautocomplete' cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctAutocomplete(element) {\n if (element.hasAttribute('autocompleted')) return;\n element.setAttribute('autocompleted', '');\n\n let event = new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: true, detail: null,\n });\n\n // no autofill if preventDefault is called\n if (!element.dispatchEvent(event)) {\n element.value = '';\n }\n}\n\n/**\n * Manage an input element when its autocompleted value is\n * removed by the browser in the following steps:\n * - remove [autocompleted] attribute from event.target\n * - create 'onautocomplete' non-cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctCancelAutocomplete(element) {\n if (!element.hasAttribute('autocompleted')) return;\n element.removeAttribute('autocompleted');\n\n // dispatch event\n element.dispatchEvent(new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: false, detail: null,\n }));\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( new ApbctHandler().checkHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(new ApbctAttachData().constructNoCookieHiddenField());\n }\n }\n }\n}\n"],"names":["ApbctGatheringData","setSessionId","sessionID","apbctSessionStorage","isSet","apbctLocalStorage","set","Number","get","Math","random","toString","replace","substr","document","referrer","URL","host","location","writeReferrersToSessionStorage","sessionCurrentPage","href","setCookiesType","cookiesType","ctPublic","data__cookies_type","delete","startFieldsListening","this","setTimeout","listenAutocomplete","window","addEventListener","apbctOnAnimationStart","apbctOnInput","gatheringTypoData","ctTypoData","CTTypoData","gatheringFields","setListeners","gatheringMouseData","ApbctCollectingUserMouseActivity","getScreenInfo","docEl","documentElement","body","layoutData","scrollWidth","bodyScrollHeight","scrollHeight","docScrollHeight","bodyOffsetHeight","offsetHeight","docOffsetHeight","bodyClientHeight","clientHeight","docClientHeight","docClientWidth","clientWidth","JSON","stringify","fullWidth","fullHeight","max","visibleWidth","visibleHeight","restartFieldsListening","undefined","ctGetCookie","let","forms","ctGetPageForms","handled_fields","length","i","handledFormFields","querySelectorAll","type","push","apbct_attach_event_handler","ctFunctionHasInputFocused","ctFunctionHasKeyUp","elementBody","querySelector","collectionForms","constructor","checkElementInForms","event","getSelection","addSelected","addTarget","resultCheck","target","outerHTML","innerHTML","indexOf","addClicks","trackMouseMovement","ctCollectingUserActivityData","clicks","selected","mouseMovementsInsideForm","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","data","Array","prototype","slice","call","forEach","field","Object","assign","currentDelta","time","Date","abs","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctMouseReadInterval","ctMouseWriteDataInterval","ctFunctionFirstKey","KeyTimestamp","floor","ctSetCookie","ctKeyStopStopListening","ctMouseStopData","apbct_remove_event_handler","ctFunctionMouseMove","clearInterval","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctSetHasScrolled","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","force_alt_cookies","getJavascriptClientData","commonCookies","resultDataJson","ct_checked_emails","ctPublicFunctions","cookiePrefix","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_pixel_url","apbct_headless","ct_bot_detector_frontend_data_log","decodeURIComponent","apbct_page_hits","apbct_prev_referer","apbct_site_referer","apbct_ct_js_errors","pixel__url","console","log","removeDoubleJsonEncoding","ctIsDrawPixel","pixel__setting","settings__data__bot_detector_enabled","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","getElementById","createElement","setAttribute","apbct","append","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","isAlive","data__ajax_type","apbct_public_sendREST","method","callback","result","String","ctNoCookieAttachHiddenFieldsToForms","apbct_public_sendAJAX","action","notJson","beforeSend","xhr","setRequestHeader","ctSetPixelUrlLocalstorage","ajaxPixelUrl","animationName","apbctAutocomplete","apbctCancelAutocomplete","inputType","element","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","value","removeAttribute","ApbctHandler","checkHiddenFieldsExclusions","getAttribute","toLowerCase","j","ApbctAttachData","constructNoCookieHiddenField"],"mappings":"MAGMA,mBAKFC,eACI,IACUC,EADLC,oBAAoBC,MAAM,kBAAkB,EAW7CC,kBAAkBC,IAAI,kBAAmBC,OAAOF,kBAAkBG,IAAI,iBAAiB,CAAC,EAAI,CAAC,GAVvFN,EAAYO,KAAKC,OAAO,EAAEC,SAAS,EAAE,EAAEC,QAA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,2BAA2BjE,SAAU,UAAWqH,kBAAkB,EAClEpD,2BAA2BjE,SAAU,SAAUoI,gBAAgB"}
\ No newline at end of file
+{"version":3,"file":"public-2-gathering-data.min.js","sources":["public-2-gathering-data.js"],"sourcesContent":["/**\n * Class for gathering data\n */\nclass ApbctGatheringData { // eslint-disable-line no-unused-vars\n /**\n * Set session ID\n * @return {void}\n */\n setSessionId() {\n if (!apbctSessionStorage.isSet('apbct_session_id')) {\n const sessionID = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);\n apbctSessionStorage.set('apbct_session_id', sessionID, false);\n apbctLocalStorage.set('apbct_page_hits', 1);\n if (document.referrer) {\n let urlReferer = new URL(document.referrer);\n if (urlReferer.host !== location.host) {\n apbctSessionStorage.set('apbct_site_referer', document.referrer, false);\n }\n }\n } else {\n apbctLocalStorage.set('apbct_page_hits', Number(apbctLocalStorage.get('apbct_page_hits')) + 1);\n }\n }\n\n /**\n * Set three statements to the sessions storage: apbct_session_current_page, apbct_prev_referer.\n * @return {void}\n */\n writeReferrersToSessionStorage() {\n const sessionCurrentPage = apbctSessionStorage.get('apbct_session_current_page');\n // set session apbct_referer\n if (sessionCurrentPage!== false && document.location.href !== sessionCurrentPage) {\n apbctSessionStorage.set('apbct_prev_referer', sessionCurrentPage, false);\n }\n // set session current page to know referrer\n apbctSessionStorage.set('apbct_session_current_page', document.location.href, false);\n }\n\n /**\n * Set cookies type.\n * If it's not set or not equal to ctPublic.data__cookies_type, clear ct_mouse_moved and ct_has_scrolled values.\n * @return {void}\n */\n setCookiesType() {\n const cookiesType = apbctLocalStorage.get('ct_cookies_type');\n if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n apbctLocalStorage.delete('ct_mouse_moved');\n apbctLocalStorage.delete('ct_has_scrolled');\n }\n }\n\n /**\n * Start fields listening\n * @return {void}\n */\n startFieldsListening() {\n if (ctPublic.data__cookies_type !== 'alternative') {\n this.startFieldsListening();\n // 2nd try to add listeners for delayed appears forms\n setTimeout(this.startFieldsListening, 1000);\n }\n }\n\n /**\n * Listen autocomplete\n * @return {void}\n */\n listenAutocomplete() {\n window.addEventListener('animationstart', this.apbctOnAnimationStart, true);\n window.addEventListener('input', this.apbctOnInput, true);\n }\n\n /**\n * Gathering typo data\n * @return {void}\n */\n gatheringTypoData() {\n document.ctTypoData = new CTTypoData();\n document.ctTypoData.gatheringFields();\n document.ctTypoData.setListeners();\n }\n\n /**\n * Gathering mouse data\n * @return {void}\n */\n gatheringMouseData() {\n new ApbctCollectingUserMouseActivity();\n }\n\n /**\n * Get screen info\n * @return {string}\n */\n getScreenInfo() {\n // Batch all layout-triggering property reads to avoid forced synchronous layouts\n const docEl = document.documentElement;\n const body = document.body;\n\n // Read all layout properties in one batch\n const layoutData = {\n scrollWidth: docEl.scrollWidth,\n bodyScrollHeight: body.scrollHeight,\n docScrollHeight: docEl.scrollHeight,\n bodyOffsetHeight: body.offsetHeight,\n docOffsetHeight: docEl.offsetHeight,\n bodyClientHeight: body.clientHeight,\n docClientHeight: docEl.clientHeight,\n docClientWidth: docEl.clientWidth,\n };\n\n return JSON.stringify({\n fullWidth: layoutData.scrollWidth,\n fullHeight: Math.max(\n layoutData.bodyScrollHeight, layoutData.docScrollHeight,\n layoutData.bodyOffsetHeight, layoutData.docOffsetHeight,\n layoutData.bodyClientHeight, layoutData.docClientHeight,\n ),\n visibleWidth: layoutData.docClientWidth,\n visibleHeight: layoutData.docClientHeight,\n });\n }\n\n /**\n * Restart listen fields to set ct_has_input_focused or ct_has_key_up\n * @return {void}\n */\n restartFieldsListening() {\n if (!apbctLocalStorage.isSet('ct_has_input_focused') && !apbctLocalStorage.isSet('ct_has_key_up')) {\n this.startFieldsListening();\n }\n }\n\n /**\n * Init listeners for keyup and focus events\n * @return {void}\n */\n startFieldsListening() {\n if (\n (apbctLocalStorage.isSet('ct_has_key_up') || apbctLocalStorage.get('ct_has_key_up')) &&\n (apbctLocalStorage.isSet('ct_has_input_focused') || apbctLocalStorage.get('ct_has_input_focused')) &&\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') !== undefined &&\n ctGetCookie('ct_has_key_up') !== undefined\n )\n ) {\n // already set\n return;\n }\n\n let forms = ctGetPageForms();\n ctPublic.handled_fields = [];\n\n if (forms.length > 0) {\n for (let i = 0; i < forms.length; i++) {\n // handle only inputs and textareas\n const handledFormFields = forms[i].querySelectorAll('input,textarea');\n for (let i = 0; i < handledFormFields.length; i++) {\n if (handledFormFields[i].type !== 'hidden') {\n // collect handled fields to remove handler in the future\n ctPublic.handled_fields.push(handledFormFields[i]);\n // do attach handlers\n apbct_attach_event_handler(handledFormFields[i], 'focus', ctFunctionHasInputFocused);\n apbct_attach_event_handler(handledFormFields[i], 'keyup', ctFunctionHasKeyUp);\n }\n }\n }\n }\n }\n}\n\n/**\n * Class collecting user mouse activity data\n *\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nclass ApbctCollectingUserMouseActivity {\n elementBody = document.querySelector('body');\n collectionForms = document.forms;\n /**\n * Constructor\n */\n constructor() {\n this.setListeners();\n }\n\n /**\n * Set listeners\n */\n setListeners() {\n this.elementBody.addEventListener('click', (event) => {\n this.checkElementInForms(event, 'addClicks');\n });\n\n this.elementBody.addEventListener('mouseup', (event) => {\n const selectedType = document.getSelection().type.toString();\n if (selectedType == 'Range') {\n this.addSelected();\n }\n });\n\n this.elementBody.addEventListener('mousemove', (event) => {\n this.checkElementInForms(event, 'trackMouseMovement');\n });\n }\n\n /**\n * Checking if there is an element in the form\n * @param {object} event\n * @param {string} addTarget\n */\n checkElementInForms(event, addTarget) {\n let resultCheck;\n for (let i = 0; i < this.collectionForms.length; i++) {\n if (\n event.target.outerHTML.length > 0 &&\n this.collectionForms[i].innerHTML.length > 0\n ) {\n resultCheck = this.collectionForms[i].innerHTML.indexOf(event.target.outerHTML);\n } else {\n resultCheck = -1;\n }\n }\n\n switch (addTarget) {\n case 'addClicks':\n if (resultCheck < 0) {\n this.addClicks();\n }\n break;\n case 'trackMouseMovement':\n if (resultCheck > -1) {\n this.trackMouseMovement();\n }\n break;\n default:\n break;\n }\n }\n\n /**\n * Add clicks\n */\n addClicks() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.clicks) {\n document.ctCollectingUserActivityData.clicks++;\n } else {\n document.ctCollectingUserActivityData.clicks = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {clicks: 1};\n }\n\n /**\n * Add selected\n */\n addSelected() {\n if (document.ctCollectingUserActivityData) {\n if (document.ctCollectingUserActivityData.selected) {\n document.ctCollectingUserActivityData.selected++;\n } else {\n document.ctCollectingUserActivityData.selected = 1;\n }\n return;\n }\n\n document.ctCollectingUserActivityData = {selected: 1};\n }\n\n /**\n * Track mouse movement\n */\n trackMouseMovement() {\n if (!document.ctCollectingUserActivityData) {\n document.ctCollectingUserActivityData = {};\n }\n if (!document.ctCollectingUserActivityData.mouseMovementsInsideForm) {\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = false;\n }\n\n document.ctCollectingUserActivityData.mouseMovementsInsideForm = true;\n }\n}\n\n/**\n * Class for gathering data about user typing.\n *\n * ==============================\n * isAutoFill - only person can use auto fill\n * isUseBuffer - use buffer for fill current field\n * ==============================\n * lastKeyTimestamp - timestamp of last key press in current field\n * speedDelta - change for each key press in current field,\n * as difference between current and previous key press timestamps,\n * robots in general have constant speed of typing.\n * If speedDelta is constant for each key press in current field,\n * so, speedDelta will be roughly to 0, then it is robot.\n * ==============================\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nclass CTTypoData {\n fieldData = {\n isAutoFill: false,\n isUseBuffer: false,\n speedDelta: 0,\n firstKeyTimestamp: 0,\n lastKeyTimestamp: 0,\n lastDelta: 0,\n countOfKey: 0,\n };\n\n fields = document.querySelectorAll('textarea[name=comment]');\n\n data = [];\n\n /**\n * Gather fields.\n */\n gatheringFields() {\n let fieldSet = Array.prototype.slice.call(this.fields);\n fieldSet.forEach((field, i) => {\n this.data.push(Object.assign({}, this.fieldData));\n });\n }\n\n /**\n * Set listeners.\n */\n setListeners() {\n this.fields.forEach((field, i) => {\n field.addEventListener('paste', () => {\n this.data[i].isUseBuffer = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('onautocomplete', () => {\n this.data[i].isAutoFill = true;\n });\n });\n\n this.fields.forEach((field, i) => {\n field.addEventListener('input', () => {\n this.data[i].countOfKey++;\n let time = + new Date();\n let currentDelta = 0;\n\n if (this.data[i].countOfKey === 1) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].firstKeyTimestamp = time;\n return;\n }\n\n currentDelta = time - this.data[i].lastKeyTimestamp;\n if (this.data[i].countOfKey === 2) {\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n return;\n }\n\n if (this.data[i].countOfKey > 2) {\n this.data[i].speedDelta += Math.abs(this.data[i].lastDelta - currentDelta);\n this.data[i].lastKeyTimestamp = time;\n this.data[i].lastDelta = currentDelta;\n }\n });\n });\n }\n}\n\n// eslint-disable-next-line camelcase\nconst ctTimeMs = new Date().getTime();\nlet ctMouseEventTimerFlag = true; // Reading interval flag\nlet ctMouseData = [];\nlet ctMouseDataCounter = 0;\nlet ctMouseReadInterval;\nlet ctMouseWriteDataInterval;\n\n\n// Writing first key press timestamp\nconst ctFunctionFirstKey = function output(event) {\n let KeyTimestamp = Math.floor(new Date().getTime() / 1000);\n ctSetCookie('ct_fkp_timestamp', KeyTimestamp);\n ctKeyStopStopListening();\n};\n\n/**\n * Stop mouse observing function\n */\nfunction ctMouseStopData() {\n apbct_remove_event_handler(document, 'mousemove', ctFunctionMouseMove);\n clearInterval(ctMouseReadInterval);\n clearInterval(ctMouseWriteDataInterval);\n}\n\n\n// mouse read\nif (ctPublic.data__key_is_ok) {\n // Reading interval\n ctMouseReadInterval = setInterval(function() {\n ctMouseEventTimerFlag = true;\n }, 150);\n\n // Writting interval\n ctMouseWriteDataInterval = setInterval(function() {\n ctSetCookie('ct_pointer_data', JSON.stringify(ctMouseData));\n }, 1200);\n}\n\n// Logging mouse position each 150 ms\nconst ctFunctionMouseMove = function output(event) {\n ctSetMouseMoved();\n if (ctMouseEventTimerFlag === true) {\n ctMouseData.push([\n Math.round(event.clientY),\n Math.round(event.clientX),\n Math.round(new Date().getTime() - ctTimeMs),\n ]);\n\n ctMouseDataCounter++;\n ctMouseEventTimerFlag = false;\n if (ctMouseDataCounter >= 50) {\n ctMouseStopData();\n }\n }\n};\n\n/**\n * Stop key listening function\n */\nfunction ctKeyStopStopListening() {\n apbct_remove_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_remove_event_handler(document, 'keydown', ctFunctionFirstKey);\n}\n\n/**\n * ctSetHasScrolled\n */\nfunction ctSetHasScrolled() {\n if ( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n ctSetCookie('ct_has_scrolled', 'true');\n apbctLocalStorage.set('ct_has_scrolled', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_scrolled') === undefined\n ) {\n ctSetCookie('ct_has_scrolled', 'true');\n }\n}\n\n/**\n * ctSetMouseMoved\n */\nfunction ctSetMouseMoved() {\n if ( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n ctSetCookie('ct_mouse_moved', 'true');\n apbctLocalStorage.set('ct_mouse_moved', true);\n }\n if (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_mouse_moved') === undefined\n ) {\n ctSetCookie('ct_mouse_moved', 'true');\n }\n}\n\n/**\n * stop listening keyup and focus\n * @param {string} eventName\n * @param {string} functionName\n */\nfunction ctStopFieldsListening(eventName, functionName) {\n if (typeof ctPublic.handled_fields !== 'undefined' && ctPublic.handled_fields.length > 0) {\n for (let i = 0; i < ctPublic.handled_fields.length; i++) {\n apbct_remove_event_handler(ctPublic.handled_fields[i], eventName, functionName);\n }\n }\n}\n\nlet ctFunctionHasInputFocused = function output(event) {\n ctSetHasInputFocused();\n ctStopFieldsListening('focus', ctFunctionHasInputFocused);\n};\n\nlet ctFunctionHasKeyUp = function output(event) {\n ctSetHasKeyUp();\n ctStopFieldsListening('keyup', ctFunctionHasKeyUp);\n};\n\n/**\n * set ct_has_input_focused ct_has_key_up cookies on session period\n */\nfunction ctSetHasInputFocused() {\n if ( ! apbctLocalStorage.isSet('ct_has_input_focused') || ! apbctLocalStorage.get('ct_has_input_focused') ) {\n apbctLocalStorage.set('ct_has_input_focused', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_input_focused') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_input_focused', 'true');\n }\n}\n\n/**\n * ctSetHasKeyUp\n */\nfunction ctSetHasKeyUp() {\n if ( ! apbctLocalStorage.isSet('ct_has_key_up') || ! apbctLocalStorage.get('ct_has_key_up') ) {\n apbctLocalStorage.set('ct_has_key_up', true);\n }\n if (\n (\n (\n ctPublic.data__cookies_type === 'native' &&\n ctGetCookie('ct_has_key_up') === undefined\n ) ||\n ctPublic.data__cookies_type === 'alternative'\n ) ||\n (\n ctPublic.data__cookies_type === 'none' &&\n (\n typeof ctPublic.force_alt_cookies !== 'undefined' ||\n (ctPublic.force_alt_cookies !== undefined && ctPublic.force_alt_cookies)\n )\n )\n ) {\n ctSetCookie('ct_has_key_up', 'true');\n }\n}\n\nif (ctPublic.data__key_is_ok) {\n apbct_attach_event_handler(document, 'mousemove', ctFunctionMouseMove);\n apbct_attach_event_handler(document, 'mousedown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'keydown', ctFunctionFirstKey);\n apbct_attach_event_handler(document, 'scroll', ctSetHasScrolled);\n}\n\n/**\n * @param {mixed} commonCookies\n * @return {string}\n */\nfunction getJavascriptClientData(commonCookies = []) { // eslint-disable-line no-unused-vars\n let resultDataJson = {};\n\n resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n resultDataJson.ct_checked_emails_exist = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails_exist');\n resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n // collecting data from localstorage\n const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const apbctPageHits = apbctLocalStorage.get('apbct_page_hits');\n const apbctPrevReferer = apbctSessionStorage.get('apbct_prev_referer');\n const apbctSiteReferer = apbctSessionStorage.get('apbct_site_referer');\n const ctJsErrorsLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_js_errors');\n const ctPixelUrl = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadless = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n const ctBotDetectorFrontendDataLog = apbctLocalStorage.get(\n ctPublicFunctions.cookiePrefix + 'ct_bot_detector_frontend_data_log',\n );\n\n // collecting data from cookies\n const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n const ctCookiesPixelUrl = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n const apbctHeadlessNative = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\n\n resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ?\n ctMouseMovedLocalStorage : ctMouseMovedCookie;\n resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ?\n ctHasScrolledLocalStorage : ctHasScrolledCookie;\n resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ?\n ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n resultDataJson.apbct_pixel_url = ctPixelUrl !== undefined ?\n ctPixelUrl : ctCookiesPixelUrl;\n resultDataJson.apbct_headless = apbctHeadless !== undefined ?\n apbctHeadless : apbctHeadlessNative;\n resultDataJson.ct_bot_detector_frontend_data_log = ctBotDetectorFrontendDataLog !== undefined ?\n ctBotDetectorFrontendDataLog : '';\n if (resultDataJson.apbct_pixel_url && typeof(resultDataJson.apbct_pixel_url) == 'string') {\n if (resultDataJson.apbct_pixel_url.indexOf('%3A%2F')) {\n resultDataJson.apbct_pixel_url = decodeURIComponent(resultDataJson.apbct_pixel_url);\n }\n }\n\n resultDataJson.apbct_page_hits = apbctPageHits;\n resultDataJson.apbct_prev_referer = apbctPrevReferer;\n resultDataJson.apbct_site_referer = apbctSiteReferer;\n resultDataJson.apbct_ct_js_errors = ctJsErrorsLocalStorage;\n\n if (!resultDataJson.apbct_pixel_url) {\n resultDataJson.apbct_pixel_url = ctPublic.pixel__url;\n }\n\n if (typeof (commonCookies) === 'object') {\n for (let i = 0; i < commonCookies.length; ++i) {\n if ( typeof (commonCookies[i][1]) === 'object' ) {\n // this is for handle SFW cookies\n resultDataJson[commonCookies[i][1][0]] = commonCookies[i][1][1];\n } else {\n resultDataJson[commonCookies[i][0]] = commonCookies[i][1];\n }\n }\n } else {\n console.log('APBCT JS ERROR: Collecting data type mismatch');\n }\n\n // Parse JSON properties to prevent double JSON encoding\n resultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\n return JSON.stringify(resultDataJson);\n}\n\n/**\n * @return {bool}\n */\nfunction ctIsDrawPixel() {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n\n return +ctPublic.pixel__enabled ||\n (ctPublic.data__cookies_type === 'none' && document.querySelectorAll('img#apbct_pixel').length === 0) ||\n (ctPublic.data__cookies_type === 'alternative' && document.querySelectorAll('img#apbct_pixel').length === 0);\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImg(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n ctSetCookie('apbct_pixel_url', pixelUrl);\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', pixelUrl);\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * @param {string} pixelUrl\n * @return {bool}\n */\nfunction ctSetPixelImgFromLocalstorage(pixelUrl) {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n if ( ctIsDrawPixel() ) {\n if ( ! document.getElementById('apbct_pixel') ) {\n let insertedImg = document.createElement('img');\n insertedImg.setAttribute('alt', 'CleanTalk Pixel');\n insertedImg.setAttribute('title', 'CleanTalk Pixel');\n insertedImg.setAttribute('id', 'apbct_pixel');\n insertedImg.setAttribute('style', 'display: none; left: 99999px;');\n insertedImg.setAttribute('src', decodeURIComponent(pixelUrl));\n apbct('body').append(insertedImg);\n }\n }\n}\n\n/**\n * ctGetPixelUrl\n * @return {bool}\n */\n// eslint-disable-next-line no-unused-vars, require-jsdoc\nfunction ctGetPixelUrl() {\n if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {\n return false;\n }\n\n // Check if pixel is already in localstorage and is not outdated\n let localStoragePixelUrl = apbctLocalStorage.get('apbct_pixel_url');\n if ( localStoragePixelUrl !== false ) {\n if ( ! apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n apbctLocalStorage.delete('apbct_pixel_url');\n } else {\n // if so - load pixel from localstorage and draw it skipping AJAX\n ctSetPixelImgFromLocalstorage(localStoragePixelUrl);\n return;\n }\n }\n // Using REST API handler\n if ( ctPublicFunctions.data__ajax_type === 'rest' ) {\n apbct_public_sendREST(\n 'apbct_get_pixel_url',\n {\n method: 'POST',\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n },\n );\n // Using AJAX request and handler\n } else {\n apbct_public_sendAJAX(\n {\n action: 'apbct_get_pixel_url',\n },\n {\n notJson: true,\n callback: function(result) {\n if (result &&\n (typeof result === 'string' || result instanceof String) && result.indexOf('https') === 0) {\n // set pixel url to localstorage\n if ( ! apbctLocalStorage.get('apbct_pixel_url') ) {\n // set pixel to the storage\n apbctLocalStorage.set('apbct_pixel_url', result);\n // update pixel data in the hidden fields\n ctNoCookieAttachHiddenFieldsToForms();\n }\n // then run pixel drawing\n ctSetPixelImg(result);\n }\n },\n beforeSend: function(xhr) {\n xhr.setRequestHeader('X-Robots-Tag', 'noindex, nofollow');\n },\n },\n );\n }\n}\n\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction ctSetPixelUrlLocalstorage(ajaxPixelUrl) {\n // set pixel to the storage\n ctSetCookie('apbct_pixel_url', ajaxPixelUrl);\n}\n\n/**\n * Handler for -webkit based browser that listen for a custom\n * animation create using the :pseudo-selector in the stylesheet.\n * Works with Chrome, Safari\n *\n * @param {AnimationEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnAnimationStart(event) {\n ('onautofillstart' === event.animationName) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Handler for non-webkit based browser that listen for input\n * event to trigger the autocomplete-cancel process.\n * Works with Firefox, Edge, IE11\n *\n * @param {InputEvent} event\n */\n// eslint-disable-next-line no-unused-vars,require-jsdoc\nfunction apbctOnInput(event) {\n ('insertReplacementText' === event.inputType || !('data' in event)) ?\n apbctAutocomplete(event.target) : apbctCancelAutocomplete(event.target);\n}\n\n/**\n * Manage an input element when its value is autocompleted\n * by the browser in the following steps:\n * - add [autocompleted] attribute from event.target\n * - create 'onautocomplete' cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctAutocomplete(element) {\n if (element.hasAttribute('autocompleted')) return;\n element.setAttribute('autocompleted', '');\n\n let event = new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: true, detail: null,\n });\n\n // no autofill if preventDefault is called\n if (!element.dispatchEvent(event)) {\n element.value = '';\n }\n}\n\n/**\n * Manage an input element when its autocompleted value is\n * removed by the browser in the following steps:\n * - remove [autocompleted] attribute from event.target\n * - create 'onautocomplete' non-cancelable CustomEvent\n * - dispatch the Event\n *\n * @param {HtmlInputElement} element\n */\nfunction apbctCancelAutocomplete(element) {\n if (!element.hasAttribute('autocompleted')) return;\n element.removeAttribute('autocompleted');\n\n // dispatch event\n element.dispatchEvent(new window.CustomEvent('onautocomplete', {\n bubbles: true, cancelable: false, detail: null,\n }));\n}\n\n/**\n * ctNoCookieAttachHiddenFieldsToForms\n */\nfunction ctNoCookieAttachHiddenFieldsToForms() {\n if (ctPublic.data__cookies_type !== 'none') {\n return;\n }\n\n let forms = ctGetPageForms();\n\n if (forms) {\n for ( let i = 0; i < forms.length; i++ ) {\n if ( new ApbctHandler().checkHiddenFieldsExclusions(document.forms[i], 'no_cookie') ) {\n continue;\n }\n\n // ignore forms with get method @todo We need to think about this\n if (document.forms[i].getAttribute('method') === null ||\n document.forms[i].getAttribute('method').toLowerCase() === 'post') {\n // remove old sets\n let fields = forms[i].querySelectorAll('.ct_no_cookie_hidden_field');\n for ( let j = 0; j < fields.length; j++ ) {\n fields[j].outerHTML = '';\n }\n // add new set\n document.forms[i].append(new ApbctAttachData().constructNoCookieHiddenField());\n }\n }\n }\n}\n"],"names":["ApbctGatheringData","setSessionId","sessionID","apbctSessionStorage","isSet","apbctLocalStorage","set","Number","get","Math","random","toString","replace","substr","document","referrer","URL","host","location","writeReferrersToSessionStorage","sessionCurrentPage","href","setCookiesType","cookiesType","ctPublic","data__cookies_type","delete","startFieldsListening","this","setTimeout","listenAutocomplete","window","addEventListener","apbctOnAnimationStart","apbctOnInput","gatheringTypoData","ctTypoData","CTTypoData","gatheringFields","setListeners","gatheringMouseData","ApbctCollectingUserMouseActivity","getScreenInfo","docEl","documentElement","body","layoutData","scrollWidth","bodyScrollHeight","scrollHeight","docScrollHeight","bodyOffsetHeight","offsetHeight","docOffsetHeight","bodyClientHeight","clientHeight","docClientHeight","docClientWidth","clientWidth","JSON","stringify","fullWidth","fullHeight","max","visibleWidth","visibleHeight","restartFieldsListening","undefined","ctGetCookie","let","forms","ctGetPageForms","handled_fields","length","i","handledFormFields","querySelectorAll","type","push","apbct_attach_event_handler","ctFunctionHasInputFocused","ctFunctionHasKeyUp","elementBody","querySelector","collectionForms","constructor","checkElementInForms","event","getSelection","addSelected","addTarget","resultCheck","target","outerHTML","innerHTML","indexOf","addClicks","trackMouseMovement","ctCollectingUserActivityData","clicks","selected","mouseMovementsInsideForm","fieldData","isAutoFill","isUseBuffer","speedDelta","firstKeyTimestamp","lastKeyTimestamp","lastDelta","countOfKey","fields","data","Array","prototype","slice","call","forEach","field","Object","assign","currentDelta","time","Date","abs","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctMouseReadInterval","ctMouseWriteDataInterval","ctFunctionFirstKey","KeyTimestamp","floor","ctSetCookie","ctKeyStopStopListening","ctMouseStopData","apbct_remove_event_handler","ctFunctionMouseMove","clearInterval","data__key_is_ok","setInterval","ctSetMouseMoved","round","clientY","clientX","ctSetHasScrolled","ctStopFieldsListening","eventName","functionName","ctSetHasInputFocused","ctSetHasKeyUp","force_alt_cookies","getJavascriptClientData","commonCookies","resultDataJson","ct_checked_emails","ctPublicFunctions","cookiePrefix","ct_checked_emails_exist","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","apbctPageHits","apbctPrevReferer","apbctSiteReferer","ctJsErrorsLocalStorage","ctPixelUrl","apbctHeadless","ctBotDetectorFrontendDataLog","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ctCookiesPixelUrl","apbctHeadlessNative","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","apbct_pixel_url","apbct_headless","ct_bot_detector_frontend_data_log","decodeURIComponent","apbct_page_hits","apbct_prev_referer","apbct_site_referer","apbct_ct_js_errors","pixel__url","console","log","removeDoubleJsonEncoding","ctIsDrawPixel","pixel__setting","bot_detector_enabled","pixel__enabled","ctSetPixelImg","pixelUrl","insertedImg","getElementById","createElement","setAttribute","apbct","append","ctSetPixelImgFromLocalstorage","ctGetPixelUrl","localStoragePixelUrl","isAlive","data__ajax_type","apbct_public_sendREST","method","callback","result","String","ctNoCookieAttachHiddenFieldsToForms","apbct_public_sendAJAX","action","notJson","beforeSend","xhr","setRequestHeader","ctSetPixelUrlLocalstorage","ajaxPixelUrl","animationName","apbctAutocomplete","apbctCancelAutocomplete","inputType","element","hasAttribute","CustomEvent","bubbles","cancelable","detail","dispatchEvent","value","removeAttribute","ApbctHandler","checkHiddenFieldsExclusions","getAttribute","toLowerCase","j","ApbctAttachData","constructNoCookieHiddenField"],"mappings":"MAGMA,mBAKFC,eACI,IACUC,EADLC,oBAAoBC,MAAM,kBAAkB,EAW7CC,kBAAkBC,IAAI,kBAAmBC,OAAOF,kBAAkBG,IAAI,iBAAiB,CAAC,EAAI,CAAC,GAVvFN,EAAYO,KAAKC,OAAO,EAAEC,SAAS,EAAE,EAAEC,QAAQ,WAAY,EAAE,EAAEC,OAAO,EAAG,EAAE,EACjFV,oBAAoBG,IAAI,mBAAoBJ,EAAW,CAAA,CAAK,EAC5DG,kBAAkBC,IAAI,kBAAmB,CAAC,EACtCQ,SAASC,UACQ,IAAIC,IAAIF,SAASC,QAAQ,EAC3BE,OAASC,SAASD,MAC7Bd,oBAAoBG,IAAI,qBAAsBQ,SAASC,SAAU,CAAA,CAAK,EAMtF,CAMAI,iCACI,IAAMC,EAAqBjB,oBAAoBK,IAAI,4BAA4B,EAErD,CAAA,IAAtBY,GAA+BN,SAASI,SAASG,OAASD,GAC1DjB,oBAAoBG,IAAI,qBAAsBc,EAAoB,CAAA,CAAK,EAG3EjB,oBAAoBG,IAAI,6BAA8BQ,SAASI,SAASG,KAAM,CAAA,CAAK,CACvF,CAOAC,iBACI,IAAMC,EAAclB,kBAAkBG,IAAI,iBAAiB,EACpDe,GAAeA,IAAgBC,SAASC,qBAC3CpB,kBAAkBC,IAAI,kBAAmBkB,SAASC,kBAAkB,EACpEpB,kBAAkBqB,OAAO,gBAAgB,EACzCrB,kBAAkBqB,OAAO,iB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C,GAAK,EAAA,IAAIsK,cAAeC,4BAA4BnO,SAASwD,MAAMI,GAAI,WAAW,IAKjC,OAA7C5D,SAASwD,MAAMI,GAAGwK,aAAa,QAAQ,GACoB,SAA3DpO,SAASwD,MAAMI,GAAGwK,aAAa,QAAQ,EAAEC,YAAY,GAAc,CAEnE9K,IAAIyC,EAASxC,EAAMI,GAAGE,iBAAiB,4BAA4B,EACnE,IAAMP,IAAI+K,EAAI,EAAGA,EAAItI,EAAOrC,OAAQ2K,CAAC,GACjCtI,EAAOsI,GAAGvJ,UAAY,GAG1B/E,SAASwD,MAAMI,GAAGqI,QAAO,IAAIsC,iBAAkBC,6BAA6B,CAAC,CACjF,CApBR,CAuBJ,CApUI9N,SAASoH,kBACT7D,2BAA2BjE,SAAU,YAAa4H,mBAAmB,EACrE3D,2BAA2BjE,SAAU,YAAaqH,kBAAkB,EACpEpD,2BAA2BjE,SAAU,UAAWqH,kBAAkB,EAClEpD,2BAA2BjE,SAAU,SAAUoI,gBAAgB"}
\ No newline at end of file
diff --git a/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js
index 8d7b6dae3..c34b8f760 100644
--- a/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js
+++ b/js/src/FetchProxyProtection/ApbctFetchProxyProtection.js
@@ -57,7 +57,7 @@ class ApbctFetchProxyProtection {
data.raw_body = bodyText;
}
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventToken = new ApbctHandler().toolGetEventToken();
if (eventToken) {
data.ct_bot_detector_event_token = eventToken;
@@ -142,4 +142,4 @@ class ApbctFetchProxyProtection {
const bodyText = this.extractBodyText(args);
return await this.checkRequest(match.formKey, match.config, bodyText);
}
-}
\ No newline at end of file
+}
diff --git a/js/src/common-decoder.js b/js/src/common-decoder.js
index 39d1c9f85..ee26f902d 100644
--- a/js/src/common-decoder.js
+++ b/js/src/common-decoder.js
@@ -111,7 +111,7 @@ function apbctAjaxEmailDecodeBulk(event, encodedEmailNodes, clickSource) {
referrer: document.referrer,
encodedEmails: '',
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
diff --git a/js/src/public-1-functions.js b/js/src/public-1-functions.js
index 5e27ff3f7..793f270b4 100644
--- a/js/src/public-1-functions.js
+++ b/js/src/public-1-functions.js
@@ -135,7 +135,7 @@ function ctSetCookie( cookies, value, expires ) {
// do it just once
ctSetAlternativeCookie(cookies, {forceAltCookies: true});
} else {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
ctNoCookieAttachHiddenFieldsToForms();
}
}
@@ -173,7 +173,7 @@ function ctSetAlternativeCookie(cookies, params) {
if (Array.isArray(cookies)) {
cookies = getJavascriptClientData(cookies);
}
- } else if (!+ctPublic.settings__data__bot_detector_enabled) {
+ } else if (!+ctPublic.bot_detector_enabled) {
console.log('APBCT ERROR: getJavascriptClientData() is not loaded');
}
diff --git a/js/src/public-1-main.js b/js/src/public-1-main.js
index 2b059ff34..e2a0247f5 100644
--- a/js/src/public-1-main.js
+++ b/js/src/public-1-main.js
@@ -92,7 +92,7 @@ class ApbctAttachData {
if (typeof ctPublic.force_alt_cookies == 'undefined' ||
(ctPublic.force_alt_cookies !== 'undefined' && !ctPublic.force_alt_cookies)
) {
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
ctNoCookieAttachHiddenFieldsToForms();
document.addEventListener('gform_page_loaded', ctNoCookieAttachHiddenFieldsToForms);
}
@@ -162,7 +162,7 @@ class ApbctAttachData {
event.target.action && event.target.action.toString().indexOf('mailpoet_subscription_form') !== -1
) {
window.XMLHttpRequest.prototype.send = function(data) {
- if (!+ctPublic.settings__data__bot_detector_enabled) {
+ if (!+ctPublic.bot_detector_enabled) {
const noCookieData = 'data%5Bct_no_cookie_hidden_field%5D=' + getNoCookieData() + '&';
defaultSend.call(this, noCookieData + data);
} else {
@@ -477,7 +477,7 @@ class ApbctHandler {
cronFormsHandler(cronStartTimeout = 2000) {
setTimeout(function() {
setInterval(function() {
- if (!+ctPublic.settings__data__bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
+ if (!+ctPublic.bot_detector_enabled && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().restartFieldsListening();
}
new ApbctEventTokenTransport().restartBotDetectorEventTokenAttach();
@@ -547,7 +547,7 @@ class ApbctHandler {
let addidionalCleantalkData = '';
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -564,7 +564,7 @@ class ApbctHandler {
if (isNeedToAddCleantalkDataCheckFormData) {
if (!(
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
)) {
let noCookieData = getNoCookieData();
@@ -622,7 +622,7 @@ class ApbctHandler {
args[1].body instanceof FormData || (typeof args[1].body.append === 'function')
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
args[1].body.append(
@@ -782,7 +782,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -798,7 +798,7 @@ class ApbctHandler {
try {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
} catch (e) {
// Continue even if error
@@ -819,7 +819,7 @@ class ApbctHandler {
if (+ctPublic.settings__forms__wc_add_to_cart) {
args[1].body = attachFieldsToBody(
args[1].body,
- selectFieldsData(+ctPublic.settings__data__bot_detector_enabled),
+ selectFieldsData(+ctPublic.bot_detector_enabled),
);
}
} catch (e) {
@@ -1149,7 +1149,7 @@ class ApbctHandler {
let visibleFieldsString = '';
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
const token = new ApbctHandler().toolGetEventToken();
@@ -1215,7 +1215,7 @@ class ApbctHandler {
options.data.requests[0].path === '/wc/store/v1/cart/add-item'
) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
let token = localStorage.getItem('bot_detector_event_token');
@@ -1230,7 +1230,7 @@ class ApbctHandler {
// checkout
if (options.path.includes('/wc/store/v1/checkout')) {
if (
- +ctPublic.settings__data__bot_detector_enabled &&
+ +ctPublic.bot_detector_enabled &&
apbctLocalStorage.get('bot_detector_event_token')
) {
options.data.ct_bot_detector_event_token = localStorage.getItem('bot_detector_event_token');
@@ -1805,7 +1805,7 @@ async function apbct_ready() {
if (
apbctLocalStorage.get('apbct_existing_visitor') && // Not for the first hit
- +ctPublic.settings__data__bot_detector_enabled && // If Bot-Detector is active
+ +ctPublic.bot_detector_enabled && // If Bot-Detector is active
!apbctLocalStorage.get('bot_detector_event_token') && // and no `event_token` generated
typeof ApbctGatheringData === 'undefined' // and no `gathering` loaded yet
) {
@@ -1824,7 +1824,7 @@ async function apbct_ready() {
// Gathering data when bot detector is disabled
if (
- ( ! +ctPublic.settings__data__bot_detector_enabled || gatheringLoaded ) &&
+ ( ! +ctPublic.bot_detector_enabled || gatheringLoaded ) &&
typeof ApbctGatheringData !== 'undefined'
) {
const gatheringData = new ApbctGatheringData();
@@ -1846,7 +1846,7 @@ async function apbct_ready() {
setTimeout(function() {
// Attach data when bot detector is enabled
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
const eventTokenTransport = new ApbctEventTokenTransport();
eventTokenTransport.attachEventTokenToMultipageGravityForms();
eventTokenTransport.attachEventTokenToWoocommerceGetRequestAddToCart();
@@ -1855,7 +1855,7 @@ async function apbct_ready() {
const attachData = new ApbctAttachData();
// Attach data when bot detector is disabled or blocked
- if (!+ctPublic.settings__data__bot_detector_enabled || gatheringLoaded) {
+ if (!+ctPublic.bot_detector_enabled || gatheringLoaded) {
attachData.attachHiddenFieldsToForms(gatheringLoaded);
}
@@ -1882,7 +1882,7 @@ async function apbct_ready() {
handler.catchJqueryAjax();
handler.catchWCRestRequestAsMiddleware();
- if (+ctPublic.settings__data__bot_detector_enabled) {
+ if (+ctPublic.bot_detector_enabled) {
let botDetectorEventTokenStored = false;
window.addEventListener('botDetectorEventTokenUpdated', (event) => {
const botDetectorEventToken = event.detail?.eventToken;
@@ -1902,7 +1902,7 @@ async function apbct_ready() {
});
}
- if (ctPublic.settings__sfw__anti_crawler && +ctPublic.settings__data__bot_detector_enabled) {
+ if (ctPublic.settings__sfw__anti_crawler && +ctPublic.bot_detector_enabled) {
handler.toolForAntiCrawlerCheckDuringBotDetector();
}
diff --git a/js/src/public-2-external-forms.js b/js/src/public-2-external-forms.js
index 804ce37c8..080c216a1 100644
--- a/js/src/public-2-external-forms.js
+++ b/js/src/public-2-external-forms.js
@@ -66,7 +66,7 @@ function ctProtectExternal() {
// Trying to process external form into an iframe
apbctProcessIframes();
// if form is still not processed by fields listening, do it here
- if (ctPublic.settings__data__bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
+ if (ctPublic.bot_detector_enabled != 1 && typeof ApbctGatheringData !== 'undefined') {
new ApbctGatheringData().startFieldsListening();
}
}
diff --git a/js/src/public-2-force-protection.js b/js/src/public-2-force-protection.js
index d1383be43..5ca2982ab 100644
--- a/js/src/public-2-force-protection.js
+++ b/js/src/public-2-force-protection.js
@@ -34,7 +34,7 @@ class ApbctForceProtection {
post_url: document.location.href,
referrer: document.referrer,
};
- if (ctPublic.settings__data__bot_detector_enabled == 1) {
+ if (+ctPublic.bot_detector_enabled) {
data.event_token = apbctLocalStorage.get('bot_detector_event_token');
} else {
data.event_javascript_data = getJavascriptClientData();
diff --git a/js/src/public-2-gathering-data.js b/js/src/public-2-gathering-data.js
index d36444c5d..de8463ed1 100644
--- a/js/src/public-2-gathering-data.js
+++ b/js/src/public-2-gathering-data.js
@@ -643,7 +643,7 @@ function getJavascriptClientData(commonCookies = []) { // eslint-disable-line no
* @return {bool}
*/
function ctIsDrawPixel() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
@@ -657,7 +657,7 @@ function ctIsDrawPixel() {
* @return {bool}
*/
function ctSetPixelImg(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
ctSetCookie('apbct_pixel_url', pixelUrl);
@@ -679,7 +679,7 @@ function ctSetPixelImg(pixelUrl) {
* @return {bool}
*/
function ctSetPixelImgFromLocalstorage(pixelUrl) {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
if ( ctIsDrawPixel() ) {
@@ -701,7 +701,7 @@ function ctSetPixelImgFromLocalstorage(pixelUrl) {
*/
// eslint-disable-next-line no-unused-vars, require-jsdoc
function ctGetPixelUrl() {
- if (ctPublic.pixel__setting == '3' && ctPublic.settings__data__bot_detector_enabled == '1') {
+ if (ctPublic.pixel__setting == '3' && +ctPublic.bot_detector_enabled) {
return false;
}
diff --git a/js/src/public-3-bot-detector-log.js b/js/src/public-3-bot-detector-log.js
index 051619e14..6630a29e6 100644
--- a/js/src/public-3-bot-detector-log.js
+++ b/js/src/public-3-bot-detector-log.js
@@ -3,8 +3,8 @@ let botDetectorLogEventTypesCollected = [];
// bot_detector frontend_data log alt session saving cron
if (
- ctPublicFunctions.hasOwnProperty('data__bot_detector_enabled') &&
- ctPublicFunctions.data__bot_detector_enabled == 1 &&
+ ctPublicFunctions.hasOwnProperty('bot_detector_enabled') &&
+ +ctPublicFunctions.bot_detector_enabled &&
ctPublicFunctions.hasOwnProperty('data__frontend_data_log_enabled') &&
ctPublicFunctions.data__frontend_data_log_enabled == 1
) {
diff --git a/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php b/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php
index dd88c3c68..ad0721c35 100644
--- a/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php
+++ b/lib/Cleantalk/ApbctWP/ApbctJsBundleResolver.php
@@ -29,7 +29,7 @@ public static function getBundleName($settings)
$script = 'apbct-public-bundle.min.js';
}
- if (isset($settings['data__bot_detector_enabled']) && $settings['data__bot_detector_enabled'] != '1') {
+ if ( ! apbct__is_bot_detector_enabled() ) {
$script = str_replace('.min.js', '_gathering.min.js', $script);
}
diff --git a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php
index bece59f24..ef5d569af 100644
--- a/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php
+++ b/lib/Cleantalk/ApbctWP/ContactsEncoder/ContactsEncoder.php
@@ -219,7 +219,7 @@ protected function checkRequest()
$event_javascript_data = '';
$event_token = '';
- if ($apbct->settings['data__bot_detector_enabled'] == 1) {
+ if ( apbct__is_bot_detector_enabled() ) {
$event_token = Post::getString('event_token');
} else {
$post_event_javascript_data = TT::toString(Post::get('event_javascript_data'));
diff --git a/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php b/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php
index b7cd38022..a6dbfd0e7 100644
--- a/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php
+++ b/lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php
@@ -510,7 +510,7 @@ public function printDiePage()
'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
'data__cookies_type' => $apbct->data['cookies_type'],
'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
- 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'],
+ 'bot_detector_enabled' => apbct__is_bot_detector_enabled(),
);
$replaces = array(
diff --git a/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php b/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php
index 28ba56678..58f1fad5f 100644
--- a/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php
+++ b/lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php
@@ -302,7 +302,7 @@ public function printDiePage()
'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
'data__cookies_type' => $apbct->data['cookies_type'],
'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
- 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'],
+ 'bot_detector_enabled' => apbct__is_bot_detector_enabled(),
);
$replaces = array(
diff --git a/lib/Cleantalk/ApbctWP/Firewall/SFW.php b/lib/Cleantalk/ApbctWP/Firewall/SFW.php
index 36c8c3774..da6f04e93 100644
--- a/lib/Cleantalk/ApbctWP/Firewall/SFW.php
+++ b/lib/Cleantalk/ApbctWP/Firewall/SFW.php
@@ -542,7 +542,7 @@ public function printDiePage()
'data__email_check_before_post' => $apbct->settings['data__email_check_before_post'],
'data__cookies_type' => $apbct->data['cookies_type'],
'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
- 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'],
+ 'bot_detector_enabled' => apbct__is_bot_detector_enabled(),
);
$replaces = array(
diff --git a/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php b/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php
index 0f075d1a6..c1bbcdcaf 100644
--- a/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php
+++ b/lib/Cleantalk/ApbctWP/Localize/CtPublicFunctionsLocalize.php
@@ -22,7 +22,7 @@ public static function getData()
'_rest_url' => Escape::escUrl(apbct_get_rest_url()),
'data__cookies_type' => $apbct->data['cookies_type'],
'data__ajax_type' => $apbct->data['ajax_type'],
- 'data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'],
+ 'bot_detector_enabled' => apbct__is_bot_detector_enabled(),
'data__frontend_data_log_enabled' => defined('APBCT_DO_NOT_COLLECT_FRONTEND_DATA_LOGS') ? 0 : 1,
'cookiePrefix' => apbct__get_cookie_prefix(),
'wprocket_detected' => apbct_is_plugin_active('wp-rocket/wp-rocket.php'),
diff --git a/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php b/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php
index 331ccc71f..361e4fcda 100644
--- a/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php
+++ b/lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php
@@ -20,7 +20,7 @@ public static function getData()
'settings__forms__force_protection' => $apbct->settings['forms__force_protection'],
'settings__forms__search_test' => $apbct->settings['forms__search_test'],
'settings__forms__wc_add_to_cart' => $apbct->settings['forms__wc_add_to_cart'],
- 'settings__data__bot_detector_enabled' => $apbct->settings['data__bot_detector_enabled'],
+ 'bot_detector_enabled' => apbct__is_bot_detector_enabled(),
'settings__sfw__anti_crawler' => $apbct->settings['sfw__anti_crawler'],
'blog_home' => get_home_url() . '/',
'pixel__setting' => $apbct->settings['data__pixel'],
diff --git a/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php b/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php
index eb849ce6f..711429a03 100644
--- a/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php
+++ b/lib/Cleantalk/ApbctWP/PluginSettingsPage/SummaryAndSupportRenderer.php
@@ -96,6 +96,7 @@ private function renderStatistics()
%s
%s
%s
+ %s
';
@@ -106,6 +107,7 @@ private function renderStatistics()
$this->renderLastSfwBlock(),
$this->renderSfwUpdate(),
$this->renderSfwLogs(),
+ $this->renderBotDetectorState(),
$this->renderPluginVersion()
);
@@ -287,6 +289,18 @@ private function renderSfwLogs()
return $this->wrapListItem($html);
}
+ public function renderBotDetectorState()
+ {
+ return $this->wrapListItem(
+ sprintf(
+ esc_html__('JavaScript library (Bot Detector) is %s', 'cleantalk-spam-protect'),
+ apbct__is_bot_detector_enabled()
+ ? esc_html__('enabled', 'cleantalk-spam-protect')
+ : esc_html__('disabled', 'cleantalk-spam-protect')
+ )
+ . '
'
+ );
+ }
/**
* Renders the current plugin version.
diff --git a/lib/Cleantalk/ApbctWP/RemoteCalls.php b/lib/Cleantalk/ApbctWP/RemoteCalls.php
index f347559ba..60b3f4cac 100644
--- a/lib/Cleantalk/ApbctWP/RemoteCalls.php
+++ b/lib/Cleantalk/ApbctWP/RemoteCalls.php
@@ -531,7 +531,6 @@ private static function getSettings($settings)
'data__use_static_js_key' => 'Use static keys for JavaScript check',
'data__general_postdata_test' => 'Check all post data',
'data__set_cookies' => 'Set cookies',
- 'data__bot_detector_enabled' => 'Use JavaScript library',
'exclusions__bot_detector' => 'JavaScript Library Exclusions',
'exclusions__bot_detector__form_attributes' => 'Exclude any forms that has attribute matches',
'exclusions__bot_detector__form_children_attributes' => 'Exclude any forms that includes a child element with attribute matches',
diff --git a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php
index 67122704d..5e04d6f3c 100644
--- a/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php
+++ b/lib/Cleantalk/ApbctWP/RequestParameters/SubmitTimeHandler.php
@@ -70,10 +70,8 @@ final public static function setToRequest($current_timestamp, &$cookie_test_valu
*/
final public static function isCalculationDisabled()
{
- global $apbct;
-
// Return the value of the bot detector setting
- return $apbct->settings['data__bot_detector_enabled']
+ return apbct__is_bot_detector_enabled()
? !RequestParameters::get('ct_gathering_loaded')
: false;
}
diff --git a/lib/Cleantalk/ApbctWP/ServiceConstants.php b/lib/Cleantalk/ApbctWP/ServiceConstants.php
index 7c8c05288..84b4b4b77 100644
--- a/lib/Cleantalk/ApbctWP/ServiceConstants.php
+++ b/lib/Cleantalk/ApbctWP/ServiceConstants.php
@@ -20,6 +20,13 @@ class ServiceConstants
*/
public $set_ajax_route_type;
+ /**
+ * Is BotDetector enabled/disabled
+ * @var ApbctConstant
+ * @psalm-suppress PossiblyUnusedProperty
+ */
+ public $bot_detector_enabled;
+
public function __construct()
{
$this->disable_empty_email_exception = new ApbctConstant(
@@ -42,6 +49,10 @@ public function __construct()
),
'Provides AJAX route type'
);
+ $this->bot_detector_enabled = new ApbctConstant(
+ array('APBCT_SERVICE__BOT_DETECTOR_ENABLED'),
+ 'Allows to set Bot-Detector enabled/disabled'
+ );
// $accepted_constants = array(
// // needs to be refactored
// 'APBCT_SERVICE__SELF_OWNED_ACCESS_KEY' => array(
diff --git a/lib/Cleantalk/ApbctWP/State.php b/lib/Cleantalk/ApbctWP/State.php
index 402a8ac6f..92a01c04f 100644
--- a/lib/Cleantalk/ApbctWP/State.php
+++ b/lib/Cleantalk/ApbctWP/State.php
@@ -84,7 +84,6 @@ class State extends \Cleantalk\Common\State
'data__use_static_js_key' => -1,
'data__general_postdata_test' => 0, //CAPD
'data__set_cookies' => 3, // Cookies type: 0 - Off / 1 - Native cookies / 2 - Alt cookies / 3 - Auto
- 'data__bot_detector_enabled' => 1,
'data__pixel' => '3',
'data__email_check_before_post' => 1,
'data__email_check_exist_post' => 1,
diff --git a/tests/Antispam/IntegrationsByHook/TestFluentForms.php b/tests/Antispam/IntegrationsByHook/TestFluentForms.php
index 51183a620..9de8f831d 100644
--- a/tests/Antispam/IntegrationsByHook/TestFluentForms.php
+++ b/tests/Antispam/IntegrationsByHook/TestFluentForms.php
@@ -8,6 +8,8 @@
class TestFluentForms extends TestCase
{
+ private $post;
+
/** @var FluentForm */
private $fluentForm;
diff --git a/tests/Antispam/IntegrationsByHook/TestNinjaForms.php b/tests/Antispam/IntegrationsByHook/TestNinjaForms.php
index 27ff679ca..4249fe5e5 100644
--- a/tests/Antispam/IntegrationsByHook/TestNinjaForms.php
+++ b/tests/Antispam/IntegrationsByHook/TestNinjaForms.php
@@ -11,6 +11,8 @@
class TestNinjaForms extends TestCase
{
+ private $post;
+
/** @var NinjaForms */
private $ninjaForms;
diff --git a/tests/ApbctWP/TestSubmitTimeHandler.php b/tests/ApbctWP/TestSubmitTimeHandler.php
index 4d86edb9e..52c53ba7c 100644
--- a/tests/ApbctWP/TestSubmitTimeHandler.php
+++ b/tests/ApbctWP/TestSubmitTimeHandler.php
@@ -9,8 +9,10 @@ public function testGetFromRequestReturnsNullWhenCalculationDisabled()
{
global $apbct;
$apbct = (object) [
- 'settings' => ['data__bot_detector_enabled' => true],
- 'data' => ['cookies_type' => 'alternative']
+ 'data' => [
+ 'cookies_type' => 'alternative',
+ 'bot_detector_enabled' => true
+ ]
];
$result = SubmitTimeHandler::getFromRequest();
@@ -23,8 +25,10 @@ public function testSetToRequestModifiesArrayRegardlessOfCalculationDisabled()
{
global $apbct;
$apbct = (object) [
- 'settings' => ['data__bot_detector_enabled' => true],
- 'data' => ['cookies_type' => 'alternative']
+ 'data' => [
+ 'cookies_type' => 'alternative',
+ 'bot_detector_enabled' => true
+ ]
];
$cookie_test_value = [];
@@ -40,8 +44,10 @@ public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled()
{
global $apbct;
$apbct = (object) [
- 'settings' => ['data__bot_detector_enabled' => true],
- 'data' => ['cookies_type' => 'alternative']
+ 'data' => [
+ 'cookies_type' => 'alternative',
+ 'bot_detector_enabled' => true
+ ]
];
$result = SubmitTimeHandler::isCalculationDisabled();
@@ -52,7 +58,7 @@ public function testIsCalculationDisabledReturnsTrueWhenBotDetectorEnabled()
public function testIsCalculationDisabledReturnsFalseWhenBotDetectorDisabled()
{
global $apbct;
- $apbct = (object) ['settings' => ['data__bot_detector_enabled' => false]];
+ $apbct = (object) ['data' => ['bot_detector_enabled' => false]];
$result = SubmitTimeHandler::isCalculationDisabled();
diff --git a/tests/Inc/TestCleantalkSettings.php b/tests/Inc/TestCleantalkSettings.php
new file mode 100644
index 000000000..9e8bbc108
--- /dev/null
+++ b/tests/Inc/TestCleantalkSettings.php
@@ -0,0 +1,29 @@
+assertArrayHasKey('data_processing', $fields);
+
+ $data_processing_options = $fields['data_processing']['fields'];
+
+ $this->assertArrayNotHasKey('data__bot_detector_enabled', $data_processing_options);
+ $this->assertArrayHasKey('bot_detector_state', $data_processing_options);
+ $this->assertArrayHasKey('callback', $data_processing_options['bot_detector_state']);
+ $this->assertArrayHasKey('long_description', $data_processing_options['bot_detector_state']);
+ $this->assertArrayHasKey('display', $data_processing_options['bot_detector_state']);
+ $this->assertArrayNotHasKey('parent', $data_processing_options['exclusions__bot_detector']);
+ }
+}
\ No newline at end of file
diff --git a/tests/StandaloneFunctions/TestBotDetectorLogGathering.php b/tests/StandaloneFunctions/TestBotDetectorLogGathering.php
index e67f8094f..133e0a9a3 100644
--- a/tests/StandaloneFunctions/TestBotDetectorLogGathering.php
+++ b/tests/StandaloneFunctions/TestBotDetectorLogGathering.php
@@ -11,7 +11,7 @@ class TestBotDetectorLogGathering extends TestCase
public function test_returnsFrontendDataLog()
{
global $apbct;
- $apbct->settings['data__bot_detector_enabled'] = '1';
+ $apbct->data['bot_detector_enabled'] = '1';
AltSessions::set('ct_bot_detector_frontend_data_log', json_encode(['log' => 'data']));
$result = apbct__bot_detector_get_fd_log();
@@ -27,7 +27,7 @@ public function test_returnsFrontendDataLog()
public function test_returnsErrorWhenDisabled()
{
global $apbct;
- $apbct->settings['data__bot_detector_enabled'] = '0';
+ $apbct->data['bot_detector_enabled'] = '0';
$result = apbct__bot_detector_get_fd_log();
$expected = json_encode([
@@ -42,7 +42,7 @@ public function test_returnsErrorWhenDisabled()
public function test_returnsErrorWhenNoLogFound()
{
global $apbct;
- $apbct->settings['data__bot_detector_enabled'] = '1';
+ $apbct->data['bot_detector_enabled'] = '1';
AltSessions::wipe();
$result = apbct__bot_detector_get_fd_log();
@@ -58,7 +58,7 @@ public function test_returnsErrorWhenNoLogFound()
public function test_returnsErrorWhenLogNotString()
{
global $apbct;
- $apbct->settings['data__bot_detector_enabled'] = '1';
+ $apbct->data['bot_detector_enabled'] = '1';
AltSessions::set('ct_bot_detector_frontend_data_log', false);
$result = apbct__bot_detector_get_fd_log();
@@ -74,7 +74,7 @@ public function test_returnsErrorWhenLogNotString()
public function test_returnsErrorWhenLogNotJson()
{
global $apbct;
- $apbct->settings['data__bot_detector_enabled'] = '1';
+ $apbct->data['bot_detector_enabled'] = '1';
AltSessions::set('ct_bot_detector_frontend_data_log', 'invalid json');
$result = apbct__bot_detector_get_fd_log();