Commit be36a7b9280 for woocommerce
commit be36a7b9280aeee5f5b746439e8fc474b17c90ea
Author: AnnaMag <AnnaMag@users.noreply.github.com>
Date: Sat Dec 5 00:32:32 2026 +0100
AI shopping health: show the first check running or not started, as designed; connector copy in AI tools (#71864)
* Show the first AI shopping health check running, or that it didn't start, as designed
While the first check runs, the status card shows the spinner with the wait line beside it and Check again turned off. With no results and nothing running, it says the check didn't start and offers Check your store. Before the first results the page adds the AI shopping banner and a card on what the check looks at.
* Describe the didn't-start text in the view schema
* Keep Check your store on a stuck first check, and fit the banner art to RTL and narrow banners
* Match the AI shopping banner to the design's measurements
* Say how to use the WordPress connector once the store is connected
* Expect the new connector text in the AgentConnect test
* Use the WordPress cart icon in What the check looks at
* Say a failed check couldn’t run, instead of repeating that it didn’t start
* Say a later check will update the page, since the last results stay up
* Say to reload for new results, since polling stops after ten minutes
diff --git a/plugins/woocommerce/assets/images/ai-shopping/sweater.jpg b/plugins/woocommerce/assets/images/ai-shopping/sweater.jpg
new file mode 100644
index 00000000000..c8f00254259
Binary files /dev/null and b/plugins/woocommerce/assets/images/ai-shopping/sweater.jpg differ
diff --git a/plugins/woocommerce/changelog/fix-ai-shopping-health-first-check-states b/plugins/woocommerce/changelog/fix-ai-shopping-health-first-check-states
new file mode 100644
index 00000000000..d0f7ea467c8
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-ai-shopping-health-first-check-states
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+AI shopping health: show what the check looks at while the first check runs, and say when it didn’t start.
diff --git a/plugins/woocommerce/changelog/fix-ai-tools-connected-copy b/plugins/woocommerce/changelog/fix-ai-tools-connected-copy
new file mode 100644
index 00000000000..f56dde00231
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-ai-tools-connected-copy
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Settings > AI tools: say how to use the WordPress connector once the store is connected to WordPress.com.
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/agent-connect.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/agent-connect.tsx
index 2609b16f1d3..2fbf0f617cc 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/components/agent-connect.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/agent-connect.tsx
@@ -111,7 +111,7 @@ export const AgentConnect = ( { connect }: { connect: ConnectView } ) => {
className="wc-sales-readiness__muted"
>
{ __(
- 'Supported AI apps can now connect to this store through MCP. To get started, add WordPress in the AI app you want to use and select this store.',
+ 'Add the WordPress connector in your AI app and ask it to find this store, then work with your products, orders, and store content from there.',
'woocommerce'
) }
</Text>
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/check-banner.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/check-banner.tsx
new file mode 100644
index 00000000000..18aaab2ae53
--- /dev/null
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/check-banner.tsx
@@ -0,0 +1,54 @@
+/**
+ * External dependencies
+ */
+import { Icon, check } from '@wordpress/icons';
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import { WC_ASSET_URL } from '~/utils/admin-settings';
+
+/**
+ * Before the first results: what the check is for, beside a product that passed.
+ */
+export const CheckBanner = () => (
+ <div className="wc-sales-readiness-banner">
+ <div className="wc-sales-readiness-banner__copy">
+ <h2>
+ { __( 'Is your store ready for AI shopping?', 'woocommerce' ) }
+ </h2>
+ <p>
+ { __(
+ 'Find out if your products show up, and what you can improve.',
+ 'woocommerce'
+ ) }
+ </p>
+ </div>
+ <div className="wc-sales-readiness-banner__art" aria-hidden="true">
+ <svg
+ className="wc-sales-readiness-banner__blob"
+ viewBox="0 0 210 120"
+ >
+ <path d="M28.5 120C18 109 7.5 90.5 8 76C7 52 29 37 52.5 36C121 29.5 175 22 194 25C197 29 202 36.25 202 45C202.5 55.5 196 61.5 188 65C180 66.75 175.5 69.25 175 73C175 76 176 78 177 78C189 88 201 101.5 209 120.5Z" />
+ </svg>
+ <div className="wc-sales-readiness-banner__product">
+ <img
+ src={ `${ WC_ASSET_URL }images/ai-shopping/sweater.jpg` }
+ alt=""
+ />
+ <span />
+ <span />
+ </div>
+ <span className="wc-sales-readiness-banner__sparkle">
+ <svg viewBox="0 0 24 24">
+ <path d="M10 4.5l1.4 4.1 4.1 1.4-4.1 1.4L10 15.5l-1.4-4.1L4.5 10l4.1-1.4zM17 13l.8 2.2 2.2.8-2.2.8L17 19l-.8-2.2-2.2-.8 2.2-.8zM17 3.5l.6 1.4 1.4.6-1.4.6L17 7.5l-.6-1.4-1.4-.6 1.4-.6z" />
+ </svg>
+ </span>
+ <span className="wc-sales-readiness-banner__passed">
+ <Icon icon={ check } size={ 16 } />
+ { __( 'Passed', 'woocommerce' ) }
+ </span>
+ </div>
+ </div>
+);
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/check-intro.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/check-intro.tsx
new file mode 100644
index 00000000000..a72ebaed110
--- /dev/null
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/check-intro.tsx
@@ -0,0 +1,89 @@
+/**
+ * External dependencies
+ */
+/* eslint-disable @wordpress/use-recommended-components -- The design asks for these @wordpress/ui components; this chunk bundles the package. */
+import { Card, Text } from '@wordpress/ui';
+/* eslint-enable @wordpress/use-recommended-components */
+import { Icon, globe, search, tag } from '@wordpress/icons';
+import { Path, SVG } from '@wordpress/primitives';
+import { __ } from '@wordpress/i18n';
+
+// The cart icon from @wordpress/icons 11.8; the version bundled here (11.0) has none.
+const cart = (
+ <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
+ <Path d="M8.5 17c-.8 0-1.5.7-1.5 1.5S7.7 20 8.5 20s1.5-.7 1.5-1.5S9.3 17 8.5 17Zm7 0c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5-.7-1.5-1.5-1.5Zm-6-3.8h5.1c1.2 0 2.2-.7 2.6-1.8l1.3-3.5c.3-.8-.3-1.7-1.2-1.7h-10l-.8-2h-3v1.5h2l2.7 6.7-.6 1.3c-.6 1.2.3 2.5 1.6 2.5h8.4v-1.5H9.2c-.2 0-.3-.2-.2-.4l.6-1.1ZM7.9 7.8h9L15.7 11c-.2.5-.6.8-1.2.8H9.4l-1.6-4Z" />
+ </SVG>
+);
+
+/**
+ * Before the first results: the four questions the check answers.
+ */
+export const CheckIntro = () => {
+ const items = [
+ {
+ icon: globe,
+ title: __( 'Store access', 'woocommerce' ),
+ text: __(
+ 'Can AI assistants open your pages and send shoppers to your checkout?',
+ 'woocommerce'
+ ),
+ },
+ {
+ icon: search,
+ title: __( 'Search and discovery', 'woocommerce' ),
+ text: __(
+ 'Can AI assistants find all your products?',
+ 'woocommerce'
+ ),
+ },
+ {
+ icon: tag,
+ title: __( 'Product details', 'woocommerce' ),
+ text: __(
+ 'Can AI assistants read your prices, stock, and images?',
+ 'woocommerce'
+ ),
+ },
+ {
+ icon: cart,
+ title: __( 'Buying through AI assistants', 'woocommerce' ),
+ text: __(
+ 'Can shoppers learn your shipping and returns terms before they buy?',
+ 'woocommerce'
+ ),
+ },
+ ];
+ return (
+ <Card.Root className="wc-sales-readiness-card">
+ <Card.Content>
+ <div className="wc-sales-readiness-intro">
+ <Text variant="heading-xl" render={ <h2 /> }>
+ { __( 'What the check looks at', 'woocommerce' ) }
+ </Text>
+ <Text variant="body-lg">
+ { __(
+ 'When the check ends, you’ll see what to fix first.',
+ 'woocommerce'
+ ) }
+ </Text>
+ <ul className="wc-sales-readiness-intro__items">
+ { items.map( ( item ) => (
+ <li key={ item.title }>
+ <Icon icon={ item.icon } />
+ <Text variant="heading-md" render={ <h3 /> }>
+ { item.title }
+ </Text>
+ <Text
+ variant="body-sm"
+ className="wc-sales-readiness__muted"
+ >
+ { item.text }
+ </Text>
+ </li>
+ ) ) }
+ </ul>
+ </div>
+ </Card.Content>
+ </Card.Root>
+ );
+};
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/checked-card.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/checked-card.tsx
index 8d37fbfe0f1..4e1f3c239c0 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/components/checked-card.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/checked-card.tsx
@@ -25,8 +25,8 @@ interface CheckedCardProps {
}
/**
- * When the store was last checked, with Check again. Before the first check it says Not checked
- * yet and offers Check your store. While a check runs it shows a spinner and Checking your store,
+ * When the store was last checked, with Check again. With no results and nothing running it says
+ * the check didn't start and offers Check your store. While a check runs it shows a spinner and Checking your store,
* with Check again turned off. From the first check on, Need help? offers the results to
* download for support (built from the last check), and a switch turns the daily check off or on.
*/
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/components/run-status.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/components/run-status.tsx
index 1ce786067eb..9ed68b0fac7 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/components/run-status.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/components/run-status.tsx
@@ -11,30 +11,26 @@ import type { ReadinessView } from '../types';
import { RowLink } from './check-row';
/**
- * The check's status before the first results: a spinner and the message while it runs, with how
- * long the first check takes, and the message itself when the check is stuck, with a button to
- * Scheduled Actions.
+ * The check's status before its results: a spinner beside the message and how long to wait while
+ * it runs, and the message itself when the check is stuck, with a button to Scheduled Actions.
*/
export const RunStatus = ( { run }: { run: ReadinessView[ 'run' ] } ) => {
if ( run.pending && ! run.stalled ) {
return (
- <>
- <div
- className="wc-sales-readiness-checked__running"
- role="status"
- >
- <Spinner />
+ <div className="wc-sales-readiness-checked__running" role="status">
+ <Spinner />
+ <div className="wc-sales-readiness-checked__running-text">
<Text variant="body-md">{ run.message }</Text>
+ { run.note && (
+ <Text
+ variant="body-sm"
+ className="wc-sales-readiness__muted"
+ >
+ { run.note }
+ </Text>
+ ) }
</div>
- { run.note && (
- <Text
- variant="body-sm"
- className="wc-sales-readiness__muted"
- >
- { run.note }
- </Text>
- ) }
- </>
+ </div>
);
}
if ( ! run.message ) {
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/index.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/index.tsx
index a2f11e06156..f7625cb63aa 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/index.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/index.tsx
@@ -12,6 +12,8 @@ import { __ } from '@wordpress/i18n';
import './sales-readiness.scss';
import { useReadinessView } from './use-readiness-view';
import { CheckedCard } from './components/checked-card';
+import { CheckBanner } from './components/check-banner';
+import { CheckIntro } from './components/check-intro';
import { ComingSoonNotice } from './components/coming-soon-notice';
import { ErrorNotice } from './components/error-notice';
import { FixFirstCard } from './components/fix-first';
@@ -76,6 +78,12 @@ export default function SalesReadiness() {
surface="page"
/>
) }
+ { ! view.checked && (
+ <>
+ <CheckBanner />
+ <CheckIntro />
+ </>
+ ) }
{ view.fix_first && (
<FixFirstCard fixFirst={ view.fix_first } />
) }
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/overview.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/overview.tsx
index 80dd29d0ac7..d858b78b9ec 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/overview.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/overview.tsx
@@ -127,15 +127,22 @@ export default function SalesReadinessOverview( {
</Text>
{ ! view.checked ? (
<>
- { ! ( view.run.pending && ! view.run.stalled ) && (
- <Text
- variant="body-sm"
- className="wc-sales-readiness__muted"
- >
- { view.last_checked }
- </Text>
+ { view.run.pending && ! view.run.stalled ? (
+ <div className="wc-sales-readiness-card__status">
+ <RunStatus run={ view.run } />
+ </div>
+ ) : (
+ <>
+ <Text
+ variant="body-md"
+ render={ <div /> }
+ className="wc-sales-readiness-card__status"
+ >
+ { view.last_checked }
+ </Text>
+ <RunStatus run={ view.run } />
+ </>
) }
- <RunStatus run={ view.run } />
<div className="wc-sales-readiness-card__actions">
<Button
variant="secondary"
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/sales-readiness.scss b/plugins/woocommerce/client/admin/client/sales-readiness/sales-readiness.scss
index b78cec2aafe..8889870c7de 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/sales-readiness.scss
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/sales-readiness.scss
@@ -415,6 +415,11 @@ body:has(.wc-sales-readiness) {
}
}
+// Before the first results on the Overview: Not checked yet, or that the check didn't start.
+.wc-sales-readiness-card__status {
+ margin-block-start: var(--wpds-dimension-gap-md);
+}
+
// Check can't start: the message, then Go to Scheduled Actions.
.wc-sales-readiness-run-status {
display: flex;
@@ -444,12 +449,197 @@ body:has(.wc-sales-readiness) {
.wc-sales-readiness-checked__running {
display: flex;
- align-items: center;
+ align-items: flex-start;
gap: var(--wpds-dimension-gap-md);
.components-spinner {
+ flex-shrink: 0;
+ // Centred on the first line of the message.
+ margin: 2px 0 0;
+ }
+}
+
+.wc-sales-readiness-checked__running-text {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+// Before the first results: what the check is for, beside a product that passed.
+// Under the page class, to outrank WooCommerce admin's heading styles.
+.wc-sales-readiness .wc-sales-readiness-banner {
+ --wc-sr-banner-bg: #6209ce;
+ --wc-sr-banner-blob: #873eff;
+ --wc-sr-banner-sparkle: #2a0560;
+ position: relative;
+ container-type: inline-size;
+ display: flex;
+ align-items: center;
+ min-height: 160px;
+ padding: var(--wpds-dimension-padding-2xl) 48px;
+ overflow: hidden;
+ border-radius: 8px;
+ background: var(--wc-sr-banner-bg);
+ color: #fff;
+ box-sizing: border-box;
+
+ h2,
+ p {
+ margin: 0;
+ color: inherit;
+ }
+
+ h2 {
+ font-size: 24px;
+ font-weight: 600;
+ line-height: 30px;
+ text-wrap: wrap;
+ }
+
+ p {
+ margin-block-start: var(--wpds-dimension-gap-sm);
+ font-size: 13px;
+ line-height: 20px;
+ }
+}
+
+.wc-sales-readiness-banner__copy {
+ position: relative;
+ max-width: 320px;
+}
+
+.wc-sales-readiness-banner__art {
+ position: absolute;
+ inset-block: 0;
+ inset-inline-end: 0;
+ width: 225px;
+
+ > * {
+ position: absolute;
+ }
+
+ // The art sits over the copy when the banner is narrower than both (the query reads the content box).
+ @container (max-width: 500px) {
+ display: none;
+ }
+}
+
+.wc-sales-readiness-banner__blob {
+ inset-block-end: 0;
+ inset-inline-end: 22px;
+ width: 210px;
+ height: 120px;
+ fill: var(--wc-sr-banner-blob);
+}
+
+.wc-sales-readiness-banner__product {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ inset-block-start: 18px;
+ inset-inline-end: 54px;
+ width: 100px;
+ padding-block-end: 12px;
+ overflow: hidden;
+ border-radius: 4px;
+ background: #fff;
+
+ img {
+ display: block;
+ width: 100%;
+ height: 88px;
+ margin-block-end: 4px;
+ object-fit: cover;
+ }
+
+ span {
+ width: 70px;
+ height: 4px;
+ border-radius: 2px;
+ background: #dcdcde;
+
+ & + span {
+ width: 46px;
+ }
+ }
+}
+
+.wc-sales-readiness-banner__sparkle {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ inset-block-start: 27px;
+ inset-inline-end: 35px;
+ width: 38px;
+ height: 38px;
+ border-radius: 4px;
+ background: var(--wc-sr-banner-sparkle);
+
+ svg {
+ width: 20px;
+ height: 20px;
+ fill: #fff;
+ }
+}
+
+.wc-sales-readiness-banner__passed {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ inset-block-start: 76px;
+ inset-inline-end: 111px;
+ padding-block: 3px;
+ padding-inline: 6px 10px;
+ border-radius: 2px;
+ background: #fff;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+ color: #50575e;
+ font-size: 12px;
+ line-height: 20px;
+
+ svg {
+ fill: var(--wc-sr-banner-bg);
+ }
+}
+
+// Before the first results: what the check looks at.
+.wc-sales-readiness .wc-sales-readiness-intro {
+ display: flex;
+ flex-direction: column;
+ gap: var(--wpds-dimension-gap-lg);
+ padding: 32px;
+
+ h2,
+ h3 {
+ margin: 0;
+ font-weight: 600;
+ }
+}
+
+.wc-sales-readiness-intro__items {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 32px var(--wpds-dimension-gap-xl);
+ margin: var(--wpds-dimension-gap-lg) 0 0;
+ padding: 0;
+ list-style: none;
+
+ li {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: var(--wpds-dimension-gap-sm);
margin: 0;
}
+
+ svg {
+ fill: currentColor;
+ }
+
+ @media (max-width: 600px) {
+ grid-template-columns: 1fr;
+ }
}
.wc-sales-readiness-checked__daily {
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/test/agent-connect.test.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/test/agent-connect.test.tsx
index 89c80b06d39..c4fad290882 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/test/agent-connect.test.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/test/agent-connect.test.tsx
@@ -49,7 +49,7 @@ describe( 'AgentConnect', () => {
area: 'agent_connect',
} );
expect(
- screen.queryByText( 'add WordPress in the AI app', {
+ screen.queryByText( 'Add the WordPress connector in your AI app', {
exact: false,
} )
).not.toBeInTheDocument();
@@ -74,7 +74,7 @@ describe( 'AgentConnect', () => {
screen.getByText( 'Connection successful' )
).toBeInTheDocument();
expect(
- screen.getByText( 'add WordPress in the AI app', {
+ screen.getByText( 'Add the WordPress connector in your AI app', {
exact: false,
} )
).toBeInTheDocument();
@@ -87,7 +87,7 @@ describe( 'AgentConnect', () => {
screen.queryByText( 'Connection successful' )
).not.toBeInTheDocument();
expect(
- screen.getByText( 'add WordPress in the AI app', {
+ screen.getByText( 'Add the WordPress connector in your AI app', {
exact: false,
} )
).toBeInTheDocument();
@@ -99,7 +99,7 @@ describe( 'AgentConnect', () => {
screen.queryByText( 'Connection successful' )
).not.toBeInTheDocument();
expect(
- screen.getByText( 'add WordPress in the AI app', {
+ screen.getByText( 'Add the WordPress connector in your AI app', {
exact: false,
} )
).toBeInTheDocument();
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/test/checked-card.test.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/test/checked-card.test.tsx
index 6634bb612dc..917e460e6e1 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/test/checked-card.test.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/test/checked-card.test.tsx
@@ -11,7 +11,7 @@ import { RowLink } from '../components/check-row';
import type { ReadinessView } from '../types';
const firstVisit = {
- last_checked: 'Not checked yet',
+ last_checked: 'The check didn’t start. Try again in a few minutes.',
checked_note: null,
checked: false,
run: {
@@ -24,7 +24,7 @@ const firstVisit = {
} as unknown as ReadinessView;
describe( 'CheckedCard', () => {
- it( 'shows Not checked yet and Check your store on the first visit, without the intro', () => {
+ it( 'says the first check didn’t start and offers Check your store', () => {
render(
<CheckedCard
view={ firstVisit }
@@ -33,7 +33,11 @@ describe( 'CheckedCard', () => {
onDownloadError={ jest.fn() }
/>
);
- expect( screen.getByText( 'Not checked yet' ) ).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'The check didn’t start. Try again in a few minutes.'
+ )
+ ).toBeInTheDocument();
expect(
screen.getByRole( 'button', { name: 'Check your store' } )
).toBeEnabled();
@@ -44,7 +48,7 @@ describe( 'CheckedCard', () => {
it( 'says how long to wait under the spinner while the first check runs', () => {
const note =
- 'Your first check can take a few minutes. You can leave this page, and the results show here when it’s done.';
+ 'This can take a little while on larger stores. Your results will show here.';
render(
<CheckedCard
view={ {
@@ -64,14 +68,15 @@ describe( 'CheckedCard', () => {
expect( screen.getByRole( 'status' ) ).toHaveTextContent(
'Checking your store'
);
- expect( screen.getByText( note ) ).toBeInTheDocument();
+ expect( screen.getByRole( 'status' ) ).toHaveTextContent( note );
} );
- it( 'shows a spinner, Checking your store and a turned-off Check your store while the first check runs', () => {
+ it( 'shows a spinner, Checking your store and a turned-off Check again while the first check runs', () => {
const running = {
...firstVisit,
run: {
...firstVisit.run,
+ label: 'Check again',
pending: true,
message: 'Checking your store',
},
@@ -90,10 +95,14 @@ describe( 'CheckedCard', () => {
expect( screen.getByRole( 'status' ) ).toHaveTextContent(
'Checking your store'
);
- expect( screen.queryByText( 'Not checked yet' ) ).toBeNull();
+ expect(
+ screen.queryByText(
+ 'The check didn’t start. Try again in a few minutes.'
+ )
+ ).toBeNull();
// Turned off but still focusable, so focus stays on it after the click.
expect(
- screen.getByRole( 'button', { name: 'Check your store' } )
+ screen.getByRole( 'button', { name: 'Check again' } )
).toHaveAttribute( 'aria-disabled', 'true' );
} );
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/test/tracks.test.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/test/tracks.test.tsx
index 95ac603ff30..3b07e13f4cd 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/test/tracks.test.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/test/tracks.test.tsx
@@ -366,6 +366,7 @@ describe( 'Sales readiness tracking', () => {
const first = {
...checkedView,
checked: false,
+ last_checked: 'The check didn’t start. Try again in a few minutes.',
fix_first: null,
run: {
label: 'Run checks',
@@ -393,7 +394,12 @@ describe( 'Sales readiness tracking', () => {
document.querySelector(
'.wc-sales-readiness--overview .components-notice'
)?.textContent
- ).toContain( 'The check didn’t start. Try again in a few minutes.' );
+ ).toContain( 'Couldn’t run the check. Try again in a few minutes.' );
+ expect(
+ screen.getByText(
+ 'The check didn’t start. Try again in a few minutes.'
+ )
+ ).toBeInTheDocument();
expect( screen.getByText( 'AI shopping' ) ).toBeTruthy();
expect(
screen.getByRole( 'button', { name: 'Run checks' } )
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/test/use-readiness-view.test.tsx b/plugins/woocommerce/client/admin/client/sales-readiness/test/use-readiness-view.test.tsx
index 97e626b4317..87131735bf0 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/test/use-readiness-view.test.tsx
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/test/use-readiness-view.test.tsx
@@ -134,7 +134,7 @@ describe( 'useReadinessView', () => {
await result.current.runCheck();
} );
expect( result.current.error ).toBe(
- 'The check didn’t start. Try again in a few minutes.'
+ 'Couldn’t run the check. Try again in a few minutes.'
);
expect( result.current.reload ).toBe( false );
} );
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/types.ts b/plugins/woocommerce/client/admin/client/sales-readiness/types.ts
index 3303af1dad1..99c6863c2cf 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/types.ts
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/types.ts
@@ -121,7 +121,7 @@ export interface ReadinessView {
pending: boolean;
stalled: boolean;
message: string;
- /** While the first check runs, how long to wait. Empty otherwise. */
+ /** While a check runs, how long to wait. Empty otherwise. */
note?: string;
/** Scheduled Actions, when the check can't start. */
link: ViewLink | null;
diff --git a/plugins/woocommerce/client/admin/client/sales-readiness/use-readiness-view.ts b/plugins/woocommerce/client/admin/client/sales-readiness/use-readiness-view.ts
index 37b7d0b1391..b00e47b6a98 100644
--- a/plugins/woocommerce/client/admin/client/sales-readiness/use-readiness-view.ts
+++ b/plugins/woocommerce/client/admin/client/sales-readiness/use-readiness-view.ts
@@ -146,7 +146,7 @@ export function useReadinessView(
trackReadiness( 'error', { surface, action: 'run' } );
setError(
__(
- 'The check didn’t start. Try again in a few minutes.',
+ 'Couldn’t run the check. Try again in a few minutes.',
'woocommerce'
)
);
diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/README.md b/plugins/woocommerce/src/Internal/AgentReadiness/README.md
index a33fb6b7434..14d4a2dcf1d 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/README.md
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/README.md
@@ -186,7 +186,7 @@ Per check, `channels` maps a channel id to the feed field and the effect, the sa
## Background scan and REST
-"Check your store" on WooCommerce > Sales readiness, or `POST wc/v3/agent-readiness/scan`, queues the scan in Action Scheduler (`ScheduledScan`). On a store that was never checked, opening AI shopping health or Settings > AI tools queues the first scan without a click (`ScheduledScan::queue_first()`, called from `ReadinessCheckPage::view()`, so `GET wc/v3/agent-readiness/view` does too). The page shows it running, with a line on how long the first check takes. This happens once per store (the `woocommerce_agent_readiness_first_scan` option), so a first scan that gives up without a report isn't queued again on every visit; Check your store still runs one. A newly queued scan requested by a merchant logged in to wp-admin starts Action Scheduler's async queue runner right away (`maybe_dispatch()`), so it doesn't wait up to a minute for WP-Cron or the next admin page load. It takes Action Scheduler's 60-second `async-request-runner` lock when that lock is free, so two requests don't each send a loopback. A lock left by an idle admin page, which sets it before checking for due actions, does not block the scan. A queue already at its batch limit is not sent another loopback. A scan already waiting doesn't send another loopback request. A scan requested without a login cookie (application passwords, OAuth, WP-CLI, cron) still waits for WP-Cron: the loopback request's nonce is checked against the request's cookies. The report is stored in the `woocommerce_agent_readiness_report` option (not autoloaded). When daily checks are on, each run schedules the next one for the coming night before scanning (`ScheduledScan::next_daily_run()`: a minute between 1:00 and 5:00 on the store's clock, fixed per store by its address), so a failed scan doesn't stop the daily refresh and a run that starts late doesn't move the next one. A slot less than 6 hours away is left for the night after. "Automatically run checks daily" on the page (`POST wc/v3/agent-readiness/daily-checks`, option `woocommerce_agent_readiness_daily_scan`) turns the daily run off: its action is removed, runs schedule no next one, and checks only run on request. Cancelling the scheduled actions under Tools > Scheduled Actions stops the chain until the next manual check. If a queued scan still hasn't started 10 minutes after it was due and no other scheduled action has finished, failed or started in that time (Action Scheduler isn't running), the Sales readiness page says so and the scan stays queued. The scan never runs in a page or REST request.
+"Check your store" on WooCommerce > Sales readiness, or `POST wc/v3/agent-readiness/scan`, queues the scan in Action Scheduler (`ScheduledScan`). On a store that was never checked, opening AI shopping health or Settings > AI tools queues the first scan without a click (`ScheduledScan::queue_first()`, called from `ReadinessCheckPage::view()`, so `GET wc/v3/agent-readiness/view` does too). The page shows it running, with a line on how long a check can take (before the first results, where they will show; once results exist, to reload the page for the new ones, because polling stops after ten minutes), and before the first results a banner and a card on what the check looks at. With no results and nothing running, the page says the check didn't start and offers Check your store. This happens once per store (the `woocommerce_agent_readiness_first_scan` option), so a first scan that gives up without a report isn't queued again on every visit; Check your store still runs one. A newly queued scan requested by a merchant logged in to wp-admin starts Action Scheduler's async queue runner right away (`maybe_dispatch()`), so it doesn't wait up to a minute for WP-Cron or the next admin page load. It takes Action Scheduler's 60-second `async-request-runner` lock when that lock is free, so two requests don't each send a loopback. A lock left by an idle admin page, which sets it before checking for due actions, does not block the scan. A queue already at its batch limit is not sent another loopback. A scan already waiting doesn't send another loopback request. A scan requested without a login cookie (application passwords, OAuth, WP-CLI, cron) still waits for WP-Cron: the loopback request's nonce is checked against the request's cookies. The report is stored in the `woocommerce_agent_readiness_report` option (not autoloaded). When daily checks are on, each run schedules the next one for the coming night before scanning (`ScheduledScan::next_daily_run()`: a minute between 1:00 and 5:00 on the store's clock, fixed per store by its address), so a failed scan doesn't stop the daily refresh and a run that starts late doesn't move the next one. A slot less than 6 hours away is left for the night after. "Automatically run checks daily" on the page (`POST wc/v3/agent-readiness/daily-checks`, option `woocommerce_agent_readiness_daily_scan`) turns the daily run off: its action is removed, runs schedule no next one, and checks only run on request. Cancelling the scheduled actions under Tools > Scheduled Actions stops the chain until the next manual check. If a queued scan still hasn't started 10 minutes after it was due and no other scheduled action has finished, failed or started in that time (Action Scheduler isn't running), the Sales readiness page says so and the scan stays queued. The scan never runs in a page or REST request.
A scan runs as a chain of actions (`NEXT_HOOK`, with the scan's id), so no action tests more than one batch of products. The first lists the products to test, newest change first (on a catalog over 5,000 products with sales to rank by, best sellers of the last 90 days first, skipping any the scan does not check and reading the next sellers until the limit is filled or the sales run out, then newest change), and stores that list with the totals in the `woocommerce_agent_readiness_scan` option (not autoloaded). Starting reads the store's 90-day totals once (`ProductSales::last_days()`). When those totals say the scan can rank, it then reads the best seller ids, summed in SQL and limited to published products, so memory doesn't grow with the number of products sold. A page of sellers the scan cannot check is followed by the next page, up to ten pages. Each later batch reads only its own products' sales, so the whole store's sales map is never loaded. Each action tests the next batch of 200, saves the totals and queues the next; the last builds the report, with the store output checks, and stores it. Before testing, an action queues a retry RETRY_AFTER (10 minutes) later, which it removes when it finishes, so a batch that ends early, as on a timeout, is tried again from the last finished batch. After MAX_ATTEMPTS (3) tries of the same batch, the scan stops and the last report stays. Giving up, cancelling, or replacing a scan removes failure rows it wrote for products the last report never covered, so the Products list stays aligned with that report. A new request (or the daily run) replaces a scan in progress and starts over; the replaced scan's actions change nothing. `refresh_report()` runs the same steps in one request.
diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
index 9b330108ca5..46a72d1ae31 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessCheckPage.php
@@ -325,18 +325,22 @@ class ReadinessCheckPage implements RegisterHooksInterface {
return array(
'title' => __( 'AI shopping health', 'woocommerce' ),
'description' => __( 'Check how well AI assistants can find and shop your store, and what to improve first.', 'woocommerce' ),
- 'last_checked' => self::last_checked( $report ),
+ // The first check runs on the first visit, so with no results and nothing running it didn't start.
+ 'last_checked' => null === $report && ! $pending ? __( 'The check didn’t start. Try again in a few minutes.', 'woocommerce' ) : self::last_checked( $report ),
'checked_note' => $truncated,
'checked' => null !== $report,
// Whether the store is checked every day; the merchant can turn it off on the page.
'daily_checks' => ScheduledScan::daily_enabled(),
'run' => array(
- 'label' => null === $report ? __( 'Check your store', 'woocommerce' ) : __( 'Check again', 'woocommerce' ),
+ // Check again only while a check runs: a first check that is stuck never ran.
+ 'label' => null === $report && ! ( $pending && ! $stalled ) ? __( 'Check your store', 'woocommerce' ) : __( 'Check again', 'woocommerce' ),
'pending' => $pending,
'stalled' => $stalled,
'message' => $message,
- // The first check has no results to show yet, so say how long to wait.
- 'note' => $pending && ! $stalled && null === $report ? __( 'Your first check can take a few minutes. You can leave this page, and the results show here when it’s done.', 'woocommerce' ) : '',
+ // Before the first results, say where they show. With results already up, polling stops after ten minutes, so say to reload.
+ 'note' => ! ( $pending && ! $stalled ) ? '' : ( null === $report
+ ? __( 'This can take a little while on larger stores. Your results will show here.', 'woocommerce' )
+ : __( 'This can take a little while on larger stores. Reload the page to see the new results.', 'woocommerce' ) ),
'link' => $stalled ? array(
'href' => admin_url( 'admin.php?page=wc-status&tab=action-scheduler&status=pending' ),
'text' => __( 'View Scheduled Actions', 'woocommerce' ),
diff --git a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessRestController.php b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessRestController.php
index b01e8da1aa1..bd42d0ffdb8 100644
--- a/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessRestController.php
+++ b/plugins/woocommerce/src/Internal/AgentReadiness/ReadinessRestController.php
@@ -315,7 +315,7 @@ class ReadinessRestController extends RestApiControllerBase {
'context' => array( 'view' ),
),
'last_checked' => array(
- 'description' => __( 'When the store was last checked, as text.', 'woocommerce' ),
+ 'description' => __( 'When the store was last checked, or that the first check didn’t start, as text.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
),
diff --git a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
index 1ab928a77ce..c882fdafa19 100644
--- a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/AgenticCommerceSettingsTest.php
@@ -2235,7 +2235,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
as_unschedule_all_actions( ScheduledScan::RUN_NOW_HOOK );
$view = $this->view();
- $this->assertSame( 'Not checked yet', $view['last_checked'], 'No check has run' );
+ $this->assertSame( 'The check didn’t start. Try again in a few minutes.', $view['last_checked'], 'No results and nothing running: the first check did not start' );
$this->assertSame( 'Check your store', $view['run']['label'], 'and the page offers to run one' );
$this->assertFalse( $view['run']['pending'] );
$this->assertFalse( $view['checked'], 'No results before the first scan' );
@@ -2245,6 +2245,7 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
wc_get_container()->get( ScheduledScan::class )->queue();
$run = $this->view()['run'];
$this->assertSame( 'Checking your store', $run['message'], 'Shown beside a spinner' );
+ $this->assertSame( 'Check again', $run['label'], 'Turned off while the check runs' );
$this->assertTrue( $run['pending'] );
$this->assertFalse( $run['stalled'], 'A queued check is not stalled, so the page keeps polling' );
@@ -2257,11 +2258,12 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
$this->assertStringContainsString( 'tab=action-scheduler', $run['link']['href'] );
$this->assertTrue( $run['pending'] );
$this->assertTrue( $run['stalled'], 'and the page stops showing a spinner' );
+ $this->assertSame( 'Check your store', $run['label'], 'A stuck first check never ran, so the button does not say Check again' );
as_unschedule_all_actions( ScheduledScan::RUN_NOW_HOOK );
}
/**
- * @testdox The first visit to a store never checked starts the check: the page shows it running with a line on how long to wait, and later visits queue nothing more.
+ * @testdox The first visit to a store never checked starts the check: the page shows it running with a line on how long to wait, and later visits queue nothing more and say it didn't start.
*/
public function test_first_visit_starts_the_first_check(): void {
delete_option( AgentReadiness::REPORT_OPTION );
@@ -2271,18 +2273,20 @@ class AgenticCommerceSettingsTest extends WC_Unit_Test_Case {
$run = $this->view()['run'];
$this->assertTrue( $run['pending'], 'The visit queued the first check' );
$this->assertSame( 'Checking your store', $run['message'] );
- $this->assertSame( 'Your first check can take a few minutes. You can leave this page, and the results show here when it’s done.', $run['note'] );
+ $this->assertSame( 'This can take a little while on larger stores. Your results will show here.', $run['note'] );
$this->assertNotFalse( as_next_scheduled_action( ScheduledScan::RUN_NOW_HOOK, array(), ScheduledScan::GROUP ) );
as_unschedule_all_actions( ScheduledScan::RUN_NOW_HOOK );
- $run = $this->view()['run'];
+ $view = $this->view();
+ $run = $view['run'];
$this->assertFalse( $run['pending'], 'A first check that gave up is not queued again on every visit' );
$this->assertSame( '', $run['note'] );
+ $this->assertSame( 'The check didn’t start. Try again in a few minutes.', $view['last_checked'] );
$this->assertSame( 'Check your store', $run['label'], 'The merchant can still start one' );
wc_get_container()->get( ScheduledScan::class )->queue();
update_option( AgentReadiness::REPORT_OPTION, array( 'store_checks' => array() ), false );
- $this->assertSame( '', $this->view()['run']['note'], 'A check after the first one has results to show, so no wait line' );
+ $this->assertSame( 'This can take a little while on larger stores. Reload the page to see the new results.', $this->view()['run']['note'], 'A later check can outlast polling, so it says to reload for the new results' );
as_unschedule_all_actions( ScheduledScan::RUN_NOW_HOOK );
}
diff --git a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/ReadinessRestControllerTest.php b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/ReadinessRestControllerTest.php
index 8ed44d8a8f2..8c0de6cb0a5 100644
--- a/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/ReadinessRestControllerTest.php
+++ b/plugins/woocommerce/tests/php/src/Internal/AgentReadiness/ReadinessRestControllerTest.php
@@ -68,7 +68,7 @@ class ReadinessRestControllerTest extends WC_REST_Unit_Test_Case {
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v3/agent-readiness/view' ) );
$this->assertSame( 200, $response->get_status() );
$data = $response->get_data();
- $this->assertSame( 'Not checked yet', $data['last_checked'] );
+ $this->assertSame( 'The check didn’t start. Try again in a few minutes.', $data['last_checked'] );
$this->assertSame( 'Check your store', $data['run']['label'] );
$this->assertNull( $data['fix_first'] );
$this->assertSame( array(), $data['sections'] );