🍪 Cookie Consent Manager

Avatar
Posts 344

✨ Demo

Check out the live demo of Cookie Consent Manager here.

🔨 Added

  • GDPR-compliant cookie consent banner with customizable positioning:
    • Top, bottom, left, right positions
    • Corner positions (top-left, top-right, bottom-left, bottom-right)
    • Centered left/right positions
  • Multiple banner styles:
    • Box style (modal window)
    • Bar style (banner strip)
  • Cookie category management:
    • Essential cookies (always active, cannot be disabled - GDPR compliant)
    • Analytics cookies (optional, user-controlled)
    • Marketing cookies (optional, user-controlled)
    • Functional cookies (optional, user-controlled)
  • User preference management with granular control:
    • Accept all cookies button
    • Decline all cookies button
    • Preferences button for detailed settings
  • Consent storage system with revision tracking:
    • Stores user consent preferences securely
    • Revision system to force users to review preferences when configuration changes
    • Consent history tracking with IP addresses and timestamps
  • Automatic cookie clearing when preferences change (requires autoClear configuration)
  • Bot detection to hide banner from crawlers (SEO-friendly)
  • Lazy HTML generation for improved initial page load performance
  • Privacy policy and cookie policy pages with full GDPR compliance information
  • Multi-language support: English, French, German, Dutch, Portuguese
  • Dark mode support with automatic theme detection
  • Admin dashboard with:
    • Consent history (last 10 consents)
    • Cookie category configuration
    • Technical settings management
    • Cookie clearing functionality
  • Page interaction blocking option (blocks scrolling/clicks until consent is given)
  • Auto-show functionality (displays banner automatically on page load if no consent)

⚡ Improved

  • Enhanced banner visibility with multiple positioning options
  • Better user experience with clear accept/decline options
  • Optimized performance with lazy loading and efficient asset management
  • Improved SEO by hiding banner from bots and crawlers
  • Better accessibility with keyboard navigation support
  • Enhanced admin interface for managing cookie categories and settings
  • Automatic theme detection for dark mode compatibility
  • Better translation system with fallback support

🐛 Fixed

  • Resolved issues with consent storage in SQLite database
  • Fixed banner display in dark mode with proper CSS classes
  • Corrected translation loading for plugin description in admin panel
  • Fixed cookie clearing functionality for administrators
  • Resolved issues with banner positioning in different screen sizes

🚀 Updating

Stay tuned for upcoming features and improvements in future releases!

🔗 Links

📝 License

Copyright © 2025 Flatboard Team
This project is GPL3 licensed.

Edited on Jan 11, 2026 By Fred .

  • cookie gdpr
Avatar
Posts 344

[1.0.2] - 2025-12-24

Fixed

  • Major fix: Consent data is now properly saved
    • Fixed JavaScript script execution order
    • Fixed onConsent and onChange callback configuration for vanilla-cookieconsent library
    • Fixed cookie data extraction (handling { cookie: {...} } format)
    • Fixed callback injection in JavaScript configuration (using IIFE instead of direct JSON injection)
    • Added global window.recordCookieConsent() function called by callbacks
    • Improved error handling and debug logging

Changed

  • Enhanced debug logging to facilitate problem diagnosis
  • Refactored getInitJs() method to build JavaScript more safely
  • Improved cookie object format handling (support for both possible formats)

Technical Details

  • Callbacks are now properly injected into configuration via JavaScript IIFE
  • recordCookieConsent function is defined before CookieConsent initialization to ensure availability
  • Data is correctly extracted and sent to server via /cookieconsent/record-consent API
  • Consents are now properly recorded in plugins/CookieConsent/data/consents.json
Avatar
Posts 206

Hi :)

the download link on the resource display a 404 page

Avatar
Posts 344

Fixed! 👍

Edited on Jan 05, 2026 By Fred .

Avatar
Posts 101

The Position Settings not shown up and at least for me no Banner at all. The Plugin is enabled and The Dashboard shows no Errors.
Thanks,

Avatar
Posts 344

[1.0.6] - 2025-01-11

🔄 Changed - Major Refactoring

  • BREAKING CHANGE: Merged Configuration.php and ConsentStorage.php into CookieConsentPlugin.php
  • All plugin logic is now contained in a single file for simplified maintenance
  • Removed external class dependencies

✨ Added - New Features

  • Added private methods for JavaScript script generation (dark mode, consent recording, console filtering)
  • Added dedicated route handlers for better code organization
  • Improved error handling with try/catch blocks in all critical methods
  • Added reflection-based configuration access in admin view

