Cookiebot | GDPR Compliant Cookie Consent and Notice - Version 4.0.3

Version Description

Download this release

Release Info

Developer aytac
Plugin Icon 128x128 Cookiebot | GDPR Compliant Cookie Consent and Notice
Version 4.0.3
Comparing to
See all releases

Code changes from version 4.0.2 to 4.0.3

cookiebot.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control
5
  Plugin URI: https://cookiebot.com/
6
  Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
7
  Author: Cybot A/S
8
- Version: 4.0.2
9
  Author URI: http://cookiebot.com
10
  Text Domain: cookiebot
11
  Domain Path: /langs
5
  Plugin URI: https://cookiebot.com/
6
  Description: Cookiebot is a cloud-driven solution that automatically controls cookies and trackers, enabling full GDPR/ePrivacy and CCPA compliance for websites.
7
  Author: Cybot A/S
8
+ Version: 4.0.3
9
  Author URI: http://cookiebot.com
10
  Text Domain: cookiebot
11
  Domain Path: /langs
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  * Contributors: cookiebot,phpgeekdk,aytac
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
- * Tested up to: 5.8.1
6
- * Stable tag: 4.0.2
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
@@ -196,6 +196,11 @@ You are able to define the mapping between Cookiebot and the WP Consent API in t
196
 
197
 
198
  ## Changelog ##
 
 
 
 
 
199
  ### 4.0.2 - 2022-01-20 ###
200
  * Fixed missing dir path for require_once
201
 
2
  * Contributors: cookiebot,phpgeekdk,aytac
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
+ * Tested up to: 5.9
6
+ * Stable tag: 4.0.3
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
196
 
197
 
198
  ## Changelog ##
199
+ ### 4.0.3 - 2022-02-23 ###
200
+ * Fixed wp-rocket not ignoring cookiebot script
201
+ * Fixed including gtm and gtc scripts when the setting was unchecked
202
+ * Updated addon to support latest version of CAOS
203
+
204
  ### 4.0.2 - 2022-01-20 ###
205
  * Fixed missing dir path for require_once
206
 
