• Resolved katmacau

    (@katmacau)


    Hello. I am creating a new thread following this one – https://ww.wp.xz.cn/support/topic/hummingbird-errors/.

    I am getting the follow PHP errors on my site. Its a dev site so I have error display enabled. It’s also using the hostings temp url until it does live. That might not be relevant but thought I would mention. Eg Domain is similar to http://101.0.111.1/~mydomain/. Not it is not using https whilst in testing mode.

    I am using WordPress 5.5.1 on a PHP 7.4.10 LiteSpeed setup. I have tried changing themes and deactivating plugins but no luck there. The only thing that stops the errors is using Classic Editor. When I enable classic editor the error stops.

    Plugins used are Advanced Custom Fields, Classic Editor (to prevent this error), Hummingbird 2.5.1, Smush, a custom plugin that simply sets up a custom post type and Yoast. All plugins up to date.

    As a side note, I was also getting errors with Gutenberg saving posts with a “the response is not a valid JSON response” error. Again, might not be the issue but thought it was worth mentioning.

    Notice: register_rest_route was called incorrectly. The REST API route definition for hummingbird/v1/status/(?P[\w-]+) 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 /home/mydomain/public_html/wp-includes/functions.php on line 5225
    
    Notice: register_rest_route was called incorrectly. The REST API route definition for hummingbird/v1/clear_cache/(?P[\w-]+) 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 /home/mydomain/public_html/wp-includes/functions.php on line 5225
    
    Notice: register_rest_route was called incorrectly. The REST API route definition for hummingbird/v1/test 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 /home/mydomain/public_html/wp-includes/functions.php on line 5225
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/mydomain/public_html/wp-includes/functions.php:5225) in /home/mydomain/public_html/wp-admin/admin-header.php on line 9
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @katmacau,

    I tested Hummingbird on my end with all the plugins you mentioned (except the one adding CPT) and even with PHP 7.4 I couldn’t replicate the issue you are having.

    Can yo try disabling your CPT plugin and switch to the default WP theme to see if the issue is gone after that?

    Do you have an installation with a top-level domain and that uses HTTPS to see if you can replicate the issue there?

    As a side note, I was also getting errors with Gutenberg saving posts with a “the response is not a valid JSON response” error.

    Our devs are already notified about this and it will be fixed in next release.

    Cheers,
    Predrag

    Thread Starter katmacau

    (@katmacau)

    Hi Predrag.

    I tried disabling CPT, switching to twenty19 and then clearing cache but still the same results with the REST API issue.

    I dont have the the top-level domain with https yet. But the site should be ready to go live soon and I can test it then.

    Thread Starter katmacau

    (@katmacau)

    Hi Predrag. The site is now on the live URL with HTTPs enabled. The error still persists. The “Warning: Cannot modify header information…” error has been fixed by changing the display errors setting. I now have the errors saving to an error log rather than display on screen. But each edit page view is still getting the REST API error. EG:

    [03-Oct-2020 00:41:48 UTC] PHP Notice: register_rest_route was called <strong>incorrectly</strong>. The REST API route definition for <code>hummingbird/v1/test</code> is missing the required <code>permission_callback</code> argument. For REST API routes that are intended to be public, use <code>__return_true</code> as the permission callback. Please see <a href="https://ww.wp.xz.cn/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.5.0.) in /home/switchin/public_html/wp-includes/functions.php on line 5225

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @katmacau,

    The register_rest_route issue is nearing the fix as I checked the same with the Hummingbird team and should be released soon. Though I would not be able to give you an ETA about it. While checking with the team, I did come to know that the following errors are not critical ones and would not cause issues on the site.

    Can you confirm if some are causing issues in the normal work process? If yes, could you please help me the exact procedure to replicate where the process gets stuck?

    I also tried to work with the said plugins and no classic editor on-site just with Gutenberg and that worked for me like a charm too. Just to confirm, is the live site on the same server as the staging site you listed earlier?

    Thank you,
    Prathamesh Palve

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @katmacau,

    Adding to the earlier reply, you can add the following code to your site child theme function file or add it as a mu-plugin.

    add_action( 'rest_api_init', function(){
    	if( class_exists('Hummingbird\\WP_Hummingbird') ){
    		remove_action( 'rest_api_init', array( Hummingbird\WP_Hummingbird::get_instance()->core->api->rest, 'register_routes' )	);
    	}
    }, 0 );

    You should add this code only and only if you are not using the Hummingbird Rest API. Once you add the code, please enable debug mode, and then try to access this:
    your-site.com/wp-json/wp/v2/posts and then check the debug log to see if the error generates again.

    Here are the step by step instructions to install a mu-plugin with the help of screenshots:
    https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins

    Do let me know if that works for you.

    Thank you,
    Prathamesh Palve

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @katmacau

    I hope you are doing well.

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved.

    However, feel free to let us know if you have any additional question or problem.

    Best Regards
    Patrick Freitas

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Hummingbird REST API route errors’ is closed to new replies.