Make WordPress Core

Opened 4 months ago

Last modified 9 days ago

#62846 assigned enhancement

Allow direct linking to site health check result

Reported by: sippis's profile sippis Owned by: audrasjb's profile audrasjb
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: reporter-feedback has-test-info has-screenshots changes-requested
Focuses: ui Cc:

Description

It would be neat if directly linking to a site health check result would be possible. The link should open the linked check to show the description.

Use case: plugin is checking if site can communicate with a necessary 3rd party server. Communication with that server is mission critical for the plugin functionality to work. There's check for that in site health, and in case of failure also admin notice. Health check description contains more explanation of possible causes and instructions how to fix. In this case, it would make a lot of sense to have direct link in the notice to the test having that description.

Attachments (1)

Screen Recording 2025-02-22 at 10.53.15 AM.mov (915.0 KB) - added by pratiklondhe 3 months ago.

Download all attachments as: .zip

Change History (15)

#1 @audrasjb
4 months ago

  • Focuses ui added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.8
  • Owner set to audrasjb
  • Status changed from new to assigned

Hello, I support this proposal at 100%!
I'm moving this to milestone 6.8 since I think I should be able to work on this one, but other PRs are welcome!

This ticket was mentioned in PR #8184 on WordPress/wordpress-develop by @audrasjb.


4 months ago
#2

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/62846

This PR does the following changes:

  • Add an ID to each accordion button
  • On page load, get the hash and open the related accordion
  • Update the URL hash each time an accordion button is clicked

This way, people can use the URL of the page to share a direct link to the site health info section they want.
Note: As a first iteration, this changeset doesn't add any UI button.

#3 @audrasjb
4 months ago

  • Keywords reporter-feedback added

@sippis the above PR is a first iteration on this feature. It doesn't add any button but you can just use the URL of the screen after clicking any Site Health Info section. Does it work on your side?

#4 @audrasjb
4 months ago

Testing instruction partially provided in the PR.

Please note that this pull request can't be tested on the Playground link provided in the PR as Playground cannot interact with URL hashes.

#5 @audrasjb
3 months ago

  • Keywords needs-testing has-testing-info added

This ticket was mentioned in Slack in #core-test by audrasjb. View the logs.


3 months ago

#7 @pratiklondhe
3 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/8184.diff

Environment

  • WordPress: 6.8-alpha-20250222.101448
  • PHP: 8.1.29
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.1.29)
  • Browser: Firefox 135.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.1
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ❌ While the accordion with the hash id got highlighted, the accordion did not expand as expected ( attaching a video of the test )

Additional Notes

  • It seems the code added in the on-load is not getting executed at all

#8 @vgnavada
3 months ago

  • Keywords has-screenshots added

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8184

Environment

  • WordPress: 6.8-alpha-20250123.235129
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Translator (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 133.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

✅ Each Site Health section has a unique ID, making it possible to reference them via URL fragments.

<button id="health-check-section-wp-paths-sizes".......>
<button id="health-check-section-wp-active-theme"......>
<button id="health-check-section-wp-plugins-inactive"..>

✅ The accordion panels are correctly referenced using aria-controls, ensuring proper structure.

<button id="health-check-section-wp-core" aria-controls="health-check-accordion-block-wp-core">

✅ Clicking a section manually expands it as expected.

❌ However, when accessing a section using a direct URL with a hash fragment (e.g., #health-check-section-wp-core), the section does not expand automatically.

❌ The page loads, but it doesn’t scroll to or expand the relevant section.

❌ Additionally, window.location.hash does not return the expected value in the console, which might indicate a script interfering with the URL fragment handling.
https://i.ibb.co/0RDyB9nH/image.png

Additional Notes

  • The setup for direct linking is in place, but the expected behavior isn’t working yet.

Supplemental Artifacts

Add Inline: No image "REPLACE_WITH_IMAGE_URL" attached to Ticket #62846

This ticket was mentioned in Slack in #core-test by vgnavada. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-test by krupajnanda. View the logs.


3 months ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


3 months ago

#12 @audrasjb
3 months ago

  • Milestone changed from 6.8 to 6.9

As per today's bug scrub: It appears this ticket still needs some work. As 6.8 beta 1 is very close, I'm moving it to 6.9. Feel free to move it back to 6.8 if it can be committed by Monday.

#13 @SirLouen
3 weeks ago

  • Keywords changes-requested added; has-patch needs-testing removed

There are two existing patch reports for the given patch.
Removing needs-testing, as @audrasjb suggests, more work is required into this patch

@sippis can you provide more information to help develop a better patch according to what audrasjb initially submitted?

#14 @wordpressdotorg
9 days ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.