• Resolved restodo

    (@restodo)


    Hola,
    En la sección Site Health del WordPress me salen 2 critical issues. An active PHP session was detected y The REST API encountered an error.
    Investigando un poco en internet hablaba que lo podía ocasionar un plugin que luego de usar session_start() no cerraba la sesión luego con session_write_close().
    Luego de ver que plugins tienen session_start() en su código descubrí que desactivando tu plugin elimina ambos errores.

    Esto es lo que me muestra WordPress.

    An active PHP session was detected

    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    The REST API encountered an error

    The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

    The REST API request failed due to an error.
    Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)`

Viewing 1 replies (of 1 total)
  • Thread Starter restodo

    (@restodo)

    Lo resolví reemplazando:
    session_start();

    por:
    if (!isset($_SESSION)) {
    session_start([‘read_and_close’ => true]);
    }

    En estos dos archivos:
    class-wc-shipping-oca.php y functions.php

Viewing 1 replies (of 1 total)
  • The topic ‘session_start() genera 2 critical issues en WordPress’ is closed to new replies.