EU Cookie Law – WordPress plugin Free download
EU Cookie Law
Description
EU Cookie Law is a light, elegant and powerful solution that allows your website to comply the european cookie law by informing users that your site has cookies, with a popup for more information and option to lock scripts before acceptance (as required by Italian Law – Garante della Privacy dispositions).
You can customise the style to perfectly fit your website and you have many options to control cookies behaviour after and before acceptance.
Demo: www.sanpellegrinoterme.gov.it
Features
GDPR compliant (if you have doubts, ask in the forum)
Customizable banner (color, position, strings)
Consent by Clicking, Scrolling and Navigation
Set your page, popup or custom URL for Cookie Policy
Set cookie expiry
Fully responsive for tablets and smartphones
Compatible with mobile themes and plugins
Compatible with multilanguage plugins
Certified for WPML
Shortcode to revoke cookie consent
Shortcode to show a list of cookies
Compatible with Disqus and Jetpack InfiniteScroll
Advanced Features
Block scripts if cookies are not accepted
Automatic block of iframes, embeds, scripts and objects
Complete set of developer Shortcodes and PHP Functions
Manual and Automatic set width and height of blocked content
Simply install the plugin and follow the instructions on the Settings page.
Cookie block
You can lock cookies using [cookie]
and [/cookie]
shortcodes in every post, page and widget. You can use php functions too:
if ( !function_exists(‘cookie_accepted’) || cookie_accepted() ) {
// Your code
}
More Shortcodes & PHP Functions are available in our faqs.
EU Cookie Law started from Peadig in 2012 and in june 2015 has became part of WPGov.it that aims to give Italian Public Government powerful open source solutions for websites.
Translations
You can add your translations here: translate.wordpress.org
If you want to be translation editor for your locale, please send your username and language code (eg. it_IT) to milesimarco@outlook.com.
@tabakisp (el)
Thanks to: Gerard Weijer, Karsten Höfner, Mariusz Kołacz, Marco Milesi, Núria Nadal
Contributions
Italian community Porte Aperte sul Web
This plugin was originally developed by Peadig.
Screenshots







[cookie-control]
shortcode

Installation
This section describes how to install the plugin and get it working.
Upload eu-cookie-law
directory to the /wp-content/plugins/
directory
Activate the plugin through the ‘Plugins’ menu in WordPress
Go to the EU Cookie settings page
Go through the steps and hit update!
FAQ
Shortcodes available
You can block code in posts, pages and widget by wrapping it with these shortcode:
[cookie] … [/cookie]
Parameters:
[cookie height=”100px” width=”100%” text=”Hi WordPress”] //My code [/cookie]
To display the button to revoke consent (if cookies accepted) or accept cookies:
[cookie-control]
You can also revoke consent by adding ?nocookie=1 parameter to your url.
Ex. wordpress.org/?nocookie=1 or wordpress.org/something/?nocookie=1
To display a list of active cookies on user client:
[cookie-list]
PHP Functions available
You can check the consent with:
if ( function_exists(‘cookie_accepted’) && cookie_accepted() ) {
// Your code
}
If you want to display the cookie-block message:
generate_cookie_notice($height, $width);
generate_cookie_notice_text($height, $width, $text);
if ( function_exists('cookie_accepted') && cookie_accepted() ) {
// Your code
} else {
generate_cookie_notice($height, $width);
}
Please note that cookie_accepted returns true if you disable it in the settings panel, if you excluded the current page or if you are a search engine 🙂
If you think that we should enhance something let us know in the forum.
Javascript Filters
Sometimes it could be useful to trigger custom actions on cookie consent, so we added useful filters.
If you want to play, just download our sample plugin and start coding!
Auto block
The plugin offers an exclusive function that allows you to block iframes, embeds, objects and scripts in posts, pages and widgets. This can be activated in the plugin options panel because is disabled by default.
To exclude a page from the filter set a custom post field eucookielaw_exclude to 1. Just enable “Custom Fields” in “Screen Options” and in the “Custom Fields” box type the name, the value, and hit “Add Custom Field”.
If you want to exclude a script, you can type between <script>
and </script>
the string eucookielaw_exclude.
Ex. add class=”eucookielaw_exclude” or a comment.
Cache
We are working to improve cache compatibility. As for now, conflicts may occur.
WP Super Cache (sperimental*): open the file wp-content/advanced-cache.php and add the following immediately after <?php opening:
if ( !isset( $_COOKIE[‘euCookie’] ) ){ return; }
So that you have:
<?php
if ( !isset( $_COOKIE[‘euCookie’] ) ){ return; }
function wpcache_broken_message() {
WPML
This plugin is officially certified for WPML. You can translate every string with WPML’s String Translation module.
WPML’s String Translation module is part of the Multilingual CMS package. To enable it, you first need to download and install it from your WPML.org account > Click to Downloads section.
Then, go to WPML->String Translation and use the display filter, at the top of the String Translation page, to determine which strings to display.
Click on the translations link to open the translation editor and adjust the strings as you want. Be sure to click on “translation is complete”” after you translate. Incomplete translations will not appear in the site.