buffer
4 years ago
script_loader_tag
4 years ago
traits
4 years ago
Consent_API_Helper.php
4 years ago
Cookie_Consent.php
4 years ago
Cookie_Consent_Interface.php
4 years ago
Cookiebot_Activated.php
4 years ago
Cookiebot_Automatic_Updates.php
4 years ago
Cookiebot_Deactivated.php
4 years ago
Cookiebot_Javascript_Helper.php
4 years ago
Cookiebot_WP.php
3 years ago
Dependency_Container.php
4 years ago
Settings_Page_Tab.php
4 years ago
Settings_Service.php
4 years ago
Settings_Service_Interface.php
4 years ago
Supported_Languages.php
4 years ago
Supported_Regions.php
3 years ago
WP_Rocket_Helper.php
4 years ago
Widgets.php
4 years ago
global-deprecations.php
4 years ago
helper.php
4 years ago
global-deprecations.php
117 lines
| 1 | <?php |
| 2 | |
| 3 | use function cybot\cookiebot\lib\deprecation_error; |
| 4 | |
| 5 | // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound |
| 6 | |
| 7 | if ( ! class_exists( 'Cookiebot_WP' ) ) { |
| 8 | /** |
| 9 | * @deprecated |
| 10 | */ |
| 11 | final class Cookiebot_WP extends cybot\cookiebot\lib\Cookiebot_WP { |
| 12 | |
| 13 | /** |
| 14 | * @var Cookiebot_WP The single instance of the class |
| 15 | * @since 1.0.0 |
| 16 | */ |
| 17 | private static $instance = null; |
| 18 | |
| 19 | /** |
| 20 | * Cookiebot_WP Constructor. |
| 21 | * @deprecated |
| 22 | * @throws RuntimeException |
| 23 | * @since 1.0.0 |
| 24 | * @access public |
| 25 | * @version 2.1.4 |
| 26 | */ |
| 27 | public function __construct() { |
| 28 | deprecation_error( |
| 29 | 'Class', |
| 30 | self::class, |
| 31 | \cybot\cookiebot\lib\Cookiebot_WP::class |
| 32 | ); |
| 33 | parent::__construct(); |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Main Cookiebot_WP Instance |
| 38 | * |
| 39 | * Ensures only one instance of Cookiebot_WP is loaded or can be loaded. |
| 40 | * |
| 41 | * @deprecated |
| 42 | * @return Cookiebot_WP - Main instance |
| 43 | * @throws RuntimeException |
| 44 | * @version 1.0.0 |
| 45 | * @since 1.0.0 |
| 46 | * @static |
| 47 | */ |
| 48 | public static function instance() { |
| 49 | if ( is_null( self::$instance ) ) { |
| 50 | self::$instance = new self(); |
| 51 | } |
| 52 | |
| 53 | return self::$instance; |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | if ( ! function_exists( 'cookiebot_assist' ) ) { |
| 59 | /** |
| 60 | * Helper function to update your scripts |
| 61 | * |
| 62 | * @param string|string[] $type |
| 63 | * |
| 64 | * @return string |
| 65 | * @deprecated |
| 66 | */ |
| 67 | function cookiebot_assist( $type = 'statistics' ) { |
| 68 | deprecation_error( |
| 69 | 'Function', |
| 70 | __METHOD__, |
| 71 | '\cybot\cookiebot\lib\cookiebot_assist' |
| 72 | ); |
| 73 | return \cybot\cookiebot\lib\cookiebot_assist( $type ); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | |
| 78 | if ( ! function_exists( 'cookiebot_active' ) ) { |
| 79 | /** |
| 80 | * Helper function to check if cookiebot is active. |
| 81 | * Useful for other plugins adding support for Cookiebot. |
| 82 | * @return bool |
| 83 | * @deprecated |
| 84 | * @since 1.2 |
| 85 | * @version 2.2.2 |
| 86 | */ |
| 87 | function cookiebot_active() { |
| 88 | deprecation_error( |
| 89 | 'Function', |
| 90 | __METHOD__, |
| 91 | '\cybot\cookiebot\lib\cookiebot_active' |
| 92 | ); |
| 93 | return \cybot\cookiebot\lib\cookiebot_active(); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | |
| 98 | if ( ! function_exists( 'cookiebot' ) ) { |
| 99 | /** |
| 100 | * Returns the main instance of Cookiebot_WP to prevent the need to use globals. |
| 101 | * |
| 102 | * @return Cookiebot_WP |
| 103 | * @throws RuntimeException |
| 104 | * @deprecated |
| 105 | * @version 1.0.0 |
| 106 | * @since 1.0.0 |
| 107 | */ |
| 108 | function cookiebot() { |
| 109 | deprecation_error( |
| 110 | 'Function', |
| 111 | __METHOD__, |
| 112 | '\cybot\cookiebot\lib\cookiebot' |
| 113 | ); |
| 114 | return Cookiebot_WP::instance(); |
| 115 | } |
| 116 | } |
| 117 |