Support » Plugin: WP REST Cache » Uncaught Error after adding my custom API to wp_rest_cache/allowed_endpoints

  • Resolved jankapusta

    (@jankapusta)


    I am following steps from here:
    “Can I register my own endpoint for caching?”

    see https://wordpress.org/plugins/wp-rest-cache/#can%20i%20register%20my%20own%20endpoint%20for%20caching%3F

    When I add_filter for “wp_rest_cache/allowed_endpoints”, it causes my api endpoint to raise exception:

    PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in /var/www/html/wp-includes/rest-api.php:591

    This happens only on cache HIT. When cache is cleaned, next first call to my endpoint is successful, after that all calls end up with 500 and the exception.

    Please suggest solution or fix if it is bug.
    Thank you
    Jan

    • This topic was modified 5 months, 1 week ago by jankapusta.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @jankapusta

    Thank you for using our plugin!

    Did you update to the latest version of our plugin? Because this error looks exactly what was caused by the WP security update 5.2.4 which we fixed in the latest version of our plugin.

    Thanks a lot!
    Yes it was just outdated plugin version 2019.4.1
    Updated to 2019.4.2 and issue is not reproducible anymore.

    Tanks for a very quick response ! 🙂
    Cheers

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @jankapusta

    Nice to hear, you problem is solved!

    Please let us know if we can be of any more assistance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.