iubenda Cookie Solution for GDPR - Version 2.0.1

Version Description

  • New: Jetpack tracking blocking
  • Fix: add_submenu_page and add_menu_page called incorrectly in WP 5.3
Download this release

Release Info

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

Code changes from version 2.0.0 to 2.0.1

includes/settings.php CHANGED
@@ -161,12 +161,12 @@ class iubenda_Settings {
161
  if ( iubenda()->options['cs']['menu_position'] === 'submenu' ) {
162
  // sub menu
163
  add_submenu_page(
164
- 'options-general.php', 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' ), 'none'
165
  );
166
  } else {
167
  // top menu
168
  add_menu_page(
169
- 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' ), 'none'
170
  );
171
  add_submenu_page( 'iubenda', __( 'Cookie Solution', 'iubenda' ), __( 'Cookie Solution', 'iubenda' ), apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' ) );
172
  add_submenu_page( 'iubenda', __( 'Consent Solution', 'iubenda' ), __( 'Consent Solution', 'iubenda' ), apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda&tab=cons', array( $this, 'options_page' ) );
161
  if ( iubenda()->options['cs']['menu_position'] === 'submenu' ) {
162
  // sub menu
163
  add_submenu_page(
164
+ 'options-general.php', 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' )
165
  );
166
  } else {
167
  // top menu
168
  add_menu_page(
169
+ 'iubenda', 'iubenda', apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' )
170
  );
171
  add_submenu_page( 'iubenda', __( 'Cookie Solution', 'iubenda' ), __( 'Cookie Solution', 'iubenda' ), apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda', array( $this, 'options_page' ) );
172
  add_submenu_page( 'iubenda', __( 'Consent Solution', 'iubenda' ), __( 'Consent Solution', 'iubenda' ), apply_filters( 'iubenda_cookie_law_cap', 'manage_options' ), 'iubenda&tab=cons', array( $this, 'options_page' ) );
iubenda_cookie_solution.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: Cookie and Consent Solution for the GDPR & ePrivacy by iubenda
4
  Plugin URI: https://www.iubenda.com
5
  Description: An All-in-One approach developed by iubenda, which includes functionalities of two powerful solutions that help to make your website GDPR and ePrivacy compliant.
6
- Version: 2.0.0
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
@@ -11,7 +11,7 @@ License URI: http://opensource.org/licenses/MIT
11
  Text Domain: iubenda
12
  Domain Path: /languages
13
 
14
- Cookie and Consent Solution for the GDPR & ePrivacy by iubenda
15
  Copyright (C) 2018-2019, 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:
@@ -32,7 +32,7 @@ define( 'IUB_DEBUG', false );
32
  * iubenda final class.
33
  *
34
  * @class iubenda
35
- * @version 2.0.0
36
  */
37
  class iubenda {
38
 
@@ -58,7 +58,7 @@ class iubenda {
58
  )
59
  );
60
  public $base_url;
61
- public $version = '2.0.0';
62
  public $no_html = false;
63
  public $multilang = false;
64
  public $languages = array();
@@ -118,6 +118,7 @@ class iubenda {
118
  // add_action( 'wp_footer', array( $this, 'wp_footer_cons' ), 1 );
119
  add_action( 'template_redirect', array( $this, 'output_start' ), 0 );
120
  add_action( 'shutdown', array( $this, 'output_end' ), 100 );
 
121
  }
122
 
123
  /**
@@ -326,13 +327,13 @@ class iubenda {
326
  */
327
  public function wp_head_cons() {
328
  if ( ! empty( $this->options['cons']['public_api_key'] ) ) {
329
-
330
  $parameters = apply_filters( 'iubenda_cons_init_parameters', array(
331
  'log_level' => 'error',
332
  'logger' => 'console',
333
  'send_from_local' => true
334
  ) );
335
-
336
  echo '<!-- Library initialization -->
337
  <script type="text/javascript">
338
  var _iub = _iub || { };
@@ -444,7 +445,7 @@ class iubenda {
444
  // bail if consent given and skip parsing enabled
445
  if ( iubendaParser::consent_given() && $this->options['cs']['skip_parsing'] )
446
  return $output;
447
-
448
  // bail on POST request
449
  if ( $_POST && $this->options['cs']['output_post'] )
450
  return $output;
@@ -457,6 +458,10 @@ class iubenda {
457
  if ( class_exists( 'WPCF7' ) && (int) WPCF7::get_option( 'iqfix_recaptcha' ) === 0 && ! iubendaParser::consent_given() )
458
  $this->options['cs']['custom_scripts'][] = 'grecaptcha';
459
 
 
 
 
 
460
  $startime = microtime( true );
461
  $output = apply_filters( 'iubenda_initial_output', $output );
462
 
@@ -517,6 +522,34 @@ class iubenda {
517
  return $source;
518
  }
519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  /**
521
  * Get allowed iubenda script HTML.
522
  *
1
  <?php
2
  /*
3
+ Plugin Name: Cookie and Consent Solution for the GDPR & ePrivacy
4
  Plugin URI: https://www.iubenda.com
5
  Description: An All-in-One approach developed by iubenda, which includes functionalities of two powerful solutions that help to make your website GDPR and ePrivacy compliant.
6
+ Version: 2.0.1
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
11
  Text Domain: iubenda
12
  Domain Path: /languages
13
 
14
+ Cookie and Consent Solution for the GDPR & ePrivacy
15
  Copyright (C) 2018-2019, 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:
32
  * iubenda final class.
33
  *
34
  * @class iubenda
35
+ * @version 2.0.1
36
  */
37
  class iubenda {
38
 
58
  )
59
  );
60
  public $base_url;
61
+ public $version = '2.0.1';
62
  public $no_html = false;
63
  public $multilang = false;
64
  public $languages = array();
118
  // add_action( 'wp_footer', array( $this, 'wp_footer_cons' ), 1 );
119
  add_action( 'template_redirect', array( $this, 'output_start' ), 0 );
120
  add_action( 'shutdown', array( $this, 'output_end' ), 100 );
121
+ add_action( 'template_redirect', array( $this, 'disable_jetpack_tracking' ) );
122
  }
123
 
124
  /**
327
  */
328
  public function wp_head_cons() {
329
  if ( ! empty( $this->options['cons']['public_api_key'] ) ) {
330
+
331
  $parameters = apply_filters( 'iubenda_cons_init_parameters', array(
332
  'log_level' => 'error',
333
  'logger' => 'console',
334
  'send_from_local' => true
335
  ) );
336
+
337
  echo '<!-- Library initialization -->
338
  <script type="text/javascript">
339
  var _iub = _iub || { };
445
  // bail if consent given and skip parsing enabled
446
  if ( iubendaParser::consent_given() && $this->options['cs']['skip_parsing'] )
447
  return $output;
448
+
449
  // bail on POST request
450
  if ( $_POST && $this->options['cs']['output_post'] )
451
  return $output;
458
  if ( class_exists( 'WPCF7' ) && (int) WPCF7::get_option( 'iqfix_recaptcha' ) === 0 && ! iubendaParser::consent_given() )
459
  $this->options['cs']['custom_scripts'][] = 'grecaptcha';
460
 
461
+ // Jetpack compatibility
462
+ if ( class_exists( 'Jetpack' ) )
463
+ $this->options['cs']['custom_scripts'][] = 'stats.wp.com';
464
+
465
  $startime = microtime( true );
466
  $output = apply_filters( 'iubenda_initial_output', $output );
467
 
522
  return $source;
523
  }
524
 
525
+ /**
526
+ * Disable Jetpack tracking on AMO cached pages.
527
+ *
528
+ * @return void
529
+ */
530
+ public function disable_jetpack_tracking() {
531
+ // bail no Jetpack active
532
+ if ( ! class_exists( 'Jetpack' ) )
533
+ return;
534
+
535
+ // disable if it's not AMP cached request
536
+ if ( ! Jetpack_AMP_Support::is_amp_request() )
537
+ return;
538
+
539
+ // if ( is_feed() || is_robots() || is_trackback() || is_preview() || jetpack_is_dnt_enabled() )
540
+
541
+ // bail if skripts blocking disabled
542
+ if ( ! $this->options['cs']['parse'] )
543
+ return;
544
+
545
+ // bail if consent given and skip parsing enabled
546
+ if ( iubendaParser::consent_given() && $this->options['cs']['skip_parsing'] )
547
+ return;
548
+
549
+ remove_action( 'wp_head', 'stats_add_shutdown_action' );
550
+ remove_action( 'wp_footer', 'stats_footer', 101 );
551
+ }
552
+
553
  /**
554
  * Get allowed iubenda script HTML.
555
  *
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Cookie and Consent Solution for the GDPR & ePrivacy by iubenda ===
2
  Contributors: iubenda
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, privacy policy, cookie consent, privacy, gdpr, eprivacy
5
  Requires at least: 4.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.3
8
- Stable tag: 2.0.0
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
@@ -134,6 +134,10 @@ We will be very happy to receive feedback here: [Uservoice forum](http://support
134
 
135
  == Changelog ==
136
 
 
 
 
 
137
  = 2.0.0 =
138
  * New: Introducing iubenda Consent Solution integration
139
  * Tweak: Simple HTML Dom update to 1.9
@@ -369,6 +373,5 @@ We will be very happy to receive feedback here: [Uservoice forum](http://support
369
 
370
  == Upgrade Notice ==
371
 
372
- = 2.0.0 =
373
- * New: Introducing iubenda Consent Solution integration
374
- * Tweak: Simple HTML Dom update to 1.9
1
+ === Cookie and Consent Solution for the GDPR & ePrivacy ===
2
  Contributors: iubenda
3
  Donate link:
4
  Tags: cookies, cookie law, cookie policy, cookie banner, privacy policy, cookie consent, privacy, gdpr, eprivacy
5
  Requires at least: 4.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.3
8
+ Stable tag: 2.0.1
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
134
 
135
  == Changelog ==
136
 
137
+ = 2.0.1 =
138
+ * New: Jetpack tracking blocking
139
+ * Fix: add_submenu_page and add_menu_page called incorrectly in WP 5.3
140
+
141
  = 2.0.0 =
142
  * New: Introducing iubenda Consent Solution integration
143
  * Tweak: Simple HTML Dom update to 1.9
373
 
374
  == Upgrade Notice ==
375
 
376
+ = 2.0.1 =
377
+ * New: Jetpack tracking blocking