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