PHP Notice: register_rest_route

Is this message in my error log for ClassicPress or for WordPress5.5?

PHP Notice: register_rest_route was called with error. The REST API route definition for powerform/v1/preview/quizzes 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 /httpdocs/wp-includes/functions.php on line 4600

With this whole forkdown, you no longer know whether you are adjusting your plugins correctly or simply encountering false/positive reports due to leftover code from WordPress…

This was introduced in ClassicPress 1.4.0 and was backported from WP-5.5.0.
Nothing to do with version 2.0, that is not available at now.

With WP_DEBUG = true you will see a notice when registering a REST API endpoint without a permission callback function (this is a try to enforce good security practices).

For sure you’ll see this also in ClassicPress v.2 when it will be published.

You can see the Git Blame here.

That’s mega funny, if I correct it, it doesn’t work anymore, I leave it, there’s a message. Could one then at least adjust the error messages so that one knows that it is not a WordPress 5.5 message, but was introduced in ClassicPress 1.4? I hope you’ll forgive me, but it’s been hell for developers to figure out what’s what. First of all, you assume that you are dealing with a WP4.9, not that it throws an error message from 5.5 and you don’t know what’s broken now. So towards developers this is very unfriendly and not very user-friendly.

It would be nice in the future if the error messages were adjusted so that a ClassicPress developer knows exactly what he is dealing with and where exactly he can look it up in the ClassicPress documentation (as far as the WordPress copy can still be relied on).

It’s simple. If the error mentions version 5+, that means it was backported. This means you’ll find additional information on Github in merged PRs, including why it was backported. For example:

1 Like

Why easy, it can be so much more complicated

  • Version 5+, that means it was backported
  • Version CP-x.x.x, that means it’s a ClassicPress deprecation

But in both cases can’t understand the importance of knowing where it started. It should be fixed.