1function wts_init() { 2 window.wts_data = window.wts_data || {}; 3 4 if (!window.wts_data.is_admin && window.wts_data.alias && window.wts_data.db) { 5 window.wts_data.fetched = 1; 6 recordHit(); 7 return; 8 } else if (window.wts_data.is_admin && window.wts_data.alias && window.wts_data.db && window.wts_data.oc_a2) { 9 window.wts_data.fetched = 1; 10 initAdmin(); 11 return; 12 } 13 14 fetchData().then(function() { 15 if (window.wts_data.is_admin) { 16 initAdmin(); 17 } else { 18 recordHit(); 19 } 20 }); 21} 22 23function fetchData() { 24 return fetch(wts_data.ajax_url, { 25 method: 'POST', 26 headers: { 27 'Content-Type': 'application/x-www-form-urlencoded' 28 }, 29 body: new URLSearchParams({ 30 JSON_data: JSON.stringify(window.wts_data) 31 }) 32 }) 33 .then(function(response) { 34 return response.json(); 35 }) 36 .then(function(data) { 37 if (data && Object.keys(data).length > 0) { 38 if (window.wts_data.is_admin) { 39 sendDataToPHP(data); 40 } 41 window.wts_data.fetched = true; 42 Object.assign(window.wts_data, data); 43 } 44 }) 45 .catch(function(error) { 46 console.error('Error fetching data:', error); 47 }); 48} 49 50function recordHit() { 51 var script = document.createElement('script'); 52 script.src = 'https://app.ardalio.com/log7.js'; 53 script.onload = function() { 54 var wts_div = document.createElement("div"); 55 wts_div.setAttribute("id", "wts" + wts_data.alias); 56 wts_div.style.textAlign = "center"; 57 document.body.appendChild(wts_div); 58 window.wts7 = {}; 59 window.wts7.user_id = wts_data.user_info; 60 window.wts7.params = "wordPress"; 61 wtslog7(wts_data.alias, wts_data.db); 62 }; 63 document.head.appendChild(script); 64} 65 66function initAdmin() { 67 return; 68} 69 70function sendDataToPHP(data) { 71 fetch(wts_data.php_ajax_url, { 72 method: 'POST', 73 headers: { 74 'Content-Type': 'application/x-www-form-urlencoded' 75 }, 76 body: new URLSearchParams({ 77 action: 'handle_ajax_data', 78 nonce: wts_data.nonce, 79 data: JSON.stringify(data) 80 }) 81 }) 82 .then(function(response) { 83 console.log(response); 84 return response.json(); 85 }) 86 .then(function(response) { 87 if (response.success) { 88 console.log('Data sent to PHP successfully'); 89 } else { 90 console.error('Error sending data to PHP:', response.data); 91 } 92 }) 93 .catch(function(error) { 94 console.error('Error sending data to PHP:', error); 95 }); 96} 97 98if (document.readyState !== 'loading') { 99 wts_init(); 100} else { 101 document.addEventListener('DOMContentLoaded', wts_init); 102} 103
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.