cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 82 forks source link

The plugin is throwing a "register_rest_route was called incorrectly" notice with WordPress 5.5 #267

Closed cabrerahector closed 3 years ago

cabrerahector commented 3 years ago

Describe the bug

An user reported here that WordPress Popular Posts is throwing a PHP notice under WordPress version 5.5 that says:

Notice: register_rest_route was called incorrectly. The REST API route definition for wordpress-popular-posts/v1/popular-posts/widget/(?P[\d]+) is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback.

I couldn't reproduce the issue myself but adding the permission_callback argument as requested won't hurt.

To Reproduce

Steps to reproduce the behavior:

  1. Install WordPress Popular Posts (latest version).
  2. Install WordPress 5.5
  3. Profit?