🐛 Fixed - Bug Fixes

  • Critical fix: Corrected banner style (Box/Bar) that wasn't applying correctly
  • Force 'box' style when position contains 'left' or 'right' (incompatible with 'bar' layout)
  • Fixed position mapping to comply with CookieConsent specifications
  • Fixed isPluginActive() to check only the active field in plugin.json
  • Fixed script loading order to ensure recordCookieConsent is defined before CookieConsent.run()
  • Fixed translation file paths (changed from .json to .php)
  • Admin view fix: Removed require_once calls to deleted Configuration.php and ConsentStorage.php files
  • Implemented direct file reading for consents in admin view

🎨 Improved - Enhancements

  • Optimized inline script generation to reduce code duplication
  • Enhanced dark mode handling with Bootstrap 5.3.8 synchronization
  • Refactored view preparation methods for better clarity
  • Improved translation handling with automatic fallback to English
  • Optimized consent storage with better duplicate handling
  • Streamlined admin view to work with unified plugin structure

📚 Documentation

  • Added detailed comments for each code section
  • Documented private methods to facilitate maintenance
  • Added clearly identified sections (Configuration, Storage, Routes, etc.)

⚙️ Technical

  • Removed unnecessary require_once statements (everything in same class)
  • Used private methods instead of static classes
  • Better encapsulation with self::$storageFile and self::$lockKey
  • Simplified routing logic with dedicated handlers
  • Admin view now uses Reflection API to access private configuration method
  • Direct file access for consent storage instead of external class calls

🗂️ File Structure Changes

Deleted files (functionality merged into CookieConsentPlugin.php):

  • src/Configuration.php
  • src/ConsentStorage.php

Modified files:

  • CookieConsentPlugin.php - Now contains all functionality
  • views/admin.php - Updated to work without external classes
  • plugin.json - Version updated to 1.0.6

Unchanged files (no modifications needed):

  • views/frontend/privacy.php
  • views/frontend/cookies.php

Contributors

  • Flatboard Team - Initial work and maintenance
  • Community contributors welcome!

License

GPL-3.0 License - Copyright © 2025 Flatboard Team

This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.


Acknowledgments

  • Built with vanilla-cookieconsent
  • Compliant with GDPR, ePrivacy Directive, and other privacy regulations
  • Designed for Flatboard 5

Last Updated: January 11, 2025
Current Version: 1.0.6
Status: Stable

Avatar
Posts 344

[1.1.1] - 2026-01-12

Fixed

  • Major fix: Inconsistent category names between JavaScript Library and PHP Storage/Display caused incorrect banner button choices in the settings.

    • JavaScript Library: Used categories like "necessary," "measurement," "marketing," and "functionality."
    • PHP Storage/Display: Used categories like "essential," "analytics," and "functional."
    • Cause: The mismatch in category IDs between stored and displayed names led to improper banner button rendering and failure to retain user choices.
    • Fix: Standardized category names in the JavaScript library to ensure consistency across both systems. This resolves the issue, ensuring that the banner buttons now correctly reflect and retain user preferences across the entire site.

Changed

  • Standardized category names for better alignment between JavaScript and PHP configurations.
  • Improved overall settings rendering consistency.

Technical Details

  • Category IDs are now consistent between JavaScript Library and PHP Storage/Display, ensuring that user preferences are correctly saved and displayed.
  • Banner button choices are now rendered properly, reflecting correct stored data.

Thank @JPRuehmann for this feedback.

Edited on Jan 12, 2026 By Fred .

Avatar
Posts 344

[1.1.2] - 2026-01-20

Added

  • Dynamic category configuration: Admin can now enable/disable cookie categories (Analytics, Marketing, Functional) from the settings panel
  • Banner position selector: 6 position options (left-bottom, right-bottom, left-top, right-top, center-bottom, center-top)
  • Banner style selector: 2 style options (Box, Bar)
  • Form-based configuration: New form_config system for cleaner admin interface
  • Automatic category management: Cookie categories are now read dynamically from plugin.json configuration

Changed

  • Configuration.php refactored: Categories are now loaded based on admin settings instead of being hardcoded
  • Removed hardcoded categories: Analytics, Marketing, and Functional categories are only shown if enabled in settings
  • Improved translations structure: Standardized translation keys using hyphens for consistency
  • Better modal sections: Preference modal sections are now generated dynamically based on enabled categories

