Skip to content

Commit 099591f

Browse files
authored
Fix undefined $helper_auth_data warning in get_wc_helper_auth_info() (#2960)
Initialize $helper_auth_data to false before the WC_Helper_Options guard so the falsy check on line 36 does not read an undeclared variable when the helper class is unavailable (e.g. during cron). Reported on wp.org: https://wordpress.org/support/topic/minor-php-bug-undeclared-variable/ WOOTAX-293
1 parent 4110622 commit 099591f

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** WooCommerce Tax Changelog ***
22

3+
= 3.6.5 - 2026-xx-xx =
4+
* Fix - Prevent PHP "undefined variable" warning when WooCommerce Helper authentication data is unavailable.
5+
36
= 3.6.4 - 2026-06-01 =
47
* Dev - Update JS dependencies.
58

classes/class-wc-connect-functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static function should_send_cart_api_request() {
2828
* @return array|WP_Error
2929
*/
3030
public static function get_wc_helper_auth_info() {
31+
$helper_auth_data = false;
3132
if ( class_exists( 'WC_Helper_Options' ) && is_callable( 'WC_Helper_Options::get' ) ) {
3233
$helper_auth_data = WC_Helper_Options::get( 'auth' );
3334
}

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ This plugin relies on the following external services:
7070

7171
== Changelog ==
7272

73+
= 3.6.5 - 2026-xx-xx =
74+
* Fix - Prevent PHP "undefined variable" warning when WooCommerce Helper authentication data is unavailable.
75+
7376
= 3.6.4 - 2026-06-01 =
7477
* Dev - Update JS dependencies.
7578

0 commit comments

Comments
 (0)