Investigate cURL error appearing on Tools > Site Health check when plugin active
See https://wordpress.org/support/topic/sitehealth-curl-error-28/#post-11708951
Replication steps:
- Activate WP PHP Console only
- Visit Tools > Site Health check
- A cURL error is returned for WP API check - but the WP API works correctly while WP PHP Console is active.
To do:
- Investigate whether this is WP PHP Console fault
- If yes, maybe add an exclusion to process in that page only?
Low priority.
Recently had a chance to revisit this issue.
As of WordPress 5.2.3 the errors are shown as follows when WP PHP Console is active:

An exclusion may work on the page, but the issue is triggered by a loopback requests in background; therefore, a simple detection of the current page the browser client is seeing won't catch that.
One could probably exclude loading the plugin if REST_REQUEST is loaded, although this may prevent catching other legitimate errors.
To reduce the scope of the exclusion one could match also other request parameters as show in https://wordpress.stackexchange.com/questions/221202/does-something-like-is-rest-exist - the site health check pings wp/v2/types/post currently.
However, loopback requests would still be an issue, because WP PHP Console is also interacting with those, and the site health check issues a remote GET to the admin_url() without much useful info to discern it from other legit requests.
Interestingly enough, the callback test on WooCommerce Status > Tools seems to pass.
For the time being some notice could be displayed while WP PHP Console is active on the site health check, to warn users about a false positive.