wp-php-console icon indicating copy to clipboard operation
wp-php-console copied to clipboard

Investigate cURL error appearing on Tools > Site Health check when plugin active

Open unfulvio opened this issue 6 years ago • 1 comments

See https://wordpress.org/support/topic/sitehealth-curl-error-28/#post-11708951

Replication steps:

  1. Activate WP PHP Console only
  2. Visit Tools > Site Health check
  3. A cURL error is returned for WP API check - but the WP API works correctly while WP PHP Console is active.

To do:

  1. Investigate whether this is WP PHP Console fault
  2. If yes, maybe add an exclusion to process in that page only?

Low priority.

unfulvio avatar Jul 08 '19 03:07 unfulvio

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:

image

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.

unfulvio avatar Sep 30 '19 09:09 unfulvio