iubenda Cookie Solution for GDPR - Version 1.11.1-beta1

Version Description

Download this release

Release Info

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

Code changes from version 1.11.0 to 1.11.1-beta1

Files changed (2) hide show
  1. iubenda_cookie_solution.php +95 -78
  2. readme.txt +13 -0
iubenda_cookie_solution.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://www.iubenda.com
6
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
7
  * Author: iubenda
8
- * Version: 1.11.0
9
  * Text Domain: iubenda-cookie-wp-plugin
10
  * Author URI: https://www.iubenda.com
11
  */
@@ -23,9 +23,10 @@
23
 
24
  /**/
25
 
26
- if(defined("XMLRPC_REQUEST") && XMLRPC_REQUEST || defined("DOING_AJAX") && DOING_AJAX || isset($_SERVER["HTTP_X_REQUESTED_WITH"]) || isset($_GET["iub_no_parse"]))
27
- {
28
  return;
 
29
  }
30
 
31
  /**/
@@ -41,26 +42,26 @@
41
 
42
  function iubenda_load_admin_panel()
43
  {
44
- /*
45
- * Checks
46
- */
47
 
48
  if(function_exists("icl_object_id"))
49
  {
50
  define("IUBENDA_WPML", true);
51
  }
52
 
53
- if(!function_exists("file_get_html"))
54
- {
55
- require(dirname(__FILE__).IUB_HTML_DOM);
56
- }
57
-
58
- require(dirname(__FILE__).IUB_CLASS_FASTER);
59
- require(dirname(__FILE__).IUB_CLASS_DEFAULT);
60
-
61
- /*
62
- * Admin
63
- */
64
 
65
  if(is_admin())
66
  {
@@ -74,28 +75,28 @@
74
 
75
  function __iubenda_content_type()
76
  {
77
- if(get_option("iubenda_ctype"))
78
- {
79
- $iub_headers = headers_list();
80
- $destroy = true;
81
-
82
- /**/
83
-
84
- foreach($iub_headers as $h)
85
- {
86
- if(strpos($h, "Content-Type: text/html") !== false || strpos($h, "Content-type: text/html") !== false)
87
- {
88
- $destroy = false;
89
- }
90
- }
91
-
92
- /**/
93
-
94
- if($destroy)
95
- {
96
- define("IUBENDA_NO_HTML", true);
97
- }
98
- }
99
  }
100
 
101
  /***/
@@ -108,19 +109,19 @@
108
 
109
  if(!get_option("default_skip_parsing")) {
110
  update_option("default_skip_parsing", true);
111
- update_option("skip_parsing", true);
112
  }
113
  if(!get_option("default_iubendactype")) {
114
- update_option("default_iubendactype", true);
115
- update_option("iubenda_ctype", true);
116
  }
117
  if(!get_option("default_iubendaparse")) {
118
- update_option("default_iubendaparse", true);
119
- update_option("iubenda_parse", true);
120
  }
121
  if(!get_option("default_parser_engine")) {
122
- update_option("default_parser_engine", true);
123
- update_option("parser_engine", "default");
124
  }
125
 
126
 
@@ -128,15 +129,18 @@
128
 
129
  __iubenda_content_type();
130
 
131
- /**/
 
132
 
133
- if(function_exists("is_user_logged_in"))
134
- {
135
- if(is_user_logged_in())
136
  {
137
- return;
 
 
 
138
  }
139
- }
 
140
  if($_POST || defined("IUBENDA_NO_HTML"))
141
  {
142
  return;
@@ -154,29 +158,30 @@
154
  {
155
  $wpml_old = html_entity_decode(stripslashes(get_option("iub_code")));
156
 
157
- $iubenda_languages = array("it", "de", "en", "es", "pt-br", "ru", "fr");
158
-
159
- foreach($iubenda_languages as $iubenda_language)
160
- {
161
- if(strpos($wpml_old, 'lang: "'.$iubenda_language) !== false) {
162
- $language_tag = $iubenda_language;
163
-
164
- break;
165
- }
166
- }
167
-
168
- update_option("iubenda-code-$language_tag", $wpml_old);
169
- update_option("iubenda-code-default", $wpml_old);
170
- update_option("iub_code", false);
171
  }
172
 
173
  if(defined("IUBENDA_WPML") && get_option("iubenda-code-".ICL_LANGUAGE_CODE))
174
  {
175
  $iubenda_code .= get_option("iubenda-code-".ICL_LANGUAGE_CODE);
176
  }
177
- else
178
- {
179
  $iubenda_code .= get_option("iubenda-code-default");
 
180
  }
181
 
182
  $iubenda_code .= "\n
@@ -191,13 +196,13 @@
191
  {
192
  iCallback();
193
 
194
- /*
195
- * Separator
196
- */
197
-
198
- jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
199
- };
200
- };
201
  </script>";
202
 
203
  /**/
@@ -211,9 +216,21 @@
211
 
212
  function __iubenda_final_output($output)
213
  {
214
- if(!get_option("iubenda_parse") || Page::consent_given() && get_option("skip_parsing") || Page::bot_detected() || $_POST || defined("IUBENDA_NO_HTML") || get_option("iubenda_output_filter") && ob_get_level() > 1)
215
- {
 
 
 
 
 
216
  return $output;
 
 
 
 
 
 
 
217
  }
218
 
219
  /**/
@@ -233,7 +250,7 @@
233
 
234
  /**/
235
 
236
- $output = $faster -> isParse($output);
237
 
238
  /**/
239
 
5
  * Plugin URI: https://www.iubenda.com
6
  * Description: Iubenda Cookie Solution permette di gestire tutti gli aspetti della cookie law su WP.
7
  * Author: iubenda
8
+ * Version: 1.11.1-beta1
9
  * Text Domain: iubenda-cookie-wp-plugin
10
  * Author URI: https://www.iubenda.com
11
  */
23
 
24
  /**/
25
 
26
+ if(defined("XMLRPC_REQUEST") && XMLRPC_REQUEST || defined("DOING_AJAX") && DOING_AJAX || isset($_SERVER["HTTP_X_REQUESTED_WITH"]) || isset($_GET["iub_no_parse"])) {
27
+
28
  return;
29
+
30
  }
31
 
32
  /**/
42
 
43
  function iubenda_load_admin_panel()
44
  {
45
+ /*
46
+ * Checks
47
+ */
48
 
49
  if(function_exists("icl_object_id"))
50
  {
51
  define("IUBENDA_WPML", true);
52
  }
53
 
54
+ if(!function_exists("file_get_html"))
55
+ {
56
+ require(dirname(__FILE__).IUB_HTML_DOM);
57
+ }
58
+
59
+ require(dirname(__FILE__).IUB_CLASS_FASTER);
60
+ require(dirname(__FILE__).IUB_CLASS_DEFAULT);
61
+
62
+ /*
63
+ * Admin
64
+ */
65
 
66
  if(is_admin())
67
  {
75
 
76
  function __iubenda_content_type()
77
  {
78
+ if(get_option("iubenda_ctype"))
79
+ {
80
+ $iub_headers = headers_list();
81
+ $destroy = true;
82
+
83
+ /**/
84
+
85
+ foreach($iub_headers as $h)
86
+ {
87
+ if(strpos($h, "Content-Type: text/html") !== false || strpos($h, "Content-type: text/html") !== false)
88
+ {
89
+ $destroy = false;
90
+ }
91
+ }
92
+
93
+ /**/
94
+
95
+ if($destroy)
96
+ {
97
+ define("IUBENDA_NO_HTML", true);
98
+ }
99
+ }
100
  }
101
 
102
  /***/
109
 
110
  if(!get_option("default_skip_parsing")) {
111
  update_option("default_skip_parsing", true);
112
+ update_option("skip_parsing", true);
113
  }
114
  if(!get_option("default_iubendactype")) {
115
+ update_option("default_iubendactype", true);
116
+ update_option("iubenda_ctype", true);
117
  }
118
  if(!get_option("default_iubendaparse")) {
119
+ update_option("default_iubendaparse", true);
120
+ update_option("iubenda_parse", true);
121
  }
122
  if(!get_option("default_parser_engine")) {
123
+ update_option("default_parser_engine", true);
124
+ update_option("parser_engine", "default");
125
  }
126
 
127
 
129
 
130
  __iubenda_content_type();
131
 
132
+ /*
133
+ Check if user is logged in, then disable the banner.
134
 
135
+ if(function_exists("is_user_logged_in"))
 
 
136
  {
137
+ if(is_user_logged_in())
138
+ {
139
+ return;
140
+ }
141
  }
142
+
143
+ */
144
  if($_POST || defined("IUBENDA_NO_HTML"))
145
  {
146
  return;
158
  {
159
  $wpml_old = html_entity_decode(stripslashes(get_option("iub_code")));
160
 
161
+ $iubenda_languages = array("it", "de", "en", "es", "pt-br", "ru", "fr");
162
+
163
+ foreach($iubenda_languages as $iubenda_language)
164
+ {
165
+ if(strpos($wpml_old, 'lang: "'.$iubenda_language) !== false) {
166
+ $language_tag = $iubenda_language;
167
+
168
+ break;
169
+ }
170
+ }
171
+
172
+ update_option("iubenda-code-$language_tag", $wpml_old);
173
+ update_option("iubenda-code-default", $wpml_old);
174
+ update_option("iub_code", false);
175
  }
176
 
177
  if(defined("IUBENDA_WPML") && get_option("iubenda-code-".ICL_LANGUAGE_CODE))
178
  {
179
  $iubenda_code .= get_option("iubenda-code-".ICL_LANGUAGE_CODE);
180
  }
181
+ else {
182
+
183
  $iubenda_code .= get_option("iubenda-code-default");
184
+
185
  }
186
 
187
  $iubenda_code .= "\n
196
  {
197
  iCallback();
198
 
199
+ /*
200
+ * Separator
201
+ */
202
+
203
+ jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
204
+ };
205
+ };
206
  </script>";
207
 
208
  /**/
216
 
217
  function __iubenda_final_output($output)
218
  {
219
+ if(strpos($output, "<html") === false) {
220
+
221
+ return $output;
222
+
223
+ }
224
+ elseif(strpos($output, "<html") > 200 ) {
225
+
226
  return $output;
227
+
228
+ }
229
+
230
+ if(!get_option("iubenda_parse") || Page::consent_given() && get_option("skip_parsing") || Page::bot_detected() || $_POST || defined("IUBENDA_NO_HTML") || get_option("iubenda_output_filter") && ob_get_level() > 1) {
231
+
232
+ return $output;
233
+
234
  }
235
 
236
  /**/
250
 
251
  /**/
252
 
253
+ $output = $faster -> isParse(mb_convert_encoding($output, "HTML-ENTITIES", "UTF-8"));
254
 
255
  /**/
256
 
readme.txt CHANGED
@@ -12,6 +12,8 @@ A plugin that works with the iubenda Cookie Law Solution: shows a cookie banner
12
 
13
  == Description ==
14
 
 
 
15
  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)
16
 
17
  * Find a comprehensive _guide and demo_ to the cookie law solution on our help blog https://www.iubenda.com/en/help/posts/1177
@@ -54,6 +56,11 @@ Iubenda and the Cookie Law Solution extension for WordPress help remove these co
54
 
55
  -----
56
 
 
 
 
 
 
57
  NOTA: Il plugin è attualmente in versione beta e potrebbe pertanto presentare alcuni bug. Ti invitiamo a segnalare sul nostro forum eventuali malfunzionamenti: [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti) (support.iubenda.com)
58
 
59
  * Consulta la _guida completa_ al kit cookie law di iubenda: https://www.iubenda.com/it/help/posts/680
@@ -135,6 +142,12 @@ Yes, right here: https://www.iubenda.com/en/help/posts/1177
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
138
  = 1.11.0 =
139
  * New: Introduced a MUCH FASTER experimental parsing engine (visit the plugin options and select the experimental parsing engine)
140
  * New: Created a new option that allow users to enable/disable the parsing engine and to select the parsing engine between stabile and experimental
12
 
13
  == Description ==
14
 
15
+ ------ ENGLISH ------
16
+
17
  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)
18
 
19
  * Find a comprehensive _guide and demo_ to the cookie law solution on our help blog https://www.iubenda.com/en/help/posts/1177
56
 
57
  -----
58
 
59
+ -----
60
+
61
+ ------ ITALIANO ------
62
+
63
+
64
  NOTA: Il plugin è attualmente in versione beta e potrebbe pertanto presentare alcuni bug. Ti invitiamo a segnalare sul nostro forum eventuali malfunzionamenti: [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti) (support.iubenda.com)
65
 
66
  * Consulta la _guida completa_ al kit cookie law di iubenda: https://www.iubenda.com/it/help/posts/680
142
 
143
  == Changelog ==
144
 
145
+ = 1.11.1 =
146
+ * New: Created a new option that disables the plugin on RSS feeds
147
+ * New: Improved the control that checks if the request content type is HTML
148
+ * Fixed an issue with the banner script
149
+ * Fixed a series of conflicts with UTF-8 special characters caused by the experimental parsing engine
150
+
151
  = 1.11.0 =
152
  * New: Introduced a MUCH FASTER experimental parsing engine (visit the plugin options and select the experimental parsing engine)
153
  * New: Created a new option that allow users to enable/disable the parsing engine and to select the parsing engine between stabile and experimental