EU Cookie Law - Version 2.5.2

Version Description

05.07.2015 = * Improved autoblock

Download this release

Release Info

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

Code changes from version 2.1.2 to 2.5.2

class-admin.php CHANGED
@@ -10,80 +10,132 @@ 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
 
14
- function pea_cook_defaults()
15
- {
16
- update_option('peadig_eucookie', array (
17
- 'enabled' => '1',
18
- 'lengthnum' => '1',
19
- 'length' => 'months',
20
- 'position' => 'bottomright',
21
- 'barmessage' => 'By continuing to use the site, you agree to the use of cookies.',
22
- 'barlink' => 'more information',
23
- 'barbutton' => 'Accept',
24
- 'closelink' => 'Close',
25
- 'boxcontent' => 'The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.',
26
- 'bhtmlcontent' => '<b>Content not available.</b><br><small>Please allow cookies by clicking Accept on the banner</small>'
27
- )
28
- );
29
  }
30
 
31
-
32
  // ADMIN PAGE
33
  function peadig_eucookie_options() {
34
  ?>
35
  <div class="wrap">
36
- <h2>EU Cookie Law <?php echo get_option( 'ecl_version_number' ); ?> &bull; Options</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  <form method="post" action="options.php">
38
  <?php settings_fields('peadig_eucookie_options'); ?>
39
- <?php $options = get_option('peadig_eucookie'); ?>
40
- <h3 class="title">Main Settings</h3>
 
 
41
  <table class="form-table">
42
- <tr valign="top"><th scope="row"><label for="enabled">Enabled</label></th>
43
  <td><input id="enabled" name="peadig_eucookie[enabled]" type="checkbox" value="1" <?php checked('1', $options['enabled']); ?> /></td>
44
  </tr>
45
- <tr valign="top"><th scope="row"><label for="lengthnum">Acceptance Cookie Length</label></th>
 
 
 
 
 
 
 
 
 
46
  <td><input id="lengthnum" type="text" name="peadig_eucookie[lengthnum]" value="<?php echo $options['lengthnum']; ?>" size="5" />
47
  <select name="peadig_eucookie[length]">
48
- <option value="hours"<?php if ($options['length'] == 'hours') { echo ' selected="selected"'; } ?>>hours</option>
49
- <option value="days"<?php if ($options['length'] == 'days') { echo ' selected="selected"'; } ?>>days</option>
50
- <option value="weeks"<?php if ($options['length'] == 'weeks') { echo ' selected="selected"'; } ?>>weeks</option>
51
- <option value="months"<?php if ($options['length'] == 'months') { echo ' selected="selected"'; } ?>>months</option>
52
- </select><br />
53
- <small>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.</small>
 
 
54
  </td>
55
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  </table>
57
  <hr>
58
- <h3 class="title">Appearance</h3>
59
  <table class="form-table">
60
- <tr valign="top"><th scope="row"><label for="position">Position</label></th>
61
  <td>
62
  <select name="peadig_eucookie[position]">
63
- <option value="bottomright"<?php if ($options['position'] == 'bottomright') { echo ' selected="selected"'; } ?>>Bottom Right</option>
64
- <option value="topright"<?php if ($options['position'] == 'topright') { echo ' selected="selected"'; } ?>>Top Right</option>
65
- <option value="bottomleft"<?php if ($options['position'] == 'bottomleft') { echo ' selected="selected"'; } ?>>Bottom Left</option>
66
- <option value="topleft"<?php if ($options['position'] == 'topleft') { echo ' selected="selected"'; } ?>>Top Left</option>
 
 
 
 
67
  </select>
68
  </td>
69
  </tr>
 
 
 
 
 
 
 
 
70
  </table>
71
  <hr>
72
- <h3 class="title">Content Settings</h3>
73
  <table class="form-table">
74
- <tr valign="top"><th scope="row"><label for="barmessage">Warning Bar Message Text</label></th>
 
75
  <td><input id="barmessage" type="text" name="peadig_eucookie[barmessage]" value="<?php echo $options['barmessage']; ?>" size="100" /></td>
76
  </tr>
77
- <tr valign="top"><th scope="row"><label for="barlink">Wording for link to find out more info</label></th>
 
78
  <td><input id="barlink" type="text" name="peadig_eucookie[barlink]" value="<?php echo $options['barlink']; ?>" /></td>
79
  </tr>
80
- <tr valign="top"><th scope="row"><label for="barbutton">Accept Button Text</label></th>
 
81
  <td><input id="barbutton" type="text" name="peadig_eucookie[barbutton]" value="<?php echo $options['barbutton']; ?>" /></td>
82
  </tr>
83
- <tr valign="top"><th scope="row"><label for="barbutton">"Close Popup" Text</label></th>
84
- <td><input id="closelink" type="text" name="peadig_eucookie[closelink]" value="<?php echo $options['closelink']; ?>" /></td>
85
- </tr>
86
- <tr valign="top"><th scope="row"><label for="boxlinkid">Bar Link<br/><small>Use this field if you want to link a page instead of showing the popup</small></label></th>
87
  <td>
88
  <?php $args = array(
89
  'depth' => 0,
@@ -100,12 +152,20 @@ function peadig_eucookie_options() {
100
  <?php wp_dropdown_pages($args); ?>
101
  </td>
102
  </tr>
103
- <tr valign="top"><th scope="row"><label for="boxcontent">Popup Box Content<br/><small>Use this to inform your users about your cookie policy</small></label></th>
 
 
 
 
 
 
104
  <td>
105
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[boxcontent]' id='boxcontent' rows='9' ><?php echo $options['boxcontent']; ?></textarea>
106
  </td>
107
  </tr>
108
- <tr valign="top"><th scope="row"><label for="bhtmlcontent">Blocked code message<br/><small>This is the message that will be displayed for locked-code areas</small></label></th>
 
 
109
  <td>
110
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[bhtmlcontent]' id='bhtmlcontent' rows='9' ><?php echo $options['bhtmlcontent']; ?></textarea>
111
  </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', '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() {
25
  ?>
26
  <div class="wrap">
27
+ <div style="position: absolute;right: 20px;">
28
+ <a style="padding:20px;" href="http://www.wpgov.it" target="_blank" title="WPGov.it">
29
+ <img src="<?php echo plugins_url('img/wpgov.png',__FILE__); ?>" />
30
+ </a>
31
+ <a style="padding:20px;" href="http://peadig.com" target="_blank" title="Peadig.com">
32
+ <img src="<?php echo plugins_url('img/peadig.png',__FILE__); ?>" />
33
+ </a>
34
+ </div>
35
+ <h2>EU Cookie Law &bull; <?php echo get_option( 'ecl_version_number' ); ?>
36
+ <a href="//wordpress.org/plugins/eu-cookie-law/changelog/" target="_blank" class="add-new-h2">
37
+ <?php _e('Changelog', 'eu-cookie-law'); ?>
38
+ </a>
39
+ <a href="//wordpress.org/support/view/plugin-reviews/eu-cookie-law" target="_blank" class="add-new-h2">
40
+ <?php _e('Rate us', 'eu-cookie-law'); ?> ★★★★★
41
+ </a>
42
+ <a href="//wordpress.org/support/plugin/eu-cookie-law" target="_blank" class="add-new-h2">
43
+ <?php _e('Support', 'eu-cookie-law'); ?>
44
+ </a>
45
+ </h2>
46
  <form method="post" action="options.php">
47
  <?php settings_fields('peadig_eucookie_options'); ?>
48
+ <?php
49
+ ecl_check_defaults();
50
+ $options = get_option('peadig_eucookie');
51
+ ?>
52
  <table class="form-table">
53
+ <tr valign="top"><th scope="row"><label for="enabled"><?php _e('Activate'); ?></label></th>
54
  <td><input id="enabled" name="peadig_eucookie[enabled]" type="checkbox" value="1" <?php checked('1', $options['enabled']); ?> /></td>
55
  </tr>
56
+ <tr valign="top"><th scope="row"><label for="autoblock"><?php _e('Auto Block'); ?><br>(BETA)</label></th>
57
+ <td><input id="autoblock" name="peadig_eucookie[autoblock]" type="checkbox" value="1" <?php checked('1', $options['autoblock']); ?> /><br>
58
+ <small><?php _e('This function will automatically block iframes, embeds and scripts in your post, pages and widgets.', 'eu-cookie-law'); ?></small></td>
59
+ </tr>
60
+ <tr valign="top"><th scope="row"><label for="tinymcebutton"><?php _e('Enable TinyMce Button'); ?></label></th>
61
+ <td><input id="tinymcebutton" name="peadig_eucookie[tinymcebutton]" type="checkbox" value="1" <?php checked('1', $options['tinymcebutton']); ?> /><br>
62
+ <small><?php _e('Click here if you want to turn on the tinymce button for manual insertion of EU Cookie Law shortcodes while editing contents.'); ?></small></td>
63
+ </tr>
64
+ <tr valign="top"><th scope="row"><label for="lengthnum">
65
+ <?php _e('Cookie acceptance lenght', 'eu-cookie-law'); ?></label></th>
66
  <td><input id="lengthnum" type="text" name="peadig_eucookie[lengthnum]" value="<?php echo $options['lengthnum']; ?>" size="5" />
67
  <select name="peadig_eucookie[length]">
68
+ <option value="days"<?php if ($options['length'] == 'days') { echo ' selected="selected"'; } ?>>
69
+ <?php _e('days', 'eu-cookie-law'); ?></option>
70
+ <option value="weeks"<?php if ($options['length'] == 'weeks') { echo ' selected="selected"'; } ?>>
71
+ <?php _e('weeks', 'eu-cookie-law'); ?></option>
72
+ <option value="months"<?php if ($options['length'] == 'months') { echo ' selected="selected"'; } ?>>
73
+ <?php _e('months', 'eu-cookie-law'); ?></option>
74
+ </select><br>
75
+ <small><?php _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'); ?></small>
76
  </td>
77
  </tr>
78
+ <tr valign="top"><th scope="row"><label for="scrollconsent"><?php _e('Scroll Consent'); ?></label></th>
79
+ <td><input id="scrollconsent" name="peadig_eucookie[scrollconsent]" type="checkbox" value="1" <?php checked('1', $options['scrollconsent']); ?> /><br>
80
+ <small><?php _e('Click here if you want to consider scrolling as cookie acceptation. Users should be informed about this...'); ?></small></td>
81
+ </tr>
82
+ <tr valign="top"><th scope="row"><label for="navigationconsent"><?php _e('Navigation Consent'); ?></label></th>
83
+ <td><input id="navigationconsent" name="peadig_eucookie[navigationconsent]" type="checkbox" value="1" <?php checked('1', $options['navigationconsent']); ?> /><br>
84
+ <small><?php _e('Click here if you want to consider continuing navigation as cookie acceptation. Users should be informed about this...'); ?></small></td>
85
+ </tr>
86
+ <tr valign="top"><th scope="row"><label for="networkshare"><?php _e('Share Cookie across Network'); ?><br>(BETA)</label></th>
87
+ <td><input id="networkshare" name="peadig_eucookie[networkshare]" type="checkbox" value="1" <?php checked('1', $options['networkshare']); ?> /><br>
88
+ <small><?php _e('Click here if you want to share euCookie across your network (subdomains or multisite)'); ?></small></td>
89
+ </tr>
90
+ <tr valign="top"><th scope="row"><label for="networkshareurl">
91
+ <?php _e('Network Domain', 'eu-cookie-law'); ?></label></th>
92
+ <td><input id="networkshareurl" type="text" name="peadig_eucookie[networkshareurl]" value="<?php echo $options['networkshareurl']; ?>" size="40" /></td>
93
+ </tr>
94
  </table>
95
  <hr>
96
+ <h3 class="title"><?php _e('Appearance'); ?></h3>
97
  <table class="form-table">
98
+ <tr valign="top"><th scope="row"><label for="position"><?php _e('Position'); ?></label></th>
99
  <td>
100
  <select name="peadig_eucookie[position]">
101
+ <option value="bottomright"<?php if ($options['position'] == 'bottomright') { echo ' selected="selected"'; } ?>>
102
+ <?php _e('Bottom Right', 'eu-cookie-law'); ?></option>
103
+ <option value="topright"<?php if ($options['position'] == 'topright') { echo ' selected="selected"'; } ?>>
104
+ <?php _e('Top Right', 'eu-cookie-law'); ?></option>
105
+ <option value="bottomleft"<?php if ($options['position'] == 'bottomleft') { echo ' selected="selected"'; } ?>>
106
+ <?php _e('Bottom Left', 'eu-cookie-law'); ?></option>
107
+ <option value="topleft"<?php if ($options['position'] == 'topleft') { echo ' selected="selected"'; } ?>>
108
+ <?php _e('Top Left', 'eu-cookie-law'); ?></option>
109
  </select>
110
  </td>
111
  </tr>
112
+ <tr valign="top"><th scope="row"><label for="backgroundcolor">
113
+ <?php _e('Background Color', 'eu-cookie-law'); ?></label></th>
114
+ <td><input id="backgroundcolor" type="text" name="peadig_eucookie[backgroundcolor]" value="<?php echo $options['backgroundcolor']; ?>" class="color-field" data-default-color="#000000"/></td>
115
+ </tr>
116
+ <tr valign="top"><th scope="row"><label for="fontcolor">
117
+ <?php _e('Font Color', 'eu-cookie-law'); ?></label></th>
118
+ <td><input id="fontcolor" type="text" name="peadig_eucookie[fontcolor]" value="<?php echo $options['fontcolor']; ?>" class="color-field" data-default-color="#ffffff"/></td>
119
+ </tr>
120
  </table>
121
  <hr>
122
+ <h3 class="title"><?php _e('Content'); ?></h3>
123
  <table class="form-table">
124
+ <tr valign="top"><th scope="row"><label for="barmessage">
125
+ <?php _e('Bar Message', 'eu-cookie-law'); ?></label></th>
126
  <td><input id="barmessage" type="text" name="peadig_eucookie[barmessage]" value="<?php echo $options['barmessage']; ?>" size="100" /></td>
127
  </tr>
128
+ <tr valign="top"><th scope="row"><label for="barlink">
129
+ <?php _e('More Info Text', 'eu-cookie-law'); ?></label></th>
130
  <td><input id="barlink" type="text" name="peadig_eucookie[barlink]" value="<?php echo $options['barlink']; ?>" /></td>
131
  </tr>
132
+ <tr valign="top"><th scope="row"><label for="barbutton">
133
+ <?php _e('Accept Text', 'eu-cookie-law'); ?></label></th>
134
  <td><input id="barbutton" type="text" name="peadig_eucookie[barbutton]" value="<?php echo $options['barbutton']; ?>" /></td>
135
  </tr>
136
+ <tr valign="top"><th scope="row"><label for="boxlinkid">
137
+ <?php _e('Bar Link', 'eu-cookie-law'); ?><br/><small>
138
+ <?php _e('Use this field if you want to link a page instead of showing the popup', 'eu-cookie-law'); ?></small></label></th>
 
139
  <td>
140
  <?php $args = array(
141
  'depth' => 0,
152
  <?php wp_dropdown_pages($args); ?>
153
  </td>
154
  </tr>
155
+ <tr valign="top"><th scope="row"><label for="closelink">
156
+ <?php _e('"Close Popup" Text', 'eu-cookie-law'); ?></label></th>
157
+ <td><input id="closelink" type="text" name="peadig_eucookie[closelink]" value="<?php echo $options['closelink']; ?>" /></td>
158
+ </tr>
159
+ <tr valign="top"><th scope="row"><label for="boxcontent">
160
+ <?php _e('Popup Box Content', 'eu-cookie-law'); ?><br>
161
+ <small><?php _e('Use this to add a popup that informs your users about your cookie policy', 'eu-cookie-law'); ?></small></label></th>
162
  <td>
163
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[boxcontent]' id='boxcontent' rows='9' ><?php echo $options['boxcontent']; ?></textarea>
164
  </td>
165
  </tr>
166
+ <tr valign="top"><th scope="row"><label for="bhtmlcontent">
167
+ <?php _e('Blocked code message', 'eu-cookie-law'); ?><br>
168
+ <small><?php _e('This is the message that will be displayed for locked-code areas', 'eu-cookie-law'); ?></small></label></th>
169
  <td>
170
  <textarea style='font-size: 90%; width:95%;' name='peadig_eucookie[bhtmlcontent]' id='bhtmlcontent' rows='9' ><?php echo $options['bhtmlcontent']; ?></textarea>
171
  </td>
class-frontend.php CHANGED
@@ -3,165 +3,204 @@
3
  function peadig_eucookie_scripts() {
4
  wp_register_style ('basecss', plugins_url('css/style.css', __FILE__), false);
5
  wp_enqueue_style ('basecss');
6
- wp_enqueue_script ('jquery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
8
  add_action('wp_head', 'peadig_eucookie_scripts');
9
 
 
 
 
 
 
 
 
 
10
  function cookie_accepted() {
11
- $options = get_option('peadig_eucookie');
12
- if ( !$options['enabled'] ) { return true; }
13
- if ( $_COOKIE['euCookie'] ) {
 
14
  return true;
15
  } else {
16
  return false;
17
  }
18
  }
19
 
20
- function get_expire_timer() {
21
  $options = get_option('peadig_eucookie');
22
-
23
- if(!$_COOKIE['euCookie']){
24
- //for Cookie
25
- switch($options['length']){
26
- case "hours":
27
- $multi = (1/24);
28
- break;
29
- case "days":
30
- $multi = 1;
31
- break;
32
- case "weeks":
33
- $multi = 7;
34
- break;
35
- case "months":
36
- $multi = 30;
37
- break;
38
- }
39
-
40
- return $multi * $options['lengthnum'];
41
- }
42
  }
43
 
44
- function eu_cookie_enabled() {
45
- $options = get_option('peadig_eucookie');
46
- return $options['enabled'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
  function peadig_eucookie_bar() {
50
- $options = get_option('peadig_eucookie');
51
 
52
- if ( cookie_accepted() ) {
53
  return;
54
  }
55
 
56
- if ( $options['boxlinkid'] ) {
57
- $link = get_permalink($options['boxlinkid']);
 
58
  } else {
59
  $link = '#';
60
  }
61
-
62
-
63
  ?>
64
- <div class="pea_cook_wrapper pea_cook_<?php if ($options['position']!="") {echo $options['position'];} else {echo "bottomright";} ?>">
65
- <p><?php echo $options['barmessage']; ?> <a href="<?php echo $link; ?>" id="fom"><?php echo $options['barlink']; ?></a> <button id="pea_cook_btn" class="pea_cook_btn" href="#"><?php echo $options['barbutton']; ?></button></p>
 
 
 
 
 
66
  </div>
67
  <div class="pea_cook_more_info_popover">
68
- <div class="pea_cook_more_info_popover_inner">
69
- <p><?php echo $options['boxcontent']; ?></p>
70
- <p><a href="#" id="pea_close"><?php echo $options['closelink']; ?></a></p>
 
 
 
 
 
71
  </div>
72
  </div>
73
-
74
- <script type="text/javascript">
75
- jQuery(document).ready(function($){
76
- <?php if ( $link == '#') { ?>
77
- $("#fom").click(function() {
78
- $(".pea_cook_more_info_popover").fadeIn("slow");
79
- $(".pea_cook_wrapper").fadeOut("fast");
80
- });
81
- <?php } ?>
82
- $("#pea_close").click(function() {
83
- $(".pea_cook_wrapper").fadeIn("fast");
84
- $(".pea_cook_more_info_popover").fadeOut("slow");
85
- });
86
- $('#pea_cook_btn').click(function() {
87
- var expire = new Date();
88
- expire.setDate(expire.getDate() + <?php echo get_expire_timer(); ?>);
89
- var isoDate = new Date(expire).toISOString();
90
- document.cookie = "euCookie=set; expires=" + isoDate + "; path=/";
91
- window.location.reload();
92
-
93
- $(".pea_cook_wrapper").fadeOut("fast");
94
- });
95
- });
96
- </script>
97
  <?php
98
  }
99
  add_action('wp_footer', 'peadig_eucookie_bar', 1000);
100
 
101
  function generate_cookie_notice_text($height, $width, $text) {
102
- return '<div class="eucookie" style="width:'.$width.';height:'.$height.';
103
- background:url(\''.plugins_url('img/congruent_pentagon.png',__FILE__).'\') repeat;"><span>'.$text.'</span></div><div class="clear"></div>';
104
  }
105
 
106
  function generate_cookie_notice($height, $width) {
107
- $options = get_option('peadig_eucookie');
108
- return generate_cookie_notice_text($height, $width, $options['bhtmlcontent']);
109
  }
110
  function eu_cookie_shortcode( $atts, $content = null ) {
111
- $options = get_option('peadig_eucookie');
112
  extract(shortcode_atts(
113
  array(
114
- 'height' => 'auto',
115
- 'width' => 'auto',
116
- 'text' => $options['bhtmlcontent']
117
  ),
118
  $atts)
119
  );
120
  if ( cookie_accepted() ) {
121
- return apply_filters('the_content', $content);
122
  } else {
123
- return generate_cookie_notice($height, $width, $text);
 
 
124
  }
125
  }
126
  add_shortcode( 'cookie', 'eu_cookie_shortcode' );
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  function eu_cookie_control_shortcode( $atts ) {
129
- if (!eu_cookie_enabled()) { return; }
130
  if ( cookie_accepted() ) {
131
  return '
132
- <div class="pea_cook_control">
133
- Cookies are currently enabled.
134
- <button id="eu_revoke_cookies" class="eu_control_btn" href="#">Revoke Cookies</button>
135
- </div>
136
- <script type="text/javascript">
137
- jQuery(document).ready(function($){
138
- $(".eu_control_btn").click(function() {
139
- document.cookie = "euCookie=set; Max-Age=0; path=/";
140
- window.location.reload();
141
- $(".pea_cook_wrapper").fadeIn("fast");
142
- });
143
- });
144
- </script>';
145
  } else {
146
  return '
147
- <div class="pea_cook_control">
148
- Cookies are currently disabled.
149
- <button id="eu_revoke_cookies" class="eu_control_btn" href="#">Accept Cookies</button>
150
- </div>
151
- <script type="text/javascript">
152
- jQuery(document).ready(function($){
153
- $(".eu_control_btn").click(function() {
154
- var expire = new Date();
155
- expire.setDate(expire.getDate() + '.get_expire_timer().');
156
- var isoDate = new Date(expire).toISOString();
157
- document.cookie = "euCookie=set; expires=" + isoDate + "; path=/";
158
- window.location.reload();
159
-
160
- $(".pea_cook_wrapper").fadeOut("fast");
161
- });
162
- });
163
- </script>';
164
-
165
  }
166
  }
167
  add_shortcode( 'cookie-control', 'eu_cookie_control_shortcode' );
3
  function peadig_eucookie_scripts() {
4
  wp_register_style ('basecss', plugins_url('css/style.css', __FILE__), false);
5
  wp_enqueue_style ('basecss');
6
+
7
+ $eclData = array(
8
+ 'expireTimer' => get_expire_timer(),
9
+ 'scrollConsent' => eucookie_option('scrollconsent'),
10
+ 'networkShareURL' => ecl_get_cookie_domain(),
11
+ 'isCookiePage' => eucookie_option('boxlinkid') == get_the_ID(),
12
+ 'isRefererWebsite' => eucookie_option('navigationconsent') && wp_get_referer()
13
+ );
14
+
15
+ wp_enqueue_script(
16
+ 'eucookielaw-scripts',
17
+ plugins_url('js/scripts.js', __FILE__),
18
+ array( 'jquery' ),
19
+ '',
20
+ true
21
+ );
22
+ wp_localize_script('eucookielaw-scripts','eucookielaw_data',$eclData);
23
+
24
  }
25
  add_action('wp_head', 'peadig_eucookie_scripts');
26
 
27
+ function ecl_get_cookie_domain() {
28
+
29
+ if ( !eucookie_option('networkshare') ) {
30
+ return false;
31
+ }
32
+ return 'domain='.eucookie_option('networkshareurl').'; ';
33
+ }
34
+
35
  function cookie_accepted() {
36
+
37
+ if ( ! eucookie_option('enabled') ) { return true; }
38
+
39
+ if ( isset( $_COOKIE['euCookie'] ) ) {
40
  return true;
41
  } else {
42
  return false;
43
  }
44
  }
45
 
46
+ function eucookie_option($name) {
47
  $options = get_option('peadig_eucookie');
48
+ if ( isset( $options[$name] ) ) { return $options[$name]; }
49
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
+ function get_expire_timer() {
53
+
54
+ switch( eucookie_option('length') ){
55
+ case "hours":
56
+ $multi = 1;
57
+ break;
58
+ case "days":
59
+ $multi = 1;
60
+ break;
61
+ case "weeks":
62
+ $multi = 7;
63
+ break;
64
+ case "months":
65
+ $multi = 30;
66
+ break;
67
+ }
68
+ return $multi * eucookie_option('lengthnum');
69
  }
70
 
71
  function peadig_eucookie_bar() {
 
72
 
73
+ if ( ! (eucookie_option('enabled') && !isset( $_COOKIE['euCookie'] ) ) ) {
74
  return;
75
  }
76
 
77
+ if ( eucookie_option('boxlinkid') ) {
78
+ $linkid = apply_filters( 'wpml_object_id', eucookie_option('boxlinkid'), 'page' );
79
+ $link = get_permalink( $linkid );
80
  } else {
81
  $link = '#';
82
  }
 
 
83
  ?>
84
+ <div
85
+ class="pea_cook_wrapper pea_cook_<?php echo eucookie_option('position'); ?>"
86
+ style="
87
+ color:<?php echo ecl_frontstyle('fontcolor'); ?>;
88
+ background-color: rgba(<?php echo ecl_frontstyle('backgroundcolor'); ?>,0.85);
89
+ ">
90
+ <p><?php echo eucookie_option('barmessage'); ?> <a style="color:<?php echo eucookie_option('fontcolor'); ?>;" href="<?php echo $link; ?>" id="fom"><?php echo eucookie_option('barlink'); ?></a> <button id="pea_cook_btn" class="pea_cook_btn" href="#"><?php echo eucookie_option('barbutton'); ?></button></p>
91
  </div>
92
  <div class="pea_cook_more_info_popover">
93
+ <div
94
+ class="pea_cook_more_info_popover_inner"
95
+ style="
96
+ color:<?php echo ecl_frontstyle('fontcolor'); ?>;
97
+ background-color: rgba(<?php echo ecl_frontstyle('backgroundcolor'); ?>,0.9);
98
+ ">
99
+ <p><?php echo eucookie_option('boxcontent'); ?></p>
100
+ <p><a style="color:<?php echo eucookie_option('fontcolor'); ?>;" href="#" id="pea_close"><?php echo eucookie_option('closelink'); ?></a></p>
101
  </div>
102
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  <?php
104
  }
105
  add_action('wp_footer', 'peadig_eucookie_bar', 1000);
106
 
107
  function generate_cookie_notice_text($height, $width, $text) {
108
+ return '<div class="eucookie" style="color:'.ecl_frontstyle('fontcolor').'; background: rgba('.ecl_frontstyle('backgroundcolor').',0.85) url(\''.plugins_url('img/block.png', __FILE__).'\') no-repeat; background-position: -30px -20px; width:'.$width.';height:'.$height.';"><span>'.$text.'</span></div><div class="clear"></div>';
 
109
  }
110
 
111
  function generate_cookie_notice($height, $width) {
112
+ return generate_cookie_notice_text($height, $width, eucookie_option('bhtmlcontent') );
 
113
  }
114
  function eu_cookie_shortcode( $atts, $content = null ) {
 
115
  extract(shortcode_atts(
116
  array(
117
+ 'height' => '',
118
+ 'width' => '',
119
+ 'text' => eucookie_option('bhtmlcontent')
120
  ),
121
  $atts)
122
  );
123
  if ( cookie_accepted() ) {
124
+ return do_shortcode( $content );
125
  } else {
126
+ if (!$width) { $width = pulisci($content,'width='); }
127
+ if (!$height) { $height = pulisci($content,'height='); }
128
+ return generate_cookie_notice($height, $width);
129
  }
130
  }
131
  add_shortcode( 'cookie', 'eu_cookie_shortcode' );
132
 
133
+ function ecl_callback($buffer) { return ecl_erase($buffer); }
134
+
135
+ add_filter( 'the_content', 'ecl_erase', 11);
136
+ add_filter( 'widget_display_callback','ecl_erase', 11, 3 );
137
+
138
+ function ecl_buffer_start() { ob_start("ecl_callback"); }
139
+ function ecl_buffer_end() { ob_end_flush(); }
140
+
141
+ add_action('wp_head', 'ecl_buffer_start');
142
+ add_action('wp_footer', 'ecl_buffer_end');
143
+
144
+ function ecl_erase($content) {
145
+ if ( !cookie_accepted() && eucookie_option('autoblock') && !get_post_field( 'eucookielaw_exclude', get_the_id() ) ) {
146
+ $content = preg_replace('#<iframe.*?\/iframe>|<object.+?</object>|<embed.*?>#is', generate_cookie_notice('auto', '100%'), $content);
147
+ $content = preg_replace('#<script.*?\/script>#is', '', $content);
148
+ $content = preg_replace('#<!cookie_start.*?\!cookie_end>#is', generate_cookie_notice('auto', '100%'), $content);
149
+ $content = preg_replace('#<div id=\"disqus_thread\".*?\/div>#is', generate_cookie_notice('auto', '100%'), $content);
150
+ }
151
+ return $content;
152
+ }
153
+
154
+ add_filter( 'widget_text', 'do_shortcode');
155
+
156
+ function pulisci($content,$ricerca){
157
+ $caratteri = strlen($ricerca)+6;
158
+ $stringa = substr($content, strpos($content, $ricerca), $caratteri);
159
+ $stringa = str_replace($ricerca, '', $stringa);
160
+ $stringa = trim(str_replace('"', '', $stringa));
161
+ return $stringa;
162
+ }
163
+
164
+ function ecl_hex2rgb($hex) {
165
+ $hex = str_replace("#", "", $hex);
166
+
167
+ if(strlen($hex) == 3) {
168
+ $r = hexdec(substr($hex,0,1).substr($hex,0,1));
169
+ $g = hexdec(substr($hex,1,1).substr($hex,1,1));
170
+ $b = hexdec(substr($hex,2,1).substr($hex,2,1));
171
+ } else {
172
+ $r = hexdec(substr($hex,0,2));
173
+ $g = hexdec(substr($hex,2,2));
174
+ $b = hexdec(substr($hex,4,2));
175
+ }
176
+ return array($r, $g, $b);
177
+ }
178
+
179
+ function ecl_frontstyle($name) {
180
+ switch ($name) {
181
+ case 'fontcolor':
182
+ return eucookie_option('fontcolor');
183
+ break;
184
+ case 'backgroundcolor':
185
+ $backgroundcolors = ecl_hex2rgb( eucookie_option('backgroundcolor') );
186
+ return $backgroundcolors[0].','.$backgroundcolors[1].','.$backgroundcolors[2];
187
+ break;
188
+ }
189
+ }
190
+
191
  function eu_cookie_control_shortcode( $atts ) {
192
+ if ( !eucookie_option('enabled') ) { return; }
193
  if ( cookie_accepted() ) {
194
  return '
195
+ <div class="pea_cook_control" style="color:'.ecl_frontstyle('fontcolor').'; background-color: rgba('.ecl_frontstyle('backgroundcolor').',0.9);">
196
+ '.__('Cookies are enabled', 'eu-cookie-law').'
197
+ <button id="eu_revoke_cookies" class="eu_control_btn" href="#">'.__('Revoke cookie consent', 'eu-cookie-law').'</button>
198
+ </div>';
 
 
 
 
 
 
 
 
 
199
  } else {
200
  return '
201
+ <div class="pea_cook_control" style="color:'.ecl_frontstyle('fontcolor').'; background-color: rgba('.ecl_frontstyle('backgroundcolor').',0.9);">
202
+ '.__('Cookies are disabled', 'eu-cookie-law').'<br>'.sprintf( __( 'Accept Cookies by clicking "%s" in the banner.', 'eu-cookie-law' ), '<b>'.eucookie_option('barbutton').'</b>' ).'
203
+ </div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
205
  }
206
  add_shortcode( 'cookie-control', 'eu_cookie_control_shortcode' );
css/style.css CHANGED
@@ -1,28 +1,17 @@
1
  .pea_cook_wrapper {
2
  position: fixed;
3
- background-color: rgba(0,0,0,0.85);
4
- /* For IE 5.5 - 7 */
5
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000);
6
- /* For IE 8*/
7
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000)";
8
  padding: 8px 21px;
9
  margin: 0;
10
- -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;
11
  z-index: 10000;
12
  text-align: center;
13
  }
14
 
15
  .pea_cook_control {
16
- float:left;
17
- width:100%;
18
- background-color: rgba(0,0,0,0.85);
19
- /* For IE 5.5 - 7 */
20
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000);
21
- /* For IE 8*/
22
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000)";
23
  padding: 8px 21px;
24
- margin: 0;
25
- -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;
26
  z-index: 10000;
27
  text-align: center;
28
  color:white;
@@ -53,20 +42,17 @@
53
  bottom: 30px;
54
  font-family: "helvetica neue", helvetica, arial, sans-serif;
55
  font-size: 11px;
56
- color: #fff;
57
  margin: 0;
58
  font-weight: bold;
59
 
60
  }
61
  .pea_cook_wrapper a {
62
- color: #fff;
63
  border-bottom: dotted thin #eee;
64
  text-decoration: none;
65
  }
66
  .pea_cook_wrapper a:hover {
67
  text-decoration: none;
68
  border-bottom-style: solid;
69
- color: #ddd;
70
  }
71
 
72
 
@@ -81,11 +67,7 @@ display: block;
81
  button.pea_cook_btn {
82
  background: #e3e3e3;
83
  border: 1px solid #bbb;
84
- -webkit-border-radius: 5px;
85
- -moz-border-radius: 5px;
86
  border-radius: 5px;
87
- -webkit-box-shadow: inset 0 0 1px 1px #f6f6f6;
88
- -moz-box-shadow: inset 0 0 1px 1px #f6f6f6;
89
  box-shadow: inset 0 0 1px 1px #f6f6f6;
90
  color: #333;
91
  font: bold 12px "helvetica neue", helvetica, arial, sans-serif;
@@ -135,7 +117,6 @@ button.pea_cook_btn {
135
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000)";
136
  }
137
  .pea_cook_more_info_popover_inner a {
138
- color: #fff;
139
  border-bottom: dotted thin #eee;
140
  text-decoration: none;
141
  }
@@ -146,23 +127,25 @@ button.pea_cook_btn {
146
  }
147
 
148
  .pea_cook_more_info_popover h2{
149
- color: #fff;
150
  font-size: 22px;
151
  font-weight: bold;
152
  }
153
  .pea_cook_more_info_popover h3{
154
- color: #fff; font-size: 22px; font-weight: bold;
155
- }
156
- .pea_cook_more_info_popover p{
157
- color: #fff;
158
  }
159
  .eucookie {
160
- border:2px dashed black;
161
- float:left;
 
 
 
 
 
 
162
  }
163
  .eucookie span {
164
- width: 100%;
165
- margin: 10% auto 0 auto;
166
- text-align: center;
167
- float:left;
168
  }
1
  .pea_cook_wrapper {
2
  position: fixed;
 
 
 
 
 
3
  padding: 8px 21px;
4
  margin: 0;
5
+ border-radius: 5px;
6
  z-index: 10000;
7
  text-align: center;
8
  }
9
 
10
  .pea_cook_control {
11
+ width:80%;
 
 
 
 
 
 
12
  padding: 8px 21px;
13
+ margin: 20px auto;
14
+ border-radius: 5px;
15
  z-index: 10000;
16
  text-align: center;
17
  color:white;
42
  bottom: 30px;
43
  font-family: "helvetica neue", helvetica, arial, sans-serif;
44
  font-size: 11px;
 
45
  margin: 0;
46
  font-weight: bold;
47
 
48
  }
49
  .pea_cook_wrapper a {
 
50
  border-bottom: dotted thin #eee;
51
  text-decoration: none;
52
  }
53
  .pea_cook_wrapper a:hover {
54
  text-decoration: none;
55
  border-bottom-style: solid;
 
56
  }
57
 
58
 
67
  button.pea_cook_btn {
68
  background: #e3e3e3;
69
  border: 1px solid #bbb;
 
 
70
  border-radius: 5px;
 
 
71
  box-shadow: inset 0 0 1px 1px #f6f6f6;
72
  color: #333;
73
  font: bold 12px "helvetica neue", helvetica, arial, sans-serif;
117
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc000000, endColorstr=#cc000000)";
118
  }
119
  .pea_cook_more_info_popover_inner a {
 
120
  border-bottom: dotted thin #eee;
121
  text-decoration: none;
122
  }
127
  }
128
 
129
  .pea_cook_more_info_popover h2{
 
130
  font-size: 22px;
131
  font-weight: bold;
132
  }
133
  .pea_cook_more_info_popover h3{
134
+ font-size: 22px; font-weight: bold;
 
 
 
135
  }
136
  .eucookie {
137
+ float:left;
138
+ border-radius: 5px;
139
+ transition: background 0.5s;
140
+ }
141
+ .eucookie:hover {
142
+ cursor: pointer;
143
+ background-position: -20px -10px!important;
144
+ transition: background 0.5s;
145
  }
146
  .eucookie span {
147
+ width: 100%;
148
+ padding: 10px;
149
+ text-align: center;
150
+ float:left;
151
  }
defaults.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $defaults = array (
4
+ array('enabled', '0'),
5
+ array('lengthnum', '1'),
6
+ array('length', 'months'),
7
+ array('position', 'bottomright'),
8
+ array('barmessage', __('By continuing to use the site, you agree to the use of cookies.', 'eu-cookie-law')),
9
+ array('barlink', __('more information', 'eu-cookie-law')),
10
+ array('barbutton', __('Accept', 'eu-cookie-law')),
11
+ array('closelink', __('Close', 'eu-cookie-law')),
12
+ array('boxcontent', __('The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.', 'eu-cookie-law')),
13
+ array('bhtmlcontent', __('<b>Content not available.</b><br><small>Please allow cookies by clicking Accept on the banner</small>', 'eu-cookie-law')),
14
+ array('backgroundcolor', '#000000'),
15
+ array('fontcolor', '#FFFFFF'),
16
+ array('autoblock', '0'),
17
+ array('tinymcebutton', '0'),
18
+ array('scrollconsent', '0'),
19
+ array('navigationconsent', '0'),
20
+ array('networkshare', '0'),
21
+ array('onlyeuropean', '0'),
22
+ array('networkshareurl', ecl_getshareurl())
23
+ );
24
+
25
+ $my_options = get_option('peadig_eucookie');
26
+ $conta = count($defaults);
27
+ for($i=0;$i<$conta;$i++){
28
+ if (!$my_options[$defaults[$i][0]]) {
29
+ $my_options[$defaults[$i][0]] = $defaults[$i][1];
30
+ update_option('peadig_eucookie', $my_options);
31
+ }
32
+ }
33
+
34
+ function ecl_getshareurl() {
35
+ if ( is_multisite() ) {
36
+ $sURL = network_site_url();
37
+ } else {
38
+ $sURL = site_url();
39
+ }
40
+ $sURL = site_url(); // WordPress function
41
+ $asParts = parse_url( $sURL ); // PHP function
42
+
43
+ if ( ! $asParts )
44
+ wp_die( 'ERROR: Path corrupt for parsing.' ); // replace this with a better error result
45
+
46
+ $sScheme = $asParts['scheme'];
47
+ $nPort = $asParts['port'];
48
+ $sHost = $asParts['host'];
49
+ $nPort = 80 == $nPort ? '' : $nPort;
50
+ $nPort = 'https' == $sScheme AND 443 == $nPort ? '' : $nPort;
51
+ $sPort = ! empty( $sPort ) ? ":$nPort" : '';
52
+ $sReturn = $sHost . $sPort;
53
+
54
+ return $sReturn;
55
+ }
56
+ ?>
eu-cookie-law.php CHANGED
@@ -3,64 +3,37 @@
3
  Plugin Name: EU Cookie Law
4
  Plugin URI: https://wordpress.org/plugins/eu-cookie-law/
5
  Description: Cookie Law informs users that your site has cookies, with a popup for more information and ability to lock scripts before acceptance.
6
- Version: 2.1.2
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
10
 
11
  */
12
 
13
-
14
- add_action('init', 'eucookie_start');
15
-
16
  function eucookie_start() {
17
- if ( is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ){
18
- require 'class-admin.php';
19
- register_activation_hook(__FILE__, 'pea_cook_defaults');
20
- } else {
21
- require 'class-frontend.php';
22
- }
23
- }
24
 
25
  function ecl_action_admin_init() {
26
-
27
  $arraya_ecl_v = get_plugin_data ( __FILE__ );
28
  $new_version = $arraya_ecl_v['Version'];
29
-
30
- if ( !get_option( 'ecl_version_number' ) ) { pea_cook_defaults(); }
31
-
32
- if (version_compare(get_option( 'ecl_version_number' ), "2.1", "<")) {
33
- $my_options = get_option('peadig_eucookie');
34
- $my_options['bhtmlcontent'] = '<b>Content not available.</b><br><small>Please allow cookies by clicking Accept on the banner</small>';
35
- update_option('peadig_eucookie', $my_options);
36
- }
37
 
38
- update_option( 'ecl_version_number', $new_version );
 
 
 
 
 
 
 
39
  } add_action('admin_init', 'ecl_action_admin_init');
40
 
41
- // Hooks your functions into the correct filters
42
- function my_add_mce_button() {
43
- // check user permissions
44
- if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
45
- return;
46
- }
47
- // check if WYSIWYG is enabled
48
- if ( 'true' == get_user_option( 'rich_editing' ) ) {
49
- add_filter( 'mce_external_plugins', 'my_add_tinymce_plugin' );
50
- add_filter( 'mce_buttons', 'my_register_mce_button' );
51
- }
52
- }
53
- add_action('admin_head', 'my_add_mce_button');
54
 
55
- // Declare script for new button
56
- function my_add_tinymce_plugin( $plugin_array ) {
57
- $plugin_array['my_mce_button'] = plugins_url('js/shortcode.js',__FILE__);
58
- return $plugin_array;
59
  }
60
 
61
- // Register new button in the editor
62
- function my_register_mce_button( $buttons ) {
63
- array_push( $buttons, 'my_mce_button' );
64
- return $buttons;
65
- }
66
  ?>
3
  Plugin Name: EU Cookie Law
4
  Plugin URI: https://wordpress.org/plugins/eu-cookie-law/
5
  Description: Cookie Law informs users that your site has cookies, with a popup for more information and ability to lock scripts before acceptance.
6
+ Version: 2.5.2
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
10
 
11
  */
12
 
 
 
 
13
  function eucookie_start() {
14
+ require 'class-frontend.php';
15
+ if ( is_admin() ) { require 'class-admin.php'; }
16
+ } add_action('init', 'eucookie_start');
 
 
 
 
17
 
18
  function ecl_action_admin_init() {
 
19
  $arraya_ecl_v = get_plugin_data ( __FILE__ );
20
  $new_version = $arraya_ecl_v['Version'];
 
 
 
 
 
 
 
 
21
 
22
+ if ( version_compare($new_version, get_option('ecl_version_number') ) == 1 ) {
23
+ ecl_check_defaults();
24
+ update_option( 'ecl_version_number', $new_version );
25
+ }
26
+
27
+ if ( eucookie_option('tinymcebutton') ) {
28
+ require 'inc/tinymce.php';
29
+ }
30
  } add_action('admin_init', 'ecl_action_admin_init');
31
 
32
+ function ecl_check_defaults() { require 'defaults.php'; }
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
+ add_action( 'plugins_loaded', 'ecl_load_textdomain' );
35
+ function ecl_load_textdomain() {
36
+ load_plugin_textdomain( 'eu-cookie-law', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
 
37
  }
38
 
 
 
 
 
 
39
  ?>
img/block.png ADDED
Binary file
img/congruent_pentagon.png DELETED
Binary file
img/peadig.png ADDED
Binary file
img/wpgov.png ADDED
Binary file
{js → inc}/shortcode.js RENAMED
File without changes
inc/tinymce.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Hooks your functions into the correct filters
3
+ function ecl_add_mce_button() {
4
+ // check user permissions
5
+ if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
6
+ return;
7
+ }
8
+ // check if WYSIWYG is enabled
9
+ if ( 'true' == get_user_option( 'rich_editing' ) ) {
10
+ add_filter( 'mce_external_plugins', 'ecl_add_tinymce_plugin' );
11
+ add_filter( 'mce_buttons', 'ecl_register_mce_button' );
12
+ }
13
+ }
14
+ add_action('admin_head', 'ecl_add_mce_button');
15
+
16
+ function ecl_add_tinymce_plugin( $plugin_array ) {
17
+ $plugin_array['my_mce_button'] = plugins_url('shortcode.js',__FILE__);
18
+ return $plugin_array;
19
+ }
20
+
21
+ function ecl_register_mce_button( $buttons ) {
22
+ array_push( $buttons, 'my_mce_button' );
23
+ return $buttons;
24
+ }
25
+ ?>
js/eucookiesettings.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ $('.color-field').wpColorPicker();
3
+
4
+ $( "#boxcontent" ).prop( "disabled", $('#boxlinkid').val() );
5
+ $( "#closelink" ).prop( "disabled", $('#boxlinkid').val() );
6
+ $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
7
+
8
+ $('#boxlinkid').on('change', function() {
9
+ $( "#boxcontent" ).prop( "disabled", this.value );
10
+ $( "#closelink" ).prop( "disabled", this.value );
11
+ });
12
+
13
+ $('#networkshare').on('change', function() {
14
+ $( "#networkshareurl" ).prop( "disabled", !$('#networkshare').is(':checked') );
15
+ });
16
+ });
js/scripts.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ var expireTimer = eucookielaw_data.expireTimer;
4
+ var scrollConsent = eucookielaw_data.scrollConsent;
5
+ var networkShareURL = eucookielaw_data.networkShareURL;
6
+ var isCookiePage = eucookielaw_data.isCookiePage;
7
+ var isRefererWebsite = eucookielaw_data.isRefererWebsite;
8
+
9
+ $(".eu_control_btn").click(function() {
10
+ document.cookie = "euCookie=set; Max-Age=0; path=/";
11
+ window.location.reload();
12
+ });
13
+
14
+ $("#fom").click(function() {
15
+ if( $('#fom').attr('href') === '#') {
16
+ $(".pea_cook_more_info_popover").fadeIn("slow");
17
+ $(".pea_cook_wrapper").fadeOut("fast");
18
+ }
19
+ });
20
+
21
+ $("#pea_close").click(function() {
22
+ $(".pea_cook_wrapper").fadeIn("fast");
23
+ $(".pea_cook_more_info_popover").fadeOut("slow");
24
+ });
25
+
26
+ $('#pea_cook_btn, .eucookie').click(function() {
27
+ euCookieConsent();
28
+ });
29
+
30
+ jQuery(window).scroll(function(){
31
+ if ( scrollConsent > 0 && document.cookie.indexOf("euCookie") < 0 ) {
32
+ if (isCookiePage) { return; }
33
+ euCookieConsent();
34
+ }
35
+ });
36
+
37
+ if (isRefererWebsite && !isCookiePage && document.cookie.indexOf("euCookie") < 0 ) { euCookieConsent(); }
38
+
39
+ function euCookieConsent() {
40
+ var today = new Date(), expire = new Date();
41
+ expire.setTime(today.getTime() + (expireTimer * 24 * 60 * 60 * 1000) );
42
+ document.cookie = "euCookie=set; "+networkShareURL+"expires=" + expire.toUTCString() + "; path=/";
43
+ window.location.reload();
44
+ }
45
+ });
languages/eu-cookie-law-it_IT.mo ADDED
Binary file
languages/eu-cookie-law-it_IT.po ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: EU Cookie Law\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: Fri Jun 05 2015 16:34:27 GMT+0200 (ora legale Europa "
6
+ "occidentale)\n"
7
+ "PO-Revision-Date: Mon Jun 08 2015 17:04:41 GMT+0200 (ora legale Europa "
8
+ "occidentale)\n"
9
+ "Last-Translator: admin <admin@127.0.0.1>\n"
10
+ "Language-Team: \n"
11
+ "Language: Italian\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: 8bit\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
20
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
21
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
22
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
23
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
24
+ "X-Generator: Loco - https://localise.biz/\n"
25
+ "X-Loco-Target-Locale: it_IT"
26
+
27
+ #: ../class-admin.php:34
28
+ msgid "Changelog"
29
+ msgstr "Changelog"
30
+
31
+ #: ../class-admin.php:37
32
+ msgid "Rate us"
33
+ msgstr "Votaci"
34
+
35
+ #: ../class-admin.php:40
36
+ msgid "Support"
37
+ msgstr "Supporto"
38
+
39
+ #: ../class-admin.php:50
40
+ msgid "Activate"
41
+ msgstr "Attiva"
42
+
43
+ #: ../class-admin.php:53
44
+ msgid "Auto Block"
45
+ msgstr "Blocco Automatico"
46
+
47
+ #: ../class-admin.php:55
48
+ msgid ""
49
+ "This function will automatically block iframes, embeds and scripts in your "
50
+ "post, pages and widgets."
51
+ msgstr ""
52
+ "Questa funzione bloccherà in automatico iframe, embed e script in articoli, "
53
+ "pagine e widget."
54
+
55
+ #: ../class-admin.php:57
56
+ msgid "Enable TinyMce Button"
57
+ msgstr "Abilita pulsante TinyMce"
58
+
59
+ #: ../class-admin.php:59
60
+ msgid ""
61
+ "Click here if you want to turn on the tinymce button for manual insertion of "
62
+ "EU Cookie Law shortcodes while editing contents."
63
+ msgstr ""
64
+ "Clicca qui se vuoi abilitare il pulsante tinymce per l'inserimento manuale "
65
+ "degli shortcode nelle pagine di modifica dei contenuti"
66
+
67
+ #: ../class-admin.php:62
68
+ msgid "Cookie acceptance lenght"
69
+ msgstr "Durata accettazione cookie"
70
+
71
+ #: ../class-admin.php:66
72
+ msgid "hours"
73
+ msgstr "ore"
74
+
75
+ #: ../class-admin.php:68
76
+ msgid "days"
77
+ msgstr "giorni"
78
+
79
+ #: ../class-admin.php:70
80
+ msgid "weeks"
81
+ msgstr "settimane"
82
+
83
+ #: ../class-admin.php:72
84
+ msgid "months"
85
+ msgstr "mesi"
86
+
87
+ #: ../class-admin.php:74
88
+ msgid ""
89
+ "Once the user clicks accept the bar will disappear. You can set how long "
90
+ "this will apply for before the bar reappears to the user."
91
+ msgstr ""
92
+ "Quando l'utente clicca accetta la barra scompare. Puoi impostare quanto "
93
+ "tempo trascorra prima che la barra riappaia all'utente."
94
+
95
+ #: ../class-admin.php:79
96
+ msgid "Appearance"
97
+ msgstr "Aspetto"
98
+
99
+ #: ../class-admin.php:81
100
+ msgid "Position"
101
+ msgstr "Posizione"
102
+
103
+ #: ../class-admin.php:85
104
+ msgid "Bottom Right"
105
+ msgstr "Basso Destra"
106
+
107
+ #: ../class-admin.php:87
108
+ msgid "Top Right"
109
+ msgstr "Alto Destra"
110
+
111
+ #: ../class-admin.php:89
112
+ msgid "Bottom Left"
113
+ msgstr "Basso Sinistra"
114
+
115
+ #: ../class-admin.php:91
116
+ msgid "Top Left"
117
+ msgstr "Alto Sinistra"
118
+
119
+ #: ../class-admin.php:96
120
+ msgid "Background Color"
121
+ msgstr "Colore di Sfondo"
122
+
123
+ #: ../class-admin.php:100
124
+ msgid "Font Color"
125
+ msgstr "Colore del Testo"
126
+
127
+ #: ../class-admin.php:105
128
+ msgid "Content"
129
+ msgstr "Contenuto"
130
+
131
+ #: ../class-admin.php:108
132
+ msgid "Bar Message"
133
+ msgstr "Messaggio Banner"
134
+
135
+ #: ../class-admin.php:112
136
+ msgid "More Info Text"
137
+ msgstr "Testo Maggiori Informazioni"
138
+
139
+ #: ../class-admin.php:116
140
+ msgid "Accept Text"
141
+ msgstr "Testo Accettazione"
142
+
143
+ #: ../class-admin.php:120
144
+ msgid "Bar Link"
145
+ msgstr "Link Banner"
146
+
147
+ #: ../class-admin.php:121
148
+ msgid "Use this field if you want to link a page instead of showing the popup"
149
+ msgstr "Usa questo campo se vuoi collegarti a una pagina anziché mostrare il popup"
150
+
151
+ #: ../class-admin.php:139
152
+ msgid "\"Close Popup\" Text"
153
+ msgstr "Testo \"Chiudi Popup\""
154
+
155
+ #: ../class-admin.php:143
156
+ msgid "Popup Box Content"
157
+ msgstr "Contenuto del Popup"
158
+
159
+ #: ../class-admin.php:144
160
+ msgid "Use this to add a popup that informs your users about your cookie policy"
161
+ msgstr ""
162
+ "Utilizza questo campo per aggiungere un popup esteso che informa i tuoi "
163
+ "utenti sulla cookie policy"
164
+
165
+ #: ../class-admin.php:150
166
+ msgid "Blocked code message"
167
+ msgstr "Messaggio nel codice bloccato"
168
+
169
+ #: ../class-admin.php:151
170
+ msgid "This is the message that will be displayed for locked-code areas"
171
+ msgstr ""
172
+ "Questo è il messaggio che sarà mostrato nelle area in cui hai bloccato il "
173
+ "codice"
174
+
175
+ #: ../class-admin.php:159
176
+ msgid "Save Changes"
177
+ msgstr "Salva Impostazioni"
178
+
179
+ #: ../class-frontend.php:184
180
+ msgid "Cookies are enabled"
181
+ msgstr "Cookies abilitati"
182
+
183
+ #: ../class-frontend.php:185
184
+ msgid "Revoke cookie consent"
185
+ msgstr "Revoca consenso dei cookie"
186
+
187
+ #: ../class-frontend.php:199
188
+ msgid "Cookies are disabled"
189
+ msgstr "Cookie disabilitati"
190
+
191
+ #: ../class-frontend.php:200
192
+ #, php-format
193
+ msgid "Accept Cookies by clicking \"%s\" in the banner."
194
+ msgstr "Accetta i Cookie cliccando \"%s\" nel banner."
195
+
196
+ #: ../defaults.php:8
197
+ msgid "By continuing to use the site, you agree to the use of cookies."
198
+ msgstr "Utilizzando il sito, accetti l'utilizzo dei cookie da parte nostra."
199
+
200
+ #: ../defaults.php:9
201
+ msgid "more information"
202
+ msgstr "maggiori informazioni"
203
+
204
+ #: ../defaults.php:10
205
+ msgid "Accept"
206
+ msgstr "Accetto"
207
+
208
+ #: ../defaults.php:11
209
+ msgid "Close"
210
+ msgstr "Chiudi"
211
+
212
+ #: ../defaults.php:12
213
+ msgid ""
214
+ "The cookie settings on this website are set to \"allow cookies\" to give you "
215
+ "the best browsing experience possible. If you continue to use this website "
216
+ "without changing your cookie settings or you click \"Accept\" below then you "
217
+ "are consenting to this."
218
+ msgstr ""
219
+ "Questo sito utilizza i cookie per fonire la migliore esperienza di "
220
+ "navigazione possibile. Continuando a utilizzare questo sito senza modificare "
221
+ "le impostazioni dei cookie o clicchi su \"Accetta\" permetti al loro utilizzo."
222
+
223
+ #: ../defaults.php:13
224
+ msgid ""
225
+ "<b>Content not available.</b><br><small>Please allow cookies by clicking "
226
+ "Accept on the banner</small>"
227
+ msgstr ""
228
+ "<b>Contenuto non disponibile</b><br><small>Consenti i cookie cliccando su "
229
+ "\"Accetta\" nel banner\"</small>"
languages/eu-cookie-law.pot ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Loco Gettext template
2
+ #, fuzzy
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: EU Cookie Law\n"
6
+ "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: Fri Jun 05 2015 16:34:27 GMT+0200 (ora legale Europa "
8
+ "occidentale)\n"
9
+ "POT-Revision-Date: Mon Jun 08 2015 17:04:22 GMT+0200 (ora legale Europa "
10
+ "occidentale)\n"
11
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: \n"
13
+ "Language-Team: \n"
14
+ "Language: \n"
15
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "X-Poedit-SourceCharset: UTF-8\n"
20
+ "X-Poedit-Basepath: .\n"
21
+ "X-Poedit-SearchPath-0: ..\n"
22
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
23
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
24
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
25
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
26
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
27
+ "X-Generator: Loco - https://localise.biz/"
28
+
29
+ #: ../class-admin.php:34
30
+ msgid "Changelog"
31
+ msgstr ""
32
+
33
+ #: ../class-admin.php:37
34
+ msgid "Rate us"
35
+ msgstr ""
36
+
37
+ #: ../class-admin.php:40
38
+ msgid "Support"
39
+ msgstr ""
40
+
41
+ #: ../class-admin.php:50
42
+ msgid "Activate"
43
+ msgstr ""
44
+
45
+ #: ../class-admin.php:53
46
+ msgid "Auto Block"
47
+ msgstr ""
48
+
49
+ #: ../class-admin.php:55
50
+ msgid ""
51
+ "This function will automatically block iframes, embeds and scripts in your "
52
+ "post, pages and widgets."
53
+ msgstr ""
54
+
55
+ #: ../class-admin.php:57
56
+ msgid "Enable TinyMce Button"
57
+ msgstr ""
58
+
59
+ #: ../class-admin.php:59
60
+ msgid ""
61
+ "Click here if you want to turn on the tinymce button for manual insertion of "
62
+ "EU Cookie Law shortcodes while editing contents."
63
+ msgstr ""
64
+
65
+ #: ../class-admin.php:62
66
+ msgid "Cookie acceptance lenght"
67
+ msgstr ""
68
+
69
+ #: ../class-admin.php:66
70
+ msgid "hours"
71
+ msgstr ""
72
+
73
+ #: ../class-admin.php:68
74
+ msgid "days"
75
+ msgstr ""
76
+
77
+ #: ../class-admin.php:70
78
+ msgid "weeks"
79
+ msgstr ""
80
+
81
+ #: ../class-admin.php:72
82
+ msgid "months"
83
+ msgstr ""
84
+
85
+ #: ../class-admin.php:74
86
+ msgid ""
87
+ "Once the user clicks accept the bar will disappear. You can set how long "
88
+ "this will apply for before the bar reappears to the user."
89
+ msgstr ""
90
+
91
+ #: ../class-admin.php:79
92
+ msgid "Appearance"
93
+ msgstr ""
94
+
95
+ #: ../class-admin.php:81
96
+ msgid "Position"
97
+ msgstr ""
98
+
99
+ #: ../class-admin.php:85
100
+ msgid "Bottom Right"
101
+ msgstr ""
102
+
103
+ #: ../class-admin.php:87
104
+ msgid "Top Right"
105
+ msgstr ""
106
+
107
+ #: ../class-admin.php:89
108
+ msgid "Bottom Left"
109
+ msgstr ""
110
+
111
+ #: ../class-admin.php:91
112
+ msgid "Top Left"
113
+ msgstr ""
114
+
115
+ #: ../class-admin.php:96
116
+ msgid "Background Color"
117
+ msgstr ""
118
+
119
+ #: ../class-admin.php:100
120
+ msgid "Font Color"
121
+ msgstr ""
122
+
123
+ #: ../class-admin.php:105
124
+ msgid "Content"
125
+ msgstr ""
126
+
127
+ #: ../class-admin.php:108
128
+ msgid "Bar Message"
129
+ msgstr ""
130
+
131
+ #: ../class-admin.php:112
132
+ msgid "More Info Text"
133
+ msgstr ""
134
+
135
+ #: ../class-admin.php:116
136
+ msgid "Accept Text"
137
+ msgstr ""
138
+
139
+ #: ../class-admin.php:120
140
+ msgid "Bar Link"
141
+ msgstr ""
142
+
143
+ #: ../class-admin.php:121
144
+ msgid "Use this field if you want to link a page instead of showing the popup"
145
+ msgstr ""
146
+
147
+ #: ../class-admin.php:139
148
+ msgid "\"Close Popup\" Text"
149
+ msgstr ""
150
+
151
+ #: ../class-admin.php:143
152
+ msgid "Popup Box Content"
153
+ msgstr ""
154
+
155
+ #: ../class-admin.php:144
156
+ msgid "Use this to add a popup that informs your users about your cookie policy"
157
+ msgstr ""
158
+
159
+ #: ../class-admin.php:150
160
+ msgid "Blocked code message"
161
+ msgstr ""
162
+
163
+ #: ../class-admin.php:151
164
+ msgid "This is the message that will be displayed for locked-code areas"
165
+ msgstr ""
166
+
167
+ #: ../class-admin.php:159
168
+ msgid "Save Changes"
169
+ msgstr ""
170
+
171
+ #: ../class-frontend.php:184
172
+ msgid "Cookies are enabled"
173
+ msgstr ""
174
+
175
+ #: ../class-frontend.php:185
176
+ msgid "Revoke cookie consent"
177
+ msgstr ""
178
+
179
+ #: ../class-frontend.php:199
180
+ msgid "Cookies are disabled"
181
+ msgstr ""
182
+
183
+ #: ../class-frontend.php:200
184
+ #, php-format
185
+ msgid "Accept Cookies by clicking \"%s\" in the banner."
186
+ msgstr ""
187
+
188
+ #: ../defaults.php:8
189
+ msgid "By continuing to use the site, you agree to the use of cookies."
190
+ msgstr ""
191
+
192
+ #: ../defaults.php:9
193
+ msgid "more information"
194
+ msgstr ""
195
+
196
+ #: ../defaults.php:10
197
+ msgid "Accept"
198
+ msgstr ""
199
+
200
+ #: ../defaults.php:11
201
+ msgid "Close"
202
+ msgstr ""
203
+
204
+ #: ../defaults.php:12
205
+ msgid ""
206
+ "The cookie settings on this website are set to \"allow cookies\" to give you "
207
+ "the best browsing experience possible. If you continue to use this website "
208
+ "without changing your cookie settings or you click \"Accept\" below then you "
209
+ "are consenting to this."
210
+ msgstr ""
211
+
212
+ #: ../defaults.php:13
213
+ msgid ""
214
+ "<b>Content not available.</b><br><small>Please allow cookies by clicking "
215
+ "Accept on the banner</small>"
216
+ msgstr ""
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === EU Cookie Law ===
2
  Contributors: alexmoss, Milmor, pleer, ShaneJones
3
- Version: 2.1.2
4
- Stable tag: 2.1.2
5
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
6
  Author URI: https://profiles.wordpress.org/milmor/
7
  Tags: eu cookie, cookies, law, analytics, european, italia, garante, privacy, eu cookie law, italy, cookie, consent, europe
@@ -10,46 +10,50 @@ Tested up to: 4.3
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
- EU Cookie Law informs users that your site has cookies, with a popup for more information and ability to lock scripts before acceptance.
14
 
15
  == Description ==
16
 
17
- EU Cookie Law allows to comply the EU Cookie Law by informing users that your site has cookies, with a popup for more information and ability to lock scripts before acceptance.
18
 
19
  https://www.youtube.com/watch?v=6f2qxC3GZJ8
20
 
21
  Demo: [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
22
 
23
- = Features =
24
- * Customizable banner
25
- * Easy shortcodes that block scripts if cookies are not accepted
 
26
  * Set cookie expiry
27
- * Compatible with multilanguage plugins
28
- * Compatible with mobile themes and plugins
29
- * Great responsiveness for tablets and smartphones
30
  * Set banner position
 
 
 
 
 
 
31
  * Complete set of developer Shortcodes and PHP Functions
 
32
 
33
  Simply install the plugin and follow the instructions on the Settings page.
34
 
35
  = Cookie block =
36
- You can lock cookies using `[cookie]` and `[/cookie]` shortcodes in every page and widget.
37
-
38
- In php files:
39
  `if ( function_exists('cookie_accepted') && cookie_accepted() ) {
40
  // Your code
41
  }`
42
 
43
- More Shortcodes & PHP Functions are available [in our faqs](https://wordpress.org/plugins/eu-cookie-law/faq/).
44
 
45
- > EU Cookie Law started from [Peadig](http://peadig.com/wordpress-plugins/eu-cookie-law/) in 2012 and in june 2015 has became part of the project [WPGov.it](http://www.wpgov.it) that aims to give Italian Public Government powerful open source solutions to make complete and law-compatible websites.
46
-
47
- If you think that we should provide more options or enhance the ones we already provide, please let us know in [our forum](https://wordpress.org/support/plugin/eu-cookie-law).
48
 
49
  = Included Languages =
50
 
51
  * English (EN) - Authors
52
- * Italian (IT) - Coming soon
 
 
53
 
54
  = Contributions =
55
 
@@ -84,11 +88,16 @@ You can easily verify if cookies consent has been set with:
84
  // Your code
85
  }`
86
  However this will limit to not showing the wrapped code. If you want to display a box like when using `[cookie]` shortcode, in php you have:
87
- `generate_cookie_notice($height, $width)
88
- generate_cookie_notice_text($height, $width, $text)`
89
 
90
  If you think that we should provide more shortcodes, functions, or enhance what we already provide, please let us know in [our forum](https://wordpress.org/support/plugin/eu-cookie-law).
91
 
 
 
 
 
 
92
  == Screenshots ==
93
 
94
  1. Example (cookie not accepted) - [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
@@ -98,6 +107,59 @@ If you think that we should provide more shortcodes, functions, or enhance what
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  = 2.1.1 + 2.1.2 04.06.2015 =
102
  * Fixed shortcodes in `[cookie]...[/cookie]` not being correctly rendered
103
  * Best tinymce icon with windowmanager
1
  === EU Cookie Law ===
2
  Contributors: alexmoss, Milmor, pleer, ShaneJones
3
+ Version: 2.5.2
4
+ Stable tag: 2.5.2
5
  Author: Alex Moss, Marco Milesi, Peadig, Shane Jones
6
  Author URI: https://profiles.wordpress.org/milmor/
7
  Tags: eu cookie, cookies, law, analytics, european, italia, garante, privacy, eu cookie law, italy, cookie, consent, europe
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
+ EU Cookie Law informs users that your site uses cookies, with option to lock scripts before acceptance. Fully customizable.
14
 
15
  == Description ==
16
 
17
+ EU Cookie Law is a **light, easy, elegant and complete** 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 ability to lock scripts before acceptance. This plugin has been coded to comply the more strict italian law too and offers many exclusive features!
18
 
19
  https://www.youtube.com/watch?v=6f2qxC3GZJ8
20
 
21
  Demo: [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
22
 
23
+ = Basic Features =
24
+ * **Customizable banner**
25
+ * Option for consent by scrolling
26
+ * Option for acceptance if user continues navigation
27
  * Set cookie expiry
28
+ * Fully **responsive** for tablets and smartphones
 
 
29
  * Set banner position
30
+ * Compatible with **mobile** themes and plugins
31
+ * Compatible with **multilanguage** plugins (certified for **WPML**)
32
+
33
+ = Advanced Features =
34
+ * Block scripts if cookies are not accepted
35
+ * **Automatic block of iframes, embeds, scripts and objects**
36
  * Complete set of developer Shortcodes and PHP Functions
37
+ * Manual and **Automatic** set width and height of blocked content
38
 
39
  Simply install the plugin and follow the instructions on the Settings page.
40
 
41
  = Cookie block =
42
+ You can lock cookies using `[cookie]` and `[/cookie]` shortcodes in every post, page and widget. You can use php functions too:
 
 
43
  `if ( function_exists('cookie_accepted') && cookie_accepted() ) {
44
  // Your code
45
  }`
46
 
47
+ **More Shortcodes & PHP Functions are available [in our faqs](https://wordpress.org/plugins/eu-cookie-law/faq/).**
48
 
49
+ > EU Cookie Law started from [Peadig](http://peadig.com/wordpress-plugins/eu-cookie-law/) in 2012 and in june 2015 has became part of [WPGov.it](http://www.wpgov.it) that aims to give Italian Public Government powerful open source solutions for websites.
 
 
50
 
51
  = Included Languages =
52
 
53
  * English (EN) - Authors
54
+ * Italian (IT) - Authors
55
+
56
+ If you want to help out, we have included the .pot file in /language folder.
57
 
58
  = Contributions =
59
 
88
  // Your code
89
  }`
90
  However this will limit to not showing the wrapped code. If you want to display a box like when using `[cookie]` shortcode, in php you have:
91
+ `generate_cookie_notice($height, $width);
92
+ generate_cookie_notice_text($height, $width, $text);`
93
 
94
  If you think that we should provide more shortcodes, functions, or enhance what we already provide, please let us know in [our forum](https://wordpress.org/support/plugin/eu-cookie-law).
95
 
96
+ = Auto block (beta) =
97
+ 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.
98
+
99
+ If you want to exclude a page from being filtered, you can set custom post field name **eucookielaw_exclude** to **1**. To do this, enable "Custom Fields" in "Screen Options". Then in the "Custom Fields" box enter the name, the value, and hit "Add Custom Field".
100
+
101
  == Screenshots ==
102
 
103
  1. Example (cookie not accepted) - [www.sanpellegrinoterme.gov.it](http://www.sanpellegrinoterme.gov.it)
107
 
108
  == Changelog ==
109
 
110
+ = 2.5.2 05.07.2015 =
111
+ * Improved autoblock
112
+
113
+ = 2.5.1 03.07.2015 =
114
+ * Compatible with **WPML**
115
+ * Better AutoBlock function (Disqus block included!)
116
+ * Now scripts block doesn't generate the message (limited for iframe, object and embed)
117
+ * Minor changes
118
+
119
+ = 2.5 24.06.2015 =
120
+ * Removed acceptance on scroll while in cookie page
121
+ * Added Continue Navigation acceptance (beta)
122
+ * Added Multisite Support (beta)
123
+
124
+ = 2.4.2 11.06.2015 =
125
+ * Fixed occasional wrong date when setting cookies
126
+
127
+ = 2.4.1 10.06.2015 =
128
+ * Solved a conflict with "Register Plus Redux"
129
+ * Minor changes
130
+
131
+ = 2.4 09.06.2015 =
132
+ * Added `<objects>` to auto block feature
133
+ * Added ability to exclude pages from auto block feature (see our faqs) (beta)
134
+ * Added option to consider scrolling as acceptation (disabled by default)
135
+ * Improved style.css
136
+ * Remove inline javascript in favor of WordPress enqueue
137
+
138
+ = 2.3.1 08.06.2015 =
139
+ * Removed "hours" in expiration (it caused bugs with internationalizationation).
140
+ * **Please re-save the field. It will be considered as "days" while calculating expiration date of cookie.**
141
+
142
+ = 2.3 08.06.2015 =
143
+ * **Added automatic block of iframes, embeds, scripts** (beta)
144
+ * **Added** option to enable/disable tinymce button
145
+ * Performance improvements
146
+ * Minor changes
147
+
148
+ = 2.2.2 08.06.2015 =
149
+ * **Fixed** conflict with the_content filter
150
+
151
+ = 2.2.1 08.06.2015 =
152
+ * **Fixed** expire date bug
153
+ * **Fixed** shortcodes in widgets
154
+ * Minor improvements
155
+
156
+ = 2.2 05.06.2015 =
157
+ * **Added** customization options (ex. background+font color)
158
+ * Added multilanguage support
159
+ * Added italian language
160
+ * Better UI for options panel
161
+ * Minor bugfixes
162
+
163
  = 2.1.1 + 2.1.2 04.06.2015 =
164
  * Fixed shortcodes in `[cookie]...[/cookie]` not being correctly rendered
165
  * Best tinymce icon with windowmanager
wpml-config.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <wpml-config>
2
+ <admin-texts>
3
+ <key name="peadig_eucookie">
4
+ <key name="barmessage"/>
5
+ <key name="barlink"/>
6
+ <key name="barbutton"/>
7
+ <key name="closelink"/>
8
+ <key name="boxcontent"/>
9
+ <key name="bhtmlcontent"/>
10
+ </key>
11
+ </admin-texts>
12
+ </wpml-config>