Extend Site Health Info with module tag statuses
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 383
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 77
Description
## Feature Description
In #5695, we introduced async status checks for Site Kit tags on the Site Health "Status" tab which primarily surfaces recommendations and errors to users. This will help surface issues if tags are not being placed or if they're not detected.
It would also be useful to additionally include this information in the "Info" tab of Site Heath, which SK has long extended with its own section. This was originally planned for 5695 but was removed from the scope due to complications with the async nature of the checks. This can be revisited however, as core itself does at least one async check for the site health info: directory sizes. The complication comes from needing to update both the HTML in the table on the page, but also the plain text version of that data which can be copied to the clipboard which is separately stored in an HTML attribute on the button. See https://github.com/WordPress/WordPress/blob/e19c18cba94edea039c8b137138ba94df0097d06/wp-admin/js/site-health.js#L375-L438
---------------
_Do not alter or remove anything below. The following sections will be managed by moderators only._
## Acceptance criteria
* The Site Health **Info** tab's "Site Kit by Google" section shows a tag placement status for each connected module that places a tag. Each module is named, a module that checks more than one page is shown once per page, and its status uses the same wording the **Status** tab's **Tag Placement** test shows:
* _Tag detected and placed by Site Kit._
* _Tag detected but could not verify that Site Kit placed the tag._
* _No tag detected._
* _Tag placement disabled in settings._ (when tag placement is turned off in the module's settings)
* _There was an error while trying to get the status, please try again later._ (when that module's status check fails)
* The statuses load asynchronously after the **Info** tab renders:
* The section shows a loading state for the tag placement status, then the statuses replace it once the check finishes.
* After the statuses load, the **Copy site info to clipboard** button copies them, and the copied text matches what the section shows on the page.
* When no per-module status can be reported, the section shows the matching **Status** tab message instead of the list:
* _Tag status not available: no modules that place tags are connected._ (when no connected module places a tag)
* _Tags are not output in the current environment._ (when the environment type is not production)
* _This feature requires WordPress version 5.6 or higher_ (when WordPress is below version 5.6)
## Implementation Brief
* [ ]
### Test Coverage
*
## QA Brief
*
## Changelog entry
*
Contributor guide
Research direction
Start with the Site Health Info tab's existing Site Kit by Google section and the Site Health async handling in wp-admin/js/site-health.js, especially lines 375-438. Compare the existing Status tab Tag Placement wording and determine how the Info tab's loading state updates both displayed HTML and copied site-info text. Done means the listed fallback states, per-module statuses, and clipboard output match the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100