plugin-icon

CaphLabs – Advanced Ad Blocker Fence

CaphLabs yazdı·
Detect ad blockers and show a clean, customizable “support us” fence (popup) after a configurable grace countdown.
Sürüm
1.0.0
Son güncellenme
Feb 27, 2026
CaphLabs – Advanced Ad Blocker Fence

Ad blockers can reduce the revenue that keeps your site running. CaphLabs – Advanced Ad Blocker Fence helps you respond in a user-friendly way:

  • Detects common ad blocking behavior (including blocking Google Ad scripts).
  • Optionally shows a small warning tag for a set number of adblocked page views (grace pages).
  • Then displays a fence popup asking visitors to whitelist your site or disable their blocker.
  • Includes optional refresh and close buttons, with configurable button text.
  • Uses lightweight assets and can render in the footer or via wp_body_open.

This plugin is designed to be simple to set up: enable it, write your message, decide your grace count, and you’re done.

TESTED WITH:

  • ✓ Adblock Plus
  • ✓ Adblock
  • ✓ ExpressVPN Keys
  • ✓ Tampermonkey
  • ✓ NordVPN
  • ✓ AdLock
  • ✓ Total Adblock
  • ✓ Adguard
  • ✓ Privacy Badger
  • ✓ Adremover
  • ✓ Adblock for Chrome™
  • ✓ Brave
  • ✓ Surfshark CleanWeb
  • ✓ Ghostery
  • ✓ uBlocker
  • ✓ Pi-hole
  • ✓ uBlock Origin
  • ✓ Ultrablock
  • ✓ Privacy Badger
  • ✓ DuckDuckGo
  • ✓ Disconnect
  • ✓ Microsoft Edge AdBlock extension
  • ✓ Firefox Tracking Protection
  • ✓ uBlock Origin
  • ✓ Fair AdBlocker
  • ✓ Hola ad remover
  • ✓ Comodo AdBlocker
  • ✓ Opera Built-in AdBlock extension

Note: Ad blockers change frequently. The list above reflects testing on common blockers and privacy tools, but no detection method can guarantee 100% coverage forever.

External Services

This plugin connects to external services:

1) Google AdSense script (ad blocker detection) This plugin loads https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js to detect when ad scripts are blocked. This helps determine whether an ad blocker is active. Data sent: This plugin does not intentionally collect or transmit personal data as part of this detection. Google Terms: https://policies.google.com/terms Google Privacy Policy: https://policies.google.com/privacy

2) Freemius checkout (optional Pro upgrade) This plugin may link to Freemius hosted checkout pages if you choose to upgrade to the Pro version. Data sent: If you click an upgrade/trial link and complete checkout, information you provide during checkout is handled by Freemius. Freemius Terms: https://freemius.com/terms/

Freemius Privacy Policy: https://freemius.com/privacy/

How it works (plain-English, step-by-step)

1) The plugin loads your saved settings

Your settings are stored by the plugin and read on each request to decide whether to output the fence markup/scripts and how to behave (grace count, button visibility, etc.).

2) Front-end CSS is loaded early (wp_head)

The plugin outputs its front-end CSS so the popup and grace tag can display correctly and immediately.

3) Front-end JavaScript is output (wp_footer or wp_body_open)

Depending on your setting (Include in Header), the plugin outputs the fence markup + JavaScript in one of these locations:

  • Default: wp_footer (most compatible)
  • Optional: wp_body_open (earlier output; requires theme support)

If your theme does not support wp_body_open, the plugin safely falls back to the footer.

4) Detection runs in the browser

The plugin uses a practical “real world” detection approach:

  • It attempts to load Google’s Ads script (adsbygoogle.js).
  • If the script is blocked or fails in certain ways, ad blocking is assumed.
  • It also performs additional lightweight checks to handle blockers that intercept requests or alter responses.

5) Grace countdown (optional)

If Fence after (adblocked pages) is set above 0:

  • The plugin shows a small warning tag (not the full popup) while the visitor is still within their grace limit.
  • Once the visitor exceeds the grace limit on adblocked page views, the full fence popup appears.

