Cookiebot | GDPR Compliant Cookie Consent and Notice - Version 4.1.1

Version Description

Download this release

Release Info

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

Code changes from version 4.1.0 to 4.1.1

CookiebotAPI.md DELETED
@@ -1,93 +0,0 @@
1
- # How do I make my plugin support Cookiebot?
2
- If you favourite plugins doesn’t support Cookiebot you are always welcome to ask the author to add support for Cookiebot.
3
- Cookiebot provides a helper function to check if there is an active, working version of Cookiebot on the website.
4
- The easiest way for at developer to implement Cookiebot support is to add a check for Cookiebot where tags are outputted to the visitor.
5
-
6
- This can be done following way:
7
-
8
- ```php
9
- $scriptTag = ";
10
- if(function_exists('cookiebot_active') && cookiebot_active()) {
11
- $scriptTag = '<script'.cookiebot_assist('statistics').'>';
12
- }
13
- ```
14
-
15
- A users consent state can be be aquired through Cookiebots JS API.
16
-
17
- The following properties are available on the Cookiebot object:
18
-
19
- | Name | Type | Default | Description |
20
- |---------------------|:----:|:-------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
21
- | consent.necessary | bool | true | True if current user has accepted necessary cookies. <br> The property is read only. |
22
- | consent.preferences | bool | false | True if current user has accepted preference cookies. <br> The property is read only. |
23
- | consent.statistics | bool | false | True if current user has accepted statistics cookies. <br> The property is read only. |
24
- | consent.marketing | bool | false | True if current user has accepted marketing cookies. <br> The property is read only. |
25
- | consented | bool | false | True if the user has accepted cookies. <br> The property is read only. |
26
- | declined | bool | false | True if the user has declined the use of cookies. <br> The property is read only. |
27
- | hasResponse | bool | false | True if the user has responded to the dialog with either 'accept' or 'decline'. |
28
- | doNotTrack | bool | false | True if the user has enabled the web browser's 'Do not track' (DNT) setting. <br> If DNT is enabled Cookiebot will not set the third party cookie CookieConsentBulkTicket used for bulk consent. <br> The property is read only. |
29
-
30
- Callbacks
31
-
32
- | Name | Description |
33
- |-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
34
- | CookiebotCallback_OnLoad | The asynchronous callback is triggered when the cookie banner has loaded to get the user's consent. |
35
- | CookiebotCallback_OnAccept | The asynchronous callback is triggered when the user clicks the accept-button of the cookie consent dialog and whenever a consented user loads a page. | |
36
- | CookiebotCallback_OnDecline | The asynchronous callback is triggered when the user declines the use of cookies by clicking the decline-button in the cookie consent dialog. The callback is also triggered whenever a user that has declined the use of cookies loads a page. | |
37
-
38
-
39
- And through PHP:
40
-
41
- ```php
42
- if (isset($_COOKIE["CookieConsent"]))
43
- {
44
- switch ($_COOKIE["CookieConsent"])
45
- {
46
- case "0":
47
- //The user has not accepted cookies - set strictly necessary cookies only
48
- break;
49
-
50
- case "-1":
51
- //The user is not within a region that requires consent - all cookies are accepted
52
- break;
53
-
54
- default: //The user has accepted one or more type of cookies
55
-
56
- //Read current user consent in encoded JavaScript format
57
- $valid_php_json = preg_replace('/\s*:\s*([a-zA-Z0-9_]+?)([}\[,])/', ':"$1"$2', preg_replace('/([{\[,])\s*([a-zA-Z0-9_]+?):/', '$1"$2":', str_replace("'", '"',stripslashes($_COOKIE["CookieConsent"]))));
58
- $CookieConsent = json_decode($valid_php_json);
59
-
60
- if (filter_var($CookieConsent->preferences, FILTER_VALIDATE_BOOLEAN))
61
- {
62
- //Current user accepts preference cookies
63
- }
64
- else
65
- {
66
- //Current user does NOT accept preference cookies
67
- }
68
-
69
- if (filter_var($CookieConsent->statistics, FILTER_VALIDATE_BOOLEAN))
70
- {
71
- //Current user accepts statistics cookies
72
- }
73
- else
74
- {
75
- //Current user does NOT accept statistics cookies
76
- }
77
-
78
- if (filter_var($CookieConsent->marketing, FILTER_VALIDATE_BOOLEAN))
79
- {
80
- //Current user accepts marketing cookies
81
- }
82
- else
83
- {
84
- //Current user does NOT accept marketing cookies
85
- }
86
- }
87
- }
88
- else
89
- {
90
- //The user has not accepted cookies - set strictly necessary cookies only
91
- }
92
- ```
93
- More details are available at https://www.cookiebot.com/goto/developer/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1.0
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.1.1
9
  Author URI: http://cookiebot.com
10
  Text Domain: cookiebot
11
  Domain Path: /langs
readme.txt CHANGED
@@ -3,7 +3,7 @@
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
  * Tested up to: 6.0.0
6
- * Stable tag: 4.1.0
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
@@ -198,6 +198,9 @@ You are able to define the mapping between Cookiebot and the WP Consent API in t
198
  Cookiebot is compatible with translation plugins when you set language to "Use WordPress Language".
199
 
200
  ## Changelog ##
 
 
 
201
  ### 4.1.0 - 2022-06-15 ###
202
  * Added setting to ignore scripts from cookiebot scan
203
  * Fixed PHP8 warnings
3
  * Tags: cookie, compliance, eu, gdpr, europe, cookie consent, consent, ccpa
4
  * Requires at least: 4.4
5
  * Tested up to: 6.0.0
6
+ * Stable tag: 4.1.1
7
  * Requires PHP: 5.6
8
  * License: GPLv2 or later
9
 
198
  Cookiebot is compatible with translation plugins when you set language to "Use WordPress Language".
199
 
200
  ## Changelog ##
201
+ ### 4.1.1 - 2022-07-01 ###
202
+ * Fixed undefined variable src when using instagram embed
203
+
204
  ### 4.1.0 - 2022-06-15 ###
205
  * Added setting to ignore scripts from cookiebot scan
206
  * Fixed PHP8 warnings
src/addons/controller/addons/embed_autocorrect/Embed_Autocorrect.php CHANGED
@@ -290,6 +290,15 @@ class Embed_Autocorrect extends Base_Cookiebot_Other_Addon {
290
  $matches
291
  );
292
  foreach ( $matches[0] as $match ) {
 
 
 
 
 
 
 
 
 
293
  //Replace - and add cookie consent notice.
294
  $adjusted = str_replace(
295
  ' src=',
290
  $matches
291
  );
292
  foreach ( $matches[0] as $match ) {
293
+ preg_match( '/src\s*=\s*"(.+?)"/', $match, $src );
294
+
295
+ //$matches[1] will have the text that matched the first captured parenthesized
296
+ if ( isset( $src[1] ) ) {
297
+ $src = $src[1];
298
+ } else {
299
+ $src = '';
300
+ }
301
+
302
  //Replace - and add cookie consent notice.
303
  $adjusted = str_replace(
304
  ' src=',
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.1.0';
15
  const COOKIEBOT_MIN_PHP_VERSION = '5.6.0';
16
 
17
  /**
11
  use RuntimeException;
12
 
13
  class Cookiebot_WP {
14
+ const COOKIEBOT_PLUGIN_VERSION = '4.1.1';
15
  const COOKIEBOT_MIN_PHP_VERSION = '5.6.0';
16
 
17
  /**