cookiebot_fix_plugin_conflicts(); } /** * Cookiebot_WP Installation actions * * @version 2.1.4 * @since 2.1.4 * @accces public */ public function activation() { //Delay display of recommendation notice in 3 days if not activated ealier if ( get_option( 'cookiebot_notice_recommend', false ) === false ) { //Not set yet - this must be first activation - delay in 3 days update_option( 'cookiebot_notice_recommend', strtotime( '+3 days' ) ); } if ( $this->get_cbid() === '' ) { if ( is_multisite() ) { update_site_option( 'cookiebot-cookie-blocking-mode', 'auto' ); update_site_option( 'cookiebot-nooutput-admin', true ); } else { update_option( 'cookiebot-cookie-blocking-mode', 'auto' ); update_option( 'cookiebot-nooutput-admin', true ); } } /** * Run through the addons and enable the default ones */ if ( ( ! defined( 'COOKIEBOT_ADDONS_STANDALONE' ) || COOKIEBOT_ADDONS_STANDALONE !== true || ! defined( 'COOKIE_ADDONS_LOADED' ) ) ) { //Make sure we got a PHP version that works if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { define( 'COOKIEBOT_URL', plugin_dir_url( __FILE__ ) ); // activation hook doesn't have the addons loaded - so load it extra when the plugin is activated include_once dirname( __FILE__ ) . '/addons/cookiebot-addons-init.php'; // run activated hook on the addons cookiebot_addons_plugin_activated(); } } } /** * Cookiebot_WP Init Cookiebot. * * @version 3.8.1 * @since 1.6.2 * @access public */ public function cookiebot_init() { /* Load Cookiebot Addons Framework */ $dismiss_addons = false; if ( defined( 'CAF_DIR' ) ) { $dismiss_addons = true; /*add_action('admin_notices', function() { ?>
' . esc_html__( 'You need to enter your Cookiebot ID.', 'cookiebot' ) . '
'; echo ''; echo esc_html__( 'Update your Cookiebot ID', 'cookiebot' ); echo '
'; } else { echo '' . esc_html_e( 'Your Cookiebot is working!', 'cookiebot' ) . '
'; } } /** * Cookiebot_WP Add option menu page for Cookiebot * * @version 2.2.0 * @since 1.0.0 */ public function add_menu() { //Cookiebot Icon SVG base64 encoded $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHR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TYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+'; add_menu_page( 'Cookiebot', __( 'Cookiebot', 'cookiebot' ), 'manage_options', 'cookiebot', array( $this, 'settings_page' ), $icon ); add_submenu_page( 'cookiebot', __( 'Cookiebot Settings', 'cookiebot' ), __( 'Settings', 'cookiebot' ), 'manage_options', 'cookiebot', array( $this, 'settings_page' ), 10 ); add_submenu_page( 'cookiebot', __( 'Cookiebot Support', 'cookiebot' ), __( 'Support', 'cookiebot' ), 'manage_options', 'cookiebot_support', array( $this, 'support_page' ), 20 ); add_submenu_page( 'cookiebot', __( 'Google Tag Manager', 'cookiebot' ), __( 'Google Tag Manager', 'cookiebot' ), 'manage_options', 'cookiebot_GTM', array( $this, 'GTM_page' ) ); add_submenu_page( 'cookiebot', __( 'IAB', 'cookiebot' ), __( 'IAB', 'cookiebot' ), 'manage_options', 'cookiebot_iab', array( $this, 'iab_page' ), 30 ); if ( defined( 'COOKIEBOT_ADDONS_UNSUPPORTED_PHPVERSION' ) ) { //Load prior consent page anyway - but from Cookiebot WP Core plugin. add_submenu_page( 'cookiebot', __( 'Prior Consent', 'cookiebot' ), __( 'Prior Consent', 'cookiebot' ), 'manage_options', 'cookiebot-addons', array( $this, 'setting_page_placeholder' ), 40 ); } } public function add_menu_legislations() { add_submenu_page( 'cookiebot', __( 'Legislations', 'cookiebot' ), __( 'Legislations', 'cookiebot' ), 'manage_options', 'cookiebot-legislations', array( $this, 'legislations_page' ), 50 ); } /** * Cookiebot_WP Add debug menu - we need to add this seperate to ensure it is placed last (after menu items from Addons). * * @version 3.6.0 * @since 3.6.0 */ public function add_menu_debug() { add_submenu_page( 'cookiebot', __( 'Debug info', 'cookiebot' ), __( 'Debug info', 'cookiebot' ), 'manage_options', 'cookiebot_debug', array( $this, 'debug_page' ) ); } /** * Cookiebot_WP Add menu for network sites * * @version 2.2.0 * @since 2.2.0 */ public function add_network_menu() { $icon = 'data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNzIgNTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNDYuODcyNTkwMyA4Ljc3MzU4MzM0QzQxLjk0MzkwMzkgMy4zODI5NTAxMSAzNC44NDI0OTQ2IDAgMjYuOTQ4MjgxOSAwIDEyLjA2NTE1NjggMCAwIDEyLjAyNDQ3NzQgMCAyNi44NTc0MjE5YzAgMTQuODMyOTQ0NSAxMi4wNjUxNTY4IDI2Ljg1NzQyMTkgMjYuOTQ4MjgxOSAyNi44NTc0MjE5IDcuODk0MjEyNyAwIDE0Ljk5NTYyMi0zLjM4Mjk1MDIgMTkuOTI0MzA4NC04Ljc3MzU4MzQtMi44ODk2OTY3LTEuMzY4ODY2My01LjM5OTMxMS0zLjQwNTQzOS03LjMyODA4MzgtNS45MDk2MzU4LTMuMTIxNDMwNiAzLjIwOTQxMDQtNy40OTI5OTQ0IDUuMjA0MTI5MS0xMi4zMzIwMjU4IDUuMjA0MTI5MS05LjQ4NDM0NDQgMC0xNy4xNzI5MjQ3LTcuNjYyNjU3Mi0xNy4xNzI5MjQ3LTE3LjExNTAyMzhzNy42ODg1ODAzLTE3LjExNTAyMzcgMTcuMTcyOTI0Ny0xNy4xMTUwMjM3YzQuNzIzNDgyMiAwIDkuMDAxNTU1MiAxLjkwMDU5MzkgMTIuMTA2MjkyIDQuOTc2MzA5IDEuOTU2OTIzNy0yLjY0MTEzMSA0LjU1MDAyNjMtNC43ODU1MTgzIDcuNTUzODE3Ni02LjIwODQzMTg2eiIvPjxwYXRoIGQ9Ik01NS4zODAzMjgyIDQyLjY1MDE5OTFDNDYuMzMzNzIyNyA0Mi42NTAxOTkxIDM5IDM1LjM0MTIwMzEgMzkgMjYuMzI1MDk5NiAzOSAxNy4zMDg5OTYgNDYuMzMzNzIyNyAxMCA1NS4zODAzMjgyIDEwYzkuMDQ2NjA1NSAwIDE2LjM4MDMyODIgNy4zMDg5OTYgMTYuMzgwMzI4MiAxNi4zMjUwOTk2IDAgOS4wMTYxMDM1LTcuMzMzNzIyNyAxNi4zMjUwOTk1LTE2LjM4MDMyODIgMTYuMzI1MDk5NXptLjAyMTMwOTItNy43NTU2MzQyYzQuNzM3MDI3NiAwIDguNTc3MTQ3MS0zLjgyNzE3MiA4LjU3NzE0NzEtOC41NDgyMjc5IDAtNC43MjEwNTYtMy44NDAxMTk1LTguNTQ4MjI4LTguNTc3MTQ3MS04LjU0ODIyOC00LjczNzAyNzUgMC04LjU3NzE0NyAzLjgyNzE3Mi04LjU3NzE0NyA4LjU0ODIyOCAwIDQuNzIxMDU1OSAzLjg0MDExOTUgOC41NDgyMjc5IDguNTc3MTQ3IDguNTQ4MjI3OXoiLz48L2c+PC9zdmc+'; add_menu_page( 'Cookiebot', __( 'Cookiebot', 'cookiebot' ), 'manage_network_options', 'cookiebot_network', array( $this, 'network_settings_page' ), $icon ); add_submenu_page( 'cookiebot_network', __( 'Cookiebot Settings', 'cookiebot' ), __( 'Settings', 'cookiebot' ), 'network_settings_page', 'cookiebot_network', array( $this, 'network_settings_page' ) ); add_submenu_page( 'cookiebot_network', __( 'Cookiebot Support', 'cookiebot' ), __( 'Support', 'cookiebot' ), 'network_settings_page', 'cookiebot_support', array( $this, 'support_page' ) ); } /** * Cookiebot_WP Cookiebot prior consent placeholder page * * @version 1.4.0 * @since 1.0.0 */ public function setting_page_placeholder() { include __DIR__ . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'view/admin/settings/setting-page.php'; } /** * Cookiebot_WP Register Cookiebot settings * * @version 3.9.0 * @since 1.0.0 */ public function register_cookiebot_settings() { register_setting( 'cookiebot', 'cookiebot-cbid' ); register_setting( 'cookiebot', 'cookiebot-language' ); register_setting( 'cookiebot', 'cookiebot-nooutput' ); register_setting( 'cookiebot', 'cookiebot-nooutput-admin' ); register_setting( 'cookiebot', 'cookiebot-output-logged-in' ); register_setting( 'cookiebot', 'cookiebot-autoupdate' ); register_setting( 'cookiebot', 'cookiebot-script-tag-uc-attribute' ); register_setting( 'cookiebot', 'cookiebot-script-tag-cd-attribute' ); register_setting( 'cookiebot', 'cookiebot-cookie-blocking-mode' ); register_setting( 'cookiebot', 'cookiebot-consent-mapping' ); register_setting( 'cookiebot-iab', 'cookiebot-iab' ); register_setting( 'cookiebot-legislations', 'cookiebot-ccpa' ); register_setting( 'cookiebot-legislations', 'cookiebot-ccpa-domain-group-id' ); register_setting( 'cookiebot-gtm', 'cookiebot-gtm' ); register_setting( 'cookiebot-gtm', 'cookiebot-gtm-id' ); register_setting( 'cookiebot-gtm', 'cookiebot-data-layer' ); register_setting( 'cookiebot-gtm', 'cookiebot-gcm' ); } /** * Cookiebot_WP Automatic update plugin if activated * * @version 2.2.0 * @since 1.5.0 */ public function automatic_updates( $update, $item ) { //Do not update from subsite on a multisite installation if ( is_multisite() && ! is_main_site() ) { return $update; } //Check if we have everything we need $item = (array) $item; if ( ! isset( $item['new_version'] ) || ! isset( $item['slug'] ) ) { return $update; } //It is not Cookiebot if ( $item['slug'] !== 'cookiebot' ) { return $update; } // Check if cookiebot autoupdate is disabled if ( ! get_option( 'cookiebot-autoupdate', false ) ) { return $update; } // Check if multisite autoupdate is disabled if ( is_multisite() && ! get_site_option( 'cookiebot-autoupdate', false ) ) { return $update; } return true; } /** * Cookiebot_WP Get list of supported languages * * @version 1.4.0 * @since 1.4.0 */ public static function get_supported_languages() { $supported_languages = array(); $supported_languages['nb'] = __( 'Norwegian Bokmål', 'cookiebot' ); $supported_languages['tr'] = __( 'Turkish', 'cookiebot' ); $supported_languages['de'] = __( 'German', 'cookiebot' ); $supported_languages['cs'] = __( 'Czech', 'cookiebot' ); $supported_languages['da'] = __( 'Danish', 'cookiebot' ); $supported_languages['sq'] = __( 'Albanian', 'cookiebot' ); $supported_languages['he'] = __( 'Hebrew', 'cookiebot' ); $supported_languages['ko'] = __( 'Korean', 'cookiebot' ); $supported_languages['it'] = __( 'Italian', 'cookiebot' ); $supported_languages['nl'] = __( 'Dutch', 'cookiebot' ); $supported_languages['vi'] = __( 'Vietnamese', 'cookiebot' ); $supported_languages['ta'] = __( 'Tamil', 'cookiebot' ); $supported_languages['is'] = __( 'Icelandic', 'cookiebot' ); $supported_languages['ro'] = __( 'Romanian', 'cookiebot' ); $supported_languages['si'] = __( 'Sinhala', 'cookiebot' ); $supported_languages['ca'] = __( 'Catalan', 'cookiebot' ); $supported_languages['bg'] = __( 'Bulgarian', 'cookiebot' ); $supported_languages['uk'] = __( 'Ukrainian', 'cookiebot' ); $supported_languages['zh'] = __( 'Chinese', 'cookiebot' ); $supported_languages['en'] = __( 'English', 'cookiebot' ); $supported_languages['ar'] = __( 'Arabic', 'cookiebot' ); $supported_languages['hr'] = __( 'Croatian', 'cookiebot' ); $supported_languages['th'] = __( 'Thai', 'cookiebot' ); $supported_languages['el'] = __( 'Greek', 'cookiebot' ); $supported_languages['lt'] = __( 'Lithuanian', 'cookiebot' ); $supported_languages['pl'] = __( 'Polish', 'cookiebot' ); $supported_languages['lv'] = __( 'Latvian', 'cookiebot' ); $supported_languages['fr'] = __( 'French', 'cookiebot' ); $supported_languages['id'] = __( 'Indonesian', 'cookiebot' ); $supported_languages['mk'] = __( 'Macedonian', 'cookiebot' ); $supported_languages['et'] = __( 'Estonian', 'cookiebot' ); $supported_languages['pt'] = __( 'Portuguese', 'cookiebot' ); $supported_languages['ga'] = __( 'Irish', 'cookiebot' ); $supported_languages['ms'] = __( 'Malay', 'cookiebot' ); $supported_languages['sl'] = __( 'Slovenian', 'cookiebot' ); $supported_languages['ru'] = __( 'Russian', 'cookiebot' ); $supported_languages['ja'] = __( 'Japanese', 'cookiebot' ); $supported_languages['hi'] = __( 'Hindi', 'cookiebot' ); $supported_languages['sk'] = __( 'Slovak', 'cookiebot' ); $supported_languages['es'] = __( 'Spanish', 'cookiebot' ); $supported_languages['sv'] = __( 'Swedish', 'cookiebot' ); $supported_languages['sr'] = __( 'Serbian', 'cookiebot' ); $supported_languages['fi'] = __( 'Finnish', 'cookiebot' ); $supported_languages['eu'] = __( 'Basque', 'cookiebot' ); $supported_languages['hu'] = __( 'Hungarian', 'cookiebot' ); asort( $supported_languages, SORT_LOCALE_STRING ); return $supported_languages; } /** * Cookiebot_WP Output settings page * * @version 3.9.0 * @since 1.0.0 */ public function settings_page() { wp_enqueue_style( 'cookiebot-consent-mapping-table', plugins_url( 'css/consent_mapping_table.css', __FILE__ ), array(), '3.5.0' ); /* Check if multisite */ if ( $is_ms = is_multisite() ) { //Receive settings from multisite - this might change the way we render the form $network_cbid = get_site_option( 'cookiebot-cbid', '' ); $network_scrip_tag_uc_attr = get_site_option( 'cookiebot-script-tag-uc-attribute', 'custom' ); $network_scrip_tag_cd_attr = get_site_option( 'cookiebot-script-tag-cd-attribute', 'custom' ); $network_cookie_blocking_mode = get_site_option( 'cookiebot-cookie-blocking-mode', 'manual' ); } ?>
%s', esc_url( $cookiebot_gdpr_url ), esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' ) ), 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' ) ); ?>
%s', esc_url( $cookiebot_gdpr_url ), esc_html__( 'General Data Protection Regulation (GDPR)', 'cookiebot' ) ), 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' ) ); ?>
and HTML tags
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' ),
'',
''
);
?>
, , and HTML tags
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' ),
'',
'',
'',
''
);
?>
(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');
ga('create', 'UA-00000000-0', 'auto');
ga('send', 'pageview');
HTML;
echo nl2br( esc_html( $output ) );
?>