COOKR – Cookie Consent & Script Blocking

چۈشەندۈرۈش

Most consent plugins operate at the UI layer.

COOKR operates at the runtime layer.

Scripts are intercepted server-side before the browser receives them. Third-party services requiring consent are neutralized before execution and restored only after consent has been granted.

No external consent cloud. No proxy layer. No visitor data leaving your site.

COOKR CORE includes:

  • Consent banner & preferences UI
  • Server-side script interception via PHP output buffer
  • Auto-Blocker for third-party scripts and iframes
  • Runtime Inspector
  • CSP-aware restoration with nonce propagation
  • Google Consent Mode v2 support
  • Full JavaScript API (window.cookrConsent)
  • Self-hosted operation — no external services required

COOKR is designed for developers, agencies, and privacy-conscious site operators who want operational visibility into what actually executes at runtime.

Runtime-first

Traditional consent tools often rely on JavaScript execution order and client-side conditions. Scripts may already execute before consent logic initializes.

COOKR intercepts scripts in the PHP output buffer using WP_HTML_Tag_Processor before delivery to the browser.

There is no race condition.

Auto-Blocker

Enable in Settings. Off by default.

When enabled, COOKR rewrites matching script tags and iframe tags server-side — setting type="text/plain" and preserving original attributes in data-cookr-* attributes for restoration after consent.

Test after enabling when using WP Rocket, LiteSpeed Cache, NitroPack, or Cloudflare Rocket Loader.

Runtime Inspector

The Runtime Inspector exposes third-party runtime activity directly in the browser — blocked scripts, restored services, iframe activity, detected domains.

Enable in Settings. Append ?cookr_debug=1 to any frontend URL while logged in as administrator.

CSP-aware

COOKR supports strict Content Security Policies without requiring unsafe-inline.

Restored scripts preserve CSP integrity via automatic nonce propagation. COOKR reads the nonce WordPress assigns to enqueued scripts at request time and passes it to restored scripts — no manual configuration required.

Developer JS API

cookrConsent.has('analytics')
cookrConsent.require('marketing', callback)
cookrConsent.whenConsented('analytics').then(fn)
cookrConsent.on('consent' | 'change' | 'decline' | 'reset', handler)
cookrConsent.off(event, handler)
cookrConsent.getConsent()
cookrConsent.getExpiry()
cookrConsent.categories()
cookrConsent.reset()

Consent Categories

  • Necessary — Always active.
  • Analytics — GA, GTM, Matomo, Hotjar, Clarity, etc.
  • Marketing — Meta Pixel, Google Ads, TikTok, LinkedIn, etc.
  • External Media — YouTube, Vimeo, Google Maps, etc.

Does COOKR require an external cloud service?

No. COOKR runs entirely on your WordPress installation.

Does visitor consent data leave the server?

No. Consent data is stored locally on your site.

Is the Auto-Blocker enabled by default?

No. Enable and test it after installation, particularly when using caching or JavaScript optimization plugins.

Which services can be blocked?

Any third-party script or iframe matching configured domains. Examples: Google Tag Manager, Meta Pixel, YouTube embeds, TikTok Analytics.

Does COOKR support Google Consent Mode v2?

Yes. Enable in settings when using GTM or GA4.

How do I inspect runtime activity?

Enable the Runtime Inspector in settings and append ?cookr_debug=1 to any frontend URL while logged in as administrator.

Does COOKR store personal data?

The consent log stores a hashed IP (not the raw IP address), consent choices, and a timestamp. Raw IP addresses are never written to the database.

Is COOKR compatible with strict CSP?

Yes. COOKR automatically reads the nonce WordPress assigns to enqueued scripts and passes it to restored scripts, preserving compatibility with strict-dynamic CSP policies. No manual configuration is required.

What WordPress version is required?

WordPress 6.2 or higher. COOKR uses WP_HTML_Tag_Processor for safe, attribute-aware script rewriting, introduced in WP 6.2.

External Services

This plugin does not connect to any external service by default.

The auto-blocker contains a built-in list of known third-party domains (such as googletagmanager.com, connect.facebook.net, maps.googleapis.com, etc.) that is used purely as a local reference to identify and block scripts before consent. No data is sent to these domains by this plugin — the list is pattern-matching data stored locally in the plugin code.

ئېكران كەسمىسى

  • COOKR admin interface with live banner preview
  • Consent banner — default view
  • Consent preferences panel with granular category toggles
  • Runtime Inspector debug panel

باھالاشلار

بۇ قىستۇرمىغا تېخى باھا يېزىلمىدى.

تۆھپىكار ۋە ئىجادكار

«COOKR – Cookie Consent & Script Blocking» كودى ئوچۇق يۇمشاق دېتال. تۆۋەندىكى كىشىلەر بۇ قىستۇرمىغا تۆھپە قوشقان.

تۆھپىكار

«COOKR – Cookie Consent & Script Blocking» نى تىلىڭىزغا تەرجىمە قىلىڭ

ئىجادىيەتكە قىزىقامسىز؟

كودقا كۆز يۈگۈرتۈپ، SVN خەزىنە تەكشۈرۈپ ياكى RSSئارقىلىق ئىجادىيەت خاتىرىسىگە مۇشتەرى بولغىلى بولىدۇ.

ئۆزگىرىش خاتىرىسى

1.9.8

  • Fixed accent colour not persisting in admin preview after page reload
  • Fixed iframe placeholder elements not inheriting accent colour on frontend
  • Fixed runtime inspector debug URL visibility after enabling inspector
  • Text domain corrected to match plugin slug
  • Restored original runtime inspector debug panel (cookr-debug.js)

1.9.6

  • Compliance improvements for WP.org review
  • Removed generic CDN entries from auto-blocker allowlist
  • Export uses explicit allowlist for safe settings only
  • Build tooling improvements

1.9.2

  • Initial public CORE release
  • 3×3 visual position picker replaces dropdown
  • Accent colour now applies to banner icon and buttons in preview
  • Auto-Blocker wording updated — recommended framing, test-after-enable guidance
  • Runtime Inspector enabled by default
  • Preserve data on uninstall enabled by default
  • Consent log default retention reduced to 100 entries

1.8.2

  • Added: Runtime Inspector — detects unknown third-party script and iframe domains at runtime
  • Added: Persistent findings stored per domain (first seen, last seen, page count)
  • Added: Runtime Inspector toggle with configurable auto-disable duration

1.2.0

  • Added: Google Consent Mode v2
  • Added: debug inspector
  • Added: browser chrome preview in admin dashboard

1.1.0

  • Plugin renamed from GDPR Cookie Consent to COOKR
  • Added: WP_HTML_Tag_Processor for safe, attribute-aware script rewriting
  • Added: CSP nonce propagation

1.0.0

  • Initial release