https://github.com/generoi/wp-genero-cookieconsent
A wordpress plugin providing a cookie consent popup using Cookie Consent by Insites
https://github.com/generoi/wp-genero-cookieconsent
Last synced: 6 months ago
JSON representation
A wordpress plugin providing a cookie consent popup using Cookie Consent by Insites
- Host: GitHub
- URL: https://github.com/generoi/wp-genero-cookieconsent
- Owner: generoi
- Created: 2018-04-24T19:23:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T12:24:51.000Z (almost 3 years ago)
- Last Synced: 2025-05-30T13:49:52.330Z (about 1 year ago)
- Language: PHP
- Size: 1.85 MB
- Stars: 9
- Watchers: 6
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wp-genero-cookieconsent
> A wordpress plugin providing a cookie consent popup using [Cookie Consent by Insites](https://cookieconsent.insites.com).
## Installation
Regular
## Requirements
ACF is required to get an options page but if not available you can provide options using filters.
## Features
- Has layouts for Foundation Reveal and Callout
- Basic fallback for sites without Foundation
- WP Super Cache integration
- Supports Opt in, Opt out and notice
- Supports custom messages and button texts
- Uses WordPress default Privacy Policy if available but can be set to a custom page.
- Triggers events to GA and GTM
## API
```php
// Modify values sent to JS.
add_filter('wp-genero-cookieconsent/options', function ($options) {
$options['options']['enabled'] = !WP_DEBUG;
return $options;
});
```
## Events
### Google Analytics
|category | action | label | description|
|---------|--------|-------|------------|
|`cookieconsent`|`allow`||Triggered if cookies should be enabled|
|`cookieconsent`|`deny`||Triggered if cookies should be disabled|
|`cookieconsent`|`init`|`dismiss/allow/deny/show`|Triggered as soon as the plugin is initialized|
|`cookieconsent`|`revoke`|`allow/deny/dismiss`|Triggered when a choice is revoked. Label will be set to the new consent status|
|`cookieconsent`|`click`|`allow/deny/dismiss`|Triggered when the user clicks a popup button|
### Google Tag Manager
The events are sent as `.`, for example: `cookieconsent.enable`.
## GDPR
|Category|Cookie|Description|
|--------|------|-----------|
|Strictly necessary|`cookieconsent_status`|Saves the consent status that has been given so we know what we can show the user. Has a lifetime of 1 year.|
|Third pary|Type|Description|
|----------|----|-----------|
|-|-|-|
## Development
Install dependencies
composer install
npm install
Run the tests
npm run test
Build assets
# Minified assets which are to be committed to git
npm run build
# Development assets while developing the plugin
npm run build:development
# Watch for changes and re-compile while developing the plugin
npm run watch
Rebuild POT files (copy to each language as `languages/wp-genero-cookieconsent-.po` and translate it)
npm run lang:pot
Compile MO files (requires `msgfmt` which is available with `brew install gettext && brew link gettext --force`)
npm run lang:mo