-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add block compatibility debug info to Site Health #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor text changes.
I see this is now loading in The Does that make sense? |
Yes, the class is called on every site load. The code that renders the test in Site Health is hooked to I think this is correct, but please @mattyrob tell me if you agree with this. I can split the code in two classes. This means less code (not so much as I must duplicate some functions between the class) loaded (but not executed). But it's more confusing to me. |
I'm trying to figure out fully how this works and integrates with the existing compatibility class. Am I right that the current code with two classes is running a trace twice to detect block based code? If so, could we not just access the database values from the |
Yes, we have two options defined for almost the same thing, but the one defined in My idea is to allow people to disable Site Health (as I do on many sites). Ideally people should put Blocks Compatibility in troubleshooting when setting installing plugins and themes, and then put it on or off depending on installed plugins and theme, so no overhead when not in |
I think I have a better under standing now.
Ignore the above, the issue was I had a test plugin using a block function that was polyfilled, and when I disabled comparability I got an error, deactivating that test plugin resolved my critical error issue. Point still stands about the update_option_blocks_compatibility_level' hook potentially being in a 'settings' class with the debug and site health classes conditionally loaded from there. If that was in a separate class, and that was always loaded in That would reduce the code overhead being loaded if the Compatibility option was set to Off, and if maybe also if Site Health was disabled for example. It may also address the issue I've run into if that can be replicated. |
Now In this way (maybe) a plugin can require There is no way to check if Site Health is disabled, as you can turn it off by removing the menu or by clean the tests array, and that is done after this code load. |
Recent changes look good - do they impact on the hook to the option purge hooked function? Doe that still work purging the saved functions if compatibility mode setting is changed to Off? |
No, the hook is not affected. It's needed only when switching from debug to something else, and in that case the hook is in place. |
I haven't had the chance to test it yet. I'm curious if this would affects results of |
Don't know if it is what Viktor asked about but for wp profile:
About wp doctor... see #235 . |
Description
This PR adds debug informations to Site Health when Blocks Compatibility is in "Troubleshooting" mode.
How has this been tested?
Local testing.
Screenshots
Types of changes