iubenda Cookie Solution for GDPR - Version 1.11.2-beta2

Version Description

Download this release

Release Info

Developer Facens
Plugin Icon 128x128 iubenda Cookie Solution for GDPR
Version 1.11.2-beta2
Comparing to
See all releases

Code changes from version 1.11.1 to 1.11.2-beta2

iubenda-cookie-class/iubenda.class.faster.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /**
4
  * iubenda.class.php
5
- * version: 2.0.0
6
  * codename: Faster
7
  * @author: Copyright 2015 iubenda
8
  * @license GNU/GPL
@@ -21,7 +21,7 @@
21
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22
  */
23
 
24
- class Faster
25
  {
26
  /*
27
  Variables
@@ -31,6 +31,10 @@
31
  (
32
  array
33
  (
 
 
 
 
34
  "platform.twitter.com/widgets.js",
35
  "apis.google.com/js/plusone.js",
36
  "apis.google.com/js/platform.js",
@@ -38,7 +42,13 @@
38
  "www.youtube.com/iframe_api",
39
  "pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
40
  "sharethis.com/button/buttons.js",
41
- "addthis.com/js/"
 
 
 
 
 
 
42
  ),
43
  array
44
  (
@@ -70,18 +80,20 @@
70
  Check if a string is in the black list.
71
  */
72
 
73
- if(empty($offender) || empty($blacklist))
74
- {
75
  return false;
 
76
  }
77
 
78
  /**/
79
 
80
  foreach($blacklist as $black)
81
  {
82
- if(strpos($offender, $black) !== false)
83
- {
84
  return true;
 
85
  }
86
  }
87
 
@@ -130,8 +142,8 @@
130
  Parse the founded elements and check who is in black.
131
  */
132
 
133
- foreach($scripts as $script) {
134
-
135
  $src = $script -> getAttribute("src");
136
 
137
  /**/
2
 
3
  /**
4
  * iubenda.class.php
5
+ * version: 2.0.2
6
  * codename: Faster
7
  * @author: Copyright 2015 iubenda
8
  * @license GNU/GPL
21
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22
  */
23
 
24
+ class iubendaFaster
25
  {
26
  /*
27
  Variables
31
  (
32
  array
33
  (
34
+ /*
35
+ Domains
36
+ */
37
+
38
  "platform.twitter.com/widgets.js",
39
  "apis.google.com/js/plusone.js",
40
  "apis.google.com/js/platform.js",
42
  "www.youtube.com/iframe_api",
43
  "pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
44
  "sharethis.com/button/buttons.js",
45
+ "addthis.com/js/",
46
+
47
+ /*
48
+ JavaScript
49
+ */
50
+
51
+ "window.adsbygoogle"
52
  ),
53
  array
54
  (
80
  Check if a string is in the black list.
81
  */
82
 
83
+ if(empty($offender) || empty($blacklist)) {
84
+
85
  return false;
86
+
87
  }
88
 
89
  /**/
90
 
91
  foreach($blacklist as $black)
92
  {
93
+ if(strpos($offender, $black) !== false) {
94
+
95
  return true;
96
+
97
  }
98
  }
99
 
142
  Parse the founded elements and check who is in black.
143
  */
144
 
145
+ foreach($scripts as $script)
146
+ {
147
  $src = $script -> getAttribute("src");
148
 
149
  /**/
iubenda-cookie-class/iubenda.class.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * iubenda.class.php
4
- * version: 1.0.1
5
  * @author: Copyright 2015 iubenda
6
  * @license GNU/GPL
7
  * This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
  */
21
 
22
- class Page {
23
 
24
  const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/sU';
25
 
@@ -31,7 +31,8 @@
31
  'www.youtube.com/iframe_api',
32
  'pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
33
  'sharethis.com/button/buttons.js',
34
- 'addthis.com/js/'
 
35
  );
36
 
37
  public $auto_iframe_tags = array(
@@ -43,7 +44,8 @@
43
  'www.google.com/maps/embed/',
44
  'player.vimeo.com/video',
45
  'maps.google.it/maps',
46
- 'www.google.com/maps/embed'
 
47
  );
48
 
49
  public $iub_comments_detected = array();
1
  <?php
2
  /**
3
  * iubenda.class.php
4
+ * version: 1.0.2
5
  * @author: Copyright 2015 iubenda
6
  * @license GNU/GPL
7
  * This program is free software: you can redistribute it and/or modify
19
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
  */
21
 
22
+ class iubendaPage {
23
 
24
  const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/sU';
25
 
31
  'www.youtube.com/iframe_api',
32
  'pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
33
  'sharethis.com/button/buttons.js',
34
+ 'addthis.com/js/',
35
+ 'window.adsbygoogle'
36
  );
37
 
38
  public $auto_iframe_tags = array(
44
  'www.google.com/maps/embed/',
45
  'player.vimeo.com/video',
46
  'maps.google.it/maps',
47
+ 'www.google.com/maps/embed',
48
+ 'window.adsbygoogle'
49
  );
50
 
51
  public $iub_comments_detected = array();
iubenda_cookie_solution.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://www.iubenda.com
6
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
7
  * Author: iubenda
8
- * Version: 1.11.1
9
  * Text Domain: iubenda-cookie-wp-plugin
10
  * Author URI: https://www.iubenda.com
11
  */
@@ -23,6 +23,20 @@
23
 
24
  /**/
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  if(defined("XMLRPC_REQUEST") && XMLRPC_REQUEST || defined("DOING_AJAX") && DOING_AJAX || isset($_SERVER["HTTP_X_REQUESTED_WITH"]) || isset($_GET["iub_no_parse"])) {
27
 
28
  return;
@@ -40,15 +54,77 @@
40
 
41
  /****/
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  function iubenda_load_admin_panel()
44
  {
45
  /*
46
  * Checks
47
  */
48
 
49
- if(function_exists("icl_object_id"))
50
- {
51
  define("IUBENDA_WPML", true);
 
52
  }
53
 
54
  if(!function_exists("file_get_html"))
@@ -63,9 +139,10 @@
63
  * Admin
64
  */
65
 
66
- if(is_admin())
67
- {
68
  add_action("admin_menu", "iub_admin");
 
69
  }
70
  }
71
 
@@ -75,28 +152,29 @@
75
 
76
  function __iubenda_content_type()
77
  {
78
- if(get_option("iubenda_ctype"))
79
- {
80
- $iub_headers = headers_list();
81
- $destroy = true;
82
-
83
- /**/
84
-
85
- foreach($iub_headers as $h)
86
- {
87
- if(strpos($h, "Content-Type: text/html") !== false || strpos($h, "Content-type: text/html") !== false)
88
- {
89
- $destroy = false;
90
- }
91
- }
92
-
93
- /**/
94
-
95
- if($destroy)
96
- {
97
- define("IUBENDA_NO_HTML", true);
98
- }
99
- }
 
100
  }
101
 
102
  /***/
@@ -246,7 +324,7 @@
246
 
247
  if(get_option("parser_engine") == "new")
248
  {
249
- $faster = new Faster;
250
 
251
  /**/
252
 
@@ -258,7 +336,7 @@
258
  }
259
  else
260
  {
261
- $page = new Page($output);
262
  $page->parse();
263
 
264
  /**/
@@ -293,6 +371,12 @@
293
 
294
  function iub_admin()
295
  {
 
 
 
 
 
 
296
  add_menu_page("Iubenda - Settings", "Iubenda", "administrator", __FILE__, "__iub_admin_load");
297
  }
298
 
@@ -419,7 +503,7 @@
419
 
420
  if(get_option("parser_engine") == "default") $parser_engine_default = 'checked="true"';
421
  if(get_option("parser_engine") == "new") $parser_engine_new = 'checked="true"';
422
-
423
  /**/
424
 
425
  echo '
5
  * Plugin URI: https://www.iubenda.com
6
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
7
  * Author: iubenda
8
+ * Version: 1.11.2-beta2
9
  * Text Domain: iubenda-cookie-wp-plugin
10
  * Author URI: https://www.iubenda.com
11
  */
23
 
24
  /**/
25
 
26
+ function iubenda_autofix_auto()
27
+ {
28
+ if(isset($_POST["iubenda_autofix"])) {
29
+
30
+ update_option("skip_parsing", false);
31
+
32
+ }
33
+ }
34
+
35
+ add_action('wp_ajax_iubenda-autofix-post', 'iubenda_autofix_auto');
36
+ add_action('wp_ajax_nopriv_iubenda-autofix-post', 'iubenda_autofix_auto');
37
+
38
+ /**/
39
+
40
  if(defined("XMLRPC_REQUEST") && XMLRPC_REQUEST || defined("DOING_AJAX") && DOING_AJAX || isset($_SERVER["HTTP_X_REQUESTED_WITH"]) || isset($_GET["iub_no_parse"])) {
41
 
42
  return;
54
 
55
  /****/
56
 
57
+ function iubenda_detect_conflicts()
58
+ {
59
+ if(!function_exists("get_plugins")) {
60
+
61
+ return false;
62
+
63
+ }
64
+
65
+ /*
66
+ Blacklist
67
+ */
68
+
69
+ $blacklist = array
70
+ (
71
+ "WP Super Cache"
72
+ );
73
+
74
+ $plugins = get_plugins();
75
+
76
+ foreach($plugins as $plugin)
77
+ {
78
+ foreach($blacklist as $black)
79
+ {
80
+ if($plugin["Name"] === $black) {
81
+
82
+ return true;
83
+
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ function iubenda_conflicts_notice()
90
+ {
91
+ echo '
92
+ <div class="notice notice-error is-dismissible">
93
+ <p id="iubenda-fix-text"><a href="#iubenda-fix" id="iubenda-fix">fix it</a> - iubenda</p>
94
+ </div>
95
+ <script type="text/javascript">
96
+ document.getElementById("iubenda-fix").onclick = function(e)
97
+ {
98
+ e.preventDefault();
99
+
100
+ jQuery.ajax({
101
+ type: "POST",
102
+ url: "http://" + document.location.hostname + ":8888/wp-admin/admin-ajax.php",
103
+ data: {
104
+
105
+ action: "iubenda-autofix-post",
106
+ iubenda_autofix: "true"
107
+
108
+ },
109
+ dataType: "json"
110
+ }).done(function(json){}).fail(function(){});
111
+ }
112
+ </script>
113
+ ';
114
+ }
115
+
116
+ /***/
117
+
118
  function iubenda_load_admin_panel()
119
  {
120
  /*
121
  * Checks
122
  */
123
 
124
+ if(function_exists("icl_object_id")) {
125
+
126
  define("IUBENDA_WPML", true);
127
+
128
  }
129
 
130
  if(!function_exists("file_get_html"))
139
  * Admin
140
  */
141
 
142
+ if(is_admin()) {
143
+
144
  add_action("admin_menu", "iub_admin");
145
+
146
  }
147
  }
148
 
152
 
153
  function __iubenda_content_type()
154
  {
155
+ if(get_option("iubenda_ctype"))
156
+ {
157
+ $iub_headers = headers_list();
158
+ $destroy = true;
159
+
160
+ /**/
161
+
162
+ foreach($iub_headers as $h)
163
+ {
164
+ if(strpos($h, "Content-Type: text/html") !== false || strpos($h, "Content-type: text/html") !== false)
165
+ {
166
+ $destroy = false;
167
+ }
168
+ }
169
+
170
+ /**/
171
+
172
+ if($destroy) {
173
+
174
+ define("IUBENDA_NO_HTML", true);
175
+
176
+ }
177
+ }
178
  }
179
 
180
  /***/
324
 
325
  if(get_option("parser_engine") == "new")
326
  {
327
+ $faster = new iubendaFaster;
328
 
329
  /**/
330
 
336
  }
337
  else
338
  {
339
+ $page = new iubendaPage($output);
340
  $page->parse();
341
 
342
  /**/
371
 
372
  function iub_admin()
373
  {
374
+ if(iubenda_detect_conflicts() && get_option("skip_parsing")) {
375
+
376
+ add_action("admin_notices", "iubenda_conflicts_notice");
377
+
378
+ }
379
+
380
  add_menu_page("Iubenda - Settings", "Iubenda", "administrator", __FILE__, "__iub_admin_load");
381
  }
382
 
503
 
504
  if(get_option("parser_engine") == "default") $parser_engine_default = 'checked="true"';
505
  if(get_option("parser_engine") == "new") $parser_engine_new = 'checked="true"';
506
+
507
  /**/
508
 
509
  echo '
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: iubenda
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, cookie block, privacy policy, cookie consent, privacy
5
  Requires at least: 3.0.1
6
- Tested up to: 4.4.1
7
  Stable tag: 1.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -19,9 +19,9 @@ NOTE: This plugin is a beta and could in certain situations still have bugs. We
19
  * Find a comprehensive _guide and demo_ to the cookie law solution on our help blog https://www.iubenda.com/en/help/posts/1177
20
 
21
  This plugin is an All-in-One approach developed by iubenda that helps with generating the privacy policy text, the cookie banner and the blocking management of cookies.
22
- This plugin works with the Iubenda Cookie Law Solution and allows to block the most common widgets and third party cookies to comply with Cookie Laws, particularly with the Italian cookie law implementation in mind.
23
 
24
- * The plugin automatically inserts the Iubenda code in the head of every page of the site
25
  * It allows to manually block all the remaining resources, without the need of direct intervention on the code
26
  * It handles the display of cookie banners and cookie policy, saving user preferences about the use of cookies
27
  * It displays a clean page (without banner) to users who have already provided their consent
@@ -41,7 +41,7 @@ This plugin works with the Iubenda Cookie Law Solution and allows to block the m
41
  **Some background information**
42
 
43
  If you have European users you will know the problem: you need to obtain consent for the usage of many types of cookies and you need to manage that consent somehow. Now even Google forces cookie consent onto users of Google AdSense, DoubleClick for Publishers, and DoubleClick Ad Exchange (and even Google Analytics in some cases). Time to get started with a cookie banner.
44
- Iubenda and the Cookie Law Solution extension for WordPress help remove these complex tasks with a couple of clicks. This extension works with the Iubenda Cookie Law Solution, displays a cookie banner in 8 languages and saves consent for returning users.
45
 
46
  **Which languages does iubenda work in currently?**
47
 
@@ -107,8 +107,8 @@ Il plugin Wordpress di iubenda permette di semplificare l’adeguamento del prop
107
 
108
  **NOTE: This plugin is a beta and could in certain situations still have bugs. We encourage you to actively let us know about any issues here:** [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti)
109
 
110
- - **Installation via WP.org**: search in your WordPress plugin admin panel for "Iubenda Cookie Solution", install it;
111
- - Once the plugin is installed and activated, go to the Admin Panel (Settings > Iubenda Cookie Solution) where you will be asked to paste the code into tht field that gets generated from your Iubenda account dashboard when you activate the cookie law kit for your privacy policy. For more information on how to activate the cookie law kit, see this article: https://www.iubenda.com/it/help/posts/680;
112
  - At this point the plugin will begin to show the banner on which displays your cookie policy (link) to users who visit the site for the first time. No need for other configurations;
113
  - Furthermore, the plugin automatically recognizes and blocks cookies that get installed via the YouTube video player and social widgets - such as the Facebook Like Box - on your site. **Important note** the scripts for Facebook, Twitter, G+, and YouTube iframe only get blocked automatically when generated from the server side (therefore processed by PHP via WordPress). Scripts that are added to the page via Javascript after page load cannot be blocked automatically;
114
  - The other scripts that install cookies for which the automatic block isn't yet available can and should be "wrapped" using these comments:
@@ -124,8 +124,8 @@ Il plugin Wordpress di iubenda permette di semplificare l’adeguamento del prop
124
 
125
  ------ ITALIANO ------
126
 
127
- - **Installazione automatica**: installa da WordPres.org cercando "Iubenda Cookie Solution";
128
- - Una volta installato ed attivato il plugin, accedi al pannello Admin (Impostazioni > Iubenda Cookie Solution) dove ti verrà chiesto di incollare in un campo il codice che iubenda genera quando attivi il kit cookie law sulla tua privacy policy. Per ulteriori informazioni su come attivare il kit cookie law, consulta questo articolo: https://www.iubenda.com/it/help/posts/680;
129
  - A questo punto il plugin inizierà a mostrare il banner in cui è richiamata la tua cookie policy agli utenti che visitano il sito per la prima volta senza la necessità di altre configurazioni;
130
  - In più, il plugin riconoscerà e bloccherà in automatico i cookie installati da tutti i video player di YouTube e dai widget sociali – come il Facebook Like Box – presenti sul tuo sito. **Nota importante**: il nostro plugin wordpress blocca in modo automatico tutti gli script Facebook, Twitter, G+, iframe youtube che sono generati lato server (quindi restituiti via PHP da wordpress). Script che vengono inseriti nella pagina dopo il loading della pagina tramite Javascript non sono e non possono essere bloccati in modo automatico;
131
  - Gli altri script per i quali non è ancora disponibile il blocco automatico – e che installano cookie che richiedono il blocco prima del consenso – vanno “avvolti” utilizzando questi commenti:
@@ -150,6 +150,10 @@ Yes, right here: https://www.iubenda.com/en/help/posts/1177
150
 
151
  == Changelog ==
152
 
 
 
 
 
153
  = 1.11.1 =
154
  * New: Created a new option that disables the plugin on RSS feeds
155
  * New: Improved the control that checks if the request content type is HTML
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, cookie block, privacy policy, cookie consent, privacy
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.5.2
7
  Stable tag: 1.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
19
  * Find a comprehensive _guide and demo_ to the cookie law solution on our help blog https://www.iubenda.com/en/help/posts/1177
20
 
21
  This plugin is an All-in-One approach developed by iubenda that helps with generating the privacy policy text, the cookie banner and the blocking management of cookies.
22
+ This plugin works with the iubenda Cookie Law Solution and allows to block the most common widgets and third party cookies to comply with Cookie Laws, particularly with the Italian cookie law implementation in mind.
23
 
24
+ * The plugin automatically inserts the iubenda code in the head of every page of the site
25
  * It allows to manually block all the remaining resources, without the need of direct intervention on the code
26
  * It handles the display of cookie banners and cookie policy, saving user preferences about the use of cookies
27
  * It displays a clean page (without banner) to users who have already provided their consent
41
  **Some background information**
42
 
43
  If you have European users you will know the problem: you need to obtain consent for the usage of many types of cookies and you need to manage that consent somehow. Now even Google forces cookie consent onto users of Google AdSense, DoubleClick for Publishers, and DoubleClick Ad Exchange (and even Google Analytics in some cases). Time to get started with a cookie banner.
44
+ iubenda and the Cookie Law Solution extension for WordPress help remove these complex tasks with a couple of clicks. This extension works with the iubenda Cookie Law Solution, displays a cookie banner in 8 languages and saves consent for returning users.
45
 
46
  **Which languages does iubenda work in currently?**
47
 
107
 
108
  **NOTE: This plugin is a beta and could in certain situations still have bugs. We encourage you to actively let us know about any issues here:** [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti)
109
 
110
+ - **Installation via WP.org**: search in your WordPress plugin admin panel for "iubenda Cookie Solution", install it;
111
+ - Once the plugin is installed and activated, go to the Admin Panel (Settings > iubenda Cookie Solution) where you will be asked to paste the code into tht field that gets generated from your iubenda account dashboard when you activate the cookie law kit for your privacy policy. For more information on how to activate the cookie law kit, see this article: https://www.iubenda.com/it/help/posts/680;
112
  - At this point the plugin will begin to show the banner on which displays your cookie policy (link) to users who visit the site for the first time. No need for other configurations;
113
  - Furthermore, the plugin automatically recognizes and blocks cookies that get installed via the YouTube video player and social widgets - such as the Facebook Like Box - on your site. **Important note** the scripts for Facebook, Twitter, G+, and YouTube iframe only get blocked automatically when generated from the server side (therefore processed by PHP via WordPress). Scripts that are added to the page via Javascript after page load cannot be blocked automatically;
114
  - The other scripts that install cookies for which the automatic block isn't yet available can and should be "wrapped" using these comments:
124
 
125
  ------ ITALIANO ------
126
 
127
+ - **Installazione automatica**: installa da WordPres.org cercando "iubenda Cookie Solution";
128
+ - Una volta installato ed attivato il plugin, accedi al pannello Admin (Impostazioni > iubenda Cookie Solution) dove ti verrà chiesto di incollare in un campo il codice che iubenda genera quando attivi il kit cookie law sulla tua privacy policy. Per ulteriori informazioni su come attivare il kit cookie law, consulta questo articolo: https://www.iubenda.com/it/help/posts/680;
129
  - A questo punto il plugin inizierà a mostrare il banner in cui è richiamata la tua cookie policy agli utenti che visitano il sito per la prima volta senza la necessità di altre configurazioni;
130
  - In più, il plugin riconoscerà e bloccherà in automatico i cookie installati da tutti i video player di YouTube e dai widget sociali – come il Facebook Like Box – presenti sul tuo sito. **Nota importante**: il nostro plugin wordpress blocca in modo automatico tutti gli script Facebook, Twitter, G+, iframe youtube che sono generati lato server (quindi restituiti via PHP da wordpress). Script che vengono inseriti nella pagina dopo il loading della pagina tramite Javascript non sono e non possono essere bloccati in modo automatico;
131
  - Gli altri script per i quali non è ancora disponibile il blocco automatico – e che installano cookie che richiedono il blocco prima del consenso – vanno “avvolti” utilizzando questi commenti:
150
 
151
  == Changelog ==
152
 
153
+ = 1.11.2 =
154
+ * Various Bug Fixes and optimizations
155
+ * Updates to the parsing engine (better handling of Google AdSense, various fixes and optimizations)
156
+
157
  = 1.11.1 =
158
  * New: Created a new option that disables the plugin on RSS feeds
159
  * New: Improved the control that checks if the request content type is HTML