src/addons/controller/addons/caos_host_analyticsjs_local/CAOS_Host_Analyticsjs_Local.php CHANGED
@@ -14,7 +14,8 @@ class CAOS_Host_Analyticsjs_Local extends Base_Cookiebot_Plugin_Addon {
14
  const SVN_URL_BASE_PATH = 'https://plugins.svn.wordpress.org/host-analyticsjs-local/trunk/';
15
  const SVN_URL_DEFAULT_SUB_PATH = 'host-analyticsjs-local.php';
16
  const ALTERNATIVE_ADDON_VERSIONS = array(
17
- '1.97' => CAOS_Host_Analyticsjs_Local_Version_1_97::class,
 
18
  );
19
 
20
  /**
@@ -23,58 +24,7 @@ class CAOS_Host_Analyticsjs_Local extends Base_Cookiebot_Plugin_Addon {
23
  * @since 1.3.0
24
  */
25
  public function load_addon_configuration() {
26
-
27
- /* Priority need to be more than 0 so we are able to hook in before output begins */
28
- $script_priority = $this->cookiebot_addon_host_analyticsjs_local_priority();
29
- if ( $script_priority <= 0 ) {
30
- //Force priority to 2
31
- $script_priority = 2;
32
- update_option( 'sgal_enqueue_order', $script_priority );
33
- }
34
-
35
- /**
36
- * ga scripts are loaded in wp_footer priority is defined in option variable
37
- */
38
- if (
39
- has_action( 'wp_footer', 'caos_analytics_render_tracking_code' ) ||
40
- has_action( 'wp_footer', 'caos_render_tracking_code' ) ||
41
- has_action( 'wp_footer', 'add_ga_header_script' ) ||
42
- ( defined( 'CAOS_OPT_SCRIPT_POSITION' ) && CAOS_OPT_SCRIPT_POSITION === 'footer' )
43
- ) {
44
- /**
45
- * Consent not given - no cache
46
- */
47
- $this->buffer_output->add_tag(
48
- 'wp_footer',
49
- $script_priority,
50
- array(
51
- 'GoogleAnalyticsObject' => $this->get_cookie_types(),
52
- ),
53
- false
54
- );
55
- }
56
-
57
- /**
58
- * ga scripts are loaded in wp_head priority is defined in option variable
59
- */
60
- if (
61
- has_action( 'wp_head', 'caos_analytics_render_tracking_code' ) ||
62
- has_action( 'wp_head', 'caos_render_tracking_code' ) ||
63
- has_action( 'wp_head', 'add_ga_header_script' ) ||
64
- ( defined( 'CAOS_OPT_SCRIPT_POSITION' ) && CAOS_OPT_SCRIPT_POSITION !== 'footer' )
65
- ) {
66
- /**
67
- * Consent not given - no cache
68
- */
69
- $this->buffer_output->add_tag(
70
- 'wp_head',
71
- $script_priority,
72
- array(
73
- 'GoogleAnalyticsObject' => $this->get_cookie_types(),
74
- ),
75
- false
76
- );
77
- }
78
  }
79
 
80
  /**
14
  const SVN_URL_BASE_PATH = 'https://plugins.svn.wordpress.org/host-analyticsjs-local/trunk/';
15
  const SVN_URL_DEFAULT_SUB_PATH = 'host-analyticsjs-local.php';
16
  const ALTERNATIVE_ADDON_VERSIONS = array(
17
+ '4.2.6' => CAOS_Host_Analyticsjs_Local_Version_4_2_6::class,
18
+ '1.97' => CAOS_Host_Analyticsjs_Local_Version_1_97::class,
19
  );
20
 
21
  /**
24
  * @since 1.3.0
25
  */
26
  public function load_addon_configuration() {
27
+ $this->script_loader_tag->add_tag( 'caos-analytics', $this->get_cookie_types() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
 
30
  /**
src/addons/controller/addons/caos_host_analyticsjs_local/CAOS_Host_Analyticsjs_Local_Version_4_2_6.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace cybot\cookiebot\addons\controller\addons\caos_host_analyticsjs_local;
4
+
5
+ use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon;
6
+
7
+ class CAOS_Host_Analyticsjs_Local_Version_4_2_6 extends Base_Cookiebot_Plugin_Addon {
8
+
9
+ const ADDON_NAME = 'Complete Analytics Optimization Suite (CAOS) 4.2.6';
10
+ const OPTION_NAME = 'caos_host_analyticsjs_local';
11
+ const DEFAULT_COOKIE_TYPES = array( 'statistics' );
12
+ const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable tracking.';
13
+ const PLUGIN_FILE_PATH = 'host-analyticsjs-local/save-ga-local.php';
14
+ const SVN_URL_BASE_PATH = 'https://plugins.svn.wordpress.org/host-analyticsjs-local/tags/4.2.6/';
15
+ const SVN_URL_DEFAULT_SUB_PATH = 'save-ga-local.php';
16
+
17
+ public function load_addon_configuration() {
18
+
19
+ /* Priority need to be more than 0 so we are able to hook in before output begins */
20
+ $script_priority = $this->cookiebot_addon_host_analyticsjs_local_priority();
21
+ if ( $script_priority <= 0 ) {
22
+ //Force priority to 2
23
+ $script_priority = 2;
24
+ update_option( 'sgal_enqueue_order', $script_priority );
25
+ }
26
+
27
+ /**
28
+ * ga scripts are loaded in wp_footer priority is defined in option variable
29
+ */
30
+ if (
31
+ has_action( 'wp_footer', 'caos_analytics_render_tracking_code' ) ||
32
+ has_action( 'wp_footer', 'caos_render_tracking_code' ) ||
33
+ has_action( 'wp_footer', 'add_ga_header_script' ) ||
34
+ ( defined( 'CAOS_OPT_SCRIPT_POSITION' ) && CAOS_OPT_SCRIPT_POSITION === 'footer' )
35
+ ) {
36
+ /**
37
+ * Consent not given - no cache
38
+ */
39
+ $this->buffer_output->add_tag(
40
+ 'wp_footer',
41
+ $script_priority,
42
+ array(
43
+ 'GoogleAnalyticsObject' => $this->get_cookie_types(),
44
+ ),
45
+ false
46
+ );
47
+ }
48
+
49
+ /**
50
+ * ga scripts are loaded in wp_head priority is defined in option variable
51
+ */
52
+ if (
53
+ has_action( 'wp_head', 'caos_analytics_render_tracking_code' ) ||
54
+ has_action( 'wp_head', 'caos_render_tracking_code' ) ||
55
+ has_action( 'wp_head', 'add_ga_header_script' ) ||
56
+ ( defined( 'CAOS_OPT_SCRIPT_POSITION' ) && CAOS_OPT_SCRIPT_POSITION !== 'footer' )
57
+ ) {
58
+ /**
59
+ * Consent not given - no cache
60
+ */
61
+ $this->buffer_output->add_tag(
62
+ 'wp_head',
63
+ $script_priority,
64
+ array(
65
+ 'GoogleAnalyticsObject' => $this->get_cookie_types(),
66
+ ),
67
+ false
68
+ );
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Get priority of script
74
+ *
75
+ * @return integer
76
+ *
77
+ * @since 1.3.0
78
+ */
79
+ public function cookiebot_addon_host_analyticsjs_local_priority() {
80
+ return ( esc_attr( get_option( 'sgal_enqueue_order' ) ) ) ? esc_attr( get_option( 'sgal_enqueue_order' ) ) : 0;
81
+ }
82
+ }
src/lib/Cookiebot_Javascript_Helper.php CHANGED
@@ -84,7 +84,9 @@ class Cookiebot_Javascript_Helper {
84
  * @throws InvalidArgumentException
85
  */
86
  public function include_google_tag_manager_js( $return_html = false ) {
87
- if ( get_option( 'cookiebot-gtm' ) !== false ) {
 
 
88
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
89
  $data_layer = 'dataLayer';
90
  } else {
@@ -111,7 +113,9 @@ class Cookiebot_Javascript_Helper {
111
  * @throws InvalidArgumentException
112
  */
113
  public function include_google_consent_mode_js( $return_html = false ) {
114
- if ( get_option( 'cookiebot-gcm' ) !== false ) {
 
 
115
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
116
  $data_layer = 'dataLayer';
117
  } else {
84
  * @throws InvalidArgumentException
85
  */
86
  public function include_google_tag_manager_js( $return_html = false ) {
87
+ $option = get_option( 'cookiebot-gtm' );
88
+
89
+ if ( $option !== false && $option !== '' ) {
90
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
91
  $data_layer = 'dataLayer';
92
  } else {
113
  * @throws InvalidArgumentException
114
  */
115
  public function include_google_consent_mode_js( $return_html = false ) {
116
+ $option = get_option( 'cookiebot-gcm' );
117
+
118
+ if ( $option !== false && $option !== '' ) {
119
  if ( empty( get_option( 'cookiebot-data-layer' ) ) ) {
120
  $data_layer = 'dataLayer';
121
  } else {
src/lib/Cookiebot_WP.php CHANGED
@@ -11,7 +11,7 @@ use cybot\cookiebot\widgets\Dashboard_Widget_Cookiebot_Status;
11
  use RuntimeException;
12
 
13
  class Cookiebot_WP {
14
- const COOKIEBOT_PLUGIN_VERSION = '4.0.2';
15
  const COOKIEBOT_MIN_PHP_VERSION = '5.6.0';
16
 
17
  /**
@@ -87,6 +87,7 @@ class Cookiebot_WP {
87
  ( new Cookiebot_Automatic_Updates() )->register_hooks();
88
  ( new Widgets() )->register_hooks();
89
  ( new Cookiebot_Gutenberg_Declaration_Block() )->register_hooks();
 
90
  }
91
 
92
  /**
11
  use RuntimeException;
12
 
13
  class Cookiebot_WP {
14
+ const COOKIEBOT_PLUGIN_VERSION = '4.0.3';
15
  const COOKIEBOT_MIN_PHP_VERSION = '5.6.0';
16
 
17
  /**
87
  ( new Cookiebot_Automatic_Updates() )->register_hooks();
88
  ( new Widgets() )->register_hooks();
89
  ( new Cookiebot_Gutenberg_Declaration_Block() )->register_hooks();
90
+ ( new WP_Rocket_Helper() )->register_hooks();
91
  }
92
 
93
  /**