Description
Issue Overview
As mentioned in today's core-editor meeting
I believe that Gutenberg could be significantly improved if it could detect unexpected server responses, especially things like PHP Notices and Warnings
and it should
- Ignore them for the purposes of determining what actually happened.
- Let the user know about the problem gracefully.
I have experienced a number of situations, where PHP Notices and Warnings get returned along with the validly formed JSON response.
- Some of these are out of my control.
- Most of them are good to know about.
- Especially if you're a developer running with WP_DEBUG true
- They don't cause a problem with the Classic editor
Steps to Reproduce (for bugs)
- Find a plugin or theme that produces Notices or Warnings or simply echoes things when it shouldn't
- Add a new post
- Use it for a while
- Notice Updating Failed messages
- Look in the Browser Console log to see unwanted HTML
- But notice that the updates did actually work.
For a particularly good example of a misbehaving plugin see https://github.com/bobbingwide/dinlo
Expected Behavior
It would be nice if Gutenberg could filter out what's not part of the JSON response and report the results based on that information.
It would also be nice if it was able to report nicely what the problem was.
Current Behavior
In the classic editor the messages appear. Many are just an annoyance but the editor works.
Possible Solution
Screenshots / Video
Here's the simplest example I could think of.
Add an HTML comment to the top of the gutenberg.php plugin.
<!-- 4936 -->
Related Issues and/or PRs
Todos
- Tests
- Documentation