EUROPA websites must follow the Commission's guidelines on privacy and data protection and inform users that cookies are not being used to gather information unnecessarily.
The ePrivacy directive – more specifically Article 5(3) – requires prior informed consent for storage for access to information stored on a user's terminal equipment. In other words, you must ask users if they agree to most cookies and similar technologies (e.g. web beacons, Flash cookies, etc.) before the site starts to use them.
For consent to be valid, it must be informed, specific, freely given and must constitute a real indication of the individual's wishes.
In this context this solution lives.
It simply alters the default document.cookie behavior to disallow cookies to be written on the client side, until the user accept the agreement.
At the same time it blocks all third-party domains you have configured as cookie generators.
If you find this script useful, and since I've noticed that nobody did this script before of me, I'd like to receive a donation. :)
If you want to use it as wordpress plugin then skip the Client side and the Server side sections
Download the script file EUCookieLaw.js
Add this code in your HTML head section (better if before all others JavaScripts)
<script src="EUCookieLaw.js"></script>
<script>
new EUCookieLaw({
languages: {
Italiano: {
title: 'Informativa sull\'uso dei cookie',
message: 'In base ad una direttiva europea sulla privacy e la protezione dei dati personali, è necessario il tuo consenso prima di conservare i cookie nel tuo browser. Me lo consenti?',
agreeLabel: 'Sono d\'accordo',
disagreeLabel: 'Non sono d\'accordo'
},
English: {
title: 'Cookie Policy',
message: 'According to european directive about privacy you need to agree this policy before surfing this site.',
agreeLabel: 'I agree',
disagreeLabel: 'I disagree'
}
}
});
</script>If the user accepts the agreement then EUCookieLaw will store a cookie for itself (to remember that the user accepted the agreement) named __eucookielaw with true as value,
that lives during the current session.
the EUCookieLaw initialization expect an Object with the following properties:
-
showBanner(booleandefaultfalse) if you want to show a banner at the top of your page you need to set this option totrue. -
reload(booleandefaultfalse) iftruethe page will be refreshed after the user accepts the agreement. This is useful is used in conjunction with the server side part. -
messageis the message used by the default confirmation dialog. In the case ofshowBanner, themessagecan be an HTML content.NOTE: Since version 2.7.0 this property is deprecated in favor of
languages.<language>object -
debug(booleandefaultfalse) iftruewill show in browser console some useful informations about script execution. -
cookieEnabled(booleandefaultfalse) set totrueto not show the banner. However this setting will change once the user take a choice. -
cookieRejected(booleandefaultfalse) set totrueto not show the banner. However this setting will change once the user take a choice. -
duration(integerdefault0) the number of days you want the cookie will expire. If0, it will produce a session cookie. -
remember(booleandefaulttrue) if setted totrue, the user rejection will be remember through the current session else the choice will be valid only for the current page. -
path(stringdefualt/) defines the path where the consent cookie will be valid. -
domain(stringdefault setted towindow.location.hostvalue) defines the domain which to apply the cookie.Note: Define it to
falseif the URL is defined by IP instead of domain. -
cookieList(arraydefault[]) the list of techincal cookies the user cannot choose to reject. If some script try to write one of the listed cookie it will be accepted.TIP: You can use the
*wildchar as suffix to intend all the cookies that starts with a specific value (eg.__umt*will mean__umta,__umtcand so on). -
blacklist(arraydefault[]) if some script try to inject HTML into the page trhough thedocument.writeit will be allowed only if in the code is not present something that points to one of theblacklisted domain. -
reload(booleandefaultfalse) if set to true, the page will be reloaded on user agreement. -
raiseLoadEvent(booleandefaulttrue) if set totruethe page will raise theloadevent on user consent.Note: some javascript analisys tools requires the event load to be fired, at the same time some scripts would consider the
loadevent to be fired just one time in the life of the page so you should check if all the script on your page is compliant with the same behavior to determine which is the best setting for you and your page.
-
id(stringdefaultbooleanfalse) if notfalsethe banner box will not be created and the script will assume that the banner is the one referred by theid.NOTE: do not set the hash (
#) before the id (eg. OKid: 'my-box'NOid: '#my-banner') -
tagif not empty, the script will use it as predefined tag for title content of the banner. The default value ish1. If the value is an empty string the title is not shown. -
bannerTitlewill be the banner title, it will be used only if thetagvalue is set.NOTE: Since version 2.7.0 this property is deprecated in favor of
languages.<language>object -
agreeLabelthe agree button label. Default isI agreeNOTE: Since version 2.7.0 this property is deprecated in favor of
languages.<language>object -
disagreeLabelthe disagreement button label. Default is an empty string. If not given the disagree button will not be shown.NOTE: Since version 2.7.0 this property is deprecated in favor of
languages.<language>object -
fixOnit defines if the banner is fixed on top or bottom, default value, if not defined or empty, istop. Allowed values aretop,bottomorstatic. -
showAgreementis the callback method that will show the dialog with the user agreement about the cookie usage. If you use a synchronous mode to show a dialog (eg.confirmmethod) theshowAgreementmust returntrueif the user have accepted the agreement, in all other cases (user rejected the agreement or in asynchronous mode) it must returnfalse. -
agreeOnScrolliftrue, when the user will scroll the page, then the agreement is implicitly accepted. The default value isfalse. -
minScrolla number (strictly depending onagreeOnScroll=true) which defines the number of pixels the user need to scroll to apply consent. The default value if not defined is100. -
agreeOnClickiftrue, the user express its conesnt by clicking wherever on the page (but outside the banner). -
languagesallows the banner translation, this property keep a set of languages which ones contains the relative informations about the title, message and button labels.
var settings = {
// ...
languages: {
Italiano: {
title: 'titolo',
message: 'messaggio del banner',
agreeLabel: "sono d'accordo",
disagreeLabel: "non sono d'accordo"
},
English: {
title: '...',
message: '...',
agreeLabel: "...",
disagreeLabel: "..."
},
// ... and so on...
}
};Once EUCookieLaw is initialized, you can access some useful methods in your JavaScript:
-
enableCookiesenables the site to store cookies -
rejectreject the cookies agreement -
isRejectedif the user have rejected the request to store cookie -
isCookieEnabledif the site can store cookies -
reconsiderallows the user to review again the banner and take a new choice. To invoke this function from everywhere in your policy page you can create a link or a button with the following code:
<a href="#"
onclick="(new EUCookieLaw()).reconsider(); return false;">
Reconsider my choice
</a>Synchronous mode (see demo):
<script src="EUCookieLaw.js"></script>
<script>
function myCustomAgreement(){
if(!eu.isRejected()) {
if (confirm('do you agree?')) {
return true;
}
eu.reject();
}
return false;
}
new EUCookieLaw({
showAgreement: myCustomAgreement
});
</script>Asynchronous mode (see demo):
<script src="EUCookieLaw.js"></script>
<script>
function showDialog(){
/*
* Your custom dialog activator goes here
*/
}
function myCustomAgreement(){
/* show some HTML-made dialog box */
showDialog();
return false;
}
new EUCookieLaw({
showAgreement: myCustomAgreement
});
</script>With agreement banner (see demo):
<script src="EUCookieLaw.js"></script>
<script>
new EUCookieLaw({
message: "La legge prevede l'autorizzazione all'utilizzo dei cookie. Me la vuoi dare per favore?",
showBanner: true,
bannerTitle: 'Autorizzazione alla conservazione dei cookie',
agreeLabel: 'Do il mio consenso',
disagreeLabel: 'Nego il consenso',
tag: 'h1'
});
</script>NOTE: The server side usage is available only for servers which has PHP installed.
The server-side script intercept the output buffer and will remove the sent cookies when user has not yet approved the agreement.
Then you should include the file eucookielaw-header.php as the first operation on your server.
This will ensure you that any of your script or CMS like Drupal, Joomla or whatever you are using, is able to write a cookie if the user doesn't given his consensus.
// This must be the first line of code of your main, always called, file.
require_once 'eucookielaw-header.php'; However if the server already detected that the user agreed the cookie law agreement the script does not override the built-in function.
NOTE: Some servers does not have enabled by default the PHP zlib extension, then you should upload the file
gzcompat.phptoo to your server. The file is included on demand byeucookielaw-header.phpif needed. To ensure the right inclusion, both files (eucookielaw-header.phpandgzcompat.phpmust reside in the same folder).
Further if you want to block some javascript elements you can do it by adding a data-eucookielaw="block" attribute to the script elements.
If you want to block specific domains you can define in your script (before including eucookielaw-header.php) two constants:
-
EUCOOKIELAW_USE_DOMiftrueand the classDOMDocumentis available, then the default parser will useDOMDocument. In all other cases theRegular Expressionswill be used to parse page contents.Note: It's suggested to enable this option as default. Disable it only if the page results is a damaged content.
-
EUCOOKIELAW_DISALLOWED_DOMAINSa semicolon (;) separated list of URLs disallowed since the user does not accept the agreement.
Each space before and/or after each URL will be removed.Note: if the domain start by a dot (eg.
.google.com) then all the related subdomains will be included in the temporary blacklist. -
EUCOOKIELAW_LOOK_IN_TAGSa pipe (|) separated list of tags where to search for the domains to block.
If not specified, the deafault tags areiframe,script,link,img,embedandparam. -
EUCOOKIELAW_LOOK_IN_SCRIPTSa boolean value, iftruethe URLs defined inEUCOOKIELAW_DISALLOWED_DOMAINSwill be searched in the<script>...</script>tags too. -
EUCOOKIELAW_SEARCHBOT_AS_HUMANiftruethe search engines will be threated as humans (same contents, to avoid accidental cloacking contents). -
EUCOOKIELAW_ALLOWED_COOKIESthe list (must be a comma separated value) of techincal cookies that the server is allowed to generate and that will not removed from headers.TIP #1: You can use the
*wildchar as suffix to intend all the cookies that starts with a specific value (eg.__umt*will mean__umta,__umtcand so on).
TIP #2: If you use just*all cookies generated by your Web Site are allowed. -
EUCOOKIELAW_AUTOSTARTif you want to invoke late theob_startthen you should define this constant totrue.NOTE: If you set this option to
trueyou need to invoke lately by your own thebufferingclass method. -
EUCOOKIELAW_DISABLEDa boolean value, iftruethe classEUCookieLawHeaderwill not be instantiated when you include theeucookielaw-cache.phpin your PHP scripts. -
EUCOOKIELAW_DEBUGa boolean value, iftruethe HTML output will report before each replacement the rule applied and at the beginning of the file it will show all the applied rules.Important do not keep it enabled on production environment.
Note: in the beginning of your HTML file you can see<!-- (EUCookieLaw Debug Enabled) -->message followed by some other details. Those messages are useful to understand what exactly is happening in your site. -
EUCOOKIELAW_DEBUG_VERBOSITY(optional, default value is99) ifEUCOOKIELAW_DEBUGis set totruethis constants sets the verbosity of the log. It can assume one of the following values:0: Silent10: Several debug log messages20: Most of debug log messages99: All the log messages
-
EUCOOKIELAW_LOG_FILE(optional) if defined andEUCOOKIELAW_DEBUGistruethe output log will be written in the file defined in this constant. -
EUCOOKIELAW_BANNER_ADDITIONAL_CLASSa string where to define the custom classes applied to the banner. -
EUCOOKIELAW_BANNER_TITLEthe title to show on the banner. -
EUCOOKIELAW_BANNER_DESCRIPTIONthe description to show into the banner. -
EUCOOKIELAW_BANNER_AGREE_BUTTONthe label on the agree button -
EUCOOKIELAW_BANNER_DISAGREE_BUTTONthe label on the disagree button. If not defined or defined as empty string then the disagree button will not be shown on the page. -
EUCOOKIELAW_BANNER_AGREE_LINKthe link to apply the consent. To let this script to manage by its own the consent, the querystring on this link must contain also the argument__eucookielaw=agree.
this mean that if the link ishttp://example.com/my-page.html?arg1=a&arg2=bthen you should append the suggested argument as follows:http://example.com/my-page.html?arg1=a&arg2=b&__eucookielaw=agree. -
EUCOOKIELAW_BANNER_DISAGREE_LINKthe link to reject the consent. To let this script to manage by its own the rejection, the querystring on this link must contain also the argument__eucookielaw=disagree.
this mean that if the link ishttp://example.com/my-page.html?arg1=a&arg2=bthen you should append the suggested argument as follows:http://example.com/my-page.html?arg1=a&arg2=b&__eucookielaw=disagree. -
EUCOOKIELAW_IGNORED_URLSthe list of site urls where not to apply the cookie policy. The list of urls must be separated by new line character (\n).
In the URL is allowed the*wildchar that means everything.Few Examples:
If you type/sitemap.xmlas one of the ignored URL then, the exact match will be ignored.
If you type*/sitemap.xmleverything that ends with/sitemap.xmlwill be ignored.
If you type/sitemaps/*everything in the site directory/sitemaps/will be ignored.
If you type/folder/*.xmleverything in the/folder/directory that has.xmlextension will be ignored. -
EUCOOKIELAW_BANNER_LANGUAGESa string containing json encoded data relative to languages.
To produce this definition constant is worth to use the following script:$languages = array( 'English' => array( 'title' => 'English title of the banner', 'message' => 'English message of the banner', 'agreeLabel' => 'Agree', 'disagreeLabel' => 'Disagree' ), 'Italiano' => array( 'title' => 'Titolo del banner in italiano', 'message' => 'Messaggio del banner in italiano', 'agreeLabel' => 'Consento', 'disagreeLabel' => 'Non consento' ) ); define('EUCOOKIELAW_BANNER_LANGUAGES', json_encode($languages) );
While WordPress has its own shortcode to manage the reconsider button, in the standalone version you should produce a link with a specific argument into the querystring: __eucookielaw=reconsider.
The plugin is available on WordPress plugin directory.
If you want install from this repository, just download the zip and install it in your WordPress. The plugin actually supports translation in both Italian (by translation file) and English (default).
The plugin is compliant (also read as has been tested) with WP Super Cache, W3 Total Cache and Zen Cache plugins to serve the right contents when the user has not yet approved the agreement.
Actually EUCookieLaw supports two shortcodes
The purpose of this shortcode is to produce a button that allow user to choose again whether to consent or not the cookie policy.
It will show a link with btn and btn-warning classes and text defined in the label attribute.
If you don't define the label attribute the default value is Reconsider.
Example: [EUCookieLawReconsider label="I want take another choice"]
The purpose of this shortcode is to wrap contents into a post and make it available once the user agreed the policy.
Example:
[EUCookieLawBlock]
<p>
This content is blocked until user consent
</p>
[EUCookieLawBlock]NOTE: This section is no more useful since the new settings for multiple languages.
I've implemented the custom text-domain files ( EUCookieLawCustom-it_IT.po / EUCookieLawCustom-it_IT.po ).
Remember that to get custom translations properly work, you need to move the EUCookieLawCustom directory at the plugins directory level.
To be more clear the custom directory will be: wp-content/plugins/EUCookieLawCustom
Then take the file default and you have to put 4 strings in your translation file:
Banner titleBanner descriptionI agreeI disagreeReconsider
Remember to put the above text in the plugin settings page (default behavior) and to produce the translation files
(starting from the default.po located in the EUCookieLawCustom directory).
You can see a production example on my personal WebSite.
To ensure your site is law compliant, you should have a page where you describe to your user which are the third-party cookies, which is their purpose and how to disable them. And yes! Don't forget to put the link in the banner!
The structure of generated banner (with the default heading tag settings) is the following:
<div class="eucookielaw-banner fixedon-top" id="eucookielaw-135">
<div class="well">
<h1 class="banner-title">
The banner title
</h1>
<div class="banner-message">
The banner message
</div>
<ul id="eucookielaw-language-switcher">
<li onclick="(new EUCookieLaw()).switchLanguage('English'); return false;">
<a href="/?__eucookielaw=switch:English">English</a>
</li>
<li onclick="(new EUCookieLaw()).switchLanguage('Italiano'); return false;">
<a href="/?__eucookielaw=switch:Italiano">
Italiano
</a>
</li>
</ul>
<p class="banner-agreement-buttons text-right">
<a class="disagree-button btn btn-danger" onclick="(new EUCookieLaw()).reject();">Disagree</a>
<a class="agree-button btn btn-primary" onclick="(new EUCookieLaw()).enableCookies();">Agree</a>
</p>
</div>
</div>.eucookielaw-banneris the banner container it will have a randomidattribute name that starts always witheucookielaw-and then followed by a number between0and200..wellis the inner containerh1.banner-titleis the banner titlep.banner-messageis the banner html message#eucookielaw-language-switcheris the list of languages which the banner is available. It is not visible if just one lanuages is available.p.banner-agreement-buttons.text-rightis the buttons container for the agree/disagree buttonsa.disagree-buttonis the disagree button it implements the CSS classesbtnandbtn-dangera.disagree-buttonis the agree button it implements the CSS classesbtnandbtn-primary
You can make your own CSS to build a custom aspect for the banner. However, if you prefer, you can start from the bundled CSS.
NOTE: If you are using the script as WordPress plugin, the custom CSS must be located in the directory
wp-content/plugins/EUCookieLawCustom/and must be namedeucookielaw.css. Then it will be read in conjunction with the default plugin CSS.
I'd like to translate this plugin in all european languages, but I'm limited to the Italian and English too.
If you want to get involved in this plugin development, then fork the repository, translate in your language and make a pull request!
- BUGFIX: If some contents to be blocked are present before the
EUCookieLaw.jsfile inclusion the page will become broken. - BUGFIX: [WP]
Warning: Constants may only evaluate to scalar valuesbugfix (issue #89) - Updated the version number
- IMPROVEMENTS: [WP] a better way to recognize if there is a cache plugin installed
- BUGFIX: [WP]
Warning: Constants may only evaluate to scalar valuesbugfix (issue #87) - BUGFIX: If the only language configured is Default a javascript error occours (issue #88)
- BUGFIX: [WP] INIReader.php file was missing (solves issue #86 and part of issue #87)
- BUGFIX: [WP] Resolved an issue that has broken the Customizer.
- NEW: In the JavaScript file
EUCookieLaw.jsnow is available the variableEUCOOKIELAW_VERSIONwith the number of current version. - NEW: Now you can set the cookie policy's banner with multiple languages
- NEW: [WP] Improved WordPress admin interface to a better management of the multiple languages.
- NEW: [WP] Multilingual no requires any multilingual plugins
- NEW: Now you can choose to raise the load event on user agreement.
- IMPROVEMENTS: The regexp eingine now takes care about Internet Explorer Conditional Comments (solves issue #84)
- IMPROVEMENTS: [WP] every minute the cron checks if the configuration files into cache are available to solve definitively the issues against WP Super Cache and W3 Total Cache plugins.
- IMPROVEMENTS: [WP] When
wp-config.phpis not available in the site root, the plugin notify what to manually wrtite into it. - IMPROVEMENTS: Now the banner message is nested into a
divto better fit the most sites/users requirements. - BUGFIX: [WP] Google Maps and Google Fonts were switched in fast service selection group
- NOTICE: Some definitions were marked as deprecated since this version
- Minor bugfixes and general improvements
- Updated documentation
- Updated translation files
- Updated the version number
- IMPROVEMENTS: The regenerated contents via javascript (without page reload) are correctly parsed evenif there is a
document.writecall - IMPROVEMENTS: if in the query string is present the
__eucookielawargument it will be redirected (with301: Moved Permanently) to the same resource without the argument to avoid the Google duplicated tags warning. - IMPROVEMENTS: if not defined
EUCOOKIELAW_BANNER_ADDITIONAL_CLASSwill be automatically defined as empty. - updated the version number
- BUGFIX: Removed an accidentally leaved
utf8_decodemethod that broke the output in several servers. - updated the version number
- IMPROVEMENTS: After consent the script raises the
window'sloadevent to be compliant with some scripts - IMPROVEMENTS: Setted DOMDocument Engine to keep the original spacing to avoid some strange behavior
- BUGFIX: In some circumstances the regexp engine turns in infinite loop
- updated the version number
- NEW: Now you can configure the URL where the banner must not be shown (Issue #69, #66, #61.
- NEW: Now you can set the debug level
- IMPROVEMENTS: Improved javascript to avoid full page reload
- IMPROVEMENTS: Improved Regular Expression parsing Engine
- IMPROVEMENTS: Improved DOMDocument parsing Engine
- IMPROVEMENTS: [WP] Minor admin panel reorganization
- IMPROVEMENTS: Better code readability in
eucookielaw-header.php - BUGFIX: W3TC Page Cache flush causes EUCookieLaw to not work properly (Issue #65).
- BUGFIX: Cache clear after saving not works properly causing a warning in error log file
- Minor bugfixes and general improvements
- updated documentation
- updated the version number
- NEW: Now you can define the domain where the cookie will be applied
- IMPROVEMENTS: Javascript page reload forces contents from server (ignoring browser cache)
- BUGFIX:
WP_CONTENT_DIRdefined instead ofEUCL_CONTENT_DIRcauses some problems if site is without cache. - Minor bugfixes and general improvements
- updated documentation
- updated the version number
- NEW: Now you can set the number of pixels for consent on scroll
- NEW: If not configured (as constants) the agree and disagree links will be auto-generated by the server.
- NEW: [WP] If you type twice a blocked URL or if a rule is already covered from another one then it will be visually noticed.
- NEW: [WP] You can now analyze your home page to which external URL are called and which ones is producing cookeis.
- NEW: [WP] If user agent contains the information
EUCookieLaw:<VERSION_NUMBER>then it will bypass the cookielaw block (used by the site analyzer). - IMPROVEMENTS: If you define an empty rule in disallowed URLS it will be ignored
- IMPROVEMENTS: [WP] Several improvements on admin page and admin JavaScript
- IMPROVEMENTS: On localhost (
127.0.0.1) the domain defined for the technical cookie must be empty to grand compatibility with some browsers. - BUGFIX:
header_removemethod in PHP prior 5.3 does not exists. - BUGFIX: The non JavaScript version of banner was containing wrong consent/rejection URL
- BUGFIX: [WP] With some W3 Total Cache configuration, EUCookieLaw was producing invalid output
- BUGFIX: [WP] Path definition confilcts with NextGenGallery
- BUGFIX: [WP] On settings page the Replaced scripts source assumes the value of Replaced iframe source also if the value is correctly saved.
- updated translation files
- updated documentation
- updated the version number
- BUGFIX: [WP] JavaScript for the admin interface was corrupted.
- BUGFIX: [WP] Unable to save settings due to a
1accidentally placed in the wrong place. - IMPROVEMENTS: [WP] Admin interface minor improvements
- NEW: Now there are two parsing engine, one based on regular expressions and one based on DOMDocument.
- NEW: [WP] Now you can import and export settings to apply the same contents on multiple sites easly.
- NEW: Now you can write debug informations on file.
- NEW: [WP] When the plugin's debug is enabled you will see an alert on every admin page.
- NEW: New theme
floatingavailable. - IMPROVEMENTS: [WP] Admin interface improved
- IMPROVEMENTS: Improved documentation
- updated translation files
- updated documentation
- updated the version number
- IMPROVEMENTS: Some JavaScript were not detected by the server if formatted in certain formats.
- BUGFIX: [WP] When W3 Total Cache is enabled and you do not have right permissions on file the message as quite cryptical.
- NEW: [WP] On tinyMCE (visual editor) you have the EUCookieLaw helpers
- NEW: [WP] Visual shortcodes in the visual editor
- NEW: Now you can define which is the default file replacement for
iframes andscripts. - IMPROVEMENT: Some improvements in admin area page
- IMPROVEMENT: Some improvements in content identification
- IMPROVEMENT: [WP] Now only administrators can access the settings page
- BUGFIX: Due to a typos the client side cookies (generated by JavaScript) are always written
- updated the version number
- IMPROVEMENT: If not defined the
EUCOOKIELAW_BANNER_DISAGREE_BUTTONthe disagree button will not be shown on the page. - IMPROVEMENT: Removed the session/local storage in favor of technical session cookie for storing the user rejection
- IMPROVEMENT: Improved the way to detect if the cookie is approved or rejected
- IMPROVEMENT: Uniformed the way to write the technical cookie
__eucookielaw - IMPROVEMENT: Improved the way how the banner is removed
- IMPROVEMENT: Updated missing pieces in documentation.
- IMPROVEMENT: Optimized behavior when asked reload of contents after consent.
- BUGFIX: Resolved an anicient related firefox issue
- BUGFIX: [WP] if the disabled option is set to yes, neither the JavaScript and CSS must be loaded on the page.
- BUGFIX: Minor bugfixes in JavaScript
- updated the minor version number
- updated documentation
- BUGFIX: when PHP does not have gzdecode the method is implemented on needs.
- BUGFIX: Internet Explorer and some mobile Browser does not recognize the
instancevariable asEUCookieLawobject causing a bad banner behavior. - BUGFIX: [WP] NextGenGallery has some weird behavior sometimes (skipped to load the locker if it is a NGG URL.
- IMPROVEMENT: [WP] The plugin now tries to write into
wp-config.phponly if there is another cache plugin enabled on the site. - IMPROVEMENT: EUCookieLaw related PHP Warnings threated as required
- CRITICAL:
Most of WordPress sites uses a FTP settings for writing files. Used native
file_get_contentsandfile_put_contentsto write data into some files for a better user experience.
- NEW: [\WP] Full compliant with any cache plugin (actually successfully tested with WP Super Cache, W3 Total Cache, Zen Cache)
- NEW: The banner is now visible either with and without javascript enabled.
- NEW: User consent whenever he clicks on an element of the page (Issue #12)
- NEW: You can list the allowed cookies before consent (aka Technical Cookies). This solves the issue #15
- NEW: Now Google Analytics is able to write cookies via JavaScript (if configured) (Issue #15)
- NEW: [WP] You can enable/disable the banner on frontend (Issue #20)
- NEW: [WP] You can enable/disable the banner on the login page (Issue #21)
- NEW: You can set the "reload on scroll" (Issue #26)
- NEW: [WP] Added the WPML XML Configuration File for a better WPML compatibility.
- IMPROVEMENT: [WP] Lack of documentation on certain admin fields (Issue #27)
- IMPROVEMENT: Most of PHP Code was completely refactored from the ground to improve performance and readability.
- BUGFIX: [WP] NextGenGallery conflict resolved (Issue #31)
- BUGFIX: [WP] QuickAdsense conflict resolved (Issue #36 and #32 )
- BUGFIX: [WP] Revolution Slider conflict resolved (Issue #37)
- BUGFIX: Page URL changes after reload (Issue #38)
- BUGFIX: Scroll on tablet does not work (Issue #40)
- BUGFIX: Invalid Calling Object in Internet Explorer 9 and Safari was resolved (Issue #41)
- updated translation files
- updated documentation
- updated the version number
- NEW: Now the plugin is able to detect if the user agent and does not block contents if it is search engine
- NEW: All the external contents are loaded after the user consent without page reloading ( Issues #4 and #10)
- NEW: The script allows to define the consent duration in days (Issue #7, #17 and #23)
- NEW: Now is possible to check almost in every HTML element ( Implicitly resolved issue #6)
- NEW: The script remembers the user rejection.
- NEW: New JavaScript public method
reconsiderto revoke the consent (and the rejection) showing the banner again (Issue #7) - NEW: [WP] Added shortcode for reconsider button (see documentation for further details) (Issue #7)
- NEW: [WP] Added shortcode for wrapping contents (see documentation for further details)
- NEW: Now the consent on scroll is fired at least after 100px scroll (up or down)
- IMPROVEMENT: [WP] Made compliant with WP Super Cache, W3 Total Cache, Zen Cache (Issue #23)
- IMPROVEMENT: Javascript has been refactored to improve performance and maintenability
- IMPROVEMENT: [WP] Admin interface improved
- IMPROVEMENT: Some CSS improvements (Issue (Issue #8)
- BUGFIX: Consent on scroll doesn't work propery
- BUGFIX: [WP] Custom content path not recognized correctly ( Issue #9)
- BUGFIX: Typos where
scriptwas written assrcripton server script (Issue #16) - BUGFIX: Only first occourrence of the same/similar URL is blocked (Issue #19)
- BUGFIX: Corrected some IE8 weird behavior
- updated translation files
- updated documentation
- updated the version number
- BUGFIX: fixed the javascript that has wrong characters in the script
- NEW: when you specify a domain starting with a dot (eg.
.google.com) all the subdomains are valid (eg.www.google.comandsub.domain.google.com) - NEW: Improved the banner loading (loaded before the DOM Event
load) - NEW: Optional implicit user agree on page scrolling (Issue #4).
- NEW: Debugging options
- NEW: You can fix the banner on top or bottom of the page.
- NEW: The custom CSS (from
EUCookieLawCustom) will be loaded in conjunction with the default CSS. - BUGFIX: removed the
<![CDATA[ ... ]]>envelop on script replacement due to some browser incompatibility. - BUGFIX: Custom translations was never read
- updated translation files
- updated documentation
- updated the version number
- BUGFIX: the default text for disagree button when not given was
Disagreeinstead it should be empty. - BUGFIX: whatever is the name of the plugin directory the directory for the customizations (translations and CSS) must be
/wp-content/plugins/EUCookieLawCustom/. - updated documentation
- updated the version number
- Updated the eucookielaw-header.php,
- NEW: now the disallowed domains trims the spaces on each domain. It means that is allowed to write
domain1.com ; domain2.comand they will be correctly interpreted asdomain1.comanddomain2.com
- NEW: now the disallowed domains trims the spaces on each domain. It means that is allowed to write
- NEW: If not defined the disagee label text then the button is not shown. Useful for informative non-restrictive cookie policy.
- BUGFIX: the cookie
__eucookielawsetted by javascript is defined at root domain level. - updated documentation
- updated the version number
- Updated the eucookielaw-header.php,
- NEW: now the search of url is performed in
<script>...</script>tags too. - BUGFIX: some translations strings were broken.
- NEW: now the search of url is performed in
- updated translation files
- updated documentation
- updated the version number
This update introduces several improvements, features and bugfixes. For a detailed information about the new release see: Issue #1
- updated the eucookielaw-header.php,
- NEW: now it blocks script tags with
data-eucookielaw="block"attribute - NEW: now is possible to define a blacklist of domains to block before the user consent the agreement
- NEW: the blacklist is related to a set of tags (by default the plugin will scan
iframe,linkandscripttags
- NEW: now it blocks script tags with
- NEW:: managed title tag, blocked domains and tags to scan
- NEW: if the plugin WP Super Cache is installed then the plugin will clear the cache until the user has not approved the agreeement to ensure to show always the right contents
- NEW:: if there is a CSS file named
eucookielaw.cssin the custom directorywp-content/plugins/EUCookieLawCustom/the it will be appliead in place of the default one. - BUGFIX: unescaped post data before saving the admin settings
- updated the version number
- updated translation strings
- updated documentation
- First release
If you find this script useful, and since I've noticed that nobody did this script before of me, I'd like to receive a donation. :)