From d08024e35d085961a7c0d7a024bae55c4b5e8658 Mon Sep 17 00:00:00 2001 From: Ayush Pahwa Date: Thu, 21 Aug 2025 23:10:10 +0530 Subject: [PATCH 1/2] update: func to fetch version of wc shipping if active --- woocommerce-services.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/woocommerce-services.php b/woocommerce-services.php index 965d86e7a..8b6f2222d 100644 --- a/woocommerce-services.php +++ b/woocommerce-services.php @@ -2107,6 +2107,23 @@ public static function is_wc_shipping_activated() { return in_array( 'woocommerce-shipping/woocommerce-shipping.php', get_option( 'active_plugins' ) ); } + /** + * Get the version of WooCommerce Shipping plugin + * + * @return string + */ + public static function get_wc_shipping_version() { + if ( ! self::is_wc_shipping_activated() ) { + return 'undefined'; + } + // Ensure this code runs within the WordPress admin context or after wp-admin/includes/plugin.php is loaded. + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $all_plugins = get_plugins(); + return $all_plugins['woocommerce-shipping/woocommerce-shipping.php']['Version']; + } + /** * Returns if both Woo Shipping and Woo Tax are active. * From b45c78ed0377dc594f915f81d72744911e611cf9 Mon Sep 17 00:00:00 2001 From: Ayush Pahwa Date: Thu, 21 Aug 2025 23:10:51 +0530 Subject: [PATCH 2/2] update: add extra param to settings in connect server api call --- classes/class-wc-connect-api-client.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-wc-connect-api-client.php b/classes/class-wc-connect-api-client.php index 1639b9455..33cb6a50f 100644 --- a/classes/class-wc-connect-api-client.php +++ b/classes/class-wc-connect-api-client.php @@ -468,6 +468,7 @@ protected function get_settings_values() { 'dimension_unit' => strtolower( get_option( 'woocommerce_dimension_unit' ) ), 'weight_unit' => strtolower( get_option( 'woocommerce_weight_unit' ) ), 'wcs_version' => WC_Connect_Loader::get_wcs_version(), + 'wcshipping_version' => WC_Connect_Loader::get_wc_shipping_version(), 'jetpack_version' => 'embed-' . WC_Connect_Jetpack::get_jetpack_connection_package_version(), 'is_atomic' => WC_Connect_Jetpack::is_atomic_site(), 'wc_version' => WC()->version,