Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#52483 closed defect (bug) (fixed)

Site Health breaks when heartbeat deregistered

Reported by: gmariani405's profile gmariani405 Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 5.7 Priority: normal
Severity: normal Version: 5.6.1
Component: Site Health Keywords: has-patch
Focuses: Cc:

Description

Site Health fails to complete if a plugin de-registers the heartbeat script which Site Health relies on to include wp-hooks. This occurs if you use a plugin to manage when heartbeat runs and how often.

I'd suggest listing wp-hooks as a dependency for Site Health instead of relying on heartbeat to include it.

This is the error generated on the Site Health page when heartbeat is de-registered:

11:36:24.820 TypeError: wp.hooks is undefined site-health.min.js:2:3983
    t https://example.com/wp-admin/js/site-health.min.js:2
    jQuery 4

Attachments (2)

screenshot.png (98.7 KB) - added by gmariani405 3 years ago.
Screenshot of error on Site Health page
52483.diff (958 bytes) - added by mukesh27 3 years ago.
Updated patch.

Download all attachments as: .zip

Change History (9)

@gmariani405
3 years ago

Screenshot of error on Site Health page

This ticket was mentioned in PR #989 on WordPress/wordpress-develop by Clorith.


3 years ago
#1

  • Keywords has-patch added

#2 @Clorith
3 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.7

Good catch! Yes Site Health should be declaring that dependency explicitly as you mentioned. See PR 989 which adds the dependency.

Milestoning this for 5.7, as it's a bug with a clear solution, and the solution provides no side-effects.

#3 @peterwilsoncc
3 years ago

  • Keywords needs-refresh added; commit removed

@Clorith wp-i18n is also missing as a direct dependency of the site-health JavaScript. It would be dandy to include that while making the change.

I did a quick search through the file for window. and wp. and I think once i18n is included everything will be good to go.

@mukesh27
3 years ago

Updated patch.

#4 @mukesh27
3 years ago

  • Keywords needs-refresh removed

52483.diff updated patch.

#5 @Clorith
3 years ago

Ahh, good catch, I was incidentally running the plugin version, which doesn't ahve the same dependencies (working on fixing that :) )

52483.diff looks good to go then.

#6 @peterwilsoncc
3 years ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

In 50294:

Site Health: Update site-health script dependencies.

Add wp-hooks and wp-i18n to Site Health JavaScript dependencies.

Props gmariani405, Clorith, mukesh27.
Fixes #52483.

Clorith commented on PR #989:


3 years ago
#7

Fixed in trunk.

Note: See TracTickets for help on using tickets.