After latest update

Hi @jadolyo,

Thanks for reaching out. So we can determine more on this please share your Site Health information. You can use this form to share privately if preferred.

Once we have the above I can propose some troubleshooting suggestions, which may include using the Health Check & Troubleshooting plugin, to rule out possible third party plugin conflicts.

 

Hello @jamesosborne

I sent the site health information in the form.

 

Many thanks for sharing. I can see you’re using the JWT Auth plugin, for which there is a known conflict with the Site Kit dashboard. You’ll find more details on this on this GitHub issue.

In order to resolve this you can use this mini plugin. You can download this as a zip file, then upload, and activate as a regular WordPress plugin. After doing so, the error should no longer appear.

Note also that I’ve opened a support topic with the JW Auth plugin authors.

Let me know how you get on with the above.

 

Hello @jamesosborne

Thank you for sharing a fix, It fixed the issue with your plugin “Site Kit by Google” but I am having an issue with rank math and WP Statistics, I don’t know if it’s affecting other plugins or functions too, I know that I shouldn’t ask this but can you write a universal fix not only for Google Kit.

add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
  $your_endpoints = array(
      '/wp-json/google-site-kit/*',
  );

  return array_unique( array_merge( $endpoints, $your_endpoints ) );
} );

instead of this line what I should write to fix all issues?
‘/wp-json/google-site-kit/*’,

 

Hi @jadolyo,

Glad to hear that addressed your Site Kit dashboard error.

I know that I shouldn’t ask this but can you write a universal fix not only for Google Kit.

While I haven’t tested Rank Math and WP Statistics you can try adding them to the function above. Rather than replacing the Site Kit endpoint reference, you can try something similar to the below:

add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
  $your_endpoints = array(
      '/wp-json/google-site-kit/*',
      '/wp-json/seo-by-rank-math/*',
      '/wp-json/wp-statistics/*',
  );

  return array_unique( array_merge( $endpoints, $your_endpoints ) );
} );

The JWT Auth team should be able to assist more than we can here when it comes to their whitelist filter.

 

Hello @jamesosborne

Thank you for sharing your solution, Now I understand the idea with my little coding skills, Allow me to share this I made the name more universal.

<?php
/**
 * Plugin Name: JWT Auth Fix
 * Plugin URI: http://www.jamesozz.ie
 * Description: Whitelist Google Site Kit, Rank Math, WO Statistics, JetPack API calls in JWT Auth by Useful Team.
 * Version: 1.1
 * Author: James Osborne
 * Author URI: http://www.jamesozz.ie
 */
 
 
add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
  $your_endpoints = array(
      '/wp-json/google-site-kit/*',
      '/wp-json/seo-by-rank-math/*',
      '/wp-json/wp-statistics/*',
	  '/wp-json/jetpack/*',
  );

  return array_unique( array_merge( $endpoints, $your_endpoints ) );
} );

 

@jadolyo Excellent, thank you for sharing. If you have any further Site Kit queries be sure to reach out. If you’ve been a Site Kit user for some time, be sure to also share your plugin feedback if not already done. We love to hear users experience from using the plugin.

 

Hello @jamesosborne

A little fix for rank Math:

‘/wp-json/rankmath/*’,

Thank you very much for your support and help, For sure I will give feedback.

 

Good catch with the rank math REST endpoint @jadolyo, thanks for sharing. This will be useful should other users report the same here in the Site Kit forums when reporting the Site Kit dashboard conflict.

Best of luck with your site going forward. You know where to find us if you have further queries.

 

Hello @jamesosborne

Last question, Is it dangerous to whitelist all?

‘/wp-json/*’,

 

Hi Admed,

I would suggesting asking that particular question over on the JWT Auth plugin forums. I can’t be sure of the implications if using the plugin, after whitelisting all. There is some documentation on the plugins GitHub. You may wish to reach out there also.

 

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Your Advertisement Here