Fixed

  • Translation keys inconsistency: Fixed mismatch between plugin.json option keys and translation keys (now using hyphens consistently)
  • Position mapping: Corrected position mapping to match CookieConsent library requirements
  • SELECT fields not showing: Removed unsupported depends_on property that was preventing SELECT fields from rendering

Technical

  • Updated Configuration::getCategories() to read enable_analytics, enable_marketing, enable_functional from plugin.json
  • Added center-bottom and center-top position options
  • Standardized all position and style keys to use hyphens instead of underscores
  • Enhanced guiOptions mapping for better position handling

Edited on Jan 20, 2026 By Fred .

Avatar
Posts 344

[1.1.5] - 2026-01-23

Key Adaptations:

  1. Complete Mapping: All CSS variables for the cookie consent banner are now linked to the Bootstrap 5.3+ variables defined in your configuration.

  2. Main Colors:

    • Background: --bs-body-bg / --bg-primary
    • Text: --bs-body-color / --text-primary
    • Primary Buttons: --bs-primary / --primary-color
  3. Dark Mode Support:

    • Automatic detection via [data-bs-theme="dark"]
    • Uses dark mode variables from your config (--dark-bg-primary, --dark-text-primary, etc.)
  4. Adapted Elements:

    • Primary and secondary buttons
    • Toggles/switches (success colors for enabled state)
    • Borders and separators
    • Footer and overlay
    • Cookie tables
    • Focus states for accessibility
  5. German lang pack update:

  • Like(1)
    JPRuehmannJPRuehmann
Avatar
Posts 101

The only thing are the Headers for the different Kind of Cookies.

That are not translatable. I´ve found a way to change the sub headers by editing the Files in the src Folder.
But I don´t thing that tis is the right way.

Thanks,

Edited on Feb 03, 2026 By JPRuehmann .

Avatar
Posts 344

[1.3.0] — 2026-02-21

Added

  • Clear recorded consents — new button in the admin dashboard card header and in the Actions section to delete the entire consent log (data/consents.json). Does not affect visitor cookies or the revision number.
  • New POST route /admin/cookieconsent/clear-records with admin + CSRF protection.
  • Consent log card now shows a count/50 badge in the header.
  • Card scrollable with max-height: 400px and overflow-y: auto — all 50 entries are visible without expanding the page.
  • table-hover class added to consent table for better readability.
  • text-nowrap on date column to prevent wrapping.
  • 7 new translation keys per language (clear_records_*) in FR, EN, DE.

Changed

  • Consent storage limit reduced from 100 to 50 — sufficient for audit purposes; keeps the JSON file lightweight.
  • getConsents() default limit updated from 10 to 50 to match the new cap.
  • Admin dashboard now loads and displays all 50 stored records (previously sliced to 10).
  • Position/style compatibility hint: the position row in the display options table now shows a ⚠️ badge when the selected position is incompatible with the selected style, plus a translated hint (position_requires_box / position_requires_bar).
  • Style and position fields are now shown in logical order (style first, then position) to make the dependency clear.
  • getGuiOptions() in Configuration.php now auto-corrects the layout to match the position: corner positions force box, center positions force bar, eliminating silent misconfigurations.
  • positionMap in Configuration.php cleaned up — removed 4 orphan keys (bottom, top, left, right) that were never reachable via the admin form.
  • Default banner_position fallback changed from 'bottom' (orphan) to 'right-bottom' (valid option).
  • select_banner_position_options in all lang files now contains only the 6 options actually present in the form (removed bottom, top, left, right orphan keys).
  • Banner position option labels now explicitly state the required style, e.g. "Bottom right (Box style only)".
  • Banner position and style field descriptions updated in all 3 languages to explain the constraint.
  • All t('key', 'Hardcoded French fallback') calls in admin.php simplified to t('key') — keys already exist in all lang files.
  • Removed dead debug block ($logsCount, $logsEmpty were never defined).
  • no_consents_hint string moved from hardcoded French to translation key across FR/EN/DE.
  • cookies_found_and_deleted fallback string removed from admin.php (was hardcoded French).
  • clearRecordsBtn (card header) and clearRecordsBtnAlt (Actions section) both trigger the same clearConsentRecords() function — single source of truth.

Fixed

  • Hardcoded French string "Les consentements seront enregistrés après acceptation dans la bannière de cookies." replaced by t('no_consents_hint').
  • admin.php no longer references undefined variables $logsCount and $logsEmpty.
  • $jsCookiesFoundText no longer has a hardcoded French fallback.
Visitor, reply to this topic…
Log in to reply
Navigation
11Posts
post #1
19 Dec 2025
ByUtilisateur