SEO: add an AI tab and move the AI SEO Enhancer setting#49408
Draft
angelablake wants to merge 1 commit into
Draft
SEO: add an AI tab and move the AI SEO Enhancer setting#49408angelablake wants to merge 1 commit into
angelablake wants to merge 1 commit into
Conversation
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
cb8dbe1 to
3cc4b34
Compare
…-1683) Stand up an AI tab in the SEO dashboard and relocate the AI SEO Enhancer toggle (auto-generate SEO title/description/alt-text for new posts) from the legacy Traffic page onto it. Additive only — the legacy toggle stays until PR #5b removes the old page. - New 'ai' tab in app.tsx (always visible — free AI settings will be added here later by separate llms.txt / AI-crawler work). - get_ai_data() bootstraps seo.ai script-data: the enhancer's enabled state plus availability, which mirrors the legacy gate (the ai_seo_enhancer_enabled feature filter AND Current_Plan::supports('ai-seo-enhancer'); Current_Plan guarded by class_exists as it's host-plugin-provided). - AiScreen renders the enhancer toggle only when available; useAiForm saves on change through the existing /jetpack/v4/settings endpoint (no new REST), with the same snackbar + revert-on-error as Settings. Lifted to the page root so the value survives tab switches. - Tests: get_ai_data() contract (shape + unavailable without a supporting plan). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3cc4b34 to
71ad180
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Adds an AI tab to the Jetpack SEO dashboard and moves the existing AI SEO Enhancer setting onto it.
This re-scopes what was originally planned as the larger "AI tab" PR: it stands up the tab shell and ports the one setting that already exists, so the bigger AI features (llms.txt, AI-crawler controls) can be built on top of it separately by their own efforts.
Why now
ai_seo_enhancer_enabled— "Automatically generate SEO title, SEO description, and image alt text for new posts") currently lives only on the legacy SEO Traffic page. It needs a home on the new admin before that page is eventually removed.What this PR does
_inc/app.tsx). The tab itself is not plan-gated — it stays visible on all hosting, since free AI settings will be added to it later.Initializer::get_ai_data()bootstraps aseo.aislice onto the page (window.JetpackScriptData.seo.ai) with the enhancer'senabledstate and whether it'savailable. Availability mirrors the legacy gate: theai_seo_enhancer_enabledfeature filter must be on (the feature still depends on AI being available) and the site's plan must support theai-seo-enhancerfeature (Current_Plan::supports(), guarded byclass_existsas it's provided by the host plugin)._inc/screens/ai/) renders the enhancer toggle only when available (parity with the legacy page); otherwise it shows a neutral placeholder so the tab isn't blank. The toggle saves on change through the existing/jetpack/v4/settingsendpoint (ai_seo_enhancer_enabled) — no new REST — with the same "Updating settings…"→"Settings saved." snackbar as the Settings tab, reverting on error. State is lifted to the page root so it survives tab switches.This is additive: the legacy Traffic-page toggle is left in place and removed later when the old page is retired. Generation itself is entirely editor/AI-Assistant side, so there is no PHP generation logic to move — only the persisted toggle and its plan-gate.
Other information
Initializer::get_ai_data()contract test (shape + unavailable without a supporting plan) in the SEO package suite.Does this pull request change what data or activity we track or use?
No. It relocates an existing setting's UI; no new options or telemetry.
Testing instructions
ai_seo_enhancer_enabledoption.The SEO dashboard is behind the
rsm_jetpack_seofeature flag; enable it on the test site to reach the page.