PluginProbe
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.7.3
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.7.3
4.7.3 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 All 93 releases
cookiebot / src / lib / Cookiebot_Frame.php

Cookiebot_Frame.php in Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode 4.7.3, at src/lib/Cookiebot_Frame.php

30 lines 784 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace cybot\cookiebot\lib;
4
5 class Cookiebot_Frame {
6
7 public static function is_cb_frame_type( $multisite = false ) {
8 $cbid = $multisite ? Cookiebot_WP::get_network_cbid() : Cookiebot_WP::get_cbid();
9 if ( empty( $cbid ) ) {
10 return 'empty';
11 } elseif ( preg_match( self::CB_FRAME_REGEX, $cbid ) ) {
12 return true;
13 } else {
14 return false;
15 }
16 }
17
18 public static function get_view_path( $multisite = false, $is_common = false ) {
19 if ( self::is_cb_frame_type( $multisite ) === 'empty' || $is_common ) {
20 return 'admin/common/';
21 } elseif ( self::is_cb_frame_type( $multisite ) === true ) {
22 return 'admin/cb_frame/';
23 } else {
24 return 'admin/uc_frame/';
25 }
26 }
27
28 const CB_FRAME_REGEX = '/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/';
29 }
30