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

  1. Enable the Site Kit by Google WordPress plugin
  2. 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)

Most upvoted comments

@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:

### wp-core ###

version: 5.5
site_language: en_US
user_language: en_US
timezone: America/Indiana/Indianapolis
permalink: /%postname%/
https_status: true
user_registration: 0
blog_public: 1
default_comment_status: open
multisite: false
user_count: 14
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /code
wordpress_size: 169.33 MB (177554298 bytes)
uploads_path: /code/wp-content/uploads
uploads_size: 4.44 GB (4771226375 bytes)
themes_path: /code/wp-content/themes
themes_size: 11.36 MB (11910844 bytes)
plugins_path: /code/wp-content/plugins
plugins_size: 66.68 MB (69920327 bytes)
database_size: 694.91 MB (728662016 bytes)
total_size: 5.36 GB (5759273860 bytes)

### wp-dropins (1) ###

object-cache.php: true

### wp-active-theme ###

name: SMWC Theme (smwc)
version: 1.6.4
author: mjkretsinger
author_website: http://mjkretsinger.com/
parent_theme: none
theme_features: core-block-patterns, menus, post-thumbnails, html5, title-tag, disable-custom-font-sizes, editor-font-sizes, disable-custom-colors, editor-color-palette, responsive-embeds, editor-style
theme_path: /code/wp-content/themes/smwc
auto_update: Disabled

### wp-mu-plugins (1) ###

Pantheon: version: 0.1, author: Pantheon

### wp-plugins-active (40) ###

ACF: Better Search: version: 3.5.3, author: Mateusz Gbiorczyk, Auto-updates disabled
ACF Content Analysis for Yoast SEO: version: 2.6, author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast, Auto-updates disabled
Advanced Custom Fields: Nav Menu Field: version: 2.0.0, author: Faison Zutavern, Auto-updates disabled
Advanced Custom Fields PRO: version: 5.8.13, author: Elliot Condon (latest version: 5.8.14), Auto-updates disabled
Akismet Anti-Spam: version: 4.1.6, author: Automattic, Auto-updates disabled
Breadcrumb NavXT: version: 6.5.0, author: John Havlik, Auto-updates disabled
Column Shortcodes: version: 1.0, author: Codepress (latest version: 1.0.1), Auto-updates disabled
Content Audit: version: 2.0, author: Stephanie Leary, Auto-updates disabled
Disable Gutenberg Blocks - Block Manager: version: 1.0.8, author: Danny Cooper, Auto-updates disabled
Email Address Encoder: version: 1.0.21, author: Till Krüss, Auto-updates disabled
Enable Media Replace: version: 3.4.1, author: ShortPixel, Auto-updates disabled
Force Strong Passwords: version: 1.8.0, author: Jason Cosper, Auto-updates disabled
HashBar - WordPress Notification Bar: version: 1.1.2, author: HT Plugins (latest version: 1.1.3), Auto-updates disabled
Instagram Feed Pro Personal: version: 5.6.4, author: Smash Balloon, Auto-updates disabled
Lightbox with PhotoSwipe: version: 3.0.6, author: Arno Welzel, Auto-updates disabled
Limit Login Attempts Reloaded: version: 2.15.1, author: WPChef, Auto-updates disabled
MCE Table Buttons: version: 3.3, author: Jake Goldman, 10up, Oomph, Auto-updates disabled
MJK Wufoo Integration: version: 1.0, author: MJ Kretsinger, Auto-updates disabled
Native PHP Sessions for WordPress: version: 1.2.0, author: Pantheon, Auto-updates disabled
Nested Pages: version: 3.1.11, author: Kyle Phillips, Auto-updates disabled
Pantheon Advanced Page Cache: version: 1.0.0, author: Pantheon, Auto-updates disabled
Popup Maker: version: 1.11.1, author: Popup Maker, Auto-updates disabled
Post Duplicator: version: 2.21, author: Metaphor Creations, Auto-updates disabled
Public Post Preview: version: 2.9.1, author: Dominik Schilling, Auto-updates disabled
Real Media Library: version: 4.9.1, author: devowl.io, Auto-updates disabled
Redirection: version: 4.8, author: John Godley, Auto-updates disabled
Regenerate Thumbnails Advanced: version: 2.3.1, author: ShortPixel, Auto-updates disabled
Relevanssi: version: 4.7.2.1, author: Mikko Saari (latest version: 4.8.0), Auto-updates disabled
Revisionize: version: 2.3.3, author: Jamie Chong, Auto-updates disabled
Search Exclude: version: 1.2.5, author: Roman Pronskiy, Auto-updates disabled
Simple History: version: 2.35.1, author: Pär Thernström, Auto-updates disabled
Site Kit by Google: version: 1.13.1, author: Google (latest version: 1.14.0), Auto-updates disabled
Smush: version: 3.6.3, author: WPMU DEV, Auto-updates disabled
SVG Support: version: 2.3.18, author: Benbodhi, Auto-updates disabled
WP Accessibility: version: 1.7.1, author: Joe Dolson, Auto-updates disabled
WP Lazy Loading: version: 1.1, author: The WordPress Team, Auto-updates disabled
WP Mail SMTP: version: 2.2.1, author: WPForms, Auto-updates disabled
WP Redis: version: 1.1.0, author: Pantheon, Josh Koenig, Matthew Boynes, Daniel Bachhuber, Alley Interactive, Auto-updates disabled
WP Retina 2x: version: 5.6.1, author: Jordy Meow, Auto-updates disabled
Yoast SEO: version: 14.7, author: Team Yoast, Auto-updates disabled

