Support » Plugin: Ads by WPQuads – Adsense Ads, Banner Ads, Popup Ads » Too much unnecessary code on the plugin page

  • Resolved Danishsard

    (@danishsard)


    Hello, when I have disabled adblock and other add-ons, such codes appear on the plugin page anyway.

    Maybe it is worth doing so that when certain things are not used, the given code is not added to the pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support WPQuads Support

    (@wpquadssupport)

    Can you please send few screenshots of the issue? we will analyze them and let you know.

    Thread Starter Danishsard

    (@danishsard)

    <script type=”text/javascript”>
    if(typeof quadsOptions !== ‘undefined’ && typeof wpquads_adblocker_check_2
    === ‘undefined’ && quadsOptions.quadsChoice == ‘ad_blocker_message’){

    var addEvent1 = function (obj, type, fn) {
    if (obj.addEventListener)
    obj.addEventListener(type, fn, false);
    else if (obj.attachEvent)
    obj.attachEvent(‘on’ + type, function () {
    return fn.call(obj, window.event);
    });
    };
    addEvent1(window, ‘load’, function () {
    if (typeof wpquads_adblocker_check_2 === “undefined” || wpquads_adblocker_check_2 === false) {
    highlight_adblocked_ads();
    }
    });

    function highlight_adblocked_ads() {
    try {
    var ad_wrappers = document.querySelectorAll(‘div[id^=”quads-ad”]’)
    } catch (e) {
    return;
    }

    for (i = 0; i < ad_wrappers.length; i++) {
    ad_wrappers[i].className += ‘ quads-highlight-adblocked’;
    ad_wrappers[i].className = ad_wrappers[i].className.replace(‘quads-location’, ”);
    ad_wrappers[i].setAttribute(‘style’, ‘display:block !important’);
    }
    }
    }

    (function() {
    //Adblocker Notice Script Starts Here
    var curr_url = window.location.href;
    var red_ulr = localStorage.getItem(‘curr’);
    var modal = document.getElementById(“quads-myModal”);
    var quadsAllowedCookie = quadsgetCookie(‘quadsAllowedCookie’);

    if(typeof quadsOptions !== ‘undefined’ && typeof wpquads_adblocker_check_2
    === ‘undefined’ ){

    if(quadsAllowedCookie!=quadsOptions.allow_cookies){
    quadssetCookie(‘quadsCookie’, ”, -1, ‘/’);
    quadssetCookie(‘quadsAllowedCookie’, quadsOptions.allow_cookies, 1, ‘/’);
    }

    if(quadsOptions.allow_cookies == 2){
    if( quadsOptions.quadsChoice == ‘bar’ || quadsOptions.quadsChoice == ‘popup’){
    modal.style.display = “block”;
    quadssetCookie(‘quadsCookie’, ”, -1, ‘/’);
    }

    if(quadsOptions.quadsChoice == ‘page_redirect’ && quadsOptions.page_redirect !=”undefined”){
    if(red_ulr==null || curr_url!=quadsOptions.page_redirect){
    window.location = quadsOptions.page_redirect;
    localStorage.setItem(‘curr’,quadsOptions.page_redirect);
    }
    }
    }else{
    var adsCookie = quadsgetCookie(‘quadsCookie’);
    if(adsCookie==false) {
    if( quadsOptions.quadsChoice == ‘bar’ || quadsOptions.quadsChoice == ‘popup’){
    modal.style.display = “block”;
    }
    if(quadsOptions.quadsChoice == ‘page_redirect’ && quadsOptions.page_redirect !=”undefined”){
    window.location = quadsOptions.page_redirect;
    quadssetCookie(‘quadsCookie’, true, 1, ‘/’);
    }
    }else{
    modal.style.display = “none”;
    }
    }
    }

    var span = document.getElementsByClassName(“quads-cls-notice”)[0];
    if(span){
    span.onclick = function() {
    modal.style.display = “none”;
    document.cookie = “quads_prompt_close=”+new Date();
    quadssetCookie(‘quadsCookie’, ‘true’, 1, ‘/’);
    }
    }

    window.onclick = function(event) {
    if (event.target == modal) {
    modal.style.display = “none”;
    document.cookie = “quads_prompt_close=”+new Date();
    quadssetCookie(‘quadsCookie’, ‘true’, 1, ‘/’);
    }
    }
    })();
    function quadsgetCookie(cname){
    var name = cname + ‘=’;
    var ca = document.cookie.split(‘;’);
    for (var i = 0; i < ca.length; i++) {
    var c = ca[i].trim();
    if (c.indexOf(name) === 0) {
    return c.substring(name.length, c.length);
    }
    }
    return false;
    }
    function quadssetCookie(cname, cvalue, exdays, path){
    var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*1000));
    var expires = “expires=”+ d.toUTCString();
    document.cookie = cname + “=” + cvalue + “;” + expires + “;path=/”;
    }
    //Adblocker Notice Script Ends Here
    </script>

    <script type=”text/javascript”>
    let cust_login = document.getElementById(“loginform”);
    if(cust_login !== null) {
    var recaptcha_script = document.createElement(‘script’);
    recaptcha_script.setAttribute(‘src’,’https://www.google.com/recaptcha/api.js&#8217;);
    document.head.appendChild(recaptcha_script);
    }
    </script>

    Plugin Support WPQuads Support

    (@wpquadssupport)

    Sorry for delay in response. We have inspected your issue and it is valid. We have created a GitHub ticket regarding the issue and it will be resolve and pushed in upcoming plugin updates.

    For reference please follow this GitHub ticket: https://github.com/wpquads/quick-adsense-reloaded/issues/287

    Plugin Support WPQuads Support

    (@wpquadssupport)

    This issue has been fixed in the latest version of the plugin(2.0.18). Can you please update the plugin and check once whether having the same issue or not. Then let me know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Too much unnecessary code on the plugin page’ is closed to new replies.