Cookie Law / GDPR Info - Version 1.7.9

Version Description

  • Fixed W3C Validation issues
  • [Bug fix] Hide non-necessary category on cookie settings popup if it is not enabled
  • [Bug fix] Translation issue with category cookies
Download this release

Release Info

Developer webtoffee
Plugin Icon Cookie Law / GDPR Info
Version 1.7.9
Comparing to
See all releases

Code changes from version 1.7.8 to 1.7.9

admin/js/cookie-law-info-admin.js CHANGED
@@ -73,32 +73,6 @@
73
  var elm=$(this).children('li').eq(0);
74
  elm.click();
75
  });
76
- $('.cookie-sensitivity-form').submit(function(e){
77
- e.preventDefault();
78
- var data=$(this).serialize();
79
- var url=$(this).attr('action');
80
- var spinner=$(this).find('.spinner');
81
- var submit_btn=$(this).find('input[type="submit"]');
82
- spinner.css({'visibility':'visible'});
83
- submit_btn.css({'opacity':'.5','cursor':'default'}).prop('disabled',true);
84
- $.ajax({
85
- url:url,
86
- type:'POST',
87
- data:data,
88
- success:function(data)
89
- {
90
- spinner.css({'visibility':'hidden'});
91
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
92
- cli_notify_msg.success(cli_success_message);
93
- },
94
- error:function ()
95
- {
96
- spinner.css({'visibility':'hidden'});
97
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
98
- cli_notify_msg.error(cli_error_message);
99
- }
100
- });
101
- });
102
  $('#cli_settings_form').submit(function(e){
103
  var submit_action=$('#cli_update_action').val();
104
  if(submit_action=='delete_all_settings')
73
  var elm=$(this).children('li').eq(0);
74
  elm.click();
75
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  $('#cli_settings_form').submit(function(e){
77
  var submit_action=$('#cli_update_action').val();
78
  if(submit_action=='delete_all_settings')
cookie-law-info.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: GDPR Cookie Consent
17
  * Plugin URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
18
  * Description: A simple way to show your website complies with the EU Cookie Law / GDPR.
19
- * Version: 1.7.8
20
  * Author: WebToffee
21
  * Author URI: http://cookielawinfo.com/
22
  * License: GPLv3
@@ -63,7 +63,7 @@ define ( 'CLI_POST_TYPE','cookielawinfo');
63
  * Currently plugin version.
64
  * Rename this for your plugin and update it as you release new versions.
65
  */
66
- define( 'CLI_VERSION', '1.7.8' );
67
 
68
 
69
  /**
16
  * Plugin Name: GDPR Cookie Consent
17
  * Plugin URI: https://www.webtoffee.com/product/gdpr-cookie-consent/
18
  * Description: A simple way to show your website complies with the EU Cookie Law / GDPR.
19
+ * Version: 1.7.9
20
  * Author: WebToffee
21
  * Author URI: http://cookielawinfo.com/
22
  * License: GPLv3
63
  * Currently plugin version.
64
  * Rename this for your plugin and update it as you release new versions.
65
  */
66
+ define( 'CLI_VERSION', '1.7.9' );
67
 
68
 
69
  /**
includes/class-cookie-law-info.php CHANGED
@@ -76,7 +76,7 @@ class Cookie_Law_Info {
76
  }
77
  else
78
  {
79
- $this->version = '1.7.8';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
@@ -205,7 +205,7 @@ class Cookie_Law_Info {
205
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
206
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
207
  $this->loader->add_action( 'init', $plugin_public,'register_custom_post_type');
208
-
209
 
210
  $plugin_public->common_modules();
211
 
@@ -551,6 +551,7 @@ class Cookie_Law_Info {
551
  case 'is_GMT_on':
552
  case 'as_popup':
553
  case 'popup_overlay':
 
554
 
555
  if ( $value == 'true' || $value === true )
556
  {
76
  }
77
  else
78
  {
79
+ $this->version = '1.7.9';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
205
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
206
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
207
  $this->loader->add_action( 'init', $plugin_public,'register_custom_post_type');
208
+ $this->loader->add_action( 'template_redirect', $plugin_public,'cli_set_category_cookies');
209
 
210
  $plugin_public->common_modules();
211
 
551
  case 'is_GMT_on':
552
  case 'as_popup':
553
  case 'popup_overlay':
554
+ case 'thirdparty_on_field':
555
 
556
  if ( $value == 'true' || $value === true )
557
  {
public/class-cookie-law-info-public.php CHANGED
@@ -90,10 +90,10 @@ class Cookie_Law_Info_Public {
90
  'privacy_overview_content' => 'This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.','privacy_overview_title' => 'Privacy Overview'
91
  );
92
  $thirdparty_defaults = array(
93
- 'thirdparty_on_field' => false,
94
  'thirdparty_description'=> 'Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.',
95
- 'thirdparty_head_section' => '',
96
- 'thirdparty_body_section' => '',
97
  );
98
  $necessary_defaults = array('necessary_description'=>'Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.'
99
  );
@@ -121,18 +121,30 @@ class Cookie_Law_Info_Public {
121
  *
122
  * @since 1.7.7
123
  */
124
- private function cli_set_category_cookies()
125
  {
126
  $cookie_categories = self::get_cookie_categories();
127
  $the_options = Cookie_Law_Info::get_settings();
 
 
128
  if ( $the_options['is_on'] == true )
129
  {
130
 
131
- foreach ($cookie_categories as $key)
132
- {
133
  if(empty($_COOKIE["cookielawinfo-checkbox-$key"]))
134
  {
135
- @setcookie("cookielawinfo-checkbox-$key",'yes',time()+3600,'/');
 
 
 
 
 
 
 
 
 
 
136
  }
137
  }
138
  }
@@ -288,8 +300,7 @@ class Cookie_Law_Info_Public {
288
  $the_options = Cookie_Law_Info::get_settings();
289
  if ( $the_options['is_on'] == true )
290
  {
291
- $this->cli_set_category_cookies();
292
- // Output the HTML in the footer:
293
  $message =nl2br($the_options['notify_message']);
294
  $str = do_shortcode( stripslashes ( $message ) );
295
  $str = __($str,'cookie-law-info');
@@ -337,14 +348,15 @@ class Cookie_Law_Info_Public {
337
  $the_options = Cookie_Law_Info::get_settings();
338
  if($the_options['is_on'] == true && !is_admin())
339
  {
340
- $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
 
341
  if(!empty($third_party_cookie_options))
342
  {
343
- if($third_party_cookie_options['thirdparty_on_field'] == 'true' && isset($_COOKIE['viewed_cookie_policy']))
344
  {
345
  if($_COOKIE['viewed_cookie_policy']=='yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
346
  {
347
- echo $third_party_cookie_options['thirdparty_head_section'];
348
  }
349
  }
350
  }
@@ -357,10 +369,11 @@ class Cookie_Law_Info_Public {
357
  $the_options = Cookie_Law_Info::get_settings();
358
  if($the_options['is_on'] == true && !is_admin())
359
  {
360
- $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
 
361
  if(!empty($third_party_cookie_options))
362
- {
363
- if($third_party_cookie_options['thirdparty_on_field'] == 'true' && isset($_COOKIE['viewed_cookie_policy']))
364
  {
365
  if($_COOKIE['viewed_cookie_policy'] == 'yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
366
  {
90
  'privacy_overview_content' => 'This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.','privacy_overview_title' => 'Privacy Overview'
91
  );
92
  $thirdparty_defaults = array(
93
+ 'thirdparty_on_field' => true,
94
  'thirdparty_description'=> 'Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.',
95
+ 'thirdparty_head_section' => '',
96
+ 'thirdparty_body_section' => '',
97
  );
98
  $necessary_defaults = array('necessary_description'=>'Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.'
99
  );
121
  *
122
  * @since 1.7.7
123
  */
124
+ public function cli_set_category_cookies()
125
  {
126
  $cookie_categories = self::get_cookie_categories();
127
  $the_options = Cookie_Law_Info::get_settings();
128
+ $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
129
+ $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$third_party_cookie_options['thirdparty_on_field']);
130
  if ( $the_options['is_on'] == true )
131
  {
132
 
133
+ foreach ($cookie_categories as $key => $value)
134
+ {
135
  if(empty($_COOKIE["cookielawinfo-checkbox-$key"]))
136
  {
137
+ if($key === 'non-necessary' && $wt_cli_is_thirdparty_enabled == false) {
138
+
139
+ return false;
140
+
141
+ }
142
+ else {
143
+
144
+ @setcookie("cookielawinfo-checkbox-$key",'yes',time()+3600,'/');
145
+
146
+ }
147
+
148
  }
149
  }
150
  }
300
  $the_options = Cookie_Law_Info::get_settings();
301
  if ( $the_options['is_on'] == true )
302
  {
303
+ // Output the HTML in the footer:
 
304
  $message =nl2br($the_options['notify_message']);
305
  $str = do_shortcode( stripslashes ( $message ) );
306
  $str = __($str,'cookie-law-info');
348
  $the_options = Cookie_Law_Info::get_settings();
349
  if($the_options['is_on'] == true && !is_admin())
350
  {
351
+ $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
352
+ $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$third_party_cookie_options['thirdparty_on_field']);
353
  if(!empty($third_party_cookie_options))
354
  {
355
+ if($wt_cli_is_thirdparty_enabled == true && isset($_COOKIE['viewed_cookie_policy']))
356
  {
357
  if($_COOKIE['viewed_cookie_policy']=='yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
358
  {
359
+ echo $third_party_cookie_options['thirdparty_head_section'];
360
  }
361
  }
362
  }
369
  $the_options = Cookie_Law_Info::get_settings();
370
  if($the_options['is_on'] == true && !is_admin())
371
  {
372
+ $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
373
+ $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$third_party_cookie_options['thirdparty_on_field']);
374
  if(!empty($third_party_cookie_options))
375
+ {
376
+ if($wt_cli_is_thirdparty_enabled == true && isset($_COOKIE['viewed_cookie_policy']))
377
  {
378
  if($_COOKIE['viewed_cookie_policy'] == 'yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
379
  {
public/css/cookie-law-info-gdpr.css CHANGED
@@ -709,7 +709,7 @@ background: #ffffff;
709
  z-index: 99999;
710
  transform: scale(0);
711
  overflow: hidden;
712
- outline: 0
713
  }
714
  .cli-modal a {
715
  text-decoration: none;
@@ -1108,6 +1108,7 @@ span.cli-necessary-caption {
1108
  .cli-modal.cli-blowup {
1109
  z-index: 999999;
1110
  transform: scale(1);
 
1111
  }
1112
  .cli-modal.cli-blowup .cli-modal-dialog {
1113
  animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
709
  z-index: 99999;
710
  transform: scale(0);
711
  overflow: hidden;
712
+ outline: 0;
713
  }
714
  .cli-modal a {
715
  text-decoration: none;
1108
  .cli-modal.cli-blowup {
1109
  z-index: 999999;
1110
  transform: scale(1);
1111
+
1112
  }
1113
  .cli-modal.cli-blowup .cli-modal-dialog {
1114
  animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
public/modules/shortcode/shortcode.php CHANGED
@@ -190,6 +190,11 @@ class Cookie_Law_Info_Shortcode {
190
  'order' => 'ASC',
191
  'orderby' => 'title'
192
  );
 
 
 
 
 
193
  $posts = get_posts($args);
194
  $ret = '<table class="cookielawinfo-row-cat-table cookielawinfo-' . $style . '"><thead><tr>';
195
  if(in_array('cookie',$columns))
190
  'order' => 'ASC',
191
  'orderby' => 'title'
192
  );
193
+ global $sitepress;
194
+ if(function_exists('icl_object_id') && $sitepress) //wpml enabled
195
+ {
196
+ $args['suppress_filters']=false;
197
+ }
198
  $posts = get_posts($args);
199
  $ret = '<table class="cookielawinfo-row-cat-table cookielawinfo-' . $style . '"><thead><tr>';
200
  if(in_array('cookie',$columns))
public/views/cookie-law-info_bar.php CHANGED
@@ -13,7 +13,7 @@ if(file_exists($pop_content_html_file))
13
  include $pop_content_html_file;
14
  }
15
  ?>
16
- <div class="cli-modal" id="cliSettingsPopup" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
17
  <div class="cli-modal-dialog" role="document">
18
  <div class="cli-modal-content cli-bar-popup">
19
  <button type="button" class="cli-modal-close" id="cliModalClose">
13
  include $pop_content_html_file;
14
  }
15
  ?>
16
+ <div class="cli-modal" id="cliSettingsPopup" tabindex="-1" role="dialog" aria-labelledby="cliSettingsPopup" aria-hidden="true">
17
  <div class="cli-modal-dialog" role="document">
18
  <div class="cli-modal-content cli-bar-popup">
19
  <button type="button" class="cli-modal-close" id="cliModalClose">
public/views/cookie-law-info_popup_content.php CHANGED
@@ -18,8 +18,11 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
18
  $privacy_overview_content=nl2br($privacy_overview_content);
19
  $privacy_overview_content = do_shortcode(stripslashes($privacy_overview_content));
20
  $content_length=strlen(strip_tags($privacy_overview_content));
21
- ?>
22
- <h4><?php echo $overview_title; ?></h4>
 
 
 
23
  <div class="cli-privacy-content">
24
  <p class="cli-privacy-content-text"><?php echo $privacy_overview_content;?></p>
25
  </div>
@@ -71,21 +74,30 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
71
  </div>';
72
  $cli_cat_content=$third_party_cookie_options['thirdparty_description'];
73
  }
74
- ?>
 
 
 
 
 
 
 
 
 
75
  <div class="cli-tab-section">
76
- <div class="cli-tab-header">
77
- <a class="cli-nav-link cli-settings-mobile" data-target="<?php echo $key; ?>" data-toggle="cli-toggle-tab" >
78
- <?php echo $value ?>
79
- </a>
80
- <?php echo $cli_switch; ?>
81
- </div>
82
- <div class="cli-tab-content">
83
- <div class="cli-tab-pane cli-fade" data-id="<?php echo $key; ?>">
84
- <p><?php echo do_shortcode($cli_cat_content, 'cookielawinfo-category' ); ?></p>
 
85
  </div>
86
  </div>
87
- </div>
88
- <?php } ?>
89
 
90
  </div>
91
  </div>
18
  $privacy_overview_content=nl2br($privacy_overview_content);
19
  $privacy_overview_content = do_shortcode(stripslashes($privacy_overview_content));
20
  $content_length=strlen(strip_tags($privacy_overview_content));
21
+ $overview_title = trim($overview_title);
22
+ if(isset($overview_title) === true && $overview_title !== '') {
23
+ echo "<h4>".$overview_title."</h4>";
24
+ }
25
+ ?>
26
  <div class="cli-privacy-content">
27
  <p class="cli-privacy-content-text"><?php echo $privacy_overview_content;?></p>
28
  </div>
74
  </div>';
75
  $cli_cat_content=$third_party_cookie_options['thirdparty_description'];
76
  }
77
+ ?>
78
+
79
+ <?php
80
+ $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$third_party_cookie_options['thirdparty_on_field']);
81
+ if($key === "non-necessary" && $wt_cli_is_thirdparty_enabled == false)
82
+ {
83
+ echo '';
84
+ }
85
+ else
86
+ {?>
87
  <div class="cli-tab-section">
88
+ <div class="cli-tab-header">
89
+ <a class="cli-nav-link cli-settings-mobile" data-target="<?php echo $key; ?>" data-toggle="cli-toggle-tab" >
90
+ <?php echo $value ?>
91
+ </a>
92
+ <?php echo $cli_switch; ?>
93
+ </div>
94
+ <div class="cli-tab-content">
95
+ <div class="cli-tab-pane cli-fade" data-id="<?php echo $key; ?>">
96
+ <p><?php echo do_shortcode($cli_cat_content, 'cookielawinfo-category' ); ?></p>
97
+ </div>
98
  </div>
99
  </div>
100
+ <?php } } ?>
 
101
 
102
  </div>
103
  </div>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
4
  Tags: eu cookie law, GDPR, cookie law, cookie consent, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
  Tested up to: 5.2
7
- Stable tag: 1.7.8
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -172,6 +172,12 @@ See http://cookielawinfo.com for more information on what is required.
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
175
  = 1.7.8 =
176
 
177
  * Fixed issues with translations
@@ -389,8 +395,8 @@ See http://cookielawinfo.com for more information on what is required.
389
 
390
  == Upgrade Notice ==
391
 
392
- = 1.7.8 =
393
 
394
- * Fixed issues with translations
395
- * [user_consent_state] added missing space in user consent states
396
- * Fixed issues with web accessibility
4
  Tags: eu cookie law, GDPR, cookie law, cookie consent, eu privacy directive, privacy directive, cookies, privacy, compliance
5
  Requires at least: 3.3.1
6
  Tested up to: 5.2
7
+ Stable tag: 1.7.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
172
 
173
  == Changelog ==
174
 
175
+ = 1.7.9 =
176
+
177
+ * Fixed W3C Validation issues
178
+ * [Bug fix] Hide non-necessary category on cookie settings popup if it is not enabled
179
+ * [Bug fix] Translation issue with category cookies
180
+
181
  = 1.7.8 =
182
 
183
  * Fixed issues with translations
395
 
396
  == Upgrade Notice ==
397
 
398
+ = 1.7.9 =
399
 
400
+ * Fixed W3C validation issues
401
+ * [Bug fix] Hide non-necessary category on cookie settings popup if it is not enabled
402
+ * [Bug fix] Translation issue with category cookies