ok perfect
from the log:
[12-May-2019 16:22:00 UTC] PHP Warning: session_start(): Cannot start session when headers already sent in /srv/www/ispazio/wp-content/plugins/unyson/framework/includes/hooks.php on line 228
so looks a plugin conflict/problem.. but this plugin is part (essential) for my theme.. so we need to check it out.
i’ve opened that hooks.php and at that line i see this:
// FW_Flash_Messages hooks
{
if ( is_admin() ) {
/**
* Start the session before the content is sent to prevent the "headers already sent" warning
* @internal
*/
function _action_fw_flash_message_backend_prepare() {
if ( apply_filters( 'fw_use_sessions', true ) && ! session_id() ) {
session_start();
}
}
add_action( 'current_screen', '_action_fw_flash_message_backend_prepare', 9999 );
/**
* Display flash messages in backend as notices
*/
add_action( 'admin_notices', array( 'FW_Flash_Messages', '_print_backend' ) );
} else {
/**
* Start the session before the content is sent to prevent the "headers already sent" warning
* @internal
*/
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();
}
}
add_action( 'send_headers', '_action_fw_flash_message_frontend_prepare', 9999 );
/**
* Print flash messages in frontend if this has not been done from theme
*/
function _action_fw_flash_message_frontend_print() {
if ( FW_Flash_Messages::_frontend_printed() ) {
return;
}
if ( ! FW_Flash_Messages::_print_frontend() ) {
return;
}
?>
<script type="text/javascript">
(function () {
if (typeof jQuery === "undefined") {
return;
}
jQuery(function ($) {
var $container;
// Try to find the content element
{
var selector, selectors = [
'#main #content',
'#content #main',
'#main',
'#content',
'#content-container',
'#container',
'.container:first'
];
while (selector = selectors.shift()) {
$container = $(selector);
if ($container.length) {
break;
}
}
}
if (!$container.length) {
// Try to find main page H1 container
$container = $('h1:first').parent();
}
if (!$container.length) {
// If nothing found, just add to body
$container = $(document.body);
}
$(".fw-flash-messages").prependTo($container);
});
})();
</script>
<style type="text/css">
.fw-flash-messages .fw-flash-type-error {
color: #f00;
}
.fw-flash-messages .fw-flash-type-warning {
color: #f70;
}
.fw-flash-messages .fw-flash-type-success {
color: #070;
}
.fw-flash-messages .fw-flash-type-info {
color: #07f;
}
</style>
<?php
}
add_action( 'wp_footer', '_action_fw_flash_message_frontend_print', 9999 );
}
}
-
This reply was modified 5 years, 6 months ago by fabiano1987.