fetching `rankmath/v1/getHead` with `rest_do_request()` logs a PHP Notice

#431389
  • Resolved Dovid Levine
    Rank Math free

    I am fetching rankmath/v1/getHead locally using rest_do_request() and it keeps logging the following PHP notice to debug.log:

    PHP Notice:  Function WP_Block_Type_Registry::register was called <strong>incorrectly</strong>. Block type "rank-math/rich-snippet" is already registered. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 5.0.0.) in /shared/httpd/wptest/htdocs/wp-includes/functions.php on line 5831
    

    I do not seem to get this notice when using wp_remote_get() or visiting the rest endpoint in the router directly.

    The code snippet to reproduce this issue:

    
    $url_param = 'mydomain.local';
    
    $rest_url = get_rest_url(null, '/rankmath/v1/getHead?url=' . $url_param );
    $request = \WP_REST_Request::from_url( $rest_url );
    
    $response = rest_do_request( $request );
    

    Env
    WordPress: 6.0.1
    Rank Math: 1.0.94
    PHP: 8.0.19

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you so much for contacting Rank Math support today and bringing your concern to our attention.

    Allow me to share this with our dev team. We should get back to you shortly with some updates or advice.

    We appreciate your time and patience on this one.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘fetching `rankmath/v1/getHead` with `rest_do_request()` logs a PHP Notice’ is closed to new replies.