DuracellTomi's Google Tag Manager for WordPress - Version 1.11.1

Version Description

WARNING! If you are upgrading directly from v1.10.x, please read the changelog of v1.11 since it includes many important notices!

  • Fixed: PHP notice about undefined order_items variable if the new 'Order data in data layer' is turned off
  • Fixed: PHP notice about missing brand array key if no brand taxonomy is selected in GTM4WP options
Download this release

Release Info

Developer duracelltomi
Plugin Icon 128x128 DuracellTomi's Google Tag Manager for WordPress
Version 1.11.1
Comparing to
See all releases

Code changes from version 1.11 to 1.11.1

duracelltomi-google-tag-manager-for-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
- Version: 1.11
5
  Plugin URI: https://gtm4wp.com/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
@@ -13,7 +13,7 @@ WC requires at least: 2.6
13
  WC tested up to: 3.8
14
  */
15
 
16
- define( 'GTM4WP_VERSION', '1.11' );
17
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
18
 
19
  global $gtp4wp_plugin_url, $gtp4wp_plugin_basename;
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
+ Version: 1.11.1
5
  Plugin URI: https://gtm4wp.com/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
13
  WC tested up to: 3.8
14
  */
15
 
16
+ define( 'GTM4WP_VERSION', '1.11.1' );
17
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
18
 
19
  global $gtp4wp_plugin_url, $gtp4wp_plugin_basename;
integration/woocommerce.php CHANGED
@@ -542,7 +542,7 @@ function gtm4wp_woocommerce_datalayer_filter_items( $dataLayer ) {
542
  );
543
  }
544
 
545
- if ( ! $order_items ) {
546
  $order_items = gtm4wp_process_order_items( $order );
547
  }
548
 
@@ -683,6 +683,10 @@ function gtm4wp_woocommerce_cart_item_remove_link_filter( $remove_from_cart_link
683
  $GLOBALS['gtm4wp_cart_item_proddata']['variant'] = '';
684
  }
685
 
 
 
 
 
686
  $cartlink_with_data = sprintf(
687
  'data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_variant="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s" href="',
688
  esc_attr( $GLOBALS['gtm4wp_cart_item_proddata']['id'] ),
@@ -746,6 +750,10 @@ function gtm4wp_woocommerce_after_template_part( $template_name ) {
746
  'listposition' => $gtm4wp_product_counter
747
  ), 'widgetproduct' );
748
 
 
 
 
 
749
  $productlink_with_data = sprintf(
750
  'data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s" href="',
751
  esc_attr( $eec_product_array['id'] ),
@@ -854,6 +862,10 @@ function gtm4wp_woocommerce_before_shop_loop_item() {
854
  'listposition' => $woocommerce_loop['loop'] + ( $posts_per_page * ( $paged - 1 ) )
855
  ), 'productlist' );
856
 
 
 
 
 
857
  printf(
858
  '<span class="gtm4wp_productdata" style="display:none; visibility:hidden;" data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s"></span>',
859
  esc_attr( $eec_product_array['id'] ),
@@ -967,6 +979,10 @@ function gtm4wp_woocommerce_grouped_product_list_column_label( $labelvalue, $pro
967
 
968
  $gtm4wp_grouped_product_ix++;
969
 
 
 
 
 
970
  $labelvalue .=
971
  sprintf(
972
  '<span class="gtm4wp_productdata" style="display:none; visibility:hidden;" data-gtm4wp_product_id="%s" data-gtm4wp_product_sku="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s"></span>',
542
  );
543
  }
544
 
545
+ if ( ! isset( $order_items ) ) {
546
  $order_items = gtm4wp_process_order_items( $order );
547
  }
548
 
683
  $GLOBALS['gtm4wp_cart_item_proddata']['variant'] = '';
684
  }
685
 
686
+ if ( ! isset( $GLOBALS['gtm4wp_cart_item_proddata']['brand'] ) ) {
687
+ $GLOBALS['gtm4wp_cart_item_proddata']['brand'] = '';
688
+ }
689
+
690
  $cartlink_with_data = sprintf(
691
  'data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_variant="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s" href="',
692
  esc_attr( $GLOBALS['gtm4wp_cart_item_proddata']['id'] ),
750
  'listposition' => $gtm4wp_product_counter
751
  ), 'widgetproduct' );
752
 
753
+ if ( ! isset( $eec_product_array[ 'brand' ] ) ) {
754
+ $eec_product_array[ 'brand' ] = '';
755
+ }
756
+
757
  $productlink_with_data = sprintf(
758
  'data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s" href="',
759
  esc_attr( $eec_product_array['id'] ),
862
  'listposition' => $woocommerce_loop['loop'] + ( $posts_per_page * ( $paged - 1 ) )
863
  ), 'productlist' );
864
 
865
+ if ( ! isset( $eec_product_array[ 'brand' ] ) ) {
866
+ $eec_product_array[ 'brand' ] = '';
867
+ }
868
+
869
  printf(
870
  '<span class="gtm4wp_productdata" style="display:none; visibility:hidden;" data-gtm4wp_product_id="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s"></span>',
871
  esc_attr( $eec_product_array['id'] ),
979
 
980
  $gtm4wp_grouped_product_ix++;
981
 
982
+ if ( ! isset( $eec_product_array[ 'brand' ] ) ) {
983
+ $eec_product_array[ 'brand' ] = '';
984
+ }
985
+
986
  $labelvalue .=
987
  sprintf(
988
  '<span class="gtm4wp_productdata" style="display:none; visibility:hidden;" data-gtm4wp_product_id="%s" data-gtm4wp_product_sku="%s" data-gtm4wp_product_name="%s" data-gtm4wp_product_price="%s" data-gtm4wp_product_cat="%s" data-gtm4wp_product_url="%s" data-gtm4wp_product_listposition="%s" data-gtm4wp_productlist_name="%s" data-gtm4wp_product_stocklevel="%s" data-gtm4wp_product_brand="%s"></span>',
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, goo
5
  Requires at least: 3.4.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.2.4
8
- Stable tag: 1.11
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl.html
11
 
@@ -258,6 +258,14 @@ If you or your social plugin inserts the Facebook buttons using IFRAMEs (like So
258
 
259
  == Changelog ==
260
 
 
 
 
 
 
 
 
 
261
  = 1.11 =
262
 
263
  WARNING!
@@ -637,6 +645,10 @@ Please report all bugs found in my plugin using the [contact form on my website]
637
 
638
  == Upgrade Notice ==
639
 
 
 
 
 
640
  = 1.11 =
641
 
642
  Please read the changelog very carefully as there are many important changes and removed features which could need your attention before updating!
5
  Requires at least: 3.4.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.2.4
8
+ Stable tag: 1.11.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl.html
11
 
258
 
259
  == Changelog ==
260
 
261
+ = 1.11.1 =
262
+
263
+ WARNING!
264
+ If you are upgrading directly from v1.10.x, please read the changelog of v1.11 since it includes many important notices!
265
+
266
+ * Fixed: PHP notice about undefined order_items variable if the new 'Order data in data layer' is turned off
267
+ * Fixed: PHP notice about missing brand array key if no brand taxonomy is selected in GTM4WP options
268
+
269
  = 1.11 =
270
 
271
  WARNING!
645
 
646
  == Upgrade Notice ==
647
 
648
+ = 1.11.1 =
649
+
650
+ WooCommerce integration related fixes.
651
+
652
  = 1.11 =
653
 
654
  Please read the changelog very carefully as there are many important changes and removed features which could need your attention before updating!