Avisos
Vaciar todo

Hosting WordPress 70% dto Dominios promo

ayuda con php abierta  

 
Alejandro
 Alejandro
Nuevo usuario

Se ha creado una sesión PHP por la llamada a la función session_start(). Esto interfiere con la API REST y las solicitudes de retorno. La sesión debería ser cerrada por session_write_close() antes de hacer cualquier solicitud HTTP.

ME APARECE ESTE MENSAJE, Y CUANDO DESACTIVO UNYSON DESAPARECE. NO QUIERO QUITAR UNYSON, ¿QUE PUEDO HACER PARA QUE MEJORES LA SALUD DEL SITIO WEB?

Contenido solo visible a usuarios registrados

Citar
Respondido : 05/10/2022 10:08 am
Pepe
 Pepe
Soporte CMS Webempresa Admin

Hola Alejandro.

Vamos a ver si podemos cerrar las sesiones.

.- Accede a tu cuneta de wePanel -> Administrador de archivos.

.- Accede a la carpeta de tu instalación ->  wp-content -> plugins -> unyson -> framework -> includes y edita el archivo " hooks.php "

.- Sobre la linea 227 veras esta función:

 function _action_fw_flash_message_backend_prepare() {
if ( apply_filters( 'fw_use_sessions', true ) && ! session_id() ) {
session_start();
}
}

 

La sustituyes por esta:

 function _action_fw_flash_message_backend_prepare() {
if ( apply_filters( 'fw_use_sessions', true ) && ! session_id() ) {
session_start();
session_write_close();
}
}

 

.- Sobre la linea 245 veras esta función:

 function _action_fw_flash_message_frontend_prepare() {
if (
apply_filters( 'fw_use_sessions', true )
&&
/**
* In ajax it's not possible to call flash message after headers were sent,
* so there will be no "headers already sent" warning.
* Also in the Backups extension, are made many internal ajax request,
* each creating a new independent request that don't remember/use session cookie from previous request,
* thus on server side are created many (not used) new sessions.
*/
! ( defined( 'DOING_AJAX' ) && DOING_AJAX )
&&
! session_id()
) {
session_start();
}
}

 

La sustituyes por esta:

 function _action_fw_flash_message_frontend_prepare() {
if (
apply_filters( 'fw_use_sessions', true )
&&
/**
* In ajax it's not possible to call flash message after headers were sent,
* so there will be no "headers already sent" warning.
* Also in the Backups extension, are made many internal ajax request,
* each creating a new independent request that don't remember/use session cookie from previous request,
* thus on server side are created many (not used) new sessions.
*/
! ( defined( 'DOING_AJAX' ) && DOING_AJAX )
&&
! session_id()
) {
session_start();
session_write_close();
}
}

 

Si te das cuenta en el código solo hemos añadido " session_write_close(); " que es la que cierra las sesiones.

 

Nota: Recuerda descargar una copia del archivo antes de realizar las modificaciones para tener una copia del original.

 

Un Saludo

 

ResponderCitar
Respondido : 05/10/2022 10:48 am

Cursos Gratuitos WordPress