• Resolved Robert

    (@kinderrwindstreamnet)


    Hi,
    I can’t get the plugin to work. The plugin installed successfully and no problem accessing the Settings tabs.

    I created div wrappers for “Adverts selectors” to simply things, e.g. <div class="ad1"> adsense or other javascript ad code goes here </div>, <div class="ad2"> ... </div>, etc.

    The Adverts selectors entry is: “.ad1, .ad2, .adsbygoogle” without the double quotes.

    Yet with Adblock Plus enabled in FireFox 44.0.2 it won’t display the modal box. I next enabled “random selectors and files” and “flushed files” but still no joy. I FTP’d to my site and checked the /wp-content/uploads directory but there are no random directories/files plugin files present.

    The Alternative Message also isn’t displayed in the ad slots.

    I examined the <div class="ad1"> layout in FireBug and it is zero height.

    I do see the random plugin code in the page source after the </footer> div:

    <div id="Y7xB5BK6Etun" class="SLtxWLZB3qI3" style="background:#dddddd;"></div>   <script type="text/javascript">/* <![CDATA[ */var anOptions ={"anOptionChoice":"  - snipped here for brevity

    I’m testing the plugin on my staging site @ WPEngine.com, e.g. mydomain.staging.wpengine.com if that’s significant.

    Thanks

    https://www.ads-software.com/plugins/adblock-notify-by-bweb/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Robert,
    1 – Can you change your container IDs with something which not contains “ad” ? Eg:
    “.ad1, .ad2, .adsbygoogle” ==> “.custom1, .custom2, .customgoogle”.
    2 – Disable “random selectors and files” and save
    3 – Enable “random selectors and files” and save
    4 – Empty you WordPress cache if you use any caching plugin
    5 – Let me know !

    Best,

    Thread Starter Robert

    (@kinderrwindstreamnet)

    Hi,
    I changed the ad wrapper div container IDs to <div class=”custom1″>, etc. and set the Advert selectors to “.custom1, .custom2” (no quotes) in addition to Steps 2, 3 and 4 in your instructions.

    With Adblock Plus enabled in both Firefox and Chrome the ads are blocked but the modal box is not displayed. Also enabled pop-ups in Firefox.

    Modal box, cookies and Random selectors & files are enabled.

    The Firebug DOM inspector shows that custom1 and custom2 classes have a clientHeight of zero.

    I do see the Adblock Notify code after the </footer>:`
    <div id="3K9OoFTSc6K6" class="8id89tbAkHTG" style="background:#dddddd;"></div> <script type="text/javascript">/* <![CDATA[ */var anOptions ={"anOptionChoice":"2","anOptionStats":"1","anOptionAdsSelectors":".custom1,.custom2","anOptionCookie":"1","anOptionCookieLife":"30","anModalTitle":"Adblocker detected!" ... snipped for brevity.

    I can provide a WordPress admin login if I can contact you offline.

    Thanks

    Thread Starter Robert

    (@kinderrwindstreamnet)

    I found the problem! My hosting provider enforces strict file permissions for security (https://wpengine.com/support/file-permissions/) that cannot be changed (I tried anyway but was denied).

    I do see two zero byte size files /wp-content/uploads/an-temp/ named <randomstring1>.css and <randomstring2>.js with file permissions 664 (-rw-r–r–) which prevents the plugin from writing to the files based on the lack of Group write permissions. 664 permissions are enforced for all files in the /uploads directory.

    Feature Request:
    A different strategy for creating local files does work on WP Engine is used by the Autoptimize plugin for serving it’s cached files. Autoptimize creates cached .js and .css files in the /wp-content/cache/autoptimize/css and /wp-content/cache/autoptimize/js which all have 644 (-rw-rw-r–) Group write permissions as set by my hosting provider.

    The Autoptimize FAQ explains how the cache file directory location is configurable.

    Hope you’ll consider the temp folder location configurable option.

    Thanks!

    Thread Starter Robert

    (@kinderrwindstreamnet)

    More info after experimenting.

    I modified adblock-notify-files.php to use the /cache folder instead of /uploads for all occurrences of wp_upload_dir():

    $uploadDir = wp_upload_dir();
    $uploadDir[ 'basedir' ] = '/nas/content/staging/mysite/wp-content/cache/';
    $uploadDir[ 'baseurl' ] = 'https://mysite.staging.wpengine.com/wp-content/cache/';

    Two random name zero byte size .css and .js files were created with 664 (-rw-r–r–) permissions. Still the wrong permissions.

    I reset all file permissions from the WP Engine admin panel, then checked the /wp-content/cache/an-temp/ file permissions. Now the two zero byte .css and .js files had the necessary 644 (-rw-rw-r–) Group write permissions!

    Back to the Adblock Notify Settings page and click Save Changes without modifying any other settings or flushing files. The same two files now had 664 (-rw-r–r–) permissions. ??

    Unless I’ve missed something in my hack on the /an-temp folder location, I’m wondering if the right credentials are being pulled when creating the random files?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Configuration Help – Not working’ is closed to new replies.