• Resolved markus1710

    (@markus1710)


    Hello,
    i have the following problem:

    Warning: The Optimization Detective REST API endpoint is unavailable

    To collect URL Metrics from visitors the REST API must be available to unauthenticated users. Specifically, visitors must be able to perform a POST request to the /optimization-detective/v1/url-metrics:store endpoint.

    You may have a plugin active or server configuration which restricts access to logged-in users. Unauthenticated access must be restored in order for Optimization Detective to work.

    The REST API returned with an HTTP status of 403 Forbidden.

    Unerlaubte REST-Anfragen unterbinden: ist deaktiviert!

    i put this in the functions.php

    // Erlaube nicht-authentifizierten Zugriff auf den Optimization Detective REST-API-Endpunkt
    add_filter( ‘rest_authentication_errors’, function( $result ) {
    $request_uri = $_SERVER[‘REQUEST_URI’] ?? ”;

    if ( strpos( $request_uri, '/wp-json/optimization-detective/v1/url-metrics:store' ) !== false ) {
        return true; // Zugriff erlauben
    }
    
    return $result;

    });

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Problem with REST API’ is closed to new replies.