Cookiebot | GDPR Compliant Cookie Consent and Notice - Version 3.11.1

Version Description

Download this release

Release Info

Developer aytac
Plugin Icon 128x128 Cookiebot | GDPR Compliant Cookie Consent and Notice
Version 3.11.1
Comparing to
See all releases

Code changes from version 3.10.1 to 3.11.1

Files changed (36) hide show
  1. addons/addons.json +6 -0
  2. addons/controller/addons/add-to-any/add-to-any.php +20 -30
  3. addons/controller/addons/embed-autocorrect/embed-autocorrect.php +225 -120
  4. addons/controller/addons/jetpack/visitor-cookies.php +15 -9
  5. addons/controller/addons/jetpack/widget/facebook-widget.php +7 -4
  6. addons/controller/addons/jetpack/widget/goodreads-widget.php +14 -8
  7. addons/controller/addons/jetpack/widget/google-maps-widget.php +20 -13
  8. addons/controller/addons/jetpack/widget/googleplus-badge-widget.php +7 -3
  9. addons/controller/addons/jetpack/widget/internet-defense-league-widget.php +15 -7
  10. addons/controller/addons/jetpack/widget/twitter-timeline-widget.php +10 -2
  11. addons/controller/addons/matomo/matomo.php +348 -0
  12. addons/controller/addons/wp-google-analytics-events/wp-google-analytics-events.php +333 -0
  13. addons/controller/plugin-controller.php +27 -20
  14. addons/cookiebot-addons-init.php +67 -60
  15. addons/lib/buffer/buffer-output-tag.php +6 -6
  16. addons/lib/buffer/buffer-output.php +5 -6
  17. addons/lib/cookie-consent.php +22 -13
  18. addons/lib/dependency-container.php +53 -0
  19. addons/lib/helper.php +146 -100
  20. addons/lib/script-loader-tag/script-loader-tag-interface.php +2 -2
  21. addons/lib/script-loader-tag/script-loader-tag.php +1 -0
  22. addons/lib/settings-service-interface.php +12 -12
  23. addons/lib/settings-service.php +36 -28
  24. addons/lib/theme-settings-service.php +4 -4
  25. addons/tests/integration/addons/test-wp-google-analytics-events.php +37 -0
  26. addons/tests/unit/test-cookie-consent.php +4 -2
  27. addons/view/admin/settings/available-addon-callback.php +80 -70
  28. addons/view/admin/settings/jetpack-addon-callback.php +24 -18
  29. addons/view/admin/settings/setting-page.php +1 -1
  30. cookiebot.php +1515 -1001
  31. langs/cookiebot-da_DK.mo +0 -0
  32. langs/cookiebot-da_DK.po +701 -152
  33. langs/cookiebot.pot +548 -178
  34. readme.txt +13 -2
  35. tests/bootstrap.php +1 -1
  36. widgets/cookiebot-declaration-widget.php +71 -30
addons/addons.json CHANGED
@@ -59,6 +59,9 @@
59
  "CAOS_Host_Analyticsjs_Local": {
60
  "class": "cookiebot_addons\\controller\\addons\\caos_host_analyticsjs_local\\CAOS_Host_Analyticsjs_Local"
61
  },
 
 
 
62
  "Ninja_Forms": {
63
  "class": "cookiebot_addons\\controller\\addons\\ninja_forms\\Ninja_Forms"
64
  },
@@ -101,5 +104,8 @@
101
  "Enfold": {
102
  "class": "cookiebot_addons\\controller\\addons\\enfold\\Enfold",
103
  "is_theme": true
 
 
 
104
  }
105
  }
59
  "CAOS_Host_Analyticsjs_Local": {
60
  "class": "cookiebot_addons\\controller\\addons\\caos_host_analyticsjs_local\\CAOS_Host_Analyticsjs_Local"
61
  },
62
+ "Matomo": {
63
+ "class": "cookiebot_addons\\controller\\addons\\matomo\\matomo"
64
+ },
65
  "Ninja_Forms": {
66
  "class": "cookiebot_addons\\controller\\addons\\ninja_forms\\Ninja_Forms"
67
  },
104
  "Enfold": {
105
  "class": "cookiebot_addons\\controller\\addons\\enfold\\Enfold",
106
  "is_theme": true
107
+ },
108
+ "Wp_Google_Analytics_Events": {
109
+ "class": "cookiebot_addons\\controller\\addons\\wp_google_analytics_events\\Wp_Google_Analytics_Events"
110
  }
111
  }
addons/controller/addons/add-to-any/add-to-any.php CHANGED
@@ -2,9 +2,6 @@
2
 
3
  namespace cookiebot_addons\controller\addons\add_to_any;
4
 
5
- use DOMDocument;
6
- use DOMXPath;
7
- use DOMElement;
8
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
9
  use cookiebot_addons\lib\Cookie_Consent_Interface;
10
  use cookiebot_addons\lib\Settings_Service_Interface;
@@ -51,7 +48,12 @@ class Add_To_Any implements Cookiebot_Addons_Interface {
51
  *
52
  * @since 1.3.0
53
  */
54
- public function __construct( Settings_Service_Interface $settings, Script_Loader_Tag_Interface $script_loader_tag, Cookie_Consent_Interface $cookie_consent, Buffer_Output_Interface $buffer_output ) {
 
 
 
 
 
55
  $this->settings = $settings;
56
  $this->script_loader_tag = $script_loader_tag;
57
  $this->cookie_consent = $cookie_consent;
@@ -73,13 +75,13 @@ class Add_To_Any implements Cookiebot_Addons_Interface {
73
  * @since 1.3.0
74
  */
75
  public function cookiebot_addon_add_to_any() {
76
-
77
- $this->buffer_output->add_tag( 'wp_head', 10, array(
78
- 'a2a_config' => $this->get_cookie_types()
79
  ), false );
80
 
81
  $this->buffer_output->add_tag( 'wp_footer', 10, array(
82
- 'a2a_config' => $this->get_cookie_types()
83
  ), false );
84
 
85
  $this->buffer_output->add_tag( 'pre_get_posts', 10, array(
@@ -105,31 +107,17 @@ class Add_To_Any implements Cookiebot_Addons_Interface {
105
  /**
106
  * Display a placeholder on elements with "addtoany_share_save_container" class name.
107
  *
108
- * @param string $content
109
  *
110
  * @return string
111
  */
112
  public function cookiebot_addon_add_to_any_content( $content ) {
113
- if ( ! class_exists( 'DOMDocument' ) || ! class_exists( 'DOMXPath' ) || ! class_exists( 'DOMElement' ) ) {
114
- return $content;
115
- }
116
-
117
  if ( $this->has_placeholder() && $this->is_placeholder_enabled() ) {
118
- $dom = new DOMDocument();
119
- $dom->loadHTML( $content );
120
- $finder = new DOMXPath( $dom );
121
- $nodes = $finder->query( "//*[contains(@class, 'addtoany_share_save_container')]" );
122
-
123
- $placeholder = $this->get_placeholder();
124
- $placeholder_element = $dom->createDocumentFragment();
125
- $placeholder_element->appendXML( '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_cookie_types() ) . '">' . $placeholder . '</div>' );
126
-
127
- foreach ( $nodes as $node ) {
128
- /* @var DOMElement $node */
129
- $node->appendChild( $placeholder_element );
130
- }
131
-
132
- $content = $dom->saveHTML();
133
  }
134
 
135
  return $content;
@@ -170,7 +158,8 @@ class Add_To_Any implements Cookiebot_Addons_Interface {
170
  * @since 1.8.0
171
  */
172
  public function get_placeholder( $src = '' ) {
173
- return $this->settings->get_placeholder( $this->get_option_name(), $this->get_default_placeholder(), cookiebot_addons_output_cookie_types( $this->get_cookie_types() ), $src );
 
174
  }
175
 
176
  /**
@@ -294,7 +283,8 @@ class Add_To_Any implements Cookiebot_Addons_Interface {
294
  * @since 1.8.0
295
  */
296
  public function get_extra_information() {
297
- return '<p>' . esc_html__( 'Blocks embedded videos from Youtube, Twitter, Vimeo and Facebook.', 'cookiebot-addons' ) . '</p>';
 
298
  }
299
 
300
  /**
2
 
3
  namespace cookiebot_addons\controller\addons\add_to_any;
4
 
 
 
 
5
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
  use cookiebot_addons\lib\Cookie_Consent_Interface;
7
  use cookiebot_addons\lib\Settings_Service_Interface;
48
  *
49
  * @since 1.3.0
50
  */
51
+ public function __construct(
52
+ Settings_Service_Interface $settings,
53
+ Script_Loader_Tag_Interface $script_loader_tag,
54
+ Cookie_Consent_Interface $cookie_consent,
55
+ Buffer_Output_Interface $buffer_output
56
+ ) {
57
  $this->settings = $settings;
58
  $this->script_loader_tag = $script_loader_tag;
59
  $this->cookie_consent = $cookie_consent;
75
  * @since 1.3.0
76
  */
77
  public function cookiebot_addon_add_to_any() {
78
+
79
+ $this->buffer_output->add_tag( 'wp_head', 10, array(
80
+ 'a2a_config' => $this->get_cookie_types(),
81
  ), false );
82
 
83
  $this->buffer_output->add_tag( 'wp_footer', 10, array(
84
+ 'a2a_config' => $this->get_cookie_types(),
85
  ), false );
86
 
87
  $this->buffer_output->add_tag( 'pre_get_posts', 10, array(
107
  /**
108
  * Display a placeholder on elements with "addtoany_share_save_container" class name.
109
  *
110
+ * @param string $content
111
  *
112
  * @return string
113
  */
114
  public function cookiebot_addon_add_to_any_content( $content ) {
 
 
 
 
115
  if ( $this->has_placeholder() && $this->is_placeholder_enabled() ) {
116
+ $pattern = '/(<div[^>]*class="[^"]*addtoany_share_save_container[^"]*"[^>]*>)/';
117
+ $placeholder_text = $this->get_placeholder();
118
+ $placeholder_class = cookiebot_addons_cookieconsent_optout( $this->get_cookie_types() );
119
+ $placeholder = '<div class="' . $placeholder_class . '">' . $placeholder_text . '</div>';
120
+ $content = preg_replace( $pattern, '$1' . $placeholder, $content );
 
 
 
 
 
 
 
 
 
 
121
  }
122
 
123
  return $content;
158
  * @since 1.8.0
159
  */
160
  public function get_placeholder( $src = '' ) {
161
+ return $this->settings->get_placeholder( $this->get_option_name(), $this->get_default_placeholder(),
162
+ cookiebot_addons_output_cookie_types( $this->get_cookie_types() ), $src );
163
  }
164
 
165
  /**
283
  * @since 1.8.0
284
  */
285
  public function get_extra_information() {
286
+ return '<p>' . esc_html__( 'Blocks embedded videos from Youtube, Twitter, Vimeo and Facebook.',
287
+ 'cookiebot-addons' ) . '</p>';
288
  }
289
 
290
  /**
addons/controller/addons/embed-autocorrect/embed-autocorrect.php CHANGED
@@ -81,34 +81,52 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
81
  public function cookiebot_addon_embed_autocorrect() {
82
 
83
  //add filters to handle autocorrection in content
84
- add_filter( 'the_content', array(
85
- $this,
86
- 'cookiebot_addon_embed_autocorrect_content',
87
- ), 1000 ); //Ensure it is executed as the last filter
 
 
 
 
88
 
89
  //add filters to handle autocorrection in widget text
90
- add_filter( 'widget_text', array(
91
- $this,
92
- 'cookiebot_addon_embed_autocorrect_content',
93
- ), 1000 ); //Ensure it is executed as the last filter
94
-
 
 
 
95
 
96
  //add fitler to handle video shortcodes
97
- add_filter( 'wp_video_shortcode', array(
98
- $this,
99
- 'cookiebot_addon_embed_autocorrect_handle_video',
100
- ), 1000 );
 
 
 
 
101
 
102
  //add fitler to handle audio shortcodes
103
- add_filter( 'wp_audio_shortcode', array(
104
- $this,
105
- 'cookiebot_addon_embed_autocorrect_handle_audio',
106
- ), 1000 );
 
 
 
 
107
 
108
- add_action( 'wp_head', array(
109
- $this,
110
- 'cookiebot_addon_embed_autocorrect_javascript',
111
- ) );
 
 
 
112
  }
113
 
114
  /**
@@ -120,21 +138,23 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
120
  $library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
121
  if ( $library === 'mediaelement' ) {
122
  ?>
123
- <style type="text/css">video.wp-video-shortcode__disabled, audio.wp-audio-shortcode__disabled {
124
- display: none;
125
- }</style>
126
- <script>
127
- window.addEventListener( 'CookiebotOnTagsExecuted', function ( e ) {
128
- if (<?php echo 'Cookiebot.consent.' . implode( ' && Cookiebot.consent.',
129
- $this->get_cookie_types() ); ?>) {
130
- jQuery( '.wp-video-shortcode__disabled' ).addClass( 'wp-video-shortcode' ).removeClass( 'wp-video-shortcode__disabled' );
131
- jQuery( '.wp-audio-shortcode__disabled' ).addClass( 'wp-audio-shortcode' ).removeClass( 'wp-audio-shortcode__disabled' );
132
- if ( window.wp && window.wp.mediaelement && window.wp.mediaelement.initialize ) {
133
- window.wp.mediaelement.initialize();
134
- }
135
- }
136
- }, false );
137
- </script><?php
 
 
138
  }
139
  }
140
 
@@ -154,15 +174,21 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
154
  $src = $matchSrc[1];
155
 
156
  //Replace - and add cookie consent notice.
157
- $adjusted = str_replace( '<script>',
 
158
  '<script type="text/plain" data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '">',
159
- $match );
 
160
 
161
  /**
162
  * Generate placeholder
163
  */
164
- $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source',
165
- $src ) );
 
 
 
 
166
 
167
  /**
168
  * Modify placeholder by Filter
@@ -171,11 +197,15 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
171
  * @param $src string Source attribute from the embedded video
172
  * @param $this array Array of required cookie types
173
  */
174
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
175
- $this->get_cookie_types() );
 
 
 
 
176
 
177
  $adjusted .= $placeholder;
178
- $content = str_replace( $match, $adjusted, $content );
179
 
180
  }
181
  unset( $matches );
@@ -192,15 +222,21 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
192
  $src = $matchSrc[1];
193
 
194
  //Replace - and add cookie consent notice.
195
- $adjusted = str_replace( '<script ',
 
196
  '<script type="text/plain" data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" ',
197
- $match );
 
198
 
199
  /**
200
  * Generate placeholder
201
  */
202
- $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source',
203
- $src ) );
 
 
 
 
204
 
205
  /**
206
  * Modify placeholder by Filter
@@ -209,20 +245,26 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
209
  * @param $src string Source attribute from the embedded video
210
  * @param $this array Array of required cookie types
211
  */
212
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
213
- $this->get_cookie_types() );
 
 
 
 
214
 
215
  $adjusted .= $placeholder;
216
- $content = str_replace( $match, $adjusted, $content );
217
 
218
  }
219
  unset( $matches );
220
 
221
-
222
  //Match all speakerdeck, slideshare, screencast, reverbnation, mixcloud, kickstarter,
223
  // dailymoition, collegehumor, cloudup, animoto, videopress, youtube, vimeo and facebook iframes.
224
- preg_match_all( $this->get_regex(),
225
- $content, $matches );
 
 
 
226
 
227
  foreach ( $matches[0] as $x => $match ) {
228
  /** Get the source attribute value */
@@ -236,13 +278,19 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
236
  }
237
 
238
  /** Replace - and add cookie consent notice. */
239
- $adjusted = str_replace( ' src=',
 
240
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
241
- $match );
 
242
 
243
  /** Generate placeholder */
244
- $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source',
245
- $src ) );
 
 
 
 
246
 
247
  /**
248
  * Modify placeholder by Filter
@@ -251,26 +299,39 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
251
  * @param $src string Source attribute from the embedded video
252
  * @param $this array Array of required cookie types
253
  */
254
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
255
- $this->get_cookie_types() );
 
 
 
 
256
 
257
  $adjusted .= $placeholder;
258
- $content = str_replace( $match, $adjusted, $content );
259
  }
260
 
261
  unset( $matches );
262
- preg_match_all( '/<script.*(instagram|twitter|issuu|imgur|redditmedia\.com|tiktok\.com|polldaddy|tumblr)+.*<\/script>/mi',
263
- $content, $matches );
 
 
 
264
  foreach ( $matches[0] as $x => $match ) {
265
  //Replace - and add cookie consent notice.
266
- $adjusted = str_replace( ' src=',
 
267
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
268
- $match );
 
269
  /**
270
  * Generate placeholder
271
  */
272
- $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source',
273
- $src ) );
 
 
 
 
274
  /**
275
  * Modify placeholder by Filter
276
  *
@@ -278,9 +339,13 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
278
  * @param $src string Source attribute from the embedded video
279
  * @param $this array Array of required cookie types
280
  */
281
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
282
- $this->get_cookie_types() );
283
- $adjusted .= $placeholder;
 
 
 
 
284
  $content = str_replace( $match, $adjusted, $content );
285
  }
286
  unset( $matches );
@@ -304,21 +369,27 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
304
 
305
  // allow same domain embeds without cookieconsent
306
  $src_domain = cookiebot_addons_get_domain_from_url( $src );
307
- if( cookiebot_addons_get_home_url_domain() === $src_domain ) {
308
- return $output;
309
  }
310
 
311
  /**
312
  * Generate placeholder
313
  */
314
  $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source', $src ) );
315
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
316
- $this->get_cookie_types() );
 
 
 
 
317
 
318
- $output = str_replace( 'wp-video-shortcode', 'wp-video-shortcode__disabled', $output );
319
- $output = str_replace( ' src=',
 
320
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
321
- $output );
 
322
  $output .= $placeholder;
323
 
324
  return $output;
@@ -342,13 +413,19 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
342
  * Generate placeholder
343
  */
344
  $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source', $src ) );
345
- $placeholder = apply_filters( 'cookiebot_addons_embed_placeholder', $placeholder, $src,
346
- $this->get_cookie_types() );
 
 
 
 
347
 
348
- $output = str_replace( 'wp-audio-shortcode', 'wp-audio-shortcode__disabled', $output );
349
- $output = str_replace( ' src=',
 
350
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
351
- $output );
 
352
  $output .= $placeholder;
353
 
354
  return $output;
@@ -362,7 +439,7 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
362
  * @return string
363
  */
364
  public function generate_placeholder_with_src( $src = '' ) {
365
- $cookieContentNotice = '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_cookie_types() ) . '">';
366
  $cookieContentNotice .= $this->get_placeholder( $src );
367
  $cookieContentNotice .= '</div>';
368
 
@@ -484,8 +561,12 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
484
  * @since 1.8.0
485
  */
486
  public function get_placeholder( $src = '' ) {
487
- return $this->settings->get_placeholder( $this->get_option_name(), $this->get_default_placeholder(),
488
- cookiebot_addons_output_cookie_types( $this->get_cookie_types() ), $src );
 
 
 
 
489
  }
490
 
491
  /**
@@ -529,8 +610,10 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
529
  * @since 1.8.0
530
  */
531
  public function get_extra_information() {
532
- return '<p>' . esc_html__( 'Blocks embedded videos from Youtube, Twitter, Vimeo and Facebook.',
533
- 'cookiebot-addons' ) . '</p>';
 
 
534
  }
535
 
536
  /**
@@ -593,8 +676,10 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
593
  * @since 2.4.6
594
  */
595
  private function get_regex() {
596
- return apply_filters( 'cookiebot_embed_regex',
597
- $this->settings->get_addon_regex( $this->get_option_name(), $this->get_default_regex() ) );
 
 
598
  }
599
 
600
  /**
@@ -605,8 +690,10 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
605
  * @since 2.4.6
606
  */
607
  private function get_default_regex() {
608
- return apply_filters( 'cookiebot_embed_default_regex',
609
- '/<iframe[^>]* src=("|\').*(facebook\.com|youtu\.be|youtube\.com|youtube-nocookie\.com|player\.vimeo\.com|soundcloud\.com|spotify\.com|speakerdeck\.com|slideshare\.net|screencast\.com|reverbnation\.com|mixcloud\.com|cloudup\.com|animoto\.com|video\.wordpress\.com|embed\.ted\.com|embedly\.com|kickstarter\.com).*[^>].*>.*?<\/iframe>/mi' );
 
 
610
  }
611
 
612
  /**
@@ -627,40 +714,58 @@ class Embed_Autocorrect implements Cookiebot_Addons_Interface {
627
  */
628
  public function extra_available_addon_option() {
629
  ?>
630
- <div class="show_advanced_options">
631
- <button class="button button-secondary"><?php esc_html_e( 'Show advanced options',
632
- 'cookiebot-addons' ); ?></button>
633
- <span class="help-tip"
634
- title="<?php echo esc_html__( 'This is for more advanced users.', 'cookiebot-addons' ); ?>"></span>
635
- </div>
636
- <div class="advanced_options">
637
-
638
- <label for="embed_regex"><?php esc_html_e( 'Regex:', 'cookiebot-addons' ); ?></label>
639
- <textarea
640
- id="embed_regex"
641
- cols="80"
642
- rows="5"
643
- name="cookiebot_available_addons[<?php echo $this->get_option_name(); ?>][regex]"
644
- disabled
645
- ><?php echo esc_html( $this->get_regex() ); ?></textarea>
 
 
 
 
 
 
646
 
647
  <?php if ( $this->is_regex_default() ) : ?>
648
- <button id="edit_embed_regex" class="button"><?php esc_html_e( 'Edit regex',
649
- 'cookiebot-addons' ); ?></button>
 
 
 
 
 
 
650
  <?php endif; ?>
651
 
652
- <button
653
- id="btn_default_embed_regex"
654
- class="button<?php echo ( $this->is_regex_default() ) ? ' hidden' : ''; ?>"
655
- type="button"
656
- value="Reset to default regex"><?php esc_html_e( 'Reset to default regex',
657
- 'cookiebot-addons' ); ?></button>
658
- <input
659
- type="hidden"
660
- name="default_embed_regex"
661
- id="default_embed_regex"
662
- value="<?php echo esc_html( $this->get_default_regex() ); ?>"/>
663
- </div>
 
 
 
 
 
 
664
  <?php
665
  }
666
 
81
  public function cookiebot_addon_embed_autocorrect() {
82
 
83
  //add filters to handle autocorrection in content
84
+ add_filter(
85
+ 'the_content',
86
+ array(
87
+ $this,
88
+ 'cookiebot_addon_embed_autocorrect_content',
89
+ ),
90
+ 1000
91
+ ); //Ensure it is executed as the last filter
92
 
93
  //add filters to handle autocorrection in widget text
94
+ add_filter(
95
+ 'widget_text',
96
+ array(
97
+ $this,
98
+ 'cookiebot_addon_embed_autocorrect_content',
99
+ ),
100
+ 1000
101
+ ); //Ensure it is executed as the last filter
102
 
103
  //add fitler to handle video shortcodes
104
+ add_filter(
105
+ 'wp_video_shortcode',
106
+ array(
107
+ $this,
108
+ 'cookiebot_addon_embed_autocorrect_handle_video',
109
+ ),
110
+ 1000
111
+ );
112
 
113
  //add fitler to handle audio shortcodes
114
+ add_filter(
115
+ 'wp_audio_shortcode',
116
+ array(
117
+ $this,
118
+ 'cookiebot_addon_embed_autocorrect_handle_audio',
119
+ ),
120
+ 1000
121
+ );
122
 
123
+ add_action(
124
+ 'wp_head',
125
+ array(
126
+ $this,
127
+ 'cookiebot_addon_embed_autocorrect_javascript',
128
+ )
129
+ );
130
  }
131
 
132
  /**
138
  $library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
139
  if ( $library === 'mediaelement' ) {
140
  ?>
141
+ <style type="text/css">video.wp-video-shortcode__disabled, audio.wp-audio-shortcode__disabled {
142
+ display: none;
143
+ }</style>
144
+ <script>
145
+ window.addEventListener( 'CookiebotOnTagsExecuted', function ( e ) {
146
+ <?php $cookie_types = implode( ',', $this->get_cookie_types() ); ?>
147
+ const cookieTypes = '<?php echo esc_js( $cookie_types ); ?>'
148
+ if ( cookieTypes.split(',').every( (cookie_type) => Cookiebot.consent[cookie_type] ) ) {
149
+ jQuery( '.wp-video-shortcode__disabled' ).addClass( 'wp-video-shortcode' ).removeClass( 'wp-video-shortcode__disabled' );
150
+ jQuery( '.wp-audio-shortcode__disabled' ).addClass( 'wp-audio-shortcode' ).removeClass( 'wp-audio-shortcode__disabled' );
151
+ if ( window.wp && window.wp.mediaelement && window.wp.mediaelement.initialize ) {
152
+ window.wp.mediaelement.initialize();
153
+ }
154
+ }
155
+ }, false );
156
+ </script>
157
+ <?php
158
  }
159
  }
160
 
174
  $src = $matchSrc[1];
175
 
176
  //Replace - and add cookie consent notice.
177
+ $adjusted = str_replace(
178
+ '<script>',
179
  '<script type="text/plain" data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '">',
180
+ $match
181
+ );
182
 
183
  /**
184
  * Generate placeholder
185
  */
186
+ $placeholder = $this->generate_placeholder_with_src(
187
+ apply_filters(
188
+ 'cookiebot_addons_embed_source',
189
+ $src
190
+ )
191
+ );
192
 
193
  /**
194
  * Modify placeholder by Filter
197
  * @param $src string Source attribute from the embedded video
198
  * @param $this array Array of required cookie types
199
  */
200
+ $placeholder = apply_filters(
201
+ 'cookiebot_addons_embed_placeholder',
202
+ $placeholder,
203
+ $src,
204
+ $this->get_cookie_types()
205
+ );
206
 
207
  $adjusted .= $placeholder;
208
+ $content = str_replace( $match, $adjusted, $content );
209
 
210
  }
211
  unset( $matches );
222
  $src = $matchSrc[1];
223
 
224
  //Replace - and add cookie consent notice.
225
+ $adjusted = str_replace(
226
+ '<script ',
227
  '<script type="text/plain" data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" ',
228
+ $match
229
+ );
230
 
231
  /**
232
  * Generate placeholder
233
  */
234
+ $placeholder = $this->generate_placeholder_with_src(
235
+ apply_filters(
236
+ 'cookiebot_addons_embed_source',
237
+ $src
238
+ )
239
+ );
240
 
241
  /**
242
  * Modify placeholder by Filter
245
  * @param $src string Source attribute from the embedded video
246
  * @param $this array Array of required cookie types
247
  */
248
+ $placeholder = apply_filters(
249
+ 'cookiebot_addons_embed_placeholder',
250
+ $placeholder,
251
+ $src,
252
+ $this->get_cookie_types()
253
+ );
254
 
255
  $adjusted .= $placeholder;
256
+ $content = str_replace( $match, $adjusted, $content );
257
 
258
  }
259
  unset( $matches );
260
 
 
261
  //Match all speakerdeck, slideshare, screencast, reverbnation, mixcloud, kickstarter,
262
  // dailymoition, collegehumor, cloudup, animoto, videopress, youtube, vimeo and facebook iframes.
263
+ preg_match_all(
264
+ $this->get_regex(),
265
+ $content,
266
+ $matches
267
+ );
268
 
269
  foreach ( $matches[0] as $x => $match ) {
270
  /** Get the source attribute value */
278
  }
279
 
280
  /** Replace - and add cookie consent notice. */
281
+ $adjusted = str_replace(
282
+ ' src=',
283
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
284
+ $match
285
+ );
286
 
287
  /** Generate placeholder */
288
+ $placeholder = $this->generate_placeholder_with_src(
289
+ apply_filters(
290
+ 'cookiebot_addons_embed_source',
291
+ $src
292
+ )
293
+ );
294
 
295
  /**
296
  * Modify placeholder by Filter
299
  * @param $src string Source attribute from the embedded video
300
  * @param $this array Array of required cookie types
301
  */
302
+ $placeholder = apply_filters(
303
+ 'cookiebot_addons_embed_placeholder',
304
+ $placeholder,
305
+ $src,
306
+ $this->get_cookie_types()
307
+ );
308
 
309
  $adjusted .= $placeholder;
310
+ $content = str_replace( $match, $adjusted, $content );
311
  }
312
 
313
  unset( $matches );
314
+ preg_match_all(
315
+ '/<script.*(instagram|twitter|issuu|imgur|redditmedia\.com|tiktok\.com|polldaddy|tumblr)+.*<\/script>/mi',
316
+ $content,
317
+ $matches
318
+ );
319
  foreach ( $matches[0] as $x => $match ) {
320
  //Replace - and add cookie consent notice.
321
+ $adjusted = str_replace(
322
+ ' src=',
323
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
324
+ $match
325
+ );
326
  /**
327
  * Generate placeholder
328
  */
329
+ $placeholder = $this->generate_placeholder_with_src(
330
+ apply_filters(
331
+ 'cookiebot_addons_embed_source',
332
+ $src
333
+ )
334
+ );
335
  /**
336
  * Modify placeholder by Filter
337
  *
339
  * @param $src string Source attribute from the embedded video
340
  * @param $this array Array of required cookie types
341
  */
342
+ $placeholder = apply_filters(
343
+ 'cookiebot_addons_embed_placeholder',
344
+ $placeholder,
345
+ $src,
346
+ $this->get_cookie_types()
347
+ );
348
+ $adjusted .= $placeholder;
349
  $content = str_replace( $match, $adjusted, $content );
350
  }
351
  unset( $matches );
369
 
370
  // allow same domain embeds without cookieconsent
371
  $src_domain = cookiebot_addons_get_domain_from_url( $src );
372
+ if ( cookiebot_addons_get_home_url_domain() === $src_domain ) {
373
+ return $output;
374
  }
375
 
376
  /**
377
  * Generate placeholder
378
  */
379
  $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source', $src ) );
380
+ $placeholder = apply_filters(
381
+ 'cookiebot_addons_embed_placeholder',
382
+ $placeholder,
383
+ $src,
384
+ $this->get_cookie_types()
385
+ );
386
 
387
+ $output = str_replace( 'wp-video-shortcode', 'wp-video-shortcode__disabled', $output );
388
+ $output = str_replace(
389
+ ' src=',
390
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
391
+ $output
392
+ );
393
  $output .= $placeholder;
394
 
395
  return $output;
413
  * Generate placeholder
414
  */
415
  $placeholder = $this->generate_placeholder_with_src( apply_filters( 'cookiebot_addons_embed_source', $src ) );
416
+ $placeholder = apply_filters(
417
+ 'cookiebot_addons_embed_placeholder',
418
+ $placeholder,
419
+ $src,
420
+ $this->get_cookie_types()
421
+ );
422
 
423
+ $output = str_replace( 'wp-audio-shortcode', 'wp-audio-shortcode__disabled', $output );
424
+ $output = str_replace(
425
+ ' src=',
426
  ' data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->get_cookie_types() ) . '" data-src=',
427
+ $output
428
+ );
429
  $output .= $placeholder;
430
 
431
  return $output;
439
  * @return string
440
  */
441
  public function generate_placeholder_with_src( $src = '' ) {
442
+ $cookieContentNotice = '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_cookie_types() ) . '">';
443
  $cookieContentNotice .= $this->get_placeholder( $src );
444
  $cookieContentNotice .= '</div>';
445
 
561
  * @since 1.8.0
562
  */
563
  public function get_placeholder( $src = '' ) {
564
+ return $this->settings->get_placeholder(
565
+ $this->get_option_name(),
566
+ $this->get_default_placeholder(),
567
+ cookiebot_addons_output_cookie_types( $this->get_cookie_types() ),
568
+ $src
569
+ );
570
  }
571
 
572
  /**
610
  * @since 1.8.0
611
  */
612
  public function get_extra_information() {
613
+ return '<p>' . esc_html__(
614
+ 'Blocks embedded videos from Youtube, Twitter, Vimeo and Facebook.',
615
+ 'cookiebot-addons'
616
+ ) . '</p>';
617
  }
618
 
619
  /**
676
  * @since 2.4.6
677
  */
678
  private function get_regex() {
679
+ return apply_filters(
680
+ 'cookiebot_embed_regex',
681
+ $this->settings->get_addon_regex( $this->get_option_name(), $this->get_default_regex() )
682
+ );
683
  }
684
 
685
  /**
690
  * @since 2.4.6
691
  */
692
  private function get_default_regex() {
693
+ return apply_filters(
694
+ 'cookiebot_embed_default_regex',
695
+ '/<iframe[^>]* src=("|\').*(facebook\.com|youtu\.be|youtube\.com|youtube-nocookie\.com|player\.vimeo\.com|soundcloud\.com|spotify\.com|speakerdeck\.com|slideshare\.net|screencast\.com|reverbnation\.com|mixcloud\.com|cloudup\.com|animoto\.com|video\.WordPress\.com|embed\.ted\.com|embedly\.com|kickstarter\.com).*[^>].*>.*?<\/iframe>/mi'
696
+ );
697
  }
698
 
699
  /**
714
  */
715
  public function extra_available_addon_option() {
716
  ?>
717
+ <div class="show_advanced_options">
718
+ <button class="button button-secondary">
719
+ <?php
720
+ esc_html_e(
721
+ 'Show advanced options',
722
+ 'cookiebot-addons'
723
+ );
724
+ ?>
725
+ </button>
726
+ <span class="help-tip"
727
+ title="<?php echo esc_html__( 'This is for more advanced users.', 'cookiebot-addons' ); ?>"></span>
728
+ </div>
729
+ <div class="advanced_options">
730
+
731
+ <label for="embed_regex"><?php esc_html_e( 'Regex:', 'cookiebot-addons' ); ?></label>
732
+ <textarea
733
+ id="embed_regex"
734
+ cols="80"
735
+ rows="5"
736
+ name="cookiebot_available_addons[<?php echo esc_attr( $this->get_option_name() ); ?>][regex]"
737
+ disabled
738
+ ><?php echo esc_html( $this->get_regex() ); ?></textarea>
739
 
740
  <?php if ( $this->is_regex_default() ) : ?>
741
+ <button id="edit_embed_regex" class="button">
742
+ <?php
743
+ esc_html_e(
744
+ 'Edit regex',
745
+ 'cookiebot-addons'
746
+ );
747
+ ?>
748
+ </button>
749
  <?php endif; ?>
750
 
751
+ <button
752
+ id="btn_default_embed_regex"
753
+ class="button<?php echo ( $this->is_regex_default() ) ? ' hidden' : ''; ?>"
754
+ type="button"
755
+ value="Reset to default regex">
756
+ <?php
757
+ esc_html_e(
758
+ 'Reset to default regex',
759
+ 'cookiebot-addons'
760
+ );
761
+ ?>
762
+ </button>
763
+ <input
764
+ type="hidden"
765
+ name="default_embed_regex"
766
+ id="default_embed_regex"
767
+ value="<?php echo esc_html( $this->get_default_regex() ); ?>"/>
768
+ </div>
769
  <?php
770
  }
771
 
addons/controller/addons/jetpack/visitor-cookies.php CHANGED
@@ -126,7 +126,7 @@ class Visitor_Cookies implements Jetpack_Widget_Interface {
126
  * @return string
127
  */
128
  public function get_default_placeholder() {
129
- return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this video.';
130
  }
131
 
132
  /**
@@ -171,7 +171,7 @@ class Visitor_Cookies implements Jetpack_Widget_Interface {
171
  * @since 1.8.0
172
  */
173
  public function get_widget_placeholder() {
174
- return $this->settings->get_widget_placeholder( $this->widget_option, $this->get_widget_option_name(), $this->get_default_placeholder(), $this->get_widget_cookie_types() );
175
  }
176
 
177
  /**
@@ -180,9 +180,12 @@ class Visitor_Cookies implements Jetpack_Widget_Interface {
180
  * @since 1.2.0
181
  */
182
  protected function disable_comment_subscriptions() {
183
- add_filter( 'comment_cookie_lifetime', function ( $time ) {
184
- return 0;
185
- } );
 
 
 
186
  }
187
 
188
  /**
@@ -212,7 +215,7 @@ class Visitor_Cookies implements Jetpack_Widget_Interface {
212
  cookiebot_addons_remove_class_action( 'comment_post', 'Highlander_Comments_Base', 'set_comment_cookies' );
213
 
214
  /**
215
- * Remove action comment cookies in wordpress core
216
  *
217
  * we have to remove this action, because it does manually add the cookie.
218
  */
@@ -251,9 +254,12 @@ class Visitor_Cookies implements Jetpack_Widget_Interface {
251
  * @since 1.2.0
252
  */
253
  public function view_accept_preferences_consent() {
254
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">
255
- ' . $this->get_default_placeholder() . '
256
- </div>';
 
 
 
257
  }
258
 
259
  /**
126
  * @return string
127
  */
128
  public function get_default_placeholder() {
129
+ return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to allow tracking.';
130
  }
131
 
132
  /**
171
  * @since 1.8.0
172
  */
173
  public function get_widget_placeholder() {
174
+ return $this->settings->get_widget_placeholder( $this->widget_option, $this->get_widget_option_name(), $this->get_default_placeholder(), cookiebot_addons_output_cookie_types( $this->get_widget_cookie_types() ) );
175
  }
176
 
177
  /**
180
  * @since 1.2.0
181
  */
182
  protected function disable_comment_subscriptions() {
183
+ add_filter(
184
+ 'comment_cookie_lifetime',
185
+ function ( $time ) {
186
+ return 0;
187
+ }
188
+ );
189
  }
190
 
191
  /**
215
  cookiebot_addons_remove_class_action( 'comment_post', 'Highlander_Comments_Base', 'set_comment_cookies' );
216
 
217
  /**
218
+ * Remove action comment cookies in WordPress core
219
  *
220
  * we have to remove this action, because it does manually add the cookie.
221
  */
254
  * @since 1.2.0
255
  */
256
  public function view_accept_preferences_consent() {
257
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() );
258
+ ?>
259
+ <div class="<?php echo esc_attr( $class_name ); ?>">
260
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
261
+ </div>
262
+ <?php
263
  }
264
 
265
  /**
addons/controller/addons/jetpack/widget/facebook-widget.php CHANGED
@@ -213,11 +213,14 @@ class Facebook_Widget {
213
  * @since 1.6.0
214
  */
215
  public function cookie_consent_div( $view, $widget ) {
216
- if ( $widget == 'facebook-likebox' && $view == 'widget_view' ) {
217
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
218
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">
219
- ' . $this->get_widget_placeholder() . '
220
- </div>';
 
 
 
221
  }
222
  }
223
  }
213
  * @since 1.6.0
214
  */
215
  public function cookie_consent_div( $view, $widget ) {
216
+ if ( $widget === 'facebook-likebox' && $view === 'widget_view' ) {
217
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
218
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() );
219
+ ?>
220
+ <div class="<?php echo esc_attr( $class_name ); ?>">
221
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
222
+ </div>
223
+ <?php
224
  }
225
  }
226
  }
addons/controller/addons/jetpack/widget/goodreads-widget.php CHANGED
@@ -213,7 +213,7 @@ class Goodreads_Widget implements Jetpack_Widget_Interface {
213
  public function display_div_message_to_go_to_consent_settings( $widget ) {
214
  $callback = $widget['callback'][0];
215
 
216
- if ( $callback->id_base == 'wpcom-goodreads' ) {
217
  ob_start( array( $this, 'manipulate_script' ) );
218
  }
219
  }
@@ -224,9 +224,12 @@ class Goodreads_Widget implements Jetpack_Widget_Interface {
224
  * @since 1.2.0
225
  */
226
  public function output_manipulated() {
227
- add_action( 'dynamic_sidebar_after', function ( $index ) {
228
- ob_end_flush();
229
- } );
 
 
 
230
  }
231
 
232
  /**
@@ -269,11 +272,14 @@ class Goodreads_Widget implements Jetpack_Widget_Interface {
269
  * @since 1.6.0
270
  */
271
  public function cookie_consent_div( $view, $widget ) {
272
- if ( $widget == 'goodreads' && $view == 'widget_view' ) {
273
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
274
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">
275
- ' . $this->get_widget_placeholder() . '
276
- </div>';
 
 
 
277
  }
278
  }
279
  }
213
  public function display_div_message_to_go_to_consent_settings( $widget ) {
214
  $callback = $widget['callback'][0];
215
 
216
+ if ( $callback->id_base === 'wpcom-goodreads' ) {
217
  ob_start( array( $this, 'manipulate_script' ) );
218
  }
219
  }
224
  * @since 1.2.0
225
  */
226
  public function output_manipulated() {
227
+ add_action(
228
+ 'dynamic_sidebar_after',
229
+ function ( $index ) {
230
+ ob_end_flush();
231
+ }
232
+ );
233
  }
234
 
235
  /**
272
  * @since 1.6.0
273
  */
274
  public function cookie_consent_div( $view, $widget ) {
275
+ if ( $widget === 'goodreads' && $view === 'widget_view' ) {
276
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
277
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() );
278
+ ?>
279
+ <div class="<?php echo esc_attr( $class_name ); ?>">
280
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
281
+ </div>
282
+ <?php
283
  }
284
  }
285
  }
addons/controller/addons/jetpack/widget/google-maps-widget.php CHANGED
@@ -231,22 +231,26 @@ class Google_Maps_Widget implements Jetpack_Widget_Interface {
231
  /**
232
  * Pattern to get all iframes
233
  */
234
- $pattern = "/\<iframe(.*?)?\>(.|\s)*?\<\/iframe\>/i";
235
 
236
  /**
237
  * Get all scripts and add cookieconsent if it does match with the criterion
238
  */
239
- $updated_scripts = preg_replace_callback( $pattern, function ( $matches ) {
 
 
240
 
241
- $data = ( isset( $matches[0] ) ) ? $matches[0] : '';
242
 
243
- $data = str_replace( 'src=', 'data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->cookie_types ) . '" data-src=', $data );
244
 
245
- /**
246
- * Return updated iframe tag
247
- */
248
- return $data;
249
- }, $buffer );
 
 
250
 
251
  /**
252
  * Set cache for 15 minutes
@@ -266,11 +270,14 @@ class Google_Maps_Widget implements Jetpack_Widget_Interface {
266
  * @since 1.6.0
267
  */
268
  public function cookie_consent_div( $view, $widget ) {
269
- if ( $widget == 'contact_info' && $view == 'widget_view' ) {
270
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
271
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">
272
- ' . $this->get_widget_placeholder() . '
273
- </div>';
 
 
 
274
  }
275
  }
276
  }
231
  /**
232
  * Pattern to get all iframes
233
  */
234
+ $pattern = '/\<iframe(.*?)?\>(.|\s)*?\<\/iframe\>/i';
235
 
236
  /**
237
  * Get all scripts and add cookieconsent if it does match with the criterion
238
  */
239
+ $updated_scripts = preg_replace_callback(
240
+ $pattern,
241
+ function ( $matches ) {
242
 
243
+ $data = ( isset( $matches[0] ) ) ? $matches[0] : '';
244
 
245
+ $data = str_replace( 'src=', 'data-cookieconsent="' . cookiebot_addons_output_cookie_types( $this->cookie_types ) . '" data-src=', $data );
246
 
247
+ /**
248
+ * Return updated iframe tag
249
+ */
250
+ return $data;
251
+ },
252
+ $buffer
253
+ );
254
 
255
  /**
256
  * Set cache for 15 minutes
270
  * @since 1.6.0
271
  */
272
  public function cookie_consent_div( $view, $widget ) {
273
+ if ( $widget === 'contact_info' && $view === 'widget_view' ) {
274
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
275
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() );
276
+ ?>
277
+ <div class="<?php esc_attr( $class_name ); ?>">
278
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
279
+ </div>
280
+ <?php
281
  }
282
  }
283
  }
addons/controller/addons/jetpack/widget/googleplus-badge-widget.php CHANGED
@@ -206,11 +206,15 @@ class Googleplus_Badge_Widget {
206
  * @since 1.2.0
207
  */
208
  public function display_div_message_to_go_to_consent_settings( $view, $widget ) {
209
- if ( $widget == 'googleplus-badge' && $view == 'widget_view' ) {
210
  if ( is_array( $this->cookie_types ) && count( $this->cookie_types ) > 0 ) {
211
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->cookie_types ) . '">' . $this->get_widget_placeholder() . '</div>';
 
 
 
 
 
212
  }
213
-
214
  }
215
  }
216
 
206
  * @since 1.2.0
207
  */
208
  public function display_div_message_to_go_to_consent_settings( $view, $widget ) {
209
+ if ( $widget === 'googleplus-badge' && $view === 'widget_view' ) {
210
  if ( is_array( $this->cookie_types ) && count( $this->cookie_types ) > 0 ) {
211
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->cookie_types );
212
+ ?>
213
+ <div class="<?php echo esc_attr( $class_name ); ?>">
214
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
215
+ </div>
216
+ <?php
217
  }
 
218
  }
219
  }
220
 
addons/controller/addons/jetpack/widget/internet-defense-league-widget.php CHANGED
@@ -88,9 +88,14 @@ class Internet_Defense_league_Widget implements Jetpack_Widget_Interface {
88
  *
89
  * @since 1.2.0
90
  */
91
- $this->buffer_output->add_tag( 'wp_footer', 10, array(
92
- 'window._idl' => $this->get_widget_cookie_types(),
93
- ), false );
 
 
 
 
 
94
 
95
  /**
96
  * Display placeholder if allowed in the backend settings
@@ -201,11 +206,14 @@ class Internet_Defense_league_Widget implements Jetpack_Widget_Interface {
201
  * @since 1.6.0
202
  */
203
  public function cookie_consent_div( $view, $widget ) {
204
- if ( $widget == 'internet_defense_league' && $view == 'widget_view' ) {
205
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
206
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">
207
- ' . $this->get_widget_placeholder() . '
208
- </div>';
 
 
 
209
  }
210
  }
211
  }
88
  *
89
  * @since 1.2.0
90
  */
91
+ $this->buffer_output->add_tag(
92
+ 'wp_footer',
93
+ 10,
94
+ array(
95
+ 'window._idl' => $this->get_widget_cookie_types(),
96
+ ),
97
+ false
98
+ );
99
 
100
  /**
101
  * Display placeholder if allowed in the backend settings
206
  * @since 1.6.0
207
  */
208
  public function cookie_consent_div( $view, $widget ) {
209
+ if ( $widget === 'internet_defense_league' && $view === 'widget_view' ) {
210
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
211
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() );
212
+ ?>
213
+ <div class="<?php echo esc_attr( $class_name ); ?>">
214
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
215
+ </div>
216
+ <?php
217
  }
218
  }
219
  }
addons/controller/addons/jetpack/widget/twitter-timeline-widget.php CHANGED
@@ -95,6 +95,9 @@ class Twitter_Timeline_Widget {
95
  }
96
  }
97
 
 
 
 
98
  public function get_label() {
99
  return 'Twitter timeline';
100
  }
@@ -202,9 +205,14 @@ class Twitter_Timeline_Widget {
202
  * @since 1.2.0
203
  */
204
  public function display_div_message_to_go_to_consent_settings( $view, $widget ) {
205
- if ( $widget == 'twitter_timeline' && $view == 'widget_view' ) {
206
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
207
- echo '<div class="' . cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() ) . '">' . $this->get_widget_placeholder() . '</div>';
 
 
 
 
 
208
  }
209
  }
210
  }
95
  }
96
  }
97
 
98
+ /**
99
+ * @return string
100
+ */
101
  public function get_label() {
102
  return 'Twitter timeline';
103
  }
205
  * @since 1.2.0
206
  */
207
  public function display_div_message_to_go_to_consent_settings( $view, $widget ) {
208
+ if ( $widget === 'twitter_timeline' && $view === 'widget_view' ) {
209
  if ( is_array( $this->get_widget_cookie_types() ) && count( $this->get_widget_cookie_types() ) > 0 ) {
210
+ $class_name = cookiebot_addons_cookieconsent_optout( $this->get_widget_cookie_types() )
211
+ ?>
212
+ <div class="<?php echo esc_attr( $class_name ); ?>">
213
+ <?php echo $this->get_widget_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
214
+ </div>
215
+ <?php
216
  }
217
  }
218
  }
addons/controller/addons/matomo/matomo.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace cookiebot_addons\controller\addons\matomo;
4
+
5
+ use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
+ use cookiebot_addons\lib\Cookie_Consent_Interface;
7
+ use cookiebot_addons\lib\Settings_Service_Interface;
8
+ use cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag_Interface;
9
+ use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
10
+
11
+ /**
12
+ * Class Matomo
13
+ * @package cookiebot_addons\controller\addons\wp_mautic
14
+ */
15
+ class Matomo implements Cookiebot_Addons_Interface {
16
+
17
+ /**
18
+ * @var Settings_Service_Interface
19
+ *
20
+ * @since 1.5.0
21
+ */
22
+ protected $settings;
23
+
24
+ /**
25
+ * @var Script_Loader_Tag_Interface
26
+ *
27
+ * @since 1.5.0
28
+ */
29
+ protected $script_loader_tag;
30
+
31
+ /**
32
+ * @var Cookie_Consent_Interface
33
+ *
34
+ * @since 1.5.0
35
+ */
36
+ public $cookie_consent;
37
+
38
+ /**
39
+ * @var Buffer_Output_Interface
40
+ *
41
+ * @since 1.5.0
42
+ */
43
+ protected $buffer_output;
44
+
45
+ /**
46
+ * constructor.
47
+ *
48
+ * @param $settings Settings_Service_Interface
49
+ * @param $script_loader_tag Script_Loader_Tag_Interface
50
+ * @param $cookie_consent Cookie_Consent_Interface
51
+ * @param $buffer_output Buffer_Output_Interface
52
+ *
53
+ * @since 1.5.0
54
+ */
55
+ public function __construct( Settings_Service_Interface $settings, Script_Loader_Tag_Interface $script_loader_tag, Cookie_Consent_Interface $cookie_consent, Buffer_Output_Interface $buffer_output ) {
56
+ $this->settings = $settings;
57
+ $this->script_loader_tag = $script_loader_tag;
58
+ $this->cookie_consent = $cookie_consent;
59
+ $this->buffer_output = $buffer_output;
60
+ }
61
+
62
+ /**
63
+ * Loads addon configuration
64
+ *
65
+ * @since 1.5.0
66
+ */
67
+ public function load_configuration() {
68
+ add_action( 'wp_loaded', array( $this, 'cookiebot_addon_matomo' ), 5 );
69
+ }
70
+
71
+ /**
72
+ * Disable scripts if state not accepted
73
+ *
74
+ * @since 1.5.0
75
+ */
76
+ public function cookiebot_addon_matomo() {
77
+ $possible_tags = array(
78
+ 'admin_footer',
79
+ 'admin_head',
80
+ 'wp_footer',
81
+ 'wp_head',
82
+ );
83
+ foreach ( $possible_tags as $possible_tag ) {
84
+ $this->buffer_output->add_tag(
85
+ $possible_tag,
86
+ 10,
87
+ array(
88
+ 'matomo' => $this->get_cookie_types(),
89
+ ),
90
+ false
91
+ );
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Return addon/plugin name
97
+ *
98
+ * @return string
99
+ *
100
+ * @since 1.5.0
101
+ */
102
+ public function get_addon_name() {
103
+ return 'Matomo Analytics';
104
+ }
105
+
106
+ /**
107
+ * Option name in the database
108
+ *
109
+ * @return string
110
+ *
111
+ * @since 1.5.0
112
+ */
113
+ public function get_option_name() {
114
+ return 'matomo';
115
+ }
116
+
117
+ /**
118
+ * Plugin file name
119
+ *
120
+ * @return string
121
+ *
122
+ * @since 1.5.0
123
+ */
124
+ public function get_plugin_file() {
125
+ return 'matomo/matomo.php';
126
+ }
127
+
128
+ /**
129
+ * Returns checked cookie types
130
+ * @return mixed
131
+ *
132
+ * @since 1.5.0
133
+ */
134
+ public function get_cookie_types() {
135
+ return $this->settings->get_cookie_types( $this->get_option_name(), $this->get_default_cookie_types() );
136
+ }
137
+
138
+ /**
139
+ * Returns default cookie types
140
+ * @return array
141
+ *
142
+ * @since 1.5.0
143
+ */
144
+ public function get_default_cookie_types() {
145
+ return array( 'statistics' );
146
+ }
147
+
148
+ /**
149
+ * Check if plugin is activated and checked in the backend
150
+ *
151
+ * @since 1.5.0
152
+ */
153
+ public function is_addon_enabled() {
154
+ return $this->settings->is_addon_enabled( $this->get_option_name() );
155
+ }
156
+
157
+ /**
158
+ * Checks if addon is installed
159
+ *
160
+ * @since 1.5.0
161
+ */
162
+ public function is_addon_installed() {
163
+ return $this->settings->is_addon_installed( $this->get_plugin_file() );
164
+ }
165
+
166
+ /**
167
+ * Checks if addon is activated
168
+ *
169
+ * @since 1.5.0
170
+ */
171
+ public function is_addon_activated() {
172
+ return $this->settings->is_addon_activated( $this->get_plugin_file() );
173
+ }
174
+
175
+ /**
176
+ * Retrieves current installed version of the addon
177
+ *
178
+ * @return bool
179
+ *
180
+ * @since 2.2.1
181
+ */
182
+ public function get_addon_version() {
183
+ return $this->settings->get_addon_version( $this->get_plugin_file() );
184
+ }
185
+
186
+ /**
187
+ * Default placeholder content
188
+ *
189
+ * @return string
190
+ *
191
+ * @since 1.8.0
192
+ */
193
+ public function get_default_placeholder() {
194
+ return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this video.';
195
+ }
196
+
197
+ /**
198
+ * Get placeholder content
199
+ *
200
+ * This function will check following features:
201
+ * - Current language
202
+ *
203
+ * @param $src
204
+ *
205
+ * @return bool|mixed
206
+ *
207
+ * @since 1.8.0
208
+ */
209
+ public function get_placeholder( $src = '' ) {
210
+ return $this->settings->get_placeholder(
211
+ $this->get_option_name(),
212
+ $this->get_default_placeholder(),
213
+ cookiebot_addons_output_cookie_types( $this->get_cookie_types() ),
214
+ $src
215
+ );
216
+ }
217
+
218
+ /**
219
+ * Checks if it does have custom placeholder content
220
+ *
221
+ * @return mixed
222
+ *
223
+ * @since 1.8.0
224
+ */
225
+ public function has_placeholder() {
226
+ return $this->settings->has_placeholder( $this->get_option_name() );
227
+ }
228
+
229
+ /**
230
+ * returns all placeholder contents
231
+ *
232
+ * @return mixed
233
+ *
234
+ * @since 1.8.0
235
+ */
236
+ public function get_placeholders() {
237
+ return $this->settings->get_placeholders( $this->get_option_name() );
238
+ }
239
+
240
+ /**
241
+ * Return true if the placeholder is enabled
242
+ *
243
+ * @return mixed
244
+ *
245
+ * @since 1.8.0
246
+ */
247
+ public function is_placeholder_enabled() {
248
+ return $this->settings->is_placeholder_enabled( $this->get_option_name() );
249
+ }
250
+
251
+ /**
252
+ * Adds extra information under the label
253
+ *
254
+ * @return string
255
+ *
256
+ * @since 1.8.0
257
+ */
258
+ public function get_extra_information() {
259
+ return false;
260
+ }
261
+
262
+ /**
263
+ * Returns the url of WordPress SVN repository or another link where we can verify the plugin file.
264
+ *
265
+ * @return boolean
266
+ *
267
+ * @since 1.8.0
268
+ */
269
+ public function get_svn_url() {
270
+ return 'https://plugins.svn.wordpress.org/matomo/trunk/matomo.php';
271
+ }
272
+
273
+ /**
274
+ * Placeholder helper overlay in the settings page.
275
+ *
276
+ * @return string
277
+ *
278
+ * @since 1.8.0
279
+ */
280
+ public function get_placeholder_helper() {
281
+ return '<p>Merge tags you can use in the placeholder text:</p><ul><li>%cookie_types - Lists required cookie types</li><li>[renew_consent]text[/renew_consent] - link to display cookie settings in frontend</li></ul>';
282
+ }
283
+
284
+
285
+ /**
286
+ * Returns parent class or false
287
+ *
288
+ * @return string|bool
289
+ *
290
+ * @since 2.1.3
291
+ */
292
+ public function get_parent_class() {
293
+ return get_parent_class( $this );
294
+ }
295
+
296
+ /**
297
+ * Action after enabling the addon on the settings page
298
+ *
299
+ * @since 2.2.0
300
+ */
301
+ public function post_hook_after_enabling() {
302
+ //do nothing
303
+ }
304
+
305
+ /**
306
+ * Cookiebot plugin is deactivated
307
+ *
308
+ * @since 2.2.0
309
+ */
310
+ public function plugin_deactivated() {
311
+ //do nothing
312
+ }
313
+
314
+ /**
315
+ * @return mixed
316
+ *
317
+ * @since 2.4.5
318
+ */
319
+ public function extra_available_addon_option() {
320
+ //do nothing
321
+ }
322
+
323
+ /**
324
+ * Returns boolean to enable/disable plugin by default
325
+ *
326
+ * @return bool
327
+ *
328
+ * @since 3.6.3
329
+ */
330
+ public function enable_by_default() {
331
+ return false;
332
+ }
333
+
334
+ /**
335
+ * Sets default settings for this addon
336
+ *
337
+ * @return array
338
+ *
339
+ * @since 3.6.3
340
+ */
341
+ public function get_default_enable_setting() {
342
+ return array(
343
+ 'enabled' => 1,
344
+ 'cookie_type' => $this->get_default_cookie_types(),
345
+ 'placeholder' => $this->get_default_placeholder(),
346
+ );
347
+ }
348
+ }
addons/controller/addons/wp-google-analytics-events/wp-google-analytics-events.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace cookiebot_addons\controller\addons\wp_google_analytics_events;
4
+
5
+ use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
+ use cookiebot_addons\lib\Cookie_Consent_Interface;
7
+ use cookiebot_addons\lib\Settings_Service_Interface;
8
+ use cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag_Interface;
9
+ use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
10
+
11
+ class Wp_Google_Analytics_Events implements Cookiebot_Addons_Interface {
12
+
13
+ /**
14
+ * @var Settings_Service_Interface
15
+ *
16
+ * @since 1.3.0
17
+ */
18
+ protected $settings;
19
+
20
+ /**
21
+ * @var Script_Loader_Tag_Interface
22
+ *
23
+ * @since 1.3.0
24
+ */
25
+ protected $script_loader_tag;
26
+
27
+ /**
28
+ * @var Cookie_Consent_Interface
29
+ *
30
+ * @since 1.3.0
31
+ */
32
+ public $cookie_consent;
33
+
34
+ /**
35
+ * @var Buffer_Output_Interface
36
+ *
37
+ * @since 1.3.0
38
+ */
39
+ protected $buffer_output;
40
+
41
+ /**
42
+ * Jetpack constructor.
43
+ *
44
+ * @param $settings Settings_Service_Interface
45
+ * @param $script_loader_tag Script_Loader_Tag_Interface
46
+ * @param $cookie_consent Cookie_Consent_Interface
47
+ * @param $buffer_output Buffer_Output_Interface
48
+ *
49
+ * @since 1.3.0
50
+ */
51
+ public function __construct(
52
+ Settings_Service_Interface $settings,
53
+ Script_Loader_Tag_Interface $script_loader_tag,
54
+ Cookie_Consent_Interface $cookie_consent,
55
+ Buffer_Output_Interface $buffer_output
56
+ ) {
57
+ $this->settings = $settings;
58
+ $this->script_loader_tag = $script_loader_tag;
59
+ $this->cookie_consent = $cookie_consent;
60
+ $this->buffer_output = $buffer_output;
61
+ }
62
+
63
+ /**
64
+ * Loads addon configuration
65
+ *
66
+ * @since 1.3.0
67
+ */
68
+ public function load_configuration() {
69
+ add_action( 'wp_loaded', array( $this, 'cookiebot_addon_wp_google_analytics_events' ), 5 );
70
+ }
71
+
72
+ /**
73
+ * Disable scripts if state not accepted
74
+ *
75
+ * @since 1.3.0
76
+ */
77
+ public function cookiebot_addon_wp_google_analytics_events() {
78
+ $this->script_loader_tag->add_tag( 'ga_events_frontend_bundle', $this->get_cookie_types() );
79
+ $this->script_loader_tag->add_tag( 'ga_events_main_script', $this->get_cookie_types() );
80
+ cookiebot_addons_remove_class_action( 'wp_head', 'GAESnippets', 'add_snippet_to_header', 0 );
81
+ }
82
+
83
+ /**
84
+ * Return addon/plugin name
85
+ *
86
+ * @return string
87
+ *
88
+ * @since 1.3.0
89
+ */
90
+ public function get_addon_name() {
91
+ return 'WP Google Analytics Events';
92
+ }
93
+
94
+ /**
95
+ * Default placeholder content
96
+ *
97
+ * @return string
98
+ *
99
+ * @since 1.8.0
100
+ */
101
+ public function get_default_placeholder() {
102
+ return 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable WP Google Analytics Events.';
103
+ }
104
+
105
+ /**
106
+ * Get placeholder content
107
+ *
108
+ * This function will check following features:
109
+ * - Current language
110
+ *
111
+ * @param $src
112
+ *
113
+ * @return bool|mixed
114
+ *
115
+ * @since 1.8.0
116
+ */
117
+ public function get_placeholder( $src = '' ) {
118
+ return $this->settings->get_placeholder( $this->get_option_name(), $this->get_default_placeholder(),
119
+ cookiebot_addons_output_cookie_types( $this->get_cookie_types() ), $src );
120
+ }
121
+
122
+ /**
123
+ * Option name in the database
124
+ *
125
+ * @return string
126
+ *
127
+ * @since 1.3.0
128
+ */
129
+ public function get_option_name() {
130
+ return 'wp_google_analytics_events';
131
+ }
132
+
133
+ /**
134
+ * Plugin file name
135
+ *
136
+ * @return string
137
+ *
138
+ * @since 1.3.0
139
+ */
140
+ public function get_plugin_file() {
141
+ return 'wp-google-analytics-events/ga-scroll-event.php';
142
+ }
143
+
144
+ /**
145
+ * Returns checked cookie types
146
+ * @return mixed
147
+ *
148
+ * @since 1.3.0
149
+ */
150
+ public function get_cookie_types() {
151
+ return $this->settings->get_cookie_types( $this->get_option_name(), $this->get_default_cookie_types() );
152
+ }
153
+
154
+ /**
155
+ * Returns default cookie types
156
+ * @return array
157
+ *
158
+ * @since 1.5.0
159
+ */
160
+ public function get_default_cookie_types() {
161
+ return array( 'statistics' );
162
+ }
163
+
164
+ /**
165
+ * Check if plugin is activated and checked in the backend
166
+ *
167
+ * @since 1.3.0
168
+ */
169
+ public function is_addon_enabled() {
170
+ return $this->settings->is_addon_enabled( $this->get_option_name() );
171
+ }
172
+
173
+ /**
174
+ * Checks if addon is installed
175
+ *
176
+ * @since 1.3.0
177
+ */
178
+ public function is_addon_installed() {
179
+ return $this->settings->is_addon_installed( $this->get_plugin_file() );
180
+ }
181
+
182
+ /**
183
+ * Checks if addon is activated
184
+ *
185
+ * @since 1.3.0
186
+ */
187
+ public function is_addon_activated() {
188
+ return $this->settings->is_addon_activated( $this->get_plugin_file() );
189
+ }
190
+
191
+ /**
192
+ * Retrieves current installed version of the addon
193
+ *
194
+ * @return bool
195
+ *
196
+ * @since 2.2.1
197
+ */
198
+ public function get_addon_version() {
199
+ return $this->settings->get_addon_version( $this->get_plugin_file() );
200
+ }
201
+
202
+ /**
203
+ * Checks if it does have custom placeholder content
204
+ *
205
+ * @return mixed
206
+ *
207
+ * @since 1.8.0
208
+ */
209
+ public function has_placeholder() {
210
+ return $this->settings->has_placeholder( $this->get_option_name() );
211
+ }
212
+
213
+ /**
214
+ * returns all placeholder contents
215
+ *
216
+ * @return mixed
217
+ *
218
+ * @since 1.8.0
219
+ */
220
+ public function get_placeholders() {
221
+ return $this->settings->get_placeholders( $this->get_option_name() );
222
+ }
223
+
224
+ /**
225
+ * Return true if the placeholder is enabled
226
+ *
227
+ * @return mixed
228
+ *
229
+ * @since 1.8.0
230
+ */
231
+ public function is_placeholder_enabled() {
232
+ return $this->settings->is_placeholder_enabled( $this->get_option_name() );
233
+ }
234
+
235
+ /**
236
+ * Adds extra information under the label
237
+ *
238
+ * @return string
239
+ *
240
+ * @since 1.8.0
241
+ */
242
+ public function get_extra_information() {
243
+ return '<p>' . esc_html__( 'The plugin allows you to fire events whenever someone interacts or views elements on your website.',
244
+ 'cookiebot-addons' ) . '</p>';
245
+ }
246
+
247
+ /**
248
+ * Returns the url of WordPress SVN repository or another link where we can verify the plugin file.
249
+ *
250
+ * @return string
251
+ *
252
+ * @since 1.8.0
253
+ */
254
+ public function get_svn_url() {
255
+ return 'http://plugins.svn.wordpress.org/wp-google-analytics-events/trunk/ga-scroll-event.php';
256
+ }
257
+
258
+ /**
259
+ * Placeholder helper overlay in the settings page.
260
+ *
261
+ * @return string
262
+ *
263
+ * @since 1.8.0
264
+ */
265
+ public function get_placeholder_helper() {
266
+ return '<p>Merge tags you can use in the placeholder text:</p><ul><li>%cookie_types - Lists required cookie types</li><li>[renew_consent]text[/renew_consent] - link to display cookie settings in frontend</li></ul>';
267
+ }
268
+
269
+
270
+ /**
271
+ * Returns parent class or false
272
+ *
273
+ * @return string|bool
274
+ *
275
+ * @since 2.1.3
276
+ */
277
+ public function get_parent_class() {
278
+ return get_parent_class( $this );
279
+ }
280
+
281
+ /**
282
+ * Action after enabling the addon on the settings page
283
+ *
284
+ * @since 2.2.0
285
+ */
286
+ public function post_hook_after_enabling() {
287
+ //do nothing
288
+ }
289
+
290
+ /**
291
+ * Cookiebot plugin is deactivated
292
+ *
293
+ * @since 2.2.0
294
+ */
295
+ public function plugin_deactivated() {
296
+ //do nothing
297
+ }
298
+
299
+ /**
300
+ * @return mixed
301
+ *
302
+ * @since 2.4.5
303
+ */
304
+ public function extra_available_addon_option() {
305
+ //do nothing
306
+ }
307
+
308
+ /**
309
+ * Returns boolean to enable/disable plugin by default
310
+ *
311
+ * @return bool
312
+ *
313
+ * @since 3.6.3
314
+ */
315
+ public function enable_by_default() {
316
+ return false;
317
+ }
318
+
319
+ /**
320
+ * Sets default settings for this addon
321
+ *
322
+ * @return array
323
+ *
324
+ * @since 3.6.3
325
+ */
326
+ public function get_default_enable_setting() {
327
+ return array(
328
+ 'enabled' => 1,
329
+ 'cookie_type' => $this->get_default_cookie_types(),
330
+ 'placeholder' => $this->get_default_placeholder(),
331
+ );
332
+ }
333
+ }
addons/controller/plugin-controller.php CHANGED
@@ -5,8 +5,14 @@ namespace cookiebot_addons\controller;
5
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
  use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
7
  use cookiebot_addons\lib\Settings_Service_Interface;
 
8
  use Cybot\Dependencies\DI;
 
9
 
 
 
 
 
10
  class Plugin_Controller {
11
 
12
  /**
@@ -37,20 +43,18 @@ class Plugin_Controller {
37
  */
38
  protected function load_init_files() {
39
  if ( ! function_exists( 'is_plugin_active' ) ) {
40
- require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
41
- require_once( ABSPATH . '/wp-includes/l10n.php' );
42
- require_once( ABSPATH . '/wp-admin/includes/translation-install.php' );
43
  }
44
  }
45
 
46
  /**
47
  * Load addon configuration if the plugin is activated
48
  *
49
- * @throws DI\DependencyException
50
- * @throws DI\NotFoundException
51
- *
52
- * @version 1.3.0
53
  * @since 1.2.0
 
54
  */
55
  public function load_active_addons() {
56
  /**
@@ -59,8 +63,8 @@ class Plugin_Controller {
59
  if ( ! function_exists( 'cookiebot_active' ) || ! cookiebot_active() ) {
60
  return;
61
  }
62
-
63
- if( \Cookiebot_WP::cookiebot_disabled_in_admin() === true && is_admin() ) {
64
  return;
65
  }
66
 
@@ -69,12 +73,12 @@ class Plugin_Controller {
69
  *
70
  * @var $plugin Cookiebot_Addons_Interface
71
  */
72
- $addonsEnabled = 0;
73
  foreach ( $this->settings_service->get_active_addons() as $plugin ) {
74
  if ( ! $plugin->cookie_consent->are_cookie_states_accepted( $plugin->get_cookie_types() )
75
  || cookiebot_addons_enabled_cache_plugin() ) {
76
  $plugin->load_configuration();
77
- $addonsEnabled++;
78
  }
79
  }
80
 
@@ -84,22 +88,25 @@ class Plugin_Controller {
84
  * Run buffer output actions - this runs after scanning of every addons
85
  */
86
  add_action( 'parse_request', array( $this, 'run_buffer_output_manipulations' ) );
87
-
88
-
89
  /**
90
  * Add notice for the user if any addons is enabled and cookie
91
  * blocking mode is set to auto.
92
  */
93
- if($addonsEnabled > 0 && \Cookiebot_WP::get_cookie_blocking_mode() == 'auto') {
94
- if(isset($_GET['page']) && in_array($_GET['page'],array('cookiebot','cookiebot-addons'))) {
95
- add_action('admin_notices', function() {
96
- echo '<div class="notice notice-warning">
 
 
 
97
  <p>
98
- <strong>'.esc_html__('You enabled Cookiebot auto blocking mode but still using addons').'</strong><br>
99
- '.esc_html__('In some occasions this may cause client side errors. If you notice any errors please try to disable Cookiebot addons or contact Cookiebot support.').'
100
  </p>
101
  </div>';
102
- });
 
103
  }
104
  }
105
  }
5
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
  use cookiebot_addons\lib\buffer\Buffer_Output_Interface;
7
  use cookiebot_addons\lib\Settings_Service_Interface;
8
+ use Cookiebot_WP;
9
  use Cybot\Dependencies\DI;
10
+ use Exception;
11
 
12
+ /**
13
+ * Class Plugin_Controller
14
+ * @package cookiebot_addons\controller
15
+ */
16
  class Plugin_Controller {
17
 
18
  /**
43
  */
44
  protected function load_init_files() {
45
  if ( ! function_exists( 'is_plugin_active' ) ) {
46
+ require_once ABSPATH . '/wp-admin/includes/plugin.php';
47
+ require_once ABSPATH . '/wp-includes/l10n.php';
48
+ require_once ABSPATH . '/wp-admin/includes/translation-install.php';
49
  }
50
  }
51
 
52
  /**
53
  * Load addon configuration if the plugin is activated
54
  *
55
+ * @throws Exception
 
 
 
56
  * @since 1.2.0
57
+ * @version 1.3.0
58
  */
59
  public function load_active_addons() {
60
  /**
63
  if ( ! function_exists( 'cookiebot_active' ) || ! cookiebot_active() ) {
64
  return;
65
  }
66
+
67
+ if ( Cookiebot_WP::cookiebot_disabled_in_admin() === true && is_admin() ) {
68
  return;
69
  }
70
 
73
  *
74
  * @var $plugin Cookiebot_Addons_Interface
75
  */
76
+ $addons_enabled_counter = 0;
77
  foreach ( $this->settings_service->get_active_addons() as $plugin ) {
78
  if ( ! $plugin->cookie_consent->are_cookie_states_accepted( $plugin->get_cookie_types() )
79
  || cookiebot_addons_enabled_cache_plugin() ) {
80
  $plugin->load_configuration();
81
+ $addons_enabled_counter++;
82
  }
83
  }
84
 
88
  * Run buffer output actions - this runs after scanning of every addons
89
  */
90
  add_action( 'parse_request', array( $this, 'run_buffer_output_manipulations' ) );
91
+
 
92
  /**
93
  * Add notice for the user if any addons is enabled and cookie
94
  * blocking mode is set to auto.
95
  */
96
+ if ( $addons_enabled_counter > 0 && Cookiebot_WP::get_cookie_blocking_mode() === 'auto' ) {
97
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended
98
+ if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'cookiebot', 'cookiebot-addons' ), true ) ) {
99
+ add_action(
100
+ 'admin_notices',
101
+ function() {
102
+ echo '<div class="notice notice-warning">
103
  <p>
104
+ <strong>' . esc_html__( 'You enabled Cookiebot auto blocking mode but still using addons' ) . '</strong><br>
105
+ ' . esc_html__( 'In some occasions this may cause client side errors. If you notice any errors please try to disable Cookiebot addons or contact Cookiebot support.' ) . '
106
  </p>
107
  </div>';
108
+ }
109
+ );
110
  }
111
  }
112
  }
addons/cookiebot-addons-init.php CHANGED
@@ -4,9 +4,13 @@ namespace cookiebot_addons;
4
 
5
  use cookiebot_addons\config\Settings_Config;
6
  use cookiebot_addons\controller\Plugin_Controller;
7
- use cookiebot_addons\lib\Settings_Service_Interface;
8
- use Cybot\Dependencies\DI\ContainerBuilder;
9
- use Cybot\Dependencies\DI;
 
 
 
 
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
@@ -18,6 +22,10 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  */
19
  define( 'COOKIEBOT_ADDONS_DIR', __DIR__ . DIRECTORY_SEPARATOR );
20
 
 
 
 
 
21
  define( 'COOKIEBOT_ADDONS_BASE_NAME', dirname( plugin_basename( __FILE__ ) ) );
22
 
23
  /**
@@ -28,26 +36,19 @@ define( 'COOKIEBOT_ADDONS_VERSION', '3.9.0' );
28
  /**
29
  * Register autoloader to load files/classes dynamically
30
  */
31
- include_once COOKIEBOT_ADDONS_DIR . 'lib/autoloader.php';
32
 
33
  /**
34
  * Load global functions for this plugin
35
  */
36
- include_once COOKIEBOT_ADDONS_DIR . 'lib/helper.php';
37
-
38
- /**
39
- * Load composer
40
- *
41
- * "php-di/php-di": "5.0"
42
- */
43
- include_once COOKIEBOT_ADDONS_DIR . 'vendor/autoload.php';
44
 
45
  class Cookiebot_Addons {
46
 
47
  /**
48
- * IoC Container - is used for dependency injections
49
  *
50
- * @var DI\Container
51
  *
52
  * @since 1.3.0
53
  */
@@ -66,38 +67,35 @@ class Cookiebot_Addons {
66
  * @var Cookiebot_Addons The single instance of the class
67
  * @since 1.0.0
68
  */
69
- protected static $_instance = null;
70
 
71
  /**
72
  * Main Cookiebot_WP Instance
73
  *
74
  * Ensures only one instance of Cookiebot_Addons is loaded or can be loaded.
75
  *
76
- * @version 2.2.0
77
  * @since 2.2.0
78
  * @static
79
  *
80
- * @return Cookiebot_Addons
81
  */
82
  public static function instance() {
83
- if ( is_null( self::$_instance ) ) {
84
  try {
85
- self::$_instance = new self();
86
- } catch ( DI\DependencyException $e ) {
87
- echo 'Dependencies are not loaded.';
88
- } catch ( DI\NotFoundException $e ) {
89
- echo 'Dependencies are not found.';
90
  }
91
  }
92
 
93
- return self::$_instance;
94
  }
95
 
96
  /**
97
  * Cookiebot_Addons constructor.
98
  *
99
- * @throws DI\DependencyException
100
- * @throws DI\NotFoundException
101
  *
102
  * @since 1.3.0
103
  */
@@ -113,10 +111,13 @@ class Cookiebot_Addons {
113
  *
114
  * @since 1.1.0
115
  */
116
- add_action( 'after_setup_theme', array(
117
- new Plugin_Controller( $this->container->get( 'Settings_Service_Interface' ) ),
118
- 'load_active_addons',
119
- ) );
 
 
 
120
  /**
121
  * Load settings config
122
  *
@@ -155,44 +156,43 @@ class Cookiebot_Addons {
155
  *
156
  * The file is located at the root map of this plugin
157
  *
 
158
  * @since 1.3.0
159
  */
160
  protected function get_plugins() {
161
- $file = file_get_contents( COOKIEBOT_ADDONS_DIR . 'addons.json' );
162
- $this->plugins = apply_filters( 'cookiebot_addons_list', json_decode( $file ) );
 
163
  }
164
 
165
  /**
166
- * Build IoC container
167
- *
168
- * @since 1.3.0
169
  */
170
  protected function build_container() {
171
- $builder = new ContainerBuilder();
172
-
173
- $builder->addDefinitions(
174
- array(
175
- 'Script_Loader_Tag_Interface' => DI\object( 'cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag' ),
176
- 'Cookie_Consent_Interface' => DI\object( 'cookiebot_addons\lib\Cookie_Consent' ),
177
- 'Buffer_Output_Interface' => DI\object( 'cookiebot_addons\lib\buffer\Buffer_Output' ),
178
- 'plugins' => DI\value( $this->plugins ),
179
- )
180
  );
181
 
182
- $this->container = $builder->build();
183
 
184
- $this->container->set( 'Settings_Service_Interface', DI\object( 'cookiebot_addons\lib\Settings_Service' )
185
- ->constructor( $this->container ) );
 
 
186
 
187
- $this->container->set( 'Theme_Settings_Service_Interface', DI\object( 'cookiebot_addons\lib\Theme_Settings_Service' )
188
- ->constructor( $this->container ) );
 
 
189
  }
190
 
191
  /**
192
  * Assign addon class to the container to use it later
193
  *
194
- * @throws DI\DependencyException
195
- * @throws DI\NotFoundException
196
  *
197
  * @since 1.3.0
198
  */
@@ -204,15 +204,22 @@ class Cookiebot_Addons {
204
  /**
205
  * Load addon class to the container
206
  */
207
- $this->container->set( $plugin->class, DI\object( $plugin->class )
208
- ->constructor(
209
- isset( $plugin->is_theme ) && $plugin->is_theme
210
- ? $this->container->get( 'Theme_Settings_Service_Interface' )
211
- : $this->container->get( 'Settings_Service_Interface' ),
212
- $this->container->get( 'Script_Loader_Tag_Interface' ),
213
- $this->container->get( 'Cookie_Consent_Interface' ),
214
- $this->container->get( 'Buffer_Output_Interface' ) )
215
- );
 
 
 
 
 
 
 
216
  }
217
  }
218
  }
4
 
5
  use cookiebot_addons\config\Settings_Config;
6
  use cookiebot_addons\controller\Plugin_Controller;
7
+ use cookiebot_addons\lib\buffer\Buffer_Output;
8
+ use cookiebot_addons\lib\Cookie_Consent;
9
+ use cookiebot_addons\lib\Dependency_Container;
10
+ use cookiebot_addons\lib\script_loader_tag\Script_Loader_Tag;
11
+ use cookiebot_addons\lib\Settings_Service;
12
+ use cookiebot_addons\lib\Theme_Settings_Service;
13
+ use Exception;
14
 
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
22
  */
23
  define( 'COOKIEBOT_ADDONS_DIR', __DIR__ . DIRECTORY_SEPARATOR );
24
 
25
+ if ( ! defined( 'COOKIEBOT_ADDONS_URL' ) ) {
26
+ define( 'COOKIEBOT_ADDONS_URL', plugin_dir_url( __FILE__ ) );
27
+ }
28
+
29
  define( 'COOKIEBOT_ADDONS_BASE_NAME', dirname( plugin_basename( __FILE__ ) ) );
30
 
31
  /**
36
  /**
37
  * Register autoloader to load files/classes dynamically
38
  */
39
+ require_once COOKIEBOT_ADDONS_DIR . 'lib/autoloader.php';
40
 
41
  /**
42
  * Load global functions for this plugin
43
  */
44
+ require_once COOKIEBOT_ADDONS_DIR . 'lib/helper.php';
 
 
 
 
 
 
 
45
 
46
  class Cookiebot_Addons {
47
 
48
  /**
49
+ * Dependency Container - is used for dependency injections
50
  *
51
+ * @var Dependency_Container
52
  *
53
  * @since 1.3.0
54
  */
67
  * @var Cookiebot_Addons The single instance of the class
68
  * @since 1.0.0
69
  */
70
+ private static $instance = null;
71
 
72
  /**
73
  * Main Cookiebot_WP Instance
74
  *
75
  * Ensures only one instance of Cookiebot_Addons is loaded or can be loaded.
76
  *
77
+ * @return Cookiebot_Addons
78
  * @since 2.2.0
79
  * @static
80
  *
81
+ * @version 2.2.0
82
  */
83
  public static function instance() {
84
+ if ( is_null( self::$instance ) ) {
85
  try {
86
+ self::$instance = new self();
87
+ } catch ( Exception $e ) {
88
+ echo 'Could not initialize Cookiebot addons: ' . esc_html( $e->getMessage() );
 
 
89
  }
90
  }
91
 
92
+ return self::$instance;
93
  }
94
 
95
  /**
96
  * Cookiebot_Addons constructor.
97
  *
98
+ * @throws Exception
 
99
  *
100
  * @since 1.3.0
101
  */
111
  *
112
  * @since 1.1.0
113
  */
114
+ add_action(
115
+ 'after_setup_theme',
116
+ array(
117
+ new Plugin_Controller( $this->container->get( 'Settings_Service_Interface' ) ),
118
+ 'load_active_addons',
119
+ )
120
+ );
121
  /**
122
  * Load settings config
123
  *
156
  *
157
  * The file is located at the root map of this plugin
158
  *
159
+ * @throws Exception
160
  * @since 1.3.0
161
  */
162
  protected function get_plugins() {
163
+ $file = cookiebot_get_local_file_json_contents( COOKIEBOT_ADDONS_DIR . 'addons.json' );
164
+
165
+ $this->plugins = apply_filters( 'cookiebot_addons_list', $file );
166
  }
167
 
168
  /**
169
+ * @throws Exception
 
 
170
  */
171
  protected function build_container() {
172
+ $dependencies = array(
173
+ 'Script_Loader_Tag_Interface' => new Script_Loader_Tag(),
174
+ 'Cookie_Consent_Interface' => new Cookie_Consent(),
175
+ 'Buffer_Output_Interface' => new Buffer_Output(),
176
+ 'plugins' => $this->plugins,
 
 
 
 
177
  );
178
 
179
+ $this->container = new Dependency_Container( $dependencies );
180
 
181
+ $this->container->set(
182
+ 'Settings_Service_Interface',
183
+ new Settings_Service( $this->container )
184
+ );
185
 
186
+ $this->container->set(
187
+ 'Theme_Settings_Service_Interface',
188
+ new Theme_Settings_Service( $this->container )
189
+ );
190
  }
191
 
192
  /**
193
  * Assign addon class to the container to use it later
194
  *
195
+ * @throws Exception
 
196
  *
197
  * @since 1.3.0
198
  */
204
  /**
205
  * Load addon class to the container
206
  */
207
+
208
+ if ( class_exists( $plugin->class ) ) {
209
+ $this->container->set(
210
+ $plugin->class,
211
+ new $plugin->class(
212
+ isset( $plugin->is_theme ) && $plugin->is_theme
213
+ ? $this->container->get( 'Theme_Settings_Service_Interface' )
214
+ : $this->container->get( 'Settings_Service_Interface' ),
215
+ $this->container->get( 'Script_Loader_Tag_Interface' ),
216
+ $this->container->get( 'Cookie_Consent_Interface' ),
217
+ $this->container->get( 'Buffer_Output_Interface' )
218
+ )
219
+ );
220
+ } else {
221
+ throw new Exception( 'Class ' . $plugin->class . ' not found' );
222
+ }
223
  }
224
  }
225
  }
addons/lib/buffer/buffer-output-tag.php CHANGED
@@ -48,7 +48,7 @@ class Buffer_Output_Tag implements Buffer_Output_Tag_Interface {
48
  *
49
  * @since 1.2.0
50
  */
51
- private $use_cache;
52
 
53
  /**
54
  * Cookiebot_Buffer_Output_Tag constructor.
@@ -67,7 +67,7 @@ class Buffer_Output_Tag implements Buffer_Output_Tag_Interface {
67
 
68
  $this->transient_name = "cookiebot_output_buffer_{$tag}_{$priority}";
69
 
70
- $this->set_use_cache($use_cache);
71
  }
72
 
73
  /**
@@ -86,7 +86,7 @@ class Buffer_Output_Tag implements Buffer_Output_Tag_Interface {
86
  *
87
  * @param $use_cache
88
  */
89
- public function set_use_cache($use_cache) {
90
  $this->use_cache = $use_cache;
91
  }
92
 
@@ -121,20 +121,20 @@ class Buffer_Output_Tag implements Buffer_Output_Tag_Interface {
121
  /**
122
  * Get wp head scripts from the cache
123
  */
124
- if( $this->use_cache ) {
125
  $updated_scripts = get_transient( $this->transient_name );
126
  }
127
 
128
  /**
129
  * If cache is not set then build it
130
  */
131
- if ( !$this->use_cache || $updated_scripts === false ) {
132
  /**
133
  * Get all scripts and add cookieconsent if it does match with the criterion
134
  */
135
  $updated_scripts = cookiebot_addons_manipulate_script( $buffer, $this->keywords );
136
 
137
- if( $this->use_cache ) {
138
  /**
139
  * Set cache for 15 minutes
140
  */
48
  *
49
  * @since 1.2.0
50
  */
51
+ private $use_cache;
52
 
53
  /**
54
  * Cookiebot_Buffer_Output_Tag constructor.
67
 
68
  $this->transient_name = "cookiebot_output_buffer_{$tag}_{$priority}";
69
 
70
+ $this->set_use_cache( $use_cache );
71
  }
72
 
73
  /**
86
  *
87
  * @param $use_cache
88
  */
89
+ public function set_use_cache( $use_cache ) {
90
  $this->use_cache = $use_cache;
91
  }
92
 
121
  /**
122
  * Get wp head scripts from the cache
123
  */
124
+ if ( $this->use_cache ) {
125
  $updated_scripts = get_transient( $this->transient_name );
126
  }
127
 
128
  /**
129
  * If cache is not set then build it
130
  */
131
+ if ( ! $this->use_cache || $updated_scripts === false ) {
132
  /**
133
  * Get all scripts and add cookieconsent if it does match with the criterion
134
  */
135
  $updated_scripts = cookiebot_addons_manipulate_script( $buffer, $this->keywords );
136
 
137
+ if ( $this->use_cache ) {
138
  /**
139
  * Set cache for 15 minutes
140
  */
addons/lib/buffer/buffer-output.php CHANGED
@@ -21,7 +21,7 @@ class Buffer_Output implements Buffer_Output_Interface {
21
  *
22
  * @since 1.2.0
23
  */
24
- public function add_tag( $tag_name, $priority, $keywords = array(), $use_cache = true) {
25
  $tag = new Buffer_Output_Tag( $tag_name, $priority, $keywords, $use_cache );
26
  $unique_id = $tag->tag . '_' . $tag->priority;
27
 
@@ -31,12 +31,11 @@ class Buffer_Output implements Buffer_Output_Interface {
31
  */
32
  if ( isset( $this->tags[ $unique_id ] ) ) {
33
  $this->tags[ $unique_id ]->merge_keywords( $keywords );
34
-
35
- if(!$use_cache) {
36
- $this->tags[ $unique_id ]->set_use_cache(false);
37
  }
38
- }
39
- else {
40
  $this->tags[ $unique_id ] = $tag;
41
  }
42
  }
21
  *
22
  * @since 1.2.0
23
  */
24
+ public function add_tag( $tag_name, $priority, $keywords = array(), $use_cache = true ) {
25
  $tag = new Buffer_Output_Tag( $tag_name, $priority, $keywords, $use_cache );
26
  $unique_id = $tag->tag . '_' . $tag->priority;
27
 
31
  */
32
  if ( isset( $this->tags[ $unique_id ] ) ) {
33
  $this->tags[ $unique_id ]->merge_keywords( $keywords );
34
+
35
+ if ( ! $use_cache ) {
36
+ $this->tags[ $unique_id ]->set_use_cache( false );
37
  }
38
+ } else {
 
39
  $this->tags[ $unique_id ] = $tag;
40
  }
41
  }
addons/lib/cookie-consent.php CHANGED
@@ -2,6 +2,10 @@
2
 
3
  namespace cookiebot_addons\lib;
4
 
 
 
 
 
5
  class Cookie_Consent implements Cookie_Consent_Interface {
6
 
7
  /**
@@ -32,7 +36,7 @@ class Cookie_Consent implements Cookie_Consent_Interface {
32
  * @since 1.2.0
33
  * @version 2.4.1
34
  */
35
- public function __construct($default_cookie = null) {
36
  $this->cookie = ( isset( $_COOKIE['CookieConsent'] ) ) ? $_COOKIE['CookieConsent'] : $default_cookie;
37
 
38
  $this->scan_cookie();
@@ -50,40 +54,45 @@ class Cookie_Consent implements Cookie_Consent_Interface {
50
 
51
  if ( ! empty( $this->cookie ) ) {
52
  switch ( $this->cookie ) {
53
- case "0":
54
  //The user has not accepted cookies - set strictly necessary cookies only
55
  break;
56
 
57
- case "-1":
58
  //The user is not within a region that requires consent - all cookies are accepted
59
  $this->add_state( 'preferences' );
60
  $this->add_state( 'statistics' );
61
  $this->add_state( 'marketing' );
62
  break;
63
 
64
- default: //The user has accepted one or more type of cookies
65
-
66
  //Read current user consent in encoded JavaScript format
67
- $valid_php_json = preg_replace( '/\s*:\s*([a-zA-Z0-9_]+?)([}\[,])/', ':"$1"$2',
68
- preg_replace( '/([{\[,])\s*([a-zA-Z0-9_]+?):/', '$1"$2":',
69
- str_replace( "'", '"', stripslashes( $this->cookie ) ) ) );
70
- $CookieConsent = json_decode( $valid_php_json );
71
-
72
- if ( isset( $CookieConsent->preferences ) && filter_var( $CookieConsent->preferences, FILTER_VALIDATE_BOOLEAN ) ) {
 
 
 
 
 
 
73
  //Current user accepts preference cookies
74
  $this->add_state( 'preferences' );
75
  } else {
76
  //Current user does NOT accept preference cookies
77
  }
78
 
79
- if ( isset( $CookieConsent->statistics ) && filter_var( $CookieConsent->statistics, FILTER_VALIDATE_BOOLEAN ) ) {
80
  //Current user accepts statistics cookies
81
  $this->add_state( 'statistics' );
82
  } else {
83
  //Current user does NOT accept statistics cookies
84
  }
85
 
86
- if ( isset( $CookieConsent->marketing ) && filter_var( $CookieConsent->marketing, FILTER_VALIDATE_BOOLEAN ) ) {
87
  //Current user accepts marketing cookies
88
  $this->add_state( 'marketing' );
89
  } else {
2
 
3
  namespace cookiebot_addons\lib;
4
 
5
+ /**
6
+ * Class Cookie_Consent
7
+ * @package cookiebot_addons\lib
8
+ */
9
  class Cookie_Consent implements Cookie_Consent_Interface {
10
 
11
  /**
36
  * @since 1.2.0
37
  * @version 2.4.1
38
  */
39
+ public function __construct( $default_cookie = null ) {
40
  $this->cookie = ( isset( $_COOKIE['CookieConsent'] ) ) ? $_COOKIE['CookieConsent'] : $default_cookie;
41
 
42
  $this->scan_cookie();
54
 
55
  if ( ! empty( $this->cookie ) ) {
56
  switch ( $this->cookie ) {
57
+ case '0':
58
  //The user has not accepted cookies - set strictly necessary cookies only
59
  break;
60
 
61
+ case '-1':
62
  //The user is not within a region that requires consent - all cookies are accepted
63
  $this->add_state( 'preferences' );
64
  $this->add_state( 'statistics' );
65
  $this->add_state( 'marketing' );
66
  break;
67
 
68
+ default:
 
69
  //Read current user consent in encoded JavaScript format
70
+ $valid_php_json = preg_replace(
71
+ '/\s*:\s*([a-zA-Z0-9_]+?)([}\[,])/',
72
+ ':"$1"$2',
73
+ preg_replace(
74
+ '/([{\[,])\s*([a-zA-Z0-9_]+?):/',
75
+ '$1"$2":',
76
+ str_replace( "'", '"', stripslashes( $this->cookie ) )
77
+ )
78
+ );
79
+ $cookie_consent = json_decode( $valid_php_json );
80
+
81
+ if ( isset( $cookie_consent->preferences ) && filter_var( $cookie_consent->preferences, FILTER_VALIDATE_BOOLEAN ) ) {
82
  //Current user accepts preference cookies
83
  $this->add_state( 'preferences' );
84
  } else {
85
  //Current user does NOT accept preference cookies
86
  }
87
 
88
+ if ( isset( $cookie_consent->statistics ) && filter_var( $cookie_consent->statistics, FILTER_VALIDATE_BOOLEAN ) ) {
89
  //Current user accepts statistics cookies
90
  $this->add_state( 'statistics' );
91
  } else {
92
  //Current user does NOT accept statistics cookies
93
  }
94
 
95
+ if ( isset( $cookie_consent->marketing ) && filter_var( $cookie_consent->marketing, FILTER_VALIDATE_BOOLEAN ) ) {
96
  //Current user accepts marketing cookies
97
  $this->add_state( 'marketing' );
98
  } else {
addons/lib/dependency-container.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace cookiebot_addons\lib;
4
+
5
+ use Exception;
6
+
7
+ /**
8
+ * Class Dependency_Container
9
+ * @package cookiebot_addons\lib
10
+ */
11
+ class Dependency_Container {
12
+
13
+ /**
14
+ * @var array
15
+ */
16
+ private $dependencies;
17
+
18
+ /**
19
+ * Dependency_Container constructor.
20
+ *
21
+ * @param array $dependencies
22
+ */
23
+ public function __construct( array $dependencies = array() ) {
24
+ $this->dependencies = $dependencies;
25
+ }
26
+
27
+ /**
28
+ * @param $key
29
+ * @param $dependency
30
+ *
31
+ * @throws Exception
32
+ */
33
+ public function set( $key, $dependency ) {
34
+ if ( isset( $this->dependencies[ $key ] ) ) {
35
+ throw new Exception( 'Dependency key ' . $key . ' already exists' );
36
+ }
37
+ $this->dependencies[ $key ] = $dependency;
38
+ }
39
+
40
+ /**
41
+ * @param $key
42
+ *
43
+ * @return mixed
44
+ * @throws Exception
45
+ */
46
+ public function get( $key ) {
47
+ if ( ! isset( $this->dependencies[ $key ] ) ) {
48
+ throw new Exception( 'Dependency key ' . $key . ' does not exists' );
49
+ }
50
+
51
+ return $this->dependencies[ $key ];
52
+ }
53
+ }
addons/lib/helper.php CHANGED
@@ -1,27 +1,28 @@
1
  <?php
2
  /**
3
  * Check if a cache plugin is activated and in function.
4
- *
5
- * @return boolean True If attributes always should be added
6
- * False If attributes only should be added if consent no given
7
  */
8
 
9
  function cookiebot_addons_enabled_cache_plugin() {
10
- if( defined( "WP_ROCKET_PATH" ) ) {
11
  return true; //WP Rocket - We need to ensure we not cache tags without attributes
12
  }
13
- if( defined( "W3TC" ) ) {
14
  return true; //W3 Total Cache
15
  }
16
- if( defined( "WPCACHEHOME" ) ) {
17
  return true; //WP Super Cache
18
  }
19
- if( defined( "WPFC_WP_PLUGIN_DIR" ) ) {
20
  return true; //WP Fastest Cache
21
  }
22
- if( defined( "LSCWP_CONTENT_DIR" ) ) {
23
  return true; //Litespeed Cache
24
  }
 
25
  return false;
26
  }
27
 
@@ -84,17 +85,15 @@ function cookiebot_addons_remove_class_action( $action, $class, $method, $priori
84
  * @since 1.2.0
85
  */
86
  function cookiebot_addons_manipulate_script( $buffer, $keywords ) {
87
- /**
88
- * normalize potential self-closing script tags
89
- */
90
-
91
- $normalized_buffer = preg_replace('/(<script(.*?)\/>)/is', '<script$2></script>', $buffer);
92
-
93
- if($normalized_buffer !== null) {
94
- $buffer = $normalized_buffer;
95
- }
96
 
 
97
 
 
 
 
98
 
99
  /**
100
  * Pattern to get all scripts
@@ -107,53 +106,57 @@ function cookiebot_addons_manipulate_script( $buffer, $keywords ) {
107
  /**
108
  * Get all scripts and add cookieconsent if it does match with the criterion
109
  */
110
- $updated_scripts = preg_replace_callback( $pattern, function ( $matches ) use ( $keywords ) {
111
-
112
- $script = $matches[0]; // the full script html
113
- $script_tag_open = $matches[1]; // only the script open tag with all attributes
114
- $script_tag_inner = $matches[2]; // only the script's innerText
115
- $script_tag_close = $matches[3]; // only the script closing tag
116
-
117
- /**
118
- * Check if the script contains the keywords, checks keywords one by one
119
- *
120
- * If one match, then the rest of the keywords will be skipped.
121
- **/
122
- foreach ( $keywords as $needle => $cookie_type ) {
123
  /**
124
- * The script contains the needle
 
 
125
  **/
126
- if ( strpos( $script, $needle ) !== false ) {
127
- /**
128
- * replace all single quotes with double quotes in the open tag
129
- * remove previously set data-cookieconsent attribute
130
- * remove type attribute
131
- */
132
- $script_tag_open = preg_replace('/\'/', '"', $script_tag_open);
133
- $script_tag_open = preg_replace('/\sdata-cookieconsent=\"(?:.*?)\"/', '', $script_tag_open);
134
- $script_tag_open = preg_replace( '/\stype=\"(?:.*?)\"/', '', $script_tag_open );
135
-
136
- /**
137
- * set the type attribute to text/plain to prevent javascript execution
138
- * add data-cookieconsent attribute
139
- */
140
- $cookie_types = cookiebot_addons_output_cookie_types( $cookie_type );
141
- $replacement = '<script type="text/plain" data-cookieconsent="' . $cookie_types . '"';
142
- $script_tag_open = preg_replace( '/<script/', $replacement, $script_tag_open );
143
-
144
- /**
145
- * reconstruct the script and break the foreach loop
146
- */
147
- $script = $script_tag_open . $script_tag_inner . $script_tag_close;
148
- continue;
 
 
 
 
 
149
  }
150
- }
151
 
152
- /**
153
- * return the reconstructed script
154
- */
155
- return $script;
156
- }, $buffer );
 
 
157
 
158
  /**
159
  * Fallback when the regex fails to work due to PCRE_ERROR_JIT_STACKLIMIT
@@ -177,28 +180,26 @@ function cookiebot_addons_manipulate_script( $buffer, $keywords ) {
177
  *
178
  * @param $helper
179
  * @param $current
180
- * @param bool $echo
181
- * @param string $type
182
  *
183
  * @return string
184
  *
185
  * @since 1.3.0
186
  */
187
  function cookiebot_addons_checked_selected_helper( $helper, $current, $echo = true, $type = 'checked' ) {
188
- if ( is_array( $helper ) && in_array( $current, $helper ) ) {
189
- $result = " $type='$type'";
190
- } elseif ( is_string( $helper ) && is_string( $current ) && $helper === $current ) {
191
- $result = " $type='$type'";
192
- } else {
193
- $result = '';
194
- }
195
 
 
 
 
 
196
 
197
- if ( $echo ) {
198
- echo $result;
199
  }
200
 
201
- return $result;
202
  }
203
 
204
  /**
@@ -214,9 +215,15 @@ function cookiebot_addons_checked_selected_helper( $helper, $current, $echo = tr
214
  */
215
  function cookiebot_addons_output_cookie_types( $cookie_types ) {
216
  if ( is_array( $cookie_types ) && count( $cookie_types ) > 0 ) {
217
- return implode( ', ', array_map( function ( $value ) {
218
- return cookiebot_translate_type_name( $value );
219
- }, $cookie_types ) );
 
 
 
 
 
 
220
  } elseif ( is_string( $cookie_types ) && $cookie_types != '' ) {
221
  return cookiebot_translate_type_name( $cookie_types );
222
  }
@@ -307,22 +314,24 @@ function cookiebot_addons_get_language() {
307
  }
308
 
309
  /**
310
- * @param array $cookie_names
311
  *
312
  * @return array
313
  */
314
- function cookiebot_translate_cookie_names($cookie_names) {
315
  $translated_cookie_names = array(
316
- 'preferences' => esc_html__('preferences', 'cookiebot'),
317
- 'statistics' => esc_html__('statistics', 'cookiebot'),
318
- 'marketing' => esc_html__('marketing', 'cookiebot'),
319
  );
 
320
  return array_map(
321
- function(string $cookie_name) use ($translated_cookie_names) {
322
- $cookie_name = trim($cookie_name);
323
- if(isset($translated_cookie_names[$cookie_name])) {
324
- return $translated_cookie_names[$cookie_name];
325
  }
 
326
  return $cookie_name;
327
  },
328
  $cookie_names
@@ -343,13 +352,14 @@ function cookiebot_addons_get_supported_languages() {
343
  }
344
 
345
  /**
 
346
  * Show languages in a select field
347
  *
348
  * @param $class
349
  * @param $name
350
  * @param $selected
351
  *
352
- * @return mixed
353
  *
354
  * @since 1.8.0
355
  */
@@ -359,15 +369,12 @@ function cookiebot_addons_get_dropdown_languages( $class, $name, $selected ) {
359
  'selected' => $selected,
360
  'show_option_site_default' => true,
361
  'echo' => false,
362
- 'languages' => get_available_languages()
363
  );
364
  $dropdown = wp_dropdown_languages( $args );
 
365
 
366
- $output = str_replace( 'select ', 'select class="' . $class . '" ', $dropdown );
367
-
368
- $output = str_replace( 'value="" ', 'value="en_US" ', $output );
369
-
370
- return $output;
371
  }
372
 
373
  /**
@@ -375,7 +382,7 @@ function cookiebot_addons_get_dropdown_languages( $class, $name, $selected ) {
375
  *
376
  * @since 2.2.0
377
  */
378
- function cookiebot_addons_plugin_deactivated( ) {
379
  $cookiebot_addons = \cookiebot_addons\Cookiebot_Addons::instance();
380
  $cookiebot_addons->cookiebot_deactivated();
381
  }
@@ -385,13 +392,13 @@ function cookiebot_addons_plugin_deactivated( ) {
385
  *
386
  * @since 3.6.3
387
  */
388
- function cookiebot_addons_plugin_activated( ) {
389
  $cookiebot_addons = \cookiebot_addons\Cookiebot_Addons::instance();
390
  $cookiebot_addons->cookiebot_activated();
391
  }
392
 
393
  /**
394
- * @param string $url
395
  *
396
  * @return string
397
  *
@@ -403,11 +410,11 @@ function cookiebot_addons_get_domain_from_url( $url ) {
403
  // relative url does not have host so use home url domain
404
  $host = isset( $parsed_url['host'] ) ? $parsed_url['host'] : cookiebot_addons_get_home_url_domain();
405
 
406
- $url_parts = explode('.', $host );
407
 
408
- $url_parts = array_slice($url_parts, -2);
409
 
410
- return implode('.', $url_parts );
411
  }
412
 
413
  /**
@@ -421,8 +428,47 @@ function cookiebot_addons_get_home_url_domain() {
421
  /** @var $host string */
422
  $host = $home_url['host'];
423
 
424
- if( empty( $host ) ) {
425
- throw new Exception('Home url domain is not found.' );
426
  }
 
427
  return $host;
428
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
3
  * Check if a cache plugin is activated and in function.
4
+ *
5
+ * @return boolean True If attributes always should be added
6
+ * False If attributes only should be added if consent no given
7
  */
8
 
9
  function cookiebot_addons_enabled_cache_plugin() {
10
+ if ( defined( 'WP_ROCKET_PATH' ) ) {
11
  return true; //WP Rocket - We need to ensure we not cache tags without attributes
12
  }
13
+ if ( defined( 'W3TC' ) ) {
14
  return true; //W3 Total Cache
15
  }
16
+ if ( defined( 'WPCACHEHOME' ) ) {
17
  return true; //WP Super Cache
18
  }
19
+ if ( defined( 'WPFC_WP_PLUGIN_DIR' ) ) {
20
  return true; //WP Fastest Cache
21
  }
22
+ if ( defined( 'LSCWP_CONTENT_DIR' ) ) {
23
  return true; //Litespeed Cache
24
  }
25
+
26
  return false;
27
  }
28
 
85
  * @since 1.2.0
86
  */
87
  function cookiebot_addons_manipulate_script( $buffer, $keywords ) {
88
+ /**
89
+ * normalize potential self-closing script tags
90
+ */
 
 
 
 
 
 
91
 
92
+ $normalized_buffer = preg_replace( '/(<script(.*?)\/>)/is', '<script$2></script>', $buffer );
93
 
94
+ if ( $normalized_buffer !== null ) {
95
+ $buffer = $normalized_buffer;
96
+ }
97
 
98
  /**
99
  * Pattern to get all scripts
106
  /**
107
  * Get all scripts and add cookieconsent if it does match with the criterion
108
  */
109
+ $updated_scripts = preg_replace_callback(
110
+ $pattern,
111
+ function ( $matches ) use ( $keywords ) {
112
+
113
+ $script = $matches[0]; // the full script html
114
+ $script_tag_open = $matches[1]; // only the script open tag with all attributes
115
+ $script_tag_inner = $matches[2]; // only the script's innerText
116
+ $script_tag_close = $matches[3]; // only the script closing tag
117
+
 
 
 
 
118
  /**
119
+ * Check if the script contains the keywords, checks keywords one by one
120
+ *
121
+ * If one match, then the rest of the keywords will be skipped.
122
  **/
123
+ foreach ( $keywords as $needle => $cookie_type ) {
124
+ /**
125
+ * The script contains the needle
126
+ **/
127
+ if ( strpos( $script, $needle ) !== false ) {
128
+ /**
129
+ * replace all single quotes with double quotes in the open tag
130
+ * remove previously set data-cookieconsent attribute
131
+ * remove type attribute
132
+ */
133
+ $script_tag_open = preg_replace( '/\'/', '"', $script_tag_open );
134
+ $script_tag_open = preg_replace( '/\sdata-cookieconsent=\"(?:.*?)\"/', '', $script_tag_open );
135
+ $script_tag_open = preg_replace( '/\stype=\"(?:.*?)\"/', '', $script_tag_open );
136
+
137
+ /**
138
+ * set the type attribute to text/plain to prevent javascript execution
139
+ * add data-cookieconsent attribute
140
+ */
141
+ $cookie_types = cookiebot_addons_output_cookie_types( $cookie_type );
142
+ $replacement = '<script type="text/plain" data-cookieconsent="' . $cookie_types . '"';
143
+ $script_tag_open = preg_replace( '/<script/', $replacement, $script_tag_open );
144
+
145
+ /**
146
+ * reconstruct the script and break the foreach loop
147
+ */
148
+ $script = $script_tag_open . $script_tag_inner . $script_tag_close;
149
+ continue;
150
+ }
151
  }
 
152
 
153
+ /**
154
+ * return the reconstructed script
155
+ */
156
+ return $script;
157
+ },
158
+ $buffer
159
+ );
160
 
161
  /**
162
  * Fallback when the regex fails to work due to PCRE_ERROR_JIT_STACKLIMIT
180
  *
181
  * @param $helper
182
  * @param $current
183
+ * @param bool $echo
184
+ * @param string $type
185
  *
186
  * @return string
187
  *
188
  * @since 1.3.0
189
  */
190
  function cookiebot_addons_checked_selected_helper( $helper, $current, $echo = true, $type = 'checked' ) {
191
+ $current_in_helper_array = is_array( $helper ) && in_array( $current, $helper, true );
192
+ $current_equals_helper_string = is_string( $helper ) && is_string( $current ) && $helper === $current;
 
 
 
 
 
193
 
194
+ if ( $current_in_helper_array || $current_equals_helper_string ) {
195
+ if ( $echo ) {
196
+ echo ' ' . esc_attr( $type ) . '=\'' . esc_attr( $type ) . '\'';
197
+ }
198
 
199
+ return " $type='$type'";
 
200
  }
201
 
202
+ return '';
203
  }
204
 
205
  /**
215
  */
216
  function cookiebot_addons_output_cookie_types( $cookie_types ) {
217
  if ( is_array( $cookie_types ) && count( $cookie_types ) > 0 ) {
218
+ return implode(
219
+ ', ',
220
+ array_map(
221
+ function ( $value ) {
222
+ return cookiebot_translate_type_name( $value );
223
+ },
224
+ $cookie_types
225
+ )
226
+ );
227
  } elseif ( is_string( $cookie_types ) && $cookie_types != '' ) {
228
  return cookiebot_translate_type_name( $cookie_types );
229
  }
314
  }
315
 
316
  /**
317
+ * @param array $cookie_names
318
  *
319
  * @return array
320
  */
321
+ function cookiebot_translate_cookie_names( $cookie_names ) {
322
  $translated_cookie_names = array(
323
+ 'preferences' => esc_html__( 'preferences', 'cookiebot' ),
324
+ 'statistics' => esc_html__( 'statistics', 'cookiebot' ),
325
+ 'marketing' => esc_html__( 'marketing', 'cookiebot' ),
326
  );
327
+
328
  return array_map(
329
+ function ( string $cookie_name ) use ( $translated_cookie_names ) {
330
+ $cookie_name = trim( $cookie_name );
331
+ if ( isset( $translated_cookie_names[ $cookie_name ] ) ) {
332
+ return $translated_cookie_names[ $cookie_name ];
333
  }
334
+
335
  return $cookie_name;
336
  },
337
  $cookie_names
352
  }
353
 
354
  /**
355
+ * Returns an escaped HTML "select" element
356
  * Show languages in a select field
357
  *
358
  * @param $class
359
  * @param $name
360
  * @param $selected
361
  *
362
+ * @return string
363
  *
364
  * @since 1.8.0
365
  */
369
  'selected' => $selected,
370
  'show_option_site_default' => true,
371
  'echo' => false,
372
+ 'languages' => get_available_languages(),
373
  );
374
  $dropdown = wp_dropdown_languages( $args );
375
+ $output = str_replace( '<select ', '<select class="' . esc_attr( $class ) . '" ', $dropdown );
376
 
377
+ return str_replace( ' value="" ', 'value="en_US" ', $output );
 
 
 
 
378
  }
379
 
380
  /**
382
  *
383
  * @since 2.2.0
384
  */
385
+ function cookiebot_addons_plugin_deactivated() {
386
  $cookiebot_addons = \cookiebot_addons\Cookiebot_Addons::instance();
387
  $cookiebot_addons->cookiebot_deactivated();
388
  }
392
  *
393
  * @since 3.6.3
394
  */
395
+ function cookiebot_addons_plugin_activated() {
396
  $cookiebot_addons = \cookiebot_addons\Cookiebot_Addons::instance();
397
  $cookiebot_addons->cookiebot_activated();
398
  }
399
 
400
  /**
401
+ * @param string $url
402
  *
403
  * @return string
404
  *
410
  // relative url does not have host so use home url domain
411
  $host = isset( $parsed_url['host'] ) ? $parsed_url['host'] : cookiebot_addons_get_home_url_domain();
412
 
413
+ $url_parts = explode( '.', $host );
414
 
415
+ $url_parts = array_slice( $url_parts, - 2 );
416
 
417
+ return implode( '.', $url_parts );
418
  }
419
 
420
  /**
428
  /** @var $host string */
429
  $host = $home_url['host'];
430
 
431
+ if ( empty( $host ) ) {
432
+ throw new Exception( 'Home url domain is not found.' );
433
  }
434
+
435
  return $host;
436
+ }
437
+
438
+ /**
439
+ * @param $file_path
440
+ *
441
+ * @return false|string
442
+ * @throws Exception
443
+ */
444
+ function cookiebot_get_local_file_contents( $file_path ) {
445
+ if ( ! file_exists( $file_path ) ) {
446
+ throw new Exception( 'File ' . $file_path . ' does not exist' );
447
+ }
448
+
449
+ ob_start();
450
+ include $file_path;
451
+
452
+ return ob_get_clean();
453
+ }
454
+
455
+ /**
456
+ * @param $file_path
457
+ *
458
+ * @return array
459
+ * @throws Exception
460
+ */
461
+ function cookiebot_get_local_file_json_contents( $file_path ) {
462
+ $json = cookiebot_get_local_file_contents( $file_path );
463
+
464
+ $decoded_json = json_decode( $json );
465
+
466
+ if ( ! is_a( $decoded_json, stdClass::class ) ) {
467
+ throw new Exception( 'Filepath ' . $file_path . ' could not be parsed as json file' );
468
+ }
469
+
470
+ /**
471
+ * @var array $decoded_json
472
+ */
473
+ return $decoded_json;
474
+ }
addons/lib/script-loader-tag/script-loader-tag-interface.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace cookiebot_addons\lib\script_loader_tag;
4
 
5
- Interface Script_Loader_Tag_Interface {
6
 
7
  /**
8
  * @param $tag
@@ -10,7 +10,7 @@ Interface Script_Loader_Tag_Interface {
10
  *
11
  * @return mixed
12
  */
13
- public function add_tag($tag, $type );
14
 
15
  /**
16
  * @param $tag
2
 
3
  namespace cookiebot_addons\lib\script_loader_tag;
4
 
5
+ interface Script_Loader_Tag_Interface {
6
 
7
  /**
8
  * @param $tag
10
  *
11
  * @return mixed
12
  */
13
+ public function add_tag( $tag, $type );
14
 
15
  /**
16
  * @param $tag
addons/lib/script-loader-tag/script-loader-tag.php CHANGED
@@ -49,6 +49,7 @@ class Script_Loader_Tag implements Script_Loader_Tag_Interface {
49
  */
50
  public function cookiebot_add_consent_attribute_to_tag( $tag, $handle, $src ) {
51
  if ( array_key_exists( $handle, $this->tags ) ) {
 
52
  return '<script src="' . $src . '" type="text/plain" data-cookieconsent="' . implode( ',', $this->tags[ $handle ] ) . '"></script>';
53
  }
54
 
49
  */
50
  public function cookiebot_add_consent_attribute_to_tag( $tag, $handle, $src ) {
51
  if ( array_key_exists( $handle, $this->tags ) ) {
52
+ //phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
53
  return '<script src="' . $src . '" type="text/plain" data-cookieconsent="' . implode( ',', $this->tags[ $handle ] ) . '"></script>';
54
  }
55
 
addons/lib/settings-service-interface.php CHANGED
@@ -2,15 +2,18 @@
2
 
3
  namespace cookiebot_addons\lib;
4
 
5
- use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
- use Cybot\Dependencies\DI;
7
 
8
- Interface Settings_Service_Interface {
 
 
 
 
9
 
10
  /**
11
  * Settings_Service constructor.
12
  *
13
- * @param $container DI\Container
14
  *
15
  * @since 1.3.0
16
  */
@@ -88,8 +91,7 @@ Interface Settings_Service_Interface {
88
  * Returns addons one by one through a generator
89
  *
90
  * @return \Generator
91
- * @throws DI\DependencyException
92
- * @throws DI\NotFoundException
93
  *
94
  * @since 1.3.0
95
  */
@@ -99,8 +101,7 @@ Interface Settings_Service_Interface {
99
  * Returns active addons
100
  *
101
  * @return array
102
- * @throws DI\DependencyException
103
- * @throws DI\NotFoundException
104
  *
105
  * @since 1.3.0
106
  */
@@ -112,12 +113,11 @@ Interface Settings_Service_Interface {
112
  * @param $option_key
113
  * @param $default_placeholder
114
  * @param $cookies
 
115
  *
116
- * @return bool|mixed
117
- *
118
- * @since 1.8.0
119
  */
120
- public function get_placeholder( $option_key, $default_placeholder, $cookies );
121
 
122
 
123
  /**
2
 
3
  namespace cookiebot_addons\lib;
4
 
5
+ use Exception;
 
6
 
7
+ /**
8
+ * Interface Settings_Service_Interface
9
+ * @package cookiebot_addons\lib
10
+ */
11
+ interface Settings_Service_Interface {
12
 
13
  /**
14
  * Settings_Service constructor.
15
  *
16
+ * @param $container Dependency_Container
17
  *
18
  * @since 1.3.0
19
  */
91
  * Returns addons one by one through a generator
92
  *
93
  * @return \Generator
94
+ * @throws Exception
 
95
  *
96
  * @since 1.3.0
97
  */
101
  * Returns active addons
102
  *
103
  * @return array
104
+ * @throws Exception
 
105
  *
106
  * @since 1.3.0
107
  */
113
  * @param $option_key
114
  * @param $default_placeholder
115
  * @param $cookies
116
+ * @param string $src
117
  *
118
+ * @return mixed
 
 
119
  */
120
+ public function get_placeholder( $option_key, $default_placeholder, $cookies, $src = '' );
121
 
122
 
123
  /**
addons/lib/settings-service.php CHANGED
@@ -3,16 +3,17 @@
3
  namespace cookiebot_addons\lib;
4
 
5
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
- use Cybot\Dependencies\DI;
 
7
 
8
  class Settings_Service implements Settings_Service_Interface {
9
 
10
  /**
11
- * @var DI\Container
12
  */
13
  public $container;
14
 
15
- CONST OPTION_NAME = 'cookiebot_available_addons';
16
 
17
  /**
18
  * Settings_Service constructor.
@@ -49,7 +50,7 @@ class Settings_Service implements Settings_Service_Interface {
49
  *
50
  * @param $addon
51
  *
52
- * @return int|\WP_Error
53
  *
54
  * @since 1.3.0
55
  */
@@ -67,8 +68,11 @@ class Settings_Service implements Settings_Service_Interface {
67
  * @since 2.2.1
68
  */
69
  public function get_addon_version( $addon ) {
70
- $plugin_data = get_file_data( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $addon, array( 'Version' => 'version' ),
71
- false );
 
 
 
72
 
73
  return ( isset( $plugin_data['Version'] ) ) ? $plugin_data['Version'] : false;
74
  }
@@ -83,7 +87,7 @@ class Settings_Service implements Settings_Service_Interface {
83
  * @since 1.3.0
84
  */
85
  public function is_addon_activated( $addon ) {
86
- return ( $addon === false || is_plugin_active( $addon ) ) ? true : false;
87
  }
88
 
89
  /**
@@ -130,8 +134,7 @@ class Settings_Service implements Settings_Service_Interface {
130
  * Returns addons one by one through a generator
131
  *
132
  * @return array
133
- * @throws DI\DependencyException
134
- * @throws DI\NotFoundException
135
  *
136
  * @since 1.3.0
137
  */
@@ -149,8 +152,7 @@ class Settings_Service implements Settings_Service_Interface {
149
  * Returns active addons
150
  *
151
  * @return array
152
- * @throws DI\DependencyException
153
- * @throws DI\NotFoundException
154
  *
155
  * @since 1.3.0
156
  */
@@ -158,8 +160,8 @@ class Settings_Service implements Settings_Service_Interface {
158
  $active_addons = array();
159
 
160
  foreach ( $this->get_addons() as $addon ) {
161
- /**
162
- * @var $addon Cookiebot_Addons_Interface
163
  * Load addon code if the plugin is active and addon is activated
164
  */
165
  if ( $addon->is_addon_enabled() && $addon->is_addon_installed() && $addon->is_addon_activated() ) {
@@ -329,6 +331,7 @@ class Settings_Service implements Settings_Service_Interface {
329
  * @param $option_key
330
  * @param $default_placeholder
331
  * @param $cookies
 
332
  *
333
  * @return bool|mixed
334
  *
@@ -381,7 +384,7 @@ class Settings_Service implements Settings_Service_Interface {
381
  private function get_translated_placeholder( $option, $option_key, $default_placeholder, $cookies, $src = '' ) {
382
  $current_lang = cookiebot_addons_get_language();
383
 
384
- if ( $current_lang == false || $current_lang == '' ) {
385
  $current_lang = 'site-default';
386
  }
387
 
@@ -394,12 +397,15 @@ class Settings_Service implements Settings_Service_Interface {
394
  /**
395
  * if current lang match with the prefix language in the database then get the text
396
  */
397
- if ( $key == $current_lang ) {
398
- $cookies_array = explode(', ',$cookies);
399
- $translated_cookie_names = cookiebot_translate_cookie_names($cookies_array);
400
- $translated_cookie_names = implode(', ', $translated_cookie_names);
401
- return $this->placeholder_merge_tag( $option[ $option_key ]['placeholder']['languages'][ $key ],
402
- $translated_cookie_names, $src );
 
 
 
403
  }
404
  }
405
  }
@@ -408,8 +414,11 @@ class Settings_Service implements Settings_Service_Interface {
408
  * Returns site-default text if no match found.
409
  */
410
  if ( isset( $option[ $option_key ]['placeholder']['languages']['site-default'] ) ) {
411
- return $this->placeholder_merge_tag( $option[ $option_key ]['placeholder']['languages']['site-default'],
412
- $cookies, $src );
 
 
 
413
  }
414
 
415
  /**
@@ -463,7 +472,7 @@ class Settings_Service implements Settings_Service_Interface {
463
  $parent_class = $addon->get_parent_class();
464
 
465
  if ( $parent_class !== false ) {
466
- if ( $parent_class == $addon_class ) {
467
  if ( $addon->is_addon_activated() ) {
468
  return true;
469
  }
@@ -485,7 +494,7 @@ class Settings_Service implements Settings_Service_Interface {
485
  * @since 2.1.3
486
  */
487
  public function is_latest_plugin_version( $addon ) {
488
- return ( get_parent_class( $addon ) === false ) ? true : false;
489
  }
490
 
491
  /**
@@ -494,8 +503,7 @@ class Settings_Service implements Settings_Service_Interface {
494
  *
495
  * @param $addon_option_name string Addon option name
496
  *
497
- * @throws DI\DependencyException
498
- * @throws DI\NotFoundException
499
  *
500
  * @since 2.2.0
501
  */
@@ -503,7 +511,7 @@ class Settings_Service implements Settings_Service_Interface {
503
  $addons = $this->get_addons();
504
 
505
  foreach ( $addons as $addon ) {
506
- if ( $addon->get_option_name() == $addon_option_name ) {
507
  $addon->post_hook_after_enabling();
508
  }
509
  }
@@ -529,7 +537,7 @@ class Settings_Service implements Settings_Service_Interface {
529
  public function cookiebot_activated() {
530
  $option = get_option( static::OPTION_NAME );
531
 
532
- if( $option == false ) {
533
  $option = array();
534
 
535
  foreach ( $this->get_addons() as $addon ) {
3
  namespace cookiebot_addons\lib;
4
 
5
  use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
6
+ use Exception;
7
+ use WP_Error;
8
 
9
  class Settings_Service implements Settings_Service_Interface {
10
 
11
  /**
12
+ * @var Dependency_Container
13
  */
14
  public $container;
15
 
16
+ const OPTION_NAME = 'cookiebot_available_addons';
17
 
18
  /**
19
  * Settings_Service constructor.
50
  *
51
  * @param $addon
52
  *
53
+ * @return int|WP_Error
54
  *
55
  * @since 1.3.0
56
  */
68
  * @since 2.2.1
69
  */
70
  public function get_addon_version( $addon ) {
71
+ $plugin_data = get_file_data(
72
+ WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $addon,
73
+ array( 'Version' => 'version' ),
74
+ false
75
+ );
76
 
77
  return ( isset( $plugin_data['Version'] ) ) ? $plugin_data['Version'] : false;
78
  }
87
  * @since 1.3.0
88
  */
89
  public function is_addon_activated( $addon ) {
90
+ return $addon === false || is_plugin_active( $addon );
91
  }
92
 
93
  /**
134
  * Returns addons one by one through a generator
135
  *
136
  * @return array
137
+ * @throws Exception
 
138
  *
139
  * @since 1.3.0
140
  */
152
  * Returns active addons
153
  *
154
  * @return array
155
+ * @throws Exception
 
156
  *
157
  * @since 1.3.0
158
  */
160
  $active_addons = array();
161
 
162
  foreach ( $this->get_addons() as $addon ) {
163
+ /**
164
+ * @var $addon Cookiebot_Addons_Interface
165
  * Load addon code if the plugin is active and addon is activated
166
  */
167
  if ( $addon->is_addon_enabled() && $addon->is_addon_installed() && $addon->is_addon_activated() ) {
331
  * @param $option_key
332
  * @param $default_placeholder
333
  * @param $cookies
334
+ * @param string $src
335
  *
336
  * @return bool|mixed
337
  *
384
  private function get_translated_placeholder( $option, $option_key, $default_placeholder, $cookies, $src = '' ) {
385
  $current_lang = cookiebot_addons_get_language();
386
 
387
+ if ( $current_lang === false || $current_lang === '' ) {
388
  $current_lang = 'site-default';
389
  }
390
 
397
  /**
398
  * if current lang match with the prefix language in the database then get the text
399
  */
400
+ if ( $key === $current_lang ) {
401
+ $cookies_array = explode( ', ', $cookies );
402
+ $translated_cookie_names = cookiebot_translate_cookie_names( $cookies_array );
403
+ $translated_cookie_names = implode( ', ', $translated_cookie_names );
404
+ return $this->placeholder_merge_tag(
405
+ $option[ $option_key ]['placeholder']['languages'][ $key ],
406
+ $translated_cookie_names,
407
+ $src
408
+ );
409
  }
410
  }
411
  }
414
  * Returns site-default text if no match found.
415
  */
416
  if ( isset( $option[ $option_key ]['placeholder']['languages']['site-default'] ) ) {
417
+ return $this->placeholder_merge_tag(
418
+ $option[ $option_key ]['placeholder']['languages']['site-default'],
419
+ $cookies,
420
+ $src
421
+ );
422
  }
423
 
424
  /**
472
  $parent_class = $addon->get_parent_class();
473
 
474
  if ( $parent_class !== false ) {
475
+ if ( $parent_class === $addon_class ) {
476
  if ( $addon->is_addon_activated() ) {
477
  return true;
478
  }
494
  * @since 2.1.3
495
  */
496
  public function is_latest_plugin_version( $addon ) {
497
+ return get_parent_class( $addon ) === false;
498
  }
499
 
500
  /**
503
  *
504
  * @param $addon_option_name string Addon option name
505
  *
506
+ * @throws Exception
 
507
  *
508
  * @since 2.2.0
509
  */
511
  $addons = $this->get_addons();
512
 
513
  foreach ( $addons as $addon ) {
514
+ if ( $addon->get_option_name() === $addon_option_name ) {
515
  $addon->post_hook_after_enabling();
516
  }
517
  }
537
  public function cookiebot_activated() {
538
  $option = get_option( static::OPTION_NAME );
539
 
540
+ if ( $option === false ) {
541
  $option = array();
542
 
543
  foreach ( $this->get_addons() as $addon ) {
addons/lib/theme-settings-service.php CHANGED
@@ -15,7 +15,7 @@ class Theme_Settings_Service extends Settings_Service {
15
  * @since 1.3.0
16
  */
17
  public function is_addon_installed( $addon ) {
18
- return wp_get_theme($addon)->exists();
19
  }
20
 
21
  /**
@@ -28,9 +28,9 @@ class Theme_Settings_Service extends Settings_Service {
28
  * @since 2.2.1
29
  */
30
  public function get_addon_version( $addon ) {
31
- $theme = wp_get_theme($addon);
32
- if($theme->exists()) {
33
- return $theme->get('Version');
34
  }
35
 
36
  return false;
15
  * @since 1.3.0
16
  */
17
  public function is_addon_installed( $addon ) {
18
+ return wp_get_theme( $addon )->exists();
19
  }
20
 
21
  /**
28
  * @since 2.2.1
29
  */
30
  public function get_addon_version( $addon ) {
31
+ $theme = wp_get_theme( $addon );
32
+ if ( $theme->exists() ) {
33
+ return $theme->get( 'Version' );
34
  }
35
 
36
  return false;
addons/tests/integration/addons/test-wp-google-analytics-events.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace cookiebot_addons\tests\integration\addons;
4
+
5
+ class Test_Wp_Google_Analytics_Events extends Addons_Base {
6
+
7
+ public function setUp() {}
8
+
9
+ /**
10
+ * This will validate if the hooks for "wp_google_analytics_events" still exists
11
+ *
12
+ * @since 2.1.0
13
+ */
14
+ public function test_wd_google_analytics() {
15
+ $content = $this->curl_get_content( 'https://plugins.svn.wordpress.org/wp-google-analytics-events/trunk/ga-scroll-event.php' );
16
+
17
+ $include_snippet = <<<TEXT
18
+ add_action('wp_head',
19
+ array('GAESnippets', 'add_snippet_to_header'),
20
+ 0);
21
+ TEXT;
22
+
23
+ $required_code_snippets = array(
24
+ "wp_register_script('ga_events_frontend_bundle',",
25
+ "wp_localize_script('ga_events_frontend_bundle',",
26
+ "wp_enqueue_script('ga_events_frontend_bundle');",
27
+ "wp_register_script('ga_events_main_script',",
28
+ "wp_localize_script('ga_events_main_script',",
29
+ "wp_enqueue_script('ga_events_main_script');",
30
+ $include_snippet,
31
+ );
32
+
33
+ foreach ( $required_code_snippets as $required_code_snippet ) {
34
+ $this->assertNotFalse( strpos( $content, $required_code_snippet ) );
35
+ }
36
+ }
37
+ }
addons/tests/unit/test-cookie-consent.php CHANGED
@@ -3,9 +3,11 @@
3
  namespace cookiebot_addons\tests\unit;
4
 
5
  use cookiebot_addons\lib\Cookie_Consent;
6
- use DI\ContainerBuilder;
7
- use DI;
8
 
 
 
 
 
9
  class Test_Cookie_Consent extends \WP_UnitTestCase {
10
 
11
  /**
3
  namespace cookiebot_addons\tests\unit;
4
 
5
  use cookiebot_addons\lib\Cookie_Consent;
 
 
6
 
7
+ /**
8
+ * Class Test_Cookie_Consent
9
+ * @package cookiebot_addons\tests\unit
10
+ */
11
  class Test_Cookie_Consent extends \WP_UnitTestCase {
12
 
13
  /**
addons/view/admin/settings/available-addon-callback.php CHANGED
@@ -1,94 +1,104 @@
1
  <?php
2
- /** @var \cookiebot_addons\controller\addons\Cookiebot_Addons_Interface $addon */
 
 
 
 
3
  $addon = $args['addon'];
4
 
5
- require_once( ABSPATH . '/wp-includes/l10n.php' );
6
- require_once( ABSPATH . '/wp-admin/includes/translation-install.php' );
7
  ?>
8
- <div class="postbox cookiebot-addon">
9
- <p>
10
- <label for="<?php echo 'enabled_' . $addon->get_option_name(); ?>"><?php esc_html_e( 'Enable', 'cookie' ); ?></label>
11
- <input type="checkbox" id="<?php echo 'enabled_' . $addon->get_option_name(); ?>"
12
- name="cookiebot_available_addons[<?php echo $addon->get_option_name() ?>][enabled]"
13
- value="1" <?php checked( 1, $addon->is_addon_enabled(), true ); ?> />
14
- </p>
15
- <p><?php esc_html_e( 'Check one or multiple cookie types:', 'cookiebot' ); ?></p>
16
- <ul class="cookietypes">
17
- <li><input type="checkbox" id="cookie_type_preferences_<?php echo $addon->get_option_name(); ?>"
18
- value="preferences"
19
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'preferences' ); ?>
20
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][cookie_type][]"><label>Preferences</label>
21
- </li>
22
- <li><input type="checkbox" id="cookie_type_statistics_<?php echo $addon->get_option_name(); ?>"
23
- value="statistics"
24
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'statistics' ); ?>
25
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][cookie_type][]"><label>Statistics</label>
26
- </li>
27
- <li><input type="checkbox" id="cookie_type_marketing_<?php echo $addon->get_option_name(); ?>"
28
- value="marketing"
29
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'marketing' ); ?>
30
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][cookie_type][]"><label>Marketing</label>
31
- </li>
32
- </ul>
33
 
34
- <p>
35
- <label><?php esc_html_e( 'Display a placeholder', 'cookiebot-addons' ); ?></label>
36
- <input type="checkbox"
37
- class="placeholder_enable"
38
- data-addon="<?php echo $addon->get_option_name(); ?>"
39
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][placeholder][enabled]"
40
  <?php checked( 1, $addon->is_placeholder_enabled() ); ?>
41
- value="1">
42
- </p>
43
 
44
- <div class="placeholder"
45
- data-addon="<?php echo $addon->get_option_name(); ?>" <?php echo ( ! $addon->is_placeholder_enabled() ) ? 'style="display:none"' : ''; ?>>
46
- <?php if ( $addon->has_placeholder() ): ?>
47
  <?php $count = 0; ?>
48
- <?php foreach ( $addon->get_placeholders() as $placeholder_lang => $placeholder_value ): ?>
49
- <div class="placeholder_content submitbox">
50
- <p>
51
- <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
52
  <?php
53
  $name = 'cookiebot_available_addons[' . $addon->get_option_name() . '][placeholder][languages][' . $placeholder_lang . ']';
 
 
54
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, $placeholder_lang );
55
  ?>
56
- <?php if ( $count != 0 ): ?>
57
- <a href=""
58
- class="submitdelete deletion"><?php esc_html_e( 'Remove language', 'cookiebot-addons' ); ?></a>
59
  <?php endif; ?>
60
- </p>
61
- <p>
62
- <textarea cols="60" rows="5"
63
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][placeholder][languages][<?php echo $placeholder_lang; ?>]"><?php echo $placeholder_value; ?></textarea>
64
- <span class="help-tip" title="<?php echo $addon->get_placeholder_helper(); ?>"></span>
65
- </p>
66
- </div>
 
67
  <?php $count ++; ?>
68
  <?php endforeach; ?>
69
- <?php else: ?>
70
- <div class="placeholder_content">
71
- <p>
72
- <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
73
  <?php
74
  $name = 'cookiebot_available_addons[' . $addon->get_option_name() . '][placeholder][languages][site-default]';
 
 
75
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, '' );
76
  ?>
77
- </p>
78
- <p>
79
- <textarea cols="80" rows="5"
80
- name="cookiebot_available_addons[<?php echo $addon->get_option_name(); ?>][placeholder][languages][site-default]"><?php echo $addon->get_default_placeholder(); ?></textarea>
81
- <span class="help-tip" title="<?php echo $addon->get_placeholder_helper(); ?>"></span>
82
- </p>
83
- </div>
 
84
  <?php endif; ?>
85
 
86
- <p class="add_placeholder_language">
87
- <button class="btn_add_language button button-secondary"
88
- data-addon="<?php echo $addon->get_option_name(); ?>"><?php esc_html_e( '+ Add language', 'cookiebot-addons' ); ?></button>
89
- </p>
90
- </div>
91
- <?php
92
- $addon->extra_available_addon_option();
93
- ?>
94
- </div>
1
  <?php
2
+
3
+ use cookiebot_addons\controller\addons\Cookiebot_Addons_Interface;
4
+
5
+ /** @var Cookiebot_Addons_Interface $addon */
6
+ /** @var array $args */
7
  $addon = $args['addon'];
8
 
9
+ require_once ABSPATH . '/wp-includes/l10n.php';
10
+ require_once ABSPATH . '/wp-admin/includes/translation-install.php';
11
  ?>
12
+ <div class="postbox cookiebot-addon">
13
+ <p>
14
+ <label for="<?php echo 'enabled_' . esc_attr( $addon->get_option_name() ); ?>"><?php esc_html_e( 'Enable', 'cookie' ); ?></label>
15
+ <input type="checkbox" id="<?php echo 'enabled_' . esc_attr( $addon->get_option_name() ); ?>"
16
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][enabled]"
17
+ value="1" <?php checked( 1, $addon->is_addon_enabled(), true ); ?> />
18
+ </p>
19
+ <p><?php esc_html_e( 'Check one or multiple cookie types:', 'cookiebot' ); ?></p>
20
+ <ul class="cookietypes">
21
+ <li><input type="checkbox" id="cookie_type_preferences_<?php echo esc_attr( $addon->get_option_name() ); ?>"
22
+ value="preferences"
23
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'preferences' ); ?>
24
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][cookie_type][]"><label>Preferences</label>
25
+ </li>
26
+ <li><input type="checkbox" id="cookie_type_statistics_<?php echo esc_attr( $addon->get_option_name() ); ?>"
27
+ value="statistics"
28
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'statistics' ); ?>
29
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][cookie_type][]"><label>Statistics</label>
30
+ </li>
31
+ <li><input type="checkbox" id="cookie_type_marketing_<?php echo esc_attr( $addon->get_option_name() ); ?>"
32
+ value="marketing"
33
  <?php cookiebot_addons_checked_selected_helper( $addon->get_cookie_types(), 'marketing' ); ?>
34
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][cookie_type][]"><label>Marketing</label>
35
+ </li>
36
+ </ul>
37
 
38
+ <p>
39
+ <label><?php esc_html_e( 'Display a placeholder', 'cookiebot-addons' ); ?></label>
40
+ <input type="checkbox"
41
+ class="placeholder_enable"
42
+ data-addon="<?php echo esc_attr( $addon->get_option_name() ); ?>"
43
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][placeholder][enabled]"
44
  <?php checked( 1, $addon->is_placeholder_enabled() ); ?>
45
+ value="1">
46
+ </p>
47
 
48
+ <div class="placeholder"
49
+ data-addon="<?php echo esc_attr( $addon->get_option_name() ); ?>" <?php echo ( ! $addon->is_placeholder_enabled() ) ? 'style="display:none"' : ''; ?>>
50
+ <?php if ( $addon->has_placeholder() ) : ?>
51
  <?php $count = 0; ?>
52
+ <?php foreach ( $addon->get_placeholders() as $placeholder_lang => $placeholder_value ) : ?>
53
+ <div class="placeholder_content submitbox">
54
+ <p>
55
+ <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
56
  <?php
57
  $name = 'cookiebot_available_addons[' . $addon->get_option_name() . '][placeholder][languages][' . $placeholder_lang . ']';
58
+ // The "cookiebot_addons_get_dropdown_languages" function sufficiently escapes the output
59
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
60
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, $placeholder_lang );
61
  ?>
62
+ <?php if ( $count != 0 ) : ?>
63
+ <a href=""
64
+ class="submitdelete deletion"><?php esc_html_e( 'Remove language', 'cookiebot-addons' ); ?></a>
65
  <?php endif; ?>
66
+ </p>
67
+ <p>
68
+ <textarea cols="60" rows="5"
69
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][placeholder][languages][<?php echo esc_attr( $placeholder_lang ); ?>]"
70
+ ><?php echo esc_html( $placeholder_value ); ?></textarea>
71
+ <span class="help-tip" title="<?php echo esc_attr( $addon->get_placeholder_helper() ); ?>"></span>
72
+ </p>
73
+ </div>
74
  <?php $count ++; ?>
75
  <?php endforeach; ?>
76
+ <?php else : ?>
77
+ <div class="placeholder_content">
78
+ <p>
79
+ <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
80
  <?php
81
  $name = 'cookiebot_available_addons[' . $addon->get_option_name() . '][placeholder][languages][site-default]';
82
+ // The "cookiebot_addons_get_dropdown_languages" function sufficiently escapes the output
83
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
84
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, '' );
85
  ?>
86
+ </p>
87
+ <p>
88
+ <textarea cols="80" rows="5"
89
+ name="cookiebot_available_addons[<?php echo esc_attr( $addon->get_option_name() ); ?>][placeholder][languages][site-default]"
90
+ ><?php echo esc_html( $addon->get_default_placeholder() ); ?></textarea>
91
+ <span class="help-tip" title="<?php echo esc_attr( $addon->get_placeholder_helper() ); ?>"></span>
92
+ </p>
93
+ </div>
94
  <?php endif; ?>
95
 
96
+ <p class="add_placeholder_language">
97
+ <button class="btn_add_language button button-secondary"
98
+ data-addon="<?php echo esc_attr( $addon->get_option_name() ); ?>"><?php esc_html_e( '+ Add language', 'cookiebot-addons' ); ?></button>
99
+ </p>
100
+ </div>
101
+ <?php
102
+ $addon->extra_available_addon_option();
103
+ ?>
104
+ </div>
addons/view/admin/settings/jetpack-addon-callback.php CHANGED
@@ -5,28 +5,28 @@ $addon = $args['addon'];
5
  ?>
6
  <div class="postbox cookiebot-addon">
7
  <p>
8
- <label for="<?php echo 'enabled_' . $widget->get_widget_option_name(); ?>"><?php esc_html_e( 'Enable', 'cookiebot' ); ?></label>
9
- <input type="checkbox" id="<?php echo 'enabled_' . $widget->get_widget_option_name(); ?>"
10
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][enabled]"
11
  value="1" <?php checked( 1, $widget->is_widget_enabled(), true ); ?> />
12
  </p>
13
  <p>
14
  <span><?php esc_html_e( 'Check one or multiple cookie types:', 'cookiebot' ); ?></span><br>
15
  <ul class="cookietypes">
16
- <li><input type="checkbox" id="cookie_type_preferences_<?php echo $widget->get_widget_option_name(); ?>"
17
  value="preferences"
18
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'preferences' ); ?>
19
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][cookie_type][]"><label>Preferences</label>
20
  </li>
21
- <li><input type="checkbox" id="cookie_type_statistics_<?php echo $widget->get_widget_option_name(); ?>"
22
  value="statistics"
23
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'statistics' ); ?>
24
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][cookie_type][]"><label>Statistics</label>
25
  </li>
26
- <li><input type="checkbox" id="cookie_type_marketing_<?php echo $widget->get_widget_option_name(); ?>"
27
  value="marketing"
28
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'marketing' ); ?>
29
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][cookie_type][]"><label>Marketing</label>
30
  </li>
31
  </ul>
32
  </p>
@@ -35,14 +35,14 @@ $addon = $args['addon'];
35
  <label><?php esc_html_e( 'Display a placeholder', 'cookiebot' ); ?></label>
36
  <input type="checkbox"
37
  class="placeholder_enable"
38
- data-addon="<?php echo $widget->get_widget_option_name(); ?>"
39
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][placeholder][enabled]"
40
  <?php checked( 1, $widget->is_widget_placeholder_enabled() ); ?>
41
  value="1">
42
  </p>
43
 
44
  <div class="placeholder"
45
- data-addon="<?php echo $widget->get_widget_option_name(); ?>" <?php echo ( ! $widget->is_widget_placeholder_enabled() ) ? 'style="display:none"' : ''; ?>>
46
  <?php if ( $widget->widget_has_placeholder() ): ?>
47
  <?php $count = 0; ?>
48
  <?php foreach ( $widget->get_widget_placeholders() as $placeholder_lang => $placeholder_value ): ?>
@@ -51,7 +51,9 @@ $addon = $args['addon'];
51
  <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
52
  <?php
53
  $name = 'cookiebot_jetpack_addon[' . $widget->get_widget_option_name() . '][placeholder][languages][' . $placeholder_lang . ']';
54
- echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, $placeholder_lang );
 
 
55
  ?>
56
  <?php if ( $count != 0 ): ?>
57
  <a href=""
@@ -60,8 +62,9 @@ $addon = $args['addon'];
60
  </p>
61
  <p>
62
  <textarea cols="60" rows="5"
63
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][placeholder][languages][<?php echo $placeholder_lang; ?>]"><?php echo $placeholder_value; ?></textarea>
64
- <span class="help-tip" title="<?php echo $addon->get_placeholder_helper(); ?>"></span>
 
65
  </p>
66
  </div>
67
  <?php $count ++; ?>
@@ -72,13 +75,16 @@ $addon = $args['addon'];
72
  <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
73
  <?php
74
  $name = 'cookiebot_jetpack_addon[' . $widget->get_widget_option_name() . '][placeholder][languages][site-default]';
 
 
75
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, '' );
76
  ?>
77
  </p>
78
  <p>
79
  <textarea cols="80" rows="5"
80
- name="cookiebot_jetpack_addon[<?php echo $widget->get_widget_option_name(); ?>][placeholder][languages][site-default]"><?php echo $widget->get_default_placeholder(); ?></textarea>
81
- <span class="help-tip" title="<?php echo $addon->get_placeholder_helper(); ?>"></span>
 
82
  </p>
83
  </div>
84
  <?php endif; ?>
@@ -86,7 +92,7 @@ $addon = $args['addon'];
86
 
87
  <p class="add_placeholder_language">
88
  <button class="btn_add_language button button-secondary"
89
- data-addon="<?php echo $widget->get_widget_option_name(); ?>"><?php esc_html_e( '+ Add language', 'cookiebot-addons' ); ?></button>
90
  </p>
91
  </div>
92
  </div>
5
  ?>
6
  <div class="postbox cookiebot-addon">
7
  <p>
8
+ <label for="<?php echo 'enabled_' . esc_attr( $widget->get_widget_option_name() ); ?>"><?php esc_html_e( 'Enable', 'cookiebot' ); ?></label>
9
+ <input type="checkbox" id="<?php echo 'enabled_' . esc_attr( $widget->get_widget_option_name() ); ?>"
10
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][enabled]"
11
  value="1" <?php checked( 1, $widget->is_widget_enabled(), true ); ?> />
12
  </p>
13
  <p>
14
  <span><?php esc_html_e( 'Check one or multiple cookie types:', 'cookiebot' ); ?></span><br>
15
  <ul class="cookietypes">
16
+ <li><input type="checkbox" id="cookie_type_preferences_<?php echo esc_attr( $widget->get_widget_option_name() ); ?>"
17
  value="preferences"
18
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'preferences' ); ?>
19
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][cookie_type][]"><label>Preferences</label>
20
  </li>
21
+ <li><input type="checkbox" id="cookie_type_statistics_<?php echo esc_attr( $widget->get_widget_option_name() ); ?>"
22
  value="statistics"
23
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'statistics' ); ?>
24
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][cookie_type][]"><label>Statistics</label>
25
  </li>
26
+ <li><input type="checkbox" id="cookie_type_marketing_<?php echo esc_attr( $widget->get_widget_option_name() ); ?>"
27
  value="marketing"
28
  <?php cookiebot_addons_checked_selected_helper( $widget->get_widget_cookie_types( $widget->get_widget_option_name() ), 'marketing' ); ?>
29
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][cookie_type][]"><label>Marketing</label>
30
  </li>
31
  </ul>
32
  </p>
35
  <label><?php esc_html_e( 'Display a placeholder', 'cookiebot' ); ?></label>
36
  <input type="checkbox"
37
  class="placeholder_enable"
38
+ data-addon="<?php echo esc_attr( $widget->get_widget_option_name() ); ?>"
39
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][placeholder][enabled]"
40
  <?php checked( 1, $widget->is_widget_placeholder_enabled() ); ?>
41
  value="1">
42
  </p>
43
 
44
  <div class="placeholder"
45
+ data-addon="<?php echo esc_attr( $widget->get_widget_option_name() ); ?>" <?php echo ( ! $widget->is_widget_placeholder_enabled() ) ? 'style="display:none"' : ''; ?>>
46
  <?php if ( $widget->widget_has_placeholder() ): ?>
47
  <?php $count = 0; ?>
48
  <?php foreach ( $widget->get_widget_placeholders() as $placeholder_lang => $placeholder_value ): ?>
51
  <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
52
  <?php
53
  $name = 'cookiebot_jetpack_addon[' . $widget->get_widget_option_name() . '][placeholder][languages][' . $placeholder_lang . ']';
54
+ // the "cookiebot_addons_get_dropdown_languages" function already sufficiently escapes the output
55
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
56
+ echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, $placeholder_lang );
57
  ?>
58
  <?php if ( $count != 0 ): ?>
59
  <a href=""
62
  </p>
63
  <p>
64
  <textarea cols="60" rows="5"
65
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][placeholder][languages][<?php echo esc_attr( $placeholder_lang ); ?>]"
66
+ ><?php echo esc_html( $placeholder_value ); ?></textarea>
67
+ <span class="help-tip" title="<?php echo esc_attr( $addon->get_placeholder_helper() ); ?>"></span>
68
  </p>
69
  </div>
70
  <?php $count ++; ?>
75
  <label><?php esc_html_e( 'Language', 'cookiebot-addons' ); ?></label>
76
  <?php
77
  $name = 'cookiebot_jetpack_addon[' . $widget->get_widget_option_name() . '][placeholder][languages][site-default]';
78
+ // the "cookiebot_addons_get_dropdown_languages" function already sufficiently escapes the output
79
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
80
  echo cookiebot_addons_get_dropdown_languages( 'placeholder_select_language', $name, '' );
81
  ?>
82
  </p>
83
  <p>
84
  <textarea cols="80" rows="5"
85
+ name="cookiebot_jetpack_addon[<?php echo esc_attr( $widget->get_widget_option_name() ); ?>][placeholder][languages][site-default]"
86
+ ><?php echo esc_html( $widget->get_default_placeholder() ); ?></textarea>
87
+ <span class="help-tip" title="<?php echo esc_attr( $addon->get_placeholder_helper() ); ?>"></span>
88
  </p>
89
  </div>
90
  <?php endif; ?>
92
 
93
  <p class="add_placeholder_language">
94
  <button class="btn_add_language button button-secondary"
95
+ data-addon="<?php echo esc_attr( $widget->get_widget_option_name() ); ?>"><?php esc_html_e( '+ Add language', 'cookiebot-addons' ); ?></button>
96
  </p>
97
  </div>
98
  </div>
addons/view/admin/settings/setting-page.php CHANGED
@@ -58,7 +58,7 @@
58
 
59
  </h2>
60
 
61
- <form method="post" action="options.php" class="<?php echo $active_tab; ?>">
62
  <?php
63
 
64
  if ( $active_tab == 'available_addons' ) {
58
 
59
  </h2>
60
 
61
+ <form method="post" action="options.php" class="<?php echo esc_attr( $active_tab ); ?>">
62
  <?php
63
 
64
  if ( $active_tab == 'available_addons' ) {
cookiebot.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control
4
  Plugin URI: https://cookiebot.com/
5
  Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
6
  Author: Cybot A/S
7
- Version: 3.10.1
8
  Author URI: http://cookiebot.com
9
  Text Domain: cookiebot
10
  Domain Path: /langs
@@ -23,29 +23,30 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
23
  * @var string
24
  * @since 1.0.0
25
  */
26
- public $version = '3.10.1';
27
 
28
  /**
29
  * @var Cookiebot_WP The single instance of the class
30
  * @since 1.0.0
31
  */
32
- protected static $_instance = null;
33
 
34
  /**
35
  * Main Cookiebot_WP Instance
36
  *
37
  * Ensures only one instance of Cookiebot_WP is loaded or can be loaded.
38
  *
39
- * @version 1.0.0
40
  * @since 1.0.0
41
  * @static
42
- * @return Cookiebot_WP - Main instance
43
  */
44
  public static function instance() {
45
- if ( is_null( self::$_instance ) ) {
46
- self::$_instance = new self();
47
  }
48
- return self::$_instance;
 
49
  }
50
 
51
  /**
@@ -55,7 +56,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
55
  * @since 1.0.0
56
  * @access public
57
  */
58
- function __construct() {
59
  add_action( 'after_setup_theme', array( $this, 'cookiebot_init' ), 5 );
60
  register_activation_hook( __FILE__, array( $this, 'activation' ) );
61
  register_deactivation_hook( __FILE__, 'cookiebot_addons_plugin_deactivated' );
@@ -70,13 +71,13 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
70
  * @since 2.1.4
71
  * @accces public
72
  */
73
- function activation() {
74
  //Delay display of recommendation notice in 3 days if not activated ealier
75
  if ( get_option( 'cookiebot_notice_recommend', false ) === false ) {
76
  //Not set yet - this must be first activation - delay in 3 days
77
  update_option( 'cookiebot_notice_recommend', strtotime( '+3 days' ) );
78
  }
79
- if ( $this->get_cbid() == '' ) {
80
  if ( is_multisite() ) {
81
  update_site_option( 'cookiebot-cookie-blocking-mode', 'auto' );
82
  update_site_option( 'cookiebot-nooutput-admin', true );
@@ -89,7 +90,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
89
  /**
90
  * Run through the addons and enable the default ones
91
  */
92
- if ( ( ! defined( 'COOKIEBOT_ADDONS_STANDALONE' ) || COOKIEBOT_ADDONS_STANDALONE != true || ! defined( 'COOKIE_ADDONS_LOADED' ) ) ) {
93
  //Make sure we got a PHP version that works
94
  if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
95
  define( 'COOKIEBOT_URL', plugin_dir_url( __FILE__ ) );
@@ -108,11 +109,11 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
108
  * @since 1.6.2
109
  * @access public
110
  */
111
- function cookiebot_init() {
112
  /* Load Cookiebot Addons Framework */
113
- $dismissAddons = false;
114
  if ( defined( 'CAF_DIR' ) ) {
115
- $dismissAddons = true;
116
  /*add_action('admin_notices', function() {
117
  ?>
118
  <div class="notice notice-warning">
@@ -124,10 +125,9 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
124
  </div>
125
  <?php
126
  });*/
127
- }
128
- //elseif( $this->get_cookie_blocking_mode() !== 'auto' ) {
129
  else {
130
- if ( ( ! defined( 'COOKIEBOT_ADDONS_STANDALONE' ) || COOKIEBOT_ADDONS_STANDALONE != true || ! defined( 'COOKIE_ADDONS_LOADED' ) ) && $dismissAddons !== true ) {
131
  //Make sure we got a PHP version that works
132
  if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
133
  define( 'COOKIEBOT_URL', plugin_dir_url( __FILE__ ) );
@@ -138,13 +138,13 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
138
  } else {
139
  add_action(
140
  'admin_notices',
141
- function() {
142
  ?>
143
- <div class="notice notice-warning">
144
- <p>
145
- <?php esc_html_e( 'You are using Cookiebot Addons Standalone.', 'cookiebot' ); ?>
146
- </p>
147
- </div>
148
  <?php
149
  }
150
  );
@@ -174,7 +174,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
174
  //Check if we should show cookie consent banner on admin pages
175
  if ( ! $this->cookiebot_disabled_in_admin() ) {
176
  //adding cookie banner in admin area too
177
- add_action( 'admin_head', array( $this, 'add_js' ), -9999 );
178
  }
179
  }
180
 
@@ -187,9 +187,9 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
187
  load_plugin_textdomain( 'cookiebot', false, dirname( plugin_basename( __FILE__ ) ) . '/langs/' );
188
 
189
  //add JS
190
- add_action( 'wp_head', array( $this, 'add_js' ), -9997 );
191
- add_action( 'wp_head', array( $this, 'add_GTM' ), -9998 );
192
- add_action( 'wp_head', array( $this, 'add_GCM' ), -9999 );
193
  add_shortcode( 'cookie_declaration', array( $this, 'show_declaration' ) );
194
 
195
  //Add filter if WP rocket is enabled
@@ -221,7 +221,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
221
  * @version 3.7.0
222
  * @since 3.7.0
223
  */
224
- function gutenberg_block_setup() {
225
  if ( ! function_exists( 'register_block_type' ) ) {
226
  return; //gutenberg not active
227
  }
@@ -240,7 +240,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
240
  * @version 3.7.1
241
  * @since 3.7.1
242
  */
243
- function gutenberg_block_admin_assets() {
244
  //Add Gutenberg Widget
245
  wp_enqueue_script(
246
  'cookiebot-declaration',
@@ -256,7 +256,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
256
  * @version 3.7.0
257
  * @since 3.7.0
258
  */
259
- function block_cookie_declaration() {
260
  return $this->show_declaration();
261
  }
262
 
@@ -266,7 +266,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
266
  * @version 2.0.0
267
  * @since 2.0.0
268
  */
269
- function load_textdomain() {
270
  load_plugin_textdomain( 'cookiebot', false, basename( dirname( __FILE__ ) ) . '/langs' );
271
  }
272
 
@@ -276,7 +276,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
276
  * @version 2.5.0
277
  * @since 2.5.0
278
  */
279
- function register_widgets() {
280
  register_widget( 'Cookiebot_Declaration_Widget' );
281
  }
282
 
@@ -287,7 +287,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
287
  * @since 1.0.0
288
  */
289
 
290
- function add_dashboard_widgets() {
291
  wp_add_dashboard_widget( 'cookiebot_status', esc_html__( 'Cookiebot Status', 'cookiebot' ), array( $this, 'dashboard_widget_status' ) );
292
  }
293
 
@@ -297,7 +297,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
297
  * @version 1.0.0
298
  * @since 1.0.0
299
  */
300
- function dashboard_widget_status() {
301
  $cbid = $this->get_cbid();
302
  if ( empty( $cbid ) ) {
303
  echo '<p>' . esc_html__( 'You need to enter your Cookiebot ID.', 'cookiebot' ) . '</p>';
@@ -315,24 +315,71 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
315
  * @version 2.2.0
316
  * @since 1.0.0
317
  */
318
- function add_menu() {
319
  //Cookiebot Icon SVG base64 encoded
320
  $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNDYuODcyNTkwMyA4Ljc3MzU4MzM0QzQxLjk0MzkwMzkgMy4zODI5NTAxMSAzNC44NDI0OTQ2IDAgMjYuOTQ4MjgxOSAwIDEyLjA2NTE1NjggMCAwIDEyLjAyNDQ3NzQgMCAyNi44NTc0MjE5YzAgMTQuODMyOTQ0NSAxMi4wNjUxNTY4IDI2Ljg1NzQyMTkgMjYuOTQ4MjgxOSAyNi44NTc0MjE5IDcuODk0MjEyNyAwIDE0Ljk5NTYyMi0zLjM4Mjk1MDIgMTkuOTI0MzA4NC04Ljc3MzU4MzQtMi44ODk2OTY3LTEuMzY4ODY2My01LjM5OTMxMS0zLjQwNTQzOS03LjMyODA4MzgtNS45MDk2MzU4LTMuMTIxNDMwNiAzLjIwOTQxMDQtNy40OTI5OTQ0IDUuMjA0MTI5MS0xMi4zMzIwMjU4IDUuMjA0MTI5MS05LjQ4NDM0NDQgMC0xNy4xNzI5MjQ3LTcuNjYyNjU3Mi0xNy4xNzI5MjQ3LTE3LjExNTAyMzhzNy42ODg1ODAzLTE3LjExNTAyMzcgMTcuMTcyOTI0Ny0xNy4xMTUwMjM3YzQuNzIzNDgyMiAwIDkuMDAxNTU1MiAxLjkwMDU5MzkgMTIuMTA2MjkyIDQuOTc2MzA5IDEuOTU2OTIzNy0yLjY0MTEzMSA0LjU1MDAyNjMtNC43ODU1MTgzIDcuNTUzODE3Ni02LjIwODQzMTg2eiIvPjxwYXRoIGQ9Ik01NS4zODAzMjgyIDQyLjY1MDE5OTFDNDYuMzMzNzIyNyA0Mi42NTAxOTkxIDM5IDM1LjM0MTIwMzEgMzkgMjYuMzI1MDk5NiAzOSAxNy4zMDg5OTYgNDYuMzMzNzIyNyAxMCA1NS4zODAzMjgyIDEwYzkuMDQ2NjA1NSAwIDE2LjM4MDMyODIgNy4zMDg5OTYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+';
321
  add_menu_page( 'Cookiebot', __( 'Cookiebot', 'cookiebot' ), 'manage_options', 'cookiebot', array( $this, 'settings_page' ), $icon );
322
 
323
- add_submenu_page( 'cookiebot', __( 'Cookiebot Settings', 'cookiebot' ), __( 'Settings', 'cookiebot' ), 'manage_options', 'cookiebot', array( $this, 'settings_page' ), 10 );
324
- add_submenu_page( 'cookiebot', __( 'Cookiebot Support', 'cookiebot' ), __( 'Support', 'cookiebot' ), 'manage_options', 'cookiebot_support', array( $this, 'support_page' ), 20 );
325
- add_submenu_page( 'cookiebot', __( 'Google Tag Manager', 'cookiebot' ), __( 'Google Tag Manager', 'cookiebot' ), 'manage_options', 'cookiebot_GTM', array( $this, 'GTM_page' ) );
326
- add_submenu_page( 'cookiebot', __( 'IAB', 'cookiebot' ), __( 'IAB', 'cookiebot' ), 'manage_options', 'cookiebot_iab', array( $this, 'iab_page' ), 30 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
 
328
  if ( defined( 'COOKIEBOT_ADDONS_UNSUPPORTED_PHPVERSION' ) ) {
329
  //Load prior consent page anyway - but from Cookiebot WP Core plugin.
330
- add_submenu_page( 'cookiebot', __( 'Prior Consent', 'cookiebot' ), __( 'Prior Consent', 'cookiebot' ), 'manage_options', 'cookiebot-addons', array( $this, 'setting_page_placeholder' ), 40 );
 
 
 
 
 
 
 
 
331
  }
332
  }
333
 
334
- function add_menu_legislations() {
335
- add_submenu_page( 'cookiebot', __( 'Legislations', 'cookiebot' ), __( 'Legislations', 'cookiebot' ), 'manage_options', 'cookiebot-legislations', array( $this, 'legislations_page' ), 50 );
 
 
 
 
 
 
 
 
336
  }
337
 
338
  /**
@@ -341,8 +388,15 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
341
  * @version 3.6.0
342
  * @since 3.6.0
343
  */
344
- function add_menu_debug() {
345
- add_submenu_page( 'cookiebot', __( 'Debug info', 'cookiebot' ), __( 'Debug info', 'cookiebot' ), 'manage_options', 'cookiebot_debug', array( $this, 'debug_page' ) );
 
 
 
 
 
 
 
346
  }
347
 
348
  /**
@@ -351,12 +405,33 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
351
  * @version 2.2.0
352
  * @since 2.2.0
353
  */
354
- function add_network_menu() {
355
  $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNDYuODcyNTkwMyA4Ljc3MzU4MzM0QzQxLjk0MzkwMzkgMy4zODI5NTAxMSAzNC44NDI0OTQ2IDAgMjYuOTQ4MjgxOSAwIDEyLjA2NTE1NjggMCAwIDEyLjAyNDQ3NzQgMCAyNi44NTc0MjE5YzAgMTQuODMyOTQ0NSAxMi4wNjUxNTY4IDI2Ljg1NzQyMTkgMjYuOTQ4MjgxOSAyNi44NTc0MjE5IDcuODk0MjEyNyAwIDE0Ljk5NTYyMi0zLjM4Mjk1MDIgMTkuOTI0MzA4NC04Ljc3MzU4MzQtMi44ODk2OTY3LTEuMzY4ODY2My01LjM5OTMxMS0zLjQwNTQzOS03LjMyODA4MzgtNS45MDk2MzU4LTMuMTIxNDMwNiAzLjIwOTQxMDQtNy40OTI5OTQ0IDUuMjA0MTI5MS0xMi4zMzIwMjU4IDUuMjA0MTI5MS05LjQ4NDM0NDQgMC0xNy4xNzI5MjQ3LTcuNjYyNjU3Mi0xNy4xNzI5MjQ3LTE3LjExNTAyMzhzNy42ODg1ODAzLTE3LjExNTAyMzcgMTcuMTcyOTI0Ny0xNy4xMTUwMjM3YzQuNzIzNDgyMiAwIDkuMDAxNTU1MiAxLjkwMDU5MzkgMTIuMTA2MjkyIDQuOTc2MzA5IDEuOTU2OTIzNy0yLjY0MTEzMSA0LjU1MDAyNjMtNC43ODU1MTgzIDcuNTUzODE3Ni02LjIwODQzMTg2eiIvPjxwYXRoIGQ9Ik01NS4zODAzMjgyIDQyLjY1MDE5OTFDNDYuMzMzNzIyNyA0Mi42NTAxOTkxIDM5IDM1LjM0MTIwMzEgMzkgMjYuMzI1MDk5NiAzOSAxNy4zMDg5OTYgNDYuMzMzNzIyNyAxMCA1NS4zODAzMjgyIDEwYzkuMDQ2NjA1NSAwIDE2LjM4MDMyODIgNy4zMDg5OTYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+';
356
- add_menu_page( 'Cookiebot', __( 'Cookiebot', 'cookiebot' ), 'manage_network_options', 'cookiebot_network', array( $this, 'network_settings_page' ), $icon );
 
 
 
 
 
 
 
357
 
358
- add_submenu_page( 'cookiebot_network', __( 'Cookiebot Settings', 'cookiebot' ), __( 'Settings', 'cookiebot' ), 'network_settings_page', 'cookiebot_network', array( $this, 'network_settings_page' ) );
359
- add_submenu_page( 'cookiebot_network', __( 'Cookiebot Support', 'cookiebot' ), __( 'Support', 'cookiebot' ), 'network_settings_page', 'cookiebot_support', array( $this, 'support_page' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
 
361
  }
362
 
@@ -366,7 +441,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
366
  * @version 1.4.0
367
  * @since 1.0.0
368
  */
369
- function setting_page_placeholder() {
370
  include __DIR__ . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'view/admin/settings/setting-page.php';
371
  }
372
 
@@ -376,7 +451,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
376
  * @version 3.9.0
377
  * @since 1.0.0
378
  */
379
- function register_cookiebot_settings() {
380
  register_setting( 'cookiebot', 'cookiebot-cbid' );
381
  register_setting( 'cookiebot', 'cookiebot-language' );
382
  register_setting( 'cookiebot', 'cookiebot-nooutput' );
@@ -402,7 +477,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
402
  * @version 2.2.0
403
  * @since 1.5.0
404
  */
405
- function automatic_updates( $update, $item ) {
406
  //Do not update from subsite on a multisite installation
407
  if ( is_multisite() && ! is_main_site() ) {
408
  return $update;
@@ -440,54 +515,55 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
440
  * @since 1.4.0
441
  */
442
  public static function get_supported_languages() {
443
- $supportedLanguages = array();
444
- $supportedLanguages['nb'] = __( 'Norwegian Bokmål', 'cookiebot' );
445
- $supportedLanguages['tr'] = __( 'Turkish', 'cookiebot' );
446
- $supportedLanguages['de'] = __( 'German', 'cookiebot' );
447
- $supportedLanguages['cs'] = __( 'Czech', 'cookiebot' );
448
- $supportedLanguages['da'] = __( 'Danish', 'cookiebot' );
449
- $supportedLanguages['sq'] = __( 'Albanian', 'cookiebot' );
450
- $supportedLanguages['he'] = __( 'Hebrew', 'cookiebot' );
451
- $supportedLanguages['ko'] = __( 'Korean', 'cookiebot' );
452
- $supportedLanguages['it'] = __( 'Italian', 'cookiebot' );
453
- $supportedLanguages['nl'] = __( 'Dutch', 'cookiebot' );
454
- $supportedLanguages['vi'] = __( 'Vietnamese', 'cookiebot' );
455
- $supportedLanguages['ta'] = __( 'Tamil', 'cookiebot' );
456
- $supportedLanguages['is'] = __( 'Icelandic', 'cookiebot' );
457
- $supportedLanguages['ro'] = __( 'Romanian', 'cookiebot' );
458
- $supportedLanguages['si'] = __( 'Sinhala', 'cookiebot' );
459
- $supportedLanguages['ca'] = __( 'Catalan', 'cookiebot' );
460
- $supportedLanguages['bg'] = __( 'Bulgarian', 'cookiebot' );
461
- $supportedLanguages['uk'] = __( 'Ukrainian', 'cookiebot' );
462
- $supportedLanguages['zh'] = __( 'Chinese', 'cookiebot' );
463
- $supportedLanguages['en'] = __( 'English', 'cookiebot' );
464
- $supportedLanguages['ar'] = __( 'Arabic', 'cookiebot' );
465
- $supportedLanguages['hr'] = __( 'Croatian', 'cookiebot' );
466
- $supportedLanguages['th'] = __( 'Thai', 'cookiebot' );
467
- $supportedLanguages['el'] = __( 'Greek', 'cookiebot' );
468
- $supportedLanguages['lt'] = __( 'Lithuanian', 'cookiebot' );
469
- $supportedLanguages['pl'] = __( 'Polish', 'cookiebot' );
470
- $supportedLanguages['lv'] = __( 'Latvian', 'cookiebot' );
471
- $supportedLanguages['fr'] = __( 'French', 'cookiebot' );
472
- $supportedLanguages['id'] = __( 'Indonesian', 'cookiebot' );
473
- $supportedLanguages['mk'] = __( 'Macedonian', 'cookiebot' );
474
- $supportedLanguages['et'] = __( 'Estonian', 'cookiebot' );
475
- $supportedLanguages['pt'] = __( 'Portuguese', 'cookiebot' );
476
- $supportedLanguages['ga'] = __( 'Irish', 'cookiebot' );
477
- $supportedLanguages['ms'] = __( 'Malay', 'cookiebot' );
478
- $supportedLanguages['sl'] = __( 'Slovenian', 'cookiebot' );
479
- $supportedLanguages['ru'] = __( 'Russian', 'cookiebot' );
480
- $supportedLanguages['ja'] = __( 'Japanese', 'cookiebot' );
481
- $supportedLanguages['hi'] = __( 'Hindi', 'cookiebot' );
482
- $supportedLanguages['sk'] = __( 'Slovak', 'cookiebot' );
483
- $supportedLanguages['es'] = __( 'Spanish', 'cookiebot' );
484
- $supportedLanguages['sv'] = __( 'Swedish', 'cookiebot' );
485
- $supportedLanguages['sr'] = __( 'Serbian', 'cookiebot' );
486
- $supportedLanguages['fi'] = __( 'Finnish', 'cookiebot' );
487
- $supportedLanguages['eu'] = __( 'Basque', 'cookiebot' );
488
- $supportedLanguages['hu'] = __( 'Hungarian', 'cookiebot' );
489
- asort( $supportedLanguages, SORT_LOCALE_STRING );
490
- return $supportedLanguages;
 
491
  }
492
 
493
  /**
@@ -496,7 +572,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
496
  * @version 3.9.0
497
  * @since 1.0.0
498
  */
499
- function settings_page() {
500
  wp_enqueue_style( 'cookiebot-consent-mapping-table', plugins_url( 'css/consent_mapping_table.css', __FILE__ ), array(), '3.5.0' );
501
 
502
  /* Check if multisite */
@@ -508,473 +584,623 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
508
  $network_cookie_blocking_mode = get_site_option( 'cookiebot-cookie-blocking-mode', 'manual' );
509
  }
510
  ?>
511
- <div class="wrap">
512
- <h1><?php esc_html_e( 'Cookiebot Settings', 'cookiebot' ); ?></h1>
513
- <a href="https://www.cookiebot.com">
514
- <img src="<?php echo plugins_url( 'cookiebot-logo.png', __FILE__ ); ?>" style="float:right;margin-left:1em;">
515
- </a>
516
- <p>
517
- <?php
518
- $cookiebot_gdpr_url = 'https://www.cookiebot.com/goto/gdpr';
519
- printf(
520
- esc_html__( 'Cookiebot enables your website to comply with current legislation in the EU on the use of cookies for user tracking and profiling. The EU ePrivacy Directive requires prior, informed consent of your site users, while the %1$s %2$s.', 'cookiebot' ),
521
- sprintf(
522
- '<a href="%s" target="_blank">%s</a>',
523
- esc_url( $cookiebot_gdpr_url ),
524
- esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' )
525
- ),
526
- esc_html__( ' requires you to document each consent. At the same time you must be able to account for what user data you share with embedded third-party services on your website and where in the world the user data is sent.', 'cookiebot' )
527
- );
528
- ?>
529
- </p>
530
- <form method="post" action="options.php">
 
 
 
 
 
 
531
  <?php settings_fields( 'cookiebot' ); ?>
532
- <?php do_settings_sections( 'cookiebot' ); ?>
533
- <table class="form-table">
534
- <tr valign="top">
535
- <th scope="row"><?php esc_html_e( 'Cookiebot ID', 'cookiebot' ); ?></th>
536
- <td>
537
- <input type="text" name="cookiebot-cbid" value="<?php echo esc_attr( get_option( 'cookiebot-cbid' ) ); ?>"<?php echo ( $is_ms ) ? ' placeholder="' . $network_cbid . '"' : ''; ?> style="width:300px" />
538
- <p class="description">
539
- <?php esc_html_e( 'Need an ID?', 'cookiebot' ); ?>
540
- <a href="https://www.cookiebot.com/goto/signup" target="_blank"><?php esc_html_e( 'Sign up for free on cookiebot.com', 'cookiebot' ); ?></a>
541
- </p>
542
- </td>
543
- </tr>
544
- <tr valign="top">
545
- <th scope="row">
546
- <?php esc_html_e( 'Cookie-blocking mode', 'cookiebot' ); ?>
547
- </th>
548
- <td>
549
- <?php
550
- $cbm = get_option( 'cookiebot-cookie-blocking-mode', 'manual' );
551
- if ( $is_ms && $network_cookie_blocking_mode != 'custom' ) {
552
- $cbm = $network_cookie_blocking_mode;
553
- }
554
- ?>
555
- <label>
556
- <input type="radio" name="cookiebot-cookie-blocking-mode" value="auto" <?php checked( 'auto', $cbm, true ); ?> />
557
- <?php esc_html_e( 'Automatic', 'cookiebot' ); ?>
558
- </label>
559
- &nbsp; &nbsp;
560
- <label>
561
- <input type="radio" name="cookiebot-cookie-blocking-mode" value="manual" <?php checked( 'manual', $cbm, true ); ?> />
562
- <?php esc_html_e( 'Manual', 'cookiebot' ); ?>
563
- </label>
564
- <p class="description">
565
- <?php esc_html_e( 'Automatic block cookies (except necessary) until the user has given their consent.', 'cookiebot' ); ?>
566
- <a href="https://support.cookiebot.com/hc/en-us/articles/360009063100-Automatic-Cookie-Blocking-How-does-it-work-" target="_blank">
567
- <?php esc_html_e( 'Learn more', 'cookiebot' ); ?>
568
- </a>
569
- </p>
570
- <script>
571
- jQuery(document).ready(function($) {
572
- var cookieBlockingMode = '<?php echo $cbm; ?>';
573
- $( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function() {
574
- if(this.value == 'auto' && cookieBlockingMode != this.value ) {
575
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
576
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
577
- }
578
- if( this.value == 'manual' && cookieBlockingMode != this.value ) {
579
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 );
580
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false );
581
- }
582
- cookieBlockingMode = this.value;
583
- });
584
- if( cookieBlockingMode == 'auto' ) {
585
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
586
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
587
- }
588
- });
589
- </script>
590
- </td>
591
- </tr>
592
- <tr valign="top">
593
- <th scope="row"><?php esc_html_e( 'Cookiebot Language', 'cookiebot' ); ?></th>
594
- <td>
595
- <div>
596
- <select name="cookiebot-language" id="cookiebot-language">
597
- <?php
598
- $currentLang = $this->get_language( true );
599
- ?>
600
- <option value=""><?php esc_html_e( 'Default (Autodetect)', 'cookiebot' ); ?></option>
601
- <option value="_wp"<?php echo ( $currentLang == '_wp' ) ? ' selected' : ''; ?>><?php esc_html_e( 'Use WordPress Language', 'cookiebot' ); ?></option>
602
- <?php
603
- $supportedLanguages = $this->get_supported_languages();
604
- foreach ( $supportedLanguages as $langCode => $langName ) {
605
- echo '<option value="' . $langCode . '"' . ( ( $currentLang == $langCode ) ? ' selected' : '' ) . '>' . $langName . '</option>';
606
- }
607
- ?>
608
- </select>
609
- </div>
610
- <div class="notice inline notice-warning notice-alt cookiebot-notice" style="padding:12px;font-size:13px;display:inline-block;">
611
- <div style="<?php echo ( $currentLang == '' ) ? 'display:none;' : ''; ?>" id="info_lang_specified">
612
- <?php esc_html_e( 'You need to add the language in the Cookiebot administration tool.', 'cookiebot' ); ?>
613
- </div>
614
- <div style="<?php echo ( $currentLang == '' ) ? '' : 'display:none;'; ?>" id="info_lang_autodetect">
615
- <?php esc_html_e( 'You need to add all languages that you want auto-detected in the Cookiebot administration tool.', 'cookiebot' ); ?> <br/>
616
- <?php esc_html_e( 'The auto-detect checkbox needs to be enabled in the Cookiebot administration tool.', 'cookiebot' ); ?><br/>
617
- <?php esc_html_e( 'If the auto-detected language is not supported, Cookiebot will use the default language.', 'cookiebot' ); ?>
618
- </div>
619
- <br />
620
-
621
- <a href="#" id="show_add_language_guide"><?php esc_html_e( 'Show guide to add languages', 'cookiebot' ); ?></a>
622
- &nbsp;
623
- <a href="https://support.cookiebot.com/hc/en-us/articles/360003793394-How-do-I-set-the-language-of-the-consent-banner-dialog-" target="_blank">
624
- <?php esc_html_e( 'Read more here', 'cookiebot' ); ?>
625
- </a>
626
-
627
- <div id="add_language_guide" style="display:none;">
628
- <img src="<?php echo plugin_dir_url( __FILE__ ); ?>/assets/guide_add_language.gif" alt="Add language in Cookiebot administration tool" />
629
- <br />
630
- <a href="#" id="hide_add_language_guide"><?php esc_html_e( 'Hide guide', 'cookiebot' ); ?></a>
631
- </div>
632
- </div>
633
- <script>
634
- jQuery(document).ready(function($) {
635
- $('#show_add_language_guide').on('click',function(e) {
636
- e.preventDefault();
637
- $('#add_language_guide').slideDown();
638
- $(this).hide();
639
- });
640
- $('#hide_add_language_guide').on('click',function(e) {
641
- e.preventDefault();
642
- $('#add_language_guide').slideUp();
643
- $('#show_add_language_guide').show();
644
- });
645
-
646
- $('#cookiebot-language').on('change', function() {
647
- if(this.value == '') {
648
- $('#info_lang_autodetect').show();
649
- $('#info_lang_specified').hide();
650
- }
651
- else {
652
- $('#info_lang_autodetect').hide();
653
- $('#info_lang_specified').show();
654
- }
655
- });
656
- });
657
- </script>
658
-
659
- </td>
660
- </tr>
661
- </table>
662
- <script>
663
- jQuery(document).ready(function($) {
664
- $('.cookiebot_fieldset_header').on('click',function(e) {
665
- e.preventDefault();
666
- $(this).next().slideToggle();
667
- $(this).toggleClass('active');
668
- });
669
- });
670
- </script>
671
- <style type="text/css">
672
- .cookiebot_fieldset_header {
673
- cursor:pointer;
674
- }
675
- .cookiebot_fieldset_header::after {
676
- content: "\f140";
677
- font: normal 24px/1 dashicons;
678
- position: relative;
679
- top: 5px;
680
- }
681
- .cookiebot_fieldset_header.active::after {
682
- content: "\f142";
683
- }
684
- </style>
685
- <h3 id="advanced_settings_link" class="cookiebot_fieldset_header"><?php esc_html_e( 'Advanced settings', 'cookiebot' ); ?></h3>
686
- <div id="advanced_settings" style="display:none;">
687
  <table class="form-table">
688
- <tr valign="top" id="cookiebot-setting-async">
689
- <th scope="row">
690
- <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
691
- <br /><?php esc_html_e( 'Consent banner script tag', 'cookiebot' ); ?>
692
- </th>
693
  <td>
694
- <?php
695
- $cv = get_option( 'cookiebot-script-tag-uc-attribute', 'async' );
696
- $disabled = false;
697
- if ( $is_ms && $network_scrip_tag_uc_attr != 'custom' ) {
698
- $disabled = true;
699
- $cv = $network_scrip_tag_uc_attr;
700
- }
701
- ?>
702
- <label>
703
- <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="" <?php checked( '', $cv, true ); ?> />
704
- <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
705
- </label>
706
- &nbsp; &nbsp;
707
- <label>
708
- <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="async" <?php checked( 'async', $cv, true ); ?> />
709
- async
710
- </label>
711
- &nbsp; &nbsp;
712
- <label>
713
- <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="defer" <?php checked( 'defer', $cv, true ); ?> />
714
- defer
715
- </label>
716
  <p class="description">
 
 
717
  <?php
718
- if ( $disabled ) {
719
- echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.', 'cookiebot' ) . '</b><br />'; }
 
 
720
  ?>
721
- <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
722
  </p>
723
  </td>
724
  </tr>
725
  <tr valign="top">
726
  <th scope="row">
727
- <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
728
- <br /><?php esc_html_e( 'Cookie declaration script tag', 'cookiebot' ); ?>
729
  </th>
730
  <td>
731
  <?php
732
- $cv = get_option( 'cookiebot-script-tag-cd-attribute', 'async' );
733
- $disabled = false;
734
- if ( $is_ms && $network_scrip_tag_cd_attr != 'custom' ) {
735
- $disabled = true;
736
- $cv = $network_scrip_tag_cd_attr;
737
  }
738
  ?>
739
  <label>
740
- <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="" <?php checked( '', $cv, true ); ?> />
741
- <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
742
  </label>
743
  &nbsp; &nbsp;
744
  <label>
745
- <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="async" <?php checked( 'async', $cv, true ); ?> />
746
- async
747
- </label>
748
- &nbsp; &nbsp;
749
- <label>
750
- <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?> value="defer" <?php checked( 'defer', $cv, true ); ?> />
751
- defer
752
  </label>
753
  <p class="description">
754
- <?php
755
- if ( $disabled ) {
756
- echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.', 'cookiebot' ) . '</b><br />'; }
757
- ?>
758
- <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
759
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760
  </td>
761
  </tr>
762
- <?php
763
- if ( ! is_multisite() ) {
764
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  <tr valign="top">
766
- <th scope="row"><?php esc_html_e( 'Auto-update Cookiebot', 'cookiebot' ); ?></th>
 
 
 
767
  <td>
768
- <input type="checkbox" name="cookiebot-autoupdate" value="1" <?php checked( 1, get_option( 'cookiebot-autoupdate', false ), true ); ?> />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
769
  <p class="description">
770
- <?php esc_html_e( 'Automatic update your Cookiebot plugin when new releases becomes available.', 'cookiebot' ); ?>
 
 
 
 
 
 
 
 
771
  </p>
772
  </td>
773
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
774
  <?php
775
  }
776
  ?>
777
- <tr valign="top" id="cookiebot-setting-hide-popup">
778
- <th scope="row"><?php esc_html_e( 'Hide Cookie Popup', 'cookiebot' ); ?></th>
779
- <td>
780
- <?php
781
- $disabled = false;
782
- if ( $is_ms && get_site_option( 'cookiebot-nooutput', false ) ) {
783
- $disabled = true;
784
- echo '<input type="checkbox" checked disabled />';
785
- } else {
786
- ?>
787
- <input type="checkbox" name="cookiebot-nooutput" value="1" <?php checked( 1, get_option( 'cookiebot-nooutput', false ), true ); ?> />
788
- <?php
789
- }
790
- ?>
791
- <p class="description">
792
  <?php
793
- if ( $disabled ) {
794
- echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.', 'cookiebot' ) . '</b><br />'; }
795
- ?>
796
- <b><?php esc_html_e( 'This checkbox will remove the cookie consent banner from your website. The <i>[cookie_declaration]</i> shortcode will still be available.', 'cookiebot' ); ?></b><br />
797
- <?php esc_html_e( 'If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager.', 'cookiebot' ); ?><br />
798
- <a href="https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment" target="_blank">
799
- <?php esc_html_e( 'See a detailed guide here', 'cookiebot' ); ?>
800
- </a>
801
- </p>
802
- </td>
803
- </tr>
804
- <tr valign="top">
805
- <th scope="row"><?php esc_html_e( 'Disable Cookiebot in WP Admin', 'cookiebot' ); ?></th>
806
- <td>
807
- <?php
808
- $disabled = false;
809
- if ( $is_ms && get_site_option( 'cookiebot-nooutput-admin', false ) ) {
810
- echo '<input type="checkbox" checked disabled />';
811
- $disabled = true;
812
- } else {
813
  ?>
814
- <input type="checkbox" name="cookiebot-nooutput-admin" value="1" <?php checked( 1, get_option( 'cookiebot-nooutput-admin', false ), true ); ?> />
815
- <?php
816
- }
817
- ?>
818
- <p class="description">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
819
  <?php
820
- if ( $disabled ) {
821
- echo '<b>' . __( 'Network setting applied. Please contact website administrator to change this setting.' ) . '</b><br />'; }
822
- ?>
823
- <b><?php esc_html_e( 'This checkbox will disable Cookiebot in the WordPress Admin area.', 'cookiebot' ); ?></b>
824
- </p>
825
- </td>
826
- </tr>
827
- <tr valign="top">
828
- <th scope="row"><?php esc_html_e( 'Enable Cookiebot on front end while logged in', 'cookiebot' ); ?></th>
829
- <td>
830
- <?php
831
- $disabled = false;
832
- if ( $is_ms && get_site_option( 'cookiebot-output-logged-in', false ) ) {
833
- echo '<input type="checkbox" checked disabled />';
834
- $disabled = true;
835
- } else {
 
836
  ?>
837
- <input type="checkbox" name="cookiebot-output-logged-in" value="1" <?php checked( 1, get_option( 'cookiebot-output-logged-in', false ), true ); ?> />
838
- <?php
839
- }
840
- ?>
841
- <p class="description">
 
 
 
 
 
 
 
 
842
  <?php
843
- if ( $disabled ) {
844
- echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.' ) . '</b><br />'; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
845
  ?>
846
- <b><?php esc_html_e( 'This checkbox will enable Cookiebot on front end while you\'re logged in', 'cookiebot' ); ?></b>
847
- </p>
848
- </td>
849
- </tr>
850
- </table>
851
- </div>
 
 
 
 
 
 
852
  <?php if ( $this->is_wp_consent_api_active() ) { ?>
853
- <h3 id="consent_level_api_settings" class="cookiebot_fieldset_header"><?php esc_html_e( 'Consent Level API Settings', 'cookiebot' ); ?></h3>
854
- <div id="consent_level_api_settings" style="display:none;">
855
- <p><?php esc_html_e( 'WP Consent Level API and Cookiebot categorise cookies a bit different. The default settings should fit mosts needs - but if you need to change the mapping you are able to do it below.', 'cookiebot' ); ?></p>
856
-
857
  <?php
858
- $mDefault = $this->get_default_wp_consent_api_mapping();
859
-
860
- $m = $this->get_wp_consent_api_mapping();
861
-
862
- $consentTypes = array( 'preferences', 'statistics', 'marketing' );
863
- $states = array_reduce(
864
- $consentTypes,
865
- function ( $t, $v ) {
866
- $newt = array();
867
- if ( empty( $t ) ) {
868
- $newt = array(
869
- array( $v => true ),
870
- array( $v => false ),
871
- );
872
- } else {
873
- foreach ( $t as $item ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
874
  $newt[] = array_merge( $item, array( $v => true ) );
875
  $newt[] = array_merge( $item, array( $v => false ) );
 
876
  }
877
- }
878
 
879
- return $newt;
880
- },
881
- array()
882
- );
883
 
884
- ?>
885
 
886
 
887
- <table class="widefat striped consent_mapping_table">
888
- <thead>
889
  <tr>
890
  <th><?php esc_html_e( 'Cookiebot categories', 'cookiebot' ); ?></th>
891
  <th class="consent_mapping"><?php esc_html_e( 'WP Consent Level categories', 'cookiebot' ); ?></th>
892
  </tr>
893
- </thead>
894
- <?php
895
- foreach ( $states as $state ) {
896
-
897
- $key = array();
898
- $key[] = 'n=1';
899
- $key[] = 'p=' . ( $state['preferences'] ? '1' : '0' );
900
- $key[] = 's=' . ( $state['statistics'] ? '1' : '0' );
901
- $key[] = 'm=' . ( $state['marketing'] ? '1' : '0' );
902
- $key = implode( ';', $key );
903
- ?>
904
- <tr valign="top">
905
- <td>
906
- <div class="cb_consent">
907
- <span class="forceconsent">
908
  <?php esc_html_e( 'Necessary', 'cookiebot' ); ?>
909
- </span>
910
- <span class="<?php echo( $state['preferences'] ? 'consent' : 'noconsent' ); ?>">
911
  <?php esc_html_e( 'Preferences', 'cookiebot' ); ?>
912
- </span>
913
- <span class="<?php echo( $state['statistics'] ? 'consent' : 'noconsent' ); ?>">
914
  <?php esc_html_e( 'Statistics', 'cookiebot' ); ?>
915
- </span>
916
- <span class="<?php echo( $state['marketing'] ? 'consent' : 'noconsent' ); ?>">
917
  <?php esc_html_e( 'Marketing', 'cookiebot' ); ?>
918
- </span>
919
- </div>
920
- </td>
921
- <td>
922
- <div class="consent_mapping">
923
- <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo $key; ?>][functional]" data-default-value="1" value="1" checked disabled
924
- > <?php esc_html_e( 'Functional', 'cookiebot' ); ?> </label>
925
- <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo $key; ?>][preferences]" data-default-value="<?php echo $mDefault[ $key ]['preferences']; ?>" value="1"
926
- <?php
927
- if ( $m[ $key ]['preferences'] ) {
928
- echo 'checked'; }
929
- ?>
930
- > <?php esc_html_e( 'Preferences', 'cookiebot' ); ?> </label>
931
- <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo $key; ?>][statistics]" data-default-value="<?php echo $mDefault[ $key ]['statistics']; ?>" value="1"
932
- <?php
933
- if ( $m[ $key ]['statistics'] ) {
934
- echo 'checked'; }
935
- ?>
936
- > <?php esc_html_e( 'Statistics', 'cookiebot' ); ?> </label>
937
- <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo $key; ?>][statistics-anonymous]" data-default-value="<?php echo $mDefault[ $key ]['statistics-anonymous']; ?>" value="1"
938
- <?php
939
- if ( $m[ $key ]['statistics-anonymous'] ) {
940
- echo 'checked'; }
941
- ?>
942
- > <?php esc_html_e( 'Statistics Anonymous', 'cookiebot' ); ?></label>
943
- <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo $key; ?>][marketing]" data-default-value="<?php echo $mDefault[ $key ]['marketing']; ?>" value="1"
944
- <?php
945
- if ( $m[ $key ]['marketing'] ) {
946
- echo 'checked'; }
947
- ?>
948
- > <?php esc_html_e( 'Marketing', 'cookiebot' ); ?></label>
949
- </div>
950
- </td>
951
- </tr>
952
- <?php
953
- }
954
- ?>
955
- <tfoot>
 
 
 
 
 
 
 
 
 
956
  <tr>
957
- <td colspan="2" style="text-align:right;"><button class="button" onclick="return resetConsentMapping();"><?php esc_html_e( 'Reset to default mapping', 'cookiebot' ); ?></button></td>
 
 
 
 
 
 
 
 
 
958
  </tr>
959
- </tfoot>
960
- </table>
961
- <script>
962
- function resetConsentMapping() {
963
- if(confirm('Are you sure you want to reset to default consent mapping?')) {
964
- jQuery('.consent_mapping_table input[type=checkbox]').each(function () {
965
- if(!this.disabled) {
966
- this.checked = (jQuery(this).data('default-value') == '1') ? true : false;
967
- }
968
- });
 
 
969
  }
970
- return false;
971
- }
972
- </script>
973
- </div>
974
- <?php } ?>
975
  <?php submit_button(); ?>
976
- </form>
977
- </div>
978
  <?php
979
  }
980
 
@@ -984,188 +1210,279 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
984
  * @version 2.2.0
985
  * @since 2.2.0
986
  */
987
- function network_settings_page() {
988
  ?>
989
- <div class="wrap">
990
- <h1><?php esc_html_e( 'Cookiebot Network Settings', 'cookiebot' ); ?></h1>
991
- <a href="https://www.cookiebot.com">
992
- <img src="<?php echo plugins_url( 'cookiebot-logo.png', __FILE__ ); ?>" style="float:right;margin-left:1em;">
993
- </a>
994
- <p>
995
- <?php
996
- $cookiebot_gdpr_url = 'https://www.cookiebot.com/goto/gdpr';
997
- printf(
998
- esc_html__( 'Cookiebot enables your website to comply with current legislation in the EU on the use of cookies for user tracking and profiling. The EU ePrivacy Directive requires prior, informed consent of your site users, while the %1$s %2$s.', 'cookiebot' ),
999
- sprintf(
1000
- '<a href="%s" target="_blank">%s</a>',
1001
- esc_url( $cookiebot_gdpr_url ),
1002
- esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' )
1003
- ),
1004
- esc_html__( ' requires you to document each consent. At the same time you must be able to account for what user data you share with embedded third-party services on your website and where in the world the user data is sent.', 'cookiebot' )
1005
- );
1006
- ?>
1007
- </p>
1008
- <p>
1009
- <b><big style="color:red;"><?php esc_html_e( 'The settings below is network wide settings. See notes below each field.', 'cookiebot' ); ?></big></b>
1010
- </p>
1011
- <form method="post" action="edit.php?action=cookiebot_network_settings">
 
 
 
 
 
 
 
 
 
 
 
 
 
1012
  <?php wp_nonce_field( 'cookiebot-network-settings' ); ?>
1013
- <table class="form-table">
1014
- <tr valign="top">
1015
- <th scope="row"><?php esc_html_e( 'Network Cookiebot ID', 'cookiebot' ); ?></th>
1016
- <td>
1017
- <input type="text" name="cookiebot-cbid" value="<?php echo esc_attr( get_site_option( 'cookiebot-cbid', '' ) ); ?>" style="width:300px" />
1018
- <p class="description">
1019
- <b><?php esc_html_e( 'If added this will be the default Cookiebot ID for all subsites. Subsites are able to override the Cookiebot ID.', 'cookiebot' ); ?></b>
1020
- <br />
 
 
 
 
 
 
 
 
1021
  <?php esc_html_e( 'Need an ID?', 'cookiebot' ); ?>
1022
- <a href="https://www.cookiebot.com/goto/signup" target="_blank"><?php esc_html_e( 'Sign up for free on cookiebot.com', 'cookiebot' ); ?></a>
1023
- </p>
1024
- </td>
1025
- </tr>
1026
- <tr valign="top">
1027
- <th scope="row">
 
 
 
 
 
 
 
1028
  <?php esc_html_e( 'Cookie-blocking mode', 'cookiebot' ); ?>
1029
- </th>
1030
- <td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  <?php
1032
- $cbm = get_site_option( 'cookiebot-cookie-blocking-mode', 'manual' );
 
 
 
 
1033
  ?>
1034
- <label>
1035
- <input type="radio" name="cookiebot-cookie-blocking-mode" value="auto" <?php checked( 'auto', $cbm, true ); ?> />
1036
- <?php esc_html_e( 'Automatic', 'cookiebot' ); ?>
1037
- </label>
1038
- &nbsp; &nbsp;
1039
- <label>
1040
- <input type="radio" name="cookiebot-cookie-blocking-mode" value="manual" <?php checked( 'manual', $cbm, true ); ?> />
1041
- <?php esc_html_e( 'Manual', 'cookiebot' ); ?>
1042
- </label>
1043
- <p class="description">
1044
- <?php esc_html_e( 'Should Cookiebot automatic block cookies by tagging known tags.', 'cookiebot' ); ?>
1045
- </p>
1046
- </td>
1047
- </tr>
1048
- <script>
1049
- jQuery(document).ready(function($) {
1050
- var cookieBlockingMode = '<?php echo $cbm; ?>';
1051
- $( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function() {
1052
- if(this.value == 'auto' && cookieBlockingMode != this.value ) {
1053
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
1054
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
1055
- }
1056
- if( this.value == 'manual' && cookieBlockingMode != this.value ) {
1057
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 );
1058
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false );
1059
- }
1060
- cookieBlockingMode = this.value;
1061
- });
1062
- if( cookieBlockingMode == 'auto' ) {
1063
- $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
1064
- $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
1065
- }
1066
- });
1067
- </script>
1068
- <tr valign="top" id="cookiebot-setting-async">
1069
- <th scope="row">
1070
- <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
1071
- <br /><?php esc_html_e( 'Consent banner script tag', 'cookiebot' ); ?>
1072
- </th>
1073
- <td>
1074
- <?php
1075
- $cv = get_site_option( 'cookiebot-script-tag-uc-attribute', 'custom' );
1076
- ?>
1077
- <label>
1078
- <input type="radio" name="cookiebot-script-tag-uc-attribute" value="" <?php checked( '', $cv, true ); ?> />
1079
- <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
1080
- </label>
1081
- &nbsp; &nbsp;
1082
- <label>
1083
- <input type="radio" name="cookiebot-script-tag-uc-attribute" value="async" <?php checked( 'async', $cv, true ); ?> />
1084
- async
1085
- </label>
1086
- &nbsp; &nbsp;
1087
- <label>
1088
- <input type="radio" name="cookiebot-script-tag-uc-attribute" value="defer" <?php checked( 'defer', $cv, true ); ?> />
1089
- defer
1090
- </label>
1091
- &nbsp; &nbsp;
1092
- <label>
1093
- <input type="radio" name="cookiebot-script-tag-uc-attribute" value="custom" <?php checked( 'custom', $cv, true ); ?> />
1094
- <i><?php esc_html_e( 'Choose per subsite', 'cookiebot' ); ?></i>
1095
- </label>
1096
- <p class="description">
1097
- <b><?php esc_html_e( 'Setting will apply for all subsites. Subsites will not be able to override.', 'cookiebot' ); ?></b><br />
1098
- <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: Choose per subsite', 'cookiebot' ); ?>
1099
- </p>
1100
- </td>
1101
- </tr>
1102
- <tr valign="top">
1103
- <th scope="row">
1104
- <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
1105
- <br /><?php esc_html_e( 'Cookie declaration script tag', 'cookiebot' ); ?>
1106
- </th>
1107
- <td>
1108
- <?php
1109
- $cv = get_site_option( 'cookiebot-script-tag-cd-attribute', 'custom' );
1110
- ?>
1111
- <label>
1112
- <input type="radio" name="cookiebot-script-tag-cd-attribute" value="" <?php checked( '', $cv, true ); ?> />
1113
- <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
1114
- </label>
1115
- &nbsp; &nbsp;
1116
- <label>
1117
- <input type="radio" name="cookiebot-script-tag-cd-attribute" value="async" <?php checked( 'async', $cv, true ); ?> />
1118
- async
1119
- </label>
1120
- &nbsp; &nbsp;
1121
- <label>
1122
- <input type="radio" name="cookiebot-script-tag-cd-attribute" value="defer" <?php checked( 'defer', $cv, true ); ?> />
1123
- defer
1124
- </label>
1125
- &nbsp; &nbsp;
1126
- <label>
1127
- <input type="radio" name="cookiebot-script-tag-cd-attribute" value="custom" <?php checked( 'custom', $cv, true ); ?> />
1128
- <i><?php esc_html_e( 'Choose per subsite', 'cookiebot' ); ?></i>
1129
- </label>
1130
- <p class="description">
1131
- <b><?php esc_html_e( 'Setting will apply for all subsites. Subsites will not be able to override.', 'cookiebot' ); ?></b><br />
1132
- <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: Choose per subsite', 'cookiebot' ); ?>
1133
- </p>
1134
- </td>
1135
- </tr>
1136
- <tr valign="top">
1137
- <th scope="row"><?php esc_html_e( 'Auto-update Cookiebot', 'cookiebot' ); ?></th>
1138
- <td>
1139
- <input type="checkbox" name="cookiebot-autoupdate" value="1" <?php checked( 1, get_site_option( 'cookiebot-autoupdate', false ), true ); ?> />
1140
- <p class="description">
1141
- <?php esc_html_e( 'Automatic update your Cookiebot plugin when new releases becomes available.', 'cookiebot' ); ?>
1142
- </p>
1143
- </td>
1144
- </tr>
1145
- <tr valign="top" id="cookiebot-setting-hide-popup">
1146
- <th scope="row"><?php esc_html_e( 'Hide Cookie Popup', 'cookiebot' ); ?></th>
1147
- <td>
1148
- <input type="checkbox" name="cookiebot-nooutput" value="1" <?php checked( 1, get_site_option( 'cookiebot-nooutput', false ), true ); ?> />
1149
- <p class="description">
1150
- <b><?php esc_html_e( 'Remove the cookie consent banner from all subsites. This cannot be changed by subsites. The <i>[cookie_declaration]</i> shortcode will still be available.', 'cookiebot' ); ?></b><br />
1151
- <?php esc_html_e( 'If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager.', 'cookiebot' ); ?><br />
1152
- <?php esc_html_e( '<a href="https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment" target="_blank">See a detailed guide here</a>', 'cookiebot' ); ?>
1153
- </p>
1154
- </td>
1155
- </tr>
1156
- <tr valign="top">
1157
- <th scope="row"><?php esc_html_e( 'Hide Cookie Popup in WP Admin', 'cookiebot' ); ?></th>
1158
- <td>
1159
- <input type="checkbox" name="cookiebot-nooutput-admin" value="1" <?php checked( 1, get_site_option( 'cookiebot-nooutput-admin', false ), true ); ?> />
1160
- <p class="description">
1161
- <b><?php esc_html_e( 'Remove the cookie consent banner the WordPress Admin area for all subsites. This cannot be changed by subsites.', 'cookiebot' ); ?></b>
1162
- </p>
1163
- </td>
1164
- </tr>
1165
- </table>
1166
  <?php submit_button(); ?>
1167
- </form>
1168
- </div>
1169
  <?php
1170
  }
1171
 
@@ -1176,7 +1493,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1176
  * @version 2.2.0
1177
  * @since 2.2.0
1178
  */
1179
- function network_settings_save() {
1180
  check_admin_referer( 'cookiebot-network-settings' );
1181
 
1182
  update_site_option( 'cookiebot-cbid', $_POST['cookiebot-cbid'] );
@@ -1205,103 +1522,207 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1205
  * @version 2.2.0
1206
  * @since 2.0.0
1207
  */
1208
- function support_page() {
1209
  ?>
1210
- <div class="wrap">
1211
- <h1><?php esc_html_e( 'Support', 'cookiebot' ); ?></h1>
1212
- <h2><?php esc_html_e( 'How to find my Cookiebot ID', 'cookiebot' ); ?></h2>
1213
- <p>
1214
  <ol>
1215
- <li><?php esc_html_e( 'Log in to your <a href="https://www.cookiebot.com/goto/account" target="_blank">Cookiebot account</a>.', 'cookiebot' ); ?></li>
1216
- <li><?php esc_html_e( 'Go to <b>Manage</b> > <b>Settings</b> and add setup your Cookiebot', 'cookiebot' ); ?></li>
1217
- <li><?php esc_html_e( 'Go to the <b>"Your scripts"</b> tab', 'cookiebot' ); ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1218
  <li><?php esc_html_e( 'Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-ef1234567890', 'cookiebot' ); ?></li>
1219
- <li><?php esc_html_e( 'Add <b>[cookie_declaration]</b> shortcode to a page to show the declation', 'cookiebot' ); ?></li>
 
 
 
 
 
 
 
 
 
1220
  <li><?php esc_html_e( 'Remember to change your scripts as descripted below', 'cookiebot' ); ?></li>
1221
  </ol>
1222
- </p>
1223
- <h2><?php esc_html_e( 'Add the Cookie Declaration to your website', 'cookiebot' ); ?></h2>
1224
- <p>
1225
- <?php esc_html_e( 'Use the shortcode <b>[cookie_declaration]</b> to add the cookie declaration a page or post. The cookie declaration will always show the latest version from Cookiebot.', 'cookiebot' ); ?>
1226
- <br />
1227
- <?php esc_html_e( 'If you need to force language of the cookie declaration, you can add the <i>lang</i> attribute. Eg. <b>[cookie_declaration lang="de"]</b>.', 'cookiebot' ); ?>
1228
- </p>
1229
- <p>
1230
- <a href="https://www.youtube.com/watch?v=OCXz2bt4H_w" target="_blank" class="button"><?php esc_html_e( 'Watch video demonstration', 'cookiebot' ); ?></a>
1231
- </p>
1232
- <h2><?php esc_html_e( 'Update your script tags', 'cookiebot' ); ?></h2>
1233
- <p>
1234
- <?php esc_html_e( 'To enable prior consent, apply the attribute "data-cookieconsent" to cookie-setting script tags on your website. Set the comma-separated value to one or more of the cookie categories "preferences", "statistics" and "marketing" in accordance with the types of cookies being set by each script. Finally change the attribute "type" from "text/javascript" to "text/plain". Example on modifying an existing Google Analytics Universal script tag.', 'cookiebot' ); ?>
1235
- </p>
1236
- <code>
1237
- <?php
1238
- echo htmlentities( '<script type="text/plain" data-cookieconsent="statistics">' ) . '<br />';
1239
- echo htmlentities( "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');" ) . '<br />';
1240
- echo htmlentities( "ga('create', 'UA-00000000-0', 'auto');" ) . '<br />';
1241
- echo htmlentities( "ga('send', 'pageview');" ) . '<br />';
1242
- echo htmlentities( '</script>' ) . '<br />';
1243
- ?>
1244
- </code>
1245
- <p>
1246
- <a href="https://www.youtube.com/watch?v=MeHycvV2QCQ" target="_blank" class="button"><?php esc_html_e( 'Watch video demonstration', 'cookiebot' ); ?></a>
1247
- </p>
1248
-
1249
- <h2><?php esc_html_e( 'Helper function to update your scripts', 'cookiebot' ); ?></h2>
1250
- <p>
1251
- <?php esc_html_e( 'You are able to update your scripts yourself. However, Cookiebot also offers a small helper function that makes the work easier.', 'cookiebot' ); ?>
1252
- <br />
1253
- <?php esc_html_e( 'Update your script tags this way:', 'cookiebot' ); ?>
1254
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1255
  <?php
1256
  printf(
1257
  esc_html__( '%1$s to %2$s', 'cookiebot' ),
1258
- '<code>' . htmlentities( '<script type="text/javascript">' ) . '</code>',
1259
- '<code>' . htmlentities( '<script<?php echo cookiebot_assist(\'marketing\') ?>>' ) . '</code>'
1260
  );
1261
  ?>
1262
- </div>
1263
  <?php
1264
  }
1265
 
1266
  /**
1267
- * Cookiebot_WP Google Tag Manager page
1268
- *
1269
- * @version 3.8.1
1270
- * @since 3.8.1
1271
- */
1272
 
1273
- function GTM_page() {
1274
  ?>
1275
- <div class="wrap">
1276
- <h1><?php esc_html_e( 'Google Tag Manager', 'cookiebot' ); ?></h1>
1277
-
1278
- <form method="post" action="options.php" style="display: grid; grid-template-columns: 35% 65%; grid-row-gap: 20px; width: 700px; align-items: center;">
1279
- <?php settings_fields( 'cookiebot-gtm' ); ?>
1280
- <?php do_settings_sections( 'cookiebot-gtm' ); ?>
1281
-
1282
- <p><?php esc_html_e( 'Enable GTM', 'cookiebot' ); ?></p>
1283
- <div class="GTM_check">
1284
- <input type="checkbox" name="cookiebot-gtm" id="cookiebot-gtm" value="1" <?php checked( 1, get_option( 'cookiebot-gtm' ), true ); ?> style="float: left; margin: 2px 4px 0 0">
1285
- <p style="margin: 0; font-style: italic;"><?php esc_html_e( 'For more details about Cookiebot and Google Tag Manager click', 'cookiebot' ); ?><a target="_blank" href="https://www.cookiebot.com/en/google-tag-manager-and-gdpr-compliance-with-cookiebot/" style="margin: 0; font-style: italic;">&nbsp;<?php esc_html_e( 'here', 'cookiebot' ); ?></a></p>
1286
- </div>
 
 
 
 
 
 
 
 
 
 
1287
 
1288
- <p><?php esc_html_e( 'GTM ID', 'cookiebot' ); ?></p>
1289
- <input type="text" name="cookiebot-gtm-id" id="cookiebot-gtm-id" value="<?php echo get_option( 'cookiebot-gtm-id' ); ?>" style="height: 30px;">
 
1290
 
1291
- <p><?php esc_html_e( 'DataLayer name', 'cookiebot' ); ?></p>
1292
- <div>
1293
- <input type="text" name="cookiebot-data-layer" id="data_layer" placeholder="dataLayer" value="<?php echo get_option( 'cookiebot-data-layer' ); ?>" style="height: 30px;">
1294
- <p style="margin: 0;"><?php esc_html_e( 'Optional, only change if necessary', 'cookiebot' ); ?></p>
1295
- </div>
 
1296
 
1297
- <p><?php esc_html_e( 'Google Consent Mode', 'cookiebot' ); ?></p>
1298
- <div class="GTM_check">
1299
- <input type="checkbox" name="cookiebot-gcm" id="gcm" value="1" <?php checked( 1, get_option( 'cookiebot-gcm' ), true ); ?> style="float: left; margin: 2px 4px 0 0">
1300
- <p style="margin: 0; font-style: italic;"><?php esc_html_e( 'For more details about Cookiebot and Google Consent Mode click', 'cookiebot' ); ?><a target="_blank" href="https://support.cookiebot.com/hc/en-us/articles/360016047000-Cookiebot-and-Google-Consent-Mode" style="margin: 0; font-style: italic;">&nbsp;<?php esc_html_e( 'here', 'cookiebot' ); ?></a></p>
1301
- </div>
1302
- <input type="submit" value="Save" name="gtm_save" style="background-color: rgb(0, 124, 186); color: white; padding: 5px 10px; border: none; border-radius: 5px; justify-self: start;">
1303
- </form>
1304
- </div>
 
 
 
 
 
 
 
 
 
 
 
1305
  <?php
1306
  }
1307
 
@@ -1311,29 +1732,34 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1311
  * @version 2.0.0
1312
  * @since 2.0.0
1313
  */
1314
- function iab_page() {
1315
  ?>
1316
- <div class="wrap">
1317
- <h1><?php esc_html_e( 'IAB', 'cookiebot' ); ?></h1>
1318
-
1319
- <p>
1320
- <?php echo sprintf(
1321
- esc_html__( 'For more details about Cookiebot\'s IAB integration, see %sarticle about cookiebot and the IAB consent framework%s', 'cookiebot' ),
1322
- '<a href="https://support.cookiebot.com/hc/en-us/articles/360007652694-Cookiebot-and-the-IAB-Consent-Framework" target="_blank">',
1323
- '</a>'
1324
- ); ?>
1325
- </p>
1326
-
1327
- <form method="post" action="options.php">
1328
- <?php settings_fields( 'cookiebot-iab' ); ?>
1329
- <?php do_settings_sections( 'cookiebot-iab' ); ?>
1330
-
1331
- <label><?php esc_html_e( 'Enable IAB integration', 'cookiebot' ); ?></label>
1332
- <input type="checkbox" name="cookiebot-iab" value="1" <?php checked( 1, get_option( 'cookiebot-iab' ), true ); ?>>
1333
-
1334
- <?php submit_button(); ?>
1335
- </form>
1336
- </div>
 
 
 
 
 
1337
  <?php
1338
  }
1339
 
@@ -1343,44 +1769,50 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1343
  * @version 3.6.6
1344
  * @since 3.6.6
1345
  */
1346
- function legislations_page() {
1347
  ?>
1348
- <div class="wrap">
1349
- <h1><?php esc_html_e( 'Legislations', 'cookiebot' ); ?></h1>
1350
-
1351
- <p>
1352
- <?php echo sprintf(
1353
- esc_html__( 'For more details about Cookiebot\'s CCPA Legislation integration, see %sarticle about cookiebot and the CCPA compliance%s', 'cookiebot' ),
1354
- '<a href="https://support.cookiebot.com/hc/en-us/articles/360010932419-Use-multiple-banners-on-the-same-website-support-both-CCPA-GDPR-compliance-" target="_blank">',
1355
- '</a>'
1356
- ); ?>
1357
- </p>
1358
-
1359
- <form method="post" action="options.php">
1360
- <?php settings_fields( 'cookiebot-legislations' ); ?>
1361
- <?php do_settings_sections( 'cookiebot-legislations' ); ?>
1362
-
1363
-
1364
- <table class="form-table">
1365
- <tbody>
1366
- <tr valign="top">
1367
- <th scope="row"><label><?php esc_html_e( 'Enable CCPA configuration for visitors from California', 'cookiebot' ); ?></label></th>
1368
- <td>
1369
- <input type="checkbox" name="cookiebot-ccpa" value="1" <?php checked( 1, get_option( 'cookiebot-ccpa' ), true ); ?>>
1370
- </td>
1371
- </tr>
1372
- <tr>
1373
- <th valign="top"><label><?php esc_html_e('Domain Group ID', 'cookiebot'); ?></label></th>
1374
- <td>
1375
- <input type="text" style="width: 300px;" name="cookiebot-ccpa-domain-group-id" value="<?php echo get_option( 'cookiebot-ccpa-domain-group-id' ); ?>">
1376
- </td>
1377
- </tr>
1378
- </tbody>
1379
- </table>
1380
-
1381
- <?php submit_button(); ?>
1382
- </form>
1383
- </div>
 
 
 
 
 
 
1384
  <?php
1385
  }
1386
 
@@ -1391,7 +1823,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1391
  * @since 3.6.0
1392
  */
1393
 
1394
- function debug_page() {
1395
  global $wpdb;
1396
 
1397
  include_once ABSPATH . 'wp-admin/includes/plugin.php';
@@ -1470,20 +1902,41 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1470
  $debugStr .= "\n##### Debug Information END #####";
1471
 
1472
  ?>
1473
- <div class="wrap">
1474
- <h1><?php esc_html_e( 'Debug information', 'cookiebot' ); ?></h1>
1475
- <p><?php esc_html_e( 'The information below is for debugging purpose. If you have any issues with your Cookiebot integration, the information below is usefull for a supporter to help you the best way.', 'cookiebot' ); ?></p>
1476
- <p><button class="button button-primary" onclick="copyDebugInfo();"><?php esc_html_e( 'Copy debug information to clipboard', 'cookiebot' ); ?></button></p>
1477
- <textarea cols="100" rows="40" style="width:800px;max-width:100%;" id="cookiebot-debug-info" readonly><?php echo $debugStr; ?></textarea>
1478
- <script>
1479
- function copyDebugInfo() {
1480
- var t = document.getElementById("cookiebot-debug-info");
1481
- t.select();
1482
- t.setSelectionRange(0, 99999);
1483
- document.execCommand("copy");
1484
- }
1485
- </script>
1486
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1487
  <?php
1488
  }
1489
 
@@ -1493,7 +1946,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1493
  * @version 3.9.0
1494
  * @since 1.0.0
1495
  */
1496
- function add_js( $printTag = true ) {
1497
  $cbid = $this->get_cbid();
1498
  if ( ! empty( $cbid ) && ! defined( 'COOKIEBOT_DISABLE_ON_PAGE' ) ) {
1499
  if ( is_multisite() && get_site_option( 'cookiebot-nooutput', false ) ) {
@@ -1504,14 +1957,11 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1504
  return; //Do not show JS - output disabled
1505
  }
1506
 
1507
- if ( $this->get_cookie_blocking_mode() == 'auto' && $this->can_current_user_edit_theme() && $printTag !== false && get_site_option( 'cookiebot-output-logged-in' ) == false ) {
1508
  return;
1509
  }
1510
 
1511
  $lang = $this->get_language();
1512
- if ( ! empty( $lang ) ) {
1513
- $lang = ' data-culture="' . strtoupper( $lang ) . '"'; //Use data-culture to define language
1514
- }
1515
 
1516
  if ( ! is_multisite() || get_site_option( 'cookiebot-script-tag-uc-attribute', 'custom' ) == 'custom' ) {
1517
  $tagAttr = get_option( 'cookiebot-script-tag-uc-attribute', 'async' );
@@ -1519,100 +1969,108 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1519
  $tagAttr = get_site_option( 'cookiebot-script-tag-uc-attribute' );
1520
  }
1521
 
1522
- if ( $this->get_cookie_blocking_mode() == 'auto' ) {
1523
- $tagAttr = 'data-blockingmode="auto"';
1524
- }
1525
-
1526
- if ( get_option( 'cookiebot-gtm' ) != false ) {
1527
- if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
1528
- $data_layer = 'data-layer-name="dataLayer"';
1529
- } else {
1530
- $data_layer = 'data-layer-name="' . get_option( 'cookiebot-data-layer' ) . '"';
1531
- }
1532
- } else {
1533
- $data_layer = '';
1534
  }
1535
-
1536
- $iab = ( get_option( 'cookiebot-iab' ) != false ) ? 'data-framework="IAB"' : '';
1537
-
1538
- $ccpa = ( get_option( 'cookiebot-ccpa' ) != false ) ? 'data-georegions="{\'region\':\'US-06\',\'cbid\':\'' . get_option( 'cookiebot-ccpa-domain-group-id' ) . '\'}"' : '';
1539
-
1540
- $tag = '<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" ' . $iab . ' ' . $ccpa . ' ' . $data_layer . ' data-cbid="' . $cbid . '"' . $lang . ' type="text/javascript" ' . $tagAttr . '></script>';
1541
- if ( $printTag === false ) {
1542
- return $tag;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1543
  }
1544
- echo $tag;
1545
  }
1546
  }
1547
 
1548
  /**
1549
- * Cookiebot_WP Add Google Tag Manager JS to <head>
1550
- *
1551
- * @version 3.8.1
1552
- * @since 3.8.1
1553
- */
1554
-
1555
- function add_GTM( $printTag = true ) {
1556
-
1557
- if ( get_option( 'cookiebot-gtm' ) != false ) {
1558
 
 
 
1559
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
1560
  $data_layer = 'dataLayer';
1561
  } else {
1562
  $data_layer = get_option( 'cookiebot-data-layer' );
1563
  }
1564
 
1565
- $GTM = '<script>';
1566
- if ( get_option( 'cookiebot-iab' ) ) {
1567
- $GTM .= 'window ["gtag_enable_tcf_support"] = true;';
1568
  }
1569
-
1570
- $GTM .= "(function (w, d, s, l, i) {
1571
- w[l] = w[l] || []; w[l].push({'gtm.start':new Date().getTime(), event: 'gtm.js'});
1572
- var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
1573
- j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
1574
- f.parentNode.insertBefore(j, f);})
1575
- (window, document, 'script', '" . $data_layer . "', '" . get_option( 'cookiebot-gtm-id' ) . "');";
1576
-
1577
- $GTM .= '</script>';
1578
-
1579
- if ( $printTag === false ) {
1580
- return $GTM;
 
 
 
1581
  }
1582
-
1583
- echo $GTM;
1584
  }
1585
  }
1586
 
1587
  /**
1588
- * Cookiebot_WP Add Google Consent Mode JS to <head>
1589
- *
1590
- * @version 3.8.1
1591
- * @since 3.8.1
1592
- */
1593
-
1594
- function add_GCM( $printTag = true ) {
1595
-
1596
- if ( get_option( 'cookiebot-gcm' ) != false ) {
1597
 
 
 
1598
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
1599
  $data_layer = 'dataLayer';
1600
  } else {
1601
  $data_layer = get_option( 'cookiebot-data-layer' );
1602
  }
1603
 
1604
- $GCM = '<script data-cookieconsent="ignore">
1605
- (function(w,d,l){w[l]=w[l]||[];function gtag(){w[l].push(arguments)};
1606
- gtag("consent","default",{ad_storage:d,analytics_storage:d,wait_for_update:500,});
1607
- gtag("set", "ads_data_redaction", true);})(window,"denied","' . $data_layer . '");';
1608
-
1609
- $GCM .= '</script>';
1610
-
1611
- if ( $printTag === false ) {
1612
- return $GCM;
 
 
 
1613
  }
1614
-
1615
- echo $GCM;
1616
  }
1617
  }
1618
 
@@ -1624,7 +2082,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1624
  * @since 3.3.1
1625
  * @version 3.4.1
1626
  */
1627
- function can_current_user_edit_theme() {
1628
  if ( is_user_logged_in() ) {
1629
  if ( current_user_can( 'edit_themes' ) ) {
1630
  return true;
@@ -1649,7 +2107,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1649
  * @version 2.2.0
1650
  * @since 1.0.0
1651
  */
1652
- function show_declaration( $atts = array() ) {
1653
  $cbid = $this->get_cbid();
1654
  $lang = '';
1655
  if ( ! empty( $cbid ) ) {
@@ -1691,6 +2149,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1691
  return $network_cbid;
1692
  }
1693
  }
 
1694
  return $cbid;
1695
  }
1696
 
@@ -1708,7 +2167,9 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1708
  }
1709
  }
1710
  if ( empty( $cbm ) ) {
1711
- $cbm = 'manual'; }
 
 
1712
  return $cbm;
1713
  }
1714
 
@@ -1725,6 +2186,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1725
  } elseif ( get_option( 'cookiebot-nooutput-admin', false ) ) {
1726
  return true;
1727
  }
 
1728
  return false;
1729
  }
1730
 
@@ -1734,7 +2196,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1734
  * @version 1.4.0
1735
  * @since 1.4.0
1736
  */
1737
- function get_language( $onlyFromSetting = false ) {
1738
  // Get language set in setting page - if empty use WP language info
1739
  $lang = get_option( 'cookiebot-language' );
1740
  if ( ! empty( $lang ) ) {
@@ -1751,9 +2213,10 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1751
  if ( $lang == '_wp' ) {
1752
  $lang = get_bloginfo( 'language' ); //Gets language in en-US format
1753
  if ( ! empty( $lang ) ) {
1754
- list($lang) = explode( '-', $lang ); //Changes format from eg. en-US to en.
1755
  }
1756
  }
 
1757
  return $lang;
1758
  }
1759
 
@@ -1763,9 +2226,10 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1763
  * @version 1.6.1
1764
  * @since 1.6.1
1765
  */
1766
- function wp_rocket_exclude_external_js( $external_js_hosts ) {
1767
  $external_js_hosts[] = 'consent.cookiebot.com'; // Add cookiebot domains
1768
  $external_js_hosts[] = 'consentcdn.cookiebot.com';
 
1769
  return $external_js_hosts;
1770
  }
1771
 
@@ -1775,7 +2239,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1775
  * @version 3.6.5
1776
  * @since 3.6.5
1777
  */
1778
- function sgo_exclude_external_js( $exclude_list ) {
1779
  //Uses same format as WP Rocket - for now we just use WP Rocket function
1780
  return wp_rocket_exclude_external_js( $exclude_list );
1781
  }
@@ -1791,6 +2255,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1791
  if ( class_exists( 'WP_CONSENT_API' ) ) {
1792
  return true;
1793
  }
 
1794
  return false;
1795
  }
1796
 
@@ -1803,61 +2268,61 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1803
  public function get_default_wp_consent_api_mapping() {
1804
  return array(
1805
  'n=1;p=1;s=1;m=1' =>
1806
- array(
1807
- 'preferences' => 1,
1808
- 'statistics' => 1,
1809
- 'statistics-anonymous' => 0,
1810
- 'marketing' => 1,
1811
- ),
1812
  'n=1;p=1;s=1;m=0' =>
1813
- array(
1814
- 'preferences' => 1,
1815
- 'statistics' => 1,
1816
- 'statistics-anonymous' => 1,
1817
- 'marketing' => 0,
1818
- ),
1819
  'n=1;p=1;s=0;m=1' =>
1820
- array(
1821
- 'preferences' => 1,
1822
- 'statistics' => 0,
1823
- 'statistics-anonymous' => 0,
1824
- 'marketing' => 1,
1825
- ),
1826
  'n=1;p=1;s=0;m=0' =>
1827
- array(
1828
- 'preferences' => 1,
1829
- 'statistics' => 0,
1830
- 'statistics-anonymous' => 0,
1831
- 'marketing' => 0,
1832
- ),
1833
  'n=1;p=0;s=1;m=1' =>
1834
- array(
1835
- 'preferences' => 0,
1836
- 'statistics' => 1,
1837
- 'statistics-anonymous' => 0,
1838
- 'marketing' => 1,
1839
- ),
1840
  'n=1;p=0;s=1;m=0' =>
1841
- array(
1842
- 'preferences' => 0,
1843
- 'statistics' => 1,
1844
- 'statistics-anonymous' => 0,
1845
- 'marketing' => 0,
1846
- ),
1847
  'n=1;p=0;s=0;m=1' =>
1848
- array(
1849
- 'preferences' => 0,
1850
- 'statistics' => 0,
1851
- 'statistics-anonymous' => 0,
1852
- 'marketing' => 1,
1853
- ),
1854
  'n=1;p=0;s=0;m=0' =>
1855
- array(
1856
- 'preferences' => 0,
1857
- 'statistics' => 0,
1858
- 'statistics-anonymous' => 0,
1859
- 'marketing' => 0,
1860
- ),
1861
  );
1862
 
1863
  }
@@ -1887,6 +2352,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1887
  }
1888
  }
1889
  }
 
1890
  return $mapping;
1891
  }
1892
 
@@ -1896,8 +2362,11 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1896
  * @version 3.5.0
1897
  * @since 3.5.0
1898
  */
1899
- function cookiebot_enqueue_consent_api_scripts() {
1900
- wp_register_script( 'cookiebot-wp-consent-level-api-integration', plugins_url( 'cookiebot/js/cookiebot-wp-consent-level-api-integration.js', 'cookiebot' ) );
 
 
 
1901
  wp_enqueue_script( 'cookiebot-wp-consent-level-api-integration' );
1902
  wp_localize_script( 'cookiebot-wp-consent-level-api-integration', 'cookiebot_category_mapping', $this->get_wp_consent_api_mapping() );
1903
  }
@@ -1909,31 +2378,74 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1909
  * @version 2.0.5
1910
  * @since 2.0.5
1911
  */
1912
- function cookiebot_admin_notices() {
1913
  if ( ! $this->cookiebot_valid_admin_recommendation() ) {
1914
  return false;
1915
  }
1916
  $two_week_review_ignore = add_query_arg( array( 'cookiebot_admin_notice' => 'hide' ) );
1917
  $two_week_review_temp = add_query_arg( array( 'cookiebot_admin_notice' => 'two_week' ) );
1918
 
1919
- $notices = array(
1920
- 'title' => esc_html__( 'Leave A Review?', 'cookiebot' ),
1921
- 'msg' => esc_html__( 'We hope you enjoy using WordPress Cookiebot! Would you consider leaving us a review on WordPress.org?', 'cookiebot' ),
1922
- 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/plugin/cookiebot/reviews?filter=5&rate=5#new-post" target="_blank">' . esc_html__( 'Sure! I\'d love to!', 'cookiebot' ) . '</a></li>
1923
- <li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . esc_html__( 'I\'ve already left a review', 'cookiebot' ) . '</a></li>
1924
- <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . esc_html__( 'Maybe Later', 'cookiebot' ) . '</a></li>
1925
- <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . esc_html__( 'Never show again', 'cookiebot' ) . '</a></li>',
1926
- 'later_link' => $two_week_review_temp,
1927
- 'int' => 14,
1928
- );
1929
-
1930
- echo '<div class="update-nag cookiebot-admin-notice">
1931
- <div class="cookiebot-notice-logo"></div>
1932
- <p class="cookiebot-notice-title">' . $notices['title'] . '</p>
1933
- <p class="cookiebot-notice-body">' . $notices['msg'] . '</p>
1934
- <ul class="cookiebot-notice-body wd-blue">' . $notices['link'] . '</ul>
1935
- <a href="' . $notices['later_link'] . '" class="dashicons dashicons-dismiss"></a>
1936
- </div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1937
 
1938
  wp_enqueue_style( 'cookiebot-admin-notices', plugins_url( 'css/notice.css', __FILE__ ), array(), '2.0.4' );
1939
  }
@@ -1947,14 +2459,14 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1947
  * @version 2.0.5
1948
  * @since 2.0.5
1949
  */
1950
- function cookiebot_valid_admin_recommendation() {
1951
  //Default - the recommendation is allowed to be visible
1952
  $return = true;
1953
 
1954
  $option = get_option( 'cookiebot_notice_recommend' );
1955
 
1956
  if ( $option != false ) {
1957
- //Never show again is clicked
1958
  if ( $option == 'hide' ) {
1959
  $return = false;
1960
  } elseif ( is_numeric( $option ) && strtotime( 'now' ) < $option ) {
@@ -1962,6 +2474,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1962
  $return = false;
1963
  }
1964
  }
 
1965
  return $return;
1966
  }
1967
 
@@ -1971,9 +2484,9 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1971
  * @version 2.0.5
1972
  * @since 2.0.5
1973
  */
1974
- function save_notice_link() {
1975
  if ( isset( $_GET['cookiebot_admin_notice'] ) ) {
1976
- if ( $_GET['cookiebot_admin_notice'] == 'hide' ) {
1977
  update_option( 'cookiebot_notice_recommend', 'hide' );
1978
  } else {
1979
  update_option( 'cookiebot_notice_recommend', strtotime( '+2 weeks' ) );
@@ -1982,15 +2495,13 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
1982
  }
1983
 
1984
 
1985
-
1986
-
1987
  /**
1988
  * Cookiebot_WP Fix plugin conflicts related to Cookiebot
1989
  *
1990
  * @version 3.2.0
1991
  * @since 3.3.0
1992
  */
1993
- function cookiebot_fix_plugin_conflicts() {
1994
  //Fix for Divi Page Builder
1995
  //Disabled - using another method now (can_current_user_edit_theme())
1996
  //add_action( 'wp', array( $this, '_cookiebot_plugin_conflict_divi' ), 100 );
@@ -2006,11 +2517,11 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
2006
  * @version 3.2.0
2007
  * @since 3.2.0
2008
  */
2009
- function _cookiebot_plugin_conflict_divi() {
2010
  if ( defined( 'ET_FB_ENABLED' ) ) {
2011
  if ( ET_FB_ENABLED &&
2012
- $this->cookiebot_disabled_in_admin() &&
2013
- $this->get_cookie_blocking_mode() == 'auto' ) {
2014
 
2015
  define( 'COOKIEBOT_DISABLE_ON_PAGE', true ); //Disable Cookiebot on the current page
2016
 
@@ -2024,7 +2535,7 @@ if ( ! class_exists( 'Cookiebot_WP' ) ) :
2024
  * @version 3.2.0
2025
  * @since 3.3.0
2026
  */
2027
- function _cookiebot_plugin_conflict_scripttags( $tag, $handle ) {
2028
 
2029
  //Check if Elementor Page Builder active
2030
  if ( defined( 'ELEMENTOR_VERSION' ) ) {
@@ -2078,14 +2589,15 @@ endif;
2078
  /**
2079
  * Helper function to manipulate script tags
2080
  *
2081
- * @version 1.6
2082
- * @since 1.0
2083
  * @return string
 
 
2084
  */
2085
  function cookiebot_assist( $type = 'statistics' ) {
2086
  //change to array
2087
  if ( ! is_array( $type ) ) {
2088
- $type = array( $type ); }
 
2089
 
2090
  foreach ( $type as $tk => $tv ) {
2091
  if ( ! in_array( $tv, array( 'marketing', 'statistics', 'preferences' ) ) ) {
@@ -2095,6 +2607,7 @@ function cookiebot_assist( $type = 'statistics' ) {
2095
  if ( sizeof( $type ) > 0 ) {
2096
  return ' type="text/plain" data-cookieconsent="' . implode( ',', $type ) . '"';
2097
  }
 
2098
  return '';
2099
  }
2100
 
@@ -2103,15 +2616,16 @@ function cookiebot_assist( $type = 'statistics' ) {
2103
  * Helper function to check if cookiebot is active.
2104
  * Useful for other plugins adding support for Cookiebot.
2105
  *
2106
- * @version 2.2.2
2107
- * @since 1.2
2108
  * @return string
 
 
2109
  */
2110
  function cookiebot_active() {
2111
  $cbid = Cookiebot_WP::get_cbid();
2112
  if ( ! empty( $cbid ) ) {
2113
  return true;
2114
  }
 
2115
  return false;
2116
  }
2117
 
@@ -2120,9 +2634,9 @@ if ( ! function_exists( 'cookiebot' ) ) {
2120
  /**
2121
  * Returns the main instance of Cookiebot_WO to prevent the need to use globals.
2122
  *
2123
- * @version 1.0.0
2124
- * @since 1.0.0
2125
  * @return Cookiebot_WP
 
 
2126
  */
2127
  function cookiebot() {
2128
  return Cookiebot_WP::instance();
4
  Plugin URI: https://cookiebot.com/
5
  Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
6
  Author: Cybot A/S
7
+ Version: 3.11.1
8
  Author URI: http://cookiebot.com
9
  Text Domain: cookiebot
10
  Domain Path: /langs
23
  * @var string
24
  * @since 1.0.0
25
  */
26
+ public $version = '3.11.1';
27
 
28
  /**
29
  * @var Cookiebot_WP The single instance of the class
30
  * @since 1.0.0
31
  */
32
+ protected static $instance = null;
33
 
34
  /**
35
  * Main Cookiebot_WP Instance
36
  *
37
  * Ensures only one instance of Cookiebot_WP is loaded or can be loaded.
38
  *
39
+ * @return Cookiebot_WP - Main instance
40
  * @since 1.0.0
41
  * @static
42
+ * @version 1.0.0
43
  */
44
  public static function instance() {
45
+ if ( is_null( self::$instance ) ) {
46
+ self::$instance = new self();
47
  }
48
+
49
+ return self::$instance;
50
  }
51
 
52
  /**
56
  * @since 1.0.0
57
  * @access public
58
  */
59
+ public function __construct() {
60
  add_action( 'after_setup_theme', array( $this, 'cookiebot_init' ), 5 );
61
  register_activation_hook( __FILE__, array( $this, 'activation' ) );
62
  register_deactivation_hook( __FILE__, 'cookiebot_addons_plugin_deactivated' );
71
  * @since 2.1.4
72
  * @accces public
73
  */
74
+ public function activation() {
75
  //Delay display of recommendation notice in 3 days if not activated ealier
76
  if ( get_option( 'cookiebot_notice_recommend', false ) === false ) {
77
  //Not set yet - this must be first activation - delay in 3 days
78
  update_option( 'cookiebot_notice_recommend', strtotime( '+3 days' ) );
79
  }
80
+ if ( $this->get_cbid() === '' ) {
81
  if ( is_multisite() ) {
82
  update_site_option( 'cookiebot-cookie-blocking-mode', 'auto' );
83
  update_site_option( 'cookiebot-nooutput-admin', true );
90
  /**
91
  * Run through the addons and enable the default ones
92
  */
93
+ if ( ( ! defined( 'COOKIEBOT_ADDONS_STANDALONE' ) || COOKIEBOT_ADDONS_STANDALONE !== true || ! defined( 'COOKIE_ADDONS_LOADED' ) ) ) {
94
  //Make sure we got a PHP version that works
95
  if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
96
  define( 'COOKIEBOT_URL', plugin_dir_url( __FILE__ ) );
109
  * @since 1.6.2
110
  * @access public
111
  */
112
+ public function cookiebot_init() {
113
  /* Load Cookiebot Addons Framework */
114
+ $dismiss_addons = false;
115
  if ( defined( 'CAF_DIR' ) ) {
116
+ $dismiss_addons = true;
117
  /*add_action('admin_notices', function() {
118
  ?>
119
  <div class="notice notice-warning">
125
  </div>
126
  <?php
127
  });*/
128
+ } //elseif( $this->get_cookie_blocking_mode() !== 'auto' ) {
 
129
  else {
130
+ if ( ( ! defined( 'COOKIEBOT_ADDONS_STANDALONE' ) || COOKIEBOT_ADDONS_STANDALONE !== true || ! defined( 'COOKIE_ADDONS_LOADED' ) ) && $dismiss_addons !== true ) {
131
  //Make sure we got a PHP version that works
132
  if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
133
  define( 'COOKIEBOT_URL', plugin_dir_url( __FILE__ ) );
138
  } else {
139
  add_action(
140
  'admin_notices',
141
+ function () {
142
  ?>
143
+ <div class="notice notice-warning">
144
+ <p>
145
+ <?php esc_html_e( 'You are using Cookiebot Addons Standalone.', 'cookiebot' ); ?>
146
+ </p>
147
+ </div>
148
  <?php
149
  }
150
  );
174
  //Check if we should show cookie consent banner on admin pages
175
  if ( ! $this->cookiebot_disabled_in_admin() ) {
176
  //adding cookie banner in admin area too
177
+ add_action( 'admin_head', array( $this, 'add_js' ), - 9999 );
178
  }
179
  }
180
 
187
  load_plugin_textdomain( 'cookiebot', false, dirname( plugin_basename( __FILE__ ) ) . '/langs/' );
188
 
189
  //add JS
190
+ add_action( 'wp_head', array( $this, 'add_js' ), - 9997 );
191
+ add_action( 'wp_head', array( $this, 'add_GTM' ), - 9998 );
192
+ add_action( 'wp_head', array( $this, 'add_GCM' ), - 9999 );
193
  add_shortcode( 'cookie_declaration', array( $this, 'show_declaration' ) );
194
 
195
  //Add filter if WP rocket is enabled
221
  * @version 3.7.0
222
  * @since 3.7.0
223
  */
224
+ public function gutenberg_block_setup() {
225
  if ( ! function_exists( 'register_block_type' ) ) {
226
  return; //gutenberg not active
227
  }
240
  * @version 3.7.1
241
  * @since 3.7.1
242
  */
243
+ public function gutenberg_block_admin_assets() {
244
  //Add Gutenberg Widget
245
  wp_enqueue_script(
246
  'cookiebot-declaration',
256
  * @version 3.7.0
257
  * @since 3.7.0
258
  */
259
+ public function block_cookie_declaration() {
260
  return $this->show_declaration();
261
  }
262
 
266
  * @version 2.0.0
267
  * @since 2.0.0
268
  */
269
+ public function load_textdomain() {
270
  load_plugin_textdomain( 'cookiebot', false, basename( dirname( __FILE__ ) ) . '/langs' );
271
  }
272
 
276
  * @version 2.5.0
277
  * @since 2.5.0
278
  */
279
+ public function register_widgets() {
280
  register_widget( 'Cookiebot_Declaration_Widget' );
281
  }
282
 
287
  * @since 1.0.0
288
  */
289
 
290
+ public function add_dashboard_widgets() {
291
  wp_add_dashboard_widget( 'cookiebot_status', esc_html__( 'Cookiebot Status', 'cookiebot' ), array( $this, 'dashboard_widget_status' ) );
292
  }
293
 
297
  * @version 1.0.0
298
  * @since 1.0.0
299
  */
300
+ public function dashboard_widget_status() {
301
  $cbid = $this->get_cbid();
302
  if ( empty( $cbid ) ) {
303
  echo '<p>' . esc_html__( 'You need to enter your Cookiebot ID.', 'cookiebot' ) . '</p>';
315
  * @version 2.2.0
316
  * @since 1.0.0
317
  */
318
+ public function add_menu() {
319
  //Cookiebot Icon SVG base64 encoded
320
  $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNDYuODcyNTkwMyA4Ljc3MzU4MzM0QzQxLjk0MzkwMzkgMy4zODI5NTAxMSAzNC44NDI0OTQ2IDAgMjYuOTQ4MjgxOSAwIDEyLjA2NTE1NjggMCAwIDEyLjAyNDQ3NzQgMCAyNi44NTc0MjE5YzAgMTQuODMyOTQ0NSAxMi4wNjUxNTY4IDI2Ljg1NzQyMTkgMjYuOTQ4MjgxOSAyNi44NTc0MjE5IDcuODk0MjEyNyAwIDE0Ljk5NTYyMi0zLjM4Mjk1MDIgMTkuOTI0MzA4NC04Ljc3MzU4MzQtMi44ODk2OTY3LTEuMzY4ODY2My01LjM5OTMxMS0zLjQwNTQzOS03LjMyODA4MzgtNS45MDk2MzU4LTMuMTIxNDMwNiAzLjIwOTQxMDQtNy40OTI5OTQ0IDUuMjA0MTI5MS0xMi4zMzIwMjU4IDUuMjA0MTI5MS05LjQ4NDM0NDQgMC0xNy4xNzI5MjQ3LTcuNjYyNjU3Mi0xNy4xNzI5MjQ3LTE3LjExNTAyMzhzNy42ODg1ODAzLTE3LjExNTAyMzcgMTcuMTcyOTI0Ny0xNy4xMTUwMjM3YzQuNzIzNDgyMiAwIDkuMDAxNTU1MiAxLjkwMDU5MzkgMTIuMTA2MjkyIDQuOTc2MzA5IDEuOTU2OTIzNy0yLjY0MTEzMSA0LjU1MDAyNjMtNC43ODU1MTgzIDcuNTUzODE3Ni02LjIwODQzMTg2eiIvPjxwYXRoIGQ9Ik01NS4zODAzMjgyIDQyLjY1MDE5OTFDNDYuMzMzNzIyNyA0Mi42NTAxOTkxIDM5IDM1LjM0MTIwMzEgMzkgMjYuMzI1MDk5NiAzOSAxNy4zMDg5OTYgNDYuMzMzNzIyNyAxMCA1NS4zODAzMjgyIDEwYzkuMDQ2NjA1NSAwIDE2LjM4MDMyODIgNy4zMDg5OTYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+';
321
  add_menu_page( 'Cookiebot', __( 'Cookiebot', 'cookiebot' ), 'manage_options', 'cookiebot', array( $this, 'settings_page' ), $icon );
322
 
323
+ add_submenu_page(
324
+ 'cookiebot',
325
+ __( 'Cookiebot Settings', 'cookiebot' ),
326
+ __( 'Settings', 'cookiebot' ),
327
+ 'manage_options',
328
+ 'cookiebot',
329
+ array( $this, 'settings_page' ),
330
+ 10
331
+ );
332
+ add_submenu_page(
333
+ 'cookiebot',
334
+ __( 'Cookiebot Support', 'cookiebot' ),
335
+ __( 'Support', 'cookiebot' ),
336
+ 'manage_options',
337
+ 'cookiebot_support',
338
+ array( $this, 'support_page' ),
339
+ 20
340
+ );
341
+ add_submenu_page(
342
+ 'cookiebot',
343
+ __( 'Google Tag Manager', 'cookiebot' ),
344
+ __( 'Google Tag Manager', 'cookiebot' ),
345
+ 'manage_options',
346
+ 'cookiebot_GTM',
347
+ array( $this, 'GTM_page' )
348
+ );
349
+ add_submenu_page(
350
+ 'cookiebot',
351
+ __( 'IAB', 'cookiebot' ),
352
+ __( 'IAB', 'cookiebot' ),
353
+ 'manage_options',
354
+ 'cookiebot_iab',
355
+ array( $this, 'iab_page' ),
356
+ 30
357
+ );
358
 
359
  if ( defined( 'COOKIEBOT_ADDONS_UNSUPPORTED_PHPVERSION' ) ) {
360
  //Load prior consent page anyway - but from Cookiebot WP Core plugin.
361
+ add_submenu_page(
362
+ 'cookiebot',
363
+ __( 'Prior Consent', 'cookiebot' ),
364
+ __( 'Prior Consent', 'cookiebot' ),
365
+ 'manage_options',
366
+ 'cookiebot-addons',
367
+ array( $this, 'setting_page_placeholder' ),
368
+ 40
369
+ );
370
  }
371
  }
372
 
373
+ public function add_menu_legislations() {
374
+ add_submenu_page(
375
+ 'cookiebot',
376
+ __( 'Legislations', 'cookiebot' ),
377
+ __( 'Legislations', 'cookiebot' ),
378
+ 'manage_options',
379
+ 'cookiebot-legislations',
380
+ array( $this, 'legislations_page' ),
381
+ 50
382
+ );
383
  }
384
 
385
  /**
388
  * @version 3.6.0
389
  * @since 3.6.0
390
  */
391
+ public function add_menu_debug() {
392
+ add_submenu_page(
393
+ 'cookiebot',
394
+ __( 'Debug info', 'cookiebot' ),
395
+ __( 'Debug info', 'cookiebot' ),
396
+ 'manage_options',
397
+ 'cookiebot_debug',
398
+ array( $this, 'debug_page' )
399
+ );
400
  }
401
 
402
  /**
405
  * @version 2.2.0
406
  * @since 2.2.0
407
  */
408
+ public function add_network_menu() {
409
  $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNDYuODcyNTkwMyA4Ljc3MzU4MzM0QzQxLjk0MzkwMzkgMy4zODI5NTAxMSAzNC44NDI0OTQ2IDAgMjYuOTQ4MjgxOSAwIDEyLjA2NTE1NjggMCAwIDEyLjAyNDQ3NzQgMCAyNi44NTc0MjE5YzAgMTQuODMyOTQ0NSAxMi4wNjUxNTY4IDI2Ljg1NzQyMTkgMjYuOTQ4MjgxOSAyNi44NTc0MjE5IDcuODk0MjEyNyAwIDE0Ljk5NTYyMi0zLjM4Mjk1MDIgMTkuOTI0MzA4NC04Ljc3MzU4MzQtMi44ODk2OTY3LTEuMzY4ODY2My01LjM5OTMxMS0zLjQwNTQzOS03LjMyODA4MzgtNS45MDk2MzU4LTMuMTIxNDMwNiAzLjIwOTQxMDQtNy40OTI5OTQ0IDUuMjA0MTI5MS0xMi4zMzIwMjU4IDUuMjA0MTI5MS05LjQ4NDM0NDQgMC0xNy4xNzI5MjQ3LTcuNjYyNjU3Mi0xNy4xNzI5MjQ3LTE3LjExNTAyMzhzNy42ODg1ODAzLTE3LjExNTAyMzcgMTcuMTcyOTI0Ny0xNy4xMTUwMjM3YzQuNzIzNDgyMiAwIDkuMDAxNTU1MiAxLjkwMDU5MzkgMTIuMTA2MjkyIDQuOTc2MzA5IDEuOTU2OTIzNy0yLjY0MTEzMSA0LjU1MDAyNjMtNC43ODU1MTgzIDcuNTUzODE3Ni02LjIwODQzMTg2eiIvPjxwYXRoIGQ9Ik01NS4zODAzMjgyIDQyLjY1MDE5OTFDNDYuMzMzNzIyNyA0Mi42NTAxOTkxIDM5IDM1LjM0MTIwMzEgMzkgMjYuMzI1MDk5NiAzOSAxNy4zMDg5OTYgNDYuMzMzNzIyNyAxMCA1NS4zODAzMjgyIDEwYzkuMDQ2NjA1NSAwIDE2LjM4MDMyODIgNy4zMDg5OTYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+';
410
+ add_menu_page(
411
+ 'Cookiebot',
412
+ __( 'Cookiebot', 'cookiebot' ),
413
+ 'manage_network_options',
414
+ 'cookiebot_network',
415
+ array( $this, 'network_settings_page' ),
416
+ $icon
417
+ );
418
 
419
+ add_submenu_page(
420
+ 'cookiebot_network',
421
+ __( 'Cookiebot Settings', 'cookiebot' ),
422
+ __( 'Settings', 'cookiebot' ),
423
+ 'network_settings_page',
424
+ 'cookiebot_network',
425
+ array( $this, 'network_settings_page' )
426
+ );
427
+ add_submenu_page(
428
+ 'cookiebot_network',
429
+ __( 'Cookiebot Support', 'cookiebot' ),
430
+ __( 'Support', 'cookiebot' ),
431
+ 'network_settings_page',
432
+ 'cookiebot_support',
433
+ array( $this, 'support_page' )
434
+ );
435
 
436
  }
437
 
441
  * @version 1.4.0
442
  * @since 1.0.0
443
  */
444
+ public function setting_page_placeholder() {
445
  include __DIR__ . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'view/admin/settings/setting-page.php';
446
  }
447
 
451
  * @version 3.9.0
452
  * @since 1.0.0
453
  */
454
+ public function register_cookiebot_settings() {
455
  register_setting( 'cookiebot', 'cookiebot-cbid' );
456
  register_setting( 'cookiebot', 'cookiebot-language' );
457
  register_setting( 'cookiebot', 'cookiebot-nooutput' );
477
  * @version 2.2.0
478
  * @since 1.5.0
479
  */
480
+ public function automatic_updates( $update, $item ) {
481
  //Do not update from subsite on a multisite installation
482
  if ( is_multisite() && ! is_main_site() ) {
483
  return $update;
515
  * @since 1.4.0
516
  */
517
  public static function get_supported_languages() {
518
+ $supported_languages = array();
519
+ $supported_languages['nb'] = __( 'Norwegian Bokmål', 'cookiebot' );
520
+ $supported_languages['tr'] = __( 'Turkish', 'cookiebot' );
521
+ $supported_languages['de'] = __( 'German', 'cookiebot' );
522
+ $supported_languages['cs'] = __( 'Czech', 'cookiebot' );
523
+ $supported_languages['da'] = __( 'Danish', 'cookiebot' );
524
+ $supported_languages['sq'] = __( 'Albanian', 'cookiebot' );
525
+ $supported_languages['he'] = __( 'Hebrew', 'cookiebot' );
526
+ $supported_languages['ko'] = __( 'Korean', 'cookiebot' );
527
+ $supported_languages['it'] = __( 'Italian', 'cookiebot' );
528
+ $supported_languages['nl'] = __( 'Dutch', 'cookiebot' );
529
+ $supported_languages['vi'] = __( 'Vietnamese', 'cookiebot' );
530
+ $supported_languages['ta'] = __( 'Tamil', 'cookiebot' );
531
+ $supported_languages['is'] = __( 'Icelandic', 'cookiebot' );
532
+ $supported_languages['ro'] = __( 'Romanian', 'cookiebot' );
533
+ $supported_languages['si'] = __( 'Sinhala', 'cookiebot' );
534
+ $supported_languages['ca'] = __( 'Catalan', 'cookiebot' );
535
+ $supported_languages['bg'] = __( 'Bulgarian', 'cookiebot' );
536
+ $supported_languages['uk'] = __( 'Ukrainian', 'cookiebot' );
537
+ $supported_languages['zh'] = __( 'Chinese', 'cookiebot' );
538
+ $supported_languages['en'] = __( 'English', 'cookiebot' );
539
+ $supported_languages['ar'] = __( 'Arabic', 'cookiebot' );
540
+ $supported_languages['hr'] = __( 'Croatian', 'cookiebot' );
541
+ $supported_languages['th'] = __( 'Thai', 'cookiebot' );
542
+ $supported_languages['el'] = __( 'Greek', 'cookiebot' );
543
+ $supported_languages['lt'] = __( 'Lithuanian', 'cookiebot' );
544
+ $supported_languages['pl'] = __( 'Polish', 'cookiebot' );
545
+ $supported_languages['lv'] = __( 'Latvian', 'cookiebot' );
546
+ $supported_languages['fr'] = __( 'French', 'cookiebot' );
547
+ $supported_languages['id'] = __( 'Indonesian', 'cookiebot' );
548
+ $supported_languages['mk'] = __( 'Macedonian', 'cookiebot' );
549
+ $supported_languages['et'] = __( 'Estonian', 'cookiebot' );
550
+ $supported_languages['pt'] = __( 'Portuguese', 'cookiebot' );
551
+ $supported_languages['ga'] = __( 'Irish', 'cookiebot' );
552
+ $supported_languages['ms'] = __( 'Malay', 'cookiebot' );
553
+ $supported_languages['sl'] = __( 'Slovenian', 'cookiebot' );
554
+ $supported_languages['ru'] = __( 'Russian', 'cookiebot' );
555
+ $supported_languages['ja'] = __( 'Japanese', 'cookiebot' );
556
+ $supported_languages['hi'] = __( 'Hindi', 'cookiebot' );
557
+ $supported_languages['sk'] = __( 'Slovak', 'cookiebot' );
558
+ $supported_languages['es'] = __( 'Spanish', 'cookiebot' );
559
+ $supported_languages['sv'] = __( 'Swedish', 'cookiebot' );
560
+ $supported_languages['sr'] = __( 'Serbian', 'cookiebot' );
561
+ $supported_languages['fi'] = __( 'Finnish', 'cookiebot' );
562
+ $supported_languages['eu'] = __( 'Basque', 'cookiebot' );
563
+ $supported_languages['hu'] = __( 'Hungarian', 'cookiebot' );
564
+ asort( $supported_languages, SORT_LOCALE_STRING );
565
+
566
+ return $supported_languages;
567
  }
568
 
569
  /**
572
  * @version 3.9.0
573
  * @since 1.0.0
574
  */
575
+ public function settings_page() {
576
  wp_enqueue_style( 'cookiebot-consent-mapping-table', plugins_url( 'css/consent_mapping_table.css', __FILE__ ), array(), '3.5.0' );
577
 
578
  /* Check if multisite */
584
  $network_cookie_blocking_mode = get_site_option( 'cookiebot-cookie-blocking-mode', 'manual' );
585
  }
586
  ?>
587
+ <div class="wrap">
588
+ <h1><?php esc_html_e( 'Cookiebot Settings', 'cookiebot' ); ?></h1>
589
+ <a href="https://www.cookiebot.com">
590
+ <img src="<?php echo esc_url( plugins_url( 'cookiebot-logo.png', __FILE__ ) ); ?>" style="float:right;margin-left:1em;">
591
+ </a>
592
+ <p>
593
+ <?php
594
+ $cookiebot_gdpr_url = 'https://www.cookiebot.com/goto/gdpr';
595
+ printf(
596
+ esc_html__(
597
+ 'Cookiebot enables your website to comply with current legislation in the EU on the use of cookies for user tracking and profiling. The EU ePrivacy Directive requires prior, informed consent of your site users, while the %1$s %2$s.',
598
+ 'cookiebot'
599
+ ),
600
+ sprintf(
601
+ '<a href="%s" target="_blank">%s</a>',
602
+ esc_url( $cookiebot_gdpr_url ),
603
+ esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' )
604
+ ),
605
+ esc_html__(
606
+ ' requires you to document each consent. At the same time you must be able to account for what user data you share with embedded third-party services on your website and where in the world the user data is sent.',
607
+ 'cookiebot'
608
+ )
609
+ );
610
+ ?>
611
+ </p>
612
+ <form method="post" action="options.php">
613
  <?php settings_fields( 'cookiebot' ); ?>
614
+ <?php do_settings_sections( 'cookiebot' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  <table class="form-table">
616
+ <tr valign="top">
617
+ <th scope="row"><?php esc_html_e( 'Cookiebot ID', 'cookiebot' ); ?></th>
 
 
 
618
  <td>
619
+ <input
620
+ type="text"
621
+ name="cookiebot-cbid"
622
+ value="<?php echo esc_attr( get_option( 'cookiebot-cbid' ) ); ?>"
623
+ <?php if ( $is_ms ) : ?>
624
+ placeholder="<?php echo esc_attr( $network_cbid ); ?>"
625
+ <?php endif; ?>
626
+ style="width:300px"
627
+ />
 
 
 
 
 
 
 
 
 
 
 
 
 
628
  <p class="description">
629
+ <?php esc_html_e( 'Need an ID?', 'cookiebot' ); ?>
630
+ <a href="https://www.cookiebot.com/goto/signup" target="_blank">
631
  <?php
632
+ esc_html_e(
633
+ 'Sign up for free on cookiebot.com',
634
+ 'cookiebot'
635
+ );
636
  ?>
637
+ </a>
638
  </p>
639
  </td>
640
  </tr>
641
  <tr valign="top">
642
  <th scope="row">
643
+ <?php esc_html_e( 'Cookie-blocking mode', 'cookiebot' ); ?>
 
644
  </th>
645
  <td>
646
  <?php
647
+ $cbm = get_option( 'cookiebot-cookie-blocking-mode', 'manual' );
648
+ if ( $is_ms && $network_cookie_blocking_mode != 'custom' ) {
649
+ $cbm = $network_cookie_blocking_mode;
 
 
650
  }
651
  ?>
652
  <label>
653
+ <input type="radio" name="cookiebot-cookie-blocking-mode" value="auto" <?php checked( 'auto', $cbm, true ); ?> />
654
+ <?php esc_html_e( 'Automatic', 'cookiebot' ); ?>
655
  </label>
656
  &nbsp; &nbsp;
657
  <label>
658
+ <input type="radio" name="cookiebot-cookie-blocking-mode" value="manual" <?php checked( 'manual', $cbm, true ); ?> />
659
+ <?php esc_html_e( 'Manual', 'cookiebot' ); ?>
 
 
 
 
 
660
  </label>
661
  <p class="description">
662
+ <?php esc_html_e( 'Automatic block cookies (except necessary) until the user has given their consent.', 'cookiebot' ); ?>
663
+ <a href="https://support.cookiebot.com/hc/en-us/articles/360009063100-Automatic-Cookie-Blocking-How-does-it-work-"
664
+ target="_blank">
665
+ <?php esc_html_e( 'Learn more', 'cookiebot' ); ?>
666
+ </a>
667
  </p>
668
+ <script>
669
+ jQuery( document ).ready( function ( $ ) {
670
+ var cookieBlockingMode = '<?php echo esc_js( $cbm ); ?>';
671
+ $( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function () {
672
+ if ( this.value == 'auto' && cookieBlockingMode != this.value ) {
673
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
674
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
675
+ }
676
+ if ( this.value == 'manual' && cookieBlockingMode != this.value ) {
677
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 );
678
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false );
679
+ }
680
+ cookieBlockingMode = this.value;
681
+ } );
682
+ if ( cookieBlockingMode == 'auto' ) {
683
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
684
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
685
+ }
686
+ } );
687
+ </script>
688
  </td>
689
  </tr>
690
+ <tr valign="top">
691
+ <th scope="row"><?php esc_html_e( 'Cookiebot Language', 'cookiebot' ); ?></th>
692
+ <td>
693
+ <div>
694
+ <select name="cookiebot-language" id="cookiebot-language">
695
+ <?php
696
+ $current_lang = $this->get_language( true );
697
+ ?>
698
+ <option value=""><?php esc_html_e( 'Default (Autodetect)', 'cookiebot' ); ?></option>
699
+ <option value="_wp"<?php echo ( $current_lang == '_wp' ) ? ' selected' : ''; ?>>
700
+ <?php
701
+ esc_html_e(
702
+ 'Use WordPress Language',
703
+ 'cookiebot'
704
+ );
705
+ ?>
706
+ </option>
707
+ <?php
708
+ $supported_languages = $this->get_supported_languages();
709
+ foreach ( $supported_languages as $lang_code => $lang_name ) :
710
+ ?>
711
+ <option value="<?php echo esc_attr( $lang_code ); ?>"
712
+ <?php if ( $current_lang === $lang_code ) : ?>
713
+ selected
714
+ <?php endif; ?>
715
+ ><?php echo esc_html( $lang_name ); ?></option>
716
+ <?php endforeach; ?>
717
+ </select>
718
+ </div>
719
+ <div class="notice inline notice-warning notice-alt cookiebot-notice" style="padding:12px;font-size:13px;display:inline-block;">
720
+ <div style="<?php echo ( $current_lang === '' ) ? 'display:none;' : ''; ?>" id="info_lang_specified">
721
+ <?php esc_html_e( 'You need to add the language in the Cookiebot administration tool.', 'cookiebot' ); ?>
722
+ </div>
723
+ <div style="<?php echo ( $current_lang === '' ) ? '' : 'display:none;'; ?>" id="info_lang_autodetect">
724
+ <?php
725
+ esc_html_e(
726
+ 'You need to add all languages that you want auto-detected in the Cookiebot administration tool.',
727
+ 'cookiebot'
728
+ );
729
+ ?>
730
+ <br/>
731
+ <?php
732
+ esc_html_e(
733
+ 'The auto-detect checkbox needs to be enabled in the Cookiebot administration tool.',
734
+ 'cookiebot'
735
+ );
736
+ ?>
737
+ <br/>
738
+ <?php
739
+ esc_html_e(
740
+ 'If the auto-detected language is not supported, Cookiebot will use the default language.',
741
+ 'cookiebot'
742
+ );
743
+ ?>
744
+ </div>
745
+ <br/>
746
+
747
+ <a href="#" id="show_add_language_guide"><?php esc_html_e( 'Show guide to add languages', 'cookiebot' ); ?></a>
748
+ &nbsp;
749
+ <a href="https://support.cookiebot.com/hc/en-us/articles/360003793394-How-do-I-set-the-language-of-the-consent-banner-dialog-"
750
+ target="_blank">
751
+ <?php esc_html_e( 'Read more here', 'cookiebot' ); ?>
752
+ </a>
753
+
754
+ <div id="add_language_guide" style="display:none;">
755
+ <img src="<?php echo esc_url( plugin_dir_url( __FILE__ ) . '/assets/guide_add_language.gif' ); ?>"
756
+ alt="Add language in Cookiebot administration tool"/>
757
+ <br/>
758
+ <a href="#" id="hide_add_language_guide"><?php esc_html_e( 'Hide guide', 'cookiebot' ); ?></a>
759
+ </div>
760
+ </div>
761
+ <script>
762
+ jQuery( document ).ready( function ( $ ) {
763
+ $( '#show_add_language_guide' ).on( 'click', function ( e ) {
764
+ e.preventDefault();
765
+ $( '#add_language_guide' ).slideDown();
766
+ $( this ).hide();
767
+ } );
768
+ $( '#hide_add_language_guide' ).on( 'click', function ( e ) {
769
+ e.preventDefault();
770
+ $( '#add_language_guide' ).slideUp();
771
+ $( '#show_add_language_guide' ).show();
772
+ } );
773
+
774
+ $( '#cookiebot-language' ).on( 'change', function () {
775
+ if ( this.value === '' ) {
776
+ $( '#info_lang_autodetect' ).show();
777
+ $( '#info_lang_specified' ).hide();
778
+ } else {
779
+ $( '#info_lang_autodetect' ).hide();
780
+ $( '#info_lang_specified' ).show();
781
+ }
782
+ } );
783
+ } );
784
+ </script>
785
+
786
+ </td>
787
+ </tr>
788
+ </table>
789
+ <script>
790
+ jQuery( document ).ready( function ( $ ) {
791
+ $( '.cookiebot_fieldset_header' ).on( 'click', function ( e ) {
792
+ e.preventDefault();
793
+ $( this ).next().slideToggle();
794
+ $( this ).toggleClass( 'active' );
795
+ } );
796
+ } );
797
+ </script>
798
+ <style type="text/css">
799
+ .cookiebot_fieldset_header {
800
+ cursor: pointer;
801
+ }
802
+
803
+ .cookiebot_fieldset_header::after {
804
+ content: "\f140";
805
+ font: normal 24px/1 dashicons;
806
+ position: relative;
807
+ top: 5px;
808
+ }
809
+
810
+ .cookiebot_fieldset_header.active::after {
811
+ content: "\f142";
812
+ }
813
+ </style>
814
+ <h3 id="advanced_settings_link" class="cookiebot_fieldset_header"><?php esc_html_e( 'Advanced settings', 'cookiebot' ); ?></h3>
815
+ <div id="advanced_settings" style="display:none;">
816
+ <table class="form-table">
817
+ <tr valign="top" id="cookiebot-setting-async">
818
+ <th scope="row">
819
+ <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
820
+ <br/><?php esc_html_e( 'Consent banner script tag', 'cookiebot' ); ?>
821
+ </th>
822
+ <td>
823
+ <?php
824
+ $cv = get_option( 'cookiebot-script-tag-uc-attribute', 'async' );
825
+ $disabled = false;
826
+ if ( $is_ms && $network_scrip_tag_uc_attr !== 'custom' ) {
827
+ $disabled = true;
828
+ $cv = $network_scrip_tag_uc_attr;
829
+ }
830
+ ?>
831
+ <label>
832
+ <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
833
+ value="" <?php checked( '', $cv, true ); ?> />
834
+ <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
835
+ </label>
836
+ &nbsp; &nbsp;
837
+ <label>
838
+ <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
839
+ value="async" <?php checked( 'async', $cv, true ); ?> />
840
+ async
841
+ </label>
842
+ &nbsp; &nbsp;
843
+ <label>
844
+ <input type="radio" name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
845
+ value="defer" <?php checked( 'defer', $cv, true ); ?> />
846
+ defer
847
+ </label>
848
+ <p class="description">
849
+ <?php
850
+ if ( $disabled ) {
851
+ echo '<b>' . esc_html__(
852
+ 'Network setting applied. Please contact website administrator to change this setting.',
853
+ 'cookiebot'
854
+ ) . '</b><br />';
855
+ }
856
+ ?>
857
+ <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
858
+ </p>
859
+ </td>
860
+ </tr>
861
  <tr valign="top">
862
+ <th scope="row">
863
+ <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
864
+ <br/><?php esc_html_e( 'Cookie declaration script tag', 'cookiebot' ); ?>
865
+ </th>
866
  <td>
867
+ <?php
868
+ $cv = get_option( 'cookiebot-script-tag-cd-attribute', 'async' );
869
+ $disabled = false;
870
+ if ( $is_ms && $network_scrip_tag_cd_attr !== 'custom' ) {
871
+ $disabled = true;
872
+ $cv = $network_scrip_tag_cd_attr;
873
+ }
874
+ ?>
875
+ <label>
876
+ <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
877
+ value="" <?php checked( '', $cv, true ); ?> />
878
+ <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
879
+ </label>
880
+ &nbsp; &nbsp;
881
+ <label>
882
+ <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
883
+ value="async" <?php checked( 'async', $cv, true ); ?> />
884
+ async
885
+ </label>
886
+ &nbsp; &nbsp;
887
+ <label>
888
+ <input type="radio" name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
889
+ value="defer" <?php checked( 'defer', $cv, true ); ?> />
890
+ defer
891
+ </label>
892
  <p class="description">
893
+ <?php
894
+ if ( $disabled ) {
895
+ echo '<b>' . esc_html__(
896
+ 'Network setting applied. Please contact website administrator to change this setting.',
897
+ 'cookiebot'
898
+ ) . '</b><br />';
899
+ }
900
+ ?>
901
+ <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
902
  </p>
903
  </td>
904
  </tr>
905
+ <?php
906
+ if ( ! is_multisite() ) {
907
+ ?>
908
+ <tr valign="top">
909
+ <th scope="row"><?php esc_html_e( 'Auto-update Cookiebot', 'cookiebot' ); ?></th>
910
+ <td>
911
+ <input type="checkbox" name="cookiebot-autoupdate" value="1"
912
+ <?php
913
+ checked(
914
+ 1,
915
+ get_option( 'cookiebot-autoupdate', false ),
916
+ true
917
+ );
918
+ ?>
919
+ />
920
+ <p class="description">
921
+ <?php esc_html_e( 'Automatic update your Cookiebot plugin when new releases becomes available.', 'cookiebot' ); ?>
922
+ </p>
923
+ </td>
924
+ </tr>
925
  <?php
926
  }
927
  ?>
928
+ <tr valign="top" id="cookiebot-setting-hide-popup">
929
+ <th scope="row"><?php esc_html_e( 'Hide Cookie Popup', 'cookiebot' ); ?></th>
930
+ <td>
 
 
 
 
 
 
 
 
 
 
 
 
931
  <?php
932
+ $disabled = false;
933
+ if ( $is_ms && get_site_option( 'cookiebot-nooutput', false ) ) {
934
+ $disabled = true;
935
+ echo '<input type="checkbox" checked disabled />';
936
+ } else {
937
+ ?>
938
+ <input type="checkbox" name="cookiebot-nooutput" value="1"
939
+ <?php
940
+ checked(
941
+ 1,
942
+ get_option( 'cookiebot-nooutput', false ),
943
+ true
944
+ );
945
+ ?>
946
+ />
947
+ <?php
948
+ }
 
 
 
949
  ?>
950
+ <p class="description">
951
+ <?php
952
+ if ( $disabled ) {
953
+ echo '<b>' . esc_html__(
954
+ 'Network setting applied. Please contact website administrator to change this setting.',
955
+ 'cookiebot'
956
+ ) . '</b><br />';
957
+ }
958
+ ?>
959
+ <b>
960
+ <?php
961
+ esc_html_e(
962
+ 'This checkbox will remove the cookie consent banner from your website. The <i>[cookie_declaration]</i> shortcode will still be available.',
963
+ 'cookiebot'
964
+ );
965
+ ?>
966
+ </b><br/>
967
+ <?php
968
+ esc_html_e(
969
+ 'If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager.',
970
+ 'cookiebot'
971
+ );
972
+ ?>
973
+ <br/>
974
+ <a href="https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment" target="_blank">
975
+ <?php esc_html_e( 'See a detailed guide here', 'cookiebot' ); ?>
976
+ </a>
977
+ </p>
978
+ </td>
979
+ </tr>
980
+ <tr valign="top">
981
+ <th scope="row"><?php esc_html_e( 'Disable Cookiebot in WP Admin', 'cookiebot' ); ?></th>
982
+ <td>
983
  <?php
984
+ $disabled = false;
985
+ if ( $is_ms && get_site_option( 'cookiebot-nooutput-admin', false ) ) {
986
+ echo '<input type="checkbox" checked disabled />';
987
+ $disabled = true;
988
+ } else {
989
+ ?>
990
+ <input type="checkbox" name="cookiebot-nooutput-admin" value="1"
991
+ <?php
992
+ checked(
993
+ 1,
994
+ get_option( 'cookiebot-nooutput-admin', false ),
995
+ true
996
+ );
997
+ ?>
998
+ />
999
+ <?php
1000
+ }
1001
  ?>
1002
+ <p class="description">
1003
+ <?php
1004
+ if ( $disabled ) {
1005
+ echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.' ) . '</b><br />';
1006
+ }
1007
+ ?>
1008
+ <b><?php esc_html_e( 'This checkbox will disable Cookiebot in the WordPress Admin area.', 'cookiebot' ); ?></b>
1009
+ </p>
1010
+ </td>
1011
+ </tr>
1012
+ <tr valign="top">
1013
+ <th scope="row"><?php esc_html_e( 'Enable Cookiebot on front end while logged in', 'cookiebot' ); ?></th>
1014
+ <td>
1015
  <?php
1016
+ $disabled = false;
1017
+ if ( $is_ms && get_site_option( 'cookiebot-output-logged-in', false ) ) {
1018
+ echo '<input type="checkbox" checked disabled />';
1019
+ $disabled = true;
1020
+ } else {
1021
+ ?>
1022
+ <input type="checkbox" name="cookiebot-output-logged-in" value="1"
1023
+ <?php
1024
+ checked(
1025
+ 1,
1026
+ get_option( 'cookiebot-output-logged-in', false ),
1027
+ true
1028
+ );
1029
+ ?>
1030
+ />
1031
+ <?php
1032
+ }
1033
  ?>
1034
+ <p class="description">
1035
+ <?php
1036
+ if ( $disabled ) {
1037
+ echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.' ) . '</b><br />';
1038
+ }
1039
+ ?>
1040
+ <b><?php esc_html_e( 'This checkbox will enable Cookiebot on front end while you\'re logged in', 'cookiebot' ); ?></b>
1041
+ </p>
1042
+ </td>
1043
+ </tr>
1044
+ </table>
1045
+ </div>
1046
  <?php if ( $this->is_wp_consent_api_active() ) { ?>
1047
+ <h3 id="consent_level_api_settings" class="cookiebot_fieldset_header">
 
 
 
1048
  <?php
1049
+ esc_html_e(
1050
+ 'Consent Level API Settings',
1051
+ 'cookiebot'
1052
+ );
1053
+ ?>
1054
+ </h3>
1055
+ <div id="consent_level_api_settings" style="display:none;">
1056
+ <p>
1057
+ <?php
1058
+ esc_html_e(
1059
+ 'WP Consent Level API and Cookiebot categorise cookies a bit different. The default settings should fit mosts needs - but if you need to change the mapping you are able to do it below.',
1060
+ 'cookiebot'
1061
+ );
1062
+ ?>
1063
+ </p>
1064
+
1065
+ <?php
1066
+ $mDefault = $this->get_default_wp_consent_api_mapping();
1067
+
1068
+ $m = $this->get_wp_consent_api_mapping();
1069
+
1070
+ $consentTypes = array( 'preferences', 'statistics', 'marketing' );
1071
+ $states = array_reduce(
1072
+ $consentTypes,
1073
+ function ( $t, $v ) {
1074
+ $newt = array();
1075
+ if ( empty( $t ) ) {
1076
+ $newt = array(
1077
+ array( $v => true ),
1078
+ array( $v => false ),
1079
+ );
1080
+ } else {
1081
+ foreach ( $t as $item ) {
1082
  $newt[] = array_merge( $item, array( $v => true ) );
1083
  $newt[] = array_merge( $item, array( $v => false ) );
1084
+ }
1085
  }
 
1086
 
1087
+ return $newt;
1088
+ },
1089
+ array()
1090
+ );
1091
 
1092
+ ?>
1093
 
1094
 
1095
+ <table class="widefat striped consent_mapping_table">
1096
+ <thead>
1097
  <tr>
1098
  <th><?php esc_html_e( 'Cookiebot categories', 'cookiebot' ); ?></th>
1099
  <th class="consent_mapping"><?php esc_html_e( 'WP Consent Level categories', 'cookiebot' ); ?></th>
1100
  </tr>
1101
+ </thead>
1102
+ <?php
1103
+ foreach ( $states as $state ) {
1104
+
1105
+ $key = array();
1106
+ $key[] = 'n=1';
1107
+ $key[] = 'p=' . ( $state['preferences'] ? '1' : '0' );
1108
+ $key[] = 's=' . ( $state['statistics'] ? '1' : '0' );
1109
+ $key[] = 'm=' . ( $state['marketing'] ? '1' : '0' );
1110
+ $key = implode( ';', $key );
1111
+ ?>
1112
+ <tr valign="top">
1113
+ <td>
1114
+ <div class="cb_consent">
1115
+ <span class="forceconsent">
1116
  <?php esc_html_e( 'Necessary', 'cookiebot' ); ?>
1117
+ </span>
1118
+ <span class="<?php echo( $state['preferences'] ? 'consent' : 'noconsent' ); ?>">
1119
  <?php esc_html_e( 'Preferences', 'cookiebot' ); ?>
1120
+ </span>
1121
+ <span class="<?php echo( $state['statistics'] ? 'consent' : 'noconsent' ); ?>">
1122
  <?php esc_html_e( 'Statistics', 'cookiebot' ); ?>
1123
+ </span>
1124
+ <span class="<?php echo( $state['marketing'] ? 'consent' : 'noconsent' ); ?>">
1125
  <?php esc_html_e( 'Marketing', 'cookiebot' ); ?>
1126
+ </span>
1127
+ </div>
1128
+ </td>
1129
+ <td>
1130
+ <div class="consent_mapping">
1131
+ <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][functional]"
1132
+ data-default-value="1" value="1" checked disabled
1133
+ > <?php esc_html_e( 'Functional', 'cookiebot' ); ?> </label>
1134
+ <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][preferences]"
1135
+ data-default-value="<?php echo esc_attr( $mDefault[ $key ]['preferences'] ); ?>" value="1"
1136
+ <?php
1137
+ if ( $m[ $key ]['preferences'] ) {
1138
+ echo 'checked';
1139
+ }
1140
+ ?>
1141
+ > <?php esc_html_e( 'Preferences', 'cookiebot' ); ?> </label>
1142
+ <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][statistics]"
1143
+ data-default-value="<?php echo esc_attr( $mDefault[ $key ]['statistics'] ); ?>" value="1"
1144
+ <?php
1145
+ if ( $m[ $key ]['statistics'] ) {
1146
+ echo 'checked';
1147
+ }
1148
+ ?>
1149
+ > <?php esc_html_e( 'Statistics', 'cookiebot' ); ?> </label>
1150
+ <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][statistics-anonymous]"
1151
+ data-default-value="<?php echo esc_attr( $mDefault[ $key ]['statistics-anonymous'] ); ?>" value="1"
1152
+ <?php
1153
+ if ( $m[ $key ]['statistics-anonymous'] ) {
1154
+ echo 'checked';
1155
+ }
1156
+ ?>
1157
+ > <?php esc_html_e( 'Statistics Anonymous', 'cookiebot' ); ?></label>
1158
+ <label><input type="checkbox" name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][marketing]"
1159
+ data-default-value="<?php echo esc_attr( $mDefault[ $key ]['marketing'] ); ?>" value="1"
1160
+ <?php
1161
+ if ( $m[ $key ]['marketing'] ) {
1162
+ echo 'checked';
1163
+ }
1164
+ ?>
1165
+ > <?php esc_html_e( 'Marketing', 'cookiebot' ); ?></label>
1166
+ </div>
1167
+ </td>
1168
+ </tr>
1169
+ <?php
1170
+ }
1171
+ ?>
1172
+ <tfoot>
1173
  <tr>
1174
+ <td colspan="2" style="text-align:right;">
1175
+ <button class="button" onclick="return resetConsentMapping();">
1176
+ <?php
1177
+ esc_html_e(
1178
+ 'Reset to default mapping',
1179
+ 'cookiebot'
1180
+ );
1181
+ ?>
1182
+ </button>
1183
+ </td>
1184
  </tr>
1185
+ </tfoot>
1186
+ </table>
1187
+ <script>
1188
+ function resetConsentMapping() {
1189
+ if ( confirm( 'Are you sure you want to reset to default consent mapping?' ) ) {
1190
+ jQuery( '.consent_mapping_table input[type=checkbox]' ).each( function () {
1191
+ if ( !this.disabled ) {
1192
+ this.checked = ( jQuery( this ).data( 'default-value' ) == '1' ) ? true : false;
1193
+ }
1194
+ } );
1195
+ }
1196
+ return false;
1197
  }
1198
+ </script>
1199
+ </div>
1200
+ <?php } ?>
 
 
1201
  <?php submit_button(); ?>
1202
+ </form>
1203
+ </div>
1204
  <?php
1205
  }
1206
 
1210
  * @version 2.2.0
1211
  * @since 2.2.0
1212
  */
1213
+ public function network_settings_page() {
1214
  ?>
1215
+ <div class="wrap">
1216
+ <h1><?php esc_html_e( 'Cookiebot Network Settings', 'cookiebot' ); ?></h1>
1217
+ <a href="https://www.cookiebot.com">
1218
+ <img src="<?php echo esc_url( plugins_url( 'cookiebot-logo.png', __FILE__ ) ); ?>" style="float:right;margin-left:1em;">
1219
+ </a>
1220
+ <p>
1221
+ <?php
1222
+ $cookiebot_gdpr_url = 'https://www.cookiebot.com/goto/gdpr';
1223
+ printf(
1224
+ esc_html__(
1225
+ 'Cookiebot enables your website to comply with current legislation in the EU on the use of cookies for user tracking and profiling. The EU ePrivacy Directive requires prior, informed consent of your site users, while the %1$s %2$s.',
1226
+ 'cookiebot'
1227
+ ),
1228
+ sprintf(
1229
+ '<a href="%s" target="_blank">%s</a>',
1230
+ esc_url( $cookiebot_gdpr_url ),
1231
+ esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' )
1232
+ ),
1233
+ esc_html__(
1234
+ ' requires you to document each consent. At the same time you must be able to account for what user data you share with embedded third-party services on your website and where in the world the user data is sent.',
1235
+ 'cookiebot'
1236
+ )
1237
+ );
1238
+ ?>
1239
+ </p>
1240
+ <p>
1241
+ <b><big style="color:red;">
1242
+ <?php
1243
+ esc_html_e(
1244
+ 'The settings below is network wide settings. See notes below each field.',
1245
+ 'cookiebot'
1246
+ );
1247
+ ?>
1248
+ </big></b>
1249
+ </p>
1250
+ <form method="post" action="edit.php?action=cookiebot_network_settings">
1251
  <?php wp_nonce_field( 'cookiebot-network-settings' ); ?>
1252
+ <table class="form-table">
1253
+ <tr valign="top">
1254
+ <th scope="row"><?php esc_html_e( 'Network Cookiebot ID', 'cookiebot' ); ?></th>
1255
+ <td>
1256
+ <input type="text" name="cookiebot-cbid" value="<?php echo esc_attr( get_site_option( 'cookiebot-cbid', '' ) ); ?>"
1257
+ style="width:300px"/>
1258
+ <p class="description">
1259
+ <b>
1260
+ <?php
1261
+ esc_html_e(
1262
+ 'If added this will be the default Cookiebot ID for all subsites. Subsites are able to override the Cookiebot ID.',
1263
+ 'cookiebot'
1264
+ );
1265
+ ?>
1266
+ </b>
1267
+ <br/>
1268
  <?php esc_html_e( 'Need an ID?', 'cookiebot' ); ?>
1269
+ <a href="https://www.cookiebot.com/goto/signup" target="_blank">
1270
+ <?php
1271
+ esc_html_e(
1272
+ 'Sign up for free on cookiebot.com',
1273
+ 'cookiebot'
1274
+ );
1275
+ ?>
1276
+ </a>
1277
+ </p>
1278
+ </td>
1279
+ </tr>
1280
+ <tr valign="top">
1281
+ <th scope="row">
1282
  <?php esc_html_e( 'Cookie-blocking mode', 'cookiebot' ); ?>
1283
+ </th>
1284
+ <td>
1285
+ <?php
1286
+ $cbm = get_site_option( 'cookiebot-cookie-blocking-mode', 'manual' );
1287
+ ?>
1288
+ <label>
1289
+ <input type="radio" name="cookiebot-cookie-blocking-mode" value="auto" <?php checked( 'auto', $cbm, true ); ?> />
1290
+ <?php esc_html_e( 'Automatic', 'cookiebot' ); ?>
1291
+ </label>
1292
+ &nbsp; &nbsp;
1293
+ <label>
1294
+ <input type="radio" name="cookiebot-cookie-blocking-mode" value="manual" <?php checked( 'manual', $cbm, true ); ?> />
1295
+ <?php esc_html_e( 'Manual', 'cookiebot' ); ?>
1296
+ </label>
1297
+ <p class="description">
1298
+ <?php esc_html_e( 'Should Cookiebot automatic block cookies by tagging known tags.', 'cookiebot' ); ?>
1299
+ </p>
1300
+ </td>
1301
+ </tr>
1302
+ <script>
1303
+ jQuery( document ).ready( function ( $ ) {
1304
+ var cookieBlockingMode = '<?php echo esc_js( $cbm ); ?>';
1305
+ $( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function () {
1306
+ if ( this.value == 'auto' && cookieBlockingMode != this.value ) {
1307
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
1308
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
1309
+ }
1310
+ if ( this.value == 'manual' && cookieBlockingMode != this.value ) {
1311
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 );
1312
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false );
1313
+ }
1314
+ cookieBlockingMode = this.value;
1315
+ } );
1316
+ if ( cookieBlockingMode == 'auto' ) {
1317
+ $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
1318
+ $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true );
1319
+ }
1320
+ } );
1321
+ </script>
1322
+ <tr valign="top" id="cookiebot-setting-async">
1323
+ <th scope="row">
1324
+ <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
1325
+ <br/><?php esc_html_e( 'Consent banner script tag', 'cookiebot' ); ?>
1326
+ </th>
1327
+ <td>
1328
+ <?php
1329
+ $cv = get_site_option( 'cookiebot-script-tag-uc-attribute', 'custom' );
1330
+ ?>
1331
+ <label>
1332
+ <input type="radio" name="cookiebot-script-tag-uc-attribute" value="" <?php checked( '', $cv, true ); ?> />
1333
+ <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
1334
+ </label>
1335
+ &nbsp; &nbsp;
1336
+ <label>
1337
+ <input type="radio" name="cookiebot-script-tag-uc-attribute" value="async" <?php checked( 'async', $cv, true ); ?> />
1338
+ async
1339
+ </label>
1340
+ &nbsp; &nbsp;
1341
+ <label>
1342
+ <input type="radio" name="cookiebot-script-tag-uc-attribute" value="defer" <?php checked( 'defer', $cv, true ); ?> />
1343
+ defer
1344
+ </label>
1345
+ &nbsp; &nbsp;
1346
+ <label>
1347
+ <input type="radio" name="cookiebot-script-tag-uc-attribute" value="custom" <?php checked( 'custom', $cv, true ); ?> />
1348
+ <i><?php esc_html_e( 'Choose per subsite', 'cookiebot' ); ?></i>
1349
+ </label>
1350
+ <p class="description">
1351
+ <b>
1352
+ <?php
1353
+ esc_html_e(
1354
+ 'Setting will apply for all subsites. Subsites will not be able to override.',
1355
+ 'cookiebot'
1356
+ );
1357
+ ?>
1358
+ </b><br/>
1359
+ <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: Choose per subsite', 'cookiebot' ); ?>
1360
+ </p>
1361
+ </td>
1362
+ </tr>
1363
+ <tr valign="top">
1364
+ <th scope="row">
1365
+ <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
1366
+ <br/><?php esc_html_e( 'Cookie declaration script tag', 'cookiebot' ); ?>
1367
+ </th>
1368
+ <td>
1369
+ <?php
1370
+ $cv = get_site_option( 'cookiebot-script-tag-cd-attribute', 'custom' );
1371
+ ?>
1372
+ <label>
1373
+ <input type="radio" name="cookiebot-script-tag-cd-attribute" value="" <?php checked( '', $cv, true ); ?> />
1374
+ <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
1375
+ </label>
1376
+ &nbsp; &nbsp;
1377
+ <label>
1378
+ <input type="radio" name="cookiebot-script-tag-cd-attribute" value="async" <?php checked( 'async', $cv, true ); ?> />
1379
+ async
1380
+ </label>
1381
+ &nbsp; &nbsp;
1382
+ <label>
1383
+ <input type="radio" name="cookiebot-script-tag-cd-attribute" value="defer" <?php checked( 'defer', $cv, true ); ?> />
1384
+ defer
1385
+ </label>
1386
+ &nbsp; &nbsp;
1387
+ <label>
1388
+ <input type="radio" name="cookiebot-script-tag-cd-attribute" value="custom" <?php checked( 'custom', $cv, true ); ?> />
1389
+ <i><?php esc_html_e( 'Choose per subsite', 'cookiebot' ); ?></i>
1390
+ </label>
1391
+ <p class="description">
1392
+ <b>
1393
+ <?php
1394
+ esc_html_e(
1395
+ 'Setting will apply for all subsites. Subsites will not be able to override.',
1396
+ 'cookiebot'
1397
+ );
1398
+ ?>
1399
+ </b><br/>
1400
+ <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: Choose per subsite', 'cookiebot' ); ?>
1401
+ </p>
1402
+ </td>
1403
+ </tr>
1404
+ <tr valign="top">
1405
+ <th scope="row"><?php esc_html_e( 'Auto-update Cookiebot', 'cookiebot' ); ?></th>
1406
+ <td>
1407
+ <input type="checkbox" name="cookiebot-autoupdate" value="1"
1408
  <?php
1409
+ checked(
1410
+ 1,
1411
+ get_site_option( 'cookiebot-autoupdate', false ),
1412
+ true
1413
+ );
1414
  ?>
1415
+ />
1416
+ <p class="description">
1417
+ <?php esc_html_e( 'Automatic update your Cookiebot plugin when new releases becomes available.', 'cookiebot' ); ?>
1418
+ </p>
1419
+ </td>
1420
+ </tr>
1421
+ <tr valign="top" id="cookiebot-setting-hide-popup">
1422
+ <th scope="row"><?php esc_html_e( 'Hide Cookie Popup', 'cookiebot' ); ?></th>
1423
+ <td>
1424
+ <input type="checkbox" name="cookiebot-nooutput" value="1"
1425
+ <?php
1426
+ checked(
1427
+ 1,
1428
+ get_site_option( 'cookiebot-nooutput', false ),
1429
+ true
1430
+ );
1431
+ ?>
1432
+ />
1433
+ <p class="description">
1434
+ <b>
1435
+ <?php
1436
+ esc_html_e(
1437
+ 'Remove the cookie consent banner from all subsites. This cannot be changed by subsites. The <i>[cookie_declaration]</i> shortcode will still be available.',
1438
+ 'cookiebot'
1439
+ );
1440
+ ?>
1441
+ </b><br/>
1442
+ <?php
1443
+ esc_html_e(
1444
+ 'If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager.',
1445
+ 'cookiebot'
1446
+ );
1447
+ ?>
1448
+ <br/>
1449
+ <?php
1450
+ esc_html_e(
1451
+ '<a href="https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment" target="_blank">See a detailed guide here</a>',
1452
+ 'cookiebot'
1453
+ );
1454
+ ?>
1455
+ </p>
1456
+ </td>
1457
+ </tr>
1458
+ <tr valign="top">
1459
+ <th scope="row"><?php esc_html_e( 'Hide Cookie Popup in WP Admin', 'cookiebot' ); ?></th>
1460
+ <td>
1461
+ <input type="checkbox" name="cookiebot-nooutput-admin" value="1"
1462
+ <?php
1463
+ checked(
1464
+ 1,
1465
+ get_site_option( 'cookiebot-nooutput-admin', false ),
1466
+ true
1467
+ );
1468
+ ?>
1469
+ />
1470
+ <p class="description">
1471
+ <b>
1472
+ <?php
1473
+ esc_html_e(
1474
+ 'Remove the cookie consent banner the WordPress Admin area for all subsites. This cannot be changed by subsites.',
1475
+ 'cookiebot'
1476
+ );
1477
+ ?>
1478
+ </b>
1479
+ </p>
1480
+ </td>
1481
+ </tr>
1482
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1483
  <?php submit_button(); ?>
1484
+ </form>
1485
+ </div>
1486
  <?php
1487
  }
1488
 
1493
  * @version 2.2.0
1494
  * @since 2.2.0
1495
  */
1496
+ public function network_settings_save() {
1497
  check_admin_referer( 'cookiebot-network-settings' );
1498
 
1499
  update_site_option( 'cookiebot-cbid', $_POST['cookiebot-cbid'] );
1522
  * @version 2.2.0
1523
  * @since 2.0.0
1524
  */
1525
+ public function support_page() {
1526
  ?>
1527
+ <div class="wrap">
1528
+ <h1><?php esc_html_e( 'Support', 'cookiebot' ); ?></h1>
1529
+ <h2><?php esc_html_e( 'How to find my Cookiebot ID', 'cookiebot' ); ?></h2>
1530
+ <div>
1531
  <ol>
1532
+ <li>
1533
+ <?php
1534
+ echo sprintf(
1535
+ // translators: the first placeholder string will be replaced with a html anchor open tag and the second placeholder string will be replaced by the html anchor closing tag
1536
+ esc_html__( 'Log in to your %1$sCookiebot account%2$s.', 'cookiebot' ),
1537
+ '<a href="https://www.cookiebot.com/goto/account" target="_blank">',
1538
+ '</a>'
1539
+ );
1540
+ ?>
1541
+ </li>
1542
+ <li>
1543
+ <?php
1544
+ echo sprintf(
1545
+ // translators: the placeholder strings denote the positions of <b>, </b>, <b> and </b> HTML tags
1546
+ esc_html__( 'Go to %1$sManage%2$s > %3$sSettings%4$s and add setup your Cookiebot', 'cookiebot' ),
1547
+ '<b>',
1548
+ '</b>',
1549
+ '<b>',
1550
+ '</b>'
1551
+ );
1552
+ ?>
1553
+ </li>
1554
+ <li>
1555
+ <?php
1556
+ echo sprintf(
1557
+ // translators: the placeholder strings denote the positions of <b> and </b> HTML tags
1558
+ esc_html__( 'Go to the %1$s"Your scripts"%2$s tab', 'cookiebot' ),
1559
+ '<b>',
1560
+ '</b>'
1561
+ );
1562
+ ?>
1563
+ </li>
1564
  <li><?php esc_html_e( 'Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-ef1234567890', 'cookiebot' ); ?></li>
1565
+ <li>
1566
+ <?php
1567
+ echo sprintf(
1568
+ // translators: the placeholder strings denote the positions of <b> and </b> HTML tags
1569
+ esc_html__( 'Add %1$s[cookie_declaration]%2$s shortcode to a page to show the declation', 'cookiebot' ),
1570
+ '<b>',
1571
+ '</b>'
1572
+ );
1573
+ ?>
1574
+ </li>
1575
  <li><?php esc_html_e( 'Remember to change your scripts as descripted below', 'cookiebot' ); ?></li>
1576
  </ol>
1577
+ </div>
1578
+ <h2><?php esc_html_e( 'Add the Cookie Declaration to your website', 'cookiebot' ); ?></h2>
1579
+ <p>
1580
+ <?php
1581
+ echo sprintf(
1582
+ // translators: the placeholder strings denote the positions of <b> and </b> HTML tags
1583
+ esc_html__( 'Use the shortcode %1$s[cookie_declaration]%2$s to add the cookie declaration a page or post. The cookie declaration will always show the latest version from Cookiebot.', 'cookiebot' ),
1584
+ '<b>',
1585
+ '</b>'
1586
+ );
1587
+ ?>
1588
+ <br/>
1589
+ <?php
1590
+ echo sprintf(
1591
+ // translators: the placeholder strings denote the positions of <i>, </i>, <b> and </b> HTML tags
1592
+ esc_html__( 'If you need to force language of the cookie declaration, you can add the %1$slang%2$s attribute. Eg. %3$s[cookie_declaration lang="de"]%4$s.', 'cookiebot' ),
1593
+ '<i>',
1594
+ '</i>',
1595
+ '<b>',
1596
+ '</b>'
1597
+ );
1598
+ ?>
1599
+ </p>
1600
+ <p>
1601
+ <a href="https://www.youtube.com/watch?v=OCXz2bt4H_w" target="_blank" class="button">
1602
+ <?php
1603
+ esc_html_e(
1604
+ 'Watch video demonstration',
1605
+ 'cookiebot'
1606
+ );
1607
+ ?>
1608
+ </a>
1609
+ </p>
1610
+ <h2><?php esc_html_e( 'Update your script tags', 'cookiebot' ); ?></h2>
1611
+ <p>
1612
+ <?php
1613
+ esc_html_e(
1614
+ 'To enable prior consent, apply the attribute "data-cookieconsent" to cookie-setting script tags on your website. Set the comma-separated value to one or more of the cookie categories "preferences", "statistics" and "marketing" in accordance with the types of cookies being set by each script. Finally change the attribute "type" from "text/javascript" to "text/plain". Example on modifying an existing Google Analytics Universal script tag.',
1615
+ 'cookiebot'
1616
+ );
1617
+ ?>
1618
+ </p>
1619
+ <code>
1620
+ <?php
1621
+ $output = <<<HTML
1622
+ <script type="text/plain" data-cookieconsent="statistics">
1623
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
1624
+ ga('create', 'UA-00000000-0', 'auto');
1625
+ ga('send', 'pageview');
1626
+ </script>
1627
+ HTML;
1628
+ echo nl2br( esc_html( $output ) );
1629
+ ?>
1630
+ </code>
1631
+ <p>
1632
+ <a href="https://www.youtube.com/watch?v=MeHycvV2QCQ" target="_blank" class="button">
1633
+ <?php
1634
+ esc_html_e(
1635
+ 'Watch video demonstration',
1636
+ 'cookiebot'
1637
+ );
1638
+ ?>
1639
+ </a>
1640
+ </p>
1641
+
1642
+ <h2><?php esc_html_e( 'Helper function to update your scripts', 'cookiebot' ); ?></h2>
1643
+ <p>
1644
+ <?php
1645
+ esc_html_e(
1646
+ 'You are able to update your scripts yourself. However, Cookiebot also offers a small helper function that makes the work easier.',
1647
+ 'cookiebot'
1648
+ );
1649
+ ?>
1650
+ <br/>
1651
+ <?php esc_html_e( 'Update your script tags this way:', 'cookiebot' ); ?>
1652
+ </p>
1653
  <?php
1654
  printf(
1655
  esc_html__( '%1$s to %2$s', 'cookiebot' ),
1656
+ '<code>' . esc_html( '<script type="text/javascript">' ) . '</code>',
1657
+ '<code>' . esc_html( '<script<?php echo cookiebot_assist(\'marketing\') ?>>' ) . '</code>'
1658
  );
1659
  ?>
1660
+ </div>
1661
  <?php
1662
  }
1663
 
1664
  /**
1665
+ * Cookiebot_WP Google Tag Manager page
1666
+ *
1667
+ * @version 3.8.1
1668
+ * @since 3.8.1
1669
+ */
1670
 
1671
+ public function GTM_page() {
1672
  ?>
1673
+ <div class="wrap">
1674
+ <h1><?php esc_html_e( 'Google Tag Manager', 'cookiebot' ); ?></h1>
1675
+
1676
+ <form method="post" action="options.php"
1677
+ style="display: grid; grid-template-columns: 35% 65%; grid-row-gap: 20px; width: 700px; align-items: center;">
1678
+ <?php settings_fields( 'cookiebot-gtm' ); ?>
1679
+ <?php do_settings_sections( 'cookiebot-gtm' ); ?>
1680
+
1681
+ <p><?php esc_html_e( 'Enable GTM', 'cookiebot' ); ?></p>
1682
+ <div class="GTM_check">
1683
+ <input type="checkbox" name="cookiebot-gtm" id="cookiebot-gtm" value="1" <?php checked( 1, get_option( 'cookiebot-gtm' ), true ); ?>
1684
+ style="float: left; margin: 2px 4px 0 0">
1685
+ <p style="margin: 0; font-style: italic;">
1686
+ <?php
1687
+ esc_html_e(
1688
+ 'For more details about Cookiebot and Google Tag Manager click',
1689
+ 'cookiebot'
1690
+ );
1691
+ ?>
1692
+ <a target="_blank" href="https://www.cookiebot.com/en/google-tag-manager-and-gdpr-compliance-with-cookiebot/"
1693
+ style="margin: 0; font-style: italic;">&nbsp;<?php esc_html_e( 'here', 'cookiebot' ); ?></a></p>
1694
+ </div>
1695
 
1696
+ <p><?php esc_html_e( 'GTM ID', 'cookiebot' ); ?></p>
1697
+ <input type="text" name="cookiebot-gtm-id" id="cookiebot-gtm-id" value="<?php echo esc_attr( get_option( 'cookiebot-gtm-id' ) ); ?>"
1698
+ style="height: 30px;">
1699
 
1700
+ <p><?php esc_html_e( 'DataLayer name', 'cookiebot' ); ?></p>
1701
+ <div>
1702
+ <input type="text" name="cookiebot-data-layer" id="data_layer" placeholder="dataLayer"
1703
+ value="<?php echo esc_attr( get_option( 'cookiebot-data-layer' ) ); ?>" style="height: 30px;">
1704
+ <p style="margin: 0;"><?php esc_html_e( 'Optional, only change if necessary', 'cookiebot' ); ?></p>
1705
+ </div>
1706
 
1707
+ <p><?php esc_html_e( 'Google Consent Mode', 'cookiebot' ); ?></p>
1708
+ <div class="GTM_check">
1709
+ <input type="checkbox" name="cookiebot-gcm" id="gcm" value="1" <?php checked( 1, get_option( 'cookiebot-gcm' ), true ); ?>
1710
+ style="float: left; margin: 2px 4px 0 0">
1711
+ <p style="margin: 0; font-style: italic;">
1712
+ <?php
1713
+ esc_html_e(
1714
+ 'For more details about Cookiebot and Google Consent Mode click',
1715
+ 'cookiebot'
1716
+ );
1717
+ ?>
1718
+ <a target="_blank"
1719
+ href="https://support.cookiebot.com/hc/en-us/articles/360016047000-Cookiebot-and-Google-Consent-Mode"
1720
+ style="margin: 0; font-style: italic;">&nbsp;<?php esc_html_e( 'here', 'cookiebot' ); ?></a></p>
1721
+ </div>
1722
+ <input type="submit" value="Save" name="gtm_save"
1723
+ style="background-color: rgb(0, 124, 186); color: white; padding: 5px 10px; border: none; border-radius: 5px; justify-self: start;">
1724
+ </form>
1725
+ </div>
1726
  <?php
1727
  }
1728
 
1732
  * @version 2.0.0
1733
  * @since 2.0.0
1734
  */
1735
+ public function iab_page() {
1736
  ?>
1737
+ <div class="wrap">
1738
+ <h1><?php esc_html_e( 'IAB', 'cookiebot' ); ?></h1>
1739
+
1740
+ <p>
1741
+ <?php
1742
+ echo sprintf(
1743
+ esc_html__(
1744
+ 'For more details about Cookiebot\'s IAB integration, see %1$sarticle about cookiebot and the IAB consent framework%2$s',
1745
+ 'cookiebot'
1746
+ ),
1747
+ '<a href="https://support.cookiebot.com/hc/en-us/articles/360007652694-Cookiebot-and-the-IAB-Consent-Framework" target="_blank">',
1748
+ '</a>'
1749
+ );
1750
+ ?>
1751
+ </p>
1752
+
1753
+ <form method="post" action="options.php">
1754
+ <?php settings_fields( 'cookiebot-iab' ); ?>
1755
+ <?php do_settings_sections( 'cookiebot-iab' ); ?>
1756
+
1757
+ <label><?php esc_html_e( 'Enable IAB integration', 'cookiebot' ); ?></label>
1758
+ <input type="checkbox" name="cookiebot-iab" value="1" <?php checked( 1, get_option( 'cookiebot-iab' ), true ); ?>>
1759
+
1760
+ <?php submit_button(); ?>
1761
+ </form>
1762
+ </div>
1763
  <?php
1764
  }
1765
 
1769
  * @version 3.6.6
1770
  * @since 3.6.6
1771
  */
1772
+ public function legislations_page() {
1773
  ?>
1774
+ <div class="wrap">
1775
+ <h1><?php esc_html_e( 'Legislations', 'cookiebot' ); ?></h1>
1776
+
1777
+ <p>
1778
+ <?php
1779
+ echo sprintf(
1780
+ esc_html__(
1781
+ 'For more details about Cookiebot\'s CCPA Legislation integration, see %1$sarticle about cookiebot and the CCPA compliance%2$s',
1782
+ 'cookiebot'
1783
+ ),
1784
+ '<a href="https://support.cookiebot.com/hc/en-us/articles/360010932419-Use-multiple-banners-on-the-same-website-support-both-CCPA-GDPR-compliance-" target="_blank">',
1785
+ '</a>'
1786
+ );
1787
+ ?>
1788
+ </p>
1789
+
1790
+ <form method="post" action="options.php">
1791
+ <?php settings_fields( 'cookiebot-legislations' ); ?>
1792
+ <?php do_settings_sections( 'cookiebot-legislations' ); ?>
1793
+
1794
+
1795
+ <table class="form-table">
1796
+ <tbody>
1797
+ <tr valign="top">
1798
+ <th scope="row"><label><?php esc_html_e( 'Enable CCPA configuration for visitors from California', 'cookiebot' ); ?></label></th>
1799
+ <td>
1800
+ <input type="checkbox" name="cookiebot-ccpa" value="1" <?php checked( 1, get_option( 'cookiebot-ccpa' ), true ); ?>>
1801
+ </td>
1802
+ </tr>
1803
+ <tr>
1804
+ <th valign="top"><label><?php esc_html_e( 'Domain Group ID', 'cookiebot' ); ?></label></th>
1805
+ <td>
1806
+ <input type="text" style="width: 300px;" name="cookiebot-ccpa-domain-group-id"
1807
+ value="<?php echo esc_attr( get_option( 'cookiebot-ccpa-domain-group-id' ) ); ?>">
1808
+ </td>
1809
+ </tr>
1810
+ </tbody>
1811
+ </table>
1812
+
1813
+ <?php submit_button(); ?>
1814
+ </form>
1815
+ </div>
1816
  <?php
1817
  }
1818
 
1823
  * @since 3.6.0
1824
  */
1825
 
1826
+ public function debug_page() {
1827
  global $wpdb;
1828
 
1829
  include_once ABSPATH . 'wp-admin/includes/plugin.php';
1902
  $debugStr .= "\n##### Debug Information END #####";
1903
 
1904
  ?>
1905
+ <div class="wrap">
1906
+ <h1><?php esc_html_e( 'Debug information', 'cookiebot' ); ?></h1>
1907
+ <p>
1908
+ <?php
1909
+ esc_html_e(
1910
+ 'The information below is for debugging purpose. If you have any issues with your Cookiebot integration, the information below is usefull for a supporter to help you the best way.',
1911
+ 'cookiebot'
1912
+ );
1913
+ ?>
1914
+ </p>
1915
+ <p>
1916
+ <button class="button button-primary" onclick="copyDebugInfo();">
1917
+ <?php
1918
+ esc_html_e(
1919
+ 'Copy debug information to clipboard',
1920
+ 'cookiebot'
1921
+ );
1922
+ ?>
1923
+ </button>
1924
+ </p>
1925
+ <textarea
1926
+ cols="100"
1927
+ rows="40"
1928
+ style="width:800px;max-width:100%;"
1929
+ id="cookiebot-debug-info"
1930
+ readonly><?php echo esc_html( $debugStr ); ?></textarea>
1931
+ <script>
1932
+ function copyDebugInfo() {
1933
+ var t = document.getElementById( "cookiebot-debug-info" );
1934
+ t.select();
1935
+ t.setSelectionRange( 0, 99999 );
1936
+ document.execCommand( "copy" );
1937
+ }
1938
+ </script>
1939
+ </div>
1940
  <?php
1941
  }
1942
 
1946
  * @version 3.9.0
1947
  * @since 1.0.0
1948
  */
1949
+ public function add_js( $print_tag = true ) {
1950
  $cbid = $this->get_cbid();
1951
  if ( ! empty( $cbid ) && ! defined( 'COOKIEBOT_DISABLE_ON_PAGE' ) ) {
1952
  if ( is_multisite() && get_site_option( 'cookiebot-nooutput', false ) ) {
1957
  return; //Do not show JS - output disabled
1958
  }
1959
 
1960
+ if ( $this->get_cookie_blocking_mode() == 'auto' && $this->can_current_user_edit_theme() && $print_tag !== false && get_site_option( 'cookiebot-output-logged-in' ) == false ) {
1961
  return;
1962
  }
1963
 
1964
  $lang = $this->get_language();
 
 
 
1965
 
1966
  if ( ! is_multisite() || get_site_option( 'cookiebot-script-tag-uc-attribute', 'custom' ) == 'custom' ) {
1967
  $tagAttr = get_option( 'cookiebot-script-tag-uc-attribute', 'async' );
1969
  $tagAttr = get_site_option( 'cookiebot-script-tag-uc-attribute' );
1970
  }
1971
 
1972
+ if ( $print_tag === false ) {
1973
+ ob_start();
 
 
 
 
 
 
 
 
 
 
1974
  }
1975
+ ?>
1976
+ <script type="text/javascript"
1977
+ id="Cookiebot"
1978
+ src="https://consent.cookiebot.com/uc.js"
1979
+ data-cbid="<?php echo esc_attr( $cbid ); ?>"
1980
+ <?php if ( (bool) get_option( 'cookiebot-iab' ) !== false ) : ?>
1981
+ data-framework="IAB"
1982
+ <?php endif; ?>
1983
+ <?php if ( (bool) get_option( 'cookiebot-ccpa' ) !== false ) : ?>
1984
+ data-georegions="{'region':'US-06','cbid':'<?php echo esc_attr( get_option( 'cookiebot-ccpa-domain-group-id' ) ); ?>'}"
1985
+ <?php endif; ?>
1986
+ <?php if ( (bool) get_option( 'cookiebot-gtm' ) !== false ) : ?>
1987
+ <?php if ( empty( get_option( 'cookiebot-data-layer' ) ) ) : ?>
1988
+ data-layer-name="dataLayer"
1989
+ <?php else : ?>
1990
+ data-layer-name="<?php echo esc_attr( get_option( 'cookiebot-data-layer' ) ); ?>"
1991
+ <?php endif; ?>
1992
+ <?php endif; ?>
1993
+ <?php if ( ! empty( $lang ) ) : ?>
1994
+ data-culture="<?php echo esc_attr( strtoupper( $lang ) ); ?>"
1995
+ <?php endif; ?>
1996
+ <?php if ( $this->get_cookie_blocking_mode() === 'auto' ) : ?>
1997
+ data-blockingmode="auto"
1998
+ <?php else : ?>
1999
+ <?php echo esc_attr( $tagAttr ); ?>
2000
+ <?php endif; ?>
2001
+ ></script>
2002
+ <?php
2003
+ if ( $print_tag === false ) {
2004
+ return ob_get_clean();
2005
  }
 
2006
  }
2007
  }
2008
 
2009
  /**
2010
+ * Cookiebot_WP Add Google Tag Manager JS to <head>
2011
+ *
2012
+ * @version 3.8.1
2013
+ * @since 3.8.1
2014
+ */
 
 
 
 
2015
 
2016
+ public function add_GTM( $print_tag = true ) {
2017
+ if ( (bool) get_option( 'cookiebot-gtm' ) !== false ) {
2018
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
2019
  $data_layer = 'dataLayer';
2020
  } else {
2021
  $data_layer = get_option( 'cookiebot-data-layer' );
2022
  }
2023
 
2024
+ if ( $print_tag === false ) {
2025
+ ob_start();
 
2026
  }
2027
+ ?>
2028
+ <script>
2029
+ <?php if ( get_option( 'cookiebot-iab' ) ) : ?>
2030
+ window ["gtag_enable_tcf_support"] = true;
2031
+ <?php endif; ?>
2032
+ (function (w, d, s, l, i) {
2033
+ w[l] = w[l] || []; w[l].push({'gtm.start':new Date().getTime(), event: 'gtm.js'});
2034
+ var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
2035
+ j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
2036
+ f.parentNode.insertBefore(j, f);})
2037
+ (window, document, 'script', '<?php echo esc_js( $data_layer ); ?>', '<?php echo esc_js( get_option( 'cookiebot-gtm-id' ) ); ?>');
2038
+ </script>
2039
+ <?php
2040
+ if ( $print_tag === false ) {
2041
+ return ob_get_clean();
2042
  }
 
 
2043
  }
2044
  }
2045
 
2046
  /**
2047
+ * Cookiebot_WP Add Google Consent Mode JS to <head>
2048
+ *
2049
+ * @version 3.8.1
2050
+ * @since 3.8.1
2051
+ */
 
 
 
 
2052
 
2053
+ public function add_GCM( $print_tag = true ) {
2054
+ if ( (bool) get_option( 'cookiebot-gcm' ) !== false ) {
2055
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
2056
  $data_layer = 'dataLayer';
2057
  } else {
2058
  $data_layer = get_option( 'cookiebot-data-layer' );
2059
  }
2060
 
2061
+ if ( $print_tag === false ) {
2062
+ ob_start();
2063
+ }
2064
+ ?>
2065
+ <script data-cookieconsent="ignore">
2066
+ (function(w,d,l){w[l]=w[l]||[];function gtag(){w[l].push(arguments)}
2067
+ gtag("consent","default",{ad_storage:d,analytics_storage:d,wait_for_update:500,});
2068
+ gtag("set", "ads_data_redaction", true);})(window,"denied","<?php echo esc_js( $data_layer ); ?>");
2069
+ </script>
2070
+ <?php
2071
+ if ( $print_tag === false ) {
2072
+ return ob_get_clean();
2073
  }
 
 
2074
  }
2075
  }
2076
 
2082
  * @since 3.3.1
2083
  * @version 3.4.1
2084
  */
2085
+ public function can_current_user_edit_theme() {
2086
  if ( is_user_logged_in() ) {
2087
  if ( current_user_can( 'edit_themes' ) ) {
2088
  return true;
2107
  * @version 2.2.0
2108
  * @since 1.0.0
2109
  */
2110
+ public function show_declaration( $atts = array() ) {
2111
  $cbid = $this->get_cbid();
2112
  $lang = '';
2113
  if ( ! empty( $cbid ) ) {
2149
  return $network_cbid;
2150
  }
2151
  }
2152
+
2153
  return $cbid;
2154
  }
2155
 
2167
  }
2168
  }
2169
  if ( empty( $cbm ) ) {
2170
+ $cbm = 'manual';
2171
+ }
2172
+
2173
  return $cbm;
2174
  }
2175
 
2186
  } elseif ( get_option( 'cookiebot-nooutput-admin', false ) ) {
2187
  return true;
2188
  }
2189
+
2190
  return false;
2191
  }
2192
 
2196
  * @version 1.4.0
2197
  * @since 1.4.0
2198
  */
2199
+ public function get_language( $onlyFromSetting = false ) {
2200
  // Get language set in setting page - if empty use WP language info
2201
  $lang = get_option( 'cookiebot-language' );
2202
  if ( ! empty( $lang ) ) {
2213
  if ( $lang == '_wp' ) {
2214
  $lang = get_bloginfo( 'language' ); //Gets language in en-US format
2215
  if ( ! empty( $lang ) ) {
2216
+ list( $lang ) = explode( '-', $lang ); //Changes format from eg. en-US to en.
2217
  }
2218
  }
2219
+
2220
  return $lang;
2221
  }
2222
 
2226
  * @version 1.6.1
2227
  * @since 1.6.1
2228
  */
2229
+ public function wp_rocket_exclude_external_js( $external_js_hosts ) {
2230
  $external_js_hosts[] = 'consent.cookiebot.com'; // Add cookiebot domains
2231
  $external_js_hosts[] = 'consentcdn.cookiebot.com';
2232
+
2233
  return $external_js_hosts;
2234
  }
2235
 
2239
  * @version 3.6.5
2240
  * @since 3.6.5
2241
  */
2242
+ public function sgo_exclude_external_js( $exclude_list ) {
2243
  //Uses same format as WP Rocket - for now we just use WP Rocket function
2244
  return wp_rocket_exclude_external_js( $exclude_list );
2245
  }
2255
  if ( class_exists( 'WP_CONSENT_API' ) ) {
2256
  return true;
2257
  }
2258
+
2259
  return false;
2260
  }
2261
 
2268
  public function get_default_wp_consent_api_mapping() {
2269
  return array(
2270
  'n=1;p=1;s=1;m=1' =>
2271
+ array(
2272
+ 'preferences' => 1,
2273
+ 'statistics' => 1,
2274
+ 'statistics-anonymous' => 0,
2275
+ 'marketing' => 1,
2276
+ ),
2277
  'n=1;p=1;s=1;m=0' =>
2278
+ array(
2279
+ 'preferences' => 1,
2280
+ 'statistics' => 1,
2281
+ 'statistics-anonymous' => 1,
2282
+ 'marketing' => 0,
2283
+ ),
2284
  'n=1;p=1;s=0;m=1' =>
2285
+ array(
2286
+ 'preferences' => 1,
2287
+ 'statistics' => 0,
2288
+ 'statistics-anonymous' => 0,
2289
+ 'marketing' => 1,
2290
+ ),
2291
  'n=1;p=1;s=0;m=0' =>
2292
+ array(
2293
+ 'preferences' => 1,
2294
+ 'statistics' => 0,
2295
+ 'statistics-anonymous' => 0,
2296
+ 'marketing' => 0,
2297
+ ),
2298
  'n=1;p=0;s=1;m=1' =>
2299
+ array(
2300
+ 'preferences' => 0,
2301
+ 'statistics' => 1,
2302
+ 'statistics-anonymous' => 0,
2303
+ 'marketing' => 1,
2304
+ ),
2305
  'n=1;p=0;s=1;m=0' =>
2306
+ array(
2307
+ 'preferences' => 0,
2308
+ 'statistics' => 1,
2309
+ 'statistics-anonymous' => 0,
2310
+ 'marketing' => 0,
2311
+ ),
2312
  'n=1;p=0;s=0;m=1' =>
2313
+ array(
2314
+ 'preferences' => 0,
2315
+ 'statistics' => 0,
2316
+ 'statistics-anonymous' => 0,
2317
+ 'marketing' => 1,
2318
+ ),
2319
  'n=1;p=0;s=0;m=0' =>
2320
+ array(
2321
+ 'preferences' => 0,
2322
+ 'statistics' => 0,
2323
+ 'statistics-anonymous' => 0,
2324
+ 'marketing' => 0,
2325
+ ),
2326
  );
2327
 
2328
  }
2352
  }
2353
  }
2354
  }
2355
+
2356
  return $mapping;
2357
  }
2358
 
2362
  * @version 3.5.0
2363
  * @since 3.5.0
2364
  */
2365
+ public function cookiebot_enqueue_consent_api_scripts() {
2366
+ wp_register_script(
2367
+ 'cookiebot-wp-consent-level-api-integration',
2368
+ plugins_url( 'cookiebot/js/cookiebot-wp-consent-level-api-integration.js', 'cookiebot' )
2369
+ );
2370
  wp_enqueue_script( 'cookiebot-wp-consent-level-api-integration' );
2371
  wp_localize_script( 'cookiebot-wp-consent-level-api-integration', 'cookiebot_category_mapping', $this->get_wp_consent_api_mapping() );
2372
  }
2378
  * @version 2.0.5
2379
  * @since 2.0.5
2380
  */
2381
+ public function cookiebot_admin_notices() {
2382
  if ( ! $this->cookiebot_valid_admin_recommendation() ) {
2383
  return false;
2384
  }
2385
  $two_week_review_ignore = add_query_arg( array( 'cookiebot_admin_notice' => 'hide' ) );
2386
  $two_week_review_temp = add_query_arg( array( 'cookiebot_admin_notice' => 'two_week' ) );
2387
 
2388
+ ?>
2389
+ <div class="update-nag cookiebot-admin-notice">
2390
+ <div class="cookiebot-notice-logo"></div>
2391
+ <p class="cookiebot-notice-title"><?php echo esc_html__( 'Leave A Review?', 'cookiebot' ); ?></p>
2392
+ <p class="cookiebot-notice-body">
2393
+ <?php
2394
+ echo esc_html__(
2395
+ 'We hope you enjoy using WordPress Cookiebot! Would you consider leaving us a review on WordPress.org?',
2396
+ 'cookiebot'
2397
+ );
2398
+ ?>
2399
+ </p>
2400
+ <ul class="cookiebot-notice-body wd-blue">
2401
+ <li>
2402
+ <span class="dashicons dashicons-external"></span>
2403
+ <a href="https://wordpress.org/support/plugin/cookiebot/reviews?filter=5&rate=5#new-post" target="_blank">
2404
+ <?php
2405
+ echo esc_html__(
2406
+ 'Sure! I\'d love to!',
2407
+ 'cookiebot'
2408
+ );
2409
+ ?>
2410
+ </a>
2411
+ </li>
2412
+ <li>
2413
+ <span class="dashicons dashicons-smiley"></span>
2414
+ <a href="<?php echo esc_url( $two_week_review_ignore ); ?>">
2415
+ <?php
2416
+ echo esc_html__(
2417
+ 'I\'ve already left a review',
2418
+ 'cookiebot'
2419
+ );
2420
+ ?>
2421
+ </a>
2422
+ </li>
2423
+ <li>
2424
+ <span class="dashicons dashicons-calendar-alt"></span>
2425
+ <a href="<?php echo esc_url( $two_week_review_temp ); ?>">
2426
+ <?php
2427
+ echo esc_html__(
2428
+ 'Maybe Later',
2429
+ 'cookiebot'
2430
+ );
2431
+ ?>
2432
+ </a>
2433
+ </li>
2434
+ <li>
2435
+ <span class="dashicons dashicons-dismiss"></span>
2436
+ <a href="<?php echo esc_url( $two_week_review_ignore ); ?>">
2437
+ <?php
2438
+ echo esc_html__(
2439
+ 'Never show again',
2440
+ 'cookiebot'
2441
+ );
2442
+ ?>
2443
+ </a>
2444
+ </li>
2445
+ </ul>
2446
+ <a href="<?php esc_url( $two_week_review_temp ); ?>" class="dashicons dashicons-dismiss"></a>
2447
+ </div>
2448
+ <?php
2449
 
2450
  wp_enqueue_style( 'cookiebot-admin-notices', plugins_url( 'css/notice.css', __FILE__ ), array(), '2.0.4' );
2451
  }
2459
  * @version 2.0.5
2460
  * @since 2.0.5
2461
  */
2462
+ public function cookiebot_valid_admin_recommendation() {
2463
  //Default - the recommendation is allowed to be visible
2464
  $return = true;
2465
 
2466
  $option = get_option( 'cookiebot_notice_recommend' );
2467
 
2468
  if ( $option != false ) {
2469
+ //Never show again is clicked
2470
  if ( $option == 'hide' ) {
2471
  $return = false;
2472
  } elseif ( is_numeric( $option ) && strtotime( 'now' ) < $option ) {
2474
  $return = false;
2475
  }
2476
  }
2477
+
2478
  return $return;
2479
  }
2480
 
2484
  * @version 2.0.5
2485
  * @since 2.0.5
2486
  */
2487
+ public function save_notice_link() {
2488
  if ( isset( $_GET['cookiebot_admin_notice'] ) ) {
2489
+ if ( $_GET['cookiebot_admin_notice'] === 'hide' ) {
2490
  update_option( 'cookiebot_notice_recommend', 'hide' );
2491
  } else {
2492
  update_option( 'cookiebot_notice_recommend', strtotime( '+2 weeks' ) );
2495
  }
2496
 
2497
 
 
 
2498
  /**
2499
  * Cookiebot_WP Fix plugin conflicts related to Cookiebot
2500
  *
2501
  * @version 3.2.0
2502
  * @since 3.3.0
2503
  */
2504
+ public function cookiebot_fix_plugin_conflicts() {
2505
  //Fix for Divi Page Builder
2506
  //Disabled - using another method now (can_current_user_edit_theme())
2507
  //add_action( 'wp', array( $this, '_cookiebot_plugin_conflict_divi' ), 100 );
2517
  * @version 3.2.0
2518
  * @since 3.2.0
2519
  */
2520
+ public function _cookiebot_plugin_conflict_divi() {
2521
  if ( defined( 'ET_FB_ENABLED' ) ) {
2522
  if ( ET_FB_ENABLED &&
2523
+ $this->cookiebot_disabled_in_admin() &&
2524
+ $this->get_cookie_blocking_mode() == 'auto' ) {
2525
 
2526
  define( 'COOKIEBOT_DISABLE_ON_PAGE', true ); //Disable Cookiebot on the current page
2527
 
2535
  * @version 3.2.0
2536
  * @since 3.3.0
2537
  */
2538
+ public function _cookiebot_plugin_conflict_scripttags( $tag, $handle ) {
2539
 
2540
  //Check if Elementor Page Builder active
2541
  if ( defined( 'ELEMENTOR_VERSION' ) ) {
2589
  /**
2590
  * Helper function to manipulate script tags
2591
  *
 
 
2592
  * @return string
2593
+ * @since 1.0
2594
+ * @version 1.6
2595
  */
2596
  function cookiebot_assist( $type = 'statistics' ) {
2597
  //change to array
2598
  if ( ! is_array( $type ) ) {
2599
+ $type = array( $type );
2600
+ }
2601
 
2602
  foreach ( $type as $tk => $tv ) {
2603
  if ( ! in_array( $tv, array( 'marketing', 'statistics', 'preferences' ) ) ) {
2607
  if ( sizeof( $type ) > 0 ) {
2608
  return ' type="text/plain" data-cookieconsent="' . implode( ',', $type ) . '"';
2609
  }
2610
+
2611
  return '';
2612
  }
2613
 
2616
  * Helper function to check if cookiebot is active.
2617
  * Useful for other plugins adding support for Cookiebot.
2618
  *
 
 
2619
  * @return string
2620
+ * @since 1.2
2621
+ * @version 2.2.2
2622
  */
2623
  function cookiebot_active() {
2624
  $cbid = Cookiebot_WP::get_cbid();
2625
  if ( ! empty( $cbid ) ) {
2626
  return true;
2627
  }
2628
+
2629
  return false;
2630
  }
2631
 
2634
  /**
2635
  * Returns the main instance of Cookiebot_WO to prevent the need to use globals.
2636
  *
 
 
2637
  * @return Cookiebot_WP
2638
+ * @since 1.0.0
2639
+ * @version 1.0.0
2640
  */
2641
  function cookiebot() {
2642
  return Cookiebot_WP::instance();
langs/cookiebot-da_DK.mo CHANGED
Binary file
langs/cookiebot-da_DK.po CHANGED
@@ -5,7 +5,7 @@ msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Cookiebot\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cookiebot\n"
8
- "POT-Creation-Date: 2018-05-30 16:47:20+00:00\n"
9
  "PO-Revision-Date: \n"
10
  "Last-Translator: \n"
11
  "Language-Team: Cookiebot <qa@cookiebot.com>\n"
@@ -23,337 +23,781 @@ msgstr ""
23
  "X-Generator: Poedit 2.4.2\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
26
- #: cookiebot.php:85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  msgid "Cookiebot Status"
28
  msgstr "Cookiebot Status"
29
 
30
- #: cookiebot.php:97
31
  msgid "You need to enter your Cookiebot ID."
32
  msgstr "Du skal indtaste et Cookiebot ID."
33
 
34
- #: cookiebot.php:99
35
  msgid "Update your Cookiebot ID"
36
  msgstr "Opdater dit Cookiebot ID"
37
 
38
- #: cookiebot.php:103
39
  msgid "Your Cookiebot is working!"
40
  msgstr "Din Cookiebot virker!"
41
 
42
- #: cookiebot.php:114
43
  msgid "Cookiebot"
44
  msgstr "Cookiebot"
45
 
46
- #: cookiebot.php:170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  msgid "Norwegian Bokmål"
48
  msgstr ""
49
 
50
- #: cookiebot.php:171
51
  msgid "Turkish"
52
  msgstr ""
53
 
54
- #: cookiebot.php:172
55
  msgid "German"
56
  msgstr ""
57
 
58
- #: cookiebot.php:173
59
  msgid "Czech"
60
  msgstr ""
61
 
62
- #: cookiebot.php:174
63
  msgid "Danish"
64
  msgstr ""
65
 
66
- #: cookiebot.php:175
67
  msgid "Albanian"
68
  msgstr ""
69
 
70
- #: cookiebot.php:176
71
  msgid "Hebrew"
72
  msgstr ""
73
 
74
- #: cookiebot.php:177
75
  msgid "Korean"
76
  msgstr ""
77
 
78
- #: cookiebot.php:178
79
  msgid "Italian"
80
  msgstr ""
81
 
82
- #: cookiebot.php:179
83
  msgid "Dutch"
84
  msgstr ""
85
 
86
- #: cookiebot.php:180
87
  msgid "Vietnamese"
88
  msgstr ""
89
 
90
- #: cookiebot.php:181
91
  msgid "Tamil"
92
  msgstr ""
93
 
94
- #: cookiebot.php:182
95
  msgid "Icelandic"
96
  msgstr ""
97
 
98
- #: cookiebot.php:183
99
  msgid "Romanian"
100
  msgstr ""
101
 
102
- #: cookiebot.php:184
103
  msgid "Sinhala"
104
  msgstr ""
105
 
106
- #: cookiebot.php:185
107
  msgid "Catalan"
108
  msgstr ""
109
 
110
- #: cookiebot.php:186
111
  msgid "Bulgarian"
112
  msgstr ""
113
 
114
- #: cookiebot.php:187
115
  msgid "Ukrainian"
116
  msgstr ""
117
 
118
- #: cookiebot.php:188
119
  msgid "Chinese"
120
  msgstr ""
121
 
122
- #: cookiebot.php:189
123
  msgid "English"
124
  msgstr ""
125
 
126
- #: cookiebot.php:190
127
  msgid "Arabic"
128
  msgstr ""
129
 
130
- #: cookiebot.php:191
131
  msgid "Croatian"
132
  msgstr ""
133
 
134
- #: cookiebot.php:192
135
  msgid "Thai"
136
  msgstr ""
137
 
138
- #: cookiebot.php:193
139
  msgid "Greek"
140
  msgstr ""
141
 
142
- #: cookiebot.php:194
143
  msgid "Lithuanian"
144
  msgstr ""
145
 
146
- #: cookiebot.php:195
147
  msgid "Polish"
148
  msgstr ""
149
 
150
- #: cookiebot.php:196
151
  msgid "Latvian"
152
  msgstr ""
153
 
154
- #: cookiebot.php:197
155
  msgid "French"
156
  msgstr ""
157
 
158
- #: cookiebot.php:198
159
  msgid "Indonesian"
160
  msgstr ""
161
 
162
- #: cookiebot.php:199
163
  msgid "Macedonian"
164
  msgstr ""
165
 
166
- #: cookiebot.php:200
167
  msgid "Estonian"
168
  msgstr ""
169
 
170
- #: cookiebot.php:201
171
  msgid "Portuguese"
172
  msgstr ""
173
 
174
- #: cookiebot.php:202
175
  msgid "Irish"
176
  msgstr ""
177
 
178
- #: cookiebot.php:203
179
  msgid "Malay"
180
  msgstr ""
181
 
182
- #: cookiebot.php:204
183
  msgid "Slovenian"
184
  msgstr ""
185
 
186
- #: cookiebot.php:205
187
  msgid "Russian"
188
  msgstr ""
189
 
190
- #: cookiebot.php:206
191
  msgid "Japanese"
192
  msgstr ""
193
 
194
- #: cookiebot.php:207
195
  msgid "Hindi"
196
  msgstr ""
197
 
198
- #: cookiebot.php:208
199
  msgid "Slovak"
200
  msgstr ""
201
 
202
- #: cookiebot.php:209
203
  msgid "Spanish"
204
  msgstr ""
205
 
206
- #: cookiebot.php:210
207
  msgid "Swedish"
208
  msgstr ""
209
 
210
- #: cookiebot.php:211
211
  msgid "Serbian"
212
  msgstr ""
213
 
214
- #: cookiebot.php:212
215
  msgid "Finnish"
216
  msgstr ""
217
 
218
- #: cookiebot.php:226
219
- msgid "Cookiebot Settings"
220
- msgstr "Cookiebot indstillinger"
221
 
222
- #: cookiebot.php:231
 
 
 
 
 
223
  msgid ""
224
  "Cookiebot enables your website to comply with current legislation in the EU "
225
  "on the use of cookies for user tracking and profiling. The EU ePrivacy "
226
- "Directive requires prior, informed consent of your site users, while the <a "
227
- "href=\"https://www.cookiebot.com/en/gdpr\" target=\"_blank\">General Data "
228
- "Protection Regulation (GDPR)</a> requires you to document each consent. At "
229
- "the same time you must be able to account for what user data you share with "
230
- "embedded third-party services on your website and where in the world the "
231
- "user data is sent."
232
- msgstr ""
233
- "Med Cookiebot kan din hjemmeside overholde gældende lovgivning i EU ift. "
234
- "brugen af cookies til sporing og profilering af dine brugere. EU's ePrivacy-"
235
- "direktiv kræver forudgående, informeret samtykke fra dine hjemmeside-"
236
- "brugere, mens persondata-forordingen (GDPR) kræver, at du kan dokumentere "
237
- "hvert enkelt samtykke. Samtidig skal du kunne redegøre for hvilke bruger-"
238
- "data, du deler med de indlejrede tredjeparts-tjenester din hjemmeside, og "
239
- "hvor i Verden brugernes data sendes hen."
240
-
241
- #: cookiebot.php:238
242
  msgid "Cookiebot ID"
243
  msgstr "Cookiebot ID"
244
 
245
- #: cookiebot.php:242
246
  msgid "Need an ID?"
247
  msgstr "Brug for et ID?"
248
 
249
- #: cookiebot.php:243
250
  msgid "Sign up for free on cookiebot.com"
251
  msgstr "Opret dig gratis på cookiebot.com"
252
 
253
- #: cookiebot.php:248
254
- #, fuzzy
255
- #| msgid "Cookiebot Status"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  msgid "Cookiebot Language"
257
- msgstr "Cookiebot Status"
258
 
259
- #: cookiebot.php:254
260
  msgid "Default (Autodetect)"
261
  msgstr ""
262
 
263
- #: cookiebot.php:255
264
- msgid "Use Wordpress Language"
265
  msgstr ""
266
 
267
- #: cookiebot.php:265
268
  msgid "You need to add the language in the Cookiebot administration tool."
269
  msgstr ""
270
 
271
- #: cookiebot.php:268
272
  msgid ""
273
  "You need to add all languages that you want auto-detected in the Cookiebot "
274
  "administration tool."
275
  msgstr ""
276
 
277
- #: cookiebot.php:269
278
  msgid ""
279
  "The auto-detect checkbox needs to be enabled in the Cookiebot administration "
280
  "tool."
281
  msgstr ""
282
 
283
- #: cookiebot.php:270
284
  msgid ""
285
  "If the auto-detected language is not supported, Cookiebot will use the "
286
  "default language."
287
  msgstr ""
288
 
289
- #: cookiebot.php:274
290
- msgid "Read more here"
291
  msgstr ""
292
 
293
- #: cookiebot.php:277
294
- msgid "Show guide to add languages"
295
  msgstr ""
296
 
297
- #: cookiebot.php:282
298
  msgid "Hide guide"
299
  msgstr ""
300
 
301
- #: cookiebot.php:313
302
- #, fuzzy
303
- #| msgid "Update your Cookiebot ID"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  msgid "Auto-update Cookiebot"
305
- msgstr "Opdater dit Cookiebot ID"
306
 
307
- #: cookiebot.php:317
308
  msgid ""
309
  "Automatic update your Cookiebot plugin when new releases becomes available."
310
  msgstr ""
311
 
312
- #: cookiebot.php:322
313
  msgid "Hide Cookie Popup"
314
  msgstr ""
315
 
316
- #: cookiebot.php:326
317
  msgid ""
318
  "This checkbox will remove the cookie consent banner from your website. The "
319
  "<i>[cookie_declaration]</i> shortcode will still be available."
320
  msgstr ""
321
 
322
- #: cookiebot.php:327
323
  msgid ""
324
  "If you are using Google Tag Manager (or equal), you need to add the "
325
  "Cookiebot script in your Tag Manager."
326
  msgstr ""
327
 
328
- #: cookiebot.php:328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  msgid ""
330
  "<a href=\"https://support.cookiebot.com/hc/en-us/articles/360003793854-"
331
  "Google-Tag-Manager-deployment\" target=\"_blank\">See a detailed guide here</"
332
  "a>"
333
  msgstr ""
334
 
335
- #: cookiebot.php:335
336
- msgid "How to find my Cookiebot ID"
337
- msgstr "Hvordan finder jeg mit Cookiebot ID"
338
 
339
- #: cookiebot.php:338
340
  msgid ""
341
- "Log in to your <a href=\"https://www.cookiebot.com/en/account\" target="
342
- "\"_blank\">Cookiebot account</a>."
343
  msgstr ""
344
- "Log ind på din <a href=\"https://www.cookiebit.com/da/account\" target="
345
- "\"blank\">Cookiebot konto</a>."
346
 
347
- #: cookiebot.php:339
348
- msgid "Go to <b>Manage</b> > <b>Settings</b> and add setup your Cookiebot"
 
 
 
 
 
 
 
 
 
 
349
  msgstr ""
350
- "Gå til <b>Administration</b> > <b>Indstillinger</b> og opret din Cookiebot"
351
 
352
- #: cookiebot.php:340
353
- msgid "Go to the <b>\"Your scripts\"</b> tab"
354
- msgstr " til <b>\"Dine scripts\"</b> fanen"
 
355
 
356
- #: cookiebot.php:341
357
  msgid ""
358
  "Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-"
359
  "ef1234567890"
@@ -361,43 +805,46 @@ msgstr ""
361
  "Kopier værdien i data-cid parameteren - f.eks.: abcdef12-3456-7890-abcd-"
362
  "ef1234567890"
363
 
364
- #: cookiebot.php:342
 
365
  msgid ""
366
- "Add <b>[cookie_declaration]</b> shortcode to a page to show the declation"
367
  msgstr ""
368
- "Tilføj <b>[cookie_declaration]</b> shortcoden til siden hvor du ønsker at "
369
  "vise deklarationen"
370
 
371
- #: cookiebot.php:343
372
  msgid "Remember to change your scripts as descripted below"
373
  msgstr "Husk at opdatere dine scripts som beskrevet nedenfor"
374
 
375
- #: cookiebot.php:346
376
  msgid "Add the Cookie Declaration to your website"
377
  msgstr ""
378
 
379
- #: cookiebot.php:348
 
380
  msgid ""
381
- "Use the shortcode <b>[cookie_declaration]</b> to add the cookie declaration "
382
  "a page or post. The cookie declaration will always show the latest version "
383
  "from Cookiebot."
384
  msgstr ""
385
 
386
- #: cookiebot.php:350
 
387
  msgid ""
388
  "If you need to force language of the cookie declaration, you can add the "
389
- "<i>lang</i> attribute. Eg. <b>[cookie_declaration lang=\"de\"]</b>."
390
  msgstr ""
391
 
392
- #: cookiebot.php:353 cookiebot.php:369
393
  msgid "Watch video demonstration"
394
  msgstr ""
395
 
396
- #: cookiebot.php:355
397
  msgid "Update your script tags"
398
  msgstr "Opdater dine script tags"
399
 
400
- #: cookiebot.php:357
401
  msgid ""
402
  "To enable prior consent, apply the attribute \"data-cookieconsent\" to "
403
  "cookie-setting script tags on your website. Set the comma-separated value to "
@@ -408,11 +855,11 @@ msgid ""
408
  "script tag."
409
  msgstr ""
410
 
411
- #: cookiebot.php:372
412
  msgid "Helper function to update your scripts"
413
  msgstr "Hjælperfunktion til at opdatere dine scripts"
414
 
415
- #: cookiebot.php:374
416
  msgid ""
417
  "You are able to update your scripts yourself. However, Cookiebot also offers "
418
  "a small helper function that makes the work easier."
@@ -420,49 +867,151 @@ msgstr ""
420
  "Du kan selv opdatere dine scripts, men Cookiebot tilbyder også en lille "
421
  "hjælperfunktion, der gør arbejdet lidt nemmere."
422
 
423
- #: cookiebot.php:376
424
  msgid "Update your script tags this way:"
425
  msgstr "Opdater dine script tags på denne måde:"
426
 
427
- #: cookiebot.php:380
428
- msgid "%s to %s"
429
- msgstr "%s til %s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
 
431
- #: cookiebot.php:431
 
 
 
 
432
  msgid "Please add your Cookiebot ID to show Cookie Declarations"
433
  msgstr "Tilføj dit Cookiebot ID for at vise Cookie deklarationen"
434
 
435
- #. Plugin Name of the plugin/theme
436
- msgid "Cookiebot | GDPR Compliant Cookie Consent and Notice"
437
  msgstr ""
438
 
439
- #. Plugin URI of the plugin/theme
440
- msgid "https://cookiebot.com/"
 
 
441
  msgstr ""
442
 
443
- #. Description of the plugin/theme
444
- msgid ""
445
- "Cookiebot is a fully GDPR & ePrivacy compliant cookie consent solution "
446
- "supporting prior consent, cookie declaration, and documentation of consents. "
447
- "Easy to install, implement and configure."
448
  msgstr ""
449
 
450
- #. Author of the plugin/theme
451
- msgid "Cybot A/S"
452
  msgstr ""
453
 
454
- #. Author URI of the plugin/theme
455
- msgid "http://cookiebot.com"
456
  msgstr ""
457
 
458
- #: Preferences
459
- msgid "preferences"
460
- msgstr "præferencer"
461
 
462
- #: Statistics
463
- msgid "statistics"
464
- msgstr "statistikker"
465
 
466
- #: Marketing
467
- msgid "marketing"
468
- msgstr "markedsføring"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  msgstr ""
6
  "Project-Id-Version: Cookiebot\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cookiebot\n"
8
+ "POT-Creation-Date: 2021-09-22 11:34+0200\n"
9
  "PO-Revision-Date: \n"
10
  "Last-Translator: \n"
11
  "Language-Team: Cookiebot <qa@cookiebot.com>\n"
23
  "X-Generator: Poedit 2.4.2\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
 
26
+ #: addons/config/settings-config.php:51 cookiebot.php:363 cookiebot.php:364
27
+ msgid "Prior Consent"
28
+ msgstr ""
29
+
30
+ #: addons/config/settings-config.php:70
31
+ #: addons/view/admin/settings/available-addon-callback.php:64
32
+ #: addons/view/admin/settings/jetpack-addon-callback.php:60
33
+ msgid "Remove language"
34
+ msgstr "Fjern sprog"
35
+
36
+ #: addons/config/settings-config.php:226
37
+ msgid "Jetpack settings."
38
+ msgstr ""
39
+
40
+ #: addons/config/settings-config.php:248
41
+ msgid ""
42
+ "Below is a list of addons for Cookiebot. Addons help you make installed "
43
+ "plugins GDPR compliant."
44
+ msgstr ""
45
+
46
+ #: addons/config/settings-config.php:250
47
+ msgid ""
48
+ "These addons are available because you have the corresponding plugins "
49
+ "installed and activated."
50
+ msgstr ""
51
+
52
+ #: addons/config/settings-config.php:252
53
+ msgid ""
54
+ "Deactivate an addon if you want to handle GDPR compliance yourself, or "
55
+ "through another plugin."
56
+ msgstr ""
57
+
58
+ #: addons/config/settings-config.php:276
59
+ msgid ""
60
+ "The following addons are unavailable. This is because the corresponding "
61
+ "plugin is not installed."
62
+ msgstr ""
63
+
64
+ #: addons/config/settings-config.php:293
65
+ msgid "The plugin is not installed."
66
+ msgstr ""
67
+
68
+ #: addons/config/settings-config.php:295
69
+ msgid "The plugin is not activated."
70
+ msgstr ""
71
+
72
+ #: addons/controller/addons/add-to-any/add-to-any.php:286
73
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:614
74
+ msgid "Blocks embedded videos from Youtube, Twitter, Vimeo and Facebook."
75
+ msgstr ""
76
+
77
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:721
78
+ msgid "Show advanced options"
79
+ msgstr ""
80
+
81
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:727
82
+ msgid "This is for more advanced users."
83
+ msgstr ""
84
+
85
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:731
86
+ msgid "Regex:"
87
+ msgstr ""
88
+
89
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:744
90
+ msgid "Edit regex"
91
+ msgstr ""
92
+
93
+ #: addons/controller/addons/embed-autocorrect/embed-autocorrect.php:758
94
+ msgid "Reset to default regex"
95
+ msgstr ""
96
+
97
+ #: addons/controller/addons/enfold/enfold.php:237
98
+ msgid "Blocks cookies created by Enfold theme's Google Services."
99
+ msgstr ""
100
+
101
+ #: addons/controller/addons/enhanced-ecommerce-for-woocommerce-store/enhanced-ecommerce-for-woocommerce-store.php:242
102
+ msgid "Blocks enhanced e-commerce for WooCommerce store"
103
+ msgstr ""
104
+
105
+ #: addons/controller/addons/google-analytics-plus/google-analytics-plus.php:238
106
+ msgid ""
107
+ "Google Analytics is a simple, easy-to-use tool that helps website owners "
108
+ "measure how users interact with website content"
109
+ msgstr ""
110
+
111
+ #: addons/controller/addons/google-analytics/google-analytics.php:243
112
+ msgid ""
113
+ "Google Analytics is used to track how visitor interact with website content."
114
+ msgstr ""
115
+
116
+ #: addons/controller/addons/google-site-kit/google-site-kit.php:242
117
+ msgid "Blocks Google Analytics scripts"
118
+ msgstr ""
119
+
120
+ #: addons/controller/addons/jetpack/widget/facebook-widget.php:236
121
+ msgid "Facebook widget."
122
+ msgstr ""
123
+
124
+ #: addons/controller/addons/litespeed-cache/litespeed-cache.php:253
125
+ msgid ""
126
+ "Excludes cookiebot javascript files when the Litespeed Cache deter option is "
127
+ "enabled."
128
+ msgstr ""
129
+
130
+ #: addons/controller/addons/official-facebook-pixel/official-facebook-pixel.php:344
131
+ msgid "Blocks Official Facebook Pixel scripts"
132
+ msgstr ""
133
+
134
+ #: addons/controller/addons/optinmonster/optinmonster.php:235
135
+ msgid ""
136
+ "OptinMonster API plugin to connect your WordPress site to your OptinMonster "
137
+ "account."
138
+ msgstr ""
139
+
140
+ #: addons/controller/addons/simple-share-buttons-adder/simple-share-buttons-adder.php:235
141
+ msgid "Blocks Simple Share Buttons Adder."
142
+ msgstr ""
143
+
144
+ #: addons/controller/addons/wp-google-analytics-events/wp-google-analytics-events.php:243
145
+ msgid ""
146
+ "The plugin allows you to fire events whenever someone interacts or views "
147
+ "elements on your website."
148
+ msgstr ""
149
+
150
+ #: addons/controller/addons/wp-rocket/wp-rocket.php:253
151
+ msgid ""
152
+ "Excludes cookiebot javascript files when the WP-Rocket deter option is "
153
+ "enabled."
154
+ msgstr ""
155
+
156
+ #: addons/controller/addons/wpforms/wpforms.php:270
157
+ msgid ""
158
+ "If the user gives correct consent, IP and Unique User ID will be saved on "
159
+ "form submissions, otherwise not."
160
+ msgstr ""
161
+
162
+ #: addons/controller/addons/wpforms/wpforms.php:272
163
+ msgid "Increases opt-in rate compared to WPForms \"GDPR mode\"."
164
+ msgstr ""
165
+
166
+ #: addons/controller/plugin-controller.php:104
167
+ msgid "You enabled Cookiebot auto blocking mode but still using addons"
168
+ msgstr ""
169
+
170
+ #: addons/controller/plugin-controller.php:105
171
+ msgid ""
172
+ "In some occasions this may cause client side errors. If you notice any "
173
+ "errors please try to disable Cookiebot addons or contact Cookiebot support."
174
+ msgstr ""
175
+
176
+ #: addons/lib/helper.php:246 addons/lib/helper.php:325
177
+ msgid "marketing"
178
+ msgstr "markedsføring"
179
+
180
+ #: addons/lib/helper.php:248 addons/lib/helper.php:324
181
+ msgid "statistics"
182
+ msgstr "statistikker"
183
+
184
+ #: addons/lib/helper.php:250 addons/lib/helper.php:323
185
+ msgid "preferences"
186
+ msgstr "præferencer"
187
+
188
+ #: addons/lib/helper.php:252
189
+ msgid "necessary"
190
+ msgstr ""
191
+
192
+ #: addons/view/admin/settings/available-addon-callback.php:14
193
+ #: addons/view/admin/settings/jetpack-addon-callback.php:8
194
+ msgid "Enable"
195
+ msgstr ""
196
+
197
+ #: addons/view/admin/settings/available-addon-callback.php:19
198
+ #: addons/view/admin/settings/jetpack-addon-callback.php:14
199
+ msgid "Check one or multiple cookie types:"
200
+ msgstr ""
201
+
202
+ #: addons/view/admin/settings/available-addon-callback.php:39
203
+ #: addons/view/admin/settings/jetpack-addon-callback.php:35
204
+ msgid "Display a placeholder"
205
+ msgstr ""
206
+
207
+ #: addons/view/admin/settings/available-addon-callback.php:55
208
+ #: addons/view/admin/settings/available-addon-callback.php:79
209
+ #: addons/view/admin/settings/jetpack-addon-callback.php:51
210
+ #: addons/view/admin/settings/jetpack-addon-callback.php:75
211
+ #: widgets/cookiebot-declaration-widget.php:34
212
+ msgid "Language"
213
+ msgstr "Sprog"
214
+
215
+ #: addons/view/admin/settings/available-addon-callback.php:98
216
+ #: addons/view/admin/settings/jetpack-addon-callback.php:95
217
+ msgid "+ Add language"
218
+ msgstr ""
219
+
220
+ #: addons/view/admin/settings/setting-page.php:5
221
+ msgid "Prior consent"
222
+ msgstr ""
223
+
224
+ #: addons/view/admin/settings/setting-page.php:8
225
+ msgid ""
226
+ "These add-ons are produced by an open-source community of developers. This "
227
+ "is done to help make it easier for Wordpress users to implement ‘prior "
228
+ "consent’ for cookies and trackers set by plugins that do not offer this as a "
229
+ "built-in functionality."
230
+ msgstr ""
231
+
232
+ #: addons/view/admin/settings/setting-page.php:11
233
+ msgid ""
234
+ "The add-ons are currently the best alternative to a Wordpress Core framework "
235
+ "that can signal the user’s consent state to other plugins (if and when this "
236
+ "will be implemented is unknown) and to those plugins who do not yet offer "
237
+ "native support for Cookiebot built into the plugin itself."
238
+ msgstr ""
239
+
240
+ #: addons/view/admin/settings/setting-page.php:14
241
+ msgid ""
242
+ "We do not assume any responsibility for the use of these add-ons. If one of "
243
+ "the plugins that the add-ons hook into makes a ‘breaking change’, there may "
244
+ "be a period of time where the add-on will not work properly until it has "
245
+ "been updated to accommodate the changes in the plugin."
246
+ msgstr ""
247
+
248
+ #: addons/view/admin/settings/setting-page.php:18
249
+ #, php-format
250
+ msgid ""
251
+ "If your favourite plugin isn't supported you're welcome to contribute or "
252
+ "request on our <a href=\"%s\" target=\"_blank\">Github development page.</a>"
253
+ msgstr ""
254
+
255
+ #: addons/view/admin/settings/setting-page.php:28
256
+ msgid "This feature is only available in PHP 5.4 and above."
257
+ msgstr ""
258
+
259
+ #: cookiebot.php:145
260
+ msgid "You are using Cookiebot Addons Standalone."
261
+ msgstr ""
262
+
263
+ #: cookiebot.php:291
264
  msgid "Cookiebot Status"
265
  msgstr "Cookiebot Status"
266
 
267
+ #: cookiebot.php:303
268
  msgid "You need to enter your Cookiebot ID."
269
  msgstr "Du skal indtaste et Cookiebot ID."
270
 
271
+ #: cookiebot.php:305
272
  msgid "Update your Cookiebot ID"
273
  msgstr "Opdater dit Cookiebot ID"
274
 
275
+ #: cookiebot.php:308
276
  msgid "Your Cookiebot is working!"
277
  msgstr "Din Cookiebot virker!"
278
 
279
+ #: cookiebot.php:321 cookiebot.php:412
280
  msgid "Cookiebot"
281
  msgstr "Cookiebot"
282
 
283
+ #: cookiebot.php:325 cookiebot.php:421 cookiebot.php:588
284
+ msgid "Cookiebot Settings"
285
+ msgstr "Cookiebot indstillinger"
286
+
287
+ #: cookiebot.php:326 cookiebot.php:422
288
+ msgid "Settings"
289
+ msgstr "Indstillinger"
290
+
291
+ #: cookiebot.php:334 cookiebot.php:429
292
+ msgid "Cookiebot Support"
293
+ msgstr "Understøttelse af Cookiebot"
294
+
295
+ #: cookiebot.php:335 cookiebot.php:430 cookiebot.php:1528
296
+ msgid "Support"
297
+ msgstr ""
298
+
299
+ #: cookiebot.php:343 cookiebot.php:344 cookiebot.php:1674
300
+ msgid "Google Tag Manager"
301
+ msgstr ""
302
+
303
+ #: cookiebot.php:351 cookiebot.php:352 cookiebot.php:1738
304
+ msgid "IAB"
305
+ msgstr ""
306
+
307
+ #: cookiebot.php:376 cookiebot.php:377 cookiebot.php:1775
308
+ msgid "Legislations"
309
+ msgstr ""
310
+
311
+ #: cookiebot.php:394 cookiebot.php:395
312
+ msgid "Debug info"
313
+ msgstr ""
314
+
315
+ #: cookiebot.php:519
316
  msgid "Norwegian Bokmål"
317
  msgstr ""
318
 
319
+ #: cookiebot.php:520
320
  msgid "Turkish"
321
  msgstr ""
322
 
323
+ #: cookiebot.php:521
324
  msgid "German"
325
  msgstr ""
326
 
327
+ #: cookiebot.php:522
328
  msgid "Czech"
329
  msgstr ""
330
 
331
+ #: cookiebot.php:523
332
  msgid "Danish"
333
  msgstr ""
334
 
335
+ #: cookiebot.php:524
336
  msgid "Albanian"
337
  msgstr ""
338
 
339
+ #: cookiebot.php:525
340
  msgid "Hebrew"
341
  msgstr ""
342
 
343
+ #: cookiebot.php:526
344
  msgid "Korean"
345
  msgstr ""
346
 
347
+ #: cookiebot.php:527
348
  msgid "Italian"
349
  msgstr ""
350
 
351
+ #: cookiebot.php:528
352
  msgid "Dutch"
353
  msgstr ""
354
 
355
+ #: cookiebot.php:529
356
  msgid "Vietnamese"
357
  msgstr ""
358
 
359
+ #: cookiebot.php:530
360
  msgid "Tamil"
361
  msgstr ""
362
 
363
+ #: cookiebot.php:531
364
  msgid "Icelandic"
365
  msgstr ""
366
 
367
+ #: cookiebot.php:532
368
  msgid "Romanian"
369
  msgstr ""
370
 
371
+ #: cookiebot.php:533
372
  msgid "Sinhala"
373
  msgstr ""
374
 
375
+ #: cookiebot.php:534
376
  msgid "Catalan"
377
  msgstr ""
378
 
379
+ #: cookiebot.php:535
380
  msgid "Bulgarian"
381
  msgstr ""
382
 
383
+ #: cookiebot.php:536
384
  msgid "Ukrainian"
385
  msgstr ""
386
 
387
+ #: cookiebot.php:537
388
  msgid "Chinese"
389
  msgstr ""
390
 
391
+ #: cookiebot.php:538
392
  msgid "English"
393
  msgstr ""
394
 
395
+ #: cookiebot.php:539
396
  msgid "Arabic"
397
  msgstr ""
398
 
399
+ #: cookiebot.php:540
400
  msgid "Croatian"
401
  msgstr ""
402
 
403
+ #: cookiebot.php:541
404
  msgid "Thai"
405
  msgstr ""
406
 
407
+ #: cookiebot.php:542
408
  msgid "Greek"
409
  msgstr ""
410
 
411
+ #: cookiebot.php:543
412
  msgid "Lithuanian"
413
  msgstr ""
414
 
415
+ #: cookiebot.php:544
416
  msgid "Polish"
417
  msgstr ""
418
 
419
+ #: cookiebot.php:545
420
  msgid "Latvian"
421
  msgstr ""
422
 
423
+ #: cookiebot.php:546
424
  msgid "French"
425
  msgstr ""
426
 
427
+ #: cookiebot.php:547
428
  msgid "Indonesian"
429
  msgstr ""
430
 
431
+ #: cookiebot.php:548
432
  msgid "Macedonian"
433
  msgstr ""
434
 
435
+ #: cookiebot.php:549
436
  msgid "Estonian"
437
  msgstr ""
438
 
439
+ #: cookiebot.php:550
440
  msgid "Portuguese"
441
  msgstr ""
442
 
443
+ #: cookiebot.php:551
444
  msgid "Irish"
445
  msgstr ""
446
 
447
+ #: cookiebot.php:552
448
  msgid "Malay"
449
  msgstr ""
450
 
451
+ #: cookiebot.php:553
452
  msgid "Slovenian"
453
  msgstr ""
454
 
455
+ #: cookiebot.php:554
456
  msgid "Russian"
457
  msgstr ""
458
 
459
+ #: cookiebot.php:555
460
  msgid "Japanese"
461
  msgstr ""
462
 
463
+ #: cookiebot.php:556
464
  msgid "Hindi"
465
  msgstr ""
466
 
467
+ #: cookiebot.php:557
468
  msgid "Slovak"
469
  msgstr ""
470
 
471
+ #: cookiebot.php:558
472
  msgid "Spanish"
473
  msgstr ""
474
 
475
+ #: cookiebot.php:559
476
  msgid "Swedish"
477
  msgstr ""
478
 
479
+ #: cookiebot.php:560
480
  msgid "Serbian"
481
  msgstr ""
482
 
483
+ #: cookiebot.php:561
484
  msgid "Finnish"
485
  msgstr ""
486
 
487
+ #: cookiebot.php:562
488
+ msgid "Basque"
489
+ msgstr ""
490
 
491
+ #: cookiebot.php:563
492
+ msgid "Hungarian"
493
+ msgstr ""
494
+
495
+ #: cookiebot.php:597 cookiebot.php:1225
496
+ #, php-format
497
  msgid ""
498
  "Cookiebot enables your website to comply with current legislation in the EU "
499
  "on the use of cookies for user tracking and profiling. The EU ePrivacy "
500
+ "Directive requires prior, informed consent of your site users, while the "
501
+ "%1$s %2$s."
502
+ msgstr ""
503
+
504
+ #: cookiebot.php:603 cookiebot.php:1231
505
+ msgid "General Data Protection Regulation (GDPR)"
506
+ msgstr ""
507
+
508
+ #: cookiebot.php:606 cookiebot.php:1234
509
+ msgid ""
510
+ " requires you to document each consent. At the same time you must be able to "
511
+ "account for what user data you share with embedded third-party services on "
512
+ "your website and where in the world the user data is sent."
513
+ msgstr ""
514
+
515
+ #: cookiebot.php:617
516
  msgid "Cookiebot ID"
517
  msgstr "Cookiebot ID"
518
 
519
+ #: cookiebot.php:629 cookiebot.php:1268
520
  msgid "Need an ID?"
521
  msgstr "Brug for et ID?"
522
 
523
+ #: cookiebot.php:633 cookiebot.php:1272
524
  msgid "Sign up for free on cookiebot.com"
525
  msgstr "Opret dig gratis på cookiebot.com"
526
 
527
+ #: cookiebot.php:643 cookiebot.php:1282
528
+ msgid "Cookie-blocking mode"
529
+ msgstr ""
530
+
531
+ #: cookiebot.php:654 cookiebot.php:1290
532
+ msgid "Automatic"
533
+ msgstr ""
534
+
535
+ #: cookiebot.php:659 cookiebot.php:1295
536
+ msgid "Manual"
537
+ msgstr ""
538
+
539
+ #: cookiebot.php:662
540
+ msgid ""
541
+ "Automatic block cookies (except necessary) until the user has given their "
542
+ "consent."
543
+ msgstr ""
544
+
545
+ #: cookiebot.php:665
546
+ msgid "Learn more"
547
+ msgstr ""
548
+
549
+ #: cookiebot.php:691
550
  msgid "Cookiebot Language"
551
+ msgstr "Cookiebot Sprog"
552
 
553
+ #: cookiebot.php:698
554
  msgid "Default (Autodetect)"
555
  msgstr ""
556
 
557
+ #: cookiebot.php:702
558
+ msgid "Use WordPress Language"
559
  msgstr ""
560
 
561
+ #: cookiebot.php:721
562
  msgid "You need to add the language in the Cookiebot administration tool."
563
  msgstr ""
564
 
565
+ #: cookiebot.php:726
566
  msgid ""
567
  "You need to add all languages that you want auto-detected in the Cookiebot "
568
  "administration tool."
569
  msgstr ""
570
 
571
+ #: cookiebot.php:733
572
  msgid ""
573
  "The auto-detect checkbox needs to be enabled in the Cookiebot administration "
574
  "tool."
575
  msgstr ""
576
 
577
+ #: cookiebot.php:740
578
  msgid ""
579
  "If the auto-detected language is not supported, Cookiebot will use the "
580
  "default language."
581
  msgstr ""
582
 
583
+ #: cookiebot.php:747
584
+ msgid "Show guide to add languages"
585
  msgstr ""
586
 
587
+ #: cookiebot.php:751
588
+ msgid "Read more here"
589
  msgstr ""
590
 
591
+ #: cookiebot.php:758
592
  msgid "Hide guide"
593
  msgstr ""
594
 
595
+ #: cookiebot.php:814
596
+ msgid "Advanced settings"
597
+ msgstr ""
598
+
599
+ #: cookiebot.php:819 cookiebot.php:863 cookiebot.php:1324 cookiebot.php:1365
600
+ msgid "Add async or defer attribute"
601
+ msgstr ""
602
+
603
+ #: cookiebot.php:820 cookiebot.php:1325
604
+ msgid "Consent banner script tag"
605
+ msgstr ""
606
+
607
+ #: cookiebot.php:834 cookiebot.php:878 cookiebot.php:1333 cookiebot.php:1374
608
+ msgid "None"
609
+ msgstr ""
610
+
611
+ #: cookiebot.php:852 cookiebot.php:896 cookiebot.php:954 cookiebot.php:1005
612
+ #: cookiebot.php:1037
613
+ msgid ""
614
+ "Network setting applied. Please contact website administrator to change this "
615
+ "setting."
616
+ msgstr ""
617
+
618
+ #: cookiebot.php:857 cookiebot.php:901
619
+ msgid "Add async or defer attribute to Cookiebot script tag. Default: async"
620
+ msgstr ""
621
+
622
+ #: cookiebot.php:864 cookiebot.php:1366
623
+ msgid "Cookie declaration script tag"
624
+ msgstr ""
625
+
626
+ #: cookiebot.php:909 cookiebot.php:1405
627
  msgid "Auto-update Cookiebot"
628
+ msgstr "Opdater dit Cookiebot"
629
 
630
+ #: cookiebot.php:921 cookiebot.php:1417
631
  msgid ""
632
  "Automatic update your Cookiebot plugin when new releases becomes available."
633
  msgstr ""
634
 
635
+ #: cookiebot.php:929 cookiebot.php:1422
636
  msgid "Hide Cookie Popup"
637
  msgstr ""
638
 
639
+ #: cookiebot.php:962
640
  msgid ""
641
  "This checkbox will remove the cookie consent banner from your website. The "
642
  "<i>[cookie_declaration]</i> shortcode will still be available."
643
  msgstr ""
644
 
645
+ #: cookiebot.php:969 cookiebot.php:1444
646
  msgid ""
647
  "If you are using Google Tag Manager (or equal), you need to add the "
648
  "Cookiebot script in your Tag Manager."
649
  msgstr ""
650
 
651
+ #: cookiebot.php:975
652
+ msgid "See a detailed guide here"
653
+ msgstr ""
654
+
655
+ #: cookiebot.php:981
656
+ msgid "Disable Cookiebot in WP Admin"
657
+ msgstr ""
658
+
659
+ #: cookiebot.php:1008
660
+ msgid "This checkbox will disable Cookiebot in the WordPress Admin area."
661
+ msgstr ""
662
+
663
+ #: cookiebot.php:1013
664
+ msgid "Enable Cookiebot on front end while logged in"
665
+ msgstr ""
666
+
667
+ #: cookiebot.php:1040
668
+ msgid "This checkbox will enable Cookiebot on front end while you're logged in"
669
+ msgstr ""
670
+
671
+ #: cookiebot.php:1050
672
+ msgid "Consent Level API Settings"
673
+ msgstr ""
674
+
675
+ #: cookiebot.php:1059
676
+ msgid ""
677
+ "WP Consent Level API and Cookiebot categorise cookies a bit different. The "
678
+ "default settings should fit mosts needs - but if you need to change the "
679
+ "mapping you are able to do it below."
680
+ msgstr ""
681
+
682
+ #: cookiebot.php:1098
683
+ msgid "Cookiebot categories"
684
+ msgstr "Cookiebot kategorier"
685
+
686
+ #: cookiebot.php:1099
687
+ msgid "WP Consent Level categories"
688
+ msgstr ""
689
+
690
+ #: cookiebot.php:1116
691
+ msgid "Necessary"
692
+ msgstr ""
693
+
694
+ #: cookiebot.php:1119 cookiebot.php:1141
695
+ msgid "Preferences"
696
+ msgstr "Præferencer"
697
+
698
+ #: cookiebot.php:1122 cookiebot.php:1149
699
+ msgid "Statistics"
700
+ msgstr "Statistikker"
701
+
702
+ #: cookiebot.php:1125 cookiebot.php:1165
703
+ msgid "Marketing"
704
+ msgstr "Markedsføring"
705
+
706
+ #: cookiebot.php:1133
707
+ msgid "Functional"
708
+ msgstr ""
709
+
710
+ #: cookiebot.php:1157
711
+ msgid "Statistics Anonymous"
712
+ msgstr "Statistikker Anonym"
713
+
714
+ #: cookiebot.php:1178
715
+ msgid "Reset to default mapping"
716
+ msgstr ""
717
+
718
+ #: cookiebot.php:1216
719
+ msgid "Cookiebot Network Settings"
720
+ msgstr "Cookiebot Network indstillinger"
721
+
722
+ #: cookiebot.php:1244
723
+ msgid ""
724
+ "The settings below is network wide settings. See notes below each field."
725
+ msgstr ""
726
+
727
+ #: cookiebot.php:1254
728
+ msgid "Network Cookiebot ID"
729
+ msgstr "Network Cookiebot ID"
730
+
731
+ #: cookiebot.php:1262
732
+ msgid ""
733
+ "If added this will be the default Cookiebot ID for all subsites. Subsites "
734
+ "are able to override the Cookiebot ID."
735
+ msgstr ""
736
+
737
+ #: cookiebot.php:1298
738
+ msgid "Should Cookiebot automatic block cookies by tagging known tags."
739
+ msgstr ""
740
+
741
+ #: cookiebot.php:1348 cookiebot.php:1389
742
+ msgid "Choose per subsite"
743
+ msgstr ""
744
+
745
+ #: cookiebot.php:1354 cookiebot.php:1395
746
+ msgid ""
747
+ "Setting will apply for all subsites. Subsites will not be able to override."
748
+ msgstr ""
749
+
750
+ #: cookiebot.php:1359 cookiebot.php:1400
751
+ msgid ""
752
+ "Add async or defer attribute to Cookiebot script tag. Default: Choose per "
753
+ "subsite"
754
+ msgstr ""
755
+
756
+ #: cookiebot.php:1437
757
+ msgid ""
758
+ "Remove the cookie consent banner from all subsites. This cannot be changed "
759
+ "by subsites. The <i>[cookie_declaration]</i> shortcode will still be "
760
+ "available."
761
+ msgstr ""
762
+
763
+ #: cookiebot.php:1451
764
  msgid ""
765
  "<a href=\"https://support.cookiebot.com/hc/en-us/articles/360003793854-"
766
  "Google-Tag-Manager-deployment\" target=\"_blank\">See a detailed guide here</"
767
  "a>"
768
  msgstr ""
769
 
770
+ #: cookiebot.php:1459
771
+ msgid "Hide Cookie Popup in WP Admin"
772
+ msgstr ""
773
 
774
+ #: cookiebot.php:1474
775
  msgid ""
776
+ "Remove the cookie consent banner the WordPress Admin area for all subsites. "
777
+ "This cannot be changed by subsites."
778
  msgstr ""
 
 
779
 
780
+ #: cookiebot.php:1529
781
+ msgid "How to find my Cookiebot ID"
782
+ msgstr "Hvordan finder jeg mit Cookiebot ID"
783
+
784
+ #: cookiebot.php:1536
785
+ #, php-format
786
+ msgid "Log in to your %1$sCookiebot account%2$s."
787
+ msgstr "Log på din %1$sCookiebot-konto%2$s."
788
+
789
+ #: cookiebot.php:1546
790
+ #, php-format
791
+ msgid "Go to %1$sManage%2$s > %3$sSettings%4$s and add setup your Cookiebot"
792
  msgstr ""
793
+ "Gå til %1$sAdministration%2$s > %3$sIndstillinger%4$s og opret din Cookiebot"
794
 
795
+ #: cookiebot.php:1558
796
+ #, php-format
797
+ msgid "Go to the %1$s\"Your scripts\"%2$s tab"
798
+ msgstr "Gå til %1$s”Dine scripts”%2$s fanen"
799
 
800
+ #: cookiebot.php:1564
801
  msgid ""
802
  "Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-"
803
  "ef1234567890"
805
  "Kopier værdien i data-cid parameteren - f.eks.: abcdef12-3456-7890-abcd-"
806
  "ef1234567890"
807
 
808
+ #: cookiebot.php:1569
809
+ #, php-format
810
  msgid ""
811
+ "Add %1$s[cookie_declaration]%2$s shortcode to a page to show the declation"
812
  msgstr ""
813
+ "Tilføj %1$s[cookie_declaration]%2$s shortcoden til siden hvor du ønsker at "
814
  "vise deklarationen"
815
 
816
+ #: cookiebot.php:1575
817
  msgid "Remember to change your scripts as descripted below"
818
  msgstr "Husk at opdatere dine scripts som beskrevet nedenfor"
819
 
820
+ #: cookiebot.php:1578
821
  msgid "Add the Cookie Declaration to your website"
822
  msgstr ""
823
 
824
+ #: cookiebot.php:1583
825
+ #, php-format
826
  msgid ""
827
+ "Use the shortcode %1$s[cookie_declaration]%2$s to add the cookie declaration "
828
  "a page or post. The cookie declaration will always show the latest version "
829
  "from Cookiebot."
830
  msgstr ""
831
 
832
+ #: cookiebot.php:1592
833
+ #, php-format
834
  msgid ""
835
  "If you need to force language of the cookie declaration, you can add the "
836
+ "%1$slang%2$s attribute. Eg. %3$s[cookie_declaration lang=\"de\"]%4$s."
837
  msgstr ""
838
 
839
+ #: cookiebot.php:1604 cookiebot.php:1635
840
  msgid "Watch video demonstration"
841
  msgstr ""
842
 
843
+ #: cookiebot.php:1610
844
  msgid "Update your script tags"
845
  msgstr "Opdater dine script tags"
846
 
847
+ #: cookiebot.php:1614
848
  msgid ""
849
  "To enable prior consent, apply the attribute \"data-cookieconsent\" to "
850
  "cookie-setting script tags on your website. Set the comma-separated value to "
855
  "script tag."
856
  msgstr ""
857
 
858
+ #: cookiebot.php:1642
859
  msgid "Helper function to update your scripts"
860
  msgstr "Hjælperfunktion til at opdatere dine scripts"
861
 
862
+ #: cookiebot.php:1646
863
  msgid ""
864
  "You are able to update your scripts yourself. However, Cookiebot also offers "
865
  "a small helper function that makes the work easier."
867
  "Du kan selv opdatere dine scripts, men Cookiebot tilbyder også en lille "
868
  "hjælperfunktion, der gør arbejdet lidt nemmere."
869
 
870
+ #: cookiebot.php:1651
871
  msgid "Update your script tags this way:"
872
  msgstr "Opdater dine script tags på denne måde:"
873
 
874
+ #: cookiebot.php:1655
875
+ #, php-format
876
+ msgid "%1$s to %2$s"
877
+ msgstr "%1$s til %2$s"
878
+
879
+ #: cookiebot.php:1681
880
+ msgid "Enable GTM"
881
+ msgstr ""
882
+
883
+ #: cookiebot.php:1688
884
+ msgid "For more details about Cookiebot and Google Tag Manager click"
885
+ msgstr ""
886
+
887
+ #: cookiebot.php:1693 cookiebot.php:1720
888
+ msgid "here"
889
+ msgstr ""
890
+
891
+ #: cookiebot.php:1696
892
+ msgid "GTM ID"
893
+ msgstr ""
894
+
895
+ #: cookiebot.php:1700
896
+ msgid "DataLayer name"
897
+ msgstr ""
898
+
899
+ #: cookiebot.php:1704
900
+ msgid "Optional, only change if necessary"
901
+ msgstr ""
902
+
903
+ #: cookiebot.php:1707
904
+ msgid "Google Consent Mode"
905
+ msgstr ""
906
+
907
+ #: cookiebot.php:1714
908
+ msgid "For more details about Cookiebot and Google Consent Mode click"
909
+ msgstr ""
910
+
911
+ #: cookiebot.php:1744
912
+ #, php-format
913
+ msgid ""
914
+ "For more details about Cookiebot's IAB integration, see %1$sarticle about "
915
+ "cookiebot and the IAB consent framework%2$s"
916
+ msgstr ""
917
+
918
+ #: cookiebot.php:1757
919
+ msgid "Enable IAB integration"
920
+ msgstr ""
921
+
922
+ #: cookiebot.php:1781
923
+ #, php-format
924
+ msgid ""
925
+ "For more details about Cookiebot's CCPA Legislation integration, see "
926
+ "%1$sarticle about cookiebot and the CCPA compliance%2$s"
927
+ msgstr ""
928
+
929
+ #: cookiebot.php:1798
930
+ msgid "Enable CCPA configuration for visitors from California"
931
+ msgstr ""
932
+
933
+ #: cookiebot.php:1804
934
+ msgid "Domain Group ID"
935
+ msgstr ""
936
+
937
+ #: cookiebot.php:1906
938
+ msgid "Debug information"
939
+ msgstr ""
940
+
941
+ #: cookiebot.php:1910
942
+ msgid ""
943
+ "The information below is for debugging purpose. If you have any issues with "
944
+ "your Cookiebot integration, the information below is usefull for a supporter "
945
+ "to help you the best way."
946
+ msgstr ""
947
 
948
+ #: cookiebot.php:1919
949
+ msgid "Copy debug information to clipboard"
950
+ msgstr ""
951
+
952
+ #: cookiebot.php:2135
953
  msgid "Please add your Cookiebot ID to show Cookie Declarations"
954
  msgstr "Tilføj dit Cookiebot ID for at vise Cookie deklarationen"
955
 
956
+ #: cookiebot.php:2391
957
+ msgid "Leave A Review?"
958
  msgstr ""
959
 
960
+ #: cookiebot.php:2395
961
+ msgid ""
962
+ "We hope you enjoy using WordPress Cookiebot! Would you consider leaving us a "
963
+ "review on WordPress.org?"
964
  msgstr ""
965
 
966
+ #: cookiebot.php:2406
967
+ msgid "Sure! I'd love to!"
 
 
 
968
  msgstr ""
969
 
970
+ #: cookiebot.php:2417
971
+ msgid "I've already left a review"
972
  msgstr ""
973
 
974
+ #: cookiebot.php:2428
975
+ msgid "Maybe Later"
976
  msgstr ""
977
 
978
+ #: cookiebot.php:2439
979
+ msgid "Never show again"
980
+ msgstr ""
981
 
982
+ #: widgets/cookiebot-declaration-widget.php:10
983
+ msgid "Cookiebot - Cookie Declaration"
984
+ msgstr "Cookiebot - Cookie erklæring"
985
 
986
+ #: widgets/cookiebot-declaration-widget.php:30
987
+ msgid "Title"
988
+ msgstr "Titel"
989
+
990
+ #: widgets/cookiebot-declaration-widget.php:38
991
+ msgid "- Default -"
992
+ msgstr ""
993
+
994
+ #~ msgid ""
995
+ #~ "Cookiebot enables your website to comply with current legislation in the "
996
+ #~ "EU on the use of cookies for user tracking and profiling. The EU ePrivacy "
997
+ #~ "Directive requires prior, informed consent of your site users, while the "
998
+ #~ "<a href=\"https://www.cookiebot.com/en/gdpr\" target=\"_blank\">General "
999
+ #~ "Data Protection Regulation (GDPR)</a> requires you to document each "
1000
+ #~ "consent. At the same time you must be able to account for what user data "
1001
+ #~ "you share with embedded third-party services on your website and where in "
1002
+ #~ "the world the user data is sent."
1003
+ #~ msgstr ""
1004
+ #~ "Med Cookiebot kan din hjemmeside overholde gældende lovgivning i EU ift. "
1005
+ #~ "brugen af cookies til sporing og profilering af dine brugere. EU's "
1006
+ #~ "ePrivacy-direktiv kræver forudgående, informeret samtykke fra dine "
1007
+ #~ "hjemmeside-brugere, mens persondata-forordingen (GDPR) kræver, at du kan "
1008
+ #~ "dokumentere hvert enkelt samtykke. Samtidig skal du kunne redegøre for "
1009
+ #~ "hvilke bruger-data, du deler med de indlejrede tredjeparts-tjenester på "
1010
+ #~ "din hjemmeside, og hvor i Verden brugernes data sendes hen."
1011
+
1012
+ #~ msgid ""
1013
+ #~ "Log in to your <a href=\"https://www.cookiebot.com/en/account\" target="
1014
+ #~ "\"_blank\">Cookiebot account</a>."
1015
+ #~ msgstr ""
1016
+ #~ "Log ind på din <a href=\"https://www.cookiebit.com/da/account\" target="
1017
+ #~ "\"blank\">Cookiebot konto</a>."
langs/cookiebot.pot CHANGED
@@ -1,438 +1,808 @@
1
- # Copyright (C) 2018 Cookiebot | GDPR Compliant Cookie Consent and Notice
2
- # This file is distributed under the same license as the Cookiebot | GDPR Compliant Cookie Consent and Notice package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Cookiebot | GDPR Compliant Cookie Consent and Notice "
6
- "1.6.0\n"
7
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cookiebot\n"
8
- "POT-Creation-Date: 2018-05-30 16:47:20+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- #: cookiebot.php:85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  msgid "Cookiebot Status"
18
  msgstr ""
19
 
20
- #: cookiebot.php:97
21
  msgid "You need to enter your Cookiebot ID."
22
  msgstr ""
23
 
24
- #: cookiebot.php:99
25
  msgid "Update your Cookiebot ID"
26
  msgstr ""
27
 
28
- #: cookiebot.php:103
29
  msgid "Your Cookiebot is working!"
30
  msgstr ""
31
 
32
- #: cookiebot.php:114
 
33
  msgid "Cookiebot"
34
  msgstr ""
35
 
36
- #: cookiebot.php:170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  msgid "Norwegian Bokmål"
38
  msgstr ""
39
 
40
- #: cookiebot.php:171
41
  msgid "Turkish"
42
  msgstr ""
43
 
44
- #: cookiebot.php:172
45
  msgid "German"
46
  msgstr ""
47
 
48
- #: cookiebot.php:173
49
  msgid "Czech"
50
  msgstr ""
51
 
52
- #: cookiebot.php:174
53
  msgid "Danish"
54
  msgstr ""
55
 
56
- #: cookiebot.php:175
57
  msgid "Albanian"
58
  msgstr ""
59
 
60
- #: cookiebot.php:176
61
  msgid "Hebrew"
62
  msgstr ""
63
 
64
- #: cookiebot.php:177
65
  msgid "Korean"
66
  msgstr ""
67
 
68
- #: cookiebot.php:178
69
  msgid "Italian"
70
  msgstr ""
71
 
72
- #: cookiebot.php:179
73
  msgid "Dutch"
74
  msgstr ""
75
 
76
- #: cookiebot.php:180
77
  msgid "Vietnamese"
78
  msgstr ""
79
 
80
- #: cookiebot.php:181
81
  msgid "Tamil"
82
  msgstr ""
83
 
84
- #: cookiebot.php:182
85
  msgid "Icelandic"
86
  msgstr ""
87
 
88
- #: cookiebot.php:183
89
  msgid "Romanian"
90
  msgstr ""
91
 
92
- #: cookiebot.php:184
93
  msgid "Sinhala"
94
  msgstr ""
95
 
96
- #: cookiebot.php:185
97
  msgid "Catalan"
98
  msgstr ""
99
 
100
- #: cookiebot.php:186
101
  msgid "Bulgarian"
102
  msgstr ""
103
 
104
- #: cookiebot.php:187
105
  msgid "Ukrainian"
106
  msgstr ""
107
 
108
- #: cookiebot.php:188
109
  msgid "Chinese"
110
  msgstr ""
111
 
112
- #: cookiebot.php:189
113
  msgid "English"
114
  msgstr ""
115
 
116
- #: cookiebot.php:190
117
  msgid "Arabic"
118
  msgstr ""
119
 
120
- #: cookiebot.php:191
121
  msgid "Croatian"
122
  msgstr ""
123
 
124
- #: cookiebot.php:192
125
  msgid "Thai"
126
  msgstr ""
127
 
128
- #: cookiebot.php:193
129
  msgid "Greek"
130
  msgstr ""
131
 
132
- #: cookiebot.php:194
133
  msgid "Lithuanian"
134
  msgstr ""
135
 
136
- #: cookiebot.php:195
137
  msgid "Polish"
138
  msgstr ""
139
 
140
- #: cookiebot.php:196
141
  msgid "Latvian"
142
  msgstr ""
143
 
144
- #: cookiebot.php:197
145
  msgid "French"
146
  msgstr ""
147
 
148
- #: cookiebot.php:198
149
  msgid "Indonesian"
150
  msgstr ""
151
 
152
- #: cookiebot.php:199
153
  msgid "Macedonian"
154
  msgstr ""
155
 
156
- #: cookiebot.php:200
157
  msgid "Estonian"
158
  msgstr ""
159
 
160
- #: cookiebot.php:201
161
  msgid "Portuguese"
162
  msgstr ""
163
 
164
- #: cookiebot.php:202
165
  msgid "Irish"
166
  msgstr ""
167
 
168
- #: cookiebot.php:203
169
  msgid "Malay"
170
  msgstr ""
171
 
172
- #: cookiebot.php:204
173
  msgid "Slovenian"
174
  msgstr ""
175
 
176
- #: cookiebot.php:205
177
  msgid "Russian"
178
  msgstr ""
179
 
180
- #: cookiebot.php:206
181
  msgid "Japanese"
182
  msgstr ""
183
 
184
- #: cookiebot.php:207
185
  msgid "Hindi"
186
  msgstr ""
187
 
188
- #: cookiebot.php:208
189
  msgid "Slovak"
190
  msgstr ""
191
 
192
- #: cookiebot.php:209
193
  msgid "Spanish"
194
  msgstr ""
195
 
196
- #: cookiebot.php:210
197
  msgid "Swedish"
198
  msgstr ""
199
 
200
- #: cookiebot.php:211
201
  msgid "Serbian"
202
  msgstr ""
203
 
204
- #: cookiebot.php:212
205
  msgid "Finnish"
206
  msgstr ""
207
 
208
- #: cookiebot.php:226
209
- msgid "Cookiebot Settings"
210
  msgstr ""
211
 
212
- #: cookiebot.php:231
213
- msgid ""
214
- "Cookiebot enables your website to comply with current legislation in the EU "
215
- "on the use of cookies for user tracking and profiling. The EU ePrivacy "
216
- "Directive requires prior, informed consent of your site users, while the <a "
217
- "href=\"https://www.cookiebot.com/en/gdpr\" target=\"_blank\">General Data "
218
- "Protection Regulation (GDPR)</a> requires you to document each consent. At "
219
- "the same time you must be able to account for what user data you share with "
220
- "embedded third-party services on your website and where in the world the "
221
- "user data is sent."
222
  msgstr ""
223
 
224
- #: cookiebot.php:238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  msgid "Cookiebot ID"
226
  msgstr ""
227
 
228
- #: cookiebot.php:242
 
229
  msgid "Need an ID?"
230
  msgstr ""
231
 
232
- #: cookiebot.php:243
 
233
  msgid "Sign up for free on cookiebot.com"
234
  msgstr ""
235
 
236
- #: cookiebot.php:248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  msgid "Cookiebot Language"
238
  msgstr ""
239
 
240
- #: cookiebot.php:254
241
  msgid "Default (Autodetect)"
242
  msgstr ""
243
 
244
- #: cookiebot.php:255
245
- msgid "Use Wordpress Language"
246
  msgstr ""
247
 
248
- #: cookiebot.php:265
249
  msgid "You need to add the language in the Cookiebot administration tool."
250
  msgstr ""
251
 
252
- #: cookiebot.php:268
253
- msgid ""
254
- "You need to add all languages that you want auto-detected in the Cookiebot "
255
- "administration tool."
256
  msgstr ""
257
 
258
- #: cookiebot.php:269
259
- msgid ""
260
- "The auto-detect checkbox needs to be enabled in the Cookiebot administration "
261
- "tool."
262
  msgstr ""
263
 
264
- #: cookiebot.php:270
265
- msgid ""
266
- "If the auto-detected language is not supported, Cookiebot will use the "
267
- "default language."
268
  msgstr ""
269
 
270
- #: cookiebot.php:274
271
- msgid "Read more here"
272
  msgstr ""
273
 
274
- #: cookiebot.php:277
275
- msgid "Show guide to add languages"
276
  msgstr ""
277
 
278
- #: cookiebot.php:282
279
  msgid "Hide guide"
280
  msgstr ""
281
 
282
- #: cookiebot.php:313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  msgid "Auto-update Cookiebot"
284
  msgstr ""
285
 
286
- #: cookiebot.php:317
287
- msgid ""
288
- "Automatic update your Cookiebot plugin when new releases becomes available."
289
  msgstr ""
290
 
291
- #: cookiebot.php:322
 
292
  msgid "Hide Cookie Popup"
293
  msgstr ""
294
 
295
- #: cookiebot.php:326
296
- msgid ""
297
- "This checkbox will remove the cookie consent banner from your website. The "
298
- "<i>[cookie_declaration]</i> shortcode will still be available."
299
  msgstr ""
300
 
301
- #: cookiebot.php:327
302
- msgid ""
303
- "If you are using Google Tag Manager (or equal), you need to add the "
304
- "Cookiebot script in your Tag Manager."
305
  msgstr ""
306
 
307
- #: cookiebot.php:328
308
- msgid ""
309
- "<a href=\"https://support.cookiebot.com/hc/en-us/articles/360003793854-"
310
- "Google-Tag-Manager-deployment\" target=\"_blank\">See a detailed guide here</"
311
- "a>"
312
  msgstr ""
313
 
314
- #: cookiebot.php:335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  msgid "How to find my Cookiebot ID"
316
  msgstr ""
317
 
318
- #: cookiebot.php:338
319
- msgid ""
320
- "Log in to your <a href=\"https://www.cookiebot.com/en/account\" target="
321
- "\"_blank\">Cookiebot account</a>."
322
  msgstr ""
323
 
324
- #: cookiebot.php:339
325
- msgid "Go to <b>Manage</b> > <b>Settings</b> and add setup your Cookiebot"
 
326
  msgstr ""
327
 
328
- #: cookiebot.php:340
329
- msgid "Go to the <b>\"Your scripts\"</b> tab"
 
330
  msgstr ""
331
 
332
- #: cookiebot.php:341
333
- msgid ""
334
- "Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-"
335
- "ef1234567890"
336
  msgstr ""
337
 
338
- #: cookiebot.php:342
339
- msgid ""
340
- "Add <b>[cookie_declaration]</b> shortcode to a page to show the declation"
341
  msgstr ""
342
 
343
- #: cookiebot.php:343
344
  msgid "Remember to change your scripts as descripted below"
345
  msgstr ""
346
 
347
- #: cookiebot.php:346
348
  msgid "Add the Cookie Declaration to your website"
349
  msgstr ""
350
 
351
- #: cookiebot.php:348
352
- msgid ""
353
- "Use the shortcode <b>[cookie_declaration]</b> to add the cookie declaration "
354
- "a page or post. The cookie declaration will always show the latest version "
355
- "from Cookiebot."
356
  msgstr ""
357
 
358
- #: cookiebot.php:350
359
- msgid ""
360
- "If you need to force language of the cookie declaration, you can add the "
361
- "<i>lang</i> attribute. Eg. <b>[cookie_declaration lang=\"de\"]</b>."
362
  msgstr ""
363
 
364
- #: cookiebot.php:353 cookiebot.php:369
 
365
  msgid "Watch video demonstration"
366
  msgstr ""
367
 
368
- #: cookiebot.php:355
369
  msgid "Update your script tags"
370
  msgstr ""
371
 
372
- #: cookiebot.php:357
373
- msgid ""
374
- "To enable prior consent, apply the attribute \"data-cookieconsent\" to "
375
- "cookie-setting script tags on your website. Set the comma-separated value to "
376
- "one or more of the cookie categories \"preferences\", \"statistics\" and "
377
- "\"marketing\" in accordance with the types of cookies being set by each "
378
- "script. Finally change the attribute \"type\" from \"text/javascript\" to "
379
- "\"text/plain\". Example on modifying an existing Google Analytics Universal "
380
- "script tag."
381
  msgstr ""
382
 
383
- #: cookiebot.php:372
384
  msgid "Helper function to update your scripts"
385
  msgstr ""
386
 
387
- #: cookiebot.php:374
388
- msgid ""
389
- "You are able to update your scripts yourself. However, Cookiebot also offers "
390
- "a small helper function that makes the work easier."
391
  msgstr ""
392
 
393
- #: cookiebot.php:376
394
  msgid "Update your script tags this way:"
395
  msgstr ""
396
 
397
- #: cookiebot.php:380
398
- msgid "%s to %s"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  msgstr ""
400
 
401
- #: cookiebot.php:431
 
 
 
 
402
  msgid "Please add your Cookiebot ID to show Cookie Declarations"
403
  msgstr ""
404
 
405
- #. Plugin Name of the plugin/theme
406
- msgid "Cookiebot | GDPR Compliant Cookie Consent and Notice"
407
  msgstr ""
408
 
409
- #. Plugin URI of the plugin/theme
410
- msgid "https://cookiebot.com/"
411
  msgstr ""
412
 
413
- #. Description of the plugin/theme
414
- msgid ""
415
- "Cookiebot is a fully GDPR & ePrivacy compliant cookie consent solution "
416
- "supporting prior consent, cookie declaration, and documentation of consents. "
417
- "Easy to install, implement and configure."
418
  msgstr ""
419
 
420
- #. Author of the plugin/theme
421
- msgid "Cybot A/S"
422
  msgstr ""
423
 
424
- #. Author URI of the plugin/theme
425
- msgid "http://cookiebot.com"
426
  msgstr ""
427
 
428
- #: Preferences
429
- msgid "preferences"
430
  msgstr ""
431
 
432
- #: Statistics
433
- msgid "statistics"
434
  msgstr ""
435
 
436
- #: Marketing
437
- msgid "marketing"
 
 
 
 
438
  msgstr ""
1
+ # Copyright (C) 2021 Cybot A/S
2
+ # This file is distributed under the same license as the Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control 3.11.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/CookiebotWP\n"
7
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
+ "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-09-22T09:27:51+00:00\n"
13
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.5.0\n"
15
+ "X-Domain: cookiebot\n"
16
+
17
+ #. Plugin Name of the plugin
18
+ msgid "Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control"
19
+ msgstr ""
20
+
21
+ #. Plugin URI of the plugin
22
+ msgid "https://cookiebot.com/"
23
+ msgstr ""
24
+
25
+ #. Description of the plugin
26
+ msgid "Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites."
27
+ msgstr ""
28
+
29
+ #. Author of the plugin
30
+ msgid "Cybot A/S"
31
+ msgstr ""
32
+
33
+ #. Author URI of the plugin
34
+ msgid "http://cookiebot.com"
35
+ msgstr ""
36
+
37
+ #: addons/config/settings-config.php:51
38
+ #: cookiebot.php:363
39
+ #: cookiebot.php:364
40
+ msgid "Prior Consent"
41
+ msgstr ""
42
+
43
+ #: addons/config/settings-config.php:226
44
+ msgid "Jetpack settings."
45
+ msgstr ""
46
+
47
+ #: addons/config/settings-config.php:248
48
+ msgid "Below is a list of addons for Cookiebot. Addons help you make installed plugins GDPR compliant."
49
+ msgstr ""
50
+
51
+ #: addons/config/settings-config.php:250
52
+ msgid "These addons are available because you have the corresponding plugins installed and activated."
53
+ msgstr ""
54
+
55
+ #: addons/config/settings-config.php:252
56
+ msgid "Deactivate an addon if you want to handle GDPR compliance yourself, or through another plugin."
57
+ msgstr ""
58
+
59
+ #: addons/config/settings-config.php:276
60
+ msgid "The following addons are unavailable. This is because the corresponding plugin is not installed."
61
+ msgstr ""
62
+
63
+ #: addons/config/settings-config.php:293
64
+ msgid "The plugin is not installed."
65
+ msgstr ""
66
+
67
+ #: addons/config/settings-config.php:295
68
+ msgid "The plugin is not activated."
69
+ msgstr ""
70
+
71
+ #: addons/lib/helper.php:246
72
+ #: addons/lib/helper.php:325
73
+ msgid "marketing"
74
+ msgstr ""
75
+
76
+ #: addons/lib/helper.php:248
77
+ #: addons/lib/helper.php:324
78
+ msgid "statistics"
79
+ msgstr ""
80
+
81
+ #: addons/lib/helper.php:250
82
+ #: addons/lib/helper.php:323
83
+ msgid "preferences"
84
+ msgstr ""
85
 
86
+ #: addons/lib/helper.php:252
87
+ msgid "necessary"
88
+ msgstr ""
89
+
90
+ #: addons/view/admin/settings/available-addon-callback.php:19
91
+ #: addons/view/admin/settings/jetpack-addon-callback.php:14
92
+ msgid "Check one or multiple cookie types:"
93
+ msgstr ""
94
+
95
+ #: addons/view/admin/settings/jetpack-addon-callback.php:8
96
+ msgid "Enable"
97
+ msgstr ""
98
+
99
+ #: addons/view/admin/settings/jetpack-addon-callback.php:35
100
+ msgid "Display a placeholder"
101
+ msgstr ""
102
+
103
+ #: addons/view/admin/settings/setting-page.php:5
104
+ msgid "Prior consent"
105
+ msgstr ""
106
+
107
+ #: cookiebot.php:145
108
+ msgid "You are using Cookiebot Addons Standalone."
109
+ msgstr ""
110
+
111
+ #: cookiebot.php:291
112
  msgid "Cookiebot Status"
113
  msgstr ""
114
 
115
+ #: cookiebot.php:303
116
  msgid "You need to enter your Cookiebot ID."
117
  msgstr ""
118
 
119
+ #: cookiebot.php:305
120
  msgid "Update your Cookiebot ID"
121
  msgstr ""
122
 
123
+ #: cookiebot.php:308
124
  msgid "Your Cookiebot is working!"
125
  msgstr ""
126
 
127
+ #: cookiebot.php:321
128
+ #: cookiebot.php:412
129
  msgid "Cookiebot"
130
  msgstr ""
131
 
132
+ #: cookiebot.php:325
133
+ #: cookiebot.php:421
134
+ #: cookiebot.php:588
135
+ msgid "Cookiebot Settings"
136
+ msgstr ""
137
+
138
+ #: cookiebot.php:326
139
+ #: cookiebot.php:422
140
+ msgid "Settings"
141
+ msgstr ""
142
+
143
+ #: cookiebot.php:334
144
+ #: cookiebot.php:429
145
+ msgid "Cookiebot Support"
146
+ msgstr ""
147
+
148
+ #: cookiebot.php:335
149
+ #: cookiebot.php:430
150
+ #: cookiebot.php:1528
151
+ msgid "Support"
152
+ msgstr ""
153
+
154
+ #: cookiebot.php:343
155
+ #: cookiebot.php:344
156
+ #: cookiebot.php:1674
157
+ msgid "Google Tag Manager"
158
+ msgstr ""
159
+
160
+ #: cookiebot.php:351
161
+ #: cookiebot.php:352
162
+ #: cookiebot.php:1738
163
+ msgid "IAB"
164
+ msgstr ""
165
+
166
+ #: cookiebot.php:376
167
+ #: cookiebot.php:377
168
+ #: cookiebot.php:1775
169
+ msgid "Legislations"
170
+ msgstr ""
171
+
172
+ #: cookiebot.php:394
173
+ #: cookiebot.php:395
174
+ msgid "Debug info"
175
+ msgstr ""
176
+
177
+ #: cookiebot.php:519
178
  msgid "Norwegian Bokmål"
179
  msgstr ""
180
 
181
+ #: cookiebot.php:520
182
  msgid "Turkish"
183
  msgstr ""
184
 
185
+ #: cookiebot.php:521
186
  msgid "German"
187
  msgstr ""
188
 
189
+ #: cookiebot.php:522
190
  msgid "Czech"
191
  msgstr ""
192
 
193
+ #: cookiebot.php:523
194
  msgid "Danish"
195
  msgstr ""
196
 
197
+ #: cookiebot.php:524
198
  msgid "Albanian"
199
  msgstr ""
200
 
201
+ #: cookiebot.php:525
202
  msgid "Hebrew"
203
  msgstr ""
204
 
205
+ #: cookiebot.php:526
206
  msgid "Korean"
207
  msgstr ""
208
 
209
+ #: cookiebot.php:527
210
  msgid "Italian"
211
  msgstr ""
212
 
213
+ #: cookiebot.php:528
214
  msgid "Dutch"
215
  msgstr ""
216
 
217
+ #: cookiebot.php:529
218
  msgid "Vietnamese"
219
  msgstr ""
220
 
221
+ #: cookiebot.php:530
222
  msgid "Tamil"
223
  msgstr ""
224
 
225
+ #: cookiebot.php:531
226
  msgid "Icelandic"
227
  msgstr ""
228
 
229
+ #: cookiebot.php:532
230
  msgid "Romanian"
231
  msgstr ""
232
 
233
+ #: cookiebot.php:533
234
  msgid "Sinhala"
235
  msgstr ""
236
 
237
+ #: cookiebot.php:534
238
  msgid "Catalan"
239
  msgstr ""
240
 
241
+ #: cookiebot.php:535
242
  msgid "Bulgarian"
243
  msgstr ""
244
 
245
+ #: cookiebot.php:536
246
  msgid "Ukrainian"
247
  msgstr ""
248
 
249
+ #: cookiebot.php:537
250
  msgid "Chinese"
251
  msgstr ""
252
 
253
+ #: cookiebot.php:538
254
  msgid "English"
255
  msgstr ""
256
 
257
+ #: cookiebot.php:539
258
  msgid "Arabic"
259
  msgstr ""
260
 
261
+ #: cookiebot.php:540
262
  msgid "Croatian"
263
  msgstr ""
264
 
265
+ #: cookiebot.php:541
266
  msgid "Thai"
267
  msgstr ""
268
 
269
+ #: cookiebot.php:542
270
  msgid "Greek"
271
  msgstr ""
272
 
273
+ #: cookiebot.php:543
274
  msgid "Lithuanian"
275
  msgstr ""
276
 
277
+ #: cookiebot.php:544
278
  msgid "Polish"
279
  msgstr ""
280
 
281
+ #: cookiebot.php:545
282
  msgid "Latvian"
283
  msgstr ""
284
 
285
+ #: cookiebot.php:546
286
  msgid "French"
287
  msgstr ""
288
 
289
+ #: cookiebot.php:547
290
  msgid "Indonesian"
291
  msgstr ""
292
 
293
+ #: cookiebot.php:548
294
  msgid "Macedonian"
295
  msgstr ""
296
 
297
+ #: cookiebot.php:549
298
  msgid "Estonian"
299
  msgstr ""
300
 
301
+ #: cookiebot.php:550
302
  msgid "Portuguese"
303
  msgstr ""
304
 
305
+ #: cookiebot.php:551
306
  msgid "Irish"
307
  msgstr ""
308
 
309
+ #: cookiebot.php:552
310
  msgid "Malay"
311
  msgstr ""
312
 
313
+ #: cookiebot.php:553
314
  msgid "Slovenian"
315
  msgstr ""
316
 
317
+ #: cookiebot.php:554
318
  msgid "Russian"
319
  msgstr ""
320
 
321
+ #: cookiebot.php:555
322
  msgid "Japanese"
323
  msgstr ""
324
 
325
+ #: cookiebot.php:556
326
  msgid "Hindi"
327
  msgstr ""
328
 
329
+ #: cookiebot.php:557
330
  msgid "Slovak"
331
  msgstr ""
332
 
333
+ #: cookiebot.php:558
334
  msgid "Spanish"
335
  msgstr ""
336
 
337
+ #: cookiebot.php:559
338
  msgid "Swedish"
339
  msgstr ""
340
 
341
+ #: cookiebot.php:560
342
  msgid "Serbian"
343
  msgstr ""
344
 
345
+ #: cookiebot.php:561
346
  msgid "Finnish"
347
  msgstr ""
348
 
349
+ #: cookiebot.php:562
350
+ msgid "Basque"
351
  msgstr ""
352
 
353
+ #: cookiebot.php:563
354
+ msgid "Hungarian"
 
 
 
 
 
 
 
 
355
  msgstr ""
356
 
357
+ #: cookiebot.php:596
358
+ #: cookiebot.php:1224
359
+ msgid "Cookiebot enables your website to comply with current legislation in the EU on the use of cookies for user tracking and profiling. The EU ePrivacy Directive requires prior, informed consent of your site users, while the %1$s %2$s."
360
+ msgstr ""
361
+
362
+ #: cookiebot.php:603
363
+ #: cookiebot.php:1231
364
+ msgid "General Data Protection Regulation (GDPR)"
365
+ msgstr ""
366
+
367
+ #: cookiebot.php:605
368
+ #: cookiebot.php:1233
369
+ msgid " requires you to document each consent. At the same time you must be able to account for what user data you share with embedded third-party services on your website and where in the world the user data is sent."
370
+ msgstr ""
371
+
372
+ #: cookiebot.php:617
373
  msgid "Cookiebot ID"
374
  msgstr ""
375
 
376
+ #: cookiebot.php:629
377
+ #: cookiebot.php:1268
378
  msgid "Need an ID?"
379
  msgstr ""
380
 
381
+ #: cookiebot.php:632
382
+ #: cookiebot.php:1271
383
  msgid "Sign up for free on cookiebot.com"
384
  msgstr ""
385
 
386
+ #: cookiebot.php:643
387
+ #: cookiebot.php:1282
388
+ msgid "Cookie-blocking mode"
389
+ msgstr ""
390
+
391
+ #: cookiebot.php:654
392
+ #: cookiebot.php:1290
393
+ msgid "Automatic"
394
+ msgstr ""
395
+
396
+ #: cookiebot.php:659
397
+ #: cookiebot.php:1295
398
+ msgid "Manual"
399
+ msgstr ""
400
+
401
+ #: cookiebot.php:662
402
+ msgid "Automatic block cookies (except necessary) until the user has given their consent."
403
+ msgstr ""
404
+
405
+ #: cookiebot.php:665
406
+ msgid "Learn more"
407
+ msgstr ""
408
+
409
+ #: cookiebot.php:691
410
  msgid "Cookiebot Language"
411
  msgstr ""
412
 
413
+ #: cookiebot.php:698
414
  msgid "Default (Autodetect)"
415
  msgstr ""
416
 
417
+ #: cookiebot.php:701
418
+ msgid "Use WordPress Language"
419
  msgstr ""
420
 
421
+ #: cookiebot.php:721
422
  msgid "You need to add the language in the Cookiebot administration tool."
423
  msgstr ""
424
 
425
+ #: cookiebot.php:725
426
+ msgid "You need to add all languages that you want auto-detected in the Cookiebot administration tool."
 
 
427
  msgstr ""
428
 
429
+ #: cookiebot.php:732
430
+ msgid "The auto-detect checkbox needs to be enabled in the Cookiebot administration tool."
 
 
431
  msgstr ""
432
 
433
+ #: cookiebot.php:739
434
+ msgid "If the auto-detected language is not supported, Cookiebot will use the default language."
 
 
435
  msgstr ""
436
 
437
+ #: cookiebot.php:747
438
+ msgid "Show guide to add languages"
439
  msgstr ""
440
 
441
+ #: cookiebot.php:751
442
+ msgid "Read more here"
443
  msgstr ""
444
 
445
+ #: cookiebot.php:758
446
  msgid "Hide guide"
447
  msgstr ""
448
 
449
+ #: cookiebot.php:814
450
+ msgid "Advanced settings"
451
+ msgstr ""
452
+
453
+ #: cookiebot.php:819
454
+ #: cookiebot.php:863
455
+ #: cookiebot.php:1324
456
+ #: cookiebot.php:1365
457
+ msgid "Add async or defer attribute"
458
+ msgstr ""
459
+
460
+ #: cookiebot.php:820
461
+ #: cookiebot.php:1325
462
+ msgid "Consent banner script tag"
463
+ msgstr ""
464
+
465
+ #: cookiebot.php:834
466
+ #: cookiebot.php:878
467
+ #: cookiebot.php:1333
468
+ #: cookiebot.php:1374
469
+ msgid "None"
470
+ msgstr ""
471
+
472
+ #: cookiebot.php:851
473
+ #: cookiebot.php:895
474
+ #: cookiebot.php:953
475
+ msgid "Network setting applied. Please contact website administrator to change this setting."
476
+ msgstr ""
477
+
478
+ #: cookiebot.php:857
479
+ #: cookiebot.php:901
480
+ msgid "Add async or defer attribute to Cookiebot script tag. Default: async"
481
+ msgstr ""
482
+
483
+ #: cookiebot.php:864
484
+ #: cookiebot.php:1366
485
+ msgid "Cookie declaration script tag"
486
+ msgstr ""
487
+
488
+ #: cookiebot.php:909
489
+ #: cookiebot.php:1405
490
  msgid "Auto-update Cookiebot"
491
  msgstr ""
492
 
493
+ #: cookiebot.php:921
494
+ #: cookiebot.php:1417
495
+ msgid "Automatic update your Cookiebot plugin when new releases becomes available."
496
  msgstr ""
497
 
498
+ #: cookiebot.php:929
499
+ #: cookiebot.php:1422
500
  msgid "Hide Cookie Popup"
501
  msgstr ""
502
 
503
+ #: cookiebot.php:961
504
+ msgid "This checkbox will remove the cookie consent banner from your website. The <i>[cookie_declaration]</i> shortcode will still be available."
 
 
505
  msgstr ""
506
 
507
+ #: cookiebot.php:968
508
+ #: cookiebot.php:1443
509
+ msgid "If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager."
 
510
  msgstr ""
511
 
512
+ #: cookiebot.php:975
513
+ msgid "See a detailed guide here"
 
 
 
514
  msgstr ""
515
 
516
+ #: cookiebot.php:981
517
+ msgid "Disable Cookiebot in WP Admin"
518
+ msgstr ""
519
+
520
+ #: cookiebot.php:1008
521
+ msgid "This checkbox will disable Cookiebot in the WordPress Admin area."
522
+ msgstr ""
523
+
524
+ #: cookiebot.php:1013
525
+ msgid "Enable Cookiebot on front end while logged in"
526
+ msgstr ""
527
+
528
+ #: cookiebot.php:1040
529
+ msgid "This checkbox will enable Cookiebot on front end while you're logged in"
530
+ msgstr ""
531
+
532
+ #: cookiebot.php:1049
533
+ msgid "Consent Level API Settings"
534
+ msgstr ""
535
+
536
+ #: cookiebot.php:1058
537
+ msgid "WP Consent Level API and Cookiebot categorise cookies a bit different. The default settings should fit mosts needs - but if you need to change the mapping you are able to do it below."
538
+ msgstr ""
539
+
540
+ #: cookiebot.php:1098
541
+ msgid "Cookiebot categories"
542
+ msgstr ""
543
+
544
+ #: cookiebot.php:1099
545
+ msgid "WP Consent Level categories"
546
+ msgstr ""
547
+
548
+ #: cookiebot.php:1116
549
+ msgid "Necessary"
550
+ msgstr ""
551
+
552
+ #: cookiebot.php:1119
553
+ #: cookiebot.php:1141
554
+ msgid "Preferences"
555
+ msgstr ""
556
+
557
+ #: cookiebot.php:1122
558
+ #: cookiebot.php:1149
559
+ msgid "Statistics"
560
+ msgstr ""
561
+
562
+ #: cookiebot.php:1125
563
+ #: cookiebot.php:1165
564
+ msgid "Marketing"
565
+ msgstr ""
566
+
567
+ #: cookiebot.php:1133
568
+ msgid "Functional"
569
+ msgstr ""
570
+
571
+ #: cookiebot.php:1157
572
+ msgid "Statistics Anonymous"
573
+ msgstr ""
574
+
575
+ #: cookiebot.php:1177
576
+ msgid "Reset to default mapping"
577
+ msgstr ""
578
+
579
+ #: cookiebot.php:1216
580
+ msgid "Cookiebot Network Settings"
581
+ msgstr ""
582
+
583
+ #: cookiebot.php:1243
584
+ msgid "The settings below is network wide settings. See notes below each field."
585
+ msgstr ""
586
+
587
+ #: cookiebot.php:1254
588
+ msgid "Network Cookiebot ID"
589
+ msgstr ""
590
+
591
+ #: cookiebot.php:1261
592
+ msgid "If added this will be the default Cookiebot ID for all subsites. Subsites are able to override the Cookiebot ID."
593
+ msgstr ""
594
+
595
+ #: cookiebot.php:1298
596
+ msgid "Should Cookiebot automatic block cookies by tagging known tags."
597
+ msgstr ""
598
+
599
+ #: cookiebot.php:1348
600
+ #: cookiebot.php:1389
601
+ msgid "Choose per subsite"
602
+ msgstr ""
603
+
604
+ #: cookiebot.php:1353
605
+ #: cookiebot.php:1394
606
+ msgid "Setting will apply for all subsites. Subsites will not be able to override."
607
+ msgstr ""
608
+
609
+ #: cookiebot.php:1359
610
+ #: cookiebot.php:1400
611
+ msgid "Add async or defer attribute to Cookiebot script tag. Default: Choose per subsite"
612
+ msgstr ""
613
+
614
+ #: cookiebot.php:1436
615
+ msgid "Remove the cookie consent banner from all subsites. This cannot be changed by subsites. The <i>[cookie_declaration]</i> shortcode will still be available."
616
+ msgstr ""
617
+
618
+ #: cookiebot.php:1450
619
+ msgid "<a href=\"https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment\" target=\"_blank\">See a detailed guide here</a>"
620
+ msgstr ""
621
+
622
+ #: cookiebot.php:1459
623
+ msgid "Hide Cookie Popup in WP Admin"
624
+ msgstr ""
625
+
626
+ #: cookiebot.php:1473
627
+ msgid "Remove the cookie consent banner the WordPress Admin area for all subsites. This cannot be changed by subsites."
628
+ msgstr ""
629
+
630
+ #: cookiebot.php:1529
631
  msgid "How to find my Cookiebot ID"
632
  msgstr ""
633
 
634
+ #. translators: the first placeholder string will be replaced with a html anchor open tag and the second placeholder string will be replaced by the html anchor closing tag
635
+ #: cookiebot.php:1536
636
+ msgid "Log in to your %1$sCookiebot account%2$s."
 
637
  msgstr ""
638
 
639
+ #. translators: the placeholder strings denote the positions of <b>, </b>, <b> and </b> HTML tags
640
+ #: cookiebot.php:1546
641
+ msgid "Go to %1$sManage%2$s > %3$sSettings%4$s and add setup your Cookiebot"
642
  msgstr ""
643
 
644
+ #. translators: the placeholder strings denote the positions of <b> and </b> HTML tags
645
+ #: cookiebot.php:1558
646
+ msgid "Go to the %1$s\"Your scripts\"%2$s tab"
647
  msgstr ""
648
 
649
+ #: cookiebot.php:1564
650
+ msgid "Copy the value inside the data-cid parameter - eg.: abcdef12-3456-7890-abcd-ef1234567890"
 
 
651
  msgstr ""
652
 
653
+ #. translators: the placeholder strings denote the positions of <b> and </b> HTML tags
654
+ #: cookiebot.php:1569
655
+ msgid "Add %1$s[cookie_declaration]%2$s shortcode to a page to show the declation"
656
  msgstr ""
657
 
658
+ #: cookiebot.php:1575
659
  msgid "Remember to change your scripts as descripted below"
660
  msgstr ""
661
 
662
+ #: cookiebot.php:1578
663
  msgid "Add the Cookie Declaration to your website"
664
  msgstr ""
665
 
666
+ #. translators: the placeholder strings denote the positions of <b> and </b> HTML tags
667
+ #: cookiebot.php:1583
668
+ msgid "Use the shortcode %1$s[cookie_declaration]%2$s to add the cookie declaration a page or post. The cookie declaration will always show the latest version from Cookiebot."
 
 
669
  msgstr ""
670
 
671
+ #. translators: the placeholder strings denote the positions of <i>, </i>, <b> and </b> HTML tags
672
+ #: cookiebot.php:1592
673
+ msgid "If you need to force language of the cookie declaration, you can add the %1$slang%2$s attribute. Eg. %3$s[cookie_declaration lang=\"de\"]%4$s."
 
674
  msgstr ""
675
 
676
+ #: cookiebot.php:1603
677
+ #: cookiebot.php:1634
678
  msgid "Watch video demonstration"
679
  msgstr ""
680
 
681
+ #: cookiebot.php:1610
682
  msgid "Update your script tags"
683
  msgstr ""
684
 
685
+ #: cookiebot.php:1613
686
+ msgid "To enable prior consent, apply the attribute \"data-cookieconsent\" to cookie-setting script tags on your website. Set the comma-separated value to one or more of the cookie categories \"preferences\", \"statistics\" and \"marketing\" in accordance with the types of cookies being set by each script. Finally change the attribute \"type\" from \"text/javascript\" to \"text/plain\". Example on modifying an existing Google Analytics Universal script tag."
 
 
 
 
 
 
 
687
  msgstr ""
688
 
689
+ #: cookiebot.php:1642
690
  msgid "Helper function to update your scripts"
691
  msgstr ""
692
 
693
+ #: cookiebot.php:1645
694
+ msgid "You are able to update your scripts yourself. However, Cookiebot also offers a small helper function that makes the work easier."
 
 
695
  msgstr ""
696
 
697
+ #: cookiebot.php:1651
698
  msgid "Update your script tags this way:"
699
  msgstr ""
700
 
701
+ #: cookiebot.php:1655
702
+ msgid "%1$s to %2$s"
703
+ msgstr ""
704
+
705
+ #: cookiebot.php:1681
706
+ msgid "Enable GTM"
707
+ msgstr ""
708
+
709
+ #: cookiebot.php:1687
710
+ msgid "For more details about Cookiebot and Google Tag Manager click"
711
+ msgstr ""
712
+
713
+ #: cookiebot.php:1693
714
+ #: cookiebot.php:1720
715
+ msgid "here"
716
+ msgstr ""
717
+
718
+ #: cookiebot.php:1696
719
+ msgid "GTM ID"
720
+ msgstr ""
721
+
722
+ #: cookiebot.php:1700
723
+ msgid "DataLayer name"
724
+ msgstr ""
725
+
726
+ #: cookiebot.php:1704
727
+ msgid "Optional, only change if necessary"
728
+ msgstr ""
729
+
730
+ #: cookiebot.php:1707
731
+ msgid "Google Consent Mode"
732
+ msgstr ""
733
+
734
+ #: cookiebot.php:1713
735
+ msgid "For more details about Cookiebot and Google Consent Mode click"
736
+ msgstr ""
737
+
738
+ #: cookiebot.php:1743
739
+ msgid "For more details about Cookiebot's IAB integration, see %1$sarticle about cookiebot and the IAB consent framework%2$s"
740
+ msgstr ""
741
+
742
+ #: cookiebot.php:1757
743
+ msgid "Enable IAB integration"
744
+ msgstr ""
745
+
746
+ #: cookiebot.php:1780
747
+ msgid "For more details about Cookiebot's CCPA Legislation integration, see %1$sarticle about cookiebot and the CCPA compliance%2$s"
748
+ msgstr ""
749
+
750
+ #: cookiebot.php:1798
751
+ msgid "Enable CCPA configuration for visitors from California"
752
+ msgstr ""
753
+
754
+ #: cookiebot.php:1804
755
+ msgid "Domain Group ID"
756
+ msgstr ""
757
+
758
+ #: cookiebot.php:1906
759
+ msgid "Debug information"
760
+ msgstr ""
761
+
762
+ #: cookiebot.php:1909
763
+ msgid "The information below is for debugging purpose. If you have any issues with your Cookiebot integration, the information below is usefull for a supporter to help you the best way."
764
  msgstr ""
765
 
766
+ #: cookiebot.php:1918
767
+ msgid "Copy debug information to clipboard"
768
+ msgstr ""
769
+
770
+ #: cookiebot.php:2135
771
  msgid "Please add your Cookiebot ID to show Cookie Declarations"
772
  msgstr ""
773
 
774
+ #: cookiebot.php:2391
775
+ msgid "Leave A Review?"
776
  msgstr ""
777
 
778
+ #: cookiebot.php:2394
779
+ msgid "We hope you enjoy using WordPress Cookiebot! Would you consider leaving us a review on WordPress.org?"
780
  msgstr ""
781
 
782
+ #: cookiebot.php:2405
783
+ msgid "Sure! I'd love to!"
 
 
 
784
  msgstr ""
785
 
786
+ #: cookiebot.php:2416
787
+ msgid "I've already left a review"
788
  msgstr ""
789
 
790
+ #: cookiebot.php:2427
791
+ msgid "Maybe Later"
792
  msgstr ""
793
 
794
+ #: cookiebot.php:2438
795
+ msgid "Never show again"
796
  msgstr ""
797
 
798
+ #: widgets/cookiebot-declaration-widget.php:10
799
+ msgid "Cookiebot - Cookie Declaration"
800
  msgstr ""
801
 
802
+ #: widgets/cookiebot-declaration-widget.php:34
803
+ msgid "Language"
804
+ msgstr ""
805
+
806
+ #: widgets/cookiebot-declaration-widget.php:38
807
+ msgid "- Default -"
808
  msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  * Contributors: cookiebot,phpgeekdk,aytac
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
- * Tested up to: 5.7.2
6
- * Stable tag: 3.10.1
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
@@ -197,6 +197,17 @@ You are able to define the mapping between Cookiebot and the WP Consent API in t
197
 
198
  ## Changelog ##
199
 
 
 
 
 
 
 
 
 
 
 
 
200
  ### 3.10.1 - 2021-04-29 ###
201
  * Added support for translating 'marketing', 'statistics', and 'preferences'
202
  * Allow cookies for same domain embedded content
2
  * Contributors: cookiebot,phpgeekdk,aytac
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
+ * Tested up to: 5.8.1
6
+ * Stable tag: 3.11.1
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
197
 
198
  ## Changelog ##
199
 
200
+ ### 3.11.1 - 2021-09-22 ###
201
+ * Fixed unescaped PHP output
202
+ * Updated some translations
203
+
204
+ ### 3.11.0 - 2021-07-16 ###
205
+ * Removed PHP-DI
206
+ * Fixed number of arguments in the settings-service-interface.php get_placeholder method signature
207
+ * Added custom container class to manage dependencies
208
+ * Added support for the Matomo Analytics plugin
209
+ # Added support for WP Google Analytics Events
210
+
211
  ### 3.10.1 - 2021-04-29 ###
212
  * Added support for translating 'marketing', 'statistics', and 'preferences'
213
  * Allow cookies for same domain embedded content
tests/bootstrap.php CHANGED
@@ -12,7 +12,7 @@ if ( ! $_tests_dir ) {
12
  }
13
 
14
  if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
15
- echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // WPCS: XSS ok.
16
  exit( 1 );
17
  }
18
 
12
  }
13
 
14
  if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
15
+ echo 'Could not find ' . esc_html( $_tests_dir ) . '/includes/functions.php, have you run bin/install-wp-tests.sh ?' . PHP_EOL;
16
  exit( 1 );
17
  }
18
 
widgets/cookiebot-declaration-widget.php CHANGED
@@ -14,69 +14,110 @@ class Cookiebot_Declaration_Widget extends WP_Widget {
14
  );
15
  }
16
 
17
- // The widget form (for the backend )
18
- public function form( $instance ) {
19
- $defaults = array('lang'=>'');
20
- extract( wp_parse_args( ( array ) $instance, $defaults ) );
21
- $title = (isset($title) ? $title : '');
 
 
 
 
 
 
22
  ?>
23
  <p>
24
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'Cookiebot' ); ?></label>
25
  <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
26
  </p>
27
  <p>
28
- <label for="<?php echo $this->get_field_id( 'lang' ); ?>"><?php esc_html_e( 'Language', 'cookiebot' ); ?></label>
29
- <select name="<?php echo $this->get_field_name( 'lang' ); ?>" id="<?php echo $this->get_field_id( 'lang' ); ?>" class="widefat">
30
- <option value=""><?php echo esc_html__('- Default -', 'cookiebot'); ?></option>
 
 
31
  <?php
32
  $options = Cookiebot_WP::get_supported_languages();
33
  foreach ( $options as $key => $name ) {
34
- echo '<option value="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" '. selected( $lang, $key, false ) . '>'. $name . '</option>';
 
 
 
 
 
 
35
  }
36
  ?>
37
  </select>
38
-
39
  </p>
40
  <?php
 
 
 
41
  }
42
 
43
  // Update widget settings
44
  public function update( $new_instance, $old_instance ) {
45
- $instance = $old_instance;
46
- $instance['lang'] = isset( $new_instance['lang'] ) ? wp_strip_all_tags( $new_instance['lang'] ) : '';
47
- $instance['title'] = isset( $new_instance['title'] ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
48
  return $instance;
49
  }
50
 
51
  // Display the widget
 
 
 
 
 
 
 
 
 
 
 
 
52
  public function widget( $args, $instance ) {
53
- extract( $args );
54
- extract( $instance );
55
-
 
 
 
 
56
  // WordPress core before_widget hook
 
57
  echo $before_widget;
58
-
59
  echo '<div class="widget-text wp_widget_plugin_box cookiebot_cookie_declaration">';
60
-
61
  // Display widget title if defined
62
  if ( $title ) {
63
- echo $before_title . $title . $after_title;
 
64
  }
65
-
66
  $cbid = Cookiebot_WP::get_cbid();
67
- if(!empty($lang)) { $lang = ' data-culture="'.$lang.'"'; }
68
- if(!is_multisite() || get_site_option('cookiebot-script-tag-cd-attribute','custom') == 'custom') {
69
- $tagAttr = get_option('cookiebot-script-tag-cd-attribute','async');
 
70
  }
71
- else {
72
- $tagAttr = get_site_option('cookiebot-script-tag-cd-attribute');
73
- }
74
-
75
- echo '<script id="CookieDeclaration" src="https://consent.cookiebot.com/'.$cbid.'/cd.js"'.$lang.' type="text/javascript" '.$tagAttr.'></script>';
76
-
 
 
 
 
 
77
  echo '</div>';
78
-
79
  // WordPress core after_widget hook
 
80
  echo $after_widget;
81
  }
82
 
14
  );
15
  }
16
 
17
+ /**
18
+ * Outputs the settings update form.
19
+ *
20
+ * @since 2.8.0
21
+ *
22
+ * @param array $instance Current settings.
23
+ * @return string Default return is 'noform'.
24
+ */
25
+ public function form( $instance ) {
26
+ $lang = isset( $instance['lang'] ) ? $instance['lang'] : '';
27
+ $title = isset( $instance['title'] ) ? $instance['title'] : '';
28
  ?>
29
  <p>
30
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'Cookiebot' ); ?></label>
31
  <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
32
  </p>
33
  <p>
34
+ <label for="<?php echo esc_attr( $this->get_field_id( 'lang' ) ); ?>"><?php esc_html_e( 'Language', 'cookiebot' ); ?></label>
35
+ <select name="<?php echo esc_attr( $this->get_field_name( 'lang' ) ); ?>"
36
+ id="<?php echo esc_attr( $this->get_field_id( 'lang' ) ); ?>"
37
+ class="widefat">
38
+ <option value=""><?php echo esc_html__( '- Default -', 'cookiebot' ); ?></option>
39
  <?php
40
  $options = Cookiebot_WP::get_supported_languages();
41
  foreach ( $options as $key => $name ) {
42
+ ?>
43
+ <option value="<?php echo esc_attr( $key ); ?>"
44
+ id="<?php echo esc_attr( $key ); ?>"
45
+ class="value"
46
+ <?php selected( $lang, $key, false, true ); ?>
47
+ ><?php echo esc_html( $name ); ?></option>
48
+ <?php
49
  }
50
  ?>
51
  </select>
 
52
  </p>
53
  <?php
54
+
55
+ // the base function expects a string to be returned
56
+ return '';
57
  }
58
 
59
  // Update widget settings
60
  public function update( $new_instance, $old_instance ) {
61
+ $instance = $old_instance;
62
+ $instance['lang'] = isset( $new_instance['lang'] ) ? wp_strip_all_tags( $new_instance['lang'] ) : '';
63
+ $instance['title'] = isset( $new_instance['title'] ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
64
  return $instance;
65
  }
66
 
67
  // Display the widget
68
+
69
+ /**
70
+ * Echoes the widget content.
71
+ *
72
+ * Subclasses should override this function to generate their widget code.
73
+ *
74
+ * @since 2.8.0
75
+ *
76
+ * @param array $args Display arguments including 'before_title', 'after_title',
77
+ * 'before_widget', and 'after_widget'.
78
+ * @param array $instance The settings for the particular instance of the widget.
79
+ */
80
  public function widget( $args, $instance ) {
81
+ $before_widget = isset( $args['before_widget'] ) ? $args['before_widget'] : '';
82
+ $after_widget = isset( $args['after_widget'] ) ? $args['after_widget'] : '';
83
+ $before_title = isset( $args['before_title'] ) ? $args['before_title'] : '';
84
+ $after_title = isset( $args['after_title'] ) ? $args['after_title'] : '';
85
+ $lang = isset( $instance['lang'] ) ? $instance['lang'] : '';
86
+ $title = isset( $instance['title'] ) ? $instance['title'] : '';
87
+
88
  // WordPress core before_widget hook
89
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
90
  echo $before_widget;
91
+
92
  echo '<div class="widget-text wp_widget_plugin_box cookiebot_cookie_declaration">';
93
+
94
  // Display widget title if defined
95
  if ( $title ) {
96
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
97
+ echo $before_title . esc_html( $title ) . $after_title;
98
  }
99
+
100
  $cbid = Cookiebot_WP::get_cbid();
101
+ if ( ! is_multisite() || get_site_option( 'cookiebot-script-tag-cd-attribute', 'custom' ) === 'custom' ) {
102
+ $tag_attr = get_option( 'cookiebot-script-tag-cd-attribute', 'async' );
103
+ } else {
104
+ $tag_attr = get_site_option( 'cookiebot-script-tag-cd-attribute' );
105
  }
106
+
107
+ ?>
108
+ <script type="text/javascript"
109
+ id="CookieDeclaration"
110
+ src="<?php echo esc_url( 'https://consent.cookiebot.com/' . $cbid . '/cd.js' ); ?>"
111
+ <?php if ( ! empty( $lang ) ) : ?>
112
+ data-culture="<?php echo esc_attr( $lang ); ?>"
113
+ <?php endif; ?>
114
+ <?php echo esc_attr( $tag_attr ); ?>
115
+ />
116
+ <?php
117
  echo '</div>';
118
+
119
  // WordPress core after_widget hook
120
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
121
  echo $after_widget;
122
  }
123