Cookie Law / GDPR Info - Version 1.5.4

Version Description

  • Tested OK with WordPress 4.9.5
  • GDPR compliance updates.
Download this release

Release Info

Developer markwt
Plugin Icon Cookie Law / GDPR Info
Version 1.5.4
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.4

admin/cli-admin-page.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  ===============================================================================
4
 
5
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
@@ -155,11 +155,20 @@ function cookielawinfo_print_admin_page() {
155
  <tr valign="top">
156
  <th scope="row"><label for="is_on_field">Cookie Bar is currently:</label></th>
157
  <td>
 
158
  <input type="radio" id="is_on_field_yes" name="is_on_field" class="styled" value="true" <?php echo ( $the_options['is_on'] == true ) ? ' checked="checked" />' : ' />'; ?> On
159
  <input type="radio" id="is_on_field_no" name="is_on_field" class="styled" value="false" <?php echo ( $the_options['is_on'] == false ) ? ' checked="checked" />' : ' />'; ?> Off
160
  <span id="header_on_off_field_warning"></span>
161
  </td>
162
  </tr>
 
 
 
 
 
 
 
 
163
  <tr valign="top">
164
  <th scope="row"><label for="notify_position_vertical_field">Cookie Bar will be show in:</label></th>
165
  <td>
@@ -375,6 +384,8 @@ function cookielawinfo_print_admin_page() {
375
  <dt><a href="#">Customise Buttons</a></dt>
376
  <dd>
377
 
 
 
378
  <h4>Main Button <code>[cookie_button]</code></h4>
379
  <p>This button/link can be customised to either simply close the cookie bar, or follow a link. You can also customise the colours and styles, and show it as a link or a button.</p>
380
  <table class="form-table">
@@ -439,8 +450,78 @@ function cookielawinfo_print_admin_page() {
439
  </td>
440
  </tr>
441
  </table><!-- end custom button -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
 
443
-
444
  <h4>Read More Link <code>[cookie_link]</code></h4>
445
  <p>This button/link can be used to provide a link out to your Privacy & Cookie Policy. You can customise it any way you like.</p>
446
  <table class="form-table">
2
  /*
3
  ===============================================================================
4
 
5
+ Copyright 2018 Markwt
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
155
  <tr valign="top">
156
  <th scope="row"><label for="is_on_field">Cookie Bar is currently:</label></th>
157
  <td>
158
+
159
  <input type="radio" id="is_on_field_yes" name="is_on_field" class="styled" value="true" <?php echo ( $the_options['is_on'] == true ) ? ' checked="checked" />' : ' />'; ?> On
160
  <input type="radio" id="is_on_field_no" name="is_on_field" class="styled" value="false" <?php echo ( $the_options['is_on'] == false ) ? ' checked="checked" />' : ' />'; ?> Off
161
  <span id="header_on_off_field_warning"></span>
162
  </td>
163
  </tr>
164
+ <tr valign="top">
165
+ <th scope="row"><label for="is_reject_on_field">Reject Button:</label></th>
166
+ <td>
167
+ <input type="radio" id="is_reject_on_field_yes" name="is_reject_on_field" class="styled" value="true" <?php echo ( $the_options['is_reject_on'] == true ) ? ' checked="checked" />' : ' />'; ?> On
168
+ <input type="radio" id="is_reject_on_field_no" name="is_reject_on_field" class="styled" value="false" <?php echo ( $the_options['is_reject_on'] == false ) ? ' checked="checked" />' : ' />'; ?> Off
169
+ <!--<span id="header_on_off_field_warning"></span>-->
170
+ </td>
171
+ </tr>
172
  <tr valign="top">
173
  <th scope="row"><label for="notify_position_vertical_field">Cookie Bar will be show in:</label></th>
174
  <td>
384
  <dt><a href="#">Customise Buttons</a></dt>
385
  <dd>
386
 
387
+ <h3 style="margin-bottom:30px;"> Accept Button </h3>
388
+
389
  <h4>Main Button <code>[cookie_button]</code></h4>
390
  <p>This button/link can be customised to either simply close the cookie bar, or follow a link. You can also customise the colours and styles, and show it as a link or a button.</p>
391
  <table class="form-table">
450
  </td>
451
  </tr>
452
  </table><!-- end custom button -->
453
+
454
+ <hr>
455
+
456
+ <h3 style="margin-top:50px;"> Reject Button </h3>
457
+
458
+ <table class="form-table" >
459
+ <tr valign="top">
460
+ <th scope="row"><label for="button_3_text_field">Link Text</label></th>
461
+ <td>
462
+ <input type="text" name="button_3_text_field" value="<?php echo stripslashes( $the_options['button_3_text'] ) ?>" />
463
+ </td>
464
+ </tr>
465
+ <tr valign="top">
466
+ <th scope="row"><label for="button_3_action_field">Action</label></th>
467
+ <td>
468
+ <select name="button_3_action_field" id="cli-plugin-button-3-action" class="vvv_combobox">
469
+ <?php
470
+ $action_list = cookielawinfo_get_js_actions();
471
+ $action_list['Close Header'] = '#cookie_action_close_header_reject';
472
+ cookielawinfo_print_combobox_options($action_list , $the_options['button_3_action'] ) ?>
473
+ </select>
474
+ </td>
475
+ </tr>
476
+ <tr valign="top" class="cli-plugin-row">
477
+ <th scope="row"><label for="button_3_url_field">Link URL</label></th>
478
+ <td>
479
+ <input type="text" name="button_3_url_field" id="button_3_url_field" value="<?php echo $the_options['button_3_url'] ?>" />
480
+ <span class="cli-plugin-example"><em>Button will only link to URL if Action = Show URL</em></span>
481
+ </td>
482
+ </tr>
483
+
484
+ <tr valign="top" class="cli-plugin-row">
485
+ <th scope="row"><label for="button_3_new_win_field">Open link in new window?</label></th>
486
+ <td>
487
+ <input type="radio" id="button_3_new_win_field_yes" name="button_3_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_3_new_win'] == true ) ? ' checked="checked" />' : ' />'; ?> Yes
488
+ <input type="radio" id="button_3_new_win_field_no" name="button_3_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_3_new_win'] == false ) ? ' checked="checked" />' : ' />'; ?> No
489
+ </td>
490
+ </tr>
491
+ <tr valign="top">
492
+ <th scope="row"><label for="button_3_link_colour_field">Link colour</label></th>
493
+ <td>
494
+ <?php
495
+ echo '<input type="text" name="button_3_link_colour_field" id="cli-colour-link-button-3" value="' .$the_options['button_3_link_colour']. '" class="my-color-field" />';
496
+ ?>
497
+ </td>
498
+ </tr>
499
+ <tr valign="top">
500
+ <th scope="row"><label for="button_3_as_button_field">Show as button?</label></th>
501
+ <td>
502
+ <input type="radio" id="button_3_as_button_field_yes" name="button_3_as_button_field" class="styled" value="true" <?php echo ( $the_options['button_3_as_button'] == true ) ? ' checked="checked" />' : ' />'; ?> Button
503
+ <input type="radio" id="button_3_as_button_field_no" name="button_3_as_button_field" class="styled" value="false" <?php echo ( $the_options['button_3_as_button'] == false ) ? ' checked="checked" />' : ' />'; ?> Link
504
+ </td>
505
+ </tr>
506
+ <tr valign="top">
507
+ <th scope="row"><label for="button_3_button_colour_field">Button colour</label></th>
508
+ <td>
509
+ <?php
510
+ echo '<input type="text" name="button_3_button_colour_field" id="cli-colour-btn-button-3" value="' .$the_options['button_3_button_colour']. '" class="my-color-field" />';
511
+ ?>
512
+ </td>
513
+ </tr>
514
+ <tr valign="top">
515
+ <th scope="row"><label for="button_3_button_size_field">Button Size</label></th>
516
+ <td>
517
+ <select name="button_3_button_size_field" class="vvv_combobox">
518
+ <?php cookielawinfo_print_combobox_options( cookielawinfo_get_button_sizes(), $the_options['button_3_button_size'] ); ?>
519
+ </select>
520
+ </td>
521
+ </tr>
522
+ </table><!-- end custom button -->
523
 
524
+ <hr>
525
  <h4>Read More Link <code>[cookie_link]</code></h4>
526
  <p>This button/link can be used to provide a link out to your Privacy & Cookie Policy. You can customise it any way you like.</p>
527
  <table class="form-table">
admin/cli-admin.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  ===============================================================================
4
 
5
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
@@ -49,9 +49,18 @@ function cookielawinfo_get_default_settings() {
49
  'button_2_as_button' => false,
50
  'button_2_button_colour' => '#333',
51
  'button_2_button_size' => 'medium',
 
 
 
 
 
 
 
 
52
  'font_family' => 'inherit', // Pick the family, not the easy name (see helper function below)
53
  'header_fix' => false,
54
- 'is_on' => true,
 
55
  'notify_animate_hide' => true,
56
  'notify_animate_show' => false,
57
  'notify_div_id' => '#cookie-law-info-bar',
@@ -265,6 +274,7 @@ function cookielawinfo_sanitise($key, $value) {
265
  switch ($key) {
266
  // Convert all boolean values from text to bool:
267
  case 'is_on':
 
268
  case 'border_on':
269
  case 'notify_animate_show':
270
  case 'notify_animate_hide':
@@ -274,6 +284,8 @@ function cookielawinfo_sanitise($key, $value) {
274
  case 'button_1_as_button':
275
  case 'button_2_new_win':
276
  case 'button_2_as_button':
 
 
277
  case 'scroll_close':
278
  case 'scroll_close_reload':
279
  case 'show_once_yn':
@@ -300,6 +312,8 @@ function cookielawinfo_sanitise($key, $value) {
300
  case 'button_1_button_colour':
301
  case 'button_2_link_colour':
302
  case 'button_2_button_colour':
 
 
303
  if ( preg_match( '/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $value ) ) {
304
  // Was: '/^#([0-9a-fA-F]{1,2}){3}$/i' which allowed e.g. '#00dd' (error)
305
  $ret = $value;
@@ -316,6 +330,7 @@ function cookielawinfo_sanitise($key, $value) {
316
  // URLs only:
317
  case 'button_1_url':
318
  case 'button_2_url':
 
319
  $ret = esc_url( $value );
320
  break;
321
  // Basic sanitisation for all the rest:
@@ -323,6 +338,7 @@ function cookielawinfo_sanitise($key, $value) {
323
  $ret = sanitize_text_field( $value );
324
  break;
325
  }
 
326
  return $ret;
327
  }
328
 
2
  /*
3
  ===============================================================================
4
 
5
+ Copyright 2018 Markwt
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
49
  'button_2_as_button' => false,
50
  'button_2_button_colour' => '#333',
51
  'button_2_button_size' => 'medium',
52
+ 'button_3_text' => 'Reject',
53
+ 'button_3_url' => '#',
54
+ 'button_3_action' => '#cookie_action_close_header_reject',
55
+ 'button_3_link_colour' => '#fff',
56
+ 'button_3_new_win' => false,
57
+ 'button_3_as_button' => true,
58
+ 'button_3_button_colour' => '#000',
59
+ 'button_3_button_size' => 'medium',
60
  'font_family' => 'inherit', // Pick the family, not the easy name (see helper function below)
61
  'header_fix' => false,
62
+ 'is_on' => true,
63
+ 'is_reject_on' => false,
64
  'notify_animate_hide' => true,
65
  'notify_animate_show' => false,
66
  'notify_div_id' => '#cookie-law-info-bar',
274
  switch ($key) {
275
  // Convert all boolean values from text to bool:
276
  case 'is_on':
277
+ case 'is_reject_on':
278
  case 'border_on':
279
  case 'notify_animate_show':
280
  case 'notify_animate_hide':
284
  case 'button_1_as_button':
285
  case 'button_2_new_win':
286
  case 'button_2_as_button':
287
+ case 'button_3_new_win':
288
+ case 'button_3_as_button':
289
  case 'scroll_close':
290
  case 'scroll_close_reload':
291
  case 'show_once_yn':
312
  case 'button_1_button_colour':
313
  case 'button_2_link_colour':
314
  case 'button_2_button_colour':
315
+ case 'button_3_link_colour':
316
+ case 'button_3_button_colour':
317
  if ( preg_match( '/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $value ) ) {
318
  // Was: '/^#([0-9a-fA-F]{1,2}){3}$/i' which allowed e.g. '#00dd' (error)
319
  $ret = $value;
330
  // URLs only:
331
  case 'button_1_url':
332
  case 'button_2_url':
333
+ case 'button_3_url':
334
  $ret = esc_url( $value );
335
  break;
336
  // Basic sanitisation for all the rest:
338
  $ret = sanitize_text_field( $value );
339
  break;
340
  }
341
+ if('is_reject_on' === $key && 'fffffff' === $ret) $ret = false;
342
  return $ret;
343
  }
344
 
cookie-law-info.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /*
3
  Plugin Name: Cookie Law Info
4
- Plugin URI: http://wordpress.org/extend/plugins/cookie-law-info/description/
5
- Description: A simple way of 'implied consent' to show your website complies with the EU Cookie Law, which came into force on 26 May 2012.
6
  Author: markwt
7
  Author URI: http://cookielawinfo.com/
8
- Version: 1.5.3
9
  License: GPL2
10
  */
11
 
12
  /*
13
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
@@ -59,6 +59,7 @@ add_action( 'wp_footer', 'cookielawinfo_inject_cli_script' );
59
  add_shortcode( 'delete_cookies', 'cookielawinfo_delete_cookies_shortcode' ); // a shortcode [delete_cookies (text="Delete Cookies")]
60
  add_shortcode( 'cookie_audit', 'cookielawinfo_table_shortcode' ); // a shortcode [cookie_audit style="winter"]
61
  add_shortcode( 'cookie_accept', 'cookielawinfo_shortcode_accept_button' ); // a shortcode [cookie_accept (colour="red")]
 
62
  add_shortcode( 'cookie_link', 'cookielawinfo_shortcode_more_link' ); // a shortcode [cookie_link]
63
  add_shortcode( 'cookie_button', 'cookielawinfo_shortcode_main_button' ); // a shortcode [cookie_button]
64
 
1
  <?php
2
  /*
3
  Plugin Name: Cookie Law Info
4
+ Plugin URI: https://wordpress.org/plugins/cookie-law-info/
5
+ Description: A simple way of to show your website complies with the EU Cookie Law / GDPR.
6
  Author: markwt
7
  Author URI: http://cookielawinfo.com/
8
+ Version: 1.5.4
9
  License: GPL2
10
  */
11
 
12
  /*
13
+ Copyright 2018 Markwt
14
 
15
  This program is free software; you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License, version 2, as
59
  add_shortcode( 'delete_cookies', 'cookielawinfo_delete_cookies_shortcode' ); // a shortcode [delete_cookies (text="Delete Cookies")]
60
  add_shortcode( 'cookie_audit', 'cookielawinfo_table_shortcode' ); // a shortcode [cookie_audit style="winter"]
61
  add_shortcode( 'cookie_accept', 'cookielawinfo_shortcode_accept_button' ); // a shortcode [cookie_accept (colour="red")]
62
+ add_shortcode( 'cookie_reject', 'cookielawinfo_shortcode_reject_button' ); // a shortcode [cookie_reject (colour="red")]
63
  add_shortcode( 'cookie_link', 'cookielawinfo_shortcode_more_link' ); // a shortcode [cookie_link]
64
  add_shortcode( 'cookie_button', 'cookielawinfo_shortcode_main_button' ); // a shortcode [cookie_button]
65
 
js/cookielawinfo.js CHANGED
@@ -1,5 +1,5 @@
1
  function cli_show_cookiebar(p) {
2
- /* plugin version 1.5.3 */
3
  var Cookie = {
4
  set: function(name,value,days) {
5
  if (days) {
@@ -42,6 +42,7 @@ function cli_show_cookiebar(p) {
42
  }
43
  var settings = JSON.parse(json_payload);
44
 
 
45
  var cached_header = jQuery(settings.notify_div_id),
46
  cached_showagain_tab = jQuery(settings.showagain_div_id),
47
  btn_accept = jQuery('#cookie_hdr_accept'),
@@ -143,7 +144,23 @@ function cli_show_cookiebar(p) {
143
  jQuery(this).css('background-color', settings.button_2_button_colour);
144
  });
145
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
 
147
  cached_showagain_tab.click(function(e) {
148
  e.preventDefault();
149
  cached_showagain_tab.slideUp(settings.animate_speed_hide, function slideShow() {
@@ -160,6 +177,11 @@ function cli_show_cookiebar(p) {
160
  e.preventDefault();
161
  accept_close();
162
  });
 
 
 
 
 
163
 
164
  function accept_close() {
165
  Cookie.set(ACCEPT_COOKIE_NAME, 'yes', ACCEPT_COOKIE_EXPIRE);
@@ -173,6 +195,24 @@ function cli_show_cookiebar(p) {
173
  cached_showagain_tab.slideDown(settings.animate_speed_show);
174
  return false;
175
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
  function closeOnScroll() {
178
  if (window.pageYOffset > 100 && !Cookie.read(ACCEPT_COOKIE_NAME)) {
1
  function cli_show_cookiebar(p) {
2
+ /* plugin version 1.5.4 */
3
  var Cookie = {
4
  set: function(name,value,days) {
5
  if (days) {
42
  }
43
  var settings = JSON.parse(json_payload);
44
 
45
+
46
  var cached_header = jQuery(settings.notify_div_id),
47
  cached_showagain_tab = jQuery(settings.showagain_div_id),
48
  btn_accept = jQuery('#cookie_hdr_accept'),
144
  jQuery(this).css('background-color', settings.button_2_button_colour);
145
  });
146
  }
147
+
148
+
149
+ var main_link = jQuery('#cookie_action_close_header_reject');
150
+ main_link.css( 'color', settings.button_3_link_colour );
151
+
152
+ if ( settings.button_3_as_button ) {
153
+ main_link.css('background-color', settings.button_3_button_colour);
154
+
155
+ main_link.hover(function() {
156
+ jQuery(this).css('background-color', settings.button_3_button_hover);
157
+ },
158
+ function() {
159
+ jQuery(this).css('background-color', settings.button_3_button_colour);
160
+ });
161
+ }
162
 
163
+
164
  cached_showagain_tab.click(function(e) {
165
  e.preventDefault();
166
  cached_showagain_tab.slideUp(settings.animate_speed_hide, function slideShow() {
177
  e.preventDefault();
178
  accept_close();
179
  });
180
+
181
+ jQuery("#cookie_action_close_header_reject").click(function(e) {
182
+ e.preventDefault();
183
+ reject_close();
184
+ });
185
 
186
  function accept_close() {
187
  Cookie.set(ACCEPT_COOKIE_NAME, 'yes', ACCEPT_COOKIE_EXPIRE);
195
  cached_showagain_tab.slideDown(settings.animate_speed_show);
196
  return false;
197
  }
198
+
199
+ function reject_close() {
200
+
201
+ for(var k in Cli_Data.nn_cookie_ids) {
202
+ Cookie.erase(Cli_Data.nn_cookie_ids[k]);
203
+ }
204
+
205
+ Cookie.set(ACCEPT_COOKIE_NAME, 'no', ACCEPT_COOKIE_EXPIRE);
206
+
207
+ if (settings.notify_animate_hide) {
208
+ cached_header.slideUp(settings.animate_speed_hide);
209
+ }
210
+ else {
211
+ cached_header.hide();
212
+ }
213
+ cached_showagain_tab.slideDown(settings.animate_speed_show);
214
+ return false;
215
+ }
216
 
217
  function closeOnScroll() {
218
  if (window.pageYOffset > 100 && !Cookie.read(ACCEPT_COOKIE_NAME)) {
php/custom-post-types.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  ===============================================================================
4
 
5
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
@@ -75,8 +75,11 @@ function cookielawinfo_register_custom_post_type() {
75
  - Cookie Duration (e.g. 2 hours, days, years, etc)
76
  */
77
  function cookielawinfo_custom_posts_admin_init() {
 
 
78
  add_meta_box("_cli_cookie_type", "Cookie Type", "cookielawinfo_cookie_type", "cookielawinfo", "side", "default");
79
  add_meta_box("_cli_cookie_duration", "Cookie Duration", "cookielawinfo_cookie_duration", "cookielawinfo", "side", "default");
 
80
  }
81
 
82
 
@@ -86,7 +89,7 @@ function cookielawinfo_cookie_type() {
86
  $custom = get_post_custom( $post->ID );
87
  $cookie_type = ( isset ( $custom["_cli_cookie_type"][0] ) ) ? $custom["_cli_cookie_type"][0] : '';
88
  ?>
89
- <label>Cookie Type:</label>
90
  <input name="_cli_cookie_type" value="<?php echo sanitize_text_field( $cookie_type ); ?>" style="width:95%;" />
91
  <?php
92
  }
@@ -103,17 +106,43 @@ function cookielawinfo_cookie_duration() {
103
  <?php
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
106
 
 
 
 
 
 
 
 
 
 
 
107
  /** Saves all form data from custom post meta boxes, including saitisation of input */
108
  function cookielawinfo_save_custom_metaboxes() {
109
  global $post;
110
 
111
  if ( isset ( $_POST["_cli_cookie_type"] ) ) {
112
  update_post_meta( $post->ID, "_cli_cookie_type", sanitize_text_field( $_POST["_cli_cookie_type"] ) );
113
- }
114
- if ( isset ( $_POST["_cli_cookie_type"] ) ) {
115
  update_post_meta( $post->ID, "_cli_cookie_duration", sanitize_text_field( $_POST["_cli_cookie_duration"] ) );
116
  }
 
 
 
 
 
 
117
  }
118
 
119
 
@@ -124,7 +153,9 @@ function cookielawinfo_edit_columns( $columns ) {
124
  "title" => "Cookie Name",
125
  "type" => "Type",
126
  "duration" => "Duration",
127
- "description" => "Description"
 
 
128
  );
129
  return $columns;
130
  }
@@ -150,7 +181,20 @@ function cookielawinfo_custom_columns( $column ) {
150
  echo $custom["_cli_cookie_duration"][0];
151
  }
152
  break;
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
 
154
  }
155
 
156
  ?>
2
  /*
3
  ===============================================================================
4
 
5
+ Copyright 2018 Markwt
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
75
  - Cookie Duration (e.g. 2 hours, days, years, etc)
76
  */
77
  function cookielawinfo_custom_posts_admin_init() {
78
+
79
+ add_meta_box("_cli_cookie_slugid", "Cookie ID", "cookielawinfo_cookie_slugid", "cookielawinfo", "side", "default");
80
  add_meta_box("_cli_cookie_type", "Cookie Type", "cookielawinfo_cookie_type", "cookielawinfo", "side", "default");
81
  add_meta_box("_cli_cookie_duration", "Cookie Duration", "cookielawinfo_cookie_duration", "cookielawinfo", "side", "default");
82
+ add_meta_box("_cli_cookie_sensitivity", "Cookie Sensitivity", "cookielawinfo_cookie_sensitivity", "cookielawinfo", "side", "default");
83
  }
84
 
85
 
89
  $custom = get_post_custom( $post->ID );
90
  $cookie_type = ( isset ( $custom["_cli_cookie_type"][0] ) ) ? $custom["_cli_cookie_type"][0] : '';
91
  ?>
92
+ <label>Cookie Type: (persistent, session, third party )</label>
93
  <input name="_cli_cookie_type" value="<?php echo sanitize_text_field( $cookie_type ); ?>" style="width:95%;" />
94
  <?php
95
  }
106
  <?php
107
  }
108
 
109
+ /** Display the custom meta box for cookie_sensitivity */
110
+ function cookielawinfo_cookie_sensitivity() {
111
+ global $post;
112
+ $custom = get_post_custom( $post->ID );
113
+ $cookie_sensitivity = ( isset ( $custom["_cli_cookie_sensitivity"][0] ) ) ? $custom["_cli_cookie_sensitivity"][0] : '';
114
+ ?>
115
+ <label>Cookie Sensitivity: ( necessary , non-necessary )</label>
116
+ <input name="_cli_cookie_sensitivity" value="<?php echo sanitize_text_field( $cookie_sensitivity ); ?>" style="width:95%;" />
117
+ <?php
118
+ }
119
 
120
+ /** Display the custom meta box for cookie_slugid */
121
+ function cookielawinfo_cookie_slugid() {
122
+ global $post;
123
+ $custom = get_post_custom( $post->ID );
124
+ $cookie_slugid = ( isset ( $custom["_cli_cookie_slugid"][0] ) ) ? $custom["_cli_cookie_slugid"][0] : '';
125
+ ?>
126
+ <label>Cookie ID:</label>
127
+ <input name="_cli_cookie_slugid" value="<?php echo sanitize_text_field( $cookie_slugid ); ?>" style="width:95%;" />
128
+ <?php
129
+ }
130
  /** Saves all form data from custom post meta boxes, including saitisation of input */
131
  function cookielawinfo_save_custom_metaboxes() {
132
  global $post;
133
 
134
  if ( isset ( $_POST["_cli_cookie_type"] ) ) {
135
  update_post_meta( $post->ID, "_cli_cookie_type", sanitize_text_field( $_POST["_cli_cookie_type"] ) );
136
+ }
137
+ if ( isset ( $_POST["_cli_cookie_type"] ) ) {
138
  update_post_meta( $post->ID, "_cli_cookie_duration", sanitize_text_field( $_POST["_cli_cookie_duration"] ) );
139
  }
140
+ if ( isset ( $_POST["_cli_cookie_sensitivity"] ) ) {
141
+ update_post_meta( $post->ID, "_cli_cookie_sensitivity", sanitize_text_field( $_POST["_cli_cookie_sensitivity"] ) );
142
+ }
143
+ if ( isset ( $_POST["_cli_cookie_slugid"] ) ) {
144
+ update_post_meta( $post->ID, "_cli_cookie_slugid", sanitize_text_field( $_POST["_cli_cookie_slugid"] ) );
145
+ }
146
  }
147
 
148
 
153
  "title" => "Cookie Name",
154
  "type" => "Type",
155
  "duration" => "Duration",
156
+ "sensitivity" => "Sensitivity",
157
+ "slugid" => "ID",
158
+ "description" => "Description"
159
  );
160
  return $columns;
161
  }
181
  echo $custom["_cli_cookie_duration"][0];
182
  }
183
  break;
184
+ case "sensitivity":
185
+ $custom = get_post_custom();
186
+ if ( isset ( $custom["_cli_cookie_sensitivity"][0] ) ) {
187
+ echo $custom["_cli_cookie_sensitivity"][0];
188
+ }
189
+ break;
190
+ case "slugid":
191
+ $custom = get_post_custom();
192
+ if ( isset ( $custom["_cli_cookie_slugid"][0] ) ) {
193
+ echo $custom["_cli_cookie_slugid"][0];
194
+ }
195
+ break;
196
  }
197
+
198
  }
199
 
200
  ?>
php/functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License, version 2, as
@@ -44,6 +44,10 @@ function cookielawinfo_get_json_settings() {
44
  'button_2_button_hover' => (cookielawinfo_su_hex_shift( $settings['button_2_button_colour'], 'down', 20 )),
45
  'button_2_link_colour' => $settings['button_2_link_colour'],
46
  'button_2_as_button' => $settings['button_2_as_button'],
 
 
 
 
47
  'font_family' => $settings['font_family'],
48
  'header_fix' => $settings['header_fix'],
49
  'notify_animate_hide' => $settings['notify_animate_hide'],
@@ -127,17 +131,54 @@ function cookielawinfo_enqueue_frontend_scripts() {
127
  /**
128
  * Force reload
129
  */
130
- $version = '1.5.3';
131
 
132
  wp_register_style( 'cookielawinfo-style', CLI_PLUGIN_URL . 'css/cli-style.css', null, $version );
133
  wp_enqueue_style( 'cookielawinfo-style' );
134
 
 
 
 
 
 
135
  wp_enqueue_script( 'cookie-law-info-script', CLI_PLUGIN_URL . 'js/cookielawinfo.js', array( 'jquery' ), $version );
 
136
  }
137
  wp_register_style( 'cookielawinfo-table-style', CLI_PLUGIN_URL . 'css/cli-tables.css', null, $version );
138
  }
139
 
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  /**
142
  * Color shift a hex value by a specific percentage factor
143
  * By http://www.phpkode.com/source/s/shortcodes-ultimate/shortcodes-ultimate/lib/color.php
1
  <?php
2
  /*
3
+ Copyright 2018 Markwt
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License, version 2, as
44
  'button_2_button_hover' => (cookielawinfo_su_hex_shift( $settings['button_2_button_colour'], 'down', 20 )),
45
  'button_2_link_colour' => $settings['button_2_link_colour'],
46
  'button_2_as_button' => $settings['button_2_as_button'],
47
+ 'button_3_button_colour' => $settings['button_3_button_colour'],
48
+ 'button_3_button_hover' => (cookielawinfo_su_hex_shift( $settings['button_3_button_colour'], 'down', 20 )),
49
+ 'button_3_link_colour' => $settings['button_3_link_colour'],
50
+ 'button_3_as_button' => $settings['button_3_as_button'],
51
  'font_family' => $settings['font_family'],
52
  'header_fix' => $settings['header_fix'],
53
  'notify_animate_hide' => $settings['notify_animate_hide'],
131
  /**
132
  * Force reload
133
  */
134
+ $version = '1.5.4';
135
 
136
  wp_register_style( 'cookielawinfo-style', CLI_PLUGIN_URL . 'css/cli-style.css', null, $version );
137
  wp_enqueue_style( 'cookielawinfo-style' );
138
 
139
+ $non_necessary_cookie_ids = get_non_necessary_cookie_ids();
140
+
141
+ $cli_cookie_datas = array(
142
+ 'nn_cookie_ids' => $non_necessary_cookie_ids,
143
+ );
144
  wp_enqueue_script( 'cookie-law-info-script', CLI_PLUGIN_URL . 'js/cookielawinfo.js', array( 'jquery' ), $version );
145
+ wp_localize_script( 'cookie-law-info-script', 'Cli_Data', $cli_cookie_datas );
146
  }
147
  wp_register_style( 'cookielawinfo-table-style', CLI_PLUGIN_URL . 'css/cli-tables.css', null, $version );
148
  }
149
 
150
 
151
+ function get_non_necessary_cookie_ids(){
152
+ global $wpdb;
153
+
154
+ $args = array(
155
+ 'post_type' => 'cookielawinfo',
156
+ 'meta_query' => array(
157
+ array(
158
+ 'key' => '_cli_cookie_sensitivity',
159
+ 'value' => 'non-necessary'
160
+ )
161
+ )
162
+
163
+ );
164
+ $cookies = new WP_Query( $args );
165
+
166
+ if ( !$cookies->have_posts() ) {
167
+ return;
168
+ }
169
+ $cookie_slugs = array();
170
+
171
+ while($cookies->have_posts()):
172
+
173
+ $cookies->the_post();
174
+ global $post;
175
+ $cookie_slugs[] = get_post_meta( $post->ID, "_cli_cookie_slugid", true);
176
+
177
+ endwhile;
178
+
179
+ return $cookie_slugs;
180
+ }
181
+
182
  /**
183
  * Color shift a hex value by a specific percentage factor
184
  * By http://www.phpkode.com/source/s/shortcodes-ultimate/shortcodes-ultimate/lib/color.php
php/shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  ===============================================================================
4
 
5
- Copyright 2012 Richard Ashby (email : wordpress@mediacreek.com)
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
@@ -125,6 +125,22 @@ function cookielawinfo_shortcode_accept_button( $atts ) {
125
  return '<a href="#" id="cookie_action_close_header" class="medium cli-plugin-button ' . $colour . '">' . stripslashes( $settings['button_1_text'] ) . '</a>';
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  /** Returns HTML for a generic button */
130
  function cookielawinfo_shortcode_more_link( $atts ) {
@@ -138,13 +154,22 @@ function cookielawinfo_shortcode_main_button( $atts ) {
138
  'button_1_text' => 'Accept',
139
  'button_1_url' => '#',
140
  'button_1_action' => '#cookie_action_close_header',
141
-
142
  'button_1_link_colour' => '#fff',
143
  'button_1_new_win' => false,
144
  'button_1_as_button' => true,
145
  'button_1_button_colour' => '0f0',
146
- 'button_1_button_size' => 'medium'
147
- );
 
 
 
 
 
 
 
 
 
 
148
  $settings = wp_parse_args( cookielawinfo_get_admin_settings(), $defaults );
149
 
150
  $class = '';
@@ -157,10 +182,29 @@ function cookielawinfo_shortcode_main_button( $atts ) {
157
 
158
  // If is action not URL then don't use URL!
159
  $url = ( $settings['button_1_action'] == "CONSTANT_OPEN_URL" ) ? $settings['button_1_url'] : "#";
 
160
 
161
  $link_tag = '<a href="' . $url . '" id="' . cookielawinfo_remove_hash ( $settings['button_1_action'] ) . '" ';
162
  $link_tag .= ( $settings['button_1_new_win'] ) ? 'target="_blank" ' : '' ;
163
  $link_tag .= $class . ' >' . stripslashes( $settings['button_1_text'] ) . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
165
  return $link_tag;
166
  }
2
  /*
3
  ===============================================================================
4
 
5
+ Copyright 2018 Markwt
6
 
7
  This program is free software; you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License, version 2, as
125
  return '<a href="#" id="cookie_action_close_header" class="medium cli-plugin-button ' . $colour . '">' . stripslashes( $settings['button_1_text'] ) . '</a>';
126
  }
127
 
128
+ /** Returns HTML for a standard (green, medium sized) 'Accept' button */
129
+ function cookielawinfo_shortcode_reject_button( $atts ) {
130
+ extract( shortcode_atts( array(
131
+ 'colour' => 'green'
132
+ ), $atts ) );
133
+
134
+ // Fixing button translate text bug
135
+ // 18/05/2015 by RA
136
+ $defaults = array(
137
+ 'button_3_text' => 'Reject'
138
+ );
139
+ $settings = wp_parse_args( cookielawinfo_get_admin_settings(), $defaults );
140
+
141
+ return '<a href="#" id="cookie_action_close_header_reject" class="medium cli-plugin-button ' . $colour . '">' . stripslashes( $settings['button_3_text'] ) . '</a>';
142
+ }
143
+
144
 
145
  /** Returns HTML for a generic button */
146
  function cookielawinfo_shortcode_more_link( $atts ) {
154
  'button_1_text' => 'Accept',
155
  'button_1_url' => '#',
156
  'button_1_action' => '#cookie_action_close_header',
 
157
  'button_1_link_colour' => '#fff',
158
  'button_1_new_win' => false,
159
  'button_1_as_button' => true,
160
  'button_1_button_colour' => '0f0',
161
+ 'button_1_button_size' => 'medium',
162
+
163
+ 'button_3_text' => 'Reject',
164
+ 'button_3_url' => '#',
165
+ 'button_3_action' => '#cookie_action_close_header_reject',
166
+ 'button_3_link_colour' => '#fff',
167
+ 'button_3_new_win' => false,
168
+ 'button_3_as_button' => true,
169
+ 'button_3_button_colour' => '#000',
170
+ 'button_3_button_size' => 'medium',
171
+ );
172
+ //echo '<pre>'; print_r(cookielawinfo_get_admin_settings());exit;
173
  $settings = wp_parse_args( cookielawinfo_get_admin_settings(), $defaults );
174
 
175
  $class = '';
182
 
183
  // If is action not URL then don't use URL!
184
  $url = ( $settings['button_1_action'] == "CONSTANT_OPEN_URL" ) ? $settings['button_1_url'] : "#";
185
+
186
 
187
  $link_tag = '<a href="' . $url . '" id="' . cookielawinfo_remove_hash ( $settings['button_1_action'] ) . '" ';
188
  $link_tag .= ( $settings['button_1_new_win'] ) ? 'target="_blank" ' : '' ;
189
  $link_tag .= $class . ' >' . stripslashes( $settings['button_1_text'] ) . '</a>';
190
+
191
+ // introduced reject on or off
192
+ if($settings['is_reject_on'] ){
193
+
194
+ $classr = '';
195
+ if ( $settings['button_3_as_button'] ) {
196
+ $classr .= ' class="' . $settings['button_3_button_size'] . ' cli-plugin-button cli-plugin-main-button"';
197
+ }
198
+ else {
199
+ $classr .= ' class="cli-plugin-main-button" ' ;
200
+ }
201
+
202
+ $url_reject = ( $settings['button_3_action'] == "CONSTANT_OPEN_URL" ) ? $settings['button_3_url'] : "#";
203
+
204
+ $link_tag .= '<a href="' . $url_reject . '" id="' . cookielawinfo_remove_hash ( $settings['button_3_action'] ) . '" ';
205
+ $link_tag .= ( $settings['button_3_new_win'] ) ? 'target="_blank" ' : '' ;
206
+ $link_tag .= $classr . ' >' . stripslashes( $settings['button_3_text'] ) . '</a>';
207
+ }
208
 
209
  return $link_tag;
210
  }
readme.txt CHANGED
@@ -1,18 +1,27 @@
1
- === Cookie Law Info ===
2
  Contributors: markwt
3
  Donate link: http://cookielawinfo.com/donate
4
- Tags: eu cookie law, cookie law, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
- Tested up to: 4.9.5
7
- Stable tag: 1.5.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- A simple way to show how your website complies with the EU Cookie Law. Implied Consent. Style it to match your own website.
12
 
13
  == Description ==
14
 
15
- This plugin uses implied consent, adding a subtle banner to your website either in the header or footer so you can show your compliance status regarding the new EU Cookie Law.
 
 
 
 
 
 
 
 
 
16
 
17
 
18
  You can fully customise the style so it fits in with your existing website- change the colours, fonts, styles, the position on the page and even how it behaves when you click "accept".
@@ -141,6 +150,10 @@ See http://cookielawinfo.com for more information on what is required.
141
 
142
  == Changelog ==
143
 
 
 
 
 
144
  = 1.5.3 =
145
  * Bug fix: Buttons now handle apostrophes correctly
146
  * Bug fix: Added <tr> to table head for [cookie_audit] table for W3 Validator (thanks to davidebabylonia for finding and suggesting the solution)
@@ -225,11 +238,6 @@ See http://cookielawinfo.com for more information on what is required.
225
 
226
  == Upgrade Notice ==
227
 
228
- = 1.2 =
229
- Performance and compatibility upgrade
230
-
231
- = 1.1.2 =
232
- Bugfix: namespaced function to cookielawinfo_enqueue_color_picker()
233
-
234
- = 1.1 =
235
- Major upgrade with several new features including auto-hide cookie bar after (configurable) delay, responsive design plus some bug fixes and performance enhancements.
1
+ === Cookie Law / GDPR Info ===
2
  Contributors: markwt
3
  Donate link: http://cookielawinfo.com/donate
4
+ Tags: eu cookie law, GDPR, cookie law, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
+ Tested up to: 4.9.6
7
+ Stable tag: 1.5.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ A simple way to show how your website complies with the EU Cookie Law / GDPR. Style it to match your own website.
12
 
13
  == Description ==
14
 
15
+ NOTE: INSTALLING THIS PLUGIN ALONE DOESNT MAKE YOUR SITE GDPR COMPLIANT. SINCE EACH SITE USES DIFFERENT COOKIES, YOU MAY NEED TO BUILD OPT IN/OUT CAPABILITY TO HANDLE YOUR SITE SPECIFIC NEEDS.
16
+
17
+ Our plugin will help you to become GDPR compliant with following features.
18
+
19
+ - Plugin will show a notice with Accept and Reject options. By default the cookie value will be set to 'null'. If the user clicks 'Accept' button the value with be changed to 'yes'. IF the user clicks on 'Reject' the value will be set to 'no'. Your developer can check this value to set a cookie
20
+
21
+ - Admin can add cookie details from the backend. The list of cookies can be displayed in your cookie policy page by using a short code
22
+
23
+
24
+ This plugin adds a subtle banner to your website either in the header or footer so you can show your compliance status regarding the new EU Cookie Law.
25
 
26
 
27
  You can fully customise the style so it fits in with your existing website- change the colours, fonts, styles, the position on the page and even how it behaves when you click "accept".
150
 
151
  == Changelog ==
152
 
153
+ = 1.5.4 =
154
+ * Tested OK with WordPress 4.9.5
155
+ * GDPR compliance updates.
156
+
157
  = 1.5.3 =
158
  * Bug fix: Buttons now handle apostrophes correctly
159
  * Bug fix: Added <tr> to table head for [cookie_audit] table for W3 Validator (thanks to davidebabylonia for finding and suggesting the solution)
238
 
239
  == Upgrade Notice ==
240
 
241
+ = 1.5.4 =
242
+ * Tested OK with WordPress 4.9.6
243
+ * GDPR compliance updates.
 
 
 
 
 
wpml-config.xml CHANGED
@@ -6,6 +6,8 @@
6
  <key name="button_1_url" />
7
  <key name="button_2_text" />
8
  <key name="button_2_url" />
 
 
9
  <key name="showagain_text" />
10
  </key>
11
  </admin-texts>
6
  <key name="button_1_url" />
7
  <key name="button_2_text" />
8
  <key name="button_2_url" />
9
+ <key name="button_3_text" />
10
+ <key name="button_3_url" />
11
  <key name="showagain_text" />
12
  </key>
13
  </admin-texts>