Cookie Law / GDPR Info - Version 1.8.4

Version Description

  • Defaulted privacy overview heading tag to H4
  • Introduced 'wt_cli_change_privacy_overview_title_tag' filter to change privacy overview heading tag
  • Introduced 'wt_cli_add_custom_cookie_categories_name' filter to change cookie category names
Download this release

Release Info

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

Code changes from version 1.8.2 to 1.8.4

Files changed (36) hide show
  1. admin/class-cookie-law-info-admin.php +21 -23
  2. admin/modules/cli-policy-generator/assets/js/cli-policy-generator-admin.js +44 -31
  3. admin/modules/cli-policy-generator/classes/class-policy-generator-ajax.php +21 -14
  4. admin/modules/cli-policy-generator/classes/class-preview-page.php +8 -6
  5. admin/modules/cli-policy-generator/cli-policy-generator.php +13 -10
  6. admin/partials/cookie-law-info-privacy_overview.php +10 -12
  7. cookie-law-info.php +2 -2
  8. includes/class-cookie-law-info.php +7 -8
  9. languages/cookie-law-info-bg_BG.mo +0 -0
  10. languages/cookie-law-info-bg_BG.po +0 -0
  11. languages/cookie-law-info-cs_CZ.mo +0 -0
  12. languages/cookie-law-info-cs_CZ.po +0 -0
  13. languages/cookie-law-info-da_DA.mo +0 -0
  14. languages/cookie-law-info-da_DA.po +0 -0
  15. languages/cookie-law-info-da_DK.mo +0 -0
  16. languages/cookie-law-info-da_DK.po +0 -0
  17. languages/cookie-law-info-de_DE.mo +0 -0
  18. languages/cookie-law-info-de_DE.po +0 -0
  19. languages/cookie-law-info-es_ES.mo +0 -0
  20. languages/cookie-law-info-es_ES.po +0 -0
  21. languages/cookie-law-info-fr_FR.mo +0 -0
  22. languages/cookie-law-info-fr_FR.po +0 -0
  23. languages/cookie-law-info-hr.mo +0 -0
  24. languages/cookie-law-info-hr.po +0 -0
  25. languages/cookie-law-info-is_IS.mo +0 -0
  26. languages/cookie-law-info-is_IS.po +0 -0
  27. languages/cookie-law-info-nl_NL.mo +0 -0
  28. languages/cookie-law-info-nl_NL.po +0 -0
  29. languages/cookie-law-info-sl_SL.mo +0 -0
  30. languages/cookie-law-info-sl_SL.po +0 -0
  31. public/class-cookie-law-info-public.php +13 -11
  32. public/css/cookie-law-info-gdpr.css +7 -1
  33. public/modules/shortcode/shortcode.php +19 -15
  34. public/views/cookie-law-info_bar.php +1 -0
  35. public/views/cookie-law-info_popup_content.php +13 -27
  36. readme.txt +16 -3
admin/class-cookie-law-info-admin.php CHANGED
@@ -210,11 +210,14 @@ class Cookie_Law_Info_Admin {
210
  return $links;
211
  }
212
 
213
-
214
  public function admin_non_necessary_cookie_page()
