From aa1a814afc66c7767ce18476bec15546b4451bfb Mon Sep 17 00:00:00 2001 From: Henry-fw Date: Tue, 20 Feb 2024 17:47:25 +0800 Subject: [PATCH 1/2] fix error --- aftership-woocommerce-tracking.php | 4 ++-- includes/class-aftership-import-csv.php | 9 +++++++-- readme.txt | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/aftership-woocommerce-tracking.php b/aftership-woocommerce-tracking.php index 760af14..c623817 100644 --- a/aftership-woocommerce-tracking.php +++ b/aftership-woocommerce-tracking.php @@ -3,7 +3,7 @@ * Plugin Name: AfterShip Tracking - All-In-One WooCommerce Order Tracking (Free plan available) * Plugin URI: http://aftership.com/ * Description: Track orders in one place. shipment tracking, automated notifications, order lookup, branded tracking page, delivery day prediction - * Version: 1.17.8 + * Version: 1.18.0 * Author: AfterShip * Author URI: http://aftership.com * @@ -20,7 +20,7 @@ require_once( 'woo-includes/woo-functions.php' ); -define( 'AFTERSHIP_VERSION', '1.17.8' ); +define( 'AFTERSHIP_VERSION', '1.18.0' ); define( 'AFTERSHIP_PATH', dirname( __FILE__ ) ); define( 'AFTERSHIP_ASSETS_URL', plugins_url() . '/' . basename( AFTERSHIP_PATH ) ); define( 'AFTERSHIP_SCRIPT_TAGS', 'aftership_script_tags' ); diff --git a/includes/class-aftership-import-csv.php b/includes/class-aftership-import-csv.php index c314523..1f499fc 100644 --- a/includes/class-aftership-import-csv.php +++ b/includes/class-aftership-import-csv.php @@ -112,8 +112,12 @@ public function add_menu() { // The user has enabled Import Tracking. // Only need detect once: the user's store order number has used default id or has customized order number if ( empty( $this->options['import_tracking'] ) ) { - // Query the user's latest order to determine: 1. whether the user has used a custom number 2. the custom fields used - $this->check_use_custom_order_number(); + try { + // Query the user's latest order to determine: 1. whether the user has used a custom number 2. the custom fields used + $this->check_use_custom_order_number(); + } catch (Throwable $ex) { + return; + } } } @@ -124,6 +128,7 @@ public function check_use_custom_order_number() { // Query the user's latest order $latest_orders = wc_get_orders( array( + 'type' => 'shop_order', 'limit' => 1, 'orderby' => 'date', 'order' => 'DESC', diff --git a/readme.txt b/readme.txt index 33d19a7..7009752 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.aftership.com/ Tags: woocommerce shipping,woocommerce tracking,shipment tracking,order tracking, woocommerce,track order,dhl,ups,usps,fedex,shipping,tracking,order Requires at least: 2.9 Tested up to: 6.3 -Stable tag: 1.17.8 +Stable tag: 1.18.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -141,7 +141,7 @@ Tailor a dynamic branded tracking page. Upload promotional banner, logo, and fav == Changelog == -= 1.17.8 = += 1.18.0 = * Enhancement: support order number column (csv template) for Import Tracking = 1.17.0 = From f4bfc8ec60c450df11ae8132074381a9cc5c1d88 Mon Sep 17 00:00:00 2001 From: Henry-fw Date: Tue, 20 Feb 2024 17:50:52 +0800 Subject: [PATCH 2/2] fix error --- aftership-woocommerce-tracking.php | 4 ++-- readme.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aftership-woocommerce-tracking.php b/aftership-woocommerce-tracking.php index c623817..e2b9a5a 100644 --- a/aftership-woocommerce-tracking.php +++ b/aftership-woocommerce-tracking.php @@ -3,7 +3,7 @@ * Plugin Name: AfterShip Tracking - All-In-One WooCommerce Order Tracking (Free plan available) * Plugin URI: http://aftership.com/ * Description: Track orders in one place. shipment tracking, automated notifications, order lookup, branded tracking page, delivery day prediction - * Version: 1.18.0 + * Version: 1.17.10 * Author: AfterShip * Author URI: http://aftership.com * @@ -20,7 +20,7 @@ require_once( 'woo-includes/woo-functions.php' ); -define( 'AFTERSHIP_VERSION', '1.18.0' ); +define( 'AFTERSHIP_VERSION', '1.17.10' ); define( 'AFTERSHIP_PATH', dirname( __FILE__ ) ); define( 'AFTERSHIP_ASSETS_URL', plugins_url() . '/' . basename( AFTERSHIP_PATH ) ); define( 'AFTERSHIP_SCRIPT_TAGS', 'aftership_script_tags' ); diff --git a/readme.txt b/readme.txt index 7009752..d397721 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.aftership.com/ Tags: woocommerce shipping,woocommerce tracking,shipment tracking,order tracking, woocommerce,track order,dhl,ups,usps,fedex,shipping,tracking,order Requires at least: 2.9 Tested up to: 6.3 -Stable tag: 1.18.0 +Stable tag: 1.17.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -141,7 +141,7 @@ Tailor a dynamic branded tracking page. Upload promotional banner, logo, and fav == Changelog == -= 1.18.0 = += 1.17.10 = * Enhancement: support order number column (csv template) for Import Tracking = 1.17.0 =