iubenda Cookie Solution for GDPR - Version 2.3.9

Version Description

  • Fix: Woocommerce custom theme support
  • Fix: Detect changes on WPforms
Download this release

Release Info

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

Code changes from version 2.3.8 to 2.3.9

Files changed (3) hide show
  1. includes/forms.php +51 -3
  2. iubenda_cookie_solution.php +1 -2
  3. readme.txt +4 -0
includes/forms.php CHANGED
@@ -462,9 +462,15 @@ class iubenda_Forms {
462
  if ( $result )
463
  $new_forms['new'] = $result;
464
  } else {
465
- // check for fields changes
466
- $new_fields = array_merge( array_diff( $formdata['form_fields'], $exists->form_fields ), array_diff( $exists->form_fields, $formdata['form_fields'] ) );
467
-
 
 
 
 
 
 
468
  if ( $new_fields ) {
469
  $new_forms['updated'] = $exists->ID;
470
 
@@ -714,6 +720,14 @@ class iubenda_Forms {
714
  // Create an abstract order
715
  WC()->order = new WC_Order;
716
 
 
 
 
 
 
 
 
 
717
  wc_get_template(
718
  'checkout/form-checkout.php', array(
719
  'checkout' => WC()->checkout()
@@ -780,6 +794,12 @@ class iubenda_Forms {
780
 
781
  // Simple HTML Dom parser
782
  } else {
 
 
 
 
 
 
783
  $html = str_get_html( $checkout_form, $lowercase = true, $force_tags_closed = true, $strip = false );
784
 
785
  if ( is_object( $html ) ) {
@@ -895,6 +915,12 @@ class iubenda_Forms {
895
 
896
  // Simple HTML Dom parser
897
  } else {
 
 
 
 
 
 
898
  $html = str_get_html( $comment_form, $lowercase = true, $force_tags_closed = true, $strip = false );
899
 
900
  if ( is_object( $html ) ) {
@@ -966,4 +992,26 @@ class iubenda_Forms {
966
  return $form;
967
  }
968
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
969
  }
462
  if ( $result )
463
  $new_forms['new'] = $result;
464
  } else {
465
+ // Is multi dimensions array
466
+ // Check if the existing form fields is not equal the new form fields
467
+ if ( is_array( current( $formdata['form_fields'] ) ) ) {
468
+ $new_fields = md5( json_encode( $this->array_dot( $formdata['form_fields'] ) ) ) !== md5( json_encode( $this->array_dot( $exists->form_fields ) ) );
469
+ }else{
470
+ // check for fields changes
471
+ $new_fields = array_merge( array_diff( $formdata['form_fields'], $exists->form_fields ), array_diff( $exists->form_fields, $formdata['form_fields'] ) );
472
+ }
473
+
474
  if ( $new_fields ) {
475
  $new_forms['updated'] = $exists->ID;
476
 
720
  // Create an abstract order
721
  WC()->order = new WC_Order;
722
 
723
+ /**
724
+ * Load notice function to be compatible with custom themes
725
+ * that request notice functions in templates
726
+ */
727
+ if ( file_exists( WC_ABSPATH . 'includes/wc-notice-functions.php' ) ) {
728
+ include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
729
+ }
730
+
731
  wc_get_template(
732
  'checkout/form-checkout.php', array(
733
  'checkout' => WC()->checkout()
794
 
795
  // Simple HTML Dom parser
796
  } else {
797
+
798
+ // Ensure helper class were loaded
799
+ if ( ! function_exists( 'str_get_html' ) ) {
800
+ require_once( IUBENDA_PLUGIN_PATH . 'iubenda-cookie-class/simple_html_dom.php' );
801
+ }
802
+
803
  $html = str_get_html( $checkout_form, $lowercase = true, $force_tags_closed = true, $strip = false );
804
 
805
  if ( is_object( $html ) ) {
915
 
916
  // Simple HTML Dom parser
917
  } else {
918
+
919
+ // Ensure helper class were loaded
920
+ if ( ! function_exists( 'str_get_html' ) ) {
921
+ require_once( IUBENDA_PLUGIN_PATH . 'iubenda-cookie-class/simple_html_dom.php' );
922
+ }
923
+
924
  $html = str_get_html( $comment_form, $lowercase = true, $force_tags_closed = true, $strip = false );
925
 
926
  if ( is_object( $html ) ) {
992
  return $form;
993
  }
994
 
995
+ /**
996
+ * Convert nested array into one level
997
+ *
998
+ * @param $array
999
+ * @param string $prepend
1000
+ *
1001
+ * @return array
1002
+ */
1003
+ public function array_dot( $array, $prepend = '' ) {
1004
+ $results = array();
1005
+
1006
+ foreach ( $array as $key => $value ) {
1007
+ if ( is_array( $value ) && ! empty( $value ) ) {
1008
+ $results = array_merge( $results, $this->array_dot( $value, $prepend . $key . '.' ) );
1009
+ } else {
1010
+ $results[ $prepend . $key ] = $value;
1011
+ }
1012
+ }
1013
+
1014
+ return $results;
1015
+ }
1016
+
1017
  }
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.3.8
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
@@ -43,7 +43,6 @@ class iubenda {
43
  'parse' => false, // iubenda_parse
44
  'skip_parsing' => true, // skip_parsing
45
  'ctype' => true, // iubenda_ctype
46
- 'parse' => false, // iubenda_parse
47
  'parser_engine' => 'new', // parser_engine
48
  'output_feed' => true, // iubenda_output_feed
49
  'output_post' => true,
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.3.9
7
  Author: iubenda
8
  Author URI: https://www.iubenda.com
9
  License: MIT License
43
  'parse' => false, // iubenda_parse
44
  'skip_parsing' => true, // skip_parsing
45
  'ctype' => true, // iubenda_ctype
 
46
  'parser_engine' => 'new', // parser_engine
47
  'output_feed' => true, // iubenda_output_feed
48
  'output_post' => true,
readme.txt CHANGED
@@ -150,6 +150,10 @@ We will be very happy to receive feedback here: [Uservoice forum](https://suppor
150
 
151
  == Changelog ==
152
 
 
 
 
 
153
  = 2.3.8 =
154
  * Tweak: Add Google GPT to per-purpose blocking support
155
  * Fix: admin.js ready method deprecation
150
 
151
  == Changelog ==
152
 
153
+ = 2.3.9 =
154
+ * Fix: Woocommerce custom theme support
155
+ * Fix: Detect changes on WPforms
156
+
157
  = 2.3.8 =
158
  * Tweak: Add Google GPT to per-purpose blocking support
159
  * Fix: admin.js ready method deprecation