Skip to content

Commit 7fd2ded

Browse files
committed
Merge branch 'release/2.0.11'
2 parents a367690 + e8c0928 commit 7fd2ded

15 files changed

+4722
-6359
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build
55
phpcs-report.txt
66
vendor
77
.DS_Store
8+
.idea/

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@
1212
"minimum-stability": "dev",
1313
"require": {
1414
"php": ">=7.0",
15-
"composer/installers": "^1.9"
15+
"composer/installers": "^1.9",
16+
"appsero/client": "dev-develop"
1617
},
1718

1819
"require-dev": {
19-
"automattic/vipwpcs": "dev-master",
20+
"automattic/vipwpcs": "^2.3",
2021
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
2122
},
2223
"scripts": {
2324
"phpcs": [
2425
"phpcs -p -s"
2526
]
26-
}
27+
},
28+
"config": {
29+
"allow-plugins": {
30+
"composer/installers": true,
31+
"dealerdirect/phpcodesniffer-composer-installer": true
32+
}
33+
}
2734
}

composer.lock

Lines changed: 87 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conversion-tracking.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Plugin Name: WooCommerce Conversion Tracking
44
Plugin URI: https://wedevs.com/woocommerce-conversion-tracking/
55
Description: Adds various conversion tracking codes to cart, checkout, registration success and product page on WooCommerce
6-
Version: 2.0.10
6+
Version: 2.0.11
77
Author: weDevs
88
Author URI: https://wedevs.com/?utm_source=ORG_Author_URI_WCCT
99
License: GPL2
10-
WC requires at least: 2.3
11-
WC tested up to: 5.2
10+
WC requires at least: 5.0.0
11+
WC tested up to: 8.1.0
1212
*/
1313

1414
/**
@@ -54,7 +54,7 @@ class WeDevs_WC_Conversion_Tracking {
5454
*
5555
* @var string
5656
*/
57-
public $version = '2.0.10';
57+
public $version = '2.0.11';
5858

5959
/**
6060
* Holds various class instances
@@ -70,12 +70,17 @@ class WeDevs_WC_Conversion_Tracking {
7070
* within our plugin.
7171
*/
7272
public function __construct() {
73+
require_once __DIR__ . '/vendor/autoload.php';
74+
7375
$this->define_constants();
7476
$this->init_hooks();
7577
$this->includes();
7678
$this->init_classes();
7779

7880
register_activation_hook( __FILE__, array( $this, 'activate' ) );
81+
// hpos support
82+
add_action( 'before_woocommerce_init', [ $this, 'add_hpos_support' ] );
83+
7984
do_action( 'wcct_loaded' );
8085
}
8186

@@ -241,10 +246,6 @@ public function plugin_upgrades() {
241246
* @return void
242247
*/
243248
public function init_tracker() {
244-
if ( ! class_exists( 'Appsero\Client' ) ) {
245-
require_once __DIR__ . '/lib/appsero/Client.php';
246-
}
247-
248249
$client = new Appsero\Client(
249250
'6816029d-7d48-4ed3-8ae4-aeb6a9496f21',
250251
'WooCommerce Conversion Tracking',
@@ -255,6 +256,19 @@ public function init_tracker() {
255256
$client->insights()->init();
256257
}
257258

259+
/**
260+
* Add High Performance Order Storage Support
261+
*
262+
* @since 2.0.11
263+
*
264+
* @return void
265+
*/
266+
public function add_hpos_support() {
267+
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
268+
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
269+
}
270+
}
271+
258272
/**
259273
* Check the pro version
260274
*

includes/integrations/class-integration-facebook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function checkout( $order_id ) {
199199
return;
200200
}
201201

202-
$order = new WC_Order( $order_id );
202+
$order = wc_get_order( $order_id );
203203
$content_type = 'product';
204204
$product_ids = array();
205205

includes/integrations/class-integration-google.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function checkout( $order_id ) {
110110
return;
111111
}
112112

113-
$order = new WC_Order( $order_id );
113+
$order = wc_get_order( $order_id );
114114

115115
$code = $this->build_event( 'conversion', array(
116116
'send_to' => sprintf( "%s/%s", $account_id, $label ),

includes/integrations/class-integration-twitter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function checkout( $order_id ) {
9797
return;
9898
}
9999

100-
$order = new WC_Order( $order_id );
100+
$order = wc_get_order( $order_id );
101101
$content_type = 'product';
102102
$product_ids = array();
103103

0 commit comments

Comments
 (0)