iubenda Cookie Solution for GDPR - Version 2.5.0

Version Description

  • Integrate with Mailchimp to add it in woo-commerce checkout form.
  • Stop parsing scripts in Divi page builder
Download this release

Release Info

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

Code changes from version 2.4.3 to 2.5.0

includes/forms.php CHANGED
@@ -24,6 +24,7 @@ class iubenda_Forms {
24
  add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
25
  // Save cons for non ajax forms
26
  add_action( 'wpforms_process_complete', array( $this, 'process_entry_for_wp_forms' ), 10, 4 );
 
27
  }
28
 
29
  /**
@@ -733,15 +734,29 @@ class iubenda_Forms {
733
  include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
734
  }
735
 
 
 
 
 
 
 
 
736
  wc_get_template(
737
  'checkout/form-checkout.php', array(
738
  'checkout' => WC()->checkout()
739
  )
740
  );
741
 
 
 
 
 
 
 
742
  wc_get_template(
743
  'checkout/form-pay.php', array(
744
- 'order' => WC()->order
 
745
  )
746
  );
747
 
@@ -1144,4 +1159,19 @@ class iubenda_Forms {
1144
 
1145
  return $data;
1146
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1147
  }
24
  add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
25
  // Save cons for non ajax forms
26
  add_action( 'wpforms_process_complete', array( $this, 'process_entry_for_wp_forms' ), 10, 4 );
27
+ add_filter( 'mc4wp_integration_woocommerce_checkbox_attributes', array( $this, 'mc4wp_integration_woocommerce_checkbox_attributes' ), 10, 2 );
28
  }
29
 
30
  /**
734
  include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
735
  }
736
 
737
+ /**
738
+ * Load cart function to be compatible to avoid fatal error on checkout page
739
+ */
740
+ if ( file_exists( WC_ABSPATH . 'includes/wc-cart-functions.php' ) ) {
741
+ include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
742
+ }
743
+
744
  wc_get_template(
745
  'checkout/form-checkout.php', array(
746
  'checkout' => WC()->checkout()
747
  )
748
  );
749
 
750
+ // Integrate with mailchimp
751
+ $mc_integration = get_option( 'mc4wp_integrations' );
752
+ if ( is_array( $mc_integration ) && '1' === $this->array_get( $mc_integration, 'woocommerce.enabled' ) ) {
753
+ do_action( 'woocommerce_review_order_before_submit' );
754
+ }
755
+
756
  wc_get_template(
757
  'checkout/form-pay.php', array(
758
+ 'order' => WC()->order,
759
+ 'order_button_text' => 'Submit',
760
  )
761
  );
762
 
1159
 
1160
  return $data;
1161
  }
1162
+
1163
+ /**
1164
+ * Integrate with mailchimp
1165
+ * Add Id attribute to add event on it from frontend
1166
+ *
1167
+ * @param $attributes
1168
+ * @param $integration
1169
+ *
1170
+ * @return string[]
1171
+ */
1172
+ public function mc4wp_integration_woocommerce_checkbox_attributes( $attributes, $integration ) {
1173
+ $attributes['id'] = '_mc4wp_subscribe_woocommerce';
1174
+
1175
+ return $attributes;
1176
+ }
1177
  }
iubenda_cookie_solution.php CHANGED
@@ -3,7 +3,7 @@
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.4.3
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
@@ -32,7 +32,7 @@ define( 'IUB_DEBUG', false );
32
  * iubenda final class.
33
  *
34
  * @class iubenda
35
- * @version 2.4.3
36
  */
37
  class iubenda {
38
 
@@ -62,7 +62,7 @@ class iubenda {
62
  )
63
  );
64
  public $base_url;
65
- public $version = '2.4.3';
66
  public $activation = array(
67
  'update_version' => 0,
68
  'update_notice' => true,
@@ -513,6 +513,11 @@ class iubenda {
513
  if ( iubendaParser::bot_detected() || $this->no_html )
514
  return $output;
515
 
 
 
 
 
 
516
  // google recaptcha v3 compatibility
517
  if ( class_exists( 'WPCF7' ) && (int) WPCF7::get_option( 'iqfix_recaptcha' ) === 0 && ! iubendaParser::consent_given() )
518
  $this->options['cs']['custom_scripts']['grecaptcha'] = 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.5.0
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
32
  * iubenda final class.
33
  *
34
  * @class iubenda
35
+ * @version 2.5.0
36
  */
37
  class iubenda {
38
 
62
  )
63
  );
64
  public $base_url;
65
+ public $version = '2.5.0';
66
  public $activation = array(
67
  'update_version' => 0,
68
  'update_notice' => true,
513
  if ( iubendaParser::bot_detected() || $this->no_html )
514
  return $output;
515
 
516
+ // bail if current page is page builder of Divi by elegant themes
517
+ if ( function_exists( 'et_fb_is_enabled' ) && et_fb_is_enabled() ) {
518
+ return $output;
519
+ }
520
+
521
  // google recaptcha v3 compatibility
522
  if ( class_exists( 'WPCF7' ) && (int) WPCF7::get_option( 'iqfix_recaptcha' ) === 0 && ! iubendaParser::consent_given() )
523
  $this->options['cs']['custom_scripts']['grecaptcha'] = 2;
js/frontend.js CHANGED
@@ -185,4 +185,19 @@
185
 
186
  } );
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  } )( jQuery );
185
 
186
  } );
187
 
188
+ // Integrate with mailchimp
189
+ // Remove the hidden input of mailchimp to avoid the duplicate while saving the cons
190
+ if ($('#_mc4wp_subscribe_woocommerce').length) {
191
+ $(window).load(function () {
192
+ var mc_subscribe_checkbox = $('#_mc4wp_subscribe_woocommerce')
193
+ mc_subscribe_checkbox.on('change', function (event) {
194
+ if (event.currentTarget.checked) {
195
+ $('input:hidden[name=_mc4wp_subscribe_woocommerce]').remove();
196
+ return;
197
+ }
198
+ mc_subscribe_checkbox.before('<input type="hidden" name="_mc4wp_subscribe_woocommerce" value="0">');
199
+ });
200
+ });
201
+ }
202
+
203
  } )( jQuery );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: cookies, cookie law, cookie policy, cookie banner, privacy policy, cookie
5
  Requires at least: 4.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.7.0
8
- Stable tag: 2.4.3
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
@@ -150,6 +150,10 @@ We will be very happy to receive feedback here: [Uservoice forum](https://suppor
150
 
151
  == Changelog ==
152
 
 
 
 
 
153
  = 2.4.3 =
154
  * Fix field mapping in Cons forms
155
 
@@ -508,5 +512,6 @@ We will be very happy to receive feedback here: [Uservoice forum](https://suppor
508
 
509
  == Upgrade Notice ==
510
 
511
- = 2.4.3 =
512
- * Fix field mapping in Cons forms
 
5
  Requires at least: 4.0
6
  Requires PHP: 5.2.4
7
  Tested up to: 5.7.0
8
+ Stable tag: 2.5.0
9
  License: MIT License
10
  License URI: http://opensource.org/licenses/MIT
11
 
150
 
151
  == Changelog ==
152
 
153
+ = 2.5.0 =
154
+ * Integrate with Mailchimp to add it in woo-commerce checkout form.
155
+ * Stop parsing scripts in Divi page builder
156
+
157
  = 2.4.3 =
158
  * Fix field mapping in Cons forms
159
 
512
 
513
  == Upgrade Notice ==
514
 
515
+ = 2.5.0 =
516
+ * Integrate with Mailchimp to add it in woo-commerce checkout form.
517
+ * Stop parsing scripts in Divi page builder