plugin updates

This commit is contained in:
Tony Volpe
2024-06-17 14:48:11 -04:00
parent ecc5fbf831
commit 3751a5a1a6
1318 changed files with 91130 additions and 52250 deletions

View File

@@ -1 +1 @@
<?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => 'd0d5ee1d86289188dd81');
<?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => 'b70e9845eca29be496f0');

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,14 @@
*** Changelog ***
= 2.1.1 - 2024-06-12 =
* Tweak - Confirm WC_Cart is available before formatting cart data.
* Tweak - WC 9.0 compatibility.
= 2.1.0 - 2024-06-05 =
* Add - Integration with the WP Consent API plugin.
* Fix - Add E2E tests for denying via WP Consent API.
* Tweak - Document WP Consent API support.
= 2.0.7 - 2024-05-14 =
* Dev - Add a manual workflow run for PHP unit tests.
* Fix - Apply discounts to the ecommerce event if available.

View File

@@ -176,6 +176,12 @@ abstract class WC_Abstract_Google_Analytics_JS {
* @return array
*/
public function get_formatted_cart(): array {
$cart = WC()->cart;
if ( is_null( $cart ) ) {
return array();
}
return array(
'items' => array_map(
function ( $item ) {
@@ -190,12 +196,12 @@ abstract class WC_Abstract_Google_Analytics_JS {
)
);
},
array_values( WC()->cart->get_cart() )
array_values( $cart->get_cart() )
),
'coupons' => WC()->cart->get_coupons(),
'coupons' => $cart->get_coupons(),
'totals' => array(
'currency_code' => get_woocommerce_currency(),
'total_price' => $this->get_formatted_price( WC()->cart->get_total( 'edit' ) ),
'total_price' => $this->get_formatted_price( $cart->get_total( 'edit' ) ),
'currency_minor_unit' => wc_get_price_decimals(),
),
);

View File

@@ -58,6 +58,9 @@ class WC_Google_Analytics extends WC_Integration {
// utm_nooverride parameter for Google AdWords
add_filter( 'woocommerce_get_return_url', array( $this, 'utm_nooverride' ) );
// Mark extension as compatible with WP Consent API
add_filter( 'wp_consent_api_registered_' . plugin_basename( __FILE__ ), '__return_true' );
// Dequeue the WooCommerce Blocks Google Analytics integration,
// not to let it register its `gtag` function so that we could provide a more detailed configuration.
add_action(

View File

@@ -94,7 +94,7 @@ class WC_Google_Gtag_JS extends WC_Abstract_Google_Analytics_JS {
function %2$s(){dataLayer.push(arguments);}
// Set up default consent state.
for ( const mode of %4$s || [] ) {
%2$s( "consent", "default", mode );
%2$s( "consent", "default", { "wait_for_update": 500, ...mode } );
}
%2$s("js", new Date());
%2$s("set", "developer_id.%3$s", true);

View File

@@ -3,7 +3,7 @@ Contributors: woocommerce, automattic, claudiosanches, bor0, royho, laurendaviss
Tags: woocommerce, google analytics
Requires at least: 6.2
Tested up to: 6.5
Stable tag: 2.0.7
Stable tag: 2.1.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -48,17 +48,19 @@ Duplicate Google Analytics code causes a conflict in tracking. Remove any other
== Changelog ==
= 2.1.1 - 2024-06-12 =
* Tweak - Confirm WC_Cart is available before formatting cart data.
* Tweak - WC 9.0 compatibility.
= 2.1.0 - 2024-06-05 =
* Add - Integration with the WP Consent API plugin.
* Fix - Add E2E tests for denying via WP Consent API.
* Tweak - Document WP Consent API support.
= 2.0.7 - 2024-05-14 =
* Dev - Add a manual workflow run for PHP unit tests.
* Fix - Apply discounts to the ecommerce event if available.
* Fix - Incorrect quantity value when adding product to the cart that exists in the cart.
* Tweak - WC 8.9 compatibility.
= 2.0.6 - 2024-04-09 =
* Tweak - WC 8.8 compatibility.
= 2.0.5 - 2024-04-04 =
* Tweak - Register `woocommerce-google-analytics-integration` script earlier, so other extensions can plug in.
* Update - Separate the site tag from the event tracking file and delay execution until DOMContentLoaded.
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-google-analytics-integration/trunk/changelog.txt).

View File

@@ -5,9 +5,9 @@
* Description: Allows Google Analytics tracking code to be inserted into WooCommerce store pages.
* Author: WooCommerce
* Author URI: https://woo.com
* Version: 2.0.7
* Version: 2.1.1
* WC requires at least: 8.4
* WC tested up to: 8.9
* WC tested up to: 9.0
* Requires at least: 6.2
* Requires Plugins: woocommerce
* Tested up to: 6.5
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.0.7' ); // WRCS: DEFINED_VERSION.
define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '2.1.1' ); // WRCS: DEFINED_VERSION.
define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_MIN_WC_VER', '6.8' );
// Maybe show the GA Pro notice on plugin activation.