Commit 97d8d39cd95 for woocommerce
commit 97d8d39cd95c9fbc8e7f5323be86013e5bff9ad9
Author: Taha Paksu <3295+tpaksu@users.noreply.github.com>
Date: Mon May 4 10:36:18 2026 +0300
Restore the Shipping task for US, CO, and MX merchants (#64521)
* Restore the Shipping task for US, CO, and MX merchants
Add US, CO, and MX to the country whitelist in
Homescreen::maybe_set_default_shipping_options_on_home() so the
home screen no longer auto-creates a default shipping zone for those
countries. Without this, the auto-zone path sets
woocommerce_admin_created_default_shipping_zones=yes on the first
home-screen visit, which makes Shipping::can_view() return false and
hides the Shipping task (and its WCShip / ShipStation / Envia
partner placements).
US was originally on the whitelist (#33547) and was dropped as a
side-effect of #36873 when the array was rewritten to add EU/LATAM
countries. CO and MX were intentionally removed in #41852 when
Skydropx was de-featured for those countries; that contingency no
longer holds because #63379 brought Envia to MX/CO and added all
three countries to Shipping::can_view()'s eligible list, leaving
Homescreen.php as the only remaining gate.
* Add changefile(s) from automation for the following project(s): woocommerce
* Remove stale Homescreen.php PHPStan baseline entries
Adding 'US' to the auto-zone whitelist makes the previously baselined
'Result of && is always false' and 'Strict comparison ... will always
evaluate to false' inferences no longer match. Per the project's
baseline policy, remove the stale entries instead of growing the
baseline.
---------
Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/64521-wooplug-6631-restore-shipping-task-us-co-mx b/plugins/woocommerce/changelog/64521-wooplug-6631-restore-shipping-task-us-co-mx
new file mode 100644
index 00000000000..2e8043f0e42
--- /dev/null
+++ b/plugins/woocommerce/changelog/64521-wooplug-6631-restore-shipping-task-us-co-mx
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Restore the Shipping task on US, CO, and MX stores by adding them back to the home-screen auto-zone whitelist.
\ No newline at end of file
diff --git a/plugins/woocommerce/phpstan-baseline.neon b/plugins/woocommerce/phpstan-baseline.neon
index cd38064367e..1159b2ffbbd 100644
--- a/plugins/woocommerce/phpstan-baseline.neon
+++ b/plugins/woocommerce/phpstan-baseline.neon
@@ -58365,18 +58365,6 @@ parameters:
count: 1
path: src/Internal/Admin/Homescreen.php
- -
- message: '#^Result of && is always false\.$#'
- identifier: booleanAnd.alwaysFalse
- count: 2
- path: src/Internal/Admin/Homescreen.php
-
- -
- message: '#^Strict comparison using \=\=\= between ''US'' and ''AR''\|''AT''\|''AU''\|''BE''\|''BR''\|''CA''\|''CL''\|''DE''\|''ES''\|''FR''\|''GB''\|''GT''\|''HK''\|''IT''\|''NL''\|''NZ''\|''PE''\|''SG''\|''UY'' will always evaluate to false\.$#'
- identifier: identical.alwaysFalse
- count: 1
- path: src/Internal/Admin/Homescreen.php
-
-
message: '#^Argument of an invalid type array\|WP_Error supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
diff --git a/plugins/woocommerce/src/Internal/Admin/Homescreen.php b/plugins/woocommerce/src/Internal/Admin/Homescreen.php
index dfb0cde522e..5528f246b5b 100644
--- a/plugins/woocommerce/src/Internal/Admin/Homescreen.php
+++ b/plugins/woocommerce/src/Internal/Admin/Homescreen.php
@@ -126,7 +126,7 @@ class Homescreen {
if (
( 'US' === $country_code && $is_jetpack_installed )
||
- ( ! in_array( $country_code, array( 'CA', 'AU', 'NZ', 'SG', 'HK', 'GB', 'ES', 'IT', 'DE', 'FR', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true ) )
+ ( ! in_array( $country_code, array( 'US', 'CA', 'AU', 'NZ', 'SG', 'HK', 'GB', 'ES', 'IT', 'DE', 'FR', 'MX', 'CO', 'CL', 'AR', 'PE', 'BR', 'UY', 'GT', 'NL', 'AT', 'BE' ), true ) )
||
( 'US' === $country_code && false === $is_jetpack_installed && false === $is_wcs_installed )
) {