Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#50282 closed defect (bug) (fixed)

wp_ajax_health_check_is_in_debug_mode is not used, contains incorrect nonce check

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 5.6 Priority: low
Severity: normal Version: 5.2
Component: Site Health Keywords:
Focuses: Cc:


The wp_ajax_health_check_is_in_debug_mode() function is not used because the is_in_debug_mode site health check is a direct one, not an async one, therefore this Ajax handler is not used.

In addition the nonce check in this function is incorrect. wp_verify_nonce() is called without its return value being checked, rendering it non-functional.

It looks like this function can be safely removed. Marking as needs a second opinion in case I missed something.

Change History (4)

#1 @johnbillion
3 years ago

  • Milestone changed from Awaiting Review to 5.6
  • Priority changed from normal to low

Can I get a second opinion on removing this function?

#2 @Clorith
3 years ago

Sorry about the late followup, yes it should be fine to remove this, it looks to be an accidental fragment of a previous implementation used in the plugin before it was merged to core.

#3 @johnbillion
3 years ago

  • Keywords 2nd-opinion removed
  • Owner set to johnbillion
  • Status changed from new to accepted

#4 @johnbillion
3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 49122:

Site Health: Remove an unused function that was erroneously added when the site health feature was introduced.

This function was and is never used as the is_in_debug_mode check is a direct one.

Fixes #50282

Note: See TracTickets for help on using tickets.