Commit e66f9da5c0a for woocommerce

commit e66f9da5c0a836a6f5cdd6ae86e6b174cdc486b0
Author: Vlad Olaru <vlad.olaru@automattic.com>
Date:   Fri Jul 17 13:51:14 2026 +0300

    Use the IPv6-capable ipify endpoint (#66735)

    * fix: use IPv6-capable ipify endpoint

    Context: WC_Geolocation uses several external IP lookup providers as a fallback for local or non-geolocatable client addresses.

    Problem: The stable ipify provider key still pointed to api.ipify.org, which is IPv4-only while the other default providers can serve IPv6-capable lookups.

    Solution: Keep the ipify key stable but switch its endpoint to the HTTPS dual-stack api64.ipify.org host, and add regression coverage for the default endpoint.

    Refs #47566

    * chore: remove trailing slash from ipify endpoint

    The other root-level IP lookup endpoints omit a trailing slash, and ipify documents its universal endpoint in that form.

    Remove the redundant slash and update the focused assertion so the provider list remains consistent without changing request semantics.

    Refs #47566

diff --git a/plugins/woocommerce/changelog/fix-47566-ipify-ipv6-endpoint b/plugins/woocommerce/changelog/fix-47566-ipify-ipv6-endpoint
new file mode 100644
index 00000000000..27fd6c14357
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-47566-ipify-ipv6-endpoint
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Use the IPv6-capable ipify endpoint for external IP lookups.
diff --git a/plugins/woocommerce/includes/class-wc-geolocation.php b/plugins/woocommerce/includes/class-wc-geolocation.php
index e2a86df839d..6f01c3761cd 100644
--- a/plugins/woocommerce/includes/class-wc-geolocation.php
+++ b/plugins/woocommerce/includes/class-wc-geolocation.php
@@ -47,7 +47,7 @@ class WC_Geolocation {
 	 * @var array
 	 */
 	private static $ip_lookup_apis = array(
-		'ipify'  => 'https://api.ipify.org/',
+		'ipify'  => 'https://api64.ipify.org',
 		'ipecho' => 'https://ipecho.net/plain',
 		'ident'  => 'https://ident.me',
 		'tnedi'  => 'https://tnedi.me',
diff --git a/plugins/woocommerce/tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php b/plugins/woocommerce/tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php
index 3336473d2db..a0cf7815fdd 100644
--- a/plugins/woocommerce/tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php
+++ b/plugins/woocommerce/tests/legacy/unit-tests/geolocation/class-wc-test-gelocation.php
@@ -87,6 +87,16 @@ class WC_Tests_Geolocation extends WC_Unit_Test_Case {
 		}
 	}

+	/**
+	 * @testdox The default ipify IP-lookup endpoint should support IPv6.
+	 */
+	public function test_ipify_ip_lookup_api_uses_ipv6_capable_endpoint() {
+		$apis = $this->get_private_static( 'ip_lookup_apis' );
+
+		$this->assertArrayHasKey( 'ipify', $apis );
+		$this->assertSame( 'https://api64.ipify.org', $apis['ipify'] );
+	}
+
 	/**
 	 * @testdox Geolocating via the API should parse the country code and only request HTTPS endpoints.
 	 */