site-kit-wp: Potential REST error in WordPress 5.5
Bug Description
After updating to WordPress 5.5 in our test environment, we have this error in the admin dashboard:
Notice: register_rest_route was called incorrectly. The REST API route definition for pum/v1/analytics is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.) in /code/wp-includes/functions.php on line 5225
I’ve narrowed down the issue to the Site Kit plugin by disabling plugins. This error disappears as soon as the plugin is deactivated and reappears as soon as it is activated. Since this a test environment, nothing is set up in the plugin itself.
Steps to reproduce
- Enable the Site Kit by Google WordPress plugin
- See the error at the top of all WP admin pages
Additional Context
- PHP Version: 7.4.9
- Wordpress Version: 5.5
- Plugin Version: 1.13.1
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
QA Brief
Changelog entry
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (2 by maintainers)
@adamsilverstein I can confirm what you’re indicating here. When I was attempting to identify the issue on my site, I started at the top of my list of plugins, disabling them one by one, to find the culprit and stopped when I got to Site Kit because the error messages went away.
I re-enabled Site Kit and continued down the list and found that several other plugins that I’m using, all part of the Toolset (https://toolset.com/) that system seem to be at the core of this. As I disabled each one, more of the messages started to disappear, and when I had all of the Toolset plugins disabled, the messages were gone completely. I’ll be opening a thread on their forum as well.
Update (before even completing this comment) - I thought I’d leave the last bit in there just for context, but as I was going through and re-enabling the Toolset plugins, I noticed that there was an update for them, posted yesterday (I usually try to stay on top of updates), which has resolved this issue for me. I am able to have the Toolset plugins and Site Kit enabled simultaneously without issue.
For others experiencing this issue, it would be good to analyze the other plugins you may have on your site, it appears that Site Kit is merely caught in the crossfire on this one.
Thanks for the updates @lukkymike, that’s really helpful!
@adamsilverstein @aaemnnosttv Given this issue was caused by other plugins not providing a
permission_callback
, I believe we should close this. There is #1924 to fix our own post search route.@adamsilverstein I’ve opened #1924 to deal with the post search REST route.
The reports of these users don’t seem related to that though, so it has to be something else. Have you tried using one of those plugins with Site Kit? The only thing I could see is some sort of conflict, although I’m not even sure how having Site Kit active could trigger that PHP warning for another plugin 🤔
Here is our report generated by Site Health:
Our setup is a little different from a typical WordPress server, since we’re on the Pantheon cloud platform. This isn’t our production environment, but the server configuration should be a clone of what we’re running live.