SEO: port Google site auto-verify to the Settings tab#49412
Conversation
Replace the legacy Traffic-page Google verification UI with a redesigned flow on the new admin page's Site verification card. Connected users can verify with Google via a WordPress.com keyring OAuth popup; manual meta-tag entry stays as a fallback (and is the only option on disconnected self-hosted sites). - get_google_verify_data() bootstraps seo.google_verify: the keyring connect URL (Keyring_Helper::connect_url) + whether the current user is connected (Manager), both guarded by class_exists since the host plugin provides them. - use-google-verify hook: fetches live verified status from /jetpack/v4/verify-site/google on mount (connected sites), and autoVerify() opens the keyring popup via @automattic/request-external-access and POSTs the keyring id to the same endpoint. Reuses the existing REST + verification_services_codes storage; no new endpoints. - GoogleVerificationField renders verified (with an owner-only Search Console link) / not-verified (Verify button + manual fallback) / disconnected (manual only) states using @wordpress/ui + @wordpress/components primitives. Dropped the legacy verbose 'Google will email about hacked/crawling' blurb. - Other four services unchanged. Test for the bootstrap contract. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Proposed changes
Ports the Google site auto-verify flow into the new Jetpack SEO admin page (Settings → Site verification), replacing the legacy
Jetpack → Settings → TrafficUI with a cleaner design. Part of the Jetpack SEO product split; addresses JETPACK-1686 (a #5b parity item — the old Traffic page can't be retired until this exists on the new admin).Targets trunk — the Settings tab it builds on (#49256) is already merged, so this is independent of the in-flight Content/AI PRs.
What it does
jetpack/v4/verify-site/googleendpoint to verify the site. Live verified status is fetched on mount.Implementation notes
Initializer::get_google_verify_data()bootstrapsseo.google_verify= the keyring connect URL (Keyring_Helper::connect_url( 'google_site_verification', 'other' )) + whether the current user is connected (Connection\Manager::is_user_connected()). Both are provided by the host plugin, so they're guarded withclass_exists(same pattern as the other plugin-provided helpers); on a disconnected site they degrade to empty URL / not-connected.@automattic/request-external-accesspackage (already used by Forms / external-connections) — one new dependency.jetpack/v4/verify-site/google(GET status + POST verify) and the existingverification_services_codesoption.@wordpress/uiBadge/Link/Stack,@wordpress/componentsButton withisBusy). The legacy "Google will email about hacked / crawling-indexing…" blurb was intentionally dropped as clutter.Other information
get_google_verify_data()bootstrap shape.Does this pull request change what data or activity we track or use?
No new data or telemetry. It relocates an existing verification flow and reuses the same endpoints/option.
Testing instructions
The SEO dashboard is behind the
rsm_jetpack_seofeature flag — enable it on the test site (add_filter( 'rsm_jetpack_seo', '__return_true' );) with theseo-toolsmodule active.On a connected site with the Settings tab:
On a disconnected self-hosted site:
5. Confirm the Google row shows only the manual code field (no Verify button).