• Resolved bzadmin

    (@bzadmin)


    Hi, using the latest wordpress version 5.5, I’m getting the following E_NOTICE exception when running:

    Exception has occurred.
    Notice: register_rest_route was called <strong>incorrectly</strong>. The REST API route definition for <code>wp-stateless/v1/status</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.)

    this happens on this callstack (note that i’m running from WC_CLI):

    trigger_error (dev-wp/wp-includes/functions.php:5225)
    _doing_it_wrong (dev-wp/wp-includes/functions.php:5225)
    register_rest_route (dev-wp/wp-includes/rest-api.php:102)
    wpCloud\StatelessMedia\Bootstrap->api_init (dev-wp/wp-content/plugins/wp-stateless/lib/classes/class-bootstrap.php:511)
    WP_Hook->apply_filters (dev-wp/wp-includes/class-wp-hook.php:287)
    WP_Hook->do_action (dev-wp/wp-includes/class-wp-hook.php:311)
    do_action (dev-wp/wp-includes/plugin.php:478)
    WC_CLI_Runner::after_wp_load (dev-wp/wp-content/plugins/woocommerce/includes/cli/class-wc-cli-runner.php:59)
    WP_CLI::do_hook (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/class-wp-cli.php:304)
    WP_CLI\Runner->load_wordpress (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1263)
    WP_CLI\Runner->start (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1158)
    WP_CLI\Bootstrap\LaunchRunner->process (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23)
    WP_CLI\bootstrap (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php:74)
    include (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php:27)
    include (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar/php/boot-phar.php:11)
    {main} (/Applications/MAMP/bin/php/php7.3.9/bin/wp-cli.phar:4)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I bumped into the same issue.
    These are paths:

    wp-stateless/v1/status
    wp-stateless/v1/jobs
    wp-stateless/v1/getSettings
    wp-stateless/v1/getMediaLibrary
    wp-stateless/v1/getMediaItem

    I found this issue may related to wordpress 5.5 REST API change

    Any quick fix is welcome.
    Besides, are these endpoints intented to be public?

    We have updated the REST API in 3.0. The error should go away.

    Thread Starter bzadmin

    (@bzadmin)

    Yes I saw on github! thanks for all the work you guys do 🙂

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

The topic ‘register_rest_route’ is closed to new replies.