ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
922 stars 217 forks source link

Critical Issue, bad perfomance: active PHP session was detected, cause plugin unyson #4042

Open otakuyose opened 4 years ago

otakuyose commented 4 years ago

An active PHP session was detected ::Rendimiento:: 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.

Cause: [27-Aug-2020 02:44:06 UTC] PHP Notice: Trying to access array offset on value of type null in /home1/sugoicom/public_html/wp-content/plugins/unyson/framework/helpers/class-fw-resize.php on line 35

my web site is bad performance, is too slow

etwordpress01 commented 4 years ago

To disable session you can try to use below filter, but i am not sure if this can create an issue with plugin sessions

if (!function_exists('_disable_fw_use_sessions')) { add_filter('fw_use_sessions','_disable_fw_use_sessions'); function _disable_fw_use_sessions(){ return false; } }

otakuyose commented 4 years ago

That code is entered in wp-config, right?

thanks for your help

etwordpress01 commented 4 years ago

No, This is a filter and you can add it in the theme functions.php file. Unyson Author has written this filter to add your own settings and i think so we can use this in our theme to disable this session.

sinakheyrandish commented 4 years ago

same here

jeremyJJB commented 4 years ago

This definitely worked, my site loads much faster now. The site is running WP 5.5.1 and Unyson 2.7.24

markarim commented 4 years ago

Thx, it worked, and my site loads faster. WP 5.5.1 PHP 7.3

corzel commented 4 years ago

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php


229: session_start();
230: }
231: session_write_close();
232: }
sergionline commented 3 years ago

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();
230: }
231: session_write_close();
232: }

Thx Thx Thz You are the best!!!!