Cookie Law / GDPR Info - Version 2.1.0

Version Description

Release Date - 17 February 2022

  • Improved: Validation & escaping for Security Enhancement.
Download this release

Release Info

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

Code changes from version 2.0.9 to 2.1.0

Files changed (70) hide show
  1. admin/class-cookie-law-info-admin.php +265 -295
  2. admin/css/cookie-law-info-admin-1.6.7.css +85 -85
  3. admin/css/cookie-law-info-admin.css +647 -647
  4. admin/index.php +1 -1
  5. admin/js/cookie-law-info-admin-1.6.7.js +214 -192
  6. admin/js/cookie-law-info-admin.js +317 -271
  7. admin/js/cookie-law-info-ckyes.js +305 -252
  8. admin/modules/ccpa/assets/js/cookie-law-info-ccpa-admin.js +47 -46
  9. admin/modules/ccpa/assets/js/cookie-law-info-ccpa.js +178 -163
  10. admin/modules/ccpa/ccpa.php +173 -178
  11. admin/modules/ccpa/views/ccpa_settings.php +21 -26
  12. admin/modules/cli-policy-generator/assets/css/editor-style.css +1 -1
  13. admin/modules/cli-policy-generator/assets/js/cli-policy-generator-admin.js +272 -238
  14. admin/modules/cli-policy-generator/classes/class-policy-generator-ajax.php +87 -86
  15. admin/modules/cli-policy-generator/classes/class-preview-page.php +133 -139
  16. admin/modules/cli-policy-generator/cli-policy-generator.php +100 -114
  17. admin/modules/cli-policy-generator/data/data.block4.php +1 -1
  18. admin/modules/cli-policy-generator/data/data.policy-generator.php +22 -22
  19. admin/modules/cli-policy-generator/views/policy-generator.php +33 -29
  20. admin/modules/cookie-scaner/assets/js/cookie-scaner.js +429 -378
  21. admin/modules/cookie-scaner/classes/class-cookie-law-info-cookie-scanner-ajax.php +19 -23
  22. admin/modules/cookie-scaner/cookie-scaner.php +62 -111
  23. admin/modules/cookie-scaner/views/scan-results.php +42 -24
  24. admin/modules/cookie-scaner/views/settings.php +13 -13
  25. admin/modules/cookies/cookies.php +43 -87
  26. admin/modules/cookies/views/necessary-settings.php +49 -48
  27. admin/modules/cookies/views/non-necessary-settings.php +80 -83
  28. admin/modules/uninstall-feedback/uninstall-feedback.php +36 -35
  29. admin/partials/cookie-law-info-admin_settings.php +132 -129
  30. admin/partials/cookie-law-info-privacy_overview.php +64 -58
  31. admin/views/admin-settings-advanced.php +18 -18
  32. admin/views/admin-settings-buttons.php +120 -91
  33. admin/views/admin-settings-general.php +30 -33
  34. admin/views/admin-settings-help.php +105 -105
  35. admin/views/admin-settings-messagebar.php +219 -211
  36. admin/views/admin-settings-save-button.php +2 -2
  37. admin/views/admin-settings-upgrade-pro.php +1 -1
  38. admin/views/admin_necessary_cookie.php +0 -58
  39. admin/views/admin_non_necessary_cookie.php +0 -93
  40. admin/views/goto-pro-v2.php +8 -7
  41. admin/views/goto-pro.php +0 -124
  42. cookie-law-info.php +3 -3
  43. includes/class-cookie-law-info-activator.php +1 -1
  44. includes/class-cookie-law-info-cookieyes.php +27 -26
  45. includes/class-cookie-law-info-deactivator.php +1 -3
  46. includes/class-cookie-law-info-loader.php +17 -17
  47. includes/class-cookie-law-info-review-request.php +244 -0
  48. includes/class-cookie-law-info-review_request.php +0 -254
  49. includes/class-cookie-law-info.php +487 -589
  50. includes/class-wt-security-helper.php +0 -179
  51. includes/index.php +1 -1
  52. index.php +1 -1
  53. public/class-cookie-law-info-public.php +213 -236
  54. public/css/cookie-law-info-gdpr.css +495 -495
  55. public/css/cookie-law-info-public.css +1 -1
  56. public/css/cookie-law-info-table.css +18 -19
  57. public/index.php +1 -1
  58. public/js/cookie-law-info-public.js +904 -906
  59. public/modules/script-blocker/assets/js/script-blocker.js +90 -79
  60. public/modules/script-blocker/integrations/facebook-for-wordpress.php +1 -1
  61. public/modules/script-blocker/integrations/instagram-feed.php +14 -14
  62. public/modules/script-blocker/integrations/twitter-feed.php +4 -4
  63. public/modules/script-blocker/script-blocker.php +696 -697
  64. public/modules/script-blocker/views/settings.php +230 -210
  65. public/modules/shortcode/shortcode.php +8 -6
  66. public/views/cookie-law-info_bar.php +30 -15
  67. public/views/cookie-law-info_popup_content.php +28 -44
  68. readme.txt +9 -4
  69. third-party/class-cookie-law-info-third-party.php +10 -15
  70. third-party/scripts/pixelyoursite/pixelyoursite.php +40 -46
admin/class-cookie-law-info-admin.php CHANGED
@@ -46,7 +46,7 @@ class Cookie_Law_Info_Admin {
46
  * admin module list, Module folder and main file must be same as that of module name
47
  * Please check the `admin_modules` method for more details
48
  */
49
- private $modules=array(
50
  'cookies',
51
  'cli-policy-generator',
52
  'ccpa',
@@ -54,54 +54,54 @@ class Cookie_Law_Info_Admin {
54
  'uninstall-feedback',
55
  );
56
 
57
- public static $existing_modules=array();
58
 
59
  /**
60
  * Initialize the class and set its properties.
61
  *
62
  * @since 1.6.6
63
- * @param string $plugin_name The name of this plugin.
64
- * @param string $version The version of this plugin.
65
  */
66
- public function __construct( $plugin_name, $version,$plugin_obj ) {
67
 
68
  $this->plugin_name = $plugin_name;
69
- $this->version = $version;
70
- $this->plugin_obj = $plugin_obj;
71
- add_action('admin_init',array( $this, 'load_plugin' ));
72
- register_activation_hook(CLI_PLUGIN_FILENAME,array($this,'activator'));
73
  // since 1.9.5 Initialize plugin settings
74
- add_action('wt_cli_initialize_plugin',array( $this, 'initialize_plugin_settings' ));
75
  }
76
-
77
  /**
78
- * Store default datas to the database if a first time user
79
- *
80
- * @since 2.3.1
81
- * @access public
82
- */
83
  public function activator() {
84
 
85
- if( Cookie_Law_Info::maybe_first_time_install() === true ) {
86
  add_option( 'wt_cli_first_time_activated_plugin', 'true' );
87
  }
88
  }
89
 
90
  public function set_default_settings() {
91
- $options = get_option(CLI_SETTINGS_FIELD);
92
- if( $options === false ) {
93
- $default = Cookie_Law_Info::get_settings();
94
- update_option(CLI_SETTINGS_FIELD,$default);
95
- }
96
  }
97
- public function set_privacy_overview_options(){
98
- $options = get_option('cookielawinfo_privacy_overview_content_settings');
99
- if( $options === false ) {
100
- $default = self::get_privacy_defaults();
101
- update_option('cookielawinfo_privacy_overview_content_settings',$default);
102
- }
103
  }
104
- public function initialize_plugin_settings(){
105
  $this->set_default_settings();
106
  $this->set_privacy_overview_options();
107
  }
@@ -123,10 +123,9 @@ class Cookie_Law_Info_Admin {
123
  * between the defined hooks and the functions defined in this
124
  * class.
125
  */
126
- if( isset($_GET['post_type']) && $_GET['post_type']==CLI_POST_TYPE || isset($_GET['page']) && $_GET['page'] == 'cookie-law-info' )
127
- {
128
  wp_enqueue_style( 'wp-color-picker' );
129
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) ."css/cookie-law-info-admin.css", array(),$this->version, 'all' );
130
  }
131
  }
132
 
@@ -148,31 +147,27 @@ class Cookie_Law_Info_Admin {
148
  * between the defined hooks and the functions defined in this
149
  * class.
150
  */
151
- if(isset($_GET['post_type']) && $_GET['post_type']==CLI_POST_TYPE) {
152
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/cookie-law-info-admin.js', array( 'jquery' ,'wp-color-picker'),$this->version, false );
153
  }
154
 
155
  }
156
 
157
  /**
158
- Registers admin modules
159
  */
160
- public function admin_modules()
161
- {
162
- foreach ($this->modules as $module) //loop through module list and include its file
163
- {
164
- $module_file=plugin_dir_path( __FILE__ )."modules/$module/$module.php";
165
- if(file_exists($module_file))
166
- {
167
- self::$existing_modules[]=$module; //this is for module_exits checking
168
  require_once $module_file;
169
- }
170
  }
171
  }
172
 
173
- public static function module_exists($module)
174
- {
175
- return in_array($module,self::$existing_modules);
176
  }
177
 
178
  /**
@@ -182,54 +177,49 @@ class Cookie_Law_Info_Admin {
182
  public function admin_menu() {
183
  global $submenu;
184
  add_submenu_page(
185
- 'edit.php?post_type='.CLI_POST_TYPE,
186
- __('Settings','cookie-law-info'),
187
- __('Settings','cookie-law-info'),
188
  'manage_options',
189
  'cookie-law-info',
190
- array($this,'admin_settings_page')
191
  );
192
  add_submenu_page(
193
- 'edit.php?post_type='.CLI_POST_TYPE,
194
- __('Privacy Overview','cookie-law-info'),
195
- __('Privacy Overview','cookie-law-info'),
196
  'manage_options',
197
  'cookie-law-info-poverview',
198
- array($this,'privacy_overview_page')
199
  );
200
- //rearrange settings menu
201
- if(isset($submenu) && !empty($submenu) && is_array($submenu))
202
- {
203
- $out=array();
204
- $back_up_settings_menu=array();
205
- if(isset($submenu['edit.php?post_type='.CLI_POST_TYPE]) && is_array($submenu['edit.php?post_type='.CLI_POST_TYPE]))
206
- {
207
- foreach ($submenu['edit.php?post_type='.CLI_POST_TYPE] as $key => $value)
208
- {
209
- if($value[2]=='cookie-law-info')
210
- {
211
- $back_up_settings_menu=$value;
212
- }else
213
- {
214
- $out[$key]=$value;
215
  }
216
  }
217
- array_unshift($out,$back_up_settings_menu);
218
- $submenu['edit.php?post_type='.CLI_POST_TYPE]=$out;
219
  }
220
  }
221
  }
222
  /**
223
- * Return the default privacy overview contents
224
- *
225
- * @since 1.9.2
226
- * @return array
227
- */
228
- public static function get_privacy_defaults(){
229
-
230
  $settings = array(
231
- 'privacy_overview_content' => 'This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are 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 affect your browsing experience.',
232
- 'privacy_overview_title' => 'Privacy Overview'
233
  );
234
  return $settings;
235
  }
@@ -237,122 +227,106 @@ class Cookie_Law_Info_Admin {
237
  * Privacy overview CMS page
238
  * @since 1.7.7
239
  */
240
- public function privacy_overview_page()
241
- {
242
- if (!current_user_can('manage_options'))
243
- {
244
- wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
245
  }
246
 
247
- $stored_options = get_option('cookielawinfo_privacy_overview_content_settings');
248
- $stored_options = ( isset( $stored_options ) && is_array( $stored_options ) ) ? $stored_options : array();
249
- $default_settings = self::get_privacy_defaults();
250
-
251
- $privacy_title = isset($stored_options['privacy_overview_title']) ? $stored_options['privacy_overview_title'] : $default_settings['privacy_overview_title'];
252
- $privacy_content = isset($stored_options['privacy_overview_content']) ? $stored_options['privacy_overview_content'] : $default_settings['privacy_overview_content'];
253
-
254
- if (isset($_POST['update_privacy_overview_content_settings_form'])) {
255
 
256
  // Check nonce:
257
- check_admin_referer('cookielawinfo-update-privacy-overview-content');
258
-
259
- $privacy_title = $stored_options['privacy_overview_title'] = sanitize_text_field( isset( $_POST['privacy_overview_title'] ) ? $_POST['privacy_overview_title'] : '' );
260
- $privacy_content = $stored_options['privacy_overview_content'] = wp_kses_post( isset( $_POST['privacy_overview_content'] ) && $_POST['privacy_overview_content'] !== '' ? $_POST['privacy_overview_content'] : '' );
261
-
262
- update_option('cookielawinfo_privacy_overview_content_settings', $stored_options);
263
- echo '<div class="updated"><p><strong>' . __('Settings Updated.', 'cookie-law-info') . '</strong></p></div>';
264
  }
265
 
266
- require_once plugin_dir_path( __FILE__ ).'partials/cookie-law-info-privacy_overview.php';
267
  }
268
- public function plugin_action_links( $links )
269
- {
270
- $links[] = '<a href="'. get_admin_url(null,'edit.php?post_type='.CLI_POST_TYPE.'&page=cookie-law-info') .'">'.__('Settings','cookie-law-info').'</a>';
271
- $links[] = '<a href="https://www.webtoffee.com/product/gdpr-cookie-consent/" target="_blank">'.__('Support','cookie-law-info').'</a>';
272
- $links[] = '<a href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_listing&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content='.CLI_VERSION.'" target="_blank" style="color: #3db634; font-weight: 500;">'.__('Premium Upgrade','cookie-law-info').'</a>';
273
- return $links;
274
  }
275
-
276
  /*
277
  * admin settings page
278
  */
279
- public function admin_settings_page()
280
- {
281
- // Lock out non-admins:
282
- if (!current_user_can('manage_options'))
283
- {
284
- wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
285
  }
286
  // Get options:
287
- $the_options =Cookie_Law_Info::get_settings();
288
- // Check if form has been set:
289
- if(isset($_POST['update_admin_settings_form']) || //normal php submit
290
- (isset($_POST['cli_settings_ajax_update']) && $_POST['cli_settings_ajax_update']=='update_admin_settings_form')) //ajax submit
291
- {
292
- // Check nonce:
293
- check_admin_referer('cookielawinfo-update-' . CLI_SETTINGS_FIELD);
294
-
295
- //module settings saving hook
296
- do_action('cli_module_save_settings');
297
-
298
- foreach($the_options as $key => $value)
299
- {
300
- if(isset($_POST[$key . '_field']))
301
- {
302
- // Store sanitised values only:
303
- $the_options[$key] = Cookie_Law_Info::sanitise_settings($key, $_POST[$key . '_field']);
304
- }
 
 
 
 
 
 
 
 
 
 
 
 
305
  }
306
- $the_options = apply_filters('wt_cli_before_save_settings',$the_options, $_POST);
307
- update_option(CLI_SETTINGS_FIELD, $the_options);
308
- do_action('wt_cli_ajax_settings_update',$_POST);
309
- echo '<div class="updated"><p><strong>' . __('Settings Updated.', 'cookie-law-info') . '</strong></p></div>';
310
- }
311
- elseif (isset($_POST['delete_all_settings']) || //normal php submit
312
- (isset($_POST['cli_settings_ajax_update']) && $_POST['cli_settings_ajax_update']=='delete_all_settings')) //ajax submit
313
- {
314
- // Check nonce:
315
- check_admin_referer('cookielawinfo-update-' . CLI_SETTINGS_FIELD);
316
- $this->delete_settings();
317
- //$the_options = Cookie_Law_Info::get_settings();
318
- //exit();
319
- }
320
- elseif (isset($_POST['revert_to_previous_settings'])) //disabled on new update
321
- {
322
- if (!$this->copy_old_settings_to_new())
323
- {
324
- echo '<h3>' . __('ERROR MIGRATING SETTINGS (ERROR: 2)', 'cookie-law-info') . '</h3>';
325
- }
326
- $the_options = Cookie_Law_Info::get_settings();
327
- }
328
- if(!empty($_SERVER[ 'HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])=='xmlhttprequest')
329
- {
330
- exit();
331
- }
332
- require_once plugin_dir_path( __FILE__ ).'partials/cookie-law-info-admin_settings.php';
333
  }
334
 
335
  /**
336
  Add custom meta boxes to Cookie Audit custom post type.
337
- - Cookie Type (e.g. session, permanent)
338
- - Cookie Duration (e.g. 2 hours, days, years, etc)
339
  */
340
-
341
 
342
-
 
343
 
344
  /** Apply column names to the custom post type table */
345
-
346
-
347
- function remove_cli_addnew_link()
348
- {
349
- global $submenu;
350
- if(isset($submenu) && !empty($submenu) && is_array($submenu))
351
- {
352
- unset($submenu['edit.php?post_type='.CLI_POST_TYPE][10]);
353
  }
354
  }
355
-
356
 
357
  /** Updates latest version number of plugin */
358
  public function update_to_latest_version_number() {
@@ -363,14 +337,11 @@ class Cookie_Law_Info_Admin {
363
  WARNING - this has a predictable result i.e. will delete saved settings! Once deleted,
364
  the get_admin_options() function will not find saved settings so will return default values
365
  */
366
- public function delete_settings()
367
- {
368
- if(defined( 'CLI_ADMIN_OPTIONS_NAME' ))
369
- {
370
  delete_option( CLI_ADMIN_OPTIONS_NAME );
371
  }
372
- if ( defined ( 'CLI_SETTINGS_FIELD' ) )
373
- {
374
  delete_option( CLI_SETTINGS_FIELD );
375
  }
376
  }
@@ -378,25 +349,24 @@ class Cookie_Law_Info_Admin {
378
  public function copy_old_settings_to_new() {
379
  $new_settings = Cookie_Law_Info::get_settings();
380
  $old_settings = get_option( CLI_ADMIN_OPTIONS_NAME );
381
-
382
  if ( empty( $old_settings ) ) {
383
  // Something went wrong:
384
  return false;
385
- }
386
- else {
387
  // Copy over settings:
388
- $new_settings['background'] = $old_settings['colour_bg'];
389
- $new_settings['border'] = $old_settings['colour_border'];
390
- $new_settings['button_1_action'] = 'CONSTANT_OPEN_URL';
391
- $new_settings['button_1_text'] = $old_settings['link_text'];
392
- $new_settings['button_1_url'] = $old_settings['link_url'];
393
- $new_settings['button_1_link_colour'] = $old_settings['colour_link'];
394
- $new_settings['button_1_new_win'] = $old_settings['link_opens_new_window'];
395
- $new_settings['button_1_as_button'] = $old_settings['show_as_button'];
396
- $new_settings['button_1_button_colour'] = $old_settings['colour_button_bg'];
397
- $new_settings['notify_message'] = $old_settings['message_text'];
398
- $new_settings['text'] = $old_settings['colour_text'];
399
-
400
  // Save new values:
401
  update_option( CLI_SETTINGS_FIELD, $new_settings );
402
  }
@@ -404,15 +374,15 @@ class Cookie_Law_Info_Admin {
404
  }
405
  /** Migrates settings from version 0.8.3 to version 0.9 */
406
  public function migrate_to_new_version() {
407
-
408
  if ( $this->has_migrated() ) {
409
  return false;
410
  }
411
-
412
- if ( !$this->copy_old_settings_to_new() ) {
413
  return false;
414
  }
415
-
416
  // Register that have completed:
417
  $this->update_to_latest_version_number();
418
  return true;
@@ -427,7 +397,7 @@ class Cookie_Law_Info_Admin {
427
  }
428
  // Test for latest version number
429
  $version = get_option( CLI_MIGRATED_VERSION );
430
- if ( empty ( $version ) ) {
431
  // No version stored; not yet migrated:
432
  return false;
433
  }
@@ -435,26 +405,25 @@ class Cookie_Law_Info_Admin {
435
  // Are on latest version
436
  return true;
437
  }
438
- echo 'VERSION: ' . esc_html( $version ). '<br /> V2: ' . CLI_LATEST_VERSION_NUMBER;
439
  // If you got this far then you're on an inbetween version
440
  return false;
441
  }
442
 
443
  /**
444
  Prints a combobox based on options and selected=match value
445
-
446
  Parameters:
447
- $options = array of options (suggest using helper functions)
448
- $selected = which of those options should be selected (allows just one; is case sensitive)
449
-
450
  Outputs (based on array ( $key => $value ):
451
- <option value=$value>$key</option>
452
- <option value=$value selected="selected">$key</option>
453
  */
454
- public function print_combobox_options( $options, $selected )
455
- {
456
  foreach ( $options as $option ) {
457
- echo '<option value="' . $option['value'] . '"';
458
  if ( $option['value'] == $selected ) {
459
  echo ' selected="selected"';
460
  }
@@ -469,12 +438,13 @@ class Cookie_Law_Info_Admin {
469
  public function get_js_actions() {
470
  $js_actions = array(
471
  'close_header' => array(
472
- 'text'=>__('Close consent bar','cookie-law-info'),
473
- 'value'=>'#cookie_action_close_header'
474
- ),
475
- 'open_url' => array(
476
- 'text' => __('Redirect to URL on click','cookie-law-info'),
477
- 'value'=>'CONSTANT_OPEN_URL') // Don't change this value, is used by jQuery
 
478
  );
479
  return $js_actions;
480
  }
@@ -484,23 +454,23 @@ class Cookie_Law_Info_Admin {
484
  Used when printing admin form (for combo boxes)
485
  */
486
  public function get_button_sizes() {
487
- $sizes = Array(
488
- 'super'=> array(
489
- 'text'=>__('Extra Large','cookie-law-info'),
490
- 'value'=>'super'
491
- ),
492
- 'large' => array(
493
- 'text'=>__('Large','cookie-law-info'),
494
- 'value'=>'large'
495
- ),
496
- 'medium' => array(
497
- 'text'=>__('Medium','cookie-law-info'),
498
- 'value'=>'medium'
499
- ),
500
- 'small' => array(
501
- 'text'=>__('Small','cookie-law-info'),
502
- 'value'=>'small'
503
- ),
504
  );
505
  return $sizes;
506
  }
@@ -510,77 +480,77 @@ class Cookie_Law_Info_Admin {
510
  Used when printing admin form (for combo box)
511
  */
512
  public function get_fonts() {
513
- $fonts = Array(
514
- 'default'=> array(
515
- 'text'=>__('Default theme font','cookie-law-info'),
516
- 'value'=>'inherit'
517
- ),
518
- 'sans_serif'=> array(
519
- 'text'=>__('Sans Serif','cookie-law-info'),
520
- 'value'=>'Helvetica, Arial, sans-serif'
521
- ),
522
- 'serif'=> array(
523
- 'text'=>__('Serif','cookie-law-info'),
524
- 'value'=>'Georgia, Times New Roman, Times, serif'
525
- ),
526
- 'arial'=> array(
527
- 'text'=>__('Arial','cookie-law-info'),
528
- 'value'=>'Arial, Helvetica, sans-serif'
529
- ),
530
- 'arial_black'=> array(
531
- 'text'=>__('Arial Black','cookie-law-info'),
532
- 'value'=>'Arial Black,Gadget,sans-serif'
533
- ),
534
- 'georgia'=> array(
535
- 'text'=>__('Georgia, serif','cookie-law-info'),
536
- 'value'=>'Georgia, serif'
537
- ),
538
- 'helvetica'=> array(
539
- 'text'=>__('Helvetica','cookie-law-info'),
540
- 'value'=>'Helvetica, sans-serif'
541
- ),
542
- 'lucida'=> array(
543
- 'text'=>__('Lucida','cookie-law-info'),
544
- 'value'=>'Lucida Sans Unicode, Lucida Grande, sans-serif'
545
- ),
546
- 'tahoma'=> array(
547
- 'text'=>__('Tahoma','cookie-law-info'),
548
- 'value'=>'Tahoma, Geneva, sans-serif'
549
- ),
550
- 'times_new_roman'=> array(
551
- 'text'=>__('Times New Roman','cookie-law-info'),
552
- 'value'=>'Times New Roman, Times, serif'
553
- ),
554
- 'trebuchet'=> array(
555
- 'text'=>__('Trebuchet','cookie-law-info'),
556
- 'value'=>'Trebuchet MS, sans-serif'
557
- ),
558
- 'verdana'=> array(
559
- 'text'=>__('Verdana','cookie-law-info'),
560
- 'value'=>'Verdana, Geneva'
561
- ),
562
- );
563
  return $fonts;
564
  }
565
 
566
  /**
567
- * Set plugin default plugin on activation
568
- *
569
- * @since 1.9.5
570
- * @access public
571
- */
 
 
572
 
573
- public function load_plugin(){
574
-
575
  if ( is_admin() && get_option( 'wt_cli_first_time_activated_plugin' ) == 'true' ) {
576
- do_action('wt_cli_initialize_plugin');
577
- delete_option('wt_cli_first_time_activated_plugin');
578
  }
579
  $this->redirect_to_settings_page();
580
  }
581
- public static function wt_cli_admin_notice( $type='info', $message='', $icon= false ){
582
- $icon_class = ( true === $icon ) ? 'wt-cli-callout-icon':'';
583
- $html = '<div class="wt-cli-callout wt-cli-callout-'.$type.' '.$icon_class.' ">'.$message.'</div>';
584
  return $html;
585
  }
586
  public function redirect_to_settings_page() {
@@ -589,5 +559,5 @@ class Cookie_Law_Info_Admin {
589
  exit();
590
  }
591
  }
592
-
593
  }
46
  * admin module list, Module folder and main file must be same as that of module name
47
  * Please check the `admin_modules` method for more details
48
  */
49
+ private $modules = array(
50
  'cookies',
51
  'cli-policy-generator',
52
  'ccpa',
54
  'uninstall-feedback',
55
  );
56
 
57
+ public static $existing_modules = array();
58
 
59
  /**
60
  * Initialize the class and set its properties.
61
  *
62
  * @since 1.6.6
63
+ * @param string $plugin_name The name of this plugin.
64
+ * @param string $version The version of this plugin.
65
  */
66
+ public function __construct( $plugin_name, $version, $plugin_obj ) {
67
 
68
  $this->plugin_name = $plugin_name;
69
+ $this->version = $version;
70
+ $this->plugin_obj = $plugin_obj;
71
+ add_action( 'admin_init', array( $this, 'load_plugin' ) );
72
+ register_activation_hook( CLI_PLUGIN_FILENAME, array( $this, 'activator' ) );
73
  // since 1.9.5 Initialize plugin settings
74
+ add_action( 'wt_cli_initialize_plugin', array( $this, 'initialize_plugin_settings' ) );
75
  }
76
+
77
  /**
78
+ * Store default datas to the database if a first time user
79
+ *
80
+ * @since 2.3.1
81
+ * @access public
82
+ */
83
  public function activator() {
84
 
85
+ if ( Cookie_Law_Info::maybe_first_time_install() === true ) {
86
  add_option( 'wt_cli_first_time_activated_plugin', 'true' );
87
  }
88
  }
89
 
90
  public function set_default_settings() {
91
+ $options = get_option( CLI_SETTINGS_FIELD );
92
+ if ( $options === false ) {
93
+ $default = Cookie_Law_Info::get_settings();
94
+ update_option( CLI_SETTINGS_FIELD, $default );
95
+ }
96
  }
97
+ public function set_privacy_overview_options() {
98
+ $options = get_option( 'cookielawinfo_privacy_overview_content_settings' );
99
+ if ( $options === false ) {
100
+ $default = self::get_privacy_defaults();
101
+ update_option( 'cookielawinfo_privacy_overview_content_settings', $default );
102
+ }
103
  }
104
+ public function initialize_plugin_settings() {
105
  $this->set_default_settings();
106
  $this->set_privacy_overview_options();
107
  }
123
  * between the defined hooks and the functions defined in this
124
  * class.
125
  */
126
+ if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == CLI_POST_TYPE || isset( $_GET['page'] ) && $_GET['page'] == 'cookie-law-info' ) {
 
127
  wp_enqueue_style( 'wp-color-picker' );
128
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/cookie-law-info-admin.css', array(), $this->version, 'all' );
129
  }
130
  }
131
 
147
  * between the defined hooks and the functions defined in this
148
  * class.
149
  */
150
+ if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == CLI_POST_TYPE ) {
151
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/cookie-law-info-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, false );
152
  }
153
 
154
  }
155
 
156
  /**
157
+ Registers admin modules
158
  */
159
+ public function admin_modules() {
160
+ foreach ( $this->modules as $module ) {
161
+ $module_file = plugin_dir_path( __FILE__ ) . "modules/$module/$module.php";
162
+ if ( file_exists( $module_file ) ) {
163
+ self::$existing_modules[] = $module; // this is for module_exits checking
 
 
 
164
  require_once $module_file;
165
+ }
166
  }
167
  }
168
 
169
+ public static function module_exists( $module ) {
170
+ return in_array( $module, self::$existing_modules );
 
171
  }
172
 
173
  /**
177
  public function admin_menu() {
178
  global $submenu;
179
  add_submenu_page(
180
+ 'edit.php?post_type=' . CLI_POST_TYPE,
181
+ __( 'Settings', 'cookie-law-info' ),
182
+ __( 'Settings', 'cookie-law-info' ),
183
  'manage_options',
184
  'cookie-law-info',
185
+ array( $this, 'admin_settings_page' )
186
  );
187
  add_submenu_page(
188
+ 'edit.php?post_type=' . CLI_POST_TYPE,
189
+ __( 'Privacy Overview', 'cookie-law-info' ),
190
+ __( 'Privacy Overview', 'cookie-law-info' ),
191
  'manage_options',
192
  'cookie-law-info-poverview',
193
+ array( $this, 'privacy_overview_page' )
194
  );
195
+ // rearrange settings menu
196
+ if ( isset( $submenu ) && ! empty( $submenu ) && is_array( $submenu ) ) {
197
+ $out = array();
198
+ $back_up_settings_menu = array();
199
+ if ( isset( $submenu[ 'edit.php?post_type=' . CLI_POST_TYPE ] ) && is_array( $submenu[ 'edit.php?post_type=' . CLI_POST_TYPE ] ) ) {
200
+ foreach ( $submenu[ 'edit.php?post_type=' . CLI_POST_TYPE ] as $key => $value ) {
201
+ if ( $value[2] == 'cookie-law-info' ) {
202
+ $back_up_settings_menu = $value;
203
+ } else {
204
+ $out[ $key ] = $value;
 
 
 
 
 
205
  }
206
  }
207
+ array_unshift( $out, $back_up_settings_menu );
208
+ $submenu[ 'edit.php?post_type=' . CLI_POST_TYPE ] = $out;
209
  }
210
  }
211
  }
212
  /**
213
+ * Return the default privacy overview contents
214
+ *
215
+ * @since 1.9.2
216
+ * @return array
217
+ */
218
+ public static function get_privacy_defaults() {
219
+
220
  $settings = array(
221
+ 'privacy_overview_content' => 'This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are 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 affect your browsing experience.',
222
+ 'privacy_overview_title' => 'Privacy Overview',
223
  );
224
  return $settings;
225
  }
227
  * Privacy overview CMS page
228
  * @since 1.7.7
229
  */
230
+ public function privacy_overview_page() {
231
+ if ( ! current_user_can( 'manage_options' ) ) {
232
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
 
 
233
  }
234
 
235
+ $stored_options = get_option( 'cookielawinfo_privacy_overview_content_settings' );
236
+ $stored_options = ( isset( $stored_options ) && is_array( $stored_options ) ) ? $stored_options : array();
237
+ $default_settings = self::get_privacy_defaults();
238
+
239
+ $privacy_title = isset( $stored_options['privacy_overview_title'] ) ? $stored_options['privacy_overview_title'] : $default_settings['privacy_overview_title'];
240
+ $privacy_content = isset( $stored_options['privacy_overview_content'] ) ? $stored_options['privacy_overview_content'] : $default_settings['privacy_overview_content'];
241
+
242
+ if ( isset( $_POST['update_privacy_overview_content_settings_form'] ) ) {
243
 
244
  // Check nonce:
245
+ check_admin_referer( 'cookielawinfo-update-privacy-overview-content' );
246
+
247
+ $privacy_title = $stored_options['privacy_overview_title'] = sanitize_text_field( isset( $_POST['privacy_overview_title'] ) ? wp_unslash( $_POST['privacy_overview_title'] ) : '' );
248
+ $privacy_content = $stored_options['privacy_overview_content'] = wp_kses_post( isset( $_POST['privacy_overview_content'] ) && $_POST['privacy_overview_content'] !== '' ? wp_unslash( $_POST['privacy_overview_content'] ) : '' );
249
+
250
+ update_option( 'cookielawinfo_privacy_overview_content_settings', $stored_options );
251
+ echo '<div class="updated"><p><strong>' . esc_html__( 'Settings Updated.', 'cookie-law-info' ) . '</strong></p></div>';
252
  }
253
 
254
+ require_once plugin_dir_path( __FILE__ ) . 'partials/cookie-law-info-privacy_overview.php';
255
  }
256
+ public function plugin_action_links( $links ) {
257
+ $links[] = '<a href="' . get_admin_url( null, 'edit.php?post_type=' . CLI_POST_TYPE . '&page=cookie-law-info' ) . '">' . __( 'Settings', 'cookie-law-info' ) . '</a>';
258
+ $links[] = '<a href="https://www.webtoffee.com/product/gdpr-cookie-consent/" target="_blank">' . esc_html__( 'Support', 'cookie-law-info' ) . '</a>';
259
+ $links[] = '<a href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_listing&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=' . CLI_VERSION . '" target="_blank" style="color: #3db634; font-weight: 500;">' . __( 'Premium Upgrade', 'cookie-law-info' ) . '</a>';
260
+ return $links;
 
261
  }
262
+
263
  /*
264
  * admin settings page
265
  */
266
+ public function admin_settings_page() {
267
+ // Lock out non-admins:
268
+ if ( ! current_user_can( 'manage_options' ) ) {
269
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
 
 
270
  }
271
  // Get options:
272
+ $the_options = Cookie_Law_Info::get_settings();
273
+ // Check if form has been set:
274
+ if ( isset( $_POST['update_admin_settings_form'] ) || // normal php submit
275
+ ( isset( $_POST['cli_settings_ajax_update'] ) && $_POST['cli_settings_ajax_update'] == 'update_admin_settings_form' ) ) {
276
+ // Check nonce:
277
+ check_admin_referer( 'cookielawinfo-update-' . CLI_SETTINGS_FIELD );
278
+
279
+ // module settings saving hook
280
+ do_action( 'cli_module_save_settings' );
281
+
282
+ foreach ( $the_options as $key => $value ) {
283
+ if ( isset( $_POST[ $key . '_field' ] ) ) {
284
+ // Store sanitised values only:
285
+ $the_options[ $key ] = Cookie_Law_Info::sanitise_settings( $key, wp_unslash( $_POST[ $key . '_field' ] ) );
286
+ }
287
+ }
288
+ $the_options = apply_filters( 'wt_cli_before_save_settings', $the_options, $_POST );
289
+ update_option( CLI_SETTINGS_FIELD, $the_options );
290
+ do_action( 'wt_cli_ajax_settings_update', $_POST );
291
+ echo '<div class="updated"><p><strong>' . esc_html__( 'Settings Updated.', 'cookie-law-info' ) . '</strong></p></div>';
292
+ } elseif ( isset( $_POST['delete_all_settings'] ) || // normal php submit
293
+ ( isset( $_POST['cli_settings_ajax_update'] ) && $_POST['cli_settings_ajax_update'] == 'delete_all_settings' ) ) {
294
+ // Check nonce:
295
+ check_admin_referer( 'cookielawinfo-update-' . CLI_SETTINGS_FIELD );
296
+ $this->delete_settings();
297
+ // $the_options = Cookie_Law_Info::get_settings();
298
+ // exit();
299
+ } elseif ( isset( $_POST['revert_to_previous_settings'] ) ) {
300
+ if ( ! $this->copy_old_settings_to_new() ) {
301
+ echo '<h3>' . esc_html__( 'ERROR MIGRATING SETTINGS (ERROR: 2)', 'cookie-law-info' ) . '</h3>';
302
  }
303
+ $the_options = Cookie_Law_Info::get_settings();
304
+ }
305
+ if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ) ) == 'xmlhttprequest' ) {
306
+ exit();
307
+ }
308
+ require_once plugin_dir_path( __FILE__ ) . 'partials/cookie-law-info-admin_settings.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
 
311
  /**
312
  Add custom meta boxes to Cookie Audit custom post type.
313
+ - Cookie Type (e.g. session, permanent)
314
+ - Cookie Duration (e.g. 2 hours, days, years, etc)
315
  */
 
316
 
317
+
318
+
319
 
320
  /** Apply column names to the custom post type table */
321
+
322
+
323
+ function remove_cli_addnew_link() {
324
+ global $submenu;
325
+ if ( isset( $submenu ) && ! empty( $submenu ) && is_array( $submenu ) ) {
326
+ unset( $submenu[ 'edit.php?post_type=' . CLI_POST_TYPE ][10] );
 
 
327
  }
328
  }
329
+
330
 
331
  /** Updates latest version number of plugin */
332
  public function update_to_latest_version_number() {
337
  WARNING - this has a predictable result i.e. will delete saved settings! Once deleted,
338
  the get_admin_options() function will not find saved settings so will return default values
339
  */
340
+ public function delete_settings() {
341
+ if ( defined( 'CLI_ADMIN_OPTIONS_NAME' ) ) {
 
 
342
  delete_option( CLI_ADMIN_OPTIONS_NAME );
343
  }
344
+ if ( defined( 'CLI_SETTINGS_FIELD' ) ) {
 
345
  delete_option( CLI_SETTINGS_FIELD );
346
  }
347
  }
349
  public function copy_old_settings_to_new() {
350
  $new_settings = Cookie_Law_Info::get_settings();
351
  $old_settings = get_option( CLI_ADMIN_OPTIONS_NAME );
352
+
353
  if ( empty( $old_settings ) ) {
354
  // Something went wrong:
355
  return false;
356
+ } else {
 
357
  // Copy over settings:
358
+ $new_settings['background'] = $old_settings['colour_bg'];
359
+ $new_settings['border'] = $old_settings['colour_border'];
360
+ $new_settings['button_1_action'] = 'CONSTANT_OPEN_URL';
361
+ $new_settings['button_1_text'] = $old_settings['link_text'];
362
+ $new_settings['button_1_url'] = $old_settings['link_url'];
363
+ $new_settings['button_1_link_colour'] = $old_settings['colour_link'];
364
+ $new_settings['button_1_new_win'] = $old_settings['link_opens_new_window'];
365
+ $new_settings['button_1_as_button'] = $old_settings['show_as_button'];
366
+ $new_settings['button_1_button_colour'] = $old_settings['colour_button_bg'];
367
+ $new_settings['notify_message'] = $old_settings['message_text'];
368
+ $new_settings['text'] = $old_settings['colour_text'];
369
+
370
  // Save new values:
371
  update_option( CLI_SETTINGS_FIELD, $new_settings );
372
  }
374
  }
375
  /** Migrates settings from version 0.8.3 to version 0.9 */
376
  public function migrate_to_new_version() {
377
+
378
  if ( $this->has_migrated() ) {
379
  return false;
380
  }
381
+
382
+ if ( ! $this->copy_old_settings_to_new() ) {
383
  return false;
384
  }
385
+
386
  // Register that have completed:
387
  $this->update_to_latest_version_number();
388
  return true;
397
  }
398
  // Test for latest version number
399
  $version = get_option( CLI_MIGRATED_VERSION );
400
+ if ( empty( $version ) ) {
401
  // No version stored; not yet migrated:
402
  return false;
403
  }
405
  // Are on latest version
406
  return true;
407
  }
408
+ echo 'VERSION: ' . esc_html( $version ) . '<br /> V2: ' . esc_html( CLI_LATEST_VERSION_NUMBER );
409
  // If you got this far then you're on an inbetween version
410
  return false;
411
  }
412
 
413
  /**
414
  Prints a combobox based on options and selected=match value
415
+
416
  Parameters:
417
+ $options = array of options (suggest using helper functions)
418
+ $selected = which of those options should be selected (allows just one; is case sensitive)
419
+
420
  Outputs (based on array ( $key => $value ):
421
+ <option value=$value>$key</option>
422
+ <option value=$value selected="selected">$key</option>
423
  */
424
+ public function print_combobox_options( $options, $selected ) {
 
425
  foreach ( $options as $option ) {
426
+ echo '<option value="' . esc_attr( $option['value'] ) . '"';
427
  if ( $option['value'] == $selected ) {
428
  echo ' selected="selected"';
429
  }
438
  public function get_js_actions() {
439
  $js_actions = array(
440
  'close_header' => array(
441
+ 'text' => __( 'Close consent bar', 'cookie-law-info' ),
442
+ 'value' => '#cookie_action_close_header',
443
+ ),
444
+ 'open_url' => array(
445
+ 'text' => __( 'Redirect to URL on click', 'cookie-law-info' ),
446
+ 'value' => 'CONSTANT_OPEN_URL',
447
+ ), // Don't change this value, is used by jQuery
448
  );
449
  return $js_actions;
450
  }
454
  Used when printing admin form (for combo boxes)
455
  */
456
  public function get_button_sizes() {
457
+ $sizes = array(
458
+ 'super' => array(
459
+ 'text' => __( 'Extra Large', 'cookie-law-info' ),
460
+ 'value' => 'super',
461
+ ),
462
+ 'large' => array(
463
+ 'text' => __( 'Large', 'cookie-law-info' ),
464
+ 'value' => 'large',
465
+ ),
466
+ 'medium' => array(
467
+ 'text' => __( 'Medium', 'cookie-law-info' ),
468
+ 'value' => 'medium',
469
+ ),
470
+ 'small' => array(
471
+ 'text' => __( 'Small', 'cookie-law-info' ),
472
+ 'value' => 'small',
473
+ ),
474
  );
475
  return $sizes;
476
  }
480
  Used when printing admin form (for combo box)
481
  */
482
  public function get_fonts() {
483
+ $fonts = array(
484
+ 'default' => array(
485
+ 'text' => __( 'Default theme font', 'cookie-law-info' ),
486
+ 'value' => 'inherit',
487
+ ),
488
+ 'sans_serif' => array(
489
+ 'text' => __( 'Sans Serif', 'cookie-law-info' ),
490
+ 'value' => 'Helvetica, Arial, sans-serif',
491
+ ),
492
+ 'serif' => array(
493
+ 'text' => __( 'Serif', 'cookie-law-info' ),
494
+ 'value' => 'Georgia, Times New Roman, Times, serif',
495
+ ),
496
+ 'arial' => array(
497
+ 'text' => __( 'Arial', 'cookie-law-info' ),
498
+ 'value' => 'Arial, Helvetica, sans-serif',
499
+ ),
500
+ 'arial_black' => array(
501
+ 'text' => __( 'Arial Black', 'cookie-law-info' ),
502
+ 'value' => 'Arial Black,Gadget,sans-serif',
503
+ ),
504
+ 'georgia' => array(
505
+ 'text' => __( 'Georgia, serif', 'cookie-law-info' ),
506
+ 'value' => 'Georgia, serif',
507
+ ),
508
+ 'helvetica' => array(
509
+ 'text' => __( 'Helvetica', 'cookie-law-info' ),
510
+ 'value' => 'Helvetica, sans-serif',
511
+ ),
512
+ 'lucida' => array(
513
+ 'text' => __( 'Lucida', 'cookie-law-info' ),
514
+ 'value' => 'Lucida Sans Unicode, Lucida Grande, sans-serif',
515
+ ),
516
+ 'tahoma' => array(
517
+ 'text' => __( 'Tahoma', 'cookie-law-info' ),
518
+ 'value' => 'Tahoma, Geneva, sans-serif',
519
+ ),
520
+ 'times_new_roman' => array(
521
+ 'text' => __( 'Times New Roman', 'cookie-law-info' ),
522
+ 'value' => 'Times New Roman, Times, serif',
523
+ ),
524
+ 'trebuchet' => array(
525
+ 'text' => __( 'Trebuchet', 'cookie-law-info' ),
526
+ 'value' => 'Trebuchet MS, sans-serif',
527
+ ),
528
+ 'verdana' => array(
529
+ 'text' => __( 'Verdana', 'cookie-law-info' ),
530
+ 'value' => 'Verdana, Geneva',
531
+ ),
532
+ );
533
  return $fonts;
534
  }
535
 
536
  /**
537
+ * Set plugin default plugin on activation
538
+ *
539
+ * @since 1.9.5
540
+ * @access public
541
+ */
542
+
543
+ public function load_plugin() {
544
 
 
 
545
  if ( is_admin() && get_option( 'wt_cli_first_time_activated_plugin' ) == 'true' ) {
546
+ do_action( 'wt_cli_initialize_plugin' );
547
+ delete_option( 'wt_cli_first_time_activated_plugin' );
548
  }
549
  $this->redirect_to_settings_page();
550
  }
551
+ public static function wt_cli_admin_notice( $type = 'info', $message = '', $icon = false ) {
552
+ $icon_class = ( true === $icon ) ? 'wt-cli-callout-icon' : '';
553
+ $html = '<div class="wt-cli-callout wt-cli-callout-' . $type . ' ' . $icon_class . ' ">' . $message . '</div>';
554
  return $html;
555
  }
556
  public function redirect_to_settings_page() {
559
  exit();
560
  }
561
  }
562
+
563
  }
admin/css/cookie-law-info-admin-1.6.7.css CHANGED
@@ -66,22 +66,22 @@
66
  }
67
  .cli-plugin-toolbar.bottom {
68
  margin-top: 12px;
69
- background: #f5f5f5;
70
- border-top: 1px solid #ddd;
71
- margin-left: -15px;
72
- margin-right: -15px;
73
- margin-bottom: -15px;
74
- padding:15px;
75
  }
76
  .cli-plugin-toolbar.top {
77
- margin-top:-15px;
78
- background: #f5f5f5;
79
- border-bottom: 1px solid #ddd;
80
- border-top: 1px solid #ddd;
81
- margin-left: -15px;
82
- margin-right: -15px;
83
- margin-bottom: -15px;
84
- padding:15px;
85
  }
86
  #header_on_off_field_warning {
87
  margin-left: 30px;
@@ -128,115 +128,115 @@
128
 
129
 
130
  table.cli_script_items{
131
- position:relative
132
  }
133
  table.cli_script_items td,table.cli_script_items th{
134
- display:table-cell!important;
135
- padding:1em!important;
136
- vertical-align:top;
137
- line-height:1.75em
138
  }
139
  table.wc_emails.wc_emails td,table.cli_script_items.wc_emails td,table.wc_shipping.wc_emails td{
140
- vertical-align:middle
141
  }
142
  table.cli_script_items tr:nth-child(odd) td{
143
- background:#f9f9f9
144
  }
145
  table.cli_script_items td.name{
146
- font-weight:700
147
  }
148
  table.wc_emails .settings,table.cli_script_items .settings,table.wc_shipping .settings{
149
- text-align:right
150
  }
151
  table.wc_emails .default,table.wc_emails .radio,table.wc_emails .status,table.cli_script_items .default,table.cli_script_items .radio,table.cli_script_items .status,table.wc_shipping .default,table.wc_shipping .radio,table.wc_shipping .status{
152
- text-align:center
153
  }
154
  table.wc_emails .default .tips,table.wc_emails .radio .tips,table.wc_emails .status .tips,table.cli_script_items .default .tips,table.cli_script_items .radio .tips,table.cli_script_items .status .tips,table.wc_shipping .default .tips,table.wc_shipping .radio .tips,table.wc_shipping .status .tips{
155
- margin:0 auto
156
  }
157
  table.wc_emails .default input,table.wc_emails .radio input,table.wc_emails .status input,table.cli_script_items .default input,table.cli_script_items .radio input,table.cli_script_items .status input,table.wc_shipping .default input,table.wc_shipping .radio input,table.wc_shipping .status input{
158
- margin:0
159
  }
160
  table.wc_emails td.sort,table.cli_script_items td.sort,table.wc_shipping td.sort{
161
- cursor:move;
162
- font-size:15px;
163
- text-align:center
164
  }
165
  table.wc_emails td.sort::before,table.cli_script_items td.sort::before,table.wc_shipping td.sort::before{
166
- content:'\f333';
167
- font-family:Dashicons;
168
- text-align:center;
169
- line-height:1;
170
- color:#999;
171
- display:block;
172
- width:17px;
173
- float:left;
174
- height:100%;
175
- line-height:24px
176
  }
177
  table.wc_emails .wc-payment-gateway-method-name,table.cli_script_items .wc-payment-gateway-method-name,table.wc_shipping .wc-payment-gateway-method-name{
178
- font-weight:400
179
  }
180
  table.wc_emails .wc-email-settings-table-name,table.cli_script_items .wc-email-settings-table-name,table.wc_shipping .wc-email-settings-table-name{
181
- font-weight:700
182
  }
183
  table.wc_emails .wc-email-settings-table-name span,table.cli_script_items .wc-email-settings-table-name span,table.wc_shipping .wc-email-settings-table-name span{
184
- font-weight:400;
185
- color:#999;
186
- margin:0 0 0 4px!important
187
  }
188
  table.wc_emails .wc-payment-gateway-method-toggle-disabled,table.wc_emails .cli-script-items-toggle-enabled,table.cli_script_items .wc-payment-gateway-method-toggle-disabled,table.cli_script_items .cli-script-items-toggle-enabled,table.wc_shipping .wc-payment-gateway-method-toggle-disabled,table.wc_shipping .cli-script-items-toggle-enabled{
189
- padding-top:1px;
190
- display:block;
191
- outline:0;
192
- -webkit-box-shadow:none;
193
- box-shadow:none
194
  }
195
  table.wc_emails .wc-email-settings-table-status,table.cli_script_items .wc-email-settings-table-status,table.wc_shipping .wc-email-settings-table-status{
196
- text-align:center;
197
- width:1em
198
  }
199
  table.wc_emails .wc-email-settings-table-status .tips,table.cli_script_items .wc-email-settings-table-status .tips,table.wc_shipping .wc-email-settings-table-status .tips{
200
- margin:0 auto
201
  }
202
  .cli-input-toggle{
203
- height:16px;
204
- width:32px;
205
- border:2px solid #935687;
206
- background-color:#935687;
207
- display:inline-block;
208
- text-indent:-9999px;
209
- border-radius:10em;
210
- position:relative;
211
- margin-top:-1px;
212
- vertical-align:text-top
213
  }
214
  .cli-input-toggle:before{
215
- content:"";
216
- display:block;
217
- width:16px;
218
- height:16px;
219
- background:#fff;
220
- position:absolute;
221
- top:0;
222
- right:0;
223
- border-radius:100%
224
  }
225
  .cli-input-toggle.cli-input-toggle--disabled{
226
- border-color:#999;
227
- background-color:#999
228
  }
229
  .cli-input-toggle.cli-input-toggle--disabled:before{
230
- right:auto;
231
- left:0
232
  }
233
  .cli-input-toggle.cli-input-toggle--loading{
234
- opacity:.5
235
  }
236
  .cookie-law-info-tab-head{ margin-right:20px;}
237
  .cookie-law-info-tab-container{
238
- padding:15px;
239
- background: #fff; box-shadow:0px 2px 2px #ccc; float: left; box-sizing:border-box; width:100%; height:auto;
240
  }
241
  .cookie-law-info-tab-head .nav-tab-active{ background: #fff; border-bottom: solid 1px #fff; }
242
  .cookie-law-info-tab-head .nav-tab:focus{ box-shadow:none;}
@@ -251,7 +251,7 @@ table.wc_emails .wc-email-settings-table-status .tips,table.cli_script_items .wc
251
  .cli-help-links li{ float:left; padding:40px; margin:20px; display: inline-block; text-align: center; box-shadow:1px 1px 5px 1px rgba(0,0,0,.1); width: 185px; height: 245px;}
252
  .cli-help-links li a{ text-decoration: none; height: 28px !important; margin-top: 20px; }
253
  .cli-help-links li img{
254
- margin-top: 15px;
255
  }
256
  /* copied from bootstrap */
257
  .cli_sub_tab_container input[type="text"], .cli_sub_tab_container select {
@@ -269,15 +269,15 @@ table.wc_emails .wc-email-settings-table-status .tips,table.cli_script_items .wc
269
  }
270
  .cookie-law-info-tab-container .button-primary
271
  {
272
- height:34px;
273
  }
274
  .notify_msg{ position:fixed; width:300px; padding:15px; color:#fff; right:60px; top:0px; opacity:0; box-shadow:0px 2px 2px #ccc; border-radius:5px;}
275
  .cli-indent-15{ }
276
  .cli-indent-15 th{ padding-left: 15px; }
277
  .cli_notify_table{ height:60px;}
278
  .cookie-law-info-form-container{
279
- padding:15px;
280
- background: #fff; box-shadow:0px 2px 2px #ccc;
281
  }
282
  .cli_non_necessary_form label{ width:100%; display: inline-block; font-weight: bold; margin-bottom: 10px; margin-top: 15px; }
283
  .cli_non_necessary_form .cli_form_help{ color: #aaa; font-style: italic; font-weight:250; font-size: 12px; }
@@ -289,6 +289,6 @@ table.wc_emails .wc-email-settings-table-status .tips,table.cli_script_items .wc
289
 
290
 
291
  @media screen and (max-width:1210px) {
292
- .cli_settings_left{ width:100%;}
293
- .cli_settings_right{ padding-left:0px; width:100%;}
294
- }
66
  }
67
  .cli-plugin-toolbar.bottom {
68
  margin-top: 12px;
69
+ background: #f5f5f5;
70
+ border-top: 1px solid #ddd;
71
+ margin-left: -15px;
72
+ margin-right: -15px;
73
+ margin-bottom: -15px;
74
+ padding:15px;
75
  }
76
  .cli-plugin-toolbar.top {
77
+ margin-top:-15px;
78
+ background: #f5f5f5;
79
+ border-bottom: 1px solid #ddd;
80
+ border-top: 1px solid #ddd;
81
+ margin-left: -15px;
82
+ margin-right: -15px;
83
+ margin-bottom: -15px;
84
+ padding:15px;
85
  }
86
  #header_on_off_field_warning {
87
  margin-left: 30px;
128
 
129
 
130
  table.cli_script_items{
131
+ position:relative
132
  }
133
  table.cli_script_items td,table.cli_script_items th{
134
+ display:table-cell!important;
135
+ padding:1em!important;
136
+ vertical-align:top;
137
+ line-height:1.75em
138
  }
139
  table.wc_emails.wc_emails td,table.cli_script_items.wc_emails td,table.wc_shipping.wc_emails td{
140
+ vertical-align:middle
141
  }
142
  table.cli_script_items tr:nth-child(odd) td{
143
+ background:#f9f9f9
144
  }
145
  table.cli_script_items td.name{
146
+ font-weight:700
147
  }
148
  table.wc_emails .settings,table.cli_script_items .settings,table.wc_shipping .settings{
149
+ text-align:right
150
  }
151
  table.wc_emails .default,table.wc_emails .radio,table.wc_emails .status,table.cli_script_items .default,table.cli_script_items .radio,table.cli_script_items .status,table.wc_shipping .default,table.wc_shipping .radio,table.wc_shipping .status{
152
+ text-align:center
153
  }
154
  table.wc_emails .default .tips,table.wc_emails .radio .tips,table.wc_emails .status .tips,table.cli_script_items .default .tips,table.cli_script_items .radio .tips,table.cli_script_items .status .tips,table.wc_shipping .default .tips,table.wc_shipping .radio .tips,table.wc_shipping .status .tips{
155
+ margin:0 auto
156
  }
157
  table.wc_emails .default input,table.wc_emails .radio input,table.wc_emails .status input,table.cli_script_items .default input,table.cli_script_items .radio input,table.cli_script_items .status input,table.wc_shipping .default input,table.wc_shipping .radio input,table.wc_shipping .status input{
158
+ margin:0
159
  }
160
  table.wc_emails td.sort,table.cli_script_items td.sort,table.wc_shipping td.sort{
161
+ cursor:move;
162
+ font-size:15px;
163
+ text-align:center
164
  }
165
  table.wc_emails td.sort::before,table.cli_script_items td.sort::before,table.wc_shipping td.sort::before{
166
+ content:'\f333';
167
+ font-family:Dashicons;
168
+ text-align:center;
169
+ line-height:1;
170
+ color:#999;
171
+ display:block;
172
+ width:17px;
173
+ float:left;
174
+ height:100%;
175
+ line-height:24px
176
  }
177
  table.wc_emails .wc-payment-gateway-method-name,table.cli_script_items .wc-payment-gateway-method-name,table.wc_shipping .wc-payment-gateway-method-name{
178
+ font-weight:400
179
  }
180
  table.wc_emails .wc-email-settings-table-name,table.cli_script_items .wc-email-settings-table-name,table.wc_shipping .wc-email-settings-table-name{
181
+ font-weight:700
182
  }
183
  table.wc_emails .wc-email-settings-table-name span,table.cli_script_items .wc-email-settings-table-name span,table.wc_shipping .wc-email-settings-table-name span{
184
+ font-weight:400;
185
+ color:#999;
186
+ margin:0 0 0 4px!important
187
  }
188
  table.wc_emails .wc-payment-gateway-method-toggle-disabled,table.wc_emails .cli-script-items-toggle-enabled,table.cli_script_items .wc-payment-gateway-method-toggle-disabled,table.cli_script_items .cli-script-items-toggle-enabled,table.wc_shipping .wc-payment-gateway-method-toggle-disabled,table.wc_shipping .cli-script-items-toggle-enabled{
189
+ padding-top:1px;
190
+ display:block;
191
+ outline:0;
192
+ -webkit-box-shadow:none;
193
+ box-shadow:none
194
  }
195
  table.wc_emails .wc-email-settings-table-status,table.cli_script_items .wc-email-settings-table-status,table.wc_shipping .wc-email-settings-table-status{
196
+ text-align:center;
197
+ width:1em
198
  }
199
  table.wc_emails .wc-email-settings-table-status .tips,table.cli_script_items .wc-email-settings-table-status .tips,table.wc_shipping .wc-email-settings-table-status .tips{
200
+ margin:0 auto
201
  }
202
  .cli-input-toggle{
203
+ height:16px;
204
+ width:32px;
205
+ border:2px solid #935687;
206
+ background-color:#935687;
207
+ display:inline-block;
208
+ text-indent:-9999px;
209
+ border-radius:10em;
210
+ position:relative;
211
+ margin-top:-1px;
212
+ vertical-align:text-top
213
  }
214
  .cli-input-toggle:before{
215
+ content:"";
216
+ display:block;
217
+ width:16px;
218
+ height:16px;
219
+ background:#fff;
220
+ position:absolute;
221
+ top:0;
222
+ right:0;
223
+ border-radius:100%
224
  }
225
  .cli-input-toggle.cli-input-toggle--disabled{
226
+ border-color:#999;
227
+ background-color:#999
228
  }
229
  .cli-input-toggle.cli-input-toggle--disabled:before{
230
+ right:auto;
231
+ left:0
232
  }
233
  .cli-input-toggle.cli-input-toggle--loading{
234
+ opacity:.5
235
  }
236
  .cookie-law-info-tab-head{ margin-right:20px;}
237
  .cookie-law-info-tab-container{
238
+ padding:15px;
239
+ background: #fff; box-shadow:0px 2px 2px #ccc; float: left; box-sizing:border-box; width:100%; height:auto;
240
  }
241
  .cookie-law-info-tab-head .nav-tab-active{ background: #fff; border-bottom: solid 1px #fff; }
242
  .cookie-law-info-tab-head .nav-tab:focus{ box-shadow:none;}
251
  .cli-help-links li{ float:left; padding:40px; margin:20px; display: inline-block; text-align: center; box-shadow:1px 1px 5px 1px rgba(0,0,0,.1); width: 185px; height: 245px;}
252
  .cli-help-links li a{ text-decoration: none; height: 28px !important; margin-top: 20px; }
253
  .cli-help-links li img{
254
+ margin-top: 15px;
255
  }
256
  /* copied from bootstrap */
257
  .cli_sub_tab_container input[type="text"], .cli_sub_tab_container select {
269
  }
270
  .cookie-law-info-tab-container .button-primary
271
  {
272
+ height:34px;
273
  }
274
  .notify_msg{ position:fixed; width:300px; padding:15px; color:#fff; right:60px; top:0px; opacity:0; box-shadow:0px 2px 2px #ccc; border-radius:5px;}
275
  .cli-indent-15{ }
276
  .cli-indent-15 th{ padding-left: 15px; }
277
  .cli_notify_table{ height:60px;}
278
  .cookie-law-info-form-container{
279
+ padding:15px;
280
+ background: #fff; box-shadow:0px 2px 2px #ccc;
281
  }
282
  .cli_non_necessary_form label{ width:100%; display: inline-block; font-weight: bold; margin-bottom: 10px; margin-top: 15px; }
283
  .cli_non_necessary_form .cli_form_help{ color: #aaa; font-style: italic; font-weight:250; font-size: 12px; }
289
 
290
 
291
  @media screen and (max-width:1210px) {
292
+ .cli_settings_left{ width:100%;}
293
+ .cli_settings_right{ padding-left:0px; width:100%;}
294
+ }
admin/css/cookie-law-info-admin.css CHANGED
@@ -3,190 +3,190 @@
3
  * included in this file.
4
  */
5
  #cli-plugin-migrate {
6
- background: #C5E3BF;
7
- border: 1px solid #98A148;
8
- color: #000;
9
- margin: 0 0 20px 0;
10
- padding: 10px;
11
- display: none;
12
  }
13
 
14
  .vvv_combobox {
15
- width: 100%;
16
  }
17
 
18
  .vvv_textbox {
19
- height: 150px;
20
- width: 100%;
21
  }
22
 
23
  .form-table input[type="text"], .vvv_textfield {
24
- width: 100%;
25
- margin-bottom: 5px;
26
  }
27
 
28
  .cli-plugin-example {
29
- display: block;
30
  }
31
 
32
  #cookielawinfo-accordion h4 {
33
- border-bottom: 1px solid #ccc;
34
- line-height: 110%;
35
- padding: 5px;
36
  }
37
 
38
  #cookielawinfo-accordion h4 code {
39
- padding-left: 40px;
40
- background: transparent;
41
  }
42
 
43
  .cli-help pre {
44
- font-weight: bold;
45
  }
46
 
47
  .cli-help span {
48
- margin: 0 0 30px 15px;
49
- display: block;
50
  }
51
 
52
  .cli-plugin-toolbar {
53
- height: 40px;
54
- width: 100%;
55
- margin: 0;
56
- padding: 0;
57
  }
58
 
59
  .cli-plugin-toolbar .left {
60
- float: left;
61
- margin: 0;
62
- padding: 0;
63
  }
64
 
65
  .cli-plugin-toolbar .left img {
66
- vertical-align: text-bottom;
67
- margin-right: 10px;
68
  }
69
 
70
  .cli-plugin-toolbar .right {
71
- float: right;
72
- margin: 0 10px 0 0;
73
- padding: 0;
74
  }
75
 
76
  .cli-plugin-toolbar.top {
77
- margin-bottom: -5px;
78
  }
79
 
80
  .cli-plugin-toolbar.bottom {
81
- margin-top: 12px;
82
- background: #f5f5f5;
83
- border-top: 1px solid #ddd;
84
- margin-left: -15px;
85
- margin-right: -15px;
86
- margin-bottom: -15px;
87
- padding: 15px;
88
  }
89
 
90
  .cli-plugin-toolbar.top {
91
- margin-top: -15px;
92
- background: #f5f5f5;
93
- border-bottom: 1px solid #ddd;
94
- border-top: 1px solid #ddd;
95
- margin-left: -15px;
96
- margin-right: -15px;
97
- margin-bottom: -15px;
98
- padding: 15px;
99
  }
100
 
101
  #header_on_off_field_warning {
102
- margin-left: 30px;
103
  }
104
 
105
  .warning {
106
- /* called by jQuery in admin-ui-controller.js */
107
- color: #f00;
108
- font-weight: bold;
109
  }
110
 
111
  .cli-plugin-container {
112
- overflow: hidden;
113
- width: 100%;
114
  }
115
 
116
  .cli-plugin-left-col {
117
- float: left;
118
- padding-bottom: 500em;
119
- margin-bottom: -500em;
120
  }
121
 
122
  .cli-plugin-right-col {
123
- float: left;
124
- margin-right: -1px;
125
- /* For IE */
126
- padding-bottom: 500em;
127
- margin-bottom: -500em;
128
  }
129
 
130
  .cli-plugin-container.width-50 {
131
- width: 50%;
132
  }
133
 
134
  .cli-plugin-container.width-60 {
135
- width: 60%;
136
  }
137
 
138
  .cli-plugin-container.width-70 {
139
- width: 70%;
140
  }
141
 
142
  .cli-plugin-container.width-80 {
143
- width: 80%;
144
  }
145
 
146
  .cli-plugin-container.width-90 {
147
- width: 90%;
148
  }
149
 
150
  .cli-plugin-left-col.width-50, .cli-plugin-right-col.width-50 {
151
- width: 50%;
152
  }
153
 
154
  .cli-plugin-left-col.width-62, .cli-plugin-right-col.width-62 {
155
- width: 62%;
156
  }
157
 
158
  /* Golden Ratio */
159
  .cli-plugin-left-col.width-38, .cli-plugin-right-col.width-38 {
160
- width: 38%;
161
  }
162
 
163
  /* Golden Ratio */
164
  .cli-plugin-left-col.width-f220, .cli-plugin-right-col.width-f220 {
165
- width: 220px;
166
  }
167
 
168
  .cli-plugin-container div.pad-5, .cli-plugin-left-col div.pad-5, .cli-plugin-right-col div.pad-5 {
169
- padding: 5px;
170
  }
171
 
172
  .cli-plugin-container div.pad-10, .cli-plugin-left-col div.pad-10, .cli-plugin-right-col div.pad-10 {
173
- padding: 10px;
174
  }
175
 
176
  .width-60 {
177
- width: 60%;
178
  }
179
 
180
  .width-100 {
181
- width: 100%;
182
  }
183
 
184
  .hr-top {
185
- border-top: 1px solid #ccc;
186
  }
187
 
188
  .hr-bottom {
189
- border-bottom: 1px solid #ccc;
190
  }
191
 
192
 
@@ -194,450 +194,450 @@
194
 
195
 
196
  table.cli_script_items {
197
- position: relative
198
  }
199
 
200
  table.cli_script_items td, table.cli_script_items th {
201
- display: table-cell !important;
202
- padding: 1em !important;
203
- vertical-align: top;
204
- line-height: 1.75em
205
  }
206
 
207
  table.wc_emails.wc_emails td, table.cli_script_items.wc_emails td, table.wc_shipping.wc_emails td {
208
- vertical-align: middle
209
  }
210
 
211
  table.cli_script_items tr:nth-child(odd) td {
212
- background: #f9f9f9
213
  }
214
 
215
  table.cli_script_items td.name {
216
- font-weight: 700
217
  }
218
 
219
  table.wc_emails .settings, table.cli_script_items .settings, table.wc_shipping .settings {
220
- text-align: right
221
  }
222
 
223
  table.wc_emails .default, table.wc_emails .radio, table.wc_emails .status, table.cli_script_items .default, table.cli_script_items .radio, table.cli_script_items .status, table.wc_shipping .default, table.wc_shipping .radio, table.wc_shipping .status {
224
- text-align: center
225
  }
226
 
227
  table.wc_emails .default .tips, table.wc_emails .radio .tips, table.wc_emails .status .tips, table.cli_script_items .default .tips, table.cli_script_items .radio .tips, table.cli_script_items .status .tips, table.wc_shipping .default .tips, table.wc_shipping .radio .tips, table.wc_shipping .status .tips {
228
- margin: 0 auto
229
  }
230
 
231
  table.wc_emails .default input, table.wc_emails .radio input, table.wc_emails .status input, table.cli_script_items .default input, table.cli_script_items .radio input, table.cli_script_items .status input, table.wc_shipping .default input, table.wc_shipping .radio input, table.wc_shipping .status input {
232
- margin: 0
233
  }
234
 
235
  table.wc_emails td.sort, table.cli_script_items td.sort, table.wc_shipping td.sort {
236
- cursor: move;
237
- font-size: 15px;
238
- text-align: center
239
  }
240
 
241
  table.wc_emails td.sort::before, table.cli_script_items td.sort::before, table.wc_shipping td.sort::before {
242
- content: '\f333';
243
- font-family: Dashicons;
244
- text-align: center;
245
- line-height: 1;
246
- color: #999;
247
- display: block;
248
- width: 17px;
249
- float: left;
250
- height: 100%;
251
- line-height: 24px
252
  }
253
 
254
  table.wc_emails .wc-payment-gateway-method-name, table.cli_script_items .wc-payment-gateway-method-name, table.wc_shipping .wc-payment-gateway-method-name {
255
- font-weight: 400
256
  }
257
 
258
  table.wc_emails .wc-email-settings-table-name, table.cli_script_items .wc-email-settings-table-name, table.wc_shipping .wc-email-settings-table-name {
259
- font-weight: 700
260
  }
261
 
262
  table.wc_emails .wc-email-settings-table-name span, table.cli_script_items .wc-email-settings-table-name span, table.wc_shipping .wc-email-settings-table-name span {
263
- font-weight: 400;
264
- color: #999;
265
- margin: 0 0 0 4px !important
266
  }
267
 
268
  table.wc_emails .wc-payment-gateway-method-toggle-disabled, table.wc_emails .cli-script-items-toggle-enabled, table.cli_script_items .wc-payment-gateway-method-toggle-disabled, table.cli_script_items .cli-script-items-toggle-enabled, table.wc_shipping .wc-payment-gateway-method-toggle-disabled, table.wc_shipping .cli-script-items-toggle-enabled {
269
- padding-top: 1px;
270
- display: block;
271
- outline: 0;
272
- -webkit-box-shadow: none;
273
- box-shadow: none
274
  }
275
 
276
  table.wc_emails .wc-email-settings-table-status, table.cli_script_items .wc-email-settings-table-status, table.wc_shipping .wc-email-settings-table-status {
277
- text-align: center;
278
- width: 1em
279
  }
280
 
281
  table.wc_emails .wc-email-settings-table-status .tips, table.cli_script_items .wc-email-settings-table-status .tips, table.wc_shipping .wc-email-settings-table-status .tips {
282
- margin: 0 auto
283
  }
284
 
285
  .cli-input-toggle {
286
- height: 16px;
287
- width: 32px;
288
- border: 2px solid #935687;
289
- background-color: #935687;
290
- display: inline-block;
291
- text-indent: -9999px;
292
- border-radius: 10em;
293
- position: relative;
294
- margin-top: -1px;
295
- vertical-align: text-top
296
  }
297
 
298
  .cli-input-toggle:before {
299
- content: "";
300
- display: block;
301
- width: 16px;
302
- height: 16px;
303
- background: #fff;
304
- position: absolute;
305
- top: 0;
306
- right: 0;
307
- border-radius: 100%
308
  }
309
 
310
  .cli-input-toggle.cli-input-toggle--disabled {
311
- border-color: #999;
312
- background-color: #999
313
  }
314
 
315
  .cli-input-toggle.cli-input-toggle--disabled:before {
316
- right: auto;
317
- left: 0
318
  }
319
 
320
  .cli-input-toggle.cli-input-toggle--loading {
321
- opacity: .5
322
  }
323
 
324
  .cookie-law-info-tab-head {
325
- margin-right: 0px;
326
- border-bottom: none;
327
  }
328
 
329
  .cookie-law-info-tab-container {
330
- padding: 15px;
331
- background: #fff;
332
- box-shadow: 0px 2px 2px #ccc;
333
- float: left;
334
- box-sizing: border-box;
335
- width: 100%;
336
- height: auto;
337
  }
338
 
339
  .cookie-law-info-tab-head .nav-tab-active {
340
- background: #fff;
341
- border-bottom: solid 1px #fff;
342
  }
343
 
344
  .cookie-law-info-tab-head .nav-tab:focus {
345
- box-shadow: none;
346
  }
347
 
348
  .cookie-law-info-tab-content {
349
- display: none;
350
- float: left;
351
- width: 100%;
352
- height: auto;
353
  }
354
 
355
  .cli_sub_tab_container {
356
- float: left;
357
- width: 100%;
358
- height: auto;
359
  }
360
 
361
  .cli_sub_tab {
362
- display: inline-block;
363
- margin: 0px;
364
- float: left;
365
- width: 100%;
366
- height: auto;
367
  }
368
 
369
  .cli_sub_tab li {
370
- display: inline-block;
371
- border-left: solid 1px #ccc;
372
- padding: 3px 10px;
373
- cursor: pointer;
374
  }
375
 
376
  .cli_sub_tab_content {
377
- display: none;
378
- float: left;
379
- width: 100%;
380
- height: auto;
381
  }
382
 
383
  .cli-shortcodes li {
384
- margin-bottom: 20px;
385
- border-bottom: dashed 1px #ccc;
386
- padding-bottom: 7px;
387
- margin-left: 15px;
388
  }
389
 
390
  .cli-shortcodes li div {
391
- font-weight: bold;
392
- width: 100%;
393
  }
394
 
395
  .cli-shortcodes li span {
396
- display: inline-block;
397
  }
398
 
399
  .cli-help-links li {
400
- float: left;
401
- padding: 40px;
402
- margin: 20px;
403
- display: inline-block;
404
- text-align: center;
405
- box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, .1);
406
- width: 185px;
407
- height: 245px;
408
  }
409
 
410
  .cli-help-links li a {
411
- text-decoration: none;
412
- height: 28px !important;
413
- margin-top: 20px;
414
  }
415
 
416
  .cli-help-links li img {
417
- margin-top: 15px;
418
  }
419
 
420
  /* copied from bootstrap */
421
  .cli_sub_tab_container input[type="text"], .cli_sub_tab_container select {
422
- display: block;
423
- width: 100%;
424
- padding: 0.375rem 0.75rem;
425
- font-size: 1rem;
426
- line-height: 1.5;
427
- color: #495057;
428
- background-color: #fff;
429
- background-clip: padding-box;
430
- border: 1px solid #ced4da;
431
- border-radius: 0.25rem;
432
- transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
433
- height: auto !important;
434
  }
435
 
436
  .cookie-law-info-tab-container .button-primary {
437
- height: 34px;
438
  }
439
 
440
  .notify_msg {
441
- position: fixed;
442
- width: 300px;
443
- padding: 15px;
444
- color: #fff;
445
- right: 60px;
446
- top: 0px;
447
- opacity: 0;
448
- box-shadow: 0px 2px 2px #ccc;
449
- border-radius: 5px;
450
  }
451
 
452
  .cli-indent-15 th {
453
- padding-left: 15px;
454
  }
455
 
456
  .cli_notify_table {
457
- height: 60px;
458
  }
459
 
460
  .cookie-law-info-form-container {
461
- padding: 15px;
462
- background: #fff;
463
- box-shadow: 0px 2px 2px #ccc;
464
  }
465
 
466
  .cli-admin-table label {
467
- width: 100%;
468
- display: inline-block;
469
- font-weight: bold;
470
- margin-bottom: 10px;
471
- margin-top: 15px;
472
  }
473
 
474
  .cli_non_necessary_form .cli_form_help {
475
- color: #aaa;
476
- font-style: italic;
477
- font-weight: 250;
478
- font-size: 12px;
479
  }
480
 
481
  .cli_settings_left {
482
- width: 68%;
483
- float: left;
484
- margin-bottom: 25px;
485
  }
486
 
487
  .cli_settings_right {
488
- width: calc(31% - 20px);
489
- float: left;
490
- margin-left: 25px;
491
  }
492
 
493
  .cli_privacy_overview_form label {
494
- width: 100%;
495
- display: inline-block;
496
- font-weight: bold;
497
- margin-bottom: 10px;
498
- margin-top: 15px;
499
  }
500
 
501
  .cli_privacy_overview_form .cli_form_help {
502
- color: #aaa;
503
- font-style: italic;
504
- font-weight: 250;
505
- font-size: 12px;
506
  }
507
 
508
  .cli_form_help {
509
- color: #8e8989;
510
- font-style: italic;
511
- font-weight: 250;
512
- font-size: 12px;
513
- display: inline-block;
514
- width: 100%;
515
  }
516
 
517
  .cli_form_er {
518
- color: red;
519
- font-style: italic;
520
- font-weight: 300;
521
- font-size: 12px;
522
- display: inline-block;
523
- width: 100%;
524
  }
525
 
526
  .cli_scroll_accept_er {
527
- display: none;
528
  }
529
 
530
  .cli_premium_features {
531
- font-size: 14px;
532
  }
533
 
534
  @media screen and (max-width:1210px) {
535
- .cli_settings_left {
536
- width: 100%;
537
- }
538
 
539
- .cli_settings_right {
540
- padding-left: 0px;
541
- width: 100%;
542
- }
543
  }
544
 
545
  /* CCPA Related Changes */
546
  /* Accordion Styles */
547
 
548
  .wt-cli-accordion-container {
549
- position: relative;
550
- height: auto;
551
- border-left: 1px solid #e2e4e7;
552
- border-right: 1px solid #e2e4e7;
553
  }
554
 
555
  .wt-cli-accordion-container>h2 {
556
- text-align: center;
557
- color: #fff;
558
- padding-bottom: 5px;
559
- margin-bottom: 20px;
560
- padding-bottom: 15px;
561
  }
562
 
563
  .wt-cli-accordion-content>.wt-cli-accordion-tab {
564
- padding-left: 10px;
565
- padding-right: 10px;
566
- border-left: 1px solid #e2e4e7;
567
- border-right: 1px solid #e2e4e7;
568
  }
569
 
570
  .wt-cli-accordion-content.active>.wt-cli-accordion-tab {
571
- background: #fff;
572
  }
573
 
574
  .wt-cli-accordion-tab {
575
- position: relative;
576
- width: 100%;
577
- height: auto;
578
- border-bottom: 2px dotted #e2e4e7;
579
- box-sizing: border-box;
580
  }
581
 
582
  .wt-cli-accordion-content {
583
- padding-bottom: 15px;
584
  }
585
 
586
  .wt-cli-accordion-tab:not(:first-child) {
587
- margin-top: -1px;
588
  }
589
 
590
  .wt-cli-accordion-tab>a {
591
- display: block;
592
- text-decoration: none;
593
- color: #191e23;
594
- font-weight: 600;
595
- padding-top: 15px;
596
- padding-bottom: 15px;
597
- outline: none;
598
- -webkit-transition: all 0.2s linear;
599
- -moz-transition: all 0.2s linear;
600
- transition: all 0.2s linear;
601
- box-shadow: none;
602
- display: flex;
603
- align-items: center;
604
- font-size: 1.3em;
605
  }
606
 
607
  .wt-cli-accordion-tab>a i {
608
- float: right;
609
- margin-top: 2px;
610
  }
611
 
612
  .wt-cli-accordion-tab>a:before {
613
- content: "";
614
- display: block;
615
- width: 8px;
616
- height: 8px;
617
- border-top: 2px solid #000000;
618
- border-right: 2px solid #000000;
619
- -webkit-transform: rotate(45deg);
620
- transform: rotate(45deg);
621
- transition: -webkit-transform 400ms ease;
622
- transition: transform 400ms ease;
623
- transition: transform 400ms ease, -webkit-transform 400ms ease;
624
- opacity: 0.8;
625
- margin-right: 16px;
626
  }
627
 
628
  .wt-cli-accordion-tab>a.active::before {
629
- -webkit-transform: rotate(135deg);
630
- transform: rotate(135deg);
631
  }
632
 
633
  .wt-cli-accordion-content {
634
- display: none;
635
  }
636
 
637
  /* End Accordion Styles */
638
 
639
  .wt-cli-section-gdpr-ccpa .wt-cli-section-inner {
640
- display: none;
641
  }
642
 
643
  /* Webtoffe GDPR Cookie Consent Tooltip */
@@ -645,608 +645,608 @@ table.wc_emails .wc-email-settings-table-status .tips, table.cli_script_items .w
645
  /* Add this attribute to the element that needs a tooltip */
646
 
647
  [data-wt-cli-tooltip] {
648
- position: relative;
649
- z-index: 9999;
650
- cursor: pointer;
651
  }
652
 
653
  /* Hide the tooltip content by default */
654
 
655
  [data-wt-cli-tooltip]:before, [data-wt-cli-tooltip]:after {
656
- visibility: hidden;
657
- opacity: 0;
658
- pointer-events: none;
659
  }
660
 
661
  /* Position tooltip above the element */
662
 
663
  [data-wt-cli-tooltip]:before {
664
- position: absolute;
665
- bottom: 100%;
666
- left: 50%;
667
- margin-bottom: 10px;
668
- transform: translateX(-50%);
669
- min-width: 250px;
670
- -webkit-border-radius: 4px;
671
- -moz-border-radius: 4px;
672
- border-radius: 4px;
673
- background-color: #333;
674
- color: #fff;
675
- content: attr(data-wt-cli-tooltip);
676
- text-align: center;
677
- font-size: 12px;
678
- line-height: 18px;
679
- font-weight: normal;
680
- padding: 12px;
681
- letter-spacing: -.25px;
682
- text-transform: none;
683
- white-space: normal;
684
  }
685
 
686
  /* Triangle hack to make tooltip look like a speech bubble */
687
 
688
  [data-wt-cli-tooltip]:after {
689
- position: absolute;
690
- bottom: 100%;
691
- left: 50%;
692
- margin-bottom: 5px;
693
- margin-left: -5px;
694
- width: 0;
695
- border-top: 5px solid #000;
696
- border-top: 5px solid hsla(0, 0%, 20%, 0.9);
697
- border-right: 5px solid transparent;
698
- border-left: 5px solid transparent;
699
- content: " ";
700
- font-size: 0;
701
- line-height: 0;
702
  }
703
 
704
  /* Show tooltip content on hover */
705
 
706
  [data-wt-cli-tooltip]:hover:before, [data-wt-cli-tooltip]:hover:after {
707
- visibility: visible;
708
- opacity: 1;
709
  }
710
 
711
  span.wt-cli-tootip-icon {
712
- background-image: url('../images/wt-cli-info.svg');
713
  }
714
 
715
  span.wt-cli-tootip-icon {
716
- background-image: url(../images/wt-cli-info.svg);
717
- width: 14px;
718
- height: 14px;
719
- display: inline-flex;
720
- background-size: 100%;
721
- align-items: center;
722
- justify-content: center;
723
- margin-top: 5px;
724
- margin-left: 10px;
725
- margin-bottom: -2px;
726
  }
727
 
728
  .wt-cli-ccpa-message-toggler .wt-cli-form-group {
729
- margin-bottom: 15px;
730
  }
731
 
732
  .wt-cli-notice.wt-cli-info {
733
- padding: 15px 15px 15px 41px;
734
- background: #e5f5fa;
735
- position: relative;
736
- border-left: 4px solid;
737
- border-color: #00a0d2;
738
- margin-bottom: 15px;
739
- width: 100%;
740
- box-sizing: border-box;
741
  }
742
 
743
  .wt-cli-notice.wt-cli-info:before {
744
- content: "\f348";
745
- color: #00a0d2;
746
- font-family: "dashicons";
747
- position: absolute;
748
- left: 15px;
749
- font-size: 16px;
750
  }
751
 
752
  .wt-cli-status-success:before {
753
- content: "";
754
- background: url(../images/add.svg);
755
- width: 18px;
756
- height: 18px;
757
- display: block;
758
- background-size: cover;
759
  }
760
 
761
  .wt-cli-status-icon {
762
- width: 18px;
763
- height: 18px;
764
- font-size: 16px;
765
- text-align: center;
766
- content: "";
767
- font-family: "dashicons";
768
  }
769
 
770
  /* Toggle checkbox CSS since 1.9.4 */
771
  .wt-cli-input-toggle-section {
772
- display: none;
773
  }
774
 
775
  .wt-cli-section-floating-widget-settings .wt-cli-input-toggle-section.wt-cli-toggle-active label {
776
- margin-left: 15px !important;
777
  }
778
 
779
  .wt-cli-section-floating-widget-settings .wt-cli-input-toggle-section label {
780
- -webkit-transition: margin 700ms;
781
- -moz-transition: margin 700ms;
782
- -o-transition: margin 700ms;
783
- transition: margin 700ms;
784
  }
785
 
786
  .wt-cli-section-floating-widget-settings .form-table th {
787
- width: 260px;
788
  }
789
 
790
 
791
  /* Callout styles */
792
 
793
  .wt-cli-callout {
794
- width: 100%;
795
- padding: 1.5em 1.5em 1.5em 1.5em;
796
- margin-bottom: 1.5em;
797
- overflow: auto;
798
- position: relative;
799
- border-width: 0 0 0 5px;
800
- border-style: solid;
801
- min-width: 170px;
802
- box-sizing: border-box;
803
  }
804
 
805
  .wt-cli-callout.wt-cli-callout-icon {
806
- padding: 1.5em 3em 1.6em 3.7em;
807
  }
808
 
809
  .wt-cli-callout p {
810
- margin-bottom: 0.6em;
811
- margin-top: 0.5em;
812
  }
813
 
814
  .wt-cli-callout p:first-child {
815
- margin-top: 0;
816
  }
817
 
818
  .wt-cli-callout p:last-child {
819
- margin-bottom: 0;
820
  }
821
 
822
  .wt-cli-callout:before {
823
- content: "";
824
- font-family: "dashicons";
825
- position: absolute;
826
- font-size: 20px;
827
- top: 50%;
828
- left: 0.5em;
829
- transform: translateY(-50%);
830
  }
831
 
832
  .wt-cli-callout .screen-reader-text+br {
833
- display: none;
834
  }
835
 
836
  .wt-cli-callout-info {
837
- background: #e5f5fa;
838
- border-color: #00a0d2;
839
  }
840
 
841
  .wt-cli-callout-success {
842
- background: #eff7ed;
843
- border-color: #64b450;
844
  }
845
 
846
  .wt-cli-callout-alert {
847
- background: #fff8e5;
848
- border-color: #ffb900;
849
  }
850
 
851
  .wt-cli-callout-tutorial {
852
- background: #f2f0f7;
853
- border-color: #826eb4;
854
  }
855
 
856
  .wt-cli-callout-warning {
857
- background: #fbeaea;
858
- border-color: #dc3232;
859
  }
860
 
861
  .wt-cli-callout-info.wt-cli-callout-icon:before {
862
- content: "\f348";
863
- color: #00a0d2;
864
  }
865
 
866
  .wt-cli-callout-success.wt-cli-callout-icon:before {
867
- content: "";
868
- color: #fff;
869
- width: 18px;
870
- height: 18px;
871
- background: url('../images/add.svg');
872
  }
873
 
874
  .wt-cli-callout-alert.wt-cli-callout-icon:before {
875
- content: "\f227";
876
- color: #ffb900;
877
  }
878
 
879
  .wt-cli-callout-tutorial.wt-cli-callout-icon:before {
880
- content: "\f308";
881
- color: #826eb4;
882
  }
883
 
884
  .wt-cli-callout-warning.wt-cli-callout-icon:before {
885
- content: "\f153";
886
- color: #dc3232;
887
  }
888
 
889
  /* Modal styles since 2.3.2 */
890
 
891
  .wt-cli-modal {
892
- position: fixed;
893
- top: 10%;
894
- padding: 15px 20px;
895
- border-radius: 3px;
896
- background-color: white;
897
- z-index: 60000;
898
- width: 400px;
899
- display: none;
900
- left: 0;
901
- right: 0;
902
- margin: 0 auto;
903
- box-sizing: border-box;
904
  }
905
 
906
  .wt-cli-modal.on {
907
- display: block;
908
  }
909
 
910
  .wt-cli-modal-js-overlay {
911
- background: #444;
912
- opacity: .8;
913
- position: fixed;
914
- top: 0px;
915
- width: 100%;
916
- height: 1000px;
917
- z-index: 20000;
918
- left: 0px;
919
  }
920
 
921
  .wt-cli-modal-js-close {
922
- position: absolute;
923
- bottom: 0px;
924
- right: 0px;
925
- color: #000;
926
- border-radius: 50%;
927
- font-size: 18px;
928
- text-align: center;
929
- padding: 1px;
930
- top: 5px;
931
- right: 5px;
932
- box-shadow: var(--box-shadow);
933
- cursor: pointer;
934
  }
935
 
936
  .wt-cli-modal-header h4 {
937
- margin: 0;
938
- font-size: 15px;
939
  }
940
 
941
  /* New grid styles */
942
  .wt-cli-align-center {
943
- -webkit-box-align: center !important;
944
- -ms-flex-align: center !important;
945
- align-items: center !important;
946
  }
947
 
948
  .wt-cli-justify-center {
949
- -webkit-box-pack: justify !important;
950
- -ms-flex-pack: justify !important;
951
- justify-content: center !important;
952
  }
953
 
954
  .wt-cli-justify-end {
955
- -ms-flex-pack: end !important;
956
- justify-content: flex-end !important;
957
  }
958
 
959
  .wt-cli-container-fluid {
960
- width: 100%;
961
- padding-right: 15px;
962
- padding-left: 15px;
963
- margin-right: auto;
964
- margin-left: auto;
965
  }
966
 
967
  .wt-cli-grid-wrapper *, .wt-cli-row * {
968
- box-sizing: border-box;
969
  }
970
 
971
  .wt-cli-row {
972
- display: -webkit-box;
973
- display: -ms-flexbox;
974
- display: flex;
975
- flex-wrap: wrap;
976
- -ms-flex-wrap: wrap;
977
- margin-left: -12.5px;
978
- margin-right: -12.5px;
979
  }
980
 
981
  .wt-cli-col {
982
- -ms-flex-preferred-size: 0;
983
- flex-basis: 0;
984
- -webkit-box-flex: 1;
985
- -ms-flex-positive: 1;
986
- flex-grow: 1;
987
- max-width: 100%;
988
  }
989
 
990
  .wt-cli-col-1 {
991
- -ms-flex: 0 0 8.33333333%;
992
- flex: 0 0 8.33333333%;
993
- max-width: 8.33333333%;
994
  }
995
 
996
  .wt-cli-col-2 {
997
- -ms-flex: 0 0 16.66666667%;
998
- flex: 0 0 16.66666667%;
999
- max-width: 16.66666667%;
1000
  }
1001
 
1002
  .wt-cli-col-3 {
1003
- -ms-flex: 0 0 25%;
1004
- flex: 0 0 25%;
1005
- max-width: 25%;
1006
  }
1007
 
1008
  .wt-cli-col-4 {
1009
- -ms-flex: 0 0 33.33333333%;
1010
- flex: 0 0 33.33333333%;
1011
- max-width: 33.33333333%;
1012
  }
1013
 
1014
  .wt-cli-col-5 {
1015
- -ms-flex: 0 0 41.66666667%;
1016
- flex: 0 0 41.66666667%;
1017
- max-width: 41.66666667%;
1018
  }
1019
 
1020
  .wt-cli-col-6 {
1021
- -webkit-box-flex: 0;
1022
- -ms-flex: 0 0 50%;
1023
- flex: 0 0 50%;
1024
- max-width: 50%;
1025
  }
1026
 
1027
  .wt-cli-col-7 {
1028
- -ms-flex: 0 0 58.33333333%;
1029
- flex: 0 0 58.33333333%;
1030
- max-width: 58.33333333%;
1031
  }
1032
 
1033
  .wt-cli-col-8 {
1034
- -ms-flex: 0 0 66.66666667%;
1035
- flex: 0 0 66.66666667%;
1036
- max-width: 66.66666667%;
1037
  }
1038
 
1039
  .wt-cli-col-9 {
1040
- -ms-flex: 0 0 75%;
1041
- flex: 0 0 75%;
1042
- max-width: 75%;
1043
  }
1044
 
1045
  .wt-cli-col-10 {
1046
- -ms-flex: 0 0 83.33333333%;
1047
- flex: 0 0 83.33333333%;
1048
- max-width: 83.33333333%;
1049
  }
1050
 
1051
  .wt-cli-col-11 {
1052
- -ms-flex: 0 0 91.66666667%;
1053
- flex: 0 0 91.66666667%;
1054
- max-width: 91.66666667%;
1055
  }
1056
 
1057
  .wt-cli-col-12 {
1058
- -webkit-box-flex: 0;
1059
- -ms-flex: 0 0 100%;
1060
- flex: 0 0 100%;
1061
- max-width: 100%;
1062
  }
1063
 
1064
  .wt-cli-col, .wt-cli-col-1, .wt-cli-col-2, .wt-cli-col-3, .wt-cli-col-4, .wt-cli-col-5, .wt-cli-col-6, .wt-cli-col-7, .wt-cli-col-8, .wt-cli-col-9, .wt-cli-col-10, .wt-cli-col-11, .wt-cli-col-12 {
1065
- position: relative;
1066
- width: 100%;
1067
- min-height: 1px;
1068
- padding-right: 12.5px;
1069
- padding-left: 12.5px;
1070
  }
1071
 
1072
  .wt-cli-gdpr-plugin-status {
1073
- display: flex;
1074
- align-items: center;
1075
- font-weight: 500;
1076
  }
1077
 
1078
  .wt-cli-gdpr-plugin-status img {
1079
- width: 18px;
1080
- margin-right: 10px;
1081
  }
1082
 
1083
  .wt-cli-gdpr-plugin-header {
1084
- display: flex;
1085
- align-items: center;
1086
- justify-content: space-between;
1087
  }
1088
 
1089
  .wt-cli-gdpr-plugin-branding-logo {
1090
- display: flex;
1091
- justify-content: flex-end;
1092
  }
1093
 
1094
  .wt-cli-gdpr-plugin-branding-logo img {
1095
- width: 150px;
1096
  }
1097
 
1098
  .wt-cli-gdpr-plugin-branding-logo a:focus {
1099
- outline: none;
1100
- box-shadow: none;
1101
  }
1102
 
1103
  .wt-cli-gdpr-plugin-branding-tagline a {
1104
- color: #444;
1105
  }
1106
 
1107
  .wt-cli-gdpr-plugin-branding-tagline {
1108
- margin-top: 5px;
1109
  }
1110
 
1111
  /* Upgrade side bar styles */
1112
  .wt-ier-sidebar-wrapper {
1113
- background: #FFFFFF;
1114
- border-radius: 5px;
1115
- max-width: 370px;
1116
  }
1117
 
1118
  .wt-ier-sidebar-img {
1119
- margin: 0 auto 20px auto;
1120
- display: block;
1121
  }
1122
 
1123
  .wt-ier-sidebar-title {
1124
- font-weight: 600;
1125
- font-size: 17px;
1126
- line-height: 25px;
1127
- color: #000000;
1128
- margin-bottom: 20px;
1129
  }
1130
 
1131
  .wt-ier-icon {
1132
- width: auto;
1133
- height: 100%;
1134
- max-height: 25px;
1135
- margin-right: 8px;
1136
  }
1137
 
1138
  .wt-ier-sidebar-p {
1139
- font-style: normal;
1140
- font-weight: normal;
1141
- font-size: 12px;
1142
- line-height: 16px;
1143
- color: #000000;
1144
- margin: 0;
1145
  }
1146
 
1147
  .wt-ier-green-btn {
1148
- background: #00CB95;
1149
- border-radius: 4px;
1150
- font-weight: 600;
1151
- font-size: 16px;
1152
- line-height: 19px;
1153
- text-align: center;
1154
- padding: 15px 20px;
1155
- color: #FFFFFF;
1156
- display: inline-block;
1157
- text-decoration: none;
1158
- transition: all .2s ease;
1159
- border: none;
1160
- margin-top: 20px;
1161
  }
1162
 
1163
  .wt-ier-green-btn:hover, .wt-ier-green-btn:focus {
1164
- text-decoration: none;
1165
- opacity: .8;
1166
- transition: all .2s ease;
1167
- border: none;
1168
- transform: translateY(1px);
1169
  }
1170
 
1171
  .wt-ier-wrapper {
1172
- background-color: #fff;
1173
- padding: 30px;
1174
  }
1175
 
1176
  .wt-ier-box-wrapper {
1177
- background: #FFFFFF;
1178
- border: 1px solid #D2D2D2;
1179
- border-radius: 6px;
1180
- min-height: 100%;
1181
  }
1182
 
1183
  .wt-ier-p-5 {
1184
- padding: 35px;
1185
  }
1186
 
1187
  .wt-ier-p-4 {
1188
- padding: 20px;
1189
  }
1190
 
1191
  .wt-ier-v-center {
1192
- -ms-flex-align: center;
1193
- align-items: center;
1194
  }
1195
 
1196
  .wt-ier-flex {
1197
- display: -ms-flexbox;
1198
- display: flex;
1199
  }
1200
 
1201
  .wt-ier-center {
1202
- text-align: center;
1203
  }
1204
 
1205
  .wt-ier-row * {
1206
- box-sizing: border-box;
1207
  }
1208
 
1209
  .wt-ier-row {
1210
- display: -ms-flexbox;
1211
- display: flex;
1212
- -ms-flex-wrap: wrap;
1213
- flex-wrap: wrap;
1214
- margin: -15px;
1215
  }
1216
 
1217
  .wt-ier-col-12 {
1218
- -ms-flex: 0 0 100%;
1219
- flex: 0 0 100%;
1220
- max-width: 100%;
1221
 
1222
  }
1223
 
1224
  .wt-ier-col-md-6, .wt-ier-col-12 {
1225
- position: relative;
1226
- width: 100%;
1227
- padding: 15px;
1228
  }
1229
 
1230
  @media (min-width: 768px) {
1231
- .wt-ier-col-md-6 {
1232
- -ms-flex: 0 0 50%;
1233
- flex: 0 0 50%;
1234
- max-width: 50%;
1235
- }
1236
 
1237
- .wt-ier-mb-md-0 {
1238
- margin-bottom: 0;
1239
- }
1240
 
1241
- .wt-ier-border-md-right {
1242
- border-right: 1px solid #E8E8E8;
1243
- }
1244
 
1245
  }
1246
  .wt-cli-footer {
1247
- padding: 15px;
1248
- background: #f5f5f5;
1249
- margin-left: -15px;
1250
- margin-right: -15px;
1251
- margin-bottom: -15px;
1252
- }
3
  * included in this file.
4
  */
5
  #cli-plugin-migrate {
6
+ background: #C5E3BF;
7
+ border: 1px solid #98A148;
8
+ color: #000;
9
+ margin: 0 0 20px 0;
10
+ padding: 10px;
11
+ display: none;
12
  }
13
 
14
  .vvv_combobox {
15
+ width: 100%;
16
  }
17
 
18
  .vvv_textbox {
19
+ height: 150px;
20
+ width: 100%;
21
  }
22
 
23
  .form-table input[type="text"], .vvv_textfield {
24
+ width: 100%;
25
+ margin-bottom: 5px;
26
  }
27
 
28
  .cli-plugin-example {
29
+ display: block;
30
  }
31
 
32
  #cookielawinfo-accordion h4 {
33
+ border-bottom: 1px solid #ccc;
34
+ line-height: 110%;
35
+ padding: 5px;
36
  }
37
 
38
  #cookielawinfo-accordion h4 code {
39
+ padding-left: 40px;
40
+ background: transparent;
41
  }
42
 
43
  .cli-help pre {
44
+ font-weight: bold;
45
  }
46
 
47
  .cli-help span {
48
+ margin: 0 0 30px 15px;
49
+ display: block;
50
  }
51
 
52
  .cli-plugin-toolbar {
53
+ height: 40px;
54
+ width: 100%;
55
+ margin: 0;
56
+ padding: 0;
57
  }
58
 
59
  .cli-plugin-toolbar .left {
60
+ float: left;
61
+ margin: 0;
62
+ padding: 0;
63
  }
64
 
65
  .cli-plugin-toolbar .left img {
66
+ vertical-align: text-bottom;
67
+ margin-right: 10px;
68
  }
69
 
70
  .cli-plugin-toolbar .right {
71
+ float: right;
72
+ margin: 0 10px 0 0;
73
+ padding: 0;
74
  }
75
 
76
  .cli-plugin-toolbar.top {
77
+ margin-bottom: -5px;
78
  }
79
 
80
  .cli-plugin-toolbar.bottom {
81
+ margin-top: 12px;
82
+ background: #f5f5f5;
83
+ border-top: 1px solid #ddd;
84
+ margin-left: -15px;
85
+ margin-right: -15px;
86
+ margin-bottom: -15px;
87
+ padding: 15px;
88
  }
89
 
90
  .cli-plugin-toolbar.top {
91
+ margin-top: -15px;
92
+ background: #f5f5f5;
93
+ border-bottom: 1px solid #ddd;
94
+ border-top: 1px solid #ddd;
95
+ margin-left: -15px;
96
+ margin-right: -15px;
97
+ margin-bottom: -15px;
98
+ padding: 15px;
99
  }
100
 
101
  #header_on_off_field_warning {
102
+ margin-left: 30px;
103
  }
104
 
105
  .warning {
106
+ /* called by jQuery in admin-ui-controller.js */
107
+ color: #f00;
108
+ font-weight: bold;
109
  }
110
 
111
  .cli-plugin-container {
112
+ overflow: hidden;
113
+ width: 100%;
114
  }
115
 
116
  .cli-plugin-left-col {
117
+ float: left;
118
+ padding-bottom: 500em;
119
+ margin-bottom: -500em;
120
  }
121
 
122
  .cli-plugin-right-col {
123
+ float: left;
124
+ margin-right: -1px;
125
+ /* For IE */
126
+ padding-bottom: 500em;
127
+ margin-bottom: -500em;
128
  }
129
 
130
  .cli-plugin-container.width-50 {
131
+ width: 50%;
132
  }
133
 
134
  .cli-plugin-container.width-60 {
135
+ width: 60%;
136
  }
137
 
138
  .cli-plugin-container.width-70 {
139
+ width: 70%;
140
  }
141
 
142
  .cli-plugin-container.width-80 {
143
+ width: 80%;
144
  }
145
 
146
  .cli-plugin-container.width-90 {
147
+ width: 90%;
148
  }
149
 
150
  .cli-plugin-left-col.width-50, .cli-plugin-right-col.width-50 {
151
+ width: 50%;
152
  }
153
 
154
  .cli-plugin-left-col.width-62, .cli-plugin-right-col.width-62 {
155
+ width: 62%;
156
  }
157
 
158
  /* Golden Ratio */
159
  .cli-plugin-left-col.width-38, .cli-plugin-right-col.width-38 {
160
+ width: 38%;
161
  }
162
 
163
  /* Golden Ratio */
164
  .cli-plugin-left-col.width-f220, .cli-plugin-right-col.width-f220 {
165
+ width: 220px;
166
  }
167
 
168
  .cli-plugin-container div.pad-5, .cli-plugin-left-col div.pad-5, .cli-plugin-right-col div.pad-5 {
169
+ padding: 5px;
170
  }
171
 
172
  .cli-plugin-container div.pad-10, .cli-plugin-left-col div.pad-10, .cli-plugin-right-col div.pad-10 {
173
+ padding: 10px;
174
  }
175
 
176
  .width-60 {
177
+ width: 60%;
178
  }
179
 
180
  .width-100 {
181
+ width: 100%;
182
  }
183
 
184
  .hr-top {
185
+ border-top: 1px solid #ccc;
186
  }
187
 
188
  .hr-bottom {
189
+ border-bottom: 1px solid #ccc;
190
  }
191
 
192
 
194
 
195
 
196
  table.cli_script_items {
197
+ position: relative
198
  }
199
 
200
  table.cli_script_items td, table.cli_script_items th {
201
+ display: table-cell !important;
202
+ padding: 1em !important;
203
+ vertical-align: top;
204
+ line-height: 1.75em
205
  }
206
 
207
  table.wc_emails.wc_emails td, table.cli_script_items.wc_emails td, table.wc_shipping.wc_emails td {
208
+ vertical-align: middle
209
  }
210
 
211
  table.cli_script_items tr:nth-child(odd) td {
212
+ background: #f9f9f9
213
  }
214
 
215
  table.cli_script_items td.name {
216
+ font-weight: 700
217
  }
218
 
219
  table.wc_emails .settings, table.cli_script_items .settings, table.wc_shipping .settings {
220
+ text-align: right
221
  }
222
 
223
  table.wc_emails .default, table.wc_emails .radio, table.wc_emails .status, table.cli_script_items .default, table.cli_script_items .radio, table.cli_script_items .status, table.wc_shipping .default, table.wc_shipping .radio, table.wc_shipping .status {
224
+ text-align: center
225
  }
226
 
227
  table.wc_emails .default .tips, table.wc_emails .radio .tips, table.wc_emails .status .tips, table.cli_script_items .default .tips, table.cli_script_items .radio .tips, table.cli_script_items .status .tips, table.wc_shipping .default .tips, table.wc_shipping .radio .tips, table.wc_shipping .status .tips {
228
+ margin: 0 auto
229
  }
230
 
231
  table.wc_emails .default input, table.wc_emails .radio input, table.wc_emails .status input, table.cli_script_items .default input, table.cli_script_items .radio input, table.cli_script_items .status input, table.wc_shipping .default input, table.wc_shipping .radio input, table.wc_shipping .status input {
232
+ margin: 0
233
  }
234
 
235
  table.wc_emails td.sort, table.cli_script_items td.sort, table.wc_shipping td.sort {
236
+ cursor: move;
237
+ font-size: 15px;
238
+ text-align: center
239
  }
240
 
241
  table.wc_emails td.sort::before, table.cli_script_items td.sort::before, table.wc_shipping td.sort::before {
242
+ content: '\f333';
243
+ font-family: Dashicons;
244
+ text-align: center;
245
+ line-height: 1;
246
+ color: #999;
247
+ display: block;
248
+ width: 17px;
249
+ float: left;
250
+ height: 100%;
251
+ line-height: 24px
252
  }
253
 
254
  table.wc_emails .wc-payment-gateway-method-name, table.cli_script_items .wc-payment-gateway-method-name, table.wc_shipping .wc-payment-gateway-method-name {
255
+ font-weight: 400
256
  }
257
 
258
  table.wc_emails .wc-email-settings-table-name, table.cli_script_items .wc-email-settings-table-name, table.wc_shipping .wc-email-settings-table-name {
259
+ font-weight: 700
260
  }
261
 
262
  table.wc_emails .wc-email-settings-table-name span, table.cli_script_items .wc-email-settings-table-name span, table.wc_shipping .wc-email-settings-table-name span {
263
+ font-weight: 400;
264
+ color: #999;
265
+ margin: 0 0 0 4px !important
266
  }
267
 
268
  table.wc_emails .wc-payment-gateway-method-toggle-disabled, table.wc_emails .cli-script-items-toggle-enabled, table.cli_script_items .wc-payment-gateway-method-toggle-disabled, table.cli_script_items .cli-script-items-toggle-enabled, table.wc_shipping .wc-payment-gateway-method-toggle-disabled, table.wc_shipping .cli-script-items-toggle-enabled {
269
+ padding-top: 1px;
270
+ display: block;
271
+ outline: 0;
272
+ -webkit-box-shadow: none;
273
+ box-shadow: none
274
  }
275
 
276
  table.wc_emails .wc-email-settings-table-status, table.cli_script_items .wc-email-settings-table-status, table.wc_shipping .wc-email-settings-table-status {
277
+ text-align: center;
278
+ width: 1em
279
  }
280
 
281
  table.wc_emails .wc-email-settings-table-status .tips, table.cli_script_items .wc-email-settings-table-status .tips, table.wc_shipping .wc-email-settings-table-status .tips {
282
+ margin: 0 auto
283
  }
284
 
285
  .cli-input-toggle {
286
+ height: 16px;
287
+ width: 32px;
288
+ border: 2px solid #935687;
289
+ background-color: #935687;
290
+ display: inline-block;
291
+ text-indent: -9999px;
292
+ border-radius: 10em;
293
+ position: relative;
294
+ margin-top: -1px;
295
+ vertical-align: text-top
296
  }
297
 
298
  .cli-input-toggle:before {
299
+ content: "";
300
+ display: block;
301
+ width: 16px;
302
+ height: 16px;
303
+ background: #fff;
304
+ position: absolute;
305
+ top: 0;
306
+ right: 0;
307
+ border-radius: 100%
308
  }
309
 
310
  .cli-input-toggle.cli-input-toggle--disabled {
311
+ border-color: #999;
312
+ background-color: #999
313
  }
314
 
315
  .cli-input-toggle.cli-input-toggle--disabled:before {
316
+ right: auto;
317
+ left: 0
318
  }
319
 
320
  .cli-input-toggle.cli-input-toggle--loading {
321
+ opacity: .5
322
  }
323
 
324
  .cookie-law-info-tab-head {
325
+ margin-right: 0px;
326
+ border-bottom: none;
327
  }
328
 
329
  .cookie-law-info-tab-container {
330
+ padding: 15px;
331
+ background: #fff;
332
+ box-shadow: 0px 2px 2px #ccc;
333
+ float: left;
334
+ box-sizing: border-box;
335
+ width: 100%;
336
+ height: auto;
337
  }
338
 
339
  .cookie-law-info-tab-head .nav-tab-active {
340
+ background: #fff;
341
+ border-bottom: solid 1px #fff;
342
  }
343
 
344
  .cookie-law-info-tab-head .nav-tab:focus {
345
+ box-shadow: none;
346
  }
347
 
348
  .cookie-law-info-tab-content {
349
+ display: none;
350
+ float: left;
351
+ width: 100%;
352
+ height: auto;
353
  }
354
 
355
  .cli_sub_tab_container {
356
+ float: left;
357
+ width: 100%;
358
+ height: auto;
359
  }
360
 
361
  .cli_sub_tab {
362
+ display: inline-block;
363
+ margin: 0px;
364
+ float: left;
365
+ width: 100%;
366
+ height: auto;
367
  }
368
 
369
  .cli_sub_tab li {
370
+ display: inline-block;
371
+ border-left: solid 1px #ccc;
372
+ padding: 3px 10px;
373
+ cursor: pointer;
374
  }
375
 
376
  .cli_sub_tab_content {
377
+ display: none;
378
+ float: left;
379
+ width: 100%;
380
+ height: auto;
381
  }
382
 
383
  .cli-shortcodes li {
384
+ margin-bottom: 20px;
385
+ border-bottom: dashed 1px #ccc;
386
+ padding-bottom: 7px;
387
+ margin-left: 15px;
388
  }
389
 
390
  .cli-shortcodes li div {
391
+ font-weight: bold;
392
+ width: 100%;
393
  }
394
 
395
  .cli-shortcodes li span {
396
+ display: inline-block;
397
  }
398
 
399
  .cli-help-links li {
400
+ float: left;
401
+ padding: 40px;
402
+ margin: 20px;
403
+ display: inline-block;
404
+ text-align: center;
405
+ box-shadow: 1px 1px 5px 1px rgba(0, 0, 0, .1);
406
+ width: 185px;
407
+ height: 245px;
408
  }
409
 
410
  .cli-help-links li a {
411
+ text-decoration: none;
412
+ height: 28px !important;
413
+ margin-top: 20px;
414
  }
415
 
416
  .cli-help-links li img {
417
+ margin-top: 15px;
418
  }
419
 
420
  /* copied from bootstrap */
421
  .cli_sub_tab_container input[type="text"], .cli_sub_tab_container select {
422
+ display: block;
423
+ width: 100%;
424
+ padding: 0.375rem 0.75rem;
425
+ font-size: 1rem;
426
+ line-height: 1.5;
427
+ color: #495057;
428
+ background-color: #fff;
429
+ background-clip: padding-box;
430
+ border: 1px solid #ced4da;
431
+ border-radius: 0.25rem;
432
+ transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
433
+ height: auto !important;
434
  }
435
 
436
  .cookie-law-info-tab-container .button-primary {
437
+ height: 34px;
438
  }
439
 
440
  .notify_msg {
441
+ position: fixed;
442
+ width: 300px;
443
+ padding: 15px;
444
+ color: #fff;
445
+ right: 60px;
446
+ top: 0px;
447
+ opacity: 0;
448
+ box-shadow: 0px 2px 2px #ccc;
449
+ border-radius: 5px;
450
  }
451
 
452
  .cli-indent-15 th {
453
+ padding-left: 15px;
454
  }
455
 
456
  .cli_notify_table {
457
+ height: 60px;
458
  }
459
 
460
  .cookie-law-info-form-container {
461
+ padding: 15px;
462
+ background: #fff;
463
+ box-shadow: 0px 2px 2px #ccc;
464
  }
465
 
466
  .cli-admin-table label {
467
+ width: 100%;
468
+ display: inline-block;
469
+ font-weight: bold;
470
+ margin-bottom: 10px;
471
+ margin-top: 15px;
472
  }
473
 
474
  .cli_non_necessary_form .cli_form_help {
475
+ color: #aaa;
476
+ font-style: italic;
477
+ font-weight: 250;
478
+ font-size: 12px;
479
  }
480
 
481
  .cli_settings_left {
482
+ width: 68%;
483
+ float: left;
484
+ margin-bottom: 25px;
485
  }
486
 
487
  .cli_settings_right {
488
+ width: calc(31% - 20px);
489
+ float: left;
490
+ margin-left: 25px;
491
  }
492
 
493
  .cli_privacy_overview_form label {
494
+ width: 100%;
495
+ display: inline-block;
496
+ font-weight: bold;
497
+ margin-bottom: 10px;
498
+ margin-top: 15px;
499
  }
500
 
501
  .cli_privacy_overview_form .cli_form_help {
502
+ color: #aaa;
503
+ font-style: italic;
504
+ font-weight: 250;
505
+ font-size: 12px;
506
  }
507
 
508
  .cli_form_help {
509
+ color: #8e8989;
510
+ font-style: italic;
511
+ font-weight: 250;
512
+ font-size: 12px;
513
+ display: inline-block;
514
+ width: 100%;
515
  }
516
 
517
  .cli_form_er {
518
+ color: red;
519
+ font-style: italic;
520
+ font-weight: 300;
521
+ font-size: 12px;
522
+ display: inline-block;
523
+ width: 100%;
524
  }
525
 
526
  .cli_scroll_accept_er {
527
+ display: none;
528
  }
529
 
530
  .cli_premium_features {
531
+ font-size: 14px;
532
  }
533
 
534
  @media screen and (max-width:1210px) {
535
+ .cli_settings_left {
536
+ width: 100%;
537
+ }
538
 
539
+ .cli_settings_right {
540
+ padding-left: 0px;
541
+ width: 100%;
542
+ }
543
  }
544
 
545
  /* CCPA Related Changes */
546
  /* Accordion Styles */
547
 
548
  .wt-cli-accordion-container {
549
+ position: relative;
550
+ height: auto;
551
+ border-left: 1px solid #e2e4e7;
552
+ border-right: 1px solid #e2e4e7;
553
  }
554
 
555
  .wt-cli-accordion-container>h2 {
556
+ text-align: center;
557
+ color: #fff;
558
+ padding-bottom: 5px;
559
+ margin-bottom: 20px;
560
+ padding-bottom: 15px;
561
  }
562
 
563
  .wt-cli-accordion-content>.wt-cli-accordion-tab {
564
+ padding-left: 10px;
565
+ padding-right: 10px;
566
+ border-left: 1px solid #e2e4e7;
567
+ border-right: 1px solid #e2e4e7;
568
  }
569
 
570
  .wt-cli-accordion-content.active>.wt-cli-accordion-tab {
571
+ background: #fff;
572
  }
573
 
574
  .wt-cli-accordion-tab {
575
+ position: relative;
576
+ width: 100%;
577
+ height: auto;
578
+ border-bottom: 2px dotted #e2e4e7;
579
+ box-sizing: border-box;
580
  }
581
 
582
  .wt-cli-accordion-content {
583
+ padding-bottom: 15px;
584
  }
585
 
586
  .wt-cli-accordion-tab:not(:first-child) {
587
+ margin-top: -1px;
588
  }
589
 
590
  .wt-cli-accordion-tab>a {
591
+ display: block;
592
+ text-decoration: none;
593
+ color: #191e23;
594
+ font-weight: 600;
595
+ padding-top: 15px;
596
+ padding-bottom: 15px;
597
+ outline: none;
598
+ -webkit-transition: all 0.2s linear;
599
+ -moz-transition: all 0.2s linear;
600
+ transition: all 0.2s linear;
601
+ box-shadow: none;
602
+ display: flex;
603
+ align-items: center;
604
+ font-size: 1.3em;
605
  }
606
 
607
  .wt-cli-accordion-tab>a i {
608
+ float: right;
609
+ margin-top: 2px;
610
  }
611
 
612
  .wt-cli-accordion-tab>a:before {
613
+ content: "";
614
+ display: block;
615
+ width: 8px;
616
+ height: 8px;
617
+ border-top: 2px solid #000000;
618
+ border-right: 2px solid #000000;
619
+ -webkit-transform: rotate(45deg);
620
+ transform: rotate(45deg);
621
+ transition: -webkit-transform 400ms ease;
622
+ transition: transform 400ms ease;
623
+ transition: transform 400ms ease, -webkit-transform 400ms ease;
624
+ opacity: 0.8;
625
+ margin-right: 16px;
626
  }
627
 
628
  .wt-cli-accordion-tab>a.active::before {
629
+ -webkit-transform: rotate(135deg);
630
+ transform: rotate(135deg);
631
  }
632
 
633
  .wt-cli-accordion-content {
634
+ display: none;
635
  }
636
 
637
  /* End Accordion Styles */
638
 
639
  .wt-cli-section-gdpr-ccpa .wt-cli-section-inner {
640
+ display: none;
641
  }
642
 
643
  /* Webtoffe GDPR Cookie Consent Tooltip */
645
  /* Add this attribute to the element that needs a tooltip */
646
 
647
  [data-wt-cli-tooltip] {
648
+ position: relative;
649
+ z-index: 9999;
650
+ cursor: pointer;
651
  }
652
 
653
  /* Hide the tooltip content by default */
654
 
655
  [data-wt-cli-tooltip]:before, [data-wt-cli-tooltip]:after {
656
+ visibility: hidden;
657
+ opacity: 0;
658
+ pointer-events: none;
659
  }
660
 
661
  /* Position tooltip above the element */
662
 
663
  [data-wt-cli-tooltip]:before {
664
+ position: absolute;
665
+ bottom: 100%;
666
+ left: 50%;
667
+ margin-bottom: 10px;
668
+ transform: translateX(-50%);
669
+ min-width: 250px;
670
+ -webkit-border-radius: 4px;
671
+ -moz-border-radius: 4px;
672
+ border-radius: 4px;
673
+ background-color: #333;
674
+ color: #fff;
675
+ content: attr(data-wt-cli-tooltip);
676
+ text-align: center;
677
+ font-size: 12px;
678
+ line-height: 18px;
679
+ font-weight: normal;
680
+ padding: 12px;
681
+ letter-spacing: -.25px;
682
+ text-transform: none;
683
+ white-space: normal;
684
  }
685
 
686
  /* Triangle hack to make tooltip look like a speech bubble */
687
 
688
  [data-wt-cli-tooltip]:after {
689
+ position: absolute;
690
+ bottom: 100%;
691
+ left: 50%;
692
+ margin-bottom: 5px;
693
+ margin-left: -5px;
694
+ width: 0;
695
+ border-top: 5px solid #000;
696
+ border-top: 5px solid hsla(0, 0%, 20%, 0.9);
697
+ border-right: 5px solid transparent;
698
+ border-left: 5px solid transparent;
699
+ content: " ";
700
+ font-size: 0;
701
+ line-height: 0;
702
  }
703
 
704
  /* Show tooltip content on hover */
705
 
706
  [data-wt-cli-tooltip]:hover:before, [data-wt-cli-tooltip]:hover:after {
707
+ visibility: visible;
708
+ opacity: 1;
709
  }
710
 
711
  span.wt-cli-tootip-icon {
712
+ background-image: url('../images/wt-cli-info.svg');
713
  }
714
 
715
  span.wt-cli-tootip-icon {
716
+ background-image: url(../images/wt-cli-info.svg);
717
+ width: 14px;
718
+ height: 14px;
719
+ display: inline-flex;
720
+ background-size: 100%;
721
+ align-items: center;
722
+ justify-content: center;
723
+ margin-top: 5px;
724
+ margin-left: 10px;
725
+ margin-bottom: -2px;
726
  }
727
 
728
  .wt-cli-ccpa-message-toggler .wt-cli-form-group {
729
+ margin-bottom: 15px;
730
  }
731
 
732
  .wt-cli-notice.wt-cli-info {
733
+ padding: 15px 15px 15px 41px;
734
+ background: #e5f5fa;
735
+ position: relative;
736
+ border-left: 4px solid;
737
+ border-color: #00a0d2;
738
+ margin-bottom: 15px;
739
+ width: 100%;
740
+ box-sizing: border-box;
741
  }
742
 
743
  .wt-cli-notice.wt-cli-info:before {
744
+ content: "\f348";
745
+ color: #00a0d2;
746
+ font-family: "dashicons";
747
+ position: absolute;
748
+ left: 15px;
749
+ font-size: 16px;
750
  }
751
 
752
  .wt-cli-status-success:before {
753
+ content: "";
754
+ background: url(../images/add.svg);
755
+ width: 18px;
756
+ height: 18px;
757
+ display: block;
758
+ background-size: cover;
759
  }
760
 
761
  .wt-cli-status-icon {
762
+ width: 18px;
763
+ height: 18px;
764
+ font-size: 16px;
765
+ text-align: center;
766
+ content: "";
767
+ font-family: "dashicons";
768
  }
769
 
770
  /* Toggle checkbox CSS since 1.9.4 */
771
  .wt-cli-input-toggle-section {
772
+ display: none;
773
  }
774
 
775
  .wt-cli-section-floating-widget-settings .wt-cli-input-toggle-section.wt-cli-toggle-active label {
776
+ margin-left: 15px !important;
777
  }
778
 
779
  .wt-cli-section-floating-widget-settings .wt-cli-input-toggle-section label {
780
+ -webkit-transition: margin 700ms;
781
+ -moz-transition: margin 700ms;
782
+ -o-transition: margin 700ms;
783
+ transition: margin 700ms;
784
  }
785
 
786
  .wt-cli-section-floating-widget-settings .form-table th {
787
+ width: 260px;
788
  }
789
 
790
 
791
  /* Callout styles */
792
 
793
  .wt-cli-callout {
794
+ width: 100%;
795
+ padding: 1.5em 1.5em 1.5em 1.5em;
796
+ margin-bottom: 1.5em;
797
+ overflow: auto;
798
+ position: relative;
799
+ border-width: 0 0 0 5px;
800
+ border-style: solid;
801
+ min-width: 170px;
802
+ box-sizing: border-box;
803
  }
804
 
805
  .wt-cli-callout.wt-cli-callout-icon {
806
+ padding: 1.5em 3em 1.6em 3.7em;
807
  }
808
 
809
  .wt-cli-callout p {
810
+ margin-bottom: 0.6em;
811
+ margin-top: 0.5em;
812
  }
813
 
814
  .wt-cli-callout p:first-child {
815
+ margin-top: 0;
816
  }
817
 
818
  .wt-cli-callout p:last-child {
819
+ margin-bottom: 0;
820
  }
821
 
822
  .wt-cli-callout:before {
823
+ content: "";
824
+ font-family: "dashicons";
825
+ position: absolute;
826
+ font-size: 20px;
827
+ top: 50%;
828
+ left: 0.5em;
829
+ transform: translateY(-50%);
830
  }
831
 
832
  .wt-cli-callout .screen-reader-text+br {
833
+ display: none;
834
  }
835
 
836
  .wt-cli-callout-info {
837
+ background: #e5f5fa;
838
+ border-color: #00a0d2;
839
  }
840
 
841
  .wt-cli-callout-success {
842
+ background: #eff7ed;
843
+ border-color: #64b450;
844
  }
845
 
846
  .wt-cli-callout-alert {
847
+ background: #fff8e5;
848
+ border-color: #ffb900;
849
  }
850
 
851
  .wt-cli-callout-tutorial {
852
+ background: #f2f0f7;
853
+ border-color: #826eb4;
854
  }
855
 
856
  .wt-cli-callout-warning {
857
+ background: #fbeaea;
858
+ border-color: #dc3232;
859
  }
860
 
861
  .wt-cli-callout-info.wt-cli-callout-icon:before {
862
+ content: "\f348";
863
+ color: #00a0d2;
864
  }
865
 
866
  .wt-cli-callout-success.wt-cli-callout-icon:before {
867
+ content: "";
868
+ color: #fff;
869
+ width: 18px;
870
+ height: 18px;
871
+ background: url('../images/add.svg');
872
  }
873
 
874
  .wt-cli-callout-alert.wt-cli-callout-icon:before {
875
+ content: "\f227";
876
+ color: #ffb900;
877
  }
878
 
879
  .wt-cli-callout-tutorial.wt-cli-callout-icon:before {
880
+ content: "\f308";
881
+ color: #826eb4;
882
  }
883
 
884
  .wt-cli-callout-warning.wt-cli-callout-icon:before {
885
+ content: "\f153";
886
+ color: #dc3232;
887
  }
888
 
889
  /* Modal styles since 2.3.2 */
890
 
891
  .wt-cli-modal {
892
+ position: fixed;
893
+ top: 10%;
894
+ padding: 15px 20px;
895
+ border-radius: 3px;
896
+ background-color: white;
897
+ z-index: 60000;
898
+ width: 400px;
899
+ display: none;
900
+ left: 0;
901
+ right: 0;
902
+ margin: 0 auto;
903
+ box-sizing: border-box;
904
  }
905
 
906
  .wt-cli-modal.on {
907
+ display: block;
908
  }
909
 
910
  .wt-cli-modal-js-overlay {
911
+ background: #444;
912
+ opacity: .8;
913
+ position: fixed;
914
+ top: 0px;
915
+ width: 100%;
916
+ height: 1000px;
917
+ z-index: 20000;
918
+ left: 0px;
919
  }
920
 
921
  .wt-cli-modal-js-close {
922
+ position: absolute;
923
+ bottom: 0px;
924
+ right: 0px;
925
+ color: #000;
926
+ border-radius: 50%;
927
+ font-size: 18px;
928
+ text-align: center;
929
+ padding: 1px;
930
+ top: 5px;
931
+ right: 5px;
932
+ box-shadow: var(--box-shadow);
933
+ cursor: pointer;
934
  }
935
 
936
  .wt-cli-modal-header h4 {
937
+ margin: 0;
938
+ font-size: 15px;
939
  }
940
 
941
  /* New grid styles */
942
  .wt-cli-align-center {
943
+ -webkit-box-align: center !important;
944
+ -ms-flex-align: center !important;
945
+ align-items: center !important;
946
  }
947
 
948
  .wt-cli-justify-center {
949
+ -webkit-box-pack: justify !important;
950
+ -ms-flex-pack: justify !important;
951
+ justify-content: center !important;
952
  }
953
 
954
  .wt-cli-justify-end {
955
+ -ms-flex-pack: end !important;
956
+ justify-content: flex-end !important;
957
  }
958
 
959
  .wt-cli-container-fluid {
960
+ width: 100%;
961
+ padding-right: 15px;
962
+ padding-left: 15px;
963
+ margin-right: auto;
964
+ margin-left: auto;
965
  }
966
 
967
  .wt-cli-grid-wrapper *, .wt-cli-row * {
968
+ box-sizing: border-box;
969
  }
970
 
971
  .wt-cli-row {
972
+ display: -webkit-box;
973
+ display: -ms-flexbox;
974
+ display: flex;
975
+ flex-wrap: wrap;
976
+ -ms-flex-wrap: wrap;
977
+ margin-left: -12.5px;
978
+ margin-right: -12.5px;
979
  }
980
 
981
  .wt-cli-col {
982
+ -ms-flex-preferred-size: 0;
983
+ flex-basis: 0;
984
+ -webkit-box-flex: 1;
985
+ -ms-flex-positive: 1;
986
+ flex-grow: 1;
987
+ max-width: 100%;
988
  }
989
 
990
  .wt-cli-col-1 {
991
+ -ms-flex: 0 0 8.33333333%;
992
+ flex: 0 0 8.33333333%;
993
+ max-width: 8.33333333%;
994
  }
995
 
996
  .wt-cli-col-2 {
997
+ -ms-flex: 0 0 16.66666667%;
998
+ flex: 0 0 16.66666667%;
999
+ max-width: 16.66666667%;
1000
  }
1001
 
1002
  .wt-cli-col-3 {
1003
+ -ms-flex: 0 0 25%;
1004
+ flex: 0 0 25%;
1005
+ max-width: 25%;
1006
  }
1007
 
1008
  .wt-cli-col-4 {
1009
+ -ms-flex: 0 0 33.33333333%;
1010
+ flex: 0 0 33.33333333%;
1011
+ max-width: 33.33333333%;
1012
  }
1013
 
1014
  .wt-cli-col-5 {
1015
+ -ms-flex: 0 0 41.66666667%;
1016
+ flex: 0 0 41.66666667%;
1017
+ max-width: 41.66666667%;
1018
  }
1019
 
1020
  .wt-cli-col-6 {
1021
+ -webkit-box-flex: 0;
1022
+ -ms-flex: 0 0 50%;
1023
+ flex: 0 0 50%;
1024
+ max-width: 50%;
1025
  }
1026
 
1027
  .wt-cli-col-7 {
1028
+ -ms-flex: 0 0 58.33333333%;
1029
+ flex: 0 0 58.33333333%;
1030
+ max-width: 58.33333333%;
1031
  }
1032
 
1033
  .wt-cli-col-8 {
1034
+ -ms-flex: 0 0 66.66666667%;
1035
+ flex: 0 0 66.66666667%;
1036
+ max-width: 66.66666667%;
1037
  }
1038
 
1039
  .wt-cli-col-9 {
1040
+ -ms-flex: 0 0 75%;
1041
+ flex: 0 0 75%;
1042
+ max-width: 75%;
1043
  }
1044
 
1045
  .wt-cli-col-10 {
1046
+ -ms-flex: 0 0 83.33333333%;
1047
+ flex: 0 0 83.33333333%;
1048
+ max-width: 83.33333333%;
1049
  }
1050
 
1051
  .wt-cli-col-11 {
1052
+ -ms-flex: 0 0 91.66666667%;
1053
+ flex: 0 0 91.66666667%;
1054
+ max-width: 91.66666667%;
1055
  }
1056
 
1057
  .wt-cli-col-12 {
1058
+ -webkit-box-flex: 0;
1059
+ -ms-flex: 0 0 100%;
1060
+ flex: 0 0 100%;
1061
+ max-width: 100%;
1062
  }
1063
 
1064
  .wt-cli-col, .wt-cli-col-1, .wt-cli-col-2, .wt-cli-col-3, .wt-cli-col-4, .wt-cli-col-5, .wt-cli-col-6, .wt-cli-col-7, .wt-cli-col-8, .wt-cli-col-9, .wt-cli-col-10, .wt-cli-col-11, .wt-cli-col-12 {
1065
+ position: relative;
1066
+ width: 100%;
1067
+ min-height: 1px;
1068
+ padding-right: 12.5px;
1069
+ padding-left: 12.5px;
1070
  }
1071
 
1072
  .wt-cli-gdpr-plugin-status {
1073
+ display: flex;
1074
+ align-items: center;
1075
+ font-weight: 500;
1076
  }
1077
 
1078
  .wt-cli-gdpr-plugin-status img {
1079
+ width: 18px;
1080
+ margin-right: 10px;
1081
  }
1082
 
1083
  .wt-cli-gdpr-plugin-header {
1084
+ display: flex;
1085
+ align-items: center;
1086
+ justify-content: space-between;
1087
  }
1088
 
1089
  .wt-cli-gdpr-plugin-branding-logo {
1090
+ display: flex;
1091
+ justify-content: flex-end;
1092
  }
1093
 
1094
  .wt-cli-gdpr-plugin-branding-logo img {
1095
+ width: 150px;
1096
  }
1097
 
1098
  .wt-cli-gdpr-plugin-branding-logo a:focus {
1099
+ outline: none;
1100
+ box-shadow: none;
1101
  }
1102
 
1103
  .wt-cli-gdpr-plugin-branding-tagline a {
1104
+ color: #444;
1105
  }
1106
 
1107
  .wt-cli-gdpr-plugin-branding-tagline {
1108
+ margin-top: 5px;
1109
  }
1110
 
1111
  /* Upgrade side bar styles */
1112
  .wt-ier-sidebar-wrapper {
1113
+ background: #FFFFFF;
1114
+ border-radius: 5px;
1115
+ max-width: 370px;
1116
  }
1117
 
1118
  .wt-ier-sidebar-img {
1119
+ margin: 0 auto 20px auto;
1120
+ display: block;
1121
  }
1122
 
1123
  .wt-ier-sidebar-title {
1124
+ font-weight: 600;
1125
+ font-size: 17px;
1126
+ line-height: 25px;
1127
+ color: #000000;
1128
+ margin-bottom: 20px;
1129
  }
1130
 
1131
  .wt-ier-icon {
1132
+ width: auto;
1133
+ height: 100%;
1134
+ max-height: 25px;
1135
+ margin-right: 8px;
1136
  }
1137
 
1138
  .wt-ier-sidebar-p {
1139
+ font-style: normal;
1140
+ font-weight: normal;
1141
+ font-size: 12px;
1142
+ line-height: 16px;
1143
+ color: #000000;
1144
+ margin: 0;
1145
  }
1146
 
1147
  .wt-ier-green-btn {
1148
+ background: #00CB95;
1149
+ border-radius: 4px;
1150
+ font-weight: 600;
1151
+ font-size: 16px;
1152
+ line-height: 19px;
1153
+ text-align: center;
1154
+ padding: 15px 20px;
1155
+ color: #FFFFFF;
1156
+ display: inline-block;
1157
+ text-decoration: none;
1158
+ transition: all .2s ease;
1159
+ border: none;
1160
+ margin-top: 20px;
1161
  }
1162
 
1163
  .wt-ier-green-btn:hover, .wt-ier-green-btn:focus {
1164
+ text-decoration: none;
1165
+ opacity: .8;
1166
+ transition: all .2s ease;
1167
+ border: none;
1168
+ transform: translateY(1px);
1169
  }
1170
 
1171
  .wt-ier-wrapper {
1172
+ background-color: #fff;
1173
+ padding: 30px;
1174
  }
1175
 
1176
  .wt-ier-box-wrapper {
1177
+ background: #FFFFFF;
1178
+ border: 1px solid #D2D2D2;
1179
+ border-radius: 6px;
1180
+ min-height: 100%;
1181
  }
1182
 
1183
  .wt-ier-p-5 {
1184
+ padding: 35px;
1185
  }
1186
 
1187
  .wt-ier-p-4 {
1188
+ padding: 20px;
1189
  }
1190
 
1191
  .wt-ier-v-center {
1192
+ -ms-flex-align: center;
1193
+ align-items: center;
1194
  }
1195
 
1196
  .wt-ier-flex {
1197
+ display: -ms-flexbox;
1198
+ display: flex;
1199
  }
1200
 
1201
  .wt-ier-center {
1202
+ text-align: center;
1203
  }
1204
 
1205
  .wt-ier-row * {
1206
+ box-sizing: border-box;
1207
  }
1208
 
1209
  .wt-ier-row {
1210
+ display: -ms-flexbox;
1211
+ display: flex;
1212
+ -ms-flex-wrap: wrap;
1213
+ flex-wrap: wrap;
1214
+ margin: -15px;
1215
  }
1216
 
1217
  .wt-ier-col-12 {
1218
+ -ms-flex: 0 0 100%;
1219
+ flex: 0 0 100%;
1220
+ max-width: 100%;
1221
 
1222
  }
1223
 
1224
  .wt-ier-col-md-6, .wt-ier-col-12 {
1225
+ position: relative;
1226
+ width: 100%;
1227
+ padding: 15px;
1228
  }
1229
 
1230
  @media (min-width: 768px) {
1231
+ .wt-ier-col-md-6 {
1232
+ -ms-flex: 0 0 50%;
1233
+ flex: 0 0 50%;
1234
+ max-width: 50%;
1235
+ }
1236
 
1237
+ .wt-ier-mb-md-0 {
1238
+ margin-bottom: 0;
1239
+ }
1240
 
1241
+ .wt-ier-border-md-right {
1242
+ border-right: 1px solid #E8E8E8;
1243
+ }
1244
 
1245
  }
1246
  .wt-cli-footer {
1247
+ padding: 15px;
1248
+ background: #f5f5f5;
1249
+ margin-left: -15px;
1250
+ margin-right: -15px;
1251
+ margin-bottom: -15px;
1252
+ }
admin/index.php CHANGED
@@ -1 +1 @@
1
- <?php // Silence is golden
1
+ <?php // Silence is golden
admin/js/cookie-law-info-admin-1.6.7.js CHANGED
@@ -28,216 +28,238 @@
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
- $(function() {
32
- $('.my-color-field').wpColorPicker();
 
33
 
34
- var cli_nav_tab=$('.cookie-law-info-tab-head .nav-tab');
35
- if(cli_nav_tab.length>0)
36
- {
37
- cli_nav_tab.click(function(){
38
- var cli_tab_hash=$(this).attr('href');
39
- cli_nav_tab.removeClass('nav-tab-active');
40
- $(this).addClass('nav-tab-active');
41
- cli_tab_hash=cli_tab_hash.charAt(0)=='#' ? cli_tab_hash.substring(1) : cli_tab_hash;
42
- var cli_tab_elm=$('div[data-id="'+cli_tab_hash+'"]');
43
- $('.cookie-law-info-tab-content').hide();
44
- if(cli_tab_elm.length>0)
45
- {
46
- cli_tab_elm.fadeIn();
47
- }
48
- });
49
- var location_hash=window.location.hash;
50
- if(location_hash!="")
51
- {
52
- var cli_tab_hash=location_hash.charAt(0)=='#' ? location_hash.substring(1) : location_hash;
53
- if(cli_tab_hash!="")
54
- {
55
- $('div[data-id="'+cli_tab_hash+'"]').show();
56
- $('a[href="#'+cli_tab_hash+'"]').addClass('nav-tab-active');
57
- }
58
- }else
59
- {
60
- cli_nav_tab.eq(0).click();
61
- }
62
- }
63
- $('.cli_sub_tab li').click(function(){
64
- var trgt=$(this).attr('data-target');
65
- var prnt=$(this).parent('.cli_sub_tab');
66
- var ctnr=prnt.siblings('.cli_sub_tab_container');
67
- prnt.find('li a').css({'color':'#0073aa','cursor':'pointer'});
68
- $(this).find('a').css({'color':'#ccc','cursor':'default'});
69
- ctnr.find('.cli_sub_tab_content').hide();
70
- ctnr.find('.cli_sub_tab_content[data-id="'+trgt+'"]').fadeIn();
71
- });
72
- $('.cli_sub_tab').each(function(){
73
- var elm=$(this).children('li').eq(0);
74
- elm.click();
75
- });
76
- $('#cli_non-ncessary_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+'&cli_non-necessary_ajax_update=1',
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_non_necessary_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_non_necessary_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')
105
- {
106
- //return;
107
  }
108
- e.preventDefault();
109
- var data=$(this).serialize();
110
- var url=$(this).attr('action');
111
- var spinner=$(this).find('.spinner');
112
- var submit_btn=$(this).find('input[type="submit"]');
113
- spinner.css({'visibility':'visible'});
114
- submit_btn.css({'opacity':'.5','cursor':'default'}).prop('disabled',true);
115
- $.ajax({
116
- url:url,
117
- type:'POST',
118
- data:data+'&cli_settings_ajax_update='+submit_action,
119
- success:function(data)
120
- {
121
- spinner.css({'visibility':'hidden'});
122
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
123
- if(submit_action=='delete_all_settings')
124
- {
125
- cli_notify_msg.success(cli_reset_settings_success_message);
126
- setTimeout(function(){
127
- window.location.reload(true);
128
- },1000);
129
- }else
130
- {
131
- cli_notify_msg.success(cli_settings_success_message);
132
- }
133
- cli_bar_active_msg();
134
- },
135
- error:function ()
136
- {
137
- spinner.css({'visibility':'hidden'});
138
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
139
- if(submit_action=='delete_all_settings')
140
- {
141
- cli_notify_msg.error(cli_reset_settings_error_message);
142
- }else
143
- {
144
- cli_notify_msg.error(cli_settings_error_message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
- });
148
- });
149
 
150
- //=====================
151
- function cli_scroll_accept_er()
152
- {
153
- if($('[name="as_popup_field"]:checked').val()=='true' && $('[name="popup_overlay_field"]:checked').val()=='true' && $('[name="scroll_close_field"]:checked').val()=='true')
154
  {
155
- $('.cli_scroll_accept_er').show();
156
- //$('label[for="scroll_close_field"]').css({'color':'red'});
157
- }else
158
- {
159
- $('.cli_scroll_accept_er').hide();
160
- //$('label[for="scroll_close_field"]').css({'color':'#23282d'});
 
161
  }
162
- }
163
- cli_scroll_accept_er();
164
- $('[name="as_popup_field"], [name="popup_overlay_field"], [name="scroll_close_field"]').click(function(){
165
  cli_scroll_accept_er();
166
- });
167
- //=====================
 
 
 
 
168
 
169
- function cli_bar_active_msg()
170
- {
171
- $('.cli_bar_state tr').hide();
172
- if($('input[type="radio"].cli_bar_on').is(':checked'))
173
  {
174
- $('.cli_bar_state tr.cli_bar_on').show();
175
- }else
176
- {
177
- $('.cli_bar_state tr.cli_bar_off').show();
 
 
178
  }
179
- }
180
- var cli_form_toggler=
181
- {
182
- set:function()
183
  {
184
- $('select.cli_form_toggle').each(function(){
185
- cli_form_toggler.toggle($(this));
186
- });
187
- $('input[type="radio"].cli_form_toggle').each(function(){
188
- if($(this).is(':checked'))
189
- {
190
- cli_form_toggler.toggle($(this));
191
- }
192
- });
193
- $('select.cli_form_toggle').change(function(){
194
- cli_form_toggler.toggle($(this));
195
- });
196
- $('input[type="radio"].cli_form_toggle').click(function(){
197
- if($(this).is(':checked'))
198
- {
199
- cli_form_toggler.toggle($(this));
200
- }
201
- });
202
- },
203
- toggle:function(elm)
204
- {
205
- var vl=elm.val();
206
- var trgt=elm.attr('cli_frm_tgl-target');
207
- $('[cli_frm_tgl-id="'+trgt+'"]').hide();
208
- $('[cli_frm_tgl-id="'+trgt+'"]').filter(function(){
209
- return $(this).attr('cli_frm_tgl-val')==vl;
210
- }).show().find('th label').css({'margin-left':'0px'}).animate({'margin-left':'15px'});
211
- }
212
- }
213
- var cli_notify_msg=
214
  {
215
- error:function(message)
216
- {
217
- var er_elm=$('<div class="notify_msg" style="background:#dd4c27; border:solid 1px #dd431c;">'+message+'</div>');
218
- this.setNotify(er_elm);
219
- },
220
- success:function(message)
221
- {
222
- var suss_elm=$('<div class="notify_msg" style="background:#1de026; border:solid 1px #2bcc1c;">'+message+'</div>');
223
- this.setNotify(suss_elm);
224
- },
225
- setNotify:function(elm)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  {
227
- $('body').append(elm);
228
- elm.stop(true,true).animate({'opacity':1,'top':'50px'},1000);
229
- setTimeout(function(){
230
- elm.animate({'opacity':0,'top':'100px'},1000,function(){
231
- elm.remove();
232
- });
233
- },3000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
235
- }
236
- cli_form_toggler.set();
237
 
238
- });
 
239
  })( jQuery );
240
  function cli_store_settings_btn_click(vl)
241
  {
242
- document.getElementById('cli_update_action').value=vl;
243
  }
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
+ $(
32
+ function() {
33
+ $( '.my-color-field' ).wpColorPicker();
34
 
35
+ var cli_nav_tab = $( '.cookie-law-info-tab-head .nav-tab' );
36
+ if (cli_nav_tab.length > 0) {
37
+ cli_nav_tab.click(
38
+ function(){
39
+ var cli_tab_hash = $( this ).attr( 'href' );
40
+ cli_nav_tab.removeClass( 'nav-tab-active' );
41
+ $( this ).addClass( 'nav-tab-active' );
42
+ cli_tab_hash = cli_tab_hash.charAt( 0 ) == '#' ? cli_tab_hash.substring( 1 ) : cli_tab_hash;
43
+ var cli_tab_elm = $( 'div[data-id="' + cli_tab_hash + '"]' );
44
+ $( '.cookie-law-info-tab-content' ).hide();
45
+ if (cli_tab_elm.length > 0) {
46
+ cli_tab_elm.fadeIn();
47
+ }
48
+ }
49
+ );
50
+ var location_hash = window.location.hash;
51
+ if (location_hash != "") {
52
+ var cli_tab_hash = location_hash.charAt( 0 ) == '#' ? location_hash.substring( 1 ) : location_hash;
53
+ if (cli_tab_hash != "") {
54
+ $( 'div[data-id="' + cli_tab_hash + '"]' ).show();
55
+ $( 'a[href="#' + cli_tab_hash + '"]' ).addClass( 'nav-tab-active' );
56
+ }
57
+ } else {
58
+ cli_nav_tab.eq( 0 ).click();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
 
 
 
 
 
 
 
60
  }
61
+ $( '.cli_sub_tab li' ).click(
62
+ function(){
63
+ var trgt = $( this ).attr( 'data-target' );
64
+ var prnt = $( this ).parent( '.cli_sub_tab' );
65
+ var ctnr = prnt.siblings( '.cli_sub_tab_container' );
66
+ prnt.find( 'li a' ).css( {'color':'#0073aa','cursor':'pointer'} );
67
+ $( this ).find( 'a' ).css( {'color':'#ccc','cursor':'default'} );
68
+ ctnr.find( '.cli_sub_tab_content' ).hide();
69
+ ctnr.find( '.cli_sub_tab_content[data-id="' + trgt + '"]' ).fadeIn();
70
+ }
71
+ );
72
+ $( '.cli_sub_tab' ).each(
73
+ function(){
74
+ var elm = $( this ).children( 'li' ).eq( 0 );
75
+ elm.click();
76
+ }
77
+ );
78
+ $( '#cli_non-ncessary_form' ).submit(
79
+ function(e){
80
+ e.preventDefault();
81
+ var data = $( this ).serialize();
82
+ var url = $( this ).attr( 'action' );
83
+ var spinner = $( this ).find( '.spinner' );
84
+ var submit_btn = $( this ).find( 'input[type="submit"]' );
85
+ spinner.css( {'visibility':'visible'} );
86
+ submit_btn.css( {'opacity':'.5','cursor':'default'} ).prop( 'disabled',true );
87
+ $.ajax(
88
+ {
89
+ url:url,
90
+ type:'POST',
91
+ data:data + '&cli_non-necessary_ajax_update=1',
92
+ success:function(data)
93
+ {
94
+ spinner.css( {'visibility':'hidden'} );
95
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
96
+ cli_notify_msg.success( cli_non_necessary_success_message );
97
+ },
98
+ error:function ()
99
+ {
100
+ spinner.css( {'visibility':'hidden'} );
101
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
102
+ cli_notify_msg.error( cli_non_necessary_error_message );
103
+ }
104
+ }
105
+ );
106
+ }
107
+ );
108
+ $( '#cli_settings_form' ).submit(
109
+ function(e){
110
+ var submit_action = $( '#cli_update_action' ).val();
111
+ if (submit_action == 'delete_all_settings') {
112
+ // return;
113
  }
114
+ e.preventDefault();
115
+ var data = $( this ).serialize();
116
+ var url = $( this ).attr( 'action' );
117
+ var spinner = $( this ).find( '.spinner' );
118
+ var submit_btn = $( this ).find( 'input[type="submit"]' );
119
+ spinner.css( {'visibility':'visible'} );
120
+ submit_btn.css( {'opacity':'.5','cursor':'default'} ).prop( 'disabled',true );
121
+ $.ajax(
122
+ {
123
+ url:url,
124
+ type:'POST',
125
+ data:data + '&cli_settings_ajax_update=' + submit_action,
126
+ success:function(data)
127
+ {
128
+ spinner.css( {'visibility':'hidden'} );
129
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
130
+ if (submit_action == 'delete_all_settings') {
131
+ cli_notify_msg.success( cli_reset_settings_success_message );
132
+ setTimeout(
133
+ function(){
134
+ window.location.reload( true );
135
+ },
136
+ 1000
137
+ );
138
+ } else {
139
+ cli_notify_msg.success( cli_settings_success_message );
140
+ }
141
+ cli_bar_active_msg();
142
+ },
143
+ error:function ()
144
+ {
145
+ spinner.css( {'visibility':'hidden'} );
146
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
147
+ if (submit_action == 'delete_all_settings') {
148
+ cli_notify_msg.error( cli_reset_settings_error_message );
149
+ } else {
150
+ cli_notify_msg.error( cli_settings_error_message );
151
+ }
152
+ }
153
+ }
154
+ );
155
  }
156
+ );
 
157
 
158
+ // =====================
159
+ function cli_scroll_accept_er()
 
 
160
  {
161
+ if ($( '[name="as_popup_field"]:checked' ).val() == 'true' && $( '[name="popup_overlay_field"]:checked' ).val() == 'true' && $( '[name="scroll_close_field"]:checked' ).val() == 'true') {
162
+ $( '.cli_scroll_accept_er' ).show();
163
+ // $('label[for="scroll_close_field"]').css({'color':'red'});
164
+ } else {
165
+ $( '.cli_scroll_accept_er' ).hide();
166
+ // $('label[for="scroll_close_field"]').css({'color':'#23282d'});
167
+ }
168
  }
 
 
 
169
  cli_scroll_accept_er();
170
+ $( '[name="as_popup_field"], [name="popup_overlay_field"], [name="scroll_close_field"]' ).click(
171
+ function(){
172
+ cli_scroll_accept_er();
173
+ }
174
+ );
175
+ // =====================
176
 
177
+ function cli_bar_active_msg()
 
 
 
178
  {
179
+ $( '.cli_bar_state tr' ).hide();
180
+ if ($( 'input[type="radio"].cli_bar_on' ).is( ':checked' )) {
181
+ $( '.cli_bar_state tr.cli_bar_on' ).show();
182
+ } else {
183
+ $( '.cli_bar_state tr.cli_bar_off' ).show();
184
+ }
185
  }
186
+ var cli_form_toggler =
 
 
 
187
  {
188
+ set:function()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  {
190
+ $( 'select.cli_form_toggle' ).each(
191
+ function(){
192
+ cli_form_toggler.toggle( $( this ) );
193
+ }
194
+ );
195
+ $( 'input[type="radio"].cli_form_toggle' ).each(
196
+ function(){
197
+ if ($( this ).is( ':checked' )) {
198
+ cli_form_toggler.toggle( $( this ) );
199
+ }
200
+ }
201
+ );
202
+ $( 'select.cli_form_toggle' ).change(
203
+ function(){
204
+ cli_form_toggler.toggle( $( this ) );
205
+ }
206
+ );
207
+ $( 'input[type="radio"].cli_form_toggle' ).click(
208
+ function(){
209
+ if ($( this ).is( ':checked' )) {
210
+ cli_form_toggler.toggle( $( this ) );
211
+ }
212
+ }
213
+ );
214
+ },
215
+ toggle:function(elm)
216
+ {
217
+ var vl = elm.val();
218
+ var trgt = elm.attr( 'cli_frm_tgl-target' );
219
+ $( '[cli_frm_tgl-id="' + trgt + '"]' ).hide();
220
+ $( '[cli_frm_tgl-id="' + trgt + '"]' ).filter(
221
+ function(){
222
+ return $( this ).attr( 'cli_frm_tgl-val' ) == vl;
223
+ }
224
+ ).show().find( 'th label' ).css( {'margin-left':'0px'} ).animate( {'margin-left':'15px'} );
225
+ }
226
+ }
227
+ var cli_notify_msg =
228
  {
229
+ error:function(message)
230
+ {
231
+ var er_elm = $( '<div class="notify_msg" style="background:#dd4c27; border:solid 1px #dd431c;">' + message + '</div>' );
232
+ this.setNotify( er_elm );
233
+ },
234
+ success:function(message)
235
+ {
236
+ var suss_elm = $( '<div class="notify_msg" style="background:#1de026; border:solid 1px #2bcc1c;">' + message + '</div>' );
237
+ this.setNotify( suss_elm );
238
+ },
239
+ setNotify:function(elm)
240
+ {
241
+ $( 'body' ).append( elm );
242
+ elm.stop( true,true ).animate( {'opacity':1,'top':'50px'},1000 );
243
+ setTimeout(
244
+ function(){
245
+ elm.animate(
246
+ {'opacity':0,'top':'100px'},
247
+ 1000,
248
+ function(){
249
+ elm.remove();
250
+ }
251
+ );
252
+ },
253
+ 3000
254
+ );
255
+ }
256
  }
257
+ cli_form_toggler.set();
 
258
 
259
+ }
260
+ );
261
  })( jQuery );
262
  function cli_store_settings_btn_click(vl)
263
  {
264
+ document.getElementById( 'cli_update_action' ).value = vl;
265
  }
admin/js/cookie-law-info-admin.js CHANGED
@@ -28,198 +28,219 @@
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
- $(function() {
32
- $('.my-color-field').wpColorPicker();
 
33
 
34
- var cli_nav_tab=$('.cookie-law-info-tab-head .nav-tab');
35
- if(cli_nav_tab.length>0)
36
- {
37
- cli_nav_tab.click(function(){
38
- var cli_tab_hash=$(this).attr('href');
39
- cli_nav_tab.removeClass('nav-tab-active');
40
- $(this).addClass('nav-tab-active');
41
- cli_tab_hash=cli_tab_hash.charAt(0)=='#' ? cli_tab_hash.substring(1) : cli_tab_hash;
42
- var cli_tab_elm=$('div[data-id="'+cli_tab_hash+'"]');
43
- $('.cookie-law-info-tab-content').hide();
44
- if(cli_tab_elm.length>0)
45
- {
46
- cli_tab_elm.fadeIn();
47
- }
48
- });
49
- var location_hash=window.location.hash;
50
- if(location_hash!="")
51
- {
52
- var cli_tab_hash=location_hash.charAt(0)=='#' ? location_hash.substring(1) : location_hash;
53
- if(cli_tab_hash!="")
54
- {
55
- $('div[data-id="'+cli_tab_hash+'"]').show();
56
- $('a[href="#'+cli_tab_hash+'"]').addClass('nav-tab-active');
57
- }
58
- }else
59
- {
60
- cli_nav_tab.eq(0).click();
61
- }
62
- }
63
- $('#cky-table-comparison-link').click(function( event ){
64
- event.preventDefault();
65
- $('a[href="#cookie-law-info-upgrade-pro"]').trigger("click");
66
- $('html,body').animate({
67
- scrollTop: $('#cky-container').offset().top - 50 },
68
- 'slow');
69
- });
70
- $('.cli_sub_tab li').click(function(){
71
- var trgt=$(this).attr('data-target');
72
- var prnt=$(this).parent('.cli_sub_tab');
73
- var ctnr=prnt.siblings('.cli_sub_tab_container');
74
- prnt.find('li a').css({'color':'#0073aa','cursor':'pointer'});
75
- $(this).find('a').css({'color':'#000','cursor':'default','font-weight':'600'});
76
- ctnr.find('.cli_sub_tab_content').hide();
77
- ctnr.find('.cli_sub_tab_content[data-id="'+trgt+'"]').fadeIn();
78
- });
79
- $('.cli_sub_tab').each(function(){
80
- var elm=$(this).children('li').eq(0);
81
- elm.click();
82
- });
83
- $('#cli_settings_form').submit(function(e){
84
- var submit_action=$('#cli_update_action').val();
85
- if(submit_action=='delete_all_settings')
86
- {
87
- //return;
88
- }
89
- e.preventDefault();
90
- var data=$(this).serialize();
91
- var url=$(this).attr('action');
92
- var spinner=$(this).find('.spinner');
93
- var submit_btn=$(this).find('input[type="submit"]');
94
- spinner.css({'visibility':'visible'});
95
- submit_btn.css({'opacity':'.5','cursor':'default'}).prop('disabled',true);
96
- $.ajax({
97
- url:url,
98
- type:'POST',
99
- data:data+'&cli_settings_ajax_update='+submit_action,
100
- success:function(data)
101
- {
102
- spinner.css({'visibility':'hidden'});
103
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
104
- if(submit_action=='delete_all_settings')
105
- {
106
- cli_notify_msg.success(cli_reset_settings_success_message);
107
- setTimeout(function(){
108
- window.location.reload(true);
109
- },1000);
110
- }else
111
- {
112
- cli_notify_msg.success(cli_settings_success_message);
113
  }
114
- cli_bar_active_msg();
115
- },
116
- error:function ()
117
- {
118
- spinner.css({'visibility':'hidden'});
119
- submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
120
- if(submit_action=='delete_all_settings')
121
- {
122
- cli_notify_msg.error(cli_reset_settings_error_message);
123
- }else
124
- {
125
- cli_notify_msg.error(cli_settings_error_message);
126
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
- });
129
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
- //=====================
132
- function cli_scroll_accept_er()
133
- {
134
- if($('[name="cookie_bar_as_field"] option:selected').val()=='popup' && $('[name="popup_overlay_field"]:checked').val()=='true' && $('[name="scroll_close_field"]:checked').val()=='true')
135
  {
136
- $('.cli_scroll_accept_er').show();
137
- //$('label[for="scroll_close_field"]').css({'color':'red'});
138
- }else
139
- {
140
- $('.cli_scroll_accept_er').hide();
141
- //$('label[for="scroll_close_field"]').css({'color':'#23282d'});
 
142
  }
143
- }
144
- cli_scroll_accept_er();
145
- $('[name="cookie_bar_as_field"]').change(function(){
146
  cli_scroll_accept_er();
147
- });
148
- $('[name="popup_overlay_field"], [name="scroll_close_field"]').click(function(){
149
- cli_scroll_accept_er();
150
- });
151
- //=====================
 
 
 
 
 
 
152
 
153
- function cli_bar_active_msg()
154
- {
155
- $('.cli_bar_state tr').hide();
156
- if($('input[type="radio"].cli_bar_on').is(':checked'))
157
  {
158
- $('.cli_bar_state tr.cli_bar_on').show();
159
- }else
160
- {
161
- $('.cli_bar_state tr.cli_bar_off').show();
 
 
162
  }
163
- }
164
- var cli_form_toggler=
165
- {
166
- set:function()
167
- {
168
- $('select.cli_form_toggle').each(function(){
169
- cli_form_toggler.toggle($(this));
170
- });
171
- $('input[type="radio"].cli_form_toggle').each(function(){
172
- if($(this).is(':checked'))
173
- {
174
- cli_form_toggler.toggle($(this));
175
- }
176
- });
177
- $('select.cli_form_toggle').change(function(){
178
- cli_form_toggler.toggle($(this));
179
- });
180
- $('input[type="radio"].cli_form_toggle').click(function(){
181
- if($(this).is(':checked'))
182
- {
183
- cli_form_toggler.toggle($(this));
184
- }
185
- });
186
- },
187
- toggle:function(elm)
188
  {
189
- var vl=elm.val();
190
- var trgt=elm.attr('cli_frm_tgl-target');
191
- $('[cli_frm_tgl-id="'+trgt+'"]').hide();
192
- var selcted_trget=$('[cli_frm_tgl-id="'+trgt+'"]').filter(function(){
193
- return $(this).attr('cli_frm_tgl-val')==vl;
194
- });
195
- selcted_trget.show();
196
- selcted_trget.find('th').each(function(){
197
- var prnt=$(this).parent('tr');
198
- var sub_lvl=1;
199
- if(typeof prnt.attr('cli_frm_tgl-lvl') !== typeof undefined && prnt.attr('cli_frm_tgl-lvl') !== false)
200
- {
201
- sub_lvl=prnt.attr('cli_frm_tgl-lvl');
202
- }
203
- var lft_margin=sub_lvl*15;
204
- $(this).find('label').css({'margin-left':'0px'}).stop(true,true).animate({'margin-left':lft_margin+'px'});
205
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
 
207
-
208
- }
209
- }
210
- $('#button_2_page_field').on('change',function(){
211
- if($('.cli_privacy_page_not_exists_er').length>0)
212
- {
213
- $('.cli_privacy_page_not_exists_er').remove();
214
  }
215
- });
 
 
 
 
 
 
 
216
 
217
- cli_form_toggler.set();
218
 
219
- });
220
- $(document).ready(function () {
221
- wtCliAdminFunctions.set();
222
- });
 
 
 
223
  })( jQuery );
224
 
225
  var wtCliAdminFunctions = {
@@ -232,161 +253,186 @@ var wtCliAdminFunctions = {
232
  this.modalEvents();
233
  },
234
  CLIAccordion : function() {
235
-
236
- if (jQuery('.wt-cli-accordion-tab').hasClass('active')) {
237
- jQuery('.wt-cli-accordion-tab.active').find('.wt-cli-accordion-content').slideDown(0);
238
  }
239
- jQuery(document).on('click', '.wt-cli-accordion-tab a', function (e) {
240
- e.preventDefault();
241
- var $this = jQuery(this);
242
- if ($this.next().hasClass('active')) {
243
- $this.removeClass('active');
244
- $this.next().removeClass('active');
245
- $this.closest('.wt-cli-accordion-tab').removeClass('active');
246
- $this.next().slideUp(350);
247
- } else {
248
- $this.parent().parent().find('.wt-cli-accordion-content').removeClass('active');
249
- $this.parent().parent().find('.wt-cli-accordion-content').slideUp(350);
250
- $this.parent().parent().find('.wt-cli-accordion-tab a').removeClass('active');
251
- $this.parent().parent().find('.wt-cli-accordion-tab').removeClass('active');
252
- $this.toggleClass('active');
253
- $this.closest('.wt-cli-accordion-tab').toggleClass('active');
254
- $this.next().toggleClass('active');
255
- $this.next().slideToggle(350);
 
 
 
256
 
 
257
  }
258
- });
259
-
260
  },
261
  checkboxTogglerHandler: function(){
262
- jQuery('input[name="showagain_tab_field"],.wt-cli-input-toggle-checkbox').each(function(){
263
- wtCliAdminFunctions.checkboxToggler( jQuery(this) );
264
- });
265
- jQuery(document).on('click','.wt-cli-input-toggle-checkbox',function(){
266
- wtCliAdminFunctions.checkboxToggler( jQuery(this));
267
- });
 
 
 
 
 
 
268
  },
269
  checkboxToggler: function( element ) {
270
-
271
  var currentElement = element;
272
- var toggleTarget = currentElement.attr('data-cli-toggle-target');
273
- var targetElement = jQuery('[data-cli-toggle-id='+toggleTarget+']');
274
- if ( currentElement.is(':checked') ) {
275
- targetElement.slideDown(200);
276
- targetElement.addClass('wt-cli-toggle-active');
277
  } else {
278
- targetElement.slideUp(100);
279
- targetElement.removeClass('wt-cli-toggle-active');
280
-
281
  }
282
  },
283
  revisitConsentPositionEvent: function(){
284
- jQuery(document).on('change', 'input[type="radio"][name="notify_position_horizontal_field"],select[name="popup_showagain_position_field"],input[name="cookie_bar_as_field"],select[name="widget_position_field"]', function(){
285
- wtCliAdminFunctions.revisitConsentPosition();
286
- });
 
 
 
 
287
  },
288
-
289
  revisitConsentPosition: function(){
290
- var barType = jQuery('input[type="radio"][name="cookie_bar_as_field"]:checked').val();
291
- var position = jQuery('input[type="radio"][name="notify_position_horizontal_field"]:checked').val();
292
- var revisitConsentMarginLabel = jQuery('#wt-cli-revisit-consent-margin-label');
293
- var currentText = jQuery('#wt-cli-revisit-consent-margin-label').val();
294
- if( barType === "popup" ) {
295
- position = jQuery('select[name="popup_showagain_position_field"] option:selected').val();
296
- } else if( barType === "widget") {
297
- position = jQuery('select[name="widget_position_field"] option:selected').val();
298
  }
299
-
300
- if( position === 'bottom-right' || position === 'top-right' || position === 'right' ){
301
- currentText = revisitConsentMarginLabel.attr('data-cli-right-text');
302
  } else {
303
- currentText = revisitConsentMarginLabel.attr('data-cli-left-text');
304
  }
305
- if(typeof(currentText) != "undefined" && currentText !== null) {
306
- revisitConsentMarginLabel.html(currentText);
307
  }
308
  },
309
-
310
  modalEvents: function(){
311
- jQuery(document).on('click','.wt-cli-modal-js-close', function(){
312
- wtCliAdminFunctions.closeModal();
313
- });
 
 
 
 
314
  },
315
  showModal: function(id) {
316
  this.closeModal();
317
- let el = jQuery('#'+id);
318
- el.find('.wt-cli-inline-notice').remove();
319
- el.addClass('on');
320
  this.addOverlay();
321
 
322
  },
323
  createModal: function( heading,content ){
324
  this.closeModal();
325
  var headingHtml = '';
326
- if( heading !== '') {
327
- headingHtml = '<div class="wt-cli-modal-header"><h4>'+heading+'</h4></div>';
328
  }
329
- html = '<div class="wt-cli-modal on" id="">';
330
- html += '<span class="wt-cli-modal-js-close">×</span>';
331
- html += headingHtml;
332
- html += '<div class="wt-cli-modal-body">';
333
- html += '<p>'+content+'</p>';
334
- html += '</div>';
335
- html += '</div>';
336
- jQuery('body').append(html);
337
  this.addOverlay();
338
  },
339
  addOverlay: function(){
340
- html = '<div class="wt-cli-modal-js-overlay"></div>';
341
- jQuery('body').append(html);
342
  },
343
  closeOverlay: function(){
344
- jQuery('.wt-cli-modal-js-overlay').remove();
345
  },
346
  closeModal: function(){
347
- jQuery('.wt-cli-modal').removeClass('on');
348
  this.closeOverlay();
349
  },
350
  addInlineMessage:function( message, type='notice', element ) {
351
- element.find('.wt-cli-inline-notice').remove();
352
- var error_message = '<div role="alert" class="wt-cli-inline-notice wt-cli-inline-notice-'+type+'">'+message+'</div>';
353
  jQuery( element ).append( error_message );
354
  },
355
  loadSpinner( element ){
356
- var spinner = jQuery( '<span class="spinner"></span>' );
357
- spinner.insertBefore(element);
358
- spinner.css({'visibility' : 'visible'});
359
  },
360
  removeSpinner: function( element ){
361
- var spinner = element.prev('.spinner');
362
  spinner.remove();
363
  },
364
  }
365
 
366
- var cli_notify_msg=
367
  {
368
  error:function(message)
369
  {
370
- var er_elm=jQuery('<div class="notify_msg" style="background:#dd4c27; border:solid 1px #dd431c;">'+message+'</div>');
371
- this.setNotify(er_elm);
372
  },
373
  success:function(message)
374
  {
375
- var suss_elm=jQuery('<div class="notify_msg" style="background:#00B200; border:solid 1px #00B200;">'+message+'</div>');
376
- this.setNotify(suss_elm);
377
  },
378
  setNotify:function(elm)
379
  {
380
- jQuery('body').append(elm);
381
- elm.stop(true,true).animate({'opacity':1,'top':'50px'},1000);
382
- setTimeout(function(){
383
- elm.animate({'opacity':0,'top':'100px'},1000,function(){
384
- elm.remove();
385
- });
386
- },3000);
 
 
 
 
 
 
 
387
  }
388
  }
389
  function cli_store_settings_btn_click(vl)
390
  {
391
- document.getElementById('cli_update_action').value=vl;
392
  }
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
+ $(
32
+ function() {
33
+ $( '.my-color-field' ).wpColorPicker();
34
 
35
+ var cli_nav_tab = $( '.cookie-law-info-tab-head .nav-tab' );
36
+ if (cli_nav_tab.length > 0) {
37
+ cli_nav_tab.click(
38
+ function(){
39
+ var cli_tab_hash = $( this ).attr( 'href' );
40
+ cli_nav_tab.removeClass( 'nav-tab-active' );
41
+ $( this ).addClass( 'nav-tab-active' );
42
+ cli_tab_hash = cli_tab_hash.charAt( 0 ) == '#' ? cli_tab_hash.substring( 1 ) : cli_tab_hash;
43
+ var cli_tab_elm = $( 'div[data-id="' + cli_tab_hash + '"]' );
44
+ $( '.cookie-law-info-tab-content' ).hide();
45
+ if (cli_tab_elm.length > 0) {
46
+ cli_tab_elm.fadeIn();
47
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
+ );
50
+ var location_hash = window.location.hash;
51
+ if (location_hash != "") {
52
+ var cli_tab_hash = location_hash.charAt( 0 ) == '#' ? location_hash.substring( 1 ) : location_hash;
53
+ if (cli_tab_hash != "") {
54
+ $( 'div[data-id="' + cli_tab_hash + '"]' ).show();
55
+ $( 'a[href="#' + cli_tab_hash + '"]' ).addClass( 'nav-tab-active' );
 
 
 
 
 
56
  }
57
+ } else {
58
+ cli_nav_tab.eq( 0 ).click();
59
+ }
60
+ }
61
+ $( '#cky-table-comparison-link' ).click(
62
+ function( event ){
63
+ event.preventDefault();
64
+ $( 'a[href="#cookie-law-info-upgrade-pro"]' ).trigger( "click" );
65
+ $( 'html,body' ).animate(
66
+ {
67
+ scrollTop: $( '#cky-container' ).offset().top - 50 },
68
+ 'slow'
69
+ );
70
+ }
71
+ );
72
+ $( '.cli_sub_tab li' ).click(
73
+ function(){
74
+ var trgt = $( this ).attr( 'data-target' );
75
+ var prnt = $( this ).parent( '.cli_sub_tab' );
76
+ var ctnr = prnt.siblings( '.cli_sub_tab_container' );
77
+ prnt.find( 'li a' ).css( {'color':'#0073aa','cursor':'pointer'} );
78
+ $( this ).find( 'a' ).css( {'color':'#000','cursor':'default','font-weight':'600'} );
79
+ ctnr.find( '.cli_sub_tab_content' ).hide();
80
+ ctnr.find( '.cli_sub_tab_content[data-id="' + trgt + '"]' ).fadeIn();
81
  }
82
+ );
83
+ $( '.cli_sub_tab' ).each(
84
+ function(){
85
+ var elm = $( this ).children( 'li' ).eq( 0 );
86
+ elm.click();
87
+ }
88
+ );
89
+ $( '#cli_settings_form' ).submit(
90
+ function(e){
91
+ var submit_action = $( '#cli_update_action' ).val();
92
+ if (submit_action == 'delete_all_settings') {
93
+ // return;
94
+ }
95
+ e.preventDefault();
96
+ var data = $( this ).serialize();
97
+ var url = $( this ).attr( 'action' );
98
+ var spinner = $( this ).find( '.spinner' );
99
+ var submit_btn = $( this ).find( 'input[type="submit"]' );
100
+ spinner.css( {'visibility':'visible'} );
101
+ submit_btn.css( {'opacity':'.5','cursor':'default'} ).prop( 'disabled',true );
102
+ $.ajax(
103
+ {
104
+ url:url,
105
+ type:'POST',
106
+ data:data + '&cli_settings_ajax_update=' + submit_action,
107
+ success:function(data)
108
+ {
109
+ spinner.css( {'visibility':'hidden'} );
110
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
111
+ if (submit_action == 'delete_all_settings') {
112
+ cli_notify_msg.success( cli_reset_settings_success_message );
113
+ setTimeout(
114
+ function(){
115
+ window.location.reload( true );
116
+ },
117
+ 1000
118
+ );
119
+ } else {
120
+ cli_notify_msg.success( cli_settings_success_message );
121
+ }
122
+ cli_bar_active_msg();
123
+ },
124
+ error:function ()
125
+ {
126
+ spinner.css( {'visibility':'hidden'} );
127
+ submit_btn.css( {'opacity':'1','cursor':'pointer'} ).prop( 'disabled',false );
128
+ if (submit_action == 'delete_all_settings') {
129
+ cli_notify_msg.error( cli_reset_settings_error_message );
130
+ } else {
131
+ cli_notify_msg.error( cli_settings_error_message );
132
+ }
133
+ }
134
+ }
135
+ );
136
+ }
137
+ );
138
 
139
+ // =====================
140
+ function cli_scroll_accept_er()
 
 
141
  {
142
+ if ($( '[name="cookie_bar_as_field"] option:selected' ).val() == 'popup' && $( '[name="popup_overlay_field"]:checked' ).val() == 'true' && $( '[name="scroll_close_field"]:checked' ).val() == 'true') {
143
+ $( '.cli_scroll_accept_er' ).show();
144
+ // $('label[for="scroll_close_field"]').css({'color':'red'});
145
+ } else {
146
+ $( '.cli_scroll_accept_er' ).hide();
147
+ // $('label[for="scroll_close_field"]').css({'color':'#23282d'});
148
+ }
149
  }
 
 
 
150
  cli_scroll_accept_er();
151
+ $( '[name="cookie_bar_as_field"]' ).change(
152
+ function(){
153
+ cli_scroll_accept_er();
154
+ }
155
+ );
156
+ $( '[name="popup_overlay_field"], [name="scroll_close_field"]' ).click(
157
+ function(){
158
+ cli_scroll_accept_er();
159
+ }
160
+ );
161
+ // =====================
162
 
163
+ function cli_bar_active_msg()
 
 
 
164
  {
165
+ $( '.cli_bar_state tr' ).hide();
166
+ if ($( 'input[type="radio"].cli_bar_on' ).is( ':checked' )) {
167
+ $( '.cli_bar_state tr.cli_bar_on' ).show();
168
+ } else {
169
+ $( '.cli_bar_state tr.cli_bar_off' ).show();
170
+ }
171
  }
172
+ var cli_form_toggler =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  {
174
+ set:function()
175
+ {
176
+ $( 'select.cli_form_toggle' ).each(
177
+ function(){
178
+ cli_form_toggler.toggle( $( this ) );
179
+ }
180
+ );
181
+ $( 'input[type="radio"].cli_form_toggle' ).each(
182
+ function(){
183
+ if ($( this ).is( ':checked' )) {
184
+ cli_form_toggler.toggle( $( this ) );
185
+ }
186
+ }
187
+ );
188
+ $( 'select.cli_form_toggle' ).change(
189
+ function(){
190
+ cli_form_toggler.toggle( $( this ) );
191
+ }
192
+ );
193
+ $( 'input[type="radio"].cli_form_toggle' ).click(
194
+ function(){
195
+ if ($( this ).is( ':checked' )) {
196
+ cli_form_toggler.toggle( $( this ) );
197
+ }
198
+ }
199
+ );
200
+ },
201
+ toggle:function(elm)
202
+ {
203
+ var vl = elm.val();
204
+ var trgt = elm.attr( 'cli_frm_tgl-target' );
205
+ $( '[cli_frm_tgl-id="' + trgt + '"]' ).hide();
206
+ var selcted_trget = $( '[cli_frm_tgl-id="' + trgt + '"]' ).filter(
207
+ function(){
208
+ return $( this ).attr( 'cli_frm_tgl-val' ) == vl;
209
+ }
210
+ );
211
+ selcted_trget.show();
212
+ selcted_trget.find( 'th' ).each(
213
+ function(){
214
+ var prnt = $( this ).parent( 'tr' );
215
+ var sub_lvl = 1;
216
+ if (typeof prnt.attr( 'cli_frm_tgl-lvl' ) !== typeof undefined && prnt.attr( 'cli_frm_tgl-lvl' ) !== false) {
217
+ sub_lvl = prnt.attr( 'cli_frm_tgl-lvl' );
218
+ }
219
+ var lft_margin = sub_lvl * 15;
220
+ $( this ).find( 'label' ).css( {'margin-left':'0px'} ).stop( true,true ).animate( {'margin-left':lft_margin + 'px'} );
221
+ }
222
+ );
223
 
224
+ }
 
 
 
 
 
 
225
  }
226
+ $( '#button_2_page_field' ).on(
227
+ 'change',
228
+ function(){
229
+ if ($( '.cli_privacy_page_not_exists_er' ).length > 0) {
230
+ $( '.cli_privacy_page_not_exists_er' ).remove();
231
+ }
232
+ }
233
+ );
234
 
235
+ cli_form_toggler.set();
236
 
237
+ }
238
+ );
239
+ $( document ).ready(
240
+ function () {
241
+ wtCliAdminFunctions.set();
242
+ }
243
+ );
244
  })( jQuery );
245
 
246
  var wtCliAdminFunctions = {
253
  this.modalEvents();
254
  },
255
  CLIAccordion : function() {
256
+
257
+ if (jQuery( '.wt-cli-accordion-tab' ).hasClass( 'active' )) {
258
+ jQuery( '.wt-cli-accordion-tab.active' ).find( '.wt-cli-accordion-content' ).slideDown( 0 );
259
  }
260
+ jQuery( document ).on(
261
+ 'click',
262
+ '.wt-cli-accordion-tab a',
263
+ function (e) {
264
+ e.preventDefault();
265
+ var $this = jQuery( this );
266
+ if ($this.next().hasClass( 'active' )) {
267
+ $this.removeClass( 'active' );
268
+ $this.next().removeClass( 'active' );
269
+ $this.closest( '.wt-cli-accordion-tab' ).removeClass( 'active' );
270
+ $this.next().slideUp( 350 );
271
+ } else {
272
+ $this.parent().parent().find( '.wt-cli-accordion-content' ).removeClass( 'active' );
273
+ $this.parent().parent().find( '.wt-cli-accordion-content' ).slideUp( 350 );
274
+ $this.parent().parent().find( '.wt-cli-accordion-tab a' ).removeClass( 'active' );
275
+ $this.parent().parent().find( '.wt-cli-accordion-tab' ).removeClass( 'active' );
276
+ $this.toggleClass( 'active' );
277
+ $this.closest( '.wt-cli-accordion-tab' ).toggleClass( 'active' );
278
+ $this.next().toggleClass( 'active' );
279
+ $this.next().slideToggle( 350 );
280
 
281
+ }
282
  }
283
+ );
284
+
285
  },
286
  checkboxTogglerHandler: function(){
287
+ jQuery( 'input[name="showagain_tab_field"],.wt-cli-input-toggle-checkbox' ).each(
288
+ function(){
289
+ wtCliAdminFunctions.checkboxToggler( jQuery( this ) );
290
+ }
291
+ );
292
+ jQuery( document ).on(
293
+ 'click',
294
+ '.wt-cli-input-toggle-checkbox',
295
+ function(){
296
+ wtCliAdminFunctions.checkboxToggler( jQuery( this ) );
297
+ }
298
+ );
299
  },
300
  checkboxToggler: function( element ) {
301
+
302
  var currentElement = element;
303
+ var toggleTarget = currentElement.attr( 'data-cli-toggle-target' );
304
+ var targetElement = jQuery( '[data-cli-toggle-id=' + toggleTarget + ']' );
305
+ if ( currentElement.is( ':checked' ) ) {
306
+ targetElement.slideDown( 200 );
307
+ targetElement.addClass( 'wt-cli-toggle-active' );
308
  } else {
309
+ targetElement.slideUp( 100 );
310
+ targetElement.removeClass( 'wt-cli-toggle-active' );
311
+
312
  }
313
  },
314
  revisitConsentPositionEvent: function(){
315
+ jQuery( document ).on(
316
+ 'change',
317
+ 'input[type="radio"][name="notify_position_horizontal_field"],select[name="popup_showagain_position_field"],input[name="cookie_bar_as_field"],select[name="widget_position_field"]',
318
+ function(){
319
+ wtCliAdminFunctions.revisitConsentPosition();
320
+ }
321
+ );
322
  },
323
+
324
  revisitConsentPosition: function(){
325
+ var barType = jQuery( 'input[type="radio"][name="cookie_bar_as_field"]:checked' ).val();
326
+ var position = jQuery( 'input[type="radio"][name="notify_position_horizontal_field"]:checked' ).val();
327
+ var revisitConsentMarginLabel = jQuery( '#wt-cli-revisit-consent-margin-label' );
328
+ var currentText = jQuery( '#wt-cli-revisit-consent-margin-label' ).val();
329
+ if ( barType === "popup" ) {
330
+ position = jQuery( 'select[name="popup_showagain_position_field"] option:selected' ).val();
331
+ } else if ( barType === "widget") {
332
+ position = jQuery( 'select[name="widget_position_field"] option:selected' ).val();
333
  }
334
+
335
+ if ( position === 'bottom-right' || position === 'top-right' || position === 'right' ) {
336
+ currentText = revisitConsentMarginLabel.attr( 'data-cli-right-text' );
337
  } else {
338
+ currentText = revisitConsentMarginLabel.attr( 'data-cli-left-text' );
339
  }
340
+ if (typeof(currentText) != "undefined" && currentText !== null) {
341
+ revisitConsentMarginLabel.html( currentText );
342
  }
343
  },
344
+
345
  modalEvents: function(){
346
+ jQuery( document ).on(
347
+ 'click',
348
+ '.wt-cli-modal-js-close',
349
+ function(){
350
+ wtCliAdminFunctions.closeModal();
351
+ }
352
+ );
353
  },
354
  showModal: function(id) {
355
  this.closeModal();
356
+ let el = jQuery( '#' + id );
357
+ el.find( '.wt-cli-inline-notice' ).remove();
358
+ el.addClass( 'on' );
359
  this.addOverlay();
360
 
361
  },
362
  createModal: function( heading,content ){
363
  this.closeModal();
364
  var headingHtml = '';
365
+ if ( heading !== '') {
366
+ headingHtml = '<div class="wt-cli-modal-header"><h4>' + heading + '</h4></div>';
367
  }
368
+ html = '<div class="wt-cli-modal on" id="">';
369
+ html += '<span class="wt-cli-modal-js-close">×</span>';
370
+ html += headingHtml;
371
+ html += '<div class="wt-cli-modal-body">';
372
+ html += '<p>' + content + '</p>';
373
+ html += '</div>';
374
+ html += '</div>';
375
+ jQuery( 'body' ).append( html );
376
  this.addOverlay();
377
  },
378
  addOverlay: function(){
379
+ html = '<div class="wt-cli-modal-js-overlay"></div>';
380
+ jQuery( 'body' ).append( html );
381
  },
382
  closeOverlay: function(){
383
+ jQuery( '.wt-cli-modal-js-overlay' ).remove();
384
  },
385
  closeModal: function(){
386
+ jQuery( '.wt-cli-modal' ).removeClass( 'on' );
387
  this.closeOverlay();
388
  },
389
  addInlineMessage:function( message, type='notice', element ) {
390
+ element.find( '.wt-cli-inline-notice' ).remove();
391
+ var error_message = '<div role="alert" class="wt-cli-inline-notice wt-cli-inline-notice-' + type + '">' + message + '</div>';
392
  jQuery( element ).append( error_message );
393
  },
394
  loadSpinner( element ){
395
+ var spinner = jQuery( '<span class="spinner"></span>' );
396
+ spinner.insertBefore( element );
397
+ spinner.css( {'visibility' : 'visible'} );
398
  },
399
  removeSpinner: function( element ){
400
+ var spinner = element.prev( '.spinner' );
401
  spinner.remove();
402
  },
403
  }
404
 
405
+ var cli_notify_msg =
406
  {
407
  error:function(message)
408
  {
409
+ var er_elm = jQuery( '<div class="notify_msg" style="background:#dd4c27; border:solid 1px #dd431c;">' + message + '</div>' );
410
+ this.setNotify( er_elm );
411
  },
412
  success:function(message)
413
  {
414
+ var suss_elm = jQuery( '<div class="notify_msg" style="background:#00B200; border:solid 1px #00B200;">' + message + '</div>' );
415
+ this.setNotify( suss_elm );
416
  },
417
  setNotify:function(elm)
418
  {
419
+ jQuery( 'body' ).append( elm );
420
+ elm.stop( true,true ).animate( {'opacity':1,'top':'50px'},1000 );
421
+ setTimeout(
422
+ function(){
423
+ elm.animate(
424
+ {'opacity':0,'top':'100px'},
425
+ 1000,
426
+ function(){
427
+ elm.remove();
428
+ }
429
+ );
430
+ },
431
+ 3000
432
+ );
433
  }
434
  }
435
  function cli_store_settings_btn_click(vl)
436
  {
437
+ document.getElementById( 'cli_update_action' ).value = vl;
438
  }
admin/js/cookie-law-info-ckyes.js CHANGED
@@ -1,256 +1,309 @@
1
  (function($) {
2
- 'use strict';
3
- var ckyes = {
4
- errorMessage: '',
5
- set: function() {
6
- this.events();
7
- this.errorMessage = ckyes_admin.messages.error;
8
- },
9
- events: function() {
10
-
11
- jQuery(document).on('click', '#wt-cli-ckyes-register-btn', function(event) {
12
- event.preventDefault();
13
- ckyes.register(jQuery(this));
14
- });
15
- jQuery(document).on('click', '#wt-cli-ckyes-login-btn', function(event) {
16
- event.preventDefault();
17
- ckyes.login(jQuery(this));
18
- });
19
- jQuery(document).on('click', '#wt-cli-ckyes-pwd-reset-link', function(event) {
20
- event.preventDefault();
21
- ckyes.resetPassword(jQuery(this));
22
- });
23
- jQuery(document).on('click', '#wt-cli-ckyes-password-reset-btn', function(event) {
24
- event.preventDefault();
25
- ckyes.resetPassword(jQuery(this));
26
- });
27
- jQuery(document).on('click', '.wt-cli-ckyes-account-action', function(event) {
28
- event.preventDefault();
29
- ckyes.accountActions( jQuery(this) );
30
- });
31
- jQuery(document).on('click', '#wt-cli-ckyes-email-resend-link', function(event) {
32
- event.preventDefault();
33
- ckyes.resendEmail( jQuery(this) );
34
- });
35
- jQuery(document).on('click', '.wt-cli-ckyes-delete-btn', function(event) {
36
- event.preventDefault();
37
- ckyes.deleteAccount( jQuery(this) );
38
- });
39
- },
40
- register: function( element ) {
41
- wtCliAdminFunctions.loadSpinner(element);
42
- var form = element.closest('form');
43
- var email = form.find('input[name="ckyes-email"]').val();
44
- var data = {
45
- 'action': 'cookieyes_ajax_main_controller',
46
- 'sub_action': 'register',
47
- '_wpnonce': ckyes_admin.nonce,
48
- 'email': email,
49
- };
50
- jQuery.ajax({
51
- url: ckyes_admin.ajax_url,
52
- type: 'POST',
53
- data: data,
54
- dataType: 'json',
55
- success: function(response) {
56
- var data = response.data;
57
- var msg = (data.message ? data.message : '');
58
- wtCliAdminFunctions.removeSpinner(element);
59
- if (response.success === true) {
60
- if( data.html ) {
61
- if( data.html ) {
62
- wtCliAdminFunctions.createModal('',data.html);
63
- jQuery( document ).trigger( "trggerReloadScanner");
64
- }
65
- }
66
- } else {
67
- if( data.code && data.code === 102 ) {
68
- if( data.html ) {
69
- wtCliAdminFunctions.createModal('',data.html);
70
- }
71
- }
72
- else {
73
- if( data.message ){
74
- wtCliAdminFunctions.createModal('',data.message);
75
- setTimeout(function(){
76
- window.location.reload();
77
- },1500);
78
- }
79
- }
80
- }
81
- },
82
- error: function() {
83
- wtCliAdminFunctions.createModal('',ckyes.errorMessage );
84
- }
85
- });
86
- },
87
- login: function(element) {
88
- wtCliAdminFunctions.loadSpinner(element);
89
- var form = element.closest('form');
90
- var formRow = form.find('.wt-cli-form-row');
91
- var email = form.find('input[name="ckyes-email"]').val();
92
- var password = form.find('input[name="ckyes-password"]').val();
93
 
94
- var data = {
95
- 'action': 'cookieyes_ajax_main_controller',
96
- 'sub_action': 'login',
97
- '_wpnonce': ckyes_admin.nonce,
98
- 'email': email,
99
- 'password': password
100
- };
101
- jQuery.ajax({
102
- url: ckyes_admin.ajax_url,
103
- type: 'POST',
104
- data: data,
105
- dataType: 'json',
106
- success: function(response) {
107
- var data = response.data;
108
- var msg = (data.message ? data.message : '');
109
- wtCliAdminFunctions.removeSpinner(element);
110
- if (response.success === true) {
111
- wtCliAdminFunctions.createModal('', msg);
112
- setTimeout(function() {
113
- window.location.reload();
114
- }, 1500);
115
- } else {
116
- wtCliAdminFunctions.addInlineMessage(msg, 'error', formRow);
117
- }
118
- },
119
- error: function() {
120
- wtCliAdminFunctions.createModal('',ckyes.errorMessage );
121
- }
122
- });
123
- },
124
- resetPassword: function(element) {
125
- wtCliAdminFunctions.loadSpinner(element);
126
- var form = element.closest('form');
127
- var email = form.find('input[name="ckyes-email"]').val();
128
- var data = {
129
- 'action': 'cookieyes_ajax_main_controller',
130
- 'sub_action': 'reset_password',
131
- '_wpnonce': ckyes_admin.nonce,
132
- 'email': email,
133
- };
134
- jQuery.ajax({
135
- url: ckyes_admin.ajax_url,
136
- type: 'POST',
137
- data: data,
138
- dataType: 'json',
139
- success: function(response) {
140
- var data = response.data;
141
- var msg = (data.message ? data.message : '');
142
- wtCliAdminFunctions.removeSpinner(element);
143
- if( true === data.status && 202 === data.code ) {
144
- wtCliAdminFunctions.addInlineMessage(msg, 'success', form);
145
- } else {
146
- wtCliAdminFunctions.addInlineMessage(msg, 'notice', form);
147
- }
148
- },
149
- error: function() {
150
- wtCliAdminFunctions.createModal('', ckyes.errorMessage );
151
- }
152
- });
153
- },
154
- accountActions:function( element ){
155
- wtCliAdminFunctions.loadSpinner(element);
156
- var action = element.attr('data-action');
157
- var data = {
158
- 'action': 'cookieyes_ajax_main_controller',
159
- 'sub_action': 'connect_disconnect',
160
- 'account_action': action,
161
- '_wpnonce': ckyes_admin.nonce,
162
- };
163
- jQuery.ajax({
164
- url: ckyes_admin.ajax_url,
165
- type: 'POST',
166
- data: data,
167
- dataType: 'json',
168
- success: function(response) {
169
- var data = response.data;
170
- var msg = (data.message ? data.message : '');
171
- wtCliAdminFunctions.removeSpinner(element);
172
- wtCliAdminFunctions.createModal('', msg);
173
- setTimeout(function() {
174
- window.location.reload();
175
- }, 2000);
176
- },
177
- error: function() {
178
- wtCliAdminFunctions.createModal('', ckyes.errorMessage);
179
- }
180
- });
181
- },
182
- resendEmail: function() {
183
- var email = "";
184
- var data = {
185
- 'action': 'cookieyes_ajax_main_controller',
186
- 'sub_action': 'resend_email',
187
- '_wpnonce': ckyes_admin.nonce,
188
- 'email': email,
189
- };
190
- jQuery.ajax({
191
- url: ckyes_admin.ajax_url,
192
- type: 'POST',
193
- data: data,
194
- dataType: 'json',
195
- success: function( response ) {
196
- var data = response.data;
197
- if( response.success === true ) {
198
- if( data.html ) {
199
- wtCliAdminFunctions.createModal('', data.html );
200
- }
201
- } else {
202
- if( data.message ) {
203
- wtCliAdminFunctions.createModal('', data.message );
204
- }
205
- }
206
- },
207
- error: function() {
208
- wtCliAdminFunctions.createModal('', ckyes.errorMessage );
209
- }
210
- });
211
- },
212
- deleteAccount: function( element ){
213
- var action = element.attr('data-action');
214
- console.log(action);
215
- if( 'delete-account' === action ) {
216
- this.sendDeleteRequest( element );
217
- } else {
218
- wtCliAdminFunctions.showModal('wt-cli-ckyes-modal-delete-account');
219
- }
220
- },
221
- sendDeleteRequest: function( element ){
222
- wtCliAdminFunctions.loadSpinner(element);
223
- var data = {
224
- 'action': 'cookieyes_ajax_main_controller',
225
- 'sub_action': 'delete_account',
226
- '_wpnonce': ckyes_admin.nonce,
227
- };
228
- jQuery.ajax({
229
- url: ckyes_admin.ajax_url,
230
- type: 'POST',
231
- data: data,
232
- dataType: 'json',
233
- success: function( response ) {
234
- var data = response.data;
235
- wtCliAdminFunctions.removeSpinner(element);
236
- if( response.success === true ) {
237
- wtCliAdminFunctions.createModal('', ckyes_admin.messages.delete_success );
238
- setTimeout(function() {
239
- window.location.reload();
240
- }, 1500);
241
- } else {
242
- wtCliAdminFunctions.createModal('', ckyes_admin.messages.delete_failed );
243
- }
244
- },
245
- error: function() {
246
- wtCliAdminFunctions.createModal('', ckyes_admin.messages.delete_failed );
247
- }
248
- });
249
- }
250
 
251
- }
252
- jQuery(document).ready(function() {
253
- ckyes.set();
254
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
- })(jQuery);
 
 
 
 
 
 
 
1
  (function($) {
2
+ 'use strict';
3
+ var ckyes = {
4
+ errorMessage: '',
5
+ set: function() {
6
+ this.events();
7
+ this.errorMessage = ckyes_admin.messages.error;
8
+ },
9
+ events: function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ jQuery( document ).on(
12
+ 'click',
13
+ '#wt-cli-ckyes-register-btn',
14
+ function(event) {
15
+ event.preventDefault();
16
+ ckyes.register( jQuery( this ) );
17
+ }
18
+ );
19
+ jQuery( document ).on(
20
+ 'click',
21
+ '#wt-cli-ckyes-login-btn',
22
+ function(event) {
23
+ event.preventDefault();
24
+ ckyes.login( jQuery( this ) );
25
+ }
26
+ );
27
+ jQuery( document ).on(
28
+ 'click',
29
+ '#wt-cli-ckyes-pwd-reset-link',
30
+ function(event) {
31
+ event.preventDefault();
32
+ ckyes.resetPassword( jQuery( this ) );
33
+ }
34
+ );
35
+ jQuery( document ).on(
36
+ 'click',
37
+ '#wt-cli-ckyes-password-reset-btn',
38
+ function(event) {
39
+ event.preventDefault();
40
+ ckyes.resetPassword( jQuery( this ) );
41
+ }
42
+ );
43
+ jQuery( document ).on(
44
+ 'click',
45
+ '.wt-cli-ckyes-account-action',
46
+ function(event) {
47
+ event.preventDefault();
48
+ ckyes.accountActions( jQuery( this ) );
49
+ }
50
+ );
51
+ jQuery( document ).on(
52
+ 'click',
53
+ '#wt-cli-ckyes-email-resend-link',
54
+ function(event) {
55
+ event.preventDefault();
56
+ ckyes.resendEmail( jQuery( this ) );
57
+ }
58
+ );
59
+ jQuery( document ).on(
60
+ 'click',
61
+ '.wt-cli-ckyes-delete-btn',
62
+ function(event) {
63
+ event.preventDefault();
64
+ ckyes.deleteAccount( jQuery( this ) );
65
+ }
66
+ );
67
+ },
68
+ register: function( element ) {
69
+ wtCliAdminFunctions.loadSpinner( element );
70
+ var form = element.closest( 'form' );
71
+ var email = form.find( 'input[name="ckyes-email"]' ).val();
72
+ var data = {
73
+ 'action': 'cookieyes_ajax_main_controller',
74
+ 'sub_action': 'register',
75
+ '_wpnonce': ckyes_admin.nonce,
76
+ 'email': email,
77
+ };
78
+ jQuery.ajax(
79
+ {
80
+ url: ckyes_admin.ajax_url,
81
+ type: 'POST',
82
+ data: data,
83
+ dataType: 'json',
84
+ success: function(response) {
85
+ var data = response.data;
86
+ var msg = (data.message ? data.message : '');
87
+ wtCliAdminFunctions.removeSpinner( element );
88
+ if (response.success === true) {
89
+ if ( data.html ) {
90
+ if ( data.html ) {
91
+ wtCliAdminFunctions.createModal( '',data.html );
92
+ jQuery( document ).trigger( "trggerReloadScanner" );
93
+ }
94
+ }
95
+ } else {
96
+ if ( data.code && data.code === 102 ) {
97
+ if ( data.html ) {
98
+ wtCliAdminFunctions.createModal( '',data.html );
99
+ }
100
+ } else {
101
+ if ( data.message ) {
102
+ wtCliAdminFunctions.createModal( '',data.message );
103
+ setTimeout(
104
+ function(){
105
+ window.location.reload();
106
+ },
107
+ 1500
108
+ );
109
+ }
110
+ }
111
+ }
112
+ },
113
+ error: function() {
114
+ wtCliAdminFunctions.createModal( '',ckyes.errorMessage );
115
+ }
116
+ }
117
+ );
118
+ },
119
+ login: function(element) {
120
+ wtCliAdminFunctions.loadSpinner( element );
121
+ var form = element.closest( 'form' );
122
+ var formRow = form.find( '.wt-cli-form-row' );
123
+ var email = form.find( 'input[name="ckyes-email"]' ).val();
124
+ var password = form.find( 'input[name="ckyes-password"]' ).val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
+ var data = {
127
+ 'action': 'cookieyes_ajax_main_controller',
128
+ 'sub_action': 'login',
129
+ '_wpnonce': ckyes_admin.nonce,
130
+ 'email': email,
131
+ 'password': password
132
+ };
133
+ jQuery.ajax(
134
+ {
135
+ url: ckyes_admin.ajax_url,
136
+ type: 'POST',
137
+ data: data,
138
+ dataType: 'json',
139
+ success: function(response) {
140
+ var data = response.data;
141
+ var msg = (data.message ? data.message : '');
142
+ wtCliAdminFunctions.removeSpinner( element );
143
+ if (response.success === true) {
144
+ wtCliAdminFunctions.createModal( '', msg );
145
+ setTimeout(
146
+ function() {
147
+ window.location.reload();
148
+ },
149
+ 1500
150
+ );
151
+ } else {
152
+ wtCliAdminFunctions.addInlineMessage( msg, 'error', formRow );
153
+ }
154
+ },
155
+ error: function() {
156
+ wtCliAdminFunctions.createModal( '',ckyes.errorMessage );
157
+ }
158
+ }
159
+ );
160
+ },
161
+ resetPassword: function(element) {
162
+ wtCliAdminFunctions.loadSpinner( element );
163
+ var form = element.closest( 'form' );
164
+ var email = form.find( 'input[name="ckyes-email"]' ).val();
165
+ var data = {
166
+ 'action': 'cookieyes_ajax_main_controller',
167
+ 'sub_action': 'reset_password',
168
+ '_wpnonce': ckyes_admin.nonce,
169
+ 'email': email,
170
+ };
171
+ jQuery.ajax(
172
+ {
173
+ url: ckyes_admin.ajax_url,
174
+ type: 'POST',
175
+ data: data,
176
+ dataType: 'json',
177
+ success: function(response) {
178
+ var data = response.data;
179
+ var msg = (data.message ? data.message : '');
180
+ wtCliAdminFunctions.removeSpinner( element );
181
+ if ( true === data.status && 202 === data.code ) {
182
+ wtCliAdminFunctions.addInlineMessage( msg, 'success', form );
183
+ } else {
184
+ wtCliAdminFunctions.addInlineMessage( msg, 'notice', form );
185
+ }
186
+ },
187
+ error: function() {
188
+ wtCliAdminFunctions.createModal( '', ckyes.errorMessage );
189
+ }
190
+ }
191
+ );
192
+ },
193
+ accountActions:function( element ){
194
+ wtCliAdminFunctions.loadSpinner( element );
195
+ var action = element.attr( 'data-action' );
196
+ var data = {
197
+ 'action': 'cookieyes_ajax_main_controller',
198
+ 'sub_action': 'connect_disconnect',
199
+ 'account_action': action,
200
+ '_wpnonce': ckyes_admin.nonce,
201
+ };
202
+ jQuery.ajax(
203
+ {
204
+ url: ckyes_admin.ajax_url,
205
+ type: 'POST',
206
+ data: data,
207
+ dataType: 'json',
208
+ success: function(response) {
209
+ var data = response.data;
210
+ var msg = (data.message ? data.message : '');
211
+ wtCliAdminFunctions.removeSpinner( element );
212
+ wtCliAdminFunctions.createModal( '', msg );
213
+ setTimeout(
214
+ function() {
215
+ window.location.reload();
216
+ },
217
+ 2000
218
+ );
219
+ },
220
+ error: function() {
221
+ wtCliAdminFunctions.createModal( '', ckyes.errorMessage );
222
+ }
223
+ }
224
+ );
225
+ },
226
+ resendEmail: function() {
227
+ var email = "";
228
+ var data = {
229
+ 'action': 'cookieyes_ajax_main_controller',
230
+ 'sub_action': 'resend_email',
231
+ '_wpnonce': ckyes_admin.nonce,
232
+ 'email': email,
233
+ };
234
+ jQuery.ajax(
235
+ {
236
+ url: ckyes_admin.ajax_url,
237
+ type: 'POST',
238
+ data: data,
239
+ dataType: 'json',
240
+ success: function( response ) {
241
+ var data = response.data;
242
+ if ( response.success === true ) {
243
+ if ( data.html ) {
244
+ wtCliAdminFunctions.createModal( '', data.html );
245
+ }
246
+ } else {
247
+ if ( data.message ) {
248
+ wtCliAdminFunctions.createModal( '', data.message );
249
+ }
250
+ }
251
+ },
252
+ error: function() {
253
+ wtCliAdminFunctions.createModal( '', ckyes.errorMessage );
254
+ }
255
+ }
256
+ );
257
+ },
258
+ deleteAccount: function( element ){
259
+ var action = element.attr( 'data-action' );
260
+ console.log( action );
261
+ if ( 'delete-account' === action ) {
262
+ this.sendDeleteRequest( element );
263
+ } else {
264
+ wtCliAdminFunctions.showModal( 'wt-cli-ckyes-modal-delete-account' );
265
+ }
266
+ },
267
+ sendDeleteRequest: function( element ){
268
+ wtCliAdminFunctions.loadSpinner( element );
269
+ var data = {
270
+ 'action': 'cookieyes_ajax_main_controller',
271
+ 'sub_action': 'delete_account',
272
+ '_wpnonce': ckyes_admin.nonce,
273
+ };
274
+ jQuery.ajax(
275
+ {
276
+ url: ckyes_admin.ajax_url,
277
+ type: 'POST',
278
+ data: data,
279
+ dataType: 'json',
280
+ success: function( response ) {
281
+ var data = response.data;
282
+ wtCliAdminFunctions.removeSpinner( element );
283
+ if ( response.success === true ) {
284
+ wtCliAdminFunctions.createModal( '', ckyes_admin.messages.delete_success );
285
+ setTimeout(
286
+ function() {
287
+ window.location.reload();
288
+ },
289
+ 1500
290
+ );
291
+ } else {
292
+ wtCliAdminFunctions.createModal( '', ckyes_admin.messages.delete_failed );
293
+ }
294
+ },
295
+ error: function() {
296
+ wtCliAdminFunctions.createModal( '', ckyes_admin.messages.delete_failed );
297
+ }
298
+ }
299
+ );
300
+ }
301
 
302
+ }
303
+ jQuery( document ).ready(
304
+ function() {
305
+ ckyes.set();
306
+ }
307
+ );
308
+
309
+ })( jQuery );
admin/modules/ccpa/assets/js/cookie-law-info-ccpa-admin.js CHANGED
@@ -1,50 +1,51 @@
1
- jQuery( function($) {
 
2
 
3
- var ccpaEnabledState = jQuery('input[name="ccpa_enabled_field"]:checked').val();
4
- function changeMessage( $event = false ) {
5
- var message = '';
6
- var toggler = jQuery('input[type="radio"][name="consent_type_field"]:checked');
7
- var consentType = toggler.val();
8
- var ccpaSettingsEnabled = false;
9
- var gdprEnabled = true;
10
- var toggleTarget = toggler.attr('data-cli-toggle-target');
11
 
12
- jQuery('.wt-cli-section-gdpr-ccpa .wt-cli-section-inner').hide();
13
- jQuery('.wt-cli-toggle-content').hide();
14
 
15
- if (consentType == 'ccpa') {
16
- message = jQuery('#wt_ci_ccpa_only').val();
17
- ccpaSettingsEnabled = true;
18
- gdprEnabled = false;
19
- }
20
- else if ( consentType == 'ccpa_gdpr') {
21
- message = jQuery('#wt_ci_ccpa_gdpr').val();
22
- jQuery('.wt-cli-section-gdpr-ccpa .wt-cli-section-inner').show();
23
- ccpaSettingsEnabled = true;
24
- }
25
- else {
26
- message = jQuery('#wt_ci_gdpr_only').val();
27
- ccpaSettingsEnabled = false;
28
- }
29
- jQuery('textarea[name="notify_message_field"]').val( message );
30
- jQuery('.wt-cli-section-gdpr-ccpa .wt-cli-section-inner-'+consentType).show();
31
- if( ccpaSettingsEnabled === false ) {
32
- jQuery('.wt-cli-ccpa-element').hide();
33
- jQuery('input[name=ccpa_enabled_field]').prop("checked",false);
34
- }
35
- else {
36
- jQuery('.wt-cli-ccpa-element').show();
37
- jQuery('input[name="ccpa_enabled_field"][value="'+ccpaEnabledState+'"]').prop('checked', true);
38
- if( $event === true ) {
39
- jQuery('input[name="ccpa_enabled_field"]').prop("checked",true);
40
- }
41
-
42
- }
43
- jQuery('.wt-cli-toggle-content[data-cli-toggle-id="'+toggleTarget+'"]').show();
44
- }
45
- changeMessage();
46
- jQuery('input[type="radio"][name="consent_type_field"]').change(function() {
47
- changeMessage(true);
48
- });
49
 
50
- });
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(
2
+ function($) {
3
 
4
+ var ccpaEnabledState = jQuery( 'input[name="ccpa_enabled_field"]:checked' ).val();
5
+ function changeMessage( $event = false ) {
6
+ var message = '';
7
+ var toggler = jQuery( 'input[type="radio"][name="consent_type_field"]:checked' );
8
+ var consentType = toggler.val();
9
+ var ccpaSettingsEnabled = false;
10
+ var gdprEnabled = true;
11
+ var toggleTarget = toggler.attr( 'data-cli-toggle-target' );
12
 
13
+ jQuery( '.wt-cli-section-gdpr-ccpa .wt-cli-section-inner' ).hide();
14
+ jQuery( '.wt-cli-toggle-content' ).hide();
15
 
16
+ if (consentType == 'ccpa') {
17
+ message = jQuery( '#wt_ci_ccpa_only' ).val();
18
+ ccpaSettingsEnabled = true;
19
+ gdprEnabled = false;
20
+ } else if ( consentType == 'ccpa_gdpr') {
21
+ message = jQuery( '#wt_ci_ccpa_gdpr' ).val();
22
+ jQuery( '.wt-cli-section-gdpr-ccpa .wt-cli-section-inner' ).show();
23
+ ccpaSettingsEnabled = true;
24
+ } else {
25
+ message = jQuery( '#wt_ci_gdpr_only' ).val();
26
+ ccpaSettingsEnabled = false;
27
+ }
28
+ jQuery( 'textarea[name="notify_message_field"]' ).val( message );
29
+ jQuery( '.wt-cli-section-gdpr-ccpa .wt-cli-section-inner-' + consentType ).show();
30
+ if ( ccpaSettingsEnabled === false ) {
31
+ jQuery( '.wt-cli-ccpa-element' ).hide();
32
+ jQuery( 'input[name=ccpa_enabled_field]' ).prop( "checked",false );
33
+ } else {
34
+ jQuery( '.wt-cli-ccpa-element' ).show();
35
+ jQuery( 'input[name="ccpa_enabled_field"][value="' + ccpaEnabledState + '"]' ).prop( 'checked', true );
36
+ if ( $event === true ) {
37
+ jQuery( 'input[name="ccpa_enabled_field"]' ).prop( "checked",true );
38
+ }
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ }
41
+ jQuery( '.wt-cli-toggle-content[data-cli-toggle-id="' + toggleTarget + '"]' ).show();
42
+ }
43
+ changeMessage();
44
+ jQuery( 'input[type="radio"][name="consent_type_field"]' ).change(
45
+ function() {
46
+ changeMessage( true );
47
+ }
48
+ );
49
+
50
+ }
51
+ );
admin/modules/ccpa/assets/js/cookie-law-info-ccpa.js CHANGED
@@ -1,65 +1,72 @@
1
  (function( $ ) {
2
- 'use strict';
3
- var CCPA = {
4
- ccpaOptedOut: false,
5
- ccpaOptOutConfirmationOpen: false,
6
- set: function() {
7
- this.setCheckboxState();
8
- jQuery(document).on('click','.wt-cli-ccpa-opt-out-checkbox',function() {
9
- CCPA.ccpaOptedOut = false;
10
- if(this.checked === true ) {
11
- CCPA.ccpaOptedOut = true;
12
- }
13
- CCPA.optOutCcpa();
14
- });
15
- jQuery(document).on('click','.wt-cli-ccpa-opt-out:not(.wt-cli-ccpa-opt-out-checkbox)',function(){
16
- CCPA.showCcpaOptOutConfirmBox();
17
- })
18
- },
19
- setCheckboxState : function() {
20
- var cliConsent = {};
21
- var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE);
22
- if( preferenceCookie !== null ) {
23
- cliConsent = CCPA.parseCookie(preferenceCookie);
24
- if( typeof( cliConsent.ccpaOptout ) !== 'undefined') {
25
-
26
- if( cliConsent.ccpaOptout === true ) {
27
- jQuery('.wt-cli-ccpa-opt-out-checkbox').prop('checked',true);
28
- }
29
- else {
30
- jQuery('.wt-cli-ccpa-opt-out-checkbox').prop('checked',false);
31
- }
32
- }
33
-
34
- }
35
- },
36
- optOutCcpa: function() {
37
- var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE);
38
- var cliConsent = {};
39
- if( preferenceCookie !== null ) {
40
- cliConsent = CCPA.parseCookie(preferenceCookie);
41
- }
42
- cliConsent.ccpaOptout = this.ccpaOptedOut;
43
- cliConsent = JSON.stringify(cliConsent);
44
- cliConsent = window.btoa(cliConsent);
45
- CLI_Cookie.set(CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE);
46
- this.setCheckboxState();
47
- },
48
- parseCookie: function( preferenceCookie ) {
49
- var cliConsent = {};
50
- cliConsent = window.atob(preferenceCookie);
51
- cliConsent = JSON.parse(cliConsent);
52
- return cliConsent;
53
- },
54
- toggleCCPA: function() {
55
-
56
- },
57
- checkAuthentication: function() {
58
-
59
- },
60
- showCcpaOptOutConfirmBox: function() {
61
-
62
- var css = '.cli-alert-dialog-buttons button {\
 
 
 
 
 
 
 
63
  -webkit-box-flex: 1!important;\
64
  -ms-flex: 1!important;\
65
  flex: 1!important;\
@@ -98,107 +105,115 @@
98
  background-color:#61a229;\
99
  color:#ffffff;\
100
  }';
101
- var head = document.head || document.getElementsByTagName('head')[0];
102
- var style = document.createElement('style');
103
- var primaryColor = CLI.settings.button_1_button_colour;
104
- var primaryLinkColor = CLI.settings.button_1_link_colour;
105
- var backgroundColor = CLI.settings.background;
106
- var textColor = CLI.settings.text;
107
- CCPA.ccpaOptOutConfirmationOpen = false;
108
- var ccpaPrompt,
109
- $this = this;
110
- (ccpaPrompt = document.createElement("div")).classList.add("cli-modal", "cli-show", "cli-blowup");
111
- ccpaPrompt.id = "cLiCcpaOptoutPrompt";
112
- var t = document.createElement("div");
113
- t.className = "cli-modal-dialog";
114
- var n=document.createElement("div");
115
- n.classList.add("cli-modal-content","cli-bar-popup");
116
- var o = document.createElement("div");
117
- o.className="cli-modal-body";
118
- var p = document.createElement("div");
119
- p.classList.add("wt-cli-element", "cli-container-fluid", "cli-tab-container");
120
- var q = document.createElement("div");
121
- q.className="cli-row";
122
- var r = document.createElement("div");
123
- r.classList.add("cli-col-12");
124
- var x = document.createElement("div");
125
- x.classList.add("cli-modal-backdrop", "cli-fade", "cli-settings-overlay", "cli-show");
126
- var a = document.createElement("button");
127
- var b = document.createElement("button");
128
- var c = document.createElement("div");
129
- var d = document.createElement("div");
130
- d.className = "cli-alert-dialog-content",
131
- d.innerText = ccpa_data.opt_out_prompt,
132
- c.className = "cli-alert-dialog-buttons";
133
- a.className = "cli-ccpa-button-confirm",
134
- a.innerText = ccpa_data.opt_out_confirm,
135
- a.addEventListener("click",
136
- function() {
137
- CCPA.ccpaOptedOut = true,
138
- CCPA.optOutCcpa(),
139
- document.body.removeChild(ccpaPrompt),
140
- document.body.removeChild(x),
141
- document.body.classList.remove("cli-modal-open");
142
- head.removeChild(style);
143
- if( Cli_Data.ccpaType === 'ccpa' ){
144
- CLI.enableAllCookies();
145
- CLI.accept_close();
146
- }
147
- }
148
- ),
149
- b.className="cli-ccpa-button-cancel",
150
- b.innerText = ccpa_data.opt_out_cancel,
151
- b.addEventListener("click",
152
- function() {
153
- CCPA.ccpaOptedOut = false,
154
- CCPA.optOutCcpa(),
155
- document.body.removeChild(ccpaPrompt),
156
- document.body.removeChild(x),
157
- document.body.classList.remove("cli-modal-open");
158
- head.removeChild(style);
159
- if( Cli_Data.ccpaType === 'ccpa' ){
160
- CLI.enableAllCookies();
161
- CLI.accept_close();
162
- }
163
- }
164
- ),
165
- ccpaPrompt.addEventListener("click",
166
- function( event ) {
167
- event.stopPropagation();
168
- if ( ccpaPrompt !== event.target) return;
169
- document.body.removeChild(ccpaPrompt),
170
- document.body.removeChild(x),
171
- document.body.classList.remove("cli-modal-open");
172
- head.removeChild(style);
173
-
174
- }),
175
- ccpaPrompt.appendChild(t),
176
- t.appendChild(n),
177
- n.appendChild(o),
178
- o.appendChild(p),
179
- p.appendChild(q),
180
- q.appendChild(r),
181
- r.appendChild(d),
182
- r.appendChild(c),
183
- c.appendChild(b),
184
- c.appendChild(a),
185
-
186
- head.appendChild(style);
187
- style.type = 'text/css';
188
- if (style.styleSheet){
189
- // This is required for IE8 and below.
190
- style.styleSheet.cssText = css;
191
- } else {
192
- style.appendChild(document.createTextNode(css));
193
- }
194
- document.body.appendChild(ccpaPrompt);
195
- document.body.appendChild(x);
196
- document.body.classList.add("cli-modal-open");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
- },
199
- }
200
- jQuery(document).ready(function() {
201
- CCPA.set();
202
- });
203
-
204
  })( jQuery );
1
  (function( $ ) {
2
+ 'use strict';
3
+ var CCPA = {
4
+ ccpaOptedOut: false,
5
+ ccpaOptOutConfirmationOpen: false,
6
+ set: function() {
7
+ this.setCheckboxState();
8
+ jQuery( document ).on(
9
+ 'click',
10
+ '.wt-cli-ccpa-opt-out-checkbox',
11
+ function() {
12
+ CCPA.ccpaOptedOut = false;
13
+ if (this.checked === true ) {
14
+ CCPA.ccpaOptedOut = true;
15
+ }
16
+ CCPA.optOutCcpa();
17
+ }
18
+ );
19
+ jQuery( document ).on(
20
+ 'click',
21
+ '.wt-cli-ccpa-opt-out:not(.wt-cli-ccpa-opt-out-checkbox)',
22
+ function(){
23
+ CCPA.showCcpaOptOutConfirmBox();
24
+ }
25
+ )
26
+ },
27
+ setCheckboxState : function() {
28
+ var cliConsent = {};
29
+ var preferenceCookie = CLI_Cookie.read( CLI_PREFERNCE_COOKIE );
30
+ if ( preferenceCookie !== null ) {
31
+ cliConsent = CCPA.parseCookie( preferenceCookie );
32
+ if ( typeof( cliConsent.ccpaOptout ) !== 'undefined') {
33
+
34
+ if ( cliConsent.ccpaOptout === true ) {
35
+ jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',true );
36
+ } else {
37
+ jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',false );
38
+ }
39
+ }
40
+
41
+ }
42
+ },
43
+ optOutCcpa: function() {
44
+ var preferenceCookie = CLI_Cookie.read( CLI_PREFERNCE_COOKIE );
45
+ var cliConsent = {};
46
+ if ( preferenceCookie !== null ) {
47
+ cliConsent = CCPA.parseCookie( preferenceCookie );
48
+ }
49
+ cliConsent.ccpaOptout = this.ccpaOptedOut;
50
+ cliConsent = JSON.stringify( cliConsent );
51
+ cliConsent = window.btoa( cliConsent );
52
+ CLI_Cookie.set( CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE );
53
+ this.setCheckboxState();
54
+ },
55
+ parseCookie: function( preferenceCookie ) {
56
+ var cliConsent = {};
57
+ cliConsent = window.atob( preferenceCookie );
58
+ cliConsent = JSON.parse( cliConsent );
59
+ return cliConsent;
60
+ },
61
+ toggleCCPA: function() {
62
+
63
+ },
64
+ checkAuthentication: function() {
65
+
66
+ },
67
+ showCcpaOptOutConfirmBox: function() {
68
+
69
+ var css = '.cli-alert-dialog-buttons button {\
70
  -webkit-box-flex: 1!important;\
71
  -ms-flex: 1!important;\
72
  flex: 1!important;\
105
  background-color:#61a229;\
106
  color:#ffffff;\
107
  }';
108
+ var head = document.head || document.getElementsByTagName( 'head' )[0];
109
+ var style = document.createElement( 'style' );
110
+ var primaryColor = CLI.settings.button_1_button_colour;
111
+ var primaryLinkColor = CLI.settings.button_1_link_colour;
112
+ var backgroundColor = CLI.settings.background;
113
+ var textColor = CLI.settings.text;
114
+ CCPA.ccpaOptOutConfirmationOpen = false;
115
+ var ccpaPrompt,
116
+ $this = this;
117
+ (ccpaPrompt = document.createElement( "div" )).classList.add( "cli-modal", "cli-show", "cli-blowup" );
118
+ ccpaPrompt.id = "cLiCcpaOptoutPrompt";
119
+ var t = document.createElement( "div" );
120
+ t.className = "cli-modal-dialog";
121
+ var n = document.createElement( "div" );
122
+ n.classList.add( "cli-modal-content","cli-bar-popup" );
123
+ var o = document.createElement( "div" );
124
+ o.className = "cli-modal-body";
125
+ var p = document.createElement( "div" );
126
+ p.classList.add( "wt-cli-element", "cli-container-fluid", "cli-tab-container" );
127
+ var q = document.createElement( "div" );
128
+ q.className = "cli-row";
129
+ var r = document.createElement( "div" );
130
+ r.classList.add( "cli-col-12" );
131
+ var x = document.createElement( "div" );
132
+ x.classList.add( "cli-modal-backdrop", "cli-fade", "cli-settings-overlay", "cli-show" );
133
+ var a = document.createElement( "button" );
134
+ var b = document.createElement( "button" );
135
+ var c = document.createElement( "div" );
136
+ var d = document.createElement( "div" );
137
+ d.className = "cli-alert-dialog-content",
138
+ d.innerText = ccpa_data.opt_out_prompt,
139
+ c.className = "cli-alert-dialog-buttons";
140
+ a.className = "cli-ccpa-button-confirm",
141
+ a.innerText = ccpa_data.opt_out_confirm,
142
+ a.addEventListener(
143
+ "click",
144
+ function() {
145
+ CCPA.ccpaOptedOut = true,
146
+ CCPA.optOutCcpa(),
147
+ document.body.removeChild( ccpaPrompt ),
148
+ document.body.removeChild( x ),
149
+ document.body.classList.remove( "cli-modal-open" );
150
+ head.removeChild( style );
151
+ if ( Cli_Data.ccpaType === 'ccpa' ) {
152
+ CLI.enableAllCookies();
153
+ CLI.accept_close();
154
+ }
155
+ }
156
+ ),
157
+ b.className = "cli-ccpa-button-cancel",
158
+ b.innerText = ccpa_data.opt_out_cancel,
159
+ b.addEventListener(
160
+ "click",
161
+ function() {
162
+ CCPA.ccpaOptedOut = false,
163
+ CCPA.optOutCcpa(),
164
+ document.body.removeChild( ccpaPrompt ),
165
+ document.body.removeChild( x ),
166
+ document.body.classList.remove( "cli-modal-open" );
167
+ head.removeChild( style );
168
+ if ( Cli_Data.ccpaType === 'ccpa' ) {
169
+ CLI.enableAllCookies();
170
+ CLI.accept_close();
171
+ }
172
+ }
173
+ ),
174
+ ccpaPrompt.addEventListener(
175
+ "click",
176
+ function( event ) {
177
+ event.stopPropagation();
178
+ if ( ccpaPrompt !== event.target) {
179
+ return;
180
+ }
181
+ document.body.removeChild( ccpaPrompt ),
182
+ document.body.removeChild( x ),
183
+ document.body.classList.remove( "cli-modal-open" );
184
+ head.removeChild( style );
185
+
186
+ }
187
+ ),
188
+ ccpaPrompt.appendChild( t ),
189
+ t.appendChild( n ),
190
+ n.appendChild( o ),
191
+ o.appendChild( p ),
192
+ p.appendChild( q ),
193
+ q.appendChild( r ),
194
+ r.appendChild( d ),
195
+ r.appendChild( c ),
196
+ c.appendChild( b ),
197
+ c.appendChild( a ),
198
+
199
+ head.appendChild( style );
200
+ style.type = 'text/css';
201
+ if (style.styleSheet) {
202
+ // This is required for IE8 and below.
203
+ style.styleSheet.cssText = css;
204
+ } else {
205
+ style.appendChild( document.createTextNode( css ) );
206
+ }
207
+ document.body.appendChild( ccpaPrompt );
208
+ document.body.appendChild( x );
209
+ document.body.classList.add( "cli-modal-open" );
210
+
211
+ },
212
+ }
213
+ jQuery( document ).ready(
214
+ function() {
215
+ CCPA.set();
216
+ }
217
+ );
218
 
 
 
 
 
 
 
219
  })( jQuery );
admin/modules/ccpa/ccpa.php CHANGED
@@ -9,200 +9,195 @@
9
  * @package CookieLawInfo
10
  */
11
 
12
- if (!defined('ABSPATH')) {
13
- exit;
14
  }
15
 
16
- class Cookie_Law_Info_CCPA
17
- {
18
-
19
- /**
20
- * Initialization
21
- *
22
- * @since 2.2.9
23
- **/
24
- private static $consent_allowed_values = array('ccpa','gdpr','ccpa_gdpr');
25
- public $ccpa_enabled;
26
- public $ccpa_as_link;
27
- public $ccpa_text;
28
- public $ccpa_region_based;
29
- public $consent_type;
30
- public $ccpa_content;
31
- public $ccpa_gdpr_content;
32
- public $gdpr_content;
33
- public $ccpa_enable_bar;
34
- public $ccpa_link_colour;
35
- public function __construct()
36
- {
37
- $cookie_options = Cookie_Law_Info::get_settings();
38
- $ccpa_settings = $this->get_ccpa_default_settings();
39
- $ccpa_default_text = ( isset( $ccpa_settings['ccpa'] ) ? $ccpa_settings['ccpa'] : '' );
40
- $ccpa_gdpr_default_text = ( isset( $ccpa_settings['ccpa_gdpr'] ) ? $ccpa_settings['ccpa_gdpr'] : '' );
41
- $this->ccpa_enabled = Cookie_Law_Info::sanitise_settings('ccpa_enabled', ( isset( $cookie_options['ccpa_enabled'] ) ? $cookie_options['ccpa_enabled'] : false ) );
42
- $this->ccpa_as_link = Cookie_Law_Info::sanitise_settings('button_6_as_link', ( isset( $cookie_options['button_6_as_link'] ) ? $cookie_options['button_6_as_link'] : true ) );
43
- $this->ccpa_text = Cookie_Law_Info::sanitise_settings('button_6_text', ( isset( $cookie_options['button_6_text'] ) ? $cookie_options['button_6_text'] : 'Do not sell my personal information' ) );
44
- $this->ccpa_link_colour = Cookie_Law_Info::sanitise_settings('button_6_link_colour', ( isset( $cookie_options['button_6_link_colour'] ) ? $cookie_options['button_6_link_colour'] : '#333333' ) );
45
- $this->ccpa_region_based = Cookie_Law_Info::sanitise_settings('ccpa_region_based', ( isset( $cookie_options['ccpa_region_based'] ) ? $cookie_options['ccpa_region_based'] : false ) );
46
- $this->consent_type = Cookie_Law_Info::sanitise_settings('consent_type', ( isset( $cookie_options['consent_type'] ) ? $cookie_options['consent_type'] : 'gdpr' ) );
47
- $this->ccpa_gdpr_content = Cookie_Law_Info::sanitise_settings('ccpa_gdpr_content', ( isset( $cookie_options['ccpa_gdpr_content'] ) ? $cookie_options['ccpa_gdpr_content'] : $ccpa_gdpr_default_text ) );
48
- $this->gdpr_content = Cookie_Law_Info::sanitise_settings('gdpr_content', ( isset( $cookie_options['gdpr_content'] ) ? $cookie_options['gdpr_content'] : $cookie_options['notify_message'] ) );
49
- $this->ccpa_content = Cookie_Law_Info::sanitise_settings('ccpa_content', ( isset( $cookie_options['ccpa_content'] ) ? $cookie_options['ccpa_content'] : $ccpa_default_text) );
50
- $this->ccpa_enable_bar = Cookie_Law_Info::sanitise_settings('ccpa_enable_bar', ( isset( $cookie_options['ccpa_enable_bar'] ) ? $cookie_options['ccpa_enable_bar'] : false ) );
51
-
52
- add_action( 'wt_cli_ccpa_settings', array( $this, 'add_ccpa_settings'));
53
- add_action( 'wp_enqueue_scripts', array( $this, 'wt_cli_enqueue_script'));
54
- add_action( 'wt_cli_before_cookie_message',array($this, 'wt_cli_message_toggler'));
55
- add_filter( 'wt_cli_before_save_settings',array($this, 'wt_cli_modify_plugin_settings'),10,2);
56
- add_filter( 'wt_cli_plugin_settings', array( $this, 'wt_cli_add_options'),10);
57
- add_filter( 'admin_enqueue_scripts', array( $this, 'wt_cli_enqueue_admin_scripts'),10);
58
- add_shortcode( 'wt_cli_ccpa_optout', array( $this, 'wt_cli_ccpa_optout_callback'));
59
-
60
- }
61
- public function add_ccpa_settings() {
62
- $cookie_options = Cookie_Law_Info::get_settings();
63
- $ccpa_settings_file = plugin_dir_path( __FILE__ ).'views/ccpa_settings.php';
64
- if( file_exists($ccpa_settings_file) )
65
- {
66
- include $ccpa_settings_file;
67
- echo $ccpa_settings;
68
- }
69
- }
70
- public function get_ccpa_default_settings() {
71
- $settings = array (
72
- 'ccpa' => addslashes ( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">This website or its third-party tools process personal data.</br>In case of sale of your personal information, you may opt out by using the link [wt_cli_ccpa_optout].</div>[cookie_close]</div>'),
73
- 'ccpa_gdpr' => addslashes ( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.</br><div class="wt-cli-ccpa-element"> [wt_cli_ccpa_optout].</div></div><div class="cli-bar-btn_container">[cookie_settings margin="0px 10px 0px 5px"][cookie_button]</div></div>'),
74
- );
75
- return $settings;
76
- }
77
- public function wt_cli_add_options( $options ) {
78
-
79
- $options = ( isset( $options ) && is_array( $options ) ) ? $options : array();
80
-
81
- $options['ccpa_enabled'] = $this->ccpa_enabled;
82
- $options['button_6_as_link'] = $this->ccpa_as_link;
83
- $options['button_6_text'] = $this->ccpa_text;
84
- $options['ccpa_enable_bar'] = $this->ccpa_enable_bar;
85
- $options['ccpa_region_based'] = $this->ccpa_region_based;
86
- $options['consent_type'] = $this->consent_type;
87
- $options['ccpa_content'] = $this->ccpa_content;
88
- $options['ccpa_gdpr_content'] = $this->ccpa_gdpr_content;
89
- $options['gdpr_content'] = $this->gdpr_content;
90
- $options['button_6_link_colour'] = $this->ccpa_link_colour;
91
-
92
- return $options;
93
- }
94
- public function wt_cli_enqueue_admin_scripts() {
95
- if(isset($_GET['post_type']) && $_GET['post_type']==CLI_POST_TYPE && isset($_GET['page']) && $_GET['page']=='cookie-law-info') {
96
- wp_enqueue_script('cookie-law-info-ccpa-admin',plugin_dir_url( __FILE__ ).'assets/js/cookie-law-info-ccpa-admin.js', array( 'jquery'),CLI_VERSION,false);
97
- }
98
- }
99
- public function wt_cli_enqueue_script() {
100
-
101
- if( !is_admin() ) {
102
- $cookie_options = Cookie_Law_Info::get_settings();
103
-
104
- $ccpa_enabled = ( wp_validate_boolean ( isset( $cookie_options['ccpa_enabled'] ) ? $cookie_options['ccpa_enabled'] : false ) );
105
- $cli_ccpa_datas = array (
106
- 'opt_out_prompt' => __('Do you really wish to opt out?','cookie-law-info'),
107
- 'opt_out_confirm' => __('Confirm','cookie-law-info'),
108
- 'opt_out_cancel' => __('Cancel','cookie-law-info'),
109
- );
110
- if( $ccpa_enabled === true ) {
111
- wp_enqueue_script('cookie-law-info-ccpa',plugin_dir_url( __FILE__ ).'assets/js/cookie-law-info-ccpa.js', array( 'jquery','cookie-law-info'),CLI_VERSION,false);
112
- wp_localize_script('cookie-law-info-ccpa', 'ccpa_data', $cli_ccpa_datas );
113
- }
114
- }
115
- }
116
- public function wt_cli_ccpa_optout_callback() {
117
-
118
- $cookie_options = Cookie_Law_Info::get_settings();
119
- $this->ccpa_text = Cookie_Law_Info::sanitise_settings('button_6_text', ( isset( $cookie_options['button_6_text'] ) ? $cookie_options['button_6_text'] : 'Do not sell my personal information' ) );
120
-
121
- $ccpa_data = '';
122
- $ccpa_enabled = $this->ccpa_enabled;
123
- $ccpa_as_link = $this->ccpa_as_link;
124
- $ccpa_text = $this->ccpa_text;
125
- $ccpa_colour = $this->ccpa_link_colour;
126
- if( $ccpa_enabled === false ) {
127
- return '';
128
- }
129
- if( $ccpa_as_link === false ) {
130
-
131
- $ccpa_data = '<span class="wt-cli-form-group wt-cli-custom-checkbox wt-cli-ccpa-checkbox"><input type="checkbox" id="wt-cli-ccpa-opt-out" class="wt-cli-ccpa-opt-out wt-cli-ccpa-opt-out-checkbox" ><label for="wt-cli-ccpa-opt-out" style="color:'.$ccpa_colour.';" >'.$ccpa_text.'</label></span>';
132
-
133
- } else {
134
- $ccpa_data = '<a href="javascript:void(0)" style="color:'.$ccpa_colour.';" class="wt-cli-ccpa-opt-out">'.$ccpa_text.'</a>';
135
- }
136
- return $ccpa_data;
137
- }
138
- public function wt_cli_message_toggler() {
139
-
140
- $ccpa_enabled = $this->ccpa_enabled;
141
- $consent_type = $this->consent_type;
142
- $ccpa_only_content = $this->ccpa_content;
143
- $ccpa_gdpr_content = $this->ccpa_gdpr_content;
144
- $gdpr_content = $this->gdpr_content;
145
-
146
- echo '
147
  <tr valign="top">
148
- <th scope="row"><label for="is_on_field">'.__('Select the type of law', 'cookie-law-info').'</label></th>
149
  <td>
150
  <div class="wt-cli-ccpa-message-toggler">
151
  <div class="wt-cli-form-group">
152
- <input type="radio" name="consent_type_field" id="consent_type_field_gdpr" value="gdpr" '.checked( $consent_type, 'gdpr',false).'><label for="consent_type_field_gdpr"><b>'.__('GDPR','cookie-law-info').'</b></label>
153
- <div class="wt-cli-info-bar"><small>'.__('GDPR compliance is essential for your website if it has a target audience from the European union.','cookie-law-info').'</small></div>
154
  </div>
155
  <div class="wt-cli-form-group">
156
- <input type="radio" name="consent_type_field" id="consent_type_field_ccpa" value="ccpa" '.checked( $consent_type, 'ccpa',false).'><label for="consent_type_field_ccpa"><b>'.__('CCPA','cookie-law-info').'</b></label>
157
- <div class="wt-cli-info-bar"><small>'.__('CCPA compliance is essential for your website if it has a target audience from California.','cookie-law-info').'</small></div>
158
  </div>
159
  <div class="wt-cli-form-group">
160
- <input type="radio" name="consent_type_field" id="consent_type_field_ccpa_gdpr" value="ccpa_gdpr" '.checked( $consent_type, 'ccpa_gdpr',false).'><label for="consent_type_field_ccpa_gdpr"><b>'.__('CCPA & GDPR','cookie-law-info').'</b></label>
161
- <div class="wt-cli-info-bar"><small>'.__('Comply with both the laws on the same website if your target audience are from European union and California.','cookie-law-info').'</small></div>
162
  </div>
163
- <textarea id="wt_ci_gdpr_only" name="gdpr_content_field" style="display:none">'.stripslashes( $gdpr_content ).'</textarea>
164
- <textarea id="wt_ci_ccpa_only" name="ccpa_content_field" style="display:none">'.stripslashes( $ccpa_only_content ).'</textarea>
165
- <textarea id="wt_ci_ccpa_gdpr" name="ccpa_gdpr_field" style="display:none">'.stripslashes( $ccpa_gdpr_content ).'</textarea>
166
  </div>
167
  </td>
168
  </tr>
169
 
170
  ';
171
 
172
- }
173
- public function wt_cli_modify_plugin_settings($options, $post) {
174
-
175
- $ccpa_enabled = Cookie_Law_Info::sanitise_settings('ccpa_enabled',( isset( $post['ccpa_enabled_field'] ) ? $post['ccpa_enabled_field'] : false ));
176
- $ccpa_as_link = Cookie_Law_Info::sanitise_settings('button_6_as_link',( isset( $post['button_6_as_link_field'] ) ? $post['button_6_as_link_field'] : false ) );
177
- $ccpa_enable_bar = Cookie_Law_Info::sanitise_settings('ccpa_enable_bar',( isset( $post['ccpa_enable_bar_field'] ) ? $post['ccpa_enable_bar_field'] : false ) );
178
- $ccpa_text = Cookie_Law_Info::sanitise_settings('button_6_text',( isset( $post['button_6_text_field'] ) ? $post['button_6_text_field'] : 'Do not sell my personal information' ));
179
- $ccpa_region_based = Cookie_Law_Info::sanitise_settings('ccpa_region_based',( isset( $post['ccpa_region_based_field'] ) ? $post['ccpa_region_based_field'] : false ) );
180
- $cookie_content = Cookie_Law_Info::sanitise_settings( 'notify_message',( isset( $options['notify_message'] ) ? $options['notify_message'] : '' ));
181
- $consent_type = Cookie_Law_Info::sanitise_settings('consent_type',( isset( $post['consent_type_field'] ) && in_array( $post['consent_type_field'], self::$consent_allowed_values) ? $post['consent_type_field'] : 'gdpr' ));
182
- $ccpa_colour = Cookie_Law_Info::sanitise_settings('button_6_link_colour',( isset( $post['button_6_link_colour_field'] ) ? $post['button_6_link_colour_field'] : '#000000' ));
183
-
184
- $this->ccpa_enabled = $options['ccpa_enabled'] = $ccpa_enabled;
185
- $this->ccpa_as_link = $options['button_6_as_link'] = $ccpa_as_link;
186
- $this->ccpa_link_colour = $options['button_6_link_colour'] = $ccpa_colour;
187
- $this->ccpa_text = $options['button_6_text'] = $ccpa_text;
188
- $this->ccpa_region_based = $options['ccpa_region_based'] = $ccpa_region_based;
189
- $this->consent_type = $options['consent_type'] = $consent_type;
190
- $this->ccpa_enable_bar = $options['ccpa_enable_bar'] = $ccpa_enable_bar;
191
-
192
- if( $consent_type === 'ccpa') {
193
- $this->ccpa_content = $options['ccpa_content'] = $cookie_content;
194
- }
195
- else if( $consent_type === 'ccpa_gdpr' ) {
196
- $this->ccpa_gdpr_content = $options['ccpa_gdpr_content'] = $cookie_content;
197
- }
198
- else {
199
- $this->gdpr_content = $options['gdpr_content'] = $cookie_content;
200
- }
201
- // if( $this->ccpa_enabled === false ) {
202
- // $options['notify_message'] = $this->gdpr_content;
203
- // }
204
- return $options;
205
- }
206
-
207
  }
208
  $CliCcpa = new Cookie_Law_Info_CCPA();
9
  * @package CookieLawInfo
10
  */
11
 
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
  }
15
 
16
+ class Cookie_Law_Info_CCPA {
17
+
18
+
19
+ /**
20
+ * Initialization
21
+ *
22
+ * @since 2.2.9
23
+ **/
24
+ private static $consent_allowed_values = array( 'ccpa', 'gdpr', 'ccpa_gdpr' );
25
+ public $ccpa_enabled;
26
+ public $ccpa_as_link;
27
+ public $ccpa_text;
28
+ public $ccpa_region_based;
29
+ public $consent_type;
30
+ public $ccpa_content;
31
+ public $ccpa_gdpr_content;
32
+ public $gdpr_content;
33
+ public $ccpa_enable_bar;
34
+ public $ccpa_link_colour;
35
+ public function __construct() {
36
+ $cookie_options = Cookie_Law_Info::get_settings();
37
+ $ccpa_settings = $this->get_ccpa_default_settings();
38
+ $ccpa_default_text = ( isset( $ccpa_settings['ccpa'] ) ? $ccpa_settings['ccpa'] : '' );
39
+ $ccpa_gdpr_default_text = ( isset( $ccpa_settings['ccpa_gdpr'] ) ? $ccpa_settings['ccpa_gdpr'] : '' );
40
+ $this->ccpa_enabled = Cookie_Law_Info::sanitise_settings( 'ccpa_enabled', ( isset( $cookie_options['ccpa_enabled'] ) ? $cookie_options['ccpa_enabled'] : false ) );
41
+ $this->ccpa_as_link = Cookie_Law_Info::sanitise_settings( 'button_6_as_link', ( isset( $cookie_options['button_6_as_link'] ) ? $cookie_options['button_6_as_link'] : true ) );
42
+ $this->ccpa_text = Cookie_Law_Info::sanitise_settings( 'button_6_text', ( isset( $cookie_options['button_6_text'] ) ? $cookie_options['button_6_text'] : 'Do not sell my personal information' ) );
43
+ $this->ccpa_link_colour = Cookie_Law_Info::sanitise_settings( 'button_6_link_colour', ( isset( $cookie_options['button_6_link_colour'] ) ? $cookie_options['button_6_link_colour'] : '#333333' ) );
44
+ $this->ccpa_region_based = Cookie_Law_Info::sanitise_settings( 'ccpa_region_based', ( isset( $cookie_options['ccpa_region_based'] ) ? $cookie_options['ccpa_region_based'] : false ) );
45
+ $this->consent_type = Cookie_Law_Info::sanitise_settings( 'consent_type', ( isset( $cookie_options['consent_type'] ) ? $cookie_options['consent_type'] : 'gdpr' ) );
46
+ $this->ccpa_gdpr_content = Cookie_Law_Info::sanitise_settings( 'ccpa_gdpr_content', ( isset( $cookie_options['ccpa_gdpr_content'] ) ? $cookie_options['ccpa_gdpr_content'] : $ccpa_gdpr_default_text ) );
47
+ $this->gdpr_content = Cookie_Law_Info::sanitise_settings( 'gdpr_content', ( isset( $cookie_options['gdpr_content'] ) ? $cookie_options['gdpr_content'] : $cookie_options['notify_message'] ) );
48
+ $this->ccpa_content = Cookie_Law_Info::sanitise_settings( 'ccpa_content', ( isset( $cookie_options['ccpa_content'] ) ? $cookie_options['ccpa_content'] : $ccpa_default_text ) );
49
+ $this->ccpa_enable_bar = Cookie_Law_Info::sanitise_settings( 'ccpa_enable_bar', ( isset( $cookie_options['ccpa_enable_bar'] ) ? $cookie_options['ccpa_enable_bar'] : false ) );
50
+
51
+ add_action( 'wt_cli_ccpa_settings', array( $this, 'add_ccpa_settings' ) );
52
+ add_action( 'wp_enqueue_scripts', array( $this, 'wt_cli_enqueue_script' ) );
53
+ add_action( 'wt_cli_before_cookie_message', array( $this, 'wt_cli_message_toggler' ) );
54
+ add_filter( 'wt_cli_before_save_settings', array( $this, 'wt_cli_modify_plugin_settings' ), 10, 2 );
55
+ add_filter( 'wt_cli_plugin_settings', array( $this, 'wt_cli_add_options' ), 10 );
56
+ add_filter( 'admin_enqueue_scripts', array( $this, 'wt_cli_enqueue_admin_scripts' ), 10 );
57
+ add_shortcode( 'wt_cli_ccpa_optout', array( $this, 'wt_cli_ccpa_optout_callback' ) );
58
+
59
+ }
60
+ public function add_ccpa_settings() {
61
+ $cookie_options = Cookie_Law_Info::get_settings();
62
+ $ccpa_settings_file = plugin_dir_path( __FILE__ ) . 'views/ccpa_settings.php';
63
+ if ( file_exists( $ccpa_settings_file ) ) {
64
+ include $ccpa_settings_file;
65
+ }
66
+ }
67
+ public function get_ccpa_default_settings() {
68
+ $settings = array(
69
+ 'ccpa' => addslashes( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">This website or its third-party tools process personal data.</br>In case of sale of your personal information, you may opt out by using the link [wt_cli_ccpa_optout].</div>[cookie_close]</div>' ),
70
+ 'ccpa_gdpr' => addslashes( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.</br><div class="wt-cli-ccpa-element"> [wt_cli_ccpa_optout].</div></div><div class="cli-bar-btn_container">[cookie_settings margin="0px 10px 0px 5px"][cookie_button]</div></div>' ),
71
+ );
72
+ return $settings;
73
+ }
74
+ public function wt_cli_add_options( $options ) {
75
+
76
+ $options = ( isset( $options ) && is_array( $options ) ) ? $options : array();
77
+
78
+ $options['ccpa_enabled'] = $this->ccpa_enabled;
79
+ $options['button_6_as_link'] = $this->ccpa_as_link;
80
+ $options['button_6_text'] = $this->ccpa_text;
81
+ $options['ccpa_enable_bar'] = $this->ccpa_enable_bar;
82
+ $options['ccpa_region_based'] = $this->ccpa_region_based;
83
+ $options['consent_type'] = $this->consent_type;
84
+ $options['ccpa_content'] = $this->ccpa_content;
85
+ $options['ccpa_gdpr_content'] = $this->ccpa_gdpr_content;
86
+ $options['gdpr_content'] = $this->gdpr_content;
87
+ $options['button_6_link_colour'] = $this->ccpa_link_colour;
88
+
89
+ return $options;
90
+ }
91
+ public function wt_cli_enqueue_admin_scripts() {
92
+ if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == CLI_POST_TYPE && isset( $_GET['page'] ) && $_GET['page'] == 'cookie-law-info' ) {
93
+ wp_enqueue_script( 'cookie-law-info-ccpa-admin', plugin_dir_url( __FILE__ ) . 'assets/js/cookie-law-info-ccpa-admin.js', array( 'jquery' ), CLI_VERSION, false );
94
+ }
95
+ }
96
+ public function wt_cli_enqueue_script() {
97
+
98
+ if ( ! is_admin() ) {
99
+ $cookie_options = Cookie_Law_Info::get_settings();
100
+
101
+ $ccpa_enabled = ( wp_validate_boolean( isset( $cookie_options['ccpa_enabled'] ) ? $cookie_options['ccpa_enabled'] : false ) );
102
+ $cli_ccpa_datas = array(
103
+ 'opt_out_prompt' => __( 'Do you really wish to opt out?', 'cookie-law-info' ),
104
+ 'opt_out_confirm' => __( 'Confirm', 'cookie-law-info' ),
105
+ 'opt_out_cancel' => __( 'Cancel', 'cookie-law-info' ),
106
+ );
107
+ if ( $ccpa_enabled === true ) {
108
+ wp_enqueue_script( 'cookie-law-info-ccpa', plugin_dir_url( __FILE__ ) . 'assets/js/cookie-law-info-ccpa.js', array( 'jquery', 'cookie-law-info' ), CLI_VERSION, false );
109
+ wp_localize_script( 'cookie-law-info-ccpa', 'ccpa_data', $cli_ccpa_datas );
110
+ }
111
+ }
112
+ }
113
+ public function wt_cli_ccpa_optout_callback() {
114
+
115
+ $cookie_options = Cookie_Law_Info::get_settings();
116
+ $this->ccpa_text = Cookie_Law_Info::sanitise_settings( 'button_6_text', ( isset( $cookie_options['button_6_text'] ) ? $cookie_options['button_6_text'] : 'Do not sell my personal information' ) );
117
+
118
+ $ccpa_data = '';
119
+ $ccpa_enabled = $this->ccpa_enabled;
120
+ $ccpa_as_link = $this->ccpa_as_link;
121
+ $ccpa_text = $this->ccpa_text;
122
+ $ccpa_colour = $this->ccpa_link_colour;
123
+ if ( $ccpa_enabled === false ) {
124
+ return '';
125
+ }
126
+ if ( $ccpa_as_link === false ) {
127
+
128
+ $ccpa_data = '<span class="wt-cli-form-group wt-cli-custom-checkbox wt-cli-ccpa-checkbox"><input type="checkbox" id="wt-cli-ccpa-opt-out" class="wt-cli-ccpa-opt-out wt-cli-ccpa-opt-out-checkbox" ><label for="wt-cli-ccpa-opt-out" style="color:' . esc_attr( $ccpa_colour ) . ';" >' . esc_html( $ccpa_text ) . '</label></span>';
129
+
130
+ } else {
131
+ $ccpa_data = '<a style="color:' . esc_attr( $ccpa_colour ) . ';" class="wt-cli-ccpa-opt-out">' . esc_html( $ccpa_text ) . '</a>';
132
+ }
133
+ return $ccpa_data;
134
+ }
135
+ public function wt_cli_message_toggler() {
136
+
137
+ $ccpa_enabled = $this->ccpa_enabled;
138
+ $consent_type = $this->consent_type;
139
+ $ccpa_only_content = $this->ccpa_content;
140
+ $ccpa_gdpr_content = $this->ccpa_gdpr_content;
141
+ $gdpr_content = $this->gdpr_content;
142
+
143
+ echo '
 
 
 
144
  <tr valign="top">
145
+ <th scope="row"><label for="is_on_field">' . esc_html__( 'Select the type of law', 'cookie-law-info' ) . '</label></th>
146
  <td>
147
  <div class="wt-cli-ccpa-message-toggler">
148
  <div class="wt-cli-form-group">
149
+ <input type="radio" name="consent_type_field" id="consent_type_field_gdpr" value="gdpr" ' . checked( $consent_type, 'gdpr', false ) . '><label for="consent_type_field_gdpr"><b>' . esc_html__( 'GDPR', 'cookie-law-info' ) . '</b></label>
150
+ <div class="wt-cli-info-bar"><small>' . esc_html__( 'GDPR compliance is essential for your website if it has a target audience from the European union.', 'cookie-law-info' ) . '</small></div>
151
  </div>
152
  <div class="wt-cli-form-group">
153
+ <input type="radio" name="consent_type_field" id="consent_type_field_ccpa" value="ccpa" ' . checked( $consent_type, 'ccpa', false ) . '><label for="consent_type_field_ccpa"><b>' . esc_html__( 'CCPA', 'cookie-law-info' ) . '</b></label>
154
+ <div class="wt-cli-info-bar"><small>' . esc_html__( 'CCPA compliance is essential for your website if it has a target audience from California.', 'cookie-law-info' ) . '</small></div>
155
  </div>
156
  <div class="wt-cli-form-group">
157
+ <input type="radio" name="consent_type_field" id="consent_type_field_ccpa_gdpr" value="ccpa_gdpr" ' . checked( $consent_type, 'ccpa_gdpr', false ) . '><label for="consent_type_field_ccpa_gdpr"><b>' . esc_html__( 'CCPA & GDPR', 'cookie-law-info' ) . '</b></label>
158
+ <div class="wt-cli-info-bar"><small>' . esc_html__( 'Comply with both the laws on the same website if your target audience are from European union and California.', 'cookie-law-info' ) . '</small></div>
159
  </div>
160
+ <textarea id="wt_ci_gdpr_only" name="gdpr_content_field" style="display:none">' . wp_kses_post( stripslashes( $gdpr_content ) ) . '</textarea>
161
+ <textarea id="wt_ci_ccpa_only" name="ccpa_content_field" style="display:none">' . wp_kses_post( stripslashes( $ccpa_only_content ) ) . '</textarea>
162
+ <textarea id="wt_ci_ccpa_gdpr" name="ccpa_gdpr_field" style="display:none">' . wp_kses_post( stripslashes( $ccpa_gdpr_content ) ) . '</textarea>
163
  </div>
164
  </td>
165
  </tr>
166
 
167
  ';
168
 
169
+ }
170
+ public function wt_cli_modify_plugin_settings( $options, $post ) {
171
+
172
+ $ccpa_enabled = Cookie_Law_Info::sanitise_settings( 'ccpa_enabled', ( isset( $post['ccpa_enabled_field'] ) ? $post['ccpa_enabled_field'] : false ) );
173
+ $ccpa_as_link = Cookie_Law_Info::sanitise_settings( 'button_6_as_link', ( isset( $post['button_6_as_link_field'] ) ? $post['button_6_as_link_field'] : false ) );
174
+ $ccpa_enable_bar = Cookie_Law_Info::sanitise_settings( 'ccpa_enable_bar', ( isset( $post['ccpa_enable_bar_field'] ) ? $post['ccpa_enable_bar_field'] : false ) );
175
+ $ccpa_text = Cookie_Law_Info::sanitise_settings( 'button_6_text', ( isset( $post['button_6_text_field'] ) ? $post['button_6_text_field'] : 'Do not sell my personal information' ) );
176
+ $ccpa_region_based = Cookie_Law_Info::sanitise_settings( 'ccpa_region_based', ( isset( $post['ccpa_region_based_field'] ) ? $post['ccpa_region_based_field'] : false ) );
177
+ $cookie_content = Cookie_Law_Info::sanitise_settings( 'notify_message', ( isset( $options['notify_message'] ) ? $options['notify_message'] : '' ) );
178
+ $consent_type = Cookie_Law_Info::sanitise_settings( 'consent_type', ( isset( $post['consent_type_field'] ) && in_array( $post['consent_type_field'], self::$consent_allowed_values ) ? $post['consent_type_field'] : 'gdpr' ) );
179
+ $ccpa_colour = Cookie_Law_Info::sanitise_settings( 'button_6_link_colour', ( isset( $post['button_6_link_colour_field'] ) ? $post['button_6_link_colour_field'] : '#000000' ) );
180
+
181
+ $this->ccpa_enabled = $options['ccpa_enabled'] = $ccpa_enabled;
182
+ $this->ccpa_as_link = $options['button_6_as_link'] = $ccpa_as_link;
183
+ $this->ccpa_link_colour = $options['button_6_link_colour'] = $ccpa_colour;
184
+ $this->ccpa_text = $options['button_6_text'] = $ccpa_text;
185
+ $this->ccpa_region_based = $options['ccpa_region_based'] = $ccpa_region_based;
186
+ $this->consent_type = $options['consent_type'] = $consent_type;
187
+ $this->ccpa_enable_bar = $options['ccpa_enable_bar'] = $ccpa_enable_bar;
188
+
189
+ if ( $consent_type === 'ccpa' ) {
190
+ $this->ccpa_content = $options['ccpa_content'] = $cookie_content;
191
+ } elseif ( $consent_type === 'ccpa_gdpr' ) {
192
+ $this->ccpa_gdpr_content = $options['ccpa_gdpr_content'] = $cookie_content;
193
+ } else {
194
+ $this->gdpr_content = $options['gdpr_content'] = $cookie_content;
195
+ }
196
+ // if( $this->ccpa_enabled === false ) {
197
+ // $options['notify_message'] = $this->gdpr_content;
198
+ // }
199
+ return $options;
200
+ }
201
+
 
 
202
  }
203
  $CliCcpa = new Cookie_Law_Info_CCPA();
admin/modules/ccpa/views/ccpa_settings.php CHANGED
@@ -1,34 +1,29 @@
1
  <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
  }
5
- ob_start();
6
  ?>
7
- <h3><?php _e('CCPA Settings', 'cookie-law-info'); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php _e('The right to opt out in the California Consumer Privacy Act gives consumers the ability to direct a business not to sell their personal information to a third party. If the user considers to not sell their personal information, all the scripts related to the categories which are configured to sell personal information will be blocked. The DO NOT SELL option is facilitated via a shortcode [wt_cli_ccpa_optout].', 'cookie-law-info'); ?>"><span class="wt-cli-tootip-icon"></span></span></h3>
8
  <table class="form-table">
9
- <tr valign="top">
10
- <th scope="row"><label for="ccpa_enabled_field"><?php _e('Enable CCPA ?', 'cookie-law-info'); ?></label></th>
11
- <td>
12
- <input type="hidden" name="ccpa_enabled_field" value="false" id="ccpa_enabled_no">
13
- <input name="ccpa_enabled_field" type="checkbox" value="true" id="ccpa_enabled_yes" <?php checked(Cookie_Law_Info::sanitise_settings('ccpa_enabled', $cookie_options['ccpa_enabled']), true); ?>>
14
- </td>
15
- </tr>
16
 
17
- <tr valign="top">
18
- <th scope="row"><label for="ccpa_enable_bar_field"><?php _e('Show CCPA notice', 'cookie-law-info'); ?></label><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php _e('Displays CCPA notice on the consent bar of your site and records prior consent from the user.', 'cookie-law-info'); ?>"><span class="wt-cli-tootip-icon"></span></span></th>
19
- <td>
20
- <input type="hidden" name="ccpa_enable_bar_field" value="false" id="ccpa_enable_bar_no">
21
- <input name="ccpa_enable_bar_field" type="checkbox" value="true" id="ccpa_enable_bar_yes" <?php checked(Cookie_Law_Info::sanitise_settings('ccpa_enable_bar', $cookie_options['ccpa_enable_bar']), true); ?>>
22
- </td>
23
- </tr>
24
  </table>
25
  <!-- Webtoffee GDPR CCPA Styles -->
26
  <style>
27
- .cookie-law-info-tab-content[data-id=cookie-law-info-ccpa] th {
28
- width: 400px;
29
- }
30
- </style>
31
- <?php
32
- $ccpa_settings = ob_get_contents();
33
- ob_end_clean();
34
- ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
  }
 
5
  ?>
6
+ <h3><?php echo esc_html__( 'CCPA Settings', 'cookie-law-info' ); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php echo esc_html__( 'The right to opt out in the California Consumer Privacy Act gives consumers the ability to direct a business not to sell their personal information to a third party. If the user considers to not sell their personal information, all the scripts related to the categories which are configured to sell personal information will be blocked. The DO NOT SELL option is facilitated via a shortcode [wt_cli_ccpa_optout].', 'cookie-law-info' ); ?>"><span class="wt-cli-tootip-icon"></span></span></h3>
7
  <table class="form-table">
8
+ <tr valign="top">
9
+ <th scope="row"><label for="ccpa_enabled_field"><?php echo esc_html__( 'Enable CCPA ?', 'cookie-law-info' ); ?></label></th>
10
+ <td>
11
+ <input type="hidden" name="ccpa_enabled_field" value="false" id="ccpa_enabled_no">
12
+ <input name="ccpa_enabled_field" type="checkbox" value="true" id="ccpa_enabled_yes" <?php checked( Cookie_Law_Info::sanitise_settings( 'ccpa_enabled', $cookie_options['ccpa_enabled'] ), true ); ?>>
13
+ </td>
14
+ </tr>
15
 
16
+ <tr valign="top">
17
+ <th scope="row"><label for="ccpa_enable_bar_field"><?php echo esc_html__( 'Show CCPA notice', 'cookie-law-info' ); ?></label><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php echo esc_html__( 'Displays CCPA notice on the consent bar of your site and records prior consent from the user.', 'cookie-law-info' ); ?>"><span class="wt-cli-tootip-icon"></span></span></th>
18
+ <td>
19
+ <input type="hidden" name="ccpa_enable_bar_field" value="false" id="ccpa_enable_bar_no">
20
+ <input name="ccpa_enable_bar_field" type="checkbox" value="true" id="ccpa_enable_bar_yes" <?php checked( Cookie_Law_Info::sanitise_settings( 'ccpa_enable_bar', $cookie_options['ccpa_enable_bar'] ), true ); ?>>
21
+ </td>
22
+ </tr>
23
  </table>
24
  <!-- Webtoffee GDPR CCPA Styles -->
25
  <style>
26
+ .cookie-law-info-tab-content[data-id=cookie-law-info-ccpa] th {
27
+ width: 400px;
28
+ }
29
+ </style>
 
 
 
 
admin/modules/cli-policy-generator/assets/css/editor-style.css CHANGED
@@ -1 +1 @@
1
- .mce-content-body{ max-width:none !important; }
1
+ .mce-content-body{ max-width:none !important; }
admin/modules/cli-policy-generator/assets/js/cli-policy-generator-admin.js CHANGED
@@ -1,258 +1,292 @@
1
  (function( $ ) {
2
- //'use strict';
3
- $(function() {
 
4
 
5
- var CLI_pg=
6
- {
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
- },
24
- refreshCurrentPolicyPageId:function()
25
  {
26
- var data = {
27
- action: 'cli_policy_generator',
28
- security: cli_policy_generator.nonces.cli_policy_generator,
29
- cli_policy_generator_action:'get_policy_pageid',
30
- };
31
- $.ajax({
32
- url: cli_policy_generator.ajax_url,
33
- data: data,
34
- //datatype:'json',
35
- type: 'POST',
36
- success:function(data)
37
- {
38
- data=JSON.parse(data);
39
- if(data.response===true)
40
- {
41
- $('[name="cli_pg_policy_pageid"]').val(data.page_id);
42
- if(data.page_id==0){
43
- $('[name="cli_pg_save_currentpage"]').hide();
44
- }else
45
- {
46
- $('[name="cli_pg_save_currentpage"]').show();
47
- }
48
- }
49
- },
50
- error:function()
51
- {
52
-
53
- }
54
- });
55
- },
56
- genContentData:function()
57
  {
58
- var content_data={};
59
- var v=0;
60
- $('.cli_pg_left .cli_pg_left_menu').each(function(){
61
- var elm=$(this);
62
- if(elm.find('[name="cli_pg_enabled_block_checkbox"]').is(':checked'))
63
- {
64
- var temp={
65
- 'ord':v,
66
- 'hd':elm.find('.cli_pg_content_hd').text(),
67
- 'content':elm.find('.cli_pg_content_hid').html()
68
- };
69
- content_data[v]=temp;
70
- v++;
71
- }
72
- });
73
- return content_data;
74
- },
75
- regSaveData:function()
76
- {
77
- $('[name="cli_pg_save_newpage"], [name="cli_pg_save_currentpage"]').on('click',function(){
78
- if(CLI_pg.onPrg)
79
- {
80
- return false;
81
- }
82
- var pg_id=$(this).attr('name')=='cli_pg_save_currentpage' ? $('[name="cli_pg_policy_pageid"]').val() : 0;
83
- var content_data=CLI_pg.genContentData();
84
- var data = {
85
- action: 'cli_policy_generator',
86
- security: cli_policy_generator.nonces.cli_policy_generator,
87
- cli_policy_generator_action:'save_contentdata',
88
- content_data:content_data,
89
- page_id:pg_id,
90
- enable_webtofee_powered_by:($('[name="enable_webtofee_powered_by"]').is(':checked') ? 1 : 0)
91
- };
92
- $('.cli_pg_footer a').css({'opacity':.5,'cursor':'default'});
93
- CLI_pg.onPrg=true;
94
- $.ajax({
95
- url: cli_policy_generator.ajax_url,
96
- data: data,
97
- //datatype:'json',
98
- type: 'POST',
99
- success:function(data)
100
- {
101
- data=JSON.parse(data);
102
- CLI_pg.onPrg=false;
103
- $('.cli_pg_footer a').css({'opacity':1,'cursor':'pointer'});
104
- if(data.response===true)
105
- {
106
- cli_notify_msg.success(cli_policy_generator.labels.success);
107
- var edit_page_url=$("<textarea></textarea>").html(data.url).text();
108
- window.location.href=edit_page_url;
109
- }else
110
- {
111
- cli_notify_msg.error(cli_policy_generator.labels.error);
112
- }
113
- },
114
- error:function()
115
- {
116
- CLI_pg.onPrg=false;
117
- $('.cli_pg_footer a').css({'opacity':1,'cursor':'pointer'});
118
- cli_notify_msg.error(cli_policy_generator.labels.error);
119
- }
120
- });
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
  {
170
- $('[name="cli_pg_hd_field"]').keyup(function(){
171
- CLI_pg.active_elm.find('.cli_pg_content_hd').html($(this).val());
172
- });
173
- $('#cli_pg_content').change(function(){
174
- CLI_pg.active_elm.find('.cli_pg_content_hid').html($(this).val());
175
- });
176
- this.cli_pg_editormode_tmr=setInterval(function(){
177
- var act_ed=tinymce.activeEditor;
178
- if(act_ed!==null)
179
- {
180
- clearInterval(CLI_pg.cli_pg_editormode_tmr);
181
- act_ed.on('keyup',function(){
182
- var act_ed_content=act_ed.getContent();
183
- CLI_pg.active_elm.find('.cli_pg_content_hid').html(act_ed_content);
184
- });
185
- }
186
- },1000);
187
- },
188
- regAddNew:function()
189
- {
190
- $('.cli_pg_addnew_hd_btn').click(function(){
191
- $('.cli_pg_samplehid_block .cli_pg_left_menu').clone().insertBefore($(this));
192
- });
193
- },
194
- tabView:function()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  {
196
- $(document).on('click','.cli_pg_left .cli_pg_left_menu',function(e){
197
- e.stopPropagation();
198
- CLI_pg.active_elm=$(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
- /* active menu */
201
- $('.cli_pg_left_menu').css({'background':'#f3f3f3'}).removeClass('cli_pg_menu_active');
202
- $(this).css({'background':'#fff'}).addClass('cli_pg_menu_active');
203
 
204
- /* heading */
205
- var hd=$(this).find('.cli_pg_content_hd').text();
206
- $('[name="cli_pg_hd_field"]').val(hd);
207
 
208
- /* description */
209
- var html=$(this).find('.cli_pg_content_hid').html();
210
- var editor_id='cli_pg_content';
211
- if($('#wp-'+editor_id+'-wrap').hasClass('html-active'))
212
- {
213
- $('#'+editor_id+'').val(html);
214
- }else
215
- {
216
- var activeEditor=tinyMCE.get(editor_id);
217
- if(activeEditor!==null)
218
- {
219
- $('#'+editor_id+'').val(html);
220
- activeEditor.setContent(html);
221
- }
222
- }
223
- });
224
- $(document).on('click','.cli_pg_content_delete',function(e){
225
- e.stopPropagation();
226
- var elm=$(this).parents('.cli_pg_left_menu');
227
- if(elm.hasClass('cli_pg_menu_active'))
228
- {
229
- elm.remove();
230
- $('.cli_pg_left .cli_pg_left_menu:eq(0)').click();
231
- }else
232
- {
233
- elm.remove();
234
- }
235
- });
236
- setTimeout(function(){
237
- $('.cli_pg_left .cli_pg_left_menu:eq(0)').click();
238
- },1000);
239
- },
240
- leftBoxHeight:function()
 
 
 
241
  {
242
- clearTimeout(CLI_pg.cli_pg_lefth_tmr);
243
- $(window).resize(function() {
244
- CLI_pg.cli_pg_lefth_tmr=setTimeout(function()
245
- {
246
- $('.cli_pg_left').css({'min-height':$('.cli_pg_right').outerHeight()});
247
- },500);
248
- });
249
- setTimeout(function()
250
- {
251
- $('.cli_pg_left').css({'min-height':$('.cli_pg_right').outerHeight()});
252
- },300);
 
 
 
 
 
 
 
 
 
253
  }
254
- }
255
- CLI_pg.Set();
256
 
257
- });
258
- })( jQuery );
 
1
  (function( $ ) {
2
+ // 'use strict';
3
+ $(
4
+ function() {
5
 
6
+ var CLI_pg =
 
 
 
 
 
 
 
7
  {
8
+ cli_pg_lefth_tmr:null,
9
+ cli_pg_editormode_tmr:null,
10
+ active_elm:null,
11
+ autosave_interval:10000,
12
+ onPrg:false,
13
+ Set:function()
 
 
 
 
 
14
  {
15
+ this.leftBoxHeight();
16
+ this.tabView();
17
+ this.regAddNew();
18
+ this.regAutoSaveForPreview();
19
+ setTimeout(
20
+ function(){
21
+ CLI_pg.editOnChange();
22
+ },
23
+ 1000
24
+ );
25
+ this.regSaveData();
26
+ this.refreshCurrentPolicyPageId();
27
+ },
28
+ refreshCurrentPolicyPageId:function()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  var data = {
31
  action: 'cli_policy_generator',
32
  security: cli_policy_generator.nonces.cli_policy_generator,
33
+ cli_policy_generator_action:'get_policy_pageid',
 
 
 
34
  };
35
+ $.ajax(
36
+ {
37
+ url: cli_policy_generator.ajax_url,
38
+ data: data,
39
+ //datatype:'json',
40
+ type: 'POST',
41
+ success:function(data)
42
+ {
43
+ data = JSON.parse( data );
44
+ if (data.response === true) {
45
+ $( '[name="cli_pg_policy_pageid"]' ).val( data.page_id );
46
+ if (data.page_id == 0) {
47
+ $( '[name="cli_pg_save_currentpage"]' ).hide();
48
+ } else {
49
+ $( '[name="cli_pg_save_currentpage"]' ).show();
50
+ }
51
+ }
52
+ },
53
+ error:function()
54
+ {
55
+
56
  }
57
+ }
58
+ );
59
+ },
60
+ genContentData:function()
61
+ {
62
+ var content_data = {};
63
+ var v = 0;
64
+ $( '.cli_pg_left .cli_pg_left_menu' ).each(
65
+ function(){
66
+ var elm = $( this );
67
+ if (elm.find( '[name="cli_pg_enabled_block_checkbox"]' ).is( ':checked' )) {
68
+ var temp = {
69
+ 'ord':v,
70
+ 'hd':elm.find( '.cli_pg_content_hd' ).text(),
71
+ 'content':elm.find( '.cli_pg_content_hid' ).html()
72
+ };
73
+ content_data[v] = temp;
74
+ v++;
75
  }
 
 
 
 
 
 
76
  }
77
+ );
78
+ return content_data;
79
+ },
80
+ regSaveData:function()
81
  {
82
+ $( '[name="cli_pg_save_newpage"], [name="cli_pg_save_currentpage"]' ).on(
83
+ 'click',
84
+ function(){
85
+ if (CLI_pg.onPrg) {
86
+ return false;
87
+ }
88
+ var pg_id = $( this ).attr( 'name' ) == 'cli_pg_save_currentpage' ? $( '[name="cli_pg_policy_pageid"]' ).val() : 0;
89
+ var content_data = CLI_pg.genContentData();
90
+ var data = {
91
+ action: 'cli_policy_generator',
92
+ security: cli_policy_generator.nonces.cli_policy_generator,
93
+ cli_policy_generator_action:'save_contentdata',
94
+ content_data:content_data,
95
+ page_id:pg_id,
96
+ enable_webtofee_powered_by:($( '[name="enable_webtofee_powered_by"]' ).is( ':checked' ) ? 1 : 0)
97
+ };
98
+ $( '.cli_pg_footer a' ).css( {'opacity':.5,'cursor':'default'} );
99
+ CLI_pg.onPrg = true;
100
+ $.ajax(
101
+ {
102
+ url: cli_policy_generator.ajax_url,
103
+ data: data,
104
+ //datatype:'json',
105
+ type: 'POST',
106
+ success:function(data)
107
+ {
108
+ data = JSON.parse( data );
109
+ CLI_pg.onPrg = false;
110
+ $( '.cli_pg_footer a' ).css( {'opacity':1,'cursor':'pointer'} );
111
+ if (data.response === true) {
112
+ cli_notify_msg.success( cli_policy_generator.labels.success );
113
+ var edit_page_url = $( "<textarea></textarea>" ).html( data.url ).text();
114
+ window.location.href = edit_page_url;
115
+ } else {
116
+ cli_notify_msg.error( cli_policy_generator.labels.error );
117
+ }
118
+ },
119
+ error:function()
120
+ {
121
+ CLI_pg.onPrg = false;
122
+ $( '.cli_pg_footer a' ).css( {'opacity':1,'cursor':'pointer'} );
123
+ cli_notify_msg.error( cli_policy_generator.labels.error );
124
+ }
125
+ }
126
+ );
127
+ }
128
+ );
129
+ },
130
+ regAutoSaveForPreview:function()
131
  {
132
+ $( '[name="cli_pg_live_preview"]' ).on(
133
+ 'click',
134
+ function(event){
135
+ event.preventDefault();
136
+ if (CLI_pg.onPrg) {
137
+ return false;
138
+ }
139
+ var content_data = CLI_pg.genContentData();
140
+ var preview_page_url = $( this ).attr( 'href' );
141
+ var data = {
142
+ action: 'cli_policy_generator',
143
+ security: cli_policy_generator.nonces.cli_policy_generator,
144
+ cli_policy_generator_action:'autosave_contant_data',
145
+ content_data:content_data,
146
+ page_id:cli_policy_generator.page_id,
147
+ enable_webtofee_powered_by:($( '[name="enable_webtofee_powered_by"]' ).is( ':checked' ) ? 1 : 0)
148
+ };
149
+ $.ajax(
150
+ {
151
+ url: cli_policy_generator.ajax_url,
152
+ data: data,
153
+ datatype:'json',
154
+ type: 'POST',
155
+ success:function(data)
156
+ {
157
+ data = JSON.parse( data );
158
+ CLI_pg.onPrg = false;
159
+ if (data.response === true) {
160
+ window.location.href = preview_page_url;
161
+ } else {
162
+ cli_notify_msg.error( cli_policy_generator.labels.error );
163
+ }
164
+ },
165
+ error:function()
166
+ {
167
+ CLI_pg.onPrg = false;
168
+ $( '.cli_pg_footer a' ).css( {'opacity':1,'cursor':'pointer'} );
169
+ cli_notify_msg.error( cli_policy_generator.labels.error );
170
+ }
171
+ }
172
+ );
173
+ }
174
+ );
175
+ },
176
+ editOnChange:function()
177
+ {
178
+ $( '[name="cli_pg_hd_field"]' ).keyup(
179
+ function(){
180
+ CLI_pg.active_elm.find( '.cli_pg_content_hd' ).html( $( this ).val() );
181
+ }
182
+ );
183
+ $( '#cli_pg_content' ).change(
184
+ function(){
185
+ CLI_pg.active_elm.find( '.cli_pg_content_hid' ).html( $( this ).val() );
186
+ }
187
+ );
188
+ this.cli_pg_editormode_tmr = setInterval(
189
+ function(){
190
+ var act_ed = tinymce.activeEditor;
191
+ if (act_ed !== null) {
192
+ clearInterval( CLI_pg.cli_pg_editormode_tmr );
193
+ act_ed.on(
194
+ 'keyup',
195
+ function(){
196
+ var act_ed_content = act_ed.getContent();
197
+ CLI_pg.active_elm.find( '.cli_pg_content_hid' ).html( act_ed_content );
198
+ }
199
+ );
200
+ }
201
+ },
202
+ 1000
203
+ );
204
+ },
205
+ regAddNew:function()
206
+ {
207
+ $( '.cli_pg_addnew_hd_btn' ).click(
208
+ function(){
209
+ $( '.cli_pg_samplehid_block .cli_pg_left_menu' ).clone().insertBefore( $( this ) );
210
+ }
211
+ );
212
+ },
213
+ tabView:function()
214
+ {
215
+ $( document ).on(
216
+ 'click',
217
+ '.cli_pg_left .cli_pg_left_menu',
218
+ function(e){
219
+ e.stopPropagation();
220
+ CLI_pg.active_elm = $( this );
221
 
222
+ /* active menu */
223
+ $( '.cli_pg_left_menu' ).css( {'background':'#f3f3f3'} ).removeClass( 'cli_pg_menu_active' );
224
+ $( this ).css( {'background':'#fff'} ).addClass( 'cli_pg_menu_active' );
225
 
226
+ /* heading */
227
+ var hd = $( this ).find( '.cli_pg_content_hd' ).text();
228
+ $( '[name="cli_pg_hd_field"]' ).val( hd );
229
 
230
+ /* description */
231
+ var html = $( this ).find( '.cli_pg_content_hid' ).html();
232
+ var editor_id = 'cli_pg_content';
233
+ if ($( '#wp-' + editor_id + '-wrap' ).hasClass( 'html-active' )) {
234
+ $( '#' + editor_id + '' ).val( html );
235
+ } else {
236
+ var activeEditor = tinyMCE.get( editor_id );
237
+ if (activeEditor !== null) {
238
+ $( '#' + editor_id + '' ).val( html );
239
+ activeEditor.setContent( html );
240
+ }
241
+ }
242
+ }
243
+ );
244
+ $( document ).on(
245
+ 'click',
246
+ '.cli_pg_content_delete',
247
+ function(e){
248
+ e.stopPropagation();
249
+ var elm = $( this ).parents( '.cli_pg_left_menu' );
250
+ if (elm.hasClass( 'cli_pg_menu_active' )) {
251
+ elm.remove();
252
+ $( '.cli_pg_left .cli_pg_left_menu:eq(0)' ).click();
253
+ } else {
254
+ elm.remove();
255
+ }
256
+ }
257
+ );
258
+ setTimeout(
259
+ function(){
260
+ $( '.cli_pg_left .cli_pg_left_menu:eq(0)' ).click();
261
+ },
262
+ 1000
263
+ );
264
+ },
265
+ leftBoxHeight:function()
266
  {
267
+ clearTimeout( CLI_pg.cli_pg_lefth_tmr );
268
+ $( window ).resize(
269
+ function() {
270
+ CLI_pg.cli_pg_lefth_tmr = setTimeout(
271
+ function()
272
+ {
273
+ $( '.cli_pg_left' ).css( {'min-height':$( '.cli_pg_right' ).outerHeight()} );
274
+ },
275
+ 500
276
+ );
277
+ }
278
+ );
279
+ setTimeout(
280
+ function()
281
+ {
282
+ $( '.cli_pg_left' ).css( {'min-height':$( '.cli_pg_right' ).outerHeight()} );
283
+ },
284
+ 300
285
+ );
286
+ }
287
  }
288
+ CLI_pg.Set();
 
289
 
290
+ }
291
+ );
292
+ })( jQuery );
admin/modules/cli-policy-generator/classes/class-policy-generator-ajax.php CHANGED
@@ -2,46 +2,40 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
- class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_Generator
6
- {
7
-
8
- public function __construct()
9
- {
10
- add_action('wp_ajax_cli_policy_generator',array($this,'ajax_policy_generator'));
11
  }
12
 
13
  /*
14
  *
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}();
36
  }
37
  }
38
- if(in_array($cli_policy_generator_action,$non_json_response))
39
- {
40
- echo is_array($out) ? $out['message'] : $out;
41
- }else
42
- {
43
- echo json_encode($out);
44
- }
45
  exit();
46
  }
47
 
@@ -50,20 +44,17 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
50
  * Get current policy page ID (Ajax-main)
51
  * This is used to update the hidden field for policy page id. (In some case user press back button)
52
  */
53
- public function get_policy_pageid()
54
- {
55
- $page_id=Cookie_Law_Info_Cli_Policy_Generator::get_cookie_policy_pageid();
56
- $policy_page_status=get_post_status($page_id);
57
- if($policy_page_status && $policy_page_status!='trash')
58
- {
59
 
60
- }else
61
- {
62
- $page_id=0;
63
  }
64
  return array(
65
- 'response'=>true,
66
- 'page_id'=>$page_id,
67
  );
68
  }
69
 
@@ -71,67 +62,77 @@ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_G
71
  * @since 1.7.4
72
  * Save current data (Ajax-main)
73
  */
74
- public function save_contentdata()
75
- {
76
- $out=array(
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',
87
- 'post_type'=>'page',
88
- 'post_content'=>Cookie_Law_Info_Cli_Policy_Generator::generate_page_content($enable_webtofee_powered_by,$content_data,0),
89
- 'post_status' => 'draft', //default is draft
90
  )
91
  );
92
- if(is_wp_error($id))
93
- {
94
- $out=array(
95
- 'response'=>false,
96
- 'er'=>__('Error','cookie-law-info'),
97
- //'er'=>$id->get_error_message(),
98
  );
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)
112
  */
113
- public function autosave_contant_data()
114
- {
115
- $out=array(
116
- 'response'=>true,
117
- 'er'=>''
118
  );
119
- $content_data = isset($_POST['content_data']) ? $_POST['content_data'] : array();
120
- $page_id= (int) sanitize_text_field( isset($_POST['page_id']) ? $_POST['page_id'] : '' );
121
- $enable_webtofee_powered_by=(int) isset($_POST['enable_webtofee_powered_by']) ? $_POST['enable_webtofee_powered_by'] : 0;
122
- if(is_array($content_data))
123
- {
124
- $content_html=Cookie_Law_Info_Cli_Policy_Generator::generate_page_content($enable_webtofee_powered_by,$content_data);
125
- update_option('cli_pg_content_data',$content_html);
126
- }else
127
- {
128
- $out=array(
129
- 'response'=>false,
130
- 'er'=>__('Error','cookie-law-info')
 
 
 
 
 
 
 
131
  );
132
  }
133
  return $out;
134
  }
135
-
136
  }
137
- new Cookie_Law_Info_Policy_Generator_Ajax();
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
+ class Cookie_Law_Info_Policy_Generator_Ajax extends Cookie_Law_Info_Cli_Policy_Generator {
6
+
7
+
8
+ public function __construct() {
9
+ add_action( 'wp_ajax_cli_policy_generator', array( $this, 'ajax_policy_generator' ) );
 
10
  }
11
 
12
  /*
13
  *
14
  * Main Ajax hook for processing requests
15
  */
16
+ public function ajax_policy_generator() {
17
+ check_ajax_referer( 'cli_policy_generator', 'security' );
18
+ if ( ! current_user_can( 'manage_options' ) ) {
19
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
 
 
20
  }
21
+ $out = array(
22
+ 'response' => false,
23
+ 'message' => __( 'Unable to handle your request.', 'cookie-law-info' ),
24
  );
25
+ $non_json_response = array();
26
+ if ( isset( $_POST['cli_policy_generator_action'] ) ) {
27
+ $allowed_actions = array( 'autosave_contant_data', 'save_contentdata', 'get_policy_pageid' );
28
+ $action = isset( $_POST['cli_policy_generator_action'] ) ? sanitize_text_field( wp_unslash( $_POST['cli_policy_generator_action'] ) ) : '';
29
+ $cli_policy_generator_action = in_array( $action, $allowed_actions ) ? $action : '';
30
+ if ( in_array( $cli_policy_generator_action, $allowed_actions ) && method_exists( $this, $cli_policy_generator_action ) ) {
31
+ $out = $this->{$cli_policy_generator_action}();
 
32
  }
33
  }
34
+ if ( in_array( $cli_policy_generator_action, $non_json_response ) ) {
35
+ echo esc_html( is_array( $out ) ? $out['message'] : $out );
36
+ } else {
37
+ echo json_encode( $out );
38
+ }
 
 
39
  exit();
40
  }
41
 
44
  * Get current policy page ID (Ajax-main)
45
  * This is used to update the hidden field for policy page id. (In some case user press back button)
46
  */
47
+ public function get_policy_pageid() {
48
+ $page_id = Cookie_Law_Info_Cli_Policy_Generator::get_cookie_policy_pageid();
49
+ $policy_page_status = get_post_status( $page_id );
50
+ if ( $policy_page_status && $policy_page_status != 'trash' ) {
 
 
51
 
52
+ } else {
53
+ $page_id = 0;
 
54
  }
55
  return array(
56
+ 'response' => true,
57
+ 'page_id' => $page_id,
58
  );
59
  }
60
 
62
  * @since 1.7.4
63
  * Save current data (Ajax-main)
64
  */
65
+ public function save_contentdata() {
66
+ check_ajax_referer( 'cli_policy_generator', 'security' );
67
+ $out = array(
68
+ 'response' => true,
69
+ 'er' => '',
70
  );
71
+ $content_data = array();
72
+ $count = isset( $_POST['content_data'] ) ? count( $_POST['content_data'] ) : 0;
73
+ for ( $i = 0; $i < $count; $i++ ) {
74
+ $data = array(
75
+ 'ord' => isset( $_POST['content_data'][ $i ]['ord'] ) ? absint( $_POST['content_data'][ $i ]['ord'] ) : 0,
76
+ 'hd' => isset( $_POST['content_data'][ $i ]['hd'] ) ? sanitize_text_field( wp_unslash( $_POST['content_data'][ $i ]['hd'] ) ) : '',
77
+ 'content' => isset( $_POST['content_data'][ $i ]['content'] ) ? wp_kses_post( wp_unslash( $_POST['content_data'][ $i ]['content'] ) ) : '',
78
+ );
79
+ $content_data[] = $data;
80
+ }
81
+ $page_id = isset( $_POST['page_id'] ) ? absint( $_POST['page_id'] ) : 0;
82
+ $enable_webtofee_powered_by = isset( $_POST['enable_webtofee_powered_by'] ) ? absint( $_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',
87
+ 'post_type' => 'page',
88
+ 'post_content' => Cookie_Law_Info_Cli_Policy_Generator::generate_page_content( $enable_webtofee_powered_by, $content_data, 0 ),
89
+ 'post_status' => 'draft', // default is draft
90
  )
91
  );
92
+ if ( is_wp_error( $id ) ) {
93
+ $out = array(
94
+ 'response' => false,
95
+ 'er' => __( 'Error', 'cookie-law-info' ),
 
 
96
  );
97
+ } else {
98
+ Cookie_Law_Info_Cli_Policy_Generator::set_cookie_policy_pageid( $id );
99
+ $out['url'] = get_edit_post_link( $id );
 
100
  }
101
  return $out;
102
  }
103
 
 
 
104
  /*
105
  * @since 1.7.4
106
  * Autosave Current content to session (Ajax-main)
107
  */
108
+ public function autosave_contant_data() {
109
+ check_ajax_referer( 'cli_policy_generator', 'security' );
110
+ $out = array(
111
+ 'response' => true,
112
+ 'er' => '',
113
  );
114
+ $content_data = array();
115
+ $count = isset( $_POST['content_data'] ) ? count( $_POST['content_data'] ) : 0;
116
+ for ( $i = 0; $i < $count; $i++ ) {
117
+ $data = array(
118
+ 'ord' => isset( $_POST['content_data'][ $i ]['ord'] ) ? absint( $_POST['content_data'][ $i ]['ord'] ) : 0,
119
+ 'hd' => isset( $_POST['content_data'][ $i ]['hd'] ) ? sanitize_text_field( wp_unslash( $_POST['content_data'][ $i ]['hd'] ) ) : '',
120
+ 'content' => isset( $_POST['content_data'][ $i ]['content'] ) ? wp_kses_post( wp_unslash( $_POST['content_data'][ $i ]['content'] ) ) : '',
121
+ );
122
+ $content_data[] = $data;
123
+ }
124
+ $page_id = isset( $_POST['page_id'] ) ? intval( $_POST['page_id'] ) : 0;
125
+ $enable_webtofee_powered_by = isset( $_POST['enable_webtofee_powered_by'] ) ? intval( $_POST['enable_webtofee_powered_by'] ) : 0;
126
+ if ( is_array( $content_data ) ) {
127
+ $content_html = Cookie_Law_Info_Cli_Policy_Generator::generate_page_content( $enable_webtofee_powered_by, $content_data );
128
+ update_option( 'cli_pg_content_data', $content_html );
129
+ } else {
130
+ $out = array(
131
+ 'response' => false,
132
+ 'er' => __( 'Error', 'cookie-law-info' ),
133
  );
134
  }
135
  return $out;
136
  }
 
137
  }
138
+ new Cookie_Law_Info_Policy_Generator_Ajax();
admin/modules/cli-policy-generator/classes/class-preview-page.php CHANGED
@@ -3,153 +3,147 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
  /**
6
- * Author: Scott Sherrill-Mix
7
- * URI: http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/
8
- * @since 1.7.4
9
- */
 
10
 
11
- class Cli_PreviewPage
12
- {
13
 
14
- public function __construct()
15
- {
16
- add_filter('the_posts',array($this,'preview_page'));
17
- }
18
 
19
- /**
20
- * Generating preview page data
21
- * @since 1.7.4
22
- */
23
- private static function get_preview_page()
24
- {
25
- $out=array();
26
- $out['cli-policy-preview'] = array(
27
- 'title' => __('Cookie Policy','cookie-law-info'),
28
- 'content' =>Cookie_Law_Info_Cli_Policy_Generator::get_page_content()
29
- );
30
- return $out;
31
- }
32
 
33
- /**
34
- *
35
- * @since 1.7.4
36
- * @param $posts
37
- * @return array|null
38
- */
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( isset( $wp->request ) ) {
 
50
 
51
- if(in_array(strtolower($wp->request),$preview_pages_slugs) ||
52
- (isset($wp->query_vars['page_id']) && in_array(strtolower($wp->query_vars['page_id']),$preview_pages_slugs)))
53
- {
54
- if(in_array(strtolower($wp->request),$preview_pages_slugs))
55
- {
56
- $preview_page=strtolower($wp->request);
57
- }else
58
- {
59
- $preview_page=strtolower($wp->query_vars['page_id']);
60
- }
61
 
62
- $posts = null;
63
- $posts[] = self::create_preview_page($preview_page,$preview_pages[$preview_page]);
64
- $wp_query->is_page = true;
65
- $wp_query->is_singular = true;
66
- $wp_query->is_home = false;
67
- $wp_query->is_archive = false;
68
- $wp_query->is_category = false;
69
- $wp_query->is_fake_page = true;
70
- $wp_query->preview_page = $wp->request;
71
- unset( $wp_query->query["error"] );
72
- $wp_query->query_vars["error"] = "";
73
- $wp_query->is_404 = false;
74
 
75
- add_action('admin_bar_menu',array($this,'add_admin_bar_menu'),100);
76
- add_action('wp_footer',array($this,'reg_preview_auto_btn'),100);
77
- }
78
- }
79
- return $posts;
80
- }
 
 
 
 
 
 
81
 
82
- public function add_admin_bar_menu($wp_admin_bar)
83
- {
84
- $wp_admin_bar->add_node(array(
85
- 'id' => 'cli_pg_live_preview',
86
- 'title' => '<span style="color:red;"><input type="checkbox" name="cli_pg_toggle_preview_autoreload" /> '.__('Auto reload preview','cookie-law-info').'</span>',
87
- ));
88
- }
89
- public function reg_preview_auto_btn()
90
- {
91
- ?>
92
- <script type="text/javascript">
93
- var cli_pg_autorealod_tmr=null;
94
- function cli_page_auto_reload()
95
- {
96
- if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
97
- {
98
- jQuery.get(window.location.href+'?rnd='+Math.random(), function(data) {
99
- var html=jQuery('<div />').html(data).find('.cli_pg_page_contaner').html();
100
- jQuery('.cli_pg_page_contaner').html(html);
101
- cli_pg_autorealod_tmr=setTimeout(function(){
102
- cli_page_auto_reload();
103
- },2000);
104
- });
105
- }
106
- }
107
- function cli_page_reg_auto_reload()
108
- {
109
- clearTimeout(cli_pg_autorealod_tmr);
110
- if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
111
- {
112
- cli_page_auto_reload();
113
- }
114
- }
115
- jQuery(document).ready(function(){
116
- jQuery('[name="cli_pg_toggle_preview_autoreload"]').click(function(){
117
- cli_page_reg_auto_reload();
118
- });
119
- if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
120
- {
121
- cli_page_reg_auto_reload();
122
- }
123
- });
124
- </script>
125
- <?php
126
- }
127
 
128
- /**
129
- * Creates virtual preview page
130
- *
131
- * @param $pagename
132
- * @param $page
133
- *
134
- * @return stdClass
135
- */
136
- private static function create_preview_page($pagename,$page)
137
- {
138
- $post = new stdClass;
139
- $post->post_author = 1;
140
- $post->post_name = $pagename;
141
- $post->guid = get_bloginfo('wpurl').'/'.$pagename;
142
- $post->post_title = $page['title'];
143
- $post->post_content = $page['content'];
144
- $post->ID = -1;
145
- $post->post_status = 'static';
146
- $post->comment_status = 'closed';
147
- $post->ping_status = 'closed';
148
- $post->comment_count = 0;
149
- $post->post_date = current_time('mysql');
150
- $post->post_date_gmt = current_time('mysql',1);
151
- $post->type = 'page';
152
- return $post;
153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
- new Cli_PreviewPage();
3
  exit;
4
  }
5
  /**
6
+ * Author: Scott Sherrill-Mix
7
+ * URI: http://scott.sherrillmix.com/blog/blogger/creating-a-better-fake-post-with-a-wordpress-plugin/
8
+ *
9
+ * @since 1.7.4
10
+ */
11
 
12
+ class Cli_PreviewPage {
 
13
 
 
 
 
 
14
 
15
+ public function __construct() {
16
+ add_filter( 'the_posts', array( $this, 'preview_page' ) );
17
+ }
 
 
 
 
 
 
 
 
 
 
18
 
19
+ /**
20
+ * Generating preview page data
21
+ *
22
+ * @since 1.7.4
23
+ */
24
+ private static function get_preview_page() {
25
+ $out = array();
26
+ $out['cli-policy-preview'] = array(
27
+ 'title' => __( 'Cookie Policy', 'cookie-law-info' ),
28
+ 'content' => Cookie_Law_Info_Cli_Policy_Generator::get_page_content(),
29
+ );
30
+ return $out;
31
+ }
32
 
33
+ /**
34
+ *
35
+ * @since 1.7.4
36
+ * @param $posts
37
+ * @return array|null
38
+ */
39
+ public function preview_page( $posts ) {
40
+ global $wp,$wp_query;
41
 
42
+ $preview_pages = self::get_preview_page();
43
+ $preview_pages_slugs = array();
44
+ foreach ( $preview_pages as $slug => $v ) {
45
+ $preview_pages_slugs[] = $slug;
46
+ }
47
+ if ( isset( $wp->request ) ) {
 
 
 
 
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
+ if ( in_array( strtolower( $wp->request ), $preview_pages_slugs ) ) {
52
+ $preview_page = strtolower( $wp->request );
53
+ } else {
54
+ $preview_page = strtolower( $wp->query_vars['page_id'] );
55
+ }
 
 
 
 
 
56
 
57
+ $posts = null;
58
+ $posts[] = self::create_preview_page( $preview_page, $preview_pages[ $preview_page ] );
59
+ $wp_query->is_page = true;
60
+ $wp_query->is_singular = true;
61
+ $wp_query->is_home = false;
62
+ $wp_query->is_archive = false;
63
+ $wp_query->is_category = false;
64
+ $wp_query->is_fake_page = true;
65
+ $wp_query->preview_page = $wp->request;
66
+ unset( $wp_query->query['error'] );
67
+ $wp_query->query_vars['error'] = '';
68
+ $wp_query->is_404 = false;
69
 
70
+ add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 100 );
71
+ add_action( 'wp_footer', array( $this, 'reg_preview_auto_btn' ), 100 );
72
+ }
73
+ }
74
+ return $posts;
75
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
+ public function add_admin_bar_menu( $wp_admin_bar ) {
78
+ $wp_admin_bar->add_node(
79
+ array(
80
+ 'id' => 'cli_pg_live_preview',
81
+ 'title' => '<span style="color:red;"><input type="checkbox" name="cli_pg_toggle_preview_autoreload" /> ' . __( 'Auto reload preview', 'cookie-law-info' ) . '</span>',
82
+ )
83
+ );
84
+ }
85
+ public function reg_preview_auto_btn() {
86
+ ?>
87
+ <script type="text/javascript">
88
+ var cli_pg_autorealod_tmr=null;
89
+ function cli_page_auto_reload()
90
+ {
91
+ if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
92
+ {
93
+ jQuery.get(window.location.href+'?rnd='+Math.random(), function(data) {
94
+ var html=jQuery('<div />').html(data).find('.cli_pg_page_contaner').html();
95
+ jQuery('.cli_pg_page_contaner').html(html);
96
+ cli_pg_autorealod_tmr=setTimeout(function(){
97
+ cli_page_auto_reload();
98
+ },2000);
99
+ });
100
+ }
101
+ }
102
+ function cli_page_reg_auto_reload()
103
+ {
104
+ clearTimeout(cli_pg_autorealod_tmr);
105
+ if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
106
+ {
107
+ cli_page_auto_reload();
108
+ }
109
+ }
110
+ jQuery(document).ready(function(){
111
+ jQuery('[name="cli_pg_toggle_preview_autoreload"]').click(function(){
112
+ cli_page_reg_auto_reload();
113
+ });
114
+ if(jQuery('[name="cli_pg_toggle_preview_autoreload"]').is(':checked'))
115
+ {
116
+ cli_page_reg_auto_reload();
117
+ }
118
+ });
119
+ </script>
120
+ <?php
121
+ }
122
+
123
+ /**
124
+ * Creates virtual preview page
125
+ *
126
+ * @param $pagename
127
+ * @param $page
128
+ *
129
+ * @return stdClass
130
+ */
131
+ private static function create_preview_page( $pagename, $page ) {
132
+ $post = new stdClass();
133
+ $post->post_author = 1;
134
+ $post->post_name = $pagename;
135
+ $post->guid = get_bloginfo( 'wpurl' ) . '/' . $pagename;
136
+ $post->post_title = $page['title'];
137
+ $post->post_content = $page['content'];
138
+ $post->ID = -1;
139
+ $post->post_status = 'static';
140
+ $post->comment_status = 'closed';
141
+ $post->ping_status = 'closed';
142
+ $post->comment_count = 0;
143
+ $post->post_date = current_time( 'mysql' );
144
+ $post->post_date_gmt = current_time( 'mysql', 1 );
145
+ $post->type = 'page';
146
+ return $post;
147
+ }
148
  }
149
+ new Cli_PreviewPage();
admin/modules/cli-policy-generator/cli-policy-generator.php CHANGED
@@ -4,20 +4,18 @@
4
  *
5
  * @link http://cookielawinfo.com/
6
  * @since 1.7.4
7
- *
8
  */
9
  if ( ! defined( 'ABSPATH' ) ) {
10
  exit;
11
  }
12
- include( plugin_dir_path( __FILE__ ).'classes/class-policy-generator-ajax.php');
13
- 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
- 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
  /**
@@ -25,72 +23,64 @@ class Cookie_Law_Info_Cli_Policy_Generator
25
  *
26
  * @since 1.7.4
27
  **/
28
- public function add_display_post_states($post_states,$post)
29
- {
30
- if($post->ID==$this->get_cookie_policy_pageid())
31
- {
32
- $post_states['page_for_cookie_policy']='Cookie Policy Page';
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
72
- * @return int
73
- */
74
- public static function get_cookie_policy_pageid()
75
- {
76
- $pageid=get_option(self::$policy_pageid);
77
- if($pageid===false)
78
- {
79
  return 0;
80
- }else
81
- {
82
  return $pageid;
83
  }
84
  }
85
 
86
  /**
87
- * Update policy page id
88
- * @since 1.7.4
89
- *
90
- */
91
- public static function set_cookie_policy_pageid($pageid)
92
- {
93
- update_option(self::$policy_pageid,$pageid);
94
  }
95
 
96
 
@@ -99,16 +89,15 @@ class Cookie_Law_Info_Cli_Policy_Generator
99
  *
100
  * @since 1.7.4
101
  **/
102
- public function add_admin_pages()
103
- {
104
- add_submenu_page(
105
- 'edit.php?post_type='.CLI_POST_TYPE,
106
- __('Policy generator','cookie-law-info'),
107
- __('Policy generator','cookie-law-info'),
108
  'manage_options',
109
  'cookie-law-info-policy-generator',
110
- array($this,'policy_generator_page')
111
- );
112
  }
113
 
114
  /*
@@ -117,26 +106,25 @@ class Cookie_Law_Info_Cli_Policy_Generator
117
  *
118
  * @since 1.7.4
119
  **/
120
- public function policy_generator_page()
121
- {
122
- add_editor_style(plugin_dir_url( __FILE__ ).'assets/css/editor-style.css');
123
- wp_enqueue_script('cli_policy_generator',plugin_dir_url( __FILE__ ).'assets/js/cli-policy-generator-admin.js', array( 'jquery'),CLI_VERSION,false);
124
- wp_enqueue_script($this->plugin_name);
125
  $params = array(
126
- 'nonces' => array(
127
- 'cli_policy_generator' => wp_create_nonce('cli_policy_generator'),
128
- ),
129
- 'ajax_url' => admin_url('admin-ajax.php'),
130
- 'page_id' =>'',
131
- 'labels'=>array(
132
- 'error'=>__('Error','cookie-law-info'),
133
- 'success'=>__('Success','cookie-law-info'),
134
- )
135
- );
136
- wp_localize_script('cli_policy_generator','cli_policy_generator',$params);
137
- $default_data=$this->process_default_data();
138
- $preview_url=home_url().'/cli-policy-preview/';
139
- include plugin_dir_path( __FILE__ ).'views/policy-generator.php';
140
  }
141
 
142
  /*
@@ -144,24 +132,20 @@ class Cookie_Law_Info_Cli_Policy_Generator
144
  * Process default data, read template file
145
  * @since 1.7.4
146
  **/
147
- private function process_default_data()
148
- {
149
- $data_path=plugin_dir_path( __FILE__ ).'data/';
150
- include $data_path.'data.policy-generator.php';
151
- $out=array();
152
- if($cli_pg_default_data)
153
- {
154
- foreach($cli_pg_default_data as $data)
155
- {
156
- $temp=$data;
157
- //reading template file
158
- if($data['body']=="" && $data['body_file']!="" && file_exists($data_path.$data['body_file']))
159
- {
160
  ob_start();
161
- include $data_path.$data['body_file'];
162
- $temp['body']=$this->process_data(ob_get_clean());
163
  }
164
- $out[]=$temp;
165
  }
166
  }
167
  return $out;
@@ -172,19 +156,21 @@ class Cookie_Law_Info_Cli_Policy_Generator
172
  * Process default data, read template file
173
  * @since 1.7.4
174
  **/
175
- private function process_data($txt)
176
- {
177
- $home_url=home_url();
178
- $home_domain=parse_url($home_url,PHP_URL_HOST);
179
- $txt=str_replace(array(
180
- '{{site_url}}'
181
- ),
182
- array(
183
- '<a href="'.$home_url.'">'.$home_domain.'</a>'
184
- ),$txt);
185
- //$txt=do_shortcode($txt);
 
 
186
  return $txt;
187
  }
188
  }
189
- $cli_pg=new Cookie_Law_Info_Cli_Policy_Generator();
190
- $cli_pg->plugin_name=$this->plugin_name;
4
  *
5
  * @link http://cookielawinfo.com/
6
  * @since 1.7.4
 
7
  */
8
  if ( ! defined( 'ABSPATH' ) ) {
9
  exit;
10
  }
11
+ require plugin_dir_path( __FILE__ ) . 'classes/class-policy-generator-ajax.php';
12
+ require plugin_dir_path( __FILE__ ) . 'classes/class-preview-page.php';
13
+ class Cookie_Law_Info_Cli_Policy_Generator {
14
+
15
+ public static $policy_pageid = 'cli_pg_policy_page_id';
16
+ public function __construct() {
17
+ add_action( 'admin_menu', array( $this, 'add_admin_pages' ) );
18
+ add_filter( 'display_post_states', array( $this, 'add_display_post_states' ), 10, 2 );
 
19
  }
20
 
21
  /**
23
  *
24
  * @since 1.7.4
25
  **/
26
+ public function add_display_post_states( $post_states, $post ) {
27
+ if ( $post->ID == $this->get_cookie_policy_pageid() ) {
28
+ $post_states['page_for_cookie_policy'] = 'Cookie Policy Page';
29
+ }
30
+ return $post_states;
 
 
31
  }
32
 
33
+ private static function gen_page_html( $content_data_arr = array(), $render_shortcode = 1 ) {
34
+ $html = '';
35
+ foreach ( $content_data_arr as $key => $value ) {
36
+ $html .= '<h3>' . $value['hd'] . '</h3>';
37
+ $post_content = ( isset( $value['content'] ) ? sanitize_textarea_field( $value['content'] ) : '' );
38
+ $html .= '<div>' . ( $render_shortcode == 1 ? do_shortcode( stripslashes( $post_content ) ) : stripslashes( $post_content ) ) . '</div>';
 
 
39
  }
40
  return $html;
41
  }
42
 
43
+ public static function get_page_content() {
44
+ $contant_val = get_option( 'cli_pg_content_data' );
45
+ $html = isset( $contant_val ) ? $contant_val : '';
 
46
  return $html;
47
  }
48
 
49
  /**
50
+ * Generating content for page from session/post
51
+ *
52
+ * @since 1.7.4
53
+ * @return string
54
+ */
55
+ public static function generate_page_content( $powered_by, $content_data_post_arr = array(), $render_shortcode = 1 ) {
56
+ $html = '<div class="cli_pg_page_contaner">';
57
+ $html .= self::gen_page_html( $content_data_post_arr, $render_shortcode );
58
+ $html .= ( $powered_by == 1 ? '[webtoffee_powered_by]' : '' ) . '</div>';
59
  return $html;
60
+ }
61
 
62
+ /**
63
+ * Get policy page id from option table
64
+ *
65
+ * @since 1.7.4
66
+ * @return int
67
+ */
68
+ public static function get_cookie_policy_pageid() {
69
+ $pageid = get_option( self::$policy_pageid );
70
+ if ( $pageid === false ) {
 
71
  return 0;
72
+ } else {
 
73
  return $pageid;
74
  }
75
  }
76
 
77
  /**
78
+ * Update policy page id
79
+ *
80
+ * @since 1.7.4
81
+ */
82
+ public static function set_cookie_policy_pageid( $pageid ) {
83
+ update_option( self::$policy_pageid, $pageid );
 
84
  }
85
 
86
 
89
  *
90
  * @since 1.7.4
91
  **/
92
+ public function add_admin_pages() {
93
+ add_submenu_page(
94
+ 'edit.php?post_type=' . CLI_POST_TYPE,
95
+ __( 'Policy generator', 'cookie-law-info' ),
96
+ __( 'Policy generator', 'cookie-law-info' ),
 
97
  'manage_options',
98
  'cookie-law-info-policy-generator',
99
+ array( $this, 'policy_generator_page' )
100
+ );
101
  }
102
 
103
  /*
106
  *
107
  * @since 1.7.4
108
  **/
109
+ public function policy_generator_page() {
110
+ add_editor_style( plugin_dir_url( __FILE__ ) . 'assets/css/editor-style.css' );
111
+ wp_enqueue_script( 'cli_policy_generator', plugin_dir_url( __FILE__ ) . 'assets/js/cli-policy-generator-admin.js', array( 'jquery' ), CLI_VERSION, false );
112
+ wp_enqueue_script( $this->plugin_name );
 
113
  $params = array(
114
+ 'nonces' => array(
115
+ 'cli_policy_generator' => wp_create_nonce( 'cli_policy_generator' ),
116
+ ),
117
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
118
+ 'page_id' => '',
119
+ 'labels' => array(
120
+ 'error' => __( 'Error', 'cookie-law-info' ),
121
+ 'success' => __( 'Success', 'cookie-law-info' ),
122
+ ),
123
+ );
124
+ wp_localize_script( 'cli_policy_generator', 'cli_policy_generator', $params );
125
+ $default_data = $this->process_default_data();
126
+ $preview_url = home_url() . '/cli-policy-preview/';
127
+ include plugin_dir_path( __FILE__ ) . 'views/policy-generator.php';
128
  }
129
 
130
  /*
132
  * Process default data, read template file
133
  * @since 1.7.4
134
  **/
135
+ private function process_default_data() {
136
+ $data_path = plugin_dir_path( __FILE__ ) . 'data/';
137
+ include $data_path . 'data.policy-generator.php';
138
+ $out = array();
139
+ if ( $cli_pg_default_data ) {
140
+ foreach ( $cli_pg_default_data as $data ) {
141
+ $temp = $data;
142
+ // reading template file
143
+ if ( $data['body'] == '' && $data['body_file'] != '' && file_exists( $data_path . $data['body_file'] ) ) {
 
 
 
 
144
  ob_start();
145
+ include $data_path . $data['body_file'];
146
+ $temp['body'] = $this->process_data( ob_get_clean() );
147
  }
148
+ $out[] = $temp;
149
  }
150
  }
151
  return $out;
156
  * Process default data, read template file
157
  * @since 1.7.4
158
  **/
159
+ private function process_data( $txt ) {
160
+ $home_url = home_url();
161
+ $home_domain = parse_url( $home_url, PHP_URL_HOST );
162
+ $txt = str_replace(
163
+ array(
164
+ '{{site_url}}',
165
+ ),
166
+ array(
167
+ '<a href="' . $home_url . '">' . $home_domain . '</a>',
168
+ ),
169
+ $txt
170
+ );
171
+ // $txt=do_shortcode($txt);
172
  return $txt;
173
  }
174
  }
175
+ $cli_pg = new Cookie_Law_Info_Cli_Policy_Generator();
176
+ $cli_pg->plugin_name = $this->plugin_name;
admin/modules/cli-policy-generator/data/data.block4.php CHANGED
@@ -5,7 +5,7 @@
5
  <p><span style="font-weight:bold;">Marketing:</span> Our website displays advertisements. These cookies are used to personalize the advertisements that we show to you so that they are meaningful to you. These cookies also help us keep track of the efficiency of these ad campaigns.</p>
6
  <p>The information stored in these cookies may also be used by the third-party ad providers to show you ads on other websites on the browser as well.</p>
7
 
8
- <p><span style="font-weight:bold;">Functional:</span> TThese are the cookies that help certain non-essential functionalities on our website. These functionalities include embedding content like videos or sharing content of the website on social media platforms.</p>
9
 
10
  <p><span style="font-weight:bold;">Preferences:</span> These cookies help us store your settings and browsing preferences like language preferences so that you have a better and efficient experience on future visits to the website.</p>
11
  [cookie_audit columns="cookie,description" heading="The below list details the cookies used in our website."]
5
  <p><span style="font-weight:bold;">Marketing:</span> Our website displays advertisements. These cookies are used to personalize the advertisements that we show to you so that they are meaningful to you. These cookies also help us keep track of the efficiency of these ad campaigns.</p>
6
  <p>The information stored in these cookies may also be used by the third-party ad providers to show you ads on other websites on the browser as well.</p>
7
 
8
+ <p><span style="font-weight:bold;">Functional:</span> These are the cookies that help certain non-essential functionalities on our website. These functionalities include embedding content like videos or sharing content of the website on social media platforms.</p>
9
 
10
  <p><span style="font-weight:bold;">Preferences:</span> These cookies help us store your settings and browsing preferences like language preferences so that you have a better and efficient experience on future visits to the website.</p>
11
  [cookie_audit columns="cookie,description" heading="The below list details the cookies used in our website."]
admin/modules/cli-policy-generator/data/data.policy-generator.php CHANGED
@@ -3,35 +3,35 @@
3
  * Default text for Privacy Generator
4
  *
5
  **/
6
- $cli_pg_default_data=array(
7
  array(
8
- 'head'=>"About this cookie policy",
9
- 'body'=>"",
10
- 'body_file'=>"data.block1.php",
11
- 'status'=>1,
12
  ),
13
  array(
14
- 'head'=>"What are cookies ?",
15
- 'body'=>"",
16
- 'body_file'=>"data.block2.php",
17
- 'status'=>1,
18
  ),
19
  array(
20
- 'head'=>"How do we use cookies ?",
21
- 'body'=>"",
22
- 'body_file'=>"data.block3.php",
23
- 'status'=>1,
24
  ),
25
  array(
26
- 'head'=>"What types of cookies do we use ?",
27
- 'body'=>"",
28
- 'body_file'=>"data.block4.php",
29
- 'status'=>1,
30
  ),
31
  array(
32
- 'head'=>"How can I control the cookie preferences ?",
33
- 'body'=>"",
34
- 'body_file'=>"data.block5.php",
35
- 'status'=>1,
36
  ),
37
- );
3
  * Default text for Privacy Generator
4
  *
5
  **/
6
+ $cli_pg_default_data = array(
7
  array(
8
+ 'head' => 'About this cookie policy',
9
+ 'body' => '',
10
+ 'body_file' => 'data.block1.php',
11
+ 'status' => 1,
12
  ),
13
  array(
14
+ 'head' => 'What are cookies ?',
15
+ 'body' => '',
16
+ 'body_file' => 'data.block2.php',
17
+ 'status' => 1,
18
  ),
19
  array(
20
+ 'head' => 'How do we use cookies ?',
21
+ 'body' => '',
22
+ 'body_file' => 'data.block3.php',
23
+ 'status' => 1,
24
  ),
25
  array(
26
+ 'head' => 'What types of cookies do we use ?',
27
+ 'body' => '',
28
+ 'body_file' => 'data.block4.php',
29
+ 'status' => 1,
30
  ),
31
  array(
32
+ 'head' => 'How can I control the cookie preferences ?',
33
+ 'body' => '',
34
+ 'body_file' => 'data.block5.php',
35
+ 'status' => 1,
36
  ),
37
+ );
admin/modules/cli-policy-generator/views/policy-generator.php CHANGED
@@ -18,27 +18,25 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  .cli_pg_content_hid, .cli_pg_samplehid_block{ display:none; }
19
  </style>
20
  <div class="wrap">
21
- <h1><?php _e('Policy generator', 'cookie-law-info'); ?></h1>
22
  <div class="cli_pg_samplehid_block">
23
  <div class="cli_pg_left_menu">
24
  <input type="checkbox" name="cli_pg_enabled_block_checkbox" checked="checked">
25
- <span class="cli_pg_content_hd"><?php _e('Sample heading','cookie-law-info'); ?></span>
26
- <div class="cli_pg_content_hid"><?php _e('Sample content','cookie-law-info'); ?></div>
27
- <span class="dashicons dashicons-trash cli_pg_content_delete" style="float:right;" title="<?php _e('Delete','cookie-law-info');?>"></span>
28
  </div>
29
  </div>
30
  <div class="cli_pg_main">
31
  <div class="cli_pg_left">
32
  <?php
33
- if(isset($default_data))
34
- {
35
- foreach($default_data as $data)
36
- {
37
  ?>
38
  <div class="cli_pg_left_menu">
39
  <input type="checkbox" name="cli_pg_enabled_block_checkbox" checked="checked">
40
- <span class="cli_pg_content_hd"><?php echo $data['head'];?></span>
41
- <div class="cli_pg_content_hid"><?php echo $data['body'];?></div>
42
  </div>
43
  <?php
44
  }
@@ -46,52 +44,58 @@ if ( ! defined( 'ABSPATH' ) ) {
46
  ?>
47
  <button class="cli_pg_addnew_hd_btn button-secondary">
48
  <span class="dashicons dashicons-plus" style="line-height:28px;"></span>
49
- <?php _e('Add new','cookie-law-info');?></button>
50
  </div>
51
  <div class="cli_pg_right">
52
  <div class="cli_pg_formrow">
53
- <label><?php _e('Heading','cookie-law-info');?></label>
54
  <input type="text" class="cli_pg_txt_field" name="cli_pg_hd_field">
55
  </div>
56
  <div class="cli_pg_formrow">
57
- <label><?php _e('Description','cookie-law-info');?></label>
58
  <?php
59
- wp_editor('','cli_pg_content',array('textarea_name'=>'cli_pg_content','editor_class'=>'cli_pg_txt_field','editor_height'=>250));
 
 
 
 
 
 
 
 
60
  ?>
61
  </div>
62
  </div>
63
  <div class="cli_pg_footer">
64
  <div style="float:right; width:75%;">
65
- <p><input type="checkbox" id="enable_webtofee_powered_by" name="enable_webtofee_powered_by"> <label for="enable_webtofee_powered_by"><?php _e('Enabling this option will help us spread the word by placing a credit to WebToffee at the very end of the Cookie Policy page.','cookie-law-info');?></label></p>
66
 
67
  <?php
68
- $policy_pageid=$this->get_cookie_policy_pageid();
69
- $update_exists_page_visibility='display:none;';
70
- if($policy_pageid)
71
- {
72
- $policy_page_status=get_post_status($policy_pageid);
73
- if($policy_page_status && $policy_page_status!='trash')
74
- {
75
- $update_exists_page_visibility='';
76
  }
77
  }
78
  ?>
79
 
80
- <a name="cli_pg_save_currentpage" style="<?php echo $update_exists_page_visibility;?>" class="button-primary cli_pg_main_buttons">
81
  <span class="dashicons dashicons-yes" style="line-height: 28px;"></span>
82
- <?php _e('Update existing Cookie Policy page','cookie-law-info');?>
83
  </a>
84
 
85
- <input type="hidden" name="cli_pg_policy_pageid" value="<?php echo $policy_pageid ? esc_attr( $policy_pageid ) : 0 ?>">
86
  <a name="cli_pg_save_newpage" class="button-primary cli_pg_main_buttons">
87
  <span class="dashicons dashicons-welcome-add-page" style="line-height: 28px;"></span>
88
- <?php _e('Create Cookie Policy page','cookie-law-info');?>
89
  </a>
90
  <a name="cli_pg_live_preview" class="button-secondary cli_pg_main_buttons" href="<?php echo esc_url( $preview_url ); ?>" target="_blank">
91
  <span class="dashicons dashicons-external" style="line-height: 28px;"></span>
92
- <?php _e('Live preview','cookie-law-info');?>
93
  </a>
94
  </div>
95
  </div>
96
  </div>
97
- </div>
18
  .cli_pg_content_hid, .cli_pg_samplehid_block{ display:none; }
19
  </style>
20
  <div class="wrap">
21
+ <h1><?php echo esc_html__( 'Policy generator', 'cookie-law-info' ); ?></h1>
22
  <div class="cli_pg_samplehid_block">
23
  <div class="cli_pg_left_menu">
24
  <input type="checkbox" name="cli_pg_enabled_block_checkbox" checked="checked">
25
+ <span class="cli_pg_content_hd"><?php echo esc_html__( 'Sample heading', 'cookie-law-info' ); ?></span>
26
+ <div class="cli_pg_content_hid"><?php echo esc_html__( 'Sample content', 'cookie-law-info' ); ?></div>
27
+ <span class="dashicons dashicons-trash cli_pg_content_delete" style="float:right;" title="<?php echo esc_html__( 'Delete', 'cookie-law-info' ); ?>"></span>
28
  </div>
29
  </div>
30
  <div class="cli_pg_main">
31
  <div class="cli_pg_left">
32
  <?php
33
+ if ( isset( $default_data ) ) {
34
+ foreach ( $default_data as $data ) {
 
 
35
  ?>
36
  <div class="cli_pg_left_menu">
37
  <input type="checkbox" name="cli_pg_enabled_block_checkbox" checked="checked">
38
+ <span class="cli_pg_content_hd"><?php echo esc_html( $data['head'] ); ?></span>
39
+ <div class="cli_pg_content_hid"><?php echo wp_kses_post( $data['body'] ); ?></div>
40
  </div>
41
  <?php
42
  }
44
  ?>
45
  <button class="cli_pg_addnew_hd_btn button-secondary">
46
  <span class="dashicons dashicons-plus" style="line-height:28px;"></span>
47
+ <?php echo esc_html__( 'Add new', 'cookie-law-info' ); ?></button>
48
  </div>
49
  <div class="cli_pg_right">
50
  <div class="cli_pg_formrow">
51
+ <label><?php echo esc_html__( 'Heading', 'cookie-law-info' ); ?></label>
52
  <input type="text" class="cli_pg_txt_field" name="cli_pg_hd_field">
53
  </div>
54
  <div class="cli_pg_formrow">
55
+ <label><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></label>
56
  <?php
57
+ wp_editor(
58
+ '',
59
+ 'cli_pg_content',
60
+ array(
61
+ 'textarea_name' => 'cli_pg_content',
62
+ 'editor_class' => 'cli_pg_txt_field',
63
+ 'editor_height' => 250,
64
+ )
65
+ );
66
  ?>
67
  </div>
68
  </div>
69
  <div class="cli_pg_footer">
70
  <div style="float:right; width:75%;">
71
+ <p><input type="checkbox" id="enable_webtofee_powered_by" name="enable_webtofee_powered_by"> <label for="enable_webtofee_powered_by"><?php echo esc_html__( 'Enabling this option will help us spread the word by placing a credit to WebToffee at the very end of the Cookie Policy page.', 'cookie-law-info' ); ?></label></p>
72
 
73
  <?php
74
+ $policy_pageid = $this->get_cookie_policy_pageid();
75
+ $update_exists_page_visibility = 'display:none;';
76
+ if ( $policy_pageid ) {
77
+ $policy_page_status = get_post_status( $policy_pageid );
78
+ if ( $policy_page_status && $policy_page_status != 'trash' ) {
79
+ $update_exists_page_visibility = '';
 
 
80
  }
81
  }
82
  ?>
83
 
84
+ <a name="cli_pg_save_currentpage" style="<?php echo esc_attr( $update_exists_page_visibility ); ?>" class="button-primary cli_pg_main_buttons">
85
  <span class="dashicons dashicons-yes" style="line-height: 28px;"></span>
86
+ <?php echo esc_html__( 'Update existing Cookie Policy page', 'cookie-law-info' ); ?>
87
  </a>
88
 
89
+ <input type="hidden" name="cli_pg_policy_pageid" value="<?php echo $policy_pageid ? esc_attr( $policy_pageid ) : 0; ?>">
90
  <a name="cli_pg_save_newpage" class="button-primary cli_pg_main_buttons">
91
  <span class="dashicons dashicons-welcome-add-page" style="line-height: 28px;"></span>
92
+ <?php echo esc_html__( 'Create Cookie Policy page', 'cookie-law-info' ); ?>
93
  </a>
94
  <a name="cli_pg_live_preview" class="button-secondary cli_pg_main_buttons" href="<?php echo esc_url( $preview_url ); ?>" target="_blank">
95
  <span class="dashicons dashicons-external" style="line-height: 28px;"></span>
96
+ <?php echo esc_html__( 'Live preview', 'cookie-law-info' ); ?>
97
  </a>
98
  </div>
99
  </div>
100
  </div>
101
+ </div>
admin/modules/cookie-scaner/assets/js/cookie-scaner.js CHANGED
@@ -1,420 +1,471 @@
1
  (function( $ ) {
2
  'use strict';
3
- $(function() {
4
- var CLI_cookie_scanner={
5
- continue_scan:1,
6
- abortingScan:0,
7
- onPrg:0,
8
- Set:function()
 
9
  {
10
- jQuery(document).on('click','#wt-cli-ckyes-scan', function(){
11
- CLI_cookie_scanner.continue_scan = 1;
12
- CLI_cookie_scanner.doScan();
13
- });
14
- jQuery(document).on('click','#wt-cli-ckyes-connect-scan', function(){
15
- CLI_cookie_scanner.continue_scan = 1;
16
- CLI_cookie_scanner.connectScan( jQuery(this));
17
- });
18
- jQuery(document).on('click', '#wt-cli-cookie-scan-abort', function( event ) {
19
- event.preventDefault();
20
- CLI_cookie_scanner.abortScan( jQuery(this) );
21
- });
22
- jQuery(document).on('click', '.wt-cli-cookie-scan-preview-modal', function( event ) {
23
- event.preventDefault();
24
- wtCliAdminFunctions.showModal('wt-cli-ckyes-modal-settings-preview');
25
- });
26
- this.reloadScanner();
27
- this.attachScanImport();
28
- this.checkScanStatus();
29
- },
30
- doScan:function()
31
- {
32
- CLI_cookie_scanner.nextScanID();
33
- },
34
- scanAgain:function()
 
 
 
 
 
 
 
 
 
 
 
 
35
  {
36
- $('.cli_scan_again').unbind('click').click(function(){
37
- CLI_cookie_scanner.continue_scan=1;
38
  CLI_cookie_scanner.nextScanID();
39
- });
40
- },
41
- scanNow:function()
42
- {
43
- this.takePages();
44
- },
45
- takePages:function()
46
  {
47
- var data = {
48
- action: 'cli_cookie_scaner',
49
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
50
- cli_scaner_action:'get_pages',
51
- };
52
- var scanbar=$('.wt-cli-cookie-scan-bar');
53
- scanbar.html('<span style="float:left; height:40px; line-height:40px;">'+cookielawinfo_cookie_scaner.labels.finding+'</span> <img src="'+cookielawinfo_cookie_scaner.loading_gif+'" style="display:inline-block;" />');
54
- $.ajax({
55
- url: cookielawinfo_cookie_scaner.ajax_url,
56
- data: data,
57
- dataType: 'json',
58
- type: 'POST',
59
- success: function (data)
60
- {
61
- CLI_cookie_scanner.scan_id = typeof data.scan_id!='undefined' ? data.scan_id : 0;
62
- if( true === data.status ) {
63
- CLI_cookie_scanner.bulkScan(data.scan_id,data.total);
64
  }
65
- else {
66
- wtCliAdminFunctions.createModal('',cookielawinfo_cookie_scaner.labels.page_fetch_error);
67
- CLI_cookie_scanner.reloadAfterRequest();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
- },
70
- error:function()
71
- {
72
- wtCliAdminFunctions.createModal('',cookielawinfo_cookie_scaner.labels.page_fetch_error);
73
- CLI_cookie_scanner.reloadAfterRequest();
74
- }
75
- });
76
- },
77
- attachScanImport: function (scan_id) {
78
- $('.cli_import').unbind('click').click(function () {
79
 
80
- var scan_id = $(this).attr('data-scan-id');
81
- var html = '<div id="wt-cli-cookie-scan-import" class="wt-cli-modal"><span class="wt-cli-modal-js-close">×</span>';
82
- html += '<div class="wt-cli-modal-header"><h2>'+cookielawinfo_cookie_scaner.labels.import_options+'</h2></div>';
83
- html += '<div class="wt-cli-modal-body">';
84
- html += '<input type="radio" name="cli_import_options" id="cli_import_options_replace" value="1" /><label for="cli_import_options_replace"> ' + cookielawinfo_cookie_scaner.labels.replace_old + '</label><br />';
85
- html += '<input type="radio" name="cli_import_options" id="cli_import_options_merge" value="2" checked /><label for="cli_import_options_merge"> ' + cookielawinfo_cookie_scaner.labels.merge + ' (' + cookielawinfo_cookie_scaner.labels.recommended + ')</label> <br />';
86
- html += '<input type="radio" name="cli_import_options" id="cli_import_options_append" value="3" /><label for="cli_import_options_append"> ' + cookielawinfo_cookie_scaner.labels.append + ' (' + cookielawinfo_cookie_scaner.labels.not_recommended + ')</label> <br /><br />';
87
- html += '<a class="button-secondary pull-left cli_import_cancel">' + cookielawinfo_cookie_scaner.labels.cancel + '</a>';
88
- html += '<a class="button-primary pull-left cli_import_now" data-scan-id="' + scan_id + '" style="margin-left:5px;">' + cookielawinfo_cookie_scaner.labels.start_import + '</a>';
89
- html += '</div>';
90
- html += '</div>';
91
-
92
- if ($('#wt-cli-cookie-scan-import').length === 0) {
93
- $('body').append(html);
94
- wtCliAdminFunctions.showModal('wt-cli-cookie-scan-import');
95
- $('.cli_import_cancel').click(function () {
96
- wtCliAdminFunctions.closeModal();
97
- });
98
- $('.cli_import_now').click(function () {
99
- wtCliAdminFunctions.loadSpinner( jQuery( this ));
100
- var import_option = $('[name="cli_import_options"]:checked').val();
101
- var scan_id = $(this).attr('data-scan-id');
102
- CLI_cookie_scanner.importNow(scan_id, import_option);
103
- });
104
- } else {
105
- wtCliAdminFunctions.showModal('wt-cli-cookie-scan-import' );
106
- }
107
- });
108
 
109
- },
110
- importNow:function(scan_id,import_option)
111
- {
112
- if(this.onPrg==1)
113
- {
114
- return false;
115
- }
116
- var data = {
117
- action: 'cli_cookie_scaner',
118
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
119
- cli_scaner_action:'import_now',
120
- scan_id:scan_id,
121
- import_option:import_option
122
- };
123
- $('.wrap a').css({'opacity':.5});
124
- $('.cli_import').html(cookielawinfo_cookie_scaner.labels.importing);
125
- $('.cli_progress_action_main').html(cookielawinfo_cookie_scaner.labels.importing);
126
- $('.spinner').css({'visibility':'visible'});
127
- this.onPrg=1;
128
- $.ajax({
129
- url:cookielawinfo_cookie_scaner.ajax_url,
130
- data:data,
131
- dataType:'json',
132
- type:'POST',
133
- success:function(data)
134
- {
135
- CLI_cookie_scanner.onPrg=0;
136
- $('.wrap a').css({'opacity':1});
137
- $('.cli_import').html(cookielawinfo_cookie_scaner.labels.import);
138
- $('.cli_progress_action_main').html(cookielawinfo_cookie_scaner.labels.import_finished);
139
- $('.spinner').css({'visibility':'hidden'});
140
- wtCliAdminFunctions.closeModal();
141
 
142
- if(data.response===true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  {
144
- cli_notify_msg.success(data.message);
145
- }else
 
 
 
 
 
 
 
 
 
 
 
 
146
  {
147
- cli_notify_msg.error(data.message);
 
 
 
 
 
 
148
  }
149
- },
150
- error:function()
151
- {
152
- CLI_cookie_scanner.onPrg=0;
153
- $('.wrap a').css({'opacity':1});
154
- $('.cli_import').html(cookielawinfo_cookie_scaner.labels.import);
155
- $('.cli_progress_action_main').html(cookielawinfo_cookie_scaner.labels.error);
156
- $('.spinner').css({'visibility':'hidden'});
157
- cli_notify_msg.error(cookielawinfo_cookie_scaner.labels.error);
158
- }
159
- });
160
- },
161
- connectScan: function( element ){
162
 
163
- var data = {
164
- action: 'cli_cookie_scaner',
165
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
166
- cli_scaner_action:'connect_scan',
167
- };
168
- wtCliAdminFunctions.loadSpinner(element);
169
- $.ajax({
170
- url: cookielawinfo_cookie_scaner.ajax_url,
171
- data: data,
172
- dataType: 'json',
173
- type: 'POST',
174
- success:function( response )
175
- {
176
- wtCliAdminFunctions.removeSpinner(element);
177
- var data = response.data;
178
- if( response.success === true ) {
179
- CLI_cookie_scanner.doScan();
180
- } else {
181
- if( data.code ) {
182
- if( data.code == 102 || data.code == 107 ) {
183
- if( data.html ) {
184
- wtCliAdminFunctions.createModal('',data.html);
185
- }
186
- }else if ( data.code == 108 ) {
 
187
 
188
- wtCliAdminFunctions.showModal('wt-cli-ckyes-modal-register');
189
 
190
- } else {
191
- if( data.message ){
192
- wtCliAdminFunctions.createModal('',data.message);
193
- setTimeout(function(){
194
- window.location.reload();
195
- },1500);
 
 
 
 
 
196
  }
197
  }
 
 
 
 
198
  }
199
  }
200
- },
201
- error:function()
202
- {
203
- wtCliAdminFunctions.createModal('','Invalid request');
204
- }
205
- });
206
- },
207
- nextScanID: function(){
208
- var data = {
209
- action: 'cli_cookie_scaner',
210
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
211
- cli_scaner_action:'next_scan_id',
212
- };
213
- var scanBtn = jQuery('#wt-cli-ckyes-scan');
214
- wtCliAdminFunctions.loadSpinner( scanBtn );
215
- $.ajax({
216
- url: cookielawinfo_cookie_scaner.ajax_url,
217
- data: data,
218
- dataType: 'json',
219
- type: 'POST',
220
- success:function( response )
221
- {
222
- var data = response.data;
223
- wtCliAdminFunctions.removeSpinner( scanBtn );
224
- if( response.success === true ) {
225
- CLI_cookie_scanner.scanNow();
226
- } else if( data.code == 107 ){
227
-
228
- if( data.html ) {
229
- wtCliAdminFunctions.createModal('',data.html);
230
- }
231
- } else {
232
- if( data.message ) {
233
- wtCliAdminFunctions.createModal('',data.message);
234
- CLI_cookie_scanner.reloadAfterRequest();
235
- }
236
- }
237
- },
238
- error:function()
239
- {
240
- wtCliAdminFunctions.createModal('','Invalid request');
241
- wtCliAdminFunctions.removeSpinner( scanBtn );
242
- }
243
- });
244
- },
245
- reloadAfterRequest: function( duration ) {
246
- var timeout = 2000;
247
- if (typeof duration !== 'undefined') {
248
- timeout = duration;
249
- }
250
- setTimeout(function(){
251
- window.location.reload();
252
- },timeout);
253
- },
254
- bulkScan: function(scan_id,total) {
255
 
256
- var data = {
257
- action: 'cli_cookie_scaner',
258
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
259
- cli_scaner_action:'bulk_scan',
260
- scan_id:scan_id,
261
- total:total
262
- };
263
- $.ajax({
264
- url: cookielawinfo_cookie_scaner.ajax_url,
265
- data: data,
266
- dataType: 'json',
267
- type: 'POST',
268
- success:function(response)
269
- {
270
- var data = response.data;
271
- if( response.success === true ) {
272
- wtCliAdminFunctions.createModal(data.title,data.message);
273
- if( data.html ) {
274
- jQuery('.wt-cli-cookie-scan-bar').html(data.html);
275
- }
276
- } else {
277
- if( data.message ) {
278
- wtCliAdminFunctions.createModal('',data.message);
279
- CLI_cookie_scanner.reloadAfterRequest( 3000 );
280
  }
281
  }
282
- },
283
- error:function()
284
- {
285
- wtCliAdminFunctions.createModal('',data.message);
286
- CLI_cookie_scanner.reloadAfterRequest( 6000 );
287
- }
288
- });
289
- },
290
- checkScanStatus: function(){
291
- var scanStatus = Boolean( cookielawinfo_cookie_scaner.scan_status );
292
- if( scanStatus === true ) {
 
 
 
 
293
 
294
  var data = {
295
  action: 'cli_cookie_scaner',
296
  security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
297
- cli_scaner_action:'check_status',
 
 
298
  };
299
- $.ajax({
300
- url: cookielawinfo_cookie_scaner.ajax_url,
301
- data: data,
302
- dataType: 'json',
303
- type: 'POST',
304
- success:function(response)
305
- {
306
-
307
- if( response.success === true ) {
308
- CLI_cookie_scanner.fetchResult();
309
- } else {
310
- if( response.data.refresh === true ) {
311
- CLI_cookie_scanner.reloadAfterRequest(10);
 
 
 
 
 
 
312
  }
313
- }
314
-
315
- },
316
- error:function()
317
  {
 
 
 
318
  }
319
- });
320
- }
321
-
322
- },
323
- fetchResult: function(){
324
- var data = {
325
- action: 'cli_cookie_scaner',
326
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
327
- cli_scaner_action:'fetch_result',
328
- };
329
- $.ajax({
330
- url: cookielawinfo_cookie_scaner.ajax_url,
331
- data: data,
332
- dataType: 'json',
333
- type: 'POST',
334
- success:function(response)
335
- {
336
- if( response.success === true ) {
337
- CLI_cookie_scanner.reloadAfterRequest(10);
338
- }
339
- },
340
- error:function()
341
- {
342
-
343
- }
344
- });
345
- },
346
- abortScan: function( element ){
347
-
348
- if( CLI_cookie_scanner.abortingScan === 1 ) {
349
- return false;
350
- }
351
- var scanner = jQuery('.wt-cli-scan-status-bar');
352
- scanner.html( cookielawinfo_cookie_scaner.labels.abort );
353
- scanner.css({'color':'#444444'});
354
- wtCliAdminFunctions.loadSpinner(scanner);
355
- CLI_cookie_scanner.abortingScan = 1;
356
- var data = {
357
- action: 'cli_cookie_scaner',
358
- security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
359
- cli_scaner_action:'stop_scan',
360
- };
361
- $.ajax({
362
- url: cookielawinfo_cookie_scaner.ajax_url,
363
- data: data,
364
- dataType: 'json',
365
- type: 'POST',
366
- success:function(response)
367
- {
368
- if( response.success === true ) {
369
- scanner.css({'color':'#2fab10'});
370
- } else {
371
- scanner.css({'color':'#f44336'});
372
- }
373
- if( response.data.message ) {
374
- scanner.html( response.data.message );
375
- }
376
- CLI_cookie_scanner.reloadAfterRequest();
377
-
378
- },
379
- error:function()
380
- {
381
- wtCliAdminFunctions.createModal('', cookielawinfo_cookie_scaner.labels.abort_failed );
382
- CLI_cookie_scanner.reloadAfterRequest();
383
  }
384
- });
385
- },
386
- reloadScanner: function(){
387
- $( document ).on( "trggerReloadScanner", function(){
388
  var data = {
389
  action: 'cli_cookie_scaner',
390
  security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
391
- cli_scaner_action:'get_scan_html',
392
  };
393
- $.ajax({
394
- url: cookielawinfo_cookie_scaner.ajax_url,
395
- data: data,
396
- dataType: 'json',
397
- type: 'POST',
398
- success:function( response )
399
- {
400
- var data = response.data;
401
- if( response.success === true ) {
402
- if( data.scan_html ) {
403
- $('.wt-cli-cookie-scan-notice').html(data.scan_html);
404
- }
 
 
 
405
  }
406
- },
407
- error:function()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  {
409
-
 
 
410
  }
411
- });
412
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  }
 
 
 
 
 
 
414
  }
415
-
416
- jQuery(document).ready( function(){
417
- CLI_cookie_scanner.Set();
418
- });
419
- });
420
- })( jQuery );
1
  (function( $ ) {
2
  'use strict';
3
+ $(
4
+ function() {
5
+ var CLI_cookie_scanner = {
6
+ continue_scan:1,
7
+ abortingScan:0,
8
+ onPrg:0,
9
+ Set:function()
10
  {
11
+ jQuery( document ).on(
12
+ 'click',
13
+ '#wt-cli-ckyes-scan',
14
+ function(){
15
+ CLI_cookie_scanner.continue_scan = 1;
16
+ CLI_cookie_scanner.doScan();
17
+ }
18
+ );
19
+ jQuery( document ).on(
20
+ 'click',
21
+ '#wt-cli-ckyes-connect-scan',
22
+ function(){
23
+ CLI_cookie_scanner.continue_scan = 1;
24
+ CLI_cookie_scanner.connectScan( jQuery( this ) );
25
+ }
26
+ );
27
+ jQuery( document ).on(
28
+ 'click',
29
+ '#wt-cli-cookie-scan-abort',
30
+ function( event ) {
31
+ event.preventDefault();
32
+ CLI_cookie_scanner.abortScan( jQuery( this ) );
33
+ }
34
+ );
35
+ jQuery( document ).on(
36
+ 'click',
37
+ '.wt-cli-cookie-scan-preview-modal',
38
+ function( event ) {
39
+ event.preventDefault();
40
+ wtCliAdminFunctions.showModal( 'wt-cli-ckyes-modal-settings-preview' );
41
+ }
42
+ );
43
+ this.reloadScanner();
44
+ this.attachScanImport();
45
+ this.checkScanStatus();
46
+ },
47
+ doScan:function()
48
  {
 
 
49
  CLI_cookie_scanner.nextScanID();
50
+ },
51
+ scanAgain:function()
 
 
 
 
 
52
  {
53
+ $( '.cli_scan_again' ).unbind( 'click' ).click(
54
+ function(){
55
+ CLI_cookie_scanner.continue_scan = 1;
56
+ CLI_cookie_scanner.nextScanID();
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
+ );
59
+ },
60
+ scanNow:function()
61
+ {
62
+ this.takePages();
63
+ },
64
+ takePages:function()
65
+ {
66
+ var data = {
67
+ action: 'cli_cookie_scaner',
68
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
69
+ cli_scaner_action:'get_pages',
70
+ };
71
+ var scanbar = $( '.wt-cli-cookie-scan-bar' );
72
+ scanbar.html( '<span style="float:left; height:40px; line-height:40px;">' + cookielawinfo_cookie_scaner.labels.finding + '</span> <img src="' + cookielawinfo_cookie_scaner.loading_gif + '" style="display:inline-block;" />' );
73
+ $.ajax(
74
+ {
75
+ url: cookielawinfo_cookie_scaner.ajax_url,
76
+ data: data,
77
+ dataType: 'json',
78
+ type: 'POST',
79
+ success: function (data)
80
+ {
81
+ CLI_cookie_scanner.scan_id = typeof data.scan_id != 'undefined' ? data.scan_id : 0;
82
+ if ( true === data.status ) {
83
+ CLI_cookie_scanner.bulkScan( data.scan_id,data.total );
84
+ } else {
85
+ wtCliAdminFunctions.createModal( '',cookielawinfo_cookie_scaner.labels.page_fetch_error );
86
+ CLI_cookie_scanner.reloadAfterRequest();
87
+ }
88
+ },
89
+ error:function()
90
+ {
91
+ wtCliAdminFunctions.createModal( '',cookielawinfo_cookie_scaner.labels.page_fetch_error );
92
+ CLI_cookie_scanner.reloadAfterRequest();
93
+ }
94
  }
95
+ );
96
+ },
97
+ attachScanImport: function (scan_id) {
98
+ $( '.cli_import' ).unbind( 'click' ).click(
99
+ function () {
 
 
 
 
 
100
 
101
+ var scan_id = $( this ).attr( 'data-scan-id' );
102
+ var html = '<div id="wt-cli-cookie-scan-import" class="wt-cli-modal"><span class="wt-cli-modal-js-close">×</span>';
103
+ html += '<div class="wt-cli-modal-header"><h2>' + cookielawinfo_cookie_scaner.labels.import_options + '</h2></div>';
104
+ html += '<div class="wt-cli-modal-body">';
105
+ html += '<input type="radio" name="cli_import_options" id="cli_import_options_replace" value="1" /><label for="cli_import_options_replace"> ' + cookielawinfo_cookie_scaner.labels.replace_old + '</label><br />';
106
+ html += '<input type="radio" name="cli_import_options" id="cli_import_options_merge" value="2" checked /><label for="cli_import_options_merge"> ' + cookielawinfo_cookie_scaner.labels.merge + ' (' + cookielawinfo_cookie_scaner.labels.recommended + ')</label> <br />';
107
+ html += '<input type="radio" name="cli_import_options" id="cli_import_options_append" value="3" /><label for="cli_import_options_append"> ' + cookielawinfo_cookie_scaner.labels.append + ' (' + cookielawinfo_cookie_scaner.labels.not_recommended + ')</label> <br /><br />';
108
+ html += '<a class="button-secondary pull-left cli_import_cancel">' + cookielawinfo_cookie_scaner.labels.cancel + '</a>';
109
+ html += '<a class="button-primary pull-left cli_import_now" data-scan-id="' + scan_id + '" style="margin-left:5px;">' + cookielawinfo_cookie_scaner.labels.start_import + '</a>';
110
+ html += '</div>';
111
+ html += '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ if ($( '#wt-cli-cookie-scan-import' ).length === 0) {
114
+ $( 'body' ).append( html );
115
+ wtCliAdminFunctions.showModal( 'wt-cli-cookie-scan-import' );
116
+ $( '.cli_import_cancel' ).click(
117
+ function () {
118
+ wtCliAdminFunctions.closeModal();
119
+ }
120
+ );
121
+ $( '.cli_import_now' ).click(
122
+ function () {
123
+ wtCliAdminFunctions.loadSpinner( jQuery( this ) );
124
+ var import_option = $( '[name="cli_import_options"]:checked' ).val();
125
+ var scan_id = $( this ).attr( 'data-scan-id' );
126
+ CLI_cookie_scanner.importNow( scan_id, import_option );
127
+ }
128
+ );
129
+ } else {
130
+ wtCliAdminFunctions.showModal( 'wt-cli-cookie-scan-import' );
131
+ }
132
+ }
133
+ );
 
 
 
 
 
 
 
 
 
 
 
134
 
135
+ },
136
+ importNow:function(scan_id,import_option)
137
+ {
138
+ if (this.onPrg == 1) {
139
+ return false;
140
+ }
141
+ var data = {
142
+ action: 'cli_cookie_scaner',
143
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
144
+ cli_scaner_action:'import_now',
145
+ scan_id:scan_id,
146
+ import_option:import_option
147
+ };
148
+ $( '.wrap a' ).css( {'opacity':.5} );
149
+ $( '.cli_import' ).html( cookielawinfo_cookie_scaner.labels.importing );
150
+ $( '.cli_progress_action_main' ).html( cookielawinfo_cookie_scaner.labels.importing );
151
+ $( '.spinner' ).css( {'visibility':'visible'} );
152
+ this.onPrg = 1;
153
+ $.ajax(
154
+ {
155
+ url:cookielawinfo_cookie_scaner.ajax_url,
156
+ data:data,
157
+ dataType:'json',
158
+ type:'POST',
159
+ success:function(data)
160
  {
161
+ CLI_cookie_scanner.onPrg = 0;
162
+ $( '.wrap a' ).css( {'opacity':1} );
163
+ $( '.cli_import' ).html( cookielawinfo_cookie_scaner.labels.import );
164
+ $( '.cli_progress_action_main' ).html( cookielawinfo_cookie_scaner.labels.import_finished );
165
+ $( '.spinner' ).css( {'visibility':'hidden'} );
166
+ wtCliAdminFunctions.closeModal();
167
+
168
+ if (data.response === true) {
169
+ cli_notify_msg.success( data.message );
170
+ } else {
171
+ cli_notify_msg.error( data.message );
172
+ }
173
+ },
174
+ error:function()
175
  {
176
+ CLI_cookie_scanner.onPrg = 0;
177
+ $( '.wrap a' ).css( {'opacity':1} );
178
+ $( '.cli_import' ).html( cookielawinfo_cookie_scaner.labels.import );
179
+ $( '.cli_progress_action_main' ).html( cookielawinfo_cookie_scaner.labels.error );
180
+ $( '.spinner' ).css( {'visibility':'hidden'} );
181
+ cli_notify_msg.error( cookielawinfo_cookie_scaner.labels.error );
182
+ }
183
  }
184
+ );
185
+ },
186
+ connectScan: function( element ){
 
 
 
 
 
 
 
 
 
 
187
 
188
+ var data = {
189
+ action: 'cli_cookie_scaner',
190
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
191
+ cli_scaner_action:'connect_scan',
192
+ };
193
+ wtCliAdminFunctions.loadSpinner( element );
194
+ $.ajax(
195
+ {
196
+ url: cookielawinfo_cookie_scaner.ajax_url,
197
+ data: data,
198
+ dataType: 'json',
199
+ type: 'POST',
200
+ success:function( response )
201
+ {
202
+ wtCliAdminFunctions.removeSpinner( element );
203
+ var data = response.data;
204
+ if ( response.success === true ) {
205
+ CLI_cookie_scanner.doScan();
206
+ } else {
207
+ if ( data.code ) {
208
+ if ( data.code == 102 || data.code == 107 ) {
209
+ if ( data.html ) {
210
+ wtCliAdminFunctions.createModal( '',data.html );
211
+ }
212
+ } else if ( data.code == 108 ) {
213
 
214
+ wtCliAdminFunctions.showModal( 'wt-cli-ckyes-modal-register' );
215
 
216
+ } else {
217
+ if ( data.message ) {
218
+ wtCliAdminFunctions.createModal( '',data.message );
219
+ setTimeout(
220
+ function(){
221
+ window.location.reload();
222
+ },
223
+ 1500
224
+ );
225
+ }
226
+ }
227
  }
228
  }
229
+ },
230
+ error:function()
231
+ {
232
+ wtCliAdminFunctions.createModal( '','Invalid request' );
233
  }
234
  }
235
+ );
236
+ },
237
+ nextScanID: function(){
238
+ var data = {
239
+ action: 'cli_cookie_scaner',
240
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
241
+ cli_scaner_action:'next_scan_id',
242
+ };
243
+ var scanBtn = jQuery( '#wt-cli-ckyes-scan' );
244
+ wtCliAdminFunctions.loadSpinner( scanBtn );
245
+ $.ajax(
246
+ {
247
+ url: cookielawinfo_cookie_scaner.ajax_url,
248
+ data: data,
249
+ dataType: 'json',
250
+ type: 'POST',
251
+ success:function( response )
252
+ {
253
+ var data = response.data;
254
+ wtCliAdminFunctions.removeSpinner( scanBtn );
255
+ if ( response.success === true ) {
256
+ CLI_cookie_scanner.scanNow();
257
+ } else if ( data.code == 107 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
+ if ( data.html ) {
260
+ wtCliAdminFunctions.createModal( '',data.html );
261
+ }
262
+ } else {
263
+ if ( data.message ) {
264
+ wtCliAdminFunctions.createModal( '',data.message );
265
+ CLI_cookie_scanner.reloadAfterRequest();
266
+ }
267
+ }
268
+ },
269
+ error:function()
270
+ {
271
+ wtCliAdminFunctions.createModal( '','Invalid request' );
272
+ wtCliAdminFunctions.removeSpinner( scanBtn );
 
 
 
 
 
 
 
 
 
 
273
  }
274
  }
275
+ );
276
+ },
277
+ reloadAfterRequest: function( duration ) {
278
+ var timeout = 2000;
279
+ if (typeof duration !== 'undefined') {
280
+ timeout = duration;
281
+ }
282
+ setTimeout(
283
+ function(){
284
+ window.location.reload();
285
+ },
286
+ timeout
287
+ );
288
+ },
289
+ bulkScan: function(scan_id,total) {
290
 
291
  var data = {
292
  action: 'cli_cookie_scaner',
293
  security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
294
+ cli_scaner_action:'bulk_scan',
295
+ scan_id:scan_id,
296
+ total:total
297
  };
298
+ $.ajax(
299
+ {
300
+ url: cookielawinfo_cookie_scaner.ajax_url,
301
+ data: data,
302
+ dataType: 'json',
303
+ type: 'POST',
304
+ success:function(response)
305
+ {
306
+ var data = response.data;
307
+ if ( response.success === true ) {
308
+ wtCliAdminFunctions.createModal( data.title,data.message );
309
+ if ( data.html ) {
310
+ jQuery( '.wt-cli-cookie-scan-bar' ).html( data.html );
311
+ }
312
+ } else {
313
+ if ( data.message ) {
314
+ wtCliAdminFunctions.createModal( '',data.message );
315
+ CLI_cookie_scanner.reloadAfterRequest( 3000 );
316
+ }
317
  }
318
+ },
319
+ error:function()
 
 
320
  {
321
+ wtCliAdminFunctions.createModal( '',data.message );
322
+ CLI_cookie_scanner.reloadAfterRequest( 6000 );
323
+ }
324
  }
325
+ );
326
+ },
327
+ checkScanStatus: function(){
328
+ var scanStatus = Boolean( cookielawinfo_cookie_scaner.scan_status );
329
+ if ( scanStatus === true ) {
330
+
331
+ var data = {
332
+ action: 'cli_cookie_scaner',
333
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
334
+ cli_scaner_action:'check_status',
335
+ };
336
+ $.ajax(
337
+ {
338
+ url: cookielawinfo_cookie_scaner.ajax_url,
339
+ data: data,
340
+ dataType: 'json',
341
+ type: 'POST',
342
+ success:function(response)
343
+ {
344
+
345
+ if ( response.success === true ) {
346
+ CLI_cookie_scanner.fetchResult();
347
+ } else {
348
+ if ( response.data.refresh === true ) {
349
+ CLI_cookie_scanner.reloadAfterRequest( 10 );
350
+ }
351
+ }
352
+
353
+ },
354
+ error:function()
355
+ {
356
+ }
357
+ }
358
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  }
360
+
361
+ },
362
+ fetchResult: function(){
 
363
  var data = {
364
  action: 'cli_cookie_scaner',
365
  security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
366
+ cli_scaner_action:'fetch_result',
367
  };
368
+ $.ajax(
369
+ {
370
+ url: cookielawinfo_cookie_scaner.ajax_url,
371
+ data: data,
372
+ dataType: 'json',
373
+ type: 'POST',
374
+ success:function(response)
375
+ {
376
+ if ( response.success === true ) {
377
+ CLI_cookie_scanner.reloadAfterRequest( 10 );
378
+ }
379
+ },
380
+ error:function()
381
+ {
382
+
383
  }
384
+ }
385
+ );
386
+ },
387
+ abortScan: function( element ){
388
+
389
+ if ( CLI_cookie_scanner.abortingScan === 1 ) {
390
+ return false;
391
+ }
392
+ var scanner = jQuery( '.wt-cli-scan-status-bar' );
393
+ scanner.html( cookielawinfo_cookie_scaner.labels.abort );
394
+ scanner.css( {'color':'#444444'} );
395
+ wtCliAdminFunctions.loadSpinner( scanner );
396
+ CLI_cookie_scanner.abortingScan = 1;
397
+ var data = {
398
+ action: 'cli_cookie_scaner',
399
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
400
+ cli_scaner_action:'stop_scan',
401
+ };
402
+ $.ajax(
403
+ {
404
+ url: cookielawinfo_cookie_scaner.ajax_url,
405
+ data: data,
406
+ dataType: 'json',
407
+ type: 'POST',
408
+ success:function(response)
409
+ {
410
+ if ( response.success === true ) {
411
+ scanner.css( {'color':'#2fab10'} );
412
+ } else {
413
+ scanner.css( {'color':'#f44336'} );
414
+ }
415
+ if ( response.data.message ) {
416
+ scanner.html( response.data.message );
417
+ }
418
+ CLI_cookie_scanner.reloadAfterRequest();
419
+
420
+ },
421
+ error:function()
422
  {
423
+ wtCliAdminFunctions.createModal( '', cookielawinfo_cookie_scaner.labels.abort_failed );
424
+ CLI_cookie_scanner.reloadAfterRequest();
425
+ }
426
  }
427
+ );
428
+ },
429
+ reloadScanner: function(){
430
+ $( document ).on(
431
+ "trggerReloadScanner",
432
+ function(){
433
+ var data = {
434
+ action: 'cli_cookie_scaner',
435
+ security: cookielawinfo_cookie_scaner.nonces.cli_cookie_scaner,
436
+ cli_scaner_action:'get_scan_html',
437
+ };
438
+ $.ajax(
439
+ {
440
+ url: cookielawinfo_cookie_scaner.ajax_url,
441
+ data: data,
442
+ dataType: 'json',
443
+ type: 'POST',
444
+ success:function( response )
445
+ {
446
+ var data = response.data;
447
+ if ( response.success === true ) {
448
+ if ( data.scan_html ) {
449
+ $( '.wt-cli-cookie-scan-notice' ).html( data.scan_html );
450
+ }
451
+ }
452
+ },
453
+ error:function()
454
+ {
455
+
456
+ }
457
+ }
458
+ );
459
+ }
460
+ );
461
+ }
462
  }
463
+
464
+ jQuery( document ).ready(
465
+ function(){
466
+ CLI_cookie_scanner.Set();
467
+ }
468
+ );
469
  }
470
+ );
471
+ })( jQuery );
 
 
 
 
admin/modules/cookie-scaner/classes/class-cookie-law-info-cookie-scanner-ajax.php CHANGED
@@ -30,7 +30,7 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
30
  );
31
  if ( isset( $_POST['cli_scaner_action'] ) ) {
32
 
33
- $cli_scan_action = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( wp_unslash( $_POST['cli_scaner_action'] ) );
34
  $allowed_actions = array(
35
  'get_pages',
36
  'scan_pages',
@@ -123,17 +123,16 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
123
 
124
  $wt_cli_site_host = $this->wt_cli_get_host( get_site_url() );
125
 
126
- $out = array(
127
  'log' => array(),
128
  'total' => 0,
129
  'limit' => $page_limit,
130
  'scan_id' => 0,
131
  'status' => false,
132
  );
 
133
 
134
- $sql = $this->get_scan_pages_query();
135
-
136
- $total_rows = $wpdb->get_row( 'SELECT COUNT(ID) AS ttnum' . $sql . " ORDER BY post_type='page' DESC LIMIT $page_limit", ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
137
  $total = $total_rows ? $total_rows['ttnum'] + 1 : 1; // always add 1 becuase home url is there.
138
 
139
  $this->set_ckyes_scan_status( 0 );
@@ -144,9 +143,7 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
144
 
145
  $this->insert_url( $scan_id, get_home_url() );
146
 
147
- $sql = 'SELECT post_name,post_title,post_type,ID' . $sql . " ORDER BY post_type='page' DESC LIMIT $page_limit";
148
-
149
- $data = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
150
 
151
  if ( ! empty( $data ) ) {
152
  foreach ( $data as $value ) {
@@ -176,11 +173,12 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
176
  * @return void
177
  */
178
  public function bulk_scan() {
 
179
 
180
  include plugin_dir_path( __FILE__ ) . 'class-cookie-law-info-cookie-scanner-api.php';
181
 
182
- $scan_id = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( ( isset( $_POST['scan_id'] ) ? $_POST['scan_id'] : 0 ), 'int' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
183
- $total = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( ( isset( $_POST['total'] ) ? $_POST['total'] : 0 ), 'int' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
184
 
185
  $data_arr = array(
186
  'current_action' => 'bulk_scan',
@@ -286,8 +284,8 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
286
  */
287
  public function get_total_page_count() {
288
  global $wpdb;
289
- $sql = $this->get_scan_pages_query();
290
- $total_rows = $wpdb->get_row( 'SELECT COUNT(ID) AS ttnum' . $sql, ARRAY_A );
291
  $pages = ( isset( $total_rows ) ? $total_rows : 0 );
292
  $page_count = intval( ( isset( $pages['ttnum'] ) ? $pages['ttnum'] : 0 ) );
293
  return $page_count;
@@ -330,11 +328,10 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
330
  /**
331
  * Returns the query to get the pages to be scanned
332
  *
333
- * @return string
334
  */
335
- public function get_scan_pages_query() {
336
  global $wpdb;
337
- $post_table = $wpdb->prefix . 'posts';
338
  $post_types = get_post_types(
339
  array(
340
  'public' => true,
@@ -346,8 +343,7 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
346
  unset( $post_types['customize_changeset'] );
347
  unset( $post_types['user_request'] );
348
 
349
- $sql = " FROM $post_table WHERE post_type IN('" . implode( "','", $post_types ) . "') AND post_status='publish'";
350
- return $sql;
351
  }
352
  /**
353
  * Returns the total URLs to be scanned.
@@ -358,9 +354,7 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
358
  public function get_urls( $scan_id ) {
359
  global $wpdb;
360
  $urls = array();
361
- $url_table = $wpdb->prefix . $this->url_table;
362
- $sql = $wpdb->prepare( "SELECT id_cli_cookie_scan_url,url FROM $url_table WHERE id_cli_cookie_scan=%d ORDER BY id_cli_cookie_scan_url ASC", $scan_id );
363
- $urls_from_db = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
364
 
365
  if ( ! empty( $urls_from_db ) ) {
366
  foreach ( $urls_from_db as $data ) {
@@ -408,7 +402,9 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
408
  */
409
  public function import_now() {
410
 
411
- $scan_id = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( ( isset( $_POST['scan_id'] ) ? wp_unslash( $_POST['scan_id'] ) : 0 ), 'int' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
 
 
412
  $out = array(
413
  'response' => false,
414
  'scan_id' => $scan_id,
@@ -421,8 +417,8 @@ class Cookie_Law_Info_Cookie_Scanner_Ajax extends Cookie_Law_Info_Cookie_Scaner
421
  $deleted = 0;
422
  $skipped = 0;
423
  $added = 0;
424
- $scan_id = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( ( isset( $_POST['scan_id'] ) ? wp_unslash( $_POST['scan_id'] ) : 0 ), 'int' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
425
- $import_option = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( ( isset( $_POST['import_option'] ) ? wp_unslash( $_POST['import_option'] ) : 2 ), 'int' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
426
 
427
  if ( $scan_id > 0 ) {
428
  $cookies = $this->get_scan_cookies( $scan_id, 0, -1 ); // taking cookies.
30
  );
31
  if ( isset( $_POST['cli_scaner_action'] ) ) {
32
 
33
+ $cli_scan_action = sanitize_text_field( wp_unslash( $_POST['cli_scaner_action'] ) );
34
  $allowed_actions = array(
35
  'get_pages',
36
  'scan_pages',
123
 
124
  $wt_cli_site_host = $this->wt_cli_get_host( get_site_url() );
125
 
126
+ $out = array(
127
  'log' => array(),
128
  'total' => 0,
129
  'limit' => $page_limit,
130
  'scan_id' => 0,
131
  'status' => false,
132
  );
133
+ $post_types = $this->get_exclude_post_types();
134
 
135
+ $total_rows = $wpdb->get_row( $wpdb->prepare( "SELECT COUNT(ID) AS ttnum FROM {$wpdb->prefix}posts WHERE post_type IN( '" . implode( "','", array_map( 'esc_sql', array_keys( $post_types ) ) ) . "' ) AND post_status='publish' ORDER BY post_type='page' DESC LIMIT %d", $page_limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
 
136
  $total = $total_rows ? $total_rows['ttnum'] + 1 : 1; // always add 1 becuase home url is there.
137
 
138
  $this->set_ckyes_scan_status( 0 );
143
 
144
  $this->insert_url( $scan_id, get_home_url() );
145
 
146
+ $data = $wpdb->get_results( $wpdb->prepare( "SELECT post_name,post_title,post_type,ID FROM {$wpdb->prefix}posts WHERE post_type IN( '" . implode( "','", array_map( 'esc_sql', array_keys( $post_types ) ) ) . "' ) AND post_status='publish' ORDER BY post_type='page' DESC LIMIT %d", $page_limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
 
147
 
148
  if ( ! empty( $data ) ) {
149
  foreach ( $data as $value ) {
173
  * @return void
174
  */
175
  public function bulk_scan() {
176
+ check_ajax_referer( 'cli_cookie_scaner', 'security' );
177
 
178
  include plugin_dir_path( __FILE__ ) . 'class-cookie-law-info-cookie-scanner-api.php';
179
 
180
+ $scan_id = isset( $_POST['scan_id'] ) ? absint( $_POST['scan_id'] ) : 0;
181
+ $total = isset( $_POST['total'] ) ? absint( $_POST['total'] ) : 0;
182
 
183
  $data_arr = array(
184
  'current_action' => 'bulk_scan',
284
  */
285
  public function get_total_page_count() {
286
  global $wpdb;
287
+ $post_types = $this->get_exclude_post_types();
288
+ $total_rows = $wpdb->get_row( "SELECT COUNT(ID) AS ttnum FROM {$wpdb->prefix}posts WHERE post_type IN( '" . implode( "','", array_map( 'esc_sql', array_keys( $post_types ) ) ) . "' ) AND post_status='publish'", ARRAY_A );
289
  $pages = ( isset( $total_rows ) ? $total_rows : 0 );
290
  $page_count = intval( ( isset( $pages['ttnum'] ) ? $pages['ttnum'] : 0 ) );
291
  return $page_count;
328
  /**
329
  * Returns the query to get the pages to be scanned
330
  *
331
+ * @return array
332
  */
333
+ public function get_exclude_post_types() {
334
  global $wpdb;
 
335
  $post_types = get_post_types(
336
  array(
337
  'public' => true,
343
  unset( $post_types['customize_changeset'] );
344
  unset( $post_types['user_request'] );
345
 
346
+ return $post_types;
 
347
  }
348
  /**
349
  * Returns the total URLs to be scanned.
354
  public function get_urls( $scan_id ) {
355
  global $wpdb;
356
  $urls = array();
357
+ $urls_from_db = $wpdb->get_results( $wpdb->prepare( "SELECT id_cli_cookie_scan_url,url FROM {$wpdb->prefix}cli_cookie_scan_url WHERE id_cli_cookie_scan=%d ORDER BY id_cli_cookie_scan_url ASC", $scan_id ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
 
 
358
 
359
  if ( ! empty( $urls_from_db ) ) {
360
  foreach ( $urls_from_db as $data ) {
402
  */
403
  public function import_now() {
404
 
405
+ check_ajax_referer( 'cli_cookie_scaner', 'security' );
406
+
407
+ $scan_id = isset( $_POST['scan_id'] ) ? absint( wp_unslash( $_POST['scan_id'] ) ) : 0;
408
  $out = array(
409
  'response' => false,
410
  'scan_id' => $scan_id,
417
  $deleted = 0;
418
  $skipped = 0;
419
  $added = 0;
420
+ $scan_id = isset( $_POST['scan_id'] ) ? absint( wp_unslash( $_POST['scan_id'] ) ) : 0;
421
+ $import_option = isset( $_POST['import_option'] ) ? absint( wp_unslash( $_POST['import_option'] ) ) : 2;
422
 
423
  if ( $scan_id > 0 ) {
424
  $cookies = $this->get_scan_cookies( $scan_id, 0, -1 ); // taking cookies.
admin/modules/cookie-scaner/cookie-scaner.php CHANGED
@@ -121,9 +121,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
121
  public function table_exists( $table_name ) {
122
  global $wpdb;
123
 
124
- $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
125
-
126
- if ( $wpdb->get_var( $query ) === $table_name ) {
127
  return true;
128
  }
129
  return false;
@@ -214,11 +212,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
214
  */
215
  private function update_tables() {
216
  global $wpdb;
217
-
218
- $cookies_table = $wpdb->prefix . $this->cookies_table;
219
- $category_table = $wpdb->prefix . $this->category_table;
220
-
221
- $wpdb->query( "ALTER TABLE `$cookies_table` ADD CONSTRAINT FOREIGN KEY (`category_id`) REFERENCES `$category_table` (`id_cli_cookie_category`)" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
222
  }
223
  /**
224
  * Recursice function to insert sanner tables no matter what error has occured
@@ -278,9 +272,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
278
  );
279
  foreach ( $scanner_tables as $table ) {
280
  $table_name = $wpdb->prefix . $table;
281
- $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
282
-
283
- if ( ! $wpdb->get_results( $sql, ARRAY_N ) ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
284
  return false;
285
  }
286
  }
@@ -406,8 +398,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
406
  $scan_table = $wpdb->prefix . $this->scan_table;
407
  $data = array();
408
  if ( true === $this->table_exists( $scan_table ) ) {
409
- $sql = "SELECT * FROM `$scan_table` ORDER BY id_cli_cookie_scan DESC LIMIT 1";
410
- $raw_data = $wpdb->get_row( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
411
  if ( $raw_data ) {
412
  $data['id_cli_cookie_scan'] = isset( $raw_data['id_cli_cookie_scan'] ) ? absint( $raw_data['id_cli_cookie_scan'] ) : 0;
413
  $data['status'] = isset( $raw_data['status'] ) ? absint( $raw_data['status'] ) : 1;
@@ -420,7 +411,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
420
  }
421
  }
422
  return false;
423
-
424
  }
425
  /**
426
  * Return the current scan status progress, failed , or success.
@@ -450,7 +441,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
450
  $notice = '<p>' . __( 'Scan your website with CookieYes, our scanning solution for high-speed, accurate cookie scanning', 'cookie-law-info' ) . '</p>';
451
  $notice = '<p style="font-weight:500;">' . sprintf(
452
  wp_kses(
453
- __( 'Clicking “Connect & scan” will let you connect with a free <a href="%s" target="_blank">CookieYes</a> account and initiate scanning of your website for cookies. These cookies along with their description will be listed under the cookie declaration popup. By continuing, you agree to CookieYes\'s <a href="%s" target="_blank">Privacy Policy</a> & <a href="%s" target="_blank">Terms of service</a>.', 'cookie-law-info' ),
454
  array(
455
  'a' => array(
456
  'href' => array(),
@@ -683,7 +674,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
683
  if ( true === $return ) {
684
  return $html;
685
  } else {
686
- echo $html; // phpcs:ignore WordPress.Security.EscapeOutput
687
 
688
  }
689
  }
@@ -789,14 +780,16 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
789
  */
790
  public function get_scan_history( $id ) {
791
  global $wpdb;
792
- $scan_table = $wpdb->prefix . $this->scan_table;
793
- $data = array();
794
- $sql = $wpdb->prepare(
795
- "SELECT * FROM {$scan_table} WHERE `id_cli_cookie_scan` = %d",
796
- $id
 
 
 
797
  );
798
- $raw_data = $wpdb->get_row( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
799
-
800
  if ( $raw_data ) {
801
 
802
  $data['id_cli_cookie_scan'] = isset( $raw_data['id_cli_cookie_scan'] ) ? absint( $raw_data['id_cli_cookie_scan'] ) : 0;
@@ -806,12 +799,11 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
806
  $data['total_cookies'] = isset( $raw_data['total_cookies'] ) ? absint( $raw_data['total_cookies'] ) : 0;
807
  $data['current_action'] = isset( $raw_data['current_action'] ) ? sanitize_text_field( $raw_data['current_action'] ) : '';
808
  $data['current_offset'] = isset( $raw_data['current_offset'] ) ? (int) $raw_data['current_offset'] : -1;
809
-
810
  return $data;
811
  }
812
  return false;
813
-
814
-
815
  }
816
  /**
817
  * Retuns scan results by ID
@@ -882,17 +874,13 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
882
  'data' => array(),
883
  );
884
 
885
- $url_table = $wpdb->prefix . $this->url_table;
886
-
887
- $count_sql = $wpdb->prepare( "SELECT COUNT( id_cli_cookie_scan_url ) AS ttnum FROM $url_table WHERE id_cli_cookie_scan = %d", $scan_id );
888
- $count_arr = $wpdb->get_row( $count_sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
889
 
890
  if ( $count_arr ) {
891
  $out['total'] = $count_arr['ttnum'];
892
  }
893
- $sql = $wpdb->prepare( "SELECT * FROM $url_table WHERE id_cli_cookie_scan = %d ORDER BY id_cli_cookie_scan_url ASC LIMIT %d,%d", $scan_id, $offset, $limit );
894
 
895
- $data_arr = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
896
 
897
  if ( $data_arr ) {
898
  $out['urls'] = $data_arr;
@@ -902,7 +890,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
902
  /**
903
  * Return the identified cookies after the scanning
904
  *
905
- * @param integer $scan_id scan ID.
906
  * @param integer $offset offset number.
907
  * @param integer $limit page limit if pagination is used.
908
  * @return array
@@ -919,8 +907,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
919
  $url_table = $wpdb->prefix . $this->url_table;
920
  $category_table = $wpdb->prefix . $this->category_table;
921
 
922
- $count_sql = $wpdb->prepare( "SELECT COUNT( id_cli_cookie_scan_cookies ) AS ttnum FROM $cookies_table WHERE id_cli_cookie_scan = %d", $scan_id );
923
- $count_arr = $wpdb->get_row( $count_sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
924
 
925
  if ( $count_arr ) {
926
  $out['total'] = $count_arr['ttnum'];
@@ -928,11 +915,11 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
928
  $offset = (int) $offset;
929
  $limit = (int) $limit;
930
 
931
- $limits = $limit > 0 ? 'LIMIT ' . $offset . ',' . $limit : '';
932
-
933
- $sql = $wpdb->prepare( "SELECT * FROM $cookies_table AS cookie INNER JOIN $category_table as category ON category.id_cli_cookie_category = cookie.category_id INNER JOIN $url_table as urls ON cookie.id_cli_cookie_scan_url = urls.id_cli_cookie_scan_url WHERE cookie.id_cli_cookie_scan = %s ORDER BY id_cli_cookie_scan_cookies ASC $limits", $scan_id );
934
-
935
- $db_data = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
936
 
937
  if ( is_array( $db_data ) && ! empty( $db_data ) ) {
938
  foreach ( (array) $db_data as $raw_data ) {
@@ -960,45 +947,6 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
960
  }
961
  return $out;
962
  }
963
- /**
964
- * Return HTML table structure for listing cookies
965
- *
966
- * @param [type] $cookies The cookie list.
967
- * @return string
968
- */
969
- public function create_cookies_table( $cookies ) {
970
-
971
- $count = 1;
972
- $html = '<table class="wt-cli-table">';
973
- $html .= '<thead>';
974
- $html .= '<th style="width: 6%;">' . __( 'Sl.No:', 'cookie-law-info' ) . '</th>';
975
- $html .= '<th>' . __( 'Cookie Name', 'cookie-law-info' ) . '</th>';
976
- $html .= '<th style="width:15%;" >' . __( 'Duration', 'cookie-law-info' ) . '</th>';
977
- $html .= '<th style="width:15%;" >' . __( 'Category', 'cookie-law-info' ) . '</th>';
978
- $html .= '<th style="width:40%;" >' . __( 'Description', 'cookie-law-info' ) . '</th>';
979
- $html .= '</thead>';
980
- $html .= '<tbody>';
981
-
982
- if ( isset( $cookies ) && is_array( $cookies ) && count( $cookies ) > 0 ) :
983
- foreach ( $cookies as $cookie ) :
984
- $html .= '<tr>';
985
- $html .= '<td>' . $count . '</td>';
986
- $html .= '<td>' . $cookie['id'] . '</td>';
987
- $html .= '<td>' . $cookie['expiry'] . '</td>';
988
- $html .= '<td>' . $cookie['category'] . '</td>';
989
- $html .= '<td>' . $cookie['description'] . '</td>';
990
- $html .= '</tr>';
991
- $count ++;
992
- endforeach;
993
- else :
994
- $html .= '<tr><td class="colspanchange" colspan="5" style="text-align:center" >' . __( 'Your cookie list is empty', 'cookie-law-info' ) . '</td></tr>';
995
- endif;
996
-
997
- $html .= '</tbody>';
998
- $html .= '</table>';
999
-
1000
- return $html;
1001
- }
1002
  /**
1003
  * Get the last scan ID
1004
  *
@@ -1045,12 +993,9 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
1045
  */
1046
  public function flush_scan_records() {
1047
  global $wpdb;
1048
- $table_name = $wpdb->prefix . $this->scan_table;
1049
- $wpdb->query( "TRUNCATE TABLE $table_name" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1050
- $table_name = $wpdb->prefix . $this->url_table;
1051
- $wpdb->query( "TRUNCATE TABLE $table_name" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1052
- $table_name = $wpdb->prefix . $this->cookies_table;
1053
- $wpdb->query( "TRUNCATE TABLE $table_name" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1054
  }
1055
  /**
1056
  * Fetch the current scan result
@@ -1087,8 +1032,8 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
1087
  if ( $cookie_data ) {
1088
  if ( $scan_id !== false ) {
1089
 
1090
- $sql = $wpdb->prepare( "SELECT id_cli_cookie_scan_url,url FROM $url_table WHERE id_cli_cookie_scan = %s ORDER BY id_cli_cookie_scan_url ASC", $scan_id );
1091
- $urls = $wpdb->get_results( $sql, ARRAY_A );
1092
  foreach ( $urls as $url_data ) {
1093
  $url = isset( $url_data['url'] ) ? sanitize_text_field( $url_data['url'] ) : '';
1094
  $scan_urls[ $url ] = isset( $url_data['id_cli_cookie_scan_url'] ) ? absint( $url_data['id_cli_cookie_scan_url'] ) : 1;
@@ -1120,7 +1065,7 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
1120
  */
1121
  public function validate_scan_instance( $instance ) {
1122
  $last_instance = $this->get_ckyes_scan_instance();
1123
- if ( ( 0 !== $instance ) && !empty( $instance ) && ( $instance === $last_instance ) ) {
1124
  return true;
1125
  }
1126
  return false;
@@ -1149,22 +1094,20 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
1149
  */
1150
  protected function insert_categories( $categories ) {
1151
  global $wpdb;
1152
- $cat_table = $wpdb->prefix . $this->category_table;
1153
- $cat_arr = array();
1154
- $cat_sql = "INSERT IGNORE INTO `$cat_table` (`cli_cookie_category_name`,`cli_cookie_category_description`) VALUES ";
1155
-
1156
  foreach ( $categories as $id => $category_data ) {
1157
  $category = ( isset( $category_data['category'] ) ? esc_sql( sanitize_text_field( $category_data['category'] ) ) : '' );
1158
- $description = ( isset( $category_data['category_desc'] ) ? esc_sql( addslashes( sanitize_textarea_field( $category_data['category_desc'] ) ) ) : '' );
1159
-
1160
  if ( ! empty( $category ) ) {
1161
- $cat_arr[] = "('$category','$description')";
 
 
 
 
 
 
 
1162
  }
1163
  }
1164
- $cat_sql = $cat_sql . implode( ',', $cat_arr );
1165
- if ( ! empty( $cat_arr ) ) {
1166
- $wpdb->query( $cat_sql );
1167
- }
1168
  }
1169
  /**
1170
  * Insert the scanned Cookies to the corresponding table
@@ -1177,30 +1120,38 @@ class Cookie_Law_Info_Cookie_Scaner extends Cookie_Law_Info_Cookieyes {
1177
  */
1178
  protected function insert_cookies( $scan_id, $urls, $cookie_data, $category ) {
1179
  global $wpdb;
1180
- $cookie_table = $wpdb->prefix . $this->cookies_table;
1181
- $category_table = $wpdb->prefix . $this->category_table;
1182
-
1183
- $sql = "INSERT IGNORE INTO `$cookie_table` (`id_cli_cookie_scan`,`id_cli_cookie_scan_url`,`cookie_id`,`expiry`,`type`,`category`,`category_id`,`description`) VALUES ";
1184
-
1185
- $sql_arr = array();
1186
 
1187
  foreach ( $cookie_data as $cookies ) {
1188
  if ( is_array( $cookies ) && ! empty( $cookies ) ) {
1189
  $cookie_id = isset( $cookies['cookie_id'] ) ? esc_sql( sanitize_text_field( $cookies['cookie_id'] ) ) : '';
1190
- $description = isset( $cookies['description'] ) ? esc_sql( sanitize_textarea_field( $cookies['description'] ) ) : '';
1191
  $expiry = isset( $cookies['duration'] ) ? esc_sql( sanitize_text_field( $cookies['duration'] ) ) : '';
1192
  $type = isset( $cookies['type'] ) ? esc_sql( sanitize_text_field( $cookies['type'] ) ) : '';
1193
  $category = esc_sql( sanitize_text_field( $category ) );
1194
  $url_id = ( isset( $cookies['frist_found_url'] ) ? esc_sql( sanitize_text_field( $cookies['frist_found_url'] ) ) : '' );
1195
  $url_id = ( isset( $urls[ $url_id ] ) ? esc_sql( $urls[ $url_id ] ) : 1 );
1196
- $category_id = $wpdb->get_var( $wpdb->prepare( "SELECT `id_cli_cookie_category` FROM `$category_table` WHERE `cli_cookie_category_name` = %s;", array( $category ) ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1197
  $category_id = esc_sql( absint( $category_id ) );
1198
- $sql_arr[] = "('$scan_id','$url_id','$cookie_id','$expiry','$type','$category','$category_id','$description')";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1199
  }
1200
  }
1201
-
1202
- $sql = $sql . implode( ',', $sql_arr );
1203
- $wpdb->query( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1204
  }
1205
  /**
1206
  * List the cookie scan features
121
  public function table_exists( $table_name ) {
122
  global $wpdb;
123
 
124
+ if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ) ) === $table_name ) {
 
 
125
  return true;
126
  }
127
  return false;
212
  */
213
  private function update_tables() {
214
  global $wpdb;
215
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}cli_cookie_scan_cookies ADD CONSTRAINT FOREIGN KEY (`category_id`) REFERENCES {$wpdb->prefix}cli_cookie_scan_categories (`id_cli_cookie_category`)" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
 
 
 
216
  }
217
  /**
218
  * Recursice function to insert sanner tables no matter what error has occured
272
  );
273
  foreach ( $scanner_tables as $table ) {
274
  $table_name = $wpdb->prefix . $table;
275
+ if ( ! $wpdb->get_results( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ), ARRAY_N ) ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
 
276
  return false;
277
  }
278
  }
398
  $scan_table = $wpdb->prefix . $this->scan_table;
399
  $data = array();
400
  if ( true === $this->table_exists( $scan_table ) ) {
401
+ $raw_data = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}cli_cookie_scan ORDER BY id_cli_cookie_scan DESC LIMIT 1", ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
402
  if ( $raw_data ) {
403
  $data['id_cli_cookie_scan'] = isset( $raw_data['id_cli_cookie_scan'] ) ? absint( $raw_data['id_cli_cookie_scan'] ) : 0;
404
  $data['status'] = isset( $raw_data['status'] ) ? absint( $raw_data['status'] ) : 1;
411
  }
412
  }
413
  return false;
414
+
415
  }
416
  /**
417
  * Return the current scan status progress, failed , or success.
441
  $notice = '<p>' . __( 'Scan your website with CookieYes, our scanning solution for high-speed, accurate cookie scanning', 'cookie-law-info' ) . '</p>';
442
  $notice = '<p style="font-weight:500;">' . sprintf(
443
  wp_kses(
444
+ __( 'Clicking “Connect & scan” will let you connect with a free <a href="%1$s" target="_blank">CookieYes</a> account and initiate scanning of your website for cookies. These cookies along with their description will be listed under the cookie declaration popup. By continuing, you agree to CookieYes\'s <a href="%2$s" target="_blank">Privacy Policy</a> & <a href="%3$s" target="_blank">Terms of service</a>.', 'cookie-law-info' ),
445
  array(
446
  'a' => array(
447
  'href' => array(),
674
  if ( true === $return ) {
675
  return $html;
676
  } else {
677
+ echo wp_kses_post( $html );
678
 
679
  }
680
  }
780
  */
781
  public function get_scan_history( $id ) {
782
  global $wpdb;
783
+ $scan_table = $wpdb->prefix . $this->scan_table;
784
+ $data = array();
785
+ $raw_data = $wpdb->get_row( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
786
+ $wpdb->prepare(
787
+ "SELECT * FROM {$wpdb->prefix}cli_cookie_scan WHERE `id_cli_cookie_scan` = %d",
788
+ $id
789
+ ),
790
+ ARRAY_A
791
  );
792
+
 
793
  if ( $raw_data ) {
794
 
795
  $data['id_cli_cookie_scan'] = isset( $raw_data['id_cli_cookie_scan'] ) ? absint( $raw_data['id_cli_cookie_scan'] ) : 0;
799
  $data['total_cookies'] = isset( $raw_data['total_cookies'] ) ? absint( $raw_data['total_cookies'] ) : 0;
800
  $data['current_action'] = isset( $raw_data['current_action'] ) ? sanitize_text_field( $raw_data['current_action'] ) : '';
801
  $data['current_offset'] = isset( $raw_data['current_offset'] ) ? (int) $raw_data['current_offset'] : -1;
802
+
803
  return $data;
804
  }
805
  return false;
806
+
 
807
  }
808
  /**
809
  * Retuns scan results by ID
874
  'data' => array(),
875
  );
876
 
877
+ $count_arr = $wpdb->get_row( $wpdb->prepare( "SELECT COUNT( id_cli_cookie_scan_url ) AS ttnum FROM {$wpdb->prefix}cli_cookie_scan_url WHERE id_cli_cookie_scan = %d", $scan_id ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
 
 
878
 
879
  if ( $count_arr ) {
880
  $out['total'] = $count_arr['ttnum'];
881
  }
 
882
 
883
+ $data_arr = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}cli_cookie_scan_url WHERE id_cli_cookie_scan = %d ORDER BY id_cli_cookie_scan_url ASC LIMIT %d,%d", $scan_id, $offset, $limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
884
 
885
  if ( $data_arr ) {
886
  $out['urls'] = $data_arr;
890
  /**
891
  * Return the identified cookies after the scanning
892
  *
893
+ * @param integer $scan_id scan ID.
894
  * @param integer $offset offset number.
895
  * @param integer $limit page limit if pagination is used.
896
  * @return array
907
  $url_table = $wpdb->prefix . $this->url_table;
908
  $category_table = $wpdb->prefix . $this->category_table;
909
 
910
+ $count_arr = $wpdb->get_row( $wpdb->prepare( "SELECT COUNT( id_cli_cookie_scan_cookies ) AS ttnum FROM {$wpdb->prefix}cli_cookie_scan_cookies WHERE id_cli_cookie_scan = %d", $scan_id ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
 
911
 
912
  if ( $count_arr ) {
913
  $out['total'] = $count_arr['ttnum'];
915
  $offset = (int) $offset;
916
  $limit = (int) $limit;
917
 
918
+ if ( $limit > 0 ) {
919
+ $db_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}cli_cookie_scan_cookies AS cookie INNER JOIN {$wpdb->prefix}cli_cookie_scan_categories as category ON category.id_cli_cookie_category = cookie.category_id INNER JOIN {$wpdb->prefix}cli_cookie_scan_url as urls ON cookie.id_cli_cookie_scan_url = urls.id_cli_cookie_scan_url WHERE cookie.id_cli_cookie_scan = %s ORDER BY id_cli_cookie_scan_cookies ASC LIMIT %d, %d", $scan_id, $offset, $limit ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
920
+ } else {
921
+ $db_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}cli_cookie_scan_cookies AS cookie INNER JOIN {$wpdb->prefix}cli_cookie_scan_categories as category ON category.id_cli_cookie_category = cookie.category_id INNER JOIN {$wpdb->prefix}cli_cookie_scan_url as urls ON cookie.id_cli_cookie_scan_url = urls.id_cli_cookie_scan_url WHERE cookie.id_cli_cookie_scan = %s ORDER BY id_cli_cookie_scan_cookies ASC", $scan_id ), ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
922
+ }
923
 
924
  if ( is_array( $db_data ) && ! empty( $db_data ) ) {
925
  foreach ( (array) $db_data as $raw_data ) {
947
  }
948
  return $out;
949
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
950
  /**
951
  * Get the last scan ID
952
  *
993
  */
994
  public function flush_scan_records() {
995
  global $wpdb;
996
+ $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}cli_cookie_scan;" );
997
+ $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}cli_cookie_scan_url;" );
998
+ $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}cli_cookie_scan_cookies;" );
 
 
 
999
  }
1000
  /**
1001
  * Fetch the current scan result
1032
  if ( $cookie_data ) {
1033
  if ( $scan_id !== false ) {
1034
 
1035
+ $urls = $wpdb->get_results( $wpdb->prepare( "SELECT id_cli_cookie_scan_url,url FROM {$wpdb->prefix}cli_cookie_scan_url WHERE id_cli_cookie_scan = %s ORDER BY id_cli_cookie_scan_url ASC", $scan_id ), ARRAY_A );
1036
+
1037
  foreach ( $urls as $url_data ) {
1038
  $url = isset( $url_data['url'] ) ? sanitize_text_field( $url_data['url'] ) : '';
1039
  $scan_urls[ $url ] = isset( $url_data['id_cli_cookie_scan_url'] ) ? absint( $url_data['id_cli_cookie_scan_url'] ) : 1;
1065
  */
1066
  public function validate_scan_instance( $instance ) {
1067
  $last_instance = $this->get_ckyes_scan_instance();
1068
+ if ( ( 0 !== $instance ) && ! empty( $instance ) && ( $instance === $last_instance ) ) {
1069
  return true;
1070
  }
1071
  return false;
1094
  */
1095
  protected function insert_categories( $categories ) {
1096
  global $wpdb;
 
 
 
 
1097
  foreach ( $categories as $id => $category_data ) {
1098
  $category = ( isset( $category_data['category'] ) ? esc_sql( sanitize_text_field( $category_data['category'] ) ) : '' );
1099
+ $description = ( isset( $category_data['category_desc'] ) ? esc_sql( addslashes( wp_kses_post( $category_data['category_desc'] ) ) ) : '' );
 
1100
  if ( ! empty( $category ) ) {
1101
+ $wpdb->insert(
1102
+ $wpdb->prefix . 'cli_cookie_scan_categories',
1103
+ array(
1104
+ 'cli_cookie_category_name' => $category,
1105
+ 'cli_cookie_category_description' => $description,
1106
+ ),
1107
+ array( '%s', '%s' ),
1108
+ );
1109
  }
1110
  }
 
 
 
 
1111
  }
1112
  /**
1113
  * Insert the scanned Cookies to the corresponding table
1120
  */
1121
  protected function insert_cookies( $scan_id, $urls, $cookie_data, $category ) {
1122
  global $wpdb;
 
 
 
 
 
 
1123
 
1124
  foreach ( $cookie_data as $cookies ) {
1125
  if ( is_array( $cookies ) && ! empty( $cookies ) ) {
1126
  $cookie_id = isset( $cookies['cookie_id'] ) ? esc_sql( sanitize_text_field( $cookies['cookie_id'] ) ) : '';
1127
+ $description = isset( $cookies['description'] ) ? esc_sql( wp_kses_post( $cookies['description'] ) ) : '';
1128
  $expiry = isset( $cookies['duration'] ) ? esc_sql( sanitize_text_field( $cookies['duration'] ) ) : '';
1129
  $type = isset( $cookies['type'] ) ? esc_sql( sanitize_text_field( $cookies['type'] ) ) : '';
1130
  $category = esc_sql( sanitize_text_field( $category ) );
1131
  $url_id = ( isset( $cookies['frist_found_url'] ) ? esc_sql( sanitize_text_field( $cookies['frist_found_url'] ) ) : '' );
1132
  $url_id = ( isset( $urls[ $url_id ] ) ? esc_sql( $urls[ $url_id ] ) : 1 );
1133
+ $category_id = $wpdb->get_var( $wpdb->prepare( "SELECT `id_cli_cookie_category` FROM {$wpdb->prefix}cli_cookie_scan_categories WHERE `cli_cookie_category_name` = %s;", array( $category ) ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1134
  $category_id = esc_sql( absint( $category_id ) );
1135
+
1136
+ if ( ! empty( $cookie_id ) ) {
1137
+ $wpdb->insert(
1138
+ $wpdb->prefix . 'cli_cookie_scan_cookies',
1139
+ array(
1140
+ 'id_cli_cookie_scan' => $scan_id,
1141
+ 'id_cli_cookie_scan_url' => $url_id,
1142
+ 'cookie_id' => $cookie_id,
1143
+ 'expiry' => $expiry,
1144
+ 'type' => $type,
1145
+ 'category' => $category,
1146
+ 'category_id' => $category_id,
1147
+ 'description' => $description,
1148
+
1149
+ ),
1150
+ array( '%d', '%d', '%s', '%s', '%s', '%s', '%d', '%s' ),
1151
+ );
1152
+ }
1153
  }
1154
  }
 
 
 
1155
  }
1156
  /**
1157
  * List the cookie scan features
admin/modules/cookie-scaner/views/scan-results.php CHANGED
@@ -3,7 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
  ?>
6
- <?php if ( $scan_results ) :
 
7
  ?>
8
  <div class="wt-cli-cookie-scan-results-container">
9
  <div class="wt-cli-scan-result-header">
@@ -11,25 +12,13 @@ if ( ! defined( 'ABSPATH' ) ) {
11
  <div class="wt-cli-col-6">
12
  <h2>
13
  <?php
14
- echo __('Cookie scan result for your website','cookie-law-info');
15
- // echo sprintf(
16
- // wp_kses(
17
- // __( 'Scan result for <a href="%s" target="_blank">' . $this->get_website_url() . '</a>', 'cookie-law-info' ),
18
- // array(
19
- // 'a' => array(
20
- // 'href' => array(),
21
- // 'target' => array(),
22
- // ),
23
- // )
24
- // ),
25
- // esc_url( $this->get_website_url() )
26
- // );
27
  ?>
28
  </h2>
29
  </div>
30
  <div class="wt-cli-col-6">
31
  <div class="wt-cli-scan-result-actions">
32
- <?php echo $this->get_scan_btn( true ); ?>
33
  </div>
34
  </div>
35
  </div>
@@ -38,17 +27,18 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  <div class="wt-cli-scan-result-summary">
39
  <ul class="wt-cli-scan-result-summary-list">
40
  <li>
41
- <b><?php _e( 'Total URLs', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_urls'] ); ?></span><br />
42
  </li>
43
  <li>
44
- <b><?php _e( 'Total cookies', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_cookies'] ); ?></span><br />
45
  </li>
46
  </ul>
47
  </div>
48
  <?php if ( $scan_results['total_cookies'] > 0 ) : ?>
49
  <div class="wt-cli-scan-result-import-section">
50
- <p><?php
51
-
 
52
  echo sprintf(
53
  wp_kses(
54
  __( 'Clicking “Add to cookie list” will import the discovered cookies to the <a href="%s" target="_blank">Cookie List</a> and thus display them in the cookie declaration section of your consent banner.', 'cookie-law-info' ),
@@ -61,18 +51,46 @@ if ( ! defined( 'ABSPATH' ) ) {
61
  ),
62
  esc_url( $cookie_list_page )
63
  );
64
- ?>
65
  </p>
66
-
67
- <a class="button-primary cli_import" data-scan-id="<?php echo esc_attr( $scan_results['scan_id'] ); ?>" style="margin-left:5px;"><?php _e( 'Add to cookie list', 'cookie-law-info' ); ?></a>
68
-
69
  </div>
70
  <?php endif; ?>
 
 
 
 
71
  <div class="wt-cli-scan-result-cookie-container">
72
  <div class="wt-cli-row">
73
  <div class="wt-cli-col-12">
74
  <div class="wt-cli-scan-result-cookies">
75
- <?php echo $this->create_cookies_table( $scan_results['cookies'] ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  </div>
77
  </div>
78
  </div>
3
  exit;
4
  }
5
  ?>
6
+ <?php
7
+ if ( $scan_results ) :
8
  ?>
9
  <div class="wt-cli-cookie-scan-results-container">
10
  <div class="wt-cli-scan-result-header">
12
  <div class="wt-cli-col-6">
13
  <h2>
14
  <?php
15
+ echo esc_html__( 'Cookie scan result for your website', 'cookie-law-info' );
 
 
 
 
 
 
 
 
 
 
 
 
16
  ?>
17
  </h2>
18
  </div>
19
  <div class="wt-cli-col-6">
20
  <div class="wt-cli-scan-result-actions">
21
+ <?php echo wp_kses_post( $this->get_scan_btn( true ) ); ?>
22
  </div>
23
  </div>
24
  </div>
27
  <div class="wt-cli-scan-result-summary">
28
  <ul class="wt-cli-scan-result-summary-list">
29
  <li>
30
+ <b><?php echo esc_html__( 'Total URLs', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_urls'] ); ?></span><br />
31
  </li>
32
  <li>
33
+ <b><?php echo esc_html__( 'Total cookies', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_cookies'] ); ?></span><br />
34
  </li>
35
  </ul>
36
  </div>
37
  <?php if ( $scan_results['total_cookies'] > 0 ) : ?>
38
  <div class="wt-cli-scan-result-import-section">
39
+ <p>
40
+ <?php
41
+
42
  echo sprintf(
43
  wp_kses(
44
  __( 'Clicking “Add to cookie list” will import the discovered cookies to the <a href="%s" target="_blank">Cookie List</a> and thus display them in the cookie declaration section of your consent banner.', 'cookie-law-info' ),
51
  ),
52
  esc_url( $cookie_list_page )
53
  );
54
+ ?>
55
  </p>
56
+ <a class="button-primary cli_import" data-scan-id="<?php echo esc_attr( $scan_results['scan_id'] ); ?>" style="margin-left:5px;"><?php echo esc_html__( 'Add to cookie list', 'cookie-law-info' ); ?></a>
 
 
57
  </div>
58
  <?php endif; ?>
59
+ <?php
60
+ $count = 1;
61
+ $cookies = isset( $scan_results['cookies'] ) ? $scan_results['cookies'] : array();
62
+ ?>
63
  <div class="wt-cli-scan-result-cookie-container">
64
  <div class="wt-cli-row">
65
  <div class="wt-cli-col-12">
66
  <div class="wt-cli-scan-result-cookies">
67
+ <table class="wt-cli-table">
68
+ <thead>
69
+ <th style="width:6%;"><?php echo esc_html__( 'Sl.No:', 'cookie-law-info' ); ?></th>
70
+ <th><?php echo esc_html__( 'Cookie Name', 'cookie-law-info' ); ?></th>
71
+ <th style="width:15%;" ><?php echo esc_html__( 'Duration', 'cookie-law-info' ); ?></th>
72
+ <th style="width:15%;" ><?php echo esc_html__( 'Category', 'cookie-law-info' ); ?></th>
73
+ <th style="width:40%;" ><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></th>
74
+ </thead>
75
+ <tbody>
76
+ <?php if ( isset( $cookies ) && is_array( $cookies ) && count( $cookies ) > 0 ) : ?>
77
+ <?php foreach ( $cookies as $cookie ) : ?>
78
+ <tr>
79
+ <td><?php echo esc_html( $count ); ?></td>
80
+ <td><?php echo esc_html( $cookie['id'] ); ?></td>
81
+ <td><?php echo esc_html( $cookie['expiry'] ); ?></td>
82
+ <td><?php echo esc_html( $cookie['category'] ); ?></td>
83
+ <td><?php echo wp_kses_post( wp_unslash( $cookie['description'] ) ); ?></td>
84
+ </tr>
85
+ <?php
86
+ $count ++;
87
+ endforeach;
88
+ ?>
89
+ <?php else : ?>
90
+ <tr><td class="colspanchange" colspan="5" style="text-align:center"><?php echo esc_html__( 'Your cookie list is empty', 'cookie-law-info' ); ?></td></tr>
91
+ <?php endif; ?>
92
+ </tbody>
93
+ </table>
94
  </div>
95
  </div>
96
  </div>
admin/modules/cookie-scaner/views/settings.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  padding-left: 15px;
23
  }
24
  .wt-cli-notice-actions {
25
- padding: 10px 0;
26
  }
27
  .wt-cli-cookie-scan-bar {
28
  display: flex;
@@ -162,37 +162,37 @@ table.wt-cli-table {
162
  display: flex;
163
  }
164
  .wt-cli-scan-result-import-section p {
165
- font-weight: 500;
166
  }
167
  .wt-cli-scan-result-import-section {
168
- display: flex;
169
- align-items: center;
170
- justify-content: space-between;
171
- padding: 10px 0 15px 0;
172
  }
173
  .wt-cli-scan-result-actions .button-primary {
174
- color: #0071a1;
175
- border-color: #0071a1;
176
- background: #f3f5f6;
177
  }
178
  .wt-cli-cookie-scan-notice {
179
  width:100%;
180
  }
181
  .wt-cli-cookie-scan-features-section .wt-cli-callout.wt-cli-callout-success {
182
- background: #eff7ed;
183
  }
184
  .wt-cli-inline-notice {
185
  padding: 15px 0;
186
  }
187
  .wt-cli-inline-notice.wt-cli-inline-notice-error {
188
- color: #ff0000;
189
  }
190
  .wt-cli-inline-notice.wt-cli-inline-notice-success {
191
- color: #3e9429;
192
  }
193
  </style>
194
  <div class="wrap">
195
- <h2><?php _e( 'Cookie scanner', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></h2>
196
  <?php do_action( 'wt_cli_before_cookie_scanner_header' ); ?>
197
  <div class="wt-cli-cookie-scan-bar">
198
  <div class="wt-cli-cookie-scan-notice">
22
  padding-left: 15px;
23
  }
24
  .wt-cli-notice-actions {
25
+ padding: 10px 0;
26
  }
27
  .wt-cli-cookie-scan-bar {
28
  display: flex;
162
  display: flex;
163
  }
164
  .wt-cli-scan-result-import-section p {
165
+ font-weight: 500;
166
  }
167
  .wt-cli-scan-result-import-section {
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: space-between;
171
+ padding: 10px 0 15px 0;
172
  }
173
  .wt-cli-scan-result-actions .button-primary {
174
+ color: #0071a1;
175
+ border-color: #0071a1;
176
+ background: #f3f5f6;
177
  }
178
  .wt-cli-cookie-scan-notice {
179
  width:100%;
180
  }
181
  .wt-cli-cookie-scan-features-section .wt-cli-callout.wt-cli-callout-success {
182
+ background: #eff7ed;
183
  }
184
  .wt-cli-inline-notice {
185
  padding: 15px 0;
186
  }
187
  .wt-cli-inline-notice.wt-cli-inline-notice-error {
188
+ color: #ff0000;
189
  }
190
  .wt-cli-inline-notice.wt-cli-inline-notice-success {
191
+ color: #3e9429;
192
  }
193
  </style>
194
  <div class="wrap">
195
+ <h2><?php echo esc_html__( 'Cookie scanner', 'cookie-law-info' ); ?></h2>
196
  <?php do_action( 'wt_cli_before_cookie_scanner_header' ); ?>
197
  <div class="wt-cli-cookie-scan-bar">
198
  <div class="wt-cli-cookie-scan-notice">
admin/modules/cookies/cookies.php CHANGED
@@ -65,14 +65,11 @@ class Cookie_Law_Info_Cookies {
65
  }
66
 
67
  public function wp_term_is_shared( $term_id ) {
68
- global $wpdb;
69
-
70
  if ( get_option( 'finished_splitting_shared_terms' ) ) {
71
  return false;
72
  }
73
-
74
  $tt_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term_id ) );
75
-
76
  return $tt_count > 1;
77
  }
78
 
@@ -151,7 +148,6 @@ class Cookie_Law_Info_Cookies {
151
  'delete_post' => 'manage_options',
152
  'read_post' => 'manage_options',
153
  ),
154
- /** done editing */
155
  'menu_icon' => plugin_dir_url( __FILE__ ) . 'images/cli_icon.png',
156
  'hierarchical' => false,
157
  'menu_position' => null,
@@ -163,24 +159,20 @@ class Cookie_Law_Info_Cookies {
163
 
164
  public function add_category_meta( $term_id ) {
165
  $this->cookie_save_defaultstate( $term_id );
166
- // $this->save_status_meta( $term_id );
167
  $this->save_scripts_meta( $term_id );
168
  $this->save_priority_meta( $term_id );
169
  }
170
  public function edit_category_meta( $term_id ) {
171
  $this->cookie_save_defaultstate( $term_id );
172
  $this->save_scripts_meta( $term_id );
173
- // $this->save_status_meta( $term_id );
174
  }
175
  public function add_category_form_fields( $term ) {
176
  $this->cookie_add_defaultstate( $term );
177
  $this->add_scripts_meta( $term );
178
- // $this->add_status_meta( $term );
179
  }
180
  public function edit_category_form_fields( $term ) {
181
  $this->cookie_edit_defaultstate( $term );
182
  $this->edit_scripts_meta( $term );
183
- // $this->edit_status_meta( $term );
184
  }
185
  public function add_meta_box() {
186
 
@@ -195,7 +187,7 @@ class Cookie_Law_Info_Cookies {
195
  $custom = get_post_custom( $post->ID );
196
  $cookie_slugid = ( isset( $custom['_cli_cookie_slugid'][0] ) ) ? $custom['_cli_cookie_slugid'][0] : '';
197
  ?>
198
- <label><?php echo __( 'Cookie ID', 'cookie-law-info' ); ?></label>
199
  <input name="_cli_cookie_slugid" value="<?php echo esc_attr( sanitize_text_field( $cookie_slugid ) ); ?>" style="width:95%;" />
200
  <?php
201
  }
@@ -206,7 +198,7 @@ class Cookie_Law_Info_Cookies {
206
  $custom = get_post_custom( $post->ID );
207
  $cookie_type = ( isset( $custom['_cli_cookie_type'][0] ) ) ? $custom['_cli_cookie_type'][0] : '';
208
  ?>
209
- <label><?php echo __( 'Cookie Type: (persistent, session, third party )', 'cookie-law-info' ); ?></label>
210
  <input name="_cli_cookie_type" value="<?php echo esc_attr( sanitize_text_field( $cookie_type ) ); ?>" style="width:95%;" />
211
  <?php
212
  }
@@ -218,7 +210,7 @@ class Cookie_Law_Info_Cookies {
218
  $cookie_duration = ( isset( $custom['_cli_cookie_duration'][0] ) ) ? $custom['_cli_cookie_duration'][0] : '';
219
  ?>
220
 
221
- <label><?php echo __( 'Cookie Duration:', 'cookie-law-info' ); ?></label>
222
  <input name="_cli_cookie_duration" value="<?php echo esc_attr( sanitize_text_field( $cookie_duration ) ); ?>" style="width:95%;" />
223
  <?php
224
  }
@@ -229,7 +221,7 @@ class Cookie_Law_Info_Cookies {
229
  $custom = get_post_custom( $post->ID );
230
  $cookie_sensitivity = ( isset( $custom['_cli_cookie_sensitivity'][0] ) ) ? $custom['_cli_cookie_sensitivity'][0] : '';
231
  ?>
232
- <label><?php echo __( 'Cookie Sensitivity: ( necessary , non-necessary )', 'cookie-law-info' ); ?></label>
233
  <input name="_cli_cookie_sensitivity" value="<?php echo esc_attr( sanitize_text_field( $cookie_sensitivity ) ); ?>" style="width:95%;" />
234
  <?php
235
  }
@@ -352,7 +344,7 @@ class Cookie_Law_Info_Cookies {
352
  $necessory_categories = self::get_strictly_necessory_categories();
353
  $necessory_category_ids = array();
354
  foreach ( $necessory_categories as $category ) {
355
- $term = $this->get_term_data_from_db( 'slug', $category );
356
  if ( false !== $term ) {
357
  $necessory_category_ids[] = $term->term_id;
358
  }
@@ -605,10 +597,10 @@ class Cookie_Law_Info_Cookies {
605
  public function cookie_add_defaultstate( $term ) {
606
  ?>
607
  <div class="form-field term-defaultstate-field">
608
- <label for="CLIdefaultstate"><?php _e( 'Category default state', 'cookie-law-info' ); ?></label>
609
- <input type="radio" name="CLIdefaultstate" value="enabled" /><?php _e( 'Enabled', 'cookie-law-info' ); ?>
610
- <input type="radio" name="CLIdefaultstate" value="disabled" checked /><?php _e( 'Disabled', 'cookie-law-info' ); ?>
611
- <p class="description"><?php _e( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?></p>
612
  </div>
613
  <?php
614
  }
@@ -624,17 +616,17 @@ class Cookie_Law_Info_Cookies {
624
  */
625
  public function cookie_edit_defaultstate( $term ) {
626
  // put the term ID into a variable
627
- $t_id = $term->term_id;
628
- $term_CLIdefaultstate = $this->get_term_meta( $t_id, 'CLIdefaultstate', true );
629
 
630
  if ( $this->check_strictly_necessary_category( $t_id ) === false ) {
631
  ?>
632
  <tr class="form-field term-defaultstate-field">
633
- <th><label for="CLIdefaultstate"><?php _e( 'Category default state', 'cookie-law-info' ); ?></label></th>
634
  <td>
635
- <input type="radio" name="CLIdefaultstate" value="enabled" <?php checked( $term_CLIdefaultstate, 'enabled' ); ?>/><label><?php _e( 'Enabled', 'cookie-law-info' ); ?></label>
636
- <input type="radio" name="CLIdefaultstate" value="disabled" <?php checked( $term_CLIdefaultstate, 'disabled' ); ?>/><label><?php _e( 'Disabled', 'cookie-law-info' ); ?></label>
637
- <p class="description"><?php _e( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?></p>
638
  </td>
639
  </tr>
640
  <?php
@@ -646,10 +638,10 @@ class Cookie_Law_Info_Cookies {
646
  */
647
  public function cookie_save_defaultstate( $term_id ) {
648
  if ( isset( $_POST['CLIdefaultstate'] ) ) {
649
- $term_CLIdefaultstate = sanitize_text_field( wp_unslash( $_POST['CLIdefaultstate'] ) );
650
 
651
- if ( $term_CLIdefaultstate ) {
652
- $this->update_term_meta( $term_id, 'CLIdefaultstate', $term_CLIdefaultstate );
653
  }
654
  } else {
655
  $this->update_term_meta( $term_id, 'CLIdefaultstate', 'disabled' );
@@ -661,14 +653,14 @@ class Cookie_Law_Info_Cookies {
661
  ?>
662
  <div class="form-field term-head-scripts-field">
663
  <p>
664
- <label><b><?php _e( 'Head scripts', 'cookie-law-info' ); ?></b></label>
665
  <label>Script: eg:- &lt;script&gt; enableGoogleAnalytics(); &lt;/script&gt; </label><br />
666
  <textarea id="_cli_cookie_head_scripts" rows=5 name="_cli_cookie_head_scripts" class="wt-cli-code-editor"></textarea>
667
  </p>
668
  </div>
669
  <div class="form-field term-body-scripts-field">
670
  <p>
671
- <label><b><?php _e( 'Body scripts', 'cookie-law-info' ); ?></b></label>
672
  <label>Script: eg:- &lt;script&gt; enableGoogleAnalytics(); &lt;/script&gt; </label><br />
673
  <textarea id="_cli_cookie_body_scripts" rows="5" name="_cli_cookie_body_scripts" class="wt-cli-code-editor" ></textarea>
674
  </p>
@@ -684,7 +676,7 @@ class Cookie_Law_Info_Cookies {
684
  ?>
685
  <tr class="form-field term-body-scripts-field">
686
  <th>
687
- <label for="_cli_cookie_head_scripts"><?php _e( 'Head scripts', 'cookie-law-info' ); ?></label>
688
  </th>
689
  <td>
690
  <textarea id="_cli_cookie_head_scripts" rows="5" name="_cli_cookie_head_scripts" class="wt-cli-code-editor"><?php echo wp_unslash( $head_scripts ); ?></textarea>
@@ -692,7 +684,7 @@ class Cookie_Law_Info_Cookies {
692
  </tr>
693
  <tr class="form-field term-head-scripts-field">
694
  <th>
695
- <label for="_cli_cookie_body_scripts"><?php _e( 'Body scripts', 'cookie-law-info' ); ?></label>
696
  </th>
697
  <td>
698
  <textarea id="_cli_cookie_body_scripts" rows="5" name="_cli_cookie_body_scripts" class="wt-cli-code-editor"><?php echo wp_unslash( $body_scripts ); ?></textarea>
@@ -710,42 +702,6 @@ class Cookie_Law_Info_Cookies {
710
 
711
  }
712
 
713
- public function add_status_meta() {
714
- ?>
715
- <div class="form-field term-status-field" style="display:none;">
716
- <label for="wt-cli-cookie-status"><?php _e( 'Status', 'cookie-law-info' ); ?></label>
717
- <input type="checkbox" name="_cli_cookie_status" id="wt-cli-cookie-status" value="1" checked="checked">
718
- </div>
719
- <?php
720
- }
721
-
722
- public function edit_status_meta( $term ) {
723
- // put the term ID into a variable
724
- $t_id = $term->term_id;
725
- $term_cli_cookie_status = $this->get_term_meta( $t_id, '_cli_cookie_status', true );
726
-
727
- // if( $this->check_strictly_necessary_category( $t_id ) === false ){
728
- ?>
729
- <tr class="form-field term-status-field">
730
- <th><label for="wt-cli-cookie-status"><?php _e( 'Active', 'cookie-law-info' ); ?></label></th>
731
- <td>
732
- <input type="checkbox" name="_cli_cookie_status" id="wt-cli-cookie-status" value="1" <?php echo $term_cli_cookie_status == 1 ? 'checked="checked"' : ''; ?>>
733
- <p class="description"><?php _e( 'Turing off the category will remove it from the settings popup. Any scripts added under the category will not be rendered on the browser.', 'cookie-law-info' ); ?></p>
734
- </td>
735
- </tr>
736
- <?php
737
- // }
738
- }
739
- public function save_status_meta( $term_id ) {
740
- if ( isset( $_POST['_cli_cookie_status'] ) ) {
741
- $term_cli_cookie_status = sanitize_text_field( wp_unslash( $_POST['_cli_cookie_status'] ) );
742
- if ( $term_cli_cookie_status ) {
743
- $this->update_term_meta( $term_id, '_cli_cookie_status', $term_cli_cookie_status );
744
- }
745
- } else {
746
- $this->update_term_meta( $term_id, '_cli_cookie_status', 0 );
747
- }
748
- }
749
  public function migrate() {
750
  global $wp_version;
751
  if ( isset( $_GET['cat-migrate'] ) && $_GET['cat-migrate'] === 'yes' ) {
@@ -753,9 +709,9 @@ class Cookie_Law_Info_Cookies {
753
  if ( check_admin_referer( 'migrate', 'cookie_law_info_nonce' ) && current_user_can( 'manage_options' ) ) {
754
  if ( version_compare( $wp_version, '4.4', '<' ) ) {
755
  echo '<div class="fade error"><p><strong>';
756
- echo __( 'WordPress 4.4 or higher is the required version. Please consider upgrading the WordPress before migrating the cookie categories.', 'cookie-law-info' );
757
  echo '</strong></p></div>';
758
- if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) {
759
  exit();
760
  }
761
  } else {
@@ -771,7 +727,7 @@ class Cookie_Law_Info_Cookies {
771
 
772
  public function admin_non_necessary_cookie_page() {
773
  if ( ! current_user_can( 'manage_options' ) ) {
774
- wp_die( __( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
775
  }
776
  if ( isset( $_POST['update_thirdparty_settings_form'] ) || isset( $_POST['cli_non-necessary_ajax_update'] ) ) {
777
  check_admin_referer( 'cookielawinfo-update-thirdparty' );
@@ -784,7 +740,7 @@ class Cookie_Law_Info_Cookies {
784
  }
785
  public function admin_necessary_cookie_page() {
786
  if ( ! current_user_can( 'manage_options' ) ) {
787
- wp_die( __( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
788
  }
789
  if ( isset( $_POST['update_necessary_settings_form'] ) || isset( $_POST['cli_necessary_ajax_update'] ) ) {
790
 
@@ -820,9 +776,9 @@ class Cookie_Law_Info_Cookies {
820
  public function finish_request() {
821
 
822
  echo '<div class="updated"><p><strong>';
823
- echo __( 'Settings Updated.', 'cookie-law-info' );
824
  echo '</strong></p></div>';
825
- if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) {
826
  exit();
827
  }
828
  }
@@ -843,16 +799,16 @@ class Cookie_Law_Info_Cookies {
843
  <div class="notice notice-warning">
844
  <div class="wt-cli-admin-notice-wrapper">
845
  <div class="wt-cli-notice-content">
846
- <p style="font-weight:500;font-size:1.05em;"><?php _e( 'Clicking “Migrate cookie categories” will auto migrate your existing cookie categories (Necessary and Non-necessary) to our new Cookie Category taxonomy. This action is required to enable the cookie scanner.', 'cookie-law-info' ); ?></p>
847
- <h3 style="font-size:1.05em;"><?php echo __( 'What happens after migration?', 'cookie-law-info' ); ?></h3>
848
  <ul>
849
- <li><?php echo __( 'You no longer need to manage static cookie categories. After the migration, new cookie categories (Necessary, Functional, Analytics, Performance, Advertisement, and Others) will be created automatically. Also, you can easily add custom cookie categories and edit/delete the existing categories including the custom categories.', 'cookie-law-info' ); ?></li>
850
- <li><?php echo __( 'If you have made any changes to the existing "Non-necessary" category we will migrate it to the newly created “Cookie Category” section. If not, we will delete the "Non-necessary" category automatically.', 'cookie-law-info' ); ?></li>
851
- <li><?php echo __( 'During the migration phase your existing cookie category translations will be lost. Hence we request you to add it manually soon after the migration. You can access the existing translations by navigating to the string translation settings of your translator plugin.', 'cookie-law-info' ); ?></li>
852
  </ul>
853
  </div>
854
  <div class="wt-cli-notice-actions">
855
- <a href="<?php echo wp_nonce_url( $url, 'migrate', 'cookie_law_info_nonce' ); ?>" class="button button-primary"><?php echo __( 'Migrate cookie categories', 'cookie-law-info' ); ?></a>
856
  </div>
857
  </div>
858
  </div>
@@ -1105,7 +1061,7 @@ class Cookie_Law_Info_Cookies {
1105
  public function get_meta_data_from_db( $term_id, $meta_key ) {
1106
  global $wpdb;
1107
  $term_value = false;
1108
- $term_meta = $wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->termmeta WHERE term_id = %d AND meta_key = %s", $term_id, $meta_key ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1109
  if ( $term_meta ) {
1110
  $term_value = $term_meta->meta_value;
1111
  }
@@ -1118,9 +1074,9 @@ class Cookie_Law_Info_Cookies {
1118
  * @param string $value value of the corresponding key.
1119
  * @return array
1120
  */
1121
- public function get_term_data_from_db( $key, $value ) {
1122
  global $wpdb;
1123
- $term_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE $key = %s", $value ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.NotPrepared
1124
  if ( $term_data && is_object( $term_data ) ) {
1125
  return $term_data;
1126
  }
@@ -1163,12 +1119,12 @@ class Cookie_Law_Info_Cookies {
1163
  array_merge(
1164
  wp_kses_allowed_html( 'post' ),
1165
  array(
1166
- 'script' => array(
1167
- 'type' => array(),
1168
- 'src' => array(),
1169
  'charset' => array(),
1170
- 'async' => array(),
1171
- 'defer' => array(),
1172
  ),
1173
  'noscript' => array(),
1174
  )
65
  }
66
 
67
  public function wp_term_is_shared( $term_id ) {
68
+ global $wpdb;
 
69
  if ( get_option( 'finished_splitting_shared_terms' ) ) {
70
  return false;
71
  }
 
72
  $tt_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term_id ) );
 
73
  return $tt_count > 1;
74
  }
75
 
148
  'delete_post' => 'manage_options',
149
  'read_post' => 'manage_options',
150
  ),
 
151
  'menu_icon' => plugin_dir_url( __FILE__ ) . 'images/cli_icon.png',
152
  'hierarchical' => false,
153
  'menu_position' => null,
159
 
160
  public function add_category_meta( $term_id ) {
161
  $this->cookie_save_defaultstate( $term_id );
 
162
  $this->save_scripts_meta( $term_id );
163
  $this->save_priority_meta( $term_id );
164
  }
165
  public function edit_category_meta( $term_id ) {
166
  $this->cookie_save_defaultstate( $term_id );
167
  $this->save_scripts_meta( $term_id );
 
168
  }
169
  public function add_category_form_fields( $term ) {
170
  $this->cookie_add_defaultstate( $term );
171
  $this->add_scripts_meta( $term );
 
172
  }
173
  public function edit_category_form_fields( $term ) {
174
  $this->cookie_edit_defaultstate( $term );
175
  $this->edit_scripts_meta( $term );
 
176
  }
177
  public function add_meta_box() {
178
 
187
  $custom = get_post_custom( $post->ID );
188
  $cookie_slugid = ( isset( $custom['_cli_cookie_slugid'][0] ) ) ? $custom['_cli_cookie_slugid'][0] : '';
189
  ?>
190
+ <label><?php echo esc_html__( 'Cookie ID', 'cookie-law-info' ); ?></label>
191
  <input name="_cli_cookie_slugid" value="<?php echo esc_attr( sanitize_text_field( $cookie_slugid ) ); ?>" style="width:95%;" />
192
  <?php
193
  }
198
  $custom = get_post_custom( $post->ID );
199
  $cookie_type = ( isset( $custom['_cli_cookie_type'][0] ) ) ? $custom['_cli_cookie_type'][0] : '';
200
  ?>
201
+ <label><?php echo esc_html__( 'Cookie Type: (persistent, session, third party )', 'cookie-law-info' ); ?></label>
202
  <input name="_cli_cookie_type" value="<?php echo esc_attr( sanitize_text_field( $cookie_type ) ); ?>" style="width:95%;" />
203
  <?php
204
  }
210
  $cookie_duration = ( isset( $custom['_cli_cookie_duration'][0] ) ) ? $custom['_cli_cookie_duration'][0] : '';
211
  ?>
212
 
213
+ <label><?php echo esc_html__( 'Cookie Duration:', 'cookie-law-info' ); ?></label>
214
  <input name="_cli_cookie_duration" value="<?php echo esc_attr( sanitize_text_field( $cookie_duration ) ); ?>" style="width:95%;" />
215
  <?php
216
  }
221
  $custom = get_post_custom( $post->ID );
222
  $cookie_sensitivity = ( isset( $custom['_cli_cookie_sensitivity'][0] ) ) ? $custom['_cli_cookie_sensitivity'][0] : '';
223
  ?>
224
+ <label><?php echo esc_html__( 'Cookie Sensitivity: ( necessary , non-necessary )', 'cookie-law-info' ); ?></label>
225
  <input name="_cli_cookie_sensitivity" value="<?php echo esc_attr( sanitize_text_field( $cookie_sensitivity ) ); ?>" style="width:95%;" />
226
  <?php
227
  }
344
  $necessory_categories = self::get_strictly_necessory_categories();
345
  $necessory_category_ids = array();
346
  foreach ( $necessory_categories as $category ) {
347
+ $term = $this->get_term_data_by_slug( $category );
348
  if ( false !== $term ) {
349
  $necessory_category_ids[] = $term->term_id;
350
  }
597
  public function cookie_add_defaultstate( $term ) {
598
  ?>
599
  <div class="form-field term-defaultstate-field">
600
+ <label for="CLIdefaultstate"><?php echo esc_html__( 'Category default state', 'cookie-law-info' ); ?></label>
601
+ <input type="radio" name="CLIdefaultstate" value="enabled" /><?php echo esc_html__( 'Enabled', 'cookie-law-info' ); ?>
602
+ <input type="radio" name="CLIdefaultstate" value="disabled" checked /><?php echo esc_html__( 'Disabled', 'cookie-law-info' ); ?>
603
+ <p class="description"><?php echo esc_html__( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?></p>
604
  </div>
605
  <?php
606
  }
616
  */
617
  public function cookie_edit_defaultstate( $term ) {
618
  // put the term ID into a variable
619
+ $t_id = $term->term_id;
620
+ $term_default_state = $this->get_term_meta( $t_id, 'CLIdefaultstate', true );
621
 
622
  if ( $this->check_strictly_necessary_category( $t_id ) === false ) {
623
  ?>
624
  <tr class="form-field term-defaultstate-field">
625
+ <th><label for="CLIdefaultstate"><?php echo esc_html__( 'Category default state', 'cookie-law-info' ); ?></label></th>
626
  <td>
627
+ <input type="radio" name="CLIdefaultstate" value="enabled" <?php checked( $term_default_state, 'enabled' ); ?>/><label><?php echo esc_html__( 'Enabled', 'cookie-law-info' ); ?></label>
628
+ <input type="radio" name="CLIdefaultstate" value="disabled" <?php checked( $term_default_state, 'disabled' ); ?>/><label><?php echo esc_html__( 'Disabled', 'cookie-law-info' ); ?></label>
629
+ <p class="description"><?php echo esc_html__( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?></p>
630
  </td>
631
  </tr>
632
  <?php
638
  */
639
  public function cookie_save_defaultstate( $term_id ) {
640
  if ( isset( $_POST['CLIdefaultstate'] ) ) {
641
+ $term_default_state = sanitize_text_field( wp_unslash( $_POST['CLIdefaultstate'] ) );
642
 
643
+ if ( $term_default_state ) {
644
+ $this->update_term_meta( $term_id, 'CLIdefaultstate', $term_default_state );
645
  }
646
  } else {
647
  $this->update_term_meta( $term_id, 'CLIdefaultstate', 'disabled' );
653
  ?>
654
  <div class="form-field term-head-scripts-field">
655
  <p>
656
+ <label><b><?php echo esc_html__( 'Head scripts', 'cookie-law-info' ); ?></b></label>
657
  <label>Script: eg:- &lt;script&gt; enableGoogleAnalytics(); &lt;/script&gt; </label><br />
658
  <textarea id="_cli_cookie_head_scripts" rows=5 name="_cli_cookie_head_scripts" class="wt-cli-code-editor"></textarea>
659
  </p>
660
  </div>
661
  <div class="form-field term-body-scripts-field">
662
  <p>
663
+ <label><b><?php echo esc_html__( 'Body scripts', 'cookie-law-info' ); ?></b></label>
664
  <label>Script: eg:- &lt;script&gt; enableGoogleAnalytics(); &lt;/script&gt; </label><br />
665
  <textarea id="_cli_cookie_body_scripts" rows="5" name="_cli_cookie_body_scripts" class="wt-cli-code-editor" ></textarea>
666
  </p>
676
  ?>
677
  <tr class="form-field term-body-scripts-field">
678
  <th>
679
+ <label for="_cli_cookie_head_scripts"><?php echo esc_html__( 'Head scripts', 'cookie-law-info' ); ?></label>
680
  </th>
681
  <td>
682
  <textarea id="_cli_cookie_head_scripts" rows="5" name="_cli_cookie_head_scripts" class="wt-cli-code-editor"><?php echo wp_unslash( $head_scripts ); ?></textarea>
684
  </tr>
685
  <tr class="form-field term-head-scripts-field">
686
  <th>
687
+ <label for="_cli_cookie_body_scripts"><?php echo esc_html__( 'Body scripts', 'cookie-law-info' ); ?></label>
688
  </th>
689
  <td>
690
  <textarea id="_cli_cookie_body_scripts" rows="5" name="_cli_cookie_body_scripts" class="wt-cli-code-editor"><?php echo wp_unslash( $body_scripts ); ?></textarea>
702
 
703
  }
704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  public function migrate() {
706
  global $wp_version;
707
  if ( isset( $_GET['cat-migrate'] ) && $_GET['cat-migrate'] === 'yes' ) {
709
  if ( check_admin_referer( 'migrate', 'cookie_law_info_nonce' ) && current_user_can( 'manage_options' ) ) {
710
  if ( version_compare( $wp_version, '4.4', '<' ) ) {
711
  echo '<div class="fade error"><p><strong>';
712
+ echo esc_html__( 'WordPress 4.4 or higher is the required version. Please consider upgrading the WordPress before migrating the cookie categories.', 'cookie-law-info' );
713
  echo '</strong></p></div>';
714
+ if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ) ) == 'xmlhttprequest' ) {
715
  exit();
716
  }
717
  } else {
727
 
728
  public function admin_non_necessary_cookie_page() {
729
  if ( ! current_user_can( 'manage_options' ) ) {
730
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
731
  }
732
  if ( isset( $_POST['update_thirdparty_settings_form'] ) || isset( $_POST['cli_non-necessary_ajax_update'] ) ) {
733
  check_admin_referer( 'cookielawinfo-update-thirdparty' );
740
  }
741
  public function admin_necessary_cookie_page() {
742
  if ( ! current_user_can( 'manage_options' ) ) {
743
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
744
  }
745
  if ( isset( $_POST['update_necessary_settings_form'] ) || isset( $_POST['cli_necessary_ajax_update'] ) ) {
746
 
776
  public function finish_request() {
777
 
778
  echo '<div class="updated"><p><strong>';
779
+ echo esc_html__( 'Settings Updated.', 'cookie-law-info' );
780
  echo '</strong></p></div>';
781
+ if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ) ) == 'xmlhttprequest' ) {
782
  exit();
783
  }
784
  }
799
  <div class="notice notice-warning">
800
  <div class="wt-cli-admin-notice-wrapper">
801
  <div class="wt-cli-notice-content">
802
+ <p style="font-weight:500;font-size:1.05em;"><?php echo esc_html__( 'Clicking “Migrate cookie categories” will auto migrate your existing cookie categories (Necessary and Non-necessary) to our new Cookie Category taxonomy. This action is required to enable the cookie scanner.', 'cookie-law-info' ); ?></p>
803
+ <h3 style="font-size:1.05em;"><?php echo esc_html__( 'What happens after migration?', 'cookie-law-info' ); ?></h3>
804
  <ul>
805
+ <li><?php echo esc_html__( 'You no longer need to manage static cookie categories. After the migration, new cookie categories (Necessary, Functional, Analytics, Performance, Advertisement, and Others) will be created automatically. Also, you can easily add custom cookie categories and edit/delete the existing categories including the custom categories.', 'cookie-law-info' ); ?></li>
806
+ <li><?php echo esc_html__( 'If you have made any changes to the existing "Non-necessary" category we will migrate it to the newly created “Cookie Category” section. If not, we will delete the "Non-necessary" category automatically.', 'cookie-law-info' ); ?></li>
807
+ <li><?php echo esc_html__( 'During the migration phase your existing cookie category translations will be lost. Hence we request you to add it manually soon after the migration. You can access the existing translations by navigating to the string translation settings of your translator plugin.', 'cookie-law-info' ); ?></li>
808
  </ul>
809
  </div>
810
  <div class="wt-cli-notice-actions">
811
+ <a href="<?php echo esc_attr( wp_nonce_url( $url, 'migrate', 'cookie_law_info_nonce' ) ); ?>" class="button button-primary"><?php echo esc_html__( 'Migrate cookie categories', 'cookie-law-info' ); ?></a>
812
  </div>
813
  </div>
814
  </div>
1061
  public function get_meta_data_from_db( $term_id, $meta_key ) {
1062
  global $wpdb;
1063
  $term_value = false;
1064
+ $term_meta = $wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->termmeta WHERE term_id = %d AND meta_key = %s", $term_id, $meta_key ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
1065
  if ( $term_meta ) {
1066
  $term_value = $term_meta->meta_value;
1067
  }
1074
  * @param string $value value of the corresponding key.
1075
  * @return array
1076
  */
1077
+ public function get_term_data_by_slug( $value ) {
1078
  global $wpdb;
1079
+ $term_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE slug = %s", $value ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
1080
  if ( $term_data && is_object( $term_data ) ) {
1081
  return $term_data;
1082
  }
1119
  array_merge(
1120
  wp_kses_allowed_html( 'post' ),
1121
  array(
1122
+ 'script' => array(
1123
+ 'type' => array(),
1124
+ 'src' => array(),
1125
  'charset' => array(),
1126
+ 'async' => array(),
1127
+ 'defer' => array(),
1128
  ),
1129
  'noscript' => array(),
1130
  )
admin/modules/cookies/views/necessary-settings.php CHANGED
@@ -1,58 +1,59 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  ?>
7
  <style>
8
- .vvv_textbox{
9
- height: 150px;
10
- width:100%;
11
- }
12
- #wpbody-content .notice {
13
- margin: 5px 20px 15px 0;
14
- }
15
- .notice, div.updated, div.error{
16
- margin: 5px 20px 15px 0;
17
- }
18
  </style>
19
  <script type="text/javascript">
20
- var cli_success_message='<?php echo __('Settings updated.', 'cookie-law-info');?>';
21
- var cli_error_message='<?php echo __('Unable to update Settings.', 'cookie-law-info');?>';
22
  </script>
23
  <div class="wrap">
24
- <div class="cookie-law-info-form-container">
25
- <div class="cli-plugin-toolbar top">
26
- <h3><?php echo __('Necessary Cookie Settings','cookie-law-info'); ?></h3>
27
- </div>
28
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>" id="cli_ncessary_form" class="cookie-sensitivity-form">
29
- <?php wp_nonce_field('cookielawinfo-update-necessary'); ?>
30
- <table class="form-table cli_necessary_form cli-admin-table">
31
- <tr>
32
- <td>
33
- <label for="wt_cli_necessary_title"><?php _e('Title', 'cookie-law-info'); ?></label>
34
- <input type="text" id="wt_cli_necessary_title" name="wt_cli_necessary_title" value="<?php echo stripslashes( $settings['title'] ); ?>" class="cli-textbox" />
35
- </td>
36
- </tr>
37
- <tr>
38
- <td>
39
- <label for="necessary_description"><?php echo __('Description','cookie-law-info');?></label>
40
- <textarea name="necessary_description" class="vvv_textbox"><?php
41
- echo apply_filters('format_to_edit', stripslashes($settings['description']));
42
- ?></textarea>
43
- </td>
44
- </tr>
45
-
46
- </table>
47
- <div class="cli-plugin-toolbar bottom">
48
- <div class="left">
49
- </div>
50
- <div class="right">
51
- <input type="hidden" name="cli_necessary_ajax_update" value="1">
52
- <input type="submit" name="update_admin_settings_form" value="<?php _e('Update Settings', 'cookie-law-info'); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
53
- <span class="spinner" style="margin-top:9px"></span>
54
- </div>
55
- </div>
56
- </form>
57
- </div>
58
- </div>
 
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  ?>
7
  <style>
8
+ .vvv_textbox{
9
+ height: 150px;
10
+ width:100%;
11
+ }
12
+ #wpbody-content .notice {
13
+ margin: 5px 20px 15px 0;
14
+ }
15
+ .notice, div.updated, div.error{
16
+ margin: 5px 20px 15px 0;
17
+ }
18
  </style>
19
  <script type="text/javascript">
20
+ var cli_success_message='<?php echo esc_html__( 'Settings updated.', 'cookie-law-info' ); ?>';
21
+ var cli_error_message='<?php echo esc_html__( 'Unable to update Settings.', 'cookie-law-info' ); ?>';
22
  </script>
23
  <div class="wrap">
24
+ <div class="cookie-law-info-form-container">
25
+ <div class="cli-plugin-toolbar top">
26
+ <h3><?php echo esc_html__( 'Necessary Cookie Settings', 'cookie-law-info' ); ?></h3>
27
+ </div>
28
+ <?php $form_action = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; ?>
29
+
30
+ <form method="post" action="<?php echo esc_url( $form_action ); ?>" id="cli_ncessary_form" class="cookie-sensitivity-form">
31
+ <?php wp_nonce_field( 'cookielawinfo-update-necessary' ); ?>
32
+ <table class="form-table cli_necessary_form cli-admin-table">
33
+ <tr>
34
+ <td>
35
+ <label for="wt_cli_necessary_title"><?php echo esc_html__( 'Title', 'cookie-law-info' ); ?></label>
36
+ <input type="text" id="wt_cli_necessary_title" name="wt_cli_necessary_title" value="<?php echo esc_attr( stripslashes( $settings['title'] ) ); ?>" class="cli-textbox" />
37
+ </td>
38
+ </tr>
39
+ <tr>
40
+ <td>
41
+ <label for="necessary_description"><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></label>
42
+ <textarea name="necessary_description" class="vvv_textbox"><?php echo wp_kses_post( apply_filters( 'format_to_edit', stripslashes( $settings['description'] ) ) ); ?>
43
+ </textarea>
44
+ </td>
45
+ </tr>
46
+
47
+ </table>
48
+ <div class="cli-plugin-toolbar bottom">
49
+ <div class="left">
50
+ </div>
51
+ <div class="right">
52
+ <input type="hidden" name="cli_necessary_ajax_update" value="1">
53
+ <input type="submit" name="update_admin_settings_form" value="<?php echo esc_html__( 'Update Settings', 'cookie-law-info' ); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
54
+ <span class="spinner" style="margin-top:9px"></span>
55
+ </div>
56
+ </div>
57
+ </form>
58
+ </div>
59
+ </div>
admin/modules/cookies/views/non-necessary-settings.php CHANGED
@@ -1,93 +1,90 @@
1
  <?php
2
  // If this file is called directly, abort.
3
- if (!defined('WPINC')) {
4
- die;
5
  }
6
  ?>
7
  <style>
8
- .vvv_textbox {
9
- height: 150px;
10
- width: 100%;
11
- }
12
- .notice, div.updated, div.error{
13
- margin: 5px 20px 15px 0;
14
- }
15
  </style>
16
  <script type="text/javascript">
17
- var cli_success_message = '<?php echo __('Settings updated.', 'cookie-law-info'); ?>';
18
- var cli_error_message = '<?php echo __('Unable to update Settings.', 'cookie-law-info'); ?>';
19
  </script>
20
  <div class="wrap">
21
- <div class="cookie-law-info-form-container">
22
- <div class="cli-plugin-toolbar top">
23
- <h3><?php echo __('Non-necessary Cookie Settings', 'cookie-law-info'); ?></h3>
24
- </div>
25
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>" id="cli_non-ncessary_form" class="cookie-sensitivity-form">
26
- <?php wp_nonce_field('cookielawinfo-update-thirdparty'); ?>
27
- <table class="form-table cli_non_necessary_form cli-admin-table">
 
28
 
29
- <tr>
30
- <td>
31
- <label for="thirdparty_on_field"><?php echo __('Enable Non-necessary Cookie', 'cookie-law-info'); ?></label>
32
- <input type="radio" id="thirdparty_on_field_yes" name="thirdparty_on_field" class="styled" value="true" <?php echo (filter_var($settings['status'], FILTER_VALIDATE_BOOLEAN) == true) ? ' checked="checked" ' : ' '; ?> /><?php echo __('Yes', 'cookie-law-info'); ?>
33
- <input type="radio" id="thirdparty_on_field_no" name="thirdparty_on_field" class="styled" value="false" <?php echo (filter_var($settings['status'], FILTER_VALIDATE_BOOLEAN) == false) ? ' checked="checked" ' : ''; ?> /><?php echo __('No', 'cookie-law-info'); ?>
34
- </td>
35
- </tr>
36
- <tr>
37
- <td>
38
- <label for="third_party_default_state"><?php echo __('Default state', 'cookie-law-info'); ?></label>
39
- <input type="radio" id="third_party_default_state_yes" name="third_party_default_state" class="styled" value="true" <?php echo (filter_var($settings['default_state'], FILTER_VALIDATE_BOOLEAN) == true) ? ' checked="checked" ' : ' '; ?> /><?php echo __('Enabled', 'cookie-law-info'); ?>
40
- <input type="radio" id="third_party_default_state_no" name="third_party_default_state" class="styled" value="false" <?php echo (filter_var($settings['default_state'], FILTER_VALIDATE_BOOLEAN) == false) ? ' checked="checked" ' : ''; ?> /><?php echo __('Disabled', 'cookie-law-info'); ?>
41
- <span class="cli_form_help">
42
- <?php echo __('If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info'); ?> <br />
43
- </span>
44
- </td>
45
- </tr>
46
- <tr>
47
- <td>
48
- <label for="wt_cli_non_necessary_title"><?php _e('Title', 'cookie-law-info'); ?></label>
49
- <input type="text" id="wt_cli_non_necessary_title" name="wt_cli_non_necessary_title" value="<?php echo esc_attr( sanitize_text_field( stripslashes( $settings['title'] ) ) ); ?>" class="cli-textbox" />
50
- </td>
51
- </tr>
52
- <tr>
53
- <td>
54
- <label for="thirdparty_description"><?php echo __('Description', 'cookie-law-info'); ?></label>
55
- <textarea name="thirdparty_description" class="vvv_textbox"><?php
56
- echo apply_filters('format_to_edit', stripslashes($settings['description']));
57
- ?></textarea>
58
- </td>
59
- </tr>
60
- <tr>
61
- <td>
62
- <label for="thirdparty_head_section"><?php echo __('This script will be added to the page HEAD section if the above settings is enabled and user has give consent.', 'cookie-law-info'); ?></label>
63
- <textarea name="thirdparty_head_section" class="vvv_textbox"><?php
64
- echo apply_filters('format_to_edit', stripslashes( $settings['head_scripts']));
65
- ?></textarea>
66
- <span class="cli_form_help">
67
- <?php echo __('Print scripts in the head tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info'); ?> <br />
68
- eg:- &lt;script&gt;console.log("header script");&lt;/script&gt
69
- </span>
70
- </td>
71
- </tr>
72
- <tr>
73
- <td>
74
- <label for="thirdparty_body_section"><?php echo __('This script will be added right after the BODY section if the above settings is enabled and user has given consent.', 'cookie-law-info'); ?></label>
75
- <textarea name="thirdparty_body_section" class="vvv_textbox"><?php echo apply_filters('format_to_edit', stripslashes($settings['body_scripts'])); ?></textarea>
76
- <span class="cli_form_help">
77
- <?php echo __('Print scripts before the closing body tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info'); ?> <br />eg:- &lt;script&gt;console.log("body script");&lt;/script&gt;
78
- </span>
79
- </td>
80
- </tr>
81
- </table>
82
- <div class="cli-plugin-toolbar bottom">
83
- <div class="left">
84
- </div>
85
- <div class="right">
86
- <input type="hidden" name="cli_non-necessary_ajax_update" value="1">
87
- <input type="submit" name="update_admin_settings_form" value="<?php _e('Update Settings', 'cookie-law-info'); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
88
- <span class="spinner" style="margin-top:9px"></span>
89
- </div>
90
- </div>
91
- </form>
92
- </div>
93
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  ?>
7
  <style>
8
+ .vvv_textbox {
9
+ height: 150px;
10
+ width: 100%;
11
+ }
12
+ .notice, div.updated, div.error{
13
+ margin: 5px 20px 15px 0;
14
+ }
15
  </style>
16
  <script type="text/javascript">
17
+ var cli_success_message = '<?php echo esc_html__( 'Settings updated.', 'cookie-law-info' ); ?>';
18
+ var cli_error_message = '<?php echo esc_html__( 'Unable to update Settings.', 'cookie-law-info' ); ?>';
19
  </script>
20
  <div class="wrap">
21
+ <div class="cookie-law-info-form-container">
22
+ <div class="cli-plugin-toolbar top">
23
+ <h3><?php echo esc_html__( 'Non-necessary Cookie Settings', 'cookie-law-info' ); ?></h3>
24
+ </div>
25
+ <?php $form_action = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; ?>
26
+ <form method="post" action="<?php echo esc_url( $form_action ); ?>" id="cli_non-ncessary_form" class="cookie-sensitivity-form">
27
+ <?php wp_nonce_field( 'cookielawinfo-update-thirdparty' ); ?>
28
+ <table class="form-table cli_non_necessary_form cli-admin-table">
29
 
30
+ <tr>
31
+ <td>
32
+ <label for="thirdparty_on_field"><?php echo esc_html__( 'Enable Non-necessary Cookie', 'cookie-law-info' ); ?></label>
33
+ <input type="radio" id="thirdparty_on_field_yes" name="thirdparty_on_field" class="styled" value="true" <?php echo ( filter_var( $settings['status'], FILTER_VALIDATE_BOOLEAN ) == true ) ? ' checked="checked" ' : ' '; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
34
+ <input type="radio" id="thirdparty_on_field_no" name="thirdparty_on_field" class="styled" value="false" <?php echo ( filter_var( $settings['status'], FILTER_VALIDATE_BOOLEAN ) == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td>
39
+ <label for="third_party_default_state"><?php echo esc_html__( 'Default state', 'cookie-law-info' ); ?></label>
40
+ <input type="radio" id="third_party_default_state_yes" name="third_party_default_state" class="styled" value="true" <?php echo ( filter_var( $settings['default_state'], FILTER_VALIDATE_BOOLEAN ) == true ) ? ' checked="checked" ' : ' '; ?> /><?php echo esc_html__( 'Enabled', 'cookie-law-info' ); ?>
41
+ <input type="radio" id="third_party_default_state_no" name="third_party_default_state" class="styled" value="false" <?php echo ( filter_var( $settings['default_state'], FILTER_VALIDATE_BOOLEAN ) == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'Disabled', 'cookie-law-info' ); ?>
42
+ <span class="cli_form_help">
43
+ <?php echo esc_html__( 'If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info' ); ?> <br />
44
+ </span>
45
+ </td>
46
+ </tr>
47
+ <tr>
48
+ <td>
49
+ <label for="wt_cli_non_necessary_title"><?php esc_html__( 'Title', 'cookie-law-info' ); ?></label>
50
+ <input type="text" id="wt_cli_non_necessary_title" name="wt_cli_non_necessary_title" value="<?php echo esc_attr( sanitize_text_field( stripslashes( $settings['title'] ) ) ); ?>" class="cli-textbox" />
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>
55
+ <label for="thirdparty_description"><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></label>
56
+ <textarea name="thirdparty_description" class="vvv_textbox"> <?php echo wp_kses_post( apply_filters( 'format_to_edit', stripslashes( $settings['description'] ) ) ); ?></textarea>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td>
61
+ <label for="thirdparty_head_section"><?php echo esc_html__( 'This script will be added to the page HEAD section if the above settings is enabled and user has give consent.', 'cookie-law-info' ); ?></label>
62
+ <textarea name="thirdparty_head_section" class="vvv_textbox"><?php echo apply_filters( 'format_to_edit', stripslashes( $settings['head_scripts'] ) ); ?></textarea>
63
+ <span class="cli_form_help">
64
+ <?php echo esc_html__( 'Print scripts in the head tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info' ); ?> <br />
65
+ eg:- &lt;script&gt;console.log("header script");&lt;/script&gt
66
+ </span>
67
+ </td>
68
+ </tr>
69
+ <tr>
70
+ <td>
71
+ <label for="thirdparty_body_section"><?php echo esc_html__( 'This script will be added right after the BODY section if the above settings is enabled and user has given consent.', 'cookie-law-info' ); ?></label>
72
+ <textarea name="thirdparty_body_section" class="vvv_textbox"><?php echo apply_filters( 'format_to_edit', stripslashes( $settings['body_scripts'] ) ); ?></textarea>
73
+ <span class="cli_form_help">
74
+ <?php echo esc_html__( 'Print scripts before the closing body tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info' ); ?> <br />eg:- &lt;script&gt;console.log("body script");&lt;/script&gt;
75
+ </span>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+ <div class="cli-plugin-toolbar bottom">
80
+ <div class="left">
81
+ </div>
82
+ <div class="right">
83
+ <input type="hidden" name="cli_non-necessary_ajax_update" value="1">
84
+ <input type="submit" name="update_admin_settings_form" value="<?php echo esc_html__( 'Update Settings', 'cookie-law-info' ); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
85
+ <span class="spinner" style="margin-top:9px"></span>
86
+ </div>
87
+ </div>
88
+ </form>
89
+ </div>
90
+ </div>
 
 
 
 
admin/modules/uninstall-feedback/uninstall-feedback.php CHANGED
@@ -80,7 +80,7 @@ class Cookie_Law_Info_Uninstall_Feedback {
80
  ),
81
  ),
82
  ),
83
- array(
84
  'id' => 'found-better-plugin',
85
  'text' => __( 'I found a better plugin', 'cookie-law-info' ),
86
  'type' => 'text',
@@ -90,7 +90,7 @@ class Cookie_Law_Info_Uninstall_Feedback {
90
  'id' => 'upgrade-to-pro',
91
  'text' => __( 'Upgrade to pro', 'cookie-law-info' ),
92
  ),
93
- array(
94
  'id' => 'temporary-deactivation',
95
  'text' => __( 'It’s a temporary deactivation', 'cookie-law-info' ),
96
  ),
@@ -115,28 +115,28 @@ class Cookie_Law_Info_Uninstall_Feedback {
115
  ?>
116
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal" id="<?php echo esc_attr( $this->plugin_id ); ?>-modal">
117
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-wrap">
118
- <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-header">
119
- <h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'cookie-law-info' ); ?></h3>
120
  </div>
121
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-body">
122
  <ul class="reasons">
123
  <?php
124
  foreach ( $reasons as $reason ) :
125
- $data_type = ( isset( $reason['type'] ) ? 'data-type="' . esc_attr( $reason['type'] ) . '"' : '' );
126
- $placeholder = ( isset( $reason['type'] ) ? 'data-placeholder="' . esc_attr( $reason['placeholder'] ) . '"' : '' );
127
  $childs = ( isset( $reason['child'] ) && is_array( $reason['child'] ) ) ? $reason['child'] : array();
128
  ?>
129
- <li <?php echo $data_type; ?> <?php echo $placeholder; ?>>
130
- <label><input type="radio" name="selected-reason" value="<?php echo $reason['id']; ?>"><?php echo $reason['text']; ?></label>
131
  <?php if ( ! empty( $childs ) ) : ?>
132
  <ul class="<?php echo esc_attr( $this->plugin_id ) . '-sub-reasons'; ?>">
133
  <?php
134
  foreach ( $childs as $child ) :
135
- $data_type = ( isset( $child['type'] ) ? 'data-type="' . esc_attr( $child['type'] ) . '"' : '' );
136
- $placeholder = ( isset( $child['type'] ) ? 'data-placeholder="' . esc_attr( $child['placeholder'] ) . '"' : '' );
137
  ?>
138
- <li <?php echo $data_type; ?> <?php echo $placeholder; ?>>
139
- <label><input type="radio" name="selected-reason" value="<?php echo $child['id']; ?>"><?php echo $child['text']; ?></label>
140
  <?php endforeach; ?>
141
  </ul>
142
  <?php endif; ?>
@@ -146,23 +146,23 @@ class Cookie_Law_Info_Uninstall_Feedback {
146
  <?php endforeach; ?>
147
  </ul>
148
  <div class="wt-uninstall-feedback-privacy-policy">
149
- <?php _e( "We do not collect any personal data when you submit this form. It's your feedback that we value.", 'cookie-law-info' ); ?>
150
- <a href="https://www.webtoffee.com/privacy-policy/" target="_blank"><?php _e( 'Privacy Policy', 'cookie-law-info' ); ?></a>
151
  </div>
152
  </div>
153
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-footer">
154
 
155
  <a class="button-primary" href="https://www.webtoffee.com/support/" target="_blank">
156
  <span class="dashicons dashicons-external" style="margin-top:3px;"></span>
157
- <?php _e( 'Go to support', 'cookie-law-info' ); ?></a>
158
- <button class="button-primary <?php echo esc_attr( $this->plugin_id ); ?>-model-submit"><?php _e( 'Submit & Deactivate', 'cookie-law-info' ); ?></button>
159
- <button class="button-secondary <?php echo esc_attr( $this->plugin_id ); ?>-model-cancel"><?php _e( 'Cancel', 'cookie-law-info' ); ?></button>
160
- <a href="#" style="color: #737373;" class="dont-bother-me"><?php _e( 'I rather wouldn\'t say', 'cookie-law-info' ); ?></a>
161
  </div>
162
  </div>
163
  </div>
164
  <style type="text/css">
165
- .<?php echo $this->plugin_id; ?>-modal {
166
  position: fixed;
167
  z-index: 99999;
168
  top: 0;
@@ -173,48 +173,48 @@ class Cookie_Law_Info_Uninstall_Feedback {
173
  display: none;
174
  }
175
 
176
- .<?php echo $this->plugin_id; ?>-modal.modal-active {
177
  display: block;
178
  }
179
 
180
- .<?php echo $this->plugin_id; ?>-modal-wrap {
181
  width: 50%;
182
  position: relative;
183
  margin: 10% auto;
184
  background: #fff;
185
  }
186
 
187
- .<?php echo $this->plugin_id; ?>-modal-header {
188
  border-bottom: 1px solid #eee;
189
  padding: 8px 20px;
190
  }
191
 
192
- .<?php echo $this->plugin_id; ?>-modal-header h3 {
193
  line-height: 150%;
194
  margin: 0;
195
  }
196
 
197
- .<?php echo $this->plugin_id; ?>-modal-body {
198
  padding: 5px 20px 20px 20px;
199
  }
200
 
201
- .<?php echo $this->plugin_id; ?>-modal-body .input-text,
202
- .<?php echo $this->plugin_id; ?>-modal-body textarea {
203
  width: 75%;
204
  }
205
 
206
- .<?php echo $this->plugin_id; ?>-modal-body .reason-input {
207
  margin-top: 5px;
208
  margin-left: 20px;
209
  }
210
 
211
- .<?php echo $this->plugin_id; ?>-modal-footer {
212
  border-top: 1px solid #eee;
213
  padding: 12px 20px;
214
  text-align: left;
215
  }
216
 
217
- .<?php echo $this->plugin_id; ?>-sub-reasons {
218
  display: none;
219
  padding-left: 20px;
220
  padding-top: 10px;
@@ -239,7 +239,7 @@ class Cookie_Law_Info_Uninstall_Feedback {
239
  <script type="text/javascript">
240
  (function($) {
241
  $(function() {
242
- var plugin_id = '<?php echo $this->plugin_id; ?>';
243
  var modal = $('#' + plugin_id + '-modal');
244
  var deactivateLink = '';
245
  $('a.' + plugin_id + '-deactivate-link').click(function(e) {
@@ -286,7 +286,8 @@ class Cookie_Law_Info_Uninstall_Feedback {
286
  data: {
287
  action: plugin_id + '_submit_uninstall_reason',
288
  reason_id: (0 === $radio.length) ? 'none' : $radio.val(),
289
- reason_info: (0 !== $input.length) ? $input.val().trim() : ''
 
290
  },
291
  beforeSend: function() {
292
  button.addClass('disabled');
@@ -304,20 +305,20 @@ class Cookie_Law_Info_Uninstall_Feedback {
304
  }
305
 
306
  public function send_uninstall_reason() {
 
307
  global $wpdb;
308
  if ( ! isset( $_POST['reason_id'] ) ) {
309
  wp_send_json_error();
310
  }
311
- // $current_user = wp_get_current_user();
312
  $data = array(
313
- 'reason_id' => sanitize_text_field( $_POST['reason_id'] ),
314
  'plugin' => $this->plugin_id,
315
  'auth' => $this->auth_key,
316
  'date' => gmdate( 'M d, Y h:i:s A' ),
317
  'url' => '',
318
  'user_email' => '',
319
- 'reason_info' => isset( $_REQUEST['reason_info'] ) ? trim( stripslashes( $_REQUEST['reason_info'] ) ) : '',
320
- 'software' => $_SERVER['SERVER_SOFTWARE'],
321
  'php_version' => phpversion(),
322
  'mysql_version' => $wpdb->db_version(),
323
  'wp_version' => get_bloginfo( 'version' ),
80
  ),
81
  ),
82
  ),
83
+ array(
84
  'id' => 'found-better-plugin',
85
  'text' => __( 'I found a better plugin', 'cookie-law-info' ),
86
  'type' => 'text',
90
  'id' => 'upgrade-to-pro',
91
  'text' => __( 'Upgrade to pro', 'cookie-law-info' ),
92
  ),
93
+ array(
94
  'id' => 'temporary-deactivation',
95
  'text' => __( 'It’s a temporary deactivation', 'cookie-law-info' ),
96
  ),
115
  ?>
116
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal" id="<?php echo esc_attr( $this->plugin_id ); ?>-modal">
117
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-wrap">
118
+ <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-header">
119
+ <h3><?php echo esc_html__( 'If you have a moment, please let us know why you are deactivating:', 'cookie-law-info' ); ?></h3>
120
  </div>
121
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-body">
122
  <ul class="reasons">
123
  <?php
124
  foreach ( $reasons as $reason ) :
125
+ $data_type = ( isset( $reason['type'] ) ? $reason['type'] : '' );
126
+ $placeholder = ( isset( $reason['placeholder'] ) ? $reason['placeholder'] : '' );
127
  $childs = ( isset( $reason['child'] ) && is_array( $reason['child'] ) ) ? $reason['child'] : array();
128
  ?>
129
+ <li data-type="<?php echo esc_attr( $data_type ); ?>" data-placeholder="<?php echo esc_attr( $placeholder ); ?>">
130
+ <label><input type="radio" name="selected-reason" value="<?php echo esc_attr( $reason['id'] ); ?>"><?php echo esc_html( $reason['text'] ); ?></label>
131
  <?php if ( ! empty( $childs ) ) : ?>
132
  <ul class="<?php echo esc_attr( $this->plugin_id ) . '-sub-reasons'; ?>">
133
  <?php
134
  foreach ( $childs as $child ) :
135
+ $data_type = ( isset( $child['type'] ) ? $child['type'] : '' );
136
+ $placeholder = ( isset( $child['type'] ) ? $child['placeholder'] : '' );
137
  ?>
138
+ <li data-type="<?php echo esc_attr( $data_type ); ?>" data-placeholder="<?php echo esc_attr( $placeholder ); ?>">
139
+ <label><input type="radio" name="selected-reason" value="<?php echo esc_attr( $child['id'] ); ?>"><?php echo esc_html( $child['text'] ); ?></label>
140
  <?php endforeach; ?>
141
  </ul>
142
  <?php endif; ?>
146
  <?php endforeach; ?>
147
  </ul>
148
  <div class="wt-uninstall-feedback-privacy-policy">
149
+ <?php esc_html__( "We do not collect any personal data when you submit this form. It's your feedback that we value.", 'cookie-law-info' ); ?>
150
+ <a href="https://www.webtoffee.com/privacy-policy/" target="_blank"><?php echo esc_html__( 'Privacy Policy', 'cookie-law-info' ); ?></a>
151
  </div>
152
  </div>
153
  <div class="<?php echo esc_attr( $this->plugin_id ); ?>-modal-footer">
154
 
155
  <a class="button-primary" href="https://www.webtoffee.com/support/" target="_blank">
156
  <span class="dashicons dashicons-external" style="margin-top:3px;"></span>
157
+ <?php echo esc_html__( 'Go to support', 'cookie-law-info' ); ?></a>
158
+ <button class="button-primary <?php echo esc_attr( $this->plugin_id ); ?>-model-submit"><?php echo esc_html__( 'Submit & Deactivate', 'cookie-law-info' ); ?></button>
159
+ <button class="button-secondary <?php echo esc_attr( $this->plugin_id ); ?>-model-cancel"><?php echo esc_html__( 'Cancel', 'cookie-law-info' ); ?></button>
160
+ <a href="#" style="color: #737373;" class="dont-bother-me"><?php echo esc_html__( 'I rather wouldn\'t say', 'cookie-law-info' ); ?></a>
161
  </div>
162
  </div>
163
  </div>
164
  <style type="text/css">
165
+ .cookielawinfo-modal {
166
  position: fixed;
167
  z-index: 99999;
168
  top: 0;
173
  display: none;
174
  }
175
 
176
+ .cookielawinfo-modal.modal-active {
177
  display: block;
178
  }
179
 
180
+ .cookielawinfo-modal-wrap {
181
  width: 50%;
182
  position: relative;
183
  margin: 10% auto;
184
  background: #fff;
185
  }
186
 
187
+ .cookielawinfo-modal-header {
188
  border-bottom: 1px solid #eee;
189
  padding: 8px 20px;
190
  }
191
 
192
+ .cookielawinfo-modal-header h3 {
193
  line-height: 150%;
194
  margin: 0;
195
  }
196
 
197
+ .cookielawinfo-modal-body {
198
  padding: 5px 20px 20px 20px;
199
  }
200
 
201
+ .cookielawinfo-modal-body .input-text,
202
+ .cookielawinfo-modal-body textarea {
203
  width: 75%;
204
  }
205
 
206
+ .cookielawinfo-modal-body .reason-input {
207
  margin-top: 5px;
208
  margin-left: 20px;
209
  }
210
 
211
+ .cookielawinfo-modal-footer {
212
  border-top: 1px solid #eee;
213
  padding: 12px 20px;
214
  text-align: left;
215
  }
216
 
217
+ .cookielawinfo-sub-reasons {
218
  display: none;
219
  padding-left: 20px;
220
  padding-top: 10px;
239
  <script type="text/javascript">
240
  (function($) {
241
  $(function() {
242
+ var plugin_id = '<?php echo esc_js( $this->plugin_id ); ?>';
243
  var modal = $('#' + plugin_id + '-modal');
244
  var deactivateLink = '';
245
  $('a.' + plugin_id + '-deactivate-link').click(function(e) {
286
  data: {
287
  action: plugin_id + '_submit_uninstall_reason',
288
  reason_id: (0 === $radio.length) ? 'none' : $radio.val(),
289
+ reason_info: (0 !== $input.length) ? $input.val().trim() : '',
290
+ _wpnonce: '<?php echo esc_js( wp_create_nonce( $this->plugin_id ) ); ?>',
291
  },
292
  beforeSend: function() {
293
  button.addClass('disabled');
305
  }
306
 
307
  public function send_uninstall_reason() {
308
+ check_ajax_referer( $this->plugin_id, '_wpnonce' );
309
  global $wpdb;
310
  if ( ! isset( $_POST['reason_id'] ) ) {
311
  wp_send_json_error();
312
  }
 
313
  $data = array(
314
+ 'reason_id' => sanitize_text_field( wp_unslash( $_POST['reason_id'] ) ),
315
  'plugin' => $this->plugin_id,
316
  'auth' => $this->auth_key,
317
  'date' => gmdate( 'M d, Y h:i:s A' ),
318
  'url' => '',
319
  'user_email' => '',
320
+ 'reason_info' => isset( $_REQUEST['reason_info'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['reason_info'] ) ) : '',
321
+ 'software' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
322
  'php_version' => phpversion(),
323
  'mysql_version' => $wpdb->db_version(),
324
  'wp_version' => get_bloginfo( 'version' ),
admin/partials/cookie-law-info-admin_settings.php CHANGED
@@ -1,142 +1,145 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
- $cli_admin_view_path=plugin_dir_path(CLI_PLUGIN_FILENAME).'admin/views/';
7
- $cli_img_path=CLI_PLUGIN_URL . 'images/';
8
- $plugin_name = 'wtgdprcookieconsent';
9
- $cli_activation_status=get_option($plugin_name.'_activation_status');
10
 
11
- //taking pages for privacy policy URL.
12
- $args_for_get_pages=array(
13
- 'sort_order' => 'ASC',
14
- 'sort_column' => 'post_title',
15
- 'hierarchical' => 0,
16
- 'child_of' => 0,
17
- 'parent' => -1,
18
- 'offset' => 0,
19
- 'post_type' => 'page',
20
- 'post_status' => 'publish'
21
  );
22
- $all_pages=get_pages($args_for_get_pages);
23
  ?>
24
  <script type="text/javascript">
25
- var cli_settings_success_message='<?php echo __('Settings updated.', 'cookie-law-info');?>';
26
- var cli_settings_error_message='<?php echo __('Unable to update Settings.', 'cookie-law-info');?>';
27
- var cli_reset_settings_success_message='<?php echo __('Settings reset to defaults.', 'cookie-law-info');?>';
28
- var cli_reset_settings_error_message='<?php echo __('Unable to reset settings.', 'cookie-law-info');?>';
29
  </script>
30
  <div class="wrap">
31
- <h2 class="wp-heading-inline"><?php _e('Settings', 'cookie-law-info'); ?></h2>
32
-
33
- <div class="wt-cli-gdpr-plugin-header">
34
- <div class="wt-cli-gdpr-plugin-status-bar">
35
- <table class="cli_notify_table cli_bar_state">
36
- <tr valign="middle" class="cli_bar_on" style="<?php echo $the_options['is_on'] == true ? '' : 'display:none;';?>">
37
- <td style="padding-left: 10px;">
38
- <div class="wt-cli-gdpr-plugin-status wt-cli-gdpr-plugin-status-active">
39
- <img id="cli-plugin-status-icon" src="<?php echo esc_url( $cli_img_path );?>add.svg" />
40
- <span><?php _e('Cookie bar is currently active', 'cookie-law-info'); ?></span>
41
- </div>
42
- </td>
43
- </tr>
44
- <tr valign="middle" class="cli_bar_off" style="<?php echo $the_options['is_on'] == true ? 'display:none;' : '';?>">
45
- <td style="padding-left: 10px;">
46
- <div class="wt-cli-gdpr-plugin-status wt-cli-gdpr-plugin-status-active">
47
- <img id="cli-plugin-status-icon" src="<?php echo esc_url( $cli_img_path );?>cross.png" />
48
- <span><?php _e('Cookie bar is currently inactive', 'cookie-law-info'); ?></span>
49
- </div>
50
- </td>
51
- </tr>
52
- </table>
53
- </div>
54
- <div class="wt-cli-gdpr-plugin-branding">
55
- <div class="wt-cli-gdpr-plugin-branding-logo">
56
- <img src="<?php echo esc_url( $cli_img_path );?>logo-cookieyes.svg" alt="CookieYes Logo">
57
- </div>
58
- <div class="wt-cli-gdpr-plugin-branding-tagline">
59
-
60
- <span><b><?php echo __( 'Cookie Compliance Made Easy', 'cookie-law-info' ); ?> | <?php echo sprintf(
61
- wp_kses(
62
- __( 'Plugin Developed By <a href="%s" target="_blank">WebToffee</a>', 'cookie-law-info' ),
63
- array(
64
- 'a' => array(
65
- 'href' => array(),
66
- 'target' => array(),
67
- ),
68
- )
69
- ),
70
- 'https://www.webtoffee.com/'
71
- ); ?></b></span>
72
- </div>
73
- </div>
74
- </div>
 
 
 
 
75
 
76
 
77
- <div class="cli_settings_left" id="cky-container">
78
- <div class="nav-tab-wrapper wp-clearfix cookie-law-info-tab-head">
79
- <?php
80
- $tab_head_arr=array(
81
- 'cookie-law-info-general'=> __('General','cookie-law-info'),
82
- 'cookie-law-info-message-bar'=>__('Customise Cookie Bar','cookie-law-info'),
83
- 'cookie-law-info-buttons'=>__('Customise Buttons','cookie-law-info'),
84
- 'cookie-law-info-advanced'=>__('Advanced','cookie-law-info'),
85
- 'cookie-law-info-help'=>__('Help Guide','cookie-law-info'),
86
- 'cookie-law-info-upgrade-pro'=>__('Free vs Pro','cookie-law-info'),
87
- );
88
- Cookie_Law_Info::generate_settings_tabhead($tab_head_arr);
89
- ?>
90
- </div>
91
- <div id="cky-tab-container" class="cookie-law-info-tab-container">
92
- <?php
93
- $setting_views_a=array(
94
- 'cookie-law-info-general'=>'admin-settings-general.php',
95
- 'cookie-law-info-message-bar'=>'admin-settings-messagebar.php',
96
- 'cookie-law-info-buttons'=>'admin-settings-buttons.php',
97
- 'cookie-law-info-advanced'=>'admin-settings-advanced.php',
98
- );
99
- $setting_views_b=array(
100
- 'cookie-law-info-help'=>'admin-settings-help.php',
101
- 'cookie-law-info-upgrade-pro'=>'admin-settings-upgrade-pro.php',
102
- );
103
- ?>
104
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]);?>" id="cli_settings_form">
105
- <input type="hidden" name="cli_update_action" value="" id="cli_update_action" />
106
- <?php
107
- // Set nonce:
108
- if (function_exists('wp_nonce_field'))
109
- {
110
- wp_nonce_field('cookielawinfo-update-' . CLI_SETTINGS_FIELD);
111
- }
112
- foreach ($setting_views_a as $target_id=>$value)
113
- {
114
- $settings_view=$cli_admin_view_path.$value;
115
- if(file_exists($settings_view))
116
- {
117
- include $settings_view;
118
- }
119
- }
120
- ?>
121
- <?php
122
- //settings form fields for module
123
- do_action('cli_module_settings_form');?>
124
- </form>
125
- <?php
126
- foreach ($setting_views_b as $target_id=>$value)
127
- {
128
- $settings_view=$cli_admin_view_path.$value;
129
- if(file_exists($settings_view))
130
- {
131
- include $settings_view;
132
- }
133
- }
134
- ?>
135
- <?php do_action('cli_module_out_settings_form');?>
136
- </div>
137
- </div>
138
- <div class="cli_settings_right">
139
- <?php include $cli_admin_view_path."goto-pro-v2.php"; ?>
140
- </div>
141
 
142
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
+ $cli_admin_view_path = plugin_dir_path( CLI_PLUGIN_FILENAME ) . 'admin/views/';
7
+ $cli_img_path = CLI_PLUGIN_URL . 'images/';
8
+ $plugin_name = 'wtgdprcookieconsent';
9
+ $cli_activation_status = get_option( $plugin_name . '_activation_status' );
10
 
11
+ // taking pages for privacy policy URL.
12
+ $args_for_get_pages = array(
13
+ 'sort_order' => 'ASC',
14
+ 'sort_column' => 'post_title',
15
+ 'hierarchical' => 0,
16
+ 'child_of' => 0,
17
+ 'parent' => -1,
18
+ 'offset' => 0,
19
+ 'post_type' => 'page',
20
+ 'post_status' => 'publish',
21
  );
22
+ $all_pages = get_pages( $args_for_get_pages );
23
  ?>
24
  <script type="text/javascript">
25
+ var cli_settings_success_message='<?php echo esc_html__( 'Settings updated.', 'cookie-law-info' ); ?>';
26
+ var cli_settings_error_message='<?php echo esc_html__( 'Unable to update Settings.', 'cookie-law-info' ); ?>';
27
+ var cli_reset_settings_success_message='<?php echo esc_html__( 'Settings reset to defaults.', 'cookie-law-info' ); ?>';
28
+ var cli_reset_settings_error_message='<?php echo esc_html__( 'Unable to reset settings.', 'cookie-law-info' ); ?>';
29
  </script>
30
  <div class="wrap">
31
+ <h2 class="wp-heading-inline"><?php echo esc_html__( 'Settings', 'cookie-law-info' ); ?></h2>
32
+
33
+ <div class="wt-cli-gdpr-plugin-header">
34
+ <div class="wt-cli-gdpr-plugin-status-bar">
35
+ <table class="cli_notify_table cli_bar_state">
36
+ <tr valign="middle" class="cli_bar_on" style="<?php echo $the_options['is_on'] == true ? '' : 'display:none;'; ?>">
37
+ <td style="padding-left: 10px;">
38
+ <div class="wt-cli-gdpr-plugin-status wt-cli-gdpr-plugin-status-active">
39
+ <img id="cli-plugin-status-icon" src="<?php echo esc_url( $cli_img_path ); ?>add.svg" />
40
+ <span><?php echo esc_html__( 'Cookie bar is currently active', 'cookie-law-info' ); ?></span>
41
+ </div>
42
+ </td>
43
+ </tr>
44
+ <tr valign="middle" class="cli_bar_off" style="<?php echo $the_options['is_on'] == true ? 'display:none;' : ''; ?>">
45
+ <td style="padding-left: 10px;">
46
+ <div class="wt-cli-gdpr-plugin-status wt-cli-gdpr-plugin-status-active">
47
+ <img id="cli-plugin-status-icon" src="<?php echo esc_url( $cli_img_path ); ?>cross.png" />
48
+ <span><?php echo esc_html__( 'Cookie bar is currently inactive', 'cookie-law-info' ); ?></span>
49
+ </div>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </div>
54
+ <div class="wt-cli-gdpr-plugin-branding">
55
+ <div class="wt-cli-gdpr-plugin-branding-logo">
56
+ <img src="<?php echo esc_url( $cli_img_path ); ?>logo-cookieyes.svg" alt="CookieYes Logo">
57
+ </div>
58
+ <div class="wt-cli-gdpr-plugin-branding-tagline">
59
+
60
+ <span><b><?php echo esc_html__( 'Cookie Compliance Made Easy', 'cookie-law-info' ); ?> |
61
+ <?php
62
+ echo sprintf(
63
+ wp_kses(
64
+ __( 'Plugin Developed By <a href="%s" target="_blank">WebToffee</a>', 'cookie-law-info' ),
65
+ array(
66
+ 'a' => array(
67
+ 'href' => array(),
68
+ 'target' => array(),
69
+ ),
70
+ )
71
+ ),
72
+ 'https://www.webtoffee.com/'
73
+ );
74
+ ?>
75
+ </b></span>
76
+ </div>
77
+ </div>
78
+ </div>
79
 
80
 
81
+ <div class="cli_settings_left" id="cky-container">
82
+ <div class="nav-tab-wrapper wp-clearfix cookie-law-info-tab-head">
83
+ <?php
84
+ $tab_head_arr = array(
85
+ 'cookie-law-info-general' => __( 'General', 'cookie-law-info' ),
86
+ 'cookie-law-info-message-bar' => __( 'Customise Cookie Bar', 'cookie-law-info' ),
87
+ 'cookie-law-info-buttons' => __( 'Customise Buttons', 'cookie-law-info' ),
88
+ 'cookie-law-info-advanced' => __( 'Advanced', 'cookie-law-info' ),
89
+ 'cookie-law-info-help' => __( 'Help Guide', 'cookie-law-info' ),
90
+ 'cookie-law-info-upgrade-pro' => __( 'Free vs Pro', 'cookie-law-info' ),
91
+ );
92
+ Cookie_Law_Info::generate_settings_tabhead( $tab_head_arr );
93
+ ?>
94
+ </div>
95
+ <div id="cky-tab-container" class="cookie-law-info-tab-container">
96
+ <?php
97
+ $setting_views_a = array(
98
+ 'cookie-law-info-general' => 'admin-settings-general.php',
99
+ 'cookie-law-info-message-bar' => 'admin-settings-messagebar.php',
100
+ 'cookie-law-info-buttons' => 'admin-settings-buttons.php',
101
+ 'cookie-law-info-advanced' => 'admin-settings-advanced.php',
102
+ );
103
+ $setting_views_b = array(
104
+ 'cookie-law-info-help' => 'admin-settings-help.php',
105
+ 'cookie-law-info-upgrade-pro' => 'admin-settings-upgrade-pro.php',
106
+ );
107
+ ?>
108
+ <?php $form_action = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; ?>
109
+ <form method="post" action="<?php echo esc_url( $form_action ); ?>" id="cli_settings_form">
110
+ <input type="hidden" name="cli_update_action" value="" id="cli_update_action" />
111
+ <?php
112
+ // Set nonce:
113
+ if ( function_exists( 'wp_nonce_field' ) ) {
114
+ wp_nonce_field( 'cookielawinfo-update-' . CLI_SETTINGS_FIELD );
115
+ }
116
+ foreach ( $setting_views_a as $target_id => $value ) {
117
+ $settings_view = $cli_admin_view_path . $value;
118
+ if ( file_exists( $settings_view ) ) {
119
+ include $settings_view;
120
+ }
121
+ }
122
+ ?>
123
+
124
+ <?php
125
+ // settings form fields for module
126
+ do_action( 'cli_module_settings_form' );
127
+ ?>
128
+
129
+ </form>
130
+ <?php
131
+ foreach ( $setting_views_b as $target_id => $value ) {
132
+ $settings_view = $cli_admin_view_path . $value;
133
+ if ( file_exists( $settings_view ) ) {
134
+ include $settings_view;
135
+ }
136
+ }
137
+ ?>
138
+ <?php do_action( 'cli_module_out_settings_form' ); ?>
139
+ </div>
140
+ </div>
141
+ <div class="cli_settings_right">
142
+ <?php require $cli_admin_view_path . 'goto-pro-v2.php'; ?>
143
+ </div>
 
144
 
145
+ </div>
admin/partials/cookie-law-info-privacy_overview.php CHANGED
@@ -1,66 +1,72 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
- }
6
  ?>
7
  <style>
8
- .vvv_textbox{
9
- height: 150px;
10
- width: 80%;
11
- }
12
- .cli-textbox{
13
- width: 100%;
14
- height: 35px;
15
- margin-bottom: 5px;
16
- }
17
- .notice, div.updated, div.error{
18
- margin: 5px 20px 15px 0;
19
- }
20
  </style>
21
  <div class="wrap">
22
 
23
- <div class="cookie-law-info-form-container">
24
- <div class="cli-plugin-toolbar top">
25
- <h3><?php _e('Privacy Overview', 'cookie-law-info');?></h3>
26
- </div>
27
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>">
28
- <?php wp_nonce_field('cookielawinfo-update-privacy-overview-content'); ?>
29
- <table class="form-table cli_privacy_overview_form" >
30
- <tr valign="top">
31
- <td>
32
- <label for="privacy_overview_title"><?php _e('Title', 'cookie-law-info'); ?></label>
33
- <input type="text" name="privacy_overview_title" value="<?php echo esc_attr( sanitize_text_field( stripslashes( $privacy_title ) ) ); ?>" class="cli-textbox" />
34
- </td>
35
- </tr>
36
- <tr valign="top">
37
- <td>
38
- <label for="privacy_overview_content"><?php _e('Privacy overview is displayed when the user clicks on ‘cookie settings’ from the cookie consent bar. Edit/ modify the title and content of ‘privacy overview’ from here.', 'cookie-law-info'); ?></label>
39
- <?php
40
- $cli_use_editor= apply_filters('cli_use_editor_in_po',true);
41
- if($cli_use_editor)
42
- {
43
- wp_editor( stripslashes($privacy_content) , 'cli_privacy_overview_content', $wpe_settings = array('textarea_name'=>'privacy_overview_content','textarea_rows' => 10));
44
- }
45
- else
46
- {
47
- ?>
48
- <textarea style="width:100%; height:250px;" name="privacy_overview_content"><?php echo wp_kses_post( stripslashes($privacy_content) ) ;?></textarea>
49
- <?php
50
- }
51
- ?>
52
- <div class="clearfix"></div>
53
- </td>
54
- </tr>
55
- </table>
56
- <div class="cli-plugin-toolbar bottom">
57
- <div class="left">
58
- </div>
59
- <div class="right">
60
- <input type="submit" name="update_privacy_overview_content_settings_form" value="<?php _e('Save Settings', 'cookie-law-info'); ?>" style="float: right;" class="button-primary" />
61
- <span class="spinner" style="margin-top:9px"></span>
62
- </div>
63
- </div>
64
- </form>
65
- </div>
66
- </div>
 
 
 
 
 
 
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
  ?>
7
  <style>
8
+ .vvv_textbox{
9
+ height: 150px;
10
+ width: 80%;
11
+ }
12
+ .cli-textbox{
13
+ width: 100%;
14
+ height: 35px;
15
+ margin-bottom: 5px;
16
+ }
17
+ .notice, div.updated, div.error{
18
+ margin: 5px 20px 15px 0;
19
+ }
20
  </style>
21
  <div class="wrap">
22
 
23
+ <div class="cookie-law-info-form-container">
24
+ <div class="cli-plugin-toolbar top">
25
+ <h3><?php echo esc_html__( 'Privacy Overview', 'cookie-law-info' ); ?></h3>
26
+ </div>
27
+ <?php $form_action = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; ?>
28
+ <form method="post" action="<?php echo esc_url( $form_action ); ?>">
29
+ <?php wp_nonce_field( 'cookielawinfo-update-privacy-overview-content' ); ?>
30
+ <table class="form-table cli_privacy_overview_form" >
31
+ <tr valign="top">
32
+ <td>
33
+ <label for="privacy_overview_title"><?php echo esc_html__( 'Title', 'cookie-law-info' ); ?></label>
34
+ <input type="text" name="privacy_overview_title" value="<?php echo esc_attr( sanitize_text_field( stripslashes( $privacy_title ) ) ); ?>" class="cli-textbox" />
35
+ </td>
36
+ </tr>
37
+ <tr valign="top">
38
+ <td>
39
+ <label for="privacy_overview_content"><?php echo esc_html__( 'Privacy overview is displayed when the user clicks on ‘cookie settings’ from the cookie consent bar. Edit/ modify the title and content of ‘privacy overview’ from here.', 'cookie-law-info' ); ?></label>
40
+ <?php
41
+ $cli_use_editor = apply_filters( 'cli_use_editor_in_po', true );
42
+ if ( $cli_use_editor ) {
43
+ wp_editor(
44
+ stripslashes( $privacy_content ),
45
+ 'cli_privacy_overview_content',
46
+ $wpe_settings = array(
47
+ 'textarea_name' => 'privacy_overview_content',
48
+ 'textarea_rows' => 10,
49
+ )
50
+ );
51
+ } else {
52
+ ?>
53
+ <textarea style="width:100%; height:250px;" name="privacy_overview_content"><?php echo wp_kses_post( stripslashes( $privacy_content ) ); ?></textarea>
54
+ <?php
55
+ }
56
+ ?>
57
+
58
+ <div class="clearfix"></div>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ <div class="cli-plugin-toolbar bottom">
63
+ <div class="left">
64
+ </div>
65
+ <div class="right">
66
+ <input type="submit" name="update_privacy_overview_content_settings_form" value="<?php echo esc_html__( 'Save Settings', 'cookie-law-info' ); ?>" style="float: right;" class="button-primary" />
67
+ <span class="spinner" style="margin-top:9px"></span>
68
+ </div>
69
+ </div>
70
+ </form>
71
+ </div>
72
+ </div>
admin/views/admin-settings-advanced.php CHANGED
@@ -1,24 +1,24 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  ?>
7
- <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id );?>">
8
- <h3><?php _e('Advanced','cookie-law-info'); ?></h3>
9
- <p><?php _e('Sometimes themes apply settings that clash with plugins. If that happens, try adjusting these settings.', 'cookie-law-info'); ?></p>
10
 
11
- <table class="form-table">
12
- <tr valign="top">
13
- <th scope="row"><?php _e('Reset settings', 'cookie-law-info'); ?></th>
14
- <td>
15
- <input type="submit" name="delete_all_settings" value="<?php _e('Delete settings and reset', 'cookie-law-info'); ?>" class="button-secondary" onclick="cli_store_settings_btn_click(this.name); if(confirm('<?php _e('Are you sure you want to delete all your settings?', 'cookie-law-info'); ?>')){ }else{ return false;};" />
16
- <span class="cli_form_help"><?php _e('Warning: Resets all your current settings to default.', 'cookie-law-info'); ?></span>
17
- </td>
18
- </tr>
19
- </table>
20
- <?php do_action('wt_cli_after_advanced_settings'); ?>
21
- <?php
22
- include "admin-settings-save-button.php";
23
- ?>
24
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  ?>
7
+ <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
+ <h3><?php echo esc_html__( 'Advanced', 'cookie-law-info' ); ?></h3>
9
+ <p><?php echo esc_html__( 'Sometimes themes apply settings that clash with plugins. If that happens, try adjusting these settings.', 'cookie-law-info' ); ?></p>
10
 
11
+ <table class="form-table">
12
+ <tr valign="top">
13
+ <th scope="row"><?php echo esc_html__( 'Reset settings', 'cookie-law-info' ); ?></th>
14
+ <td>
15
+ <input type="submit" name="delete_all_settings" value="<?php echo esc_html__( 'Delete settings and reset', 'cookie-law-info' ); ?>" class="button-secondary" onclick="cli_store_settings_btn_click(this.name); if(confirm('<?php echo esc_html__( 'Are you sure you want to delete all your settings?', 'cookie-law-info' ); ?>')){ }else{ return false;};" />
16
+ <span class="cli_form_help"><?php echo esc_html__( 'Warning: Resets all your current settings to default.', 'cookie-law-info' ); ?></span>
17
+ </td>
18
+ </tr>
19
+ </table>
20
+ <?php do_action( 'wt_cli_after_advanced_settings' ); ?>
21
+ <?php
22
+ require 'admin-settings-save-button.php';
23
+ ?>
24
+ </div>
admin/views/admin-settings-buttons.php CHANGED
@@ -7,28 +7,28 @@ if ( ! defined( 'WPINC' ) ) {
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
 
9
  <ul class="cli_sub_tab">
10
- <li style="border-left:none; padding-left: 0px;" data-target="accept-all-button"><a><?php _e('Accept All Button', 'cookie-law-info'); ?></a></li>
11
- <li data-target="accept-button"><a><?php _e( 'Accept Button', 'cookie-law-info' ); ?></a></li>
12
- <li data-target="reject-button"><a><?php _e( 'Reject Button', 'cookie-law-info' ); ?></a></li>
13
- <li data-target="settings-button"><a><?php _e( 'Settings Button', 'cookie-law-info' ); ?></a></li>
14
- <li data-target="read-more-button"><a><?php _e( 'Read more', 'cookie-law-info' ); ?></a></li>
15
- <li data-target="do-not-sell-button" class="wt-cli-ccpa-element"><a><?php _e( 'Do not sell', 'cookie-law-info' ); ?></a></li>
16
  </ul>
17
 
18
  <div class="cli_sub_tab_container">
19
 
20
  <div class="cli_sub_tab_content" data-id="accept-button" style="display:block;">
21
- <h3><?php _e( 'Accept Button', 'cookie-law-info' ); ?> <code>[cookie_button]</code></h3>
22
- <p><?php _e( 'Customize the Accept button to match the theme of your site. Insert the shortcode [cookie_button] in Customise Cookie Bar > Cookie bar > Message to include accept button in cookie consent bar.', 'cookie-law-info' ); ?></p>
23
  <table class="form-table">
24
  <tr valign="top">
25
- <th scope="row"><label for="button_1_text_field"><?php _e( 'Text', 'cookie-law-info' ); ?></label></th>
26
  <td>
27
  <input type="text" name="button_1_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_1_text'] ) ); ?>" />
28
  </td>
29
  </tr>
30
  <tr valign="top">
31
- <th scope="row"><label for="button_1_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
32
  <td>
33
  <?php
34
  echo '<input type="text" name="button_1_link_colour_field" id="cli-colour-link-button-1" value="' . esc_attr( $the_options['button_1_link_colour'] ) . '" class="my-color-field" />';
@@ -36,15 +36,15 @@ if ( ! defined( 'WPINC' ) ) {
36
  </td>
37
  </tr>
38
  <tr valign="top">
39
- <th scope="row"><label for="button_1_as_button_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
40
  <td>
41
- <input type="radio" cli_frm_tgl-target="cli_accept_type" id="button_1_as_button_field_yes" name="button_1_as_button_field" class="styled cli_form_toggle" value="true" <?php echo ( $the_options['button_1_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php _e( 'Button', 'cookie-law-info' ); ?>
42
 
43
- <input type="radio" cli_frm_tgl-target="cli_accept_type" id="button_1_as_button_field_no" name="button_1_as_button_field" class="styled cli_form_toggle" value="false" <?php echo ( $the_options['button_1_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Link', 'cookie-law-info' ); ?>
44
  </td>
45
  </tr>
46
  <tr valign="top" class="cli-indent-15" cli_frm_tgl-id="cli_accept_type" cli_frm_tgl-val="true">
47
- <th scope="row"><label for="button_1_button_colour_field"><?php _e( 'Background colour', 'cookie-law-info' ); ?></label></th>
48
  <td>
49
  <?php
50
  echo '<input type="text" name="button_1_button_colour_field" id="cli-colour-btn-button-1" value="' . esc_attr( $the_options['button_1_button_colour'] ) . '" class="my-color-field" />';
@@ -53,7 +53,7 @@ if ( ! defined( 'WPINC' ) ) {
53
  </tr>
54
 
55
  <tr valign="top">
56
- <th scope="row"><label for="button_1_action_field"><?php _e( 'Action', 'cookie-law-info' ); ?></label></th>
57
  <td>
58
  <select name="button_1_action_field" id="cli-plugin-button-1-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_accept_action">
59
  <?php $this->print_combobox_options( $this->get_js_actions(), $the_options['button_1_action'] ); ?>
@@ -61,26 +61,26 @@ if ( ! defined( 'WPINC' ) ) {
61
  </td>
62
  </tr>
63
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
64
- <th scope="row"><label for="button_1_url_field"><?php _e( 'URL', 'cookie-law-info' ); ?></label></th>
65
  <td>
66
  <input type="text" name="button_1_url_field" id="button_1_url_field" value="<?php echo esc_attr( $the_options['button_1_url'] ); ?>" />
67
- <span class="cli_form_help"><?php _e( 'Specify the URL to redirect users on accept button click. e.g. Entering the cookie policy page URL will redirect users to the cookie policy page after giving consent.', 'cookie-law-info' ); ?></span>
68
  </td>
69
  </tr>
70
 
71
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
72
- <th scope="row"><label for="button_1_new_win_field"><?php _e( 'Open URL in new window', 'cookie-law-info' ); ?></label></th>
73
  <td>
74
- <input type="radio" id="button_1_new_win_field_yes" name="button_1_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_1_new_win'] == true ) ? ' checked="checked"' : ''; ?> /><?php _e( 'Yes', 'cookie-law-info' ); ?>
75
 
76
- <input type="radio" id="button_1_new_win_field_no" name="button_1_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_1_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'No', 'cookie-law-info' ); ?>
77
  </td>
78
  </tr>
79
 
80
 
81
 
82
  <tr valign="top">
83
- <th scope="row"><label for="button_1_button_size_field"><?php _e( 'Button Size', 'cookie-law-info' ); ?></label></th>
84
  <td>
85
  <select name="button_1_button_size_field" class="vvv_combobox">
86
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_1_button_size'] ); ?>
@@ -91,17 +91,28 @@ if ( ! defined( 'WPINC' ) ) {
91
  </div>
92
 
93
  <div class="cli_sub_tab_content" data-id="reject-button">
94
- <h3><?php _e( 'Reject Button', 'cookie-law-info' ); ?> <code>[cookie_reject]</code></h3>
95
- <p><?php _e( 'Customize the Reject button to match the theme of your site. Insert the shortcode <b>[cookie_reject]</b> in <b>Customise Cookie Bar > Cookie bar > Message</b> to include reject button in cookie consent bar.', 'cookie-law-info' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
96
  <table class="form-table" >
97
  <tr valign="top">
98
- <th scope="row"><label for="button_3_text_field"><?php _e( 'Text', 'cookie-law-info' ); ?></label></th>
99
  <td>
100
  <input type="text" name="button_3_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_3_text'] ) ); ?>" />
101
  </td>
102
  </tr>
103
  <tr valign="top">
104
- <th scope="row"><label for="button_3_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
105
  <td>
106
  <?php
107
  echo '<input type="text" name="button_3_link_colour_field" id="cli-colour-link-button-3" value="' . esc_attr( $the_options['button_3_link_colour'] ) . '" class="my-color-field" />';
@@ -109,15 +120,15 @@ if ( ! defined( 'WPINC' ) ) {
109
  </td>
110
  </tr>
111
  <tr valign="top">
112
- <th scope="row"><label for="button_3_as_button_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
113
  <td>
114
- <input type="radio" id="button_3_as_button_field_yes" name="button_3_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_reject_type" value="true" <?php echo ( $the_options['button_3_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php _e( 'Button', 'cookie-law-info' ); ?>
115
 
116
- <input type="radio" id="button_3_as_button_field_no" name="button_3_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_reject_type" value="false" <?php echo ( $the_options['button_3_as_button'] == false ) ? ' checked="checked"' : ''; ?> /><?php _e( 'Link', 'cookie-law-info' ); ?>
117
  </td>
118
  </tr>
119
  <tr valign="top" cli_frm_tgl-id="cli_reject_type" cli_frm_tgl-val="true">
120
- <th scope="row"><label for="button_3_button_colour_field"><?php _e( 'Background colour', 'cookie-law-info' ); ?></label></th>
121
  <td>
122
  <?php
123
  echo '<input type="text" name="button_3_button_colour_field" id="cli-colour-btn-button-3" value="' . esc_attr( $the_options['button_3_button_colour'] ) . '" class="my-color-field" />';
@@ -125,7 +136,7 @@ if ( ! defined( 'WPINC' ) ) {
125
  </td>
126
  </tr>
127
  <tr valign="top">
128
- <th scope="row"><label for="button_3_action_field"><?php _e( 'Action', 'cookie-law-info' ); ?></label></th>
129
  <td>
130
  <select name="button_3_action_field" id="cli-plugin-button-3-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_reject_action">
131
  <?php
@@ -137,22 +148,22 @@ if ( ! defined( 'WPINC' ) ) {
137
  </td>
138
  </tr>
139
  <tr valign="top" class="cli-plugin-row" cli_frm_tgl-id="cli_reject_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
140
- <th scope="row"><label for="button_3_url_field"><?php _e( 'URL', 'cookie-law-info' ); ?></label></th>
141
  <td>
142
  <input type="text" name="button_3_url_field" id="button_3_url_field" value="<?php echo esc_url( $the_options['button_3_url'] ); ?>" />
143
- <span class="cli_form_help"><?php _e( 'Specify the URL to redirect users on reject button click. e.g. Entering the cookie policy page URL will redirect users to the cookie policy page after rejecting cookies.', 'cookie-law-info' ); ?></span>
144
  </td>
145
  </tr>
146
 
147
  <tr valign="top" class="cli-plugin-row" cli_frm_tgl-id="cli_reject_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
148
- <th scope="row"><label for="button_3_new_win_field"><?php _e( 'Open URL in new window', 'cookie-law-info' ); ?></label></th>
149
  <td>
150
- <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"' : ''; ?> /><?php _e( 'Yes', 'cookie-law-info' ); ?>
151
- <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"' : ''; ?> /><?php _e( 'No', 'cookie-law-info' ); ?>
152
  </td>
153
  </tr>
154
  <tr valign="top">
155
- <th scope="row"><label for="button_3_button_size_field"><?php _e( 'Button Size', 'cookie-law-info' ); ?></label></th>
156
  <td>
157
  <select name="button_3_button_size_field" class="vvv_combobox">
158
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_3_button_size'] ); ?>
@@ -162,17 +173,27 @@ if ( ! defined( 'WPINC' ) ) {
162
  </table><!-- end custom button -->
163
  </div>
164
  <div class="cli_sub_tab_content" data-id="settings-button">
165
- <h3><?php _e( 'Settings Button', 'cookie-law-info' ); ?> <code>[cookie_settings]</code></h3>
166
- <p><?php _e( 'Customize the cookie settings to match the theme of your site. Insert the shortcode <b>[cookie_settings]</b> in <b>Customise Cookie Bar > Cookie bar > Message</b> to include cookie settings within the cookie consent bar. Clicking ‘Cookie settings’ opens up a pop up window with provisions to enable/disable cookie categories.', 'cookie-law-info' ); ?></p>
 
 
 
 
 
 
 
 
 
 
167
  <table class="form-table" >
168
  <tr valign="top">
169
- <th scope="row"><label for="button_4_text_field"><?php _e('Text', 'cookie-law-info' ); ?></label></th>
170
  <td>
171
  <input type="text" name="button_4_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_4_text'] ) ); ?>" />
172
  </td>
173
  </tr>
174
  <tr valign="top">
175
- <th scope="row"><label for="button_4_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
176
  <td>
177
  <?php
178
  echo '<input type="text" name="button_4_link_colour_field" id="cli-colour-link-button-4" value="' . esc_attr( $the_options['button_4_link_colour'] ) . '" class="my-color-field" />';
@@ -180,15 +201,15 @@ if ( ! defined( 'WPINC' ) ) {
180
  </td>
181
  </tr>
182
  <tr valign="top">
183
- <th scope="row"><label for="button_4_as_button_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
184
  <td>
185
- <input type="radio" id="button_4_as_button_field_yes" name="button_4_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_settings_type" value="true" <?php echo ( $the_options['button_4_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /><?php _e( 'Button', 'cookie-law-info' ); ?>
186
 
187
- <input type="radio" id="button_4_as_button_field_no" name="button_4_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_settings_type" value="false" <?php echo ( $the_options['button_4_as_button'] == false ) ? ' checked="checked"' : ''; ?> /><?php _e( 'Link', 'cookie-law-info' ); ?>
188
  </td>
189
  </tr>
190
  <tr valign="top" cli_frm_tgl-id="cli_settings_type" cli_frm_tgl-val="true">
191
- <th scope="row"><label for="button_4_button_colour_field"><?php _e( 'Background colour', 'cookie-law-info' ); ?></label></th>
192
  <td>
193
  <?php
194
  echo '<input type="text" name="button_4_button_colour_field" id="cli-colour-btn-button-4" value="' . esc_attr( $the_options['button_4_button_colour'] ) . '" class="my-color-field" />';
@@ -198,15 +219,23 @@ if ( ! defined( 'WPINC' ) ) {
198
  </table><!-- end custom button -->
199
  </div>
200
  <div class="cli_sub_tab_content" data-id="read-more-button">
201
- <h3><?php _e( 'Read more', 'cookie-law-info' ); ?> <code>[cookie_link]</code></h3>
202
  <p>
203
- <?php _e( '‘Read more’ redirects users to the ‘Privacy & Cookie Policy’ page. Create a ‘Privacy & Cookie Policy’ page for your site from here.', 'cookie-law-info' ); ?>
204
- <?php _e( 'Insert the shortcode <b>[cookie_link]</b> in <b>Customise Cookie Bar > Cookie bar > Message</b> to include ‘Read more’ within the cookie consent bar.', 'cookie-law-info' ); ?>
 
 
 
 
 
 
 
 
205
  </p>
206
  <?php
207
  if ( Cookie_Law_Info_Admin::module_exists( 'cli-policy-generator' ) ) {
208
  ?>
209
- <p><?php _e( 'Click', 'cookie-law-info' ); ?> <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=' . CLI_POST_TYPE . '&page=cookie-law-info-policy-generator' ) ); ?>"><?php _e( 'here', 'cookie-law-info' ); ?></a> <?php _e( ' to generate content for Cookie Policy page.', 'cookie-law-info' ); ?>
210
  </p>
211
  <?php
212
  }
@@ -214,13 +243,13 @@ if ( ! defined( 'WPINC' ) ) {
214
 
215
  <table class="form-table">
216
  <tr valign="top">
217
- <th scope="row"><label for="button_2_text_field"><?php _e( 'Text', 'cookie-law-info' ); ?></label></th>
218
  <td>
219
  <input type="text" name="button_2_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_2_text'] ) ); ?>" />
220
  </td>
221
  </tr>
222
  <tr valign="top">
223
- <th scope="row"><label for="button_2_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
224
  <td>
225
  <?php
226
  echo '<input type="text" name="button_2_link_colour_field" id="cli-colour-link-button-1" value="' . esc_attr( $the_options['button_2_link_colour'] ) . '" class="my-color-field" />';
@@ -228,15 +257,15 @@ if ( ! defined( 'WPINC' ) ) {
228
  </td>
229
  </tr>
230
  <tr valign="top">
231
- <th scope="row"><label for="button_2_as_button_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
232
  <td>
233
- <input type="radio" id="button_2_as_button_field_yes" name="button_2_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_type" value="true" <?php echo ( $the_options['button_2_as_button'] == true ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Button', 'cookie-law-info' ); ?>
234
 
235
- <input type="radio" id="button_2_as_button_field_no" name="button_2_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_type" value="false" <?php echo ( $the_options['button_2_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Link', 'cookie-law-info' ); ?>
236
  </td>
237
  </tr>
238
  <tr valign="top" cli_frm_tgl-id="cli_readmore_type" cli_frm_tgl-val="true">
239
- <th scope="row"><label for="button_2_button_colour_field"><?php _e( 'Background colour', 'cookie-law-info' ); ?></label></th>
240
  <td>
241
  <?php
242
  echo '<input type="text" name="button_2_button_colour_field" id="cli-colour-btn-button-1" value="' . esc_attr( $the_options['button_2_button_colour'] ) . '" class="my-color-field" />';
@@ -245,25 +274,25 @@ if ( ! defined( 'WPINC' ) ) {
245
  </tr>
246
 
247
  <tr valign="top">
248
- <th scope="row"><label for="button_2_url_type_field"><?php _e( 'URL or Page?', 'cookie-law-info' ); ?></label></th>
249
  <td>
250
- <input type="radio" id="button_2_url_type_field_url" name="button_2_url_type_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_url_type" value="url" <?php echo ( $the_options['button_2_url_type'] == 'url' ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'URL', 'cookie-law-info' ); ?>
251
 
252
- <input type="radio" id="button_2_url_type_field_page" name="button_2_url_type_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_url_type" value="page" <?php echo ( $the_options['button_2_url_type'] == 'page' ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Page', 'cookie-law-info' ); ?>
253
  </td>
254
  </tr>
255
 
256
  <tr valign="top" cli_frm_tgl-id="cli_readmore_url_type" cli_frm_tgl-val="url">
257
- <th scope="row"><label for="button_2_url_field"><?php _e( 'URL', 'cookie-law-info' ); ?></label></th>
258
  <td>
259
  <input type="text" name="button_2_url_field" id="button_2_url_field" value="<?php echo esc_url( $the_options['button_2_url'] ); ?>" />
260
  </td>
261
  </tr>
262
  <tr valign="top" cli_frm_tgl-id="cli_readmore_url_type" cli_frm_tgl-val="page">
263
- <th scope="row"><label for="button_2_page_field"><?php _e( 'Page', 'cookie-law-info' ); ?></label></th>
264
  <td>
265
  <select name="button_2_page_field" class="vvv_combobox" id="button_2_page_field">
266
- <option value="0">--<?php _e( 'Select One', 'cookie-law-info' ); ?>--</option>
267
  <?php
268
  foreach ( $all_pages as $page ) {
269
  ?>
@@ -283,7 +312,7 @@ if ( ! defined( 'WPINC' ) ) {
283
  }
284
  if ( $privacy_page_exists == 0 ) {
285
  ?>
286
- <span class="cli_form_er cli_privacy_page_not_exists_er" style="display: inline;"><?php echo _e( 'The currently selected page does not exist. Please select a new page.' ); ?></span>
287
  <?php
288
  }
289
  }
@@ -291,44 +320,44 @@ if ( ! defined( 'WPINC' ) ) {
291
  </td>
292
  </tr>
293
  <tr valign="top">
294
- <th scope="row"><label for="button_2_new_win_field"><?php _e( 'Hide cookie bar in this page/URL', 'cookie-law-info' ); ?></label></th>
295
  <td>
296
- <input type="radio" id="button_2_hidebar_field_yes" name="button_2_hidebar_field" class="styled" value="true" <?php echo ( $the_options['button_2_hidebar'] == true ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Yes', 'cookie-law-info' ); ?>
297
- <input type="radio" id="button_2_hidebar_field_no" name="button_2_hidebar_field" class="styled" value="false" <?php echo ( $the_options['button_2_hidebar'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'No', 'cookie-law-info' ); ?>
298
  </td>
299
  </tr>
300
  <tr valign="top">
301
- <th scope="row"><label for="button_2_new_win_field"><?php _e( 'Open in a new window', 'cookie-law-info' ); ?></label></th>
302
  <td>
303
- <input type="radio" id="button_2_new_win_field_yes" name="button_2_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_2_new_win'] == true ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Yes', 'cookie-law-info' ); ?>
304
- <input type="radio" id="button_2_new_win_field_no" name="button_2_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_2_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'No', 'cookie-law-info' ); ?>
305
  </td>
306
  </tr>
307
  </table><!-- end custom button -->
308
  </div>
309
  <div class="cli_sub_tab_content" data-id="do-not-sell-button">
310
- <h3><?php _e( 'Do not sell', 'cookie-law-info' ); ?> <code>[wt_cli_ccpa_optout]</code></h3>
311
- <p><?php _e( 'Customise the appearance of CCPA notice. Enabling ‘Show CCPA notice’ displays the notice on the consent bar and records prior consent from the user. Alternatively, insert CCPA shortcode [wt_cli_ccpa_optout] to render CCPA notice in a specific page of your site, preferably, cookie policy page.', 'cookie-law-info' ); ?></p>
312
 
313
  <table class="form-table">
314
  <tr valign="top">
315
- <th scope="row"><label for="button_6_text_field"><?php _e( 'CCPA Text', 'cookie-law-info' ); ?></label></th>
316
  <td>
317
  <input type="text" name="button_6_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_6_text'] ) ); ?>" />
318
  </td>
319
  </tr>
320
  <tr valign="top">
321
- <th scope="row"><label for="button_6_as_link_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
322
  <td>
323
- <input type="radio" cli_frm_tgl-target="wt-cli-ccpa-advanced" id="button_6_as_link_field_yes" name="button_6_as_link_field" class="styled cli_form_toggle" value="true" <?php echo ( wp_validate_boolean( $the_options['button_6_as_link'] ) == true ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Link', 'cookie-law-info' ); ?>
324
- <input type="radio" cli_frm_tgl-target="wt-cli-ccpa-advanced" id="button_6_as_link_field_no" name="button_6_as_link_field" class="styled cli_form_toggle" value="false" <?php echo ( wp_validate_boolean( $the_options['button_6_as_link'] ) == false ) ? ' checked="checked"' : ' '; ?> /> <?php _e( 'Checkbox', 'cookie-law-info' ); ?>
325
- <span class="cli_form_help" cli_frm_tgl-id="wt-cli-ccpa-advanced" cli_frm_tgl-val="true" style="margin-top:8px;"><?php _e( 'The shortcode will be represented as a link whereever used.', 'cookie-law-info' ); ?></span>
326
- <span class="cli_form_help" cli_frm_tgl-id="wt-cli-ccpa-advanced" cli_frm_tgl-val="false" style="margin-top:8px;"><?php _e( 'The shortcode will be represented as a checkbox with select option to record consent.', 'cookie-law-info' ); ?></span>
327
 
328
  </td>
329
  </tr>
330
  <tr valign="top">
331
- <th scope="row"><label for="button_6_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
332
  <td>
333
  <?php
334
  echo '<input type="text" name="button_6_link_colour_field" id="cli-colour-link-button-6" value="' . esc_attr( $the_options['button_6_link_colour'] ) . '" class="my-color-field" />';
@@ -338,17 +367,17 @@ if ( ! defined( 'WPINC' ) ) {
338
  </table><!-- end custom button -->
339
  </div>
340
  <div class="cli_sub_tab_content" data-id="accept-all-button" style="display:block;">
341
- <h3><?php _e( 'Accept All Button', 'cookie-law-info' ); ?> <code>[cookie_accept_all]</code></h3>
342
- <p><?php _e( '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.', 'cookie-law-info' ); ?></p>
343
  <table class="form-table">
344
  <tr valign="top">
345
- <th scope="row"><label for="button_7_text_field"><?php _e( 'Text', 'cookie-law-info' ); ?></label></th>
346
  <td>
347
  <input type="text" name="button_7_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_7_text'] ) ); ?>" />
348
  </td>
349
  </tr>
350
  <tr valign="top">
351
- <th scope="row"><label for="button_7_link_colour_field"><?php _e( 'Text colour', 'cookie-law-info' ); ?></label></th>
352
  <td>
353
  <?php
354
  echo '<input type="text" name="button_7_link_colour_field" id="cli-colour-link-button-7" value="' . esc_attr( $the_options['button_7_link_colour'] ) . '" class="my-color-field" />';
@@ -356,15 +385,15 @@ if ( ! defined( 'WPINC' ) ) {
356
  </td>
357
  </tr>
358
  <tr valign="top">
359
- <th scope="row"><label for="button_7_as_button_field"><?php _e( 'Show as', 'cookie-law-info' ); ?></label></th>
360
  <td>
361
- <input type="radio" cli_frm_tgl-target="cli_accept_all_type" id="button_7_as_button_field_yes" name="button_7_as_button_field" class="styled cli_form_toggle" value="true" <?php echo ( $the_options['button_7_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php _e( 'Button', 'cookie-law-info' ); ?>
362
 
363
- <input type="radio" cli_frm_tgl-target="cli_accept_all_type" id="button_7_as_button_field_no" name="button_7_as_button_field" class="styled cli_form_toggle" value="false" <?php echo ( $the_options['button_7_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Link', 'cookie-law-info' ); ?>
364
  </td>
365
  </tr>
366
  <tr valign="top" class="cli-indent-15" cli_frm_tgl-id="cli_accept_all_type" cli_frm_tgl-val="true">
367
- <th scope="row"><label for="button_7_button_colour_field"><?php _e( 'Background colour', 'cookie-law-info' ); ?></label></th>
368
  <td>
369
  <?php
370
  echo '<input type="text" name="button_7_button_colour_field" id="cli-colour-btn-button-7" value="' . esc_attr( $the_options['button_7_button_colour'] ) . '" class="my-color-field" />';
@@ -372,7 +401,7 @@ if ( ! defined( 'WPINC' ) ) {
372
  </td>
373
  </tr>
374
  <tr valign="top">
375
- <th scope="row"><label for="button_7_action_field"><?php _e( 'Action', 'cookie-law-info' ); ?></label></th>
376
  <td>
377
  <select name="button_7_action_field" id="cli-plugin-button-7-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_accept_all_action">
378
  <?php $this->print_combobox_options( $this->get_js_actions(), $the_options['button_7_action'] ); ?>
@@ -380,23 +409,23 @@ if ( ! defined( 'WPINC' ) ) {
380
  </td>
381
  </tr>
382
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_all_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
383
- <th scope="row"><label for="button_7_url_field"><?php _e( 'URL', 'cookie-law-info' ); ?></label></th>
384
  <td>
385
  <input type="text" name="button_7_url_field" id="button_7_url_field" value="<?php echo esc_url( $the_options['button_7_url'] ); ?>" />
386
- <span class="cli_form_help"><?php _e( 'Button will only link to URL if Action = Open URL', 'cookie-law-info' ); ?></span>
387
  </td>
388
  </tr>
389
 
390
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_all_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
391
- <th scope="row"><label for="button_7_new_win_field"><?php _e( 'Open URL in new window?', 'cookie-law-info' ); ?></label></th>
392
  <td>
393
- <input type="radio" id="button_7_new_win_field_yes" name="button_7_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_7_new_win'] == true ) ? ' checked="checked"' : ''; ?> /><?php _e( 'Yes', 'cookie-law-info' ); ?>
394
 
395
- <input type="radio" id="button_7_new_win_field_no" name="button_7_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_7_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'No', 'cookie-law-info' ); ?>
396
  </td>
397
  </tr>
398
  <tr valign="top">
399
- <th scope="row"><label for="button_7_button_size_field"><?php _e( 'Size', 'cookie-law-info' ); ?></label></th>
400
  <td>
401
  <select name="button_7_button_size_field" class="vvv_combobox">
402
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_7_button_size'] ); ?>
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
 
9
  <ul class="cli_sub_tab">
10
+ <li style="border-left:none; padding-left: 0px;" data-target="accept-all-button"><a><?php echo esc_html__( 'Accept All Button', 'cookie-law-info' ); ?></a></li>
11
+ <li data-target="accept-button"><a><?php echo esc_html__( 'Accept Button', 'cookie-law-info' ); ?></a></li>
12
+ <li data-target="reject-button"><a><?php echo esc_html__( 'Reject Button', 'cookie-law-info' ); ?></a></li>
13
+ <li data-target="settings-button"><a><?php echo esc_html__( 'Settings Button', 'cookie-law-info' ); ?></a></li>
14
+ <li data-target="read-more-button"><a><?php echo esc_html__( 'Read more', 'cookie-law-info' ); ?></a></li>
15
+ <li data-target="do-not-sell-button" class="wt-cli-ccpa-element"><a><?php echo esc_html__( 'Do not sell', 'cookie-law-info' ); ?></a></li>
16
  </ul>
17
 
18
  <div class="cli_sub_tab_container">
19
 
20
  <div class="cli_sub_tab_content" data-id="accept-button" style="display:block;">
21
+ <h3><?php echo esc_html__( 'Accept Button', 'cookie-law-info' ); ?> <code>[cookie_button]</code></h3>
22
+ <p><?php echo esc_html__( 'Customize the Accept button to match the theme of your site. Insert the shortcode [cookie_button] in Customise Cookie Bar > Cookie bar > Message to include accept button in cookie consent bar.', 'cookie-law-info' ); ?></p>
23
  <table class="form-table">
24
  <tr valign="top">
25
+ <th scope="row"><label for="button_1_text_field"><?php echo esc_html__( 'Text', 'cookie-law-info' ); ?></label></th>
26
  <td>
27
  <input type="text" name="button_1_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_1_text'] ) ); ?>" />
28
  </td>
29
  </tr>
30
  <tr valign="top">
31
+ <th scope="row"><label for="button_1_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
32
  <td>
33
  <?php
34
  echo '<input type="text" name="button_1_link_colour_field" id="cli-colour-link-button-1" value="' . esc_attr( $the_options['button_1_link_colour'] ) . '" class="my-color-field" />';
36
  </td>
37
  </tr>
38
  <tr valign="top">
39
+ <th scope="row"><label for="button_1_as_button_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
40
  <td>
41
+ <input type="radio" cli_frm_tgl-target="cli_accept_type" id="button_1_as_button_field_yes" name="button_1_as_button_field" class="styled cli_form_toggle" value="true" <?php echo ( $the_options['button_1_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php echo esc_html__( 'Button', 'cookie-law-info' ); ?>
42
 
43
+ <input type="radio" cli_frm_tgl-target="cli_accept_type" id="button_1_as_button_field_no" name="button_1_as_button_field" class="styled cli_form_toggle" value="false" <?php echo ( $the_options['button_1_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
44
  </td>
45
  </tr>
46
  <tr valign="top" class="cli-indent-15" cli_frm_tgl-id="cli_accept_type" cli_frm_tgl-val="true">
47
+ <th scope="row"><label for="button_1_button_colour_field"><?php echo esc_html__( 'Background colour', 'cookie-law-info' ); ?></label></th>
48
  <td>
49
  <?php
50
  echo '<input type="text" name="button_1_button_colour_field" id="cli-colour-btn-button-1" value="' . esc_attr( $the_options['button_1_button_colour'] ) . '" class="my-color-field" />';
53
  </tr>
54
 
55
  <tr valign="top">
56
+ <th scope="row"><label for="button_1_action_field"><?php echo esc_html__( 'Action', 'cookie-law-info' ); ?></label></th>
57
  <td>
58
  <select name="button_1_action_field" id="cli-plugin-button-1-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_accept_action">
59
  <?php $this->print_combobox_options( $this->get_js_actions(), $the_options['button_1_action'] ); ?>
61
  </td>
62
  </tr>
63
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
64
+ <th scope="row"><label for="button_1_url_field"><?php echo esc_html__( 'URL', 'cookie-law-info' ); ?></label></th>
65
  <td>
66
  <input type="text" name="button_1_url_field" id="button_1_url_field" value="<?php echo esc_attr( $the_options['button_1_url'] ); ?>" />
67
+ <span class="cli_form_help"><?php echo esc_html__( 'Specify the URL to redirect users on accept button click. e.g. Entering the cookie policy page URL will redirect users to the cookie policy page after giving consent.', 'cookie-law-info' ); ?></span>
68
  </td>
69
  </tr>
70
 
71
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
72
+ <th scope="row"><label for="button_1_new_win_field"><?php echo esc_html__( 'Open URL in new window', 'cookie-law-info' ); ?></label></th>
73
  <td>
74
+ <input type="radio" id="button_1_new_win_field_yes" name="button_1_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_1_new_win'] == true ) ? ' checked="checked"' : ''; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
75
 
76
+ <input type="radio" id="button_1_new_win_field_no" name="button_1_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_1_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
77
  </td>
78
  </tr>
79
 
80
 
81
 
82
  <tr valign="top">
83
+ <th scope="row"><label for="button_1_button_size_field"><?php echo esc_html__( 'Button Size', 'cookie-law-info' ); ?></label></th>
84
  <td>
85
  <select name="button_1_button_size_field" class="vvv_combobox">
86
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_1_button_size'] ); ?>
91
  </div>
92
 
93
  <div class="cli_sub_tab_content" data-id="reject-button">
94
+ <h3><?php echo esc_html__( 'Reject Button', 'cookie-law-info' ); ?> <code>[cookie_reject]</code></h3>
95
+
96
+ <p>
97
+ <?php
98
+ echo wp_kses(
99
+ __( 'Customize the Reject button to match the theme of your site. Insert the shortcode <strong>[cookie_reject]</strong> in <strong>Customise Cookie Bar > Cookie bar > Message</strong> to include reject button in cookie consent bar.', 'cookie-law-info' ),
100
+ array(
101
+ 'p' => array(),
102
+ 'strong' => array(),
103
+ )
104
+ );
105
+ ?>
106
+ </p>
107
  <table class="form-table" >
108
  <tr valign="top">
109
+ <th scope="row"><label for="button_3_text_field"><?php echo esc_html__( 'Text', 'cookie-law-info' ); ?></label></th>
110
  <td>
111
  <input type="text" name="button_3_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_3_text'] ) ); ?>" />
112
  </td>
113
  </tr>
114
  <tr valign="top">
115
+ <th scope="row"><label for="button_3_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
116
  <td>
117
  <?php
118
  echo '<input type="text" name="button_3_link_colour_field" id="cli-colour-link-button-3" value="' . esc_attr( $the_options['button_3_link_colour'] ) . '" class="my-color-field" />';
120
  </td>
121
  </tr>
122
  <tr valign="top">
123
+ <th scope="row"><label for="button_3_as_button_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
124
  <td>
125
+ <input type="radio" id="button_3_as_button_field_yes" name="button_3_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_reject_type" value="true" <?php echo ( $the_options['button_3_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php echo esc_html__( 'Button', 'cookie-law-info' ); ?>
126
 
127
+ <input type="radio" id="button_3_as_button_field_no" name="button_3_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_reject_type" value="false" <?php echo ( $the_options['button_3_as_button'] == false ) ? ' checked="checked"' : ''; ?> /><?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
128
  </td>
129
  </tr>
130
  <tr valign="top" cli_frm_tgl-id="cli_reject_type" cli_frm_tgl-val="true">
131
+ <th scope="row"><label for="button_3_button_colour_field"><?php echo esc_html__( 'Background colour', 'cookie-law-info' ); ?></label></th>
132
  <td>
133
  <?php
134
  echo '<input type="text" name="button_3_button_colour_field" id="cli-colour-btn-button-3" value="' . esc_attr( $the_options['button_3_button_colour'] ) . '" class="my-color-field" />';
136
  </td>
137
  </tr>
138
  <tr valign="top">
139
+ <th scope="row"><label for="button_3_action_field"><?php echo esc_html__( 'Action', 'cookie-law-info' ); ?></label></th>
140
  <td>
141
  <select name="button_3_action_field" id="cli-plugin-button-3-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_reject_action">
142
  <?php
148
  </td>
149
  </tr>
150
  <tr valign="top" class="cli-plugin-row" cli_frm_tgl-id="cli_reject_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
151
+ <th scope="row"><label for="button_3_url_field"><?php echo esc_html__( 'URL', 'cookie-law-info' ); ?></label></th>
152
  <td>
153
  <input type="text" name="button_3_url_field" id="button_3_url_field" value="<?php echo esc_url( $the_options['button_3_url'] ); ?>" />
154
+ <span class="cli_form_help"><?php echo esc_html__( 'Specify the URL to redirect users on reject button click. e.g. Entering the cookie policy page URL will redirect users to the cookie policy page after rejecting cookies.', 'cookie-law-info' ); ?></span>
155
  </td>
156
  </tr>
157
 
158
  <tr valign="top" class="cli-plugin-row" cli_frm_tgl-id="cli_reject_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
159
+ <th scope="row"><label for="button_3_new_win_field"><?php echo esc_html__( 'Open URL in new window', 'cookie-law-info' ); ?></label></th>
160
  <td>
161
+ <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"' : ''; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
162
+ <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"' : ''; ?> /><?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
163
  </td>
164
  </tr>
165
  <tr valign="top">
166
+ <th scope="row"><label for="button_3_button_size_field"><?php echo esc_html__( 'Button Size', 'cookie-law-info' ); ?></label></th>
167
  <td>
168
  <select name="button_3_button_size_field" class="vvv_combobox">
169
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_3_button_size'] ); ?>
173
  </table><!-- end custom button -->
174
  </div>
175
  <div class="cli_sub_tab_content" data-id="settings-button">
176
+ <h3><?php echo esc_html__( 'Settings Button', 'cookie-law-info' ); ?> <code>[cookie_settings]</code></h3>
177
+ <p>
178
+ <?php
179
+ echo wp_kses(
180
+ __( 'Customize the cookie settings to match the theme of your site. Insert the shortcode <strong>[cookie_settings]</strong> in <strong>Customise Cookie Bar > Cookie bar > Message</strong> to include cookie settings within the cookie consent bar. Clicking ‘Cookie settings’ opens up a pop up window with provisions to enable/disable cookie categories.', 'cookie-law-info' ),
181
+ array(
182
+ 'p' => array(),
183
+ 'strong' => array(),
184
+ )
185
+ );
186
+ ?>
187
+ </p>
188
  <table class="form-table" >
189
  <tr valign="top">
190
+ <th scope="row"><label for="button_4_text_field"><?php echo esc_html__( 'Text', 'cookie-law-info' ); ?></label></th>
191
  <td>
192
  <input type="text" name="button_4_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_4_text'] ) ); ?>" />
193
  </td>
194
  </tr>
195
  <tr valign="top">
196
+ <th scope="row"><label for="button_4_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
197
  <td>
198
  <?php
199
  echo '<input type="text" name="button_4_link_colour_field" id="cli-colour-link-button-4" value="' . esc_attr( $the_options['button_4_link_colour'] ) . '" class="my-color-field" />';
201
  </td>
202
  </tr>
203
  <tr valign="top">
204
+ <th scope="row"><label for="button_4_as_button_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
205
  <td>
206
+ <input type="radio" id="button_4_as_button_field_yes" name="button_4_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_settings_type" value="true" <?php echo ( $the_options['button_4_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /><?php echo esc_html__( 'Button', 'cookie-law-info' ); ?>
207
 
208
+ <input type="radio" id="button_4_as_button_field_no" name="button_4_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_settings_type" value="false" <?php echo ( $the_options['button_4_as_button'] == false ) ? ' checked="checked"' : ''; ?> /><?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
209
  </td>
210
  </tr>
211
  <tr valign="top" cli_frm_tgl-id="cli_settings_type" cli_frm_tgl-val="true">
212
+ <th scope="row"><label for="button_4_button_colour_field"><?php echo esc_html__( 'Background colour', 'cookie-law-info' ); ?></label></th>
213
  <td>
214
  <?php
215
  echo '<input type="text" name="button_4_button_colour_field" id="cli-colour-btn-button-4" value="' . esc_attr( $the_options['button_4_button_colour'] ) . '" class="my-color-field" />';
219
  </table><!-- end custom button -->
220
  </div>
221
  <div class="cli_sub_tab_content" data-id="read-more-button">
222
+ <h3><?php echo esc_html__( 'Read more', 'cookie-law-info' ); ?> <code>[cookie_link]</code></h3>
223
  <p>
224
+ <?php echo esc_html__( '‘Read more’ redirects users to the ‘Privacy & Cookie Policy’ page. Create a ‘Privacy & Cookie Policy’ page for your site from here.', 'cookie-law-info' ); ?>
225
+ <?php
226
+ echo wp_kses(
227
+ __( 'Insert the shortcode <strong>[cookie_link]</strong> in <strong>Customise Cookie Bar > Cookie bar > Message</strong> to include ‘Read more’ within the cookie consent bar.', 'cookie-law-info' ),
228
+ array(
229
+ 'p' => array(),
230
+ 'strong' => array(),
231
+ )
232
+ );
233
+ ?>
234
  </p>
235
  <?php
236
  if ( Cookie_Law_Info_Admin::module_exists( 'cli-policy-generator' ) ) {
237
  ?>
238
+ <p><?php echo esc_html__( 'Click', 'cookie-law-info' ); ?> <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=' . CLI_POST_TYPE . '&page=cookie-law-info-policy-generator' ) ); ?>"><?php echo esc_html__( 'here', 'cookie-law-info' ); ?></a> <?php echo esc_html__( ' to generate content for Cookie Policy page.', 'cookie-law-info' ); ?>
239
  </p>
240
  <?php
241
  }
243
 
244
  <table class="form-table">
245
  <tr valign="top">
246
+ <th scope="row"><label for="button_2_text_field"><?php echo esc_html__( 'Text', 'cookie-law-info' ); ?></label></th>
247
  <td>
248
  <input type="text" name="button_2_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_2_text'] ) ); ?>" />
249
  </td>
250
  </tr>
251
  <tr valign="top">
252
+ <th scope="row"><label for="button_2_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
253
  <td>
254
  <?php
255
  echo '<input type="text" name="button_2_link_colour_field" id="cli-colour-link-button-1" value="' . esc_attr( $the_options['button_2_link_colour'] ) . '" class="my-color-field" />';
257
  </td>
258
  </tr>
259
  <tr valign="top">
260
+ <th scope="row"><label for="button_2_as_button_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
261
  <td>
262
+ <input type="radio" id="button_2_as_button_field_yes" name="button_2_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_type" value="true" <?php echo ( $the_options['button_2_as_button'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Button', 'cookie-law-info' ); ?>
263
 
264
+ <input type="radio" id="button_2_as_button_field_no" name="button_2_as_button_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_type" value="false" <?php echo ( $the_options['button_2_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
265
  </td>
266
  </tr>
267
  <tr valign="top" cli_frm_tgl-id="cli_readmore_type" cli_frm_tgl-val="true">
268
+ <th scope="row"><label for="button_2_button_colour_field"><?php echo esc_html__( 'Background colour', 'cookie-law-info' ); ?></label></th>
269
  <td>
270
  <?php
271
  echo '<input type="text" name="button_2_button_colour_field" id="cli-colour-btn-button-1" value="' . esc_attr( $the_options['button_2_button_colour'] ) . '" class="my-color-field" />';
274
  </tr>
275
 
276
  <tr valign="top">
277
+ <th scope="row"><label for="button_2_url_type_field"><?php echo esc_html__( 'URL or Page?', 'cookie-law-info' ); ?></label></th>
278
  <td>
279
+ <input type="radio" id="button_2_url_type_field_url" name="button_2_url_type_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_url_type" value="url" <?php echo ( $the_options['button_2_url_type'] == 'url' ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'URL', 'cookie-law-info' ); ?>
280
 
281
+ <input type="radio" id="button_2_url_type_field_page" name="button_2_url_type_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_readmore_url_type" value="page" <?php echo ( $the_options['button_2_url_type'] == 'page' ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Page', 'cookie-law-info' ); ?>
282
  </td>
283
  </tr>
284
 
285
  <tr valign="top" cli_frm_tgl-id="cli_readmore_url_type" cli_frm_tgl-val="url">
286
+ <th scope="row"><label for="button_2_url_field"><?php echo esc_html__( 'URL', 'cookie-law-info' ); ?></label></th>
287
  <td>
288
  <input type="text" name="button_2_url_field" id="button_2_url_field" value="<?php echo esc_url( $the_options['button_2_url'] ); ?>" />
289
  </td>
290
  </tr>
291
  <tr valign="top" cli_frm_tgl-id="cli_readmore_url_type" cli_frm_tgl-val="page">
292
+ <th scope="row"><label for="button_2_page_field"><?php echo esc_html__( 'Page', 'cookie-law-info' ); ?></label></th>
293
  <td>
294
  <select name="button_2_page_field" class="vvv_combobox" id="button_2_page_field">
295
+ <option value="0">--<?php echo esc_html__( 'Select One', 'cookie-law-info' ); ?>--</option>
296
  <?php
297
  foreach ( $all_pages as $page ) {
298
  ?>
312
  }
313
  if ( $privacy_page_exists == 0 ) {
314
  ?>
315
+ <span class="cli_form_er cli_privacy_page_not_exists_er" style="display: inline;"><?php echo esc_html__( 'The currently selected page does not exist. Please select a new page.' ); ?></span>
316
  <?php
317
  }
318
  }
320
  </td>
321
  </tr>
322
  <tr valign="top">
323
+ <th scope="row"><label for="button_2_new_win_field"><?php echo esc_html__( 'Hide cookie bar in this page/URL', 'cookie-law-info' ); ?></label></th>
324
  <td>
325
+ <input type="radio" id="button_2_hidebar_field_yes" name="button_2_hidebar_field" class="styled" value="true" <?php echo ( $the_options['button_2_hidebar'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
326
+ <input type="radio" id="button_2_hidebar_field_no" name="button_2_hidebar_field" class="styled" value="false" <?php echo ( $the_options['button_2_hidebar'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
327
  </td>
328
  </tr>
329
  <tr valign="top">
330
+ <th scope="row"><label for="button_2_new_win_field"><?php echo esc_html__( 'Open in a new window', 'cookie-law-info' ); ?></label></th>
331
  <td>
332
+ <input type="radio" id="button_2_new_win_field_yes" name="button_2_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_2_new_win'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
333
+ <input type="radio" id="button_2_new_win_field_no" name="button_2_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_2_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
334
  </td>
335
  </tr>
336
  </table><!-- end custom button -->
337
  </div>
338
  <div class="cli_sub_tab_content" data-id="do-not-sell-button">
339
+ <h3><?php echo esc_html__( 'Do not sell', 'cookie-law-info' ); ?> <code>[wt_cli_ccpa_optout]</code></h3>
340
+ <p><?php echo esc_html__( 'Customise the appearance of CCPA notice. Enabling ‘Show CCPA notice’ displays the notice on the consent bar and records prior consent from the user. Alternatively, insert CCPA shortcode [wt_cli_ccpa_optout] to render CCPA notice in a specific page of your site, preferably, cookie policy page.', 'cookie-law-info' ); ?></p>
341
 
342
  <table class="form-table">
343
  <tr valign="top">
344
+ <th scope="row"><label for="button_6_text_field"><?php echo esc_html__( 'CCPA Text', 'cookie-law-info' ); ?></label></th>
345
  <td>
346
  <input type="text" name="button_6_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_6_text'] ) ); ?>" />
347
  </td>
348
  </tr>
349
  <tr valign="top">
350
+ <th scope="row"><label for="button_6_as_link_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
351
  <td>
352
+ <input type="radio" cli_frm_tgl-target="wt-cli-ccpa-advanced" id="button_6_as_link_field_yes" name="button_6_as_link_field" class="styled cli_form_toggle" value="true" <?php echo ( wp_validate_boolean( $the_options['button_6_as_link'] ) == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
353
+ <input type="radio" cli_frm_tgl-target="wt-cli-ccpa-advanced" id="button_6_as_link_field_no" name="button_6_as_link_field" class="styled cli_form_toggle" value="false" <?php echo ( wp_validate_boolean( $the_options['button_6_as_link'] ) == false ) ? ' checked="checked"' : ' '; ?> /> <?php echo esc_html__( 'Checkbox', 'cookie-law-info' ); ?>
354
+ <span class="cli_form_help" cli_frm_tgl-id="wt-cli-ccpa-advanced" cli_frm_tgl-val="true" style="margin-top:8px;"><?php echo esc_html__( 'The shortcode will be represented as a link whereever used.', 'cookie-law-info' ); ?></span>
355
+ <span class="cli_form_help" cli_frm_tgl-id="wt-cli-ccpa-advanced" cli_frm_tgl-val="false" style="margin-top:8px;"><?php echo esc_html__( 'The shortcode will be represented as a checkbox with select option to record consent.', 'cookie-law-info' ); ?></span>
356
 
357
  </td>
358
  </tr>
359
  <tr valign="top">
360
+ <th scope="row"><label for="button_6_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
361
  <td>
362
  <?php
363
  echo '<input type="text" name="button_6_link_colour_field" id="cli-colour-link-button-6" value="' . esc_attr( $the_options['button_6_link_colour'] ) . '" class="my-color-field" />';
367
  </table><!-- end custom button -->
368
  </div>
369
  <div class="cli_sub_tab_content" data-id="accept-all-button" style="display:block;">
370
+ <h3><?php echo esc_html__( 'Accept All Button', 'cookie-law-info' ); ?> <code>[cookie_accept_all]</code></h3>
371
+ <p><?php echo esc_html__( '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.', 'cookie-law-info' ); ?></p>
372
  <table class="form-table">
373
  <tr valign="top">
374
+ <th scope="row"><label for="button_7_text_field"><?php echo esc_html__( 'Text', 'cookie-law-info' ); ?></label></th>
375
  <td>
376
  <input type="text" name="button_7_text_field" value="<?php echo esc_attr( stripslashes( $the_options['button_7_text'] ) ); ?>" />
377
  </td>
378
  </tr>
379
  <tr valign="top">
380
+ <th scope="row"><label for="button_7_link_colour_field"><?php echo esc_html__( 'Text colour', 'cookie-law-info' ); ?></label></th>
381
  <td>
382
  <?php
383
  echo '<input type="text" name="button_7_link_colour_field" id="cli-colour-link-button-7" value="' . esc_attr( $the_options['button_7_link_colour'] ) . '" class="my-color-field" />';
385
  </td>
386
  </tr>
387
  <tr valign="top">
388
+ <th scope="row"><label for="button_7_as_button_field"><?php echo esc_html__( 'Show as', 'cookie-law-info' ); ?></label></th>
389
  <td>
390
+ <input type="radio" cli_frm_tgl-target="cli_accept_all_type" id="button_7_as_button_field_yes" name="button_7_as_button_field" class="styled cli_form_toggle" value="true" <?php echo ( $the_options['button_7_as_button'] == true ) ? ' checked="checked"' : ' '; ?> /> <?php echo esc_html__( 'Button', 'cookie-law-info' ); ?>
391
 
392
+ <input type="radio" cli_frm_tgl-target="cli_accept_all_type" id="button_7_as_button_field_no" name="button_7_as_button_field" class="styled cli_form_toggle" value="false" <?php echo ( $the_options['button_7_as_button'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Link', 'cookie-law-info' ); ?>
393
  </td>
394
  </tr>
395
  <tr valign="top" class="cli-indent-15" cli_frm_tgl-id="cli_accept_all_type" cli_frm_tgl-val="true">
396
+ <th scope="row"><label for="button_7_button_colour_field"><?php echo esc_html__( 'Background colour', 'cookie-law-info' ); ?></label></th>
397
  <td>
398
  <?php
399
  echo '<input type="text" name="button_7_button_colour_field" id="cli-colour-btn-button-7" value="' . esc_attr( $the_options['button_7_button_colour'] ) . '" class="my-color-field" />';
401
  </td>
402
  </tr>
403
  <tr valign="top">
404
+ <th scope="row"><label for="button_7_action_field"><?php echo esc_html__( 'Action', 'cookie-law-info' ); ?></label></th>
405
  <td>
406
  <select name="button_7_action_field" id="cli-plugin-button-7-action" class="vvv_combobox cli_form_toggle" cli_frm_tgl-target="cli_accept_all_action">
407
  <?php $this->print_combobox_options( $this->get_js_actions(), $the_options['button_7_action'] ); ?>
409
  </td>
410
  </tr>
411
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_all_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
412
+ <th scope="row"><label for="button_7_url_field"><?php echo esc_html__( 'URL', 'cookie-law-info' ); ?></label></th>
413
  <td>
414
  <input type="text" name="button_7_url_field" id="button_7_url_field" value="<?php echo esc_url( $the_options['button_7_url'] ); ?>" />
415
+ <span class="cli_form_help"><?php echo esc_html__( 'Button will only link to URL if Action = Open URL', 'cookie-law-info' ); ?></span>
416
  </td>
417
  </tr>
418
 
419
  <tr valign="top" class="cli-plugin-row cli-indent-15" cli_frm_tgl-id="cli_accept_all_action" cli_frm_tgl-val="CONSTANT_OPEN_URL">
420
+ <th scope="row"><label for="button_7_new_win_field"><?php echo esc_html__( 'Open URL in new window?', 'cookie-law-info' ); ?></label></th>
421
  <td>
422
+ <input type="radio" id="button_7_new_win_field_yes" name="button_7_new_win_field" class="styled" value="true" <?php echo ( $the_options['button_7_new_win'] == true ) ? ' checked="checked"' : ''; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
423
 
424
+ <input type="radio" id="button_7_new_win_field_no" name="button_7_new_win_field" class="styled" value="false" <?php echo ( $the_options['button_7_new_win'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
425
  </td>
426
  </tr>
427
  <tr valign="top">
428
+ <th scope="row"><label for="button_7_button_size_field"><?php echo esc_html__( 'Size', 'cookie-law-info' ); ?></label></th>
429
  <td>
430
  <select name="button_7_button_size_field" class="vvv_combobox">
431
  <?php $this->print_combobox_options( $this->get_button_sizes(), $the_options['button_7_button_size'] ); ?>
admin/views/admin-settings-general.php CHANGED
@@ -1,60 +1,60 @@
1
  <?php
2
  // If this file is called directly, abort.
3
- if (!defined('WPINC')) {
4
  die;
5
  }
6
  ?>
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
  <ul class="cli_sub_tab">
9
- <li style="border-left:none; padding-left: 0px;" data-target="cookie-bar"><a><?php _e('General', 'cookie-law-info'); ?></a></li>
10
- <li data-target="other"><a><?php _e('Other', 'cookie-law-info'); ?></a></li>
11
  </ul>
12
  <div class="cli_sub_tab_container">
13
  <div class="cli_sub_tab_content" data-id="cookie-bar" style="display:block;">
14
  <div class="wt-cli-section wt-cli-section-general-settings">
15
  <table class="form-table">
16
  <tr valign="top">
17
- <th scope="row"><label for="is_on_field"><?php _e('Enable cookie bar', 'cookie-law-info'); ?></label></th>
18
  <td>
19
- <input type="radio" id="is_on_field_yes" name="is_on_field" class="styled cli_bar_on" value="true" <?php echo ($the_options['is_on'] == true) ? ' checked="checked"' : ''; ?> /><?php _e('On', 'cookie-law-info'); ?>
20
- <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" ' : ''; ?> /><?php _e('Off', 'cookie-law-info'); ?>
21
  </td>
22
  </tr>
23
- <?php do_action('wt_cli_before_cookie_message'); ?>
24
  </table>
25
  </div>
26
  <div class="wt-cli-section wt-cli-section-gdpr-ccpa">
27
  <div class="wt-cli-section-inner wt-cli-section-inner-gdpr">
28
  </div>
29
  <div class="wt-cli-section-inner wt-cli-section-inner-ccpa">
30
- <?php do_action('wt_cli_ccpa_settings'); ?>
31
  </div>
32
  </div>
33
  <table class="form-table" style="border-top: 2px dotted #e2e4e7;">
34
  <!-- SHOW ONCE / TIMER -->
35
  <tr valign="top">
36
- <th scope="row"><label for="show_once_yn_field"><?php _e('Auto-hide(Accept) cookie bar after delay?', 'cookie-law-info'); ?></label></th>
37
  <td>
38
- <input type="radio" id="show_once_yn_yes" name="show_once_yn_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_autohide" value="true" <?php echo ($the_options['show_once_yn'] == true) ? ' checked="checked"' : ''; ?> /> <?php _e('Yes', 'cookie-law-info'); ?>
39
- <input type="radio" id="show_once_yn_no" name="show_once_yn_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_autohide" value="false" <?php echo ($the_options['show_once_yn'] == false) ? ' checked="checked"' : ''; ?> /> <?php _e('No', 'cookie-law-info'); ?>
40
  </td>
41
  </tr>
42
  <tr valign="top" cli_frm_tgl-id="cli_bar_autohide" cli_frm_tgl-val="true">
43
- <th scope="row"><label for="show_once_field"><?php _e('Milliseconds until hidden', 'cookie-law-info'); ?></label></th>
44
  <td>
45
  <input type="text" name="show_once_field" value="<?php echo esc_attr( $the_options['show_once'] ); ?>" />
46
- <span class="cli_form_help"><?php _e('Specify milliseconds (not seconds)', 'cookie-law-info'); ?> e.g. 8000 = 8 <?php _e('seconds', 'cookie-law-info'); ?></span>
47
  </td>
48
  </tr>
49
 
50
  <!-- NEW: CLOSE ON SCROLL -->
51
  <tr valign="top">
52
- <th scope="row"><label for="scroll_close_field"><?php _e('Auto-hide cookie bar if the user scrolls ( Accept on Scroll )?', 'cookie-law-info'); ?></label></th>
53
  <td>
54
- <input type="radio" id="scroll_close_yes" name="scroll_close_field" class="styled" value="true" <?php echo ($the_options['scroll_close'] == true) ? ' checked="checked"' : ''; ?> /> <?php _e('Yes', 'cookie-law-info'); ?>
55
- <input type="radio" id="scroll_close_no" name="scroll_close_field" class="styled" value="false" <?php echo ($the_options['scroll_close'] == false) ? ' checked="checked"' : ''; ?> /> <?php _e('No', 'cookie-law-info'); ?>
56
- <span class="cli_form_help" style="margin-top:8px;"><?php _e('As per latest GDPR policies it is required to take an explicit consent for the cookies. Use this option with discretion especially if you serve EU', 'cookie-law-info'); ?></span>
57
- <span class="cli_form_er cli_scroll_accept_er"><?php _e('This option will not work along with `Popup overlay`.', 'cookie-law-info'); ?></span>
58
  </td>
59
  </tr>
60
  </table>
@@ -63,37 +63,34 @@ if (!defined('WPINC')) {
63
 
64
  </div>
65
  <div class="cli_sub_tab_content" data-id="other">
66
- <h3><?php _e('Other', 'cookie-law-info'); ?></h3>
67
  <table class="form-table">
68
  <tr valign="top" class="">
69
- <th scope="row"><label for="scroll_close_reload_field"><?php _e('Reload after "scroll accept" event?', 'cookie-law-info'); ?></label></th>
70
  <td>
71
- <!-- <input type="text" name="scroll_close_reload_field" value="<?php echo $the_options['scroll_close_reload'] ?>" />
72
- <span class="cli_form_help">If the user accepts, do you want to reload the page? This feature is mostly for Italian users who have to deal with a very specific interpretation of the cookie law.</span>
73
- -->
74
- <input type="radio" id="scroll_close_reload_yes" name="scroll_close_reload_field" class="styled" value="true" <?php echo ($the_options['scroll_close_reload'] == true) ? ' checked="checked" ' : ' '; ?> /> <?php _e('Yes', 'cookie-law-info'); ?>
75
- <input type="radio" id="scroll_close_reload_no" name="scroll_close_reload_field" class="styled" value="false" <?php echo ($the_options['scroll_close_reload'] == false) ? ' checked="checked" ' : ''; ?> /> <?php _e('No', 'cookie-law-info'); ?>
76
 
77
  </td>
78
  </tr>
79
  <tr valign="top">
80
- <th scope="row"><label for="accept_close_reload_field"><?php _e('Reload after Accept button click', 'cookie-law-info'); ?></label></th>
81
  <td>
82
- <input type="radio" id="accept_close_reload_yes" name="accept_close_reload_field" class="styled" value="true" <?php echo ($the_options['accept_close_reload'] == true) ? ' checked="checked" ' : ''; ?> /><?php _e('Yes', 'cookie-law-info'); ?>
83
- <input type="radio" id="accept_close_reload_no" name="accept_close_reload_field" class="styled" value="false" <?php echo ($the_options['accept_close_reload'] == false) ? ' checked="checked" ' : ''; ?> /><?php _e('No', 'cookie-law-info'); ?>
84
  </td>
85
  </tr>
86
  <tr valign="top">
87
- <th scope="row"><label for="reject_close_reload_field"><?php _e('Reload after Reject button click', 'cookie-law-info'); ?></label></th>
88
  <td>
89
- <input type="radio" id="reject_close_reload_yes" name="reject_close_reload_field" class="styled" value="true" <?php echo ($the_options['reject_close_reload'] == true) ? ' checked="checked" ' : ''; ?> /><?php _e('Yes', 'cookie-law-info'); ?>
90
- <input type="radio" id="reject_close_reload_no" name="reject_close_reload_field" class="styled" value="false" <?php echo ($the_options['reject_close_reload'] == false) ? ' checked="checked" ' : ''; ?> /><?php _e('No', 'cookie-law-info'); ?>
91
  </td>
92
  </tr>
93
  </table>
94
  </div>
95
  </div>
96
  <?php
97
- include "admin-settings-save-button.php";
98
  ?>
99
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
  die;
5
  }
6
  ?>
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
  <ul class="cli_sub_tab">
9
+ <li style="border-left:none; padding-left: 0px;" data-target="cookie-bar"><a><?php echo esc_html__( 'General', 'cookie-law-info' ); ?></a></li>
10
+ <li data-target="other"><a><?php echo esc_html__( 'Other', 'cookie-law-info' ); ?></a></li>
11
  </ul>
12
  <div class="cli_sub_tab_container">
13
  <div class="cli_sub_tab_content" data-id="cookie-bar" style="display:block;">
14
  <div class="wt-cli-section wt-cli-section-general-settings">
15
  <table class="form-table">
16
  <tr valign="top">
17
+ <th scope="row"><label for="is_on_field"><?php echo esc_html__( 'Enable cookie bar', 'cookie-law-info' ); ?></label></th>
18
  <td>
19
+ <input type="radio" id="is_on_field_yes" name="is_on_field" class="styled cli_bar_on" value="true" <?php echo ( $the_options['is_on'] == true ) ? ' checked="checked"' : ''; ?> /><?php echo esc_html__( 'On', 'cookie-law-info' ); ?>
20
+ <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" ' : ''; ?> /><?php echo esc_html__( 'Off', 'cookie-law-info' ); ?>
21
  </td>
22
  </tr>
23
+ <?php do_action( 'wt_cli_before_cookie_message' ); ?>
24
  </table>
25
  </div>
26
  <div class="wt-cli-section wt-cli-section-gdpr-ccpa">
27
  <div class="wt-cli-section-inner wt-cli-section-inner-gdpr">
28
  </div>
29
  <div class="wt-cli-section-inner wt-cli-section-inner-ccpa">
30
+ <?php do_action( 'wt_cli_ccpa_settings' ); ?>
31
  </div>
32
  </div>
33
  <table class="form-table" style="border-top: 2px dotted #e2e4e7;">
34
  <!-- SHOW ONCE / TIMER -->
35
  <tr valign="top">
36
+ <th scope="row"><label for="show_once_yn_field"><?php echo esc_html__( 'Auto-hide(Accept) cookie bar after delay?', 'cookie-law-info' ); ?></label></th>
37
  <td>
38
+ <input type="radio" id="show_once_yn_yes" name="show_once_yn_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_autohide" value="true" <?php echo ( $the_options['show_once_yn'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
39
+ <input type="radio" id="show_once_yn_no" name="show_once_yn_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_autohide" value="false" <?php echo ( $the_options['show_once_yn'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
40
  </td>
41
  </tr>
42
  <tr valign="top" cli_frm_tgl-id="cli_bar_autohide" cli_frm_tgl-val="true">
43
+ <th scope="row"><label for="show_once_field"><?php echo esc_html__( 'Milliseconds until hidden', 'cookie-law-info' ); ?></label></th>
44
  <td>
45
  <input type="text" name="show_once_field" value="<?php echo esc_attr( $the_options['show_once'] ); ?>" />
46
+ <span class="cli_form_help"><?php echo esc_html__( 'Specify milliseconds (not seconds)', 'cookie-law-info' ); ?> e.g. 8000 = 8 <?php echo esc_html__( 'seconds', 'cookie-law-info' ); ?></span>
47
  </td>
48
  </tr>
49
 
50
  <!-- NEW: CLOSE ON SCROLL -->
51
  <tr valign="top">
52
+ <th scope="row"><label for="scroll_close_field"><?php echo esc_html__( 'Auto-hide cookie bar if the user scrolls ( Accept on Scroll )?', 'cookie-law-info' ); ?></label></th>
53
  <td>
54
+ <input type="radio" id="scroll_close_yes" name="scroll_close_field" class="styled" value="true" <?php echo ( $the_options['scroll_close'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
55
+ <input type="radio" id="scroll_close_no" name="scroll_close_field" class="styled" value="false" <?php echo ( $the_options['scroll_close'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
56
+ <span class="cli_form_help" style="margin-top:8px;"><?php echo esc_html__( 'As per latest GDPR policies it is required to take an explicit consent for the cookies. Use this option with discretion especially if you serve EU', 'cookie-law-info' ); ?></span>
57
+ <span class="cli_form_er cli_scroll_accept_er"><?php echo esc_html__( 'This option will not work along with `Popup overlay`.', 'cookie-law-info' ); ?></span>
58
  </td>
59
  </tr>
60
  </table>
63
 
64
  </div>
65
  <div class="cli_sub_tab_content" data-id="other">
66
+ <h3><?php echo esc_html__( 'Other', 'cookie-law-info' ); ?></h3>
67
  <table class="form-table">
68
  <tr valign="top" class="">
69
+ <th scope="row"><label for="scroll_close_reload_field"><?php echo esc_html__( 'Reload after "scroll accept" event?', 'cookie-law-info' ); ?></label></th>
70
  <td>
71
+ <input type="radio" id="scroll_close_reload_yes" name="scroll_close_reload_field" class="styled" value="true" <?php echo ( $the_options['scroll_close_reload'] == true ) ? ' checked="checked" ' : ' '; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
72
+ <input type="radio" id="scroll_close_reload_no" name="scroll_close_reload_field" class="styled" value="false" <?php echo ( $the_options['scroll_close_reload'] == false ) ? ' checked="checked" ' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
 
 
 
73
 
74
  </td>
75
  </tr>
76
  <tr valign="top">
77
+ <th scope="row"><label for="accept_close_reload_field"><?php echo esc_html__( 'Reload after Accept button click', 'cookie-law-info' ); ?></label></th>
78
  <td>
79
+ <input type="radio" id="accept_close_reload_yes" name="accept_close_reload_field" class="styled" value="true" <?php echo ( $the_options['accept_close_reload'] == true ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
80
+ <input type="radio" id="accept_close_reload_no" name="accept_close_reload_field" class="styled" value="false" <?php echo ( $the_options['accept_close_reload'] == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
81
  </td>
82
  </tr>
83
  <tr valign="top">
84
+ <th scope="row"><label for="reject_close_reload_field"><?php echo esc_html__( 'Reload after Reject button click', 'cookie-law-info' ); ?></label></th>
85
  <td>
86
+ <input type="radio" id="reject_close_reload_yes" name="reject_close_reload_field" class="styled" value="true" <?php echo ( $the_options['reject_close_reload'] == true ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
87
+ <input type="radio" id="reject_close_reload_no" name="reject_close_reload_field" class="styled" value="false" <?php echo ( $the_options['reject_close_reload'] == false ) ? ' checked="checked" ' : ''; ?> /><?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
88
  </td>
89
  </tr>
90
  </table>
91
  </div>
92
  </div>
93
  <?php
94
+ require 'admin-settings-save-button.php';
95
  ?>
96
+ </div>
admin/views/admin-settings-help.php CHANGED
@@ -1,124 +1,124 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  ?>
7
- <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id );?>">
8
  <ul class="cli_sub_tab">
9
- <li style="border-left:none; padding-left: 0px;" data-target="shortcodes"><a><?php _e('Shortcodes', 'cookie-law-info'); ?></a></li>
10
- <li data-target="help-links"><a><?php _e('Help Links', 'cookie-law-info'); ?></a></li>
11
- </ul>
12
 
13
- <div class="cli_sub_tab_container">
14
- <div class="cli_sub_tab_content" data-id="shortcodes" style="display:block;">
15
- <div style="font-size: 14px;">
16
- <h3><?php _e('Cookie bar shortcodes', 'cookie-law-info'); ?></h3>
17
- <?php _e('You can insert the shortcodes in the Settings > Customise Cookie Bar > Cookie bar > Message to get it rendered on the cookie consent bar of your site.', 'cookie-law-info'); ?>
18
- </div>
19
- <ul class="cli-shortcodes">
20
- <li>
21
- <div style="font-weight: bold;">[cookie_button]</div>
22
- <?php _e('This is the "main button" you customise above.', 'cookie-law-info'); ?>
23
- </li>
24
 
25
- <li><div style="font-weight: bold;">[cookie_reject]</div>
26
- <?php _e('This is the cookie reject button shortcode.', 'cookie-law-info'); ?>
27
- </li>
28
- <li>
29
- <div style="font-weight: bold;">[cookie_settings]</div>
30
- <?php _e('This is the cookie settings button rendering shortcode.', 'cookie-law-info'); ?>
31
- </li>
32
- <li><div style="font-weight: bold;">[cookie_link]</div>
33
- <?php _e('This is the "read more" link you customise above.', 'cookie-law-info'); ?>
34
- </li>
35
 
36
- <li><div style="font-weight: bold;"><?php _e("Setup margin for above buttons");?></div>
37
- Eg: [cookie_button margin="10px"]
38
  <pre>
39
- margin: 5%; /* All sides: 5% margin */
40
 
41
- margin: 10px; /* All sides: 10px margin */
42
 
43
- margin: 1.6em 20px; /* top and bottom: 1.6em margin */
44
- /* left and right: 20px margin */
45
 
46
- margin: 10px 3% -1em; /* top: 10px margin */
47
- /* left and right: 3% margin */
48
- /* bottom: -1em margin */
49
 
50
- margin: 10px 3px 30px 5px; /* top: 10px margin */
51
- /* right: 3px margin */
52
- /* bottom: 30px margin */
53
- /* left: 5px margin */
54
 
55
- margin: 2em auto; /* top and bottom: 2em margin */
56
- /* Box is horizontally centered */
57
 
58
- margin: auto; /* top and bottom: 0 margin */
59
- /* Box is horizontally centered */
60
  </pre>
61
- </li>
62
 
63
- </ul>
64
- <div style="font-size: 14px;">
65
- <h3 style="margin-bottom:5px; margin-top:25px;"><?php _e('Other shortcodes', 'cookie-law-info'); ?></h3>
66
- <?php _e('These shortcodes can be used in pages and posts on your website. It is not recommended to use these inside the cookie bar itself.', 'cookie-law-info'); ?>
67
- </div>
68
 
69
- <ul class="cli-shortcodes">
70
- <li>
71
- <div style="font-weight: bold;">[cookie_audit]</div>
72
- <?php _e('This prints out a nice table of cookies, in line with the guidance given by the ICO.', 'cookie-law-info'); ?> <em><?php _e('You need to enter the cookies your website uses via the Cookie Law Info menu in your WordPress dashboard.', 'cookie-law-info'); ?></em>
73
- <div style="font-weight: bold;">
74
- [cookie_audit style="winter"] <br />
75
- [cookie_audit not_shown_message="No records found"] <br />
76
- [cookie_audit style="winter" not_shown_message="Not found"]<br />
77
- [cookie_audit columns="cookie,description"] <br />
78
- [cookie_audit heading="The below list details the cookies used in our website."]
79
- </div>
80
- <?php _e('Styles included','cookie-law-info'); ?>: simple, classic, modern, rounded, elegant, winter. Default is classic.
81
- <br />
82
- <?php _e('Columns available','cookie-law-info'); ?>: cookie, description, type, duration. <?php _e('Will print all columns by default.','cookie-law-info'); ?>
83
- </li>
84
- <li>
85
- <div style="font-weight: bold;">[delete_cookies]</div>
86
- <?php _e('This shortcode will display a normal HTML link which when clicked, will delete the cookie set by Cookie Law Info (this cookie is used to remember that the cookie bar is closed).', 'cookie-law-info'); ?>
87
- </li>
88
- <li>
89
- <div style="font-weight: bold;">[delete_cookies text="Click here to delete"]</div>
90
- <?php _e('Add any text you like- useful if you want e.g. another language to English.', 'cookie-law-info'); ?>
91
- </li>
92
- <li>
93
- <div style="font-weight: bold;">[cookie_after_accept] Your content goes here... [/cookie_after_accept]</div>
94
- <?php _e('Add content after accepting the cookie notice.', 'cookie-law-info'); ?>
95
- You can use `do_shortcode` function to add shortcodes inside the template file.
96
- </li>
97
- </ul>
98
- </div>
99
- <div class="cli_sub_tab_content" data-id="help-links" style="float: left; height:auto;">
100
- <?php
101
- $admin_img_path=plugin_dir_url(CLI_PLUGIN_FILENAME).'admin/images/';
102
- ?>
103
- <h3><?php _e('Help Links', 'cookie-law-info'); ?></h3>
104
- <ul class="cli-help-links">
105
- <li>
106
- <img src="<?php echo esc_url( $admin_img_path );?>documentation.png">
107
- <h3><?php _e('Documentation', 'cookie-law-info'); ?></h3>
108
- <p><?php _e('Refer to our documentation to set and get started', 'cookie-law-info'); ?></p>
109
- <a target="_blank" href="https://www.webtoffee.com/gdpr-cookie-consent-plugin-basic-version-user-guide/" class="button button-primary">
110
- <?php _e('Documentation', 'cookie-law-info'); ?>
111
- </a>
112
- </li>
113
- <li>
114
- <img src="<?php echo esc_url( $admin_img_path );?>support.png">
115
- <h3><?php _e('Help and Support', 'cookie-law-info'); ?></h3>
116
- <p><?php _e('We would love to help you on any queries or issues.', 'cookie-law-info'); ?></p>
117
- <a target="_blank" href="https://wordpress.org/support/plugin/cookie-law-info/" class="button button-primary">
118
- <?php _e('Contact Us', 'cookie-law-info'); ?>
119
- </a>
120
- </li>
121
- </ul>
122
- </div>
123
- </div>
124
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  ?>
7
+ <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
  <ul class="cli_sub_tab">
9
+ <li style="border-left:none; padding-left: 0px;" data-target="shortcodes"><a><?php echo esc_html__( 'Shortcodes', 'cookie-law-info' ); ?></a></li>
10
+ <li data-target="help-links"><a><?php echo esc_html__( 'Help Links', 'cookie-law-info' ); ?></a></li>
11
+ </ul>
12
 
13
+ <div class="cli_sub_tab_container">
14
+ <div class="cli_sub_tab_content" data-id="shortcodes" style="display:block;">
15
+ <div style="font-size: 14px;">
16
+ <h3><?php echo esc_html__( 'Cookie bar shortcodes', 'cookie-law-info' ); ?></h3>
17
+ <?php echo esc_html__( 'You can insert the shortcodes in the Settings > Customise Cookie Bar > Cookie bar > Message to get it rendered on the cookie consent bar of your site.', 'cookie-law-info' ); ?>
18
+ </div>
19
+ <ul class="cli-shortcodes">
20
+ <li>
21
+ <div style="font-weight: bold;">[cookie_button]</div>
22
+ <?php echo esc_html__( 'This is the "main button" you customise above.', 'cookie-law-info' ); ?>
23
+ </li>
24
 
25
+ <li><div style="font-weight: bold;">[cookie_reject]</div>
26
+ <?php echo esc_html__( 'This is the cookie reject button shortcode.', 'cookie-law-info' ); ?>
27
+ </li>
28
+ <li>
29
+ <div style="font-weight: bold;">[cookie_settings]</div>
30
+ <?php echo esc_html__( 'This is the cookie settings button rendering shortcode.', 'cookie-law-info' ); ?>
31
+ </li>
32
+ <li><div style="font-weight: bold;">[cookie_link]</div>
33
+ <?php echo esc_html__( 'This is the "read more" link you customise above.', 'cookie-law-info' ); ?>
34
+ </li>
35
 
36
+ <li><div style="font-weight: bold;"><?php echo esc_html__( 'Setup margin for above buttons' ); ?></div>
37
+ Eg: [cookie_button margin="10px"]
38
  <pre>
39
+ margin: 5%; /* All sides: 5% margin */
40
 
41
+ margin: 10px; /* All sides: 10px margin */
42
 
43
+ margin: 1.6em 20px; /* top and bottom: 1.6em margin */
44
+ /* left and right: 20px margin */
45
 
46
+ margin: 10px 3% -1em; /* top: 10px margin */
47
+ /* left and right: 3% margin */
48
+ /* bottom: -1em margin */
49
 
50
+ margin: 10px 3px 30px 5px; /* top: 10px margin */
51
+ /* right: 3px margin */
52
+ /* bottom: 30px margin */
53
+ /* left: 5px margin */
54
 
55
+ margin: 2em auto; /* top and bottom: 2em margin */
56
+ /* Box is horizontally centered */
57
 
58
+ margin: auto; /* top and bottom: 0 margin */
59
+ /* Box is horizontally centered */
60
  </pre>
61
+ </li>
62
 
63
+ </ul>
64
+ <div style="font-size: 14px;">
65
+ <h3 style="margin-bottom:5px; margin-top:25px;"><?php echo esc_html__( 'Other shortcodes', 'cookie-law-info' ); ?></h3>
66
+ <?php echo esc_html__( 'These shortcodes can be used in pages and posts on your website. It is not recommended to use these inside the cookie bar itself.', 'cookie-law-info' ); ?>
67
+ </div>
68
 
69
+ <ul class="cli-shortcodes">
70
+ <li>
71
+ <div style="font-weight: bold;">[cookie_audit]</div>
72
+ <?php echo esc_html__( 'This prints out a nice table of cookies, in line with the guidance given by the ICO.', 'cookie-law-info' ); ?> <em><?php echo esc_html__( 'You need to enter the cookies your website uses via the Cookie Law Info menu in your WordPress dashboard.', 'cookie-law-info' ); ?></em>
73
+ <div style="font-weight: bold;">
74
+ [cookie_audit style="winter"] <br />
75
+ [cookie_audit not_shown_message="No records found"] <br />
76
+ [cookie_audit style="winter" not_shown_message="Not found"]<br />
77
+ [cookie_audit columns="cookie,description"] <br />
78
+ [cookie_audit heading="The below list details the cookies used in our website."]
79
+ </div>
80
+ <?php echo esc_html__( 'Styles included', 'cookie-law-info' ); ?>: simple, classic, modern, rounded, elegant, winter. Default is classic.
81
+ <br />
82
+ <?php echo esc_html__( 'Columns available', 'cookie-law-info' ); ?>: cookie, description, type, duration. <?php echo esc_html__( 'Will print all columns by default.', 'cookie-law-info' ); ?>
83
+ </li>
84
+ <li>
85
+ <div style="font-weight: bold;">[delete_cookies]</div>
86
+ <?php echo esc_html__( 'This shortcode will display a normal HTML link which when clicked, will delete the cookie set by Cookie Law Info (this cookie is used to remember that the cookie bar is closed).', 'cookie-law-info' ); ?>
87
+ </li>
88
+ <li>
89
+ <div style="font-weight: bold;">[delete_cookies text="Click here to delete"]</div>
90
+ <?php echo esc_html__( 'Add any text you like- useful if you want e.g. another language to English.', 'cookie-law-info' ); ?>
91
+ </li>
92
+ <li>
93
+ <div style="font-weight: bold;">[cookie_after_accept] Your content goes here... [/cookie_after_accept]</div>
94
+ <?php echo esc_html__( 'Add content after accepting the cookie notice.', 'cookie-law-info' ); ?>
95
+ You can use `do_shortcode` function to add shortcodes inside the template file.
96
+ </li>
97
+ </ul>
98
+ </div>
99
+ <div class="cli_sub_tab_content" data-id="help-links" style="float: left; height:auto;">
100
+ <?php
101
+ $admin_img_path = plugin_dir_url( CLI_PLUGIN_FILENAME ) . 'admin/images/';
102
+ ?>
103
+ <h3><?php echo esc_html__( 'Help Links', 'cookie-law-info' ); ?></h3>
104
+ <ul class="cli-help-links">
105
+ <li>
106
+ <img src="<?php echo esc_url( $admin_img_path ); ?>documentation.png">
107
+ <h3><?php echo esc_html__( 'Documentation', 'cookie-law-info' ); ?></h3>
108
+ <p><?php echo esc_html__( 'Refer to our documentation to set and get started', 'cookie-law-info' ); ?></p>
109
+ <a target="_blank" href="https://www.webtoffee.com/gdpr-cookie-consent-plugin-basic-version-user-guide/" class="button button-primary">
110
+ <?php echo esc_html__( 'Documentation', 'cookie-law-info' ); ?>
111
+ </a>
112
+ </li>
113
+ <li>
114
+ <img src="<?php echo esc_url( $admin_img_path ); ?>support.png">
115
+ <h3><?php echo esc_html__( 'Help and Support', 'cookie-law-info' ); ?></h3>
116
+ <p><?php echo esc_html__( 'We would love to help you on any queries or issues.', 'cookie-law-info' ); ?></p>
117
+ <a target="_blank" href="https://wordpress.org/support/plugin/cookie-law-info/" class="button button-primary">
118
+ <?php echo esc_html__( 'Contact Us', 'cookie-law-info' ); ?>
119
+ </a>
120
+ </li>
121
+ </ul>
122
+ </div>
123
+ </div>
124
+ </div>
admin/views/admin-settings-messagebar.php CHANGED
@@ -1,223 +1,231 @@
1
  <?php
2
  // If this file is called directly, abort.
3
- if (!defined('WPINC')) {
4
- die;
5
  }
6
  ?>
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
- <ul class="cli_sub_tab">
9
- <li style="border-left:none; padding-left: 0px;" data-target="cookie-message"><a><?php _e('Cookie bar', 'cookie-law-info'); ?></a></li>
10
- <li data-target="show-again-tab"><a><?php _e('Revisit consent', 'cookie-law-info'); ?></a></li>
11
- </ul>
12
- <div class="cli_sub_tab_container">
13
- <div class="cli_sub_tab_content" data-id="cookie-message" style="display:block;">
14
- <div class="wt-cli-section wt-cli-section-general-settings">
15
- <table class="form-table">
16
- <tr valign="top">
17
- <th scope="row"><label for="bar_heading_text_field"><?php _e('Message Heading', 'cookie-law-info'); ?></label></th>
18
- <td>
19
- <input type="text" name="bar_heading_text_field" value="<?php echo esc_attr( stripslashes( $the_options['bar_heading_text'] ) ); ?>" />
20
- <span class="cli_form_help"><?php _e('Input text to have a heading for the cookie consent bar. Leave it blank if you do not need one.', 'cookie-law-info'); ?>
21
- </span>
22
- </td>
23
- </tr>
24
- <tr valign="top">
25
- <th scope="row"><label for="notify_message_field"><?php _e('Message', 'cookie-law-info'); ?></label></th>
26
- <td>
27
- <?php
28
- echo '<textarea name="notify_message_field" class="vvv_textbox">';
29
- echo apply_filters('format_to_edit', stripslashes($the_options['notify_message'])) . '</textarea>';
30
- ?>
31
- <span class="cli_form_help"><?php _e('Modify/edit the content of the cookie consent bar.', 'cookie-law-info'); ?> <br /><em><?php _e('Supports shortcodes.(link shortcodes to help link) e.g. [cookie_accept_all] for accept all button, [cookie_button] for accept button, [cookie_reject] for reject button, [cookie_link] for Read more, [cookie_settings] for cookie settings.', 'cookie-law-info'); ?></em></span>
32
- </td>
33
- </tr>
34
- <tr valign="top">
35
- <th scope="row"><label for="background_field"><?php _e('Cookie Bar Colour', 'cookie-law-info'); ?></label></th>
36
- <td>
37
- <?php
38
- /** RICHARDASHBY EDIT */
39
- //echo '<input type="text" name="background_field" id="cli-colour-background" value="' .$the_options['background']. '" />';
40
- echo '<input type="text" name="background_field" id="cli-colour-background" value="' . esc_attr( $the_options['background'] ) . '" class="my-color-field" data-default-color="#fff" />';
41
- ?>
42
- </td>
43
- </tr>
44
- <tr valign="top">
45
- <th scope="row"><label for="text_field"><?php _e('Text Colour', 'cookie-law-info'); ?></label></th>
46
- <td>
47
- <?php
48
- /** RICHARDASHBY EDIT */
49
- echo '<input type="text" name="text_field" id="cli-colour-text" value="' . esc_attr( $the_options['text'] ) . '" class="my-color-field" data-default-color="#000" />';
50
- ?>
51
- </td>
52
- </tr>
53
- <tr valign="top">
54
- <th scope="row"><label for="font_family_field"><?php _e('Font', 'cookie-law-info'); ?></label></th>
55
- <td>
56
- <select name="font_family_field" class="vvv_combobox">
57
- <?php $this->print_combobox_options( $this->get_fonts(), $the_options['font_family'] ) ?>
58
- </select>
59
- </td>
60
- </tr>
61
- <tr valign="top">
62
- <th scope="row"><label for="cookie_bar_as_field"><?php _e('Show cookie bar as', 'cookie-law-info'); ?></label></th>
63
- <td>
64
- <?php
65
- $cookie_bar_as = $the_options['cookie_bar_as'];
66
- ?>
67
- <input type="radio" id="cookie_bar_as_field_banner" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="banner" <?php checked($cookie_bar_as, 'banner'); ?> /> <?php _e('Banner', 'cookie-law-info'); ?>
68
- <input type="radio" id="cookie_bar_as_field_popup" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="popup" <?php checked($cookie_bar_as, 'popup'); ?> /> <?php _e('Popup', 'cookie-law-info'); ?>
69
- <input type="radio" id="cookie_bar_as_field_widget" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="widget" <?php checked($cookie_bar_as, 'widget'); ?> /> <?php _e('Widget', 'cookie-law-info'); ?>
70
- </td>
71
- </tr>
72
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="widget">
73
- <th scope="row"><label for="widget_position_field"><?php _e('Position', 'cookie-law-info'); ?></label></th>
74
- <td>
75
- <?php $widget_position = $the_options['widget_position']; ?>
76
- <select name="widget_position_field" id="widget_position_field" class="vvv_combobox">
77
- <option value="left" <?php echo $widget_position == 'left' ? 'selected' : ''; ?>><?php echo __( 'Left', 'cookie-law-info' ); ?></option>
78
- <option value="right" <?php echo $widget_position == 'right' ? 'selected' : ''; ?>><?php echo __( 'Right', 'cookie-law-info' ); ?></option>
79
- </select>
80
- </td>
81
- </tr>
82
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="popup">
83
- <th scope="row"><label for="popup_overlay_field"><?php _e('Add overlay?', 'cookie-law-info'); ?></label></th>
84
- <td>
85
- <input type="radio" id="popup_overlay_field_yes" name="popup_overlay_field" class="styled" value="true" <?php echo ($the_options['popup_overlay'] == true) ? ' checked="checked"' : ''; ?> /> <?php _e('Yes', 'cookie-law-info'); ?>
86
- <input type="radio" id="popup_overlay_field_no" name="popup_overlay_field" class="styled" value="false" <?php echo ($the_options['popup_overlay'] == false) ? ' checked="checked"' : ''; ?> /> <?php _e('No', 'cookie-law-info'); ?>
87
- <span class="cli_form_help"><?php _e('When the popup is active, an overlay will block the user from browsing the site.', 'cookie-law-info'); ?></span>
88
- <span class="cli_form_er cli_scroll_accept_er"><?php _e('`Accept on scroll` will not work along with this option.', 'cookie-law-info'); ?></span>
89
- </td>
90
- </tr>
91
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="1">
92
- <th scope="row"><label for="notify_position_vertical_field"><?php _e('Position:', 'cookie-law-info'); ?></label></th>
93
- <td>
94
- <?php
95
- $notify_positon = (isset($the_options['notify_position_vertical']) ? $the_options['notify_position_vertical'] : 'bottom');
96
- ?>
97
- <input type="radio" id="notify_position_vertical_field_top" name="notify_position_vertical_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_pos" value="top" <?php checked($notify_positon, 'top'); ?> /> <?php _e('Header', 'cookie-law-info'); ?>
98
- <input type="radio" id="notify_position_vertical_field_bottom" name="notify_position_vertical_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_pos" value="bottom" <?php checked($notify_positon, 'bottom'); ?> /> <?php _e('Footer', 'cookie-law-info'); ?>
99
- </td>
100
- </tr>
101
- <!-- header_fix code here -->
102
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="1">
103
- <td colspan="2" style="padding: 0px;">
104
- <table>
105
- <tr valign="top" cli_frm_tgl-id="cli_bar_pos" cli_frm_tgl-val="top" cli_frm_tgl-lvl="2">
106
- <th></th>
107
- <td>
108
- <div style="margin-top:-15px; margin-bottom:15px;">
109
- <input type="radio" id="header_fix_field_yes" name="header_fix_field" class="styled" value="true" <?php echo ($the_options['header_fix'] == true) ? ' checked="checked"' : ''; ?> /> <?php _e('Fix bar on header', 'cookie-law-info'); ?>
110
- </div>
111
- <div>
112
- <input type="radio" id="iheader_fix_field_no" name="header_fix_field" class="styled" value="false" <?php echo ($the_options['header_fix'] == false) ? ' checked="checked"' : ''; ?> /> <?php _e('Move with the scroll', 'cookie-law-info'); ?>
113
- </div>
114
-
115
- </td>
116
- </tr>
117
- </table>
118
- </td>
119
- </tr>
120
 
121
- <tr valign="top">
122
- <th scope="row"><label for="notify_animate_show_field"><?php _e('On load', 'cookie-law-info'); ?></label></th>
123
- <td>
124
- <?php
125
- $notify_animate_show = (isset($the_options['notify_animate_show']) ? $the_options['notify_animate_show'] : false);
126
- ?>
127
- <input type="radio" id="notify_animate_show_field_animate" name="notify_animate_show_field" class="styled" value="true" <?php checked($notify_animate_show, true); ?> /> <?php _e('Animate', 'cookie-law-info'); ?>
128
- <input type="radio" id="notify_animate_show_field_sticky" name="notify_animate_show_field" class="styled" value="false" <?php checked($notify_animate_show, false); ?> /> <?php _e('Sticky', 'cookie-law-info'); ?>
129
- </td>
130
- </tr>
131
- <tr valign="top">
132
- <th scope="row"><label for="notify_animate_hide_field"><?php _e('On hide', 'cookie-law-info'); ?></label></th>
133
- <td>
134
- <?php
135
- $notify_animate_hide = (isset($the_options['notify_animate_hide']) ? $the_options['notify_animate_hide'] : true);
136
- ?>
137
- <input type="radio" id="notify_animate_hide_field_animate" name="notify_animate_hide_field" class="styled" value="true" <?php checked($notify_animate_hide, true); ?> /> <?php _e('Animate', 'cookie-law-info'); ?>
138
- <input type="radio" id="notify_animate_hide_field_sticky" name="notify_animate_hide_field" class="styled" value="false" <?php checked($notify_animate_hide, false); ?> /> <?php _e('Sticky', 'cookie-law-info'); ?>
139
- </td>
140
- </tr>
141
- </table>
142
- </div>
143
- </div>
144
- <div class="cli_sub_tab_content" data-id="show-again-tab">
145
- <div class="wt-cli-section wt-cli-section-floating-widget-settings">
146
- <div class="cli_sub_tab_content" data-id="show-again-tab">
147
- <div class="wt-cli-notice wt-cli-info">
148
- <?php echo __('Revisit consent will allow the visitors to view/edit/revoke their prior preferences. Enable to display a sticky/fixed widget widget at the footer of your website. You can also manually insert a widget by adding the shortcode <b>[wt_cli_manage_consent]</b> to your website.', 'cookie-law-info'); ?>
149
- </div>
150
- <div class="wt-cli-revisit-consent-widget">
151
- <table class="form-table">
152
- <tr valign="top">
153
- <th scope="row"><label for="showagain_tab_field"><?php _e('Enable revisit consent widget', 'cookie-law-info'); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php _e('Enable to display a sticky/fixed widget at the footer of your website (remains fixed on page scroll).', 'cookie-law-info'); ?>"><span class="wt-cli-tootip-icon"></span></span></label></th>
154
- <td>
155
- <input type="hidden" name="showagain_tab_field" value="false" id="showagain_tab_field_no">
156
- <input name="showagain_tab_field" type="checkbox" value="true" id="showagain_tab_field_yes" class="wt-cli-input-toggle-checkbox" data-cli-toggle-target="wt-cli-revisit-consent-widget" <?php checked($the_options['showagain_tab'], true); ?>>
157
- </td>
158
- </tr>
159
- </table>
160
- </div>
161
- <div class="wt-cli-input-toggle-section" data-cli-toggle-id="wt-cli-revisit-consent-widget">
162
- <table class="form-table">
163
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="0">
164
- <th scope="row"><label for="notify_position_horizontal_field"><?php _e('Widget position', 'cookie-law-info'); ?></label></th>
165
- <td>
166
- <input type="radio" id="notify_position_horizontal_field_right" name="notify_position_horizontal_field" class="styled" value="right" <?php checked( $the_options['notify_position_horizontal'], 'right'); ?> /> <?php _e('Right', 'cookie-law-info'); ?>
167
- <input type="radio" id="notify_position_horizontal_field_left" name="notify_position_horizontal_field" class="styled" value="left" <?php checked( $the_options['notify_position_horizontal'], 'left'); ?> /> <?php _e('Left', 'cookie-law-info'); ?>
168
- </td>
169
- </tr>
 
 
 
 
 
 
 
 
170
 
171
- <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="popup" cli_frm_tgl-lvl="0">
172
- <th scope="row"><label for="popup_showagain_position_field"><?php _e('Tab Position', 'cookie-law-info'); ?></label></th>
173
- <td>
174
- <select name="popup_showagain_position_field" class="vvv_combobox" style="max-width:100%;">
175
- <?php
176
- $pp_sa_pos = $the_options['popup_showagain_position'];
177
- ?>
178
- <option value="bottom-right" <?php echo $pp_sa_pos == 'bottom-right' ? 'selected' : ''; ?>>
179
- <?php _e('Bottom Right', 'cookie-law-info') ?>
180
- </option>
181
- <option value="bottom-left" <?php echo $pp_sa_pos == 'bottom-left' ? 'selected' : ''; ?>>
182
- <?php _e('Bottom Left', 'cookie-law-info') ?>
183
- </option>
184
- <option value="top-right" <?php echo $pp_sa_pos == 'top-right' ? 'selected' : ''; ?>>
185
- <?php _e('Top Right', 'cookie-law-info') ?>
186
- </option>
187
- <option value="top-left" <?php echo $pp_sa_pos == 'top-left' ? 'selected' : ''; ?>>
188
- <?php _e('Top Left', 'cookie-law-info') ?>
189
- </option>
190
- </select>
191
- </td>
192
- </tr>
193
 
194
- <tr valign="top">
195
- <th scope="row"><label id="wt-cli-revisit-consent-margin-label" for="showagain_x_position_field" data-cli-right-text="<?php _e('From Right Margin', 'cookie-law-info'); ?>" data-cli-left-text="<?php _e('From Left Margin', 'cookie-law-info'); ?>"><?php _e('From Left Margin', 'cookie-law-info'); ?></label></th>
196
- <td>
197
- <input type="text" name="showagain_x_position_field" value="<?php echo esc_attr( $the_options['showagain_x_position'] ) ?>" />
198
- <span class="cli_form_help"><?php _e('Specify the widget distance from margin in ‘px’ or ‘%’ . e.g. 100px or 30%', 'cookie-law-info'); ?></span>
199
- </td>
200
- </tr>
201
 
202
- </table>
203
 
204
- </div>
205
- <table class="form-table" style="margin-top: 0;">
206
- <tr valign="top">
207
- <th scope="row"><label for="showagain_text"><?php _e('Text on the widget', 'cookie-law-info'); ?></label></th>
208
- <td>
209
- <input type="text" name="showagain_text_field" value="<?php echo esc_attr( $the_options['showagain_text'] ) ?>" />
210
- <span class="cli_form_help"><?php _e('Input a text to appear on the revisit consent widget.', 'cookie-law-info'); ?></span>
211
- </td>
212
- </tr>
213
- </table>
214
- </div>
215
- </div>
216
- </div>
217
- </div>
218
 
219
 
220
- <?php
221
- include "admin-settings-save-button.php";
222
- ?>
223
- </div>
1
  <?php
2
  // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  ?>
7
  <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id ); ?>">
8
+ <ul class="cli_sub_tab">
9
+ <li style="border-left:none; padding-left: 0px;" data-target="cookie-message"><a><?php echo esc_html__( 'Cookie bar', 'cookie-law-info' ); ?></a></li>
10
+ <li data-target="show-again-tab"><a><?php echo esc_html__( 'Revisit consent', 'cookie-law-info' ); ?></a></li>
11
+ </ul>
12
+ <div class="cli_sub_tab_container">
13
+ <div class="cli_sub_tab_content" data-id="cookie-message" style="display:block;">
14
+ <div class="wt-cli-section wt-cli-section-general-settings">
15
+ <table class="form-table">
16
+ <tr valign="top">
17
+ <th scope="row"><label for="bar_heading_text_field"><?php echo esc_html__( 'Message Heading', 'cookie-law-info' ); ?></label></th>
18
+ <td>
19
+ <input type="text" name="bar_heading_text_field" value="<?php echo esc_attr( stripslashes( $the_options['bar_heading_text'] ) ); ?>" />
20
+ <span class="cli_form_help"><?php echo esc_html__( 'Input text to have a heading for the cookie consent bar. Leave it blank if you do not need one.', 'cookie-law-info' ); ?>
21
+ </span>
22
+ </td>
23
+ </tr>
24
+ <tr valign="top">
25
+ <th scope="row"><label for="notify_message_field"><?php echo esc_html__( 'Message', 'cookie-law-info' ); ?></label></th>
26
+ <td>
27
+ <?php
28
+ echo '<textarea name="notify_message_field" class="vvv_textbox">';
29
+ echo wp_kses_post( apply_filters( 'format_to_edit', stripslashes( $the_options['notify_message'] ) ) ) . '</textarea>';
30
+ ?>
31
+ <span class="cli_form_help"><?php echo esc_html__( 'Modify/edit the content of the cookie consent bar.', 'cookie-law-info' ); ?> <br /><em><?php echo esc_html__( 'Supports shortcodes.(link shortcodes to help link) e.g. [cookie_accept_all] for accept all button, [cookie_button] for accept button, [cookie_reject] for reject button, [cookie_link] for Read more, [cookie_settings] for cookie settings.', 'cookie-law-info' ); ?></em></span>
32
+ </td>
33
+ </tr>
34
+ <tr valign="top">
35
+ <th scope="row"><label for="background_field"><?php echo esc_html__( 'Cookie Bar Colour', 'cookie-law-info' ); ?></label></th>
36
+ <td>
37
+ <?php
38
+ /** RICHARDASHBY EDIT */
39
+ // echo '<input type="text" name="background_field" id="cli-colour-background" value="' .$the_options['background']. '" />';
40
+ echo '<input type="text" name="background_field" id="cli-colour-background" value="' . esc_attr( $the_options['background'] ) . '" class="my-color-field" data-default-color="#fff" />';
41
+ ?>
42
+ </td>
43
+ </tr>
44
+ <tr valign="top">
45
+ <th scope="row"><label for="text_field"><?php echo esc_html__( 'Text Colour', 'cookie-law-info' ); ?></label></th>
46
+ <td>
47
+ <?php
48
+ /** RICHARDASHBY EDIT */
49
+ echo '<input type="text" name="text_field" id="cli-colour-text" value="' . esc_attr( $the_options['text'] ) . '" class="my-color-field" data-default-color="#000" />';
50
+ ?>
51
+ </td>
52
+ </tr>
53
+ <tr valign="top">
54
+ <th scope="row"><label for="font_family_field"><?php echo esc_html__( 'Font', 'cookie-law-info' ); ?></label></th>
55
+ <td>
56
+ <select name="font_family_field" class="vvv_combobox">
57
+ <?php $this->print_combobox_options( $this->get_fonts(), $the_options['font_family'] ); ?>
58
+ </select>
59
+ </td>
60
+ </tr>
61
+ <tr valign="top">
62
+ <th scope="row"><label for="cookie_bar_as_field"><?php echo esc_html__( 'Show cookie bar as', 'cookie-law-info' ); ?></label></th>
63
+ <td>
64
+ <?php
65
+ $cookie_bar_as = $the_options['cookie_bar_as'];
66
+ ?>
67
+ <input type="radio" id="cookie_bar_as_field_banner" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="banner" <?php checked( $cookie_bar_as, 'banner' ); ?> /> <?php echo esc_html__( 'Banner', 'cookie-law-info' ); ?>
68
+ <input type="radio" id="cookie_bar_as_field_popup" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="popup" <?php checked( $cookie_bar_as, 'popup' ); ?> /> <?php echo esc_html__( 'Popup', 'cookie-law-info' ); ?>
69
+ <input type="radio" id="cookie_bar_as_field_widget" name="cookie_bar_as_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_type" value="widget" <?php checked( $cookie_bar_as, 'widget' ); ?> /> <?php echo esc_html__( 'Widget', 'cookie-law-info' ); ?>
70
+ </td>
71
+ </tr>
72
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="widget">
73
+ <th scope="row"><label for="widget_position_field"><?php echo esc_html__( 'Position', 'cookie-law-info' ); ?></label></th>
74
+ <td>
75
+ <?php $widget_position = $the_options['widget_position']; ?>
76
+ <select name="widget_position_field" id="widget_position_field" class="vvv_combobox">
77
+ <option value="left" <?php echo $widget_position == 'left' ? 'selected' : ''; ?>><?php echo esc_html__( 'Left', 'cookie-law-info' ); ?></option>
78
+ <option value="right" <?php echo $widget_position == 'right' ? 'selected' : ''; ?>><?php echo esc_html__( 'Right', 'cookie-law-info' ); ?></option>
79
+ </select>
80
+ </td>
81
+ </tr>
82
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="popup">
83
+ <th scope="row"><label for="popup_overlay_field"><?php echo esc_html__( 'Add overlay?', 'cookie-law-info' ); ?></label></th>
84
+ <td>
85
+ <input type="radio" id="popup_overlay_field_yes" name="popup_overlay_field" class="styled" value="true" <?php echo ( $the_options['popup_overlay'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Yes', 'cookie-law-info' ); ?>
86
+ <input type="radio" id="popup_overlay_field_no" name="popup_overlay_field" class="styled" value="false" <?php echo ( $the_options['popup_overlay'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'No', 'cookie-law-info' ); ?>
87
+ <span class="cli_form_help"><?php echo esc_html__( 'When the popup is active, an overlay will block the user from browsing the site.', 'cookie-law-info' ); ?></span>
88
+ <span class="cli_form_er cli_scroll_accept_er"><?php echo esc_html__( '`Accept on scroll` will not work along with this option.', 'cookie-law-info' ); ?></span>
89
+ </td>
90
+ </tr>
91
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="1">
92
+ <th scope="row"><label for="notify_position_vertical_field"><?php echo esc_html__( 'Position:', 'cookie-law-info' ); ?></label></th>
93
+ <td>
94
+ <?php
95
+ $notify_positon = ( isset( $the_options['notify_position_vertical'] ) ? $the_options['notify_position_vertical'] : 'bottom' );
96
+ ?>
97
+ <input type="radio" id="notify_position_vertical_field_top" name="notify_position_vertical_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_pos" value="top" <?php checked( $notify_positon, 'top' ); ?> /> <?php echo esc_html__( 'Header', 'cookie-law-info' ); ?>
98
+ <input type="radio" id="notify_position_vertical_field_bottom" name="notify_position_vertical_field" class="styled cli_form_toggle" cli_frm_tgl-target="cli_bar_pos" value="bottom" <?php checked( $notify_positon, 'bottom' ); ?> /> <?php echo esc_html__( 'Footer', 'cookie-law-info' ); ?>
99
+ </td>
100
+ </tr>
101
+ <!-- header_fix code here -->
102
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="1">
103
+ <td colspan="2" style="padding: 0px;">
104
+ <table>
105
+ <tr valign="top" cli_frm_tgl-id="cli_bar_pos" cli_frm_tgl-val="top" cli_frm_tgl-lvl="2">
106
+ <th></th>
107
+ <td>
108
+ <div style="margin-top:-15px; margin-bottom:15px;">
109
+ <input type="radio" id="header_fix_field_yes" name="header_fix_field" class="styled" value="true" <?php echo ( $the_options['header_fix'] == true ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Fix bar on header', 'cookie-law-info' ); ?>
110
+ </div>
111
+ <div>
112
+ <input type="radio" id="iheader_fix_field_no" name="header_fix_field" class="styled" value="false" <?php echo ( $the_options['header_fix'] == false ) ? ' checked="checked"' : ''; ?> /> <?php echo esc_html__( 'Move with the scroll', 'cookie-law-info' ); ?>
113
+ </div>
114
+
115
+ </td>
116
+ </tr>
117
+ </table>
118
+ </td>
119
+ </tr>
120
 
121
+ <tr valign="top">
122
+ <th scope="row"><label for="notify_animate_show_field"><?php echo esc_html__( 'On load', 'cookie-law-info' ); ?></label></th>
123
+ <td>
124
+ <?php
125
+ $notify_animate_show = ( isset( $the_options['notify_animate_show'] ) ? $the_options['notify_animate_show'] : false );
126
+ ?>
127
+ <input type="radio" id="notify_animate_show_field_animate" name="notify_animate_show_field" class="styled" value="true" <?php checked( $notify_animate_show, true ); ?> /> <?php echo esc_html__( 'Animate', 'cookie-law-info' ); ?>
128
+ <input type="radio" id="notify_animate_show_field_sticky" name="notify_animate_show_field" class="styled" value="false" <?php checked( $notify_animate_show, false ); ?> /> <?php echo esc_html__( 'Sticky', 'cookie-law-info' ); ?>
129
+ </td>
130
+ </tr>
131
+ <tr valign="top">
132
+ <th scope="row"><label for="notify_animate_hide_field"><?php echo esc_html__( 'On hide', 'cookie-law-info' ); ?></label></th>
133
+ <td>
134
+ <?php
135
+ $notify_animate_hide = ( isset( $the_options['notify_animate_hide'] ) ? $the_options['notify_animate_hide'] : true );
136
+ ?>
137
+ <input type="radio" id="notify_animate_hide_field_animate" name="notify_animate_hide_field" class="styled" value="true" <?php checked( $notify_animate_hide, true ); ?> /> <?php echo esc_html__( 'Animate', 'cookie-law-info' ); ?>
138
+ <input type="radio" id="notify_animate_hide_field_sticky" name="notify_animate_hide_field" class="styled" value="false" <?php checked( $notify_animate_hide, false ); ?> /> <?php echo esc_html__( 'Sticky', 'cookie-law-info' ); ?>
139
+ </td>
140
+ </tr>
141
+ </table>
142
+ </div>
143
+ </div>
144
+ <div class="cli_sub_tab_content" data-id="show-again-tab">
145
+ <div class="wt-cli-section wt-cli-section-floating-widget-settings">
146
+ <div class="cli_sub_tab_content" data-id="show-again-tab">
147
+ <div class="wt-cli-notice wt-cli-info">
148
+ <?php
149
+ echo wp_kses(
150
+ __( 'Revisit consent will allow the visitors to view/edit/revoke their prior preferences. Enable to display a sticky/fixed widget widget at the footer of your website. You can also manually insert a widget by adding the shortcode <strong>[wt_cli_manage_consent]</strong> to your website.', 'cookie-law-info' ),
151
+ array(
152
+ 'p' => array(),
153
+ 'strong' => array(),
154
+ )
155
+ );
156
+ ?>
157
+ </div>
158
+ <div class="wt-cli-revisit-consent-widget">
159
+ <table class="form-table">
160
+ <tr valign="top">
161
+ <th scope="row"><label for="showagain_tab_field"><?php echo esc_html__( 'Enable revisit consent widget', 'cookie-law-info' ); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php echo esc_html__( 'Enable to display a sticky/fixed widget at the footer of your website (remains fixed on page scroll).', 'cookie-law-info' ); ?>"><span class="wt-cli-tootip-icon"></span></span></label></th>
162
+ <td>
163
+ <input type="hidden" name="showagain_tab_field" value="false" id="showagain_tab_field_no">
164
+ <input name="showagain_tab_field" type="checkbox" value="true" id="showagain_tab_field_yes" class="wt-cli-input-toggle-checkbox" data-cli-toggle-target="wt-cli-revisit-consent-widget" <?php checked( $the_options['showagain_tab'], true ); ?>>
165
+ </td>
166
+ </tr>
167
+ </table>
168
+ </div>
169
+ <div class="wt-cli-input-toggle-section" data-cli-toggle-id="wt-cli-revisit-consent-widget">
170
+ <table class="form-table">
171
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="banner" cli_frm_tgl-lvl="0">
172
+ <th scope="row"><label for="notify_position_horizontal_field"><?php echo esc_html__( 'Widget position', 'cookie-law-info' ); ?></label></th>
173
+ <td>
174
+ <input type="radio" id="notify_position_horizontal_field_right" name="notify_position_horizontal_field" class="styled" value="right" <?php checked( $the_options['notify_position_horizontal'], 'right' ); ?> /> <?php echo esc_html__( 'Right', 'cookie-law-info' ); ?>
175
+ <input type="radio" id="notify_position_horizontal_field_left" name="notify_position_horizontal_field" class="styled" value="left" <?php checked( $the_options['notify_position_horizontal'], 'left' ); ?> /> <?php echo esc_html__( 'Left', 'cookie-law-info' ); ?>
176
+ </td>
177
+ </tr>
178
 
179
+ <tr valign="top" cli_frm_tgl-id="cli_bar_type" cli_frm_tgl-val="popup" cli_frm_tgl-lvl="0">
180
+ <th scope="row"><label for="popup_showagain_position_field"><?php echo esc_html__( 'Tab Position', 'cookie-law-info' ); ?></label></th>
181
+ <td>
182
+ <select name="popup_showagain_position_field" class="vvv_combobox" style="max-width:100%;">
183
+ <?php
184
+ $pp_sa_pos = $the_options['popup_showagain_position'];
185
+ ?>
186
+ <option value="bottom-right" <?php echo $pp_sa_pos == 'bottom-right' ? 'selected' : ''; ?>>
187
+ <?php echo esc_html__( 'Bottom Right', 'cookie-law-info' ); ?>
188
+ </option>
189
+ <option value="bottom-left" <?php echo $pp_sa_pos == 'bottom-left' ? 'selected' : ''; ?>>
190
+ <?php echo esc_html__( 'Bottom Left', 'cookie-law-info' ); ?>
191
+ </option>
192
+ <option value="top-right" <?php echo $pp_sa_pos == 'top-right' ? 'selected' : ''; ?>>
193
+ <?php echo esc_html__( 'Top Right', 'cookie-law-info' ); ?>
194
+ </option>
195
+ <option value="top-left" <?php echo $pp_sa_pos == 'top-left' ? 'selected' : ''; ?>>
196
+ <?php echo esc_html__( 'Top Left', 'cookie-law-info' ); ?>
197
+ </option>
198
+ </select>
199
+ </td>
200
+ </tr>
201
 
202
+ <tr valign="top">
203
+ <th scope="row"><label id="wt-cli-revisit-consent-margin-label" for="showagain_x_position_field" data-cli-right-text="<?php echo esc_html__( 'From Right Margin', 'cookie-law-info' ); ?>" data-cli-left-text="<?php echo esc_html__( 'From Left Margin', 'cookie-law-info' ); ?>"><?php echo esc_html__( 'From Left Margin', 'cookie-law-info' ); ?></label></th>
204
+ <td>
205
+ <input type="text" name="showagain_x_position_field" value="<?php echo esc_attr( $the_options['showagain_x_position'] ); ?>" />
206
+ <span class="cli_form_help"><?php echo esc_html__( 'Specify the widget distance from margin in ‘px’ or ‘%’ . e.g. 100px or 30%', 'cookie-law-info' ); ?></span>
207
+ </td>
208
+ </tr>
209
 
210
+ </table>
211
 
212
+ </div>
213
+ <table class="form-table" style="margin-top: 0;">
214
+ <tr valign="top">
215
+ <th scope="row"><label for="showagain_text"><?php echo esc_html__( 'Text on the widget', 'cookie-law-info' ); ?></label></th>
216
+ <td>
217
+ <input type="text" name="showagain_text_field" value="<?php echo esc_attr( $the_options['showagain_text'] ); ?>" />
218
+ <span class="cli_form_help"><?php echo esc_html__( 'Input a text to appear on the revisit consent widget.', 'cookie-law-info' ); ?></span>
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </div>
223
+ </div>
224
+ </div>
225
+ </div>
226
 
227
 
228
+ <?php
229
+ require 'admin-settings-save-button.php';
230
+ ?>
231
+ </div>
admin/views/admin-settings-save-button.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'WPINC' ) ) {
8
  <div class="wt-cli-footer">
9
  <div class="wt-cli-row">
10
  <div class="wt-cli-col-6"></div>
11
- <div class="wt-cli-col-6"><input type="submit" name="update_admin_settings_form" value="<?php _e( 'Update Settings', 'cookie-law-info' ); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
12
  <span class="spinner" style="margin-top:10px"></span></div>
13
  </div>
14
- </div>
8
  <div class="wt-cli-footer">
9
  <div class="wt-cli-row">
10
  <div class="wt-cli-col-6"></div>
11
+ <div class="wt-cli-col-6"><input type="submit" name="update_admin_settings_form" value="<?php echo esc_html__( 'Update Settings', 'cookie-law-info' ); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
12
  <span class="spinner" style="margin-top:10px"></span></div>
13
  </div>
14
+ </div>
admin/views/admin-settings-upgrade-pro.php CHANGED
@@ -163,7 +163,7 @@ if ( ! defined( 'WPINC' ) ) {
163
  </table>
164
  </div>
165
  <p class="text-right" style="margin-top: 25px;"><a
166
- href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_pro-comparison&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION );?>"
167
  class="wt-primary-btn crown-icon" target="_blank" style="text-transform:uppercase;margin-bottom:0px"><?php echo esc_html( __( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
168
 
169
  <!------ stop copying -- (frame 10 : table)-------->
163
  </table>
164
  </div>
165
  <p class="text-right" style="margin-top: 25px;"><a
166
+ href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_pro-comparison&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION ); ?>"
167
  class="wt-primary-btn crown-icon" target="_blank" style="text-transform:uppercase;margin-bottom:0px"><?php echo esc_html( __( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
168
 
169
  <!------ stop copying -- (frame 10 : table)-------->
admin/views/admin_necessary_cookie.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- // If this file is called directly, abort.
3
- if ( ! defined( 'WPINC' ) ) {
4
- die;
5
- }
6
- ?>
7
- <style>
8
- .vvv_textbox{
9
- height: 150px;
10
- width:100%;
11
- }
12
- #wpbody-content .notice {
13
- margin: 5px 20px 15px 0;
14
- }
15
- .notice, div.updated, div.error{
16
- margin: 5px 20px 15px 0;
17
- }
18
- </style>
19
- <script type="text/javascript">
20
- var cli_success_message='<?php echo __('Settings updated.', 'cookie-law-info');?>';
21
- var cli_error_message='<?php echo __('Unable to update Settings.', 'cookie-law-info');?>';
22
- </script>
23
- <div class="wrap">
24
- <div class="cookie-law-info-form-container">
25
- <div class="cli-plugin-toolbar top">
26
- <h3><?php echo __('Necessary Cookie Settings','cookie-law-info'); ?></h3>
27
- </div>
28
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>" id="cli_ncessary_form" class="cookie-sensitivity-form">
29
- <?php wp_nonce_field('cookielawinfo-update-necessary'); ?>
30
- <table class="form-table cli_necessary_form cli-admin-table">
31
- <tr>
32
- <td>
33
- <label for="wt_cli_necessary_title"><?php _e('Title', 'cookie-law-info'); ?></label>
34
- <input type="text" id="wt_cli_necessary_title" name="wt_cli_necessary_title" value="<?php echo stripslashes( $wt_cli_necessary_title ); ?>" class="cli-textbox" />
35
- </td>
36
- </tr>
37
- <tr>
38
- <td>
39
- <label for="necessary_description"><?php echo __('Description','cookie-law-info');?></label>
40
- <textarea name="necessary_description" class="vvv_textbox"><?php
41
- echo apply_filters('format_to_edit', stripslashes($wt_cli_necessary_description));
42
- ?></textarea>
43
- </td>
44
- </tr>
45
-
46
- </table>
47
- <div class="cli-plugin-toolbar bottom">
48
- <div class="left">
49
- </div>
50
- <div class="right">
51
- <input type="hidden" name="cli_necessary_ajax_update" value="1">
52
- <input type="submit" name="update_admin_settings_form" value="<?php _e('Update Settings', 'cookie-law-info'); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
53
- <span class="spinner" style="margin-top:9px"></span>
54
- </div>
55
- </div>
56
- </form>
57
- </div>
58
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/admin_non_necessary_cookie.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- // If this file is called directly, abort.
3
- if (!defined('WPINC')) {
4
- die;
5
- }
6
- ?>
7
- <style>
8
- .vvv_textbox {
9
- height: 150px;
10
- width: 100%;
11
- }
12
- .notice, div.updated, div.error{
13
- margin: 5px 20px 15px 0;
14
- }
15
- </style>
16
- <script type="text/javascript">
17
- var cli_success_message = '<?php echo __('Settings updated.', 'cookie-law-info'); ?>';
18
- var cli_error_message = '<?php echo __('Unable to update Settings.', 'cookie-law-info'); ?>';
19
- </script>
20
- <div class="wrap">
21
- <div class="cookie-law-info-form-container">
22
- <div class="cli-plugin-toolbar top">
23
- <h3><?php echo __('Non-necessary Cookie Settings', 'cookie-law-info'); ?></h3>
24
- </div>
25
- <form method="post" action="<?php echo esc_url($_SERVER["REQUEST_URI"]); ?>" id="cli_non-ncessary_form" class="cookie-sensitivity-form">
26
- <?php wp_nonce_field('cookielawinfo-update-thirdparty'); ?>
27
- <table class="form-table cli_non_necessary_form cli-admin-table">
28
-
29
- <tr>
30
- <td>
31
- <label for="thirdparty_on_field"><?php echo __('Enable Non-necessary Cookie', 'cookie-law-info'); ?></label>
32
- <input type="radio" id="thirdparty_on_field_yes" name="thirdparty_on_field" class="styled" value="true" <?php echo (filter_var($wt_cli_non_necessary_enabled, FILTER_VALIDATE_BOOLEAN) == true) ? ' checked="checked" ' : ' '; ?> /><?php echo __('Yes', 'cookie-law-info'); ?>
33
- <input type="radio" id="thirdparty_on_field_no" name="thirdparty_on_field" class="styled" value="false" <?php echo (filter_var($wt_cli_non_necessary_enabled, FILTER_VALIDATE_BOOLEAN) == false) ? ' checked="checked" ' : ''; ?> /><?php echo __('No', 'cookie-law-info'); ?>
34
- </td>
35
- </tr>
36
- <tr>
37
- <td>
38
- <label for="third_party_default_state"><?php echo __('Default state', 'cookie-law-info'); ?></label>
39
- <input type="radio" id="third_party_default_state_yes" name="third_party_default_state" class="styled" value="true" <?php echo (filter_var($wt_cli_default_state, FILTER_VALIDATE_BOOLEAN) == true) ? ' checked="checked" ' : ' '; ?> /><?php echo __('Enabled', 'cookie-law-info'); ?>
40
- <input type="radio" id="third_party_default_state_no" name="third_party_default_state" class="styled" value="false" <?php echo (filter_var($wt_cli_default_state, FILTER_VALIDATE_BOOLEAN) == false) ? ' checked="checked" ' : ''; ?> /><?php echo __('Disabled', 'cookie-law-info'); ?>
41
- <span class="cli_form_help">
42
- <?php echo __('If you enable this option, the category toggle button will be in the active state for cookie consent.', 'cookie-law-info'); ?> <br />
43
- </span>
44
- </td>
45
- </tr>
46
- <tr>
47
- <td>
48
- <label for="wt_cli_non_necessary_title"><?php _e('Title', 'cookie-law-info'); ?></label>
49
- <input type="text" id="wt_cli_non_necessary_title" name="wt_cli_non_necessary_title" value="<?php echo sanitize_text_field(stripslashes($wt_cli_non_necessary_title)); ?>" class="cli-textbox" />
50
- </td>
51
- </tr>
52
- <tr>
53
- <td>
54
- <label for="thirdparty_description"><?php echo __('Description', 'cookie-law-info'); ?></label>
55
- <textarea name="thirdparty_description" class="vvv_textbox"><?php
56
- echo apply_filters('format_to_edit', stripslashes($wt_cli_non_necessary_description));
57
- ?></textarea>
58
- </td>
59
- </tr>
60
- <tr>
61
- <td>
62
- <label for="thirdparty_head_section"><?php echo __('This script will be added to the page HEAD section if the above settings is enabled and user has give consent.', 'cookie-law-info'); ?></label>
63
- <textarea name="thirdparty_head_section" class="vvv_textbox"><?php
64
- echo apply_filters('format_to_edit', stripslashes($wt_cli_non_necessary_head_scripts));
65
- ?></textarea>
66
- <span class="cli_form_help">
67
- <?php echo __('Print scripts in the head tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info'); ?> <br />
68
- eg:- &lt;script&gt;console.log("header script");&lt;/script&gt
69
- </span>
70
- </td>
71
- </tr>
72
- <tr>
73
- <td>
74
- <label for="thirdparty_body_section"><?php echo __('This script will be added right after the BODY section if the above settings is enabled and user has given consent.', 'cookie-law-info'); ?></label>
75
- <textarea name="thirdparty_body_section" class="vvv_textbox"><?php echo apply_filters('format_to_edit', stripslashes($wt_cli_non_necessary_body_scripts)); ?></textarea>
76
- <span class="cli_form_help">
77
- <?php echo __('Print scripts before the closing body tag on the front end if above cookie settings is enabled and user has given consent.', 'cookie-law-info'); ?> <br />eg:- &lt;script&gt;console.log("body script");&lt;/script&gt;
78
- </span>
79
- </td>
80
- </tr>
81
- </table>
82
- <div class="cli-plugin-toolbar bottom">
83
- <div class="left">
84
- </div>
85
- <div class="right">
86
- <input type="hidden" name="cli_non-necessary_ajax_update" value="1">
87
- <input type="submit" name="update_admin_settings_form" value="<?php _e('Update Settings', 'cookie-law-info'); ?>" class="button-primary" style="float:right;" onClick="return cli_store_settings_btn_click(this.name)" />
88
- <span class="spinner" style="margin-top:9px"></span>
89
- </div>
90
- </div>
91
- </form>
92
- </div>
93
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/goto-pro-v2.php CHANGED
@@ -355,7 +355,7 @@ ul.wt-gdprpro-features {
355
  <div class="wt-bg">
356
  <h3 class="wt-sidebar-title text-center"><?php echo esc_html( _e( 'Get access to advanced features for GDPR compliance', 'cookie-law-info' ) ); ?></h3>
357
  <p class="text-center my-0"><a
358
- href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_sidebar&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION );?>"
359
  class="wt-primary-btn crown-icon" target="_blank" style="text-transform:uppercase;"><?php echo esc_html( _e( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
360
 
361
  </div>
@@ -372,11 +372,12 @@ ul.wt-gdprpro-features {
372
  <ul class="wt-gdprpro-features">
373
  <li><b><?php echo esc_html( __( 'Enhanced cookie scanning:', 'cookie-law-info' ) ); ?></b> <?php echo esc_html( __( 'Scan up to 2000 URLs in a go.', 'cookie-law-info' ) ); ?></li>
374
  <li>
375
- <b><?php echo esc_html( __( 'Auto-block cookies from popular third-party services & plugins:', 'cookie-law-info' ) ); ?></b> <?php
376
- echo esc_html(
377
- __( 'Supports Google analytics, Facebook pixel, Google tag manager, Hotjar analytics, +20 more.', 'cookie-law-info' )
378
- );
379
- ?>
 
380
  </li>
381
  <li>
382
  <b><?php echo esc_html( __( 'Be consent proof ready:', 'cookie-law-info' ) ); ?></b>
@@ -443,7 +444,7 @@ ul.wt-gdprpro-features {
443
  </li>
444
  </ul>
445
  <p class="text-center my-0"><a
446
- href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_sidebar&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION );?>"
447
  class="wt-secondary-btn crown-icon" target="_blank" style="text-transform:uppercase;"><?php echo esc_html( __( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
448
  <p class="text-center my-0"> <a id="cky-table-comparison-link" class="wt-link"><?php echo esc_html( __( 'Compare Free and Premium', 'cookie-law-info' ) ); ?></a></p>
449
  </div>
355
  <div class="wt-bg">
356
  <h3 class="wt-sidebar-title text-center"><?php echo esc_html( _e( 'Get access to advanced features for GDPR compliance', 'cookie-law-info' ) ); ?></h3>
357
  <p class="text-center my-0"><a
358
+ href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_sidebar&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION ); ?>"
359
  class="wt-primary-btn crown-icon" target="_blank" style="text-transform:uppercase;"><?php echo esc_html( _e( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
360
 
361
  </div>
372
  <ul class="wt-gdprpro-features">
373
  <li><b><?php echo esc_html( __( 'Enhanced cookie scanning:', 'cookie-law-info' ) ); ?></b> <?php echo esc_html( __( 'Scan up to 2000 URLs in a go.', 'cookie-law-info' ) ); ?></li>
374
  <li>
375
+ <b><?php echo esc_html( __( 'Auto-block cookies from popular third-party services & plugins:', 'cookie-law-info' ) ); ?></b>
376
+ <?php
377
+ echo esc_html(
378
+ __( 'Supports Google analytics, Facebook pixel, Google tag manager, Hotjar analytics, +20 more.', 'cookie-law-info' )
379
+ );
380
+ ?>
381
  </li>
382
  <li>
383
  <b><?php echo esc_html( __( 'Be consent proof ready:', 'cookie-law-info' ) ); ?></b>
444
  </li>
445
  </ul>
446
  <p class="text-center my-0"><a
447
+ href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_sidebar&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_attr( CLI_VERSION ); ?>"
448
  class="wt-secondary-btn crown-icon" target="_blank" style="text-transform:uppercase;"><?php echo esc_html( __( 'Upgrade to premium', 'cookie-law-info' ) ); ?></a></p>
449
  <p class="text-center my-0"> <a id="cky-table-comparison-link" class="wt-link"><?php echo esc_html( __( 'Compare Free and Premium', 'cookie-law-info' ) ); ?></a></p>
450
  </div>
admin/views/goto-pro.php DELETED
@@ -1,124 +0,0 @@
1
- <style>
2
- .cli-button-go-pro {
3
- box-shadow: none;
4
- border: 0;
5
- text-shadow: none;
6
- padding: 10px 15px;
7
- height: auto;
8
- font-size: 18px;
9
- border-radius: 4px;
10
- font-weight: 600;
11
- background: #00cb95;
12
- margin-top: 20px;
13
- text-decoration: none;
14
- }
15
-
16
- .cli-button {
17
- margin-bottom: 20px;
18
- color: #fff;
19
- }
20
- .cli-button:hover, .cli-button:visited {
21
- color: #fff;
22
- }
23
- .cli_gopro_block{ background: #fff; float: left; height:auto; box-shadow: 0px 2px 2px #ccc; margin-top: 20px; width: 100%; box-sizing:border-box; }
24
- .cli_gopro_block h3{ text-align: center; }
25
- .cli_premium_features{ padding-left: 20px;padding-top: 10px;}
26
- .cli_premium_features li{ padding-left:15px; padding-right: 15px; }
27
- .cli_premium_features li::before {
28
- font-family: dashicons;
29
- text-decoration: inherit;
30
- font-weight: 400;
31
- font-style: normal;
32
- vertical-align: top;
33
- text-align: center;
34
- content: "\f147";
35
- margin-right: 10px;
36
- margin-left: -25px;
37
- font-size: 16px;
38
- color: #3085bb;
39
- }
40
- .cli-button-documentation{
41
- border: 0;
42
- background: #d8d8dc;
43
- box-shadow: none;
44
- padding: 10px 15px;
45
- font-size: 15px;
46
- height: auto;
47
- margin-left: 10px;
48
- margin-right: 10px;
49
- margin-top: 10px;
50
- border-radius: 3px;
51
- text-decoration: none;
52
- }
53
- .wt-cli-pro-feature-list {
54
- padding: 35px 15px;
55
- border-top: 1px solid #dfdfdf;
56
- }
57
- </style>
58
-
59
- <div class="cli_gopro_block" style="margin-top: 43px;">
60
- <!----sidebar starts----->
61
- <div class="wt-ier-sidebar-wrapper" style="padding:35px 50px;">
62
- <img src="<?php echo esc_url( CLI_PLUGIN_URL . 'images/crown.svg' ); ?>" class="wt-ier-sidebar-img">
63
- <h3 class="wt-ier-sidebar-title wt-ier-center"><?php echo __('Get access to advanced features for GDPR compliance.','cookie-law-info'); ?></h3>
64
- <div class="wt-ier-row">
65
- <div class="wt-ier-col-12 wt-ier-col-md-6 wt-ier-border-md-right">
66
- <div class="wt-ier-flex wt-ier-v-center ">
67
- <img src="<?php echo esc_url( CLI_PLUGIN_URL . 'images/money-back-badge.svg' ); ?>" class="wt-ier-icon">
68
- <p class="wt-ier-sidebar-p"><?php echo __('30 Day Money Back Guarantee','cookie-law-info'); ?></p>
69
- </div>
70
- </div>
71
- <div class="wt-ier-col-12 wt-ier-col-md-6">
72
- <div class="wt-ier-flex wt-ier-v-center">
73
- <img src="<?php echo esc_url( CLI_PLUGIN_URL . 'images/support.svg' ); ?>" class="wt-ier-icon">
74
- <p class="wt-ier-sidebar-p"><?php echo __('Fast and Superior Support','cookie-law-info'); ?></p>
75
- </div>
76
- </div>
77
- </div>
78
- <div class="wt-ier-center wt-ier-pt-4">
79
- <a href="https://www.webtoffee.com/product/gdpr-cookie-consent/?utm_source=free_plugin_sidebar&utm_medium=gdpr_basic&utm_campaign=GDPR&utm_content=<?php echo esc_url( CLI_VERSION );?>" class="wt-ier-green-btn" target="_blank"><?php echo __('Upgrade to Premium','cookie-law-info'); ?></a>
80
- </div>
81
- </div>
82
- <!----sidebar ends----->
83
-
84
- <div class="wt-cli-pro-feature-list">
85
- <h3 style=" text-align: left; font-size: 16px; font-weight: 500; padding-left: 13px;margin: 0; "><?php echo __('Premium features','cookie-law-info'); ?></h3>
86
- <ul class="cli_premium_features">
87
- <li><?php echo __('Automatic Cookie Scanner','cookie-law-info'); ?></li>
88
- <li><?php echo __('Auto block scripts - Google Analytics, Facebook Pixel, Google Tag Manager, Hotjar Analytics, Google Publisher Tag, Youtube embed, Vimeo embed, Google maps, Addthis widget, Sharethis widget, Twitter widget, Soundcloud embed, Slideshare embed, Linkedin widget, Instagram embed, Pinterest widget','cookie-law-info'); ?></li>
89
- <li><?php echo __('Location based exclusion of cookie notice for EU countries','cookie-law-info'); ?></li>
90
- <li><?php echo __('Granular control over the cookies/scipts used by the website','cookie-law-info'); ?></li>
91
- <li><?php echo __('User consent audit logs','cookie-law-info'); ?></li>
92
- <li><?php echo __('4 different layouts and 26 pre-designed templates','cookie-law-info'); ?></li>
93
- <li><?php echo __('Customized privacy overview','cookie-law-info'); ?></li>
94
- <li><?php echo __('Cookie bar preview in admin settings page','cookie-law-info'); ?></li>
95
- <li><?php echo __('Advanced support for cache plugins','cookie-law-info'); ?></li>
96
- <li><?php echo __('Cookie bar theme customizer for banner/ widgets/ popup','cookie-law-info'); ?></li>
97
- <li><?php echo __('GDPR compliance with Google Tag Manager','cookie-law-info'); ?></li>
98
- <li><?php echo __('Javascript helper functions','cookie-law-info'); ?></li>
99
- </ul>
100
- <p style="text-align: center;">
101
- <a href="https://www.webtoffee.com/gdpr-cookie-consent-plugin-basic-version-user-guide/" target="_blank" class="wt-ier-green-btn"><?php echo __('Documentation','cookie-law-info'); ?></a>
102
- </p>
103
- </div>
104
-
105
-
106
- </div>
107
-
108
- <div class="cli_gopro_block" style="padding: 15px 25px;">
109
- <h3 style="text-align: center;"><?php echo __('Like this plugin?','cookie-law-info'); ?></h3>
110
- <p><?php echo __('If you find this plugin useful please show your support and rate it','cookie-law-info'); ?> <a href="http://wordpress.org/support/view/plugin-reviews/cookie-law-info" target="_blank" style="color: #ffc600; text-decoration: none;">★★★★★</a><?php echo __(' on','cookie-law-info'); ?> <a href="http://wordpress.org/support/view/plugin-reviews/cookie-law-info" target="_blank">WordPress.org</a> -<?php echo __(' much appreciated!','cookie-law-info'); ?> :)</p>
111
- </div>
112
-
113
- <!-- <div>
114
- <form action="http://cookielawinfo.us5.list-manage.com/subscribe/post?u=b32779d828ef2e37e68e1580d&amp;id=71af66b86e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
115
- <h3><label for="mce-EMAIL">Subscribe to our mailing list</label></h3>
116
- <p>Occasional updates on plugin updates, compliance requirements, who's doing what and industry best practice.</p>
117
- <input type="email" value="" name="EMAIL" class="vvv_textfield" id="mce-EMAIL" placeholder="email address" required>
118
- <div class="">
119
- <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button-secondary">
120
- </div>
121
- <p>We will not send you spam or pass your details to 3rd Parties.</p>
122
- </form>
123
- </div>-->
124
- <!--End mc_embed_signup-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 2.0.9
20
  * Author: WebToffee
21
  * Author URI: https://www.webtoffee.com/
22
  * License: GPLv3
@@ -70,7 +70,7 @@ define( 'CLI_ACTIVATION_ID', 'wtgdprcookieconsent' );
70
  * Currently plugin version.
71
  * Rename this for your plugin and update it as you release new versions.
72
  */
73
- define( 'CLI_VERSION', '2.0.9' );
74
 
75
  function wt_cookie_law_info_update_message( $data, $response ) {
76
  if ( isset( $data['upgrade_notice'] ) ) {
@@ -81,7 +81,7 @@ function wt_cookie_law_info_update_message( $data, $response ) {
81
  #cookie-law-info-update ul{ list-style:disc; margin-left:30px;}
82
  .wf-update-message{ padding-left:30px;}
83
  </style>
84
- <div class="update-message wf-update-message"><div style="color: #f56e28;">' . __( 'Please make sure the cache is cleared after each plugin update especially if you have minified JS and/or CSS files.', 'cookie-law-info' ) . '</div>' . wpautop( $msg ) . '</div>';
85
  }
86
  }
87
  function wt_cookie_law_info_plugin_screen_update_js() { ?>
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: 2.1.0
20
  * Author: WebToffee
21
  * Author URI: https://www.webtoffee.com/
22
  * License: GPLv3
70
  * Currently plugin version.
71
  * Rename this for your plugin and update it as you release new versions.
72
  */
73
+ define( 'CLI_VERSION', '2.1.0' );
74
 
75
  function wt_cookie_law_info_update_message( $data, $response ) {
76
  if ( isset( $data['upgrade_notice'] ) ) {
81
  #cookie-law-info-update ul{ list-style:disc; margin-left:30px;}
82
  .wf-update-message{ padding-left:30px;}
83
  </style>
84
+ <div class="update-message wf-update-message"><div style="color: #f56e28;">' . esc_html__( 'Please make sure the cache is cleared after each plugin update especially if you have minified JS and/or CSS files.', 'cookie-law-info' ) . '</div>' . wp_kses_post( wpautop( $msg ) ) . '</div>';
85
  }
86
  }
87
  function wt_cookie_law_info_plugin_screen_update_js() { ?>
includes/class-cookie-law-info-activator.php CHANGED
@@ -135,4 +135,4 @@ class Cookie_Law_Info_Activator {
135
  return get_option( 'wt_cli_cookie_db_version', false );
136
  }
137
  }
138
- Cookie_Law_Info_Activator::init();
135
  return get_option( 'wt_cli_cookie_db_version', false );
136
  }
137
  }
138
+ Cookie_Law_Info_Activator::init();
includes/class-cookie-law-info-cookieyes.php CHANGED
@@ -121,12 +121,13 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
121
  * @return void
122
  */
123
  public function ajax_main_controller() {
124
- if ( ! Wt_Cookie_Law_Info_Security_Helper::check_write_access( CLI_PLUGIN_FILENAME, $this->module_id ) ) {
125
- wp_die( __( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) ); // phpcs:ignore WordPress.Security.EscapeOutput
 
126
  }
127
- if ( isset( $_POST['sub_action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
128
 
129
- $sub_action = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( $_POST['sub_action'] ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
130
 
131
  if ( in_array( $sub_action, $this->ckyes_actions, true ) && method_exists( $this, $sub_action ) ) {
132
 
@@ -265,13 +266,13 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
265
  </style>
266
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-password-reset'>
267
  <div class="wt-cli-modal-header">
268
- <h4><?php echo __( 'Reset Password', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></h4>
269
  </div>
270
  <div class="wt-cli-modal-body">
271
  <form id="wt-cli-ckyes-form-password-reset">
272
- <input type="email" name="ckyes-reset-email" class="wt-cli-form-input" placeholder="<?php echo __( 'Email', 'cookie-law-info' ); ?>" value="<?php echo esc_attr( $this->get_user_email() ); ?>" />
273
  <div class="wt-cli-action-container">
274
- <button id="wt-cli-ckyes-password-reset-btn" class="wt-cli-action button button-primary"><?php echo __( 'Send password reset email', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></button>
275
  </div>
276
 
277
  </form>
@@ -279,14 +280,14 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
279
  </div>
280
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-register'>
281
  <span class="wt-cli-modal-js-close">×</span>
282
- <div class="wt-cli-modal-header"><h4><?php echo __( 'Welcome to CookieYes', 'cookie-law-info' ); ?></h4></div>
283
  <div class="wt-cli-modal-body">
284
- <p><?php echo __( 'Enter your email to create an account with CookieYes. By clicking “Connect”, your CookieYes account will be created automatically and you can start scanning your website for cookies right away!', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></p>
285
  <form id="wt-cli-ckyes-form-register">
286
- <input type="email" name="ckyes-email" class="wt-cli-form-input" placeholder="<?php echo __( 'Email', 'cookie-law-info' ); ?>" value = "<?php echo esc_attr( $this->get_user_email() ); ?>" />
287
  <div class="wt-cli-action-container">
288
  <div class="wt-cli-action-group">
289
- <button id="wt-cli-ckyes-register-btn" class="wt-cli-action button button-primary"><?php echo __( 'Connect', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></button>
290
  </div>
291
  </div>
292
  </form>
@@ -352,7 +353,7 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
352
  $cookieyes_options = $this->get_cookieyes_options();
353
  $this->user_email = ( isset( $cookieyes_options['email'] ) ? $cookieyes_options['email'] : '' );
354
  }
355
- return $this->user_email;
356
  }
357
  /**
358
  * Get CookieYes access token
@@ -562,11 +563,13 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
562
  * @return array
563
  */
564
  public function register() {
 
 
565
  $api_response = $this->get_default_response();
566
  $endpoint = $this->get_base_path() . 'users/register';
567
 
568
  $url = $this->get_website_url();
569
- $email = isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : $email; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
570
  $this->user_email = $email;
571
  if ( empty( $email ) || empty( $url ) ) {
572
  $api_response['code'] = 101;
@@ -608,18 +611,16 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
608
  */
609
  public function login() {
610
 
 
611
  $api_response = $this->get_default_response();
612
-
613
- $endpoint = $this->get_base_path() . 'users/login';
614
 
615
  $url = $this->get_website_url();
616
  $email = $this->get_user_email();
617
 
618
- $email = isset( $_POST['email'] ) ? $_POST['email'] : $email; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
619
  $password = isset( $_POST['password'] ) ? $_POST['password'] : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
620
 
621
- $email = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( $email );
622
-
623
  if ( empty( $email ) || empty( $url ) || empty( $password ) ) {
624
  $api_response['code'] = 101;
625
  return $api_response;
@@ -717,12 +718,12 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
717
  * @return array
718
  */
719
  public function reset_password() {
 
720
  $api_response = $this->get_default_response();
721
 
722
  $endpoint = $this->get_base_path() . 'password/reset';
723
 
724
- $email = isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
725
- $email = Wt_Cookie_Law_Info_Security_Helper::sanitize_item( $email );
726
 
727
  if ( empty( $email ) ) {
728
  $api_response['code'] = 101;
@@ -774,14 +775,14 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
774
  * @return array
775
  */
776
  public function connect_disconnect() {
777
-
778
  $api_response = array(
779
  'status' => false,
780
  'code' => 100,
781
  'message' => '',
782
  );
783
  $message = __( 'Successfully disconnected with Cookieyes', 'cookie-law-info' );
784
- $action = isset( $_POST['account_action'] ) ? wp_unslash( $_POST['account_action'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
785
  if ( empty( $action ) ) {
786
  $api_response['message'] = __( 'Could not identify the action', 'cookie-law-info' );
787
  return $api_response;
@@ -896,10 +897,10 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
896
  </table>
897
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-delete-account'>
898
  <span class="wt-cli-modal-js-close">×</span>
899
- <div class="wt-cli-modal-header"><h4><?php echo __( 'Do you really want to delete your website from CookieYes', 'cookie-law-info' ); ?></h4></div>
900
  <div class="wt-cli-modal-body">
901
- <p><?php echo __( 'This action will clear all your website data from CookieYes. If you have multiple websites added to your CookieYes account, then only the data associated with this website get deleted. Otherwise, your entire account will be deleted.', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></p>
902
- <button class="wt-cli-action wt-cli-ckyes-delete-btn button button-primary" data-action="delete-account" ><?php echo __( 'Delete this website', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></button>
903
  </div>
904
  </div>
905
  <?php
@@ -913,7 +914,7 @@ if ( ! class_exists( 'Cookie_Law_Info_Cookieyes' ) ) {
913
  public function ckyes_save_settings() {
914
 
915
  if ( ! current_user_can( 'manage_options' ) ) {
916
- wp_die( __( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) ); // phpcs:ignore WordPress.Security.EscapeOutput
917
  }
918
  check_admin_referer( 'cookielawinfo-update-' . CLI_SETTINGS_FIELD );
919
  if ( isset( $_POST['wt-cli-ckyes-branding'] ) && 'yes' === $_POST['wt-cli-ckyes-branding'] ) {
121
  * @return void
122
  */
123
  public function ajax_main_controller() {
124
+ check_ajax_referer( $this->module_id, '_wpnonce' );
125
+ if ( ! current_user_can( 'manage_options' ) ) {
126
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
127
  }
128
+ if ( isset( $_POST['sub_action'] ) ) {
129
 
130
+ $sub_action = sanitize_text_field( wp_unslash( $_POST['sub_action'] ) ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
131
 
132
  if ( in_array( $sub_action, $this->ckyes_actions, true ) && method_exists( $this, $sub_action ) ) {
133
 
266
  </style>
267
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-password-reset'>
268
  <div class="wt-cli-modal-header">
269
+ <h4><?php echo esc_html__( 'Reset Password', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></h4>
270
  </div>
271
  <div class="wt-cli-modal-body">
272
  <form id="wt-cli-ckyes-form-password-reset">
273
+ <input type="email" name="ckyes-reset-email" class="wt-cli-form-input" placeholder="<?php echo esc_attr__( 'Email', 'cookie-law-info' ); ?>" value="<?php echo esc_attr( $this->get_user_email() ); ?>" />
274
  <div class="wt-cli-action-container">
275
+ <button id="wt-cli-ckyes-password-reset-btn" class="wt-cli-action button button-primary"><?php echo esc_html__( 'Send password reset email', 'cookie-law-info' ); ?></button>
276
  </div>
277
 
278
  </form>
280
  </div>
281
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-register'>
282
  <span class="wt-cli-modal-js-close">×</span>
283
+ <div class="wt-cli-modal-header"><h4><?php echo esc_html__( 'Welcome to CookieYes', 'cookie-law-info' ); ?></h4></div>
284
  <div class="wt-cli-modal-body">
285
+ <p><?php echo esc_html__( 'Enter your email to create an account with CookieYes. By clicking “Connect”, your CookieYes account will be created automatically and you can start scanning your website for cookies right away!', 'cookie-law-info' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></p>
286
  <form id="wt-cli-ckyes-form-register">
287
+ <input type="email" name="ckyes-email" class="wt-cli-form-input" placeholder="<?php echo esc_attr__( 'Email', 'cookie-law-info' ); ?>" value = "<?php echo esc_attr( $this->get_user_email() ); ?>" />
288
  <div class="wt-cli-action-container">
289
  <div class="wt-cli-action-group">
290
+ <button id="wt-cli-ckyes-register-btn" class="wt-cli-action button button-primary"><?php echo esc_html__( 'Connect', 'cookie-law-info' ); ?></button>
291
  </div>
292
  </div>
293
  </form>
353
  $cookieyes_options = $this->get_cookieyes_options();
354
  $this->user_email = ( isset( $cookieyes_options['email'] ) ? $cookieyes_options['email'] : '' );
355
  }
356
+ return sanitize_email( $this->user_email );
357
  }
358
  /**
359
  * Get CookieYes access token
563
  * @return array
564
  */
565
  public function register() {
566
+ check_ajax_referer( $this->module_id, '_wpnonce' );
567
+
568
  $api_response = $this->get_default_response();
569
  $endpoint = $this->get_base_path() . 'users/register';
570
 
571
  $url = $this->get_website_url();
572
+ $email = isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : '';
573
  $this->user_email = $email;
574
  if ( empty( $email ) || empty( $url ) ) {
575
  $api_response['code'] = 101;
611
  */
612
  public function login() {
613
 
614
+ check_ajax_referer( $this->module_id, '_wpnonce' );
615
  $api_response = $this->get_default_response();
616
+ $endpoint = $this->get_base_path() . 'users/login';
 
617
 
618
  $url = $this->get_website_url();
619
  $email = $this->get_user_email();
620
 
621
+ $email = isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : $email;
622
  $password = isset( $_POST['password'] ) ? $_POST['password'] : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
623
 
 
 
624
  if ( empty( $email ) || empty( $url ) || empty( $password ) ) {
625
  $api_response['code'] = 101;
626
  return $api_response;
718
  * @return array
719
  */
720
  public function reset_password() {
721
+ check_ajax_referer( $this->module_id, '_wpnonce' );
722
  $api_response = $this->get_default_response();
723
 
724
  $endpoint = $this->get_base_path() . 'password/reset';
725
 
726
+ $email = isset( $_POST['email'] ) ? sanitize_email( wp_unslash( $_POST['email'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
 
727
 
728
  if ( empty( $email ) ) {
729
  $api_response['code'] = 101;
775
  * @return array
776
  */
777
  public function connect_disconnect() {
778
+ check_ajax_referer( $this->module_id, '_wpnonce' );
779
  $api_response = array(
780
  'status' => false,
781
  'code' => 100,
782
  'message' => '',
783
  );
784
  $message = __( 'Successfully disconnected with Cookieyes', 'cookie-law-info' );
785
+ $action = isset( $_POST['account_action'] ) ? sanitize_text_field( wp_unslash( $_POST['account_action'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
786
  if ( empty( $action ) ) {
787
  $api_response['message'] = __( 'Could not identify the action', 'cookie-law-info' );
788
  return $api_response;
897
  </table>
898
  <div class='wt-cli-modal' id='wt-cli-ckyes-modal-delete-account'>
899
  <span class="wt-cli-modal-js-close">×</span>
900
+ <div class="wt-cli-modal-header"><h4><?php echo esc_html__( 'Do you really want to delete your website from CookieYes', 'cookie-law-info' ); ?></h4></div>
901
  <div class="wt-cli-modal-body">
902
+ <p><?php echo esc_html__( 'This action will clear all your website data from CookieYes. If you have multiple websites added to your CookieYes account, then only the data associated with this website get deleted. Otherwise, your entire account will be deleted.', 'cookie-law-info' ); ?></p>
903
+ <button class="wt-cli-action wt-cli-ckyes-delete-btn button button-primary" data-action="delete-account" ><?php echo esc_html__( 'Delete this website', 'cookie-law-info' ); ?></button>
904
  </div>
905
  </div>
906
  <?php
914
  public function ckyes_save_settings() {
915
 
916
  if ( ! current_user_can( 'manage_options' ) ) {
917
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) ); // phpcs:ignore WordPress.Security.EscapeOutput
918
  }
919
  check_admin_referer( 'cookielawinfo-update-' . CLI_SETTINGS_FIELD );
920
  if ( isset( $_POST['wt-cli-ckyes-branding'] ) && 'yes' === $_POST['wt-cli-ckyes-branding'] ) {
includes/class-cookie-law-info-deactivator.php CHANGED
@@ -29,9 +29,7 @@ class Cookie_Law_Info_Deactivator {
29
  *
30
  * @since 1.6.6
31
  */
32
- public static function deactivate()
33
- {
34
-
35
  }
36
 
37
  }
29
  *
30
  * @since 1.6.6
31
  */
32
+ public static function deactivate() {
 
 
33
  }
34
 
35
  }
includes/class-cookie-law-info-loader.php CHANGED
@@ -57,11 +57,11 @@ class Cookie_Law_Info_Loader {
57
  * Add a new action to the collection to be registered with WordPress.
58
  *
59
  * @since 1.6.6
60
- * @param string $hook The name of the WordPress action that is being registered.
61
- * @param object $component A reference to the instance of the object on which the action is defined.
62
- * @param string $callback The name of the function definition on the $component.
63
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
64
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
65
  */
66
  public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
67
  $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
@@ -71,11 +71,11 @@ class Cookie_Law_Info_Loader {
71
  * Add a new filter to the collection to be registered with WordPress.
72
  *
73
  * @since 1.6.6
74
- * @param string $hook The name of the WordPress filter that is being registered.
75
- * @param object $component A reference to the instance of the object on which the filter is defined.
76
- * @param string $callback The name of the function definition on the $component.
77
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
78
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
79
  */
80
  public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
81
  $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
@@ -87,12 +87,12 @@ class Cookie_Law_Info_Loader {
87
  *
88
  * @since 1.6.6
89
  * @access private
90
- * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
91
- * @param string $hook The name of the WordPress filter that is being registered.
92
- * @param object $component A reference to the instance of the object on which the filter is defined.
93
- * @param string $callback The name of the function definition on the $component.
94
- * @param int $priority The priority at which the function should be fired.
95
- * @param int $accepted_args The number of arguments that should be passed to the $callback.
96
  * @return array The collection of actions and filters registered with WordPress.
97
  */
98
  private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
@@ -102,7 +102,7 @@ class Cookie_Law_Info_Loader {
102
  'component' => $component,
103
  'callback' => $callback,
104
  'priority' => $priority,
105
- 'accepted_args' => $accepted_args
106
  );
107
 
108
  return $hooks;
57
  * Add a new action to the collection to be registered with WordPress.
58
  *
59
  * @since 1.6.6
60
+ * @param string $hook The name of the WordPress action that is being registered.
61
+ * @param object $component A reference to the instance of the object on which the action is defined.
62
+ * @param string $callback The name of the function definition on the $component.
63
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
64
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
65
  */
66
  public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
67
  $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
71
  * Add a new filter to the collection to be registered with WordPress.
72
  *
73
  * @since 1.6.6
74
+ * @param string $hook The name of the WordPress filter that is being registered.
75
+ * @param object $component A reference to the instance of the object on which the filter is defined.
76
+ * @param string $callback The name of the function definition on the $component.
77
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
78
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
79
  */
80
  public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
81
  $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
87
  *
88
  * @since 1.6.6
89
  * @access private
90
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
91
+ * @param string $hook The name of the WordPress filter that is being registered.
92
+ * @param object $component A reference to the instance of the object on which the filter is defined.
93
+ * @param string $callback The name of the function definition on the $component.
94
+ * @param int $priority The priority at which the function should be fired.
95
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
96
  * @return array The collection of actions and filters registered with WordPress.
97
  */
98
  private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
102
  'component' => $component,
103
  'callback' => $callback,
104
  'priority' => $priority,
105
+ 'accepted_args' => $accepted_args,
106
  );
107
 
108
  return $hooks;
includes/class-cookie-law-info-review-request.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Review request
5
+ *
6
+ * @package Cookie_Law_Info
7
+ */
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ class Cookie_Law_Info_Review_Request {
12
+
13
+ /**
14
+ * config options
15
+ */
16
+ private $plugin_title = 'GDPR Cookie Consent (CCPA Ready)';
17
+ private $review_url = 'https://wordpress.org/support/plugin/cookie-law-info/reviews/#new-post';
18
+ private $plugin_prefix = 'wt_cli'; /* must be unique name */
19
+ private $days_to_show_banner = 15; /* when did the banner to show */
20
+ private $remind_days = 15; /* remind interval in days */
21
+ private $webtoffee_logo_url = '';
22
+
23
+
24
+
25
+ private $start_date = 0; /* banner to show count start date. plugin installed date, remind me later added date */
26
+ private $current_banner_state = 2; /* 1: active, 2: waiting to show(first after installation), 3: closed by user/not interested to review, 4: user done the review, 5:remind me later */
27
+ private $banner_state_option_name = ''; /* WP option name to save banner state */
28
+ private $start_date_option_name = ''; /* WP option name to save start date */
29
+ private $banner_css_class = ''; /* CSS class name for Banner HTML element. */
30
+ private $banner_message = ''; /* Banner message. */
31
+ private $later_btn_text = ''; /* Remind me later button text */
32
+ private $never_btn_text = ''; /* Never review button text. */
33
+ private $review_btn_text = ''; /* Review now button text. */
34
+ private $ajax_action_name = ''; /* Name of ajax action to save banner state. */
35
+ private $allowed_action_type_arr = array(
36
+ 'later', /* remind me later */
37
+ 'never', /* never */
38
+ 'review', /* review now */
39
+ 'closed', /* not interested */
40
+ );
41
+
42
+ public function __construct() {
43
+ // Set config vars
44
+ $this->set_vars();
45
+
46
+ register_activation_hook( CLI_PLUGIN_FILENAME, array( $this, 'on_activate' ) );
47
+ register_deactivation_hook( CLI_PLUGIN_FILENAME, array( $this, 'on_deactivate' ) );
48
+
49
+ if ( $this->check_condition() ) { /* checks the banner is active now */
50
+ $this->banner_message = sprintf( __( 'Hey, we at %1$sWebToffee%2$s would like to thank you for using our plugin. We would really appreciate if you could take a moment to drop a quick review that will inspire us to keep going.', 'cookie-law-info' ), '<b>', '</b>' );
51
+
52
+ /* button texts */
53
+ $this->later_btn_text = __( 'Remind me later', 'cookie-law-info' );
54
+ $this->never_btn_text = __( 'Not interested', 'cookie-law-info' );
55
+ $this->review_btn_text = __( 'Review now', 'cookie-law-info' );
56
+
57
+ add_action( 'admin_notices', array( $this, 'show_banner' ) ); /* show banner */
58
+ add_action( 'admin_print_footer_scripts', array( $this, 'add_banner_scripts' ) ); /* add banner scripts */
59
+ add_action( 'wp_ajax_' . $this->ajax_action_name, array( $this, 'process_user_action' ) ); /* process banner user action */
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Set config vars
65
+ */
66
+ public function set_vars() {
67
+ $this->ajax_action_name = $this->plugin_prefix . '_process_user_review_action';
68
+ $this->banner_state_option_name = $this->plugin_prefix . '_review_request';
69
+ $this->start_date_option_name = $this->plugin_prefix . '_start_date';
70
+ $this->banner_css_class = $this->plugin_prefix . '_review_request';
71
+
72
+ $this->start_date = absint( get_option( $this->start_date_option_name ) );
73
+ $banner_state = absint( get_option( $this->banner_state_option_name ) );
74
+ $this->current_banner_state = ( $banner_state == 0 ? $this->current_banner_state : $banner_state );
75
+ $this->webtoffee_logo_url = CLI_PLUGIN_URL . 'images/webtoffee-logo_small.png';
76
+
77
+ }
78
+
79
+ /**
80
+ * Actions on plugin activation
81
+ * Saves activation date
82
+ */
83
+ public function on_activate() {
84
+ if ( $this->start_date == 0 ) {
85
+ $this->reset_start_date();
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Actions on plugin deactivation
91
+ * Removes activation date
92
+ */
93
+ public function on_deactivate() {
94
+ delete_option( $this->start_date_option_name );
95
+ }
96
+
97
+ /**
98
+ * Reset the start date.
99
+ */
100
+ private function reset_start_date() {
101
+ update_option( $this->start_date_option_name, time() );
102
+ }
103
+
104
+ /**
105
+ * Update the banner state
106
+ */
107
+ private function update_banner_state( $val ) {
108
+ update_option( $this->banner_state_option_name, $val );
109
+ }
110
+
111
+ /**
112
+ * Prints the banner
113
+ */
114
+ public function show_banner() {
115
+ $this->update_banner_state( 1 ); /* update banner active state */
116
+ ?>
117
+ <div class="<?php echo esc_attr( $this->banner_css_class ); ?> notice-info notice is-dismissible">
118
+ <?php
119
+ if ( $this->webtoffee_logo_url != '' ) {
120
+ ?>
121
+ <h3 style="margin: 10px 0;"><?php echo esc_html( $this->plugin_title ); ?></h3>
122
+ <?php
123
+ }
124
+ ?>
125
+ <p>
126
+ <?php echo wp_kses_post( $this->banner_message ); ?>
127
+ </p>
128
+ <p>
129
+ <a class="button button-secondary" style="color:#333; border-color:#ccc; background:#efefef;" data-type="later"><?php echo esc_html( $this->later_btn_text ); ?></a>
130
+ <a class="button button-primary" data-type="review"><?php echo esc_html( $this->review_btn_text ); ?></a>
131
+ </p>
132
+ <div class="wt-cli-review-footer" style="position: relative;">
133
+ <span class="wt-cli-footer-icon" style="position: absolute;right: 0;bottom: 10px;"><img src="<?php echo esc_url( $this->webtoffee_logo_url ); ?>" style="max-width:100px;"></span>
134
+ </div>
135
+ </div>
136
+ <?php
137
+ }
138
+
139
+ /**
140
+ * Ajax hook to process user action on the banner
141
+ */
142
+ public function process_user_action() {
143
+ check_ajax_referer( $this->plugin_prefix );
144
+ if ( isset( $_POST['wt_review_action_type'] ) ) {
145
+ $action_type = sanitize_text_field( wp_unslash( $_POST['wt_review_action_type'] ) );
146
+
147
+ /* current action is in allowed action list */
148
+ if ( in_array( $action_type, $this->allowed_action_type_arr ) ) {
149
+ if ( $action_type == 'never' || $action_type == 'closed' ) {
150
+ $new_banner_state = 3;
151
+ } elseif ( $action_type == 'review' ) {
152
+ $new_banner_state = 4;
153
+ } else {
154
+ /* reset start date to current date */
155
+ $this->reset_start_date();
156
+ $new_banner_state = 5; /* remind me later */
157
+ }
158
+ $this->update_banner_state( $new_banner_state );
159
+ }
160
+ }
161
+ exit();
162
+ }
163
+
164
+ /**
165
+ * Add banner JS to admin footer
166
+ */
167
+ public function add_banner_scripts() {
168
+ $ajax_url = admin_url( 'admin-ajax.php' );
169
+ $nonce = wp_create_nonce( $this->plugin_prefix );
170
+ ?>
171
+ <script type="text/javascript">
172
+ (function($) {
173
+ "use strict";
174
+
175
+ /* prepare data object */
176
+ var data_obj = {
177
+ _wpnonce: '<?php echo esc_js( $nonce ); ?>',
178
+ action: '<?php echo esc_js( $this->ajax_action_name ); ?>',
179
+ wt_review_action_type: ''
180
+ };
181
+
182
+ $(document).on('click', '.<?php echo esc_js( $this->banner_css_class ); ?> a.button', function(e) {
183
+ e.preventDefault();
184
+ var elm = $(this);
185
+ var btn_type = elm.attr('data-type');
186
+ if (btn_type == 'review') {
187
+ window.open('<?php echo esc_js( $this->review_url ); ?>');
188
+ }
189
+ elm.parents('.<?php echo esc_js( $this->banner_css_class ); ?>').hide();
190
+
191
+ data_obj['wt_review_action_type'] = btn_type;
192
+ $.ajax({
193
+ url: '<?php echo esc_js( $ajax_url ); ?>',
194
+ data: data_obj,
195
+ type: 'POST'
196
+ });
197
+
198
+ }).on('click', '.<?php echo esc_js( $this->banner_css_class ); ?> .notice-dismiss', function(e) {
199
+ e.preventDefault();
200
+ data_obj['wt_review_action_type'] = 'closed';
201
+ $.ajax({
202
+ url: '<?php echo esc_js( $ajax_url ); ?>',
203
+ data: data_obj,
204
+ type: 'POST',
205
+ });
206
+
207
+ });
208
+
209
+ })(jQuery)
210
+ </script>
211
+ <?php
212
+ }
213
+
214
+ /**
215
+ * Checks the condition to show the banner
216
+ */
217
+ private function check_condition() {
218
+
219
+ if ( $this->current_banner_state == 1 ) { /* currently showing then return true */
220
+ return true;
221
+ }
222
+
223
+ if ( $this->current_banner_state == 2 || $this->current_banner_state == 5 ) { /* only waiting/remind later state */
224
+ if ( $this->start_date == 0 ) { /*
225
+ unable to get activated date */
226
+ /* set current date as activation date*/
227
+ $this->reset_start_date();
228
+ return false;
229
+ }
230
+
231
+ $days = ( $this->current_banner_state == 2 ? $this->days_to_show_banner : $this->remind_days );
232
+
233
+ $date_to_check = $this->start_date + ( 86400 * $days );
234
+ if ( $date_to_check <= time() ) { /* time reached to show the banner */
235
+ return true;
236
+ } else {
237
+ return false;
238
+ }
239
+ }
240
+
241
+ return false;
242
+ }
243
+ }
244
+ new Cookie_Law_Info_Review_Request();
includes/class-cookie-law-info-review_request.php DELETED
@@ -1,254 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Review request
5
- *
6
- *
7
- * @package Cookie_Law_Info
8
- */
9
- if (!defined('ABSPATH')) {
10
- exit;
11
- }
12
- class Cookie_Law_Info_Review_Request
13
- {
14
- /**
15
- * config options
16
- */
17
- private $plugin_title = "GDPR Cookie Consent (CCPA Ready)";
18
- private $review_url = "https://wordpress.org/support/plugin/cookie-law-info/reviews/#new-post";
19
- private $plugin_prefix = "wt_cli"; /* must be unique name */
20
- private $days_to_show_banner = 15; /* when did the banner to show */
21
- private $remind_days = 15; /* remind interval in days */
22
- private $webtoffee_logo_url = '';
23
-
24
-
25
-
26
- private $start_date = 0; /* banner to show count start date. plugin installed date, remind me later added date */
27
- private $current_banner_state = 2; /* 1: active, 2: waiting to show(first after installation), 3: closed by user/not interested to review, 4: user done the review, 5:remind me later */
28
- private $banner_state_option_name = ''; /* WP option name to save banner state */
29
- private $start_date_option_name = ''; /* WP option name to save start date */
30
- private $banner_css_class = ''; /* CSS class name for Banner HTML element. */
31
- private $banner_message = ''; /* Banner message. */
32
- private $later_btn_text = ''; /* Remind me later button text */
33
- private $never_btn_text = ''; /* Never review button text. */
34
- private $review_btn_text = ''; /* Review now button text. */
35
- private $ajax_action_name = ''; /* Name of ajax action to save banner state. */
36
- private $allowed_action_type_arr = array(
37
- 'later', /* remind me later */
38
- 'never', /* never */
39
- 'review', /* review now */
40
- 'closed', /* not interested */
41
- );
42
-
43
- public function __construct()
44
- {
45
- //Set config vars
46
- $this->set_vars();
47
-
48
- register_activation_hook(CLI_PLUGIN_FILENAME , array($this, 'on_activate'));
49
- register_deactivation_hook(CLI_PLUGIN_FILENAME, array($this, 'on_deactivate'));
50
-
51
- if ($this->check_condition()) /* checks the banner is active now */ {
52
- $this->banner_message = sprintf(__("Hey, we at %sWebToffee%s would like to thank you for using our plugin. We would really appreciate if you could take a moment to drop a quick review that will inspire us to keep going.", 'cookie-law-info'), '<b>', '</b>');
53
-
54
- /* button texts */
55
- $this->later_btn_text = __("Remind me later", 'cookie-law-info');
56
- $this->never_btn_text = __("Not interested", 'cookie-law-info');
57
- $this->review_btn_text = __("Review now", 'cookie-law-info');
58
-
59
- add_action('admin_notices', array($this, 'show_banner')); /* show banner */
60
- add_action('admin_print_footer_scripts', array($this, 'add_banner_scripts')); /* add banner scripts */
61
- add_action('wp_ajax_' . $this->ajax_action_name, array($this, 'process_user_action')); /* process banner user action */
62
- }
63
- }
64
-
65
- /**
66
- * Set config vars
67
- */
68
- public function set_vars()
69
- {
70
- $this->ajax_action_name = $this->plugin_prefix . '_process_user_review_action';
71
- $this->banner_state_option_name = $this->plugin_prefix . "_review_request";
72
- $this->start_date_option_name = $this->plugin_prefix . "_start_date";
73
- $this->banner_css_class = $this->plugin_prefix . "_review_request";
74
-
75
- $this->start_date = absint(get_option($this->start_date_option_name));
76
- $banner_state = absint(get_option($this->banner_state_option_name));
77
- $this->current_banner_state = ($banner_state == 0 ? $this->current_banner_state : $banner_state);
78
- $this->webtoffee_logo_url = CLI_PLUGIN_URL . 'images/webtoffee-logo_small.png';
79
-
80
- }
81
-
82
- /**
83
- * Actions on plugin activation
84
- * Saves activation date
85
- */
86
- public function on_activate()
87
- {
88
- if( $this->start_date == 0 ) {
89
- $this->reset_start_date();
90
- }
91
- }
92
-
93
- /**
94
- * Actions on plugin deactivation
95
- * Removes activation date
96
- */
97
- public function on_deactivate()
98
- {
99
- delete_option($this->start_date_option_name);
100
- }
101
-
102
- /**
103
- * Reset the start date.
104
- */
105
- private function reset_start_date()
106
- {
107
- update_option($this->start_date_option_name, time());
108
- }
109
-
110
- /**
111
- * Update the banner state
112
- */
113
- private function update_banner_state($val)
114
- {
115
- update_option($this->banner_state_option_name, $val);
116
- }
117
-
118
- /**
119
- * Prints the banner
120
- */
121
- public function show_banner()
122
- {
123
- $this->update_banner_state(1); /* update banner active state */
124
- ?>
125
- <div class="<?php echo esc_attr( $this->banner_css_class ); ?> notice-info notice is-dismissible">
126
- <?php
127
- if ($this->webtoffee_logo_url != "") {
128
- ?>
129
- <h3 style="margin: 10px 0;"><?php echo esc_html( $this->plugin_title ); ?></h3>
130
- <?php
131
- }
132
- ?>
133
- <p>
134
- <?php echo $this->banner_message; ?>
135
- </p>
136
- <p>
137
- <a class="button button-secondary" style="color:#333; border-color:#ccc; background:#efefef;" data-type="later"><?php echo esc_html( $this->later_btn_text ); ?></a>
138
- <a class="button button-primary" data-type="review"><?php echo esc_html( $this->review_btn_text ); ?></a>
139
- </p>
140
- <div class="wt-cli-review-footer" style="position: relative;">
141
- <span class="wt-cli-footer-icon" style="position: absolute;right: 0;bottom: 10px;"><img src="<?php echo esc_url( $this->webtoffee_logo_url ); ?>" style="max-width:100px;"></span>
142
- </div>
143
- </div>
144
- <?php
145
- }
146
-
147
- /**
148
- * Ajax hook to process user action on the banner
149
- */
150
- public function process_user_action()
151
- {
152
- check_ajax_referer($this->plugin_prefix);
153
- if (isset($_POST['wt_review_action_type'])) {
154
- $action_type = sanitize_text_field($_POST['wt_review_action_type']);
155
-
156
- /* current action is in allowed action list */
157
- if (in_array($action_type, $this->allowed_action_type_arr)) {
158
- if ($action_type == 'never' || $action_type == 'closed') {
159
- $new_banner_state = 3;
160
- } elseif ($action_type == 'review') {
161
- $new_banner_state = 4;
162
- } else {
163
- /* reset start date to current date */
164
- $this->reset_start_date();
165
- $new_banner_state = 5; /* remind me later */
166
- }
167
- $this->update_banner_state($new_banner_state);
168
- }
169
- }
170
- exit();
171
- }
172
-
173
- /**
174
- * Add banner JS to admin footer
175
- */
176
- public function add_banner_scripts()
177
- {
178
- $ajax_url = admin_url('admin-ajax.php');
179
- $nonce = wp_create_nonce($this->plugin_prefix);
180
- ?>
181
- <script type="text/javascript">
182
- (function($) {
183
- "use strict";
184
-
185
- /* prepare data object */
186
- var data_obj = {
187
- _wpnonce: '<?php echo $nonce; ?>',
188
- action: '<?php echo $this->ajax_action_name; ?>',
189
- wt_review_action_type: ''
190
- };
191
-
192
- $(document).on('click', '.<?php echo $this->banner_css_class; ?> a.button', function(e) {
193
- e.preventDefault();
194
- var elm = $(this);
195
- var btn_type = elm.attr('data-type');
196
- if (btn_type == 'review') {
197
- window.open('<?php echo $this->review_url; ?>');
198
- }
199
- elm.parents('.<?php echo $this->banner_css_class; ?>').hide();
200
-
201
- data_obj['wt_review_action_type'] = btn_type;
202
- $.ajax({
203
- url: '<?php echo $ajax_url; ?>',
204
- data: data_obj,
205
- type: 'POST'
206
- });
207
-
208
- }).on('click', '.<?php echo $this->banner_css_class; ?> .notice-dismiss', function(e) {
209
- e.preventDefault();
210
- data_obj['wt_review_action_type'] = 'closed';
211
- $.ajax({
212
- url: '<?php echo $ajax_url; ?>',
213
- data: data_obj,
214
- type: 'POST',
215
- });
216
-
217
- });
218
-
219
- })(jQuery)
220
- </script>
221
- <?php
222
- }
223
-
224
- /**
225
- * Checks the condition to show the banner
226
- */
227
- private function check_condition()
228
- {
229
-
230
- if ($this->current_banner_state == 1) /* currently showing then return true */ {
231
- return true;
232
- }
233
-
234
- if ($this->current_banner_state == 2 || $this->current_banner_state == 5) /* only waiting/remind later state */ {
235
- if ($this->start_date == 0) /* unable to get activated date */ {
236
- /* set current date as activation date*/
237
- $this->reset_start_date();
238
- return false;
239
- }
240
-
241
- $days = ($this->current_banner_state == 2 ? $this->days_to_show_banner : $this->remind_days);
242
-
243
- $date_to_check = $this->start_date + (86400 * $days);
244
- if ($date_to_check <= time()) /* time reached to show the banner */ {
245
- return true;
246
- } else {
247
- return false;
248
- }
249
- }
250
-
251
- return false;
252
- }
253
- }
254
- new Cookie_Law_Info_Review_Request();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-cookie-law-info.php CHANGED
@@ -57,7 +57,7 @@ class Cookie_Law_Info {
57
  */
58
  protected $version;
59
 
60
- private static $stored_options=array();
61
  protected $js_blocking_enabled = false;
62
 
63
  /**
@@ -70,15 +70,11 @@ class Cookie_Law_Info {
70
  * @since 1.6.6
71
  */
72
  public static $db_initial_version = '1.9.4';
73
- public function __construct()
74
- {
75
- if(defined( 'CLI_VERSION' ))
76
- {
77
  $this->version = CLI_VERSION;
78
- }
79
- else
80
- {
81
- $this->version = '2.0.9';
82
  }
83
  $this->plugin_name = 'cookie-law-info';
84
 
@@ -87,7 +83,7 @@ class Cookie_Law_Info {
87
  $this->define_admin_hooks();
88
  $this->define_public_hooks();
89
  $this->define_thrid_party_hooks();
90
-
91
  }
92
 
93
  /**
@@ -113,19 +109,11 @@ class Cookie_Law_Info {
113
  * core plugin.
114
  */
115
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-loader.php';
116
-
117
- /**
118
- * Webtoffee Security Library
119
- * Includes Data sanitization, Access checking
120
- */
121
-
122
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wt-security-helper.php';
123
-
124
  /**
125
  * The class which integrates Cookieyes services to the plugin
126
  */
127
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-cookieyes.php';
128
-
129
 
130
  /**
131
  * The class responsible for defining internationalization functionality
@@ -143,7 +131,7 @@ class Cookie_Law_Info {
143
  * The class which integrates Cookieyes services to the plugin
144
  */
145
  // require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-cookieyes.php';
146
-
147
  /**
148
  * The class responsible for defining all actions that occur in the admin area.
149
  */
@@ -155,14 +143,12 @@ class Cookie_Law_Info {
155
  */
156
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-cookie-law-info-public.php';
157
 
158
-
159
  /**
160
  * The class responsible for adding compatibility to third party plugins
161
- *
162
  */
163
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'third-party/class-cookie-law-info-third-party.php';
164
 
165
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-review_request.php';
166
 
167
  $this->loader = new Cookie_Law_Info_Loader();
168
 
@@ -194,26 +180,24 @@ class Cookie_Law_Info {
194
  */
195
  private function define_admin_hooks() {
196
 
197
- $plugin_admin = new Cookie_Law_Info_Admin( $this->get_plugin_name(), $this->get_version(),$this);
 
 
198
 
199
-
200
- $this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_menu',11); /* Adding admin menu */
201
-
202
-
203
- $this->loader->add_action('admin_menu',$plugin_admin,'remove_cli_addnew_link');
204
 
205
  // Add plugin settings link:
206
- add_filter('plugin_action_links_'.plugin_basename(CLI_PLUGIN_FILENAME),array($plugin_admin,'plugin_action_links'));
207
 
208
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
209
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
210
 
211
-
212
- /*.
213
  * loading admin modules
214
  */
215
  $plugin_admin->admin_modules();
216
-
217
  }
218
 
219
  /**
@@ -223,19 +207,18 @@ class Cookie_Law_Info {
223
  * @since 1.6.6
224
  * @access private
225
  */
226
- private function define_public_hooks()
227
- {
228
- $plugin_public = new Cookie_Law_Info_Public( $this->get_plugin_name(), $this->get_version(),$this);
229
 
230
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
231
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
232
- $this->loader->add_action( 'template_redirect', $plugin_public,'cli_set_category_cookies');
233
 
234
  $plugin_public->common_modules();
235
-
236
- $this->loader->add_action( 'wp_footer',$plugin_public,'cookielawinfo_inject_cli_script');
237
- $this->loader->add_action('wp_head',$plugin_public,'include_user_accepted_cookielawinfo');
238
- $this->loader->add_action('wp_footer',$plugin_public,'include_user_accepted_cookielawinfo_in_body');
239
  }
240
 
241
 
@@ -246,12 +229,11 @@ class Cookie_Law_Info {
246
  * @since 1.7.2
247
  * @access public
248
  */
249
- public function define_thrid_party_hooks()
250
- {
251
  $plugin_third_party = new Cookie_Law_Info_Third_Party();
252
  $plugin_third_party->register_scripts();
253
  }
254
-
255
 
256
  /**
257
  * Run the loader to execute all of the hooks with WordPress.
@@ -295,17 +277,13 @@ class Cookie_Law_Info {
295
 
296
  /**
297
  * Get current settings.
298
- *
299
  */
300
- public static function get_settings()
301
- {
302
- $settings = self::get_default_settings();
303
- self::$stored_options = get_option(CLI_SETTINGS_FIELD);
304
- if(!empty(self::$stored_options))
305
- {
306
- foreach(self::$stored_options as $key => $option )
307
- {
308
- $settings[$key] = self::sanitise_settings($key,$option );
309
  }
310
  }
311
  return $settings;
@@ -315,256 +293,223 @@ class Cookie_Law_Info {
315
  * Generate tab head for settings page.
316
  * method will translate the string to current language
317
  */
318
- public static function generate_settings_tabhead($title_arr)
319
- {
320
- $out_arr=array();
321
- foreach($title_arr as $k=>$v)
322
- {
323
- if($k=='cookie-law-info-buttons')
324
- {
325
- $out_arr[$k]=$v;
326
- //tab head for modules
327
- $out_arr=apply_filters('cli_module_settings_tabhead',$out_arr);
328
- }else
329
- {
330
- $out_arr[$k]=$v;
331
- }
332
- }
333
- foreach($out_arr as $k=>$v)
334
- {
335
- if(is_array($v))
336
- {
337
- $v=(isset($v[2]) ? $v[2] : '').__($v[0], 'cookie-law-info').' '.(isset($v[1]) ? $v[1] : '');
338
- }else
339
- {
340
- $v=__($v, 'cookie-law-info');
341
  }
342
- ?>
343
- <a class="nav-tab" href="#<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></a>
344
- <?php
345
  }
346
- }
347
-
348
- /**
349
- * Envelope settings tab content with tab div.
350
- * relative path is not acceptable in view file
351
- */
352
- public static function envelope_settings_tabcontent($target_id,$view_file="",$html="")
353
- {
354
- ?>
355
- <div class="cookie-law-info-tab-content" data-id="<?php echo esc_attr( $target_id );?>">
356
- <?php
357
- if($view_file!="" && file_exists($view_file))
358
- {
359
- include_once $view_file;
360
- }else
361
- {
362
- echo $html;
363
  }
364
  ?>
365
- </div>
366
- <?php
 
367
  }
368
-
369
  /**
370
  Returns default settings
371
  If you override the settings here, be ultra careful to use escape characters!
372
  */
373
- public static function get_default_settings($key='')
374
- {
375
  $settings_v0_9 = array(
376
- 'animate_speed_hide' => '500',
377
- 'animate_speed_show' => '500',
378
- 'background' => '#FFF',
379
- 'background_url' => '',
380
- 'border' => '#b1a6a6c2',
381
- 'border_on' => true,
382
- 'bar_style' => array(),
383
- 'button_1_text' => 'Accept',
384
- 'button_1_url' => '#',
385
- 'button_1_action' => '#cookie_action_close_header',
386
- 'button_1_link_colour' => '#fff',
387
- 'button_1_new_win' => false,
388
- 'button_1_as_button' => true,
389
- 'button_1_button_colour' => '#61a229',
390
- 'button_1_button_size' => 'medium',
391
- 'button_1_style' => array(),
392
-
393
- 'button_2_text' => 'Read More',
394
- 'button_2_url' => get_site_url(),
395
- 'button_2_action' => 'CONSTANT_OPEN_URL',
396
- 'button_2_link_colour' => '#444',
397
- 'button_2_new_win' => true,
398
- 'button_2_as_button' => false,
399
- 'button_2_button_colour' => '#333',
400
- 'button_2_button_size' => 'medium',
401
- 'button_2_url_type' =>'url',
402
- 'button_2_page' =>get_option('wp_page_for_privacy_policy') ? get_option('wp_page_for_privacy_policy') : 0,
403
- 'button_2_hidebar' =>false,
404
- 'button_2_style' => array(),
405
-
406
- 'button_3_text' => 'Reject All',
407
- 'button_3_url' => '#',
408
- 'button_3_action' => '#cookie_action_close_header_reject',
409
- 'button_3_link_colour' => '#333333',
410
- 'button_3_new_win' => false,
411
- 'button_3_as_button' => true,
412
- 'button_3_button_colour' => '#dedfe0',
413
- 'button_3_button_size' => 'medium',
414
- 'button_3_style' => array(),
415
-
416
- 'button_4_text' => 'Cookie Settings',
417
- 'button_4_url' => '#',
418
- 'button_4_action' => '#cookie_action_settings',
419
- 'button_4_link_colour' => '#333333',
420
- 'button_4_new_win' => false,
421
- 'button_4_as_button' => true,
422
- 'button_4_button_colour' => '#dedfe0',
423
- 'button_4_button_size' => 'medium',
424
- 'button_4_style' => array(),
425
- 'button_5_style' => array(),
426
-
427
- 'button_7_text' => 'Accept All',
428
- 'button_7_url' => '#',
429
- 'button_7_action' => '#cookie_action_close_header',
430
- 'button_7_link_colour' => '#fff',
431
- 'button_7_new_win' => false,
432
- 'button_7_as_button' => true,
433
- 'button_7_button_colour' => '#61a229',
434
- 'button_7_button_size' => 'medium',
435
- 'button_7_style' => array(),
436
-
437
- 'font_family' => 'inherit', // Pick the family, not the easy name (see helper function below)
438
- 'header_fix' => false,
439
- 'is_on' => true,
440
- 'is_eu_on' => false,
441
- 'logging_on' => false,
442
- 'notify_animate_hide' => true,
443
- 'notify_animate_show' => false,
444
- 'notify_div_id' => '#cookie-law-info-bar',
445
- 'notify_position_horizontal' => 'right', // left | right
446
- 'notify_position_vertical' => 'bottom', // 'top' = header | 'bottom' = footer
447
- 'notify_message' => addslashes ( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.</div><div class="cli-bar-btn_container">[cookie_settings margin="0px 5px 0px 0px"][cookie_accept_all]</div></div>'),
448
- 'scroll_close' => false,
449
- 'scroll_close_reload' => false,
450
- 'accept_close_reload' => false,
451
- 'reject_close_reload' => false,
452
- 'showagain_background' => '#fff',
453
- 'showagain_border' => '#000',
454
- 'showagain_text' => addslashes('Manage consent'),
455
- 'showagain_div_id' => '#cookie-law-info-again',
456
- 'showagain_tab' => false,
457
- 'showagain_x_position' => '100px',
458
- 'text' => '#333333',
459
- 'use_colour_picker' => true,
460
- 'show_once_yn' => false, // this is a new feature so default = switched off
461
- 'show_once' => '10000', // 8 seconds
462
- 'is_GMT_on' => true,
463
- 'as_popup' => false, // version 1.7.1 onwards this option is merged with `cookie_bar_as`
464
- 'popup_overlay' => true, //
465
- 'bar_heading_text' =>'',
466
- 'cookie_bar_as' =>'banner',
467
- 'popup_showagain_position' =>'bottom-right', //bottom-right | bottom-left | top-right | top-left
468
- 'widget_position' => 'left', //left | right
469
  );
470
- $settings_v0_9 = apply_filters('wt_cli_plugin_settings', $settings_v0_9);
471
- return $key!="" ? $settings_v0_9[$key] : $settings_v0_9;
472
  }
473
 
474
  /**
475
  Returns JSON object containing the settings for the main script
476
  REFACTOR / DEBUG: may need to use addslashes( ... ) else breaks JSON
477
  */
478
- public static function get_json_settings()
479
- {
480
- $settings = self::get_settings();
481
-
482
- // DEBUG hex:
483
- // preg_match('/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $hex)
484
- // DEBUG json_encode - issues across different versions of PHP!
485
- // $str = json_encode( $slim_settings, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP );
486
-
487
- // Slim down JSON objects to the bare bones:
488
- $slim_settings = array(
489
- 'animate_speed_hide' => $settings['animate_speed_hide'],
490
- 'animate_speed_show' => $settings['animate_speed_show'],
491
- 'background' => $settings['background'],
492
- 'border' => $settings['border'],
493
- 'border_on' => false, //$settings['border_on'],
494
- 'button_1_button_colour' => $settings['button_1_button_colour'],
495
- 'button_1_button_hover' => (self::su_hex_shift( $settings['button_1_button_colour'], 'down', 20 )),
496
- 'button_1_link_colour' => $settings['button_1_link_colour'],
497
- 'button_1_as_button' => $settings['button_1_as_button'],
498
- 'button_1_new_win' => $settings['button_1_new_win'],
499
- 'button_2_button_colour' => $settings['button_2_button_colour'],
500
- 'button_2_button_hover' => (self::su_hex_shift( $settings['button_2_button_colour'], 'down', 20 )),
501
- 'button_2_link_colour' => $settings['button_2_link_colour'],
502
- 'button_2_as_button' => $settings['button_2_as_button'],
503
- 'button_2_hidebar' =>$settings['button_2_hidebar'],
504
- 'button_3_button_colour' => $settings['button_3_button_colour'],
505
- 'button_3_button_hover' => (self::su_hex_shift( $settings['button_3_button_colour'], 'down', 20 )),
506
- 'button_3_link_colour' => $settings['button_3_link_colour'],
507
- 'button_3_as_button' => $settings['button_3_as_button'],
508
- 'button_3_new_win' => $settings['button_3_new_win'],
509
- 'button_4_button_colour' => $settings['button_4_button_colour'],
510
- 'button_4_button_hover' => (self::su_hex_shift( $settings['button_4_button_colour'], 'down', 20 )),
511
- 'button_4_link_colour' => $settings['button_4_link_colour'],
512
- 'button_4_as_button' => $settings['button_4_as_button'],
513
- 'button_7_button_colour' => $settings['button_7_button_colour'],
514
- 'button_7_button_hover' => (self::su_hex_shift( $settings['button_7_button_colour'], 'down', 20 )),
515
- 'button_7_link_colour' => $settings['button_7_link_colour'],
516
- 'button_7_as_button' => $settings['button_7_as_button'],
517
- 'button_7_new_win' => $settings['button_7_new_win'],
518
- 'font_family' => $settings['font_family'],
519
- 'header_fix' => $settings['header_fix'],
520
- 'notify_animate_hide' => $settings['notify_animate_hide'],
521
- 'notify_animate_show' => $settings['notify_animate_show'],
522
- 'notify_div_id' => $settings['notify_div_id'],
523
- 'notify_position_horizontal' => $settings['notify_position_horizontal'],
524
- 'notify_position_vertical' => $settings['notify_position_vertical'],
525
- 'scroll_close' => $settings['scroll_close'],
526
- 'scroll_close_reload' => $settings['scroll_close_reload'],
527
- 'accept_close_reload' => $settings['accept_close_reload'],
528
- 'reject_close_reload' => $settings['reject_close_reload'],
529
- 'showagain_tab' => $settings['showagain_tab'],
530
- 'showagain_background' => $settings['showagain_background'],
531
- 'showagain_border' => $settings['showagain_border'],
532
- 'showagain_div_id' => $settings['showagain_div_id'],
533
- 'showagain_x_position' => $settings['showagain_x_position'],
534
- 'text' => $settings['text'],
535
- 'show_once_yn' => $settings['show_once_yn'],
536
- 'show_once' => $settings['show_once'],
537
- 'logging_on'=>$settings['logging_on'],
538
- 'as_popup'=>$settings['as_popup'],
539
- 'popup_overlay'=>$settings['popup_overlay'],
540
- 'bar_heading_text'=>$settings['bar_heading_text'],
541
- 'cookie_bar_as'=>$settings['cookie_bar_as'],
542
- 'popup_showagain_position'=>$settings['popup_showagain_position'],
543
- 'widget_position'=>$settings['widget_position'],
544
- );
545
- // $str = json_encode( $slim_settings );
546
- /*
547
- DEBUG:
548
- if ( $str == null | $str == '') {
549
- $str = 'error: json is empty';
550
- }
551
- */
552
- return $slim_settings;
553
  }
554
 
555
  /**
556
- Returns sanitised content based on field-specific rules defined here
557
  Used for both read AND write operations
558
  */
559
- public static function sanitise_settings($key, $value)
560
- {
561
- $ret = null;
562
- switch ($key) {
563
  // Convert all boolean values from text to bool:
564
  case 'is_on':
565
  case 'is_reject_on':
566
- case 'is_eu_on':
567
- case 'logging_on':
568
  case 'border_on':
569
  case 'notify_animate_show':
570
  case 'notify_animate_hide':
@@ -575,16 +520,16 @@ class Cookie_Law_Info {
575
  case 'button_2_new_win':
576
  case 'button_2_as_button':
577
  case 'button_2_hidebar':
578
- case 'button_3_new_win':
579
  case 'button_3_as_button':
580
- case 'button_4_new_win':
581
  case 'button_4_as_button':
582
  case 'button_7_new_win':
583
  case 'button_7_as_button':
584
  case 'scroll_close':
585
  case 'scroll_close_reload':
586
- case 'accept_close_reload':
587
- case 'reject_close_reload':
588
  case 'show_once_yn':
589
  case 'header_fix':
590
  case 'is_GMT_on':
@@ -596,17 +541,11 @@ class Cookie_Law_Info {
596
  case 'button_6_as_link':
597
  case 'ccpa_region_based':
598
  case 'ccpa_enable_bar':
599
-
600
- if ( $value == 'true' || $value === true )
601
- {
602
  $ret = true;
603
- }
604
- elseif ( $value == 'false' || $value === false )
605
- {
606
  $ret = false;
607
- }
608
- else
609
- {
610
  // Unexpected value returned from radio button, go fix the HTML.
611
  // Failover = assign null.
612
  $ret = 'fffffff';
@@ -622,20 +561,18 @@ class Cookie_Law_Info {
622
  case 'button_1_button_colour':
623
  case 'button_2_link_colour':
624
  case 'button_2_button_colour':
625
- case 'button_3_link_colour':
626
- case 'button_3_button_colour':
627
- case 'button_4_link_colour':
628
- case 'button_4_button_colour':
629
  case 'button_7_link_colour':
630
- case 'button_7_button_colour':
631
- if ( preg_match( '/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $value ) )
632
- {
633
  // Was: '/^#([0-9a-fA-F]{1,2}){3}$/i' which allowed e.g. '#00dd' (error)
634
- $ret = $value;
635
- }
636
- else {
637
  // Failover = assign '#000' (black)
638
- $ret = '#000';
639
  }
640
  break;
641
  // Allow some HTML, but no JavaScript. Note that deliberately NOT stripping out line breaks here, that's done when sending JavaScript parameter elsewhere:
@@ -644,62 +581,61 @@ class Cookie_Law_Info {
644
  case 'ccpa_content':
645
  case 'ccpa_gdpr_content':
646
  case 'gdpr_content':
647
- $ret = wp_kses( $value,self::allowed_html(), self::allowed_protocols() );
648
  break;
649
  // URLs only:
650
  case 'button_1_url':
651
  case 'button_2_url':
652
  case 'button_3_url':
653
- case 'button_4_url':
654
- case 'button_7_url':
655
- $ret = esc_url( $value );
656
- break;
657
  // Basic sanitisation for all the rest:
658
  default:
659
  $ret = self::wt_cli_clean( $value );
660
  break;
661
  }
662
- if(('is_eu_on' === $key || 'logging_on' == $key) && 'fffffff' === $ret) $ret = false;
 
 
663
  return $ret;
664
  }
665
- public static function wt_cli_clean( $var ){
666
  if ( is_array( $var ) ) {
667
- return array_map( 'self::wt_cli_clean' , $var );
668
- } else {
669
  return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
670
- }
671
  }
672
- public static function get_non_necessary_cookie_ids()
673
- {
674
-
675
- global $wpdb;
676
- $args = array(
677
- 'post_type' => CLI_POST_TYPE,
678
- 'posts_per_page' => -1,
679
- 'suppress_filters' => false,
680
- 'meta_query' => array(
681
- array(
682
- 'key' => '_cli_cookie_sensitivity',
683
- 'value' => 'non-necessary'
684
- )
685
- )
686
-
687
- );
688
- $posts = get_posts($args);
689
-
690
- if ( !$posts ) {
691
- return;
692
- }
693
- $cookie_slugs = array();
694
-
695
- if($posts){
696
- foreach( $posts as $post )
697
- {
698
- $cookie_slugs[] = get_post_meta( $post->ID, "_cli_cookie_slugid", true);
699
- }
700
- }
701
-
702
- return $cookie_slugs;
703
  }
704
 
705
  /**
@@ -707,93 +643,93 @@ class Cookie_Law_Info {
707
  * By http://www.phpkode.com/source/s/shortcodes-ultimate/shortcodes-ultimate/lib/color.php
708
  * Adapted by Richard Ashby; amended error handling to use failovers not messages, so app continues
709
  *
710
- * @param string $supplied_hex Any valid hex value. Short forms e.g. #333 accepted.
711
- * @param string $shift_method How to shift the value e.g( +,up,lighter,>)
712
  * @param integer $percentage Percentage in range of [0-100] to shift provided hex value by
713
  * @return string shifted hex value
714
  * @version 1.0 2008-03-28
715
  */
716
  public static function su_hex_shift( $supplied_hex, $shift_method, $percentage = 50 ) {
717
- $shifted_hex_value = null;
718
- $valid_shift_option = FALSE;
719
- $current_set = 1;
720
- $RGB_values = array( );
721
- $valid_shift_up_args = array( 'up', '+', 'lighter', '>' );
722
- $valid_shift_down_args = array( 'down', '-', 'darker', '<' );
723
- $shift_method = strtolower( trim( $shift_method ) );
724
-
725
- // Check Factor
726
- if ( !is_numeric( $percentage ) || ($percentage = ( int ) $percentage) < 0 || $percentage > 100 ) {
727
- //trigger_error( "Invalid factor", E_USER_ERROR );
728
- return $supplied_hex;
729
- }
730
-
731
- // Check shift method
732
- foreach ( array( $valid_shift_down_args, $valid_shift_up_args ) as $options ) {
733
- foreach ( $options as $method ) {
734
- if ( $method == $shift_method ) {
735
- $valid_shift_option = !$valid_shift_option;
736
- $shift_method = ( $current_set === 1 ) ? '+' : '-';
737
- break 2;
738
- }
739
- }
740
- ++$current_set;
741
- }
742
-
743
- if ( !$valid_shift_option ) {
744
- //trigger_error( "Invalid shift method", E_USER_ERROR );
745
- return $supplied_hex;
746
- }
747
-
748
- // Check Hex string
749
- switch ( strlen( $supplied_hex = ( str_replace( '#', '', trim( $supplied_hex ) ) ) ) ) {
750
- case 3:
751
- if ( preg_match( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', $supplied_hex ) ) {
752
- $supplied_hex = preg_replace( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', '\\1\\1\\2\\2\\3\\3', $supplied_hex );
753
- } else {
754
- //trigger_error( "Invalid hex color value", E_USER_ERROR );
755
- return $supplied_hex;
756
- }
757
- break;
758
- case 6:
759
- if ( !preg_match( '/^[0-9a-f]{2}[0-9a-f]{2}[0-9a-f]{2}$/i', $supplied_hex ) ) {
760
- //trigger_error( "Invalid hex color value", E_USER_ERROR );
761
- return $supplied_hex;
762
- }
763
- break;
764
- default:
765
- //trigger_error( "Invalid hex color length", E_USER_ERROR );
766
- return $supplied_hex;
767
- }
768
- // Start shifting
769
- $RGB_values['R'] = hexdec( $supplied_hex[0] . $supplied_hex[1] );
770
- $RGB_values['G'] = hexdec( $supplied_hex[2] . $supplied_hex[3] );
771
- $RGB_values['B'] = hexdec( $supplied_hex[4] . $supplied_hex[5] );
772
-
773
- foreach ( $RGB_values as $c => $v ) {
774
- switch ( $shift_method ) {
775
- case '-':
776
- $amount = round( ((255 - $v) / 100) * $percentage ) + $v;
777
- break;
778
- case '+':
779
- $amount = $v - round( ($v / 100) * $percentage );
780
- break;
781
- default:
782
- // trigger_error( "Oops. Unexpected shift method", E_USER_ERROR );
783
- return $supplied_hex;
784
- }
785
-
786
- $shifted_hex_value .= $current_value = (
787
- strlen( $decimal_to_hex = dechex( $amount ) ) < 2
788
- ) ? '0' . $decimal_to_hex : $decimal_to_hex;
789
- }
790
-
791
- return '#' . $shifted_hex_value;
792
  }
793
 
794
  /**
795
  Returns list of HTML tags allowed in HTML fields for use in declaration of wp_kset field validation.
796
-
797
  Deliberately allows class and ID declarations to assist with custom CSS styling.
798
  To customise further, see the excellent article at: http://ottopress.com/2010/wp-quickie-kses/
799
  */
@@ -801,67 +737,66 @@ class Cookie_Law_Info {
801
  $allowed_html = array(
802
  // Allowed: <a href="" id="" class="" title="" target="">...</a>
803
  // Not allowed: <a href="javascript(...);">...</a>
804
- 'a' => array(
805
- 'href' => array(),
806
- 'id' => array(),
807
- 'class' => array(),
808
- 'title' => array(),
809
  'target' => array(),
810
- 'rel' => array(),
811
- 'style' => array()
812
  ),
813
- 'b' => array(),
814
- 'br' => array(
815
- 'id' => array(),
816
  'class' => array(),
817
- 'style' => array()
818
  ),
819
- 'div' => array(
820
- 'id' => array(),
821
  'class' => array(),
822
- 'style' => array()
823
  ),
824
- 'em' => array (
825
- 'id' => array(),
826
  'class' => array(),
827
- 'style' => array()
828
  ),
829
- 'i' => array(),
830
- 'img' => array(
831
- 'src' => array(),
832
- 'id' => array(),
833
  'class' => array(),
834
- 'alt' => array(),
835
- 'style' => array()
836
  ),
837
- 'p' => array (
838
- 'id' => array(),
839
  'class' => array(),
840
- 'style' => array()
841
  ),
842
- 'span' => array(
843
- 'id' => array(),
844
  'class' => array(),
845
- 'style' => array()
846
  ),
847
  'strong' => array(
848
- 'id' => array(),
849
  'class' => array(),
850
- 'style' => array()
851
  ),
852
- 'label' => array(
853
- 'id' => array(),
854
  'class' => array(),
855
- 'style' => array()
856
- )
857
  );
858
- $html5_tags=array('article','section','aside','details','figcaption','figure','footer','header','main','mark','nav','summary','time');
859
- foreach($html5_tags as $html5_tag)
860
- {
861
- $allowed_html[$html5_tag]=array(
862
- 'id' => array(),
863
  'class' => array(),
864
- 'style' => array()
865
  );
866
  }
867
  return $allowed_html;
@@ -875,172 +810,135 @@ class Cookie_Law_Info {
875
  */
876
  public static function allowed_protocols() {
877
  // Additional options: 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'
878
- return array ('http', 'https');
879
  }
880
 
881
 
882
  /**
883
  * Check if GTM is active
884
  **/
885
- public static function cli_is_active_GTM()
886
- {
887
-
888
  if ( in_array( 'duracelltomi-google-tag-manager/duracelltomi-google-tag-manager-for-wordpress.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
889
- return true;
890
  }
891
  }
892
- public static function cli_get_client_ip()
893
- {
894
-
895
- $ipaddress = '';
896
- if (isset($_SERVER['HTTP_CLIENT_IP']))
897
- $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
898
- else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
899
- $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
900
- else if (isset($_SERVER['HTTP_X_FORWARDED']))
901
- $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
902
- else if (isset($_SERVER['HTTP_FORWARDED_FOR']))
903
- $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
904
- else if (isset($_SERVER['HTTP_FORWARDED']))
905
- $ipaddress = $_SERVER['HTTP_FORWARDED'];
906
- else if (isset($_SERVER['REMOTE_ADDR']))
907
- $ipaddress = $_SERVER['REMOTE_ADDR'];
908
- else
909
- $ipaddress = 'UNKNOWN';
910
- return $ipaddress;
911
- }
912
-
913
- /*
914
  *
915
  * Patch script while updating versions
916
- */
917
- public static function cli_patches()
918
- {
919
- $options=self::get_settings();
920
-
921
- //========bar as widget=========@since 1.7.1
922
- if($options['cookie_bar_as']=='banner' && $options['as_popup']==true) //the site in popup mode
923
- {
924
- $options['cookie_bar_as']='popup';
925
- $options['as_popup']=false;
926
- $options['popup_showagain_position']=$options['notify_position_vertical'].'-'.$options['notify_position_horizontal'];
927
- update_option( CLI_SETTINGS_FIELD,$options);
928
  }
929
 
930
-
931
-
932
- //========reject button missing issue=========@since 1.6.7
933
- $message_bar_text=$options['notify_message'];
934
- //user turned on the reject button with his previous settings
935
- if(isset($options['is_reject_on']) && $options['is_reject_on']==true)
936
- {
937
- if(strpos($message_bar_text,'cookie_reject')===false) //user not manualy inserted the code
938
- {
939
- $pattern = get_shortcode_regex();
940
- if(preg_match_all ('/'. $pattern .'/s',$message_bar_text, $matches))
941
- {
942
- $shortcode_arr=$matches[0];
943
- foreach($shortcode_arr as $shrtcode)
944
- {
945
- if(strpos($shrtcode,'cookie_button')!==false)
946
- {
947
-
948
- $options['notify_message']=str_replace($shrtcode,$shrtcode.' [cookie_reject]',$message_bar_text);
949
- $options['is_reject_on']=false;
950
- update_option( CLI_SETTINGS_FIELD, $options );
951
- break;
952
- }
953
- }
954
- }
955
- }else
956
- {
957
- $options['is_reject_on']=false;
958
- update_option( CLI_SETTINGS_FIELD, $options );
959
- }
960
- }
961
- //---------reject button missing issue------------
962
-
963
- //bar heading text issue @since 1.6.7
964
- $bar_version='1.6.6';
965
- $bar_heading_version = get_option('cli_heading_version');
966
- if($bar_heading_version!=$bar_version)
967
- {
968
- if(isset($options['bar_heading_text']) && $options['bar_heading_text']=='This website uses cookies')
969
- {
970
- $options['bar_heading_text']='';
971
- update_option( CLI_SETTINGS_FIELD, $options );
972
- update_option('cli_heading_version', $bar_version);
973
- }
974
- }
975
  }
976
  /**
977
- * Check whether JS blocking is active or not
978
- *
979
- * @since 1.8.9
980
- * @return bool
981
- */
982
  public static function wt_cli_is_js_blocking_active() {
983
 
984
  $js_blocking_enabled = false;
985
- $js_option = self::get_js_option();
986
- if( $js_option === true && !self::is_divi_enabled() ) {
987
  $js_blocking_enabled = true;
988
- }
989
- return apply_filters('wt_cli_enable_js_blocking',$js_blocking_enabled);
990
  }
991
  /**
992
- * JS blocker will be disabled by default for existing customer
993
- *
994
- * @since 1.8.9
995
- * @return bool
996
- */
997
- public static function check_for_upgrade()
998
- {
999
- $plugin_settings = get_option(CLI_SETTINGS_FIELD);
1000
- if( $plugin_settings === false ) {
1001
-
1002
- $transient_value = get_transient('_wt_cli_first_time_activation');
1003
- if( $transient_value === false ) {
1004
- set_transient('_wt_cli_first_time_activation', true, 30);
1005
  }
1006
  return true;
1007
  }
1008
  return false;
1009
  }
1010
- public static function maybe_first_time_install()
1011
- {
1012
- $maybe_first_time = false;
1013
- $activation_transient = wp_validate_boolean( get_transient('_wt_cli_first_time_activation') );
1014
- if( $activation_transient === true ) {
1015
  $maybe_first_time = true;
1016
  }
1017
  return $maybe_first_time;
1018
  }
1019
  /**
1020
- * Return js options
1021
- *
1022
- * @since 1.8.9
1023
- * @return bool,string
1024
- */
1025
  public static function get_js_option() {
1026
 
1027
  $js_option = false;
1028
  $js_option = get_option( 'cookielawinfo_js_blocking' );
1029
- if( isset( $js_option ) && $js_option === 'yes') {
1030
  return true;
1031
  }
1032
  return false;
1033
  }
1034
 
1035
  /**
1036
- * Check whether DIVI builder is active or not
1037
- *
1038
- * @since 2.0.4
1039
- * @return bool
1040
- */
1041
  public static function is_divi_enabled() {
1042
 
1043
- return isset($_GET['et_fb']) ? true : false;
1044
  }
1045
-
1046
- }
57
  */
58
  protected $version;
59
 
60
+ private static $stored_options = array();
61
  protected $js_blocking_enabled = false;
62
 
63
  /**
70
  * @since 1.6.6
71
  */
72
  public static $db_initial_version = '1.9.4';
73
+ public function __construct() {
74
+ if ( defined( 'CLI_VERSION' ) ) {
 
 
75
  $this->version = CLI_VERSION;
76
+ } else {
77
+ $this->version = '2.1.0';
 
 
78
  }
79
  $this->plugin_name = 'cookie-law-info';
80
 
83
  $this->define_admin_hooks();
84
  $this->define_public_hooks();
85
  $this->define_thrid_party_hooks();
86
+
87
  }
88
 
89
  /**
109
  * core plugin.
110
  */
111
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-loader.php';
112
+
 
 
 
 
 
 
 
113
  /**
114
  * The class which integrates Cookieyes services to the plugin
115
  */
116
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-cookieyes.php';
 
117
 
118
  /**
119
  * The class responsible for defining internationalization functionality
131
  * The class which integrates Cookieyes services to the plugin
132
  */
133
  // require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-cookieyes.php';
134
+
135
  /**
136
  * The class responsible for defining all actions that occur in the admin area.
137
  */
143
  */
144
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-cookie-law-info-public.php';
145
 
 
146
  /**
147
  * The class responsible for adding compatibility to third party plugins
 
148
  */
149
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'third-party/class-cookie-law-info-third-party.php';
150
 
151
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-cookie-law-info-review-request.php';
152
 
153
  $this->loader = new Cookie_Law_Info_Loader();
154
 
180
  */
181
  private function define_admin_hooks() {
182
 
183
+ $plugin_admin = new Cookie_Law_Info_Admin( $this->get_plugin_name(), $this->get_version(), $this );
184
+
185
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_menu', 11 ); /* Adding admin menu */
186
 
187
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'remove_cli_addnew_link' );
 
 
 
 
188
 
189
  // Add plugin settings link:
190
+ add_filter( 'plugin_action_links_' . plugin_basename( CLI_PLUGIN_FILENAME ), array( $plugin_admin, 'plugin_action_links' ) );
191
 
192
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
193
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
194
 
195
+ /*
196
+ .
197
  * loading admin modules
198
  */
199
  $plugin_admin->admin_modules();
200
+
201
  }
202
 
203
  /**
207
  * @since 1.6.6
208
  * @access private
209
  */
210
+ private function define_public_hooks() {
211
+ $plugin_public = new Cookie_Law_Info_Public( $this->get_plugin_name(), $this->get_version(), $this );
 
212
 
213
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
214
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
215
+ $this->loader->add_action( 'template_redirect', $plugin_public, 'cli_set_category_cookies' );
216
 
217
  $plugin_public->common_modules();
218
+
219
+ $this->loader->add_action( 'wp_footer', $plugin_public, 'cookielawinfo_inject_cli_script' );
220
+ $this->loader->add_action( 'wp_head', $plugin_public, 'include_user_accepted_cookielawinfo' );
221
+ $this->loader->add_action( 'wp_footer', $plugin_public, 'include_user_accepted_cookielawinfo_in_body' );
222
  }
223
 
224
 
229
  * @since 1.7.2
230
  * @access public
231
  */
232
+ public function define_thrid_party_hooks() {
 
233
  $plugin_third_party = new Cookie_Law_Info_Third_Party();
234
  $plugin_third_party->register_scripts();
235
  }
236
+
237
 
238
  /**
239
  * Run the loader to execute all of the hooks with WordPress.
277
 
278
  /**
279
  * Get current settings.
 
280
  */
281
+ public static function get_settings() {
282
+ $settings = self::get_default_settings();
283
+ self::$stored_options = get_option( CLI_SETTINGS_FIELD );
284
+ if ( ! empty( self::$stored_options ) ) {
285
+ foreach ( self::$stored_options as $key => $option ) {
286
+ $settings[ $key ] = self::sanitise_settings( $key, $option );
 
 
 
287
  }
288
  }
289
  return $settings;
293
  * Generate tab head for settings page.
294
  * method will translate the string to current language
295
  */
296
+ public static function generate_settings_tabhead( $title_arr ) {
297
+ $out_arr = array();
298
+ foreach ( $title_arr as $k => $v ) {
299
+ if ( $k == 'cookie-law-info-buttons' ) {
300
+ $out_arr[ $k ] = $v;
301
+ // tab head for modules
302
+ $out_arr = apply_filters( 'cli_module_settings_tabhead', $out_arr );
303
+ } else {
304
+ $out_arr[ $k ] = $v;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  }
 
 
 
306
  }
307
+ foreach ( $out_arr as $k => $v ) {
308
+ if ( is_array( $v ) ) {
309
+ $v = ( isset( $v[2] ) ? $v[2] : '' ) . __( $v[0], 'cookie-law-info' ) . ' ' . ( isset( $v[1] ) ? $v[1] : '' );
310
+ } else {
311
+ $v = __( $v, 'cookie-law-info' );
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
  ?>
314
+ <a class="nav-tab" href="#<?php echo esc_attr( $k ); ?>"><?php echo esc_html( $v ); ?></a>
315
+ <?php
316
+ }
317
  }
 
318
  /**
319
  Returns default settings
320
  If you override the settings here, be ultra careful to use escape characters!
321
  */
322
+ public static function get_default_settings( $key = '' ) {
 
323
  $settings_v0_9 = array(
324
+ 'animate_speed_hide' => '500',
325
+ 'animate_speed_show' => '500',
326
+ 'background' => '#FFF',
327
+ 'background_url' => '',
328
+ 'border' => '#b1a6a6c2',
329
+ 'border_on' => true,
330
+ 'bar_style' => array(),
331
+ 'button_1_text' => 'Accept',
332
+ 'button_1_url' => '#',
333
+ 'button_1_action' => '#cookie_action_close_header',
334
+ 'button_1_link_colour' => '#fff',
335
+ 'button_1_new_win' => false,
336
+ 'button_1_as_button' => true,
337
+ 'button_1_button_colour' => '#61a229',
338
+ 'button_1_button_size' => 'medium',
339
+ 'button_1_style' => array(),
340
+
341
+ 'button_2_text' => 'Read More',
342
+ 'button_2_url' => get_site_url(),
343
+ 'button_2_action' => 'CONSTANT_OPEN_URL',
344
+ 'button_2_link_colour' => '#444',
345
+ 'button_2_new_win' => true,
346
+ 'button_2_as_button' => false,
347
+ 'button_2_button_colour' => '#333',
348
+ 'button_2_button_size' => 'medium',
349
+ 'button_2_url_type' => 'url',
350
+ 'button_2_page' => get_option( 'wp_page_for_privacy_policy' ) ? get_option( 'wp_page_for_privacy_policy' ) : 0,
351
+ 'button_2_hidebar' => false,
352
+ 'button_2_style' => array(),
353
+
354
+ 'button_3_text' => 'Reject All',
355
+ 'button_3_url' => '#',
356
+ 'button_3_action' => '#cookie_action_close_header_reject',
357
+ 'button_3_link_colour' => '#333333',
358
+ 'button_3_new_win' => false,
359
+ 'button_3_as_button' => true,
360
+ 'button_3_button_colour' => '#dedfe0',
361
+ 'button_3_button_size' => 'medium',
362
+ 'button_3_style' => array(),
363
+
364
+ 'button_4_text' => 'Cookie Settings',
365
+ 'button_4_url' => '#',
366
+ 'button_4_action' => '#cookie_action_settings',
367
+ 'button_4_link_colour' => '#333333',
368
+ 'button_4_new_win' => false,
369
+ 'button_4_as_button' => true,
370
+ 'button_4_button_colour' => '#dedfe0',
371
+ 'button_4_button_size' => 'medium',
372
+ 'button_4_style' => array(),
373
+ 'button_5_style' => array(),
374
+ 'button_7_text' => 'Accept All',
375
+ 'button_7_url' => '#',
376
+ 'button_7_action' => '#cookie_action_close_header',
377
+ 'button_7_link_colour' => '#fff',
378
+ 'button_7_new_win' => false,
379
+ 'button_7_as_button' => true,
380
+ 'button_7_button_colour' => '#61a229',
381
+ 'button_7_button_size' => 'medium',
382
+ 'button_7_style' => array(),
383
+
384
+ 'font_family' => 'inherit', // Pick the family, not the easy name (see helper function below)
385
+ 'header_fix' => false,
386
+ 'is_on' => true,
387
+ 'is_eu_on' => false,
388
+ 'logging_on' => false,
389
+ 'notify_animate_hide' => true,
390
+ 'notify_animate_show' => false,
391
+ 'notify_div_id' => '#cookie-law-info-bar',
392
+ 'notify_position_horizontal' => 'right', // left | right
393
+ 'notify_position_vertical' => 'bottom', // 'top' = header | 'bottom' = footer
394
+ 'notify_message' => addslashes( '<div class="cli-bar-container cli-style-v2"><div class="cli-bar-message">We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.</div><div class="cli-bar-btn_container">[cookie_settings margin="0px 5px 0px 0px"][cookie_accept_all]</div></div>' ),
395
+ 'scroll_close' => false,
396
+ 'scroll_close_reload' => false,
397
+ 'accept_close_reload' => false,
398
+ 'reject_close_reload' => false,
399
+ 'showagain_background' => '#fff',
400
+ 'showagain_border' => '#000',
401
+ 'showagain_text' => addslashes( 'Manage consent' ),
402
+ 'showagain_div_id' => '#cookie-law-info-again',
403
+ 'showagain_tab' => false,
404
+ 'showagain_x_position' => '100px',
405
+ 'text' => '#333333',
406
+ 'use_colour_picker' => true,
407
+ 'show_once_yn' => false, // this is a new feature so default = switched off
408
+ 'show_once' => '10000', // 8 seconds
409
+ 'is_GMT_on' => true,
410
+ 'as_popup' => false, // version 1.7.1 onwards this option is merged with `cookie_bar_as`
411
+ 'popup_overlay' => true,
412
+ 'bar_heading_text' => '',
413
+ 'cookie_bar_as' => 'banner',
414
+ 'popup_showagain_position' => 'bottom-right', // bottom-right | bottom-left | top-right | top-left
415
+ 'widget_position' => 'left', // left | right
 
416
  );
417
+ $settings_v0_9 = apply_filters( 'wt_cli_plugin_settings', $settings_v0_9 );
418
+ return $key != '' ? $settings_v0_9[ $key ] : $settings_v0_9;
419
  }
420
 
421
  /**
422
  Returns JSON object containing the settings for the main script
423
  REFACTOR / DEBUG: may need to use addslashes( ... ) else breaks JSON
424
  */
425
+ public static function get_json_settings() {
426
+ $settings = self::get_settings();
427
+
428
+ // DEBUG hex:
429
+ // preg_match('/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $hex)
430
+ // DEBUG json_encode - issues across different versions of PHP!
431
+ // $str = json_encode( $slim_settings, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP );
432
+
433
+ // Slim down JSON objects to the bare bones:
434
+ $slim_settings = array(
435
+ 'animate_speed_hide' => $settings['animate_speed_hide'],
436
+ 'animate_speed_show' => $settings['animate_speed_show'],
437
+ 'background' => $settings['background'],
438
+ 'border' => $settings['border'],
439
+ 'border_on' => false, // $settings['border_on'],
440
+ 'button_1_button_colour' => $settings['button_1_button_colour'],
441
+ 'button_1_button_hover' => ( self::su_hex_shift( $settings['button_1_button_colour'], 'down', 20 ) ),
442
+ 'button_1_link_colour' => $settings['button_1_link_colour'],
443
+ 'button_1_as_button' => $settings['button_1_as_button'],
444
+ 'button_1_new_win' => $settings['button_1_new_win'],
445
+ 'button_2_button_colour' => $settings['button_2_button_colour'],
446
+ 'button_2_button_hover' => ( self::su_hex_shift( $settings['button_2_button_colour'], 'down', 20 ) ),
447
+ 'button_2_link_colour' => $settings['button_2_link_colour'],
448
+ 'button_2_as_button' => $settings['button_2_as_button'],
449
+ 'button_2_hidebar' => $settings['button_2_hidebar'],
450
+ 'button_3_button_colour' => $settings['button_3_button_colour'],
451
+ 'button_3_button_hover' => ( self::su_hex_shift( $settings['button_3_button_colour'], 'down', 20 ) ),
452
+ 'button_3_link_colour' => $settings['button_3_link_colour'],
453
+ 'button_3_as_button' => $settings['button_3_as_button'],
454
+ 'button_3_new_win' => $settings['button_3_new_win'],
455
+ 'button_4_button_colour' => $settings['button_4_button_colour'],
456
+ 'button_4_button_hover' => ( self::su_hex_shift( $settings['button_4_button_colour'], 'down', 20 ) ),
457
+ 'button_4_link_colour' => $settings['button_4_link_colour'],
458
+ 'button_4_as_button' => $settings['button_4_as_button'],
459
+ 'button_7_button_colour' => $settings['button_7_button_colour'],
460
+ 'button_7_button_hover' => ( self::su_hex_shift( $settings['button_7_button_colour'], 'down', 20 ) ),
461
+ 'button_7_link_colour' => $settings['button_7_link_colour'],
462
+ 'button_7_as_button' => $settings['button_7_as_button'],
463
+ 'button_7_new_win' => $settings['button_7_new_win'],
464
+ 'font_family' => $settings['font_family'],
465
+ 'header_fix' => $settings['header_fix'],
466
+ 'notify_animate_hide' => $settings['notify_animate_hide'],
467
+ 'notify_animate_show' => $settings['notify_animate_show'],
468
+ 'notify_div_id' => $settings['notify_div_id'],
469
+ 'notify_position_horizontal' => $settings['notify_position_horizontal'],
470
+ 'notify_position_vertical' => $settings['notify_position_vertical'],
471
+ 'scroll_close' => $settings['scroll_close'],
472
+ 'scroll_close_reload' => $settings['scroll_close_reload'],
473
+ 'accept_close_reload' => $settings['accept_close_reload'],
474
+ 'reject_close_reload' => $settings['reject_close_reload'],
475
+ 'showagain_tab' => $settings['showagain_tab'],
476
+ 'showagain_background' => $settings['showagain_background'],
477
+ 'showagain_border' => $settings['showagain_border'],
478
+ 'showagain_div_id' => $settings['showagain_div_id'],
479
+ 'showagain_x_position' => $settings['showagain_x_position'],
480
+ 'text' => $settings['text'],
481
+ 'show_once_yn' => $settings['show_once_yn'],
482
+ 'show_once' => $settings['show_once'],
483
+ 'logging_on' => $settings['logging_on'],
484
+ 'as_popup' => $settings['as_popup'],
485
+ 'popup_overlay' => $settings['popup_overlay'],
486
+ 'bar_heading_text' => $settings['bar_heading_text'],
487
+ 'cookie_bar_as' => $settings['cookie_bar_as'],
488
+ 'popup_showagain_position' => $settings['popup_showagain_position'],
489
+ 'widget_position' => $settings['widget_position'],
490
+ );
491
+ // $str = json_encode( $slim_settings );
492
+ /*
493
+ DEBUG:
494
+ if ( $str == null | $str == '') {
495
+ $str = 'error: json is empty';
496
+ }
497
+ */
498
+ return $slim_settings;
 
499
  }
500
 
501
  /**
502
+ Returns sanitised content based on field-specific rules defined here
503
  Used for both read AND write operations
504
  */
505
+ public static function sanitise_settings( $key, $value ) {
506
+ $ret = null;
507
+ switch ( $key ) {
 
508
  // Convert all boolean values from text to bool:
509
  case 'is_on':
510
  case 'is_reject_on':
511
+ case 'is_eu_on':
512
+ case 'logging_on':
513
  case 'border_on':
514
  case 'notify_animate_show':
515
  case 'notify_animate_hide':
520
  case 'button_2_new_win':
521
  case 'button_2_as_button':
522
  case 'button_2_hidebar':
523
+ case 'button_3_new_win':
524
  case 'button_3_as_button':
525
+ case 'button_4_new_win':
526
  case 'button_4_as_button':
527
  case 'button_7_new_win':
528
  case 'button_7_as_button':
529
  case 'scroll_close':
530
  case 'scroll_close_reload':
531
+ case 'accept_close_reload':
532
+ case 'reject_close_reload':
533
  case 'show_once_yn':
534
  case 'header_fix':
535
  case 'is_GMT_on':
541
  case 'button_6_as_link':
542
  case 'ccpa_region_based':
543
  case 'ccpa_enable_bar':
544
+ if ( $value == 'true' || $value === true ) {
 
 
545
  $ret = true;
546
+ } elseif ( $value == 'false' || $value === false ) {
 
 
547
  $ret = false;
548
+ } else {
 
 
549
  // Unexpected value returned from radio button, go fix the HTML.
550
  // Failover = assign null.
551
  $ret = 'fffffff';
561
  case 'button_1_button_colour':
562
  case 'button_2_link_colour':
563
  case 'button_2_button_colour':
564
+ case 'button_3_link_colour':
565
+ case 'button_3_button_colour':
566
+ case 'button_4_link_colour':
567
+ case 'button_4_button_colour':
568
  case 'button_7_link_colour':
569
+ case 'button_7_button_colour':
570
+ if ( preg_match( '/^#[a-f0-9]{6}|#[a-f0-9]{3}$/i', $value ) ) {
 
571
  // Was: '/^#([0-9a-fA-F]{1,2}){3}$/i' which allowed e.g. '#00dd' (error)
572
+ $ret = $value;
573
+ } else {
 
574
  // Failover = assign '#000' (black)
575
+ $ret = '#000';
576
  }
577
  break;
578
  // Allow some HTML, but no JavaScript. Note that deliberately NOT stripping out line breaks here, that's done when sending JavaScript parameter elsewhere:
581
  case 'ccpa_content':
582
  case 'ccpa_gdpr_content':
583
  case 'gdpr_content':
584
+ $ret = wp_kses( $value, self::allowed_html(), self::allowed_protocols() );
585
  break;
586
  // URLs only:
587
  case 'button_1_url':
588
  case 'button_2_url':
589
  case 'button_3_url':
590
+ case 'button_4_url':
591
+ case 'button_7_url':
592
+ $ret = esc_url( $value );
593
+ break;
594
  // Basic sanitisation for all the rest:
595
  default:
596
  $ret = self::wt_cli_clean( $value );
597
  break;
598
  }
599
+ if ( ( 'is_eu_on' === $key || 'logging_on' == $key ) && 'fffffff' === $ret ) {
600
+ $ret = false;
601
+ }
602
  return $ret;
603
  }
604
+ public static function wt_cli_clean( $var ) {
605
  if ( is_array( $var ) ) {
606
+ return array_map( 'self::wt_cli_clean', $var );
607
+ } else {
608
  return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
609
+ }
610
  }
611
+ public static function get_non_necessary_cookie_ids() {
612
+ global $wpdb;
613
+ $args = array(
614
+ 'post_type' => CLI_POST_TYPE,
615
+ 'posts_per_page' => -1,
616
+ 'suppress_filters' => false,
617
+ 'meta_query' => array(
618
+ array(
619
+ 'key' => '_cli_cookie_sensitivity',
620
+ 'value' => 'non-necessary',
621
+ ),
622
+ ),
623
+
624
+ );
625
+ $posts = get_posts( $args );
626
+
627
+ if ( ! $posts ) {
628
+ return;
629
+ }
630
+ $cookie_slugs = array();
631
+
632
+ if ( $posts ) {
633
+ foreach ( $posts as $post ) {
634
+ $cookie_slugs[] = get_post_meta( $post->ID, '_cli_cookie_slugid', true );
635
+ }
636
+ }
637
+
638
+ return $cookie_slugs;
 
 
 
639
  }
640
 
641
  /**
643
  * By http://www.phpkode.com/source/s/shortcodes-ultimate/shortcodes-ultimate/lib/color.php
644
  * Adapted by Richard Ashby; amended error handling to use failovers not messages, so app continues
645
  *
646
+ * @param string $supplied_hex Any valid hex value. Short forms e.g. #333 accepted.
647
+ * @param string $shift_method How to shift the value e.g( +,up,lighter,>)
648
  * @param integer $percentage Percentage in range of [0-100] to shift provided hex value by
649
  * @return string shifted hex value
650
  * @version 1.0 2008-03-28
651
  */
652
  public static function su_hex_shift( $supplied_hex, $shift_method, $percentage = 50 ) {
653
+ $shifted_hex_value = null;
654
+ $valid_shift_option = false;
655
+ $current_set = 1;
656
+ $RGB_values = array();
657
+ $valid_shift_up_args = array( 'up', '+', 'lighter', '>' );
658
+ $valid_shift_down_args = array( 'down', '-', 'darker', '<' );
659
+ $shift_method = strtolower( trim( $shift_method ) );
660
+
661
+ // Check Factor
662
+ if ( ! is_numeric( $percentage ) || ( $percentage = (int) $percentage ) < 0 || $percentage > 100 ) {
663
+ // trigger_error( "Invalid factor", E_USER_ERROR );
664
+ return $supplied_hex;
665
+ }
666
+
667
+ // Check shift method
668
+ foreach ( array( $valid_shift_down_args, $valid_shift_up_args ) as $options ) {
669
+ foreach ( $options as $method ) {
670
+ if ( $method == $shift_method ) {
671
+ $valid_shift_option = ! $valid_shift_option;
672
+ $shift_method = ( $current_set === 1 ) ? '+' : '-';
673
+ break 2;
674
+ }
675
+ }
676
+ ++$current_set;
677
+ }
678
+
679
+ if ( ! $valid_shift_option ) {
680
+ // trigger_error( "Invalid shift method", E_USER_ERROR );
681
+ return $supplied_hex;
682
+ }
683
+
684
+ // Check Hex string
685
+ switch ( strlen( $supplied_hex = ( str_replace( '#', '', trim( $supplied_hex ) ) ) ) ) {
686
+ case 3:
687
+ if ( preg_match( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', $supplied_hex ) ) {
688
+ $supplied_hex = preg_replace( '/^([0-9a-f])([0-9a-f])([0-9a-f])/i', '\\1\\1\\2\\2\\3\\3', $supplied_hex );
689
+ } else {
690
+ // trigger_error( "Invalid hex color value", E_USER_ERROR );
691
+ return $supplied_hex;
692
+ }
693
+ break;
694
+ case 6:
695
+ if ( ! preg_match( '/^[0-9a-f]{2}[0-9a-f]{2}[0-9a-f]{2}$/i', $supplied_hex ) ) {
696
+ // trigger_error( "Invalid hex color value", E_USER_ERROR );
697
+ return $supplied_hex;
698
+ }
699
+ break;
700
+ default:
701
+ // trigger_error( "Invalid hex color length", E_USER_ERROR );
702
+ return $supplied_hex;
703
+ }
704
+ // Start shifting
705
+ $RGB_values['R'] = hexdec( $supplied_hex[0] . $supplied_hex[1] );
706
+ $RGB_values['G'] = hexdec( $supplied_hex[2] . $supplied_hex[3] );
707
+ $RGB_values['B'] = hexdec( $supplied_hex[4] . $supplied_hex[5] );
708
+
709
+ foreach ( $RGB_values as $c => $v ) {
710
+ switch ( $shift_method ) {
711
+ case '-':
712
+ $amount = round( ( ( 255 - $v ) / 100 ) * $percentage ) + $v;
713
+ break;
714
+ case '+':
715
+ $amount = $v - round( ( $v / 100 ) * $percentage );
716
+ break;
717
+ default:
718
+ // trigger_error( "Oops. Unexpected shift method", E_USER_ERROR );
719
+ return $supplied_hex;
720
+ }
721
+
722
+ $shifted_hex_value .= $current_value = (
723
+ strlen( $decimal_to_hex = dechex( $amount ) ) < 2
724
+ ) ? '0' . $decimal_to_hex : $decimal_to_hex;
725
+ }
726
+
727
+ return '#' . $shifted_hex_value;
728
  }
729
 
730
  /**
731
  Returns list of HTML tags allowed in HTML fields for use in declaration of wp_kset field validation.
732
+
733
  Deliberately allows class and ID declarations to assist with custom CSS styling.
734
  To customise further, see the excellent article at: http://ottopress.com/2010/wp-quickie-kses/
735
  */
737
  $allowed_html = array(
738
  // Allowed: <a href="" id="" class="" title="" target="">...</a>
739
  // Not allowed: <a href="javascript(...);">...</a>
740
+ 'a' => array(
741
+ 'href' => array(),
742
+ 'id' => array(),
743
+ 'class' => array(),
744
+ 'title' => array(),
745
  'target' => array(),
746
+ 'rel' => array(),
747
+ 'style' => array(),
748
  ),
749
+ 'b' => array(),
750
+ 'br' => array(
751
+ 'id' => array(),
752
  'class' => array(),
753
+ 'style' => array(),
754
  ),
755
+ 'div' => array(
756
+ 'id' => array(),
757
  'class' => array(),
758
+ 'style' => array(),
759
  ),
760
+ 'em' => array(
761
+ 'id' => array(),
762
  'class' => array(),
763
+ 'style' => array(),
764
  ),
765
+ 'i' => array(),
766
+ 'img' => array(
767
+ 'src' => array(),
768
+ 'id' => array(),
769
  'class' => array(),
770
+ 'alt' => array(),
771
+ 'style' => array(),
772
  ),
773
+ 'p' => array(
774
+ 'id' => array(),
775
  'class' => array(),
776
+ 'style' => array(),
777
  ),
778
+ 'span' => array(
779
+ 'id' => array(),
780
  'class' => array(),
781
+ 'style' => array(),
782
  ),
783
  'strong' => array(
784
+ 'id' => array(),
785
  'class' => array(),
786
+ 'style' => array(),
787
  ),
788
+ 'label' => array(
789
+ 'id' => array(),
790
  'class' => array(),
791
+ 'style' => array(),
792
+ ),
793
  );
794
+ $html5_tags = array( 'article', 'section', 'aside', 'details', 'figcaption', 'figure', 'footer', 'header', 'main', 'mark', 'nav', 'summary', 'time' );
795
+ foreach ( $html5_tags as $html5_tag ) {
796
+ $allowed_html[ $html5_tag ] = array(
797
+ 'id' => array(),
 
798
  'class' => array(),
799
+ 'style' => array(),
800
  );
801
  }
802
  return $allowed_html;
810
  */
811
  public static function allowed_protocols() {
812
  // Additional options: 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'
813
+ return array( 'http', 'https' );
814
  }
815
 
816
 
817
  /**
818
  * Check if GTM is active
819
  **/
820
+ public static function cli_is_active_GTM() {
 
 
821
  if ( in_array( 'duracelltomi-google-tag-manager/duracelltomi-google-tag-manager-for-wordpress.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
822
+ return true;
823
  }
824
  }
825
+ /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  *
827
  * Patch script while updating versions
828
+ */
829
+ public static function cli_patches() {
830
+ $options = self::get_settings();
831
+
832
+ // ========bar as widget=========@since 1.7.1
833
+ if ( $options['cookie_bar_as'] == 'banner' && $options['as_popup'] == true ) {
834
+ $options['cookie_bar_as'] = 'popup';
835
+ $options['as_popup'] = false;
836
+ $options['popup_showagain_position'] = $options['notify_position_vertical'] . '-' . $options['notify_position_horizontal'];
837
+ update_option( CLI_SETTINGS_FIELD, $options );
 
 
838
  }
839
 
840
+ // ========reject button missing issue=========@since 1.6.7
841
+ $message_bar_text = $options['notify_message'];
842
+ // user turned on the reject button with his previous settings
843
+ if ( isset( $options['is_reject_on'] ) && $options['is_reject_on'] == true ) {
844
+ if ( strpos( $message_bar_text, 'cookie_reject' ) === false ) {
845
+ $pattern = get_shortcode_regex();
846
+ if ( preg_match_all( '/' . $pattern . '/s', $message_bar_text, $matches ) ) {
847
+ $shortcode_arr = $matches[0];
848
+ foreach ( $shortcode_arr as $shrtcode ) {
849
+ if ( strpos( $shrtcode, 'cookie_button' ) !== false ) {
850
+
851
+ $options['notify_message'] = str_replace( $shrtcode, $shrtcode . ' [cookie_reject]', $message_bar_text );
852
+ $options['is_reject_on'] = false;
853
+ update_option( CLI_SETTINGS_FIELD, $options );
854
+ break;
855
+ }
856
+ }
857
+ }
858
+ } else {
859
+ $options['is_reject_on'] = false;
860
+ update_option( CLI_SETTINGS_FIELD, $options );
861
+ }
862
+ }
863
+ // ---------reject button missing issue------------
864
+
865
+ // bar heading text issue @since 1.6.7
866
+ $bar_version = '1.6.6';
867
+ $bar_heading_version = get_option( 'cli_heading_version' );
868
+ if ( $bar_heading_version != $bar_version ) {
869
+ if ( isset( $options['bar_heading_text'] ) && $options['bar_heading_text'] == 'This website uses cookies' ) {
870
+ $options['bar_heading_text'] = '';
871
+ update_option( CLI_SETTINGS_FIELD, $options );
872
+ update_option( 'cli_heading_version', $bar_version );
873
+ }
874
+ }
 
 
 
 
 
 
 
 
 
 
875
  }
876
  /**
877
+ * Check whether JS blocking is active or not
878
+ *
879
+ * @since 1.8.9
880
+ * @return bool
881
+ */
882
  public static function wt_cli_is_js_blocking_active() {
883
 
884
  $js_blocking_enabled = false;
885
+ $js_option = self::get_js_option();
886
+ if ( $js_option === true && ! self::is_divi_enabled() ) {
887
  $js_blocking_enabled = true;
888
+ }
889
+ return apply_filters( 'wt_cli_enable_js_blocking', $js_blocking_enabled );
890
  }
891
  /**
892
+ * JS blocker will be disabled by default for existing customer
893
+ *
894
+ * @since 1.8.9
895
+ * @return bool
896
+ */
897
+ public static function check_for_upgrade() {
898
+ $plugin_settings = get_option( CLI_SETTINGS_FIELD );
899
+ if ( $plugin_settings === false ) {
900
+
901
+ $transient_value = get_transient( '_wt_cli_first_time_activation' );
902
+ if ( $transient_value === false ) {
903
+ set_transient( '_wt_cli_first_time_activation', true, 30 );
 
904
  }
905
  return true;
906
  }
907
  return false;
908
  }
909
+ public static function maybe_first_time_install() {
910
+ $maybe_first_time = false;
911
+ $activation_transient = wp_validate_boolean( get_transient( '_wt_cli_first_time_activation' ) );
912
+ if ( $activation_transient === true ) {
 
913
  $maybe_first_time = true;
914
  }
915
  return $maybe_first_time;
916
  }
917
  /**
918
+ * Return js options
919
+ *
920
+ * @since 1.8.9
921
+ * @return bool,string
922
+ */
923
  public static function get_js_option() {
924
 
925
  $js_option = false;
926
  $js_option = get_option( 'cookielawinfo_js_blocking' );
927
+ if ( isset( $js_option ) && $js_option === 'yes' ) {
928
  return true;
929
  }
930
  return false;
931
  }
932
 
933
  /**
934
+ * Check whether DIVI builder is active or not
935
+ *
936
+ * @since 2.0.4
937
+ * @return bool
938
+ */
939
  public static function is_divi_enabled() {
940
 
941
+ return isset( $_GET['et_fb'] ) ? true : false;
942
  }
943
+
944
+ }
includes/class-wt-security-helper.php DELETED
@@ -1,179 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Webtoffee Security Library
5
- *
6
- * Includes Data sanitization, Access checking
7
- * @author WebToffee <info@webtoffee.com>
8
- */
9
-
10
- if(!class_exists('Wt_Security_Helper'))
11
- {
12
-
13
- class Wt_Cookie_Law_Info_Security_Helper
14
- {
15
-
16
- /**
17
- * Data sanitization function.
18
- *
19
- * @param mixed $val value to sanitize
20
- * @param string $key array key in the validation rule
21
- * @param array $validation_rule array of validation rules. Eg: array('field_key' => array('type' => 'textarea'))
22
- * @return mixed sanitized value
23
- */
24
- public static function sanitize_data($val, $key, $validation_rule = array())
25
- {
26
- if(isset($validation_rule[$key]) && is_array($validation_rule[$key])) /* rule declared/exists */
27
- {
28
- if(isset($validation_rule[$key]['type']))
29
- {
30
- $val = self::sanitize_item($val, $validation_rule[$key]['type']);
31
- }
32
- }else //if no rule is specified then it will be treated as text
33
- {
34
- $val = self::sanitize_item($val, 'text');
35
- }
36
- return $val;
37
- }
38
-
39
-
40
- /**
41
- * Sanitize individual data item
42
- *
43
- * @param mixed $val value to sanitize
44
- * @param string $type value type
45
- * @return mixed sanitized value
46
- */
47
- public static function sanitize_item($val, $type='')
48
- {
49
- switch ($type)
50
- {
51
- case 'text':
52
- $val = sanitize_text_field($val);
53
- break;
54
- case 'text_arr':
55
- $val = self::sanitize_arr($val);
56
- break;
57
- case 'url':
58
- $val = esc_url_raw($val);
59
- break;
60
- case 'url_arr':
61
- $val = self::sanitize_arr($val, 'url');
62
- break;
63
- case 'textarea':
64
- $val=sanitize_textarea_field($val);
65
- break;
66
- case 'int':
67
- $val = intval($val);
68
- break;
69
- case 'int_arr':
70
- $val = self::sanitize_arr($val, 'int');
71
- break;
72
- case 'float':
73
- $val = floatval($val);
74
- break;
75
- case 'post_content':
76
- $val = wp_kses_post($val);
77
- break;
78
- case 'hex':
79
- $val = sanitize_hex_color($val);
80
- break;
81
- default:
82
- $val = sanitize_text_field($val);
83
- }
84
-
85
- return $val;
86
- }
87
-
88
- /**
89
- * Recursive array sanitization function
90
- *
91
- * @param mixed $arr value to sanitize
92
- * @param string $type value type
93
- * @return mixed sanitized value
94
- */
95
- public static function sanitize_arr($arr, $type = 'text')
96
- {
97
- if(is_array($arr))
98
- {
99
- $out = array();
100
- foreach($arr as $k=>$arrv)
101
- {
102
- if(is_array($arrv))
103
- {
104
- $out[$k] = self::sanitize_arr($arrv, $type);
105
- }else
106
- {
107
- $out[$k] = self::sanitize_item($arrv, $type);
108
- }
109
- }
110
- return $out;
111
- }else
112
- {
113
- return self::sanitize_item($arr, $type);
114
- }
115
- }
116
-
117
- /**
118
- * User accessibility. Function checks user logged in status, nonce and role access.
119
- *
120
- * @param string $plugin_id unique plugin id. Note: This id is used as an identifier in filter name so please use characters allowed in filters
121
- * @param string $nonce_id Nonce id. If not specified then uses plugin id
122
- * @return boolean if user allowed or not
123
- */
124
- public static function check_write_access($plugin_id, $nonce_id = '')
125
- {
126
- $er = true;
127
-
128
- if(!is_user_logged_in()) //checks user is logged in
129
- {
130
- $er = false;
131
- }
132
-
133
- if($er === true) //no error then proceed
134
- {
135
- $nonce = (isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : '');
136
- $nonce = (is_array($nonce) ? $nonce[0] : $nonce); //in some cases multiple nonces are declared
137
- $nonce_id = ($nonce_id == "" ? $plugin_id : $nonce_id); //if nonce id not provided then uses plugin id as nonce id
138
-
139
- if(!(wp_verify_nonce($nonce, $nonce_id))) //verifying nonce
140
- {
141
- $er = false;
142
- }else
143
- {
144
- if(!self::check_role_access($plugin_id)) //Check user role
145
- {
146
- $er = false;
147
- }
148
- }
149
- }
150
- return $er;
151
- }
152
-
153
-
154
- /**
155
- * Checks if user role has access
156
- *
157
- * @param string $plugin_id unique plugin id. Note: This id is used as an identifier in filter name so please use characters allowed in filters
158
- * @return boolean if user allowed or not
159
- */
160
- public static function check_role_access($plugin_id)
161
- {
162
- $roles = array('manage_options');
163
- $roles = apply_filters('wt_'.$plugin_id.'_alter_role_access', $roles); //dynamic filter based on plugin id to alter roles
164
- $roles = (!is_array($roles) ? array() : $roles);
165
- $is_allowed = false;
166
-
167
- foreach($roles as $role) //loop through roles
168
- {
169
- if(current_user_can($role))
170
- {
171
- $is_allowed = true;
172
- break;
173
- }
174
- }
175
- return $is_allowed;
176
- }
177
-
178
- }
179
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/index.php CHANGED
@@ -1 +1 @@
1
- <?php // Silence is golden
1
+ <?php // Silence is golden
index.php CHANGED
@@ -1 +1 @@
1
- <?php // Silence is golden
1
+ <?php // Silence is golden
public/class-cookie-law-info-public.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * The public-facing functionality of the plugin.
5
  *
@@ -20,8 +19,8 @@
20
  * @subpackage Cookie_Law_Info/public
21
  * @author WebToffee <info@webtoffee.com>
22
  */
23
- class Cookie_Law_Info_Public
24
- {
25
 
26
  /**
27
  * The ID of this plugin.
@@ -47,8 +46,8 @@ class Cookie_Law_Info_Public
47
  * module list, Module folder and main file must be same as that of module name
48
  * Please check the `register_modules` method for more details
49
  */
50
- private $modules = array(
51
- 'script-blocker',
52
  'shortcode',
53
  );
54
  public static $existing_modules = array();
@@ -57,31 +56,29 @@ class Cookie_Law_Info_Public
57
  * Initialize the class and set its properties.
58
  *
59
  * @since 1.6.6
60
- * @param string $plugin_name The name of the plugin.
61
- * @param string $version The version of this plugin.
62
  */
63
 
64
- public function __construct($plugin_name, $version, $plugin_obj)
65
- {
66
 
67
  $this->plugin_name = $plugin_name;
68
- $this->version = $version;
69
- $this->plugin_obj = $plugin_obj;
70
- register_activation_hook(CLI_PLUGIN_FILENAME, array($this, 'activator'));
71
-
72
- }
73
- public function activator()
74
- {
75
-
76
- $activation_transient = wp_validate_boolean( get_transient('_wt_cli_first_time_activation') );
77
-
78
- if( Cookie_Law_Info::maybe_first_time_install() === true ) {
79
  $js_blocking = wp_validate_boolean( Cookie_Law_Info::get_js_option() );
80
- if( $js_blocking === false ) {
81
- update_option('cookielawinfo_js_blocking', 'yes');
82
  }
83
  }
84
-
85
  }
86
 
87
  /**
@@ -89,28 +86,27 @@ class Cookie_Law_Info_Public
89
  *
90
  * @since 1.7.7
91
  */
92
- public function cli_set_category_cookies()
93
- {
94
  $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
95
-
96
- if ($js_blocking_enabled === false) {
97
-
98
- $cookie_category_data = apply_filters('wt_cli_cookie_categories',array());
99
- $the_options = Cookie_Law_Info::get_settings();
100
-
101
- if ($the_options['is_on'] == true) {
102
-
103
- foreach( $cookie_category_data as $key => $data ) {
104
- if (empty($_COOKIE["cookielawinfo-checkbox-$key"])) {
105
- $category_enabled = isset( $data['enabled']) ? $data['enabled'] : false ;
106
- $cookie_value = ( isset( $data['default_state'] ) && $data['default_state'] === true ) ? 'yes' : 'no';
107
- if( $category_enabled === false ) {
108
  return false;
109
  } else {
110
- if( true === apply_filters('wt_cli_set_secure_cookies', false ) ) {
111
- @setcookie("cookielawinfo-checkbox-$key", $cookie_value, time() + 3600, '/','',true );
112
  } else {
113
- @setcookie("cookielawinfo-checkbox-$key", $cookie_value, time() + 3600, '/');
114
  }
115
  }
116
  }
@@ -124,9 +120,7 @@ class Cookie_Law_Info_Public
124
  *
125
  * @since 1.6.6
126
  */
127
- public function enqueue_styles()
128
- {
129
-
130
  /**
131
  * This function is provided for demonstration purposes only.
132
  *
@@ -139,11 +133,11 @@ class Cookie_Law_Info_Public
139
  * class.
140
  */
141
  $the_options = Cookie_Law_Info::get_settings();
142
- if ($the_options['is_on'] == true) {
143
- wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/cookie-law-info-public.css', array(), $this->version, 'all');
144
- wp_enqueue_style($this->plugin_name . '-gdpr', plugin_dir_url(__FILE__) . 'css/cookie-law-info-gdpr.css', array(), $this->version, 'all');
145
- //this style will include only when shortcode is called
146
- wp_register_style($this->plugin_name . '-table', plugin_dir_url(__FILE__) . 'css/cookie-law-info-table.css', array(), $this->version, 'all');
147
  }
148
  }
149
 
@@ -152,9 +146,7 @@ class Cookie_Law_Info_Public
152
  *
153
  * @since 1.6.6
154
  */
155
- public function enqueue_scripts()
156
- {
157
-
158
  /**
159
  * This function is provided for demonstration purposes only.
160
  *
@@ -166,144 +158,133 @@ class Cookie_Law_Info_Public
166
  * between the defined hooks and the functions defined in this
167
  * class.
168
  */
169
- $the_options = Cookie_Law_Info::get_settings();
170
- $ccpa_enabled = (isset($the_options['ccpa_enabled']) ? $the_options['ccpa_enabled'] : false);
171
- $ccpa_region_based = (isset($the_options['ccpa_region_based']) ? $the_options['ccpa_region_based'] : false);
172
- $ccpa_enable_bar = (isset($the_options['ccpa_enable_bar']) ? $the_options['ccpa_enable_bar'] : false);
173
- $ccpa_type = (isset($the_options['consent_type']) ? $the_options['consent_type'] : 'gdpr');
174
- $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
175
- $enable_custom_integration = apply_filters('wt_cli_enable_plugin_integration',false);
176
- $trigger_dom_reload = apply_filters('wt_cli_script_blocker_trigger_dom_refresh',false);
177
-
178
- if ($the_options['is_on'] == true) {
179
  $non_necessary_cookie_ids = Cookie_Law_Info::get_non_necessary_cookie_ids();
180
- $cli_cookie_datas = array(
181
- 'nn_cookie_ids' => !empty($non_necessary_cookie_ids) ? $non_necessary_cookie_ids : array(),
182
- 'cookielist' => array(),
183
  'non_necessary_cookies' => $this->get_cookies_by_category(),
184
- 'ccpaEnabled' => $ccpa_enabled,
185
- 'ccpaRegionBased' => $ccpa_region_based,
186
- 'ccpaBarEnabled' => $ccpa_enable_bar,
187
- 'strictlyEnabled' => Cookie_Law_Info_Cookies::get_instance()->get_strictly_necessory_categories(),
188
- 'ccpaType' => $ccpa_type,
189
- 'js_blocking' => $js_blocking_enabled,
190
- 'custom_integration' => $enable_custom_integration,
191
- 'triggerDomRefresh' => $trigger_dom_reload,
192
- 'secure_cookies' => apply_filters('wt_cli_set_secure_cookies', false ),
193
  );
194
- wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/cookie-law-info-public.js', array('jquery'), $this->version, false);
195
- wp_localize_script($this->plugin_name, 'Cli_Data', $cli_cookie_datas);
196
- wp_localize_script($this->plugin_name,'cli_cookiebar_settings',Cookie_Law_Info::get_json_settings());
197
- wp_localize_script($this->plugin_name, 'log_object', array('ajax_url' => admin_url('admin-ajax.php')));
198
  }
199
  }
200
 
201
  /**
202
- Registers modules: public+admin
203
  */
204
- public function common_modules()
205
- {
206
- foreach ($this->modules as $module) //loop through module list and include its file
207
- {
208
- $module_file = plugin_dir_path(__FILE__) . "modules/$module/$module.php";
209
- if (file_exists($module_file)) {
210
- self::$existing_modules[] = $module; //this is for module_exits checking
211
  require_once $module_file;
212
  }
213
  }
214
  }
215
- public static function module_exists($module)
216
- {
217
- return in_array($module, self::$existing_modules);
218
  }
219
 
220
-
221
 
222
  /** Removes leading # characters from a string */
223
- public static function cookielawinfo_remove_hash($str)
224
- {
225
- if ($str[0] == "#") {
226
- $str = substr($str, 1, strlen($str));
227
  } else {
228
  return $str;
229
  }
230
- return self::cookielawinfo_remove_hash($str);
231
  }
232
 
233
- /**
234
- Outputs the cookie control script in the footer
235
- N.B. This script MUST be output in the footer.
236
-
237
- This function should be attached to the wp_footer action hook.
238
  */
239
- public function cookielawinfo_inject_cli_script()
240
- {
241
- $the_options = Cookie_Law_Info::get_settings();
242
  $show_cookie_bar = true;
243
- if(apply_filters('wt_cli_hide_bar_on_page_editor', true) && $this->is_page_editor_active()) {
244
  $show_cookie_bar = false;
245
  }
246
- if ( $the_options['is_on'] == true && $show_cookie_bar ){
247
  // Output the HTML in the footer:
248
- $message = nl2br($the_options['notify_message']);
249
- $str = do_shortcode(stripslashes($message));
250
- $str = __($str, 'cookie-law-info');
251
- $head = __($the_options['bar_heading_text'], 'cookie-law-info');
252
- $head = trim(stripslashes($head));
253
-
254
- $notify_html = '<div id="' . $this->cookielawinfo_remove_hash($the_options["notify_div_id"]) . '" data-nosnippet="true">' .
255
- ($head != "" ? '<h5 class="cli_messagebar_head">' . $head . '</h5>' : '')
256
  . '<span>' . $str . '</span></div>';
257
 
258
- //if($the_options['showagain_tab'] === true)
259
- //{
260
- $show_again = __(stripslashes($the_options["showagain_text"]), 'cookie-law-info');
261
- $notify_html .= '<div id="' . $this->cookielawinfo_remove_hash($the_options["showagain_div_id"]) . '" style="display:none;" data-nosnippet="true"><span id="cookie_hdr_showagain">' . $show_again . '</span></div>';
262
- //}
263
  global $wp_query;
264
  $current_obj = get_queried_object();
265
- $post_slug = '';
266
- if (is_object($current_obj)) {
267
- if (is_category() || is_tag()) {
268
- $post_slug = isset($current_obj->slug) ? $current_obj->slug : '';
269
- } elseif (is_archive()) {
270
- $post_slug = isset($current_obj->rewrite) && isset($current_obj->rewrite['slug']) ? $current_obj->rewrite['slug'] : '';
271
  } else {
272
- if (isset($current_obj->post_name)) {
273
  $post_slug = $current_obj->post_name;
274
  }
275
  }
276
  }
277
- $notify_html = apply_filters('cli_show_cookie_bar_only_on_selected_pages', $notify_html, $post_slug);
278
- require_once plugin_dir_path(__FILE__) . 'views/cookie-law-info_bar.php';
279
  }
280
  }
281
 
282
  /* Print scripts or data in the head tag on the front end. */
283
- public function include_user_accepted_cookielawinfo()
284
- {
285
  $this->wt_cli_print_scripts( true );
286
  }
287
- public function wt_cli_head_scripts(){
288
-
289
  }
290
  public function wt_cli_print_scripts( $head = false ) {
291
 
292
- $the_options = Cookie_Law_Info::get_settings();
293
- $advanced_script_rendering = Cookie_Law_Info::wt_cli_is_js_blocking_active();
294
-
295
- if ($the_options['is_on'] == true && !is_admin()) {
296
- $cookie_categories = apply_filters( 'wt_cli_cookie_categories',array() );
297
-
298
- if( !empty( $cookie_categories ) ) {
299
- foreach( $cookie_categories as $slug => $data ) {
300
- if( isset( $data['status'] ) && $data['status'] === true ){
301
- if( $head === false ) {
302
- $scripts = $data['body_scripts'];
303
  } else {
304
- $scripts = $data['head_scripts'];
305
  }
306
- if( !empty( $scripts )) {
307
  $this->process_scripts( $scripts, $slug, $advanced_script_rendering, $head );
308
  }
309
  }
@@ -311,86 +292,83 @@ class Cookie_Law_Info_Public
311
  }
312
  }
313
  }
314
- public function process_scripts( $script, $slug, $advanced_script_rendering, $head ){
315
- if( $advanced_script_rendering === false ) {
316
- if( $this->check_consent( $slug ) === true ) {
317
  echo $script;
318
  }
319
  } else {
320
  echo $this->pre_process_scripts( $slug, $script, $head );
321
  }
322
  }
323
- public function check_consent( $slug ){
324
 
325
- $preference_cookie = isset( $_COOKIE[ 'cookielawinfo-checkbox-'.$slug ] ) ? $_COOKIE[ 'cookielawinfo-checkbox-'.$slug ] : 'no' ;
326
- $main_cookie = isset( $_COOKIE[ 'viewed_cookie_policy' ] ) ? $_COOKIE[ 'viewed_cookie_policy' ] : 'no' ;
327
- if( $main_cookie === 'yes' && $preference_cookie === 'yes' || isset( $_GET['cli_bypass'] ) && get_option('CLI_BYPASS') == 1 ) {
328
  return true;
329
  }
330
  return false;
331
  }
332
- public function pre_process_scripts( $slug, $script, $head ){
333
- $position = 'body';
334
- if( $head === true ){
335
- $position = 'head';
336
  }
337
- $replace = 'data-cli-class="cli-blocker-script" data-cli-script-type="'.$slug.'" data-cli-block="true" data-cli-element-position="'.$position.'"';
338
- $scripts = $this->replace_script_attribute_type( $script, $replace );
339
  return $scripts;
340
  }
341
  /* Print scripts or data in the body tag on the front end. */
342
- public function include_user_accepted_cookielawinfo_in_body()
343
- {
344
  $this->wt_cli_print_scripts();
345
  }
346
  /**
347
- * Desceiption
348
- *
349
- * @since 1.8.9
350
- * @param string script
351
- * @param string replace
352
- * @return string
353
- */
354
- public function replace_script_attribute_type($script, $replace ) {
355
- $textarr = wp_html_split($script);
356
  $replace_script = $script;
357
- $script_array = ( isset( $textarr ) && is_array( $textarr ) ) ? $textarr : array();
358
- $changed = false;
359
- $script_type = "text/plain";
360
- foreach ($script_array as $i => $html) {
361
- if( preg_match( '/<script[^\>]*?\>/m', $script_array[$i] ) ) {
362
  $changed = true;
363
- if (preg_match('/<script.*(type=(?:"|\')(.*?)(?:"|\')).*?>/', $script_array[$i]) && preg_match('/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script_array[$i] )) {
364
- preg_match('/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script_array[$i], $output_array);
365
- $re = preg_quote($output_array[1],'/');
366
- if(!empty($output_array)) {
367
-
368
- $script_array[$i] = preg_replace('/' .$re .'/', 'type="'.$script_type.'"'.' '.$replace, $script_array[$i],1);
369
-
370
- }
371
  } else {
372
-
373
- $script_array[$i] = str_replace('<script', '<script type="'.$script_type.'"'.' '.$replace, $script_array[$i]);
374
-
375
- }
376
-
377
  }
378
-
379
  }
380
  if ( $changed === true ) {
381
- $replace_script = implode($script_array);
382
- }
383
  return $replace_script;
384
  }
385
  public function wt_cli_bypass_script_blocking() {
386
- $bypass_blocking = false;
387
- $the_options = Cookie_Law_Info::get_settings();
388
- $ccpa_enabled = Cookie_Law_Info::sanitise_settings('ccpa_enabled', ( isset( $the_options['ccpa_enabled'] ) ? $the_options['ccpa_enabled'] : false ) );
389
- $ccpa_bar_enabled = Cookie_Law_Info::sanitise_settings('ccpa_enable_bar', ( isset( $the_options['ccpa_enable_bar'] ) ? $the_options['ccpa_enable_bar'] : false ) );
390
- $consent_type = Cookie_Law_Info::sanitise_settings('consent_type', ( isset( $the_options['consent_type'] ) ? $the_options['consent_type'] : 'gdpr' ) );
391
- if( $ccpa_enabled === true && $consent_type === 'ccpa') {
392
- if( $ccpa_bar_enabled === false ) {
393
- if( !isset( $_COOKIE['viewed_cookie_policy'] ) && self::do_not_sell_optout() === false ) {
394
  $bypass_blocking = true;
395
  }
396
  }
@@ -398,78 +376,77 @@ class Cookie_Law_Info_Public
398
  return $bypass_blocking;
399
  }
400
  /**
401
- * Check whether opted in CCPA or not
402
- *
403
- * @since 1.0.0
404
- * @return bool
405
- */
406
  public static function do_not_sell_optout() {
407
- $preference_cookie = "CookieLawInfoConsent";
408
- $ccpa_optout = false;
409
- if( isset( $_COOKIE[ $preference_cookie ]) ) {
410
- $json_cookie = json_decode( base64_decode( $_COOKIE[$preference_cookie] ) );
411
  $ccpa_optout = ( isset( $json_cookie->ccpaOptout ) ? $json_cookie->ccpaOptout : false );
412
  }
413
  return $ccpa_optout;
414
  }
415
  public function get_cookies_by_category() {
416
 
417
- $cookie_categories = apply_filters( 'wt_cli_cookie_categories',array() );
418
-
419
  $categories = array();
420
-
421
- if( !empty( $cookie_categories ) ) {
422
-
423
- foreach( $cookie_categories as $slug => $data ) {
424
 
425
- if( isset( $data['status'] ) && $data['status'] === true ){
 
 
426
 
427
- $cookies = ( isset( $data['cookies'] ) && is_array( $data['cookies'] ) ) ? $data['cookies'] : array();
 
 
428
  $cookie_list = array();
429
- $strict = isset( $data['strict'] ) ? $data['strict'] : false ;
430
-
431
- if( !empty( $cookies ) ) {
432
  foreach ( $cookies as $key => $cookie ) {
433
 
434
- $sensitivity = get_post_meta( $cookie->ID, "_cli_cookie_sensitivity", true) ;
435
- $cookie_title = get_post_meta( $cookie->ID, "_cli_cookie_slugid", true) ;
436
- $cookie_id = ( " " !== $cookie_title ) ? $cookie_title : $cookie->post_title;
437
 
438
- if( 'non-necessary' === $sensitivity || false === $strict) {
439
- if( false === $this->maybe_plugin_cookie( $cookie_id ) ) {
440
  $cookie_list[] = $cookie_id;
441
  }
442
  }
443
  }
444
- }
445
  }
446
- if( !empty( $cookie_list ) ) {
447
  $categories[ $slug ] = $cookie_list;
448
  }
449
  }
450
-
451
  }
452
  return $categories;
453
  }
454
  public function maybe_plugin_cookie( $cookie ) {
455
- if( 'viewed_cookie_policy' === $cookie || false !== strpos( $cookie, 'cookielawinfo-checkbox') ) {
456
  return true;
457
  }
458
  return false;
459
  }
460
  /**
461
- * Check whether any page editor is active or not
462
- *
463
- * @since 2.0.5
464
- * @return bool
465
- */
466
  public function is_page_editor_active() {
467
  global $wp_customize;
468
- if( isset($_GET['et_fb'])
469
- || (defined( 'ET_FB_ENABLED' ) && ET_FB_ENABLED)
470
- || isset($_GET['elementor-preview'])
471
- || isset($_POST['cs_preview_state'])
472
- || isset($wp_customize)
473
  ) {
474
  return true;
475
  }
1
  <?php
 
2
  /**
3
  * The public-facing functionality of the plugin.
4
  *
19
  * @subpackage Cookie_Law_Info/public
20
  * @author WebToffee <info@webtoffee.com>
21
  */
22
+ class Cookie_Law_Info_Public {
23
+
24
 
25
  /**
26
  * The ID of this plugin.
46
  * module list, Module folder and main file must be same as that of module name
47
  * Please check the `register_modules` method for more details
48
  */
49
+ private $modules = array(
50
+ 'script-blocker',
51
  'shortcode',
52
  );
53
  public static $existing_modules = array();
56
  * Initialize the class and set its properties.
57
  *
58
  * @since 1.6.6
59
+ * @param string $plugin_name The name of the plugin.
60
+ * @param string $version The version of this plugin.
61
  */
62
 
63
+ public function __construct( $plugin_name, $version, $plugin_obj ) {
 
64
 
65
  $this->plugin_name = $plugin_name;
66
+ $this->version = $version;
67
+ $this->plugin_obj = $plugin_obj;
68
+ register_activation_hook( CLI_PLUGIN_FILENAME, array( $this, 'activator' ) );
69
+
70
+ }
71
+ public function activator() {
72
+
73
+ $activation_transient = wp_validate_boolean( get_transient( '_wt_cli_first_time_activation' ) );
74
+
75
+ if ( Cookie_Law_Info::maybe_first_time_install() === true ) {
 
76
  $js_blocking = wp_validate_boolean( Cookie_Law_Info::get_js_option() );
77
+ if ( $js_blocking === false ) {
78
+ update_option( 'cookielawinfo_js_blocking', 'yes' );
79
  }
80
  }
81
+
82
  }
83
 
84
  /**
86
  *
87
  * @since 1.7.7
88
  */
89
+ public function cli_set_category_cookies() {
 
90
  $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
91
+
92
+ if ( $js_blocking_enabled === false ) {
93
+
94
+ $cookie_category_data = apply_filters( 'wt_cli_cookie_categories', array() );
95
+ $the_options = Cookie_Law_Info::get_settings();
96
+
97
+ if ( $the_options['is_on'] == true ) {
98
+
99
+ foreach ( $cookie_category_data as $key => $data ) {
100
+ if ( empty( $_COOKIE[ "cookielawinfo-checkbox-$key" ] ) ) {
101
+ $category_enabled = isset( $data['enabled'] ) ? $data['enabled'] : false;
102
+ $cookie_value = ( isset( $data['default_state'] ) && $data['default_state'] === true ) ? 'yes' : 'no';
103
+ if ( $category_enabled === false ) {
104
  return false;
105
  } else {
106
+ if ( true === apply_filters( 'wt_cli_set_secure_cookies', false ) ) {
107
+ @setcookie( "cookielawinfo-checkbox-$key", $cookie_value, time() + 3600, '/', '', true );
108
  } else {
109
+ @setcookie( "cookielawinfo-checkbox-$key", $cookie_value, time() + 3600, '/' );
110
  }
111
  }
112
  }
120
  *
121
  * @since 1.6.6
122
  */
123
+ public function enqueue_styles() {
 
 
124
  /**
125
  * This function is provided for demonstration purposes only.
126
  *
133
  * class.
134
  */
135
  $the_options = Cookie_Law_Info::get_settings();
136
+ if ( $the_options['is_on'] == true ) {
137
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/cookie-law-info-public.css', array(), $this->version, 'all' );
138
+ wp_enqueue_style( $this->plugin_name . '-gdpr', plugin_dir_url( __FILE__ ) . 'css/cookie-law-info-gdpr.css', array(), $this->version, 'all' );
139
+ // this style will include only when shortcode is called
140
+ wp_register_style( $this->plugin_name . '-table', plugin_dir_url( __FILE__ ) . 'css/cookie-law-info-table.css', array(), $this->version, 'all' );
141
  }
142
  }
143
 
146
  *
147
  * @since 1.6.6
148
  */
149
+ public function enqueue_scripts() {
 
 
150
  /**
151
  * This function is provided for demonstration purposes only.
152
  *
158
  * between the defined hooks and the functions defined in this
159
  * class.
160
  */
161
+ $the_options = Cookie_Law_Info::get_settings();
162
+ $ccpa_enabled = ( isset( $the_options['ccpa_enabled'] ) ? $the_options['ccpa_enabled'] : false );
163
+ $ccpa_region_based = ( isset( $the_options['ccpa_region_based'] ) ? $the_options['ccpa_region_based'] : false );
164
+ $ccpa_enable_bar = ( isset( $the_options['ccpa_enable_bar'] ) ? $the_options['ccpa_enable_bar'] : false );
165
+ $ccpa_type = ( isset( $the_options['consent_type'] ) ? $the_options['consent_type'] : 'gdpr' );
166
+ $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
167
+ $enable_custom_integration = apply_filters( 'wt_cli_enable_plugin_integration', false );
168
+ $trigger_dom_reload = apply_filters( 'wt_cli_script_blocker_trigger_dom_refresh', false );
169
+
170
+ if ( $the_options['is_on'] == true ) {
171
  $non_necessary_cookie_ids = Cookie_Law_Info::get_non_necessary_cookie_ids();
172
+ $cli_cookie_datas = array(
173
+ 'nn_cookie_ids' => ! empty( $non_necessary_cookie_ids ) ? $non_necessary_cookie_ids : array(),
174
+ 'cookielist' => array(),
175
  'non_necessary_cookies' => $this->get_cookies_by_category(),
176
+ 'ccpaEnabled' => $ccpa_enabled,
177
+ 'ccpaRegionBased' => $ccpa_region_based,
178
+ 'ccpaBarEnabled' => $ccpa_enable_bar,
179
+ 'strictlyEnabled' => Cookie_Law_Info_Cookies::get_instance()->get_strictly_necessory_categories(),
180
+ 'ccpaType' => $ccpa_type,
181
+ 'js_blocking' => $js_blocking_enabled,
182
+ 'custom_integration' => $enable_custom_integration,
183
+ 'triggerDomRefresh' => $trigger_dom_reload,
184
+ 'secure_cookies' => apply_filters( 'wt_cli_set_secure_cookies', false ),
185
  );
186
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/cookie-law-info-public.js', array( 'jquery' ), $this->version, false );
187
+ wp_localize_script( $this->plugin_name, 'Cli_Data', $cli_cookie_datas );
188
+ wp_localize_script( $this->plugin_name, 'cli_cookiebar_settings', Cookie_Law_Info::get_json_settings() );
189
+ wp_localize_script( $this->plugin_name, 'log_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
190
  }
191
  }
192
 
193
  /**
194
+ Registers modules: public+admin
195
  */
196
+ public function common_modules() {
197
+ foreach ( $this->modules as $module ) {
198
+ $module_file = plugin_dir_path( __FILE__ ) . "modules/$module/$module.php";
199
+ if ( file_exists( $module_file ) ) {
200
+ self::$existing_modules[] = $module; // this is for module_exits checking
 
 
201
  require_once $module_file;
202
  }
203
  }
204
  }
205
+ public static function module_exists( $module ) {
206
+ return in_array( $module, self::$existing_modules );
 
207
  }
208
 
209
+
210
 
211
  /** Removes leading # characters from a string */
212
+ public static function cookielawinfo_remove_hash( $str ) {
213
+ if ( $str[0] == '#' ) {
214
+ $str = substr( $str, 1, strlen( $str ) );
 
215
  } else {
216
  return $str;
217
  }
218
+ return self::cookielawinfo_remove_hash( $str );
219
  }
220
 
221
+ /*
222
+ /* Outputs the cookie control script in the footer
223
+ /* N.B. This script MUST be output in the footer.
224
+ /* This function should be attached to the wp_footer action hook.
 
225
  */
226
+ public function cookielawinfo_inject_cli_script() {
227
+ $the_options = Cookie_Law_Info::get_settings();
 
228
  $show_cookie_bar = true;
229
+ if ( apply_filters( 'wt_cli_hide_bar_on_page_editor', true ) && $this->is_page_editor_active() ) {
230
  $show_cookie_bar = false;
231
  }
232
+ if ( $the_options['is_on'] == true && $show_cookie_bar ) {
233
  // Output the HTML in the footer:
234
+ $message = nl2br( $the_options['notify_message'] );
235
+ $str = do_shortcode( stripslashes( $message ) );
236
+ $head = trim( stripslashes( $the_options['bar_heading_text'] ) );
237
+
238
+ $notify_html = '<div id="' . $this->cookielawinfo_remove_hash( $the_options['notify_div_id'] ) . '" data-nosnippet="true">' .
239
+ ( $head != '' ? '<h5 class="cli_messagebar_head">' . wp_kses_post( $head ) . '</h5>' : '' )
 
 
240
  . '<span>' . $str . '</span></div>';
241
 
242
+ $show_again = stripslashes( $the_options['showagain_text'] );
243
+ $notify_html .= '<div id="' . $this->cookielawinfo_remove_hash( $the_options['showagain_div_id'] ) . '" style="display:none;" data-nosnippet="true"><span id="cookie_hdr_showagain">' . esc_html( $show_again ) . '</span></div>';
244
+
 
 
245
  global $wp_query;
246
  $current_obj = get_queried_object();
247
+ $post_slug = '';
248
+ if ( is_object( $current_obj ) ) {
249
+ if ( is_category() || is_tag() ) {
250
+ $post_slug = isset( $current_obj->slug ) ? $current_obj->slug : '';
251
+ } elseif ( is_archive() ) {
252
+ $post_slug = isset( $current_obj->rewrite ) && isset( $current_obj->rewrite['slug'] ) ? $current_obj->rewrite['slug'] : '';
253
  } else {
254
+ if ( isset( $current_obj->post_name ) ) {
255
  $post_slug = $current_obj->post_name;
256
  }
257
  }
258
  }
259
+ $notify_html = apply_filters( 'cli_show_cookie_bar_only_on_selected_pages', $notify_html, $post_slug );
260
+ require_once plugin_dir_path( __FILE__ ) . 'views/cookie-law-info_bar.php';
261
  }
262
  }
263
 
264
  /* Print scripts or data in the head tag on the front end. */
265
+ public function include_user_accepted_cookielawinfo() {
 
266
  $this->wt_cli_print_scripts( true );
267
  }
268
+ public function wt_cli_head_scripts() {
269
+
270
  }
271
  public function wt_cli_print_scripts( $head = false ) {
272
 
273
+ $the_options = Cookie_Law_Info::get_settings();
274
+ $advanced_script_rendering = Cookie_Law_Info::wt_cli_is_js_blocking_active();
275
+
276
+ if ( $the_options['is_on'] == true && ! is_admin() ) {
277
+ $cookie_categories = apply_filters( 'wt_cli_cookie_categories', array() );
278
+
279
+ if ( ! empty( $cookie_categories ) ) {
280
+ foreach ( $cookie_categories as $slug => $data ) {
281
+ if ( isset( $data['status'] ) && $data['status'] === true ) {
282
+ if ( $head === false ) {
283
+ $scripts = $data['body_scripts'];
284
  } else {
285
+ $scripts = $data['head_scripts'];
286
  }
287
+ if ( ! empty( $scripts ) ) {
288
  $this->process_scripts( $scripts, $slug, $advanced_script_rendering, $head );
289
  }
290
  }
292
  }
293
  }
294
  }
295
+ public function process_scripts( $script, $slug, $advanced_script_rendering, $head ) {
296
+ if ( $advanced_script_rendering === false ) {
297
+ if ( $this->check_consent( $slug ) === true ) {
298
  echo $script;
299
  }
300
  } else {
301
  echo $this->pre_process_scripts( $slug, $script, $head );
302
  }
303
  }
304
+ public function check_consent( $slug ) {
305
 
306
+ $preference_cookie = isset( $_COOKIE[ 'cookielawinfo-checkbox-' . $slug ] ) ? sanitize_text_field( wp_unslash( $_COOKIE[ 'cookielawinfo-checkbox-' . $slug ] ) ) : 'no';
307
+ $main_cookie = isset( $_COOKIE['viewed_cookie_policy'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['viewed_cookie_policy'] ) ) : 'no';
308
+ if ( $main_cookie === 'yes' && $preference_cookie === 'yes' || isset( $_GET['cli_bypass'] ) && get_option( 'CLI_BYPASS' ) == 1 ) {
309
  return true;
310
  }
311
  return false;
312
  }
313
+ public function pre_process_scripts( $slug, $script, $head ) {
314
+ $position = 'body';
315
+ if ( $head === true ) {
316
+ $position = 'head';
317
  }
318
+ $replace = 'data-cli-class="cli-blocker-script" data-cli-script-type="' . $slug . '" data-cli-block="true" data-cli-element-position="' . $position . '"';
319
+ $scripts = $this->replace_script_attribute_type( $script, $replace );
320
  return $scripts;
321
  }
322
  /* Print scripts or data in the body tag on the front end. */
323
+ public function include_user_accepted_cookielawinfo_in_body() {
 
324
  $this->wt_cli_print_scripts();
325
  }
326
  /**
327
+ * Desceiption
328
+ *
329
+ * @since 1.8.9
330
+ * @param string script
331
+ * @param string replace
332
+ * @return string
333
+ */
334
+ public function replace_script_attribute_type( $script, $replace ) {
335
+ $textarr = wp_html_split( $script );
336
  $replace_script = $script;
337
+ $script_array = ( isset( $textarr ) && is_array( $textarr ) ) ? $textarr : array();
338
+ $changed = false;
339
+ $script_type = 'text/plain';
340
+ foreach ( $script_array as $i => $html ) {
341
+ if ( preg_match( '/<script[^\>]*?\>/m', $script_array[ $i ] ) ) {
342
  $changed = true;
343
+ if ( preg_match( '/<script.*(type=(?:"|\')(.*?)(?:"|\')).*?>/', $script_array[ $i ] ) && preg_match( '/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script_array[ $i ] ) ) {
344
+ preg_match( '/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script_array[ $i ], $output_array );
345
+ $re = preg_quote( $output_array[1], '/' );
346
+ if ( ! empty( $output_array ) ) {
347
+
348
+ $script_array[ $i ] = preg_replace( '/' . $re . '/', 'type="' . $script_type . '"' . ' ' . $replace, $script_array[ $i ], 1 );
349
+
350
+ }
351
  } else {
352
+
353
+ $script_array[ $i ] = str_replace( '<script', '<script type="' . $script_type . '"' . ' ' . $replace, $script_array[ $i ] );
354
+
355
+ }
 
356
  }
 
357
  }
358
  if ( $changed === true ) {
359
+ $replace_script = implode( $script_array );
360
+ }
361
  return $replace_script;
362
  }
363
  public function wt_cli_bypass_script_blocking() {
364
+ $bypass_blocking = false;
365
+ $the_options = Cookie_Law_Info::get_settings();
366
+ $ccpa_enabled = Cookie_Law_Info::sanitise_settings( 'ccpa_enabled', ( isset( $the_options['ccpa_enabled'] ) ? $the_options['ccpa_enabled'] : false ) );
367
+ $ccpa_bar_enabled = Cookie_Law_Info::sanitise_settings( 'ccpa_enable_bar', ( isset( $the_options['ccpa_enable_bar'] ) ? $the_options['ccpa_enable_bar'] : false ) );
368
+ $consent_type = Cookie_Law_Info::sanitise_settings( 'consent_type', ( isset( $the_options['consent_type'] ) ? $the_options['consent_type'] : 'gdpr' ) );
369
+ if ( $ccpa_enabled === true && $consent_type === 'ccpa' ) {
370
+ if ( $ccpa_bar_enabled === false ) {
371
+ if ( ! isset( $_COOKIE['viewed_cookie_policy'] ) && self::do_not_sell_optout() === false ) {
372
  $bypass_blocking = true;
373
  }
374
  }
376
  return $bypass_blocking;
377
  }
378
  /**
379
+ * Check whether opted in CCPA or not
380
+ *
381
+ * @since 1.0.0
382
+ * @return bool
383
+ */
384
  public static function do_not_sell_optout() {
385
+ $preference_cookie = 'CookieLawInfoConsent';
386
+ $ccpa_optout = false;
387
+ if ( isset( $_COOKIE[ $preference_cookie ] ) ) {
388
+ $json_cookie = json_decode( base64_decode( sanitize_text_field( wp_unslash( $_COOKIE[ $preference_cookie ] ) ) ) );
389
  $ccpa_optout = ( isset( $json_cookie->ccpaOptout ) ? $json_cookie->ccpaOptout : false );
390
  }
391
  return $ccpa_optout;
392
  }
393
  public function get_cookies_by_category() {
394
 
395
+ $cookie_categories = apply_filters( 'wt_cli_cookie_categories', array() );
396
+
397
  $categories = array();
 
 
 
 
398
 
399
+ if ( ! empty( $cookie_categories ) ) {
400
+
401
+ foreach ( $cookie_categories as $slug => $data ) {
402
 
403
+ if ( isset( $data['status'] ) && $data['status'] === true ) {
404
+
405
+ $cookies = ( isset( $data['cookies'] ) && is_array( $data['cookies'] ) ) ? $data['cookies'] : array();
406
  $cookie_list = array();
407
+ $strict = isset( $data['strict'] ) ? $data['strict'] : false;
408
+
409
+ if ( ! empty( $cookies ) ) {
410
  foreach ( $cookies as $key => $cookie ) {
411
 
412
+ $sensitivity = get_post_meta( $cookie->ID, '_cli_cookie_sensitivity', true );
413
+ $cookie_title = get_post_meta( $cookie->ID, '_cli_cookie_slugid', true );
414
+ $cookie_id = ( ' ' !== $cookie_title ) ? $cookie_title : $cookie->post_title;
415
 
416
+ if ( 'non-necessary' === $sensitivity || false === $strict ) {
417
+ if ( false === $this->maybe_plugin_cookie( $cookie_id ) ) {
418
  $cookie_list[] = $cookie_id;
419
  }
420
  }
421
  }
422
+ }
423
  }
424
+ if ( ! empty( $cookie_list ) ) {
425
  $categories[ $slug ] = $cookie_list;
426
  }
427
  }
 
428
  }
429
  return $categories;
430
  }
431
  public function maybe_plugin_cookie( $cookie ) {
432
+ if ( 'viewed_cookie_policy' === $cookie || false !== strpos( $cookie, 'cookielawinfo-checkbox' ) ) {
433
  return true;
434
  }
435
  return false;
436
  }
437
  /**
438
+ * Check whether any page editor is active or not
439
+ *
440
+ * @since 2.0.5
441
+ * @return bool
442
+ */
443
  public function is_page_editor_active() {
444
  global $wp_customize;
445
+ if ( isset( $_GET['et_fb'] )
446
+ || ( defined( 'ET_FB_ENABLED' ) && ET_FB_ENABLED )
447
+ || isset( $_GET['elementor-preview'] )
448
+ || isset( $_POST['cs_preview_state'] )
449
+ || isset( $wp_customize )
450
  ) {
451
  return true;
452
  }
public/css/cookie-law-info-gdpr.css CHANGED
@@ -1,35 +1,35 @@
1
  .gdpr-container-fluid {
2
- width: 100%;
3
- padding-right: 15px;
4
- padding-left: 15px;
5
- margin-right: auto;
6
- margin-left: auto;
7
  }
8
  .gdpr-row {
9
  display: -ms-flexbox;
10
- display: flex;
11
- -ms-flex-wrap: wrap;
12
- flex-wrap: wrap;
13
- margin-right: -15px;
14
- margin-left: -15px;
15
  }
16
  .gdpr-col-4 {
17
- -ms-flex: 0 0 33.333333%;
18
- flex: 0 0 33.333333%;
19
- max-width: 33.333333%;
20
  }
21
  .gdpr-col-8 {
22
- -ms-flex: 0 0 66.666667%;
23
- flex: 0 0 66.666667%;
24
- max-width: 66.666667%;
25
  }
26
  .gdpr-align-items-stretch {
27
- -ms-flex-align: stretch!important;
28
- align-items: stretch!important;
29
  }
30
  .gdpr-d-flex {
31
- display: -ms-flexbox!important;
32
- display: flex!important;
33
  }
34
  .gdpr-px-0 {
35
  padding-left: 0;
@@ -39,101 +39,101 @@
39
  opacity: .8;
40
  }
41
  .modal-open {
42
- overflow: hidden
43
  }
44
 
45
  .modal-open .gdpr-modal {
46
- overflow-x: hidden;
47
- overflow-y: auto
48
  }
49
 
50
  .gdpr-modal.fade .gdpr-modal-dialog {
51
- transition: -webkit-transform .3s ease-out;
52
- transition: transform .3s ease-out;
53
- transition: transform .3s ease-out,-webkit-transform .3s ease-out;
54
- -webkit-transform: translate(0,-25%);
55
- transform: translate(0,-25%)
56
  }
57
 
58
  .gdpr-modal.show .gdpr-modal-dialog {
59
- -webkit-transform: translate(0,0);
60
- transform: translate(0,0)
61
  }
62
 
63
  .modal-backdrop {
64
- position: fixed;
65
- top: 0;
66
- right: 0;
67
- bottom: 0;
68
- left: 0;
69
- z-index: 1039;
70
- background-color: #000
71
  }
72
 
73
  .modal-backdrop.fade {
74
- opacity: 0
75
  }
76
 
77
  .modal-backdrop.show {
78
- opacity: .5
79
  }
80
 
81
  .gdpr-modal {
82
  position: fixed;
83
- top: 0;
84
- right: 0;
85
- bottom: 0;
86
- left: 0;
87
- z-index: 1050;
88
- display: none;
89
- overflow: hidden;
90
- outline: 0
91
  }
92
  .gdpr-modal a {
93
  text-decoration: none;
94
  }
95
  .gdpr-modal .gdpr-modal-dialog {
96
  position: relative;
97
- width: auto;
98
- margin: .5rem;
99
- pointer-events: none;
100
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
101
- font-size: 1rem;
102
- font-weight: 400;
103
- line-height: 1.5;
104
- color: #212529;
105
  text-align: left;
106
  display: -ms-flexbox;
107
- display: flex;
108
- -ms-flex-align: center;
109
- align-items: center;
110
- min-height: calc(100% - (.5rem * 2))
111
  }
112
  @media (min-width: 576px) {
113
- .gdpr-modal .gdpr-modal-dialog {
114
- max-width:500px;
115
  margin: 1.75rem auto;
116
- min-height: calc(100% - (1.75rem * 2));
117
- }
118
  }
119
  @media (min-width: 992px) {
120
  .gdpr-modal .gdpr-modal-dialog {
121
- max-width: 900px;
122
  }
123
  }
124
  .gdpr-modal-content {
125
  position: relative;
126
- display: -ms-flexbox;
127
- display: flex;
128
- -ms-flex-direction: column;
129
- flex-direction: column;
130
- width: 100%;
131
- pointer-events: auto;
132
- background-color: #fff;
133
- background-clip: padding-box;
134
- border: 1px solid rgba(0,0,0,.2);
135
- border-radius: .3rem;
136
- outline: 0
137
  }
138
  .gdpr-modal .row {
139
  margin: 0 -15px;
@@ -141,8 +141,8 @@
141
  .gdpr-modal .modal-body {
142
  padding: 0;
143
  position: relative;
144
- -ms-flex: 1 1 auto;
145
- flex: 1 1 auto;
146
  }
147
  .gdpr-modal .close {
148
  position: absolute;
@@ -150,14 +150,14 @@
150
  top: 10px;
151
  z-index: 1;
152
  padding: 0;
153
- background-color: transparent;
154
- border: 0;
155
  -webkit-appearance: none;
156
  font-size: 1.5rem;
157
- font-weight: 700;
158
- line-height: 1;
159
- color: #000;
160
- text-shadow: 0 1px 0 #fff;
161
  }
162
  .gdpr-modal .close:focus {
163
  outline: 0;
@@ -207,26 +207,26 @@
207
  border-radius: 50%;
208
  }
209
  .gdpr-tab-content>.gdpr-tab-pane {
210
- display: none;
211
  }
212
  .gdpr-tab-content>.active {
213
- display: block;
214
  }
215
  .gdpr-fade {
216
- transition: opacity .15s linear;
217
  }
218
  .gdpr-nav-pills {
219
  display: -ms-flexbox;
220
- display: flex;
221
- -ms-flex-wrap: wrap;
222
- flex-wrap: wrap;
223
- padding-left: 0;
224
- margin-bottom: 0;
225
  list-style: none;
226
  -ms-flex-direction: column !important;
227
- flex-direction: column !important;
228
- align-items: stretch !important;
229
- -ms-align-items: stretch !important;
230
  }
231
  .nav.gdpr-nav-pills, .gdpr-tab-content {
232
  width: 100%;
@@ -262,20 +262,20 @@
262
  color: #ffffff;
263
  font-size: 14px;
264
  display: inline-block;
265
- font-weight: 400;
266
- text-align: center;
267
- white-space: nowrap;
268
- vertical-align: middle;
269
- -webkit-user-select: none;
270
- -moz-user-select: none;
271
- -ms-user-select: none;
272
- user-select: none;
273
- border: 1px solid transparent;
274
- padding: .375rem .75rem;
275
- font-size: 1rem;
276
- line-height: 1.5;
277
- border-radius: .25rem;
278
- transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
279
  }
280
  .gdpr-tab-content p {
281
  color: #343438;
@@ -286,10 +286,10 @@
286
  font-size: 20px;
287
  margin-bottom: .5rem;
288
  margin-top: 0;
289
- font-family: inherit;
290
- font-weight: 500;
291
- line-height: 1.2;
292
- color: inherit;
293
  }
294
 
295
 
@@ -483,109 +483,109 @@
483
  font-size: 14px;
484
  }
485
  .cli-switch input[type="checkbox"] {
486
- display:none;
487
  }
488
  .cli-switch .cli-slider {
489
- background-color: #e3e1e8;
490
- height: 24px;
491
- width: 50px;
492
- bottom: 0;
493
- cursor: pointer;
494
- left: 0;
495
- position: absolute;
496
- right: 0;
497
- top: 0;
498
- transition: .4s;
499
  }
500
  .cli-switch .cli-slider:before {
501
- background-color: #fff;
502
- bottom: 2px;
503
- content: "";
504
- height: 20px;
505
- left: 2px;
506
- position: absolute;
507
- transition: .4s;
508
- width: 20px;
509
  }
510
  .cli-switch input:checked + .cli-slider {
511
- background-color: #00acad
512
  }
513
  .cli-switch input:checked + .cli-slider:before {
514
- transform: translateX(26px);
515
  }
516
  .cli-switch .cli-slider {
517
- border-radius: 34px;
518
  }
519
  .cli-switch .cli-slider:before {
520
- border-radius: 50%;
521
  }
522
  .cli-tab-content {
523
  background: #ffffff;
524
  }
525
  .cli-tab-content>.cli-active {
526
- display: block;
527
  }
528
  .cli-fade {
529
- transition: opacity .15s linear;
530
  }
531
  .cli-nav-pills {
532
- display: -ms-flexbox;
533
- display: flex;
534
- -ms-flex-wrap: wrap;
535
- flex-wrap: wrap;
536
- padding-left: 0;
537
- margin-bottom: 0;
538
- list-style: none;
539
- -ms-flex-direction: column;
540
- flex-direction: column;
541
  }
542
  .cli-nav-pills, .cli-tab-content {
543
- width: 100%;
544
- padding: 30px;
545
  }
546
  @media (max-width: 767px) {
547
  .cli-nav-pills, .cli-tab-content {
548
- padding: 30px 10px;
549
  }
550
  }
551
  .cli-nav-pills {
552
- background: #f3f3f3;
553
  }
554
  .cli-nav-pills .cli-nav-link {
555
- border: 1px solid #00acad;
556
- margin-bottom: 10px;
557
- color: #00acad;
558
- font-size: 14px;
559
- display: block;
560
- padding: .5rem 1rem;
561
- border-radius: .25rem;
562
- cursor: pointer
563
  }
564
  .cli-nav-pills .cli-nav-link.cli-active, .cli-nav-pills .cli-show>.cli-nav-link {
565
- background-color: #00acad;
566
- border: 1px solid #00acad;
567
  }
568
  .cli-nav-pills .cli-nav-link.cli-active {
569
- color: #ffffff;
570
  }
571
  .cli-tab-content .cli-button-wrapper {
572
- padding-top: 30px;
573
- margin-top: 30px;
574
- border-top: 1px solid #d6d6d6;
575
  }
576
  .cli-tab-content p {
577
- color: #343438;
578
- font-size: 14px;
579
- margin-top: 0;
580
  }
581
  .cli-tab-content h4 {
582
- font-size: 20px;
583
- margin-bottom: 1.5rem;
584
- margin-top: 0;
585
- font-family: inherit;
586
- font-weight: 500;
587
- line-height: 1.2;
588
- color: inherit;
589
  }
590
  /* Settings Popup */
591
  .cli-container-fluid {
@@ -686,14 +686,14 @@ background: #ffffff;
686
  bottom: 0;
687
  left: 0;
688
  z-index: 1040;
689
- background-color: #000;
690
- -webkit-transform:scale(0);
691
- transform:scale(0);
692
- transition: opacity ease-in-out 0.5s;
693
  }
694
  .cli-modal-backdrop.cli-fade {
695
  opacity: 0;
696
-
697
  }
698
  .cli-modal-backdrop.cli-show {
699
  opacity: .5;
@@ -707,10 +707,10 @@ background: #ffffff;
707
  bottom: 0;
708
  left: 0;
709
  z-index: 99999;
710
- transform: scale(0);
711
  overflow: hidden;
712
- outline: 0;
713
- display: none;
714
  }
715
  .cli-modal a {
716
  text-decoration: none;
@@ -766,36 +766,36 @@ background: #ffffff;
766
  outline: 0;
767
  }
768
  .cli-switch {
769
- display: inline-block;
770
- position: relative;
771
- min-height: 1px;
772
- padding-left: 38px;
773
- font-size: 14px;
774
  }
775
  .cli-switch input[type="checkbox"] {
776
- display:none;
777
  }
778
  .cli-switch .cli-slider {
779
- background-color: #e3e1e8;
780
  height: 20px;
781
- width: 38px;
782
- bottom: 0;
783
- cursor: pointer;
784
- left: 0;
785
- position: absolute;
786
- right: 0;
787
- top: 0;
788
- transition: .4s;
789
  }
790
  .cli-switch .cli-slider:before {
791
  background-color: #fff;
792
- bottom: 2px;
793
- content: "";
794
- height: 15px;
795
- left: 3px;
796
- position: absolute;
797
- transition: .4s;
798
- width: 15px;
799
  }
800
  .cli-switch input:checked + .cli-slider {
801
  background-color: #61a229;
@@ -804,78 +804,78 @@ background: #ffffff;
804
  transform: translateX(18px);
805
  }
806
  .cli-switch .cli-slider {
807
- border-radius: 34px;
808
- font-size:0;
809
  }
810
  .cli-switch .cli-slider:before {
811
- border-radius: 50%;
812
  }
813
  .cli-tab-content {
814
  background: #ffffff;
815
  }
816
  .cli-nav-pills {
817
- display: -ms-flexbox;
818
- display: flex;
819
- -ms-flex-wrap: wrap;
820
- flex-wrap: wrap;
821
- padding-left: 0;
822
- margin-bottom: 0;
823
- list-style: none;
824
- -ms-flex-direction: column;
825
- flex-direction: column;
826
  }
827
  .cli-nav-pills, .cli-tab-content {
828
- width: 100%;
829
- padding:5px 30px 5px 5px;
830
  box-sizing: border-box;
831
  }
832
  @media (max-width: 767px) {
833
  .cli-nav-pills, .cli-tab-content {
834
- padding: 30px 10px;
835
  }
836
  }
837
  .cli-nav-pills {
838
- background: #fff;
839
  }
840
  .cli-nav-pills .cli-nav-link {
841
- border: 1px solid #cccccc;
842
- margin-bottom: 10px;
843
- color:#2a2a2a;
844
- font-size: 14px;
845
- display: block;
846
- padding: .5rem 1rem;
847
- border-radius: .25rem;
848
- cursor: pointer
849
  }
850
  .cli-nav-pills .cli-nav-link.cli-active, .cli-nav-pills .cli-show>.cli-nav-link {
851
- background-color: #f6f6f9;
852
- border: 1px solid #cccccc;
853
  }
854
  .cli-nav-pills .cli-nav-link.cli-active {
855
- color:#2a2a2a;
856
  }
857
  .cli-tab-content .cli-button-wrapper {
858
- padding-top: 30px;
859
- margin-top: 30px;
860
- border-top: 1px solid #d6d6d6;
861
  }
862
  .cli-tab-content p {
863
- color: #343438;
864
- font-size: 14px;
865
- margin-top: 0;
866
  }
867
  .cli-tab-content h4 {
868
- font-size: 20px;
869
- margin-bottom: 1.5rem;
870
- margin-top: 0;
871
- font-family: inherit;
872
- font-weight: 500;
873
- line-height: 1.2;
874
- color: inherit;
875
  }
876
  /* Cookie Settings In Bar */
877
  #cookie-law-info-bar .cli-nav-pills,#cookie-law-info-bar .cli-tab-content,#cookie-law-info-bar .cli-nav-pills .cli-show>.cli-nav-link,#cookie-law-info-bar a.cli-nav-link.cli-active{
878
- background: transparent;
879
  }
880
 
881
  #cookie-law-info-bar .cli-nav-pills .cli-nav-link.cli-active,#cookie-law-info-bar .cli-nav-link,#cookie-law-info-bar .cli-tab-container p,#cookie-law-info-bar span.cli-necessary-caption,#cookie-law-info-bar .cli-switch .cli-slider:after
@@ -885,7 +885,7 @@ color:inherit;
885
  #cookie-law-info-bar .cli-tab-header a:before
886
  {
887
  border-right: 1px solid currentColor;
888
- border-bottom: 1px solid currentColor;
889
  }
890
  #cookie-law-info-bar .cli-row
891
  {
@@ -902,15 +902,15 @@ color:inherit;
902
  #cookie-law-info-bar .cli-col-8
903
  {
904
  flex-basis: 0;
905
- -webkit-box-flex: 1;
906
- -ms-flex-positive: 1;
907
- flex-grow: 1;
908
- max-width: 100%;
909
  }
910
  .cli-wrapper {
911
- max-width: 90%;
912
- float: none;
913
- margin: 0 auto;
914
  }
915
  #cookie-law-info-bar .cli-tab-content h4
916
  {
@@ -928,20 +928,20 @@ color:inherit;
928
 
929
  /* Popup Footer Styles */
930
  .cli-tab-footer .cli-btn {
931
- background-color: #00acad;
932
- padding: 10px 15px;
933
- text-decoration:none;
934
  }
935
  .cli-tab-footer .wt-cli-privacy-accept-btn {
936
- background-color: #61a229;
937
- color: #ffffff;
938
- border-radius: 0;
939
  }
940
 
941
  .cli-tab-footer {
942
  width:100%;
943
  text-align:right;
944
- padding: 20px 0;
945
  }
946
  /* version 2.0 */
947
  .cli-col-12
@@ -954,88 +954,88 @@ color:inherit;
954
  justify-content: space-between;
955
  }
956
  .cli-tab-header a:before {
957
- width: 10px;
958
- height: 2px;
959
- left: 0;
960
- top: calc(50% - 1px);
961
  }
962
  .cli-tab-header a:after {
963
- width: 2px;
964
- height: 10px;
965
- left: 4px;
966
- top: calc(50% - 5px);
967
- -webkit-transform: none;
968
- transform: none;
969
  }
970
  .cli-tab-header a:before {
971
  width: 7px;
972
- height: 7px;
973
- border-right: 1px solid #4a6e78;
974
- border-bottom: 1px solid #4a6e78;
975
- content: " ";
976
- transform: rotate(-45deg);
977
- -webkit-transition: all 0.2s ease-in-out;
978
- -moz-transition: all 0.2s ease-in-out;
979
  transition: all 0.2s ease-in-out;
980
  margin-right:10px;
981
  }
982
  .cli-tab-header a.cli-nav-link {
983
- position: relative;
984
  display: flex;
985
- align-items: center;
986
  font-size:14px;
987
- color:#000;
988
- text-transform: capitalize;
989
-
990
  }
991
  .cli-tab-header.cli-tab-active .cli-nav-link:before
992
  {
993
- transform: rotate(45deg);
994
- -webkit-transition: all 0.2s ease-in-out;
995
- -moz-transition: all 0.2s ease-in-out;
996
- transition: all 0.2s ease-in-out;
997
  }
998
  .cli-tab-header {
999
- border-radius: 5px;
1000
- padding: 12px 15px;
1001
- cursor: pointer;
1002
- transition: background-color 0.2s ease-out 0.3s, color 0.2s ease-out 0s;
1003
- background-color:#f2f2f2;
1004
  }
1005
  .cli-modal .cli-modal-close {
1006
- position: absolute;
1007
- right: 0;
1008
- top: 0;
1009
- z-index: 1;
1010
- -webkit-appearance: none;
1011
- width: 40px;
1012
- height: 40px;
1013
- padding: 0;
1014
- border-radius: 50%;
1015
  padding: 10px;
1016
  background: transparent;
1017
- border:none;
1018
- min-width: 40px;
1019
  }
1020
  .cli-tab-container h4,.cli-tab-container h1 {
1021
  font-family: inherit;
1022
- font-size: 16px;
1023
- margin-bottom: 15px;
1024
  margin:10px 0;
1025
  }
1026
  #cliSettingsPopup .cli-tab-section-container {
1027
- padding-top: 12px;
1028
  }
1029
  .cli-tab-container p ,.cli-privacy-content-text{
1030
- font-size: 14px;
1031
- line-height: 1.4;
1032
- margin-top: 0;
1033
- padding: 0;
1034
- color: #000;
1035
  }
1036
  .wt-cli-privacy
1037
  {
1038
- display:none;
1039
  }
1040
  .cli-tab-content
1041
  {
@@ -1056,12 +1056,12 @@ color:inherit;
1056
  }
1057
  .cli-switch .cli-slider:after{
1058
  content: attr(data-cli-disable);
1059
- position: absolute;
1060
- right: 50px;
1061
  color: #000;
1062
  font-size:12px;
1063
- text-align:right;
1064
- min-width: 80px;
1065
  }
1066
  .cli-switch input:checked + .cli-slider:after
1067
  {
@@ -1069,31 +1069,31 @@ color:inherit;
1069
  }
1070
  .cli-privacy-overview:not(.cli-collapsed) .cli-privacy-content {
1071
  max-height: 60px;
1072
- transition: max-height 0.15s ease-out;
1073
- overflow: hidden;
1074
  }
1075
  a.cli-privacy-readmore {
1076
- font-size: 12px;
1077
- margin-top: 12px;
1078
- display: inline-block;
1079
- padding-bottom: 0;
1080
- cursor: pointer;
1081
- color:#000;
1082
- text-decoration: underline;
1083
  }
1084
  .cli-modal-footer {
1085
- position: relative;
1086
  }
1087
  a.cli-privacy-readmore:before {
1088
- content: attr(data-readmore-text);
1089
  }
1090
  .cli-collapsed a.cli-privacy-readmore:before {
1091
- content: attr(data-readless-text);
1092
  }
1093
 
1094
  .cli-collapsed .cli-privacy-content
1095
  {
1096
- transition: max-height 0.25s ease-in;
1097
 
1098
  }
1099
  .cli-privacy-content p
@@ -1101,284 +1101,284 @@ a.cli-privacy-readmore:before {
1101
  margin-bottom:0;
1102
  }
1103
  .cli-modal-close svg {
1104
- fill: #000;
1105
  }
1106
  span.cli-necessary-caption {
1107
- color: #000;
1108
- font-size: 12px;
1109
  }
1110
  .cli-tab-section.cli-privacy-tab {
1111
- display: none;
1112
  }
1113
  #cookie-law-info-bar .cli-tab-section.cli-privacy-tab {
1114
- display: block;
1115
  }
1116
  #cookie-law-info-bar .cli-privacy-overview {
1117
- display: none;
1118
  }
1119
  .cli-tab-container .cli-row
1120
  {
1121
  max-height: 500px;
1122
- overflow-y: auto;
1123
  }
1124
  .cli-modal.cli-blowup.cli-out {
1125
- z-index: -1;
1126
  }
1127
  .cli-modal.cli-blowup {
1128
- z-index: 999999;
1129
- transform: scale(1);
1130
-
1131
  }
1132
  .cli-modal.cli-blowup .cli-modal-dialog {
1133
- animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
1134
  }
1135
  .cli-modal.cli-blowup.cli-out .cli-modal-dialog
1136
  {
1137
- animation: blowUpModalTwo 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
1138
  }
1139
  @keyframes blowUpContent {
1140
- 0% {
1141
- transform: scale(1);
1142
- opacity: 1;
1143
- }
1144
- 99.9% {
1145
- transform: scale(2);
1146
- opacity: 0;
1147
- }
1148
- 100% {
1149
- transform: scale(0);
1150
- }
1151
  }
1152
  @keyframes blowUpContentTwo {
1153
- 0% {
1154
- transform: scale(2);
1155
- opacity: 0;
1156
- }
1157
- 100% {
1158
- transform: scale(1);
1159
- opacity: 1;
1160
- }
1161
  }
1162
  @keyframes blowUpModal {
1163
- 0% {
1164
- transform: scale(0);
1165
- }
1166
- 100% {
1167
- transform: scale(1);
1168
- }
1169
  }
1170
  @keyframes blowUpModalTwo {
1171
- 0% {
1172
- transform: scale(1);
1173
- opacity: 1;
1174
- }
1175
- 50% {
1176
- transform: scale(0.5);
1177
- opacity: 0;
1178
- }
1179
- 100% {
1180
- transform: scale(0);
1181
- opacity: 0;
1182
- }
1183
  }
1184
  .cli-tab-section .cookielawinfo-row-cat-table td, .cli-tab-section .cookielawinfo-row-cat-table th {
1185
- font-size: 12px;
1186
  }
1187
  .cli_settings_button
1188
  {
1189
- cursor: pointer;
1190
  }
1191
  /* Accessibility Fix */
1192
  .wt-cli-sr-only
1193
  {
1194
- display: none;
1195
- font-size:16px;
1196
  }
1197
- /* Changes for CCPA
1198
  Version : 1.8.9
1199
  */
1200
  a.wt-cli-element.cli_cookie_close_button {
1201
- text-decoration: none;
1202
- color: #333333;
1203
- font-size: 22px;
1204
- line-height: 22px;
1205
- cursor: pointer;
1206
- position: absolute;
1207
- right: 10px;
1208
- top: 5px;
1209
  }
1210
  /* GDPR Bar Version 2 */
1211
  .cli-bar-container{
1212
- float: none;
1213
- margin: 0 auto;
1214
- display: -webkit-box;
1215
- display: -moz-box;
1216
- display: -ms-flexbox;
1217
- display: -webkit-flex;
1218
- display: flex;
1219
- justify-content: space-between;
1220
- -webkit-box-align: center;
1221
- -moz-box-align: center;
1222
- -ms-flex-align: center;
1223
- -webkit-align-items: center;
1224
- align-items: center;
1225
  }
1226
  .cli-bar-btn_container {
1227
- margin-left: 20px;
1228
- display: -webkit-box;
1229
- display: -moz-box;
1230
- display: -ms-flexbox;
1231
- display: -webkit-flex;
1232
- display: flex;
1233
- -webkit-box-align: center;
1234
- -moz-box-align: center;
1235
- -ms-flex-align: center;
1236
- -webkit-align-items: center;
1237
- align-items: center;
1238
- flex-wrap: nowrap;
1239
  }
1240
  .cli-style-v2 a
1241
  {
1242
- cursor: pointer;
1243
  }
1244
  .cli-bar-btn_container a {
1245
- white-space: nowrap;
1246
  }
1247
- .cli-style-v2 .cli-plugin-main-link
1248
  {
1249
- font-weight:inherit;
1250
  }
1251
- .cli-style-v2
1252
- {
1253
- font-size: 11pt;
1254
- line-height: 18px;
1255
- font-weight:normal;
1256
  }
1257
  #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-container,#cookie-law-info-bar[data-cli-type="popup"] .cli-bar-container{
1258
- display: block;
1259
  }
1260
  .cli-style-v2 .cli-bar-message {
1261
- width: 70%;
1262
- text-align: left;
1263
  }
1264
  #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-message,#cookie-law-info-bar[data-cli-type="popup"] .cli-bar-message
1265
  {
1266
- width:100%;
1267
  }
1268
  #cookie-law-info-bar[data-cli-type="widget"] .cli-style-v2 .cli-bar-btn_container {
1269
- margin-top:8px;
1270
- margin-left: 0px;
1271
- flex-wrap: wrap;
1272
  }
1273
  /* #cookie-law-info-bar[data-cli-type="widget"] .cli-style-v2 .cli-bar-message {
1274
- text-align: center;
1275
  } */
1276
  #cookie-law-info-bar[data-cli-type="popup"] .cli-style-v2 .cli-bar-btn_container {
1277
- margin-top:8px;
1278
- margin-left: 0px;
1279
  }
1280
  #cookie-law-info-bar[data-cli-style="cli-style-v2"] .cli_messagebar_head{
1281
- text-align: left;
1282
- /* padding-left: 15px; */
1283
- margin-bottom: 5px;
1284
- margin-top: 0px;
1285
- font-size: 16px;
1286
  }
1287
  /* #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-container.cli-style-v2 {
1288
- padding-left: 0px;
1289
- padding-right: 0px;
1290
  } */
1291
 
1292
  .cli-style-v2 .cli-bar-message .wt-cli-ccpa-element,.cli-style-v2 .cli-bar-message .wt-cli-ccpa-checkbox {
1293
- margin-top: 5px;
1294
  }
1295
  .cli-style-v2 .cli-bar-btn_container .cli_action_button ,
1296
  .cli-style-v2 .cli-bar-btn_container .cli-plugin-main-link,
1297
  .cli-style-v2 .cli-bar-btn_container .cli_settings_button
1298
  {
1299
- margin-left: 5px;
1300
  }
1301
  .wt-cli-ccpa-checkbox label {
1302
- font-size: inherit;
1303
- cursor: pointer;
1304
- margin: 0px 0px 0px 5px;
1305
  }
1306
  /* .cli-bar-container.cli-style-v2 {
1307
- padding-left: 15px;
1308
- padding-right: 15px;
1309
- padding-top: 2px;
1310
- padding-bottom: 2px;
1311
  } */
1312
- #cookie-law-info-bar[data-cli-style="cli-style-v2"]
1313
  {
1314
- padding: 14px 25px;
1315
  }
1316
  #cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="widget"]
1317
  {
1318
- padding:32px 30px;
1319
  }
1320
  #cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="popup"] {
1321
- padding: 32px 45px;
1322
  }
1323
  .cli-style-v2 .cli-plugin-main-link:not(.cli-plugin-button), .cli-style-v2 .cli_settings_button:not(.cli-plugin-button),.cli-style-v2 .cli_action_button:not(.cli-plugin-button){
1324
- text-decoration: underline;
1325
  }
1326
  .cli-style-v2 .cli-bar-btn_container .cli-plugin-button {
1327
- margin-top: 5px;
1328
- margin-bottom: 5px;
1329
  }
1330
  a.wt-cli-ccpa-opt-out {
1331
- white-space: nowrap;
1332
- text-decoration: underline;
1333
  }
1334
  .wt-cli-necessary-checkbox {
1335
- display: none !important;
1336
  }
1337
  @media (max-width: 985px) {
1338
- .cli-style-v2 .cli-bar-message
1339
- {
1340
- width:100%;
1341
- }
1342
- .cli-style-v2.cli-bar-container
1343
- {
1344
- justify-content:left;
1345
- flex-wrap: wrap;
1346
- }
1347
- .cli-style-v2 .cli-bar-btn_container {
1348
- margin-left:0px;
1349
- margin-top: 10px;
1350
- }
1351
- #cookie-law-info-bar[data-cli-style="cli-style-v2"],#cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="widget"],#cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="popup"]
1352
- {
1353
- padding: 25px 25px;
1354
- }
1355
  }
1356
  /* Settings popup footer section */
1357
  .wt-cli-ckyes-brand-logo {
1358
- display: flex;
1359
- align-items: center;
1360
- font-size: 9px;
1361
- color: #111111;
1362
- font-weight: normal;
1363
  }
1364
  .wt-cli-ckyes-brand-logo img{
1365
- width: 65px;
1366
- margin-left: 2px;
1367
  }
1368
  .wt-cli-privacy-overview-actions {
1369
- padding-bottom:0;
1370
  }
1371
  @media only screen and (max-width: 479px) and (min-width: 320px){
1372
-
1373
- .cli-style-v2 .cli-bar-btn_container {
1374
- flex-wrap: wrap;
1375
- }
1376
  }
1377
  /* Fix: HTML validation error due to the enclosing of <p> tags on category description */
1378
  .wt-cli-cookie-description {
1379
- font-size: 14px;
1380
- line-height: 1.4;
1381
- margin-top: 0;
1382
- padding: 0;
1383
- color: #000;
1384
- }
1
  .gdpr-container-fluid {
2
+ width: 100%;
3
+ padding-right: 15px;
4
+ padding-left: 15px;
5
+ margin-right: auto;
6
+ margin-left: auto;
7
  }
8
  .gdpr-row {
9
  display: -ms-flexbox;
10
+ display: flex;
11
+ -ms-flex-wrap: wrap;
12
+ flex-wrap: wrap;
13
+ margin-right: -15px;
14
+ margin-left: -15px;
15
  }
16
  .gdpr-col-4 {
17
+ -ms-flex: 0 0 33.333333%;
18
+ flex: 0 0 33.333333%;
19
+ max-width: 33.333333%;
20
  }
21
  .gdpr-col-8 {
22
+ -ms-flex: 0 0 66.666667%;
23
+ flex: 0 0 66.666667%;
24
+ max-width: 66.666667%;
25
  }
26
  .gdpr-align-items-stretch {
27
+ -ms-flex-align: stretch!important;
28
+ align-items: stretch!important;
29
  }
30
  .gdpr-d-flex {
31
+ display: -ms-flexbox!important;
32
+ display: flex!important;
33
  }
34
  .gdpr-px-0 {
35
  padding-left: 0;
39
  opacity: .8;
40
  }
41
  .modal-open {
42
+ overflow: hidden
43
  }
44
 
45
  .modal-open .gdpr-modal {
46
+ overflow-x: hidden;
47
+ overflow-y: auto
48
  }
49
 
50
  .gdpr-modal.fade .gdpr-modal-dialog {
51
+ transition: -webkit-transform .3s ease-out;
52
+ transition: transform .3s ease-out;
53
+ transition: transform .3s ease-out,-webkit-transform .3s ease-out;
54
+ -webkit-transform: translate(0,-25%);
55
+ transform: translate(0,-25%)
56
  }
57
 
58
  .gdpr-modal.show .gdpr-modal-dialog {
59
+ -webkit-transform: translate(0,0);
60
+ transform: translate(0,0)
61
  }
62
 
63
  .modal-backdrop {
64
+ position: fixed;
65
+ top: 0;
66
+ right: 0;
67
+ bottom: 0;
68
+ left: 0;
69
+ z-index: 1039;
70
+ background-color: #000
71
  }
72
 
73
  .modal-backdrop.fade {
74
+ opacity: 0
75
  }
76
 
77
  .modal-backdrop.show {
78
+ opacity: .5
79
  }
80
 
81
  .gdpr-modal {
82
  position: fixed;
83
+ top: 0;
84
+ right: 0;
85
+ bottom: 0;
86
+ left: 0;
87
+ z-index: 1050;
88
+ display: none;
89
+ overflow: hidden;
90
+ outline: 0
91
  }
92
  .gdpr-modal a {
93
  text-decoration: none;
94
  }
95
  .gdpr-modal .gdpr-modal-dialog {
96
  position: relative;
97
+ width: auto;
98
+ margin: .5rem;
99
+ pointer-events: none;
100
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
101
+ font-size: 1rem;
102
+ font-weight: 400;
103
+ line-height: 1.5;
104
+ color: #212529;
105
  text-align: left;
106
  display: -ms-flexbox;
107
+ display: flex;
108
+ -ms-flex-align: center;
109
+ align-items: center;
110
+ min-height: calc(100% - (.5rem * 2))
111
  }
112
  @media (min-width: 576px) {
113
+ .gdpr-modal .gdpr-modal-dialog {
114
+ max-width:500px;
115
  margin: 1.75rem auto;
116
+ min-height: calc(100% - (1.75rem * 2));
117
+ }
118
  }
119
  @media (min-width: 992px) {
120
  .gdpr-modal .gdpr-modal-dialog {
121
+ max-width: 900px;
122
  }
123
  }
124
  .gdpr-modal-content {
125
  position: relative;
126
+ display: -ms-flexbox;
127
+ display: flex;
128
+ -ms-flex-direction: column;
129
+ flex-direction: column;
130
+ width: 100%;
131
+ pointer-events: auto;
132
+ background-color: #fff;
133
+ background-clip: padding-box;
134
+ border: 1px solid rgba(0,0,0,.2);
135
+ border-radius: .3rem;
136
+ outline: 0
137
  }
138
  .gdpr-modal .row {
139
  margin: 0 -15px;
141
  .gdpr-modal .modal-body {
142
  padding: 0;
143
  position: relative;
144
+ -ms-flex: 1 1 auto;
145
+ flex: 1 1 auto;
146
  }
147
  .gdpr-modal .close {
148
  position: absolute;
150
  top: 10px;
151
  z-index: 1;
152
  padding: 0;
153
+ background-color: transparent;
154
+ border: 0;
155
  -webkit-appearance: none;
156
  font-size: 1.5rem;
157
+ font-weight: 700;
158
+ line-height: 1;
159
+ color: #000;
160
+ text-shadow: 0 1px 0 #fff;
161
  }
162
  .gdpr-modal .close:focus {
163
  outline: 0;
207
  border-radius: 50%;
208
  }
209
  .gdpr-tab-content>.gdpr-tab-pane {
210
+ display: none;
211
  }
212
  .gdpr-tab-content>.active {
213
+ display: block;
214
  }
215
  .gdpr-fade {
216
+ transition: opacity .15s linear;
217
  }
218
  .gdpr-nav-pills {
219
  display: -ms-flexbox;
220
+ display: flex;
221
+ -ms-flex-wrap: wrap;
222
+ flex-wrap: wrap;
223
+ padding-left: 0;
224
+ margin-bottom: 0;
225
  list-style: none;
226
  -ms-flex-direction: column !important;
227
+ flex-direction: column !important;
228
+ align-items: stretch !important;
229
+ -ms-align-items: stretch !important;
230
  }
231
  .nav.gdpr-nav-pills, .gdpr-tab-content {
232
  width: 100%;
262
  color: #ffffff;
263
  font-size: 14px;
264
  display: inline-block;
265
+ font-weight: 400;
266
+ text-align: center;
267
+ white-space: nowrap;
268
+ vertical-align: middle;
269
+ -webkit-user-select: none;
270
+ -moz-user-select: none;
271
+ -ms-user-select: none;
272
+ user-select: none;
273
+ border: 1px solid transparent;
274
+ padding: .375rem .75rem;
275
+ font-size: 1rem;
276
+ line-height: 1.5;
277
+ border-radius: .25rem;
278
+ transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
279
  }
280
  .gdpr-tab-content p {
281
  color: #343438;
286
  font-size: 20px;
287
  margin-bottom: .5rem;
288
  margin-top: 0;
289
+ font-family: inherit;
290
+ font-weight: 500;
291
+ line-height: 1.2;
292
+ color: inherit;
293
  }
294
 
295
 
483
  font-size: 14px;
484
  }
485
  .cli-switch input[type="checkbox"] {
486
+ display:none;
487
  }
488
  .cli-switch .cli-slider {
489
+ background-color: #e3e1e8;
490
+ height: 24px;
491
+ width: 50px;
492
+ bottom: 0;
493
+ cursor: pointer;
494
+ left: 0;
495
+ position: absolute;
496
+ right: 0;
497
+ top: 0;
498
+ transition: .4s;
499
  }
500
  .cli-switch .cli-slider:before {
501
+ background-color: #fff;
502
+ bottom: 2px;
503
+ content: "";
504
+ height: 20px;
505
+ left: 2px;
506
+ position: absolute;
507
+ transition: .4s;
508
+ width: 20px;
509
  }
510
  .cli-switch input:checked + .cli-slider {
511
+ background-color: #00acad
512
  }
513
  .cli-switch input:checked + .cli-slider:before {
514
+ transform: translateX(26px);
515
  }
516
  .cli-switch .cli-slider {
517
+ border-radius: 34px;
518
  }
519
  .cli-switch .cli-slider:before {
520
+ border-radius: 50%;
521
  }
522
  .cli-tab-content {
523
  background: #ffffff;
524
  }
525
  .cli-tab-content>.cli-active {
526
+ display: block;
527
  }
528
  .cli-fade {
529
+ transition: opacity .15s linear;
530
  }
531
  .cli-nav-pills {
532
+ display: -ms-flexbox;
533
+ display: flex;
534
+ -ms-flex-wrap: wrap;
535
+ flex-wrap: wrap;
536
+ padding-left: 0;
537
+ margin-bottom: 0;
538
+ list-style: none;
539
+ -ms-flex-direction: column;
540
+ flex-direction: column;
541
  }
542
  .cli-nav-pills, .cli-tab-content {
543
+ width: 100%;
544
+ padding: 30px;
545
  }
546
  @media (max-width: 767px) {
547
  .cli-nav-pills, .cli-tab-content {
548
+ padding: 30px 10px;
549
  }
550
  }
551
  .cli-nav-pills {
552
+ background: #f3f3f3;
553
  }
554
  .cli-nav-pills .cli-nav-link {
555
+ border: 1px solid #00acad;
556
+ margin-bottom: 10px;
557
+ color: #00acad;
558
+ font-size: 14px;
559
+ display: block;
560
+ padding: .5rem 1rem;
561
+ border-radius: .25rem;
562
+ cursor: pointer
563
  }
564
  .cli-nav-pills .cli-nav-link.cli-active, .cli-nav-pills .cli-show>.cli-nav-link {
565
+ background-color: #00acad;
566
+ border: 1px solid #00acad;
567
  }
568
  .cli-nav-pills .cli-nav-link.cli-active {
569
+ color: #ffffff;
570
  }
571
  .cli-tab-content .cli-button-wrapper {
572
+ padding-top: 30px;
573
+ margin-top: 30px;
574
+ border-top: 1px solid #d6d6d6;
575
  }
576
  .cli-tab-content p {
577
+ color: #343438;
578
+ font-size: 14px;
579
+ margin-top: 0;
580
  }
581
  .cli-tab-content h4 {
582
+ font-size: 20px;
583
+ margin-bottom: 1.5rem;
584
+ margin-top: 0;
585
+ font-family: inherit;
586
+ font-weight: 500;
587
+ line-height: 1.2;
588
+ color: inherit;
589
  }
590
  /* Settings Popup */
591
  .cli-container-fluid {
686
  bottom: 0;
687
  left: 0;
688
  z-index: 1040;
689
+ background-color: #000;
690
+ -webkit-transform:scale(0);
691
+ transform:scale(0);
692
+ transition: opacity ease-in-out 0.5s;
693
  }
694
  .cli-modal-backdrop.cli-fade {
695
  opacity: 0;
696
+
697
  }
698
  .cli-modal-backdrop.cli-show {
699
  opacity: .5;
707
  bottom: 0;
708
  left: 0;
709
  z-index: 99999;
710
+ transform: scale(0);
711
  overflow: hidden;
712
+ outline: 0;
713
+ display: none;
714
  }
715
  .cli-modal a {
716
  text-decoration: none;
766
  outline: 0;
767
  }
768
  .cli-switch {
769
+ display: inline-block;
770
+ position: relative;
771
+ min-height: 1px;
772
+ padding-left: 38px;
773
+ font-size: 14px;
774
  }
775
  .cli-switch input[type="checkbox"] {
776
+ display:none;
777
  }
778
  .cli-switch .cli-slider {
779
+ background-color: #e3e1e8;
780
  height: 20px;
781
+ width: 38px;
782
+ bottom: 0;
783
+ cursor: pointer;
784
+ left: 0;
785
+ position: absolute;
786
+ right: 0;
787
+ top: 0;
788
+ transition: .4s;
789
  }
790
  .cli-switch .cli-slider:before {
791
  background-color: #fff;
792
+ bottom: 2px;
793
+ content: "";
794
+ height: 15px;
795
+ left: 3px;
796
+ position: absolute;
797
+ transition: .4s;
798
+ width: 15px;
799
  }
800
  .cli-switch input:checked + .cli-slider {
801
  background-color: #61a229;
804
  transform: translateX(18px);
805
  }
806
  .cli-switch .cli-slider {
807
+ border-radius: 34px;
808
+ font-size:0;
809
  }
810
  .cli-switch .cli-slider:before {
811
+ border-radius: 50%;
812
  }
813
  .cli-tab-content {
814
  background: #ffffff;
815
  }
816
  .cli-nav-pills {
817
+ display: -ms-flexbox;
818
+ display: flex;
819
+ -ms-flex-wrap: wrap;
820
+ flex-wrap: wrap;
821
+ padding-left: 0;
822
+ margin-bottom: 0;
823
+ list-style: none;
824
+ -ms-flex-direction: column;
825
+ flex-direction: column;
826
  }
827
  .cli-nav-pills, .cli-tab-content {
828
+ width: 100%;
829
+ padding:5px 30px 5px 5px;
830
  box-sizing: border-box;
831
  }
832
  @media (max-width: 767px) {
833
  .cli-nav-pills, .cli-tab-content {
834
+ padding: 30px 10px;
835
  }
836
  }
837
  .cli-nav-pills {
838
+ background: #fff;
839
  }
840
  .cli-nav-pills .cli-nav-link {
841
+ border: 1px solid #cccccc;
842
+ margin-bottom: 10px;
843
+ color:#2a2a2a;
844
+ font-size: 14px;
845
+ display: block;
846
+ padding: .5rem 1rem;
847
+ border-radius: .25rem;
848
+ cursor: pointer
849
  }
850
  .cli-nav-pills .cli-nav-link.cli-active, .cli-nav-pills .cli-show>.cli-nav-link {
851
+ background-color: #f6f6f9;
852
+ border: 1px solid #cccccc;
853
  }
854
  .cli-nav-pills .cli-nav-link.cli-active {
855
+ color:#2a2a2a;
856
  }
857
  .cli-tab-content .cli-button-wrapper {
858
+ padding-top: 30px;
859
+ margin-top: 30px;
860
+ border-top: 1px solid #d6d6d6;
861
  }
862
  .cli-tab-content p {
863
+ color: #343438;
864
+ font-size: 14px;
865
+ margin-top: 0;
866
  }
867
  .cli-tab-content h4 {
868
+ font-size: 20px;
869
+ margin-bottom: 1.5rem;
870
+ margin-top: 0;
871
+ font-family: inherit;
872
+ font-weight: 500;
873
+ line-height: 1.2;
874
+ color: inherit;
875
  }
876
  /* Cookie Settings In Bar */
877
  #cookie-law-info-bar .cli-nav-pills,#cookie-law-info-bar .cli-tab-content,#cookie-law-info-bar .cli-nav-pills .cli-show>.cli-nav-link,#cookie-law-info-bar a.cli-nav-link.cli-active{
878
+ background: transparent;
879
  }
880
 
881
  #cookie-law-info-bar .cli-nav-pills .cli-nav-link.cli-active,#cookie-law-info-bar .cli-nav-link,#cookie-law-info-bar .cli-tab-container p,#cookie-law-info-bar span.cli-necessary-caption,#cookie-law-info-bar .cli-switch .cli-slider:after
885
  #cookie-law-info-bar .cli-tab-header a:before
886
  {
887
  border-right: 1px solid currentColor;
888
+ border-bottom: 1px solid currentColor;
889
  }
890
  #cookie-law-info-bar .cli-row
891
  {
902
  #cookie-law-info-bar .cli-col-8
903
  {
904
  flex-basis: 0;
905
+ -webkit-box-flex: 1;
906
+ -ms-flex-positive: 1;
907
+ flex-grow: 1;
908
+ max-width: 100%;
909
  }
910
  .cli-wrapper {
911
+ max-width: 90%;
912
+ float: none;
913
+ margin: 0 auto;
914
  }
915
  #cookie-law-info-bar .cli-tab-content h4
916
  {
928
 
929
  /* Popup Footer Styles */
930
  .cli-tab-footer .cli-btn {
931
+ background-color: #00acad;
932
+ padding: 10px 15px;
933
+ text-decoration:none;
934
  }
935
  .cli-tab-footer .wt-cli-privacy-accept-btn {
936
+ background-color: #61a229;
937
+ color: #ffffff;
938
+ border-radius: 0;
939
  }
940
 
941
  .cli-tab-footer {
942
  width:100%;
943
  text-align:right;
944
+ padding: 20px 0;
945
  }
946
  /* version 2.0 */
947
  .cli-col-12
954
  justify-content: space-between;
955
  }
956
  .cli-tab-header a:before {
957
+ width: 10px;
958
+ height: 2px;
959
+ left: 0;
960
+ top: calc(50% - 1px);
961
  }
962
  .cli-tab-header a:after {
963
+ width: 2px;
964
+ height: 10px;
965
+ left: 4px;
966
+ top: calc(50% - 5px);
967
+ -webkit-transform: none;
968
+ transform: none;
969
  }
970
  .cli-tab-header a:before {
971
  width: 7px;
972
+ height: 7px;
973
+ border-right: 1px solid #4a6e78;
974
+ border-bottom: 1px solid #4a6e78;
975
+ content: " ";
976
+ transform: rotate(-45deg);
977
+ -webkit-transition: all 0.2s ease-in-out;
978
+ -moz-transition: all 0.2s ease-in-out;
979
  transition: all 0.2s ease-in-out;
980
  margin-right:10px;
981
  }
982
  .cli-tab-header a.cli-nav-link {
983
+ position: relative;
984
  display: flex;
985
+ align-items: center;
986
  font-size:14px;
987
+ color:#000;
988
+ text-transform: capitalize;
989
+
990
  }
991
  .cli-tab-header.cli-tab-active .cli-nav-link:before
992
  {
993
+ transform: rotate(45deg);
994
+ -webkit-transition: all 0.2s ease-in-out;
995
+ -moz-transition: all 0.2s ease-in-out;
996
+ transition: all 0.2s ease-in-out;
997
  }
998
  .cli-tab-header {
999
+ border-radius: 5px;
1000
+ padding: 12px 15px;
1001
+ cursor: pointer;
1002
+ transition: background-color 0.2s ease-out 0.3s, color 0.2s ease-out 0s;
1003
+ background-color:#f2f2f2;
1004
  }
1005
  .cli-modal .cli-modal-close {
1006
+ position: absolute;
1007
+ right: 0;
1008
+ top: 0;
1009
+ z-index: 1;
1010
+ -webkit-appearance: none;
1011
+ width: 40px;
1012
+ height: 40px;
1013
+ padding: 0;
1014
+ border-radius: 50%;
1015
  padding: 10px;
1016
  background: transparent;
1017
+ border:none;
1018
+ min-width: 40px;
1019
  }
1020
  .cli-tab-container h4,.cli-tab-container h1 {
1021
  font-family: inherit;
1022
+ font-size: 16px;
1023
+ margin-bottom: 15px;
1024
  margin:10px 0;
1025
  }
1026
  #cliSettingsPopup .cli-tab-section-container {
1027
+ padding-top: 12px;
1028
  }
1029
  .cli-tab-container p ,.cli-privacy-content-text{
1030
+ font-size: 14px;
1031
+ line-height: 1.4;
1032
+ margin-top: 0;
1033
+ padding: 0;
1034
+ color: #000;
1035
  }
1036
  .wt-cli-privacy
1037
  {
1038
+ display:none;
1039
  }
1040
  .cli-tab-content
1041
  {
1056
  }
1057
  .cli-switch .cli-slider:after{
1058
  content: attr(data-cli-disable);
1059
+ position: absolute;
1060
+ right: 50px;
1061
  color: #000;
1062
  font-size:12px;
1063
+ text-align:right;
1064
+ min-width: 80px;
1065
  }
1066
  .cli-switch input:checked + .cli-slider:after
1067
  {
1069
  }
1070
  .cli-privacy-overview:not(.cli-collapsed) .cli-privacy-content {
1071
  max-height: 60px;
1072
+ transition: max-height 0.15s ease-out;
1073
+ overflow: hidden;
1074
  }
1075
  a.cli-privacy-readmore {
1076
+ font-size: 12px;
1077
+ margin-top: 12px;
1078
+ display: inline-block;
1079
+ padding-bottom: 0;
1080
+ cursor: pointer;
1081
+ color:#000;
1082
+ text-decoration: underline;
1083
  }
1084
  .cli-modal-footer {
1085
+ position: relative;
1086
  }
1087
  a.cli-privacy-readmore:before {
1088
+ content: attr(data-readmore-text);
1089
  }
1090
  .cli-collapsed a.cli-privacy-readmore:before {
1091
+ content: attr(data-readless-text);
1092
  }
1093
 
1094
  .cli-collapsed .cli-privacy-content
1095
  {
1096
+ transition: max-height 0.25s ease-in;
1097
 
1098
  }
1099
  .cli-privacy-content p
1101
  margin-bottom:0;
1102
  }
1103
  .cli-modal-close svg {
1104
+ fill: #000;
1105
  }
1106
  span.cli-necessary-caption {
1107
+ color: #000;
1108
+ font-size: 12px;
1109
  }
1110
  .cli-tab-section.cli-privacy-tab {
1111
+ display: none;
1112
  }
1113
  #cookie-law-info-bar .cli-tab-section.cli-privacy-tab {
1114
+ display: block;
1115
  }
1116
  #cookie-law-info-bar .cli-privacy-overview {
1117
+ display: none;
1118
  }
1119
  .cli-tab-container .cli-row
1120
  {
1121
  max-height: 500px;
1122
+ overflow-y: auto;
1123
  }
1124
  .cli-modal.cli-blowup.cli-out {
1125
+ z-index: -1;
1126
  }
1127
  .cli-modal.cli-blowup {
1128
+ z-index: 999999;
1129
+ transform: scale(1);
1130
+
1131
  }
1132
  .cli-modal.cli-blowup .cli-modal-dialog {
1133
+ animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
1134
  }
1135
  .cli-modal.cli-blowup.cli-out .cli-modal-dialog
1136
  {
1137
+ animation: blowUpModalTwo 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
1138
  }
1139
  @keyframes blowUpContent {
1140
+ 0% {
1141
+ transform: scale(1);
1142
+ opacity: 1;
1143
+ }
1144
+ 99.9% {
1145
+ transform: scale(2);
1146
+ opacity: 0;
1147
+ }
1148
+ 100% {
1149
+ transform: scale(0);
1150
+ }
1151
  }
1152
  @keyframes blowUpContentTwo {
1153
+ 0% {
1154
+ transform: scale(2);
1155
+ opacity: 0;
1156
+ }
1157
+ 100% {
1158
+ transform: scale(1);
1159
+ opacity: 1;
1160
+ }
1161
  }
1162
  @keyframes blowUpModal {
1163
+ 0% {
1164
+ transform: scale(0);
1165
+ }
1166
+ 100% {
1167
+ transform: scale(1);
1168
+ }
1169
  }
1170
  @keyframes blowUpModalTwo {
1171
+ 0% {
1172
+ transform: scale(1);
1173
+ opacity: 1;
1174
+ }
1175
+ 50% {
1176
+ transform: scale(0.5);
1177
+ opacity: 0;
1178
+ }
1179
+ 100% {
1180
+ transform: scale(0);
1181
+ opacity: 0;
1182
+ }
1183
  }
1184
  .cli-tab-section .cookielawinfo-row-cat-table td, .cli-tab-section .cookielawinfo-row-cat-table th {
1185
+ font-size: 12px;
1186
  }
1187
  .cli_settings_button
1188
  {
1189
+ cursor: pointer;
1190
  }
1191
  /* Accessibility Fix */
1192
  .wt-cli-sr-only
1193
  {
1194
+ display: none;
1195
+ font-size:16px;
1196
  }
1197
+ /* Changes for CCPA
1198
  Version : 1.8.9
1199
  */
1200
  a.wt-cli-element.cli_cookie_close_button {
1201
+ text-decoration: none;
1202
+ color: #333333;
1203
+ font-size: 22px;
1204
+ line-height: 22px;
1205
+ cursor: pointer;
1206
+ position: absolute;
1207
+ right: 10px;
1208
+ top: 5px;
1209
  }
1210
  /* GDPR Bar Version 2 */
1211
  .cli-bar-container{
1212
+ float: none;
1213
+ margin: 0 auto;
1214
+ display: -webkit-box;
1215
+ display: -moz-box;
1216
+ display: -ms-flexbox;
1217
+ display: -webkit-flex;
1218
+ display: flex;
1219
+ justify-content: space-between;
1220
+ -webkit-box-align: center;
1221
+ -moz-box-align: center;
1222
+ -ms-flex-align: center;
1223
+ -webkit-align-items: center;
1224
+ align-items: center;
1225
  }
1226
  .cli-bar-btn_container {
1227
+ margin-left: 20px;
1228
+ display: -webkit-box;
1229
+ display: -moz-box;
1230
+ display: -ms-flexbox;
1231
+ display: -webkit-flex;
1232
+ display: flex;
1233
+ -webkit-box-align: center;
1234
+ -moz-box-align: center;
1235
+ -ms-flex-align: center;
1236
+ -webkit-align-items: center;
1237
+ align-items: center;
1238
+ flex-wrap: nowrap;
1239
  }
1240
  .cli-style-v2 a
1241
  {
1242
+ cursor: pointer;
1243
  }
1244
  .cli-bar-btn_container a {
1245
+ white-space: nowrap;
1246
  }
1247
+ .cli-style-v2 .cli-plugin-main-link
1248
  {
1249
+ font-weight:inherit;
1250
  }
1251
+ .cli-style-v2
1252
+ {
1253
+ font-size: 11pt;
1254
+ line-height: 18px;
1255
+ font-weight:normal;
1256
  }
1257
  #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-container,#cookie-law-info-bar[data-cli-type="popup"] .cli-bar-container{
1258
+ display: block;
1259
  }
1260
  .cli-style-v2 .cli-bar-message {
1261
+ width: 70%;
1262
+ text-align: left;
1263
  }
1264
  #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-message,#cookie-law-info-bar[data-cli-type="popup"] .cli-bar-message
1265
  {
1266
+ width:100%;
1267
  }
1268
  #cookie-law-info-bar[data-cli-type="widget"] .cli-style-v2 .cli-bar-btn_container {
1269
+ margin-top:8px;
1270
+ margin-left: 0px;
1271
+ flex-wrap: wrap;
1272
  }
1273
  /* #cookie-law-info-bar[data-cli-type="widget"] .cli-style-v2 .cli-bar-message {
1274
+ text-align: center;
1275
  } */
1276
  #cookie-law-info-bar[data-cli-type="popup"] .cli-style-v2 .cli-bar-btn_container {
1277
+ margin-top:8px;
1278
+ margin-left: 0px;
1279
  }
1280
  #cookie-law-info-bar[data-cli-style="cli-style-v2"] .cli_messagebar_head{
1281
+ text-align: left;
1282
+ /* padding-left: 15px; */
1283
+ margin-bottom: 5px;
1284
+ margin-top: 0px;
1285
+ font-size: 16px;
1286
  }
1287
  /* #cookie-law-info-bar[data-cli-type="widget"] .cli-bar-container.cli-style-v2 {
1288
+ padding-left: 0px;
1289
+ padding-right: 0px;
1290
  } */
1291
 
1292
  .cli-style-v2 .cli-bar-message .wt-cli-ccpa-element,.cli-style-v2 .cli-bar-message .wt-cli-ccpa-checkbox {
1293
+ margin-top: 5px;
1294
  }
1295
  .cli-style-v2 .cli-bar-btn_container .cli_action_button ,
1296
  .cli-style-v2 .cli-bar-btn_container .cli-plugin-main-link,
1297
  .cli-style-v2 .cli-bar-btn_container .cli_settings_button
1298
  {
1299
+ margin-left: 5px;
1300
  }
1301
  .wt-cli-ccpa-checkbox label {
1302
+ font-size: inherit;
1303
+ cursor: pointer;
1304
+ margin: 0px 0px 0px 5px;
1305
  }
1306
  /* .cli-bar-container.cli-style-v2 {
1307
+ padding-left: 15px;
1308
+ padding-right: 15px;
1309
+ padding-top: 2px;
1310
+ padding-bottom: 2px;
1311
  } */
1312
+ #cookie-law-info-bar[data-cli-style="cli-style-v2"]
1313
  {
1314
+ padding: 14px 25px;
1315
  }
1316
  #cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="widget"]
1317
  {
1318
+ padding:32px 30px;
1319
  }
1320
  #cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="popup"] {
1321
+ padding: 32px 45px;
1322
  }
1323
  .cli-style-v2 .cli-plugin-main-link:not(.cli-plugin-button), .cli-style-v2 .cli_settings_button:not(.cli-plugin-button),.cli-style-v2 .cli_action_button:not(.cli-plugin-button){
1324
+ text-decoration: underline;
1325
  }
1326
  .cli-style-v2 .cli-bar-btn_container .cli-plugin-button {
1327
+ margin-top: 5px;
1328
+ margin-bottom: 5px;
1329
  }
1330
  a.wt-cli-ccpa-opt-out {
1331
+ white-space: nowrap;
1332
+ text-decoration: underline;
1333
  }
1334
  .wt-cli-necessary-checkbox {
1335
+ display: none !important;
1336
  }
1337
  @media (max-width: 985px) {
1338
+ .cli-style-v2 .cli-bar-message
1339
+ {
1340
+ width:100%;
1341
+ }
1342
+ .cli-style-v2.cli-bar-container
1343
+ {
1344
+ justify-content:left;
1345
+ flex-wrap: wrap;
1346
+ }
1347
+ .cli-style-v2 .cli-bar-btn_container {
1348
+ margin-left:0px;
1349
+ margin-top: 10px;
1350
+ }
1351
+ #cookie-law-info-bar[data-cli-style="cli-style-v2"],#cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="widget"],#cookie-law-info-bar[data-cli-style="cli-style-v2"][data-cli-type="popup"]
1352
+ {
1353
+ padding: 25px 25px;
1354
+ }
1355
  }
1356
  /* Settings popup footer section */
1357
  .wt-cli-ckyes-brand-logo {
1358
+ display: flex;
1359
+ align-items: center;
1360
+ font-size: 9px;
1361
+ color: #111111;
1362
+ font-weight: normal;
1363
  }
1364
  .wt-cli-ckyes-brand-logo img{
1365
+ width: 65px;
1366
+ margin-left: 2px;
1367
  }
1368
  .wt-cli-privacy-overview-actions {
1369
+ padding-bottom:0;
1370
  }
1371
  @media only screen and (max-width: 479px) and (min-width: 320px){
1372
+
1373
+ .cli-style-v2 .cli-bar-btn_container {
1374
+ flex-wrap: wrap;
1375
+ }
1376
  }
1377
  /* Fix: HTML validation error due to the enclosing of <p> tags on category description */
1378
  .wt-cli-cookie-description {
1379
+ font-size: 14px;
1380
+ line-height: 1.4;
1381
+ margin-top: 0;
1382
+ padding: 0;
1383
+ color: #000;
1384
+ }
public/css/cookie-law-info-public.css CHANGED
@@ -119,5 +119,5 @@
119
  text-decoration: none;
120
  }
121
  .cli-plugin-main-link.cli-plugin-button {
122
- margin-left: 5px;
123
  }
119
  text-decoration: none;
120
  }
121
  .cli-plugin-main-link.cli-plugin-button {
122
+ margin-left: 5px;
123
  }
public/css/cookie-law-info-table.css CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  Responsive table courtesy of Mark Wiltshire: mark@bamboorocketapps.com (thanks!)
3
-
4
  For more styles try: http://icant.co.uk/csstablegallery/
5
  ----
6
  Generic styles:
@@ -50,9 +50,9 @@ table.cookielawinfo-classic tr.odd th, table.cookielawinfo-classic tr.odd td {ba
50
 
51
  /* "Winter Blues" CSS theme for CSS Table Gallery (http://icant.co.uk/csstablegallery/) by Gunta Klavina (http://www.klavina.com) */
52
  table.cookielawinfo-winter {font: 85% "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;padding: 0; margin: 10px 0 20px; border-collapse: collapse; color: #333; background: #F3F5F7;}
53
- table.cookielawinfo-winter a {color: #3A4856; text-decoration: none; border-bottom: 1px solid #C6C8CB;}
54
  table.cookielawinfo-winter a:visited {color: #777;}
55
- table.cookielawinfo-winter a:hover {color: #000;}
56
  table.cookielawinfo-winter caption {text-align: left; text-transform: uppercase; padding-bottom: 10px; font: 200% "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;}
57
  table.cookielawinfo-winter thead th {background: #3A4856; padding: 15px 10px; color: #fff; text-align: left; font-weight: normal;}
58
  table.cookielawinfo-winter tbody {border-left: 1px solid #EAECEE; border-right: 1px solid #EAECEE;}
@@ -65,27 +65,26 @@ table.cookielawinfo-winter tfoot td, table.cookielawinfo-winter tfoot th, table.
65
 
66
  /** 27/05/2013: responsive table by Mark Wiltshire */
67
  @media(max-width:800px) {
68
- table.cookielawinfo-row-cat-table td, table.cookielawinfo-row-cat-table th
69
- {
70
- width:23%;
71
- font-size:12px;
72
- word-wrap: break-word;
73
- }
74
- table.cookielawinfo-row-cat-table .cookielawinfo-column-4, table.cookielawinfo-row-cat-table .cookielawinfo-column-4
75
- {
76
- width:45%;
77
- }
78
  }
79
 
80
  .cookielawinfo-row-cat-title{
81
- border-bottom: 1px solid #eee;
82
- text-align: center;
83
  }
84
  .cookielawinfo-row-cat-title-head{
85
- text-align: center;
86
  }
87
  .cookielawinfo-row-cat-table{
88
- width: 99%;
89
- margin-left: 5px;
90
  }
91
-
1
  /**
2
  Responsive table courtesy of Mark Wiltshire: mark@bamboorocketapps.com (thanks!)
3
+
4
  For more styles try: http://icant.co.uk/csstablegallery/
5
  ----
6
  Generic styles:
50
 
51
  /* "Winter Blues" CSS theme for CSS Table Gallery (http://icant.co.uk/csstablegallery/) by Gunta Klavina (http://www.klavina.com) */
52
  table.cookielawinfo-winter {font: 85% "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;padding: 0; margin: 10px 0 20px; border-collapse: collapse; color: #333; background: #F3F5F7;}
53
+ table.cookielawinfo-winter a {color: #3A4856; text-decoration: none; border-bottom: 1px solid #C6C8CB;}
54
  table.cookielawinfo-winter a:visited {color: #777;}
55
+ table.cookielawinfo-winter a:hover {color: #000;}
56
  table.cookielawinfo-winter caption {text-align: left; text-transform: uppercase; padding-bottom: 10px; font: 200% "Lucida Grande", "Lucida Sans Unicode", "Trebuchet MS", sans-serif;}
57
  table.cookielawinfo-winter thead th {background: #3A4856; padding: 15px 10px; color: #fff; text-align: left; font-weight: normal;}
58
  table.cookielawinfo-winter tbody {border-left: 1px solid #EAECEE; border-right: 1px solid #EAECEE;}
65
 
66
  /** 27/05/2013: responsive table by Mark Wiltshire */
67
  @media(max-width:800px) {
68
+ table.cookielawinfo-row-cat-table td, table.cookielawinfo-row-cat-table th
69
+ {
70
+ width:23%;
71
+ font-size:12px;
72
+ word-wrap: break-word;
73
+ }
74
+ table.cookielawinfo-row-cat-table .cookielawinfo-column-4, table.cookielawinfo-row-cat-table .cookielawinfo-column-4
75
+ {
76
+ width:45%;
77
+ }
78
  }
79
 
80
  .cookielawinfo-row-cat-title{
81
+ border-bottom: 1px solid #eee;
82
+ text-align: center;
83
  }
84
  .cookielawinfo-row-cat-title-head{
85
+ text-align: center;
86
  }
87
  .cookielawinfo-row-cat-table{
88
+ width: 99%;
89
+ margin-left: 5px;
90
  }
 
public/index.php CHANGED
@@ -1 +1 @@
1
- <?php // Silence is golden
1
+ <?php // Silence is golden
public/js/cookie-law-info-public.js CHANGED
@@ -1,63 +1,64 @@
1
- CLI_ACCEPT_COOKIE_NAME =(typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy');
2
- CLI_PREFERNCE_COOKIE =(typeof CLI_PREFERNCE_COOKIE !== 'undefined' ? CLI_PREFERNCE_COOKIE : 'CookieLawInfoConsent');
3
- CLI_ACCEPT_COOKIE_EXPIRE =(typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365);
4
- CLI_COOKIEBAR_AS_POPUP=(typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false);
5
- var CLI_Cookie={
6
  set: function (name, value, days) {
7
  var secure = "";
8
- if ( true === Boolean( Cli_Data.secure_cookies ) ) secure = ";secure";
9
- if (days) {
10
- var date = new Date();
11
- date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
12
- var expires = "; expires=" + date.toGMTString();
13
- } else
14
- var expires = "";
15
- document.cookie = name + "=" + value + secure + expires + "; path=/";
16
- if(days<1)
17
- {
18
- host_name=window.location.hostname;
19
- document.cookie = name + "=" + value + expires + "; path=/; domain=."+host_name+";";
20
- if(host_name.indexOf("www")!=1)
21
- {
22
- var host_name_withoutwww=host_name.replace('www','');
23
- document.cookie = name + "=" + value + secure + expires + "; path=/; domain="+host_name_withoutwww+";";
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
- host_name=host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".")-1));
26
- document.cookie = name + "=" + value + secure + expires + "; path=/; domain="+host_name+";";
27
- }
28
- },
29
- read: function (name) {
30
- var nameEQ = name + "=";
31
- var ca = document.cookie.split(';');
32
- for (var i = 0; i < ca.length; i++) {
33
- var c = ca[i];
34
- while (c.charAt(0) == ' ') {
35
- c = c.substring(1, c.length);
36
- }
37
- if (c.indexOf(nameEQ) === 0) {
38
- return c.substring(nameEQ.length, c.length);
39
- }
40
- }
41
- return null;
42
- },
43
- erase: function (name) {
44
- this.set(name, "", -10);
45
- },
46
- exists: function (name) {
47
- return (this.read(name) !== null);
48
- },
49
- getallcookies:function()
50
- {
51
- var pairs = document.cookie.split(";");
52
- var cookieslist = {};
53
- for (var i = 0; i < pairs.length; i++) {
54
- var pair = pairs[i].split("=");
55
- cookieslist[(pair[0] + '').trim()] = unescape(pair[1]);
56
- }
57
- return cookieslist;
58
  }
59
  }
60
- var CLI=
61
  {
62
  bar_config:{},
63
  showagain_config:{},
@@ -65,104 +66,97 @@ var CLI=
65
  js_blocking_enabled: false,
66
  set:function(args)
67
  {
68
- if(typeof JSON.parse !== "function")
69
- {
70
- console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it");
71
- return;
 
 
 
 
72
  }
73
- if(typeof args.settings!=='object')
74
- {
75
- this.settings = JSON.parse(args.settings);
76
- }
77
- else
78
- {
79
- this.settings = args.settings;
80
- }
81
  this.js_blocking_enabled = Boolean( Cli_Data.js_blocking );
82
- this.settings = args.settings;
83
- this.bar_elm = jQuery(this.settings.notify_div_id);
84
- this.showagain_elm = jQuery(this.settings.showagain_div_id);
85
- this.settingsModal = jQuery('#cliSettingsPopup');
86
-
87
- /* buttons */
88
- this.main_button=jQuery('.cli-plugin-main-button');
89
- this.main_link = jQuery('.cli-plugin-main-link');
90
- this.reject_link = jQuery('.cookie_action_close_header_reject');
91
- this.delete_link=jQuery(".cookielawinfo-cookie-delete");
92
- this.settings_button=jQuery('.cli_settings_button');
93
- this.accept_all_button = jQuery('.wt-cli-accept-all-btn');
94
- if(this.settings.cookie_bar_as=='popup')
95
- {
96
- CLI_COOKIEBAR_AS_POPUP=true;
97
  }
98
  this.mayBeSetPreferenceCookie();
99
- this.addStyleAttribute();
100
  this.configBar();
101
- this.toggleBar();
102
- this.attachDelete();
103
- this.attachEvents();
104
  this.configButtons();
105
  this.reviewConsent();
106
- var cli_hidebar_on_readmore=this.hideBarInReadMoreLink();
107
- if( Boolean( this.settings.scroll_close ) ===true && cli_hidebar_on_readmore===false)
108
- {
109
- window.addEventListener("scroll",CLI.closeOnScroll, false);
110
  }
111
-
112
  },
113
  hideBarInReadMoreLink:function()
114
  {
115
- if( Boolean( CLI.settings.button_2_hidebar ) === true && this.main_link.length>0 && this.main_link.hasClass('cli-minimize-bar'))
116
- {
117
  this.hideHeader();
118
  cliBlocker.cookieBar( false );
119
- this.showagain_elm.slideDown(this.settings.animate_speed_show);
120
  return true;
121
  }
122
  return false;
123
  },
124
  attachEvents:function()
125
- {
126
- jQuery(document).on('click','.wt-cli-privacy-btn',function(e){
127
- e.preventDefault();
128
- CLI.accept_close();
129
- CLI.settingsPopUpClose();
130
- });
131
-
132
- jQuery('.cli_action_button').on("click", function(e) {
133
- e.preventDefault();
134
- var elm=jQuery(this);
135
- var button_action=elm.attr('data-cli_action');
136
- var open_link=elm[0].hasAttribute("href") && elm.attr("href") != '#' ? true : false;
137
- var new_window=false;
138
- if(button_action=='accept')
139
- {
140
- CLI.accept_close();
141
- new_window= Boolean( CLI.settings.button_1_new_win ) ? true : false;
142
-
143
- }
144
- else if( button_action == 'accept_all') {
145
- CLI.enableAllCookies();
146
  CLI.accept_close();
147
- new_window=CLI.settings.button_7_new_win ? true : false;
148
  }
149
- else if(button_action=='reject')
150
- {
151
- CLI.disableAllCookies();
152
- CLI.reject_close();
153
- new_window= Boolean( CLI.settings.button_3_new_win ) ? true : false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
- if(open_link)
156
- {
157
- if(new_window)
158
- {
159
- window.open(elm.attr("href"),'_blank');
160
- }else
161
- {
162
- window.location.href =elm.attr("href");
163
- }
164
- }
165
- });
166
  this.settingsPopUp();
167
  this.settingsTabbedAccordion();
168
  this.toggleUserPreferenceCheckBox();
@@ -171,480 +165,484 @@ var CLI=
171
 
172
  },
173
  toggleUserPreferenceCheckBox:function()
174
- {
175
-
176
- jQuery('.cli-user-preference-checkbox').each(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
- categoryCookie = 'cookielawinfo-'+jQuery(this).attr('data-id');
179
- categoryCookieValue = CLI_Cookie.read(categoryCookie);
180
- if( categoryCookieValue == null )
181
- {
182
- if(jQuery(this).is(':checked'))
183
- {
184
- CLI_Cookie.set(categoryCookie,'yes',CLI_ACCEPT_COOKIE_EXPIRE);
185
- }else
186
- {
187
- CLI_Cookie.set(categoryCookie,'no',CLI_ACCEPT_COOKIE_EXPIRE);
188
- }
189
- }
190
- else
191
- {
192
- if(categoryCookieValue == "yes")
193
- {
194
- jQuery(this).prop("checked",true);
195
- }
196
- else
197
- {
198
- jQuery(this).prop("checked",false);
199
  }
200
 
201
  }
202
-
203
- });
204
- jQuery('.cli-user-preference-checkbox').on("click", function(e) {
205
- var dataID = jQuery(this).attr('data-id');
206
- var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id='+dataID+']');
207
- if(jQuery(this).is(':checked'))
208
- {
209
- CLI_Cookie.set('cookielawinfo-'+dataID,'yes',CLI_ACCEPT_COOKIE_EXPIRE);
210
- currentToggleElm.prop('checked',true);
211
- }else
212
- {
213
- CLI_Cookie.set('cookielawinfo-'+dataID,'no',CLI_ACCEPT_COOKIE_EXPIRE);
214
- currentToggleElm.prop('checked',false);
 
 
215
  }
216
- CLI.checkCategories();
217
- CLI.generateConsent();
218
- });
219
-
220
  },
221
  settingsPopUp:function()
222
- {
223
- jQuery(document).on('click','.cli_settings_button',function(e){
224
- e.preventDefault();
225
- CLI.settingsModal.addClass("cli-show").css({'opacity':0}).animate({'opacity':1});
226
- CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup");
227
- jQuery('body').addClass("cli-modal-open");
228
- jQuery(".cli-settings-overlay").addClass("cli-show");
229
- jQuery("#cookie-law-info-bar").css({'opacity':.1});
230
- if(!jQuery('.cli-settings-mobile').is(':visible'))
231
- {
232
- CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click");
 
 
 
233
  }
234
- });
235
- jQuery('#cliModalClose').on("click", function(e) {
236
- CLI.settingsPopUpClose();
237
- });
238
- CLI.settingsModal.on("click", function(e) {
239
- if(!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target)))
240
- {
241
  CLI.settingsPopUpClose();
242
  }
243
- });
244
- jQuery('.cli_enable_all_btn').on("click", function(e) {
245
- var cli_toggle_btn = jQuery(this);
246
- var enable_text = cli_toggle_btn.attr('data-enable-text');
247
- var disable_text= cli_toggle_btn.attr('data-disable-text');
248
- if(cli_toggle_btn.hasClass('cli-enabled')){
249
- CLI.disableAllCookies();
250
- cli_toggle_btn.html(enable_text);
251
  }
252
- else
253
- {
254
- CLI.enableAllCookies();
255
- cli_toggle_btn.html(disable_text);
 
 
 
 
 
 
 
 
 
256
 
 
 
257
  }
258
- jQuery(this).toggleClass('cli-enabled');
259
- });
260
-
261
  this.privacyReadmore();
262
  },
263
  settingsTabbedAccordion:function()
264
  {
265
- jQuery(".cli-tab-header").on("click", function(e) {
266
- if(!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox')))
267
- {
268
- if (jQuery(this).hasClass("cli-tab-active")) {
269
- jQuery(this).removeClass("cli-tab-active");
270
- jQuery(this)
271
- .siblings(".cli-tab-content")
272
- .slideUp(200);
 
273
 
274
- } else {
275
- jQuery(".cli-tab-header").removeClass("cli-tab-active");
276
- jQuery(this).addClass("cli-tab-active");
277
- jQuery(".cli-tab-content").slideUp(200);
278
- jQuery(this)
279
- .siblings(".cli-tab-content")
280
- .slideDown(200);
281
- }
282
- }
283
- });
 
284
  },
285
  settingsPopUpClose:function()
286
  {
287
- this.settingsModal.removeClass('cli-show');
288
- this.settingsModal.addClass('cli-out');
289
- jQuery('body').removeClass("cli-modal-open");
290
- jQuery(".cli-settings-overlay").removeClass("cli-show");
291
- jQuery("#cookie-law-info-bar").css({'opacity':1});
292
  },
293
  privacyReadmore:function()
294
- {
295
- var el= jQuery('.cli-privacy-content .cli-privacy-content-text');
296
- if( el.length > 0 ) {
297
- var clone= el.clone(),
298
- originalHtml= clone.html(),
299
- originalHeight= el.outerHeight(),
300
- Trunc = {
301
- addReadmore:function(textBlock)
302
- {
303
- if(textBlock.html().length > 250)
304
- {
305
- jQuery('.cli-privacy-readmore').show();
306
- }
307
- else
308
- {
309
- jQuery('.cli-privacy-readmore').hide();
310
- }
311
- },
312
- truncateText : function( textBlock ) {
313
- var strippedText = jQuery('<div />').html(textBlock.html());
314
- strippedText.find('table').remove();
315
- textBlock.html(strippedText.html());
316
- currentText = textBlock.text();
317
- if(currentText.trim().length > 250){
318
- var newStr = currentText.substring(0, 250);
319
- textBlock.empty().html(newStr).append('...');
 
320
  }
321
- },
322
- replaceText: function ( textBlock, original ){
323
- return textBlock.html(original);
324
- }
325
-
326
  };
327
- Trunc.addReadmore(el);
328
- Trunc.truncateText(el);
329
- jQuery('a.cli-privacy-readmore').on("click", function(e) {
330
- e.preventDefault();
331
- if(jQuery('.cli-privacy-overview').hasClass('cli-collapsed'))
332
- {
333
- Trunc.truncateText(el);
334
- jQuery('.cli-privacy-overview').removeClass('cli-collapsed');
335
- el.css('height', '100%');
336
- }
337
- else
338
- {
339
- jQuery('.cli-privacy-overview').addClass('cli-collapsed');
340
- Trunc.replaceText(el, originalHtml);
 
341
  }
342
-
343
-
344
- });
345
  }
346
-
347
  },
348
  attachDelete:function()
349
  {
350
- this.delete_link.on("click", function(e) {
351
- CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME);
352
- for(var k in Cli_Data.nn_cookie_ids)
353
- {
354
- CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]);
 
 
 
 
355
  }
356
- CLI.generateConsent();
357
- return false;
358
- });
359
-
360
  },
361
  configButtons:function()
362
  {
363
- /*[cookie_button] */
364
- this.main_button.css('color',this.settings.button_1_link_colour);
365
- if( Boolean( this.settings.button_1_as_button ) )
366
- {
367
- this.main_button.css('background-color',this.settings.button_1_button_colour);
368
-
369
- this.main_button.on('mouseenter', function(){
370
- jQuery(this).css('background-color',CLI.settings.button_1_button_hover);
371
- })
372
- .on('mouseleave', function(){
373
- jQuery(this).css('background-color',CLI.settings.button_1_button_colour);
374
- });
375
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
 
377
- /* [cookie_link] */
378
- this.main_link.css('color',this.settings.button_2_link_colour);
379
- if( Boolean( this.settings.button_2_as_button ) )
380
- {
381
- this.main_link.css('background-color',this.settings.button_2_button_colour);
382
 
383
- this.main_link.on('mouseenter', function(){
384
- jQuery(this).css('background-color',CLI.settings.button_2_button_hover);
385
- })
386
- .on('mouseleave', function(){
387
- jQuery(this).css('background-color',CLI.settings.button_2_button_colour);
388
- });
389
-
390
- }
391
- /* [cookie_reject] */
392
- this.reject_link.css('color',this.settings.button_3_link_colour);
393
- if( Boolean( this.settings.button_3_as_button ) )
394
- {
395
-
396
- this.reject_link.css('background-color',this.settings.button_3_button_colour);
397
- this.reject_link.on('mouseenter', function(){
398
- jQuery(this).css('background-color',CLI.settings.button_3_button_hover);
399
- })
400
- .on('mouseleave', function(){
401
- jQuery(this).css('background-color',CLI.settings.button_3_button_colour);
402
- });
 
 
 
 
 
 
 
 
 
 
403
  }
404
- /* [cookie_settings] */
405
- this.settings_button.css('color',this.settings.button_4_link_colour);
406
- if( Boolean( this.settings.button_4_as_button ) )
407
- {
408
- this.settings_button.css('background-color',this.settings.button_4_button_colour);
409
- this.settings_button.on('mouseenter', function(){
410
- jQuery(this).css('background-color',CLI.settings.button_4_button_hover);
411
- })
412
- .on('mouseleave', function(){
413
- jQuery(this).css('background-color',CLI.settings.button_4_button_colour);
414
- });
415
- }
416
  /* [cookie_accept_all] */
417
- this.accept_all_button.css('color',this.settings.button_7_link_colour);
418
- if(this.settings.button_7_as_button)
419
- {
420
- this.accept_all_button.css('background-color',this.settings.button_7_button_colour);
421
- this.accept_all_button.on('mouseenter', function(){
422
- jQuery(this).css('background-color',CLI.settings.button_7_button_hover);
423
- })
424
- .on('mouseleave', function(){
425
- jQuery(this).css('background-color',CLI.settings.button_7_button_colour);
426
- });
 
 
 
 
 
427
  }
428
  },
429
  toggleBar:function()
430
  {
431
- if(CLI_COOKIEBAR_AS_POPUP)
432
- {
433
- this.barAsPopUp(1);
434
  }
435
- if(CLI.settings.cookie_bar_as=='widget')
436
- {
437
- this.barAsWidget(1);
438
  }
439
- if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME))
440
- {
441
- this.displayHeader();
442
- }else
443
- {
444
- this.hideHeader();
445
- }
446
- if( Boolean( this.settings.show_once_yn ))
447
- {
448
- setTimeout(function(){
449
- CLI.close_header();
450
- },CLI.settings.show_once);
451
  }
452
- if( CLI.js_blocking_enabled === false ) {
453
- if( Boolean( Cli_Data.ccpaEnabled ) === true ) {
454
- if( Cli_Data.ccpaType === 'ccpa' && Boolean( Cli_Data.ccpaBarEnabled ) === false ) {
455
  cliBlocker.cookieBar( false );
456
  }
457
  } else {
458
- jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove();
459
  }
460
- }
461
-
462
- this.showagain_elm.on("click", function(e) {
463
- e.preventDefault();
464
- CLI.showagain_elm.slideUp(CLI.settings.animate_speed_hide,function()
465
- {
466
- CLI.bar_elm.slideDown(CLI.settings.animate_speed_show);
467
- if(CLI_COOKIEBAR_AS_POPUP)
468
- {
469
- CLI.showPopupOverlay();
470
- }
471
- });
472
- });
 
 
 
 
 
473
  },
474
  configShowAgain:function()
475
  {
476
  this.showagain_config = {
477
- 'background-color': this.settings.background,
478
- 'color':this.l1hs(this.settings.text),
479
- 'position': 'fixed',
480
- 'font-family': this.settings.font_family
481
- };
482
- if(Boolean( this.settings.border_on ) )
483
- {
484
- var border_to_hide = 'border-' + this.settings.notify_position_vertical;
485
- this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border);
486
- this.showagain_config[border_to_hide] = 'none';
487
- }
488
- var cli_win=jQuery(window);
489
- var cli_winw=cli_win.width();
490
- var showagain_x_pos=this.settings.showagain_x_position;
491
- if(cli_winw<300)
492
- {
493
- showagain_x_pos=10;
494
- this.showagain_config.width=cli_winw-20;
495
- }else
496
- {
497
- this.showagain_config.width='auto';
498
- }
499
- var cli_defw=cli_winw>400 ? 500 : cli_winw-20;
500
- if(CLI_COOKIEBAR_AS_POPUP) /* cookie bar as popup */
501
- {
502
- var sa_pos=this.settings.popup_showagain_position;
503
- var sa_pos_arr=sa_pos.split('-');
504
- if(sa_pos_arr[1]=='left')
505
- {
506
- this.showagain_config.left=showagain_x_pos;
507
- }else if(sa_pos_arr[1]=='right')
508
- {
509
- this.showagain_config.right=showagain_x_pos;
510
- }
511
- if(sa_pos_arr[0]=='top')
512
- {
513
- this.showagain_config.top=0;
514
 
515
- }else if(sa_pos_arr[0]=='bottom')
516
- {
517
- this.showagain_config.bottom=0;
518
- }
519
- this.bar_config['position'] = 'fixed';
520
 
521
- }else if(this.settings.cookie_bar_as=='widget')
522
- {
523
- this.showagain_config.bottom=0;
524
- if(this.settings.widget_position=='left')
525
- {
526
- this.showagain_config.left=showagain_x_pos;
527
- }else if(this.settings.widget_position=='right')
528
- {
529
- this.showagain_config.right=showagain_x_pos;
530
- }
531
- }
532
- else
533
- {
534
- if(this.settings.notify_position_vertical == "top")
535
- {
536
- this.showagain_config.top = '0';
537
- }
538
- else if(this.settings.notify_position_vertical == "bottom")
539
- {
540
- this.bar_config['position'] = 'fixed';
541
- this.bar_config['bottom'] = '0';
542
- this.showagain_config.bottom = '0';
543
- }
544
- if(this.settings.notify_position_horizontal == "left")
545
- {
546
- this.showagain_config.left =showagain_x_pos;
547
- }else if(this.settings.notify_position_horizontal == "right")
548
- {
549
- this.showagain_config.right =showagain_x_pos;
550
- }
551
- }
552
- this.showagain_elm.css(this.showagain_config);
553
  },
554
  configBar:function()
555
  {
556
  this.bar_config = {
557
- 'background-color':this.settings.background,
558
- 'color':this.settings.text,
559
- 'font-family':this.settings.font_family
560
- };
561
- if(this.settings.notify_position_vertical=="top")
562
- {
563
- this.bar_config['top'] = '0';
564
- if( Boolean( this.settings.header_fix ) === true)
565
- {
566
- this.bar_config['position'] = 'fixed';
567
- }
568
- }else
569
- {
570
- this.bar_config['bottom'] = '0';
571
- }
572
- this.configShowAgain();
573
- this.bar_elm.css(this.bar_config).hide();
 
 
 
 
 
 
574
  },
575
- l1hs:function(str)
576
  {
577
- if (str.charAt(0) == "#") {
578
- str = str.substring(1, str.length);
579
- } else {
580
- return "#" + str;
581
- }
582
- return this.l1hs(str);
583
  },
584
- close_header:function()
585
  {
586
- CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE);
587
- this.hideHeader();
588
- },
589
- accept_close:function()
590
- {
591
  this.hidePopupOverlay();
592
  this.generateConsent();
593
  this.cookieLawInfoRunCallBacks();
594
 
595
- CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE);
596
- if( Boolean( this.settings.notify_animate_hide ) )
597
- {
598
- if( CLI.js_blocking_enabled === true ) {
599
  this.bar_elm.slideUp( this.settings.animate_speed_hide, cliBlocker.runScripts );
600
  } else {
601
  this.bar_elm.slideUp( this.settings.animate_speed_hide );
602
  }
603
-
604
- }else
605
- {
606
- if( CLI.js_blocking_enabled === true ) {
607
- this.bar_elm.hide( 0, cliBlocker.runScripts );
608
 
609
  } else {
610
  this.bar_elm.hide();
611
  }
612
- }
613
- if( Boolean( this.settings.showagain_tab ) )
614
- {
615
- this.showagain_elm.slideDown(this.settings.animate_speed_show);
616
  }
617
- if( Boolean( this.settings.accept_close_reload ) === true )
618
- {
619
- this.reload_current_page();
620
- }
621
- return false;
622
- },
623
- reject_close:function()
624
- {
 
 
625
  this.hidePopupOverlay();
626
  this.generateConsent();
627
  this.cookieLawInfoRunCallBacks();
628
- for(var k in Cli_Data.nn_cookie_ids)
629
- {
630
- CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]);
631
- }
632
- CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE);
633
-
634
- if( Boolean( this.settings.notify_animate_hide ) )
635
- {
636
- if( CLI.js_blocking_enabled === true ) {
637
 
638
- this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts);
 
 
 
639
 
640
  } else {
641
-
642
- this.bar_elm.slideUp(this.settings.animate_speed_hide);
643
  }
644
-
645
- } else
646
- {
647
- if( CLI.js_blocking_enabled === true ) {
648
 
649
  this.bar_elm.hide( cliBlocker.runScripts );
650
 
@@ -653,313 +651,326 @@ var CLI=
653
  this.bar_elm.hide();
654
 
655
  }
656
-
657
- }
658
- if( Boolean( this.settings.showagain_tab ) )
659
- {
660
- this.showagain_elm.slideDown(this.settings.animate_speed_show);
661
- }
662
- if( Boolean( this.settings.reject_close_reload ) === true )
663
- {
664
- this.reload_current_page();
665
- }
666
- return false;
667
- },
668
- reload_current_page:function()
669
- {
670
-
671
- window.location.reload(true);
672
- },
673
- closeOnScroll:function()
674
  {
675
- if(window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME))
676
- {
677
- CLI.accept_close();
678
- if( Boolean( CLI.settings.scroll_close_reload ) === true)
679
- {
680
- window.location.reload();
681
- }
682
- window.removeEventListener("scroll",CLI.closeOnScroll,false);
683
- }
684
- },
685
- displayHeader:function()
686
- {
687
- if( Boolean( this.settings.notify_animate_show ) )
688
- {
689
- this.bar_elm.slideDown(this.settings.animate_speed_show);
690
- }else
691
- {
692
- this.bar_elm.show();
693
- }
694
- this.showagain_elm.hide();
695
- if(CLI_COOKIEBAR_AS_POPUP)
696
- {
697
- this.showPopupOverlay();
698
- }
699
- },
700
- hideHeader:function()
701
- {
702
- if( Boolean( this.settings.showagain_tab ) )
703
- {
704
- if( Boolean( this.settings.notify_animate_show ) )
705
- {
706
- this.showagain_elm.slideDown(this.settings.animate_speed_show);
707
- } else {
708
- this.showagain_elm.show();
709
- }
710
- }else
711
- {
712
- this.showagain_elm.hide();
713
- }
714
- this.bar_elm.slideUp(this.settings.animate_speed_show);
715
- this.hidePopupOverlay();
716
- },
717
- hidePopupOverlay:function()
718
- {
719
- jQuery('body').removeClass("cli-barmodal-open");
720
- jQuery(".cli-popupbar-overlay").removeClass("cli-show");
721
- },
722
- showPopupOverlay:function()
723
- {
724
- if( this.bar_elm.length ) {
725
- if( Boolean( this.settings.popup_overlay ) )
726
- {
727
- jQuery('body').addClass("cli-barmodal-open");
728
- jQuery(".cli-popupbar-overlay").addClass("cli-show");
729
  }
 
730
  }
731
-
732
- },
733
- barAsWidget:function(a)
734
- {
735
- var cli_elm=this.bar_elm;
736
- cli_elm.attr('data-cli-type','widget');
737
- var cli_win=jQuery(window);
738
- var cli_winh=cli_win.height()-40;
739
- var cli_winw=cli_win.width();
740
- var cli_defw=cli_winw>400 ? 300 : cli_winw-30;
741
- cli_elm.css({
742
- 'width':cli_defw,'height':'auto','max-height':cli_winh,'overflow':'auto','position':'fixed','box-sizing':'border-box'
743
- });
744
- if ( this.checkifStyleAttributeExist() === false ) {
745
- cli_elm.css({'padding':'25px 15px'});
746
  }
747
- if(this.settings.widget_position=='left')
748
- {
749
- cli_elm.css({
750
- 'left':'15px','right':'auto','bottom':'15px','top':'auto'
751
- });
752
- }else
753
- {
754
- cli_elm.css({
755
- 'left':'auto','right':'15px','bottom':'15px','top':'auto'
756
- });
757
- }
758
- if(a)
759
- {
760
- this.setResize();
761
  }
762
- },
763
- barAsPopUp:function(a)
764
- {
765
- if(typeof cookie_law_info_bar_as_popup==='function')
766
- {
767
- return false;
768
- }
769
- var cli_elm=this.bar_elm;
770
- cli_elm.attr('data-cli-type','popup');
771
- var cli_win=jQuery(window);
772
- var cli_winh=cli_win.height()-40;
773
- var cli_winw=cli_win.width();
774
- var cli_defw=cli_winw>700 ? 500 : cli_winw-20;
775
-
776
- cli_elm.css({
777
- 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw/2)*-1,'margin-top':'-100px','overflow':'auto'
778
- }).addClass('cli-bar-popup cli-modal-content');
779
- if ( this.checkifStyleAttributeExist() === false ) {
780
- cli_elm.css({'padding':'25px 15px'});
781
  }
782
- cli_h=cli_elm.height();
783
- li_h=cli_h<200 ? 200 : cli_h;
784
- cli_elm.css({'top':'50%','margin-top':((cli_h/2)+30)*-1});
785
- setTimeout(function(){
786
- cli_elm.css({
787
- 'bottom':''
788
- });
789
- },100);
790
- if(a)
791
- {
792
- this.setResize();
 
 
 
 
793
  }
794
- },
795
- setResize:function()
 
796
  {
797
- var resizeTmr=null;
798
- jQuery(window).resize(function() {
799
- clearTimeout(resizeTmr);
800
- resizeTmr=setTimeout(function()
 
 
 
801
  {
802
- if(CLI_COOKIEBAR_AS_POPUP)
 
 
 
 
 
 
 
803
  {
804
- CLI.barAsPopUp();
805
  }
806
- if(CLI.settings.cookie_bar_as=='widget')
 
 
807
  {
808
- CLI.barAsWidget();
809
  }
810
- CLI.configShowAgain();
811
- },500);
812
- });
 
 
813
  },
814
- enableAllCookies:function()
815
- {
816
-
817
- jQuery('.cli-user-preference-checkbox').each(function(){
818
- var cli_chkbox_elm=jQuery(this);
819
- var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id');
820
- if(cli_chkbox_data_id!='checkbox-necessary')
 
 
 
 
 
 
821
  {
822
- cli_chkbox_elm.prop('checked',true);
823
- CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'yes',CLI_ACCEPT_COOKIE_EXPIRE);
824
  }
825
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  },
827
  disableAllCookies:function()
828
- {
829
- jQuery('.cli-user-preference-checkbox').each(function(){
 
830
 
831
- var cli_chkbox_elm=jQuery(this);
832
- var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id');
833
- cliCategorySlug = cli_chkbox_data_id.replace('checkbox-','');
834
- if(Cli_Data.strictlyEnabled.indexOf(cliCategorySlug) === -1)
835
- {
836
- cli_chkbox_elm.prop('checked',false);
837
- CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'no',CLI_ACCEPT_COOKIE_EXPIRE);
838
  }
839
- });
840
  },
841
  hideCookieBarOnClose: function() {
842
- jQuery(document).on('click','.cli_cookie_close_button',function(e){
843
- e.preventDefault();
844
- var elm=jQuery(this);
845
- var button_action = elm.attr('data-cli_action');
846
- if( Cli_Data.ccpaType === 'ccpa' )
847
- {
848
- CLI.enableAllCookies();
 
 
 
 
849
  }
850
- CLI.accept_close();
851
- });
852
  },
853
  checkCategories:function()
854
- {
855
- var cliAllowedCategories = [];
856
- var cli_categories = {};
857
- jQuery('.cli-user-preference-checkbox').each(function()
858
- { var status=false;
859
- cli_chkbox_elm=jQuery(this);
860
- cli_chkbox_data_id=cli_chkbox_elm.attr('data-id');
861
- cli_chkbox_data_id=cli_chkbox_data_id.replace('checkbox-','');
862
- cli_chkbox_data_id_trimmed=cli_chkbox_data_id.replace('-','_')
863
- if(jQuery(cli_chkbox_elm).is(':checked'))
864
- {
865
- status=true;
866
- cliAllowedCategories.push(cli_chkbox_data_id);
 
 
 
867
  }
868
-
869
- cli_categories[cli_chkbox_data_id_trimmed]= status;
870
- });
871
  CLI.allowedCategories = cliAllowedCategories;
872
  },
873
  cookieLawInfoRunCallBacks:function()
874
- {
875
  this.checkCategories();
876
- if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes')
877
- {
878
- if("function" == typeof CookieLawInfo_Accept_Callback){
879
- CookieLawInfo_Accept_Callback();
880
  }
881
  }
882
  },
883
  generateConsent:function()
884
- {
885
- var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE);
886
- cliConsent = {};
887
- if(preferenceCookie !== null) {
888
- cliConsent = window.atob(preferenceCookie);
889
- cliConsent = JSON.parse(cliConsent);
890
  }
891
  cliConsent.ver = Cli_Data.consentVersion;
892
- categories = [];
893
- jQuery('.cli-user-preference-checkbox').each(function(){
894
- categoryVal = '';
895
- cli_chkbox_data_id = jQuery(this).attr('data-id');
896
- cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-','');
897
- if(jQuery(this).is(':checked'))
898
- {
899
- categoryVal = true;
900
- }
901
- else
902
- {
903
- categoryVal = false;
904
  }
905
- cliConsent[cli_chkbox_data_id] = categoryVal;
906
- });
907
- cliConsent = JSON.stringify(cliConsent);
908
- cliConsent = window.btoa(cliConsent);
909
- CLI_Cookie.set(CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE);
910
  },
911
  addStyleAttribute:function()
912
  {
913
- var bar=this.bar_elm;
914
- var styleClass='';
915
- if(jQuery(bar).find('.cli-bar-container').length > 0)
916
- {
917
- styleClass = jQuery('.cli-bar-container').attr('class');
918
- styleClass = styleClass.replace('cli-bar-container','');
919
- styleClass = styleClass.trim();
920
- jQuery(bar).attr('data-cli-style',styleClass);
921
  }
922
  },
923
  getParameterByName: function( name, url ) {
924
- if (!url) url = window.location.href;
925
- name = name.replace(/[\[\]]/g, '\\$&');
926
- var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
927
- results = regex.exec(url);
928
- if (!results) return null;
929
- if (!results[2]) return '';
930
- return decodeURIComponent(results[2].replace(/\+/g, ' '));
 
 
 
 
 
 
931
  },
932
  CookieLawInfo_Callback: function( enableBar, enableBlocking ) {
933
- enableBar = typeof enableBar !== 'undefined' ? enableBar : true;
934
  enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true;
935
- if( CLI.js_blocking_enabled === true && Boolean( Cli_Data.custom_integration ) === true ) {
936
  cliBlocker.cookieBar( enableBar );
937
  cliBlocker.runScripts( enableBlocking );
938
  }
939
  },
940
- checkifStyleAttributeExist: function()
941
- {
942
  var exist = false;
943
- var attr = this.bar_elm.attr('data-cli-style');
944
  if (typeof attr !== typeof undefined && attr !== false) {
945
  exist = true;
946
  }
947
  return exist;
948
  },
949
  reviewConsent : function()
950
- {
951
- jQuery(document).on('click','.cli_manage_current_consent,.wt-cli-manage-consent-link',function(){
952
- CLI.displayHeader();
953
- });
 
 
 
 
954
  },
955
  mayBeSetPreferenceCookie: function() {
956
- if( CLI.getParameterByName('cli_bypass') === "1" ) {
957
  CLI.generateConsent();
958
  }
959
  }
960
  }
961
- var cliBlocker =
962
- {
963
  blockingStatus: true,
964
  scriptsLoaded: false,
965
  ccpaEnabled : false,
@@ -967,79 +978,66 @@ var cliBlocker =
967
  ccpaApplicable : false,
968
  ccpaBarEnabled: false,
969
  cliShowBar: true ,
970
- isBypassEnabled: CLI.getParameterByName('cli_bypass'),
971
  checkPluginStatus: function(callbackA , callbackB )
972
- {
973
- this.ccpaEnabled = Boolean( Cli_Data.ccpaEnabled );
974
  this.ccpaRegionBased = Boolean( Cli_Data.ccpaRegionBased );
975
- this.ccpaBarEnabled = Boolean( Cli_Data.ccpaBarEnabled );
976
-
977
- if( Boolean( Cli_Data.custom_integration ) === true ) {
978
  callbackA( false );
979
- }
980
- else {
981
- if( this.ccpaEnabled === true ) {
982
  this.ccpaApplicable = true;
983
- if( Cli_Data.ccpaType === 'ccpa') {
984
- if( this.ccpaBarEnabled !== true ) {
985
- this.cliShowBar = false;
986
  this.blockingStatus = false;
987
  }
988
  }
989
  } else {
990
- jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove();
991
  }
992
  if ( cliBlocker.isBypassEnabled === "1") {
993
  cliBlocker.blockingStatus = false;
994
  }
995
  callbackA( this.cliShowBar );
996
- callbackB( this.blockingStatus);
997
  }
998
-
999
-
1000
  },
1001
  cookieBar: function( showbar )
1002
- {
1003
- showbar = typeof showbar !== 'undefined' ? showbar : true;
1004
  cliBlocker.cliShowBar = showbar;
1005
- if(cliBlocker.cliShowBar === false)
1006
- {
1007
  CLI.bar_elm.hide();
1008
  CLI.showagain_elm.hide();
1009
- CLI.settingsModal.removeClass('cli-blowup cli-out');
1010
  CLI.hidePopupOverlay();
1011
- jQuery(".cli-settings-overlay").removeClass("cli-show");
1012
- }
1013
- else
1014
- {
1015
- if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME))
1016
- {
1017
  CLI.displayHeader();
1018
- }
1019
- else
1020
- {
1021
  CLI.hideHeader();
1022
  }
1023
  }
1024
  },
1025
- removeCookieByCategory : function()
1026
- {
1027
 
1028
- if(cliBlocker.blockingStatus === true)
1029
- {
1030
- if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null)
1031
- {
1032
  var non_necessary_cookies = Cli_Data.non_necessary_cookies;
1033
  for (var key in non_necessary_cookies) {
1034
  currentCategory = key;
1035
- if(CLI.allowedCategories.indexOf(currentCategory) === -1)
1036
- {
1037
  var nonNecessaryCookies = non_necessary_cookies[currentCategory];
1038
- for(var i=0; i < nonNecessaryCookies.length; i++)
1039
- {
1040
- if(CLI_Cookie.read(nonNecessaryCookies[i]) !== null)
1041
- {
1042
- CLI_Cookie.erase(nonNecessaryCookies[i]);
1043
  }
1044
 
1045
  }
@@ -1048,160 +1046,160 @@ var cliBlocker =
1048
  }
1049
  }
1050
  },
1051
- runScripts:function( blocking )
1052
- {
1053
- blocking = typeof blocking !== 'undefined' ? blocking : true;
1054
  cliBlocker.blockingStatus = blocking;
1055
- srcReplaceableElms = ['iframe','IFRAME','EMBED','embed','OBJECT','object','IMG','img'];
1056
- var genericFuncs =
1057
- {
1058
-
1059
  renderByElement: function( callback )
1060
- {
1061
  cliScriptFuncs.renderScripts();
1062
  callback();
1063
  cliBlocker.scriptsLoaded = true;
1064
  },
1065
 
1066
  };
1067
- var cliScriptFuncs =
1068
  {
1069
  // trigger DOMContentLoaded
1070
- scriptsDone:function()
1071
- {
1072
  if (typeof Cli_Data.triggerDomRefresh !== 'undefined') {
1073
- if( Boolean( Cli_Data.triggerDomRefresh ) === true )
1074
- {
1075
- var DOMContentLoadedEvent = document.createEvent('Event')
1076
- DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true)
1077
- window.document.dispatchEvent(DOMContentLoadedEvent);
1078
  }
1079
  }
1080
  },
1081
  seq :function(arr, callback, index) {
1082
  // first call, without an index
1083
  if (typeof index === 'undefined') {
1084
- index = 0
1085
  }
1086
-
1087
- arr[index](function () {
1088
- index++
1089
- if (index === arr.length) {
1090
- callback()
1091
- } else {
1092
- cliScriptFuncs.seq(arr, callback, index)
1093
- }
1094
- })
1095
- },
 
 
1096
  /* script runner */
1097
  insertScript:function($script,callback) {
1098
- var s ='';
1099
- var scriptType = $script.getAttribute('data-cli-script-type');
1100
- var elementPosition = $script.getAttribute('data-cli-element-position');
1101
- var isBlock = $script.getAttribute('data-cli-block');
1102
- var s = document.createElement('script');
1103
- var ccpaOptedOut = cliBlocker.ccpaOptedOut();
1104
- s.type = 'text/plain';
1105
- if($script.async)
1106
- {
1107
  s.async = $script.async;
1108
  }
1109
- if($script.defer)
1110
- {
1111
  s.defer = $script.defer;
1112
  }
1113
  if ($script.src) {
1114
- s.onload = callback
1115
  s.onerror = callback
1116
- s.src = $script.src
1117
  } else {
1118
  s.textContent = $script.innerText
1119
  }
1120
- var attrs = jQuery($script).prop("attributes");
1121
  for (var ii = 0; ii < attrs.length; ++ii) {
1122
  if (attrs[ii].nodeName !== 'id') {
1123
- s.setAttribute(attrs[ii].nodeName,attrs[ii].value);
1124
  }
1125
  }
1126
- if(cliBlocker.blockingStatus === true)
1127
- {
1128
-
1129
- if(( CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes' && CLI.allowedCategories.indexOf(scriptType) !== -1 ) )
1130
- {
1131
- s.setAttribute('data-cli-consent','accepted');
1132
  s.type = 'text/javascript';
1133
  }
1134
- if( cliBlocker.ccpaApplicable === true ) {
1135
- if( ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null ) {
1136
  s.type = 'text/plain';
1137
  }
1138
  }
1139
- }
1140
- else
1141
- {
1142
  s.type = 'text/javascript';
1143
  }
1144
-
1145
- if($script.type != s.type)
1146
- {
1147
- if(elementPosition === 'head') {
1148
- document.head.appendChild(s);
1149
- } else {
1150
- document.body.appendChild(s);
1151
  }
1152
- if (!$script.src) {
1153
  callback()
1154
- }
1155
- $script.parentNode.removeChild($script);
1156
-
1157
- }
1158
- else {
1159
 
1160
  callback();
1161
  }
1162
  },
1163
  renderScripts:function()
1164
- {
1165
- var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]');
1166
- if($scripts.length > 0)
1167
- {
1168
  var runList = []
1169
  var typeAttr
1170
- Array.prototype.forEach.call($scripts, function ($script) {
1171
- // only run script tags without the type attribute
1172
- // or with a javascript mime attribute value
1173
- typeAttr = $script.getAttribute('type')
1174
- runList.push(function (callback) {
1175
- cliScriptFuncs.insertScript($script, callback)
1176
- })
1177
- })
1178
- cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone);
 
 
 
 
 
1179
  }
1180
  }
1181
  };
1182
  genericFuncs.renderByElement( cliBlocker.removeCookieByCategory );
1183
  },
1184
  ccpaOptedOut : function () {
1185
- var ccpaOptedOut = false;
1186
- var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE);
1187
- if( preferenceCookie !== null ) {
1188
- cliConsent = window.atob(preferenceCookie);
1189
- cliConsent = JSON.parse(cliConsent);
1190
- if( typeof cliConsent.ccpaOptout !== 'undefined') {
1191
- ccpaOptedOut = cliConsent.ccpaOptout;
1192
- }
1193
  }
1194
  return ccpaOptedOut;
1195
  }
1196
  }
1197
- jQuery(document).ready(function() {
1198
- if(typeof cli_cookiebar_settings!='undefined')
1199
- {
1200
- CLI.set({
1201
- settings:cli_cookiebar_settings
1202
- });
1203
- if( CLI.js_blocking_enabled === true ) {
1204
- cliBlocker.checkPluginStatus(cliBlocker.cookieBar,cliBlocker.runScripts);
 
 
 
1205
  }
1206
  }
1207
- });
1
+ CLI_ACCEPT_COOKIE_NAME = (typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy');
2
+ CLI_PREFERNCE_COOKIE = (typeof CLI_PREFERNCE_COOKIE !== 'undefined' ? CLI_PREFERNCE_COOKIE : 'CookieLawInfoConsent');
3
+ CLI_ACCEPT_COOKIE_EXPIRE = (typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365);
4
+ CLI_COOKIEBAR_AS_POPUP = (typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false);
5
+ var CLI_Cookie = {
6
  set: function (name, value, days) {
7
  var secure = "";
8
+ if ( true === Boolean( Cli_Data.secure_cookies ) ) {
9
+ secure = ";secure";
10
+ }
11
+ if (days) {
12
+ var date = new Date();
13
+ date.setTime( date.getTime() + (days * 24 * 60 * 60 * 1000) );
14
+ var expires = "; expires=" + date.toGMTString();
15
+ } else {
16
+ var expires = "";
17
+ }
18
+ document.cookie = name + "=" + value + secure + expires + "; path=/";
19
+ if (days < 1) {
20
+ host_name = window.location.hostname;
21
+ document.cookie = name + "=" + value + expires + "; path=/; domain=." + host_name + ";";
22
+ if (host_name.indexOf( "www" ) != 1) {
23
+ var host_name_withoutwww = host_name.replace( 'www','' );
24
+ document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name_withoutwww + ";";
25
+ }
26
+ host_name = host_name.substring( host_name.lastIndexOf( ".", host_name.lastIndexOf( "." ) - 1 ) );
27
+ document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name + ";";
28
+ }
29
+ },
30
+ read: function (name) {
31
+ var nameEQ = name + "=";
32
+ var ca = document.cookie.split( ';' );
33
+ for (var i = 0; i < ca.length; i++) {
34
+ var c = ca[i];
35
+ while (c.charAt( 0 ) == ' ') {
36
+ c = c.substring( 1, c.length );
37
  }
38
+ if (c.indexOf( nameEQ ) === 0) {
39
+ return c.substring( nameEQ.length, c.length );
40
+ }
41
+ }
42
+ return null;
43
+ },
44
+ erase: function (name) {
45
+ this.set( name, "", -10 );
46
+ },
47
+ exists: function (name) {
48
+ return (this.read( name ) !== null);
49
+ },
50
+ getallcookies:function()
51
+ {
52
+ var pairs = document.cookie.split( ";" );
53
+ var cookieslist = {};
54
+ for (var i = 0; i < pairs.length; i++) {
55
+ var pair = pairs[i].split( "=" );
56
+ cookieslist[(pair[0] + '').trim()] = unescape( pair[1] );
57
+ }
58
+ return cookieslist;
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
  }
61
+ var CLI =
62
  {
63
  bar_config:{},
64
  showagain_config:{},
66
  js_blocking_enabled: false,
67
  set:function(args)
68
  {
69
+ if (typeof JSON.parse !== "function") {
70
+ console.log( "CookieLawInfo requires JSON.parse but your browser doesn't support it" );
71
+ return;
72
+ }
73
+ if (typeof args.settings !== 'object') {
74
+ this.settings = JSON.parse( args.settings );
75
+ } else {
76
+ this.settings = args.settings;
77
  }
 
 
 
 
 
 
 
 
78
  this.js_blocking_enabled = Boolean( Cli_Data.js_blocking );
79
+ this.settings = args.settings;
80
+ this.bar_elm = jQuery( this.settings.notify_div_id );
81
+ this.showagain_elm = jQuery( this.settings.showagain_div_id );
82
+ this.settingsModal = jQuery( '#cliSettingsPopup' );
83
+
84
+ /* buttons */
85
+ this.main_button = jQuery( '.cli-plugin-main-button' );
86
+ this.main_link = jQuery( '.cli-plugin-main-link' );
87
+ this.reject_link = jQuery( '.cookie_action_close_header_reject' );
88
+ this.delete_link = jQuery( ".cookielawinfo-cookie-delete" );
89
+ this.settings_button = jQuery( '.cli_settings_button' );
90
+ this.accept_all_button = jQuery( '.wt-cli-accept-all-btn' );
91
+ if (this.settings.cookie_bar_as == 'popup') {
92
+ CLI_COOKIEBAR_AS_POPUP = true;
 
93
  }
94
  this.mayBeSetPreferenceCookie();
95
+ this.addStyleAttribute();
96
  this.configBar();
97
+ this.toggleBar();
98
+ this.attachDelete();
99
+ this.attachEvents();
100
  this.configButtons();
101
  this.reviewConsent();
102
+ var cli_hidebar_on_readmore = this.hideBarInReadMoreLink();
103
+ if ( Boolean( this.settings.scroll_close ) === true && cli_hidebar_on_readmore === false) {
104
+ window.addEventListener( "scroll",CLI.closeOnScroll, false );
 
105
  }
106
+
107
  },
108
  hideBarInReadMoreLink:function()
109
  {
110
+ if ( Boolean( CLI.settings.button_2_hidebar ) === true && this.main_link.length > 0 && this.main_link.hasClass( 'cli-minimize-bar' )) {
 
111
  this.hideHeader();
112
  cliBlocker.cookieBar( false );
113
+ this.showagain_elm.slideDown( this.settings.animate_speed_show );
114
  return true;
115
  }
116
  return false;
117
  },
118
  attachEvents:function()
119
+ {
120
+ jQuery( document ).on(
121
+ 'click',
122
+ '.wt-cli-privacy-btn',
123
+ function(e){
124
+ e.preventDefault();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  CLI.accept_close();
126
+ CLI.settingsPopUpClose();
127
  }
128
+ );
129
+
130
+ jQuery( '.cli_action_button' ).on(
131
+ "click",
132
+ function(e) {
133
+ e.preventDefault();
134
+ var elm = jQuery( this );
135
+ var button_action = elm.attr( 'data-cli_action' );
136
+ var open_link = elm[0].hasAttribute( "href" ) && elm.attr( "href" ) != '#' ? true : false;
137
+ var new_window = false;
138
+ if (button_action == 'accept') {
139
+ CLI.accept_close();
140
+ new_window = Boolean( CLI.settings.button_1_new_win ) ? true : false;
141
+
142
+ } else if ( button_action == 'accept_all') {
143
+ CLI.enableAllCookies();
144
+ CLI.accept_close();
145
+ new_window = CLI.settings.button_7_new_win ? true : false;
146
+ } else if (button_action == 'reject') {
147
+ CLI.disableAllCookies();
148
+ CLI.reject_close();
149
+ new_window = Boolean( CLI.settings.button_3_new_win ) ? true : false;
150
+ }
151
+ if (open_link) {
152
+ if (new_window) {
153
+ window.open( elm.attr( "href" ),'_blank' );
154
+ } else {
155
+ window.location.href = elm.attr( "href" );
156
+ }
157
+ }
158
  }
159
+ );
 
 
 
 
 
 
 
 
 
 
160
  this.settingsPopUp();
161
  this.settingsTabbedAccordion();
162
  this.toggleUserPreferenceCheckBox();
165
 
166
  },
167
  toggleUserPreferenceCheckBox:function()
168
+ {
169
+
170
+ jQuery( '.cli-user-preference-checkbox' ).each(
171
+ function(){
172
+
173
+ categoryCookie = 'cookielawinfo-' + jQuery( this ).attr( 'data-id' );
174
+ categoryCookieValue = CLI_Cookie.read( categoryCookie );
175
+ if ( categoryCookieValue == null ) {
176
+ if (jQuery( this ).is( ':checked' )) {
177
+ CLI_Cookie.set( categoryCookie,'yes',CLI_ACCEPT_COOKIE_EXPIRE );
178
+ } else {
179
+ CLI_Cookie.set( categoryCookie,'no',CLI_ACCEPT_COOKIE_EXPIRE );
180
+ }
181
+ } else {
182
+ if (categoryCookieValue == "yes") {
183
+ jQuery( this ).prop( "checked",true );
184
+ } else {
185
+ jQuery( this ).prop( "checked",false );
186
+ }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  }
189
 
190
  }
191
+ );
192
+ jQuery( '.cli-user-preference-checkbox' ).on(
193
+ "click",
194
+ function(e) {
195
+ var dataID = jQuery( this ).attr( 'data-id' );
196
+ var currentToggleElm = jQuery( '.cli-user-preference-checkbox[data-id=' + dataID + ']' );
197
+ if (jQuery( this ).is( ':checked' )) {
198
+ CLI_Cookie.set( 'cookielawinfo-' + dataID,'yes',CLI_ACCEPT_COOKIE_EXPIRE );
199
+ currentToggleElm.prop( 'checked',true );
200
+ } else {
201
+ CLI_Cookie.set( 'cookielawinfo-' + dataID,'no',CLI_ACCEPT_COOKIE_EXPIRE );
202
+ currentToggleElm.prop( 'checked',false );
203
+ }
204
+ CLI.checkCategories();
205
+ CLI.generateConsent();
206
  }
207
+ );
208
+
 
 
209
  },
210
  settingsPopUp:function()
211
+ {
212
+ jQuery( document ).on(
213
+ 'click',
214
+ '.cli_settings_button',
215
+ function(e){
216
+ e.preventDefault();
217
+ CLI.settingsModal.addClass( "cli-show" ).css( {'opacity':0} ).animate( {'opacity':1} );
218
+ CLI.settingsModal.removeClass( 'cli-blowup cli-out' ).addClass( "cli-blowup" );
219
+ jQuery( 'body' ).addClass( "cli-modal-open" );
220
+ jQuery( ".cli-settings-overlay" ).addClass( "cli-show" );
221
+ jQuery( "#cookie-law-info-bar" ).css( {'opacity':.1} );
222
+ if ( ! jQuery( '.cli-settings-mobile' ).is( ':visible' )) {
223
+ CLI.settingsModal.find( '.cli-nav-link:eq(0)' ).trigger( "click" );
224
+ }
225
  }
226
+ );
227
+ jQuery( '#cliModalClose' ).on(
228
+ "click",
229
+ function(e) {
 
 
 
230
  CLI.settingsPopUpClose();
231
  }
232
+ );
233
+ CLI.settingsModal.on(
234
+ "click",
235
+ function(e) {
236
+ if ( ! (document.getElementsByClassName( 'cli-modal-dialog' )[0].contains( e.target ))) {
237
+ CLI.settingsPopUpClose();
238
+ }
 
239
  }
240
+ );
241
+ jQuery( '.cli_enable_all_btn' ).on(
242
+ "click",
243
+ function(e) {
244
+ var cli_toggle_btn = jQuery( this );
245
+ var enable_text = cli_toggle_btn.attr( 'data-enable-text' );
246
+ var disable_text = cli_toggle_btn.attr( 'data-disable-text' );
247
+ if (cli_toggle_btn.hasClass( 'cli-enabled' )) {
248
+ CLI.disableAllCookies();
249
+ cli_toggle_btn.html( enable_text );
250
+ } else {
251
+ CLI.enableAllCookies();
252
+ cli_toggle_btn.html( disable_text );
253
 
254
+ }
255
+ jQuery( this ).toggleClass( 'cli-enabled' );
256
  }
257
+ );
258
+
 
259
  this.privacyReadmore();
260
  },
261
  settingsTabbedAccordion:function()
262
  {
263
+ jQuery( ".cli-tab-header" ).on(
264
+ "click",
265
+ function(e) {
266
+ if ( ! (jQuery( e.target ).hasClass( 'cli-slider' ) || jQuery( e.target ).hasClass( 'cli-user-preference-checkbox' ))) {
267
+ if (jQuery( this ).hasClass( "cli-tab-active" )) {
268
+ jQuery( this ).removeClass( "cli-tab-active" );
269
+ jQuery( this )
270
+ .siblings( ".cli-tab-content" )
271
+ .slideUp( 200 );
272
 
273
+ } else {
274
+ jQuery( ".cli-tab-header" ).removeClass( "cli-tab-active" );
275
+ jQuery( this ).addClass( "cli-tab-active" );
276
+ jQuery( ".cli-tab-content" ).slideUp( 200 );
277
+ jQuery( this )
278
+ .siblings( ".cli-tab-content" )
279
+ .slideDown( 200 );
280
+ }
281
+ }
282
+ }
283
+ );
284
  },
285
  settingsPopUpClose:function()
286
  {
287
+ this.settingsModal.removeClass( 'cli-show' );
288
+ this.settingsModal.addClass( 'cli-out' );
289
+ jQuery( 'body' ).removeClass( "cli-modal-open" );
290
+ jQuery( ".cli-settings-overlay" ).removeClass( "cli-show" );
291
+ jQuery( "#cookie-law-info-bar" ).css( {'opacity':1} );
292
  },
293
  privacyReadmore:function()
294
+ {
295
+ var el = jQuery( '.cli-privacy-content .cli-privacy-content-text' );
296
+ if ( el.length > 0 ) {
297
+ var clone = el.clone(),
298
+ originalHtml = clone.html(),
299
+ originalHeight = el.outerHeight(),
300
+ Trunc = {
301
+ addReadmore:function(textBlock)
302
+ {
303
+ if (textBlock.html().length > 250) {
304
+ jQuery( '.cli-privacy-readmore' ).show();
305
+ } else {
306
+ jQuery( '.cli-privacy-readmore' ).hide();
307
+ }
308
+ },
309
+ truncateText : function( textBlock ) {
310
+ var strippedText = jQuery( '<div />' ).html( textBlock.html() );
311
+ strippedText.find( 'table' ).remove();
312
+ textBlock.html( strippedText.html() );
313
+ currentText = textBlock.text();
314
+ if (currentText.trim().length > 250) {
315
+ var newStr = currentText.substring( 0, 250 );
316
+ textBlock.empty().html( newStr ).append( '...' );
317
+ }
318
+ },
319
+ replaceText: function ( textBlock, original ){
320
+ return textBlock.html( original );
321
  }
322
+
 
 
 
 
323
  };
324
+ Trunc.addReadmore( el );
325
+ Trunc.truncateText( el );
326
+ jQuery( 'a.cli-privacy-readmore' ).on(
327
+ "click",
328
+ function(e) {
329
+ e.preventDefault();
330
+ if (jQuery( '.cli-privacy-overview' ).hasClass( 'cli-collapsed' )) {
331
+ Trunc.truncateText( el );
332
+ jQuery( '.cli-privacy-overview' ).removeClass( 'cli-collapsed' );
333
+ el.css( 'height', '100%' );
334
+ } else {
335
+ jQuery( '.cli-privacy-overview' ).addClass( 'cli-collapsed' );
336
+ Trunc.replaceText( el, originalHtml );
337
+ }
338
+
339
  }
340
+ );
 
 
341
  }
342
+
343
  },
344
  attachDelete:function()
345
  {
346
+ this.delete_link.on(
347
+ "click",
348
+ function(e) {
349
+ CLI_Cookie.erase( CLI_ACCEPT_COOKIE_NAME );
350
+ for (var k in Cli_Data.nn_cookie_ids) {
351
+ CLI_Cookie.erase( Cli_Data.nn_cookie_ids[k] );
352
+ }
353
+ CLI.generateConsent();
354
+ return false;
355
  }
356
+ );
357
+
 
 
358
  },
359
  configButtons:function()
360
  {
361
+ /*[cookie_button] */
362
+ this.main_button.css( 'color',this.settings.button_1_link_colour );
363
+ if ( Boolean( this.settings.button_1_as_button ) ) {
364
+ this.main_button.css( 'background-color',this.settings.button_1_button_colour );
365
+
366
+ this.main_button.on(
367
+ 'mouseenter',
368
+ function(){
369
+ jQuery( this ).css( 'background-color',CLI.settings.button_1_button_hover );
370
+ }
371
+ )
372
+ .on(
373
+ 'mouseleave',
374
+ function(){
375
+ jQuery( this ).css( 'background-color',CLI.settings.button_1_button_colour );
376
+ }
377
+ );
378
+ }
379
+
380
+ /* [cookie_link] */
381
+ this.main_link.css( 'color',this.settings.button_2_link_colour );
382
+ if ( Boolean( this.settings.button_2_as_button ) ) {
383
+ this.main_link.css( 'background-color',this.settings.button_2_button_colour );
384
+
385
+ this.main_link.on(
386
+ 'mouseenter',
387
+ function(){
388
+ jQuery( this ).css( 'background-color',CLI.settings.button_2_button_hover );
389
+ }
390
+ )
391
+ .on(
392
+ 'mouseleave',
393
+ function(){
394
+ jQuery( this ).css( 'background-color',CLI.settings.button_2_button_colour );
395
+ }
396
+ );
397
 
398
+ }
399
+ /* [cookie_reject] */
400
+ this.reject_link.css( 'color',this.settings.button_3_link_colour );
401
+ if ( Boolean( this.settings.button_3_as_button ) ) {
 
402
 
403
+ this.reject_link.css( 'background-color',this.settings.button_3_button_colour );
404
+ this.reject_link.on(
405
+ 'mouseenter',
406
+ function(){
407
+ jQuery( this ).css( 'background-color',CLI.settings.button_3_button_hover );
408
+ }
409
+ )
410
+ .on(
411
+ 'mouseleave',
412
+ function(){
413
+ jQuery( this ).css( 'background-color',CLI.settings.button_3_button_colour );
414
+ }
415
+ );
416
+ }
417
+ /* [cookie_settings] */
418
+ this.settings_button.css( 'color',this.settings.button_4_link_colour );
419
+ if ( Boolean( this.settings.button_4_as_button ) ) {
420
+ this.settings_button.css( 'background-color',this.settings.button_4_button_colour );
421
+ this.settings_button.on(
422
+ 'mouseenter',
423
+ function(){
424
+ jQuery( this ).css( 'background-color',CLI.settings.button_4_button_hover );
425
+ }
426
+ )
427
+ .on(
428
+ 'mouseleave',
429
+ function(){
430
+ jQuery( this ).css( 'background-color',CLI.settings.button_4_button_colour );
431
+ }
432
+ );
433
  }
 
 
 
 
 
 
 
 
 
 
 
 
434
  /* [cookie_accept_all] */
435
+ this.accept_all_button.css( 'color',this.settings.button_7_link_colour );
436
+ if (this.settings.button_7_as_button) {
437
+ this.accept_all_button.css( 'background-color',this.settings.button_7_button_colour );
438
+ this.accept_all_button.on(
439
+ 'mouseenter',
440
+ function(){
441
+ jQuery( this ).css( 'background-color',CLI.settings.button_7_button_hover );
442
+ }
443
+ )
444
+ .on(
445
+ 'mouseleave',
446
+ function(){
447
+ jQuery( this ).css( 'background-color',CLI.settings.button_7_button_colour );
448
+ }
449
+ );
450
  }
451
  },
452
  toggleBar:function()
453
  {
454
+ if (CLI_COOKIEBAR_AS_POPUP) {
455
+ this.barAsPopUp( 1 );
 
456
  }
457
+ if (CLI.settings.cookie_bar_as == 'widget') {
458
+ this.barAsWidget( 1 );
 
459
  }
460
+ if ( ! CLI_Cookie.exists( CLI_ACCEPT_COOKIE_NAME )) {
461
+ this.displayHeader();
462
+ } else {
463
+ this.hideHeader();
464
+ }
465
+ if ( Boolean( this.settings.show_once_yn )) {
466
+ setTimeout(
467
+ function(){
468
+ CLI.close_header();
469
+ },
470
+ CLI.settings.show_once
471
+ );
472
  }
473
+ if ( CLI.js_blocking_enabled === false ) {
474
+ if ( Boolean( Cli_Data.ccpaEnabled ) === true ) {
475
+ if ( Cli_Data.ccpaType === 'ccpa' && Boolean( Cli_Data.ccpaBarEnabled ) === false ) {
476
  cliBlocker.cookieBar( false );
477
  }
478
  } else {
479
+ jQuery( '.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element' ).remove();
480
  }
481
+ }
482
+
483
+ this.showagain_elm.on(
484
+ "click",
485
+ function(e) {
486
+ e.preventDefault();
487
+ CLI.showagain_elm.slideUp(
488
+ CLI.settings.animate_speed_hide,
489
+ function()
490
+ {
491
+ CLI.bar_elm.slideDown( CLI.settings.animate_speed_show );
492
+ if (CLI_COOKIEBAR_AS_POPUP) {
493
+ CLI.showPopupOverlay();
494
+ }
495
+ }
496
+ );
497
+ }
498
+ );
499
  },
500
  configShowAgain:function()
501
  {
502
  this.showagain_config = {
503
+ 'background-color': this.settings.background,
504
+ 'color':this.l1hs( this.settings.text ),
505
+ 'position': 'fixed',
506
+ 'font-family': this.settings.font_family
507
+ };
508
+ if (Boolean( this.settings.border_on ) ) {
509
+ var border_to_hide = 'border-' + this.settings.notify_position_vertical;
510
+ this.showagain_config['border'] = '1px solid ' + this.l1hs( this.settings.border );
511
+ this.showagain_config[border_to_hide] = 'none';
512
+ }
513
+ var cli_win = jQuery( window );
514
+ var cli_winw = cli_win.width();
515
+ var showagain_x_pos = this.settings.showagain_x_position;
516
+ if (cli_winw < 300) {
517
+ showagain_x_pos = 10;
518
+ this.showagain_config.width = cli_winw - 20;
519
+ } else {
520
+ this.showagain_config.width = 'auto';
521
+ }
522
+ var cli_defw = cli_winw > 400 ? 500 : cli_winw - 20;
523
+ if (CLI_COOKIEBAR_AS_POPUP) { /* cookie bar as popup */
524
+ var sa_pos = this.settings.popup_showagain_position;
525
+ var sa_pos_arr = sa_pos.split( '-' );
526
+ if (sa_pos_arr[1] == 'left') {
527
+ this.showagain_config.left = showagain_x_pos;
528
+ } else if (sa_pos_arr[1] == 'right') {
529
+ this.showagain_config.right = showagain_x_pos;
530
+ }
531
+ if (sa_pos_arr[0] == 'top') {
532
+ this.showagain_config.top = 0;
 
 
 
 
 
 
 
533
 
534
+ } else if (sa_pos_arr[0] == 'bottom') {
535
+ this.showagain_config.bottom = 0;
536
+ }
537
+ this.bar_config['position'] = 'fixed';
 
538
 
539
+ } else if (this.settings.cookie_bar_as == 'widget') {
540
+ this.showagain_config.bottom = 0;
541
+ if (this.settings.widget_position == 'left') {
542
+ this.showagain_config.left = showagain_x_pos;
543
+ } else if (this.settings.widget_position == 'right') {
544
+ this.showagain_config.right = showagain_x_pos;
545
+ }
546
+ } else {
547
+ if (this.settings.notify_position_vertical == "top") {
548
+ this.showagain_config.top = '0';
549
+ } else if (this.settings.notify_position_vertical == "bottom") {
550
+ this.bar_config['position'] = 'fixed';
551
+ this.bar_config['bottom'] = '0';
552
+ this.showagain_config.bottom = '0';
553
+ }
554
+ if (this.settings.notify_position_horizontal == "left") {
555
+ this.showagain_config.left = showagain_x_pos;
556
+ } else if (this.settings.notify_position_horizontal == "right") {
557
+ this.showagain_config.right = showagain_x_pos;
558
+ }
559
+ }
560
+ this.showagain_elm.css( this.showagain_config );
 
 
 
 
 
 
 
 
 
 
561
  },
562
  configBar:function()
563
  {
564
  this.bar_config = {
565
+ 'background-color':this.settings.background,
566
+ 'color':this.settings.text,
567
+ 'font-family':this.settings.font_family
568
+ };
569
+ if (this.settings.notify_position_vertical == "top") {
570
+ this.bar_config['top'] = '0';
571
+ if ( Boolean( this.settings.header_fix ) === true) {
572
+ this.bar_config['position'] = 'fixed';
573
+ }
574
+ } else {
575
+ this.bar_config['bottom'] = '0';
576
+ }
577
+ this.configShowAgain();
578
+ this.bar_elm.css( this.bar_config ).hide();
579
+ },
580
+ l1hs:function(str)
581
+ {
582
+ if (str.charAt( 0 ) == "#") {
583
+ str = str.substring( 1, str.length );
584
+ } else {
585
+ return "#" + str;
586
+ }
587
+ return this.l1hs( str );
588
  },
589
+ close_header:function()
590
  {
591
+ CLI_Cookie.set( CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE );
592
+ this.hideHeader();
 
 
 
 
593
  },
594
+ accept_close:function()
595
  {
 
 
 
 
 
596
  this.hidePopupOverlay();
597
  this.generateConsent();
598
  this.cookieLawInfoRunCallBacks();
599
 
600
+ CLI_Cookie.set( CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE );
601
+ if ( Boolean( this.settings.notify_animate_hide ) ) {
602
+ if ( CLI.js_blocking_enabled === true ) {
 
603
  this.bar_elm.slideUp( this.settings.animate_speed_hide, cliBlocker.runScripts );
604
  } else {
605
  this.bar_elm.slideUp( this.settings.animate_speed_hide );
606
  }
607
+
608
+ } else {
609
+ if ( CLI.js_blocking_enabled === true ) {
610
+ this.bar_elm.hide( 0, cliBlocker.runScripts );
 
611
 
612
  } else {
613
  this.bar_elm.hide();
614
  }
 
 
 
 
615
  }
616
+ if ( Boolean( this.settings.showagain_tab ) ) {
617
+ this.showagain_elm.slideDown( this.settings.animate_speed_show );
618
+ }
619
+ if ( Boolean( this.settings.accept_close_reload ) === true ) {
620
+ this.reload_current_page();
621
+ }
622
+ return false;
623
+ },
624
+ reject_close:function()
625
+ {
626
  this.hidePopupOverlay();
627
  this.generateConsent();
628
  this.cookieLawInfoRunCallBacks();
629
+ for (var k in Cli_Data.nn_cookie_ids) {
630
+ CLI_Cookie.erase( Cli_Data.nn_cookie_ids[k] );
631
+ }
632
+ CLI_Cookie.set( CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE );
 
 
 
 
 
633
 
634
+ if ( Boolean( this.settings.notify_animate_hide ) ) {
635
+ if ( CLI.js_blocking_enabled === true ) {
636
+
637
+ this.bar_elm.slideUp( this.settings.animate_speed_hide, cliBlocker.runScripts );
638
 
639
  } else {
640
+
641
+ this.bar_elm.slideUp( this.settings.animate_speed_hide );
642
  }
643
+
644
+ } else {
645
+ if ( CLI.js_blocking_enabled === true ) {
 
646
 
647
  this.bar_elm.hide( cliBlocker.runScripts );
648
 
651
  this.bar_elm.hide();
652
 
653
  }
654
+
655
+ }
656
+ if ( Boolean( this.settings.showagain_tab ) ) {
657
+ this.showagain_elm.slideDown( this.settings.animate_speed_show );
658
+ }
659
+ if ( Boolean( this.settings.reject_close_reload ) === true ) {
660
+ this.reload_current_page();
661
+ }
662
+ return false;
663
+ },
664
+ reload_current_page:function()
 
 
 
 
 
 
 
665
  {
666
+
667
+ window.location.reload( true );
668
+ },
669
+ closeOnScroll:function()
670
+ {
671
+ if (window.pageYOffset > 100 && ! CLI_Cookie.read( CLI_ACCEPT_COOKIE_NAME )) {
672
+ CLI.accept_close();
673
+ if ( Boolean( CLI.settings.scroll_close_reload ) === true) {
674
+ window.location.reload();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
  }
676
+ window.removeEventListener( "scroll",CLI.closeOnScroll,false );
677
  }
678
+ },
679
+ displayHeader:function()
680
+ {
681
+ if ( Boolean( this.settings.notify_animate_show ) ) {
682
+ this.bar_elm.slideDown( this.settings.animate_speed_show );
683
+ } else {
684
+ this.bar_elm.show();
 
 
 
 
 
 
 
 
685
  }
686
+ this.showagain_elm.hide();
687
+ if (CLI_COOKIEBAR_AS_POPUP) {
688
+ this.showPopupOverlay();
 
 
 
 
 
 
 
 
 
 
 
689
  }
690
+ },
691
+ hideHeader:function()
692
+ {
693
+ if ( Boolean( this.settings.showagain_tab ) ) {
694
+ if ( Boolean( this.settings.notify_animate_show ) ) {
695
+ this.showagain_elm.slideDown( this.settings.animate_speed_show );
696
+ } else {
697
+ this.showagain_elm.show();
698
+ }
699
+ } else {
700
+ this.showagain_elm.hide();
 
 
 
 
 
 
 
 
701
  }
702
+ this.bar_elm.slideUp( this.settings.animate_speed_show );
703
+ this.hidePopupOverlay();
704
+ },
705
+ hidePopupOverlay:function()
706
+ {
707
+ jQuery( 'body' ).removeClass( "cli-barmodal-open" );
708
+ jQuery( ".cli-popupbar-overlay" ).removeClass( "cli-show" );
709
+ },
710
+ showPopupOverlay:function()
711
+ {
712
+ if ( this.bar_elm.length ) {
713
+ if ( Boolean( this.settings.popup_overlay ) ) {
714
+ jQuery( 'body' ).addClass( "cli-barmodal-open" );
715
+ jQuery( ".cli-popupbar-overlay" ).addClass( "cli-show" );
716
+ }
717
  }
718
+
719
+ },
720
+ barAsWidget:function(a)
721
  {
722
+ var cli_elm = this.bar_elm;
723
+ cli_elm.attr( 'data-cli-type','widget' );
724
+ var cli_win = jQuery( window );
725
+ var cli_winh = cli_win.height() - 40;
726
+ var cli_winw = cli_win.width();
727
+ var cli_defw = cli_winw > 400 ? 300 : cli_winw - 30;
728
+ cli_elm.css(
729
  {
730
+ 'width':cli_defw,'height':'auto','max-height':cli_winh,'overflow':'auto','position':'fixed','box-sizing':'border-box'
731
+ }
732
+ );
733
+ if ( this.checkifStyleAttributeExist() === false ) {
734
+ cli_elm.css( {'padding':'25px 15px'} );
735
+ }
736
+ if (this.settings.widget_position == 'left') {
737
+ cli_elm.css(
738
  {
739
+ 'left':'15px','right':'auto','bottom':'15px','top':'auto'
740
  }
741
+ );
742
+ } else {
743
+ cli_elm.css(
744
  {
745
+ 'left':'auto','right':'15px','bottom':'15px','top':'auto'
746
  }
747
+ );
748
+ }
749
+ if (a) {
750
+ this.setResize();
751
+ }
752
  },
753
+ barAsPopUp:function(a)
754
+ {
755
+ if (typeof cookie_law_info_bar_as_popup === 'function') {
756
+ return false;
757
+ }
758
+ var cli_elm = this.bar_elm;
759
+ cli_elm.attr( 'data-cli-type','popup' );
760
+ var cli_win = jQuery( window );
761
+ var cli_winh = cli_win.height() - 40;
762
+ var cli_winw = cli_win.width();
763
+ var cli_defw = cli_winw > 700 ? 500 : cli_winw - 20;
764
+
765
+ cli_elm.css(
766
  {
767
+ 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw / 2) * -1,'margin-top':'-100px','overflow':'auto'
 
768
  }
769
+ ).addClass( 'cli-bar-popup cli-modal-content' );
770
+ if ( this.checkifStyleAttributeExist() === false ) {
771
+ cli_elm.css( {'padding':'25px 15px'} );
772
+ }
773
+ cli_h = cli_elm.height();
774
+ li_h = cli_h < 200 ? 200 : cli_h;
775
+ cli_elm.css( {'top':'50%','margin-top':((cli_h / 2) + 30) * -1} );
776
+ setTimeout(
777
+ function(){
778
+ cli_elm.css(
779
+ {
780
+ 'bottom':''
781
+ }
782
+ );
783
+ },
784
+ 100
785
+ );
786
+ if (a) {
787
+ this.setResize();
788
+ }
789
+ },
790
+ setResize:function()
791
+ {
792
+ var resizeTmr = null;
793
+ jQuery( window ).resize(
794
+ function() {
795
+ clearTimeout( resizeTmr );
796
+ resizeTmr = setTimeout(
797
+ function()
798
+ {
799
+ if (CLI_COOKIEBAR_AS_POPUP) {
800
+ CLI.barAsPopUp();
801
+ }
802
+ if (CLI.settings.cookie_bar_as == 'widget') {
803
+ CLI.barAsWidget();
804
+ }
805
+ CLI.configShowAgain();
806
+ },
807
+ 500
808
+ );
809
+ }
810
+ );
811
+ },
812
+ enableAllCookies:function()
813
+ {
814
+
815
+ jQuery( '.cli-user-preference-checkbox' ).each(
816
+ function(){
817
+ var cli_chkbox_elm = jQuery( this );
818
+ var cli_chkbox_data_id = cli_chkbox_elm.attr( 'data-id' );
819
+ if (cli_chkbox_data_id != 'checkbox-necessary') {
820
+ cli_chkbox_elm.prop( 'checked',true );
821
+ CLI_Cookie.set( 'cookielawinfo-' + cli_chkbox_data_id,'yes',CLI_ACCEPT_COOKIE_EXPIRE );
822
+ }
823
+ }
824
+ );
825
  },
826
  disableAllCookies:function()
827
+ {
828
+ jQuery( '.cli-user-preference-checkbox' ).each(
829
+ function(){
830
 
831
+ var cli_chkbox_elm = jQuery( this );
832
+ var cli_chkbox_data_id = cli_chkbox_elm.attr( 'data-id' );
833
+ cliCategorySlug = cli_chkbox_data_id.replace( 'checkbox-','' );
834
+ if (Cli_Data.strictlyEnabled.indexOf( cliCategorySlug ) === -1) {
835
+ cli_chkbox_elm.prop( 'checked',false );
836
+ CLI_Cookie.set( 'cookielawinfo-' + cli_chkbox_data_id,'no',CLI_ACCEPT_COOKIE_EXPIRE );
837
+ }
838
  }
839
+ );
840
  },
841
  hideCookieBarOnClose: function() {
842
+ jQuery( document ).on(
843
+ 'click',
844
+ '.cli_cookie_close_button',
845
+ function(e){
846
+ e.preventDefault();
847
+ var elm = jQuery( this );
848
+ var button_action = elm.attr( 'data-cli_action' );
849
+ if ( Cli_Data.ccpaType === 'ccpa' ) {
850
+ CLI.enableAllCookies();
851
+ }
852
+ CLI.accept_close();
853
  }
854
+ );
 
855
  },
856
  checkCategories:function()
857
+ {
858
+ var cliAllowedCategories = [];
859
+ var cli_categories = {};
860
+ jQuery( '.cli-user-preference-checkbox' ).each(
861
+ function()
862
+ { var status = false;
863
+ cli_chkbox_elm = jQuery( this );
864
+ cli_chkbox_data_id = cli_chkbox_elm.attr( 'data-id' );
865
+ cli_chkbox_data_id = cli_chkbox_data_id.replace( 'checkbox-','' );
866
+ cli_chkbox_data_id_trimmed = cli_chkbox_data_id.replace( '-','_' )
867
+ if (jQuery( cli_chkbox_elm ).is( ':checked' )) {
868
+ status = true;
869
+ cliAllowedCategories.push( cli_chkbox_data_id );
870
+ }
871
+
872
+ cli_categories[cli_chkbox_data_id_trimmed] = status;
873
  }
874
+ );
 
 
875
  CLI.allowedCategories = cliAllowedCategories;
876
  },
877
  cookieLawInfoRunCallBacks:function()
878
+ {
879
  this.checkCategories();
880
+ if (CLI_Cookie.read( CLI_ACCEPT_COOKIE_NAME ) == 'yes') {
881
+ if ("function" == typeof CookieLawInfo_Accept_Callback) {
882
+ CookieLawInfo_Accept_Callback();
 
883
  }
884
  }
885
  },
886
  generateConsent:function()
887
+ {
888
+ var preferenceCookie = CLI_Cookie.read( CLI_PREFERNCE_COOKIE );
889
+ cliConsent = {};
890
+ if (preferenceCookie !== null) {
891
+ cliConsent = window.atob( preferenceCookie );
892
+ cliConsent = JSON.parse( cliConsent );
893
  }
894
  cliConsent.ver = Cli_Data.consentVersion;
895
+ categories = [];
896
+ jQuery( '.cli-user-preference-checkbox' ).each(
897
+ function(){
898
+ categoryVal = '';
899
+ cli_chkbox_data_id = jQuery( this ).attr( 'data-id' );
900
+ cli_chkbox_data_id = cli_chkbox_data_id.replace( 'checkbox-','' );
901
+ if (jQuery( this ).is( ':checked' )) {
902
+ categoryVal = true;
903
+ } else {
904
+ categoryVal = false;
905
+ }
906
+ cliConsent[cli_chkbox_data_id] = categoryVal;
907
  }
908
+ );
909
+ cliConsent = JSON.stringify( cliConsent );
910
+ cliConsent = window.btoa( cliConsent );
911
+ CLI_Cookie.set( CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE );
 
912
  },
913
  addStyleAttribute:function()
914
  {
915
+ var bar = this.bar_elm;
916
+ var styleClass = '';
917
+ if (jQuery( bar ).find( '.cli-bar-container' ).length > 0) {
918
+ styleClass = jQuery( '.cli-bar-container' ).attr( 'class' );
919
+ styleClass = styleClass.replace( 'cli-bar-container','' );
920
+ styleClass = styleClass.trim();
921
+ jQuery( bar ).attr( 'data-cli-style',styleClass );
 
922
  }
923
  },
924
  getParameterByName: function( name, url ) {
925
+ if ( ! url) {
926
+ url = window.location.href;
927
+ }
928
+ name = name.replace( /[\[\]]/g, '\\$&' );
929
+ var regex = new RegExp( '[?&]' + name + '(=([^&#]*)|&|#|$)' ),
930
+ results = regex.exec( url );
931
+ if ( ! results) {
932
+ return null;
933
+ }
934
+ if ( ! results[2]) {
935
+ return '';
936
+ }
937
+ return decodeURIComponent( results[2].replace( /\+/g, ' ' ) );
938
  },
939
  CookieLawInfo_Callback: function( enableBar, enableBlocking ) {
940
+ enableBar = typeof enableBar !== 'undefined' ? enableBar : true;
941
  enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true;
942
+ if ( CLI.js_blocking_enabled === true && Boolean( Cli_Data.custom_integration ) === true ) {
943
  cliBlocker.cookieBar( enableBar );
944
  cliBlocker.runScripts( enableBlocking );
945
  }
946
  },
947
+ checkifStyleAttributeExist: function()
948
+ {
949
  var exist = false;
950
+ var attr = this.bar_elm.attr( 'data-cli-style' );
951
  if (typeof attr !== typeof undefined && attr !== false) {
952
  exist = true;
953
  }
954
  return exist;
955
  },
956
  reviewConsent : function()
957
+ {
958
+ jQuery( document ).on(
959
+ 'click',
960
+ '.cli_manage_current_consent,.wt-cli-manage-consent-link',
961
+ function(){
962
+ CLI.displayHeader();
963
+ }
964
+ );
965
  },
966
  mayBeSetPreferenceCookie: function() {
967
+ if ( CLI.getParameterByName( 'cli_bypass' ) === "1" ) {
968
  CLI.generateConsent();
969
  }
970
  }
971
  }
972
+ var cliBlocker =
973
+ {
974
  blockingStatus: true,
975
  scriptsLoaded: false,
976
  ccpaEnabled : false,
978
  ccpaApplicable : false,
979
  ccpaBarEnabled: false,
980
  cliShowBar: true ,
981
+ isBypassEnabled: CLI.getParameterByName( 'cli_bypass' ),
982
  checkPluginStatus: function(callbackA , callbackB )
983
+ {
984
+ this.ccpaEnabled = Boolean( Cli_Data.ccpaEnabled );
985
  this.ccpaRegionBased = Boolean( Cli_Data.ccpaRegionBased );
986
+ this.ccpaBarEnabled = Boolean( Cli_Data.ccpaBarEnabled );
987
+
988
+ if ( Boolean( Cli_Data.custom_integration ) === true ) {
989
  callbackA( false );
990
+ } else {
991
+ if ( this.ccpaEnabled === true ) {
 
992
  this.ccpaApplicable = true;
993
+ if ( Cli_Data.ccpaType === 'ccpa') {
994
+ if ( this.ccpaBarEnabled !== true ) {
995
+ this.cliShowBar = false;
996
  this.blockingStatus = false;
997
  }
998
  }
999
  } else {
1000
+ jQuery( '.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element' ).remove();
1001
  }
1002
  if ( cliBlocker.isBypassEnabled === "1") {
1003
  cliBlocker.blockingStatus = false;
1004
  }
1005
  callbackA( this.cliShowBar );
1006
+ callbackB( this.blockingStatus );
1007
  }
1008
+
 
1009
  },
1010
  cookieBar: function( showbar )
1011
+ {
1012
+ showbar = typeof showbar !== 'undefined' ? showbar : true;
1013
  cliBlocker.cliShowBar = showbar;
1014
+ if (cliBlocker.cliShowBar === false) {
 
1015
  CLI.bar_elm.hide();
1016
  CLI.showagain_elm.hide();
1017
+ CLI.settingsModal.removeClass( 'cli-blowup cli-out' );
1018
  CLI.hidePopupOverlay();
1019
+ jQuery( ".cli-settings-overlay" ).removeClass( "cli-show" );
1020
+ } else {
1021
+ if ( ! CLI_Cookie.exists( CLI_ACCEPT_COOKIE_NAME )) {
 
 
 
1022
  CLI.displayHeader();
1023
+ } else {
 
 
1024
  CLI.hideHeader();
1025
  }
1026
  }
1027
  },
1028
+ removeCookieByCategory : function()
1029
+ {
1030
 
1031
+ if (cliBlocker.blockingStatus === true) {
1032
+ if (CLI_Cookie.read( CLI_ACCEPT_COOKIE_NAME ) !== null) {
 
 
1033
  var non_necessary_cookies = Cli_Data.non_necessary_cookies;
1034
  for (var key in non_necessary_cookies) {
1035
  currentCategory = key;
1036
+ if (CLI.allowedCategories.indexOf( currentCategory ) === -1) {
 
1037
  var nonNecessaryCookies = non_necessary_cookies[currentCategory];
1038
+ for (var i = 0; i < nonNecessaryCookies.length; i++) {
1039
+ if (CLI_Cookie.read( nonNecessaryCookies[i] ) !== null) {
1040
+ CLI_Cookie.erase( nonNecessaryCookies[i] );
 
 
1041
  }
1042
 
1043
  }
1046
  }
1047
  }
1048
  },
1049
+ runScripts:function( blocking )
1050
+ {
1051
+ blocking = typeof blocking !== 'undefined' ? blocking : true;
1052
  cliBlocker.blockingStatus = blocking;
1053
+ srcReplaceableElms = ['iframe','IFRAME','EMBED','embed','OBJECT','object','IMG','img'];
1054
+ var genericFuncs =
1055
+ {
1056
+
1057
  renderByElement: function( callback )
1058
+ {
1059
  cliScriptFuncs.renderScripts();
1060
  callback();
1061
  cliBlocker.scriptsLoaded = true;
1062
  },
1063
 
1064
  };
1065
+ var cliScriptFuncs =
1066
  {
1067
  // trigger DOMContentLoaded
1068
+ scriptsDone:function()
1069
+ {
1070
  if (typeof Cli_Data.triggerDomRefresh !== 'undefined') {
1071
+ if ( Boolean( Cli_Data.triggerDomRefresh ) === true ) {
1072
+ var DOMContentLoadedEvent = document.createEvent( 'Event' )
1073
+ DOMContentLoadedEvent.initEvent( 'DOMContentLoaded', true, true )
1074
+ window.document.dispatchEvent( DOMContentLoadedEvent );
 
1075
  }
1076
  }
1077
  },
1078
  seq :function(arr, callback, index) {
1079
  // first call, without an index
1080
  if (typeof index === 'undefined') {
1081
+ index = 0
1082
  }
1083
+
1084
+ arr[index](
1085
+ function () {
1086
+ index++
1087
+ if (index === arr.length) {
1088
+ callback()
1089
+ } else {
1090
+ cliScriptFuncs.seq( arr, callback, index )
1091
+ }
1092
+ }
1093
+ )
1094
+ },
1095
  /* script runner */
1096
  insertScript:function($script,callback) {
1097
+ var s = '';
1098
+ var scriptType = $script.getAttribute( 'data-cli-script-type' );
1099
+ var elementPosition = $script.getAttribute( 'data-cli-element-position' );
1100
+ var isBlock = $script.getAttribute( 'data-cli-block' );
1101
+ var s = document.createElement( 'script' );
1102
+ var ccpaOptedOut = cliBlocker.ccpaOptedOut();
1103
+ s.type = 'text/plain';
1104
+ if ($script.async) {
 
1105
  s.async = $script.async;
1106
  }
1107
+ if ($script.defer) {
 
1108
  s.defer = $script.defer;
1109
  }
1110
  if ($script.src) {
1111
+ s.onload = callback
1112
  s.onerror = callback
1113
+ s.src = $script.src
1114
  } else {
1115
  s.textContent = $script.innerText
1116
  }
1117
+ var attrs = jQuery( $script ).prop( "attributes" );
1118
  for (var ii = 0; ii < attrs.length; ++ii) {
1119
  if (attrs[ii].nodeName !== 'id') {
1120
+ s.setAttribute( attrs[ii].nodeName,attrs[ii].value );
1121
  }
1122
  }
1123
+ if (cliBlocker.blockingStatus === true) {
1124
+
1125
+ if (( CLI_Cookie.read( CLI_ACCEPT_COOKIE_NAME ) == 'yes' && CLI.allowedCategories.indexOf( scriptType ) !== -1 ) ) {
1126
+ s.setAttribute( 'data-cli-consent','accepted' );
 
 
1127
  s.type = 'text/javascript';
1128
  }
1129
+ if ( cliBlocker.ccpaApplicable === true ) {
1130
+ if ( ccpaOptedOut === true || CLI_Cookie.read( CLI_ACCEPT_COOKIE_NAME ) == null ) {
1131
  s.type = 'text/plain';
1132
  }
1133
  }
1134
+ } else {
 
 
1135
  s.type = 'text/javascript';
1136
  }
1137
+
1138
+ if ($script.type != s.type) {
1139
+ if (elementPosition === 'head') {
1140
+ document.head.appendChild( s );
1141
+ } else {
1142
+ document.body.appendChild( s );
 
1143
  }
1144
+ if ( ! $script.src) {
1145
  callback()
1146
+ }
1147
+ $script.parentNode.removeChild( $script );
1148
+
1149
+ } else {
 
1150
 
1151
  callback();
1152
  }
1153
  },
1154
  renderScripts:function()
1155
+ {
1156
+ var $scripts = document.querySelectorAll( 'script[data-cli-class="cli-blocker-script"]' );
1157
+ if ($scripts.length > 0) {
 
1158
  var runList = []
1159
  var typeAttr
1160
+ Array.prototype.forEach.call(
1161
+ $scripts,
1162
+ function ($script) {
1163
+ // only run script tags without the type attribute
1164
+ // or with a javascript mime attribute value
1165
+ typeAttr = $script.getAttribute( 'type' )
1166
+ runList.push(
1167
+ function (callback) {
1168
+ cliScriptFuncs.insertScript( $script, callback )
1169
+ }
1170
+ )
1171
+ }
1172
+ )
1173
+ cliScriptFuncs.seq( runList, cliScriptFuncs.scriptsDone );
1174
  }
1175
  }
1176
  };
1177
  genericFuncs.renderByElement( cliBlocker.removeCookieByCategory );
1178
  },
1179
  ccpaOptedOut : function () {
1180
+ var ccpaOptedOut = false;
1181
+ var preferenceCookie = CLI_Cookie.read( CLI_PREFERNCE_COOKIE );
1182
+ if ( preferenceCookie !== null ) {
1183
+ cliConsent = window.atob( preferenceCookie );
1184
+ cliConsent = JSON.parse( cliConsent );
1185
+ if ( typeof cliConsent.ccpaOptout !== 'undefined') {
1186
+ ccpaOptedOut = cliConsent.ccpaOptout;
1187
+ }
1188
  }
1189
  return ccpaOptedOut;
1190
  }
1191
  }
1192
+ jQuery( document ).ready(
1193
+ function() {
1194
+ if (typeof cli_cookiebar_settings != 'undefined') {
1195
+ CLI.set(
1196
+ {
1197
+ settings:cli_cookiebar_settings
1198
+ }
1199
+ );
1200
+ if ( CLI.js_blocking_enabled === true ) {
1201
+ cliBlocker.checkPluginStatus( cliBlocker.cookieBar,cliBlocker.runScripts );
1202
+ }
1203
  }
1204
  }
1205
+ );
public/modules/script-blocker/assets/js/script-blocker.js CHANGED
@@ -1,85 +1,96 @@
1
  (function ($) {
2
- 'use strict';
3
 
4
- var CLIScriptBlocker = {
5
- set: function () {
6
- this.changeStatusEvent();
7
- this.changeCategory();
8
- this.disableEvents();
9
- },
10
- changeStatusEvent: function() {
11
- jQuery('.wt-cli-plugin-status').on('change', function (e) {
12
- e.preventDefault();
13
- CLIScriptBlocker.changeStatus( jQuery(this) );
14
- });
15
- },
16
- disableEvents: function(){
17
- jQuery('.wt-cli-script-blocker-disabled').children().click(function(){return false;});
18
- jQuery('.wt-cli-plugin-inactive').children().click(function(){return false;});
19
- },
20
- changeStatus: function( element ) {
21
-
22
- var script_id = element.attr('data-script-id');
23
- var status = element.is(':checked');
24
 
25
- var data = {
26
- 'action' : 'wt_cli_change_plugin_status',
27
- '_wpnonce' : wt_cli_script_blocker_obj.nonce,
28
- 'script_id' : script_id,
29
- 'status' : status
30
- };
31
- jQuery.ajax({
32
- url: wt_cli_script_blocker_obj.ajax_url,
33
- type: 'POST',
34
- data: data,
35
- dataType: 'json',
36
- success: function (response) {
37
- if (response.success === true) {
38
- cli_notify_msg.success(wt_cli_script_blocker_obj.messages.success);
39
- }
40
- },
41
- error: function () {
42
- cli_notify_msg.error(wt_cli_script_blocker_obj.messages.success);
43
- }
44
- });
45
- },
46
- changeCategory: function () {
47
- jQuery('[name="cliscript_category"]').on('change', function (e) {
48
 
49
- e.preventDefault();
50
- var element = jQuery(this);
51
- var script_id = element.closest('tr').attr('data-script-id');
52
- var category = this.value;
53
- console.log( category);
54
- var data = {
55
- 'action': 'cli_change_script_category',
56
- '_wpnonce': wt_cli_script_blocker_obj.nonce,
57
- 'script_id': script_id,
58
- 'category': category
59
- };
60
- jQuery.ajax({
61
- url: wt_cli_script_blocker_obj.ajax_url,
62
- type: 'POST',
63
- data: data,
64
- dataType: 'json',
65
- success: function (response) {
66
- if (response.success === true) {
67
- cli_notify_msg.success(wt_cli_script_blocker_obj.messages.success);
68
- }
69
- else {
70
- cli_notify_msg.error(response.data);
71
- }
72
- },
73
- error: function () {
74
- cli_notify_msg.error(wt_cli_script_blocker_obj.messages.error);
75
- }
76
- });
77
- });
78
 
79
- }
80
- }
81
- jQuery(document).ready(function () {
82
- CLIScriptBlocker.set();
83
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- })(jQuery);
 
 
 
 
 
 
 
 
1
  (function ($) {
2
+ 'use strict';
3
 
4
+ var CLIScriptBlocker = {
5
+ set: function () {
6
+ this.changeStatusEvent();
7
+ this.changeCategory();
8
+ this.disableEvents();
9
+ },
10
+ changeStatusEvent: function() {
11
+ jQuery( '.wt-cli-plugin-status' ).on(
12
+ 'change',
13
+ function (e) {
14
+ e.preventDefault();
15
+ CLIScriptBlocker.changeStatus( jQuery( this ) );
16
+ }
17
+ );
18
+ },
19
+ disableEvents: function(){
20
+ jQuery( '.wt-cli-script-blocker-disabled' ).children().click( function(){return false;} );
21
+ jQuery( '.wt-cli-plugin-inactive' ).children().click( function(){return false;} );
22
+ },
23
+ changeStatus: function( element ) {
24
 
25
+ var script_id = element.attr( 'data-script-id' );
26
+ var status = element.is( ':checked' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ var data = {
29
+ 'action' : 'wt_cli_change_plugin_status',
30
+ '_wpnonce' : wt_cli_script_blocker_obj.nonce,
31
+ 'script_id' : script_id,
32
+ 'status' : status
33
+ };
34
+ jQuery.ajax(
35
+ {
36
+ url: wt_cli_script_blocker_obj.ajax_url,
37
+ type: 'POST',
38
+ data: data,
39
+ dataType: 'json',
40
+ success: function (response) {
41
+ if (response.success === true) {
42
+ cli_notify_msg.success( wt_cli_script_blocker_obj.messages.success );
43
+ }
44
+ },
45
+ error: function () {
46
+ cli_notify_msg.error( wt_cli_script_blocker_obj.messages.success );
47
+ }
48
+ }
49
+ );
50
+ },
51
+ changeCategory: function () {
52
+ jQuery( '[name="cliscript_category"]' ).on(
53
+ 'change',
54
+ function (e) {
 
 
55
 
56
+ e.preventDefault();
57
+ var element = jQuery( this );
58
+ var script_id = element.closest( 'tr' ).attr( 'data-script-id' );
59
+ var category = this.value;
60
+ console.log( category );
61
+ var data = {
62
+ 'action': 'cli_change_script_category',
63
+ '_wpnonce': wt_cli_script_blocker_obj.nonce,
64
+ 'script_id': script_id,
65
+ 'category': category
66
+ };
67
+ jQuery.ajax(
68
+ {
69
+ url: wt_cli_script_blocker_obj.ajax_url,
70
+ type: 'POST',
71
+ data: data,
72
+ dataType: 'json',
73
+ success: function (response) {
74
+ if (response.success === true) {
75
+ cli_notify_msg.success( wt_cli_script_blocker_obj.messages.success );
76
+ } else {
77
+ cli_notify_msg.error( response.data );
78
+ }
79
+ },
80
+ error: function () {
81
+ cli_notify_msg.error( wt_cli_script_blocker_obj.messages.error );
82
+ }
83
+ }
84
+ );
85
+ }
86
+ );
87
 
88
+ }
89
+ }
90
+ jQuery( document ).ready(
91
+ function () {
92
+ CLIScriptBlocker.set();
93
+ }
94
+ );
95
+
96
+ })( jQuery );
public/modules/script-blocker/integrations/facebook-for-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_facebook_wordpress_script' );
7
  function wt_cli_facebook_wordpress_script( $tags ) {
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_facebook_wordpress_script' );
7
  function wt_cli_facebook_wordpress_script( $tags ) {
public/modules/script-blocker/integrations/instagram-feed.php CHANGED
@@ -1,23 +1,23 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_instagram_feed_script' );
7
  function wt_cli_instagram_feed_script( $tags ) {
8
 
9
- $tags['instagram-feed'] = array(
10
-
11
- 'plugins/instagram-feed/js/sb-instagram.min.js',
12
- 'plugins/instagram-feed/js/sb-instagram.js',
13
- 'plugins/instagram-feed/js/sbi-scripts.min.js',
14
- 'plugins/instagram-feed/js/sbi-scripts.js',
15
- 'plugins/instagram-feed-pro/js/sb-instagram.min.js',
16
- 'plugins/instagram-feed-pro/js/sb-instagram.js',
17
- 'plugins/instagram-feed-pro/js/sbi-scripts.min.js',
18
- 'plugins/instagram-feed-pro/js/sbi-scripts.js'
19
-
20
- ) ;
21
 
22
  return $tags;
23
- }
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_instagram_feed_script' );
7
  function wt_cli_instagram_feed_script( $tags ) {
8
 
9
+ $tags['instagram-feed'] = array(
10
+
11
+ 'plugins/instagram-feed/js/sb-instagram.min.js',
12
+ 'plugins/instagram-feed/js/sb-instagram.js',
13
+ 'plugins/instagram-feed/js/sbi-scripts.min.js',
14
+ 'plugins/instagram-feed/js/sbi-scripts.js',
15
+ 'plugins/instagram-feed-pro/js/sb-instagram.min.js',
16
+ 'plugins/instagram-feed-pro/js/sb-instagram.js',
17
+ 'plugins/instagram-feed-pro/js/sbi-scripts.min.js',
18
+ 'plugins/instagram-feed-pro/js/sbi-scripts.js',
19
+
20
+ );
21
 
22
  return $tags;
23
+ }
public/modules/script-blocker/integrations/twitter-feed.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
- die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_twitter_feed_script' );
7
  function wt_cli_twitter_feed_script( $tags ) {
8
- $tags['twitter-feed'] = array(
9
  'plugins/custom-twitter-feeds/js/ctf-scripts.js',
10
  'plugins/custom-twitter-feeds/js/ctf-scripts.min.js',
11
  'plugins/custom-twitter-feeds-pro/js/ctf-scripts.js',
12
- 'plugins/custom-twitter-feeds-pro/js/ctf-scripts.min.js'
13
  );
14
  return $tags;
15
- }
1
  <?php
2
  // If this file is called directly, abort.
3
  if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  add_filter( 'wt_cli_third_party_scripts', 'wt_cli_twitter_feed_script' );
7
  function wt_cli_twitter_feed_script( $tags ) {
8
+ $tags['twitter-feed'] = array(
9
  'plugins/custom-twitter-feeds/js/ctf-scripts.js',
10
  'plugins/custom-twitter-feeds/js/ctf-scripts.min.js',
11
  'plugins/custom-twitter-feeds-pro/js/ctf-scripts.js',
12
+ 'plugins/custom-twitter-feeds-pro/js/ctf-scripts.min.js',
13
  );
14
  return $tags;
15
+ }
public/modules/script-blocker/script-blocker.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  // If this file is called directly, abort.
3
- if (!defined('WPINC')) {
4
- die;
5
  }
6
  global $wt_cli_integration_list;
7
 
@@ -45,289 +45,288 @@ $wt_cli_integration_list = apply_filters(
45
  );
46
 
47
 
48
- if (!class_exists('Cookie_Law_Info_Script_Blocker')) {
49
- class Cookie_Law_Info_Script_Blocker
50
- {
51
-
52
- protected $script_data;
53
- public $script_blocker_status;
54
- public $js_blocking;
55
- public $third_party_enabled;
56
-
57
- protected $script_table = 'cli_scripts';
58
- protected $module_id = 'script-blocker';
59
-
60
-
61
- function __construct()
62
- {
63
- add_action( 'init', array($this, 'init_scripts'), 10);
64
- $this->init_script_blocker();
65
- register_activation_hook( CLI_PLUGIN_FILENAME, array($this, 'activator'));
66
- add_action( 'activated_plugin', array($this, 'update_integration_data'));
67
- add_action( 'admin_menu', array( $this, 'register_settings_page' ),10 );
68
- add_action( 'wp_ajax_wt_cli_change_plugin_status',array($this, 'change_plugin_status'));
69
- add_action( 'admin_init', array( $this, 'update_script_blocker_status' ));
70
- add_action( 'wt_cli_after_advanced_settings', array( $this, 'add_blocking_control'));
71
- add_action( 'wt_cli_ajax_settings_update', array( $this, 'update_js_blocking_status'),10,1);
72
-
73
-
74
- // @since 1.9.6 for changing the category of each script blocker
75
- add_action('wp_ajax_cli_change_script_category', array($this, 'cli_change_script_category'));
76
- add_action('wt_cli_after_cookie_category_migration',array( $this, 'reset_scripts_category') );
77
-
78
-
79
- }
80
- public function init_script_blocker() {
81
- if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || is_admin() ) {
82
- return;
83
- }
84
- if( $this->get_blocking_status() === true && $this->advanced_rendering_enabled() === true && $this->third_party_scripts() === true ) {
85
- add_action( 'template_redirect', array($this, 'start_buffer'));
86
- add_action( 'shutdown', array($this, 'end_buffer'), 999);
87
- }
88
- }
89
- public function init_scripts() {
90
- $this->load_integrations();
91
- }
92
- /**
93
- * Get the current status of the integrations
94
- * @since 1.9.2
95
- * @access public
96
- * @return array
97
- */
98
- public function get_script_data() {
99
  global $wpdb;
100
  $script_table = $wpdb->prefix . $this->script_table;
101
  $scripts = array();
102
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$script_table'" ) == $script_table ) {
103
-
104
- $script_data = $wpdb->get_results( "select * from {$script_table}", ARRAY_A );
105
- foreach ( $script_data as $key => $data ) {
106
-
107
- $id = sanitize_text_field( ( isset( $data['id'] ) ? $data['id'] : '' ) );
108
- $slug = sanitize_text_field( ( isset( $data['cliscript_key'] ) ? $data['cliscript_key'] : '' ) );
109
- $title = sanitize_text_field( ( isset( $data['cliscript_title'] ) ? $data['cliscript_title'] : '' ) );
110
- $description = sanitize_text_field( ( isset( $data['cliscript_description'] ) ? $data['cliscript_description'] : '' ) );
111
- $category_id = isset( $data['cliscript_category'] ) ? $data['cliscript_category'] : '';
112
- $status = (isset($data['cliscript_status']) && ( $data['cliscript_status'] === "yes" || $data['cliscript_status'] === "1") ? true : false);
113
- $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
114
- $category_slug = '';
115
- if ( '' !== $category_id ) {
116
- if ( is_numeric( $category_id ) ) {
117
- $category_slug = $this->get_script_category_slug_by_id( $category_id );
118
-
119
- } else {
120
- $category_slug = $category_id;
121
- }
122
- }
123
- if( false === Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() && !is_admin() && is_null( term_exists( $category_slug, 'cookielawinfo-category') ) ) {
124
- $status = false;
125
- }
126
- if ( ! empty( $id ) ) {
127
- $scripts[ $slug ] = array(
128
- 'id' => $id,
129
- 'title' => $title,
130
- 'description' => $description,
131
- 'category' => $category_slug,
132
- 'status' => $status,
133
- );
134
- }
135
- }
136
- }
137
- return $scripts;
138
- }
139
- public function get_scripts() {
140
- if( !$this->script_data ) {
141
- $this->script_data = $this->get_script_data();
142
- }
143
- return $this->script_data;
144
- }
145
- /**
146
- * Register admin menu for the plugn
147
- * @since 1.9.2
148
- * @access public
149
- * @return bool
150
- */
151
- public function get_script_blocker_status() {
152
- $status = get_option('cli_script_blocker_status');
153
- if( isset( $status ) && $status === 'enabled' ) {
154
- return true;
155
- }
156
- return false;
157
- }
158
- public function get_third_party_status() {
159
-
160
- if( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === true ) {
161
- $cookies = Cookie_Law_Info_Cookies::get_instance()->get_cookies();
162
- if( isset( $cookies['non-necessary']) && !empty( $cookies['non-necessary'])) {
163
- $status = isset( $cookies['non-necessary']['status'] ) ? $cookies['non-necessary']['status'] : false ;
164
- return $status;
165
- }
166
- } else {
167
- return true;
168
- }
169
- return false;
170
- }
171
- /**
172
- * Update script blocker status
173
- * @since 1.9.2
174
- * @access public
175
- */
176
- public function update_script_blocker_status()
177
- {
178
-
179
- if( isset( $_POST['cli_update_script_blocker'] ) )
180
- {
181
- if (!current_user_can('manage_options'))
182
- {
183
- wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
184
- }
185
- check_admin_referer( $this->module_id );
186
- $cli_sb_status = ( isset( $_POST['cli_script_blocker_state'] ) ? sanitize_text_field( $_POST['cli_script_blocker_state'] ) : '' );
187
- if( $cli_sb_status === 'enabled') {
188
- $this->script_blocker_status = true;
189
- } else {
190
- $this->script_blocker_status = false;
191
- }
192
- update_option( 'cli_script_blocker_status', $cli_sb_status );
193
- }
194
- }
195
- /**
196
- * Register admin menu for the plugn
197
- * @since 1.9.2
198
- * @access public
199
- * @return array
200
- */
201
- public function register_settings_page() {
202
-
203
-
204
- add_submenu_page(
205
- 'edit.php?post_type='.CLI_POST_TYPE,
206
- __( 'Script Blocker', 'cookie-law-info' ),
207
- __( 'Script Blocker', 'cookie-law-info' ),
208
- 'manage_options',
209
- 'cli-script-settings',
210
- array( $this, 'integrations_settings_page')
211
- );
212
- }
213
-
214
- /**
215
- * Admin menu settings page
216
- * @since 1.9.2
217
- * @access public
218
- * @return array
219
- */
220
- public function integrations_settings_page() {
221
-
222
- if (!current_user_can('manage_options')) {
223
- wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
224
- }
225
- if(isset($_GET['post_type']) && $_GET['post_type']==CLI_POST_TYPE && isset($_GET['page']) && $_GET['page']=='cli-script-settings') {
226
-
227
- global $wt_cli_integration_list;
228
- $script_data = $this->get_scripts();
229
- $script_blocker_status = $this->get_blocking_status();
230
- $js_blocking = $this->advanced_rendering_enabled();
231
- $messages = array(
232
- 'success' => __('Status updated','cookie-law-info'),
233
- );
234
- $settings = array(
235
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
236
- 'nonce' => wp_create_nonce( $this->module_id ),
237
- 'messages' => $messages
238
- );
239
- wp_enqueue_style('cookie-law-info');
240
- wp_enqueue_script('cookie-law-info-script-blocker',plugin_dir_url( __FILE__ ).'assets/js/script-blocker.js', array( 'jquery','cookie-law-info'),CLI_VERSION,false);
241
- wp_localize_script( 'cookie-law-info-script-blocker', 'wt_cli_script_blocker_obj', $settings );
242
-
243
- }
244
- $terms = Cookie_Law_Info_Cookies::get_instance()->get_cookie_category_options();
245
- $terms = ( isset( $terms ) ? $terms : array() );
246
-
247
- include plugin_dir_path( __FILE__ ).'views/settings.php';
248
- }
249
- /**
250
- * Add option to enable or disable javascript blocking in advanced settings tab
251
- * @since 1.9.2
252
- * @access public
253
- */
254
- public function add_blocking_control(){
255
-
256
- $js_blocking = $this->advanced_rendering_enabled();
257
- echo '<table class="form-table">
 
258
  <tr valign="top">
259
- <th scope="row">'.__('Advanced script rendering', 'cookie-law-info').'</th>
260
  <td>
261
- <input type="radio" id="wt_cli_js_blocking_enable_field" name="wt_cli_js_blocking_field" class="styled" value="yes" '.checked( $js_blocking, true, false).' /><label for="wt_cli_js_blocking_enable_field" >'.__('Enable', 'cookie-law-info').'</label>
262
- <input type="radio" id="wt_cli_js_blocking_disable_field" name="wt_cli_js_blocking_field" class="styled" value="no" '.checked( $js_blocking, false, false).' /><label for="wt_cli_js_blocking_disable_field" >'.__('Disable', 'cookie-law-info').'</label>
263
- <span class="cli_form_help" style="margin-top:10px;">'.__('Advanced script rendering will render the blocked scripts using javascript thus eliminating the need for a page refresh. It is also optimized for caching since there is no server-side processing after obtaining the consent.','cookie-law-info').'</span>
264
  </td>
265
  </tr>
266
  </table>';
267
- }
268
-
269
- /**
270
- * Enabe or disable javascript blocking
271
- * @since 1.9.2
272
- * @access public
273
- */
274
- public function update_js_blocking_status( $data ) {
275
-
276
- $js_blocking = 'no';
277
- if( isset( $data['wt_cli_js_blocking_field'] ) && $data['wt_cli_js_blocking_field'] === 'yes' ) {
278
- $js_blocking = 'yes';
279
- }
280
- $this->js_blocking = $js_blocking;
281
- update_option('cookielawinfo_js_blocking', $js_blocking );
282
-
283
- }
284
- /**
285
- * Fire during plugin activation or deactivaion
286
- * @since 1.9.2
287
- * @access public
288
- */
289
- public function activator()
290
- {
291
- global $wpdb;
292
- $activation_transient = wp_validate_boolean( get_transient('_wt_cli_first_time_activation') );
293
- $plugin_settings = get_option(CLI_SETTINGS_FIELD);
294
-
295
- if( $activation_transient === true ) {
296
- set_transient( 'wt_cli_script_blocker_notice', true, DAY_IN_SECONDS );
297
- $script_blocking = $this->get_script_blocker_status();
298
- if( $script_blocking === false ) {
299
- update_option('cli_script_blocker_status', 'enabled');
300
- }
301
- }
302
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
303
- if (is_multisite()) {
304
- // Get all blogs in the network and activate plugin on each one
305
- $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
306
- foreach ($blog_ids as $blog_id) {
307
- switch_to_blog($blog_id);
308
- self::install_tables();
309
- restore_current_blog();
310
- }
311
- } else {
312
- self::install_tables();
313
- }
314
- }
315
-
316
- /**
317
- * Install necessary tables for storing integrations data
318
- * @since 1.9.2
319
- * @access public
320
- */
321
- public static function install_tables()
322
- {
323
- global $wpdb;
324
- $search_query = "SHOW TABLES LIKE %s";
325
- $charset_collate = $wpdb->get_charset_collate();
326
- $like = '%' . $wpdb->prefix . 'cli_scripts%';
327
- $table_name = $wpdb->prefix . 'cli_scripts';
328
- if (!$wpdb->get_results($wpdb->prepare($search_query, $like), ARRAY_N)) {
329
-
330
- $sql = "CREATE TABLE $table_name(
331
  `id` INT NOT NULL AUTO_INCREMENT,
332
  `cliscript_title` TEXT NOT NULL,
333
  `cliscript_category` VARCHAR(100) NOT NULL,
@@ -338,177 +337,174 @@ if (!class_exists('Cookie_Law_Info_Script_Blocker')) {
338
  `type` INT NOT NULL DEFAULT '0',
339
  PRIMARY KEY(`id`)
340
  ) $charset_collate;";
341
- dbDelta($sql);
342
- }
343
- self::update_table_columns( $table_name );
344
- self::insert_scripts( $table_name );
345
- }
346
- /**
347
- * Update the status of the plugin based on user option
348
- * @since 1.9.2
349
- * @access public
350
- */
351
- public function change_plugin_status() {
352
-
353
- if (!current_user_can('manage_options'))
354
- {
355
- wp_die(__('You do not have sufficient permission to perform this operation', 'cookie-law-info'));
356
- }
357
- check_ajax_referer( $this->module_id );
358
- $script_id = (int) ( isset( $_POST['script_id'] ) ? $_POST['script_id'] : -1 );
359
- $status = wp_validate_boolean( ( isset( $_POST['status'] ) ? $_POST['status'] : false ) ) ;
360
- if ( $script_id !== -1 ) {
361
- $this->update_script_status($script_id, $status );
362
- wp_send_json_success();
363
- }
364
- wp_send_json_error();
365
-
366
- }
367
- public function update_script_status( $id, $status) {
368
-
369
- global $wpdb;
370
- $script_table = $wpdb->prefix.$this->script_table;
371
- $wpdb->query($wpdb->prepare("UPDATE $script_table SET cliscript_status = %d WHERE id = %d", $status, $id));
372
-
373
- }
374
- /**
375
- * Load integration if it is currently activated
376
- * @since 1.9.2
377
- * @access public
378
- */
379
- public static function insert_scripts($table_name)
380
- {
381
-
382
- global $wpdb;
383
- global $wt_cli_integration_list;
384
- foreach ($wt_cli_integration_list as $key => $value) {
385
- $data = array(
386
- 'cliscript_key' => isset($key) ? $key : '',
387
- 'cliscript_title' => isset($value['label']) ? $value['label'] : '',
388
- 'cliscript_category' => isset($value['category']) ? $value['category'] : '',
389
- 'cliscript_type' => isset($value['type']) ? $value['type'] : 0,
390
- 'cliscript_status' => isset($value['status']) ? $value['status'] : true,
391
- 'cliscript_description' => isset($value['description']) ? $value['description'] : '',
392
- );
393
- $data_exists = $wpdb->get_row("SELECT id FROM `$table_name` WHERE `cliscript_key`='" . $key . "'", ARRAY_A);
394
- if (!$data_exists) {
395
- if( Cookie_Law_Info::maybe_first_time_install() === false ) {
396
- $data['cliscript_status'] = false;
397
- }
398
- $wpdb->insert($table_name, $data);
399
- }
400
- }
401
- }
402
- /**
403
- *
404
- * @access private
405
- * @return void
406
- * @since 1.9.2
407
- */
408
- private static function update_table_columns( $table_name )
409
- {
410
- global $wpdb;
411
- $search_query = "SHOW COLUMNS FROM `$table_name` LIKE 'cliscript_type'";
412
- if(!$wpdb->get_results($search_query,ARRAY_N))
413
- {
414
- $wpdb->query("ALTER TABLE `$table_name` ADD `cliscript_type` INT DEFAULT 0 AFTER `cliscript_category`");
415
- }
416
- }
417
- /**
418
- * Load integration if it is currently activated
419
- * @since 1.9.2
420
- * @access public
421
- */
422
- public function load_integrations()
423
- {
424
- global $wt_cli_integration_list;
425
- foreach ($wt_cli_integration_list as $plugin => $details) {
426
- if ( $this->wt_cli_plugin_is_active($plugin) ) {
427
-
428
- $file = plugin_dir_path( __FILE__ ) . "integrations/$plugin.php";
429
- if (file_exists($file)) {
430
- require_once($file);
431
- } else {
432
- error_log("searched for $plugin integration at $file, but did not find it");
433
- }
434
- }
435
- }
436
- }
437
-
438
- /**
439
- * Check and load necessary plugin data if it is in disabled state
440
- * @since 1.9.2
441
- * @access public
442
- */
443
- public function update_integration_data()
444
- {
445
-
446
- }
447
-
448
- /**
449
- * Check if the listed integration is active on the website
450
- * @since 1.9.2
451
- * @access public
452
- */
453
- public function wt_cli_plugin_is_active($plugin)
454
- {
455
- global $wt_cli_integration_list;
456
- $script_data = $this->get_scripts();
457
-
458
- if( empty( $script_data ) ) {
459
- return false;
460
- }
461
- if (!isset($wt_cli_integration_list[$plugin])) return false;
462
- $details = $wt_cli_integration_list[$plugin];
463
-
464
- $enabled = isset( $script_data[ $plugin ]['status'] ) ? wp_validate_boolean( $script_data[ $plugin ]['status'] ) : false;
465
- if ( ( defined($details['identifier'])
466
- || function_exists($details['identifier'])
467
- || class_exists($details['identifier']) ) && $enabled === true ) {
468
- return true;
469
- }
470
- return false;
471
- }
472
-
473
- /**
474
- * Start buffering the output for blocking scripts
475
- * @since 1.9.2
476
- * @access public
477
- */
478
-
479
- public function start_buffer()
480
- {
481
- ob_start(array($this, "init"));
482
- }
483
- /**
484
- * Flush the buffer
485
- *
486
- * @access public
487
- */
488
-
489
- public function end_buffer()
490
- {
491
- if (ob_get_length()) {
492
- ob_end_flush();
493
- }
494
- }
495
-
496
- /**
497
- * Starts replacing the tags that should be blocked
498
- *
499
- * @since 1.9.2
500
- * @access public
501
- * @param string
502
- * @return string
503
- */
504
-
505
- public function init($buffer)
506
- {
507
- $buffer = $this->replace_scripts($buffer);
508
- return $buffer;
509
- }
510
-
511
- /**
512
  * check if there is a partial match between a key of the array and the haystack
513
  * We cannot use array_search, as this would not allow partial matches.
514
  *
@@ -527,264 +523,267 @@ if (!class_exists('Cookie_Law_Info_Script_Blocker')) {
527
  $needle = array( $needle );
528
  }
529
  foreach ( $needle as $key => $value ) {
530
-
531
- if( is_array( $value ) ) {
532
 
533
- foreach ( $value as $data ) {
534
-
535
- if ( strlen($data) === 0 ) continue;
536
- if ( ( $pos = strpos( $haystack, $data ) ) !== false ) {
537
- return ( is_numeric( $key ) ) ? $data : $key;
538
- }
539
- }
540
- } else {
 
 
 
 
541
 
542
- if ( strlen($value) === 0 ) continue;
543
- if ( ( $pos = strpos( $haystack, $value ) ) !== false ) {
544
- return ( is_numeric( $key ) ) ? $value : $key;
545
- }
546
- }
 
 
547
  }
548
 
549
  return false;
550
  }
551
- /**
552
- * Perform a series of regular expression operation to find and replace the unwanted tags from the output
553
- *
554
- * @since 1.9.2
555
- * @access public
556
- * @param string
557
- * @return string
558
- */
559
-
560
- public function replace_scripts($buffer)
561
- {
562
- $third_party_script_tags = array();
563
-
564
- $third_party_script_tags = apply_filters( 'wt_cli_third_party_scripts',$third_party_script_tags );
565
-
566
- $script_pattern = '/(<script.*?>)(\X*?)<\/script>/i';
567
- $index = 0;
568
- if (preg_match_all(
569
- $script_pattern,
570
- $buffer,
571
- $matches,
572
- PREG_PATTERN_ORDER
573
- )) {
574
-
575
- foreach ($matches[1] as $key => $script_open) {
576
- //exclude ld+json
577
- if (
578
- strpos($script_open, 'application/ld+json')
579
- !== false
580
- ) {
581
- continue;
582
- }
583
- $total_match = $matches[0][$key];
584
- $content = $matches[2][$key];
585
-
586
- //if there is inline script here, it has some content
587
- if (!empty($content)) {
588
- $found = $this->strpos_arr(
589
- $content,
590
- $third_party_script_tags
591
- );
592
-
593
- if ($found !== false) {
594
- $category = $this->get_category_by_script_slug( $found );
595
- $new = $total_match;
596
- $new = $this->replace_script_type_attribute( $new, $category );
597
- $buffer = str_replace( $total_match, $new,$buffer );
598
- }
599
- }
600
- $script_src_pattern
601
  = '/<script [^>]*?src=[\'"](http:\/\/|https:\/\/|\/\/)([\w.,;@?^=%&:()\/~+#!\-*]*?)[\'"].*?>/i';
602
- if ( preg_match_all( $script_src_pattern, $total_match,
603
- $src_matches, PREG_PATTERN_ORDER )
 
 
 
 
604
  ) {
605
- $script_src_matches = ( isset( $src_matches[2] ) && is_array( $src_matches[2] ) ) ? $src_matches[2] : array();
606
- if( !empty( $script_src_matches ) ) {
607
- foreach ( $src_matches[2] as $src_key => $script_src ) {
608
- $script_src = $src_matches[1][ $src_key ]. $src_matches[2][ $src_key ];
609
- $found = $this->strpos_arr( $script_src,
610
- $third_party_script_tags );
611
-
612
- if ( $found !== false ) {
613
- $category = $this->get_category_by_script_slug( $found );
614
- $new = $total_match;
615
- $new = $this->replace_script_type_attribute( $new, $category );
616
- $buffer = str_replace( $total_match, $new,$buffer );
617
- }
618
- }
619
- }
620
- }
621
- }
622
- }
623
- return $buffer;
624
- }
625
-
626
- public function replace_script_type_attribute( $script, $category) {
627
-
628
- $replace = 'data-cli-class="cli-blocker-script" data-cli-script-type="'.sanitize_text_field( $category ).'" data-cli-block="true" data-cli-element-position="head"';
629
- $script_type = "text/plain";
630
-
631
- if( preg_match( '/<script[^\>]*?\>/m', $script ) ) {
 
 
632
  $changed = true;
633
- if (preg_match('/<script.*(type=(?:"|\')(.*?)(?:"|\')).*?>/', $script) && preg_match('/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script )) {
634
- preg_match('/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script, $output_array);
635
- $re = preg_quote($output_array[1],'/');
636
- if(!empty($output_array)) {
637
-
638
- $script = preg_replace('/' .$re .'/', 'type="'.$script_type.'"'.' '.$replace, $script,1);
639
-
640
- }
641
  } else {
642
-
643
- $script = str_replace('<script', '<script type="'.$script_type.'"'.' '.$replace, $script);
644
-
645
- }
646
-
647
- }
648
- return $script;
649
- }
650
-
651
- /* change category of item on list page (ajax) */
652
- public function cli_change_script_category()
653
- {
654
-
655
- if (current_user_can('manage_options') && check_ajax_referer( $this->module_id )) {
656
-
657
- $script_id = (int) ( isset( $_POST['script_id'] ) ? $_POST['script_id'] : -1 );
658
- $category = isset( $_POST['category'] ) ? sanitize_text_field( $_POST['category'] ) : '';
659
-
660
- if ( $script_id !== -1 ) {
661
- self::cli_script_update_category( $script_id, $category );
662
- wp_send_json_success();
663
- }
664
- wp_send_json_error( __('Invalid script id','cookie-law-info') );
665
- }
666
- wp_send_json_error(__('You do not have sufficient permission to perform this operation','cookie-law-info') );
667
- }
668
- public static function cli_script_update_category($id = 0, $cat = 3)
669
- {
670
-
671
- global $wpdb;
672
-
673
- $table_name = $wpdb->prefix . 'cli_scripts';
674
-
675
- $wpdb->query($wpdb->prepare("UPDATE $table_name SET cliscript_category = %s WHERE id = %s", $cat, $id));
676
- }
677
- public function get_category_by_script_slug( $slug ){
678
- $category = 'non-necessary';
679
- $scripts = $this->get_scripts();
680
- $script_data = isset( $scripts[ $slug ] ) ? $scripts[ $slug ] : array();
681
- if( !empty( $script_data ) ){
682
- $category = isset( $script_data['category'] ) ? $script_data['category'] : '' ;
683
- }
684
- return $category;
685
- }
686
- /**
687
- * Set script category to necessary after cookie category migration
688
- *
689
- * @since 1.9.5
690
- * @access public
691
- */
692
- public function reset_scripts_category(){
693
-
694
- global $wt_cli_integration_list;
695
- $script_data = $this->get_scripts();
696
- if( isset( $script_data ) ) {
697
- foreach ( $script_data as $key => $data ) {
698
- $script_id = $data['id'];
699
- $category = $data['category'];
700
-
701
- if( 'non-necessary' === $category ) {
702
- if( -1 !== self::get_non_necessary_category_id() ) {
703
- $this->cli_script_update_category( $script_id, 'non-necessary' );
704
- } else {
705
- $default_category = isset( $wt_cli_integration_list[$key]['category'] ) ? $wt_cli_integration_list[$key]['category'] : '' ;
706
-
707
- if( '' !== $default_category ) {
708
- $this->cli_script_update_category( $script_id, $default_category );
709
- }
710
- }
711
- }
712
- }
713
- }
714
- }
715
- /**
716
- * Get the id of non-necessary category ( Default category )
717
- *
718
- * @since 1.9.5
719
- * @access public
720
- */
721
- public static function get_non_necessary_category_id()
722
- {
723
-
724
- $id_obj = get_term_by('slug', 'non-necessary', 'cookielawinfo-category');
725
- $id = -1; // for non-necessary default - this may change
726
- if ($id_obj) {
727
- $id = $id_obj->term_id;
728
- }
729
- return $id;
730
- }
731
-
732
- public function get_blocking_status() {
733
-
734
- if( !$this->script_blocker_status ) {
735
- $this->script_blocker_status = $this->get_script_blocker_status();
736
- }
737
- return $this->script_blocker_status;
738
- }
739
- public function advanced_rendering_enabled(){
740
-
741
- if( ! $this->js_blocking ) {
742
- $this->js_blocking = Cookie_Law_Info::get_js_option();
743
- }
744
- return $this->js_blocking;
745
- }
746
- public function third_party_scripts(){
747
-
748
- if( !$this->third_party_enabled ) {
749
- $this->third_party_enabled = $this->get_third_party_status();
750
- }
751
- return $this->third_party_enabled;
752
- }
753
- // Returns the category slug by category id or slug
754
- public function get_script_category_slug_by_id( $category_id ) {
755
-
756
- $category_slug = '';
757
- $category_id = intval( $category_id );
758
- if ( $category_id === -1 ) { // Existing cusomters.
759
- $category_slug = 'non-necessary';
760
- } else {
761
- if ( Cookie_Law_Info_Languages::get_instance()->is_multilanguage_plugin_active() === true ) {
762
-
763
- $default_language = Cookie_Law_Info_Languages::get_instance()->get_default_language_code();
764
- $current_language = Cookie_Law_Info_Languages::get_instance()->get_current_language_code();
765
-
766
- if ( $current_language !== $default_language ) {
767
- $default_term = Cookie_Law_Info_Languages::get_instance()->get_term_by_language( $category_id, $default_language );
768
-
769
- if ( $default_term && $default_term->term_id ) {
770
- $category_slug = $default_term->slug;
771
- }
772
- } else {
773
- $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
774
- if ( isset( $term ) && is_object( $term ) ) {
775
- $category_slug = $term->slug;
776
- }
777
- }
778
- } else {
779
- $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
780
- if ( isset( $term ) && is_object( $term ) ) {
781
- $category_slug = $term->slug;
782
- }
783
- }
784
- }
785
- return $category_slug;
786
- }
787
- }
788
-
789
  }
790
  new Cookie_Law_Info_Script_Blocker();
1
  <?php
2
  // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
  }
6
  global $wt_cli_integration_list;
7
 
45
  );
46
 
47
 
48
+ if ( ! class_exists( 'Cookie_Law_Info_Script_Blocker' ) ) {
49
+ class Cookie_Law_Info_Script_Blocker {
50
+
51
+
52
+ protected $script_data;
53
+ public $script_blocker_status;
54
+ public $js_blocking;
55
+ public $third_party_enabled;
56
+
57
+ protected $script_table = 'cli_scripts';
58
+ protected $module_id = 'script-blocker';
59
+
60
+
61
+ function __construct() {
62
+ add_action( 'init', array( $this, 'init_scripts' ), 10 );
63
+ $this->init_script_blocker();
64
+ register_activation_hook( CLI_PLUGIN_FILENAME, array( $this, 'activator' ) );
65
+ add_action( 'activated_plugin', array( $this, 'update_integration_data' ) );
66
+ add_action( 'admin_menu', array( $this, 'register_settings_page' ), 10 );
67
+ add_action( 'wp_ajax_wt_cli_change_plugin_status', array( $this, 'change_plugin_status' ) );
68
+ add_action( 'admin_init', array( $this, 'update_script_blocker_status' ) );
69
+ add_action( 'wt_cli_after_advanced_settings', array( $this, 'add_blocking_control' ) );
70
+ add_action( 'wt_cli_ajax_settings_update', array( $this, 'update_js_blocking_status' ), 10, 1 );
71
+
72
+ // @since 1.9.6 for changing the category of each script blocker
73
+ add_action( 'wp_ajax_cli_change_script_category', array( $this, 'cli_change_script_category' ) );
74
+ add_action( 'wt_cli_after_cookie_category_migration', array( $this, 'reset_scripts_category' ) );
75
+
76
+ }
77
+ public function init_script_blocker() {
78
+ if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || is_admin() ) {
79
+ return;
80
+ }
81
+ if ( $this->get_blocking_status() === true && $this->advanced_rendering_enabled() === true && $this->third_party_scripts() === true ) {
82
+ add_action( 'template_redirect', array( $this, 'start_buffer' ) );
83
+ add_action( 'shutdown', array( $this, 'end_buffer' ), 999 );
84
+ }
85
+ }
86
+ public function init_scripts() {
87
+ $this->load_integrations();
88
+ }
89
+ /**
90
+ * Get the current status of the integrations
91
+ *
92
+ * @since 1.9.2
93
+ * @access public
94
+ * @return array
95
+ */
96
+ public function get_script_data() {
 
 
97
  global $wpdb;
98
  $script_table = $wpdb->prefix . $this->script_table;
99
  $scripts = array();
100
+ if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $script_table ) ) == $script_table ) {
101
+
102
+ $script_data = $wpdb->get_results( "select * from {$wpdb->prefix}cli_scripts", ARRAY_A );
103
+ foreach ( $script_data as $key => $data ) {
104
+
105
+ $id = sanitize_text_field( ( isset( $data['id'] ) ? $data['id'] : '' ) );
106
+ $slug = sanitize_text_field( ( isset( $data['cliscript_key'] ) ? $data['cliscript_key'] : '' ) );
107
+ $title = sanitize_text_field( ( isset( $data['cliscript_title'] ) ? $data['cliscript_title'] : '' ) );
108
+ $description = sanitize_text_field( ( isset( $data['cliscript_description'] ) ? $data['cliscript_description'] : '' ) );
109
+ $category_id = isset( $data['cliscript_category'] ) ? $data['cliscript_category'] : '';
110
+ $status = ( isset( $data['cliscript_status'] ) && ( $data['cliscript_status'] === 'yes' || $data['cliscript_status'] === '1' ) ? true : false );
111
+ $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
112
+ $category_slug = '';
113
+ if ( '' !== $category_id ) {
114
+ if ( is_numeric( $category_id ) ) {
115
+ $category_slug = $this->get_script_category_slug_by_id( $category_id );
116
+
117
+ } else {
118
+ $category_slug = $category_id;
119
+ }
120
+ }
121
+ if ( false === Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() && ! is_admin() && is_null( term_exists( $category_slug, 'cookielawinfo-category' ) ) ) {
122
+ $status = false;
123
+ }
124
+ if ( ! empty( $id ) ) {
125
+ $scripts[ $slug ] = array(
126
+ 'id' => $id,
127
+ 'title' => $title,
128
+ 'description' => $description,
129
+ 'category' => $category_slug,
130
+ 'status' => $status,
131
+ );
132
+ }
133
+ }
134
+ }
135
+ return $scripts;
136
+ }
137
+ public function get_scripts() {
138
+ if ( ! $this->script_data ) {
139
+ $this->script_data = $this->get_script_data();
140
+ }
141
+ return $this->script_data;
142
+ }
143
+ /**
144
+ * Register admin menu for the plugn
145
+ *
146
+ * @since 1.9.2
147
+ * @access public
148
+ * @return bool
149
+ */
150
+ public function get_script_blocker_status() {
151
+ $status = get_option( 'cli_script_blocker_status' );
152
+ if ( isset( $status ) && $status === 'enabled' ) {
153
+ return true;
154
+ }
155
+ return false;
156
+ }
157
+ public function get_third_party_status() {
158
+
159
+ if ( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === true ) {
160
+ $cookies = Cookie_Law_Info_Cookies::get_instance()->get_cookies();
161
+ if ( isset( $cookies['non-necessary'] ) && ! empty( $cookies['non-necessary'] ) ) {
162
+ $status = isset( $cookies['non-necessary']['status'] ) ? $cookies['non-necessary']['status'] : false;
163
+ return $status;
164
+ }
165
+ } else {
166
+ return true;
167
+ }
168
+ return false;
169
+ }
170
+ /**
171
+ * Update script blocker status
172
+ *
173
+ * @since 1.9.2
174
+ * @access public
175
+ */
176
+ public function update_script_blocker_status() {
177
+
178
+ if ( isset( $_POST['cli_update_script_blocker'] ) ) {
179
+ if ( ! current_user_can( 'manage_options' ) ) {
180
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
181
+ }
182
+ check_admin_referer( $this->module_id );
183
+ $cli_sb_status = ( isset( $_POST['cli_script_blocker_state'] ) ? sanitize_text_field( wp_unslash( $_POST['cli_script_blocker_state'] ) ) : '' );
184
+ if ( $cli_sb_status === 'enabled' ) {
185
+ $this->script_blocker_status = true;
186
+ } else {
187
+ $this->script_blocker_status = false;
188
+ }
189
+ update_option( 'cli_script_blocker_status', $cli_sb_status );
190
+ }
191
+ }
192
+ /**
193
+ * Register admin menu for the plugn
194
+ *
195
+ * @since 1.9.2
196
+ * @access public
197
+ * @return array
198
+ */
199
+ public function register_settings_page() {
200
+
201
+ add_submenu_page(
202
+ 'edit.php?post_type=' . CLI_POST_TYPE,
203
+ __( 'Script Blocker', 'cookie-law-info' ),
204
+ __( 'Script Blocker', 'cookie-law-info' ),
205
+ 'manage_options',
206
+ 'cli-script-settings',
207
+ array( $this, 'integrations_settings_page' )
208
+ );
209
+ }
210
+
211
+ /**
212
+ * Admin menu settings page
213
+ *
214
+ * @since 1.9.2
215
+ * @access public
216
+ * @return array
217
+ */
218
+ public function integrations_settings_page() {
219
+
220
+ if ( ! current_user_can( 'manage_options' ) ) {
221
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
222
+ }
223
+ if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == CLI_POST_TYPE && isset( $_GET['page'] ) && $_GET['page'] == 'cli-script-settings' ) {
224
+
225
+ global $wt_cli_integration_list;
226
+ $script_data = $this->get_scripts();
227
+ $script_blocker_status = $this->get_blocking_status();
228
+ $js_blocking = $this->advanced_rendering_enabled();
229
+ $messages = array(
230
+ 'success' => __( 'Status updated', 'cookie-law-info' ),
231
+ );
232
+ $settings = array(
233
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
234
+ 'nonce' => wp_create_nonce( $this->module_id ),
235
+ 'messages' => $messages,
236
+ );
237
+ wp_enqueue_style( 'cookie-law-info' );
238
+ wp_enqueue_script( 'cookie-law-info-script-blocker', plugin_dir_url( __FILE__ ) . 'assets/js/script-blocker.js', array( 'jquery', 'cookie-law-info' ), CLI_VERSION, false );
239
+ wp_localize_script( 'cookie-law-info-script-blocker', 'wt_cli_script_blocker_obj', $settings );
240
+
241
+ }
242
+ $terms = Cookie_Law_Info_Cookies::get_instance()->get_cookie_category_options();
243
+ $terms = ( isset( $terms ) ? $terms : array() );
244
+
245
+ include plugin_dir_path( __FILE__ ) . 'views/settings.php';
246
+ }
247
+ /**
248
+ * Add option to enable or disable javascript blocking in advanced settings tab
249
+ *
250
+ * @since 1.9.2
251
+ * @access public
252
+ */
253
+ public function add_blocking_control() {
254
+
255
+ $js_blocking = $this->advanced_rendering_enabled();
256
+ echo '<table class="form-table">
257
  <tr valign="top">
258
+ <th scope="row">' . esc_html__( 'Advanced script rendering', 'cookie-law-info' ) . '</th>
259
  <td>
260
+ <input type="radio" id="wt_cli_js_blocking_enable_field" name="wt_cli_js_blocking_field" class="styled" value="yes" ' . checked( $js_blocking, true, false ) . ' /><label for="wt_cli_js_blocking_enable_field" >' . esc_html__( 'Enable', 'cookie-law-info' ) . '</label>
261
+ <input type="radio" id="wt_cli_js_blocking_disable_field" name="wt_cli_js_blocking_field" class="styled" value="no" ' . checked( $js_blocking, false, false ) . ' /><label for="wt_cli_js_blocking_disable_field" >' . esc_html__( 'Disable', 'cookie-law-info' ) . '</label>
262
+ <span class="cli_form_help" style="margin-top:10px;">' . esc_html__( 'Advanced script rendering will render the blocked scripts using javascript thus eliminating the need for a page refresh. It is also optimized for caching since there is no server-side processing after obtaining the consent.', 'cookie-law-info' ) . '</span>
263
  </td>
264
  </tr>
265
  </table>';
266
+ }
267
+
268
+ /**
269
+ * Enabe or disable javascript blocking
270
+ *
271
+ * @since 1.9.2
272
+ * @access public
273
+ */
274
+ public function update_js_blocking_status( $data ) {
275
+
276
+ $js_blocking = 'no';
277
+ if ( isset( $data['wt_cli_js_blocking_field'] ) && $data['wt_cli_js_blocking_field'] === 'yes' ) {
278
+ $js_blocking = 'yes';
279
+ }
280
+ $this->js_blocking = $js_blocking;
281
+ update_option( 'cookielawinfo_js_blocking', $js_blocking );
282
+
283
+ }
284
+ /**
285
+ * Fire during plugin activation or deactivaion
286
+ *
287
+ * @since 1.9.2
288
+ * @access public
289
+ */
290
+ public function activator() {
291
+ global $wpdb;
292
+ $activation_transient = wp_validate_boolean( get_transient( '_wt_cli_first_time_activation' ) );
293
+ $plugin_settings = get_option( CLI_SETTINGS_FIELD );
294
+
295
+ if ( $activation_transient === true ) {
296
+ set_transient( 'wt_cli_script_blocker_notice', true, DAY_IN_SECONDS );
297
+ $script_blocking = $this->get_script_blocker_status();
298
+ if ( $script_blocking === false ) {
299
+ update_option( 'cli_script_blocker_status', 'enabled' );
300
+ }
301
+ }
302
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
303
+ if ( is_multisite() ) {
304
+ // Get all blogs in the network and activate plugin on each one
305
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
306
+ foreach ( $blog_ids as $blog_id ) {
307
+ switch_to_blog( $blog_id );
308
+ self::install_tables();
309
+ restore_current_blog();
310
+ }
311
+ } else {
312
+ self::install_tables();
313
+ }
314
+ }
315
+
316
+ /**
317
+ * Install necessary tables for storing integrations data
318
+ *
319
+ * @since 1.9.2
320
+ * @access public
321
+ */
322
+ public static function install_tables() {
323
+ global $wpdb;
324
+ $charset_collate = $wpdb->get_charset_collate();
325
+ $like = '%' . $wpdb->prefix . 'cli_scripts%';
326
+ $table_name = $wpdb->prefix . 'cli_scripts';
327
+ if ( ! $wpdb->get_results( $wpdb->prepare( 'SHOW TABLES LIKE %s', $like ), ARRAY_N ) ) {
328
+
329
+ $sql = "CREATE TABLE $table_name(
330
  `id` INT NOT NULL AUTO_INCREMENT,
331
  `cliscript_title` TEXT NOT NULL,
332
  `cliscript_category` VARCHAR(100) NOT NULL,
337
  `type` INT NOT NULL DEFAULT '0',
338
  PRIMARY KEY(`id`)
339
  ) $charset_collate;";
340
+ dbDelta( $sql );
341
+ }
342
+ self::update_table_columns();
343
+ self::insert_scripts( $table_name );
344
+ }
345
+ /**
346
+ * Update the status of the plugin based on user option
347
+ *
348
+ * @since 1.9.2
349
+ * @access public
350
+ */
351
+ public function change_plugin_status() {
352
+
353
+ if ( ! current_user_can( 'manage_options' ) ) {
354
+ wp_die( esc_html__( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
355
+ }
356
+ check_ajax_referer( $this->module_id );
357
+ $script_id = (int) ( isset( $_POST['script_id'] ) ? absint( $_POST['script_id'] ) : -1 );
358
+ $status = wp_validate_boolean( ( isset( $_POST['status'] ) && true === wp_validate_boolean( sanitize_text_field( wp_unslash( $_POST['status'] ) ) ) ? true : false ) );
359
+ if ( $script_id !== -1 ) {
360
+ $this->update_script_status( $script_id, $status );
361
+ wp_send_json_success();
362
+ }
363
+ wp_send_json_error();
364
+
365
+ }
366
+ public function update_script_status( $id, $status ) {
367
+
368
+ global $wpdb;
369
+ $script_table = $wpdb->prefix . $this->script_table;
370
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}cli_scripts SET cliscript_status = %d WHERE id = %d", $status, $id ) );
371
+
372
+ }
373
+ /**
374
+ * Load integration if it is currently activated
375
+ *
376
+ * @since 1.9.2
377
+ * @access public
378
+ */
379
+ public static function insert_scripts( $table_name ) {
380
+
381
+ global $wpdb;
382
+ global $wt_cli_integration_list;
383
+ foreach ( $wt_cli_integration_list as $key => $value ) {
384
+ $data = array(
385
+ 'cliscript_key' => isset( $key ) ? $key : '',
386
+ 'cliscript_title' => isset( $value['label'] ) ? $value['label'] : '',
387
+ 'cliscript_category' => isset( $value['category'] ) ? $value['category'] : '',
388
+ 'cliscript_type' => isset( $value['type'] ) ? $value['type'] : 0,
389
+ 'cliscript_status' => isset( $value['status'] ) ? $value['status'] : true,
390
+ 'cliscript_description' => isset( $value['description'] ) ? $value['description'] : '',
391
+ );
392
+ $data_exists = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}cli_scripts WHERE cliscript_key= %s", $key ), ARRAY_A );
393
+ if ( ! $data_exists ) {
394
+ if ( Cookie_Law_Info::maybe_first_time_install() === false ) {
395
+ $data['cliscript_status'] = false;
396
+ }
397
+ $wpdb->insert( $table_name, $data );
398
+ }
399
+ }
400
+ }
401
+ /**
402
+ *
403
+ * @access private
404
+ * @return void
405
+ * @since 1.9.2
406
+ */
407
+ private static function update_table_columns() {
408
+ global $wpdb;
409
+ if ( ! $wpdb->get_results( "SHOW COLUMNS FROM {$wpdb->prefix}cli_scripts LIKE 'cliscript_type'", ARRAY_N ) ) {
410
+ $wpdb->query( "ALTER TABLE {$wpdb->prefix}cli_scripts ADD `cliscript_type` INT DEFAULT 0 AFTER `cliscript_category`" );
411
+ }
412
+ }
413
+ /**
414
+ * Load integration if it is currently activated
415
+ *
416
+ * @since 1.9.2
417
+ * @access public
418
+ */
419
+ public function load_integrations() {
420
+ global $wt_cli_integration_list;
421
+ foreach ( $wt_cli_integration_list as $plugin => $details ) {
422
+ if ( $this->wt_cli_plugin_is_active( $plugin ) ) {
423
+
424
+ $file = plugin_dir_path( __FILE__ ) . "integrations/$plugin.php";
425
+ if ( file_exists( $file ) ) {
426
+ require_once $file;
427
+ } else {
428
+ error_log( "searched for $plugin integration at $file, but did not find it" );
429
+ }
430
+ }
431
+ }
432
+ }
433
+
434
+ /**
435
+ * Check and load necessary plugin data if it is in disabled state
436
+ *
437
+ * @since 1.9.2
438
+ * @access public
439
+ */
440
+ public function update_integration_data() {
441
+
442
+ }
443
+
444
+ /**
445
+ * Check if the listed integration is active on the website
446
+ *
447
+ * @since 1.9.2
448
+ * @access public
449
+ */
450
+ public function wt_cli_plugin_is_active( $plugin ) {
451
+ global $wt_cli_integration_list;
452
+ $script_data = $this->get_scripts();
453
+
454
+ if ( empty( $script_data ) ) {
455
+ return false;
456
+ }
457
+ if ( ! isset( $wt_cli_integration_list[ $plugin ] ) ) {
458
+ return false;
459
+ }
460
+ $details = $wt_cli_integration_list[ $plugin ];
461
+
462
+ $enabled = isset( $script_data[ $plugin ]['status'] ) ? wp_validate_boolean( $script_data[ $plugin ]['status'] ) : false;
463
+ if ( ( defined( $details['identifier'] )
464
+ || function_exists( $details['identifier'] )
465
+ || class_exists( $details['identifier'] ) ) && $enabled === true ) {
466
+ return true;
467
+ }
468
+ return false;
469
+ }
470
+
471
+ /**
472
+ * Start buffering the output for blocking scripts
473
+ *
474
+ * @since 1.9.2
475
+ * @access public
476
+ */
477
+
478
+ public function start_buffer() {
479
+ ob_start( array( $this, 'init' ) );
480
+ }
481
+ /**
482
+ * Flush the buffer
483
+ *
484
+ * @access public
485
+ */
486
+
487
+ public function end_buffer() {
488
+ if ( ob_get_length() ) {
489
+ ob_end_flush();
490
+ }
491
+ }
492
+
493
+ /**
494
+ * Starts replacing the tags that should be blocked
495
+ *
496
+ * @since 1.9.2
497
+ * @access public
498
+ * @param string
499
+ * @return string
500
+ */
501
+
502
+ public function init( $buffer ) {
503
+ $buffer = $this->replace_scripts( $buffer );
504
+ return $buffer;
505
+ }
506
+
507
+ /**
 
 
 
508
  * check if there is a partial match between a key of the array and the haystack
509
  * We cannot use array_search, as this would not allow partial matches.
510
  *
523
  $needle = array( $needle );
524
  }
525
  foreach ( $needle as $key => $value ) {
 
 
526
 
527
+ if ( is_array( $value ) ) {
528
+
529
+ foreach ( $value as $data ) {
530
+
531
+ if ( strlen( $data ) === 0 ) {
532
+ continue;
533
+ }
534
+ if ( ( $pos = strpos( $haystack, $data ) ) !== false ) {
535
+ return ( is_numeric( $key ) ) ? $data : $key;
536
+ }
537
+ }
538
+ } else {
539
 
540
+ if ( strlen( $value ) === 0 ) {
541
+ continue;
542
+ }
543
+ if ( ( $pos = strpos( $haystack, $value ) ) !== false ) {
544
+ return ( is_numeric( $key ) ) ? $value : $key;
545
+ }
546
+ }
547
  }
548
 
549
  return false;
550
  }
551
+ /**
552
+ * Perform a series of regular expression operation to find and replace the unwanted tags from the output
553
+ *
554
+ * @since 1.9.2
555
+ * @access public
556
+ * @param string
557
+ * @return string
558
+ */
559
+
560
+ public function replace_scripts( $buffer ) {
561
+ $third_party_script_tags = array();
562
+
563
+ $third_party_script_tags = apply_filters( 'wt_cli_third_party_scripts', $third_party_script_tags );
564
+
565
+ $script_pattern = '/(<script.*?>)(\X*?)<\/script>/i';
566
+ $index = 0;
567
+ if ( preg_match_all(
568
+ $script_pattern,
569
+ $buffer,
570
+ $matches,
571
+ PREG_PATTERN_ORDER
572
+ ) ) {
573
+
574
+ foreach ( $matches[1] as $key => $script_open ) {
575
+ // exclude ld+json
576
+ if (
577
+ strpos( $script_open, 'application/ld+json' )
578
+ !== false
579
+ ) {
580
+ continue;
581
+ }
582
+ $total_match = $matches[0][ $key ];
583
+ $content = $matches[2][ $key ];
584
+
585
+ // if there is inline script here, it has some content
586
+ if ( ! empty( $content ) ) {
587
+ $found = $this->strpos_arr(
588
+ $content,
589
+ $third_party_script_tags
590
+ );
591
+
592
+ if ( $found !== false ) {
593
+ $category = $this->get_category_by_script_slug( $found );
594
+ $new = $total_match;
595
+ $new = $this->replace_script_type_attribute( $new, $category );
596
+ $buffer = str_replace( $total_match, $new, $buffer );
597
+ }
598
+ }
599
+ $script_src_pattern
 
600
  = '/<script [^>]*?src=[\'"](http:\/\/|https:\/\/|\/\/)([\w.,;@?^=%&:()\/~+#!\-*]*?)[\'"].*?>/i';
601
+ if ( preg_match_all(
602
+ $script_src_pattern,
603
+ $total_match,
604
+ $src_matches,
605
+ PREG_PATTERN_ORDER
606
+ )
607
  ) {
608
+ $script_src_matches = ( isset( $src_matches[2] ) && is_array( $src_matches[2] ) ) ? $src_matches[2] : array();
609
+ if ( ! empty( $script_src_matches ) ) {
610
+ foreach ( $src_matches[2] as $src_key => $script_src ) {
611
+ $script_src = $src_matches[1][ $src_key ] . $src_matches[2][ $src_key ];
612
+ $found = $this->strpos_arr(
613
+ $script_src,
614
+ $third_party_script_tags
615
+ );
616
+
617
+ if ( $found !== false ) {
618
+ $category = $this->get_category_by_script_slug( $found );
619
+ $new = $total_match;
620
+ $new = $this->replace_script_type_attribute( $new, $category );
621
+ $buffer = str_replace( $total_match, $new, $buffer );
622
+ }
623
+ }
624
+ }
625
+ }
626
+ }
627
+ }
628
+ return $buffer;
629
+ }
630
+
631
+ public function replace_script_type_attribute( $script, $category ) {
632
+
633
+ $replace = 'data-cli-class="cli-blocker-script" data-cli-script-type="' . sanitize_text_field( $category ) . '" data-cli-block="true" data-cli-element-position="head"';
634
+ $script_type = 'text/plain';
635
+
636
+ if ( preg_match( '/<script[^\>]*?\>/m', $script ) ) {
637
  $changed = true;
638
+ if ( preg_match( '/<script.*(type=(?:"|\')(.*?)(?:"|\')).*?>/', $script ) && preg_match( '/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script ) ) {
639
+ preg_match( '/<script.*(type=(?:"|\')text\/javascript(.*?)(?:"|\')).*?>/', $script, $output_array );
640
+ $re = preg_quote( $output_array[1], '/' );
641
+ if ( ! empty( $output_array ) ) {
642
+
643
+ $script = preg_replace( '/' . $re . '/', 'type="' . $script_type . '"' . ' ' . $replace, $script, 1 );
644
+
645
+ }
646
  } else {
647
+
648
+ $script = str_replace( '<script', '<script type="' . $script_type . '"' . ' ' . $replace, $script );
649
+
650
+ }
651
+ }
652
+ return $script;
653
+ }
654
+
655
+ /* change category of item on list page (ajax) */
656
+ public function cli_change_script_category() {
657
+
658
+ if ( current_user_can( 'manage_options' ) && check_ajax_referer( $this->module_id ) ) {
659
+
660
+ $script_id = (int) ( isset( $_POST['script_id'] ) ? sanitize_text_field( wp_unslash( $_POST['script_id'] ) ) : -1 );
661
+ $category = isset( $_POST['category'] ) ? sanitize_text_field( wp_unslash( $_POST['category'] ) ) : '';
662
+
663
+ if ( $script_id !== -1 ) {
664
+ self::cli_script_update_category( $script_id, $category );
665
+ wp_send_json_success();
666
+ }
667
+ wp_send_json_error( __( 'Invalid script id', 'cookie-law-info' ) );
668
+ }
669
+ wp_send_json_error( __( 'You do not have sufficient permission to perform this operation', 'cookie-law-info' ) );
670
+ }
671
+ public static function cli_script_update_category( $id = 0, $cat = 3 ) {
672
+
673
+ global $wpdb;
674
+
675
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}cli_scripts SET cliscript_category = %s WHERE id = %s", $cat, $id ) );
676
+ }
677
+ public function get_category_by_script_slug( $slug ) {
678
+ $category = 'non-necessary';
679
+ $scripts = $this->get_scripts();
680
+ $script_data = isset( $scripts[ $slug ] ) ? $scripts[ $slug ] : array();
681
+ if ( ! empty( $script_data ) ) {
682
+ $category = isset( $script_data['category'] ) ? $script_data['category'] : '';
683
+ }
684
+ return $category;
685
+ }
686
+ /**
687
+ * Set script category to necessary after cookie category migration
688
+ *
689
+ * @since 1.9.5
690
+ * @access public
691
+ */
692
+ public function reset_scripts_category() {
693
+
694
+ global $wt_cli_integration_list;
695
+ $script_data = $this->get_scripts();
696
+ if ( isset( $script_data ) ) {
697
+ foreach ( $script_data as $key => $data ) {
698
+ $script_id = $data['id'];
699
+ $category = $data['category'];
700
+
701
+ if ( 'non-necessary' === $category ) {
702
+ if ( -1 !== self::get_non_necessary_category_id() ) {
703
+ $this->cli_script_update_category( $script_id, 'non-necessary' );
704
+ } else {
705
+ $default_category = isset( $wt_cli_integration_list[ $key ]['category'] ) ? $wt_cli_integration_list[ $key ]['category'] : '';
706
+
707
+ if ( '' !== $default_category ) {
708
+ $this->cli_script_update_category( $script_id, $default_category );
709
+ }
710
+ }
711
+ }
712
+ }
713
+ }
714
+ }
715
+ /**
716
+ * Get the id of non-necessary category ( Default category )
717
+ *
718
+ * @since 1.9.5
719
+ * @access public
720
+ */
721
+ public static function get_non_necessary_category_id() {
722
+
723
+ $id_obj = get_term_by( 'slug', 'non-necessary', 'cookielawinfo-category' );
724
+ $id = -1; // for non-necessary default - this may change
725
+ if ( $id_obj ) {
726
+ $id = $id_obj->term_id;
727
+ }
728
+ return $id;
729
+ }
730
+
731
+ public function get_blocking_status() {
732
+
733
+ if ( ! $this->script_blocker_status ) {
734
+ $this->script_blocker_status = $this->get_script_blocker_status();
735
+ }
736
+ return $this->script_blocker_status;
737
+ }
738
+ public function advanced_rendering_enabled() {
739
+
740
+ if ( ! $this->js_blocking ) {
741
+ $this->js_blocking = Cookie_Law_Info::get_js_option();
742
+ }
743
+ return $this->js_blocking;
744
+ }
745
+ public function third_party_scripts() {
746
+
747
+ if ( ! $this->third_party_enabled ) {
748
+ $this->third_party_enabled = $this->get_third_party_status();
749
+ }
750
+ return $this->third_party_enabled;
751
+ }
752
+ // Returns the category slug by category id or slug
753
+ public function get_script_category_slug_by_id( $category_id ) {
754
+
755
+ $category_slug = '';
756
+ $category_id = intval( $category_id );
757
+ if ( $category_id === -1 ) { // Existing cusomters.
758
+ $category_slug = 'non-necessary';
759
+ } else {
760
+ if ( Cookie_Law_Info_Languages::get_instance()->is_multilanguage_plugin_active() === true ) {
761
+
762
+ $default_language = Cookie_Law_Info_Languages::get_instance()->get_default_language_code();
763
+ $current_language = Cookie_Law_Info_Languages::get_instance()->get_current_language_code();
764
+
765
+ if ( $current_language !== $default_language ) {
766
+ $default_term = Cookie_Law_Info_Languages::get_instance()->get_term_by_language( $category_id, $default_language );
767
+
768
+ if ( $default_term && $default_term->term_id ) {
769
+ $category_slug = $default_term->slug;
770
+ }
771
+ } else {
772
+ $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
773
+ if ( isset( $term ) && is_object( $term ) ) {
774
+ $category_slug = $term->slug;
775
+ }
776
+ }
777
+ } else {
778
+ $term = get_term_by( 'id', $category_id, 'cookielawinfo-category' );
779
+ if ( isset( $term ) && is_object( $term ) ) {
780
+ $category_slug = $term->slug;
781
+ }
782
+ }
783
+ }
784
+ return $category_slug;
785
+ }
786
+ }
787
+
 
 
 
 
 
 
788
  }
789
  new Cookie_Law_Info_Script_Blocker();
public/modules/script-blocker/views/settings.php CHANGED
@@ -1,220 +1,240 @@
1
  <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
  }
5
 
6
- $cli_icon = ($script_blocker_status === true ? '<span class="dashicons dashicons-yes cli-enabled ">' : '<span class="dashicons dashicons-no-alt cli-disabled"></span>');
7
- $action_text = ($script_blocker_status === true ? __('Disable', 'cookie-law-info') : __('Enable', 'cookie-law-info'));
8
- $action_value = ($script_blocker_status === true ? 'disabled' : 'enabled');
9
- $script_blocker_text = ($script_blocker_status === true ? __('Script blocker is enabled.', 'cookie-law-info') : __('Script blocker is currently disabled. Enable the blocker if you want any of the below listed plugins to be auto blocked.', 'cookie-law-info'));
10
- $cli_notice_text = sprintf(__('<a href="javascript: submitform()">%s</a>', 'cookie-law-info'), $action_text);
11
- $js_blocking_status = ($js_blocking === false || $js_blocking === 'no') ? false : true;
12
- $script_blocker_class = ($js_blocking_status === false || $script_blocker_status === false) ? 'wt-cli-script-blocker-disabled' : '';
13
- $advanced_settings_url = get_admin_url(null, 'edit.php?post_type=' . CLI_POST_TYPE . '&page=cookie-law-info#cookie-law-info-advanced');
14
- $js_blocking_notice = sprintf(wp_kses(__('Advanced script rendering is currently disabled. It should be enabled for the automatic script blocker to function. <a href="%s">Enable.</a>', 'cookie-law-info'), array('a' => array('href' => array()))), esc_url($advanced_settings_url));
15
- $count = 0;
16
- $plugin_help_url = 'https://www.webtoffee.com/gdpr-cookie-consent-plugin-basic-version-user-guide/#Script_Blocker9';
17
  ?>
18
  <style>
19
- table.cli_script_items td,
20
- table.cli_script_items th {
21
- display: table-cell !important;
22
- padding: 1em !important;
23
- vertical-align: top;
24
- line-height: 1.75em;
25
- }
26
-
27
- .cli-switch {
28
- display: inline-block;
29
- position: relative;
30
- min-height: 20px;
31
- padding-left: 38px;
32
- font-size: 14px;
33
-
34
- }
35
-
36
- .cli-switch input[type="checkbox"] {
37
- display: none;
38
- }
39
-
40
- .cli-switch .cli-slider {
41
- background-color: #e3e1e8;
42
- height: 20px;
43
- width: 38px;
44
- bottom: 0;
45
- cursor: pointer;
46
- left: 0;
47
- position: absolute;
48
- right: 0;
49
- top: 0;
50
- transition: .4s;
51
- }
52
-
53
- .cli-switch .cli-slider:before {
54
- background-color: #fff;
55
- bottom: 2px;
56
- content: "";
57
- height: 15px;
58
- left: 3px;
59
- position: absolute;
60
- transition: .4s;
61
- width: 15px;
62
- }
63
-
64
- .cli-switch input:checked+.cli-slider {
65
- background-color: #28a745;
66
- }
67
-
68
- .cli-switch input:checked+.cli-slider:before {
69
- transform: translateX(18px);
70
- }
71
-
72
- .cli-switch .cli-slider {
73
- border-radius: 34px;
74
- font-size: 0;
75
- }
76
-
77
- .cli-switch .cli-slider:before {
78
- border-radius: 50%;
79
- }
80
-
81
- .dashicons.cli-enabled {
82
- color: #46b450;
83
- }
84
-
85
- .dashicons.cli-disabled {
86
- color: #dc3232;
87
- }
88
-
89
- .wt-cli-script-blocker-disabled,
90
- .wt-cli-plugin-inactive .cli-switch {
91
- opacity: 0.5;
92
- }
93
-
94
- .cli_script_items [data-wt-cli-tooltip]:before {
95
- min-width: 220px;
96
- }
97
-
98
- .wt-cli-notice.wt-cli-info {
99
- padding: 15px 15px 15px 41px;
100
- background: #e5f5fa;
101
- position: relative;
102
- border-left: 4px solid;
103
- border-color: #00a0d2;
104
- margin-bottom: 15px;
105
- }
106
-
107
- .wt-cli-notice.wt-cli-info:before {
108
- content: "\f348";
109
- color: #00a0d2;
110
- font-family: "dashicons";
111
- position: absolute;
112
- left: 15px;
113
- font-size: 16px;
114
- }
 
 
 
115
  </style>
116
  <div class="wrap cliscript-container">
117
- <h3><?php _e('Manage Script Blocking', 'cookie-law-info'); ?></h3>
118
- <?php if ($js_blocking_status === false) : ?>
119
- <div class="notice-warning notice">
120
- <p><label><span class="dashicons dashicons-no-alt cli-disabled"></span></label>
121
- <?php echo $js_blocking_notice; ?>
122
- </div>
123
- <?php endif; ?>
124
- <div class="notice-info notice">
125
- <p><label><?php echo $cli_icon; ?></label>
126
- <?php echo esc_html( $script_blocker_text ); ?> <?php echo $cli_notice_text; ?></p>
127
- </div>
128
- <form method="post" name="script_blocker_form">
129
- <?php
130
- if (function_exists('wp_nonce_field')) {
131
- wp_nonce_field($this->module_id);
132
- }
133
- ?>
134
- <input type="hidden" id="cli_script_blocker_state" name="cli_script_blocker_state" class="styled" value="<?php echo esc_attr( $action_value ); ?>" />
135
- <input type="hidden" id="cli_update_script_blocker" name="cli_update_script_blocker" />
136
- </form>
137
- <div class="wt-cli-notice wt-cli-info">
138
- <?php echo sprintf(wp_kses(__('Below is the list of plugins currently supported for auto blocking. Plugins marked inactive are either not installed or activated on your website. Enabled plugins will be blocked by default on the front-end of your website prior to obtaining user consent and rendered respectively based on consent. <a href="%s" target="_blank">Read more.</a>', 'cookie-law-info'), array('a' => array('href' => array(), 'target' => array()))), esc_url($plugin_help_url)); ?>
139
- </div>
140
- <table class="cli_script_items widefat <?php echo esc_attr( $script_blocker_class ); ?>" cellspacing="0">
141
- <thead>
142
- <tr>
143
- <th><?php echo __('No', 'cookie-law-info'); ?></th>
144
- <th><?php echo __('Name', 'cookie-law-info'); ?></th>
145
- <th><?php echo __('Enabled', 'cookie-law-info'); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php _e('Enabled: Plugins will be blocked by default prior to obtaining user consent.', 'cookie-law-info'); ?> <?php _e('Disabled: Plugins will be rendered prior to obtaining consent.', 'cookie-law-info'); ?>"><span class="wt-cli-tootip-icon"></span></span></th>
146
- <?php if( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === false ): ?>
147
- <th><?php echo __('Category', 'cookie-law-info'); ?></th>
148
- <?php endif; ?>
149
- <th><?php echo __('Description', 'cookie-law-info'); ?></th>
150
- </tr>
151
- </thead>
152
- <tbody>
153
-
154
- <?php
155
- $disabled_plugins = array();
156
- $enabled_plugins = array();
157
- foreach ($wt_cli_integration_list as $plugin => $data) {
158
-
159
- $plugin_data = (isset($script_data[$plugin]) ? $script_data[$plugin] : '');
160
- if (!empty($plugin_data)) {
161
- if (defined($data['identifier']) || function_exists($data['identifier']) || class_exists($data['identifier'])) {
162
- $plugin_data['active'] = true;
163
- $enabled_plugins[$plugin] = $plugin_data;
164
- } else {
165
- $plugin_data['active'] = false;
166
- $disabled_plugins[$plugin] = $plugin_data;
167
- }
168
- }
169
- }
170
- $plugin_list = $enabled_plugins + $disabled_plugins;
171
- if (!empty($plugin_list)) :
172
- foreach ($plugin_list as $plugin => $plugin_data) :
173
-
174
- $count++;
175
- $script_id = isset($plugin_data['id']) ? $plugin_data['id'] : '';
176
- $title = isset($plugin_data['title']) ? $plugin_data['title'] : '';
177
- $description = isset($plugin_data['description']) ? $plugin_data['description'] : '';
178
- $status = isset($plugin_data['status']) ? wp_validate_boolean($plugin_data['status']) : false;
179
- $plugin_status = isset($plugin_data['active']) ? wp_validate_boolean($plugin_data['active']) : false;
180
- $category = __('Non-necessary', 'cookie-law-info');
181
- $plugins_status_text = ($plugin_status === false ? __('Inactive', 'cookie-law-info') : '');
182
- $plugins_status_class = ($plugin_status === false ? 'wt-cli-plugin-inactive' : 'wt-cli-plugin-active');
183
- ?>
184
- <tr class="<?php echo esc_attr( $plugins_status_class ); ?>" data-script-id="<?php echo esc_attr($script_id) ?>">
185
- <td><?php echo esc_html( $count ); ?></td>
186
- <td><?php echo esc_html( $title ); ?>
187
- <?php if (!empty($plugins_status_text)) : ?>
188
- <span style="color:#dc3232; margin-left:3px;">( <?php echo esc_html( $plugins_status_text ); ?> )</span>
189
- <?php endif; ?>
190
- </td>
191
- <td>
192
- <div class="cli-switch">
193
- <input type="checkbox" id="wt-cli-checkbox-<?php echo esc_attr($plugin); ?>" data-script-id="<?php echo esc_attr($script_id) ?>" class="wt-cli-plugin-status" <?php checked(wp_validate_boolean($status), true) ?> />
194
- <label for="wt-cli-checkbox-<?php echo esc_attr($plugin); ?>" class="cli-slider"></label>
195
- </div>
196
- </td>
197
- <?php if( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === false ): ?>
198
-
199
- <td>
200
- <select name="cliscript_category" id="cliscript_category">
201
- <option value="0">--Select Category--</option>
202
- <?php foreach ($terms as $key => $term) : ?>
203
- <option value="<?php echo esc_attr( $key ); ?>" <?php echo selected($plugin_data['category'], $key, false) ?>><?php echo esc_html( $term['title'] ); ?></option>
204
- <?php endforeach; ?>
205
- </select>
206
- </td>
207
- <?php endif; ?>
208
- <td><?php echo esc_html( $description ); ?></td>
209
- </tr>
210
- <?php endforeach;
211
- endif; ?>
212
- </tbody>
213
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  </div>
215
  <script>
216
- function submitform() {
217
- document.script_blocker_form.submit();
218
- }
 
 
219
  </script>
220
- <?php // Silence is golden
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
  }
5
 
6
+ $cli_icon = ( $script_blocker_status === true ? '<span class="dashicons dashicons-yes cli-enabled ">' : '<span class="dashicons dashicons-no-alt cli-disabled"></span>' );
7
+ $action_text = ( $script_blocker_status === true ? __( 'Disable', 'cookie-law-info' ) : __( 'Enable', 'cookie-law-info' ) );
8
+ $action_value = ( $script_blocker_status === true ? 'disabled' : 'enabled' );
9
+ $script_blocker_text = ( $script_blocker_status === true ? __( 'Script blocker is enabled.', 'cookie-law-info' ) : __( 'Script blocker is currently disabled. Enable the blocker if you want any of the below listed plugins to be auto blocked.', 'cookie-law-info' ) );
10
+ $cli_notice_text = sprintf( __( '<a id="wt-cli-script-blocker-action">%s</a>', 'cookie-law-info' ), $action_text );
11
+ $js_blocking_status = ( $js_blocking === false || $js_blocking === 'no' ) ? false : true;
12
+ $script_blocker_class = ( $js_blocking_status === false || $script_blocker_status === false ) ? 'wt-cli-script-blocker-disabled' : '';
13
+ $advanced_settings_url = get_admin_url( null, 'edit.php?post_type=' . CLI_POST_TYPE . '&page=cookie-law-info#cookie-law-info-advanced' );
14
+ $js_blocking_notice = sprintf( wp_kses( __( 'Advanced script rendering is currently disabled. It should be enabled for the automatic script blocker to function. <a href="%s">Enable.</a>', 'cookie-law-info' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $advanced_settings_url ) );
15
+ $count = 0;
16
+ $plugin_help_url = 'https://www.webtoffee.com/gdpr-cookie-consent-plugin-basic-version-user-guide/#Script_Blo_21';
17
  ?>
18
  <style>
19
+ #wt-cli-script-blocker-action {
20
+ cursor: pointer;
21
+ }
22
+ table.cli_script_items td,
23
+ table.cli_script_items th {
24
+ display: table-cell !important;
25
+ padding: 1em !important;
26
+ vertical-align: top;
27
+ line-height: 1.75em;
28
+ }
29
+
30
+ .cli-switch {
31
+ display: inline-block;
32
+ position: relative;
33
+ min-height: 20px;
34
+ padding-left: 38px;
35
+ font-size: 14px;
36
+
37
+ }
38
+
39
+ .cli-switch input[type="checkbox"] {
40
+ display: none;
41
+ }
42
+
43
+ .cli-switch .cli-slider {
44
+ background-color: #e3e1e8;
45
+ height: 20px;
46
+ width: 38px;
47
+ bottom: 0;
48
+ cursor: pointer;
49
+ left: 0;
50
+ position: absolute;
51
+ right: 0;
52
+ top: 0;
53
+ transition: .4s;
54
+ }
55
+
56
+ .cli-switch .cli-slider:before {
57
+ background-color: #fff;
58
+ bottom: 2px;
59
+ content: "";
60
+ height: 15px;
61
+ left: 3px;
62
+ position: absolute;
63
+ transition: .4s;
64
+ width: 15px;
65
+ }
66
+
67
+ .cli-switch input:checked+.cli-slider {
68
+ background-color: #28a745;
69
+ }
70
+
71
+ .cli-switch input:checked+.cli-slider:before {
72
+ transform: translateX(18px);
73
+ }
74
+
75
+ .cli-switch .cli-slider {
76
+ border-radius: 34px;
77
+ font-size: 0;
78
+ }
79
+
80
+ .cli-switch .cli-slider:before {
81
+ border-radius: 50%;
82
+ }
83
+
84
+ .dashicons.cli-enabled {
85
+ color: #46b450;
86
+ }
87
+
88
+ .dashicons.cli-disabled {
89
+ color: #dc3232;
90
+ }
91
+
92
+ .wt-cli-script-blocker-disabled,
93
+ .wt-cli-plugin-inactive .cli-switch {
94
+ opacity: 0.5;
95
+ }
96
+
97
+ .cli_script_items [data-wt-cli-tooltip]:before {
98
+ min-width: 220px;
99
+ }
100
+
101
+ .wt-cli-notice.wt-cli-info {
102
+ padding: 15px 15px 15px 41px;
103
+ background: #e5f5fa;
104
+ position: relative;
105
+ border-left: 4px solid;
106
+ border-color: #00a0d2;
107
+ margin-bottom: 15px;
108
+ }
109
+
110
+ .wt-cli-notice.wt-cli-info:before {
111
+ content: "\f348";
112
+ color: #00a0d2;
113
+ font-family: "dashicons";
114
+ position: absolute;
115
+ left: 15px;
116
+ font-size: 16px;
117
+ }
118
  </style>
119
  <div class="wrap cliscript-container">
120
+ <h3><?php echo esc_html__( 'Manage Script Blocking', 'cookie-law-info' ); ?></h3>
121
+ <?php if ( $js_blocking_status === false ) : ?>
122
+ <div class="notice-warning notice">
123
+ <p><label><span class="dashicons dashicons-no-alt cli-disabled"></span></label>
124
+ <?php echo wp_kses_post( $js_blocking_notice ); ?>
125
+ </div>
126
+ <?php endif; ?>
127
+ <div class="notice-info notice">
128
+ <p><label><?php echo wp_kses_post( $cli_icon ); ?></label>
129
+ <?php echo esc_html( $script_blocker_text ); ?> <?php echo wp_kses_post( $cli_notice_text ); ?></p>
130
+ </div>
131
+ <form method="post" name="script_blocker_form">
132
+ <?php
133
+ if ( function_exists( 'wp_nonce_field' ) ) {
134
+ wp_nonce_field( $this->module_id );
135
+ }
136
+ ?>
137
+ <input type="hidden" id="cli_script_blocker_state" name="cli_script_blocker_state" class="styled" value="<?php echo esc_attr( $action_value ); ?>" />
138
+ <input type="hidden" id="cli_update_script_blocker" name="cli_update_script_blocker" />
139
+ </form>
140
+ <div class="wt-cli-notice wt-cli-info">
141
+ <?php
142
+ echo sprintf(
143
+ wp_kses(
144
+ __( 'Below is the list of plugins currently supported for auto blocking. Plugins marked inactive are either not installed or activated on your website. Enabled plugins will be blocked by default on the front-end of your website prior to obtaining user consent and rendered respectively based on consent. <a href="%s" target="_blank">Read more.</a>', 'cookie-law-info' ),
145
+ array(
146
+ 'a' => array(
147
+ 'href' => array(),
148
+ 'target' => array(),
149
+ ),
150
+ )
151
+ ),
152
+ esc_url( $plugin_help_url )
153
+ );
154
+ ?>
155
+ </div>
156
+ <table class="cli_script_items widefat <?php echo esc_attr( $script_blocker_class ); ?>" cellspacing="0">
157
+ <thead>
158
+ <tr>
159
+ <th><?php echo esc_html__( 'No', 'cookie-law-info' ); ?></th>
160
+ <th><?php echo esc_html__( 'Name', 'cookie-law-info' ); ?></th>
161
+ <th><?php echo esc_html__( 'Enabled', 'cookie-law-info' ); ?><span class="wt-cli-tootip" data-wt-cli-tooltip="<?php echo esc_html__( 'Enabled: Plugins will be blocked by default prior to obtaining user consent.', 'cookie-law-info' ); ?> <?php echo esc_html__( 'Disabled: Plugins will be rendered prior to obtaining consent.', 'cookie-law-info' ); ?>"><span class="wt-cli-tootip-icon"></span></span></th>
162
+ <?php if ( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === false ) : ?>
163
+ <th><?php echo esc_html__( 'Category', 'cookie-law-info' ); ?></th>
164
+ <?php endif; ?>
165
+ <th><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></th>
166
+ </tr>
167
+ </thead>
168
+ <tbody>
169
+
170
+ <?php
171
+ $disabled_plugins = array();
172
+ $enabled_plugins = array();
173
+ foreach ( $wt_cli_integration_list as $plugin => $data ) {
174
+
175
+ $plugin_data = ( isset( $script_data[ $plugin ] ) ? $script_data[ $plugin ] : '' );
176
+ if ( ! empty( $plugin_data ) ) {
177
+ if ( defined( $data['identifier'] ) || function_exists( $data['identifier'] ) || class_exists( $data['identifier'] ) ) {
178
+ $plugin_data['active'] = true;
179
+ $enabled_plugins[ $plugin ] = $plugin_data;
180
+ } else {
181
+ $plugin_data['active'] = false;
182
+ $disabled_plugins[ $plugin ] = $plugin_data;
183
+ }
184
+ }
185
+ }
186
+ $plugin_list = $enabled_plugins + $disabled_plugins;
187
+ if ( ! empty( $plugin_list ) ) :
188
+ foreach ( $plugin_list as $plugin => $plugin_data ) :
189
+
190
+ $count++;
191
+ $script_id = isset( $plugin_data['id'] ) ? $plugin_data['id'] : '';
192
+ $title = isset( $plugin_data['title'] ) ? $plugin_data['title'] : '';
193
+ $description = isset( $plugin_data['description'] ) ? $plugin_data['description'] : '';
194
+ $status = isset( $plugin_data['status'] ) ? wp_validate_boolean( $plugin_data['status'] ) : false;
195
+ $plugin_status = isset( $plugin_data['active'] ) ? wp_validate_boolean( $plugin_data['active'] ) : false;
196
+ $category = __( 'Non-necessary', 'cookie-law-info' );
197
+ $plugins_status_text = ( $plugin_status === false ? __( 'Inactive', 'cookie-law-info' ) : '' );
198
+ $plugins_status_class = ( $plugin_status === false ? 'wt-cli-plugin-inactive' : 'wt-cli-plugin-active' );
199
+ ?>
200
+ <tr class="<?php echo esc_attr( $plugins_status_class ); ?>" data-script-id="<?php echo esc_attr( $script_id ); ?>">
201
+ <td><?php echo esc_html( $count ); ?></td>
202
+ <td><?php echo esc_html( $title ); ?>
203
+ <?php if ( ! empty( $plugins_status_text ) ) : ?>
204
+ <span style="color:#dc3232; margin-left:3px;">( <?php echo esc_html( $plugins_status_text ); ?> )</span>
205
+ <?php endif; ?>
206
+ </td>
207
+ <td>
208
+ <div class="cli-switch">
209
+ <input type="checkbox" id="wt-cli-checkbox-<?php echo esc_attr( $plugin ); ?>" data-script-id="<?php echo esc_attr( $script_id ); ?>" class="wt-cli-plugin-status" <?php checked( wp_validate_boolean( $status ), true ); ?> />
210
+ <label for="wt-cli-checkbox-<?php echo esc_attr( $plugin ); ?>" class="cli-slider"></label>
211
+ </div>
212
+ </td>
213
+ <?php if ( Cookie_Law_Info_Cookies::get_instance()->check_if_old_category_table() === false ) : ?>
214
+
215
+ <td>
216
+ <select name="cliscript_category" id="cliscript_category">
217
+ <option value="0">--Select Category--</option>
218
+ <?php foreach ( $terms as $key => $term ) : ?>
219
+ <option value="<?php echo esc_attr( $key ); ?>" <?php echo selected( $plugin_data['category'], $key, false ); ?>><?php echo esc_html( $term['title'] ); ?></option>
220
+ <?php endforeach; ?>
221
+ </select>
222
+ </td>
223
+ <?php endif; ?>
224
+ <td><?php echo esc_html( $description ); ?></td>
225
+ </tr>
226
+ <?php
227
+ endforeach;
228
+ endif;
229
+ ?>
230
+ </tbody>
231
+ </table>
232
  </div>
233
  <script>
234
+ let item = document.getElementById('wt-cli-script-blocker-action');
235
+ item && item.addEventListener('click', function(event) {
236
+ event.preventDefault();
237
+ document.script_blocker_form.submit();
238
+ });
239
  </script>
240
+ <?php
public/modules/shortcode/shortcode.php CHANGED
@@ -77,9 +77,11 @@ class Cookie_Law_Info_Shortcode {
77
  jQuery('#cookie-law-info-again').click();
78
  setTimeout(function(){
79
  if( jQuery('#cookie-law-info-bar').length > 0) {
80
- jQuery(window).scrollTop(jQuery('#cookie-law-info-bar').offset().top);
 
 
81
  }
82
- },1000);
83
  });
84
  });
85
  </script>
@@ -104,7 +106,7 @@ class Cookie_Law_Info_Shortcode {
104
  {
105
  $html .= ' ' . __( 'No consent given.', 'cookie-law-info' );
106
  }
107
- $html .= ' <a class="cli_manage_current_consent" style="cursor:pointer;">' . __( 'Manage your consent.', 'cookie-law-info' ) . '</a> </div>';
108
  return $html;
109
  }
110
 
@@ -270,7 +272,7 @@ class Cookie_Law_Info_Shortcode {
270
  $ret .= '<td class="cookielawinfo-column-3">' . esc_html( $cookie_duration ) . '</td>';
271
  }
272
  if ( in_array( 'description', $columns ) ) {
273
- $ret .= '<td class="cookielawinfo-column-4">' . wp_kses_post( $post->post_content ). '</td>';
274
  }
275
  $ret = apply_filters( 'cli_new_column_values_to_audit_table', $ret, $custom );
276
  $ret .= '</tr>';
@@ -533,7 +535,7 @@ class Cookie_Law_Info_Shortcode {
533
  }
534
  $manage_consent_link = '';
535
  $manage_consent_text = ( isset( $this->cookie_options['showagain_text'] ) ? $this->cookie_options['showagain_text'] : '' );
536
- $manage_consent_link = '<a href="javascript:void(0)" class="wt-cli-manage-consent-link">' . esc_html( $manage_consent_text ) . '</a>';
537
 
538
  return $manage_consent_link;
539
  }
@@ -552,7 +554,7 @@ class Cookie_Law_Info_Shortcode {
552
  } else {
553
  $class = ' class="wt-cli-element cli-plugin-main-button wt-cli-accept-all-btn cookie_action_close_header cli_action_button" ';
554
  }
555
- $url = ( $settings['button_7_action'] == 'CONSTANT_OPEN_URL' && $settings['button_7_url'] != '#' ) ? 'href="' . esc_url( $settings['button_7_url'] ) . '"': "role='button'";
556
 
557
  $link_tag = '<a id="wt-cli-accept-all-btn" tabindex="0" ' . $url . ' data-cli_action="accept_all" ';
558
  $link_tag .= ( $settings['button_7_new_win'] ) ? ' target="_blank" ' : '';
77
  jQuery('#cookie-law-info-again').click();
78
  setTimeout(function(){
79
  if( jQuery('#cookie-law-info-bar').length > 0) {
80
+ jQuery('html, body').animate({
81
+ scrollTop: jQuery("#cookie-law-info-bar").offset().top
82
+ }, 300);
83
  }
84
+ },100);
85
  });
86
  });
87
  </script>
106
  {
107
  $html .= ' ' . __( 'No consent given.', 'cookie-law-info' );
108
  }
109
+ $html .= ' <a class="cli_manage_current_consent" style="cursor:pointer;text-decoration:underline;">' . __( 'Manage your consent.', 'cookie-law-info' ) . '</a> </div>';
110
  return $html;
111
  }
112
 
272
  $ret .= '<td class="cookielawinfo-column-3">' . esc_html( $cookie_duration ) . '</td>';
273
  }
274
  if ( in_array( 'description', $columns ) ) {
275
+ $ret .= '<td class="cookielawinfo-column-4">' . wp_kses_post( $post->post_content ) . '</td>';
276
  }
277
  $ret = apply_filters( 'cli_new_column_values_to_audit_table', $ret, $custom );
278
  $ret .= '</tr>';
535
  }
536
  $manage_consent_link = '';
537
  $manage_consent_text = ( isset( $this->cookie_options['showagain_text'] ) ? $this->cookie_options['showagain_text'] : '' );
538
+ $manage_consent_link = '<a class="wt-cli-manage-consent-link">' . esc_html( $manage_consent_text ) . '</a>';
539
 
540
  return $manage_consent_link;
541
  }
554
  } else {
555
  $class = ' class="wt-cli-element cli-plugin-main-button wt-cli-accept-all-btn cookie_action_close_header cli_action_button" ';
556
  }
557
+ $url = ( $settings['button_7_action'] == 'CONSTANT_OPEN_URL' && $settings['button_7_url'] != '#' ) ? 'href="' . esc_url( $settings['button_7_url'] ) . '"' : "role='button'";
558
 
559
  $link_tag = '<a id="wt-cli-accept-all-btn" tabindex="0" ' . $url . ' data-cli_action="accept_all" ';
560
  $link_tag .= ( $settings['button_7_new_win'] ) ? ' target="_blank" ' : '';
public/views/cookie-law-info_bar.php CHANGED
@@ -7,37 +7,52 @@ if ( ! defined( 'WPINC' ) ) {
7
  echo '<!--googleoff: all-->';
8
 
9
  if ( $notify_html == '' ) {
10
- return; } //if filter is applied
11
- echo $notify_html;
12
- $pop_out = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  $pop_content_html_file = plugin_dir_path( CLI_PLUGIN_FILENAME ) . 'public/views/cookie-law-info_popup_content.php';
14
- if ( file_exists( $pop_content_html_file ) ) {
15
- include $pop_content_html_file;
16
- }
17
  ?>
18
  <div class="cli-modal" data-nosnippet="true" id="cliSettingsPopup" tabindex="-1" role="dialog" aria-labelledby="cliSettingsPopup" aria-hidden="true">
19
  <div class="cli-modal-dialog" role="document">
20
  <div class="cli-modal-content cli-bar-popup">
21
- <button type="button" class="cli-modal-close" id="cliModalClose">
22
  <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>
23
- <span class="wt-cli-sr-only"><?php echo __( 'Close', 'cookie-law-info' ); ?></span>
24
- </button>
25
- <div class="cli-modal-body">
26
- <?php echo $pop_out;?>
27
- </div>
28
- <div class="cli-modal-footer">
 
 
 
 
29
  <div class="wt-cli-element cli-container-fluid cli-tab-container">
30
  <div class="cli-row">
31
  <div class="cli-col-12 cli-align-items-stretch cli-px-0">
32
  <div class="cli-tab-footer wt-cli-privacy-overview-actions">
33
 
34
  <?php if ( apply_filters( 'wt_cli_enable_settings_accept_btn', true ) === true ) : ?>
35
- <a id="wt-cli-privacy-save-btn" role="button" tabindex="0" data-cli-action="accept" class="wt-cli-privacy-btn cli_setting_save_button wt-cli-privacy-accept-btn cli-btn"><?php echo __( 'SAVE & ACCEPT', 'cookie-law-info' ); ?></a>
36
  <?php endif; ?>
37
  </div>
38
  <?php if ( apply_filters( 'wt_cli_enable_ckyes_branding', true ) === true ) : ?>
39
  <div class="wt-cli-ckyes-footer-section">
40
- <div class="wt-cli-ckyes-brand-logo"><?php echo __( 'Powered by', 'cookie-law-info' ); ?> <a href="https://www.cookieyes.com/"><img src="<?php echo esc_url( CLI_PLUGIN_URL . 'public/images/logo-cookieyes.svg' ); ?>" alt="CookieYes Logo"></a></div>
41
  </div>
42
  <?php endif; ?>
43
 
7
  echo '<!--googleoff: all-->';
8
 
9
  if ( $notify_html == '' ) {
10
+ return;
11
+ } //if filter is applied.
12
+ echo wp_kses(
13
+ trim( stripslashes( $notify_html ) ),
14
+ array_merge(
15
+ array(
16
+ 'input' => array(
17
+ 'type' => 'true',
18
+ 'style' => true,
19
+ 'id' => true,
20
+ 'class' => true,
21
+ ),
22
+ ),
23
+ wp_kses_allowed_html( 'post' )
24
+ )
25
+ );
26
  $pop_content_html_file = plugin_dir_path( CLI_PLUGIN_FILENAME ) . 'public/views/cookie-law-info_popup_content.php';
27
+
 
 
28
  ?>
29
  <div class="cli-modal" data-nosnippet="true" id="cliSettingsPopup" tabindex="-1" role="dialog" aria-labelledby="cliSettingsPopup" aria-hidden="true">
30
  <div class="cli-modal-dialog" role="document">
31
  <div class="cli-modal-content cli-bar-popup">
32
+ <button type="button" class="cli-modal-close" id="cliModalClose">
33
  <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>
34
+ <span class="wt-cli-sr-only"><?php echo esc_html__( 'Close', 'cookie-law-info' ); ?></span>
35
+ </button>
36
+ <div class="cli-modal-body">
37
+ <?php
38
+ if ( file_exists( $pop_content_html_file ) ) {
39
+ include $pop_content_html_file;
40
+ }
41
+ ?>
42
+ </div>
43
+ <div class="cli-modal-footer">
44
  <div class="wt-cli-element cli-container-fluid cli-tab-container">
45
  <div class="cli-row">
46
  <div class="cli-col-12 cli-align-items-stretch cli-px-0">
47
  <div class="cli-tab-footer wt-cli-privacy-overview-actions">
48
 
49
  <?php if ( apply_filters( 'wt_cli_enable_settings_accept_btn', true ) === true ) : ?>
50
+ <a id="wt-cli-privacy-save-btn" role="button" tabindex="0" data-cli-action="accept" class="wt-cli-privacy-btn cli_setting_save_button wt-cli-privacy-accept-btn cli-btn"><?php echo esc_html__( 'SAVE & ACCEPT', 'cookie-law-info' ); ?></a>
51
  <?php endif; ?>
52
  </div>
53
  <?php if ( apply_filters( 'wt_cli_enable_ckyes_branding', true ) === true ) : ?>
54
  <div class="wt-cli-ckyes-footer-section">
55
+ <div class="wt-cli-ckyes-brand-logo"><?php echo esc_html__( 'Powered by', 'cookie-law-info' ); ?> <a href="https://www.cookieyes.com/"><img src="<?php echo esc_url( CLI_PLUGIN_URL . 'public/images/logo-cookieyes.svg' ); ?>" alt="CookieYes Logo"></a></div>
56
  </div>
57
  <?php endif; ?>
58
 
public/views/cookie-law-info_popup_content.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
2
- ob_start();
3
  $overview = get_option( 'cookielawinfo_privacy_overview_content_settings' );
4
  $default_privacy_settings = Cookie_Law_Info_Admin::get_privacy_defaults();
5
 
6
  $cli_always_enable_text = __( 'Always Enabled', 'cookie-law-info' );
7
  $cli_enable_text = __( 'Enabled', 'cookie-law-info' );
8
  $cli_disable_text = __( 'Disabled', 'cookie-law-info' );
9
- $cli_privacy_readmore = '<a class="cli-privacy-readmore" aria-label="' . __('Show more', 'cookie-law-info') . '" tabindex="0" role="button" data-readmore-text="' . __( 'Show more', 'cookie-law-info' ) . '" data-readless-text="' . __( 'Show less', 'cookie-law-info' ) . '"></a>';
10
  $overview_title = sanitize_text_field( stripslashes( isset( $overview['privacy_overview_title'] ) ? $overview['privacy_overview_title'] : $default_privacy_settings['privacy_overview_title'] ) );
11
  $privacy_overview_content = wp_kses_post( isset( $overview['privacy_overview_content'] ) ? $overview['privacy_overview_content'] : $default_privacy_settings['privacy_overview_content'] );
12
  $privacy_overview_content = nl2br( $privacy_overview_content );
@@ -18,14 +17,6 @@ $overview_title = trim( $overview_title );
18
  // $cookie_filter_categories = '';
19
  $cookie_categories = apply_filters( 'wt_cli_cookie_categories', array() );
20
 
21
-
22
- // if( has_filter('wt_cli_add_custom_cookie_categories_name')) {
23
- // $cookie_filter_categories = array(
24
- // 'necessary' => isset( $cookie_category_data['necessary']['title'] ) ? $cookie_category_data['necessary']['title'] : __('Necessary', 'cookie-law-info'),
25
- // 'non-necessary' => isset( $cookie_category_data['non-necessary']['title'] ) ? $cookie_category_data['non-necessary']['title'] : __('Non-necessary', 'cookie-law-info'),
26
- // );
27
- // $cookie_filter_categories = apply_filters('wt_cli_add_custom_cookie_categories_name', $cookie_filter_categories);
28
- // }
29
  $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
30
 
31
  ?>
@@ -37,16 +28,16 @@ $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
37
 
38
  if ( isset( $overview_title ) === true && $overview_title !== '' ) {
39
  if ( has_filter( 'wt_cli_change_privacy_overview_title_tag' ) ) {
40
- echo apply_filters( 'wt_cli_change_privacy_overview_title_tag', esc_html( $overview_title ), '<h4>', '</h4>' );
41
  } else {
42
  echo '<h4>' . esc_html( $overview_title ) . '</h4>';
43
  }
44
  }
45
  ?>
46
  <div class="cli-privacy-content">
47
- <div class="cli-privacy-content-text"><?php echo $privacy_overview_content; ?></div>
48
  </div>
49
- <?php echo $cli_privacy_readmore; ?>
50
  </div>
51
  </div>
52
  <div class="cli-col-12 cli-align-items-stretch cli-px-0 cli-tab-section-container">
@@ -58,46 +49,41 @@ $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
58
  $category_description = ( isset( $value['description'] ) ? $value['description'] : '' );
59
  $category_default_state = ( isset( $value['default_state'] ) ? $value['default_state'] : false );
60
  $cookie_title = isset( $cookie_filter_categories[ $key ] ) ? $cookie_filter_categories[ $key ] : $cookie_title;
61
-
62
- if ( $key === 'necessary' ) {
63
- $cli_switch = '<div class="wt-cli-necessary-checkbox">
64
- <input type="checkbox" class="cli-user-preference-checkbox" id="wt-cli-checkbox-' . $key . '" data-id="checkbox-' . $key . '" checked="checked" />
65
- <label class="form-check-label" for="wt-cli-checkbox-' . $key . '">' . $cookie_title . '</label>
66
- </div>
67
- <span class="cli-necessary-caption">' . $cli_always_enable_text . '</span> ';
68
-
69
  } else {
 
 
 
70
 
71
- $checked = false;
72
- if ( $js_blocking_enabled === true ) {
73
- if ( isset( $category_default_state ) && $category_default_state === true ) {
74
- $checked = true;
75
- }
76
- } else {
77
- if ( isset( $_COOKIE[ "cookielawinfo-checkbox-$key" ] ) && $_COOKIE[ "cookielawinfo-checkbox-$key" ] == 'yes' ) {
78
- $checked = true;
79
- } elseif ( ! isset( $_COOKIE[ "cookielawinfo-checkbox-$key" ] ) ) {
80
-
81
- $checked = true;
82
- if ( $category_default_state === false ) {
83
- $checked = false;
84
- }
85
  }
86
  }
87
- $cli_switch =
88
- '<div class="cli-switch">
89
- <input type="checkbox" id="wt-cli-checkbox-' . $key . '" class="cli-user-preference-checkbox" data-id="checkbox-' . $key . '" ' . checked( $checked, true, false ) . ' />
90
- <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">' . $cookie_title . '</span></label>
91
- </div>';
92
  }
93
  ?>
94
  <?php if ( $category_enabled === true ) : ?>
95
  <div class="cli-tab-section">
96
  <div class="cli-tab-header">
97
  <a role="button" tabindex="0" class="cli-nav-link cli-settings-mobile" data-target="<?php echo esc_attr( $key ); ?>" data-toggle="cli-toggle-tab">
98
- <?php echo $cookie_title; ?>
99
  </a>
100
- <?php echo $cli_switch; ?>
 
 
 
 
 
 
 
 
 
 
 
101
  </div>
102
  <div class="cli-tab-content">
103
  <div class="cli-tab-pane cli-fade" data-id="<?php echo esc_attr( $key ); ?>">
@@ -115,5 +101,3 @@ $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
115
  </div>
116
  </div>
117
  <?php
118
- $pop_out = ob_get_contents();
119
- ob_end_clean();
1
  <?php
 
2
  $overview = get_option( 'cookielawinfo_privacy_overview_content_settings' );
3
  $default_privacy_settings = Cookie_Law_Info_Admin::get_privacy_defaults();
4
 
5
  $cli_always_enable_text = __( 'Always Enabled', 'cookie-law-info' );
6
  $cli_enable_text = __( 'Enabled', 'cookie-law-info' );
7
  $cli_disable_text = __( 'Disabled', 'cookie-law-info' );
8
+ $cli_privacy_readmore = '<a class="cli-privacy-readmore" aria-label="' . __( 'Show more', 'cookie-law-info' ) . '" tabindex="0" role="button" data-readmore-text="' . __( 'Show more', 'cookie-law-info' ) . '" data-readless-text="' . __( 'Show less', 'cookie-law-info' ) . '"></a>';
9
  $overview_title = sanitize_text_field( stripslashes( isset( $overview['privacy_overview_title'] ) ? $overview['privacy_overview_title'] : $default_privacy_settings['privacy_overview_title'] ) );
10
  $privacy_overview_content = wp_kses_post( isset( $overview['privacy_overview_content'] ) ? $overview['privacy_overview_content'] : $default_privacy_settings['privacy_overview_content'] );
11
  $privacy_overview_content = nl2br( $privacy_overview_content );
17
  // $cookie_filter_categories = '';
18
  $cookie_categories = apply_filters( 'wt_cli_cookie_categories', array() );
19
 
 
 
 
 
 
 
 
 
20
  $js_blocking_enabled = Cookie_Law_Info::wt_cli_is_js_blocking_active();
21
 
22
  ?>
28
 
29
  if ( isset( $overview_title ) === true && $overview_title !== '' ) {
30
  if ( has_filter( 'wt_cli_change_privacy_overview_title_tag' ) ) {
31
+ echo wp_kses_post( apply_filters( 'wt_cli_change_privacy_overview_title_tag', esc_html( $overview_title ), '<h4>', '</h4>' ) );
32
  } else {
33
  echo '<h4>' . esc_html( $overview_title ) . '</h4>';
34
  }
35
  }
36
  ?>
37
  <div class="cli-privacy-content">
38
+ <div class="cli-privacy-content-text"><?php echo wp_kses_post( $privacy_overview_content ); ?></div>
39
  </div>
40
+ <?php echo wp_kses_post( $cli_privacy_readmore ); ?>
41
  </div>
42
  </div>
43
  <div class="cli-col-12 cli-align-items-stretch cli-px-0 cli-tab-section-container">
49
  $category_description = ( isset( $value['description'] ) ? $value['description'] : '' );
50
  $category_default_state = ( isset( $value['default_state'] ) ? $value['default_state'] : false );
51
  $cookie_title = isset( $cookie_filter_categories[ $key ] ) ? $cookie_filter_categories[ $key ] : $cookie_title;
52
+ $checked = false;
53
+ if ( $js_blocking_enabled === true ) {
54
+ if ( isset( $category_default_state ) && $category_default_state === true ) {
55
+ $checked = true;
56
+ }
 
 
 
57
  } else {
58
+ if ( isset( $_COOKIE[ "cookielawinfo-checkbox-$key" ] ) && $_COOKIE[ "cookielawinfo-checkbox-$key" ] == 'yes' ) {
59
+ $checked = true;
60
+ } elseif ( ! isset( $_COOKIE[ "cookielawinfo-checkbox-$key" ] ) ) {
61
 
62
+ $checked = true;
63
+ if ( $category_default_state === false ) {
64
+ $checked = false;
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
  }
 
 
 
 
 
67
  }
68
  ?>
69
  <?php if ( $category_enabled === true ) : ?>
70
  <div class="cli-tab-section">
71
  <div class="cli-tab-header">
72
  <a role="button" tabindex="0" class="cli-nav-link cli-settings-mobile" data-target="<?php echo esc_attr( $key ); ?>" data-toggle="cli-toggle-tab">
73
+ <?php echo esc_html( $cookie_title ); ?>
74
  </a>
75
+ <?php if ( 'necessary' === $key ) : ?>
76
+ <div class="wt-cli-necessary-checkbox">
77
+ <input type="checkbox" class="cli-user-preference-checkbox" id="wt-cli-checkbox-<?php echo esc_attr( $key ); ?>" data-id="checkbox-<?php echo esc_attr( $key ); ?>" checked="checked" />
78
+ <label class="form-check-label" for="wt-cli-checkbox-<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $cookie_title ); ?></label>
79
+ </div>
80
+ <span class="cli-necessary-caption"><?php echo esc_html( $cli_always_enable_text ); ?></span>
81
+ <?php else : ?>
82
+ <div class="cli-switch">
83
+ <input type="checkbox" id="wt-cli-checkbox-<?php echo esc_attr( $key ); ?>" class="cli-user-preference-checkbox" data-id="checkbox-<?php echo esc_attr( $key ); ?>"<?php echo checked( $checked, true, false ); ?> />
84
+ <label for="wt-cli-checkbox-<?php echo esc_attr( $key ); ?>" class="cli-slider" data-cli-enable="<?php echo esc_attr( $cli_enable_text ); ?>" data-cli-disable="<?php echo esc_attr( $cli_disable_text ); ?>"><span class="wt-cli-sr-only"><?php echo esc_html( $cookie_title ); ?></span></label>
85
+ </div>
86
+ <?php endif; ?>
87
  </div>
88
  <div class="cli-tab-content">
89
  <div class="cli-tab-pane cli-fade" data-id="<?php echo esc_attr( $key ); ?>">
101
  </div>
102
  </div>
103
  <?php
 
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: GDPR, CCPA, cookie notice, DSGVO, RGPD, LGPD, PIPEDA, POPIA, cookies , coo
5
  Requires at least: 4.4.0
6
  Tested up to: 5.9
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.9
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -191,6 +191,12 @@ For every update of the plugin, you will be notified of the installed plugins pa
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
194
  = 2.0.9 =
195
 
196
  * Fix - Removed cache flush helper functions
@@ -546,7 +552,6 @@ For every update of the plugin, you will be notified of the installed plugins pa
546
 
547
  == Upgrade Notice ==
548
 
549
- = 2.0.9 =
550
 
551
- * Fix - Removed cache flush helper functions
552
- * Tested ok with WordPress version 5.9
5
  Requires at least: 4.4.0
6
  Tested up to: 5.9
7
  Requires PHP: 5.6
8
+ Stable tag: 2.1.0
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
191
 
192
  == Changelog ==
193
 
194
+ = 2.1.0 =
195
+ *Release Date - 17 February 2022*
196
+
197
+ * Improved: Validation & escaping for Security Enhancement.
198
+
199
+
200
  = 2.0.9 =
201
 
202
  * Fix - Removed cache flush helper functions
552
 
553
  == Upgrade Notice ==
554
 
555
+ = 2.1.0 =
556
 
557
+ * Improved: Validation & escaping for Security Enhancement.
 
third-party/class-cookie-law-info-third-party.php CHANGED
@@ -12,7 +12,6 @@
12
  /**
13
  * Third party plugin compatibility.
14
  *
15
- *
16
  * @package Cookie_Law_Info
17
  * @subpackage Cookie_Law_Info/third-party
18
  * @author WebToffee <info@webtoffee.com>
@@ -23,11 +22,11 @@ class Cookie_Law_Info_Third_Party {
23
  * scripts list, Script folder and main file must be same as that of script name
24
  * Please check the `register_scripts` method for more details
25
  */
26
- private $scripts=array(
27
  'pixelyoursite',
28
  );
29
 
30
- public static $existing_scripts=array();
31
 
32
  /**
33
  * Initialize the class and set its properties.
@@ -35,23 +34,19 @@ class Cookie_Law_Info_Third_Party {
35
  * @since 1.7.2
36
  */
37
  public function __construct() {
38
-
39
  }
40
 
41
  /**
42
- * Registering third party scripts
43
- *
44
  */
45
- public function register_scripts()
46
- {
47
- foreach ($this->scripts as $script) //loop through script list and include its file
48
- {
49
- $script_file=plugin_dir_path( __FILE__ )."scripts/$script/$script.php";
50
- if(file_exists($script_file))
51
- {
52
- self::$existing_scripts[]=$script; //this is for module_exits checking
53
  require_once $script_file;
54
  }
55
  }
56
  }
57
- }
12
  /**
13
  * Third party plugin compatibility.
14
  *
 
15
  * @package Cookie_Law_Info
16
  * @subpackage Cookie_Law_Info/third-party
17
  * @author WebToffee <info@webtoffee.com>
22
  * scripts list, Script folder and main file must be same as that of script name
23
  * Please check the `register_scripts` method for more details
24
  */
25
+ private $scripts = array(
26
  'pixelyoursite',
27
  );
28
 
29
+ public static $existing_scripts = array();
30
 
31
  /**
32
  * Initialize the class and set its properties.
34
  * @since 1.7.2
35
  */
36
  public function __construct() {
37
+
38
  }
39
 
40
  /**
41
+ * Registering third party scripts
 
42
  */
43
+ public function register_scripts() {
44
+ foreach ( $this->scripts as $script ) {
45
+ $script_file = plugin_dir_path( __FILE__ ) . "scripts/$script/$script.php";
46
+ if ( file_exists( $script_file ) ) {
47
+ self::$existing_scripts[] = $script; // this is for module_exits checking
 
 
 
48
  require_once $script_file;
49
  }
50
  }
51
  }
52
+ }
third-party/scripts/pixelyoursite/pixelyoursite.php CHANGED
@@ -1,57 +1,51 @@
1
  <?php
2
  /**
3
  * Compatibility with PixelYourSite
 
4
  * @link http://www.pixelyoursite.com/
5
  * @since 1.7.2
6
  */
7
- if (!defined('ABSPATH')) {
8
- exit; // Exit if accessed directly.
9
  }
10
- class Cookie_Law_Info_PixelYourSite
11
- {
12
- public function __construct()
13
- {
14
- if($this->is_plugin_active())
15
- {
16
- $this->add_main_filter();
17
- }
18
- }
19
 
20
- /*
21
- *
22
- * Add main filter based on GDPR main cookie (accept/reject)
23
- * @since 1.7.2
24
- */
25
- private function add_main_filter()
26
- {
27
- $viewed_cookie="viewed_cookie_policy";
28
- $out_fn='__return_true'; //block it
29
- $out=true;
30
- if(isset($_COOKIE[$viewed_cookie]))
31
- {
32
- if($_COOKIE[$viewed_cookie]=='yes')
33
- {
34
- $out_fn='__return_false'; //remove blocking
35
- $out=false;
36
- }
37
- }
38
- add_filter('pys_disable_by_gdpr',$out_fn,10,2);
39
- return $out;
40
- }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
- /*
44
- *
45
- * Checks PixelYourSite plugin is active
46
- * @since 1.7.2
47
- */
48
- private function is_plugin_active()
49
- {
50
- if(!function_exists('is_plugin_active'))
51
- {
52
- include_once(ABSPATH.'wp-admin/includes/plugin.php');
53
- }
54
- return is_plugin_active('pixelyoursite-pro/pixelyoursite-pro.php') || is_plugin_active('pixelyoursite/facebook-pixel-master.php');
55
- }
56
  }
57
- new Cookie_Law_Info_PixelYourSite();
1
  <?php
2
  /**
3
  * Compatibility with PixelYourSite
4
+ *
5
  * @link http://www.pixelyoursite.com/
6
  * @since 1.7.2
7
  */
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
  }
11
+ class Cookie_Law_Info_PixelYourSite {
 
 
 
 
 
 
 
 
12
 
13
+ public function __construct() {
14
+ if ( $this->is_plugin_active() ) {
15
+ $this->add_main_filter();
16
+ }
17
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
+ /*
20
+ *
21
+ * Add main filter based on GDPR main cookie (accept/reject)
22
+ * @since 1.7.2
23
+ */
24
+ private function add_main_filter() {
25
+ $viewed_cookie = 'viewed_cookie_policy';
26
+ $out_fn = '__return_true'; // block it
27
+ $out = true;
28
+ if ( isset( $_COOKIE[ $viewed_cookie ] ) ) {
29
+ if ( $_COOKIE[ $viewed_cookie ] == 'yes' ) {
30
+ $out_fn = '__return_false'; // remove blocking
31
+ $out = false;
32
+ }
33
+ }
34
+ add_filter( 'pys_disable_by_gdpr', $out_fn, 10, 2 );
35
+ return $out;
36
+ }
37
 
38
+
39
+ /*
40
+ *
41
+ * Checks PixelYourSite plugin is active
42
+ * @since 1.7.2
43
+ */
44
+ private function is_plugin_active() {
45
+ if ( ! function_exists( 'is_plugin_active' ) ) {
46
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
47
+ }
48
+ return is_plugin_active( 'pixelyoursite-pro/pixelyoursite-pro.php' ) || is_plugin_active( 'pixelyoursite/facebook-pixel-master.php' );
49
+ }
 
50
  }
51
+ new Cookie_Law_Info_PixelYourSite();