### wp-plugins-inactive (1) ###

Regenerate Thumbnails: version: 3.1.3, author: Alex Mills (Viper007Bond), Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1690
imagemagick_version: ImageMagick 6.9.10-86 Q16 x86_64 2020-01-13 https://imagemagick.org
file_uploads: File uploads is turned off
post_max_size: 100M
upload_max_filesize: 100M
max_effective_size: 100 MB
max_file_uploads: 20
imagick_limits: 
	imagick::RESOURCETYPE_AREA: 126 GB
	imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
	imagick::RESOURCETYPE_FILE: 24576
	imagick::RESOURCETYPE_MAP: 126 GB
	imagick::RESOURCETYPE_MEMORY: 63 GB
	imagick::RESOURCETYPE_THREAD: 16
gd_version: bundled (2.1.0 compatible)
ghostscript_version: 9.25

### wp-server ###

server_architecture: Linux 4.19.112+ x86_64
httpd_software: nginx/1.16.1
php_version: 7.4.9 64bit
php_sapi: fpm-fcgi
max_input_variables: 10000
time_limit: 120
memory_limit: 512M
max_input_time: 900
upload_max_size: 100M
php_post_max_size: 100M
curl_version: 7.61.1 OpenSSL/1.1.1c
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true

### wp-database ###

extension: mysqli
server_version: 10.0.23-MariaDB-log
client_version: mysqlnd 7.4.9

### wp-constants ###

WP_HOME: https://wp55-smwc.pantheonsite.io
WP_SITEURL: https://wp55-smwc.pantheonsite.io
WP_CONTENT_DIR: /code/wp-content
WP_PLUGIN_DIR: /code/wp-content/plugins
WP_MAX_MEMORY_LIMIT: 512M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: /code/wp-content/uploads/debug.log
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_LOCAL_DEV: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

### google-site-kit ###

version: 1.13.1
php_version: 7.4.9
wp_version: 5.5
reference_url: https://wp55-smwc.pantheonsite.io
amp_mode: no
site_status: not-connected
user_status: not authenticated
active_modules: site-verification, search-console, adsense, analytics, pagespeed-insights, tagmanager
required_scopes: 
	openid: ✅
	https://www.googleapis.com/auth/userinfo.profile: ✅
	https://www.googleapis.com/auth/userinfo.email: ✅
	https://www.googleapis.com/auth/siteverification: ✅
	https://www.googleapis.com/auth/webmasters: ✅
	https://www.googleapis.com/auth/adsense.readonly: ✅
	https://www.googleapis.com/auth/analytics.readonly: ✅
	https://www.googleapis.com/auth/tagmanager.readonly: ✅
search_console_property: https://wp55-smwc.pantheonsite.io/
adsense_account_id: none
adsense_client_id: none
adsense_account_status: none
adsense_use_snippet: yes
analytics_account_id: 7344•••
analytics_property_id: UA-7344•••••
analytics_profile_id: 1310•••••
analytics_use_snippet: no
tagmanager_account_id: 5111•••••
tagmanager_container_id: GTM-TK7•••
tagmanager_amp_container_id: none
tagmanager_use_snippet: yes

### wp_mail_smtp ###

version: 2.2.1
license_key_type: lite
debug: No debug notices found.
db_tables: wp_wpmailsmtp_tasks_meta

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.