#54617 closed enhancement (fixed)
Add more details when site health checks fail
Reported by: | dingo_d | Owned by: | Clorith |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Site Health | Keywords: | needs-copy-review has-patch |
Focuses: | Cc: |
Description
I encountered a notice that said:
The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages. The REST API call gave the following unexpected result: (401) <html> <head><title>401 Authorization Required</title></head> <body bgcolor="white"> <center><h1>401 Authorization Required</h1></center> <hr><center>nginx</center> </body> </html> .
Now, I can see that it's probably something in nginx being blocked. But I have no idea what or on what API call this error happened.
It would be awesome if this error was more like:
The REST API call gave the following unexpected result when checking the following endpoint: ...
That way I could check this endpoint, see if I'm getting any errors or not, poke around a bit.
I remember there being similar notices thrown by the site health check, that were missing debug info.
Maybe some additional debugging information would be a good idea to have as well, for developers. wp_debug_backtrace_summary() function could be used if some issue was encountered with more debugging details.
Attachments (1)
Change History (11)
#4
@
2 years ago
- Keywords needs-copy-review added
Adding the proposed new strings here for someone with better copy-editing skills than I to have a quick look over and give the all clear :)
The Titles have not been modified, but the responses for number 2, and 3, have both been modified to simplify them, and provide a bit more details.
- If no problems are detected;
Title:
The REST API is available
Body:
The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
- If an error is encountered;
Title:
The REST API encountered an error
Body:
The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
When testing the REST API, an error was encountered;
REST API Endpoint: <URL being requested>
REST API Response: (<WP_HTTP API error code>) <WP_HTTP API error message>
- If an unexpected result was encountered;
Title:
The REST API encountered an unexpected result
Body:
The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
When testing the REST API, an unexpected result came up;
REST API Endpoint: <URL being requested>
REST API Response: (<HTTP Response code>) <Human readable error message for the HTTP response code>
(Note: This was originally quite messy, as it would output all the markup returned, which was not very helpful)
- If the result was successful, but the data returned did not indicate that things are working as expected;
Title:
The REST API did not behave correctly
Body:
The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
The REST API did not process the
context
query parameter correctly.
This ticket was mentioned in Slack in #core by clorith. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by clorith. View the logs.
2 years ago
#7
@
2 years ago
@Clorith Suggesting some minor changes to make this a bit more parseable for non-technical users (I hope!). See below and let me know if you have any questions.
- If no problems are detected;
Title:
The REST API is available
Body:
The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.
- If an error is encountered;
Title:
The REST API encountered an error
Body:
The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.
When testing the REST API, an error was encountered:
REST API Endpoint: <URL being requested>
REST API Response: (<WP_HTTP API error code>) <WP_HTTP API error message>
- If an unexpected result was encountered;
Title:
The REST API encountered an unexpected result
Body:
The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.
When testing the REST API, an unexpected result was returned:
REST API Endpoint: <URL being requested>
REST API Response: (<HTTP Response code>) <Human readable error message for the HTTP response code>
- If the result was successful, but the data returned did not indicate that things are working as expected;
Title:
The REST API isn't working as expected
Body:
The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.
The REST API did not process thecontext
query parameter correctly.
This ticket was mentioned in PR #3276 on WordPress/wordpress-develop by Clorith.
2 years ago
#8
- Keywords has-patch added
Updates the texts returned for the various REST API statuses, with more accurate and user-friendly details.
Trac ticket: https://core.trac.wordpress.org/ticket/54617
I think we could safely introduce the information on what endpoint was attempted here, that seems fine.
I would not want to introduce backtraces or similar, this is a screen intended for non-technical users to either resolve scenarios on their own, or get the details on where to discover how to resolve it, and a backtrace is just far too technical an element to add to the mix at that point.
I've attached 54617.JPG as an example of giving slightly more details (and I think it might make more sense to strip html, instead of just escaping it, from the response body here, looking at your example there's a lot of markup at times).
The example splits out the response from the long string, putting it on its own line wit ha clear definition in front of it of what the user is looking at, which I think will also be more useful in the long run.