iubenda Cookie Solution for GDPR - Version 1.9.9

Version Description

  • Bugs page 60000 chars
Download this release

Release Info

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

Code changes from version 1.9.7 to 1.9.9

assets/banner-1544x500..png ADDED
Binary file
assets/banner-1544x500.jpg ADDED
Binary file
assets/banner-772x250.jpg ADDED
Binary file
assets/banner-772x250.png ADDED
Binary file
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
iubenda_cookie_solution.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: https://www.iubenda.com
5
  Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
6
  Author: iubenda
7
- Version: 1.9.7
8
  Author URI: https://www.iubenda.com
9
  */
10
 
@@ -12,6 +12,7 @@
12
  include_once 'simple_html_dom.php';
13
  }
14
 
 
15
  DEFINE('VOICE_MENU', 'Iubenda Cookie Solution');
16
  DEFINE('URL_MENU', str_replace(' ', '_', VOICE_MENU));
17
  DEFINE('IUB_REGEX_PATTERN', '/<!--IUB_COOKIE_POLICY_START-->(.*)<!--IUB_COOKIE_POLICY_END-->/sU');
@@ -54,7 +55,7 @@
54
  $iub_code = get_option('iub_code');
55
  $str = html_entity_decode(stripslashes($iub_code));
56
 
57
- if(!consentGiven()){
58
  $str.="\n
59
  <script>
60
  (function(){
@@ -122,7 +123,7 @@
122
  $js = '';
123
 
124
  foreach($elements as $e){
125
-
126
  switch($e->tag){
127
  case 'script':
128
  $s = $e->innertext;
@@ -130,6 +131,7 @@
130
  break;
131
 
132
  default:
 
133
  $js.= '<noscript class="_no_script_iub">';
134
  $js.= $e->outertext;
135
  $js.= '</noscript>';
@@ -167,21 +169,25 @@
167
  'apis.google.com/js/plusone.js',
168
  'apis.google.com/js/platform.js',
169
  'connect.facebook.net',
170
- 'www.youtube.com/iframe_api'
 
171
  );
172
 
173
  $auto_iframe_tags = array(
174
  'youtube.com',
175
  'platform.twitter.com',
176
  'www.facebook.com/plugins/like.php',
177
- 'apis.google.com'
 
178
  );
179
 
180
 
181
- if(consentGiven()){
 
182
  return $output;
183
  }
184
 
 
185
  /* Replace all the comments with js/html encoded code */
186
  preg_match_all(IUB_REGEX_PATTERN, $output, $scripts);
187
  if(is_array($scripts[1])){
@@ -224,13 +230,13 @@
224
  }
225
 
226
  /* Auto match iframe and replace */
227
- $iframes = $html->find("iframe");
228
  if(is_array($iframes)){
229
  $count = count($iframes);
230
  for($j=0; $j<$count; $j++){
231
  $i = $iframes[$j];
232
  $src = $i->src;
233
- if (strpos_array($src, $auto_iframe_tags) !== false){
234
  $new_src = "data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+";
235
  $class = $i->class;
236
  $i->suppressedsrc = $src;
@@ -252,9 +258,7 @@
252
 
253
 
254
  function iub_func($atts, $content = "") {
255
- /* Shortcode function */
256
- $html = str_get_html($content, $lowercase=true, $forceTagsClosed=true, $stripRN=false);
257
- return create_tags($html);
258
  }
259
 
260
 
4
  Plugin URI: https://www.iubenda.com
5
  Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
6
  Author: iubenda
7
+ Version: 1.9.8
8
  Author URI: https://www.iubenda.com
9
  */
10
 
12
  include_once 'simple_html_dom.php';
13
  }
14
 
15
+ DEFINE('DEBUG', 0);
16
  DEFINE('VOICE_MENU', 'Iubenda Cookie Solution');
17
  DEFINE('URL_MENU', str_replace(' ', '_', VOICE_MENU));
18
  DEFINE('IUB_REGEX_PATTERN', '/<!--IUB_COOKIE_POLICY_START-->(.*)<!--IUB_COOKIE_POLICY_END-->/sU');
55
  $iub_code = get_option('iub_code');
56
  $str = html_entity_decode(stripslashes($iub_code));
57
 
58
+ if(!consentGiven() && !DEBUG){
59
  $str.="\n
60
  <script>
61
  (function(){
123
  $js = '';
124
 
125
  foreach($elements as $e){
126
+
127
  switch($e->tag){
128
  case 'script':
129
  $s = $e->innertext;
131
  break;
132
 
133
  default:
134
+
135
  $js.= '<noscript class="_no_script_iub">';
136
  $js.= $e->outertext;
137
  $js.= '</noscript>';
169
  'apis.google.com/js/plusone.js',
170
  'apis.google.com/js/platform.js',
171
  'connect.facebook.net',
172
+ 'www.youtube.com/iframe_api',
173
+ 'pagead2.googlesyndication.com/pagead/show_ads.js'
174
  );
175
 
176
  $auto_iframe_tags = array(
177
  'youtube.com',
178
  'platform.twitter.com',
179
  'www.facebook.com/plugins/like.php',
180
+ 'apis.google.com',
181
+ 'www.google.com/maps/embed/'
182
  );
183
 
184
 
185
+
186
+ if(consentGiven() && !DEBUG){
187
  return $output;
188
  }
189
 
190
+
191
  /* Replace all the comments with js/html encoded code */
192
  preg_match_all(IUB_REGEX_PATTERN, $output, $scripts);
193
  if(is_array($scripts[1])){
230
  }
231
 
232
  /* Auto match iframe and replace */
233
+ $iframes = $html->find("iframe");
234
  if(is_array($iframes)){
235
  $count = count($iframes);
236
  for($j=0; $j<$count; $j++){
237
  $i = $iframes[$j];
238
  $src = $i->src;
239
+ if (strpos_array($src, $auto_iframe_tags) !== false){
240
  $new_src = "data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+";
241
  $class = $i->class;
242
  $i->suppressedsrc = $src;
258
 
259
 
260
  function iub_func($atts, $content = "") {
261
+ return '<!--IUB_COOKIE_POLICY_START-->'.do_shortcode($content).'<!--IUB_COOKIE_POLICY_END-->';
 
 
262
  }
263
 
264
 
readme.txt CHANGED
@@ -8,7 +8,7 @@ Stable tag: 1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- A plugin for the Iubenda Cookie Law Solution & allows to block the most common widgets to comply with Cookie Laws, particularly fit for Italy.
12
 
13
  == Description ==
14
 
@@ -45,10 +45,21 @@ Under "Installation/Other Notes" you will find instructions in both English and
45
  `<!--IUB_COOKIE_POLICY_START-->
46
  <!--IUB_COOKIE_POLICY_END-->`
47
 
 
 
 
 
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
50
  = 1.9.7 =
51
- * minor bugfix
52
 
53
  = 1.9.6 =
54
  * bugfix: custom banner now allowed
@@ -109,12 +120,14 @@ In case of continued browsing, the preferences of your users for the use of cook
109
 
110
  At the moment the automatic blocking of the YouTube video player and social widgets are done only if these scripts are located after the function wp_head(). The solution is the first version. Test it and contact us to report any errors.
111
 
112
- # Bug reports
 
 
113
 
114
  * The best way you can help us is by providing as much information as possible, including the use of wp_debug https://codex.wordpress.org/Debugging_in_WordPress.
115
  * We will be very happy to receive feedback here: http://gsfn.us/t/4qpks
116
 
117
- # Istruzioni in italiano
118
 
119
  Per esempio in un plugin Facebook dovrai fare come segue:
120
 
@@ -148,7 +161,7 @@ In caso di proseguimento della navigazione, le preferenze dei tuoi utenti circa
148
 
149
  Al momento il blocco automatico dei video player di YouTube e dei widget sociali avviene solo se questi script si trovano dopo la funzione wp_head(). La soluzione è alla prima versione. Testatela e contattateci per segnalare eventuali errori.
150
 
151
- # Segnalazioni di bug
152
 
153
  * Il modo migliore per aiutarci è quello di fornire quante più informazioni possibili, compreso l'uso di wp_debug https://codex.wordpress.org/Debugging_in_WordPress.
154
  * Saremo molto contenti di ricevere feedback qui: http://gsfn.us/t/4qpks
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ A plugin that works with the iubenda Cookie Law Solution that shows a cookie banner & allows blocking prior to consent, particularly fit for Italy.
12
 
13
  == Description ==
14
 
45
  `<!--IUB_COOKIE_POLICY_START-->
46
  <!--IUB_COOKIE_POLICY_END-->`
47
 
48
+ == Screenshots ==
49
+
50
+ 1. This screen shot shows the default banner on top of our test site testkada4.altervista.org/cookie-test/example2.html
51
+ 2. When clicking on the cookie policy link, the user gets a view of the entire cookie policy, where they ultimately can give their consent
52
+
53
  == Changelog ==
54
 
55
+ = 1.9.9 =
56
+ * Bugs page 60000 chars
57
+
58
+ = 1.9.8 =
59
+ * Added Google Maps & Google Adsense + better shortcode handling
60
+
61
  = 1.9.7 =
62
+ * minor bugfix
63
 
64
  = 1.9.6 =
65
  * bugfix: custom banner now allowed
120
 
121
  At the moment the automatic blocking of the YouTube video player and social widgets are done only if these scripts are located after the function wp_head(). The solution is the first version. Test it and contact us to report any errors.
122
 
123
+ Header image for this plugin page [graciously provided by this person](http://www.sketchappsources.com/free-source/1012-minimal-lines-device-icons-sketch-freebie-resource.html).
124
+
125
+ == Bug reports ==
126
 
127
  * The best way you can help us is by providing as much information as possible, including the use of wp_debug https://codex.wordpress.org/Debugging_in_WordPress.
128
  * We will be very happy to receive feedback here: http://gsfn.us/t/4qpks
129
 
130
+ == Istruzioni in italiano ==
131
 
132
  Per esempio in un plugin Facebook dovrai fare come segue:
133
 
161
 
162
  Al momento il blocco automatico dei video player di YouTube e dei widget sociali avviene solo se questi script si trovano dopo la funzione wp_head(). La soluzione è alla prima versione. Testatela e contattateci per segnalare eventuali errori.
163
 
164
+ == Segnalazioni di bug ==
165
 
166
  * Il modo migliore per aiutarci è quello di fornire quante più informazioni possibili, compreso l'uso di wp_debug https://codex.wordpress.org/Debugging_in_WordPress.
167
  * Saremo molto contenti di ricevere feedback qui: http://gsfn.us/t/4qpks
simple_html_dom.php CHANGED
@@ -72,7 +72,7 @@ function file_get_html($url, $use_include_path = false, $context=null, $offset =
72
  $contents = file_get_contents($url, $use_include_path, $context, $offset);
73
  // Paperg - use our own mechanism for getting the contents as we want to control the timeout.
74
  //$contents = retrieve_url_contents($url);
75
- if (empty($contents) || strlen($contents) > 60000)
76
  {
77
  return false;
78
  }
@@ -85,7 +85,7 @@ function file_get_html($url, $use_include_path = false, $context=null, $offset =
85
  function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $stripRN=true)
86
  {
87
  $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $stripRN);
88
- if (empty($str) || strlen($str) > 60000)
89
  {
90
  $dom->clear();
91
  return false;
@@ -1174,7 +1174,7 @@ class simple_html_dom
1174
  $this->root->_[HDOM_INFO_BEGIN] = -1;
1175
  $this->root->nodetype = HDOM_TYPE_ROOT;
1176
  $this->parent = $this->root;
1177
- if ($this->size>0) $this->char = $this->doc[0];
1178
  }
1179
 
1180
  // parse html content
72
  $contents = file_get_contents($url, $use_include_path, $context, $offset);
73
  // Paperg - use our own mechanism for getting the contents as we want to control the timeout.
74
  //$contents = retrieve_url_contents($url);
75
+ if (empty($contents))
76
  {
77
  return false;
78
  }
85
  function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $stripRN=true)
86
  {
87
  $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $stripRN);
88
+ if (empty($str))
89
  {
90
  $dom->clear();
91
  return false;
1174
  $this->root->_[HDOM_INFO_BEGIN] = -1;
1175
  $this->root->nodetype = HDOM_TYPE_ROOT;
1176
  $this->parent = $this->root;
1177
+ //if ($this->size>0) $this->char = $this->doc[0];
1178
  }
1179
 
1180
  // parse html content