ernestdefoe/advanced-cookie-consent
Composer 安装命令:
composer require ernestdefoe/advanced-cookie-consent
包简介
Advanced Cookie Consent for Flarum 2 — a GDPR/ePrivacy-style cookie banner with granular, admin-defined consent categories, per-category script gating (third-party scripts load only after consent), a Categories/Services privacy-settings modal, consent versioning and a reopen-anytime control.
README 文档
README
A GDPR / ePrivacy-style cookie consent extension for Flarum 2. Free and MIT-licensed.
Shows a clean cookie notice with Accept / Reject / Customize, and a granular Privacy Settings dialog with consent categories and a per-service transparency view — and, crucially, it can gate third-party scripts so they only load after consent.
Features
- Cookie notice banner (bottom bar, corner box, or centered) with Accept, Reject and Customize, plus your Privacy Notice link.
- Granular Privacy Settings modal — per-category toggles (Necessary is always on) with expandable detail, plus a Services tab listing the third-party services and cookies in each category.
- Script gating — two ways to ensure tags only run after consent:
- Paste scripts per category in the admin panel; they load when that category is accepted.
- Mark any script on the page as
<script type="text/plain" data-cc-category="marketing">…</script>and it activates on consent.
- Admin-defined categories (rename, add, remove, mark required) — defaults: Necessary, Performance, Functional, Marketing.
- Consent versioning — bump the version to re-prompt everyone when your policy changes.
- Do Not Track / Global Privacy Control — optionally auto-reject non-essential categories when the browser sends an opt-out signal.
- Fully stylable — layout (bottom bar / corner box / centered), light / dark / auto theme, custom accent colour, box width and corner radius, so it fits any site and screen size.
- Reopen anytime — a "Cookie settings" link, plus a JS API so a theme can place its own trigger.
- Fully translatable; consent is stored locally (no personal data leaves the browser).
Screenshots
| Cookie notice | Privacy settings |
|---|---|
![]() |
![]() |
Fully stylable so it fits any forum — choose the layout (bottom bar / corner box / centered), a light/dark/auto theme, your own accent colour, box width and corner radius:
JavaScript API
window.cookieConsent.open(); // re-open the settings dialog window.cookieConsent.accepted('marketing'); // boolean window.cookieConsent.onChange((c) => { /* … */ }); window.cookieConsent.acceptAll(); window.cookieConsent.rejectAll();
Installation
composer require ernestdefoe/advanced-cookie-consent php flarum cache:clear
Then open Admin → Advanced Cookie Consent to set your text, categories and scripts.
License
ernestdefoe/advanced-cookie-consent 适用场景与选型建议
ernestdefoe/advanced-cookie-consent 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cookie」 「privacy」 「flarum」 「consent」 「gdpr」 「flarum-extension」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ernestdefoe/advanced-cookie-consent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ernestdefoe/advanced-cookie-consent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ernestdefoe/advanced-cookie-consent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Make TYPO3 more compatible to GDPR
Add a configurable cookie consent banner to the website.
Adds more BBCode
Output of discussions lists in form of cards
Strips potentially identifying information from outbound requests to the WordPress.org API
Use Klaro! Consent Manager in Contao CMS
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 37
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-09


