EU Cookie Law - Version 3.0.1

Version Description

26.05.2019 = * Fixed critical bug with some browsers (for example Internet Explorer) that killed "Accept" button

Download this release

Release Info

Developer Milmor
Plugin Icon 128x128 EU Cookie Law
Version 3.0.1
Comparing to
See all releases

Code changes from version 2.13 to 3.0.1

class-admin.php CHANGED
@@ -10,15 +10,14 @@ function show_peadig_eucookie_options() {
10
  add_options_page('EU Cookie Law', 'EU Cookie Law', 'manage_options', 'peadig_eucookie', 'peadig_eucookie_options');
11
  }
12
 
13
- add_action( 'admin_enqueue_scripts', 'ecl_enqueue_color_picker' );
14
- function ecl_enqueue_color_picker( $hook_suffix ) {
15
  $screen = get_current_screen();
16
 
17
  if ( $screen->id == 'settings_page_peadig_eucookie') {
18
  wp_enqueue_style( 'wp-color-picker' );
19
- wp_enqueue_script( 'elc-color-picker', plugins_url('js/eucookiesettings.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
20
  }
21
- }
22
 
23
  // ADMIN PAGE
24
  function peadig_eucookie_options() {
@@ -46,20 +45,47 @@ function peadig_eucookie_options() {
46
  <?php esc_html_e('Support', 'eu-cookie-law'); ?>
47
  </a>
48
  </h1>
49
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  <form method="post" action="options.php">
51
  <?php settings_fields('peadig_eucookie_options'); ?>
52
  <?php
53
  ecl_check_defaults();
54
  $options = get_option('peadig_eucookie');
55
  ?>
 
56
  <table class="form-table">
57
  <tr valign="top"><th scope="row"><label for="enabled"><?php esc_html_e('Activate'); ?></label></th>
58
  <td><input id="enabled" name="peadig_eucookie[enabled]" type="checkbox" value="1" <?php checked('1', $options['enabled']); ?> /></td>
59
  </tr>
60
  <tr valign="top"><th scope="row"><label for="autoblock"><?php esc_html_e('Auto Block', 'eu-cookie-law'); ?></label></th>
61
  <td><input id="autoblock" name="peadig_eucookie[autoblock]" type="checkbox" value="1" <?php checked('1', $options['autoblock']); ?> /><br>
62
- <small><?php esc_html_e('This function will automatically block iframes, embeds and scripts in your post, pages and widgets.', 'eu-cookie-law'); ?></small></td>
 
 
 
 
 
 
 
 
63
  </tr>
64
  <tr valign="top"><th scope="row"><label for="tinymcebutton"><?php esc_html_e('Enable TinyMCE Button', 'eu-cookie-law'); ?></label></th>
65
  <td><input id="tinymcebutton" name="peadig_eucookie[tinymcebutton]" type="checkbox" value="1" <?php checked('1', $options['tinymcebutton']); ?> /><br>
@@ -79,11 +105,11 @@ function peadig_eucookie_options() {
79
  <small><?php esc_html_e('Once the user clicks accept the bar will disappear. You can set how long this will apply for before the bar reappears to the user.', 'eu-cookie-law'); ?> <?php esc_html_e('Set "0" for SESSION cookie.', 'eu-cookie-law'); ?></small>
80
  </td>
81
  </tr>
82
- <tr valign="top"><th scope="row"><label for="scrollconsent"><?php esc_html_e('Scroll Consent', 'eu-cookie-law'); ?></label></th>
83
  <td><input id="scrollconsent" name="peadig_eucookie[scrollconsent]" type="checkbox" value="1" <?php checked('1', $options['scrollconsent']); ?> /><br>
84
  <small><?php esc_html_e('Click here if you want to consider scrolling as cookie acceptation. Users should be informed about this...', 'eu-cookie-law'); ?></small></td>
85
  </tr>
86
- <tr valign="top"><th scope="row"><label for="navigationconsent"><?php esc_html_e('Navigation Consent', 'eu-cookie-law'); ?></label></th>
87
  <td><input id="navigationconsent" name="peadig_eucookie[navigationconsent]" type="checkbox" value="1" <?php checked('1', $options['navigationconsent']); ?> /><br>
88
  <small><?php esc_html_e('Click here if you want to consider continuing navigation as cookie acceptation. Users should be informed about this...', 'eu-cookie-law'); ?></small></td>
89
  </tr>
@@ -200,7 +226,7 @@ function peadig_eucookie_options() {
200
  </tr>
201
  <tr valign="top"><th scope="row"><label for="cc-cookieenabled">
202
  <?php esc_html_e('Cookie enabled message', 'eu-cookie-law'); ?><br>
203
- <small><?php esc_html_e('This is the message that will be displayed when cookie are enabled', 'eu-cookie-law'); ?></small></label></th>
204
  <td>
205
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[cc-cookieenabled]' id='cc-cookieenabled' rows='9' ><?php echo esc_textarea( $options['cc-cookieenabled'] ); ?></textarea><br>
206
 
@@ -210,7 +236,7 @@ function peadig_eucookie_options() {
210
  </tr>
211
  <tr valign="top"><th scope="row"><label for="cc-cookiedisabled">
212
  <?php esc_html_e('Cookie disabled message', 'eu-cookie-law'); ?><br>
213
- <small><?php esc_html_e('This is the message that will be displayed when cookie are not accepted', 'eu-cookie-law'); ?></small></label></th>
214
  <td>
215
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[cc-cookiedisabled]' id='cc-cookiedisabled' rows='9' ><?php echo esc_textarea( $options['cc-cookiedisabled'] ); ?></textarea>
216
  </td>
10
  add_options_page('EU Cookie Law', 'EU Cookie Law', 'manage_options', 'peadig_eucookie', 'peadig_eucookie_options');
11
  }
12
 
13
+ add_action( 'admin_enqueue_scripts', function ( $hook_suffix ) {
 
14
  $screen = get_current_screen();
15
 
16
  if ( $screen->id == 'settings_page_peadig_eucookie') {
17
  wp_enqueue_style( 'wp-color-picker' );
18
+ wp_enqueue_script( 'elc-color-picker', plugins_url('js/settings.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
19
  }
20
+ } );
21
 
22
  // ADMIN PAGE
23
  function peadig_eucookie_options() {
45
  <?php esc_html_e('Support', 'eu-cookie-law'); ?>
46
  </a>
47
  </h1>
48
+
49
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
50
+
51
+ <!-- Identify your business so that you can collect the payments. -->
52
+ <input type="hidden" name="business" value="milesimarco@outlook.com">
53
+
54
+ <!-- Specify a Donate button. -->
55
+ <input type="hidden" name="cmd" value="_donations">
56
+
57
+ <!-- Specify details about the contribution -->
58
+ <input type="hidden" name="item_name" value="EU Cookie Law (WordPress plugin)">
59
+ <input type="hidden" name="currency_code" value="EUR">
60
+
61
+ <!-- Display the payment button. -->
62
+ <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="Donate">
63
+ <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
64
+
65
+ </form>
66
+
67
  <form method="post" action="options.php">
68
  <?php settings_fields('peadig_eucookie_options'); ?>
69
  <?php
70
  ecl_check_defaults();
71
  $options = get_option('peadig_eucookie');
72
  ?>
73
+
74
  <table class="form-table">
75
  <tr valign="top"><th scope="row"><label for="enabled"><?php esc_html_e('Activate'); ?></label></th>
76
  <td><input id="enabled" name="peadig_eucookie[enabled]" type="checkbox" value="1" <?php checked('1', $options['enabled']); ?> /></td>
77
  </tr>
78
  <tr valign="top"><th scope="row"><label for="autoblock"><?php esc_html_e('Auto Block', 'eu-cookie-law'); ?></label></th>
79
  <td><input id="autoblock" name="peadig_eucookie[autoblock]" type="checkbox" value="1" <?php checked('1', $options['autoblock']); ?> /><br>
80
+ <small><?php esc_html_e('This function will automatically block iframes, embeds and scripts in your post, pages and widgets.', 'eu-cookie-law'); ?></small>
81
+ <table id="fineblock" class="form-table"<?php if ( !eucookie_option('autoblock') ) { echo ' style="display: none;"'; } ?>>
82
+ <tr valign="top"><th scope="row"><label for="exclude_script"><?php esc_html_e('Exclude Scripts'); ?></label><br><small>/beta<smaill></th>
83
+ <td><input id="exclude_script" name="peadig_eucookie[exclude_script]" type="checkbox" value="1" <?php checked('1', $options['exclude_script']); ?> /><br>
84
+ <small><?php esc_html_e('Check this if you don\'t want scripts to be blocked.', 'eu-cookie-law'); ?></small></td>
85
+ </tr>
86
+ </table>
87
+
88
+ </td>
89
  </tr>
90
  <tr valign="top"><th scope="row"><label for="tinymcebutton"><?php esc_html_e('Enable TinyMCE Button', 'eu-cookie-law'); ?></label></th>
91
  <td><input id="tinymcebutton" name="peadig_eucookie[tinymcebutton]" type="checkbox" value="1" <?php checked('1', $options['tinymcebutton']); ?> /><br>
105
  <small><?php esc_html_e('Once the user clicks accept the bar will disappear. You can set how long this will apply for before the bar reappears to the user.', 'eu-cookie-law'); ?> <?php esc_html_e('Set "0" for SESSION cookie.', 'eu-cookie-law'); ?></small>
106
  </td>
107
  </tr>
108
+ <tr valign="top"><th scope="row"><label for="scrollconsent"><?php esc_html_e('Scroll Consent', 'eu-cookie-law'); ?></label><br><small style="color:red;">/no GDPR compliance except for technical cookies + AutoBlock OFF<smaill></th>
109
  <td><input id="scrollconsent" name="peadig_eucookie[scrollconsent]" type="checkbox" value="1" <?php checked('1', $options['scrollconsent']); ?> /><br>
110
  <small><?php esc_html_e('Click here if you want to consider scrolling as cookie acceptation. Users should be informed about this...', 'eu-cookie-law'); ?></small></td>
111
  </tr>
112
+ <tr valign="top"><th scope="row"><label for="navigationconsent"><?php esc_html_e('Navigation Consent', 'eu-cookie-law'); ?></label><br><small style="color:red;">/no GDPR compliance except for technical cookies + AutoBlock OFF<smaill></th>
113
  <td><input id="navigationconsent" name="peadig_eucookie[navigationconsent]" type="checkbox" value="1" <?php checked('1', $options['navigationconsent']); ?> /><br>
114
  <small><?php esc_html_e('Click here if you want to consider continuing navigation as cookie acceptation. Users should be informed about this...', 'eu-cookie-law'); ?></small></td>
115
  </tr>
226
  </tr>
227
  <tr valign="top"><th scope="row"><label for="cc-cookieenabled">
228
  <?php esc_html_e('Cookie enabled message', 'eu-cookie-law'); ?><br>
229
+ <small><?php esc_html_e('Message when cookies have been accepted', 'eu-cookie-law'); ?></small></label></th>
230
  <td>
231
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[cc-cookieenabled]' id='cc-cookieenabled' rows='9' ><?php echo esc_textarea( $options['cc-cookieenabled'] ); ?></textarea><br>
232
 
236
  </tr>
237
  <tr valign="top"><th scope="row"><label for="cc-cookiedisabled">
238
  <?php esc_html_e('Cookie disabled message', 'eu-cookie-law'); ?><br>
239
+ <small><?php esc_html_e('Message when cookies haven\'t been accepted', 'eu-cookie-law'); ?></small></label></th>
240
  <td>
241
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[cc-cookiedisabled]' id='cc-cookiedisabled' rows='9' ><?php echo esc_textarea( $options['cc-cookiedisabled'] ); ?></textarea>
242
  </td>
class-frontend.php CHANGED
@@ -2,25 +2,10 @@
2
 
3
  $euCookieSet = 0;
4
 
5
- add_action( 'send_headers', function() {
6
- if ( isset($_GET['nocookie']) ) {
7
- setcookie('euCookie', '', 1, '/');
8
- global $euCookieSet;
9
- $euCookieSet = 0;
10
- wp_redirect( esc_url( remove_query_arg( 'nocookie' ) ) );
11
- exit();
12
- }
13
- });
14
-
15
  add_action('wp_head', function() {
16
 
17
  global $euCookieSet;
18
- global $deleteCookieUrlCheck;
19
-
20
- if ( !isset($_GET['nocookie']) && wp_get_referer() && eucookie_option('navigationconsent') && (!cookie_accepted()) && (eucookie_option('boxlinkid') != get_the_ID()) ) {
21
- $euCookieSet = 1;
22
- }
23
-
24
 
25
  if ( ecl_isSearchEngine() ) {
26
  $euCookieSet = 1;
@@ -36,8 +21,7 @@ add_action('wp_head', function() {
36
  'scrollConsent' => eucookie_option('scrollconsent'),
37
  'networkShareURL' => ecl_get_cookie_domain(),
38
  'isCookiePage' => eucookie_option('boxlinkid') == get_the_ID(),
39
- 'isRefererWebsite' => eucookie_option('navigationconsent') && wp_get_referer(),
40
- 'deleteCookieUrl' => esc_url( add_query_arg( 'nocookie', '1', get_permalink() ) )
41
  );
42
 
43
  wp_enqueue_script(
@@ -96,7 +80,7 @@ function cookie_accepted() {
96
 
97
  if ( ! eucookie_option('enabled') ) { return true; }
98
 
99
- if ( ( isset( $_COOKIE['euCookie'] ) && !isset( $_GET['nocookie'] ) ) || $euCookieSet ) {
100
  return true;
101
  } else {
102
  return false;
@@ -195,7 +179,9 @@ function ecl_erase($content) {
195
  ) {
196
 
197
  $content = preg_replace('#<iframe.*?\/iframe>|<object.*?\/object>|<embed.*?>#is', generate_cookie_notice('auto', '100%'), $content);
198
- $content = preg_replace('#<script.(?:(?!eucookielaw_exclude).)*?\/script>#is', '', $content);
 
 
199
  $content = preg_replace('#<!cookie_start.*?\!cookie_end>#is', generate_cookie_notice('auto', '100%'), $content);
200
  $content = preg_replace('#<div id=\"disqus_thread\".*?\/div>#is', generate_cookie_notice('auto', '100%'), $content);
201
  }
@@ -245,13 +231,13 @@ function ecl_frontstyle($name) {
245
  }
246
  }
247
 
248
- function eu_cookie_control_shortcode( $atts ) {
249
  if ( !eucookie_option('enabled') ) { return; }
250
  if ( cookie_accepted() ) {
251
  return '
252
  <div class="pea_cook_control" style="color:'.ecl_frontstyle('fontcolor').'; background-color: rgba('.ecl_frontstyle('backgroundcolor').',0.9);">
253
- '.eucookie_option('cc-cookieenabled').'<br>
254
- <button id="eu_revoke_cookies" class="eu_control_btn">'.eucookie_option('cc-disablecookie').'</button>
255
  </div>';
256
  } else {
257
  return '
@@ -259,8 +245,7 @@ function eu_cookie_control_shortcode( $atts ) {
259
  '.str_replace( '%s', eucookie_option('barbutton'), eucookie_option('cc-cookiedisabled') ).'
260
  </div>';
261
  }
262
- }
263
- add_shortcode( 'cookie-control', 'eu_cookie_control_shortcode' );
264
 
265
  function eu_cookie_list_shortcode( $atts ) {
266
 
2
 
3
  $euCookieSet = 0;
4
 
 
 
 
 
 
 
 
 
 
 
5
  add_action('wp_head', function() {
6
 
7
  global $euCookieSet;
8
+ global $deleteCookieUrlCheck;
 
 
 
 
 
9
 
10
  if ( ecl_isSearchEngine() ) {
11
  $euCookieSet = 1;
21
  'scrollConsent' => eucookie_option('scrollconsent'),
22
  'networkShareURL' => ecl_get_cookie_domain(),
23
  'isCookiePage' => eucookie_option('boxlinkid') == get_the_ID(),
24
+ 'isRefererWebsite' => eucookie_option('navigationconsent') && wp_get_referer() && ( eucookie_option('boxlinkid') != get_the_ID() )
 
25
  );
26
 
27
  wp_enqueue_script(
80
 
81
  if ( ! eucookie_option('enabled') ) { return true; }
82
 
83
+ if ( ( isset( $_COOKIE['euCookie'] ) && $_COOKIE['euCookie'] == 'set' ) || $euCookieSet ) {
84
  return true;
85
  } else {
86
  return false;
179
  ) {
180
 
181
  $content = preg_replace('#<iframe.*?\/iframe>|<object.*?\/object>|<embed.*?>#is', generate_cookie_notice('auto', '100%'), $content);
182
+ if ( !eucookie_option('exclude_script') ) {
183
+ $content = preg_replace('#<script.(?:(?!eucookielaw_exclude).)*?\/script>#is', '', $content);
184
+ }
185
  $content = preg_replace('#<!cookie_start.*?\!cookie_end>#is', generate_cookie_notice('auto', '100%'), $content);
186
  $content = preg_replace('#<div id=\"disqus_thread\".*?\/div>#is', generate_cookie_notice('auto', '100%'), $content);
187
  }
231
  }
232
  }
233
 
234
+ add_shortcode( 'cookie-control', function ( $atts ) {
235
  if ( !eucookie_option('enabled') ) { return; }
236
  if ( cookie_accepted() ) {
237
  return '
238
  <div class="pea_cook_control" style="color:'.ecl_frontstyle('fontcolor').'; background-color: rgba('.ecl_frontstyle('backgroundcolor').',0.9);">
239
+ <b>'.eucookie_option('cc-cookieenabled').'</b><br>
240
+ <button id="eu_revoke_cookies" class="eu_control_btn" style="color:'.ecl_frontstyle('backgroundcolor').'; background-color: '.ecl_frontstyle('fontcolor').';">'.eucookie_option('cc-disablecookie').'</button>
241
  </div>';
242
  } else {
243
  return '
245
  '.str_replace( '%s', eucookie_option('barbutton'), eucookie_option('cc-cookiedisabled') ).'
246
  </div>';
247
  }
248
+ } );
 
249
 
250
  function eu_cookie_list_shortcode( $atts ) {
251
 
css/style.css CHANGED
@@ -17,6 +17,16 @@
17
  color:white;
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
20
  .pea_cook_wrapper.pea_cook_topleft {
21
  top:30px;
22
  left:30px;
@@ -147,6 +157,7 @@ button.pea_cook_btn {
147
  float:left;
148
  border-radius: 5px;
149
  transition: background 0.5s;
 
150
  }
151
  .eucookie:hover {
152
  cursor: pointer;
17
  color:white;
18
  }
19
 
20
+ .eu_control_btn {
21
+ border: none;
22
+ padding: 15px 32px;
23
+ text-align: center;
24
+ text-decoration: none;
25
+ display: inline-block;
26
+ cursor:pointer;
27
+ margin: 10px;
28
+ }
29
+
30
  .pea_cook_wrapper.pea_cook_topleft {
31
  top:30px;
32
  left:30px;
157
  float:left;
158
  border-radius: 5px;
159
  transition: background 0.5s;
160
+ margin: 10px;
161
  }
162
  .eucookie:hover {
163
  cursor: pointer;
defaults.php CHANGED
@@ -24,7 +24,8 @@
24
  array('cc-disablecookie', __('Revoke cookie consent', 'eu-cookie-law')),
25
  array('cc-cookieenabled', __('Cookies are enabled', 'eu-cookie-law')),
26
  array('cc-cookiedisabled', __('Cookies are disabled<br>Accept Cookies by clicking "%s" in the banner.', 'eu-cookie-law')),
27
- array('networkshareurl', ecl_getshareurl())
 
28
  );
29
 
30
  $my_options = get_option('peadig_eucookie');
24
  array('cc-disablecookie', __('Revoke cookie consent', 'eu-cookie-law')),
25
  array('cc-cookieenabled', __('Cookies are enabled', 'eu-cookie-law')),
26
  array('cc-cookiedisabled', __('Cookies are disabled<br>Accept Cookies by clicking "%s" in the banner.', 'eu-cookie-law')),
27
+ array('networkshareurl', ecl_getshareurl()),
28
+ array('exclude_script', '0')
29
  );
30
 
31
  $my_options = get_option('peadig_eucookie');
eu-cookie-law.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: EU Cookie Law
4
  Plugin URI: https://wordpress.org/plugins/eu-cookie-law/
5
  Description: EU Cookie Law informs users that your site uses cookies, with option to lock scripts before consent. Light + Customizable style.
6
- Version: 2.13
7
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
8
  Author URI: https://wordpress.org/plugins/eu-cookie-law/
9
  Contributors: alexmoss, Milmor, peer, ShaneJones
3
  Plugin Name: EU Cookie Law
4
  Plugin URI: https://wordpress.org/plugins/eu-cookie-law/
5
  Description: EU Cookie Law informs users that your site uses cookies, with option to lock scripts before consent. Light + Customizable style.
6
+ Version: 3.0.1
7
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
8
  Author URI: https://wordpress.org/plugins/eu-cookie-law/
9
  Contributors: alexmoss, Milmor, peer, ShaneJones
js/scripts.js CHANGED
@@ -1,5 +1,7 @@
1
  jQuery(document).ready(function($){
2
 
 
 
3
  var euCookieSet = eucookielaw_data.euCookieSet;
4
  var expireTimer = eucookielaw_data.expireTimer;
5
  var scrollConsent = eucookielaw_data.scrollConsent;
@@ -8,19 +10,43 @@ jQuery(document).ready(function($){
8
  var isRefererWebsite = eucookielaw_data.isRefererWebsite;
9
  var deleteCookieUrl = eucookielaw_data.deleteCookieUrl;
10
  var autoBlock = eucookielaw_data.autoBlock;
11
-
12
- if (document.cookie.indexOf("euCookie") >= 0) {
13
- $(".pea_cook_wrapper").fadeOut("fast");
14
- euCookieSet = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
- if ( euCookieSet > 0) {
 
17
  createCookie();
18
  }
19
 
20
- $(".eu_control_btn").click(function() {
21
- window.location.replace(deleteCookieUrl);
 
 
 
22
  });
23
 
 
 
24
  $("#fom").click(function() {
25
  if( $('#fom').attr('href') === '#') {
26
  $(".pea_cook_more_info_popover").fadeIn("slow");
@@ -32,23 +58,16 @@ jQuery(document).ready(function($){
32
  $(".pea_cook_wrapper").fadeIn("fast");
33
  $(".pea_cook_more_info_popover").fadeOut("slow");
34
  });
35
-
36
- $('#pea_cook_btn, .eucookie').on('click', function () {
37
- euCookieConsent();
38
- });
39
-
40
- jQuery(window).scroll(function(){
41
- if ( scrollConsent > 0 && document.cookie.indexOf("euCookie") < 0 && !euCookieSet ) {
42
- if (!isCookiePage) {
43
- euCookieConsent();
44
- }
45
- }
46
- });
47
 
 
48
  function euCookieConsent() {
 
 
 
 
49
  createCookie();
50
  if (autoBlock == 1) {
51
- window.location = window.location;
52
  }
53
  }
54
 
@@ -64,4 +83,25 @@ jQuery(document).ready(function($){
64
  document.cookie = cookiestring;
65
  $(".pea_cook_wrapper").fadeOut("fast");
66
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  });
1
  jQuery(document).ready(function($){
2
 
3
+ var cookies = document.cookie.split(";");
4
+
5
  var euCookieSet = eucookielaw_data.euCookieSet;
6
  var expireTimer = eucookielaw_data.expireTimer;
7
  var scrollConsent = eucookielaw_data.scrollConsent;
10
  var isRefererWebsite = eucookielaw_data.isRefererWebsite;
11
  var deleteCookieUrl = eucookielaw_data.deleteCookieUrl;
12
  var autoBlock = eucookielaw_data.autoBlock;
13
+
14
+ // Navigation Consent
15
+ if ( autoBlock == 0 && isRefererWebsite && document.cookie.indexOf('euCookie') < 0 ) {
16
+ euCookieConsent();
17
+ }
18
+
19
+ // Scroll Consent
20
+ jQuery(window).scroll(function(){
21
+ if ( autoBlock == 0 && scrollConsent > 0 && document.cookie.indexOf("euCookie") < 0 && !euCookieSet ) {
22
+ if (!isCookiePage && getCookie('euCookie') != "block" ) {
23
+ euCookieConsent();
24
+ }
25
+ }
26
+ });
27
+
28
+ // Accept Button
29
+ $('#pea_cook_btn, .eucookie').on('click', function () {
30
+ euCookieConsent();
31
+ });
32
+
33
+ if ( getCookie('euCookie') == "set" ) {
34
+ //$(".pea_cook_wrapper").fadeOut("fast");
35
  }
36
+
37
+ if ( euCookieSet == 1 ) {
38
  createCookie();
39
  }
40
 
41
+ // Cookie-Control shortcode - REVOKE
42
+ $("#eu_revoke_cookies").click(function() {
43
+ deleteCookies();
44
+ //createCookie( "block" );
45
+ location.reload();
46
  });
47
 
48
+
49
+ // Banner open / close
50
  $("#fom").click(function() {
51
  if( $('#fom').attr('href') === '#') {
52
  $(".pea_cook_more_info_popover").fadeIn("slow");
58
  $(".pea_cook_wrapper").fadeIn("fast");
59
  $(".pea_cook_more_info_popover").fadeOut("slow");
60
  });
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ // AUX Functions
63
  function euCookieConsent() {
64
+ if (typeof euCookieConsentFilter === "function") {
65
+ euCookieConsentFilter();
66
+ }
67
+ deleteCookies()
68
  createCookie();
69
  if (autoBlock == 1) {
70
+ location.reload();
71
  }
72
  }
73
 
83
  document.cookie = cookiestring;
84
  $(".pea_cook_wrapper").fadeOut("fast");
85
  }
86
+
87
+ function getCookie(cname) {
88
+ var name = cname + "=";
89
+ var decodedCookie = decodeURIComponent(document.cookie);
90
+ var ca = decodedCookie.split(';');
91
+ for(var i = 0; i <ca.length; i++) {
92
+ var c = ca[i];
93
+ while (c.charAt(0) == ' ') {
94
+ c = c.substring(1);
95
+ }
96
+ if (c.indexOf(name) == 0) {
97
+ return c.substring(name.length, c.length);
98
+ }
99
+ }
100
+ return "";
101
+ }
102
+
103
+ function deleteCookies() {
104
+ document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
105
+ window.location = window.location;
106
+ }
107
  });
js/{eucookiesettings.js → settings.js} RENAMED
@@ -1,7 +1,6 @@
1
  jQuery(document).ready(function($){
2
  $('.color-field').wpColorPicker();
3
 
4
-
5
  eclshowhide();
6
 
7
  $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
@@ -11,6 +10,15 @@ jQuery(document).ready(function($){
11
  $('#networkshare').on('change', function() {
12
  $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
13
  });
 
 
 
 
 
 
 
 
 
14
 
15
  function eclshowhide() {
16
  if ($('#boxlinkid').val() == "C") {
1
  jQuery(document).ready(function($){
2
  $('.color-field').wpColorPicker();
3
 
 
4
  eclshowhide();
5
 
6
  $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
10
  $('#networkshare').on('change', function() {
11
  $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
12
  });
13
+
14
+ // On Change
15
+ $('#autoblock').on('change', function() {
16
+ if ( $('#autoblock').is(':checked') ) {
17
+ $('#fineblock').fadeIn('slow');
18
+ } else {
19
+ $('#fineblock').fadeOut('slow');
20
+ }
21
+ });
22
 
23
  function eclshowhide() {
24
  if ($('#boxlinkid').val() == "C") {
readme.txt CHANGED
@@ -1,6 +1,6 @@
1
  === EU Cookie Law ===
2
  Contributors: alexmoss, Milmor, pleer, ShaneJones
3
- Version: 2.13
4
  Stable tag: trunk
5
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
6
  Author URI: https://profiles.wordpress.org/milmor/
@@ -23,7 +23,7 @@ https://www.youtube.com/watch?v=6f2qxC3GZJ8
23
  Demo: [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
24
 
25
  = Features =
26
- * **GDPR** compliance under review
27
  * **Customizable banner** (color, position, strings)
28
  * Consent by **Clicking, Scrolling and Navigation**
29
  * Set your page, popup or custom URL for Cookie Policy
@@ -114,6 +114,12 @@ Please note that **cookie_accepted** returns true if you disable it in the setti
114
 
115
  If you think that we should enhance something let us know in the [forum](https://wordpress.org/support/plugin/eu-cookie-law).
116
 
 
 
 
 
 
 
117
  = Auto block =
118
  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.
119
 
@@ -157,6 +163,21 @@ Click on the translations link to open the translation editor and adjust the str
157
 
158
  == Changelog ==
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  = 2.13 24.04.2018 =
161
  * **Fixed** bug with WordPress default Youtube embeds. Thanks to @rfmcomposer + @bitmed
162
  * **Added** better php check to block cookies in our faq - improvement by @rfmcomposer
1
  === EU Cookie Law ===
2
  Contributors: alexmoss, Milmor, pleer, ShaneJones
3
+ Version: 3.0.1
4
  Stable tag: trunk
5
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
6
  Author URI: https://profiles.wordpress.org/milmor/
23
  Demo: [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
24
 
25
  = Features =
26
+ * **GDPR** compliant (if you have doubts, ask in the forum)
27
  * **Customizable banner** (color, position, strings)
28
  * Consent by **Clicking, Scrolling and Navigation**
29
  * Set your page, popup or custom URL for Cookie Policy
114
 
115
  If you think that we should enhance something let us know in the [forum](https://wordpress.org/support/plugin/eu-cookie-law).
116
 
117
+ = Javascript Filters =
118
+ Sometimes it could be useful to trigger custom actions on cookie consent, so we added useful filters.
119
+
120
+ If you want to play, just download our [sample plugin](https://plugins.svn.wordpress.org/eu-cookie-law/assets/eu-cookie-law-filter.zip) and start coding!
121
+
122
+
123
  = Auto block =
124
  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.
125
 
163
 
164
  == Changelog ==
165
 
166
+ = 3.0.1 26.05.2019 =
167
+ * **Fixed** critical bug with some browsers (for example Internet Explorer) that killed "Accept" button
168
+
169
+ = 3.0 24.05.2019 - First GDPR release =
170
+ Hello! This is our first GDPR release and hope you'll like it. Some functions have changed, so report bugs in our support forum to discuss them.
171
+ Also, if you don't use technical cookies only, we suggest to turn AutoBlock function ON.
172
+
173
+ * **Added** option to exclude script block: useful if you only wants to block iframe/embeds, but not scripts. Scripts (like Google Analytics) can be always be blocked with our placeholders
174
+ * **Added** more javascript-oriented logic to increase cache compatibility
175
+ * **SCROLL CONSENT** and **NAVIGATION CONSENT** automatically disabled if you use AutoBlock
176
+ * **Added** developer filter in Javascript for consent. Take a look on our FAQ or directly head to download our [sample plugin download](https://plugins.svn.wordpress.org/eu-cookie-law/assets/eu-cookie-law-filter.zip) to start coding!
177
+ * **Improved** [cookie-control] shortcode style to revoke consent
178
+ * **Added** 10px in style.css for blocked cookies banner
179
+ * Some code cleanup for faster performances
180
+
181
  = 2.13 24.04.2018 =
182
  * **Fixed** bug with WordPress default Youtube embeds. Thanks to @rfmcomposer + @bitmed
183
  * **Added** better php check to block cookies in our faq - improvement by @rfmcomposer