PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.0.0
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.0.0
4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.5 3.6.6 3.7.0 3.7.1 3.8.0 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.2.0 4.2.1 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.10 4.3.11 4.3.12 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.7.1 4.3.8 4.3.9 4.3.9.1 4.4.0 4.4.1 4.4.2 4.5.0 4.5.1 4.5.10 4.5.11 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.7.0
cookiebot / src / view / admin / settings / settings-page.php
cookiebot / src / view / admin / settings Last commit date
prior-consent 4 years ago debug-page.php 4 years ago gtm-page.php 4 years ago iab-page.php 4 years ago legislations-page.php 4 years ago network-settings-page.php 4 years ago settings-page.php 4 years ago support-page.php 4 years ago
settings-page.php
587 lines
1 <?php
2
3
4 /**
5 * @var string $cbid
6 * @var bool $is_ms
7 * @var string $network_cbid
8 * @var string $network_scrip_tag_uc_attr
9 * @var string $network_scrip_tag_cd_attr
10 * @var string $cookiebot_gdpr_url
11 * @var string $cookiebot_logo
12 * @var array $supported_languages
13 * @var string $current_lang
14 * @var bool $is_wp_consent_api_active
15 * @var array $m_default
16 * @var array $m
17 * @var string $cookie_blocking_mode
18 * @var string $add_language_gif_url
19 */
20 ?>
21 <div class="wrap">
22 <h1><?php esc_html_e( 'Cookiebot Settings', 'cookiebot' ); ?></h1>
23 <a href="https://www.cookiebot.com">
24 <img
25 src="<?php echo esc_url( $cookiebot_logo ); ?>"
26 alt="Cookiebot logo"
27 style="float:right;margin-left:1em;">
28 </a>
29 <p>
30 <?php
31 printf(
32 /* translators: %1$s: GDPR URL; %2$s: extra information about the requirements */
33 esc_html__(
34 '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.',
35 'cookiebot'
36 ),
37 sprintf(
38 '<a href="%s" target="_blank">%s</a>',
39 esc_url( $cookiebot_gdpr_url ),
40 esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' )
41 ),
42 esc_html__(
43 ' 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.',
44 'cookiebot'
45 )
46 );
47 ?>
48 </p>
49 <form method="post" action="options.php">
50 <?php settings_fields( 'cookiebot' ); ?>
51 <?php do_settings_sections( 'cookiebot' ); ?>
52 <table class="form-table">
53 <tr>
54 <th scope="row"><?php esc_html_e( 'Cookiebot ID', 'cookiebot' ); ?></th>
55 <td>
56 <input <?php echo ( $is_ms ) ? ' placeholder="' . esc_attr( $network_cbid ) . '"' : ''; ?>
57 type="text" name="cookiebot-cbid"
58 value="<?php echo esc_attr( $cbid ); ?>"
59 style="width:300px"
60 />
61 <p class="description">
62 <?php esc_html_e( 'Need an ID?', 'cookiebot' ); ?>
63 <a href="https://www.cookiebot.com/goto/signup" target="_blank">
64 <?php
65 esc_html_e(
66 'Sign up for free on cookiebot.com',
67 'cookiebot'
68 );
69 ?>
70 </a>
71 </p>
72 </td>
73 </tr>
74 <tr>
75 <th scope="row">
76 <?php esc_html_e( 'Cookie-blocking mode', 'cookiebot' ); ?>
77 </th>
78 <td>
79 <label>
80 <input <?php checked( 'auto', $cookie_blocking_mode ); ?>
81 type="radio"
82 name="cookiebot-cookie-blocking-mode"
83 value="auto"
84 />
85 <?php esc_html_e( 'Automatic', 'cookiebot' ); ?>
86 </label>
87 &nbsp; &nbsp;
88 <label>
89 <input <?php checked( 'manual', $cookie_blocking_mode ); ?>
90 type="radio"
91 name="cookiebot-cookie-blocking-mode"
92 value="manual"
93 />
94 <?php esc_html_e( 'Manual', 'cookiebot' ); ?>
95 </label>
96 <p class="description">
97 <?php esc_html_e( 'Automatic block cookies (except necessary) until the user has given their consent.', 'cookiebot' ); ?>
98 <a
99 href="https://support.cookiebot.com/hc/en-us/articles/360009063100-Automatic-Cookie-Blocking-How-does-it-work-"
100 target="_blank">
101 <?php esc_html_e( 'Learn more', 'cookiebot' ); ?>
102 </a>
103 </p>
104 </td>
105 </tr>
106 <tr>
107 <th scope="row"><?php esc_html_e( 'Cookiebot Language', 'cookiebot' ); ?></th>
108 <td>
109 <div>
110 <select name="cookiebot-language" id="cookiebot-language">
111 <option value=""><?php esc_html_e( 'Default (Autodetect)', 'cookiebot' ); ?></option>
112 <option value="_wp"<?php echo ( $current_lang === '_wp' ) ? ' selected' : ''; ?>>
113 <?php
114 esc_html_e(
115 'Use WordPress Language',
116 'cookiebot'
117 );
118 ?>
119 </option>
120 <?php
121 foreach ( $supported_languages as $lang_code => $lang_name ) {
122 echo '<option value="' . esc_attr( $lang_code ) . '"' . ( ( $current_lang === esc_attr( $lang_code ) ) ? ' selected' : '' ) . '>' . esc_html( $lang_name ) . '</option>';
123 }
124 ?>
125 </select>
126 </div>
127 <div
128 class="notice inline notice-warning notice-alt cookiebot-notice"
129 style="padding:12px;font-size:13px;display:inline-block;">
130 <div
131 style="<?php echo ( $current_lang === '' ) ? 'display:none;' : ''; ?>"
132 id="info_lang_specified">
133 <?php esc_html_e( 'You need to add the language in the Cookiebot administration tool.', 'cookiebot' ); ?>
134 </div>
135 <div
136 style="<?php echo ( $current_lang === '' ) ? '' : 'display:none;'; ?>"
137 id="info_lang_autodetect">
138 <?php
139 esc_html_e(
140 'You need to add all languages that you want auto-detected in the Cookiebot administration tool.',
141 'cookiebot'
142 );
143 ?>
144 <br/>
145 <?php
146 esc_html_e(
147 'The auto-detect checkbox needs to be enabled in the Cookiebot administration tool.',
148 'cookiebot'
149 );
150 ?>
151 <br/>
152 <?php
153 esc_html_e(
154 'If the auto-detected language is not supported, Cookiebot will use the default language.',
155 'cookiebot'
156 );
157 ?>
158 </div>
159 <br>
160
161 <a
162 href="#"
163 id="show_add_language_guide">
164 <?php esc_html_e( 'Show guide to add languages', 'cookiebot' ); ?>
165 </a>
166 &nbsp;
167 <a
168 href="https://support.cookiebot.com/hc/en-us/articles/360003793394-How-do-I-set-the-language-of-the-consent-banner-dialog-"
169 target="_blank">
170 <?php esc_html_e( 'Read more here', 'cookiebot' ); ?>
171 </a>
172
173 <div id="add_language_guide" style="display:none;">
174 <img
175 src="<?php echo esc_attr( $add_language_gif_url ); ?>"
176 alt="Add language in Cookiebot administration tool"/>
177 <br/>
178 <a
179 href="#"
180 id="hide_add_language_guide">
181 <?php esc_html_e( 'Hide guide', 'cookiebot' ); ?>
182 </a>
183 </div>
184 </div>
185 </td>
186 </tr>
187 </table>
188 <h3 id="advanced_settings_link"
189 class="cookiebot_fieldset_header"><?php esc_html_e( 'Advanced settings', 'cookiebot' ); ?></h3>
190 <div id="advanced_settings" style="display:none;">
191 <table class="form-table">
192 <tr id="cookiebot-setting-async">
193 <th scope="row">
194 <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
195 <br/><?php esc_html_e( 'Consent banner script tag', 'cookiebot' ); ?>
196 </th>
197 <td>
198 <?php
199 $cv = get_option( 'cookiebot-script-tag-uc-attribute', 'async' );
200 $disabled = false;
201 if ( $is_ms && $network_scrip_tag_uc_attr !== 'custom' ) {
202 $disabled = true;
203 $cv = $network_scrip_tag_uc_attr;
204 }
205 ?>
206 <label>
207 <input
208 type="radio"
209 name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
210 value="" <?php checked( '', $cv ); ?> />
211 <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
212 </label>
213 &nbsp; &nbsp;
214 <label>
215 <input
216 type="radio"
217 name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
218 value="async" <?php checked( 'async', $cv ); ?> />
219 async
220 </label>
221 &nbsp; &nbsp;
222 <label>
223 <input
224 type="radio"
225 name="cookiebot-script-tag-uc-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
226 value="defer" <?php checked( 'defer', $cv ); ?> />
227 defer
228 </label>
229 <p class="description">
230 <?php
231 if ( $disabled ) {
232 echo '<b>' . esc_html__(
233 'Network setting applied. Please contact website administrator to change this setting.',
234 'cookiebot'
235 ) . '</b><br />';
236 }
237 ?>
238 <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
239 </p>
240 </td>
241 </tr>
242 <tr>
243 <th scope="row">
244 <?php esc_html_e( 'Add async or defer attribute', 'cookiebot' ); ?>
245 <br/><?php esc_html_e( 'Cookie declaration script tag', 'cookiebot' ); ?>
246 </th>
247 <td>
248 <?php
249 $cv = get_option( 'cookiebot-script-tag-cd-attribute', 'async' );
250 $disabled = false;
251 if ( $is_ms && $network_scrip_tag_cd_attr !== 'custom' ) {
252 $disabled = true;
253 $cv = $network_scrip_tag_cd_attr;
254 }
255 ?>
256 <label>
257 <input
258 type="radio"
259 name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
260 value="" <?php checked( '', $cv ); ?>/>
261 <i><?php esc_html_e( 'None', 'cookiebot' ); ?></i>
262 </label>
263 &nbsp; &nbsp;
264 <label>
265 <input
266 type="radio"
267 name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
268 value="async" <?php checked( 'async', $cv ); ?>/>
269 async
270 </label>
271 &nbsp; &nbsp;
272 <label>
273 <input
274 type="radio"
275 name="cookiebot-script-tag-cd-attribute"<?php echo ( $disabled ) ? ' disabled' : ''; ?>
276 value="defer" <?php checked( 'defer', $cv ); ?>/>
277 defer
278 </label>
279 <p class="description">
280 <?php
281 if ( $disabled ) {
282 echo '<b>' . esc_html__(
283 'Network setting applied. Please contact website administrator to change this setting.',
284 'cookiebot'
285 ) . '</b><br />';
286 }
287 ?>
288 <?php esc_html_e( 'Add async or defer attribute to Cookiebot script tag. Default: async', 'cookiebot' ); ?>
289 </p>
290 </td>
291 </tr>
292 <?php
293 if ( ! is_multisite() ) {
294 ?>
295 <tr>
296 <th scope="row"><?php esc_html_e( 'Auto-update Cookiebot', 'cookiebot' ); ?></th>
297 <td>
298 <input type="checkbox" name="cookiebot-autoupdate" value="1"
299 <?php
300 checked(
301 1,
302 get_option( 'cookiebot-autoupdate', false )
303 );
304 ?>
305 />
306 <p class="description">
307 <?php esc_html_e( 'Automatic update your Cookiebot plugin when new releases becomes available.', 'cookiebot' ); ?>
308 </p>
309 </td>
310 </tr>
311 <?php
312 }
313 ?>
314 <tr id="cookiebot-setting-hide-popup">
315 <th scope="row"><?php esc_html_e( 'Hide Cookie Popup', 'cookiebot' ); ?></th>
316 <td>
317 <?php
318 $disabled = false;
319 if ( $is_ms && get_site_option( 'cookiebot-nooutput' ) ) {
320 $disabled = true;
321 echo '<input type="checkbox" checked disabled />';
322 } else {
323 ?>
324 <input type="checkbox" name="cookiebot-nooutput" value="1"
325 <?php
326 checked(
327 1,
328 get_option( 'cookiebot-nooutput', false )
329 );
330 ?>
331 />
332 <?php
333 }
334 ?>
335 <p class="description">
336 <?php
337 if ( $disabled ) {
338 echo '<b>' . esc_html__(
339 'Network setting applied. Please contact website administrator to change this setting.',
340 'cookiebot'
341 ) . '</b><br />';
342 }
343 ?>
344 <b>
345 <?php
346 esc_html_e(
347 'This checkbox will remove the cookie consent banner from your website. The <i>[cookie_declaration]</i> shortcode will still be available.',
348 'cookiebot'
349 );
350 ?>
351 </b><br/>
352 <?php
353 esc_html_e(
354 'If you are using Google Tag Manager (or equal), you need to add the Cookiebot script in your Tag Manager.',
355 'cookiebot'
356 );
357 ?>
358 <br/>
359 <a
360 href="https://support.cookiebot.com/hc/en-us/articles/360003793854-Google-Tag-Manager-deployment"
361 target="_blank">
362 <?php esc_html_e( 'See a detailed guide here', 'cookiebot' ); ?>
363 </a>
364 </p>
365 </td>
366 </tr>
367 <tr>
368 <th scope="row"><?php esc_html_e( 'Disable Cookiebot in WP Admin', 'cookiebot' ); ?></th>
369 <td>
370 <?php
371 $disabled = false;
372 if ( $is_ms && get_site_option( 'cookiebot-nooutput-admin' ) ) {
373 echo '<input type="checkbox" checked disabled />';
374 $disabled = true;
375 } else {
376 ?>
377 <input type="checkbox" name="cookiebot-nooutput-admin" value="1"
378 <?php
379 checked(
380 1,
381 get_option( 'cookiebot-nooutput-admin', false )
382 );
383 ?>
384 />
385 <?php
386 }
387 ?>
388 <p class="description">
389 <?php
390 if ( $disabled ) {
391 echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.', 'cookiebot' ) . '</b><br />';
392 }
393 ?>
394 <b><?php esc_html_e( 'This checkbox will disable Cookiebot in the WordPress Admin area.', 'cookiebot' ); ?></b>
395 </p>
396 </td>
397 </tr>
398 <tr>
399 <th scope="row"><?php esc_html_e( 'Enable Cookiebot on front end while logged in', 'cookiebot' ); ?></th>
400 <td>
401 <?php
402 $disabled = false;
403 if ( $is_ms && get_site_option( 'cookiebot-output-logged-in' ) ) {
404 echo '<input type="checkbox" checked disabled />';
405 $disabled = true;
406 } else {
407 ?>
408 <input type="checkbox" name="cookiebot-output-logged-in" value="1"
409 <?php
410 checked(
411 1,
412 get_option( 'cookiebot-output-logged-in', false )
413 );
414 ?>
415 />
416 <?php
417 }
418 ?>
419 <p class="description">
420 <?php
421 if ( $disabled ) {
422 echo '<b>' . esc_html__( 'Network setting applied. Please contact website administrator to change this setting.', 'cookiebot' ) . '</b><br />';
423 }
424 ?>
425 <b><?php esc_html_e( 'This checkbox will enable Cookiebot on front end while you\'re logged in', 'cookiebot' ); ?></b>
426 </p>
427 </td>
428 </tr>
429 </table>
430 </div>
431 <?php if ( $is_wp_consent_api_active ) { ?>
432 <h3 id="consent_level_api_settings" class="cookiebot_fieldset_header">
433 <?php
434 esc_html_e(
435 'Consent Level API Settings',
436 'cookiebot'
437 );
438 ?>
439 </h3>
440 <div id="consent_level_api_settings" style="display:none;">
441 <p>
442 <?php
443 esc_html_e(
444 '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.',
445 'cookiebot'
446 );
447 ?>
448 </p>
449
450 <?php
451 $consent_types = array( 'preferences', 'statistics', 'marketing' );
452 $states = array_reduce(
453 $consent_types,
454 function ( $t, $v ) {
455 $newt = array();
456 if ( empty( $t ) ) {
457 $newt = array(
458 array( $v => true ),
459 array( $v => false ),
460 );
461 } else {
462 foreach ( $t as $item ) {
463 $newt[] = array_merge( $item, array( $v => true ) );
464 $newt[] = array_merge( $item, array( $v => false ) );
465 }
466 }
467
468 return $newt;
469 },
470 array()
471 );
472
473 ?>
474
475
476 <table class="widefat striped consent_mapping_table">
477 <thead>
478 <tr>
479 <th><?php esc_html_e( 'Cookiebot categories', 'cookiebot' ); ?></th>
480 <th class="consent_mapping"><?php esc_html_e( 'WP Consent Level categories', 'cookiebot' ); ?></th>
481 </tr>
482 </thead>
483 <?php
484 foreach ( $states as $state ) {
485 $key = array();
486 $key[] = 'n=1';
487 $key[] = 'p=' . ( $state['preferences'] ? '1' : '0' );
488 $key[] = 's=' . ( $state['statistics'] ? '1' : '0' );
489 $key[] = 'm=' . ( $state['marketing'] ? '1' : '0' );
490 $key = implode( ';', $key );
491 ?>
492 <tr>
493 <td>
494 <div class="cb_consent">
495 <span class="forceconsent">
496 <?php esc_html_e( 'Necessary', 'cookiebot' ); ?>
497 </span>
498 <span class="<?php echo( $state['preferences'] ? 'consent' : 'noconsent' ); ?>">
499 <?php esc_html_e( 'Preferences', 'cookiebot' ); ?>
500 </span>
501 <span class="<?php echo( $state['statistics'] ? 'consent' : 'noconsent' ); ?>">
502 <?php esc_html_e( 'Statistics', 'cookiebot' ); ?>
503 </span>
504 <span class="<?php echo( $state['marketing'] ? 'consent' : 'noconsent' ); ?>">
505 <?php esc_html_e( 'Marketing', 'cookiebot' ); ?>
506 </span>
507 </div>
508 </td>
509 <td>
510 <div class="consent_mapping">
511 <label><input
512 type="checkbox"
513 name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][functional]"
514 data-default-value="1" value="1" checked disabled
515 > <?php esc_html_e( 'Functional', 'cookiebot' ); ?> </label>
516 <label><input
517 type="checkbox"
518 name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][preferences]"
519 data-default-value="<?php echo esc_attr( $m_default[ $key ]['preferences'] ); ?>"
520 value="1"
521 <?php
522 if ( $m[ $key ]['preferences'] ) {
523 echo 'checked';
524 }
525 ?>
526 > <?php esc_html_e( 'Preferences', 'cookiebot' ); ?> </label>
527 <label><input
528 type="checkbox"
529 name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][statistics]"
530 data-default-value="<?php echo esc_attr( $m_default[ $key ]['statistics'] ); ?>"
531 value="1"
532 <?php
533 if ( $m[ $key ]['statistics'] ) {
534 echo 'checked';
535 }
536 ?>
537 > <?php esc_html_e( 'Statistics', 'cookiebot' ); ?> </label>
538 <label><input
539 type="checkbox"
540 name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][statistics-anonymous]"
541 data-default-value="<?php echo esc_attr( $m_default[ $key ]['statistics-anonymous'] ); ?>"
542 value="1"
543 <?php
544 if ( $m[ $key ]['statistics-anonymous'] ) {
545 echo 'checked';
546 }
547 ?>
548 > <?php esc_html_e( 'Statistics Anonymous', 'cookiebot' ); ?>
549 </label>
550 <label><input
551 type="checkbox"
552 name="cookiebot-consent-mapping[<?php echo esc_attr( $key ); ?>][marketing]"
553 data-default-value="<?php echo esc_attr( $m_default[ $key ]['marketing'] ); ?>"
554 value="1"
555 <?php
556 if ( $m[ $key ]['marketing'] ) {
557 echo 'checked';
558 }
559 ?>
560 > <?php esc_html_e( 'Marketing', 'cookiebot' ); ?></label>
561 </div>
562 </td>
563 </tr>
564 <?php
565 }
566 ?>
567 <tfoot>
568 <tr>
569 <td colspan="2" style="text-align:right;">
570 <button class="button" onclick="return resetConsentMapping();">
571 <?php
572 esc_html_e(
573 'Reset to default mapping',
574 'cookiebot'
575 );
576 ?>
577 </button>
578 </td>
579 </tr>
580 </tfoot>
581 </table>
582 </div>
583 <?php } ?>
584 <?php submit_button(); ?>
585 </form>
586 </div>
587