215
  {
216
  wp_enqueue_style($this->plugin_name);
217
- wp_enqueue_script($this->plugin_name);
 
 
 
 
218
  $options = array('thirdparty_on_field',
219
  'third_party_default_state',
220
  'thirdparty_description',
@@ -239,16 +242,13 @@ class Cookie_Law_Info_Admin {
239
  )
240
  {
241
  // Check nonce:
242
- check_admin_referer('cookielawinfo-update-thirdparty');
243
- foreach ($options as $key)
244
- {
245
- if (isset($_POST[$key]))
246
- {
247
- // Store sanitised values only:
248
- $stored_options[$key]=wp_unslash($_POST[$key]);
249
- }
250
- }
251
- update_option('cookielawinfo_thirdparty_settings', $stored_options);
252
  echo '<div class="updated"><p><strong>';
253
  echo __('Settings Updated.','cookie-law-info');
254
  echo '</strong></p></div>';
@@ -272,7 +272,11 @@ class Cookie_Law_Info_Admin {
272
  public function admin_necessary_cookie_page()
273
  {
274
  wp_enqueue_style($this->plugin_name);
275
- wp_enqueue_script($this->plugin_name);
 
 
 
 
276
  $options = array('necessary_description'
277
  );
278
  // Get options:
@@ -286,15 +290,9 @@ class Cookie_Law_Info_Admin {
286
  )
287
  {
288
  // Check nonce:
289
- check_admin_referer('cookielawinfo-update-necessary');
290
- foreach ($options as $key)
291
- {
292
- if (isset($_POST[$key]))
293
- {
294
- // Store sanitised values only:
295
- $stored_options[$key]=wp_unslash($_POST[$key]);
296
- }
297
- }
298
  update_option('cookielawinfo_necessary_settings', $stored_options);
299
  echo '<div class="updated"><p><strong>';
300
  echo __('Settings Updated.','cookie-law-info');
@@ -579,7 +577,7 @@ class Cookie_Law_Info_Admin {
579
 
580
  /** Returns true if user is on latest version of plugin */
581
  public function has_migrated() {
582
- // print_combobox_options
583
  $old_settings = get_option( CLI_ADMIN_OPTIONS_NAME );
584
  if ( empty( $old_settings ) ) {
585
  return true;
210
  return $links;
211
  }
212
 
 
213
  public function admin_non_necessary_cookie_page()
214
  {
215
  wp_enqueue_style($this->plugin_name);
216
+ wp_enqueue_script($this->plugin_name);
217
+ if (!current_user_can('manage_options'))
218
+ {
219
+ wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
220
+ }
221
  $options = array('thirdparty_on_field',
222
  'third_party_default_state',
223
  'thirdparty_description',
242
  )
243
  {
244
  // Check nonce:
245
+ check_admin_referer('cookielawinfo-update-thirdparty');
246
+ $stored_options['thirdparty_on_field'] = (bool)( isset( $_POST['thirdparty_on_field'] ) ? Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$_POST['thirdparty_on_field']) : $stored_options['thirdparty_on_field'] );
247
+ $stored_options['third_party_default_state'] = (bool)( isset( $_POST['third_party_default_state'] ) ? Cookie_Law_Info::sanitise_settings('third_party_default_state',$_POST['third_party_default_state']) : $stored_options['third_party_default_state'] );
248
+ $stored_options['thirdparty_description'] = wp_kses_post( isset( $_POST['thirdparty_description'] ) && $_POST['thirdparty_description'] !== '' ? $_POST['thirdparty_description'] : $stored_options['thirdparty_description'] );
249
+ $stored_options['thirdparty_head_section'] = wp_unslash( isset( $_POST['thirdparty_head_section'] ) && $_POST['thirdparty_head_section'] !== '' ? $_POST['thirdparty_head_section'] : $stored_options['thirdparty_head_section'] );
250
+ $stored_options['thirdparty_body_section'] = wp_unslash( isset( $_POST['thirdparty_body_section'] ) && $_POST['thirdparty_body_section'] !== '' ? $_POST['thirdparty_body_section'] : $stored_options['thirdparty_body_section'] );
251
+ update_option('cookielawinfo_thirdparty_settings', $stored_options);
 
 
 
252
  echo '<div class="updated"><p><strong>';
253
  echo __('Settings Updated.','cookie-law-info');
254
  echo '</strong></p></div>';
272
  public function admin_necessary_cookie_page()
273
  {
274
  wp_enqueue_style($this->plugin_name);
275
+ wp_enqueue_script($this->plugin_name);
276
+ if (!current_user_can('manage_options'))
277
+ {
278
+ wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
279
+ }
280
  $options = array('necessary_description'
281
  );
282
  // Get options:
290
  )
291
  {
292
  // Check nonce:
293
+ check_admin_referer('cookielawinfo-update-necessary');
294
+
295
+ $stored_options['necessary_description'] = wp_kses_post( isset( $_POST['necessary_description'] ) && $_POST['necessary_description'] !== '' ? $_POST['necessary_description'] : $stored_options['necessary_description'] );
 
 
 
 
 
 
296
  update_option('cookielawinfo_necessary_settings', $stored_options);
297
  echo '<div class="updated"><p><strong>';
298
  echo __('Settings Updated.','cookie-law-info');
577
 
578
  /** Returns true if user is on latest version of plugin */
579
  public function has_migrated() {
580
+ // Test for previous version. If doesn't exist then safe to say are fresh install:
581
  $old_settings = get_option( CLI_ADMIN_OPTIONS_NAME );
582
  if ( empty( $old_settings ) ) {
583
  return true;
admin/modules/cli-policy-generator/assets/js/cli-policy-generator-admin.js CHANGED
@@ -7,17 +7,17 @@
7
  cli_pg_lefth_tmr:null,
8
  cli_pg_editormode_tmr:null,
9
  active_elm:null,
10
- autosave_interval:2000,
11
  onPrg:false,
12
  Set:function()
13
  {
14
  this.leftBoxHeight();
15
  this.tabView();
16
  this.regAddNew();
 
17
  setTimeout(function(){
18
  CLI_pg.editOnChange();
19
  },1000);
20
- this.regAutoSaveForPreview();
21
  this.regSaveData();
22
  this.refreshCurrentPolicyPageId();
23
  },
@@ -121,36 +121,49 @@
121
  });
122
  },
123
  regAutoSaveForPreview:function()
124
- {
125
- var content_data=this.genContentData();
126
-
127
- var data = {
128
- action: 'cli_policy_generator',
129
- security: cli_policy_generator.nonces.cli_policy_generator,
130
- cli_policy_generator_action:'autosave_contant_data',
131
- content_data:content_data,
132
- page_id:cli_policy_generator.page_id,
133
- enable_webtofee_powered_by:($('[name="enable_webtofee_powered_by"]').is(':checked') ? 1 : 0)
134
- };
135
- $.ajax({
136
- url: cli_policy_generator.ajax_url,
137
- data: data,
138
- datatype:'json',
139
- type: 'POST',
140
- success:function(data)
141
- {
142
- setTimeout(function(){
143
- CLI_pg.regAutoSaveForPreview();
144
- },CLI_pg.autosave_interval);
145
- },
146
- error:function()
147
- {
148
- setTimeout(function(){
149
- CLI_pg.regAutoSaveForPreview();
150
- },CLI_pg.autosave_interval);
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  });
153
-
154
  },
155
  editOnChange:function()
156
  {
7
  cli_pg_lefth_tmr:null,
8
  cli_pg_editormode_tmr:null,
9
  active_elm:null,
10
+ autosave_interval:10000,
11
  onPrg:false,
12
  Set:function()
13
  {
14
  this.leftBoxHeight();
15
  this.tabView();
16
  this.regAddNew();
17
+ this.regAutoSaveForPreview();
18
  setTimeout(function(){
19
  CLI_pg.editOnChange();
20
  },1000);
 
21
  this.regSaveData();
22
  this.refreshCurrentPolicyPageId();
23
  },
121
  });
122
  },
123
  regAutoSaveForPreview:function()
124
+ {
125
+ $('[name="cli_pg_live_preview"]').on('click',function(event){
126
+ event.preventDefault();
127
+ if(CLI_pg.onPrg)
128
+ {
129
+ return false;
130
+ }
131
+ var content_data=CLI_pg.genContentData();
132
+ var preview_page_url=$(this).attr('href');
133
+ var data = {
134
+ action: 'cli_policy_generator',
135
+ security: cli_policy_generator.nonces.cli_policy_generator,
136
+ cli_policy_generator_action:'autosave_contant_data',
137
+ content_data:content_data,
138
+ page_id:cli_policy_generator.page_id,
139
+ enable_webtofee_powered_by:($('[name="enable_webtofee_powered_by"]').is(':checked') ? 1 : 0)
140
+ };
141
+ $.ajax({
142
+ url: cli_policy_generator.ajax_url,
143
+ data: data,
144
+ datatype:'json',
145
+ type: 'POST',
146
+ success:function(data)
147
+ {
148
+ data=JSON.parse(data);
149
+ CLI_pg.onPrg=false;
150
+ if(data.response===true)
151
+ {
152
+ window.location.href=preview_page_url;
153
+ }
154
+ else
155
+ {
156
+ cli_notify_msg.error(cli_policy_generator.labels.error);
157
+ }
158
+ },
159
+ error:function()
160
+ {
161
+ CLI_pg.onPrg=false;
162
+ $('.cli_pg_footer a').css({'opacity':1,'cursor':'pointer'});
163
+ cli_notify_msg.error(cli_policy_generator.labels.error);
164
+ }
165
+ });
166
  });
 
167
  },
168
  editOnChange:function()
169
  {
admin/modules/cli-policy-generator/classes/class-policy-generator-ajax.php CHANGED
@@ -15,16 +15,21 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
15
  * Main Ajax hook for processing requests
16
  */
17
  public function ajax_policy_generator()
18
- {
 
 
 
 
 
19
  $out=array(
20
  'response'=>false,
21
  'message'=>__('Unable to handle your request.','cookie-law-info'),
22
  );
23
  $non_json_response=array();
24
  if(isset($_POST['cli_policy_generator_action']))
25
- {
26
- $cli_policy_generator_action=$_POST['cli_policy_generator_action'];
27
- $allowed_actions=array('autosave_contant_data','save_contentdata','get_policy_pageid');
28
  if(in_array($cli_policy_generator_action,$allowed_actions) && method_exists($this,$cli_policy_generator_action))
29
  {
30
  $out=$this->{$cli_policy_generator_action}();
@@ -52,8 +57,7 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
52
  if($policy_page_status && $policy_page_status!='trash')
53
  {
54
 
55
- }
56
- else
57
  {
58
  $page_id=0;
59
  }
@@ -73,10 +77,10 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
73
  'response'=>true,
74
  'er'=>''
75
  );
76
- $content_data=isset($_POST['content_data']) ? $_POST['content_data'] : array();
77
- $page_id=(int) isset($_POST['page_id']) ? $_POST['page_id']*1 : 0;
78
- $enable_webtofee_powered_by=(int) isset($_POST['enable_webtofee_powered_by']) ? $_POST['enable_webtofee_powered_by']*1 : 0;
79
- $id = wp_insert_post(
80
  array(
81
  'ID'=>$page_id, //if ID is zero it will create new page otherwise update
82
  'post_title'=>'Cookie Policy',
@@ -95,10 +99,13 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
95
  }else
96
  {
97
  Cookie_Law_Info_Cli_Policy_Generator::set_cookie_policy_pageid($id);
98
- $out['url']=get_edit_post_link($id);
99
  }
100
  return $out;
101
  }
 
 
 
102
  /*
103
  * @since 1.7.4
104
  * Autosave Current content to session (Ajax-main)
@@ -111,9 +118,9 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
111
  'response'=>true,
112
  'er'=>''
113
  );
114
- $content_data=isset($_POST['content_data']) ? $_POST['content_data'] : array();
115
- $page_id=isset($_POST['page_id']) ? $_POST['page_id'] : '';
116
- $enable_webtofee_powered_by=(int) isset($_POST['enable_webtofee_powered_by']) ? $_POST['enable_webtofee_powered_by']*1 : 0;
117
  if(is_array($content_data))
118
  {
119
  $content_html=Cookie_Law_Info_Cli_Policy_Generator::generate_page_content($enable_webtofee_powered_by,$content_data);
15
  * Main Ajax hook for processing requests
16
  */
17
  public function ajax_policy_generator()
18
+ {
19
+ check_ajax_referer('cli_policy_generator','security');
20
+ if (!current_user_can('manage_options'))
21
+ {
22
+ wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
23
+ }
24
  $out=array(
25
  'response'=>false,
26
  'message'=>__('Unable to handle your request.','cookie-law-info'),
27
  );
28
  $non_json_response=array();
29
  if(isset($_POST['cli_policy_generator_action']))
30
+ {
31
+ $allowed_actions = array('autosave_contant_data','save_contentdata','get_policy_pageid');
32
+ $cli_policy_generator_action = sanitize_text_field( isset( $_POST['cli_policy_generator_action'] ) && in_array( $_POST['cli_policy_generator_action'], $allowed_actions ) ? $_POST['cli_policy_generator_action'] : '' );
33
  if(in_array($cli_policy_generator_action,$allowed_actions) && method_exists($this,$cli_policy_generator_action))
34
  {
35
  $out=$this->{$cli_policy_generator_action}();
57
  if($policy_page_status && $policy_page_status!='trash')
58
  {
59
 
60
+ }else
 
61
  {
62
  $page_id=0;
63
  }
77
  'response'=>true,
78
  'er'=>''
79
  );
80
+ $content_data = isset($_POST['content_data']) ? $_POST['content_data'] : array();
81
+ $page_id = (int) sanitize_text_field( isset( $_POST['page_id'] ) ? $_POST['page_id'] : 0 );
82
+ $enable_webtofee_powered_by = (int) isset($_POST['enable_webtofee_powered_by']) ? $_POST['enable_webtofee_powered_by'] : 0;
83
+ $id=wp_insert_post(
84
  array(
85
  'ID'=>$page_id, //if ID is zero it will create new page otherwise update
86
  'post_title'=>'Cookie Policy',
99
  }else
100
  {
101
  Cookie_Law_Info_Cli_Policy_Generator::set_cookie_policy_pageid($id);
102
+ $out['url'] = get_edit_post_link($id);
103
  }
104
  return $out;
105
  }
106
+
107
+
108
+
109
  /*
110
  * @since 1.7.4
111
  * Autosave Current content to session (Ajax-main)
118
  'response'=>true,
119
  'er'=>''
120
  );
121
+ $content_data = isset($_POST['content_data']) ? $_POST['content_data'] : array();
122
+ $page_id= (int) sanitize_text_field( isset($_POST['page_id']) ? $_POST['page_id'] : '' );
123
+ $enable_webtofee_powered_by=(int) isset($_POST['enable_webtofee_powered_by']) ? $_POST['enable_webtofee_powered_by'] : 0;
124
  if(is_array($content_data))
125
  {
126
  $content_html=Cookie_Law_Info_Cli_Policy_Generator::generate_page_content($enable_webtofee_powered_by,$content_data);
admin/modules/cli-policy-generator/classes/class-preview-page.php CHANGED
@@ -29,6 +29,7 @@ class Cli_PreviewPage
29
  );
30
  return $out;
31
  }
 
32
  /**
33
  *
34
  * @since 1.7.4
@@ -38,22 +39,22 @@ class Cli_PreviewPage
38
  public function preview_page($posts)
39
  {
40
  global $wp,$wp_query;
41
- $preview_pages = self::get_preview_page();
 
42
  $preview_pages_slugs = array();
43
  foreach($preview_pages as $slug=>$v)
44
  {
45
  $preview_pages_slugs[]=$slug;
46
  }
47
  if(in_array(strtolower($wp->request),$preview_pages_slugs) ||
48
- (isset( $wp->query_vars['page_id'] ) && in_array(strtolower($wp->query_vars['page_id']),$preview_pages_slugs)))
49
  {
50
  if(in_array(strtolower($wp->request),$preview_pages_slugs))
51
  {
52
- $preview_page = strtolower($wp->request);
53
- }
54
- else
55
  {
56
- $preview_page = strtolower($wp->query_vars['page_id']);
57
  }
58
 
59
  $posts = null;
@@ -68,6 +69,7 @@ class Cli_PreviewPage
68
  unset( $wp_query->query["error"] );
69
  $wp_query->query_vars["error"] = "";
70
  $wp_query->is_404 = false;
 
71
  add_action('admin_bar_menu',array($this,'add_admin_bar_menu'),100);
72
  add_action('wp_footer',array($this,'reg_preview_auto_btn'),100);
73
  }
29
  );
30
  return $out;
31
  }
32
+
33
  /**
34
  *
35
  * @since 1.7.4
39
  public function preview_page($posts)
40
  {
41
  global $wp,$wp_query;
42
+
43
+ $preview_pages=self::get_preview_page();
44
  $preview_pages_slugs = array();
45
  foreach($preview_pages as $slug=>$v)
46
  {
47
  $preview_pages_slugs[]=$slug;
48
  }
49
  if(in_array(strtolower($wp->request),$preview_pages_slugs) ||
50
+ (isset($wp->query_vars['page_id']) && in_array(strtolower($wp->query_vars['page_id']),$preview_pages_slugs)))
51
  {
52
  if(in_array(strtolower($wp->request),$preview_pages_slugs))
53
  {
54
+ $preview_page=strtolower($wp->request);
55
+ }else
 
56
  {
57
+ $preview_page=strtolower($wp->query_vars['page_id']);
58
  }
59
 
60
  $posts = null;
69
  unset( $wp_query->query["error"] );
70
  $wp_query->query_vars["error"] = "";
71
  $wp_query->is_404 = false;
72
+
73
  add_action('admin_bar_menu',array($this,'add_admin_bar_menu'),100);
74
  add_action('wp_footer',array($this,'reg_preview_auto_btn'),100);
75
  }
admin/modules/cli-policy-generator/cli-policy-generator.php CHANGED
@@ -14,12 +14,12 @@ include( plugin_dir_path( __FILE__ ).'classes/class-preview-page.php');
14
  class Cookie_Law_Info_Cli_Policy_Generator
15
  {
16
  public static $policy_pageid='cli_pg_policy_page_id';
17
-
18
  public function __construct()
19
  {
20
  add_action('admin_menu',array($this,'add_admin_pages'));
21
  add_filter('display_post_states',array($this,'add_display_post_states'),10,2);
22
  }
 
23
  /**
24
  * Add a post display state for Cookie Policy page in the page list table.
25
  *
@@ -33,35 +33,39 @@ class Cookie_Law_Info_Cli_Policy_Generator
33
  }
34
  return $post_states;
35
  }
 
36
  private static function gen_page_html($content_data_arr=array(),$render_shortcode=1)
37
  {
38
  $html='';
39
  foreach($content_data_arr as $key=>$value)
40
  {
41
  $html.='<h3>'.$value['hd'].'</h3>';
42
- $html.='<div>'.($render_shortcode==1 ? do_shortcode(stripslashes($value['content'])) : stripslashes($value['content'])).'</div>';
 
43
  }
44
  return $html;
45
  }
 
46
  public static function get_page_content()
47
  {
48
- $contant_val = get_option('cli_pg_content_data');
49
- $html = isset($contant_val) ? $contant_val : '';
50
  return $html;
51
  }
 
52
  /**
53
  * Generating content for page from session/post
54
  * @since 1.7.4
55
  * @return string
56
  */
57
- public static function generate_page_content( $powered_by, $content_data_post_arr=array(), $render_shortcode=1 )
58
  {
59
  $html='<div class="cli_pg_page_contaner">';
60
- $html.= self::gen_page_html($content_data_post_arr,$render_shortcode);
61
  $html.=($powered_by==1 ? '[webtoffee_powered_by]' : '').'</div>';
62
  return $html;
63
- }
64
-
65
  /**
66
  * Get policy page id from option table
67
  * @since 1.7.4
@@ -73,8 +77,7 @@ class Cookie_Law_Info_Cli_Policy_Generator
73
  if($pageid===false)
74
  {
75
  return 0;
76
- }
77
- else
78
  {
79
  return $pageid;
80
  }
14
  class Cookie_Law_Info_Cli_Policy_Generator
15
  {
16
  public static $policy_pageid='cli_pg_policy_page_id';
 
17
  public function __construct()
18
  {
19
  add_action('admin_menu',array($this,'add_admin_pages'));
20
  add_filter('display_post_states',array($this,'add_display_post_states'),10,2);
21
  }
22
+
23
  /**
24
  * Add a post display state for Cookie Policy page in the page list table.
25
  *
33
  }
34
  return $post_states;
35
  }
36
+
37
  private static function gen_page_html($content_data_arr=array(),$render_shortcode=1)
38
  {
39
  $html='';
40
  foreach($content_data_arr as $key=>$value)
41
  {
42
  $html.='<h3>'.$value['hd'].'</h3>';
43
+ $post_content = (isset( $value['content'] ) ? sanitize_textarea_field( $value['content'] ) : '');
44
+ $html.='<div>'.($render_shortcode==1 ? do_shortcode( stripslashes($post_content) ) : stripslashes( $post_content )).'</div>';
45
  }
46
  return $html;
47
  }
48
+
49
  public static function get_page_content()
50
  {
51
+ $contant_val=get_option('cli_pg_content_data');
52
+ $html=isset($contant_val) ? $contant_val : '';
53
  return $html;
54
  }
55
+
56
  /**
57
  * Generating content for page from session/post
58
  * @since 1.7.4
59
  * @return string
60
  */
61
+ public static function generate_page_content($powered_by,$content_data_post_arr=array(),$render_shortcode=1)
62
  {
63
  $html='<div class="cli_pg_page_contaner">';
64
+ $html.=self::gen_page_html($content_data_post_arr,$render_shortcode);
65
  $html.=($powered_by==1 ? '[webtoffee_powered_by]' : '').'</div>';
66
  return $html;
67
+ }
68
+
69
  /**
70
  * Get policy page id from option table
71
  * @since 1.7.4
77
  if($pageid===false)
78
  {
79
  return 0;
80
+ }else
 
81
  {
82
  return $pageid;
83
  }
admin/partials/cookie-law-info-privacy_overview.php CHANGED
@@ -2,7 +2,11 @@
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
  die;
5
- }
 
 
 
 
6
  $options = array(
7
  'privacy_overview_title',
8
  'privacy_overview_content',
@@ -17,14 +21,8 @@ if (isset($_POST['update_privacy_overview_content_settings_form'])) {
17
  // Check nonce:
18
  check_admin_referer('cookielawinfo-update-privacy-overview-content');
19
 
20
- foreach ($options as $key) {
21
-
22
- if (isset($_POST[$key])) {
23
-
24
- //Todo - Store sanitised values only: wp_unslash failed on some site - need to do proper sanitize
25
- $stored_options[$key] = $_POST[$key];
26
- }
27
- }
28
  update_option('cookielawinfo_privacy_overview_content_settings', $stored_options);
29
  echo '<div class="updated"><p><strong>' . __('Settings Updated.', 'cookie-law-info') . '</strong></p></div>';
30
  }
@@ -58,7 +56,7 @@ $privacy_content = isset($stored_options['privacy_overview_content']) ? $stored_
58
  <tr valign="top">
59
  <td>
60
  <label for="privacy_overview_title"><?php _e('Privacy Overview Title', 'cookie-law-info'); ?></label>
61
- <input type="text" name="privacy_overview_title" value="<?php echo $privacy_title; ?>" class="cli-textbox" />
62
  </td>
63
  </tr>
64
  <tr valign="top">
@@ -68,12 +66,12 @@ $privacy_content = isset($stored_options['privacy_overview_content']) ? $stored_
68
  $cli_use_editor= apply_filters('cli_use_editor_in_po',true);
69
  if($cli_use_editor)
70
  {
71
- wp_editor(stripslashes($privacy_content) , 'cli_privacy_overview_content', $wpe_settings = array('textarea_name'=>'privacy_overview_content'));
72
  }
73
  else
74
  {
75
  ?>
76
- <textarea style="width:100%; height:250px;" name="privacy_overview_content"><?php echo stripslashes($privacy_content) ;?></textarea>
77
  <?php
78
  }
79
  ?>
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
  die;
5
+ }
6
+ if (!current_user_can('manage_options'))
7
+ {
8
+ wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
9
+ }
10
  $options = array(
11
  'privacy_overview_title',
12
  'privacy_overview_content',
21
  // Check nonce:
22
  check_admin_referer('cookielawinfo-update-privacy-overview-content');
23
 
24
+ $stored_options['privacy_overview_title'] = sanitize_text_field( isset( $_POST['privacy_overview_title'] ) ? $_POST['privacy_overview_title'] : $stored_options['privacy_overview_title'] );
25
+ $stored_options['privacy_overview_content'] = wp_kses_post( isset( $_POST['privacy_overview_content'] ) && $_POST['privacy_overview_content'] !== '' ? $_POST['privacy_overview_content'] : $stored_options['privacy_overview_content'] );
 
 
 
 
 
 
26
  update_option('cookielawinfo_privacy_overview_content_settings', $stored_options);
27
  echo '<div class="updated"><p><strong>' . __('Settings Updated.', 'cookie-law-info') . '</strong></p></div>';
28
  }
56
  <tr valign="top">
57
  <td>
58
  <label for="privacy_overview_title"><?php _e('Privacy Overview Title', 'cookie-law-info'); ?></label>
59
+ <input type="text" name="privacy_overview_title" value="<?php echo sanitize_text_field( stripslashes( $privacy_title ) ); ?>" class="cli-textbox" />
60
  </td>
61
  </tr>
62
  <tr valign="top">
66
  $cli_use_editor= apply_filters('cli_use_editor_in_po',true);
67
  if($cli_use_editor)
68
  {
69
+ wp_editor( stripslashes($privacy_content) , 'cli_privacy_overview_content', $wpe_settings = array('textarea_name'=>'privacy_overview_content'));
70
  }
71
  else
72
  {
73
  ?>
74
+ <textarea style="width:100%; height:250px;" name="privacy_overview_content"><?php echo wp_kses_post( stripslashes($privacy_content) ) ;?></textarea>
75
  <?php
76
  }
77
  ?>
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.8.2
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.8.2' );
67
 
68
  function wt_cookie_law_info_update_message( $data, $response )
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.8.4
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.8.4' );
67
 
68
  function wt_cookie_law_info_update_message( $data, $response )
69
  {
includes/class-cookie-law-info.php CHANGED
@@ -74,9 +74,9 @@ class Cookie_Law_Info {
74
  {
75
  $this->version = CLI_VERSION;
76
  }
77
- else
78
  {
79
- $this->version = '1.8.2';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
@@ -517,7 +517,7 @@ class Cookie_Law_Info {
517
 
518
  /**
519
  Returns sanitised content based on field-specific rules defined here
520
- Used for both read AND write operations
521
  */
522
  public static function sanitise_settings($key, $value)
523
  {
@@ -708,11 +708,10 @@ class Cookie_Law_Info {
708
  //trigger_error( "Invalid hex color length", E_USER_ERROR );
709
  return $supplied_hex;
710
  }
711
-
712
  // Start shifting
713
- $RGB_values['R'] = hexdec( $supplied_hex{0} . $supplied_hex{1} );
714
- $RGB_values['G'] = hexdec( $supplied_hex{2} . $supplied_hex{3} );
715
- $RGB_values['B'] = hexdec( $supplied_hex{4} . $supplied_hex{5} );
716
 
717
  foreach ( $RGB_values as $c => $v ) {
718
  switch ( $shift_method ) {
@@ -874,7 +873,7 @@ class Cookie_Law_Info {
874
 
875
 
876
  //========reject button missing issue=========@since 1.6.7
877
- $message_bar_text = $options['notify_message'];
878
  //user turned on the reject button with his previous settings
879
  if(isset($options['is_reject_on']) && $options['is_reject_on']==true)
880
  {
74
  {
75
  $this->version = CLI_VERSION;
76
  }
77
+ else
78
  {
79
+ $this->version = '1.8.4';
80
  }
81
  $this->plugin_name = 'cookie-law-info';
82
 
517
 
518
  /**
519
  Returns sanitised content based on field-specific rules defined here
520
+ Used for both read AND write operations
521
  */
522
  public static function sanitise_settings($key, $value)
523
  {
708
  //trigger_error( "Invalid hex color length", E_USER_ERROR );
709
  return $supplied_hex;
710
  }
 
711
  // Start shifting
712
+ $RGB_values['R'] = hexdec( $supplied_hex[0] . $supplied_hex[1] );
713
+ $RGB_values['G'] = hexdec( $supplied_hex[2] . $supplied_hex[3] );
714
+ $RGB_values['B'] = hexdec( $supplied_hex[4] . $supplied_hex[5] );
715
 
716
  foreach ( $RGB_values as $c => $v ) {
717
  switch ( $shift_method ) {
873
 
874
 
875
  //========reject button missing issue=========@since 1.6.7
876
+ $message_bar_text=$options['notify_message'];
877
  //user turned on the reject button with his previous settings
878
  if(isset($options['is_reject_on']) && $options['is_reject_on']==true)
879
  {
languages/cookie-law-info-bg_BG.mo CHANGED
File without changes
languages/cookie-law-info-bg_BG.po CHANGED
File without changes
languages/cookie-law-info-cs_CZ.mo CHANGED
File without changes
languages/cookie-law-info-cs_CZ.po CHANGED
File without changes
languages/cookie-law-info-da_DA.mo CHANGED
File without changes
languages/cookie-law-info-da_DA.po CHANGED
File without changes
languages/cookie-law-info-da_DK.mo CHANGED
File without changes
languages/cookie-law-info-da_DK.po CHANGED
File without changes
languages/cookie-law-info-de_DE.mo CHANGED
File without changes
languages/cookie-law-info-de_DE.po CHANGED
File without changes
languages/cookie-law-info-es_ES.mo CHANGED
File without changes
languages/cookie-law-info-es_ES.po CHANGED
File without changes
languages/cookie-law-info-fr_FR.mo CHANGED
File without changes
languages/cookie-law-info-fr_FR.po CHANGED
File without changes
languages/cookie-law-info-hr.mo CHANGED
File without changes
languages/cookie-law-info-hr.po CHANGED
File without changes
languages/cookie-law-info-is_IS.mo CHANGED
File without changes
languages/cookie-law-info-is_IS.po CHANGED
File without changes
languages/cookie-law-info-nl_NL.mo CHANGED
File without changes
languages/cookie-law-info-nl_NL.po CHANGED
File without changes
languages/cookie-law-info-sl_SL.mo CHANGED
File without changes
languages/cookie-law-info-sl_SL.po CHANGED
File without changes
public/class-cookie-law-info-public.php CHANGED
@@ -74,6 +74,7 @@ class Cookie_Law_Info_Public {
74
  'necessary'=>__('Necessary','cookie-law-info'),
75
  'non-necessary' => __('Non-necessary','cookie-law-info'),
76
  );
 
77
  return $cookie_categories;
78
  }
79
  public static function wt_cli_check_thirdparty_state()
@@ -153,7 +154,7 @@ class Cookie_Law_Info_Public {
153
 
154
  foreach ($cookie_categories as $key => $value)
155
  {
156
- if(empty($_COOKIE["cookielawinfo-checkbox-$key"]))
157
  {
158
  if($key === 'non-necessary' ) {
159
 
@@ -307,8 +308,8 @@ class Cookie_Law_Info_Public {
307
 
308
  /** Removes leading # characters from a string */
309
  public static function cookielawinfo_remove_hash( $str )
310
- {
311
- if( $str{0} == "#" )
312
  {
313
  $str = substr( $str, 1, strlen($str) );
314
  }
@@ -330,7 +331,7 @@ class Cookie_Law_Info_Public {
330
  if ( $the_options['is_on'] == true )
331
  {
332
  // Output the HTML in the footer:
333
- $message =nl2br($the_options['notify_message']);
334
  $str = do_shortcode( stripslashes ( $message ) );
335
  $str = __($str,'cookie-law-info');
336
  $head= __($the_options['bar_heading_text'],'cookie-law-info');
@@ -342,7 +343,7 @@ class Cookie_Law_Info_Public {
342
 
343
  //if($the_options['showagain_tab'] === true)
344
  //{
345
- $show_again=__($the_options["showagain_text"],'cookie-law-info');
346
  $notify_html .= '<div id="' . $this->cookielawinfo_remove_hash( $the_options["showagain_div_id"] ) . '" style="display:none;"><span id="cookie_hdr_showagain">'.$show_again.'</span></div>';
347
  //}
348
  global $wp_query;
@@ -377,16 +378,16 @@ class Cookie_Law_Info_Public {
377
  $the_options = Cookie_Law_Info::get_settings();
378
  if($the_options['is_on'] == true && !is_admin())
379
  {
380
- $third_party_cookie_options=get_option('cookielawinfo_thirdparty_settings');
381
  if(!empty($third_party_cookie_options))
382
  {
383
  $thirdparty_on_field = isset($third_party_cookie_options['thirdparty_on_field']) ? $third_party_cookie_options['thirdparty_on_field'] : false;
384
  $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$thirdparty_on_field);
385
- if($wt_cli_is_thirdparty_enabled == true && isset($_COOKIE['viewed_cookie_policy']))
386
  {
387
  if($_COOKIE['viewed_cookie_policy']=='yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
388
  {
389
- echo (isset($third_party_cookie_options['thirdparty_head_section'])) ? $third_party_cookie_options['thirdparty_head_section'] : '';
390
  }
391
  }
392
  }
@@ -404,11 +405,11 @@ class Cookie_Law_Info_Public {
404
  {
405
  $thirdparty_on_field = isset($third_party_cookie_options['thirdparty_on_field']) ? $third_party_cookie_options['thirdparty_on_field'] : false;
406
  $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$thirdparty_on_field);
407
- if($wt_cli_is_thirdparty_enabled == true && isset($_COOKIE['viewed_cookie_policy']))
408
  {
409
  if($_COOKIE['viewed_cookie_policy'] == 'yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
410
  {
411
- echo (isset($third_party_cookie_options['thirdparty_body_section'])) ? $third_party_cookie_options['thirdparty_body_section'] : '';
412
  }
413
  }
414
  }
@@ -500,12 +501,13 @@ class Cookie_Law_Info_Public {
500
  {
501
  $cli_flush_cache=1;
502
  }
503
-
504
  ?>
505
  <script type="text/javascript">
506
  var cli_flush_cache=<?php echo $cli_flush_cache; ?>;
507
  </script>
508
  <?php
 
509
  }
510
 
511
 
74
  'necessary'=>__('Necessary','cookie-law-info'),
75
  'non-necessary' => __('Non-necessary','cookie-law-info'),
76
  );
77
+ $cookie_categories = apply_filters('wt_cli_add_custom_cookie_categories_name', $cookie_categories);
78
  return $cookie_categories;
79
  }
80
  public static function wt_cli_check_thirdparty_state()
154
 
155
  foreach ($cookie_categories as $key => $value)
156
  {
157
+ if( empty($_COOKIE["cookielawinfo-checkbox-$key"]) )
158
  {
159
  if($key === 'non-necessary' ) {
160
 
308
 
309
  /** Removes leading # characters from a string */
310
  public static function cookielawinfo_remove_hash( $str )
311
+ {
312
+ if( $str[0] == "#" )
313
  {
314
  $str = substr( $str, 1, strlen($str) );
315
  }
331
  if ( $the_options['is_on'] == true )
332
  {
333
  // Output the HTML in the footer:
334
+ $message =nl2br($the_options['notify_message']);
335
  $str = do_shortcode( stripslashes ( $message ) );
336
  $str = __($str,'cookie-law-info');
337
  $head= __($the_options['bar_heading_text'],'cookie-law-info');
343
 
344
  //if($the_options['showagain_tab'] === true)
345
  //{
346
+ $show_again=__( stripslashes( $the_options["showagain_text"] ),'cookie-law-info');
347
  $notify_html .= '<div id="' . $this->cookielawinfo_remove_hash( $the_options["showagain_div_id"] ) . '" style="display:none;"><span id="cookie_hdr_showagain">'.$show_again.'</span></div>';
348
  //}
349
  global $wp_query;
378
  $the_options = Cookie_Law_Info::get_settings();
379
  if($the_options['is_on'] == true && !is_admin())
380
  {
381
+ $third_party_cookie_options = get_option('cookielawinfo_thirdparty_settings');
382
  if(!empty($third_party_cookie_options))
383
  {
384
  $thirdparty_on_field = isset($third_party_cookie_options['thirdparty_on_field']) ? $third_party_cookie_options['thirdparty_on_field'] : false;
385
  $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$thirdparty_on_field);
386
+ if($wt_cli_is_thirdparty_enabled == true && isset( $_COOKIE['viewed_cookie_policy'] ) && isset( $_COOKIE["cookielawinfo-checkbox-non-necessary"] ))
387
  {
388
  if($_COOKIE['viewed_cookie_policy']=='yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
389
  {
390
+ echo wp_unslash( isset($third_party_cookie_options['thirdparty_head_section']) ? $third_party_cookie_options['thirdparty_head_section'] : '' );
391
  }
392
  }
393
  }
405
  {
406
  $thirdparty_on_field = isset($third_party_cookie_options['thirdparty_on_field']) ? $third_party_cookie_options['thirdparty_on_field'] : false;
407
  $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$thirdparty_on_field);
408
+ if( $wt_cli_is_thirdparty_enabled == true && isset($_COOKIE['viewed_cookie_policy']) && isset( $_COOKIE["cookielawinfo-checkbox-non-necessary"] ) )
409
  {
410
  if($_COOKIE['viewed_cookie_policy'] == 'yes' && $_COOKIE["cookielawinfo-checkbox-non-necessary"] =='yes')
411
  {
412
+ echo wp_unslash( isset($third_party_cookie_options['thirdparty_body_section']) ? $third_party_cookie_options['thirdparty_body_section'] : '' );
413
  }
414
  }
415
  }
501
  {
502
  $cli_flush_cache=1;
503
  }
504
+ if($cli_flush_cache == 1):
505
  ?>
506
  <script type="text/javascript">
507
  var cli_flush_cache=<?php echo $cli_flush_cache; ?>;
508
  </script>
509
  <?php
510
+ endif;
511
  }
512
 
513
 
public/css/cookie-law-info-gdpr.css CHANGED
@@ -1009,7 +1009,7 @@ color:inherit;
1009
  border:none;
1010
  min-width: 40px;
1011
  }
1012
- .cli-tab-container h4 {
1013
  font-family: inherit;
1014
  font-size: 16px;
1015
  margin-bottom: 15px;
@@ -1176,4 +1176,10 @@ span.cli-necessary-caption {
1176
  .cli_settings_button
1177
  {
1178
  cursor: pointer;
 
 
 
 
 
 
1179
  }
1009
  border:none;
1010
  min-width: 40px;
1011
  }
1012
+ .cli-tab-container h4,.cli-tab-container h1 {
1013
  font-family: inherit;
1014
  font-size: 16px;
1015
  margin-bottom: 15px;
1176
  .cli_settings_button
1177
  {
1178
  cursor: pointer;
1179
+ }
1180
+ /* Accessibility Fix */
1181
+ .wt-cli-sr-only
1182
+ {
1183
+ display: none;
1184
+ font-size:16px;
1185
  }
public/modules/shortcode/shortcode.php CHANGED
@@ -174,14 +174,15 @@ class Cookie_Law_Info_Shortcode {
174
  /** RICHARDASHBY EDIT: only add CSS if table is being used */
175
  wp_enqueue_style($this->plugin_name.'-table');
176
  /** END EDIT */
 
177
  extract( shortcode_atts( array(
178
  'style' => 'classic',
179
  'not_shown_message' => __('No records found','cookie-law-info'),
180
  'columns' =>'cookie,type,duration,description',
181
  'heading' =>'',
182
  ), $atts ) );
183
-
184
  $columns=explode(",",$columns);
 
185
  $args = array(
186
  'post_type' => CLI_POST_TYPE,
187
  /** 28/05/2013: Changing from 10 to 50 to allow longer tables of cookie data */
@@ -192,7 +193,7 @@ class Cookie_Law_Info_Shortcode {
192
  global $sitepress;
193
  if(function_exists('icl_object_id') && $sitepress) //wpml enabled
194
  {
195
- $args['suppress_filters'] = false;
196
  }
197
  $posts = get_posts($args);
198
  $ret = '<table class="cookielawinfo-row-cat-table cookielawinfo-' . $style . '"><thead><tr>';
@@ -278,8 +279,12 @@ class Cookie_Law_Info_Shortcode {
278
  $ret .= '</tr>';
279
  return $ret;
280
  }
 
 
 
 
281
  /**
282
- * Returns HTML for a standard (green, medium sized) 'Accept' button
283
  */
284
  public function cookielawinfo_shortcode_accept_button( $atts )
285
  {
@@ -287,11 +292,11 @@ class Cookie_Law_Info_Shortcode {
287
  'colour' => 'green',
288
  'margin' => '',
289
  ), $atts ));
290
- $defaults = Cookie_Law_Info::get_default_settings('button_1_text');
291
  $settings = wp_parse_args(Cookie_Law_Info::get_settings(),$defaults);
292
  $button_1_text=__($settings['button_1_text'],'cookie-law-info');
293
  $margin_style=$margin!="" ? ' style="margin:'.$margin.';" ' : '';
294
- return '<a class="cli_action_button cli-accept-button medium cli-plugin-button ' . $colour . '" data-cli_action="accept"'.$margin_style.'>' . stripslashes($button_1_text) . '</a>';
295
  }
296
 
297
  /** Returns HTML for a standard (green, medium sized) 'Reject' button */
@@ -314,7 +319,7 @@ class Cookie_Law_Info_Shortcode {
314
  {
315
  $classr=' class="cookie_action_close_header_reject cli_action_button" ';
316
  }
317
- $url_reject = ( $settings['button_3_action'] == "CONSTANT_OPEN_URL" && $settings['button_3_url'] != "#" ) ? "href='$settings[button_3_url]'" : "";
318
  $link_tag = '';
319
  $link_tag .= ' <a '.$url_reject.' id="'.Cookie_Law_Info_Public::cookielawinfo_remove_hash($settings['button_3_action']).'" ';
320
  $link_tag .= ($settings['button_3_new_win'] ) ? 'target="_blank" ' : '' ;
@@ -343,15 +348,15 @@ class Cookie_Law_Info_Shortcode {
343
  }
344
  else
345
  {
346
- $classr= 'class="cli_settings_button" ';
347
  }
348
 
349
  //adding custom style
350
- $url_s = ( $settings['button_4_action'] == "CONSTANT_OPEN_URL" && $settings['button_4_url'] != "#" ) ? "href='$settings[button_4_url]'" : "";
351
  $link_tag = '';
352
  $link_tag .= '<a ' . $url_s;
353
  $link_tag .= ( $settings['button_4_new_win'] ) ? ' target="_blank" ' : '' ;
354
- $link_tag .= $classr . ' '.$margin_style.'>' . stripslashes( $settings['button_4_text'] ) . '</a>';
355
  return $link_tag;
356
  }
357
  /** Returns HTML for a generic button */
@@ -380,7 +385,7 @@ class Cookie_Law_Info_Shortcode {
380
  }
381
 
382
  // If is action not URL then don't use URL!
383
- $url = ( $settings['button_1_action'] == "CONSTANT_OPEN_URL" && $settings['button_1_url'] != "#" ) ? "href='$settings[button_1_url]'" : "";
384
  $link_tag = '<a '.$url.' data-cli_action="accept" id="' . Cookie_Law_Info_Public::cookielawinfo_remove_hash ( $settings['button_1_action'] ) . '" ';
385
  $link_tag .= ( $settings['button_1_new_win'] ) ? 'target="_blank" ' : '' ;
386
  $link_tag .= $class.' style="display:inline-block; '.$margin_style.'">' . stripslashes( __($settings['button_1_text'],'cookie-law-info') ) . '</a>';
@@ -437,10 +442,10 @@ class Cookie_Law_Info_Shortcode {
437
  * @since 1.7.4
438
  * Checks if user enabled minify bar in the current page
439
  */
440
- if($arr['button_2_hidebar'] === true)
441
  {
442
  global $wp;
443
- $current_url = home_url(add_query_arg(array(),$wp->request));
444
  $btn2_url=$current_url[strlen($current_url)-1]=='/' ? substr($current_url,0,-1) : $current_url;
445
  $btn2_url=$arr['button_2_url'][strlen($arr['button_2_url'])-1]=='/' ? substr($arr['button_2_url'],0,-1) : $arr['button_2_url'];
446
  if(strpos($btn2_url,$current_url)!==false)
@@ -459,8 +464,7 @@ class Cookie_Law_Info_Shortcode {
459
  }
460
  }
461
  }
462
- }
463
- else
464
  {
465
  $privacy_page_exists=0;
466
  if($arr['button_2_page']>0) //page choosed
@@ -505,7 +509,7 @@ class Cookie_Law_Info_Shortcode {
505
  }
506
 
507
  // If is action not URL then don't use URL!
508
- $url = ( $settings['button_x_action'] == "CONSTANT_OPEN_URL" && $settings['button_x_url'] != "#" ) ? "href='$settings[button_x_url]'" : "";
509
  $link_tag = '<a '. $url . ' id="' . Cookie_Law_Info_Public::cookielawinfo_remove_hash ( $settings['button_x_action'] ) . '" ';
510
  $link_tag .= ( $settings['button_x_new_win'] ) ? 'target="_blank" ' : '' ;
511
  $link_tag .= $class.' style="display:inline-block;'.$margin_style.'" >' . $settings['button_x_text'] . '</a>';
174
  /** RICHARDASHBY EDIT: only add CSS if table is being used */
175
  wp_enqueue_style($this->plugin_name.'-table');
176
  /** END EDIT */
177
+
178
  extract( shortcode_atts( array(
179
  'style' => 'classic',
180
  'not_shown_message' => __('No records found','cookie-law-info'),
181
  'columns' =>'cookie,type,duration,description',
182
  'heading' =>'',
183
  ), $atts ) );
 
184
  $columns=explode(",",$columns);
185
+
186
  $args = array(
187
  'post_type' => CLI_POST_TYPE,
188
  /** 28/05/2013: Changing from 10 to 50 to allow longer tables of cookie data */
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>';
279
  $ret .= '</tr>';
280
  return $ret;
281
  }
282
+
283
+
284
+
285
+
286
  /**
287
+ * Returns HTML for a standard (green, medium sized) 'Accept' button
288
  */
289
  public function cookielawinfo_shortcode_accept_button( $atts )
290
  {
292
  'colour' => 'green',
293
  'margin' => '',
294
  ), $atts ));
295
+ $defaults =Cookie_Law_Info::get_default_settings('button_1_text');
296
  $settings = wp_parse_args(Cookie_Law_Info::get_settings(),$defaults);
297
  $button_1_text=__($settings['button_1_text'],'cookie-law-info');
298
  $margin_style=$margin!="" ? ' style="margin:'.$margin.';" ' : '';
299
+ return '<a role="button" tabindex="0" class="cli_action_button cli-accept-button medium cli-plugin-button ' . $colour . '" data-cli_action="accept"'.$margin_style.'>' . stripslashes($button_1_text) . '</a>';
300
  }
301
 
302
  /** Returns HTML for a standard (green, medium sized) 'Reject' button */
319
  {
320
  $classr=' class="cookie_action_close_header_reject cli_action_button" ';
321
  }
322
+ $url_reject = ( $settings['button_3_action'] == "CONSTANT_OPEN_URL" && $settings['button_3_url'] != "#" ) ? "href='$settings[button_3_url]'" : "role='button' tabindex='0'";
323
  $link_tag = '';
324
  $link_tag .= ' <a '.$url_reject.' id="'.Cookie_Law_Info_Public::cookielawinfo_remove_hash($settings['button_3_action']).'" ';
325
  $link_tag .= ($settings['button_3_new_win'] ) ? 'target="_blank" ' : '' ;
348
  }
349
  else
350
  {
351
+ $classr= ' class="cli_settings_button"';
352
  }
353
 
354
  //adding custom style
355
+ $url_s = ( $settings['button_4_action'] == "CONSTANT_OPEN_URL" && $settings['button_4_url'] != "#" ) ? "href='$settings[button_4_url]'" : "role='button' tabindex='0'";
356
  $link_tag = '';
357
  $link_tag .= '<a ' . $url_s;
358
  $link_tag .= ( $settings['button_4_new_win'] ) ? ' target="_blank" ' : '' ;
359
+ $link_tag .= $classr.''.$margin_style.'>' . stripslashes( $settings['button_4_text'] ) . '</a>';
360
  return $link_tag;
361
  }
362
  /** Returns HTML for a generic button */
385
  }
386
 
387
  // If is action not URL then don't use URL!
388
+ $url = ( $settings['button_1_action'] == "CONSTANT_OPEN_URL" && $settings['button_1_url'] != "#" ) ? "href='$settings[button_1_url]'" : "role='button' tabindex='0'";
389
  $link_tag = '<a '.$url.' data-cli_action="accept" id="' . Cookie_Law_Info_Public::cookielawinfo_remove_hash ( $settings['button_1_action'] ) . '" ';
390
  $link_tag .= ( $settings['button_1_new_win'] ) ? 'target="_blank" ' : '' ;
391
  $link_tag .= $class.' style="display:inline-block; '.$margin_style.'">' . stripslashes( __($settings['button_1_text'],'cookie-law-info') ) . '</a>';
442
  * @since 1.7.4
443
  * Checks if user enabled minify bar in the current page
444
  */
445
+ if($arr['button_2_hidebar']===true)
446
  {
447
  global $wp;
448
+ $current_url=home_url(add_query_arg(array(),$wp->request));
449
  $btn2_url=$current_url[strlen($current_url)-1]=='/' ? substr($current_url,0,-1) : $current_url;
450
  $btn2_url=$arr['button_2_url'][strlen($arr['button_2_url'])-1]=='/' ? substr($arr['button_2_url'],0,-1) : $arr['button_2_url'];
451
  if(strpos($btn2_url,$current_url)!==false)
464
  }
465
  }
466
  }
467
+ }else
 
468
  {
469
  $privacy_page_exists=0;
470
  if($arr['button_2_page']>0) //page choosed
509
  }
510
 
511
  // If is action not URL then don't use URL!
512
+ $url = ( $settings['button_x_action'] == "CONSTANT_OPEN_URL" && $settings['button_x_url'] != "#" ) ? "href='$settings[button_x_url]'" : "role='button' tabindex='0'";
513
  $link_tag = '<a '. $url . ' id="' . Cookie_Law_Info_Public::cookielawinfo_remove_hash ( $settings['button_x_action'] ) . '" ';
514
  $link_tag .= ( $settings['button_x_new_win'] ) ? 'target="_blank" ' : '' ;
515
  $link_tag .= $class.' style="display:inline-block;'.$margin_style.'" >' . $settings['button_x_text'] . '</a>';
public/views/cookie-law-info_bar.php CHANGED
@@ -18,6 +18,7 @@ if(file_exists($pop_content_html_file))
18
  <div class="cli-modal-content cli-bar-popup">
19
  <button type="button" class="cli-modal-close" id="cliModalClose">
20
  <svg class="" viewBox="0 0 24 24"><path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"></path><path d="M0 0h24v24h-24z" fill="none"></path></svg>
 
21
  </button>
22
  <div class="cli-modal-body">
23
  <?php
18
  <div class="cli-modal-content cli-bar-popup">
19
  <button type="button" class="cli-modal-close" id="cliModalClose">
20
  <svg class="" viewBox="0 0 24 24"><path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"></path><path d="M0 0h24v24h-24z" fill="none"></path></svg>
21
+ <span class="wt-cli-sr-only"><?php echo __('Close', 'cookie-law-info'); ?></span>
22
  </button>
23
  <div class="cli-modal-body">
24
  <?php
public/views/cookie-law-info_popup_content.php CHANGED
@@ -13,14 +13,14 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
13
  <div class="cli-col-12 cli-align-items-stretch cli-px-0">
14
  <div class="cli-privacy-overview">
15
  <?php
16
- $overview_title=isset($overview['privacy_overview_title']) ? $overview['privacy_overview_title'] : '';
17
- $privacy_overview_content = isset($overview['privacy_overview_content']) ? $overview['privacy_overview_content'] : '';
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">
@@ -30,19 +30,6 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
30
  </div>
31
  </div>
32
  <div class="cli-col-12 cli-align-items-stretch cli-px-0 cli-tab-section-container">
33
- <div class="cli-tab-section cli-privacy-tab">
34
- <div class="cli-tab-header">
35
- <a class="cli-nav-link cli-settings-mobile" >
36
- <?php echo $overview_title; ?>
37
- </a>
38
- </div>
39
- <div class="cli-tab-content">
40
- <div class="cli-tab-pane cli-fade">
41
- <p><?php echo $privacy_overview_content;?></p>
42
- </div>
43
- </div>
44
-
45
- </div>
46
  <?php
47
  $cookie_categories = self::get_cookie_categories();
48
  foreach ($cookie_categories as $key => $value)
@@ -70,21 +57,20 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
70
  {
71
  $cli_switch='
72
  <span class="cli-necessary-caption">'.$cli_always_enable_text.'</span> ';
73
- $cli_cat_content=isset($necessary_cookie_options['necessary_description']) ? $necessary_cookie_options['necessary_description'] : '';
74
  }
75
  else
76
  {
77
  $cli_switch=
78
  '<div class="cli-switch">
79
- <input type="checkbox" id="checkbox-'.$key.'" class="cli-user-preference-checkbox" data-id="checkbox-'.$key.'" '.$cli_checked.' />
80
- <label for="checkbox-'.$key.'" class="cli-slider" data-cli-enable="'.$cli_enable_text.'" data-cli-disable="'.$cli_disable_text.'">'.$value.'</label>
81
  </div>';
82
- $cli_cat_content=isset($third_party_cookie_options['thirdparty_description']) ? $third_party_cookie_options['thirdparty_description'] : '';
83
  }
84
  ?>
85
  <?php
86
- $thirdparty_on_field=isset($third_party_cookie_options['thirdparty_on_field']) ? $third_party_cookie_options['thirdparty_on_field'] : false;
87
- $wt_cli_is_thirdparty_enabled = Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$thirdparty_on_field);
88
  if($key === "non-necessary" && $wt_cli_is_thirdparty_enabled == false)
89
  {
90
  echo '';
@@ -93,14 +79,14 @@ $necessary_cookie_options=get_option('cookielawinfo_necessary_settings');
93
  {?>
94
  <div class="cli-tab-section">
95
  <div class="cli-tab-header">
96
- <a class="cli-nav-link cli-settings-mobile" data-target="<?php echo $key; ?>" data-toggle="cli-toggle-tab" >
97
  <?php echo $value ?>
98
  </a>
99
  <?php echo $cli_switch; ?>
100
  </div>
101
  <div class="cli-tab-content">
102
  <div class="cli-tab-pane cli-fade" data-id="<?php echo $key; ?>">
103
- <p><?php echo do_shortcode($cli_cat_content, 'cookielawinfo-category' ); ?></p>
104
  </div>
105
  </div>
106
  </div>
13
  <div class="cli-col-12 cli-align-items-stretch cli-px-0">
14
  <div class="cli-privacy-overview">
15
  <?php
16
+ $overview_title = sanitize_text_field( stripslashes( isset($overview['privacy_overview_title']) ? $overview['privacy_overview_title'] : '' ) );
17
+ $privacy_overview_content = wp_kses_post( isset( $overview['privacy_overview_content'] ) ? $overview['privacy_overview_content'] : '' );
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 apply_filters('wt_cli_change_privacy_overview_title_tag', $overview_title, '<h4>', '</h4>');
24
  }
25
  ?>
26
  <div class="cli-privacy-content">
30
  </div>
31
  </div>
32
  <div class="cli-col-12 cli-align-items-stretch cli-px-0 cli-tab-section-container">
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  <?php
34
  $cookie_categories = self::get_cookie_categories();
35
  foreach ($cookie_categories as $key => $value)
57
  {
58
  $cli_switch='
59
  <span class="cli-necessary-caption">'.$cli_always_enable_text.'</span> ';
60
+ $cli_cat_content = wp_kses_post ( stripslashes( isset($necessary_cookie_options['necessary_description']) ? $necessary_cookie_options['necessary_description'] : '' ) );
61
  }
62
  else
63
  {
64
  $cli_switch=
65
  '<div class="cli-switch">
66
+ <input type="checkbox" id="wt-cli-checkbox-'.$key.'" class="cli-user-preference-checkbox" data-id="checkbox-'.$key.'" '.$cli_checked.' />
67
+ <label for="wt-cli-checkbox-'.$key.'" class="cli-slider" data-cli-enable="'.$cli_enable_text.'" data-cli-disable="'.$cli_disable_text.'"><span class="wt-cli-sr-only">'.$value.'</span></label>
68
  </div>';
69
+ $cli_cat_content = wp_kses_post( stripslashes( isset($third_party_cookie_options['thirdparty_description']) ? $third_party_cookie_options['thirdparty_description'] : '' ) );
70
  }
71
  ?>
72
  <?php
73
+ $wt_cli_is_thirdparty_enabled = (bool)( isset( $third_party_cookie_options['thirdparty_on_field'] ) ? Cookie_Law_Info::sanitise_settings('thirdparty_on_field',$third_party_cookie_options['thirdparty_on_field']) : false );
 
74
  if($key === "non-necessary" && $wt_cli_is_thirdparty_enabled == false)
75
  {
76
  echo '';
79
  {?>
80
  <div class="cli-tab-section">
81
  <div class="cli-tab-header">
82
+ <a role="button" tabindex="0" class="cli-nav-link cli-settings-mobile" data-target="<?php echo $key; ?>" data-toggle="cli-toggle-tab" >
83
  <?php echo $value ?>
84
  </a>
85
  <?php echo $cli_switch; ?>
86
  </div>
87
  <div class="cli-tab-content">
88
  <div class="cli-tab-pane cli-fade" data-id="<?php echo $key; ?>">
89
+ <p><?php echo do_shortcode( $cli_cat_content, 'cookielawinfo-category'); ?></p>
90
  </div>
91
  </div>
92
  </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.3
7
- Stable tag: 1.8.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -143,6 +143,17 @@ See http://cookielawinfo.com for more information on what is required.
143
 
144
  == Changelog ==
145
 
 
 
 
 
 
 
 
 
 
 
 
146
  = 1.8.2 =
147
 
148
  * Tested ok with WP 5.3
@@ -381,6 +392,8 @@ See http://cookielawinfo.com for more information on what is required.
381
 
382
  == Upgrade Notice ==
383
 
384
- = 1.8.2 =
385
 
386
- * Tested ok with WP 5.3
 
 
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.3
7
+ Stable tag: 1.8.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
143
 
144
  == Changelog ==
145
 
146
+ = 1.8.4 =
147
+
148
+ * Defaulted privacy overview heading tag to H4
149
+ * Introduced 'wt_cli_change_privacy_overview_title_tag' filter to change privacy overview heading tag
150
+ * Introduced 'wt_cli_add_custom_cookie_categories_name' filter to change cookie category names
151
+
152
+ = 1.8.3 =
153
+
154
+ * PHP 7.4 compatibility
155
+ * Security fix
156
+
157
  = 1.8.2 =
158
 
159
  * Tested ok with WP 5.3
392
 
393
  == Upgrade Notice ==
394
 
395
+ = 1.8.4 =
396
 
397
+ * Defaulted privacy overview heading tag to H4
398
+ * Introduced 'wt_cli_change_privacy_overview_title_tag' filter to change privacy overview heading tag
399
+ * Introduced 'wt_cli_add_custom_cookie_categories_name' filter to change cookie category names