Skip to content

Commit 0eb289a

Browse files
authored
SEO: Name the conflicting SEO plugin on the Overview (#53874)
* SEO: Report which conflicting SEO plugin owns the output The SEO module now names the plugin it steps aside for through a new jetpack_seo_conflicting_plugin filter, and the dashboard's Overview and Settings payloads carry that name so the screens can say who owns the output. * SEO: Name the conflicting plugin only while Jetpack steps aside Report the name only when jetpack_disable_seo_tools is on, so it can't contradict live output, and list paid editions before the free plugins they run alongside so the first match names the right one. * SEO: Name the conflicting SEO plugin on the Overview The Overview's generic "SEO tools are not enabled" warning now names the plugin when another SEO plugin is the reason. * SEO: Space the Overview warning off the cards below it * Changelog: Make the Overview entries comment-only, as the SEO page is gated
1 parent 875ca6a commit 0eb289a

5 files changed

Lines changed: 43 additions & 6 deletions

File tree

‎projects/packages/seo/_inc/screens/overview/index.tsx‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useSelect } from '@wordpress/data';
44
import { useCallback } from '@wordpress/element';
5-
import { __ } from '@wordpress/i18n';
5+
import { __, sprintf } from '@wordpress/i18n';
66
import { useNavigate } from '@wordpress/route';
77
import { Notice, Stack } from '@wordpress/ui';
88
import EnableSeoCard from '../../components/enable-seo-card';
@@ -122,12 +122,21 @@ const OverviewScreen: FC = () => {
122122
return (
123123
<div className={ styles.root }>
124124
{ ! data.plan.seo_enabled_for_site && (
125-
<Notice.Root intent="warning">
125+
<Notice.Root intent="warning" className={ styles.notice }>
126126
<Notice.Description>
127-
{ __(
128-
'SEO tools are not enabled on this site. Some cards reflect the underlying WordPress options only.',
129-
'jetpack-seo'
130-
) }
127+
{ data.conflicting_seo_plugin
128+
? sprintf(
129+
/* translators: %s: name of the SEO plugin that controls the site's SEO output, e.g. Yoast SEO. */
130+
__(
131+
'%s is managing your SEO titles and descriptions, so Jetpack’s are turned off.',
132+
'jetpack-seo'
133+
),
134+
data.conflicting_seo_plugin
135+
)
136+
: __(
137+
'SEO tools are not enabled on this site. Some cards reflect the underlying WordPress options only.',
138+
'jetpack-seo'
139+
) }
131140
</Notice.Description>
132141
</Notice.Root>
133142
) }

‎projects/packages/seo/_inc/screens/overview/style.module.scss‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
margin-inline: auto;
77
}
88

9+
// The warning above the card grid, spaced off it by the grid's own gap.
10+
.notice {
11+
margin-block-end: var(--wpds-dimension-gap-lg);
12+
}
13+
914
.grid {
1015
display: grid;
1116
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

‎projects/packages/seo/_inc/screens/overview/test/index.test.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,19 @@ describe( 'OverviewScreen', () => {
8787
expect( screen.getByText( 'Site visibility' ) ).toBeInTheDocument();
8888
expect( screen.getByText( 'Site verification' ) ).toBeInTheDocument();
8989
} );
90+
91+
it.each( [
92+
[ 'names the plugin that owns the output', 'Yoast SEO', /^Yoast SEO is managing your SEO/ ],
93+
[ 'falls back when no plugin is named', '', /^SEO tools are not enabled/ ],
94+
] )( 'with SEO output off, %s', ( _, plugin, notice ) => {
95+
getOverview.mockReturnValue( {
96+
...buildOverview(),
97+
plan: { seo_enabled_for_site: false },
98+
conflicting_seo_plugin: plugin,
99+
} );
100+
101+
render( <OverviewScreen /> );
102+
103+
expect( screen.getByText( notice ) ).toBeInTheDocument();
104+
} );
90105
} );
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Overview: Name the conflicting SEO plugin in the SEO-off warning, and space it off the cards. The new SEO page is gated.
4+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
Comment: SEO: Name the conflicting SEO plugin on the gated SEO Overview.
4+

0 commit comments

Comments
 (0)