iubenda Cookie Solution for GDPR - Version 1.4.2

Version Description

Download this release

Release Info

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

Code changes from version 1.14.2 to 1.4.2

iubenda_cookie_solution.php CHANGED
@@ -1,718 +1,750 @@
1
- <?php
2
- /*
3
- Plugin Name: iubenda Cookie Solution
4
- Plugin URI: https://www.iubenda.com
5
- Description: iubendas Cookie Solution allows you to manage all aspects of cookie law on WP.
6
- Version: 1.14.2
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, 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.1
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
- 'deactivation' => false
52
- );
53
- public $version = '1.14.1';
54
- public $no_html = false;
55
- public $links = array();
56
- public $multilang = false;
57
- public $languages = array();
58
- public $lang_default = '';
59
-
60
- /**
61
- * Class constructor.
62
- */
63
- public function __construct() {
64
- register_activation_hook( __FILE__, array( $this, 'activation' ) );
65
- register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
66
-
67
- // settings
68
- $this->options = array_merge( $this->defaults, (array) get_option( 'iubenda_cookie_law_solution', $this->defaults ) );
69
-
70
- // actions
71
- add_action( 'admin_init', array( $this, 'register_options' ) );
72
- add_action( 'admin_init', array( $this, 'update_plugin' ), 9 );
73
- add_action( 'admin_menu', array( $this, 'admin_menu_options' ) );
74
- add_action( 'admin_notices', array( $this, 'settings_errors' ) );
75
- // add_action( 'admin_menu', array( $this, 'save_options' ), 9 );
76
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
77
- add_action( 'plugins_loaded', array( $this, 'init' ) );
78
- add_action( 'after_setup_theme', array( $this, 'register_shortcode' ) );
79
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
80
- add_action( 'admin_print_styles', array( $this, 'admin_print_styles' ) );
81
- add_action( 'wp_head', array( $this, 'wp_head' ), 99 );
82
- add_action( 'template_redirect', array( $this, 'output_start' ), 0 );
83
- add_action( 'shutdown', array( $this, 'output_end' ), 100 );
84
- }
85
-
86
- /**
87
- * Initialize plugin.
88
- *
89
- * @return void
90
- */
91
- public function init() {
92
-
93
- // check if WPML or Polylang is active
94
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
95
-
96
- // Polylang support
97
- if ( is_plugin_active( 'polylang/polylang.php' ) && function_exists( 'PLL' ) ) {
98
- $this->multilang = true;
99
-
100
- // get registered languages
101
- $registered_languages = PLL()->model->get_languages_list();
102
-
103
- if ( ! empty( $registered_languages ) ) {
104
- foreach ( $registered_languages as $language )
105
- $this->languages[$language->slug] = $language->name;
106
- }
107
-
108
- // get default language
109
- $this->lang_default = pll_default_language();
110
-
111
- // WPML support
112
- } elseif ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && class_exists( 'SitePress' ) ) {
113
- $this->multilang = true;
114
-
115
- global $sitepress;
116
-
117
- // get registered languages
118
- $registered_languages = icl_get_languages();
119
-
120
- if ( ! empty( $registered_languages ) ) {
121
- foreach ( $registered_languages as $language )
122
- $this->languages[$language['code']] = $language['display_name'];
123
- }
124
-
125
- // get default language
126
- $this->lang_default = $sitepress->get_default_language();
127
- }
128
-
129
- // load Simple HTML DOM if needed
130
- if ( ! function_exists( 'file_get_html' ) ) {
131
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/simple_html_dom.php' );
132
- }
133
-
134
- // load plugin class
135
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.faster.php' );
136
- require_once( dirname( __FILE__ ) . '/iubenda-cookie-class/iubenda.class.php' );
137
-
138
- $links = array(
139
- 'en' => array(
140
- 'guide' => 'https://www.iubenda.com/en/iubenda-cookie-law-solution',
141
- 'plugin_page' => 'https://www.iubenda.com/en/help/posts/1215',
142
- 'generating_code' => 'https://www.iubenda.com/en/help/posts/1177',
143
- 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
144
- 'documentation' => 'https://www.iubenda.com/en/help/posts/1215'
145
- ),
146
- 'it' => array(
147
- 'guide' => 'https://www.iubenda.com/it/soluzione-cookie-law',
148
- 'plugin_page' => 'https://www.iubenda.com/it/help/posts/810',
149
- 'generating_code' => 'https://www.iubenda.com/it/help/posts/680',
150
- 'support_forum' => 'https://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti',
151
- 'documentation' => 'https://www.iubenda.com/it/help/posts/810',
152
- )
153
- );
154
-
155
- $locale = explode( '_', get_locale() );
156
- $locale_code = $locale[0];
157
-
158
- // assign links
159
- $this->links = in_array( $locale_code, array_keys( $links ) ) ? $links[$locale_code] : $links['en'];
160
- }
161
-
162
- /**
163
- * Plugin activation.
164
- *
165
- * @return void
166
- */
167
- public function activation() {
168
- add_option( 'iubenda_cookie_law_solution', $this->options, '', 'no' );
169
- add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
170
- }
171
-
172
- /**
173
- * Plugin deactivation.
174
- *
175
- * @return void
176
- */
177
- public function deactivation() {
178
- // remove options from database?
179
- if ( $this->options['deactivation'] ) {
180
- delete_option( 'iubenda_cookie_law_solution' );
181
- delete_option( 'iubenda_cookie_law_version' );
182
- }
183
- }
184
-
185
- /**
186
- * Plugin options migration for versions < 1.14.0
187
- *
188
- * @return void
189
- */
190
- public function update_plugin() {
191
- if ( ! current_user_can( 'install_plugins' ) )
192
- return;
193
-
194
- $db_version = get_option( 'iubenda_cookie_law_version' );
195
- $db_version = ! $db_version ? '1.13.0' : $db_version;
196
-
197
- if ( $db_version != false ) {
198
- if ( version_compare( $db_version, '1.14.0', '<' ) ) {
199
- $options = array();
200
-
201
- $old_new = array(
202
- 'iubenda_parse' => 'parse',
203
- 'skip_parsing' => 'skip_parsing',
204
- 'iubenda_ctype' => 'ctype',
205
- 'iubenda_parse' => 'parse',
206
- 'parser_engine' => 'parser_engine',
207
- 'iubenda_output_feed' => 'output_feed',
208
- 'iubenda-code-default' => 'code_default',
209
- 'default_skip_parsing' => '',
210
- 'default_iubendactype' => '',
211
- 'default_iubendaparse' => '',
212
- 'default_parser_engine' => '',
213
- 'iub_code' => '',
214
- );
215
-
216
- foreach ( $old_new as $old => $new ) {
217
- if ( $new ) {
218
- $options[$new] = get_option( $old );
219
- }
220
- delete_option( $old );
221
- }
222
-
223
- // multilang support
224
- if ( ! empty( $this->languages ) ) {
225
- foreach ( $this->languages as $lang ) {
226
- $code = get_option( 'iubenda-code-' . $lang );
227
-
228
- if ( ! empty( $code ) ) {
229
- $options['code_' . $lang] = $code;
230
-
231
- delete_option( 'iubenda-code-' . $lang );
232
- }
233
- }
234
- }
235
-
236
- add_option( 'iubenda_cookie_law_solution', $options, '', 'no' );
237
- add_option( 'iubenda_cookie_law_version', $this->version, '', 'no' );
238
- }
239
- }
240
- }
241
-
242
- /**
243
- * Register shortcode function.
244
- */
245
- public function register_shortcode() {
246
- add_shortcode( 'iub-cookie-policy', array( $this, 'shortcode' ) );
247
- }
248
-
249
- /**
250
- * Handle shortcode function.
251
- *
252
- * @param array $atts
253
- * @param mixed $content
254
- * @return mixed
255
- */
256
- public function shortcode( $atts, $content = '' ) {
257
- return '<!--IUB_COOKIE_POLICY_START-->' . do_shortcode( $content ) . '<!--IUB_COOKIE_POLICY_END-->';
258
- }
259
-
260
- /**
261
- * Add submenu.
262
- */
263
- public function admin_menu_options() {
264
- add_menu_page(
265
- 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda-cookie-law-solution', array( $this, 'options_page' ), 'none'
266
- );
267
- }
268
-
269
- /**
270
- * Load textdomain.
271
- */
272
- public function load_textdomain() {
273
- load_plugin_textdomain( 'iubenda-cookie-law-solution', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
274
- }
275
-
276
- /**
277
- * Load admin scripts and styles.
278
- *
279
- * @param string $page
280
- * @return void
281
- */
282
- public function admin_enqueue_scripts( $page ) {
283
- if ( $page !== 'toplevel_page_iubenda-cookie-law-solution' )
284
- return;
285
-
286
- wp_enqueue_script(
287
- 'iubenda-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' )
288
- );
289
-
290
- wp_enqueue_style( 'iubenda-admin', plugins_url( 'css/admin.css', __FILE__ ) );
291
- }
292
-
293
- /**
294
- * Load admin style inline, for menu icon only.
295
- *
296
- * @return mixed
297
- */
298
- public function admin_print_styles() {
299
- echo '
300
- <style>
301
- a.toplevel_page_iubenda-cookie-law-solution .wp-menu-image {
302
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDkuNDE4IiBoZWlnaHQ9IjI3My4wMTgiIHZpZXdCb3g9IjAgMCAxMDkuNDE4IDI3My4wMTgiPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGIiBkPSJNMTA5LjQxOCA1NC41M0MxMDkuNDE4IDI0LjQwNCA4NC45MzYgMCA1NC43MDggMCAyNC40ODYgMCAwIDI0LjQwNCAwIDU0LjUzYzAgMTQuNzY1IDUuOSAyOC4xNCAxNS40ODcgMzcuOTUzTDQuMTI0IDI3My4wMThoMTAzLjg3TDk2LjQ3NyA4OS43MzJjOC4wODYtOS41MDQgMTIuOTQtMjEuNzgyIDEyLjk0LTM1LjIwMnptLTY1LjM2LTkuOTAzQzQ3LjAwNyA0MS42OCA1MC42MyA0MC4yIDU0LjkzIDQwLjJjNC4yIDAgNy43NzMgMS40OCAxMC43MjUgNC40MjcgMi45NDggMi45NDggNC40MjQgNi41MjIgNC40MjQgMTAuNzI0IDAgNC4xOTctMS40NzYgNy43OTUtNC40MjQgMTAuNzk1LTIuOTUyIDMtNi41MjQgNC40OTgtMTAuNzI0IDQuNDk4LTQuMTk4IDAtNy44LTEuNDk4LTEwLjc5Ny00LjQ5OC0zLTMtNC41LTYuNi00LjUtMTAuNzk0LS4wMDItNC4yIDEuNDczLTcuNzc0IDQuNDI2LTEwLjcyM3ptNDQuMTY1IDIwOC44M0gyMS40ODZ2LTUuNDAyYzYuNyAwIDExLjItLjY0NiAxMy40OTgtMS45NDYgMi4yOTgtMS4yOTUgNC4xMjUtMy40NSA1LjQ3NS02LjQ0NyAxLjM0Ni0zIDIuMDIzLTguNzQ3IDIuMDIzLTE3LjI0N3YtNTIuOTQzYzAtMTQuODk4LS40NTMtMjQuNTQtMS4zNTItMjguOTQ0LS42OTgtMy4xOTYtMS43OTctNS40Mi0zLjMtNi42Ny0xLjQ5NS0xLjI1LTMuNTQ4LTEuODc0LTYuMTQ3LTEuODc0LTIuNzk4IDAtNi4yLjc1LTEwLjE5NyAyLjI1bC0yLjEwMi01LjQgNDEuMzk0LTE2Ljc5N2g2LjZ2MTEwLjM3N2MwIDguNTk4LjYyNCAxNC4zMiAxLjg3NSAxNy4xNyAxLjI1IDIuODQ4IDMuMDk2IDQuOTc0IDUuNTQ4IDYuMzc0IDIuNDUgMS40MDMgNi45MjYgMi4wOTcgMTMuNDIzIDIuMDk3djUuNHoiLz48L3N2Zz4=);
303
- background-position: center center;
304
- background-repeat: no-repeat;
305
- background-size: 7px auto;
306
- }
307
- </style>
308
- ';
309
- }
310
-
311
- /**
312
- * Add wp_head content.
313
- *
314
- * @return mixed
315
- */
316
- public function wp_head() {
317
- /* check if user is logged in, then disable the banner.
318
- if ( is_user_logged_in() ) {
319
- return;
320
- }
321
- */
322
-
323
- // break on admin side
324
- if ( is_admin() ) {
325
- return;
326
- }
327
-
328
- // check content type
329
- if ( (bool) $this->options['ctype'] == true ) {
330
- $iub_headers = headers_list();
331
- $destroy = true;
332
-
333
- foreach ( $iub_headers as $h ) {
334
- if ( strpos( $h, "Content-Type: text/html" ) !== false || strpos( $h, "Content-type: text/html" ) !== false ) {
335
- $destroy = false;
336
- }
337
- }
338
-
339
- if ( $destroy ) {
340
- $this->no_html = true;
341
- }
342
- }
343
-
344
- // is post or not html content type?
345
- if ( $_POST || $this->no_html ) {
346
- return;
347
- }
348
-
349
- // initial head output
350
- $iubenda_code = "";
351
-
352
- if ( $this->multilang === true && defined( 'ICL_LANGUAGE_CODE' ) && isset( $this->options['code_' . ICL_LANGUAGE_CODE] ) ) {
353
- $iubenda_code .= $this->options['code_' . ICL_LANGUAGE_CODE];
354
-
355
- // no code for current language, use default
356
- if ( ! $iubenda_code ) {
357
- $iubenda_code .= $this->options['code_default'];
358
- }
359
- } else {
360
- $iubenda_code .= $this->options['code_default'];
361
- }
362
-
363
- $iubenda_code .= "\n
364
- <script>
365
- var iCallback = function() {};
366
-
367
- if ( typeof _iub.csConfiguration != 'undefined' ) {
368
- if ( 'callback' in _iub.csConfiguration ) {
369
- if ( 'onConsentGiven' in _iub.csConfiguration.callback )
370
- iCallback = _iub.csConfiguration.callback.onConsentGiven;
371
-
372
- _iub.csConfiguration.callback.onConsentGiven = function() {
373
- iCallback();
374
-
375
- /* separator */
376
- jQuery('noscript._no_script_iub').each(function (a, b) { var el = jQuery(b); el.after(el.html()); });
377
- }
378
- }
379
- }
380
- </script>";
381
-
382
- echo $iubenda_code;
383
- }
384
-
385
- /**
386
- * Initialize html output.
387
- *
388
- * @return void
389
- */
390
- public function output_start() {
391
- if ( ! is_admin() ) {
392
- ob_start( array( $this, 'output_callback' ) );
393
- }
394
- }
395
-
396
- /**
397
- * Finish html output.
398
- *
399
- * @return void
400
- */
401
- public function output_end() {
402
- if ( ! is_admin() && ob_get_level() ) {
403
- ob_end_flush();
404
- }
405
- }
406
-
407
- /**
408
- * Handle final html output.
409
- *
410
- * @param mixed $output
411
- * @return mixed
412
- */
413
- public function output_callback( $output ) {
414
- // break on ajax, xmlrpc or iub_no_parse request
415
- if (
416
- ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
417
- || ( defined( 'DOING_AJAX' ) && DOING_AJAX )
418
- || isset( $_SERVER["HTTP_X_REQUESTED_WITH"] )
419
- || isset( $_GET['iub_no_parse'] )
420
- ) {
421
- return $output;
422
- }
423
-
424
- // break on admin side
425
- if ( is_admin() ) {
426
- return $output;
427
- }
428
-
429
- // break for logged in users?
430
- /* if ( is_user_logged_in() ) {
431
- return $output;
432
- }
433
- */
434
-
435
- // break on rss feed
436
- if ( is_feed() && $this->options['output_feed'] ) {
437
- return $output;
438
- }
439
-
440
- if ( strpos( $output, "<html" ) === false ) {
441
- return $output;
442
- } elseif ( strpos( $output, "<html" ) > 200 ) {
443
- return $output;
444
- }
445
-
446
- // check whether to run parser or not
447
- if (
448
- ! $this->options['parse'] || ( iubendaPage::consent_given() && $this->options['skip_parsing'] ) || iubendaPage::bot_detected() || $_POST || $this->no_html ) {
449
-
450
- return $output;
451
- }
452
-
453
- $startime = microtime( true );
454
-
455
- // experimental class
456
- if ( $this->options['parser_engine'] == 'new' ) {
457
- $faster = new iubendaFaster;
458
-
459
- // render output
460
- $output = $faster->isParse( mb_convert_encoding( $output, 'HTML-ENTITIES', 'UTF-8' ) );
461
-
462
- // append signature
463
- $output .= '<!-- Parsed with iubenda experimental class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
464
- // default class
465
- } else {
466
- $page = new iubendaPage( $output );
467
- $page->parse();
468
-
469
- // render output
470
- $output = $page->get_converted_page();
471
-
472
- // append signature
473
- $output .= '<!-- Parsed with iubenda default class in ' . round( microtime( true ) - $startime, 4 ) . ' sec. -->';
474
- }
475
-
476
- return apply_filters( 'iubenda_final_output', $output );
477
- }
478
-
479
- /**
480
- * Register plugin options.
481
- */
482
- public function register_options() {
483
- register_setting( 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution', array( $this, 'save_options' ) );
484
-
485
- add_settings_section( 'iubenda_cookie_law_solution', '', '', 'iubenda_cookie_law_solution' );
486
- add_settings_field( 'iub_code', __( 'Code', 'iubenda-cookie-law-solution' ), array( $this, 'iub_code' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
487
- add_settings_field( 'iub_parse', __( 'Scripts blocking', 'iubenda-cookie-law-solution' ), array( $this, 'iub_parse' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
488
- add_settings_field( 'iub_ctype', __( 'Content type', 'iubenda-cookie-law-solution' ), array( $this, 'iub_ctype' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
489
- 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' );
490
- add_settings_field( 'iub_deactivatioin', __( 'Deactivation', 'iubenda-cookie-law-solution' ), array( $this, 'iub_deactivation' ), 'iubenda_cookie_law_solution', 'iubenda_cookie_law_solution' );
491
- }
492
-
493
- /**
494
- * Display errors and notices.
495
- */
496
- public function settings_errors() {
497
- settings_errors( 'iub_settings_errors' );
498
- }
499
-
500
- /**
501
- * Code option.
502
- *
503
- * @return mixed
504
- */
505
- public function iub_code() {
506
- // multilang support
507
- if ( $this->multilang && ! empty( $this->languages ) ) {
508
- echo '
509
- <div id="contextual-help-wrap" class="hidden" tabindex="-1" style="display: block;">
510
- <div id="contextual-help-back"></div>
511
- <div id="contextual-help-columns">
512
- <div class="contextual-help-tabs">
513
- <ul>';
514
- foreach ( $this->languages as $lang_id => $lang_name ) {
515
- echo '
516
- <li id="tab-link-overview" class="' . ( $this->lang_default == $lang_id ? 'active' : '' ) . '">
517
- <a href="#tab-panel-' . $lang_id . '" aria-controls="tab-panel-' . $lang_id . '">' . $lang_name . '</a>
518
- </li>';
519
- }
520
- echo '
521
- </ul>
522
- </div>
523
-
524
- <div class="contextual-help-tabs-wrap">';
525
- foreach ( $this->languages as $lang_id => $lang_name ) {
526
- // get code for the language
527
- $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() ) ) ) ) ) : '';
528
- // handle default, if empty
529
- $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;
530
-
531
- echo '
532
- <div id="tab-panel-' . $lang_id . '" class="help-tab-content' . ( $this->lang_default == $lang_id ? ' active' : '' ) . '">
533
- <textarea name="iubenda_cookie_law_solution[code_' . $lang_id . ']" class="large-text" cols="50" rows="10">' . $code . '</textarea>
534
- <p class="description">' . sprintf( __( 'Enter the iubenda code for %s.', 'iubenda-cookie-law-solution' ), $lang_name ) . '</p>
535
- </div>';
536
- }
537
- echo '
538
- </div>
539
- </div>
540
- </div>';
541
- } else {
542
- echo '
543
- <div id="iub_code_default">
544
- <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>
545
- <p class="description">' . __( 'Enter the iubenda code.', 'iubenda-cookie-law-solution' ) . '</p>
546
- </div>';
547
- }
548
- }
549
-
550
- /**
551
- * Parsing option.
552
- *
553
- * @return mixed
554
- */
555
- public function iub_parse() {
556
- echo '
557
- <div id="iub_parse_container">
558
- <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>
559
- <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>
560
- <div id="iub_parser_engine_container"' . ( $this->options['parse'] === false ? ' style="display: none;"' : '' ) . '>
561
- <div>
562
- <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>
563
- <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>
564
- <p class="description">' . __( 'Select parsing engine.', 'iubenda-cookie-law-solution' ) . '</p>
565
- </div>
566
- <div>
567
- <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>
568
- <p class="description">(' . __( "improves performance, highly recommended, to be deactivated only if your site uses a caching system", 'iubenda-cookie-law-solution' ) . ')</p>
569
- </div>
570
- </div>
571
- </div>';
572
- }
573
-
574
- /**
575
- * Ctype option.
576
- *
577
- * @return mixed
578
- */
579
- public function iub_ctype() {
580
- echo '
581
- <div id="iub_ctype_container">
582
- <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>
583
- </div>';
584
- }
585
-
586
- /**
587
- * RSS feed option.
588
- *
589
- * @return mixed
590
- */
591
- public function iub_output_feed() {
592
- echo '
593
- <div id="iub_output_feed_container">
594
- <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>
595
- </div>';
596
- }
597
-
598
- /**
599
- * Deactivation option.
600
- *
601
- * @return mixed
602
- */
603
- public function iub_deactivation() {
604
- echo '
605
- <div id="iub_deactivation_container">
606
- <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>
607
- </div>';
608
- }
609
-
610
- /**
611
- * Save options.
612
- *
613
- * @return void
614
- */
615
- public function save_options( $input ) {
616
- if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) )
617
- return;
618
-
619
- // save options
620
- if ( isset( $_POST['save_iubenda_options'] ) ) {
621
- $input['parse'] = (bool) isset( $input['parse'] );
622
- $input['parser_engine'] = isset( $input['parser_engine'] ) && in_array( $input['parser_engine'], array( 'default', 'new' ) ) ? $input['parser_engine'] : $this->defaults['parser_engine'];
623
- $input['skip_parsing'] = (bool) isset( $input['skip_parsing'] );
624
- $input['ctype'] = (bool) isset( $input['ctype'] );
625
- $input['output_feed'] = (bool) isset( $input['output_feed'] );
626
- $input['deactivation'] = (bool) isset( $input['deactivation'] );
627
-
628
- // multilang support
629
- if ( $this->multilang && ! empty( $this->languages ) ) {
630
- foreach ( $this->languages as $lang_id => $lang_name ) {
631
- $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() ) ) ) : '';
632
-
633
- // handle default lang too
634
- if ( $lang_id == $this->lang_default ) {
635
- $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'];
636
- }
637
- }
638
- } else {
639
- $input['code_default'] = ! empty( $input['code_default'] ) ? wp_kses( $input['code_default'], array( 'script' => array( 'type' => array(), 'src' => array(), 'charset' => array(), 'async' => array() ) ) ) : '';
640
- }
641
-
642
- add_settings_error( 'iub_settings_errors', 'iub_settings_updated', __( 'Settings saved.', 'iubenda-cookie-law-solution' ), 'updated' );
643
- // reset options
644
- } elseif ( isset( $_POST['reset_iubenda_options'] ) ) {
645
- $input = $this->defaults;
646
-
647
- // multilang support
648
- if ( $this->multilang && ! empty( $this->languages ) ) {
649
- foreach ( $this->languages as $lang_id => $lang_name ) {
650
- $input['code_' . $lang_id] = '';
651
- }
652
- }
653
- add_settings_error( 'iub_settings_errors', 'iub_settings_restored', __( 'Settings restored to defaults.', 'iubenda-cookie-law-solution' ), 'updated' );
654
- }
655
-
656
- return $input;
657
- }
658
-
659
- /**
660
- * Load admin options page.
661
- *
662
- * @return void
663
- */
664
- public function options_page() {
665
- if ( ! current_user_can( apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ) ) ) {
666
- wp_die( __( "You don't have permission to access this page.", 'iubenda-cookie-law-solution' ) );
667
- }
668
- ?>
669
- <div class="wrap">
670
- <div id="iubenda-view">
671
- <?php
672
- echo '
673
- <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>
674
- <p class="iubenda-text">
675
- ' . __( "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' ) . '
676
- </p>
677
- <p class="iubenda-text">
678
- <span class="iubenda-title">' . __( "Would you like to know more about the cookie law?", 'iubenda-cookie-law-solution' ) . '</span><br />
679
- ' . 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'] ) . '
680
- </p>
681
- <p class="iubenda-text">
682
- <span class="iubenda-title">' . __( "What is the full functionality of the plugin?", 'iubenda-cookie-law-solution' ) . '</span><br />
683
- ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page.</a>", 'iubenda-cookie-law-solution' ), $this->links['plugin_page'] ) . '
684
- </p>
685
- <p class="iubenda-text">
686
- <span class="iubenda-title">' . __( "Enter the iubenda code for the Cookie Solution below.", 'iubenda-cookie-law-solution' ) . '</span><br />
687
- ' . 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'] ) . '
688
- </p>';
689
- ?>
690
- <form id="iubenda-tabs" action="options.php" method="post">
691
- <?php
692
- settings_fields( 'iubenda_cookie_law_solution' );
693
- do_settings_sections( 'iubenda_cookie_law_solution' );
694
-
695
- echo ' <p class="submit">';
696
- submit_button( '', 'primary', 'save_iubenda_options', false );
697
- echo ' ';
698
- submit_button( __( 'Reset to defaults', 'iubenda-cookie-law-solution' ), 'secondary', 'reset_iubenda_options', false );
699
- echo ' </p>';
700
- ?>
701
- </form>
702
- <?php echo '
703
- <p class="iubenda-text">
704
- <span class="iubenda-title">' . __( 'Need support for this plugin?', 'iubenda-cookie-law-solution' ) . '</span><br />
705
- ' . sprintf( __( "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support forum.</a>", 'iubenda-cookie-law-solution' ), $this->links['support_forum'] ) . '
706
- </p>
707
- <p class="iubenda-text">
708
- <span class="iubenda-title">' . __( 'Want to try a beta version of this plugin with the latest features?', 'iubenda-cookie-law-solution' ) . '</span><br />
709
- ' . 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'] ) . '
710
- </p>';
711
- ?>
712
- </div>
713
- <div class="clear"></div>
714
- </div>
715
- <?php
716
- }
717
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  }
1
+ <?php
2
+ /*
3
+ Plugin Name: iubenda Cookie Solution
4
+ Plugin URI: https://www.iubenda.com
5
+ Description: iubendas Cookie Solution allows you to manage all aspects of cookie law on WP.
6
+ Version: 1.14.2
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, 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.2
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.2';
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
  }
languages/iubenda-cookie-law-solution-it_IT.mo CHANGED
Binary file
languages/iubenda-cookie-law-solution-it_IT.po CHANGED
@@ -1,51 +1,59 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Iubenda Cookie Solution\n"
4
- "POT-Creation-Date: 2016-12-14 16:20+0100\n"
5
- "PO-Revision-Date: 2016-12-21 16:58+0100\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.11\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:446
20
  msgid "Code"
21
  msgstr "Codice"
22
 
23
- #: iubenda_cookie_solution.php:447
24
  msgid "Scripts blocking"
25
  msgstr "Blocco preventivo dei codici"
26
 
27
- #: iubenda_cookie_solution.php:448
 
 
 
 
28
  msgid "Content type"
29
  msgstr "Tipo di contenuto"
30
 
31
- #: iubenda_cookie_solution.php:449
32
  msgid "RSS feed"
33
  msgstr "Feed RSS"
34
 
35
- #: iubenda_cookie_solution.php:493
 
 
 
 
36
  #, php-format
37
  msgid "Enter the iubenda code for %s."
38
  msgstr "Inserire il codice di iubenda per %s."
39
 
40
- #: iubenda_cookie_solution.php:504
41
  msgid "Enter the iubenda code."
42
  msgstr "Inserire il codice di iubenda."
43
 
44
- #: iubenda_cookie_solution.php:517
45
  msgid "Automatically block scripts detected by the plugin."
46
  msgstr "Blocca automaticamente gli script rilevati dal plugin."
47
 
48
- #: iubenda_cookie_solution.php:518
49
  #, php-format
50
  msgid ""
51
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
@@ -54,26 +62,26 @@ msgstr ""
54
  "visita <a href=\"%s\" target=\"_blank\">la nostra documentazione</a> per la "
55
  "lista degli script rilevati automaticamente dal plugin."
56
 
57
- #: iubenda_cookie_solution.php:521
58
  msgid "Default"
59
  msgstr "Default"
60
 
61
- #: iubenda_cookie_solution.php:522
62
  msgid "Experimental"
63
  msgstr "Sperimentale"
64
 
65
- #: iubenda_cookie_solution.php:523
66
  msgid "Select parsing engine."
67
  msgstr "Seleziona il motore di parsing."
68
 
69
- #: iubenda_cookie_solution.php:526
70
  msgid ""
71
  "Leave scripts untouched on the page if the user has already given consent"
72
  msgstr ""
73
  "Lascia gli script intatti sulla pagina se l'utente ha già prestato il "
74
  "consenso"
75
 
76
- #: iubenda_cookie_solution.php:527
77
  msgid ""
78
  "improves performance, highly recommended, to be deactivated only if your "
79
  "site uses a caching system"
@@ -81,7 +89,19 @@ msgstr ""
81
  "migliora le prestazioni, altamente consigliato, da disattivare solo qualora "
82
  "il tuo sito utilizzi un sistema di cache"
83
 
84
- #: iubenda_cookie_solution.php:541
 
 
 
 
 
 
 
 
 
 
 
 
85
  msgid ""
86
  "Restrict the plugin to run only for requests that have \"Content-type: "
87
  "text / html\" (recommended)"
@@ -89,23 +109,27 @@ msgstr ""
89
  "Restringi l'esecuzione del plugin alle sole richieste che presentano "
90
  "\"Content-type: text/html\" (consigliato)"
91
 
92
- #: iubenda_cookie_solution.php:553
93
  msgid "Do not run the plugin inside the RSS feed (recommended)"
94
  msgstr "Non eseguire il plugin all'interno dei Feed RSS (consigliato)"
95
 
96
- #: iubenda_cookie_solution.php:588
 
 
 
 
97
  msgid "Settings saved."
98
  msgstr "Impostazioni salvate."
99
 
100
- #: iubenda_cookie_solution.php:599
101
  msgid "Settings restored to defaults."
102
  msgstr "Impostazioni di default ripristinate."
103
 
104
- #: iubenda_cookie_solution.php:614
105
  msgid "You don't have permission to access this page."
106
  msgstr "Non disponi dell'autorizzazione per accedere a questa pagina."
107
 
108
- #: iubenda_cookie_solution.php:622
109
  msgid ""
110
  "This plugin is the easiest and most comprehensive way to adapt your "
111
  "WordPress site to the European cookie law. Upon your user's first visit, the "
@@ -123,11 +147,11 @@ msgstr ""
123
  "il semplice scroll (il metodo più efficace) e la riattivazione senza il "
124
  "refresh della pagina."
125
 
126
- #: iubenda_cookie_solution.php:625
127
  msgid "Would you like to know more about the cookie law?"
128
  msgstr "Vuoi capire di più sulla cookie law?"
129
 
130
- #: iubenda_cookie_solution.php:626
131
  #, php-format
132
  msgid ""
133
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
@@ -136,11 +160,11 @@ msgstr ""
136
  "Consulta la nostra <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
137
  "\">guida completa alla cookie law</a>."
138
 
139
- #: iubenda_cookie_solution.php:629
140
  msgid "What is the full functionality of the plugin?"
141
  msgstr "Qual'è la completa funzionalità del plugin?"
142
 
143
- #: iubenda_cookie_solution.php:630
144
  #, php-format
145
  msgid ""
146
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin page."
@@ -149,11 +173,11 @@ msgstr ""
149
  "Visita la <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">nostra "
150
  "pagina dedicata</a> al plugin."
151
 
152
- #: iubenda_cookie_solution.php:633
153
  msgid "Enter the iubenda code for the Cookie Solution below."
154
  msgstr "Inserisci qui sotto il codice di iubenda per la Cookie Solution."
155
 
156
- #: iubenda_cookie_solution.php:634
157
  #, php-format
158
  msgid ""
159
  "In order to run the plugin, you need to enter the iubenda code that "
@@ -166,15 +190,15 @@ msgstr ""
166
  "codice può essere generato su www.iubenda.com, <a href=\"%s\" class="
167
  "\"iubenda-url\" target=\"_blank\">seguendo questa guida</a> ."
168
 
169
- #: iubenda_cookie_solution.php:645
170
  msgid "Reset to defaults"
171
  msgstr "Ripristina le impostazioni di default"
172
 
173
- #: iubenda_cookie_solution.php:651
174
  msgid "Need support for this plugin?"
175
  msgstr "Hai bisogno di supporto su questo plugin?"
176
 
177
- #: iubenda_cookie_solution.php:652
178
  #, php-format
179
  msgid ""
180
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
@@ -183,13 +207,13 @@ msgstr ""
183
  "Visita il nostro <a href=\"%s\" class=\"iubenda-url\" target=\"_blank"
184
  "\">forum di supporto</a>."
185
 
186
- #: iubenda_cookie_solution.php:655
187
  msgid "Want to try a beta version of this plugin with the latest features?"
188
  msgstr ""
189
  "Vuoi provare una versione Beta di questo plugin, con le funzionalità più "
190
  "recenti?"
191
 
192
- #: iubenda_cookie_solution.php:656
193
  #, php-format
194
  msgid ""
195
  "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: 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
  "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
  "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
  "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 "
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 "
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."
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 "
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 "
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"
languages/iubenda-cookie-law-solution.pot CHANGED
@@ -2,110 +2,126 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Iubenda Cookie Solution\n"
5
- "POT-Creation-Date: 2017-01-05 10:38+0100\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.11\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:486
20
  msgid "Code"
21
  msgstr ""
22
 
23
- #: iubenda_cookie_solution.php:487
24
  msgid "Scripts blocking"
25
  msgstr ""
26
 
27
- #: iubenda_cookie_solution.php:488
 
 
 
 
28
  msgid "Content type"
29
  msgstr ""
30
 
31
- #: iubenda_cookie_solution.php:489
32
  msgid "RSS feed"
33
  msgstr ""
34
 
35
- #: iubenda_cookie_solution.php:490
36
  msgid "Deactivation"
37
  msgstr ""
38
 
39
- #: iubenda_cookie_solution.php:534
40
  #, php-format
41
  msgid "Enter the iubenda code for %s."
42
  msgstr ""
43
 
44
- #: iubenda_cookie_solution.php:545
45
  msgid "Enter the iubenda code."
46
  msgstr ""
47
 
48
- #: iubenda_cookie_solution.php:558
49
  msgid "Automatically block scripts detected by the plugin."
50
  msgstr ""
51
 
52
- #: iubenda_cookie_solution.php:559
53
  #, php-format
54
  msgid ""
55
  "see <a href=\"%s\" target=\"_blank\">our documentation</a> for the list of "
56
  "detected scripts."
57
  msgstr ""
58
 
59
- #: iubenda_cookie_solution.php:562
60
  msgid "Default"
61
  msgstr ""
62
 
63
- #: iubenda_cookie_solution.php:563
64
  msgid "Experimental"
65
  msgstr ""
66
 
67
- #: iubenda_cookie_solution.php:564
68
  msgid "Select parsing engine."
69
  msgstr ""
70
 
71
- #: iubenda_cookie_solution.php:567
72
  msgid ""
73
  "Leave scripts untouched on the page if the user has already given consent"
74
  msgstr ""
75
 
76
- #: iubenda_cookie_solution.php:568
77
  msgid ""
78
  "improves performance, highly recommended, to be deactivated only if your "
79
  "site uses a caching system"
80
  msgstr ""
81
 
82
- #: iubenda_cookie_solution.php:582
 
 
 
 
 
 
 
 
 
 
 
 
83
  msgid ""
84
  "Restrict the plugin to run only for requests that have \"Content-type: "
85
  "text / html\" (recommended)"
86
  msgstr ""
87
 
88
- #: iubenda_cookie_solution.php:594
89
  msgid "Do not run the plugin inside the RSS feed (recommended)"
90
  msgstr ""
91
 
92
- #: iubenda_cookie_solution.php:606
93
  msgid "Delete all plugin data upon deactivation?"
94
  msgstr ""
95
 
96
- #: iubenda_cookie_solution.php:642
97
  msgid "Settings saved."
98
  msgstr ""
99
 
100
- #: iubenda_cookie_solution.php:653
101
  msgid "Settings restored to defaults."
102
  msgstr ""
103
 
104
- #: iubenda_cookie_solution.php:666
105
  msgid "You don't have permission to access this page."
106
  msgstr ""
107
 
108
- #: iubenda_cookie_solution.php:675
109
  msgid ""
110
  "This plugin is the easiest and most comprehensive way to adapt your "
111
  "WordPress site to the European cookie law. Upon your user's first visit, "
@@ -116,33 +132,33 @@ msgid ""
116
  "script reactivation without refreshing the page."
117
  msgstr ""
118
 
119
- #: iubenda_cookie_solution.php:678
120
  msgid "Would you like to know more about the cookie law?"
121
  msgstr ""
122
 
123
- #: iubenda_cookie_solution.php:679
124
  #, php-format
125
  msgid ""
126
  "Read our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">complete "
127
  "guide to the cookie law.</a>"
128
  msgstr ""
129
 
130
- #: iubenda_cookie_solution.php:682
131
  msgid "What is the full functionality of the plugin?"
132
  msgstr ""
133
 
134
- #: iubenda_cookie_solution.php:683
135
  #, php-format
136
  msgid ""
137
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">plugin "
138
  "page.</a>"
139
  msgstr ""
140
 
141
- #: iubenda_cookie_solution.php:686
142
  msgid "Enter the iubenda code for the Cookie Solution below."
143
  msgstr ""
144
 
145
- #: iubenda_cookie_solution.php:687
146
  #, php-format
147
  msgid ""
148
  "In order to run the plugin, you need to enter the iubenda code that "
@@ -151,26 +167,26 @@ msgid ""
151
  "class=\"iubenda-url\" target=\"_blank\">this guide.</a>"
152
  msgstr ""
153
 
154
- #: iubenda_cookie_solution.php:698
155
  msgid "Reset to defaults"
156
  msgstr ""
157
 
158
- #: iubenda_cookie_solution.php:704
159
  msgid "Need support for this plugin?"
160
  msgstr ""
161
 
162
- #: iubenda_cookie_solution.php:705
163
  #, php-format
164
  msgid ""
165
  "Visit our <a href=\"%s\" class=\"iubenda-url\" target=\"_blank\">support "
166
  "forum.</a>"
167
  msgstr ""
168
 
169
- #: iubenda_cookie_solution.php:708
170
  msgid "Want to try a beta version of this plugin with the latest features?"
171
  msgstr ""
172
 
173
- #: iubenda_cookie_solution.php:709
174
  #, php-format
175
  msgid ""
176
  "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: 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
  "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
  "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"
readme.txt CHANGED
@@ -1,297 +1,296 @@
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.7.1
7
- Stable tag: 1.14.2
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
22
- * It detects bots/spiders and serves them a clean page
23
-
24
- **The plugin is currently capable of automatically detecting and blocking the following scripts:**
25
-
26
- * Facebook widgets
27
- * Twitter widgets
28
- * Google+ widgets
29
- * Google AdSense
30
- * YouTube widgets
31
- * AddThis widgets
32
- * ShareThis widgets
33
- * Google Maps widgets
34
-
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
-
42
- * English
43
- * Italian
44
- * French
45
- * Spanish
46
- * Portuguese (Brazilian)
47
- * German
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];
59
- if (d.getElementById(id)) return;
60
- js = d.createElement(s); js.id = id;
61
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=808061959224601";
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 ==
105
-
106
- **Where can I find help?**
107
- You can find a dedicated support forum thread here [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti) or we're happy to answer at info@iubenda.com.
108
-
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
115
- 2. When clicking on the cookie policy link, the user gets a view of the entire cookie policy, where they ultimately can give their consent
116
- 3. It's as simple as copy-pasting the code from iubenda into the plugin form.
117
-
118
- == Changelog ==
119
-
120
- = 1.14.2 =
121
- * Fix: WordPress repository issue breaking the update
122
-
123
- = 1.14.1 =
124
- * New: Option to delete all plugin data upon deactivation
125
- * Fix: Code script attributes stripped from default code block
126
- * Fix: Updated plugin help links
127
- * Fix: Italian language files not loading properly
128
-
129
- = 1.14.0 =
130
- * New: i18 support
131
- * New: Polylang support
132
- * Fix: Multiple classes no longer being added to script tags
133
- * Fix: Buffering action hooks adjustments
134
- * General rewrite using WordPress coding standards
135
- * Turned into OOP
136
-
137
- = 1.11.1 =
138
- * New: Created a new option that disables the plugin on RSS feeds
139
- * New: Improved the control that checks if the request content type is HTML
140
- * Fixed an issue with the banner script
141
- * Fixed a series of conflicts with UTF-8 special characters caused by the experimental parsing engine
142
-
143
- = 1.11.0 =
144
- * New: Introduced a MUCH FASTER experimental parsing engine (visit the plugin options and select the experimental parsing engine)
145
- * New: Created a new option that allow users to enable/disable the parsing engine and to select the parsing engine between stable and experimental
146
- * New: Created a new option that filters the output buffer level to get only the first level ()
147
- * Fixed a series of conflicts with AJAX requests, which were conflicting with Contact Form 7, BackWPUp and other plugins
148
- * Added filter that only activates the plugin when the Content Type is text/html, enabled by default
149
- * Loads of bug fixes and speed improvements
150
-
151
- = 1.10.21 =
152
- * Rolling back to 1.10.11
153
-
154
- = 1.10.20 =
155
- * Hotfix: moved "is_user_logged_in" method control after the “template_redirect” hook.
156
-
157
- = 1.10.19 =
158
- * Fixed a series of conflicts with AJAX requests, which were conflicting with Contact Form 7 and other plugins
159
-
160
- = 1.10.18 =
161
- * More bugs fixed
162
- * The content-type restriction option is now on by default
163
-
164
- = 1.10.17 =
165
- * Added filter that only activates the plugin when the Content Type is text/html
166
- * Loads of bug fixes and speed improvements
167
-
168
- = 1.10.11 =
169
- * iub_no_parse parameter reintroduced
170
- * added XMLRPC control
171
-
172
- = 1.10.10 =
173
- * French and Portuguese languages fixed when used with WPML
174
-
175
- = 1.10.9 =
176
- * Further bugfixing
177
-
178
- = 1.10.9 =
179
- * Further bugfixing
180
-
181
- = 1.10.8 =
182
- * Fixed problems with WPML and with using the shortcode
183
-
184
- = 1.10.7 =
185
- * Further work on resolving any conflicts with other plugins
186
- * Fixed a problem with the Media library
187
-
188
- = 1.10.5 =
189
- * Reverting the parsing method to 1.9.19, slower but more stable
190
-
191
- = 1.10.4 =
192
- * Fixed compatibility with the Yoast SEO plugin (and possibly others)
193
- * Fixed preference saving after update from 1.9.19
194
-
195
- = 1.10.3 =
196
- * Fixed the WPML activation, which now detects the language of the embedding code and places it in the right tab
197
- * The first tab when WPML is activated is now activated automatically
198
- * The iubenda shortcode has been improved to be more flexible
199
-
200
- = 1.10.2 =
201
- * Fixed an encoding issue
202
-
203
- = 1.10.1 =
204
- * Fixed a bug that forced users to re-insert their cookie law code
205
-
206
- = 1.10.0 =
207
- * New: Multi-language support with WPML integration
208
- * New: AdSense auto-matching/blocking has been redone and now works properly
209
- * New: Addthis and Sharethis are now also automatically blocked
210
- * Loads of small fixes and improvements
211
-
212
- = 1.9.28 =
213
- * Fixed some bugs about i18n, created .pot files for translations. Now is true i18n friendly. Tested.
214
-
215
- = 1.9.27 =
216
- * i18n friendly
217
-
218
- = 1.9.26 =
219
- * Associate cookie policy for installation before/after WPML
220
-
221
- = 1.9.25 =
222
- * Hiding E_NOTICE messages
223
-
224
- = 1.9.24 =
225
- * skip parsing if XML-RPC request
226
- * skip parsing if is admin page
227
- * added multilanguage
228
-
229
- = 1.9.19 =
230
- * new iframe src according to the new doc
231
-
232
- = 1.9.18 =
233
- * bug on all iframe, suppressedsrc is not null anymore
234
-
235
- = 1.9.17 =
236
- * added another url of google maps embed
237
-
238
- = 1.9.16 =
239
- * skip parsing page if bot/crawler + added checkbox to autoparse (or not) the page if the user have already given the consent
240
-
241
- = 1.9.15 =
242
- * include bug + google maps
243
-
244
- = 1.9.14 =
245
- * Autoconvert iframe vimeo + facebook likebox
246
-
247
- = 1.9.13 =
248
- * Now the plugin use iubenda.class.php + fix bug on it.
249
-
250
- = 1.9.12 =
251
- * Add iub__no_parse get parameter to skip parsing page
252
-
253
- = 1.9.11 =
254
- * Add iub__no_parse get parameter to skip parsing page
255
-
256
- = 1.9.10 =
257
- * Another adsense script blocked, another fix on simple html dom
258
-
259
- = 1.9.9 =
260
- * Bugs page 60000 chars
261
-
262
- = 1.9.8 =
263
- * Added Google Maps & Google Adsense + better shortcode handling
264
-
265
- = 1.9.7 =
266
- * minor bugfix
267
-
268
- = 1.9.6 =
269
- * bugfix: custom banner now allowed
270
-
271
- = 1.9.5 =
272
- * no refresh page needed to activate scripts inside IUB tags.
273
-
274
- = 1.9.4 =
275
- * wp-admin blank page bug fix
276
-
277
- = 1.9.3 =
278
- * G+ platform bug, typo: _iub_cs_activate_inline vs _iub_cs_activate-inline
279
-
280
- = 1.9.2 =
281
- * G+ platform bug
282
-
283
- = 1.9.1 =
284
- * Minor improvements
285
-
286
- = 1.9 =
287
- * Improved parsing without regex
288
- * No parsing if the user have already given the consent
289
-
290
- = 1.0 =
291
- * First plugin version.
292
-
293
- == Upgrade Notice ==
294
-
295
- = 1.14.1 =
296
- * New: Option to delete all plugin data upon deactivation
297
- * Fix: Code script attributes stripped from default code block
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.2
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
22
+ * It detects bots/spiders and serves them a clean page
23
+
24
+ **The plugin is currently capable of automatically detecting and blocking the following scripts:**
25
+
26
+ * Facebook widgets
27
+ * Twitter widgets
28
+ * Google+ widgets
29
+ * Google AdSense
30
+ * YouTube widgets
31
+ * AddThis widgets
32
+ * ShareThis widgets
33
+ * Google Maps widgets
34
+
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
+
42
+ * English
43
+ * Italian
44
+ * French
45
+ * Spanish
46
+ * Portuguese (Brazilian)
47
+ * German
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];
59
+ if (d.getElementById(id)) return;
60
+ js = d.createElement(s); js.id = id;
61
+ js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=808061959224601";
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 ==
105
+
106
+ **Where can I find help?**
107
+ You can find a dedicated support forum thread here [Uservoice forum](http://support.iubenda.com/forums/314835-general/suggestions/9670701-discussion-regarding-the-iubenda-cookie-law-soluti) or we're happy to answer at info@iubenda.com.
108
+
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
115
+ 2. When clicking on the cookie policy link, the user gets a view of the entire cookie policy, where they ultimately can give their consent
116
+ 3. It's as simple as copy-pasting the code from iubenda into the plugin form.
117
+
118
+ == Changelog ==
119
+
120
+ = 1.14.2 =
121
+ * New: Option to enqueue scripts in header or footer
122
+
123
+ = 1.14.1 =
124
+ * New: Option to delete all plugin data upon deactivation
125
+ * Fix: Code script attributes stripped from default code block
126
+ * Fix: Updated plugin help links
127
+ * Fix: Italian language files not loading properly
128
+
129
+ = 1.14.0 =
130
+ * New: i18 support
131
+ * New: Polylang support
132
+ * Fix: Multiple classes no longer being added to script tags
133
+ * Fix: Buffering action hooks adjustments
134
+ * General rewrite using WordPress coding standards
135
+ * Turned into OOP
136
+
137
+ = 1.11.1 =
138
+ * New: Created a new option that disables the plugin on RSS feeds
139
+ * New: Improved the control that checks if the request content type is HTML
140
+ * Fixed an issue with the banner script
141
+ * Fixed a series of conflicts with UTF-8 special characters caused by the experimental parsing engine
142
+
143
+ = 1.11.0 =
144
+ * New: Introduced a MUCH FASTER experimental parsing engine (visit the plugin options and select the experimental parsing engine)
145
+ * New: Created a new option that allow users to enable/disable the parsing engine and to select the parsing engine between stable and experimental
146
+ * New: Created a new option that filters the output buffer level to get only the first level ()
147
+ * Fixed a series of conflicts with AJAX requests, which were conflicting with Contact Form 7, BackWPUp and other plugins
148
+ * Added filter that only activates the plugin when the Content Type is text/html, enabled by default
149
+ * Loads of bug fixes and speed improvements
150
+
151
+ = 1.10.21 =
152
+ * Rolling back to 1.10.11
153
+
154
+ = 1.10.20 =
155
+ * Hotfix: moved "is_user_logged_in" method control after the “template_redirect” hook.
156
+
157
+ = 1.10.19 =
158
+ * Fixed a series of conflicts with AJAX requests, which were conflicting with Contact Form 7 and other plugins
159
+
160
+ = 1.10.18 =
161
+ * More bugs fixed
162
+ * The content-type restriction option is now on by default
163
+
164
+ = 1.10.17 =
165
+ * Added filter that only activates the plugin when the Content Type is text/html
166
+ * Loads of bug fixes and speed improvements
167
+
168
+ = 1.10.11 =
169
+ * iub_no_parse parameter reintroduced
170
+ * added XMLRPC control
171
+
172
+ = 1.10.10 =
173
+ * French and Portuguese languages fixed when used with WPML
174
+
175
+ = 1.10.9 =
176
+ * Further bugfixing
177
+
178
+ = 1.10.9 =
179
+ * Further bugfixing
180
+
181
+ = 1.10.8 =
182
+ * Fixed problems with WPML and with using the shortcode
183
+
184
+ = 1.10.7 =
185
+ * Further work on resolving any conflicts with other plugins
186
+ * Fixed a problem with the Media library
187
+
188
+ = 1.10.5 =
189
+ * Reverting the parsing method to 1.9.19, slower but more stable
190
+
191
+ = 1.10.4 =
192
+ * Fixed compatibility with the Yoast SEO plugin (and possibly others)
193
+ * Fixed preference saving after update from 1.9.19
194
+
195
+ = 1.10.3 =
196
+ * Fixed the WPML activation, which now detects the language of the embedding code and places it in the right tab
197
+ * The first tab when WPML is activated is now activated automatically
198
+ * The iubenda shortcode has been improved to be more flexible
199
+
200
+ = 1.10.2 =
201
+ * Fixed an encoding issue
202
+
203
+ = 1.10.1 =
204
+ * Fixed a bug that forced users to re-insert their cookie law code
205
+
206
+ = 1.10.0 =
207
+ * New: Multi-language support with WPML integration
208
+ * New: AdSense auto-matching/blocking has been redone and now works properly
209
+ * New: Addthis and Sharethis are now also automatically blocked
210
+ * Loads of small fixes and improvements
211
+
212
+ = 1.9.28 =
213
+ * Fixed some bugs about i18n, created .pot files for translations. Now is true i18n friendly. Tested.
214
+
215
+ = 1.9.27 =
216
+ * i18n friendly
217
+
218
+ = 1.9.26 =
219
+ * Associate cookie policy for installation before/after WPML
220
+
221
+ = 1.9.25 =
222
+ * Hiding E_NOTICE messages
223
+
224
+ = 1.9.24 =
225
+ * skip parsing if XML-RPC request
226
+ * skip parsing if is admin page
227
+ * added multilanguage
228
+
229
+ = 1.9.19 =
230
+ * new iframe src according to the new doc
231
+
232
+ = 1.9.18 =
233
+ * bug on all iframe, suppressedsrc is not null anymore
234
+
235
+ = 1.9.17 =
236
+ * added another url of google maps embed
237
+
238
+ = 1.9.16 =
239
+ * skip parsing page if bot/crawler + added checkbox to autoparse (or not) the page if the user have already given the consent
240
+
241
+ = 1.9.15 =
242
+ * include bug + google maps
243
+
244
+ = 1.9.14 =
245
+ * Autoconvert iframe vimeo + facebook likebox
246
+
247
+ = 1.9.13 =
248
+ * Now the plugin use iubenda.class.php + fix bug on it.
249
+
250
+ = 1.9.12 =
251
+ * Add iub__no_parse get parameter to skip parsing page
252
+
253
+ = 1.9.11 =
254
+ * Add iub__no_parse get parameter to skip parsing page
255
+
256
+ = 1.9.10 =
257
+ * Another adsense script blocked, another fix on simple html dom
258
+
259
+ = 1.9.9 =
260
+ * Bugs page 60000 chars
261
+
262
+ = 1.9.8 =
263
+ * Added Google Maps & Google Adsense + better shortcode handling
264
+
265
+ = 1.9.7 =
266
+ * minor bugfix
267
+
268
+ = 1.9.6 =
269
+ * bugfix: custom banner now allowed
270
+
271
+ = 1.9.5 =
272
+ * no refresh page needed to activate scripts inside IUB tags.
273
+
274
+ = 1.9.4 =
275
+ * wp-admin blank page bug fix
276
+
277
+ = 1.9.3 =
278
+ * G+ platform bug, typo: _iub_cs_activate_inline vs _iub_cs_activate-inline
279
+
280
+ = 1.9.2 =
281
+ * G+ platform bug
282
+
283
+ = 1.9.1 =
284
+ * Minor improvements
285
+
286
+ = 1.9 =
287
+ * Improved parsing without regex
288
+ * No parsing if the user have already given the consent
289
+
290
+ = 1.0 =
291
+ * First plugin version.
292
+
293
+ == Upgrade Notice ==
294
+
295
+ = 1.14.2 =
296
+ * New: Option to enqueue scripts in header or footer