iubenda Cookie Solution for GDPR - Version 1.15.0

Version Description

  • New: Option to select iubenda menu position
  • Tweak: iubenda faster class regex update
  • Tweak: Enable style tag in iubenda code field
  • Tweak: Changed default parser method
Download this release

Release Info

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

Code changes from version 1.14.3 to 1.15.0

iubenda-cookie-class/iubenda.class.faster.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
3
  * iubenda.class.php
4
- * version: 2.0.2
5
  * codename: Faster
6
- * @author: Copyright 2015 iubenda
7
  * @license GNU/GPL
8
  * This program is free software: you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
@@ -21,16 +21,15 @@
21
  */
22
 
23
  class iubendaFaster {
24
- /*
25
- Variables
26
- */
 
27
 
 
28
  private $getBlack = array(
29
  array(
30
- /*
31
- Domains
32
- */
33
-
34
  "platform.twitter.com/widgets.js",
35
  "apis.google.com/js/plusone.js",
36
  "apis.google.com/js/platform.js",
@@ -39,9 +38,7 @@ class iubendaFaster {
39
  "pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
40
  "sharethis.com/button/buttons.js",
41
  "addthis.com/js/",
42
- /*
43
- JavaScript
44
- */
45
  "window.adsbygoogle"
46
  ),
47
  array
@@ -62,22 +59,20 @@ class iubendaFaster {
62
  private $getBlank = "//cdn.iubenda.com/cookie_solution/empty.html";
63
  private $getClass = array( "_iub_cs_activate", "_iub_cs_activate-inline" );
64
 
65
- /*
66
- Methods
 
 
 
 
67
  */
68
-
69
  public function isBlack( $offender, $blacklist ) {
70
- /*
71
- Check if a string is in the black list.
72
- */
73
-
74
  if ( empty( $offender ) || empty( $blacklist ) ) {
75
 
76
  return false;
77
  }
78
 
79
- /**/
80
-
81
  foreach ( $blacklist as $black ) {
82
  if ( strpos( $offender, $black ) !== false ) {
83
 
@@ -85,21 +80,22 @@ class iubendaFaster {
85
  }
86
  }
87
 
88
- /**/
89
-
90
  return false;
91
  }
92
 
93
- /**/
94
-
95
- public function isParse( $offender ) {
96
- /*
97
- Parse the entrie document and search for black elements.
98
- */
99
-
 
 
100
  libxml_use_internal_errors( true );
101
 
102
- /**/
 
103
 
104
  $src = "";
105
 
@@ -111,29 +107,18 @@ class iubendaFaster {
111
 
112
  $document = new DOMDocument();
113
 
114
- /**/
115
-
116
  $document->formatOutput = true;
117
  $document->preserveWhiteSpace = false;
118
 
119
- /**/
120
-
121
- $document->loadHTML( $offender );
122
-
123
- /**/
124
 
125
  $scripts = $document->getElementsByTagName( "script" );
126
  $iframes = $document->getElementsByTagName( "iframe" );
127
 
128
- /*
129
- Parse the founded elements and check who is in black.
130
- */
131
-
132
  foreach ( $scripts as $script ) {
133
  $src = $script->getAttribute( "src" );
134
 
135
- /**/
136
-
137
  if ( $this->isBlack( $src, $list_1 ) ) {
138
  $script->setAttribute( "type", "text/plain" );
139
  $script->setAttribute( "class", $script->getAttribute( "class" ) . " " . $class[0] );
@@ -146,8 +131,6 @@ class iubendaFaster {
146
 
147
  $src = $iframe->getAttribute( "src" );
148
 
149
- /**/
150
-
151
  if ( $this->isBlack( $src, $list_2 ) ) {
152
  $iframe->setAttribute( "src", $blank );
153
  $iframe->setAttribute( "suppressedsrc", $src );
@@ -155,17 +138,88 @@ class iubendaFaster {
155
  }
156
  }
157
 
158
- /**/
159
 
160
- $offender = $document->saveHTML();
161
 
162
- /**/
 
163
 
164
- libxml_use_internal_errors( false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
- /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
- return $offender;
169
  }
170
 
171
  }
1
  <?php
2
  /**
3
  * iubenda.class.php
4
+ * version: 2.0.3
5
  * codename: Faster
6
+ * @author: Copyright 2018 iubenda
7
  * @license GNU/GPL
8
  * This program is free software: you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
21
  */
22
 
23
  class iubendaFaster {
24
+
25
+ // variables
26
+ const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/s';
27
+ const IUB_REGEX_PATTERN_2 = '/<!--\s*IUB-COOKIE-BLOCK-START\s*-->(.*?)<!--\s*IUB-COOKIE-BLOCK-END\s*-->/s';
28
 
29
+ public $iub_comments_detected = array();
30
  private $getBlack = array(
31
  array(
32
+ // domains
 
 
 
33
  "platform.twitter.com/widgets.js",
34
  "apis.google.com/js/plusone.js",
35
  "apis.google.com/js/platform.js",
38
  "pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
39
  "sharethis.com/button/buttons.js",
40
  "addthis.com/js/",
41
+ // javascript
 
 
42
  "window.adsbygoogle"
43
  ),
44
  array
59
  private $getBlank = "//cdn.iubenda.com/cookie_solution/empty.html";
60
  private $getClass = array( "_iub_cs_activate", "_iub_cs_activate-inline" );
61
 
62
+ /**
63
+ * Methods
64
+ *
65
+ * @param type $offender
66
+ * @param type $blacklist
67
+ * @return boolean
68
  */
 
69
  public function isBlack( $offender, $blacklist ) {
70
+ // check if a string is in the black list.
 
 
 
71
  if ( empty( $offender ) || empty( $blacklist ) ) {
72
 
73
  return false;
74
  }
75
 
 
 
76
  foreach ( $blacklist as $black ) {
77
  if ( strpos( $offender, $black ) !== false ) {
78
 
80
  }
81
  }
82
 
 
 
83
  return false;
84
  }
85
 
86
+ /**
87
+ * Parse automatically all the scripts in the page and converts it in text/plain
88
+ * if src or the whole output has inside one of the elements in $auto_script_tags array
89
+ *
90
+ * @param mixed $content
91
+ * @return mixed
92
+ */
93
+ public function isParse( $content ) {
94
+ // parse the entrie document and search for black elements.
95
  libxml_use_internal_errors( true );
96
 
97
+ // parse all IUBENDAs comment and convert the code inside
98
+ $content = $this->parse_iubenda_comments( $content );
99
 
100
  $src = "";
101
 
107
 
108
  $document = new DOMDocument();
109
 
 
 
110
  $document->formatOutput = true;
111
  $document->preserveWhiteSpace = false;
112
 
113
+ $document->loadHTML( $content );
 
 
 
 
114
 
115
  $scripts = $document->getElementsByTagName( "script" );
116
  $iframes = $document->getElementsByTagName( "iframe" );
117
 
118
+ // parse the founded elements and check who is in black.
 
 
 
119
  foreach ( $scripts as $script ) {
120
  $src = $script->getAttribute( "src" );
121
 
 
 
122
  if ( $this->isBlack( $src, $list_1 ) ) {
123
  $script->setAttribute( "type", "text/plain" );
124
  $script->setAttribute( "class", $script->getAttribute( "class" ) . " " . $class[0] );
131
 
132
  $src = $iframe->getAttribute( "src" );
133
 
 
 
134
  if ( $this->isBlack( $src, $list_2 ) ) {
135
  $iframe->setAttribute( "src", $blank );
136
  $iframe->setAttribute( "suppressedsrc", $src );
138
  }
139
  }
140
 
141
+ $content = $document->saveHTML();
142
 
143
+ libxml_use_internal_errors( false );
144
 
145
+ return $content;
146
+ }
147
 
148
+ /**
149
+ * Parse all IUBENDAs comment and convert the code inside with create_tags method
150
+ *
151
+ * @param mixed $content
152
+ * @return mixed
153
+ */
154
+ public function parse_iubenda_comments( $content ) {
155
+ foreach ( array( 'IUB_REGEX_PATTERN', 'IUB_REGEX_PATTERN_2' ) as $pattern ) {
156
+ preg_match_all( constant( 'self::' . $pattern ), $content, $scripts );
157
+
158
+ // found any content?
159
+ if ( is_array( $scripts[1] ) ) {
160
+ $count = count( $scripts[1] );
161
+ $js_scripts = array();
162
+
163
+ for ( $j = 0; $j < $count; $j ++ ) {
164
+ // keep it for testing
165
+ $this->iub_comments_detected[] = $scripts[1][$j];
166
+
167
+ // get HTML dom from string
168
+ $html = str_get_html( $scripts[1][$j], true, true, false );
169
+
170
+ // convert scripts, iframes and other code inside IUBENDAs comment in text/plain to not generate cookies
171
+ $js_scripts[] = $this->create_tags( $html );
172
+ }
173
 
174
+ if ( is_array( $js_scripts ) && $count >= 1 && count( $js_scripts ) >= 1 )
175
+ $content = strtr( $content, array_combine( $scripts[1], $js_scripts ) );
176
+ }
177
+ }
178
+
179
+ return $content;
180
+ }
181
+
182
+ /**
183
+ * Convert scripts, iframe and other code inside IUBENDAs comment in text/plain to not generate cookies
184
+ *
185
+ * @param mixed $content
186
+ * @return mixed
187
+ */
188
+ public function create_tags( $content ) {
189
+ $elements = $content->find( "*" );
190
+ $js = '';
191
+
192
+ if ( is_array( $elements ) ) {
193
+ $count = count( $elements );
194
+
195
+ for ( $j = 0; $j < $count; $j ++ ) {
196
+ $e = $elements[$j];
197
+
198
+ switch ( $e->tag ) {
199
+ case 'script':
200
+ $class = $e->class;
201
+ $e->class = $class . ' _iub_cs_activate';
202
+ $e->type = 'text/plain';
203
+ $js .= $e->outertext;
204
+ break;
205
+
206
+ case 'iframe':
207
+ $new_src = "//cdn.iubenda.com/cookie_solution/empty.html";
208
+ $class = $e->class;
209
+ $e->suppressedsrc = $e->src;
210
+ $e->src = $new_src;
211
+ $e->class = $class . ' _iub_cs_activate';
212
+ $js .= $e->outertext;
213
+ break;
214
+
215
+ default:
216
+ $js = $content;
217
+ break;
218
+ }
219
+ }
220
+ }
221
 
222
+ return $js;
223
  }
224
 
225
  }
iubenda-cookie-class/iubenda.class.php CHANGED
@@ -1,8 +1,8 @@
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
8
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,9 @@
21
 
22
  class iubendaPage {
23
 
24
- const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/sU';
 
 
25
 
26
  public $auto_script_tags = array(
27
  'platform.twitter.com/widgets.js',
@@ -54,21 +56,24 @@ class iubendaPage {
54
  public $scripts_inline_converted = array();
55
  public $scripts_converted = array();
56
 
57
- /*
58
- construct: the whole HTML output of the page
 
 
59
  */
60
-
61
  public function __construct( $content_page ) {
62
  $this->original_content_page = $content_page;
63
  $this->content_page = $content_page;
64
  }
65
 
66
- /*
67
- print iubenda banner, parameter: the script code of iubenda to print the banner
 
 
 
68
  */
69
-
70
  public function print_banner( $banner ) {
71
- return $banner.= "\n
72
  <script>
73
  var iCallback = function(){};
74
 
@@ -89,18 +94,20 @@ if('callback' in _iub.csConfiguration) {
89
  </script>";
90
  }
91
 
92
- /*
93
- Static, detect bot & crawler
 
 
94
  */
95
-
96
  static function bot_detected() {
97
- return (isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/bot|crawl|slurp|spider|google|yahoo/i', $_SERVER['HTTP_USER_AGENT'] ));
98
  }
99
 
100
- /*
101
- Static, utility function: Return true if the user has already given consent on the page
 
 
102
  */
103
-
104
  static function consent_given() {
105
  foreach ( $_COOKIE as $key => $value ) {
106
  if ( iubendaPage::strpos_array( $key, array( '_iub_cs-s', '_iub_cs' ) ) ) {
@@ -110,10 +117,13 @@ if('callback' in _iub.csConfiguration) {
110
  return false;
111
  }
112
 
113
- /*
114
- Static, utility function: strpos for array
 
 
 
 
115
  */
116
-
117
  static function strpos_array( $haystack, $needle ) {
118
  if ( is_array( $needle ) ) {
119
  foreach ( $needle as $need ) {
@@ -129,8 +139,12 @@ if('callback' in _iub.csConfiguration) {
129
  return false;
130
  }
131
 
132
- /* Convert scripts, iframe and other code inside IUBENDAs comment in text/plain to not generate cookies */
133
-
 
 
 
 
134
  public function create_tags( $html ) {
135
 
136
  $elements = $html->find( "*" );
@@ -145,7 +159,7 @@ if('callback' in _iub.csConfiguration) {
145
  $class = $e->class;
146
  $e->class = $class . ' _iub_cs_activate';
147
  $e->type = 'text/plain';
148
- $js.= $e->outertext;
149
  break;
150
 
151
  case 'iframe':
@@ -154,7 +168,7 @@ if('callback' in _iub.csConfiguration) {
154
  $e->suppressedsrc = $e->src;
155
  $e->src = $new_src;
156
  $e->class = $class . ' _iub_cs_activate';
157
- $js.= $e->outertext;
158
  break;
159
 
160
  default:
@@ -166,33 +180,38 @@ if('callback' in _iub.csConfiguration) {
166
  return $js;
167
  }
168
 
169
- /* Parse all IUBENDAs comment and convert the code inside with create_tags method */
170
-
 
171
  public function parse_iubenda_comments() {
172
- preg_match_all( self::IUB_REGEX_PATTERN, $this->content_page, $scripts );
173
- if ( is_array( $scripts[1] ) ) {
174
- $count = count( $scripts[1] );
175
- $js_scripts = array();
176
- for ( $j = 0; $j < $count; $j ++ ) {
177
- $this->iub_comments_detected[] = $scripts[1][$j];
178
- $html = str_get_html( $scripts[1][$j], $lowercase = true, $forceTagsClosed = true, $stripRN = false );
179
- $js_scripts[] = $this->create_tags( $html );
180
- }
 
 
181
 
182
- if ( is_array( $scripts[1] ) && is_array( $js_scripts ) ) {
183
- if ( count( $scripts[1] ) >= 1 && count( $js_scripts ) >= 1 ) {
184
- $this->content_page = strtr( $this->content_page, array_combine( $scripts[1], $js_scripts ) );
 
185
  }
186
  }
187
  }
188
  }
189
 
190
- /* Parse automatically all the scripts in the page and converts it in text/plain
191
- if src or the whole output has inside one of the elements in $auto_script_tags array */
192
-
 
193
  public function parse_scripts() {
194
-
195
  $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
 
196
  if ( is_object( $html ) ) {
197
  $scripts = $html->find( "script" );
198
  if ( is_array( $scripts ) ) {
@@ -222,10 +241,7 @@ if('callback' in _iub.csConfiguration) {
222
  }
223
  }
224
 
225
- /*
226
- * AdSense check by Peste Vasile Alexandru, AdSense here
227
- */
228
-
229
  $ad_found = false;
230
 
231
  while ( preg_match( "#google_ad_client =(.*?);#i", $html ) ) {
@@ -236,29 +252,21 @@ if('callback' in _iub.csConfiguration) {
236
  $ad_height = null;
237
  $ad_block = null;
238
 
239
- /**/
240
-
241
  preg_match( "#google_ad_client =(.*?);#i", $html, $ad_client );
242
  preg_match( "#google_ad_slot =(.*?);#i", $html, $ad_slot );
243
  preg_match( "#google_ad_width =(.*?);#i", $html, $ad_width );
244
  preg_match( "#google_ad_height =(.*?);#i", $html, $ad_height );
245
 
246
- /**/
247
-
248
  $html = preg_replace( "#google_ad_client =(.*?);#i", "", $html, 1 );
249
  $html = preg_replace( "#google_ad_slot =(.*?);#i", "", $html, 1 );
250
  $html = preg_replace( "#google_ad_width =(.*?);#i", "", $html, 1 );
251
  $html = preg_replace( "#google_ad_height =(.*?);#i", "", $html, 1 );
252
 
253
- /**/
254
-
255
  $ad_client = trim( $ad_client[1] );
256
  $ad_slot = trim( $ad_slot[1] );
257
  $ad_width = trim( $ad_width[1] );
258
  $ad_height = trim( $ad_height[1] );
259
 
260
- /**/
261
-
262
  $ad_class = 'class="_iub_cs_activate_google_ads"';
263
  $ad_style = 'style="width:' . $ad_width . 'px; height:' . $ad_height . 'px;"';
264
 
@@ -267,17 +275,11 @@ if('callback' in _iub.csConfiguration) {
267
  $ad_width = 'data-width="' . $ad_width . '"';
268
  $ad_height = 'data-height="' . $ad_height . '"';
269
 
270
- /**/
271
-
272
  $ad_block = "<div $ad_style $ad_class $ad_width $ad_height $ad_slot $ad_client></div>";
273
 
274
- /**/
275
-
276
  $html = preg_replace( '#(<[^>]+) src="//pagead2.googlesyndication.com/pagead/show_ads.js"(.*?)</script>#i', $ad_block, $html, 1 );
277
  }
278
 
279
- /**/
280
-
281
  if ( $ad_found ) {
282
  $adsense_callback = "
283
  <script>
@@ -325,17 +327,17 @@ if('callback' in _iub.csConfiguration) {
325
  $html = str_replace( "</body>", $adsense_callback . "</body>", $html );
326
  }
327
 
328
- /**/
329
-
330
  $this->content_page = $html;
331
  }
332
  }
333
 
334
- /* Parse automatically all the iframe in the page and change the src to suppressedsrc
335
- if src has inside one of the elements in $auto_iframe_tags array */
336
-
 
337
  public function parse_iframe() {
338
  $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
 
339
  if ( is_object( $html ) ) {
340
  $iframes = $html->find( "iframe" );
341
  if ( is_array( $iframes ) ) {
@@ -358,20 +360,20 @@ if('callback' in _iub.csConfiguration) {
358
  }
359
  }
360
 
361
- /*
362
- Call three methods to parse the page, iubendas comment, scripts + iframe
363
  */
364
-
365
  public function parse() {
366
  $this->parse_iubenda_comments();
367
  $this->parse_scripts();
368
  $this->parse_iframe();
369
  }
370
 
371
- /*
372
- Return the final page to output
 
 
373
  */
374
-
375
  public function get_converted_page() {
376
  return $this->content_page;
377
  }
1
  <?php
2
  /**
3
  * iubenda.class.php
4
+ * version: 1.0.3
5
+ * @author: Copyright 2018 iubenda
6
  * @license GNU/GPL
7
  * This program is free software: you can redistribute it and/or modify
8
  * it under the terms of the GNU General Public License as published by
21
 
22
  class iubendaPage {
23
 
24
+ // variables
25
+ const IUB_REGEX_PATTERN = '/<!--\s*IUB_COOKIE_POLICY_START\s*-->(.*?)<!--\s*IUB_COOKIE_POLICY_END\s*-->/s';
26
+ const IUB_REGEX_PATTERN_2 = '/<!--\s*IUB-COOKIE-BLOCK-START\s*-->(.*?)<!--\s*IUB-COOKIE-BLOCK-END\s*-->/s';
27
 
28
  public $auto_script_tags = array(
29
  'platform.twitter.com/widgets.js',
56
  public $scripts_inline_converted = array();
57
  public $scripts_converted = array();
58
 
59
+ /**
60
+ * Construct: the whole HTML output of the page
61
+ *
62
+ * @param mixed $content_page
63
  */
 
64
  public function __construct( $content_page ) {
65
  $this->original_content_page = $content_page;
66
  $this->content_page = $content_page;
67
  }
68
 
69
+ /**
70
+ * Print iubenda banner, parameter: the script code of iubenda to print the banner
71
+ *
72
+ * @param string $banner
73
+ * @return string
74
  */
 
75
  public function print_banner( $banner ) {
76
+ return $banner .= "\n
77
  <script>
78
  var iCallback = function(){};
79
 
94
  </script>";
95
  }
96
 
97
+ /**
98
+ * Static, detect bot & crawler
99
+ *
100
+ * @return bool
101
  */
 
102
  static function bot_detected() {
103
+ return ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/bot|crawl|slurp|spider|google|yahoo/i', $_SERVER['HTTP_USER_AGENT'] ) );
104
  }
105
 
106
+ /**
107
+ * Static, utility function: Return true if the user has already given consent on the page
108
+ *
109
+ * @return boolean
110
  */
 
111
  static function consent_given() {
112
  foreach ( $_COOKIE as $key => $value ) {
113
  if ( iubendaPage::strpos_array( $key, array( '_iub_cs-s', '_iub_cs' ) ) ) {
117
  return false;
118
  }
119
 
120
+ /**
121
+ * Static, utility function: strpos for array
122
+ *
123
+ * @param type $haystack
124
+ * @param type $needle
125
+ * @return boolean
126
  */
 
127
  static function strpos_array( $haystack, $needle ) {
128
  if ( is_array( $needle ) ) {
129
  foreach ( $needle as $need ) {
139
  return false;
140
  }
141
 
142
+ /**
143
+ * Convert scripts, iframe and other code inside IUBENDAs comment in text/plain to not generate cookies
144
+ *
145
+ * @param mixed $html
146
+ * @return mixed
147
+ */
148
  public function create_tags( $html ) {
149
 
150
  $elements = $html->find( "*" );
159
  $class = $e->class;
160
  $e->class = $class . ' _iub_cs_activate';
161
  $e->type = 'text/plain';
162
+ $js .= $e->outertext;
163
  break;
164
 
165
  case 'iframe':
168
  $e->suppressedsrc = $e->src;
169
  $e->src = $new_src;
170
  $e->class = $class . ' _iub_cs_activate';
171
+ $js .= $e->outertext;
172
  break;
173
 
174
  default:
180
  return $js;
181
  }
182
 
183
+ /**
184
+ * Parse all IUBENDAs comment and convert the code inside with create_tags method
185
+ */
186
  public function parse_iubenda_comments() {
187
+ foreach ( array( 'IUB_REGEX_PATTERN', 'IUB_REGEX_PATTERN_2' ) as $pattern ) {
188
+ preg_match_all( constant( 'self::' . $pattern ), $this->content_page, $scripts );
189
+
190
+ if ( is_array( $scripts[1] ) ) {
191
+ $count = count( $scripts[1] );
192
+ $js_scripts = array();
193
+ for ( $j = 0; $j < $count; $j ++ ) {
194
+ $this->iub_comments_detected[] = $scripts[1][$j];
195
+ $html = str_get_html( $scripts[1][$j], $lowercase = true, $forceTagsClosed = true, $stripRN = false );
196
+ $js_scripts[] = $this->create_tags( $html );
197
+ }
198
 
199
+ if ( is_array( $scripts[1] ) && is_array( $js_scripts ) ) {
200
+ if ( count( $scripts[1] ) >= 1 && count( $js_scripts ) >= 1 ) {
201
+ $this->content_page = strtr( $this->content_page, array_combine( $scripts[1], $js_scripts ) );
202
+ }
203
  }
204
  }
205
  }
206
  }
207
 
208
+ /**
209
+ * Parse automatically all the scripts in the page and converts it in text/plain
210
+ * if src or the whole output has inside one of the elements in $auto_script_tags array
211
+ */
212
  public function parse_scripts() {
 
213
  $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
214
+
215
  if ( is_object( $html ) ) {
216
  $scripts = $html->find( "script" );
217
  if ( is_array( $scripts ) ) {
241
  }
242
  }
243
 
244
+ // AdSense check by Peste Vasile Alexandru, AdSense here
 
 
 
245
  $ad_found = false;
246
 
247
  while ( preg_match( "#google_ad_client =(.*?);#i", $html ) ) {
252
  $ad_height = null;
253
  $ad_block = null;
254
 
 
 
255
  preg_match( "#google_ad_client =(.*?);#i", $html, $ad_client );
256
  preg_match( "#google_ad_slot =(.*?);#i", $html, $ad_slot );
257
  preg_match( "#google_ad_width =(.*?);#i", $html, $ad_width );
258
  preg_match( "#google_ad_height =(.*?);#i", $html, $ad_height );
259
 
 
 
260
  $html = preg_replace( "#google_ad_client =(.*?);#i", "", $html, 1 );
261
  $html = preg_replace( "#google_ad_slot =(.*?);#i", "", $html, 1 );
262
  $html = preg_replace( "#google_ad_width =(.*?);#i", "", $html, 1 );
263
  $html = preg_replace( "#google_ad_height =(.*?);#i", "", $html, 1 );
264
 
 
 
265
  $ad_client = trim( $ad_client[1] );
266
  $ad_slot = trim( $ad_slot[1] );
267
  $ad_width = trim( $ad_width[1] );
268
  $ad_height = trim( $ad_height[1] );
269
 
 
 
270
  $ad_class = 'class="_iub_cs_activate_google_ads"';
271
  $ad_style = 'style="width:' . $ad_width . 'px; height:' . $ad_height . 'px;"';
272
 
275
  $ad_width = 'data-width="' . $ad_width . '"';
276
  $ad_height = 'data-height="' . $ad_height . '"';
277
 
 
 
278
  $ad_block = "<div $ad_style $ad_class $ad_width $ad_height $ad_slot $ad_client></div>";
279
 
 
 
280
  $html = preg_replace( '#(<[^>]+) src="//pagead2.googlesyndication.com/pagead/show_ads.js"(.*?)</script>#i', $ad_block, $html, 1 );
281
  }
282
 
 
 
283
  if ( $ad_found ) {
284
  $adsense_callback = "
285
  <script>
327
  $html = str_replace( "</body>", $adsense_callback . "</body>", $html );
328
  }
329
 
 
 
330
  $this->content_page = $html;
331
  }
332
  }
333
 
334
+ /**
335
+ * Parse automatically all the iframe in the page and change the src to suppressedsrc
336
+ * if src has inside one of the elements in $auto_iframe_tags array
337
+ */
338
  public function parse_iframe() {
339
  $html = str_get_html( $this->content_page, $lowercase = true, $forceTagsClosed = true, $stripRN = false );
340
+
341
  if ( is_object( $html ) ) {
342
  $iframes = $html->find( "iframe" );
343
  if ( is_array( $iframes ) ) {
360
  }
361
  }
362
 
363
+ /**
364
+ * Call three methods to parse the page, iubendas comment, scripts + iframe
365
  */
 
366
  public function parse() {
367
  $this->parse_iubenda_comments();
368
  $this->parse_scripts();
369
  $this->parse_iframe();
370
  }
371
 
372
+ /**
373
+ * Return the final page to output
374
+ *
375
+ * @return mixed
376
  */
 
377
  public function get_converted_page() {
378
  return $this->content_page;
379
  }
iubenda-cookie-class/test.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * test.php
4
- * @author: Copyright 2015 iubenda
5
  * @license GNU/GPL
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
@@ -16,99 +16,98 @@
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
- ini_set( 'max_execution_time', 300 );
 
20
  ?>
21
 
22
  <html>
23
- <head>
24
- <!-- Latest compiled and minified CSS -->
25
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
26
-
27
- <!-- Optional theme -->
28
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
29
- <style>
30
- ul { margin: 0; padding: 0;}
31
- ul li { list-style-type: none; }
32
- </style>
33
- </head>
34
- <body>
35
- <div class="container">
36
- <div class="row">
37
- <div class="col-md-12">
38
- <h1>iubenda class test</h1>
39
- <form action="" method="POST">
40
- <strong>URL WEBSITE</strong><BR>
41
- <input type="text" name="url">
42
- <input type="submit" class="btn" value="Analyze">
43
- </form>
44
- </div>
45
-
46
- <?php
47
- $url = $_POST['url'];
48
- if ( $url || $_GET['url'] ) {
49
-
50
- function print_stuff( $array ) {
51
- if ( count( $array ) ) {
52
- echo "<ul>";
53
- foreach ( $array as $r ) {
54
- echo "<li><pre><code>" . htmlspecialchars( $r ) . "</code></pre></li>";
55
- }
56
- echo "</ul>";
57
- } else {
58
- echo "<p>Nothing</p>";
59
- }
60
  }
 
 
 
 
 
61
 
62
- echo '<div class="col-md-12" style="padding-bottom:150px;"><h2>RESULTS</H2>';
63
-
64
- include_once 'iubenda.class.php';
65
- include_once 'simple_html_dom.php';
66
 
67
- if ( $_GET['url'] ) {
68
- $content = file_get_contents( 'A' );
69
- } else {
70
- $content = file_get_contents( $url );
71
- }
72
 
73
- $page = new iubendaPage( $content );
74
- $page->parse();
75
 
76
- $iub_comments_detected = count( $page->iub_comments_detected );
77
- $scripts_detected = count( $page->scripts_detected );
78
- $iframe_detected = count( $page->iframe_detected );
79
- $iframe_converted = count( $page->iframe_converted );
80
- $script_inline_converted = count( $page->scripts_inline_converted );
81
- $script_converted = count( $page->scripts_converted );
82
 
83
- echo "<p>Iubenda comments detected: $iub_comments_detected<br>Iubenda automatic stuff<br>Iframe detected: $iframe_detected<br>Iframe autoconverted: $iframe_converted<br>Scripts detected: $scripts_detected<br>Inline scripts autoconverted: $script_inline_converted<br>Scripts autoconverted: $script_converted</p>";
84
 
85
- echo "<H3>DETAILS</H3>";
86
 
87
- echo "<H4>iubenda comments stuff</h4>";
88
- print_stuff( $page->iub_comments_detected );
89
 
90
- echo "<H4>Script detected</h4>";
91
- print_stuff( $page->scripts_detected );
92
-
93
- echo "<H4>Script converted</h4>";
94
- print_stuff( $page->scripts_converted );
95
-
96
- echo "<H4>Script inline converted</h4>";
97
- print_stuff( $page->scripts_inline_converted );
98
 
99
- echo "<H4>Iframe detected</h4>";
100
- print_stuff( $page->iframe_detected );
101
-
102
- echo "<H4>Iframe converted</h4>";
103
- print_stuff( $page->iframe_converted );
104
 
105
 
106
 
107
- echo "</div>";
108
- }
109
- ?>
110
- </div>
111
- </div>
112
 
113
- </body>
114
  </html>
1
  <?php
2
  /**
3
  * test.php
4
+ * @author: Copyright 2018 iubenda
5
  * @license GNU/GPL
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
+
20
+ ini_set('max_execution_time', 300);
21
  ?>
22
 
23
  <html>
24
+ <head>
25
+ <!-- Latest compiled and minified CSS -->
26
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
27
+
28
+ <!-- Optional theme -->
29
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
30
+ <style>
31
+ ul { margin: 0; padding: 0;}
32
+ ul li { list-style-type: none; }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <div class="container">
37
+ <div class="row">
38
+ <div class="col-md-12">
39
+ <h1>iubenda class test</h1>
40
+ <form action="" method="POST">
41
+ <strong>URL WEBSITE</strong><BR>
42
+ <input type="text" name="url">
43
+ <input type="submit" class="btn" value="Analyze">
44
+ </form>
45
+ </div>
46
+
47
+ <?php
48
+ $url = $_POST['url'];
49
+
50
+ if ( $url || $_GET['url'] ) {
51
+
52
+ function print_stuff( $array ) {
53
+ if ( count( $array ) ) {
54
+ echo "<ul>";
55
+ foreach ( $array as $r ) {
56
+ echo "<li><pre><code>" . htmlspecialchars( $r ) . "</code></pre></li>";
 
 
 
 
57
  }
58
+ echo "</ul>";
59
+ } else {
60
+ echo "<p>Nothing</p>";
61
+ }
62
+ }
63
 
64
+ echo '<div class="col-md-12" style="padding-bottom:150px;"><h2>RESULTS</H2>';
65
+
66
+ include_once 'iubenda.class.php';
67
+ include_once 'simple_html_dom.php';
68
 
69
+ if ( $_GET['url'] ) {
70
+ $content = file_get_contents( 'A' );
71
+ } else {
72
+ $content = file_get_contents( $url );
73
+ }
74
 
75
+ $page = new Page( $content );
76
+ $page->parse();
77
 
78
+ $iub_comments_detected = count( $page->iub_comments_detected );
79
+ $scripts_detected = count( $page->scripts_detected );
80
+ $iframe_detected = count( $page->iframe_detected );
81
+ $iframe_converted = count( $page->iframe_converted );
82
+ $script_inline_converted = count( $page->scripts_inline_converted );
83
+ $script_converted = count( $page->scripts_converted );
84
 
85
+ echo "<p>Iubenda comments detected: $iub_comments_detected<br>Iubenda automatic stuff<br>Iframe detected: $iframe_detected<br>Iframe autoconverted: $iframe_converted<br>Scripts detected: $scripts_detected<br>Inline scripts autoconverted: $script_inline_converted<br>Scripts autoconverted: $script_converted</p>";
86
 
87
+ echo "<H3>DETAILS</H3>";
88
 
89
+ echo "<H4>iubenda comments stuff</h4>";
90
+ print_stuff( $page->iub_comments_detected );
91
 
92
+ echo "<H4>Script detected</h4>";
93
+ print_stuff( $page->scripts_detected );
94
+ echo "<H4>Script converted</h4>";
95
+ print_stuff( $page->scripts_converted );
96
+ echo "<H4>Script inline converted</h4>";
97
+ print_stuff( $page->scripts_inline_converted );
 
 
98
 
99
+ echo "<H4>Iframe detected</h4>";
100
+ print_stuff( $page->iframe_detected );
101
+ echo "<H4>Iframe converted</h4>";
102
+ print_stuff( $page->iframe_converted );
 
103
 
104
 
105
 
106
+ echo "</div>";
107
+ }
108
+ ?>
109
+ </div>
110
+ </div>
111
 
112
+ </body>
113
  </html>
iubenda-cookie-class/usage.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * usage.php
4
- * @author: Copyright 2015 iubenda
5
  * @license GNU/GPL
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
@@ -16,38 +16,32 @@
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
 
19
  // the "$html" parameter must contain the content of the web page with the iubenda JavaScript banner/policy included
20
 
21
  function iubenda_system( $html ) {
22
  if ( empty( $html ) )
23
  return;
24
 
25
- /*
26
- * Separator
27
- */
28
-
29
  if ( ! function_exists( "file_get_html" ) ) {
30
  require_once("simple_html_dom.php");
31
  }
32
 
33
  require_once("iubenda.class.php");
34
 
35
- /*
36
- * Separator
37
- */
38
-
39
- if ( ! iubendaPage::consent_given() && ! iubendaPage::bot_detected() ) {
40
  $page = new Page( $html );
41
  $page->parse();
42
  $html = $page->get_converted_page();
43
  }
44
 
45
- /* Finished */
46
-
47
  return $html;
48
  }
49
 
50
- /*
51
  *
52
  * Example:
53
  *
1
  <?php
2
  /**
3
  * usage.php
4
+ * @author: Copyright 2018 iubenda
5
  * @license GNU/GPL
6
  * This program is free software: you can redistribute it and/or modify
7
  * it under the terms of the GNU General Public License as published by
16
  * You should have received a copy of the GNU General Public License
17
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
+
20
  // the "$html" parameter must contain the content of the web page with the iubenda JavaScript banner/policy included
21
 
22
  function iubenda_system( $html ) {
23
  if ( empty( $html ) )
24
  return;
25
 
26
+ // separator
 
 
 
27
  if ( ! function_exists( "file_get_html" ) ) {
28
  require_once("simple_html_dom.php");
29
  }
30
 
31
  require_once("iubenda.class.php");
32
 
33
+ // separator
34
+ if ( ! Page::consent_given() && ! Page::bot_detected() ) {
 
 
 
35
  $page = new Page( $html );
36
  $page->parse();
37
  $html = $page->get_converted_page();
38
  }
39
 
40
+ // finished
 
41
  return $html;
42
  }
43
 
44
+ /**
45
  *
46
  * Example:
47
  *
iubenda_cookie_solution.php CHANGED
@@ -1,750 +1,780 @@
1
- <?php
2
- /*
3
- Plugin Name: iubenda Cookie Solution
4
- Plugin URI: https://www.iubenda.com
5
- Description: The iubenda Cookie Solution allows you to manage all aspects of the cookie law on WP.
6
- Version: 1.14.3
7
- Author: iubenda
8
- Author URI: https://www.iubenda.com
9
- License: MIT License
10
- License URI: http://opensource.org/licenses/MIT
11
- Text Domain: iubenda-cookie-law-solution
12
- Domain Path: /languages
13
-
14
- ibenda Cookie Solution
15
- Copyright (C) 2016-2017, iubenda s.r.l
16
-
17
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
-
19
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- */
23
-
24
- // exit if accessed directly
25
- if ( ! defined( 'ABSPATH' ) )
26
- exit;
27
-
28
- // define contants
29
- define( 'IUB_DEBUG', false );
30
-
31
- // set plugin instance
32
- $iubenda_cookie_law_solution = new iubenda_Cookie_Law_Solution();
33
-
34
- /**
35
- * iubenda_Cookie_Law_Solution final class.
36
- *
37
- * @class iubenda_Cookie_Law_Solution
38
- * @version 1.14.3
39
- */
40
- class iubenda_Cookie_Law_Solution {
41
-
42
- public $options;
43
- public $defaults = array(
44
- 'parse' => false, // iubenda_parse
45
- 'skip_parsing' => true, // skip_parsing
46
- 'ctype' => true, // iubenda_ctype
47
- 'parse' => false, // iubenda_parse
48
- 'parser_engine' => 'default', // parser_engine
49
- 'output_feed' => true, // iubenda_output_feed
50
- 'code_default' => false, // iubenda-code-default,
51
- 'loading' => 'header',
52
- 'deactivation' => false
53
- );
54
- public $version = '1.14.3';
55
- public $no_html = false;
56
- public $links = array();
57
- public $multilang = false;
58
- public $languages = array();
59
- public $lang_default = '';
60
-
61
- /**
62
- * Class constructor.
63
- */
64
- public function __construct() {
65
- register_activation_hook( __FILE__, array( $this, 'activation' ) );
66
- register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
67
-
68
- // settings
69
- $this->options = array_merge( $this->defaults, (array) get_option( 'iubenda_cookie_law_solution', $this->defaults ) );
70
-
71
- // actions
72
- add_action( 'admin_init', array( $this, 'register_options' ) );
73
- add_action( 'admin_init', array( $this, 'update_plugin' ), 9 );
74
- add_action( 'admin_menu', array( $this, 'admin_menu_options' ) );
75
- add_action( 'admin_notices', array( $this, 'settings_errors' ) );
76
- // add_action( 'admin_menu', array( $this, 'save_options' ), 9 );
77
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
78
- add_action( 'plugins_loaded', array( $this, 'init' ) );
79
- add_action( 'after_setup_theme', array( $this, 'register_shortcode' ) );
80
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
81
- add_action( 'admin_print_styles', array( $this, 'admin_print_styles' ) );
82
- add_action( 'init', array( $this, 'script_position' ) );
83
- add_action( 'template_redirect', array( $this, 'output_start' ), 0 );
84
- add_action( 'shutdown', array( $this, 'output_end' ), 100 );
85
- }
86
-
87
- /**
88
- * Initialize plugin.
89
- *
90
- * @return void
91
- */
92
- public function init() {
93
-
94
- // check if WPML or Polylang is active
95
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
96
-
97
- // Polylang support
98
- if ( is_plugin_active( 'polylang/polylang.php' ) && function_exists( 'PLL' ) ) {
99
- $this->multilang = true;
100
-
101
- // get registered languages
102
- $registered_languages = PLL()->model->get_languages_list();
103
-
104
- if ( ! empty( $registered_languages ) ) {
105
- foreach ( $registered_languages as $language )
106
- $this->languages[$language->slug] = $language->name;
107
- }
108
-
109
- // get default language
110
- $this->lang_default = pll_default_language();
111
-
112
- // WPML support
113
- } elseif ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && class_exists( 'SitePress' ) ) {
114
- $this->multilang = true;
115
-
116
- global $sitepress;
117
-
118
- // get registered languages
119
- $registered_languages = icl_get_languages();
120
-
121
- if ( ! empty( $registered_languages ) ) {
122
- foreach ( $registered_languages as $language )
123
- $this->languages[$language['code']] = $language['display_name'];
124
- }
125
-
126
- // get default language
127
- $this->lang_default = $sitepress->get_default_language();
128
- }
129
-
130
- // load Simple HTML DOM if needed
131
- if ( ! function_exists( 'file_get_html' ) ) {
132
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/simple_html_dom.php' );
133
- }
134
-
135
- // load plugin class
136
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.faster.php' );
137
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.php' );
138
-
139
- $links = array(
140
- 'en' => array(
141
- 'guide' => 'https://www.iubenda.com/en/iubenda-cookie-law-solution',
142
- 'plugin_page' => 'https://www.iubenda.com/en/help/posts/1215',
143
- 'generating_code' => 'https://www.iubenda.com/en/help/posts/1177',
144
- 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
145
- 'documentation' => 'https://www.iubenda.com/en/help/posts/1215'
146
- ),
147
- 'it' => array(
148
- 'guide' => 'https://www.iubenda.com/it/soluzione-cookie-law',
149
- 'plugin_page' => 'https://www.iubenda.com/it/help/posts/810',
150
- 'generating_code' => 'https://www.iubenda.com/it/help/posts/680',
151
- 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
152
- 'documentation' => 'https://www.iubenda.com/it/help/posts/810',
153
- )
154
- );
155
-
156
- $locale = explode( '_', get_locale() );
157
- $locale_code = $locale[0];
158
-
159
- // assign links
160
- $this->links = in_array( $locale_code, array_keys( $links ) ) ? $links[$locale_code] : $links['en'];
161
- }
162
-
163
- /**
164
- * Plugin activation.
165
- *
166
- * @return void
167
- */
168
- public function activation() {
169
- add_option( 'iubenda_cookie_law_solution', $this->options, '', 'no' );
170
- add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
171
- }
172
-
173
- /**
174
- * Plugin deactivation.
175
- *
176
- * @return void
177
- */
178
- public function deactivation() {
179
- // remove options from database?
180
- if ( $this->options['deactivation'] ) {
181
- delete_option( 'iubenda_cookie_law_solution' );
182
- delete_option( 'iubenda_cookie_law_version' );
183
- }
184
- }
185
-
186
- /**
187
- * Plugin options migration for versions < 1.14.0
188
- *
189
- * @return void
190
- */
191
- public function update_plugin() {
192
- if ( ! current_user_can( 'install_plugins' ) )
193
- return;
194
-
195
- $db_version = get_option( 'iubenda_cookie_law_version' );
196
- $db_version = ! $db_version ? '1.13.0' : $db_version;
197
-
198
- if ( $db_version != false ) {
199
- if ( version_compare( $db_version, '1.14.0', '<' ) ) {
200
- $options = array();
201
-
202
- $old_new = array(
203
- 'iubenda_parse' => 'parse',
204
- 'skip_parsing' => 'skip_parsing',
205
- 'iubenda_ctype' => 'ctype',
206
- 'iubenda_parse' => 'parse',
207
- 'parser_engine' => 'parser_engine',
208
- 'iubenda_output_feed' => 'output_feed',
209
- 'iubenda-code-default' => 'code_default',
210
- 'default_skip_parsing' => '',
211
- 'default_iubendactype' => '',
212
- 'default_iubendaparse' => '',
213
- 'default_parser_engine' => '',
214
- 'iub_code' => '',
215
- );
216
-
217
- foreach ( $old_new as $old => $new ) {
218
- if ( $new ) {
219
- $options[$new] = get_option( $old );
220
- }
221
- delete_option( $old );
222
- }
223
-
224
- // multilang support
225
- if ( ! empty( $this->languages ) ) {
226
- foreach ( $this->languages as $lang ) {
227
- $code = get_option( 'iubenda-code-' . $lang );
228
-
229
- if ( ! empty( $code ) ) {
230
- $options['code_' . $lang] = $code;
231
-
232
- delete_option( 'iubenda-code-' . $lang );
233
- }
234
- }
235
- }
236
-
237
- add_option( 'iubenda_cookie_law_solution', $options, '', 'no' );
238
- add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
239
- }
240
- }
241
- }
242
-
243
- /**
244
- * Register shortcode function.
245
- */
246
- public function register_shortcode() {
247
- add_shortcode( 'iub-cookie-policy', array( $this, 'shortcode' ) );
248
- }
249
-
250
- /**
251
- * Handle shortcode function.
252
- *
253
- * @param array $atts
254
- * @param mixed $content
255
- * @return mixed
256
- */
257
- public function shortcode( $atts, $content = '' ) {
258
- return '<!--IUB_COOKIE_POLICY_START-->' . do_shortcode( $content ) . '<!--IUB_COOKIE_POLICY_END-->';
259
- }
260
-
261
- /**
262
- * Add submenu.
263
- */
264
- public function admin_menu_options() {
265
- add_menu_page(
266
- 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda-cookie-law-solution', array( $this, 'options_page' ), 'none'
267
- );
268
- }
269
-
270
- /**
271
- * Load textdomain.
272
- */
273
- public function load_textdomain() {
274
- load_plugin_textdomain( 'iubenda-cookie-law-solution', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
275
- }
276
-
277
- /**
278
- * Load admin scripts and styles.
279
- *
280
- * @param string $page
281
- * @return void
282
- */
283
- public function admin_enqueue_scripts( $page ) {
284
- if ( $page !== 'toplevel_page_iubenda-cookie-law-solution' )
285
- return;
286
-
287
- wp_enqueue_script(
288
- 'iubenda-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' )
289
- );
290
-
291
- wp_enqueue_style( 'iubenda-admin', plugins_url( 'css/admin.css', __FILE__ ) );
292
- }
293
-
294
- /**
295
- * Load admin style inline, for menu icon only.
296
- *
297
- * @return mixed
298
- */
299
- public function admin_print_styles() {
300
- echo '
301
- <style>
302
- a.toplevel_page_iubenda-cookie-law-solution .wp-menu-image {
303
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDkuNDE4IiBoZWlnaHQ9IjI3My4wMTgiIHZpZXdCb3g9IjAgMCAxMDkuNDE4IDI3My4wMTgiPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGIiBkPSJNMTA5LjQxOCA1NC41M0MxMDkuNDE4IDI0LjQwNCA4NC45MzYgMCA1NC43MDggMCAyNC40ODYgMCAwIDI0LjQwNCAwIDU0LjUzYzAgMTQuNzY1IDUuOSAyOC4xNCAxNS40ODcgMzcuOTUzTDQuMTI0IDI3My4wMThoMTAzLjg3TDk2LjQ3NyA4OS43MzJjOC4wODYtOS41MDQgMTIuOTQtMjEuNzgyIDEyLjk0LTM1LjIwMnptLTY1LjM2LTkuOTAzQzQ3LjAwNyA0MS42OCA1MC42MyA0MC4yIDU0LjkzIDQwLjJjNC4yIDAgNy43NzMgMS40OCAxMC43MjUgNC40MjcgMi45NDggMi45NDggNC40MjQgNi41MjIgNC40MjQgMTAuNzI0IDAgNC4xOTctMS40NzYgNy43OTUtNC40MjQgMTAuNzk1LTIuOTUyIDMtNi41MjQgNC40OTgtMTAuNzI0IDQuNDk4LTQuMTk4IDAtNy44LTEuNDk4LTEwLjc5Ny00LjQ5OC0zLTMtNC41LTYuNi00LjUtMTAuNzk0LS4wMDItNC4yIDEuNDczLTcuNzc0IDQuNDI2LTEwLjcyM3ptNDQuMTY1IDIwOC44M0gyMS40ODZ2LTUuNDAyYzYuNyAwIDExLjItLjY0NiAxMy40OTgtMS45NDYgMi4yOTgtMS4yOTUgNC4xMjUtMy40NSA1LjQ3NS02LjQ0NyAxLjM0Ni0zIDIuMDIzLTguNzQ3IDIuMDIzLTE3LjI0N3YtNTIuOTQzYzAtMTQuODk4LS40NTMtMjQuNTQtMS4zNTItMjguOTQ0LS42OTgtMy4xOTYtMS43OTctNS40Mi0zLjMtNi42Ny0xLjQ5NS0xLjI1LTMuNTQ4LTEuODc0LTYuMTQ3LTEuODc0LTIuNzk4IDAtNi4yLjc1LTEwLjE5NyAyLjI1bC0yLjEwMi01LjQgNDEuMzk0LTE2Ljc5N2g2LjZ2MTEwLjM3N2MwIDguNTk4LjYyNCAxNC4zMiAxLjg3NSAxNy4xNyAxLjI1IDIuODQ4IDMuMDk2IDQuOTc0IDUuNTQ4IDYuMzc0IDIuNDUgMS40MDMgNi45MjYgMi4wOTcgMTMuNDIzIDIuMDk3djUuNHoiLz48L3N2Zz4=);
304
- background-position: center center;
305
- background-repeat: no-repeat;
306
- background-size: 7px auto;
307
- }
308
- </style>
309
- ';
310
- }
311
-
312
- /**
313
- * Enqueue frontend scripts.
314
- *
315
- * @return mixed
316
- */
317
- public function script_position() {
318
- // break on admin side
319
- if ( is_admin() ) {
320
- return;
321
- }
322
-
323
- if ( $this->options['loading'] === 'footer' ) {
324
- add_action( 'wp_footer', array( $this, 'script_load' ), 99 );
325
- } else {
326
- add_action( 'wp_head', array( $this, 'script_load' ), 99 );
327
- }
328
- }
329
-
330
- /**
331
- * Load scripts.
332
- *
333
- * @return string
334
- */
335
- public function script_load() {
336
- /* check if user is logged in, then disable the banner.
337
- if ( is_user_logged_in() ) {
338
- return;
339
- }
340
- */
341
-
342
- // check content type
343
- if ( (bool) $this->options['ctype'] == true ) {
344
- $iub_headers = headers_list();
345
- $destroy = true;
346
-
347
- foreach ( $iub_headers as $h ) {
348
- if ( strpos( $h, "Content-Type: text/html" ) !== false || strpos( $h, "Content-type: text/html" ) !== false ) {
349
- $destroy = false;
350
- }
351
- }
352
-
353
- if ( $destroy ) {
354
- $this->no_html = true;
355
- }
356
- }
357
-
358
- // is post or not html content type?
359
- if ( $_POST || $this->no_html ) {
360
- return;
361
- }
362
-
363
- // initial head output
364
- $iubenda_code = "";
365
-
366
- if ( $this->multilang === true && defined( 'ICL_LANGUAGE_CODE' ) && isset( $this->options['code_' . ICL_LANGUAGE_CODE] ) ) {
367
- $iubenda_code .= $this->options['code_' . ICL_LANGUAGE_CODE];
368
-
369
- // no code for current language, use default
370
- if ( ! $iubenda_code ) {
371
- $iubenda_code .= $this->options['code_default'];
372
- }
373
- } else {
374
- $iubenda_code .= $this->options['code_default'];
375
- }
376
-
377
- $iubenda_code = apply_filters( 'iubenda_script_code', $iubenda_code );
378
-
379
- $iubenda_code .= "\n
380
- <script>
381
- var iCallback = function() {};
382
-
383
- if ( typeof _iub.csConfiguration != 'undefined' ) {
384
- if ( 'callback' in _iub.csConfiguration ) {
385
- if ( 'onConsentGiven' in _iub.csConfiguration.callback )
386
- iCallback = _iub.csConfiguration.callback.onConsentGiven;
387
-
388
- _iub.csConfiguration.callback.onConsentGiven = function() {
389
- iCallback();
390
-
391
- /* separator */
392
- jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
393
- }
394
- }
395
- }
396
- </script>";
397
-
398
- echo apply_filters( 'iubenda_code', $iubenda_code );
399
- }
400
-
401
- /**
402
- * Initialize html output.
403
- *
404
- * @return void
405
- */
406
- public function output_start() {
407
- if ( ! is_admin() ) {
408
- ob_start( array( $this, 'output_callback' ) );
409
- }
410
- }
411
-
412
- /**
413
- * Finish html output.
414
- *
415
- * @return void
416
- */
417
- public function output_end() {
418
- if ( ! is_admin() && ob_get_level() ) {
419
- ob_end_flush();
420
- }
421
- }
422
-
423
- /**
424
- * Handle final html output.
425
- *
426
- * @param mixed $output
427
- * @return mixed
428
- */
429
- public function output_callback( $output ) {
430
- // break on ajax, xmlrpc or iub_no_parse request
431
- if (
432
- ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
433
- || ( defined( 'DOING_AJAX' ) && DOING_AJAX )
434
- || isset( $_SERVER["HTTP_X_REQUESTED_WITH"] )
435
- || isset( $_GET['iub_no_parse'] )
436
- ) {
437
- return $output;
438
- }
439
-
440
- // break on admin side
441
- if ( is_admin() ) {
442
- return $output;
443
- }
444
-
445
- // break for logged in users?
446
- /* if ( is_user_logged_in() ) {
447
- return $output;
448
- }
449
- */
450
-
451
- // break on rss feed
452
- if ( is_feed() && $this->options['output_feed'] ) {
453
- return $output;
454
- }
455
-
456
- if ( strpos( $output, "<html" ) === false ) {
457
- return $output;
458
- } elseif ( strpos( $output, "<html" ) > 200 ) {
459
- return $output;
460
- }
461
-
462
- // check whether to run parser or not
463
- if (
464
- ! $this->options['parse'] || ( iubendaPage::consent_given() && $this->options['skip_parsing'] ) || iubendaPage::bot_detected() || $_POST || $this->no_html ) {
465
-
466
- return $output;
467
- }
468
-
469
- $startime = microtime( true );
470
-
471
- // experimental class
472
- if ( $this->options['parser_engine'] == 'new' ) {
473
- $faster = new iubendaFaster;
474
-
475
- // render output
476
- $output = $faster->isParse( mb_convert_encoding( $output, 'HTML-ENTITIES', 'UTF-8' ) );
477
-
478
- // append signature
479
- $output .= '<!-- Parsed with iubenda experimental class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
480
- // default class
481
- } else {
482
- $page = new iubendaPage( $output );
483
- $page->parse();
484
-
485
- // render output
486
- $output = $page->get_converted_page();
487
-
488
- // append signature
489
- $output .= '<!-- Parsed with iubenda default class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
490
- }
491
-
492
- return apply_filters( 'iubenda_final_output', $output );
493
- }
494
-
495
- /**
496
- * Register plugin options.
497
- */
498
- public function register_options() {
499
- register_setting( 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution', array( $this, 'save_options' ) );
500
-
501
- add_settings_section( 'iubenda_cookie_law_solution', '', '', 'iubenda_cookie_law_solution' );
502
- add_settings_field( 'iub_code', __( 'Code', 'iubenda-cookie-law-solution' ), array( $this, 'iub_code' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
503
- add_settings_field( 'iub_parse', __( 'Scripts blocking', 'iubenda-cookie-law-solution' ), array( $this, 'iub_parse' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
504
- add_settings_field( 'iub_loading', __( 'Scripts loading', 'iubenda-cookie-law-solution' ), array( $this, 'iub_loading' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
505
- add_settings_field( 'iub_ctype', __( 'Content type', 'iubenda-cookie-law-solution' ), array( $this, 'iub_ctype' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
506
- add_settings_field( 'iub_output_feed', __( 'RSS feed', 'iubenda-cookie-law-solution' ), array( $this, 'iub_output_feed' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
507
- add_settings_field( 'iub_deactivatioin', __( 'Deactivation', 'iubenda-cookie-law-solution' ), array( $this, 'iub_deactivation' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
508
- }
509
-
510
- /**
511
- * Display errors and notices.
512
- */
513
- public function settings_errors() {
514
- settings_errors( 'iub_settings_errors' );
515
- }
516
-
517
- /**
518
- * Code option.
519
- *
520
- * @return mixed
521
- */
522
- public function iub_code() {
523
- // multilang support
524
- if ( $this->multilang && ! empty( $this->languages ) ) {
525
- echo '
526
- <div id="contextual-help-wrap" class="hidden" tabindex="-1" style="display: block;">
527
- <div id="contextual-help-back"></div>
528
- <div id="contextual-help-columns">
529
- <div class="contextual-help-tabs">
530
- <ul>';
531
- foreach ( $this->languages as $lang_id => $lang_name ) {
532
- echo '
533
- <li id="tab-link-overview" class="' . ( $this->lang_default == $lang_id ? 'active' : '' ) . '">
534
- <a href="#tab-panel-' . $lang_id . '" aria-controls="tab-panel-' . $lang_id . '">' . $lang_name . '</a>
535
- </li>';
536
- }
537
- echo '
538
- </ul>
539
- </div>
540
-
541
- <div class="contextual-help-tabs-wrap">';
542
- foreach ( $this->languages as $lang_id => $lang_name ) {
543
- // get code for the language
544
- $code = ! empty( $this->options['code_' . $lang_id] ) ? html_entity_decode( trim( wp_kses( $this->options['code_' . $lang_id], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : '';
545
- // handle default, if empty
546
- $code = empty( $code ) && $lang_id == $this->lang_default ? html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : $code;
547
-
548
- echo '
549
- <div id="tab-panel-' . $lang_id . '" class="help-tab-content' . ( $this->lang_default == $lang_id ? ' active' : '' ) . '">
550
- <textarea name="iubenda_cookie_law_solution[code_' . $lang_id . ']" class="large-text" cols="50" rows="10">' . $code . '</textarea>
551
- <p class="description">' . sprintf( __( 'Enter the iubenda code for %s.', 'iubenda-cookie-law-solution' ), $lang_name ) . '</p>
552
- </div>';
553
- }
554
- echo '
555
- </div>
556
- </div>
557
- </div>';
558
- } else {
559
- echo '
560
- <div id="iub_code_default">
561
- <textarea name="iubenda_cookie_law_solution[code_default]" class="large-text" cols="50" rows="10">' . html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) . '</textarea>
562
- <p class="description">' . __( 'Enter the iubenda code.', 'iubenda-cookie-law-solution' ) . '</p>
563
- </div>';
564
- }
565
- }
566
-
567
- /**
568
- * Parsing option.
569
- *
570
- * @return mixed
571
- */
572
- public function iub_parse() {
573
- echo '
574
- <div id="iub_parse_container">
575
- <label><input id="iub_parse" type="checkbox" name="iubenda_cookie_law_solution[parse]" value="1" ' . checked( true, (bool) $this->options['parse'], false ) . '/>' . __( 'Automatically block scripts detected by the plugin.', 'iubenda-cookie-law-solution' ) . '</label>
576
- <p class="description">' . '(' . sprintf( __( "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of detected scripts.", 'iubenda-cookie-law-solution' ), $this->links['documentation'] ) . ')' . '</p>
577
- <div id="iub_parser_engine_container"' . ( $this->options['parse'] === false ? ' style="display: none;"' : '' ) . '>
578
- <div>
579
- <label><input id="iub_parser_engine-default" type="radio" name="iubenda_cookie_law_solution[parser_engine]" value="default" ' . checked( 'default', $this->options['parser_engine'], false ) . ' />' . __( 'Default', 'iubenda-cookie-law-solution' ) . '</label>
580
- <label><input id="iub_parser_engine-new" type="radio" name="iubenda_cookie_law_solution[parser_engine]" value="new" ' . checked( 'new', $this->options['parser_engine'], false ) . ' />' . __( 'Experimental', 'iubenda-cookie-law-solution' ) . '</label>
581
- <p class="description">' . __( 'Select parsing engine.', 'iubenda-cookie-law-solution' ) . '</p>
582
- </div>
583
- <div>
584
- <label><input id="iub_skip_parsing" type="checkbox" name="iubenda_cookie_law_solution[skip_parsing]" value="1" ' . checked( true, (bool) $this->options['skip_parsing'], false ) . '/>' . __( 'Leave scripts untouched on the page if the user has already given consent', 'iubenda-cookie-law-solution' ) . '</label>
585
- <p class="description">(' . __( "improves performance, highly recommended, to be deactivated only if your site uses a caching system", 'iubenda-cookie-law-solution' ) . ')</p>
586
- </div>
587
- </div>
588
- </div>';
589
- }
590
-
591
- /**
592
- * Scripts loading option.
593
- *
594
- * @return mixed
595
- */
596
- public function iub_loading() {
597
- echo '
598
- <div id="iub_loading_container">
599
- <label><input id="iub_loading-header" type="radio" name="iubenda_cookie_law_solution[loading]" value="header" ' . checked( 'header', $this->options['loading'], false ) . ' />' . __( 'Header', 'iubenda-cookie-law-solution' ) . '</label>
600
- <label><input id="iub_loading_footer" type="radio" name="iubenda_cookie_law_solution[loading]" value="footer" ' . checked( 'footer', $this->options['loading'], false ) . ' />' . __( 'Footer', 'iubenda-cookie-law-solution' ) . '</label>
601
- <p class="description">' . __( 'Select scripts loading position.', 'iubenda-cookie-law-solution' ) . '</p>
602
- </div>';
603
- }
604
-
605
- /**
606
- * Ctype option.
607
- *
608
- * @return mixed
609
- */
610
- public function iub_ctype() {
611
- echo '
612
- <div id="iub_ctype_container">
613
- <label><input id="iub_ctype" type="checkbox" name="iubenda_cookie_law_solution[ctype]" value="1" ' . checked( true, (bool) $this->options['ctype'], false ) . '/>' . __( 'Restrict the plugin to run only for requests that have "Content-type: text / html" (recommended)', 'iubenda-cookie-law-solution' ) . '</label>
614
- </div>';
615
- }
616
-
617
- /**
618
- * RSS feed option.
619
- *
620
- * @return mixed
621
- */
622
- public function iub_output_feed() {
623
- echo '
624
- <div id="iub_output_feed_container">
625
- <label><input id="iub_ctype" type="checkbox" name="iubenda_cookie_law_solution[output_feed]" value="1" ' . checked( true, (bool) $this->options['output_feed'], false ) . '/>' . __( 'Do not run the plugin inside the RSS feed (recommended)', 'iubenda-cookie-law-solution' ) . '</label>
626
- </div>';
627
- }
628
-
629
- /**
630
- * Deactivation option.
631
- *
632
- * @return mixed
633
- */
634
- public function iub_deactivation() {
635
- echo '
636
- <div id="iub_deactivation_container">
637
- <label><input id="iub_deactivation" type="checkbox" name="iubenda_cookie_law_solution[deactivation]" value="1" ' . checked( true, (bool) $this->options['deactivation'], false ) . '/>' . __( 'Delete all plugin data upon deactivation?', 'iubenda-cookie-law-solution' ) . '</label>
638
- </div>';
639
- }
640
-
641
- /**
642
- * Save options.
643
- *
644
- * @return void
645
- */
646
- public function save_options( $input ) {
647
- if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) )
648
- return;
649
-
650
- // save options
651
- if ( isset( $_POST['save_iubenda_options'] ) ) {
652
- $input['parse'] = (bool) isset( $input['parse'] );
653
- $input['parser_engine'] = isset( $input['parser_engine'] ) && in_array( $input['parser_engine'], array( 'default', 'new' ) ) ? $input['parser_engine'] : $this->defaults['parser_engine'];
654
- $input['loading'] = isset( $input['loading'] ) && in_array( $input['loading'], array( 'header', 'footer' ) ) ? $input['loading'] : $this->defaults['loading'];
655
- $input['skip_parsing'] = (bool) isset( $input['skip_parsing'] );
656
- $input['ctype'] = (bool) isset( $input['ctype'] );
657
- $input['output_feed'] = (bool) isset( $input['output_feed'] );
658
- $input['deactivation'] = (bool) isset( $input['deactivation'] );
659
-
660
- // multilang support
661
- if ( $this->multilang && ! empty( $this->languages ) ) {
662
- foreach ( $this->languages as $lang_id => $lang_name ) {
663
- $input['code_' . $lang_id] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
664
-
665
- // handle default lang too
666
- if ( $lang_id == $this->lang_default ) {
667
- $input['code_default'] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : $this->options['code_default'];
668
- }
669
- }
670
- } else {
671
- $input['code_default'] = ! empty( $input['code_default'] ) ? wp_kses( $input['code_default'], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
672
- }
673
-
674
- add_settings_error( 'iub_settings_errors', 'iub_settings_updated', __( 'Settings saved.', 'iubenda-cookie-law-solution' ), 'updated' );
675
- // reset options
676
- } elseif ( isset( $_POST['reset_iubenda_options'] ) ) {
677
- $input = $this->defaults;
678
-
679
- // multilang support
680
- if ( $this->multilang && ! empty( $this->languages ) ) {
681
- foreach ( $this->languages as $lang_id => $lang_name ) {
682
- $input['code_' . $lang_id] = '';
683
- }
684
- }
685
- add_settings_error( 'iub_settings_errors', 'iub_settings_restored', __( 'Settings restored to defaults.', 'iubenda-cookie-law-solution' ), 'updated' );
686
- }
687
-
688
- return $input;
689
- }
690
-
691
- /**
692
- * Load admin options page.
693
- *
694
- * @return void
695
- */
696
- public function options_page() {
697
- if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) ) {
698
- wp_die( __( "You don't have permission to access this page.", 'iubenda-cookie-law-solution' ) );
699
- }
700
- ?>
701
- <div class="wrap">
702
- <div id="iubenda-view">
703
- <?php
704
- echo '
705
- <a class="iubenda-link" href="http://iubenda.com"><img id="iubenda-logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAAAdCAMAAAB8M6mmAAAAhFBMVEUAAAA0O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0I0O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr3/////G69+35tdTw5/U8Ofx+vdiyKd+0rep4c/i9e8otIeN17/AB1g0AAAAHnRSTlMAEBAgIDAwQEBQUGBwcICAkJCgoLCwwMDQ0ODg8PCQCZ0FAAACrklEQVR4Xr2V63LbIBCFF1OZKBCiKAohlK7kXHt5//cruyDjjFTX42l9fnhh1+yHGB0EAJu7kXS/gUto8zRmPV2Edz/OergA7ctYtV0DCKPPBCgrF7kb4rzs3incrCzpEd05LKEDolqkb4nzNr1RuF1UB8TzcE1E/CPu+7Rbxwnozn06Eddw25H0wr9XsJQh3Flyazh4HGd9hRWpf4zbfptx15fAwR53dRHcWHFSkQDKoOJ05w5M1NjBdXpvFU0WW9TlHidN73rbVtz7844PU7mIiADQOkyaccIjqQOW6DHQ/3yTxiYg2pQhqVIfMPYDYiwZHdF3gdpk3K/XadoVH6hCgbbivMcsyzSPhntiFBAcbcOj6xI/QKl7UYynciOTj9YWJ/z8scfBjIOKQ68ADC2n8+oKNc37FHuqp7xMsQGuRzHvV1U/tMVQVwm0O4oLIg+4v0CkKXNiChZxEMVmbQrN/tBjweVdygXu7g84B3N/D6AxWhYdY8ZZgDroM6QaQUfGiwXu8Tiu5UyP0e3VLHERccUIqseCuzkVJzjjMEDVAtfgCk4HdLrgbk/FQcHhMZxa4hqPLg0WuKcTce1fcPITTvMbtoIbj+MaHvWIAxQFuXqYuuLYMKH08xQeTsVpbqRrPx1h9VVxFcd+6w77PX7G+dmtC5zDILK90XAl2nUjoD7A2fJUzRK3AYCBLzc5JCwqIarNTdmHxaRg7YBR5Gl3iJOx8EyKVkjFuxO8qhky7nV6m79ALXdDLyhGxXdf0EJYjO1s9yLFN2TZjgiIngaaSt4FjPla55AWc5o+dx/P0zQ9fzCOT5EfMBU19+nygl5CkeVEaCo6gOfI76AKuewwWgnQ0NRJcNwVxirGgdSGOlkFs5SxLZFrwppaXUoZ6qD1PFWSQ8p9wl3D/9ZvoAF23RgFj1kAAAAASUVORK5CYII="/></a>
706
- <p class="iubenda-text">
707
- ' . __( "This plugin is the easiest and most comprehensive way to adapt your WordPress site to the European cookie law. Upon your user's first visit, the plugin will take care of collecting their consent, of blocking the most popular among the scripts that install cookies and subsequently reactivate these scripts as soon as consent is provided. The basic settings include obtaining consent by a simple scroll action (the most effective method) and script reactivation without refreshing the page.", 'iubenda-cookie-law-solution' ) . '
708
- </p>
709
- <p class="iubenda-text">
710
- <span class="iubenda-title">' . __( "Would you like to know more about the cookie law?", 'iubenda-cookie-law-solution' ) . '</span><br />
711
- ' . sprintf( __( "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete guide to the cookie law.</a>", 'iubenda-cookie-law-solution' ), $this->links['guide'] ) . '
712
- </p>
713
- <p class="iubenda-text">
714
- <span class="iubenda-title">' . __( "What is the full functionality of the plugin?", 'iubenda-cookie-law-solution' ) . '</span><br />
715
- ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page.</a>", 'iubenda-cookie-law-solution' ), $this->links['plugin_page'] ) . '
716
- </p>
717
- <p class="iubenda-text">
718
- <span class="iubenda-title">' . __( "Enter the iubenda code for the Cookie Solution below.", 'iubenda-cookie-law-solution' ) . '</span><br />
719
- ' . sprintf( __( "In order to run the plugin, you need to enter the iubenda code that activates the cookie law banner and the cookie policy in the form below. This code can be generated on www.iubenda.com, following <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">this guide.</a>", 'iubenda-cookie-law-solution' ), $this->links['generating_code'] ) . '
720
- </p>';
721
- ?>
722
- <form id="iubenda-tabs" action="options.php" method="post">
723
- <?php
724
- settings_fields( 'iubenda_cookie_law_solution' );
725
- do_settings_sections( 'iubenda_cookie_law_solution' );
726
-
727
- echo ' <p class="submit">';
728
- submit_button( '', 'primary', 'save_iubenda_options', false );
729
- echo ' ';
730
- submit_button( __( 'Reset to defaults', 'iubenda-cookie-law-solution' ), 'secondary', 'reset_iubenda_options', false );
731
- echo ' </p>';
732
- ?>
733
- </form>
734
- <?php echo '
735
- <p class="iubenda-text">
736
- <span class="iubenda-title">' . __( 'Need support for this plugin?', 'iubenda-cookie-law-solution' ) . '</span><br />
737
- ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support forum.</a>", 'iubenda-cookie-law-solution' ), $this->links['support_forum'] ) . '
738
- </p>
739
- <p class="iubenda-text">
740
- <span class="iubenda-title">' . __( 'Want to try a beta version of this plugin with the latest features?', 'iubenda-cookie-law-solution' ) . '</span><br />
741
- ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">documentation pages</a> and follow the instructions to install a beta version.", 'iubenda-cookie-law-solution' ), $this->links['documentation'] ) . '
742
- </p>';
743
- ?>
744
- </div>
745
- <div class="clear"></div>
746
- </div>
747
- <?php
748
- }
749
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
  }
1
+ <?php
2
+ /*
3
+ Plugin Name: iubenda Cookie Solution for GDPR
4
+ Plugin URI: https://www.iubenda.com
5
+ Description: iubenda Cookie Solution allows you to make your website GDPR compliant and manage all aspects of cookie law on WP.
6
+ Version: 1.15.0
7
+ Author: iubenda
8
+ Author URI: https://www.iubenda.com
9
+ License: MIT License
10
+ License URI: http://opensource.org/licenses/MIT
11
+ Text Domain: iubenda-cookie-law-solution
12
+ Domain Path: /languages
13
+
14
+ ibenda Cookie Solution
15
+ Copyright (C) 2018, iubenda s.r.l
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ // exit if accessed directly
25
+ if ( ! defined( 'ABSPATH' ) )
26
+ exit;
27
+
28
+ // define contants
29
+ define( 'IUB_DEBUG', false );
30
+
31
+ // set plugin instance
32
+ $iubenda_cookie_law_solution = new iubenda_Cookie_Law_Solution();
33
+
34
+ /**
35
+ * iubenda_Cookie_Law_Solution final class.
36
+ *
37
+ * @class iubenda_Cookie_Law_Solution
38
+ * @version 1.15.0
39
+ */
40
+ class iubenda_Cookie_Law_Solution {
41
+
42
+ public $options;
43
+ public $defaults = array(
44
+ 'parse' => false, // iubenda_parse
45
+ 'skip_parsing' => true, // skip_parsing
46
+ 'ctype' => true, // iubenda_ctype
47
+ 'parse' => false, // iubenda_parse
48
+ 'parser_engine' => 'new', // parser_engine
49
+ 'output_feed' => true, // iubenda_output_feed
50
+ 'code_default' => false, // iubenda-code-default,
51
+ 'menu_position' => 'topmenu',
52
+ 'deactivation' => false
53
+ );
54
+ public $version = '1.15.0';
55
+ public $no_html = false;
56
+ public $links = array();
57
+ public $multilang = false;
58
+ public $languages = array();
59
+ public $lang_default = '';
60
+
61
+ /**
62
+ * Class constructor.
63
+ */
64
+ public function __construct() {
65
+ register_activation_hook( __FILE__, array( $this, 'activation' ) );
66
+ register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
67
+
68
+ // settings
69
+ $this->options = array_merge( $this->defaults, (array) get_option( 'iubenda_cookie_law_solution', $this->defaults ) );
70
+
71
+ // actions
72
+ add_action( 'admin_init', array( $this, 'register_options' ) );
73
+ add_action( 'admin_init', array( $this, 'update_plugin' ), 9 );
74
+ add_action( 'admin_init', array( $this, 'admin_page_redirect' ), 20 );
75
+ add_action( 'admin_menu', array( $this, 'admin_menu_options' ) );
76
+ add_action( 'admin_notices', array( $this, 'settings_errors' ) );
77
+ // add_action( 'admin_menu', array( $this, 'save_options' ), 9 );
78
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
79
+ add_action( 'plugins_loaded', array( $this, 'init' ) );
80
+ add_action( 'after_setup_theme', array( $this, 'register_shortcode' ) );
81
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
82
+ add_action( 'admin_print_styles', array( $this, 'admin_print_styles' ) );
83
+ add_action( 'wp_head', array( $this, 'wp_head' ), 99 );
84
+ add_action( 'template_redirect', array( $this, 'output_start' ), 0 );
85
+ add_action( 'shutdown', array( $this, 'output_end' ), 100 );
86
+ }
87
+
88
+ /**
89
+ * Initialize plugin.
90
+ *
91
+ * @return void
92
+ */
93
+ public function init() {
94
+
95
+ // check if WPML or Polylang is active
96
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
+
98
+ // Polylang support
99
+ if ( is_plugin_active( 'polylang/polylang.php' ) && function_exists( 'PLL' ) ) {
100
+ $this->multilang = true;
101
+
102
+ // get registered languages
103
+ $registered_languages = PLL()->model->get_languages_list();
104
+
105
+ if ( ! empty( $registered_languages ) ) {
106
+ foreach ( $registered_languages as $language )
107
+ $this->languages[$language->slug] = $language->name;
108
+ }
109
+
110
+ // get default language
111
+ $this->lang_default = pll_default_language();
112
+
113
+ // WPML support
114
+ } elseif ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && class_exists( 'SitePress' ) ) {
115
+ $this->multilang = true;
116
+
117
+ global $sitepress;
118
+
119
+ // get registered languages
120
+ $registered_languages = icl_get_languages();
121
+
122
+ if ( ! empty( $registered_languages ) ) {
123
+ foreach ( $registered_languages as $language )
124
+ $this->languages[$language['code']] = $language['display_name'];
125
+ }
126
+
127
+ // get default language
128
+ $this->lang_default = $sitepress->get_default_language();
129
+ }
130
+
131
+ // load Simple HTML DOM if needed
132
+ if ( ! function_exists( 'file_get_html' ) ) {
133
+ require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/simple_html_dom.php' );
134
+ }
135
+
136
+ // load plugin class
137
+ require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.faster.php' );
138
+ require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.php' );
139
+
140
+ $links = array(
141
+ 'en' => array(
142
+ 'guide' => 'https://www.iubenda.com/en/iubenda-cookie-law-solution',
143
+ 'plugin_page' => 'https://www.iubenda.com/en/help/posts/1215',
144
+ 'generating_code' => 'https://www.iubenda.com/en/help/posts/1177',
145
+ 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
146
+ 'documentation' => 'https://www.iubenda.com/en/help/posts/1215'
147
+ ),
148
+ 'it' => array(
149
+ 'guide' => 'https://www.iubenda.com/it/soluzione-cookie-law',
150
+ 'plugin_page' => 'https://www.iubenda.com/it/help/posts/810',
151
+ 'generating_code' => 'https://www.iubenda.com/it/help/posts/680',
152
+ 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
153
+ 'documentation' => 'https://www.iubenda.com/it/help/posts/810',
154
+ )
155
+ );
156
+
157
+ $locale = explode( '_', get_locale() );
158
+ $locale_code = $locale[0];
159
+
160
+ // assign links
161
+ $this->links = in_array( $locale_code, array_keys( $links ) ) ? $links[$locale_code] : $links['en'];
162
+ }
163
+
164
+ /**
165
+ * Plugin activation.
166
+ *
167
+ * @return void
168
+ */
169
+ public function activation() {
170
+ add_option( 'iubenda_cookie_law_solution', $this->options, '', 'no' );
171
+ add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
172
+ }
173
+
174
+ /**
175
+ * Plugin deactivation.
176
+ *
177
+ * @return void
178
+ */
179
+ public function deactivation() {
180
+ // remove options from database?
181
+ if ( $this->options['deactivation'] ) {
182
+ delete_option( 'iubenda_cookie_law_solution' );
183
+ delete_option( 'iubenda_cookie_law_version' );
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Plugin options migration for versions < 1.14.0
189
+ *
190
+ * @return void
191
+ */
192
+ public function update_plugin() {
193
+ if ( ! current_user_can( 'install_plugins' ) )
194
+ return;
195
+
196
+ $db_version = get_option( 'iubenda_cookie_law_version' );
197
+ $db_version = ! $db_version ? '1.13.0' : $db_version;
198
+
199
+ if ( $db_version != false ) {
200
+ if ( version_compare( $db_version, '1.14.0', '<' ) ) {
201
+ $options = array();
202
+
203
+ $old_new = array(
204
+ 'iubenda_parse' => 'parse',
205
+ 'skip_parsing' => 'skip_parsing',
206
+ 'iubenda_ctype' => 'ctype',
207
+ 'iubenda_parse' => 'parse',
208
+ 'parser_engine' => 'parser_engine',
209
+ 'iubenda_output_feed' => 'output_feed',
210
+ 'iubenda-code-default' => 'code_default',
211
+ 'default_skip_parsing' => '',
212
+ 'default_iubendactype' => '',
213
+ 'default_iubendaparse' => '',
214
+ 'default_parser_engine' => '',
215
+ 'iub_code' => '',
216
+ );
217
+
218
+ foreach ( $old_new as $old => $new ) {
219
+ if ( $new ) {
220
+ $options[$new] = get_option( $old );
221
+ }
222
+ delete_option( $old );
223
+ }
224
+
225
+ // multilang support
226
+ if ( ! empty( $this->languages ) ) {
227
+ foreach ( $this->languages as $lang ) {
228
+ $code = get_option( 'iubenda-code-' . $lang );
229
+
230
+ if ( ! empty( $code ) ) {
231
+ $options['code_' . $lang] = $code;
232
+
233
+ delete_option( 'iubenda-code-' . $lang );
234
+ }
235
+ }
236
+ }
237
+
238
+ add_option( 'iubenda_cookie_law_solution', $options, '', 'no' );
239
+ add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
240
+ }
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Register shortcode function.
246
+ */
247
+ public function register_shortcode() {
248
+ add_shortcode( 'iub-cookie-policy', array( $this, 'shortcode' ) );
249
+ }
250
+
251
+ /**
252
+ * Handle shortcode function.
253
+ *
254
+ * @param array $atts
255
+ * @param mixed $content
256
+ * @return mixed
257
+ */
258
+ public function shortcode( $atts, $content = '' ) {
259
+ return '<!--IUB_COOKIE_POLICY_START-->' . do_shortcode( $content ) . '<!--IUB_COOKIE_POLICY_END-->';
260
+ }
261
+
262
+ /**
263
+ * Add submenu.
264
+ */
265
+ public function admin_menu_options() {
266
+ if ( $this->options['menu_position'] === 'submenu' ) {
267
+ // sub menu
268
+ add_submenu_page(
269
+ 'options-general.php', 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda-cookie-law-solution', array( $this, 'options_page' ), 'none'
270
+ );
271
+ } else {
272
+ // top menu
273
+ add_menu_page(
274
+ 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda-cookie-law-solution', array( $this, 'options_page' ), 'none'
275
+ );
276
+ }
277
+ }
278
+
279
+ /**
280
+ * Load textdomain.
281
+ */
282
+ public function load_textdomain() {
283
+ load_plugin_textdomain( 'iubenda-cookie-law-solution', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
284
+ }
285
+
286
+ /**
287
+ * Load admin scripts and styles.
288
+ *
289
+ * @param string $page
290
+ * @return void
291
+ */
292
+ public function admin_enqueue_scripts( $page ) {
293
+ if ( ! in_array( $page, array( 'toplevel_page_iubenda-cookie-law-solution', 'settings_page_iubenda-cookie-law-solution' ) ) )
294
+ return;
295
+
296
+ wp_enqueue_script(
297
+ 'iubenda-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' )
298
+ );
299
+
300
+ wp_enqueue_style( 'iubenda-admin', plugins_url( 'css/admin.css', __FILE__ ) );
301
+ }
302
+
303
+ /**
304
+ * Load admin style inline, for menu icon only.
305
+ *
306
+ * @return mixed
307
+ */
308
+ public function admin_print_styles() {
309
+ echo '
310
+ <style>
311
+ a.toplevel_page_iubenda-cookie-law-solution .wp-menu-image {
312
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDkuNDE4IiBoZWlnaHQ9IjI3My4wMTgiIHZpZXdCb3g9IjAgMCAxMDkuNDE4IDI3My4wMTgiPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGIiBkPSJNMTA5LjQxOCA1NC41M0MxMDkuNDE4IDI0LjQwNCA4NC45MzYgMCA1NC43MDggMCAyNC40ODYgMCAwIDI0LjQwNCAwIDU0LjUzYzAgMTQuNzY1IDUuOSAyOC4xNCAxNS40ODcgMzcuOTUzTDQuMTI0IDI3My4wMThoMTAzLjg3TDk2LjQ3NyA4OS43MzJjOC4wODYtOS41MDQgMTIuOTQtMjEuNzgyIDEyLjk0LTM1LjIwMnptLTY1LjM2LTkuOTAzQzQ3LjAwNyA0MS42OCA1MC42MyA0MC4yIDU0LjkzIDQwLjJjNC4yIDAgNy43NzMgMS40OCAxMC43MjUgNC40MjcgMi45NDggMi45NDggNC40MjQgNi41MjIgNC40MjQgMTAuNzI0IDAgNC4xOTctMS40NzYgNy43OTUtNC40MjQgMTAuNzk1LTIuOTUyIDMtNi41MjQgNC40OTgtMTAuNzI0IDQuNDk4LTQuMTk4IDAtNy44LTEuNDk4LTEwLjc5Ny00LjQ5OC0zLTMtNC41LTYuNi00LjUtMTAuNzk0LS4wMDItNC4yIDEuNDczLTcuNzc0IDQuNDI2LTEwLjcyM3ptNDQuMTY1IDIwOC44M0gyMS40ODZ2LTUuNDAyYzYuNyAwIDExLjItLjY0NiAxMy40OTgtMS45NDYgMi4yOTgtMS4yOTUgNC4xMjUtMy40NSA1LjQ3NS02LjQ0NyAxLjM0Ni0zIDIuMDIzLTguNzQ3IDIuMDIzLTE3LjI0N3YtNTIuOTQzYzAtMTQuODk4LS40NTMtMjQuNTQtMS4zNTItMjguOTQ0LS42OTgtMy4xOTYtMS43OTctNS40Mi0zLjMtNi42Ny0xLjQ5NS0xLjI1LTMuNTQ4LTEuODc0LTYuMTQ3LTEuODc0LTIuNzk4IDAtNi4yLjc1LTEwLjE5NyAyLjI1bC0yLjEwMi01LjQgNDEuMzk0LTE2Ljc5N2g2LjZ2MTEwLjM3N2MwIDguNTk4LjYyNCAxNC4zMiAxLjg3NSAxNy4xNyAxLjI1IDIuODQ4IDMuMDk2IDQuOTc0IDUuNTQ4IDYuMzc0IDIuNDUgMS40MDMgNi45MjYgMi4wOTcgMTMuNDIzIDIuMDk3djUuNHoiLz48L3N2Zz4=);
313
+ background-position: center center;
314
+ background-repeat: no-repeat;
315
+ background-size: 7px auto;
316
+ }
317
+ </style>
318
+ ';
319
+ }
320
+
321
+ /**
322
+ * Redirect to the correct urle after switching menu position.
323
+ *
324
+ * @global string $pagenow
325
+ */
326
+ public function admin_page_redirect() {
327
+ if ( ! empty( $_GET['settings-updated'] ) && ! empty( $_GET['page'] ) && in_array( $_GET['page'], array( 'iubenda-cookie-law-solution' ) ) ) {
328
+ global $pagenow;
329
+
330
+ // no redirect by default
331
+ $redirect_to = false;
332
+
333
+ if ( $this->options['menu_position'] === 'submenu' && $pagenow === 'admin.php' ) {
334
+ // sub menu
335
+ $redirect_to = admin_url( 'options-general.php?page=iubenda-cookie-law-solution' );
336
+ } elseif ( $this->options['menu_position'] === 'topmenu' && $pagenow === 'options-general.php' ) {
337
+ // top menu
338
+ $redirect_to = admin_url( 'admin.php?page=iubenda-cookie-law-solution' );
339
+ }
340
+
341
+ if ( $redirect_to ) {
342
+ // make sure it's current host location
343
+ wp_safe_redirect( add_query_arg( 'settings-updated', true, $redirect_to ) );
344
+ exit;
345
+ }
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Add wp_head content.
351
+ *
352
+ * @return mixed
353
+ */
354
+ public function wp_head() {
355
+ /* check if user is logged in, then disable the banner.
356
+ if ( is_user_logged_in() ) {
357
+ return;
358
+ }
359
+ */
360
+
361
+ // break on admin side
362
+ if ( is_admin() ) {
363
+ return;
364
+ }
365
+
366
+ // check content type
367
+ if ( (bool) $this->options['ctype'] == true ) {
368
+ $iub_headers = headers_list();
369
+ $destroy = true;
370
+
371
+ foreach ( $iub_headers as $h ) {
372
+ if ( strpos( $h, "Content-Type: text/html" ) !== false || strpos( $h, "Content-type: text/html" ) !== false ) {
373
+ $destroy = false;
374
+ }
375
+ }
376
+
377
+ if ( $destroy ) {
378
+ $this->no_html = true;
379
+ }
380
+ }
381
+
382
+ // is post or not html content type?
383
+ if ( $_POST || $this->no_html ) {
384
+ return;
385
+ }
386
+
387
+ // initial head output
388
+ $iubenda_code = "";
389
+
390
+ if ( $this->multilang === true && defined( 'ICL_LANGUAGE_CODE' ) && isset( $this->options['code_' . ICL_LANGUAGE_CODE] ) ) {
391
+ $iubenda_code .= $this->options['code_' . ICL_LANGUAGE_CODE];
392
+
393
+ // no code for current language, use default
394
+ if ( ! $iubenda_code ) {
395
+ $iubenda_code .= $this->options['code_default'];
396
+ }
397
+ } else {
398
+ $iubenda_code .= $this->options['code_default'];
399
+ }
400
+
401
+ $iubenda_code .= "\n
402
+ <script>
403
+ var iCallback = function() {};
404
+
405
+ if ( typeof _iub.csConfiguration != 'undefined' ) {
406
+ if ( 'callback' in _iub.csConfiguration ) {
407
+ if ( 'onConsentGiven' in _iub.csConfiguration.callback )
408
+ iCallback = _iub.csConfiguration.callback.onConsentGiven;
409
+
410
+ _iub.csConfiguration.callback.onConsentGiven = function() {
411
+ iCallback();
412
+
413
+ /* separator */
414
+ jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
415
+ }
416
+ }
417
+ }
418
+ </script>";
419
+
420
+ echo $iubenda_code;
421
+ }
422
+
423
+ /**
424
+ * Initialize html output.
425
+ *
426
+ * @return void
427
+ */
428
+ public function output_start() {
429
+ if ( ! is_admin() ) {
430
+ ob_start( array( $this, 'output_callback' ) );
431
+ }
432
+ }
433
+
434
+ /**
435
+ * Finish html output.
436
+ *
437
+ * @return void
438
+ */
439
+ public function output_end() {
440
+ if ( ! is_admin() && ob_get_level() ) {
441
+ ob_end_flush();
442
+ }
443
+ }
444
+
445
+ /**
446
+ * Handle final html output.
447
+ *
448
+ * @param mixed $output
449
+ * @return mixed
450
+ */
451
+ public function output_callback( $output ) {
452
+ // break on ajax, xmlrpc or iub_no_parse request
453
+ if (
454
+ ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
455
+ || ( defined( 'DOING_AJAX' ) && DOING_AJAX )
456
+ || isset( $_SERVER["HTTP_X_REQUESTED_WITH"] )
457
+ || isset( $_GET['iub_no_parse'] )
458
+ ) {
459
+ return $output;
460
+ }
461
+
462
+ // break on admin side
463
+ if ( is_admin() ) {
464
+ return $output;
465
+ }
466
+
467
+ // break for logged in users?
468
+ /* if ( is_user_logged_in() ) {
469
+ return $output;
470
+ }
471
+ */
472
+
473
+ // break on rss feed
474
+ if ( is_feed() && $this->options['output_feed'] ) {
475
+ return $output;
476
+ }
477
+
478
+ if ( strpos( $output, "<html" ) === false ) {
479
+ return $output;
480
+ } elseif ( strpos( $output, "<html" ) > 200 ) {
481
+ return $output;
482
+ }
483
+
484
+ // check whether to run parser or not
485
+ if (
486
+ ! $this->options['parse'] || ( iubendaPage::consent_given() && $this->options['skip_parsing'] ) || iubendaPage::bot_detected() || $_POST || $this->no_html ) {
487
+
488
+ return $output;
489
+ }
490
+
491
+ $startime = microtime( true );
492
+
493
+ $output = apply_filters( 'iubenda_initial_output', $output );
494
+
495
+ // experimental class
496
+ if ( $this->options['parser_engine'] == 'new' ) {
497
+ $faster = new iubendaFaster;
498
+
499
+ // render output
500
+ $output = $faster->isParse( mb_convert_encoding( $output, 'HTML-ENTITIES', 'UTF-8' ) );
501
+
502
+ // append signature
503
+ $output .= '<!-- Parsed with iubenda experimental class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
504
+ // default class
505
+ } else {
506
+ $page = new iubendaPage( $output );
507
+ $page->parse();
508
+
509
+ // render output
510
+ $output = $page->get_converted_page();
511
+
512
+ // append signature
513
+ $output .= '<!-- Parsed with iubenda default class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
514
+ }
515
+
516
+ return apply_filters( 'iubenda_final_output', $output );
517
+ }
518
+
519
+ /**
520
+ * Register plugin options.
521
+ */
522
+ public function register_options() {
523
+ register_setting( 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution', array( $this, 'save_options' ) );
524
+
525
+ add_settings_section( 'iubenda_cookie_law_solution', '', '', 'iubenda_cookie_law_solution' );
526
+ add_settings_field( 'iub_code', __( 'Code', 'iubenda-cookie-law-solution' ), array( $this, 'iub_code' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
527
+ add_settings_field( 'iub_parse', __( 'Scripts blocking', 'iubenda-cookie-law-solution' ), array( $this, 'iub_parse' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
528
+ add_settings_field( 'iub_ctype', __( 'Content type', 'iubenda-cookie-law-solution' ), array( $this, 'iub_ctype' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
529
+ add_settings_field( 'iub_output_feed', __( 'RSS feed', 'iubenda-cookie-law-solution' ), array( $this, 'iub_output_feed' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
530
+ add_settings_field( 'iub_menu_position', __( 'Menu position', 'iubenda-cookie-law-solution' ), array( $this, 'iub_menu_position' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
531
+ add_settings_field( 'iub_deactivation', __( 'Deactivation', 'iubenda-cookie-law-solution' ), array( $this, 'iub_deactivation' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
532
+ }
533
+
534
+ /**
535
+ * Display errors and notices.
536
+ *
537
+ * @global string $pagenow
538
+ */
539
+ public function settings_errors() {
540
+ global $pagenow;
541
+
542
+ // force display notices in top menu settings page
543
+ if ( $pagenow != 'options-general.php' )
544
+ settings_errors( 'iub_settings_errors' );
545
+ }
546
+
547
+ /**
548
+ * Code option.
549
+ *
550
+ * @return mixed
551
+ */
552
+ public function iub_code() {
553
+ // multilang support
554
+ if ( $this->multilang && ! empty( $this->languages ) ) {
555
+ echo '
556
+ <div id="contextual-help-wrap" class="hidden" tabindex="-1" style="display: block;">
557
+ <div id="contextual-help-back"></div>
558
+ <div id="contextual-help-columns">
559
+ <div class="contextual-help-tabs">
560
+ <ul>';
561
+ foreach ( $this->languages as $lang_id => $lang_name ) {
562
+ echo '
563
+ <li id="tab-link-overview" class="' . ( $this->lang_default == $lang_id ? 'active' : '' ) . '">
564
+ <a href="#tab-panel-' . $lang_id . '" aria-controls="tab-panel-' . $lang_id . '">' . $lang_name . '</a>
565
+ </li>';
566
+ }
567
+ echo '
568
+ </ul>
569
+ </div>
570
+
571
+ <div class="contextual-help-tabs-wrap">';
572
+ foreach ( $this->languages as $lang_id => $lang_name ) {
573
+ // get code for the language
574
+ $code = ! empty( $this->options['code_' . $lang_id] ) ? html_entity_decode( trim( wp_kses( $this->options['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : '';
575
+ // handle default, if empty
576
+ $code = empty( $code ) && $lang_id == $this->lang_default ? html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) : $code;
577
+
578
+ echo '
579
+ <div id="tab-panel-' . $lang_id . '" class="help-tab-content' . ( $this->lang_default == $lang_id ? ' active' : '' ) . '">
580
+ <textarea name="iubenda_cookie_law_solution[code_' . $lang_id . ']" class="large-text" cols="50" rows="10">' . $code . '</textarea>
581
+ <p class="description">' . sprintf( __( 'Enter the iubenda code for %s.', 'iubenda-cookie-law-solution' ), $lang_name ) . '</p>
582
+ </div>';
583
+ }
584
+ echo '
585
+ </div>
586
+ </div>
587
+ </div>';
588
+ } else {
589
+ echo '
590
+ <div id="iub_code_default">
591
+ <textarea name="iubenda_cookie_law_solution[code_default]" class="large-text" cols="50" rows="10">' . html_entity_decode( trim( wp_kses( $this->options['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) ) ) . '</textarea>
592
+ <p class="description">' . __( 'Enter the iubenda code.', 'iubenda-cookie-law-solution' ) . '</p>
593
+ </div>';
594
+ }
595
+ }
596
+
597
+ /**
598
+ * Parsing option.
599
+ *
600
+ * @return mixed
601
+ */
602
+ public function iub_parse() {
603
+ echo '
604
+ <div id="iub_parse_container">
605
+ <label><input id="iub_parse" type="checkbox" name="iubenda_cookie_law_solution[parse]" value="1" ' . checked( true, (bool) $this->options['parse'], false ) . '/>' . __( 'Automatically block scripts detected by the plugin.', 'iubenda-cookie-law-solution' ) . '</label>
606
+ <p class="description">' . '(' . sprintf( __( "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of detected scripts.", 'iubenda-cookie-law-solution' ), $this->links['documentation'] ) . ')' . '</p>
607
+ <div id="iub_parser_engine_container"' . ( $this->options['parse'] === false ? ' style="display: none;"' : '' ) . '>
608
+ <div>
609
+ <label><input id="iub_parser_engine-default" type="radio" name="iubenda_cookie_law_solution[parser_engine]" value="default" ' . checked( 'default', $this->options['parser_engine'], false ) . ' />' . __( 'Default', 'iubenda-cookie-law-solution' ) . '</label>
610
+ <label><input id="iub_parser_engine-new" type="radio" name="iubenda_cookie_law_solution[parser_engine]" value="new" ' . checked( 'new', $this->options['parser_engine'], false ) . ' />' . __( 'Experimental', 'iubenda-cookie-law-solution' ) . '</label>
611
+ <p class="description">' . __( 'Select parsing engine.', 'iubenda-cookie-law-solution' ) . '</p>
612
+ </div>
613
+ <div>
614
+ <label><input id="iub_skip_parsing" type="checkbox" name="iubenda_cookie_law_solution[skip_parsing]" value="1" ' . checked( true, (bool) $this->options['skip_parsing'], false ) . '/>' . __( 'Leave scripts untouched on the page if the user has already given consent', 'iubenda-cookie-law-solution' ) . '</label>
615
+ <p class="description">(' . __( "improves performance, highly recommended, to be deactivated only if your site uses a caching system", 'iubenda-cookie-law-solution' ) . ')</p>
616
+ </div>
617
+ </div>
618
+ </div>';
619
+ }
620
+
621
+ /**
622
+ * Ctype option.
623
+ *
624
+ * @return mixed
625
+ */
626
+ public function iub_ctype() {
627
+ echo '
628
+ <div id="iub_ctype_container">
629
+ <label><input id="iub_ctype" type="checkbox" name="iubenda_cookie_law_solution[ctype]" value="1" ' . checked( true, (bool) $this->options['ctype'], false ) . '/>' . __( 'Restrict the plugin to run only for requests that have "Content-type: text / html" (recommended)', 'iubenda-cookie-law-solution' ) . '</label>
630
+ </div>';
631
+ }
632
+
633
+ /**
634
+ * RSS feed option.
635
+ *
636
+ * @return mixed
637
+ */
638
+ public function iub_output_feed() {
639
+ echo '
640
+ <div id="iub_output_feed_container">
641
+ <label><input id="iub_ctype" type="checkbox" name="iubenda_cookie_law_solution[output_feed]" value="1" ' . checked( true, (bool) $this->options['output_feed'], false ) . '/>' . __( 'Do not run the plugin inside the RSS feed (recommended)', 'iubenda-cookie-law-solution' ) . '</label>
642
+ </div>';
643
+ }
644
+
645
+ /**
646
+ * Menu option.
647
+ *
648
+ * @return mixed
649
+ */
650
+ public function iub_menu_position() {
651
+ echo '
652
+ <div id="iub_menu_position_container">
653
+ <label><input id="iub_menu_position-topmenu" type="radio" name="iubenda_cookie_law_solution[menu_position]" value="topmenu" ' . checked( 'topmenu', $this->options['menu_position'], false ) . ' />' . __( 'Top menu', 'iubenda-cookie-law-solution' ) . '</label>
654
+ <label><input id="iub_menu_position-submenu" type="radio" name="iubenda_cookie_law_solution[menu_position]" value="submenu" ' . checked( 'submenu', $this->options['menu_position'], false ) . ' />' . __( 'Submenu', 'iubenda-cookie-law-solution' ) . '</label>
655
+ <p class="description">' . __( 'Select whether to display iubenda in a top admin menu or the Settings submenu.', 'iubenda-cookie-law-solution' ) . '</p>
656
+ </div>';
657
+ }
658
+
659
+ /**
660
+ * Deactivation option.
661
+ *
662
+ * @return mixed
663
+ */
664
+ public function iub_deactivation() {
665
+ echo '
666
+ <div id="iub_deactivation_container">
667
+ <label><input id="iub_deactivation" type="checkbox" name="iubenda_cookie_law_solution[deactivation]" value="1" ' . checked( true, (bool) $this->options['deactivation'], false ) . '/>' . __( 'Delete all plugin data upon deactivation?', 'iubenda-cookie-law-solution' ) . '</label>
668
+ </div>';
669
+ }
670
+
671
+ /**
672
+ * Save options.
673
+ *
674
+ * @return void
675
+ */
676
+ public function save_options( $input ) {
677
+ if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) )
678
+ return $input;
679
+
680
+ // save options
681
+ if ( isset( $_POST['save_iubenda_options'] ) ) {
682
+ $input['parse'] = (bool) isset( $input['parse'] );
683
+ $input['parser_engine'] = isset( $input['parser_engine'] ) && in_array( $input['parser_engine'], array( 'default', 'new' ) ) ? $input['parser_engine'] : $this->defaults['parser_engine'];
684
+ $input['skip_parsing'] = (bool) isset( $input['skip_parsing'] );
685
+ $input['ctype'] = (bool) isset( $input['ctype'] );
686
+ $input['output_feed'] = (bool) isset( $input['output_feed'] );
687
+ $input['menu_position'] = isset( $input['menu_position'] ) && in_array( $input['menu_position'], array( 'topmenu', 'submenu' ) ) ? $input['menu_position'] : $this->defaults['menu_position'];
688
+ $input['deactivation'] = (bool) isset( $input['deactivation'] );
689
+
690
+ // multilang support
691
+ if ( $this->multilang && ! empty( $this->languages ) ) {
692
+ foreach ( $this->languages as $lang_id => $lang_name ) {
693
+ $input['code_' . $lang_id] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
694
+
695
+ // handle default lang too
696
+ if ( $lang_id == $this->lang_default ) {
697
+ $input['code_default'] = ! empty( $input['code_' . $lang_id] ) ? wp_kses( $input['code_' . $lang_id], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : $this->options['code_default'];
698
+ }
699
+ }
700
+ } else {
701
+ $input['code_default'] = ! empty( $input['code_default'] ) ? wp_kses( $input['code_default'], array( 'style' => array( 'type' => array() ), 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
702
+ }
703
+
704
+ add_settings_error( 'iub_settings_errors', 'iub_settings_updated', __( 'Settings saved.', 'iubenda-cookie-law-solution' ), 'updated' );
705
+ // reset options
706
+ } elseif ( isset( $_POST['reset_iubenda_options'] ) ) {
707
+ $input = $this->defaults;
708
+
709
+ // multilang support
710
+ if ( $this->multilang && ! empty( $this->languages ) ) {
711
+ foreach ( $this->languages as $lang_id => $lang_name ) {
712
+ $input['code_' . $lang_id] = '';
713
+ }
714
+ }
715
+ add_settings_error( 'iub_settings_errors', 'iub_settings_restored', __( 'Settings restored to defaults.', 'iubenda-cookie-law-solution' ), 'updated' );
716
+ }
717
+
718
+ return $input;
719
+ }
720
+
721
+ /**
722
+ * Load admin options page.
723
+ *
724
+ * @return void
725
+ */
726
+ public function options_page() {
727
+ if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) ) {
728
+ wp_die( __( "You don't have permission to access this page.", 'iubenda-cookie-law-solution' ) );
729
+ }
730
+ ?>
731
+ <div class="wrap">
732
+ <div id="iubenda-view">
733
+ <?php
734
+ echo '
735
+ <a class="iubenda-link" href="http://iubenda.com"><img id="iubenda-logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAAAdCAMAAAB8M6mmAAAAhFBMVEUAAAA0O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0I0O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr380O0Ibr3/////G69+35tdTw5/U8Ofx+vdiyKd+0rep4c/i9e8otIeN17/AB1g0AAAAHnRSTlMAEBAgIDAwQEBQUGBwcICAkJCgoLCwwMDQ0ODg8PCQCZ0FAAACrklEQVR4Xr2V63LbIBCFF1OZKBCiKAohlK7kXHt5//cruyDjjFTX42l9fnhh1+yHGB0EAJu7kXS/gUto8zRmPV2Edz/OergA7ctYtV0DCKPPBCgrF7kb4rzs3incrCzpEd05LKEDolqkb4nzNr1RuF1UB8TzcE1E/CPu+7Rbxwnozn06Eddw25H0wr9XsJQh3Flyazh4HGd9hRWpf4zbfptx15fAwR53dRHcWHFSkQDKoOJ05w5M1NjBdXpvFU0WW9TlHidN73rbVtz7844PU7mIiADQOkyaccIjqQOW6DHQ/3yTxiYg2pQhqVIfMPYDYiwZHdF3gdpk3K/XadoVH6hCgbbivMcsyzSPhntiFBAcbcOj6xI/QKl7UYynciOTj9YWJ/z8scfBjIOKQ68ADC2n8+oKNc37FHuqp7xMsQGuRzHvV1U/tMVQVwm0O4oLIg+4v0CkKXNiChZxEMVmbQrN/tBjweVdygXu7g84B3N/D6AxWhYdY8ZZgDroM6QaQUfGiwXu8Tiu5UyP0e3VLHERccUIqseCuzkVJzjjMEDVAtfgCk4HdLrgbk/FQcHhMZxa4hqPLg0WuKcTce1fcPITTvMbtoIbj+MaHvWIAxQFuXqYuuLYMKH08xQeTsVpbqRrPx1h9VVxFcd+6w77PX7G+dmtC5zDILK90XAl2nUjoD7A2fJUzRK3AYCBLzc5JCwqIarNTdmHxaRg7YBR5Gl3iJOx8EyKVkjFuxO8qhky7nV6m79ALXdDLyhGxXdf0EJYjO1s9yLFN2TZjgiIngaaSt4FjPla55AWc5o+dx/P0zQ9fzCOT5EfMBU19+nygl5CkeVEaCo6gOfI76AKuewwWgnQ0NRJcNwVxirGgdSGOlkFs5SxLZFrwppaXUoZ6qD1PFWSQ8p9wl3D/9ZvoAF23RgFj1kAAAAASUVORK5CYII="/></a>
736
+ <p class="iubenda-text">
737
+ ' . __( "This plugin is the easiest and most comprehensive way to adapt your WordPress site to the European cookie law. Upon your user's first visit, the plugin will take care of collecting their consent, of blocking the most popular among the scripts that install cookies and subsequently reactivate these scripts as soon as consent is provided. The basic settings include obtaining consent by a simple scroll action (the most effective method) and script reactivation without refreshing the page.", 'iubenda-cookie-law-solution' ) . '
738
+ </p>
739
+ <p class="iubenda-text">
740
+ <span class="iubenda-title">' . __( "Would you like to know more about the cookie law?", 'iubenda-cookie-law-solution' ) . '</span><br />
741
+ ' . sprintf( __( "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete guide to the cookie law.</a>", 'iubenda-cookie-law-solution' ), $this->links['guide'] ) . '
742
+ </p>
743
+ <p class="iubenda-text">
744
+ <span class="iubenda-title">' . __( "What is the full functionality of the plugin?", 'iubenda-cookie-law-solution' ) . '</span><br />
745
+ ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page.</a>", 'iubenda-cookie-law-solution' ), $this->links['plugin_page'] ) . '
746
+ </p>
747
+ <p class="iubenda-text">
748
+ <span class="iubenda-title">' . __( "Enter the iubenda code for the Cookie Solution below.", 'iubenda-cookie-law-solution' ) . '</span><br />
749
+ ' . sprintf( __( "In order to run the plugin, you need to enter the iubenda code that activates the cookie law banner and the cookie policy in the form below. This code can be generated on www.iubenda.com, following <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">this guide.</a>", 'iubenda-cookie-law-solution' ), $this->links['generating_code'] ) . '
750
+ </p>';
751
+ ?>
752
+ <form id="iubenda-tabs" action="options.php" method="post">
753
+ <?php
754
+ settings_fields( 'iubenda_cookie_law_solution' );
755
+ do_settings_sections( 'iubenda_cookie_law_solution' );
756
+
757
+ echo ' <p class="submit">';
758
+ submit_button( '', 'primary', 'save_iubenda_options', false );
759
+ echo ' ';
760
+ submit_button( __( 'Reset to defaults', 'iubenda-cookie-law-solution' ), 'secondary', 'reset_iubenda_options', false );
761
+ echo ' </p>';
762
+ ?>
763
+ </form>
764
+ <?php echo '
765
+ <p class="iubenda-text">
766
+ <span class="iubenda-title">' . __( 'Need support for this plugin?', 'iubenda-cookie-law-solution' ) . '</span><br />
767
+ ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support forum.</a>", 'iubenda-cookie-law-solution' ), $this->links['support_forum'] ) . '
768
+ </p>
769
+ <p class="iubenda-text">
770
+ <span class="iubenda-title">' . __( 'Want to try a beta version of this plugin with the latest features?', 'iubenda-cookie-law-solution' ) . '</span><br />
771
+ ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">documentation pages</a> and follow the instructions to install a beta version.", 'iubenda-cookie-law-solution' ), $this->links['documentation'] ) . '
772
+ </p>';
773
+ ?>
774
+ </div>
775
+ <div class="clear"></div>
776
+ </div>
777
+ <?php
778
+ }
779
+
780
  }
languages/iubenda-cookie-law-solution-it_IT.mo CHANGED
Binary file
languages/iubenda-cookie-law-solution-it_IT.po CHANGED
@@ -1,59 +1,59 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Iubenda Cookie Solution\n"
4
- "POT-Creation-Date: 2017-07-05 16:49+0200\n"
5
- "PO-Revision-Date: 2017-07-07 10:49+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: it\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.12\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: iubenda_cookie_solution.php:502
20
  msgid "Code"
21
  msgstr "Codice"
22
 
23
- #: iubenda_cookie_solution.php:503
24
  msgid "Scripts blocking"
25
  msgstr "Blocco preventivo dei codici"
26
 
27
- #: iubenda_cookie_solution.php:504
28
- msgid "Scripts loading"
29
- msgstr "Caricamento degli script"
30
-
31
- #: iubenda_cookie_solution.php:505
32
  msgid "Content type"
33
  msgstr "Tipo di contenuto"
34
 
35
- #: iubenda_cookie_solution.php:506
36
  msgid "RSS feed"
37
  msgstr "Feed RSS"
38
 
39
- #: iubenda_cookie_solution.php:507
 
 
 
 
40
  msgid "Deactivation"
41
  msgstr "Disattivazione"
42
 
43
- #: iubenda_cookie_solution.php:551
44
  #, php-format
45
  msgid "Enter the iubenda code for %s."
46
  msgstr "Inserire il codice di iubenda per %s."
47
 
48
- #: iubenda_cookie_solution.php:562
49
  msgid "Enter the iubenda code."
50
  msgstr "Inserire il codice di iubenda."
51
 
52
- #: iubenda_cookie_solution.php:575
53
  msgid "Automatically block scripts detected by the plugin."
54
  msgstr "Blocca automaticamente gli script rilevati dal plugin."
55
 
56
- #: iubenda_cookie_solution.php:576
57
  #, php-format
58
  msgid ""
59
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
@@ -62,26 +62,26 @@ msgstr ""
62
  "visita <a href=\"%s\" target=\"_blank\">la nostra documentazione</a> per la "
63
  "lista degli script rilevati automaticamente dal plugin."
64
 
65
- #: iubenda_cookie_solution.php:579
66
  msgid "Default"
67
  msgstr "Default"
68
 
69
- #: iubenda_cookie_solution.php:580
70
  msgid "Experimental"
71
  msgstr "Sperimentale"
72
 
73
- #: iubenda_cookie_solution.php:581
74
  msgid "Select parsing engine."
75
  msgstr "Seleziona il motore di parsing."
76
 
77
- #: iubenda_cookie_solution.php:584
78
  msgid ""
79
  "Leave scripts untouched on the page if the user has already given consent"
80
  msgstr ""
81
  "Lascia gli script intatti sulla pagina se l'utente ha già prestato il "
82
  "consenso"
83
 
84
- #: iubenda_cookie_solution.php:585
85
  msgid ""
86
  "improves performance, highly recommended, to be deactivated only if your "
87
  "site uses a caching system"
@@ -89,19 +89,7 @@ msgstr ""
89
  "migliora le prestazioni, altamente consigliato, da disattivare solo qualora "
90
  "il tuo sito utilizzi un sistema di cache"
91
 
92
- #: iubenda_cookie_solution.php:599
93
- msgid "Header"
94
- msgstr "Header"
95
-
96
- #: iubenda_cookie_solution.php:600
97
- msgid "Footer"
98
- msgstr "Footer"
99
-
100
- #: iubenda_cookie_solution.php:601
101
- msgid "Select scripts loading position."
102
- msgstr "Seleziona gli script che caricano la posizione"
103
-
104
- #: iubenda_cookie_solution.php:613
105
  msgid ""
106
  "Restrict the plugin to run only for requests that have \"Content-type: "
107
  "text / html\" (recommended)"
@@ -109,27 +97,44 @@ msgstr ""
109
  "Restringi l'esecuzione del plugin alle sole richieste che presentano "
110
  "\"Content-type: text/html\" (consigliato)"
111
 
112
- #: iubenda_cookie_solution.php:625
113
  msgid "Do not run the plugin inside the RSS feed (recommended)"
114
  msgstr "Non eseguire il plugin all'interno dei Feed RSS (consigliato)"
115
 
116
- #: iubenda_cookie_solution.php:637
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  msgid "Delete all plugin data upon deactivation?"
118
- msgstr "Elimina tutti i dati relativi al plugin con la disattivazione"
 
119
 
120
- #: iubenda_cookie_solution.php:674
121
  msgid "Settings saved."
122
  msgstr "Impostazioni salvate."
123
 
124
- #: iubenda_cookie_solution.php:685
125
  msgid "Settings restored to defaults."
126
  msgstr "Impostazioni di default ripristinate."
127
 
128
- #: iubenda_cookie_solution.php:698
129
  msgid "You don't have permission to access this page."
130
  msgstr "Non disponi dell'autorizzazione per accedere a questa pagina."
131
 
132
- #: iubenda_cookie_solution.php:707
133
  msgid ""
134
  "This plugin is the easiest and most comprehensive way to adapt your "
135
  "WordPress site to the European cookie law. Upon your user's first visit, the "
@@ -140,44 +145,44 @@ msgid ""
140
  "script reactivation without refreshing the page."
141
  msgstr ""
142
  "Questo plugin è il modo più semplice e completo per adeguare il tuo sito "
143
- "Wordpress alla cookie law. Alla prima visita dell'utente il plugin si "
144
  "occuperà di raccoglierne il consenso, di bloccare i più popolari fra gli "
145
  "script che installano cookie e di riattivarli non appena il consenso viene "
146
  "fornito. Le impostazioni di base includono la raccolta del consenso tramite "
147
  "il semplice scroll (il metodo più efficace) e la riattivazione senza il "
148
  "refresh della pagina."
149
 
150
- #: iubenda_cookie_solution.php:710
151
  msgid "Would you like to know more about the cookie law?"
152
  msgstr "Vuoi capire di più sulla cookie law?"
153
 
154
- #: iubenda_cookie_solution.php:711
155
  #, php-format
156
  msgid ""
157
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
158
  "guide to the cookie law.</a>"
159
  msgstr ""
160
  "Consulta la nostra <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
161
- "\">guida completa alla cookie law</a>."
162
 
163
- #: iubenda_cookie_solution.php:714
164
  msgid "What is the full functionality of the plugin?"
165
- msgstr "Qual'è la completa funzionalità del plugin?"
166
 
167
- #: iubenda_cookie_solution.php:715
168
  #, php-format
169
  msgid ""
170
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page."
171
  "</a>"
172
  msgstr ""
173
  "Visita la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
174
- "pagina dedicata</a> al plugin."
175
 
176
- #: iubenda_cookie_solution.php:718
177
  msgid "Enter the iubenda code for the Cookie Solution below."
178
  msgstr "Inserisci qui sotto il codice di iubenda per la Cookie Solution."
179
 
180
- #: iubenda_cookie_solution.php:719
181
  #, php-format
182
  msgid ""
183
  "In order to run the plugin, you need to enter the iubenda code that "
@@ -188,32 +193,32 @@ msgstr ""
188
  "Per far funzionare il plugin, è necessario inserire nel form sottostante il "
189
  "codice di iubenda che attiva il banner cookie law e la cookie policy. Questo "
190
  "codice può essere generato su www.iubenda.com, <a href=\"%s\" class="
191
- "\"iubenda-url\" target=\"_blank\">seguendo questa guida</a> ."
192
 
193
- #: iubenda_cookie_solution.php:730
194
  msgid "Reset to defaults"
195
  msgstr "Ripristina le impostazioni di default"
196
 
197
- #: iubenda_cookie_solution.php:736
198
  msgid "Need support for this plugin?"
199
  msgstr "Hai bisogno di supporto su questo plugin?"
200
 
201
- #: iubenda_cookie_solution.php:737
202
  #, php-format
203
  msgid ""
204
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
205
  "forum.</a>"
206
  msgstr ""
207
  "Visita il nostro <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
208
- "\">forum di supporto</a>."
209
 
210
- #: iubenda_cookie_solution.php:740
211
  msgid "Want to try a beta version of this plugin with the latest features?"
212
  msgstr ""
213
  "Vuoi provare una versione Beta di questo plugin, con le funzionalità più "
214
  "recenti?"
215
 
216
- #: iubenda_cookie_solution.php:741
217
  #, php-format
218
  msgid ""
219
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Iubenda Cookie Solution\n"
4
+ "POT-Creation-Date: 2018-04-26 17:32+0200\n"
5
+ "PO-Revision-Date: 2018-05-09 12:30+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: it\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 2.0.7\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
+ #: iubenda_cookie_solution.php:526
20
  msgid "Code"
21
  msgstr "Codice"
22
 
23
+ #: iubenda_cookie_solution.php:527
24
  msgid "Scripts blocking"
25
  msgstr "Blocco preventivo dei codici"
26
 
27
+ #: iubenda_cookie_solution.php:528
 
 
 
 
28
  msgid "Content type"
29
  msgstr "Tipo di contenuto"
30
 
31
+ #: iubenda_cookie_solution.php:529
32
  msgid "RSS feed"
33
  msgstr "Feed RSS"
34
 
35
+ #: iubenda_cookie_solution.php:530
36
+ msgid "Menu position"
37
+ msgstr "Posizione menu"
38
+
39
+ #: iubenda_cookie_solution.php:531
40
  msgid "Deactivation"
41
  msgstr "Disattivazione"
42
 
43
+ #: iubenda_cookie_solution.php:581
44
  #, php-format
45
  msgid "Enter the iubenda code for %s."
46
  msgstr "Inserire il codice di iubenda per %s."
47
 
48
+ #: iubenda_cookie_solution.php:592
49
  msgid "Enter the iubenda code."
50
  msgstr "Inserire il codice di iubenda."
51
 
52
+ #: iubenda_cookie_solution.php:605
53
  msgid "Automatically block scripts detected by the plugin."
54
  msgstr "Blocca automaticamente gli script rilevati dal plugin."
55
 
56
+ #: iubenda_cookie_solution.php:606
57
  #, php-format
58
  msgid ""
59
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
62
  "visita <a href=\"%s\" target=\"_blank\">la nostra documentazione</a> per la "
63
  "lista degli script rilevati automaticamente dal plugin."
64
 
65
+ #: iubenda_cookie_solution.php:609
66
  msgid "Default"
67
  msgstr "Default"
68
 
69
+ #: iubenda_cookie_solution.php:610
70
  msgid "Experimental"
71
  msgstr "Sperimentale"
72
 
73
+ #: iubenda_cookie_solution.php:611
74
  msgid "Select parsing engine."
75
  msgstr "Seleziona il motore di parsing."
76
 
77
+ #: iubenda_cookie_solution.php:614
78
  msgid ""
79
  "Leave scripts untouched on the page if the user has already given consent"
80
  msgstr ""
81
  "Lascia gli script intatti sulla pagina se l'utente ha già prestato il "
82
  "consenso"
83
 
84
+ #: iubenda_cookie_solution.php:615
85
  msgid ""
86
  "improves performance, highly recommended, to be deactivated only if your "
87
  "site uses a caching system"
89
  "migliora le prestazioni, altamente consigliato, da disattivare solo qualora "
90
  "il tuo sito utilizzi un sistema di cache"
91
 
92
+ #: iubenda_cookie_solution.php:629
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid ""
94
  "Restrict the plugin to run only for requests that have \"Content-type: "
95
  "text / html\" (recommended)"
97
  "Restringi l'esecuzione del plugin alle sole richieste che presentano "
98
  "\"Content-type: text/html\" (consigliato)"
99
 
100
+ #: iubenda_cookie_solution.php:641
101
  msgid "Do not run the plugin inside the RSS feed (recommended)"
102
  msgstr "Non eseguire il plugin all'interno dei Feed RSS (consigliato)"
103
 
104
+ #: iubenda_cookie_solution.php:653
105
+ msgid "Top menu"
106
+ msgstr "Menu principale"
107
+
108
+ #: iubenda_cookie_solution.php:654
109
+ msgid "Submenu"
110
+ msgstr "Sottomenu"
111
+
112
+ #: iubenda_cookie_solution.php:655
113
+ msgid ""
114
+ "Select whether to display iubenda in a top admin menu or the Settings "
115
+ "submenu."
116
+ msgstr ""
117
+ "Scegli se visualizzare iubenda in una voce di menu principale del pannello "
118
+ "admin o in un sottomenu della scheda Impostazioni."
119
+
120
+ #: iubenda_cookie_solution.php:667
121
  msgid "Delete all plugin data upon deactivation?"
122
+ msgstr ""
123
+ "Vuoi eliminare tutti i dati del plugin al momento della disattivazione?"
124
 
125
+ #: iubenda_cookie_solution.php:704
126
  msgid "Settings saved."
127
  msgstr "Impostazioni salvate."
128
 
129
+ #: iubenda_cookie_solution.php:715
130
  msgid "Settings restored to defaults."
131
  msgstr "Impostazioni di default ripristinate."
132
 
133
+ #: iubenda_cookie_solution.php:728
134
  msgid "You don't have permission to access this page."
135
  msgstr "Non disponi dell'autorizzazione per accedere a questa pagina."
136
 
137
+ #: iubenda_cookie_solution.php:737
138
  msgid ""
139
  "This plugin is the easiest and most comprehensive way to adapt your "
140
  "WordPress site to the European cookie law. Upon your user's first visit, the "
145
  "script reactivation without refreshing the page."
146
  msgstr ""
147
  "Questo plugin è il modo più semplice e completo per adeguare il tuo sito "
148
+ "WordPress alla cookie law. Alla prima visita dell'utente il plugin si "
149
  "occuperà di raccoglierne il consenso, di bloccare i più popolari fra gli "
150
  "script che installano cookie e di riattivarli non appena il consenso viene "
151
  "fornito. Le impostazioni di base includono la raccolta del consenso tramite "
152
  "il semplice scroll (il metodo più efficace) e la riattivazione senza il "
153
  "refresh della pagina."
154
 
155
+ #: iubenda_cookie_solution.php:740
156
  msgid "Would you like to know more about the cookie law?"
157
  msgstr "Vuoi capire di più sulla cookie law?"
158
 
159
+ #: iubenda_cookie_solution.php:741
160
  #, php-format
161
  msgid ""
162
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
163
  "guide to the cookie law.</a>"
164
  msgstr ""
165
  "Consulta la nostra <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
166
+ "\">guida completa alla cookie law</a>"
167
 
168
+ #: iubenda_cookie_solution.php:744
169
  msgid "What is the full functionality of the plugin?"
170
+ msgstr "Qual è la completa funzionalità del plugin?"
171
 
172
+ #: iubenda_cookie_solution.php:745
173
  #, php-format
174
  msgid ""
175
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page."
176
  "</a>"
177
  msgstr ""
178
  "Visita la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
179
+ "pagina dedicata</a> al plugin"
180
 
181
+ #: iubenda_cookie_solution.php:748
182
  msgid "Enter the iubenda code for the Cookie Solution below."
183
  msgstr "Inserisci qui sotto il codice di iubenda per la Cookie Solution."
184
 
185
+ #: iubenda_cookie_solution.php:749
186
  #, php-format
187
  msgid ""
188
  "In order to run the plugin, you need to enter the iubenda code that "
193
  "Per far funzionare il plugin, è necessario inserire nel form sottostante il "
194
  "codice di iubenda che attiva il banner cookie law e la cookie policy. Questo "
195
  "codice può essere generato su www.iubenda.com, <a href=\"%s\" class="
196
+ "\"iubenda-url\" target=\"_blank\">seguendo questa guida.</a>"
197
 
198
+ #: iubenda_cookie_solution.php:760
199
  msgid "Reset to defaults"
200
  msgstr "Ripristina le impostazioni di default"
201
 
202
+ #: iubenda_cookie_solution.php:766
203
  msgid "Need support for this plugin?"
204
  msgstr "Hai bisogno di supporto su questo plugin?"
205
 
206
+ #: iubenda_cookie_solution.php:767
207
  #, php-format
208
  msgid ""
209
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
210
  "forum.</a>"
211
  msgstr ""
212
  "Visita il nostro <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
213
+ "\">forum di supporto</a>"
214
 
215
+ #: iubenda_cookie_solution.php:770
216
  msgid "Want to try a beta version of this plugin with the latest features?"
217
  msgstr ""
218
  "Vuoi provare una versione Beta di questo plugin, con le funzionalità più "
219
  "recenti?"
220
 
221
+ #: iubenda_cookie_solution.php:771
222
  #, php-format
223
  msgid ""
224
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
languages/iubenda-cookie-law-solution.pot CHANGED
@@ -2,126 +2,128 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Iubenda Cookie Solution\n"
5
- "POT-Creation-Date: 2017-07-05 16:49+0200\n"
6
  "PO-Revision-Date: 2015-08-12 10:36+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.12\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: iubenda_cookie_solution.php:502
20
  msgid "Code"
21
  msgstr ""
22
 
23
- #: iubenda_cookie_solution.php:503
24
  msgid "Scripts blocking"
25
  msgstr ""
26
 
27
- #: iubenda_cookie_solution.php:504
28
- msgid "Scripts loading"
29
- msgstr ""
30
-
31
- #: iubenda_cookie_solution.php:505
32
  msgid "Content type"
33
  msgstr ""
34
 
35
- #: iubenda_cookie_solution.php:506
36
  msgid "RSS feed"
37
  msgstr ""
38
 
39
- #: iubenda_cookie_solution.php:507
 
 
 
 
40
  msgid "Deactivation"
41
  msgstr ""
42
 
43
- #: iubenda_cookie_solution.php:551
44
  #, php-format
45
  msgid "Enter the iubenda code for %s."
46
  msgstr ""
47
 
48
- #: iubenda_cookie_solution.php:562
49
  msgid "Enter the iubenda code."
50
  msgstr ""
51
 
52
- #: iubenda_cookie_solution.php:575
53
  msgid "Automatically block scripts detected by the plugin."
54
  msgstr ""
55
 
56
- #: iubenda_cookie_solution.php:576
57
  #, php-format
58
  msgid ""
59
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
60
  "detected scripts."
61
  msgstr ""
62
 
63
- #: iubenda_cookie_solution.php:579
64
  msgid "Default"
65
  msgstr ""
66
 
67
- #: iubenda_cookie_solution.php:580
68
  msgid "Experimental"
69
  msgstr ""
70
 
71
- #: iubenda_cookie_solution.php:581
72
  msgid "Select parsing engine."
73
  msgstr ""
74
 
75
- #: iubenda_cookie_solution.php:584
76
  msgid ""
77
  "Leave scripts untouched on the page if the user has already given consent"
78
  msgstr ""
79
 
80
- #: iubenda_cookie_solution.php:585
81
  msgid ""
82
  "improves performance, highly recommended, to be deactivated only if your "
83
  "site uses a caching system"
84
  msgstr ""
85
 
86
- #: iubenda_cookie_solution.php:599
87
- msgid "Header"
 
 
88
  msgstr ""
89
 
90
- #: iubenda_cookie_solution.php:600
91
- msgid "Footer"
92
  msgstr ""
93
 
94
- #: iubenda_cookie_solution.php:601
95
- msgid "Select scripts loading position."
96
  msgstr ""
97
 
98
- #: iubenda_cookie_solution.php:613
99
- msgid ""
100
- "Restrict the plugin to run only for requests that have \"Content-type: "
101
- "text / html\" (recommended)"
102
  msgstr ""
103
 
104
- #: iubenda_cookie_solution.php:625
105
- msgid "Do not run the plugin inside the RSS feed (recommended)"
 
 
106
  msgstr ""
107
 
108
- #: iubenda_cookie_solution.php:637
109
  msgid "Delete all plugin data upon deactivation?"
110
  msgstr ""
111
 
112
- #: iubenda_cookie_solution.php:674
113
  msgid "Settings saved."
114
  msgstr ""
115
 
116
- #: iubenda_cookie_solution.php:685
117
  msgid "Settings restored to defaults."
118
  msgstr ""
119
 
120
- #: iubenda_cookie_solution.php:698
121
  msgid "You don't have permission to access this page."
122
  msgstr ""
123
 
124
- #: iubenda_cookie_solution.php:707
125
  msgid ""
126
  "This plugin is the easiest and most comprehensive way to adapt your "
127
  "WordPress site to the European cookie law. Upon your user's first visit, "
@@ -132,33 +134,33 @@ msgid ""
132
  "script reactivation without refreshing the page."
133
  msgstr ""
134
 
135
- #: iubenda_cookie_solution.php:710
136
  msgid "Would you like to know more about the cookie law?"
137
  msgstr ""
138
 
139
- #: iubenda_cookie_solution.php:711
140
  #, php-format
141
  msgid ""
142
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
143
  "guide to the cookie law.</a>"
144
  msgstr ""
145
 
146
- #: iubenda_cookie_solution.php:714
147
  msgid "What is the full functionality of the plugin?"
148
  msgstr ""
149
 
150
- #: iubenda_cookie_solution.php:715
151
  #, php-format
152
  msgid ""
153
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin "
154
  "page.</a>"
155
  msgstr ""
156
 
157
- #: iubenda_cookie_solution.php:718
158
  msgid "Enter the iubenda code for the Cookie Solution below."
159
  msgstr ""
160
 
161
- #: iubenda_cookie_solution.php:719
162
  #, php-format
163
  msgid ""
164
  "In order to run the plugin, you need to enter the iubenda code that "
@@ -167,26 +169,26 @@ msgid ""
167
  "class=\"iubenda-url\" target=\"_blank\">this guide.</a>"
168
  msgstr ""
169
 
170
- #: iubenda_cookie_solution.php:730
171
  msgid "Reset to defaults"
172
  msgstr ""
173
 
174
- #: iubenda_cookie_solution.php:736
175
  msgid "Need support for this plugin?"
176
  msgstr ""
177
 
178
- #: iubenda_cookie_solution.php:737
179
  #, php-format
180
  msgid ""
181
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
182
  "forum.</a>"
183
  msgstr ""
184
 
185
- #: iubenda_cookie_solution.php:740
186
  msgid "Want to try a beta version of this plugin with the latest features?"
187
  msgstr ""
188
 
189
- #: iubenda_cookie_solution.php:741
190
  #, php-format
191
  msgid ""
192
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Iubenda Cookie Solution\n"
5
+ "POT-Creation-Date: 2018-04-26 17:32+0200\n"
6
  "PO-Revision-Date: 2015-08-12 10:36+0200\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 2.0.7\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
+ #: iubenda_cookie_solution.php:526
20
  msgid "Code"
21
  msgstr ""
22
 
23
+ #: iubenda_cookie_solution.php:527
24
  msgid "Scripts blocking"
25
  msgstr ""
26
 
27
+ #: iubenda_cookie_solution.php:528
 
 
 
 
28
  msgid "Content type"
29
  msgstr ""
30
 
31
+ #: iubenda_cookie_solution.php:529
32
  msgid "RSS feed"
33
  msgstr ""
34
 
35
+ #: iubenda_cookie_solution.php:530
36
+ msgid "Menu position"
37
+ msgstr ""
38
+
39
+ #: iubenda_cookie_solution.php:531
40
  msgid "Deactivation"
41
  msgstr ""
42
 
43
+ #: iubenda_cookie_solution.php:581
44
  #, php-format
45
  msgid "Enter the iubenda code for %s."
46
  msgstr ""
47
 
48
+ #: iubenda_cookie_solution.php:592
49
  msgid "Enter the iubenda code."
50
  msgstr ""
51
 
52
+ #: iubenda_cookie_solution.php:605
53
  msgid "Automatically block scripts detected by the plugin."
54
  msgstr ""
55
 
56
+ #: iubenda_cookie_solution.php:606
57
  #, php-format
58
  msgid ""
59
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
60
  "detected scripts."
61
  msgstr ""
62
 
63
+ #: iubenda_cookie_solution.php:609
64
  msgid "Default"
65
  msgstr ""
66
 
67
+ #: iubenda_cookie_solution.php:610
68
  msgid "Experimental"
69
  msgstr ""
70
 
71
+ #: iubenda_cookie_solution.php:611
72
  msgid "Select parsing engine."
73
  msgstr ""
74
 
75
+ #: iubenda_cookie_solution.php:614
76
  msgid ""
77
  "Leave scripts untouched on the page if the user has already given consent"
78
  msgstr ""
79
 
80
+ #: iubenda_cookie_solution.php:615
81
  msgid ""
82
  "improves performance, highly recommended, to be deactivated only if your "
83
  "site uses a caching system"
84
  msgstr ""
85
 
86
+ #: iubenda_cookie_solution.php:629
87
+ msgid ""
88
+ "Restrict the plugin to run only for requests that have \"Content-type: "
89
+ "text / html\" (recommended)"
90
  msgstr ""
91
 
92
+ #: iubenda_cookie_solution.php:641
93
+ msgid "Do not run the plugin inside the RSS feed (recommended)"
94
  msgstr ""
95
 
96
+ #: iubenda_cookie_solution.php:653
97
+ msgid "Top menu"
98
  msgstr ""
99
 
100
+ #: iubenda_cookie_solution.php:654
101
+ msgid "Submenu"
 
 
102
  msgstr ""
103
 
104
+ #: iubenda_cookie_solution.php:655
105
+ msgid ""
106
+ "Select whether to display iubenda in a top admin menu or the Settings "
107
+ "submenu."
108
  msgstr ""
109
 
110
+ #: iubenda_cookie_solution.php:667
111
  msgid "Delete all plugin data upon deactivation?"
112
  msgstr ""
113
 
114
+ #: iubenda_cookie_solution.php:704
115
  msgid "Settings saved."
116
  msgstr ""
117
 
118
+ #: iubenda_cookie_solution.php:715
119
  msgid "Settings restored to defaults."
120
  msgstr ""
121
 
122
+ #: iubenda_cookie_solution.php:728
123
  msgid "You don't have permission to access this page."
124
  msgstr ""
125
 
126
+ #: iubenda_cookie_solution.php:737
127
  msgid ""
128
  "This plugin is the easiest and most comprehensive way to adapt your "
129
  "WordPress site to the European cookie law. Upon your user's first visit, "
134
  "script reactivation without refreshing the page."
135
  msgstr ""
136
 
137
+ #: iubenda_cookie_solution.php:740
138
  msgid "Would you like to know more about the cookie law?"
139
  msgstr ""
140
 
141
+ #: iubenda_cookie_solution.php:741
142
  #, php-format
143
  msgid ""
144
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
145
  "guide to the cookie law.</a>"
146
  msgstr ""
147
 
148
+ #: iubenda_cookie_solution.php:744
149
  msgid "What is the full functionality of the plugin?"
150
  msgstr ""
151
 
152
+ #: iubenda_cookie_solution.php:745
153
  #, php-format
154
  msgid ""
155
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin "
156
  "page.</a>"
157
  msgstr ""
158
 
159
+ #: iubenda_cookie_solution.php:748
160
  msgid "Enter the iubenda code for the Cookie Solution below."
161
  msgstr ""
162
 
163
+ #: iubenda_cookie_solution.php:749
164
  #, php-format
165
  msgid ""
166
  "In order to run the plugin, you need to enter the iubenda code that "
169
  "class=\"iubenda-url\" target=\"_blank\">this guide.</a>"
170
  msgstr ""
171
 
172
+ #: iubenda_cookie_solution.php:760
173
  msgid "Reset to defaults"
174
  msgstr ""
175
 
176
+ #: iubenda_cookie_solution.php:766
177
  msgid "Need support for this plugin?"
178
  msgstr ""
179
 
180
+ #: iubenda_cookie_solution.php:767
181
  #, php-format
182
  msgid ""
183
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
184
  "forum.</a>"
185
  msgstr ""
186
 
187
+ #: iubenda_cookie_solution.php:770
188
  msgid "Want to try a beta version of this plugin with the latest features?"
189
  msgstr ""
190
 
191
+ #: iubenda_cookie_solution.php:771
192
  #, php-format
193
  msgid ""
194
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
readme.txt CHANGED
@@ -1,21 +1,23 @@
1
- === Plugin Name ===
2
  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: 4.0
6
- Tested up to: 4.8
7
- Stable tag: 1.14.3
 
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
11
- A plugin that works with the iubenda Cookie Law Solution: shows a cookie banner & allows blocking prior to consent, particularly fit for Italy.
12
 
13
  == Description ==
14
 
15
- 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.
16
- 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.
17
 
18
- * The plugin automatically inserts the Iubenda code in the head of every page of the site
 
 
19
  * It allows to manually block all the remaining resources, without the need of direct intervention on the code
20
  * It handles the display of cookie banners and cookie policy, saving user preferences about the use of cookies
21
  * It displays a clean page (without banner) to users who have already provided their consent
@@ -35,7 +37,8 @@ This plugin works with the Iubenda Cookie Law Solution and allows to block the m
35
  **Some background information**
36
 
37
  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.
38
- 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.
 
39
 
40
  **Which languages does iubenda work in currently?**
41
 
@@ -48,11 +51,11 @@ Iubenda and the Cookie Law Solution extension for WordPress help remove these co
48
  * Dutch
49
  * Russian
50
 
51
- **Usage**
52
 
53
- How does this plugin work with a Facebook button, for example?
54
 
55
- <!--IUB_COOKIE_POLICY_START-->
56
  <script>
57
  (function(d, s, id) {
58
  var js, fjs = d.getElementsByTagName(s)[0];
@@ -62,43 +65,32 @@ How does this plugin work with a Facebook button, for example?
62
  fjs.parentNode.insertBefore(js, fjs);
63
  }(document, 'script', 'facebook-jssdk'));
64
  </script>
65
- <!--IUB_COOKIE_POLICY_END-->
66
 
67
  If there are HTML / IMG / IFRAME elements, you need to proceed in this way:
68
 
69
- <!--IUB_COOKIE_POLICY_START-->
70
  <iframe src="...
71
  <img src="...
72
- <!--IUB_COOKIE_POLICY_END-->
73
 
74
- For articles, however, there's a shortcode available:
75
 
76
  [iub-cookie-policy]
77
  [/iub-cookie-policy]
78
 
79
  In case of continued browsing, the preferences of your users for the use of cookies will be set on "OK" to clear the banner and unlock the cookies. Moreover, banners and the blocking codes will not be delivered to subsequent visits by users who have already given their consent (and such preference will be updated at each subsequent visit for the future).
80
 
81
- **Bug reports**
82
-
83
- 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) (support.iubenda.com)
84
-
85
- * Find a comprehensive _guide and demo_ to the cookie law solution on our help blog https://www.iubenda.com/en/help/posts/1177
86
-
87
- * 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.
88
- * We will be very happy to receive feedback here: [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti)
89
-
90
  == Installation ==
91
 
92
- **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)
93
-
94
- - **Installation via WP.org**: search in your WordPress plugin admin panel for "Iubenda Cookie Solution", install it;
95
- - 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;
96
  - 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;
97
  - 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;
98
- - The other scripts that install cookies for which the automatic block isn't yet available can and should be "wrapped" using these comments:
99
 
100
- `<!--IUB_COOKIE_POLICY_START-->
101
- <!--IUB_COOKIE_POLICY_END-->`
102
  - In case you're querying WordPress via API, you can disable our plugin by using the iub_no_parse=true URL parameter, like this: www.example.com/api/get_recent_posts?iub_no_parse=true.
103
 
104
  == Frequently Asked Questions ==
@@ -109,6 +101,10 @@ You can find a dedicated support forum thread here [Uservoice forum](http://supp
109
  **Do you have more guidance, or a demo?**
110
  Yes, right here: https://www.iubenda.com/en/help/posts/1177
111
 
 
 
 
 
112
  == Screenshots ==
113
 
114
  1. This screen shot shows the default banner on top of our test site testkada4.altervista.org/cookie-test/example2.html
@@ -117,11 +113,17 @@ Yes, right here: https://www.iubenda.com/en/help/posts/1177
117
 
118
  == Changelog ==
119
 
120
- = 1.14.3 =
121
- * New: Option to enqueue scripts in header or footer
 
 
 
122
 
123
  = 1.14.2 =
124
- * New: Improved script options saving
 
 
 
125
 
126
  = 1.14.1 =
127
  * New: Option to delete all plugin data upon deactivation
@@ -295,5 +297,7 @@ Yes, right here: https://www.iubenda.com/en/help/posts/1177
295
 
296
  == Upgrade Notice ==
297
 
298
- = 1.14.3 =
299
- * New: Option to enqueue scripts in header or footer
 
 
1
+ === iubenda Cookie Solution for GDPR ===
2
  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: 4.0
6
+ Requires PHP: 5.2
7
+ Tested up to: 4.9.6
8
+ Stable tag: 1.15.0
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
12
+ iubenda Cookie Solution allows you to make your website GDPR compliant and manage all aspects of cookie law on WP, particularly fit for Italy.
13
 
14
  == Description ==
15
 
16
+ This plugin is an All-in-One approach developed by iubenda that helps to make your website GDPR compliant by generating the privacy policy text, the cookie banner and the blocking management of cookies.
 
17
 
18
+ 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.
19
+
20
+ * The plugin automatically inserts the iubenda code in the head of every page of the site
21
  * It allows to manually block all the remaining resources, without the need of direct intervention on the code
22
  * It handles the display of cookie banners and cookie policy, saving user preferences about the use of cookies
23
  * It displays a clean page (without banner) to users who have already provided their consent
37
  **Some background information**
38
 
39
  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.
40
+
41
+ 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.
42
 
43
  **Which languages does iubenda work in currently?**
44
 
51
  * Dutch
52
  * Russian
53
 
54
+ **Manual Usage**
55
 
56
+ How to make the plugin manually work for a Facebook button?
57
 
58
+ <!--IUB-COOKIE-BLOCK-START-->
59
  <script>
60
  (function(d, s, id) {
61
  var js, fjs = d.getElementsByTagName(s)[0];
65
  fjs.parentNode.insertBefore(js, fjs);
66
  }(document, 'script', 'facebook-jssdk'));
67
  </script>
68
+ <!--IUB-COOKIE-BLOCK-END-->
69
 
70
  If there are HTML / IMG / IFRAME elements, you need to proceed in this way:
71
 
72
+ <!--IUB-COOKIE-BLOCK-START-->
73
  <iframe src="...
74
  <img src="...
75
+ <!--IUB-COOKIE-BLOCK-END-->
76
 
77
+ Inside a post/page content there's a shortcode available:
78
 
79
  [iub-cookie-policy]
80
  [/iub-cookie-policy]
81
 
82
  In case of continued browsing, the preferences of your users for the use of cookies will be set on "OK" to clear the banner and unlock the cookies. Moreover, banners and the blocking codes will not be delivered to subsequent visits by users who have already given their consent (and such preference will be updated at each subsequent visit for the future).
83
 
 
 
 
 
 
 
 
 
 
84
  == Installation ==
85
 
86
+ - Search in your WordPress plugins admin panel for "iubenda Cookie Solution", install it;
87
+ - Once the plugin is installed and activated, go to the Admin Panel -> iubenda menu 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;
 
 
88
  - 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;
89
  - 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;
90
+ - If you'd like to manually block a specific script "wrap" it eith the following HTML comments:
91
 
92
+ `<!--IUB-COOKIE-BLOCK-START-->
93
+ <!--IUB-COOKIE-BLOCK-END-->`
94
  - In case you're querying WordPress via API, you can disable our plugin by using the iub_no_parse=true URL parameter, like this: www.example.com/api/get_recent_posts?iub_no_parse=true.
95
 
96
  == Frequently Asked Questions ==
101
  **Do you have more guidance, or a demo?**
102
  Yes, right here: https://www.iubenda.com/en/help/posts/1177
103
 
104
+ **Bug reports**
105
+ 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.
106
+ We will be very happy to receive feedback here: [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti)
107
+
108
  == Screenshots ==
109
 
110
  1. This screen shot shows the default banner on top of our test site testkada4.altervista.org/cookie-test/example2.html
113
 
114
  == Changelog ==
115
 
116
+ = 1.15.0 =
117
+ * New: Option to select iubenda menu position
118
+ * Tweak: iubenda faster class regex update
119
+ * Tweak: Enable style tag in iubenda code field
120
+ * Tweak: Changed default parser method
121
 
122
  = 1.14.2 =
123
+ * New: iubenda_initial_output filter hook
124
+
125
+ = 1.14.2-beta1 =
126
+ * Fix: repository issues breaking the update
127
 
128
  = 1.14.1 =
129
  * New: Option to delete all plugin data upon deactivation
297
 
298
  == Upgrade Notice ==
299
 
300
+ = 1.15.0 =
301
+ * New: Option to select iubenda menu position
302
+ * Tweak: iubenda faster class regex update
303
+ * Tweak: Changed default parser method