Commit 82627fd95b9 for woocommerce
commit 82627fd95b984d8c318ad764c2b178e92313a148
Author: Akeda Bagus <akeda.bagus@automattic.com>
Date: Tue Nov 24 11:30:12 2026 +0700
Restore rel on shipping label banner new-tab links (#71303)
* restore rel on shipping banner new-tab links
`ExternalLink` always added `rel="external noreferrer noopener"`; the
`@wordpress/ui` `Link` that replaced it in #70802 adds no `rel`. pass
`rel="noopener noreferrer"` explicitly, as other `@wordpress/ui` `Link`
usages in the admin client do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* reword changelog entry for merchants
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* make changelog a dev entry; #70802 is unreleased
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/changelog/fix-shipping-banner-link-rel b/plugins/woocommerce/changelog/fix-shipping-banner-link-rel
new file mode 100644
index 00000000000..0522bc950fe
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-shipping-banner-link-rel
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Restore rel on shipping label banner links lost in unreleased #70802; no merchant-facing change.
+
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
index 2fa83dc2caa..c6125cb2bfd 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
@@ -491,12 +491,14 @@ export class ShippingBanner extends Component {
<UILink
href="https://automattic.com/tos/"
openInNewTab
+ rel="noopener noreferrer"
/>
),
wcsLink: (
<UILink
href="https://woocommerce.com/products/shipping/?utm_medium=product"
openInNewTab
+ rel="noopener noreferrer"
onClick={
this
.woocommerceServiceLinkClicked
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
index ecc09a9f689..4f3fc139c00 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
@@ -926,6 +926,18 @@ describe( 'The message in the banner', () => {
).toBe( notActivatedMessage );
} );
+ it( 'should open the Terms of Service and WooCommerce Shipping links in a new tab with noopener noreferrer.', () => {
+ const { getByRole } = createShippingBannerWrapper( {
+ activePlugins: [],
+ } );
+
+ for ( const name of [ /^Terms of Service/, /^WooCommerce Shipping/ ] ) {
+ const link = getByRole( 'link', { name } );
+ expect( link ).toHaveAttribute( 'target', '_blank' );
+ expect( link ).toHaveAttribute( 'rel', 'noopener noreferrer' );
+ }
+ } );
+
it( 'should continue to show the initial message "By clicking "Create shipping label"..." after WooCommerce Service is installed successfully.', () => {
const { container, rerender } = createShippingBannerWrapper( {
activePlugins: [],