This helps avoid instantly “slamming the door” on first-time visitors while still protecting your monetization over time.

6) Fence popup behavior

When the popup is shown:

  • Your Title and Content are displayed.
  • The visitor can:
    • Click the Refresh button (if enabled) to reload after whitelisting
    • Click the Close button (if enabled) to dismiss (depending on your configuration)

7) Reset countdown after X days (optional)

If the visitor stops triggering adblock detection for a while, the plugin can reset the grace counter after your configured number of days.

Settings page: Every option explained (point-by-point)

Go to: WP Admin Settings Advanced Ad Blocker Fence (or wherever your plugin places its menu entry).

Enable Fence

Turns the plugin on/off. When disabled, the plugin does not show the fence.

Enable Noscript

Adds a <noscript> fallback message for users who have JavaScript disabled.

Why it matters: – Adblock detection is primarily JavaScript-based. – A noscript message ensures users with JS disabled still see guidance.

Title

The headline shown on the fence popup.

Tips: – Keep it short and clear (example: “Please support our site”). – Avoid aggressive language; polite messaging improves whitelist rates.

Content

A small WYSIWYG editor for the popup body text.

Use it to explain: – Ads help fund hosting/content – How to whitelist your site (simple steps) – A friendly “thank you”

Note: – The editor is intentionally lightweight (limited toolbar) to keep output clean.

Width (in %)

Controls how wide the popup content area is as a percentage.

Examples: – 40 = compact popup – 60 = larger popup for more text – 80 = very wide popup (use carefully on mobile)

Fence after (adblocked pages)

This is your grace counter.

  • 0 = show the fence immediately on the first detected adblocked page view
  • 3 = show the warning tag for 3 adblocked page views, then fence on the next

Recommended starting point: – 2–3 grace pages for content sites – 0 grace pages for high-monetization landing pages (use cautiously)

Reset countdown after (days)

If adblock is detected again after this many days without a warning, the countdown resets back to the full value.

Examples: – 7 = weekly reset (reasonable default) – 30 = monthly reset

Show Refresh Button

When enabled, a “refresh” button is shown in the popup.

Typical use: – Visitor whitelists your site – Visitor clicks refresh to reload the page cleanly

Refresh Button (Text)

Changes the refresh button label.

Examples: – “I whitelisted — refresh” – “Refresh page” – “Try again”

Show Close Button

When enabled, shows a close/dismiss button on the popup.

Site owners often choose: – Enable close for softer approach (less friction) – Disable close for stricter enforcement

Close Button (Text)

Changes the close button label.

Examples: – “Close” – “Not now” – “Continue without ads” (avoid promises you can’t enforce)

Include in Header

If enabled, the plugin will attempt to output the fence JS earlier using wp_body_open.

Important: – Your theme must support the wp_body_open hook – If not supported, the plugin automatically falls back to footer output

Minify JS

Enables an optional inline script packing toggle (where applicable) to reduce output size and make the front-end logic harder to fingerprint.

Note: Some caching/minify plugins already compress JavaScript globally. If you experience conflicts, disable this option and let your caching plugin handle optimization.

Branding

Free version includes a small “Powered by” style badge while the popup is open.

“Branding is optional / administrator opt-in” And extremely appreciated <3

Developer notes (hooks/filters)

This plugin exposes filters that allow advanced users to alter behavior.

If you are building custom integrations, you may encounter legacy filter names. Some are preserved for backward compatibility.

Common examples include: – Minify toggle filter – Branding behavior filter – Icon and HTML icon customization filters

(Exact hook names may differ by version/build. If you rely on hooks, test after updating.)

ÜcretsizBusiness paketinde
Kurulum işlemini tamamlayarak, WordPress.com'un Hizmet Şartları ile Üçüncü Taraf Eklenti Şartlarını kabul etmiş olursunuz.
Test edilen son sürüm
WordPress 6.9.1
Bu eklenti, sitenizde kullanılmak üzere indirilebilir.