• Hi Sir,

    I have tried to use this plugin but unfortunately it is showing some errors at my site. I used following code (replace with my adsense code) through PHP code in Ad Inserter plugin:
    <?php
    if( aicp_can_see_ads() ) {
    $adCode = ‘<div class=”aicp”>
    <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– AdSense Responsive Ad Code –>
    <ins class=”adsbygoogle”
    style=”display:block”
    data-ad-client=”ca-pub-1234567890″
    data-ad-slot=”0987654321″
    data-ad-format=”auto”>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </div>’;
    echo $adCode;
    } else {
    echo ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
    }
    ?>

    But here it is showing following error:

    PHP error in Ad Inserter code block – 11 – …..
    Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting, “,” or “;”

    When I changed:
    echo ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
    with:
    echo “Sorry! you are blocked from seeing the ads.”;

    It is not working and takes about 1-2 mints to load the page but still showing ad.

    Kindly guide me where I am doing wrong.

    Regards,

    Chetan

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter chetanmalhi

    (@chetanmalhi)

    Yes I did it No, now the site is loading fast but showing the ads, so can’t hide the ads for country I want to block.

    Plugin Author iSaumya

    (@isaumya)

    OK. One last question before telling you what the problem is, how many visitors do you get on your site?

    Thread Starter chetanmalhi

    (@chetanmalhi)

    Avg. 10-15 visitors per day, my site is in initial phase.

    Plugin Author iSaumya

    (@isaumya)

    Then it is your server which is blocking the API call to IP-API. Check your server or PHP log to see what’s happening.

    Plugin Author iSaumya

    (@isaumya)

    Also for testing, if you have made more than 150 requests in a min, maybe your server IP has been banned for further requests. You can go here: https://www.ip-api.com/docs/unban enter your server Ip to unban it if that was the case.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Plugin showing error and slowing the site.’ is closed to new replies.