Make WordPress Core

Opened 11 months ago

Last modified 7 weeks 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: 7.0 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: has-test-info has-screenshots dev-feedback
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 10 months ago.

Download all attachments as: .zip

Change History (25)

#1 @audrasjb
11 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.


11 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
11 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
11 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
10 months ago

  • Keywords needs-testing has-testing-info added

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


10 months ago

#7 @pratiklondhe
10 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
10 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.


10 months ago

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


10 months ago

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


9 months ago

#12 @audrasjb
9 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
8 months 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
7 months ago

  • Keywords has-test-info added; has-testing-info removed

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


5 months ago
#15

  • Keywords has-patch added

#16 @nikunj8866
5 months ago

  • Keywords needs-testing added; changes-requested removed

#17 @pmbaldha
5 months ago

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

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/9176.diff

Environment

  • WordPress: 6.9-alpha-20250701.133748
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ❌ Issue resolved with patch.

When we put any passed tests section URL in a browser, the passed tests section does not open. Other things are working fine.

Additional Notes

Supplemental Artifacts

Add Inline: https://img001.prntscr.com/file/img001/YErMEHDjQkiO5gxD6Vs3yA.png

#18 @nikunj8866
5 months ago

  • Keywords dev-feedback added; changes-requested removed

Thanks for the testing info, @pmbaldha

I've debugged the issue and found that the Site Health > Status tab loads its content via an AJAX request. Because of this, the specific accordion section referenced by the hash (e.g., #health-check-section-php_default_timezone) isn't immediately available in the DOM when the page loads, so the section doesn't open as expected.

To prevent confusion, I've removed the hash-based link sharing for the Status tab accordion items.

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


2 months ago

#20 @wildworks
2 months ago

  • Keywords needs-testing added

This ticket was featured on today's 6.9 Bug Scub.

The linked PR seems to have been updated, so I'd appreciate it if someone could test it again.

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


8 weeks ago

#22 @sajjad67
8 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

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

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.29
  • Server: nginx/1.29.1
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 141.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • Patch working correctly. When visited to specific section it does expand now that section with section heading highlighted.

Supplemental Artifacts

http://localhost:8889/wp-admin/site-health.php?tab=debug#health-check-section-wp-filesystem

https://img001.prntscr.com/file/img001/Qfe6NyE0Sm-dbZCK178J4g.png

http://localhost:8889/wp-admin/site-health.php?tab=debug#health-check-section-wp-server

https://img001.prntscr.com/file/img001/MnHVSh1oQJ-5LbAPKIz4Uw.png

http://localhost:8889/wp-admin/site-health.php?tab=debug#health-check-section-wp-active-theme

https://img001.prntscr.com/file/img001/p8lqWspzRIyfrCqZJZhmhg.png

#23 @nikunj8866
8 weeks ago

  • Keywords reporter-feedback needs-testing removed

#24 @wildworks
7 weeks ago

  • Milestone changed from 6.9 to 7.0

Since the 6.9 Beta1 release is coming soon, let's puntthis ticket to 7.0.

Note: See TracTickets for help on using tickets.