Whoops \ Exception \ ErrorException (E_WARNING)
session_start(): Cannot start session when headers already sent Whoops\Exception\ErrorException thrown with message "session_start(): Cannot start session when headers already sent" Stacktrace: #9 Whoops\Exception\ErrorException in /home/gzxgloe/www/wp-content/themes/megagic/functions.php:50 #8 session_start in /home/gzxgloe/www/wp-content/themes/megagic/functions.php:50 #7 megagic_start_session in /home/gzxgloe/www/wp-includes/class-wp-hook.php:324 #6 WP_Hook:apply_filters in /home/gzxgloe/www/wp-includes/class-wp-hook.php:348 #5 WP_Hook:do_action in /home/gzxgloe/www/wp-includes/plugin.php:517 #4 do_action in /home/gzxgloe/www/wp-settings.php:727 #3 require_once in /home/gzxgloe/www/wp-config.php:93 #2 require_once in /home/gzxgloe/www/wp-load.php:50 #1 require_once in /home/gzxgloe/www/wp-blog-header.php:13 #0 require in /home/gzxgloe/www/index.php:17
Stack frames (10)
9
Whoops
\
Exception
\
ErrorException
/
home
/
gzxgloe
/
www
/
wp-content
/
themes
/
megagic
/
functions.php
50
8
session_start
/
home
/
gzxgloe
/
www
/
wp-content
/
themes
/
megagic
/
functions.php
50
7
megagic_start_session
/
home
/
gzxgloe
/
www
/
wp-includes
/
class-wp-hook.php
324
6
WP_Hook
apply_filters
/
home
/
gzxgloe
/
www
/
wp-includes
/
class-wp-hook.php
348
5
WP_Hook
do_action
/
home
/
gzxgloe
/
www
/
wp-includes
/
plugin.php
517
4
do_action
/
home
/
gzxgloe
/
www
/
wp-settings.php
727
3
require_once
/
home
/
gzxgloe
/
www
/
wp-config.php
93
2
require_once
/
home
/
gzxgloe
/
www
/
wp-load.php
50
1
require_once
/
home
/
gzxgloe
/
www
/
wp-blog-header.php
13
0
require
/
home
/
gzxgloe
/
www
/
index.php
17
/
home
/
gzxgloe
/
www
/
wp-content
/
themes
/
megagic
/
functions.php
            'ajaxurl'     => admin_url( 'admin-ajax.php' ),
        )
    );

}
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 );


//Empeche de l'editeur gutemberg en pleine page
function dbefm_disable_editor_fullscreen_by_default() {
    $script = "window.onload = function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } }";
    wp_add_inline_script( 'wp-blocks', $script );
}
add_action( 'enqueue_block_editor_assets', 'dbefm_disable_editor_fullscreen_by_default' ,1, 10);


//POUR AJOUTER un champ dans le formulaire de connection + CF js avec l'exploitation de la valeur de login_context dans \learndash\ld30\assets\js\learndash.js
function megagic_start_session() {
    if(!session_id()) {
        session_start();
    }
}
add_action('init', 'megagic_start_session', 1);

//Ajout d'un champ dans le formulaire de connexion
function megagic_login_form_top($args){
    $value = isset($_SESSION['login_context']) ? $_SESSION['login_context'] : '';
    return '<input type="hidden" name="login_context" id="login_context" value="'.$value.'">';
}
add_filter('login_form_top', 'megagic_login_form_top');

//recupération de la valeur du champ  durant la connexion 
function megagic_authenticate($user, $username, $password){
    $_SESSION['login_context']  = isset($_POST['login_context']) ? $_POST['login_context'] : '';
    session_write_close();
    return $user;
}
add_filter( 'authenticate', 'megagic_authenticate', 98, 3 );

//Suppression du filtre pour la page ecole_de_magie
Arguments
  1. "session_start(): Cannot start session when headers already sent"
    
/
home
/
gzxgloe
/
www
/
wp-content
/
themes
/
megagic
/
functions.php
            'ajaxurl'     => admin_url( 'admin-ajax.php' ),
        )
    );

}
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 );


//Empeche de l'editeur gutemberg en pleine page
function dbefm_disable_editor_fullscreen_by_default() {
    $script = "window.onload = function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } }";
    wp_add_inline_script( 'wp-blocks', $script );
}
add_action( 'enqueue_block_editor_assets', 'dbefm_disable_editor_fullscreen_by_default' ,1, 10);


//POUR AJOUTER un champ dans le formulaire de connection + CF js avec l'exploitation de la valeur de login_context dans \learndash\ld30\assets\js\learndash.js
function megagic_start_session() {
    if(!session_id()) {
        session_start();
    }
}
add_action('init', 'megagic_start_session', 1);

//Ajout d'un champ dans le formulaire de connexion
function megagic_login_form_top($args){
    $value = isset($_SESSION['login_context']) ? $_SESSION['login_context'] : '';
    return '<input type="hidden" name="login_context" id="login_context" value="'.$value.'">';
}
add_filter('login_form_top', 'megagic_login_form_top');

//recupération de la valeur du champ  durant la connexion 
function megagic_authenticate($user, $username, $password){
    $_SESSION['login_context']  = isset($_POST['login_context']) ? $_POST['login_context'] : '';
    session_write_close();
    return $user;
}
add_filter( 'authenticate', 'megagic_authenticate', 98, 3 );

//Suppression du filtre pour la page ecole_de_magie
/
home
/
gzxgloe
/
www
/
wp-includes
/
class-wp-hook.php
 
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        $num_args = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
 
            $priority = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 === $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        --$this->nesting_level;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
Arguments
  1. ""
    
/
home
/
gzxgloe
/
www
/
wp-includes
/
class-wp-hook.php
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        --$this->nesting_level;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
Arguments
  1. null
    
  2. array:1 [
      0 => ""
    ]
    
/
home
/
gzxgloe
/
www
/
wp-includes
/
plugin.php
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    if ( empty( $arg ) ) {
        $arg[] = '';
    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
        $arg[0] = $arg[0][0];
    }
 
    $wp_filter[ $hook_name ]->do_action( $arg );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Calls the callback functions that have been added to an action hook, specifying arguments in an array.
 *
 * @since 2.1.0
 *
 * @see do_action() This function is identical, but the arguments passed to the
 *                  functions hooked to `$hook_name` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $hook_name The name of the action to be executed.
 * @param array  $args      The arguments supplied to the functions hooked to `$hook_name`.
 */
function do_action_ref_array( $hook_name, $args ) {
Arguments
  1. array:1 [
      0 => ""
    ]
    
/
home
/
gzxgloe
/
www
/
wp-settings.php
if ( ! class_exists( 'WP_Site_Health' ) ) {
    require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}
WP_Site_Health::get_instance();
 
// Set up current user.
$GLOBALS['wp']->init();
 
/**
 * Fires after WordPress has finished loading but before any headers are sent.
 *
 * Most of WP is loaded at this stage, and the user is authenticated. WP continues
 * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate
 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
 *
 * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
 *
 * @since 1.5.0
 */
do_action( 'init' );
 
// Check site status.
if ( is_multisite() ) {
    $file = ms_site_check();
    if ( true !== $file ) {
        require $file;
        die();
    }
    unset( $file );
}
 
/**
 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
 *
 * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
 * users not logged in.
 *
 * @link https://developer.wordpress.org/plugins/javascript/ajax
 *
 * @since 3.0.0
Arguments
  1. "init"
    
/
home
/
gzxgloe
/
www
/
wp-config.php
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
 
require_once(ABSPATH . 'wp-debug.php');
 
/* That's all, stop editing! Happy blogging. */
 
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
 
/* Fixes "Add media button not working", see http://www.carnfieldwebdesign.co.uk/blog/wordpress-fix-add-media-button-not-working/ */
define('CONCATENATE_SCRIPTS', false );
 
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
 
Arguments
  1. "/home/gzxgloe/www/wp-settings.php"
    
/
home
/
gzxgloe
/
www
/
wp-load.php
     * Initialize error reporting to a known set of levels.
     *
     * This will be adapted in wp_debug_mode() located in wp-includes/load.php based on WP_DEBUG.
     * @see https://www.php.net/manual/en/errorfunc.constants.php List of known error levels.
     */
    error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
}
 
/*
 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
 * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
 * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
 * and /blog/ is WordPress(b).
 *
 * If neither set of conditions is true, initiate loading the setup process.
 */
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
 
    /** The config file resides in ABSPATH */
    require_once ABSPATH . 'wp-config.php';
 
} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
 
    /** The config file resides one level above ABSPATH but is not part of another installation */
    require_once dirname( ABSPATH ) . '/wp-config.php';
 
} else {
 
    // A config file doesn't exist.
 
    define( 'WPINC', 'wp-includes' );
    require_once ABSPATH . WPINC . '/version.php';
    require_once ABSPATH . WPINC . '/compat.php';
    require_once ABSPATH . WPINC . '/load.php';
 
    // Check for the required PHP version and for the MySQL extension or a database drop-in.
    wp_check_php_mysql_versions();
 
    // Standardize $_SERVER variables across setups.
    wp_fix_server_vars();
Arguments
  1. "/home/gzxgloe/www/wp-config.php"
    
/
home
/
gzxgloe
/
www
/
wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
Arguments
  1. "/home/gzxgloe/www/wp-load.php"
    
/
home
/
gzxgloe
/
www
/
index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 
Arguments
  1. "/home/gzxgloe/www/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache"
REQUEST_URI
"/wp-sitemap.xml"
PATH
"/usr/local/bin:/usr/bin:/bin"
REDIRECT_STATUS
"200"
UNIQUE_ID
"anJzk36uzF8O10EJMkGSZgAABhA"
GEOIP_COUNTRY_CODE
"US"
GEOIP_COUNTRY_NAME
"United States"
GEOIP_REGION
"CA"
GEOIP_CITY
"Santa Paula"
GEOIP_DMA_CODE
"803"
GEOIP_AREA_CODE
"805"
GEOIP_LATITUDE
"34.355598"
GEOIP_LONGITUDE
"-119.070099"
SCRIPT_URL
"/wp-sitemap.xml"
SCRIPT_URI
"https://www.ecolemegagic.com:443/wp-sitemap.xml"
HTTPS
"on"
HTTP_AUTHORIZATION
""
CFG_CLUSTER
"cluster131"
ENVIRONMENT
"development"
APP_ENGINE_VERSION
"7.4"
APP_ENGINE
"phpcgi"
HTTP_HOST
"www.ecolemegagic.com"
HTTP_X_PREDICTOR
"1"
HTTP_X_FORWARDED_FOR
"216.73.217.113"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_OVHREQUEST_ID
"7192aaaf9729e173f94e03cdcabc7bab"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_REMOTE_IP
"216.73.217.113"
SERVER_SIGNATURE
""
SERVER_NAME
"www.ecolemegagic.com"
SERVER_ADDR
"10.131.20.2"
SERVER_PORT
"443"
REMOTE_ADDR
"216.73.217.113"
DOCUMENT_ROOT
"/home/gzxgloe/www"
SERVER_ADMIN
"postmaster@www.ecolemegagic.com"
SCRIPT_FILENAME
"/home/gzxgloe/www/index.php"
REMOTE_PORT
"39754"
REDIRECT_URL
"/wp-sitemap.xml"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
SCRIPT_NAME
"/index.php"
HOME
"/homez.1813/gzxgloe"
PWD
"/homez.1813/gzxgloe/www"
UID
"gzxgloe"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1785885587.6029
REQUEST_TIME
1785885587
argv
array:1 [
  0 => "index.php"
]
argc
1
Key Value
PATH
"/usr/local/bin:/usr/bin:/bin"
REDIRECT_STATUS
"200"
UNIQUE_ID
"anJzk36uzF8O10EJMkGSZgAABhA"
GEOIP_COUNTRY_CODE
"US"
GEOIP_COUNTRY_NAME
"United States"
GEOIP_REGION
"CA"
GEOIP_CITY
"Santa Paula"
GEOIP_DMA_CODE
"803"
GEOIP_AREA_CODE
"805"
GEOIP_LATITUDE
"34.355598"
GEOIP_LONGITUDE
"-119.070099"
SCRIPT_URL
"/wp-sitemap.xml"
SCRIPT_URI
"https://www.ecolemegagic.com:443/wp-sitemap.xml"
HTTPS
"on"
HTTP_AUTHORIZATION
""
CFG_CLUSTER
"cluster131"
ENVIRONMENT
"development"
APP_ENGINE_VERSION
"7.4"
APP_ENGINE
"phpcgi"
HTTP_HOST
"www.ecolemegagic.com"
HTTP_X_PREDICTOR
"1"
HTTP_X_FORWARDED_FOR
"216.73.217.113"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_OVHREQUEST_ID
"7192aaaf9729e173f94e03cdcabc7bab"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_REMOTE_IP
"216.73.217.113"
SERVER_SIGNATURE
""
SERVER_SOFTWARE
"Apache"
SERVER_NAME
"www.ecolemegagic.com"
SERVER_ADDR
"10.131.20.2"
SERVER_PORT
"443"
REMOTE_ADDR
"216.73.217.113"
DOCUMENT_ROOT
"/home/gzxgloe/www"
SERVER_ADMIN
"postmaster@www.ecolemegagic.com"
SCRIPT_FILENAME
"/home/gzxgloe/www/index.php"
REMOTE_PORT
"39754"
REDIRECT_URL
"/wp-sitemap.xml"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/wp-sitemap.xml"
SCRIPT_NAME
"/index.php"
HOME
"/homez.1813/gzxgloe"
PWD
"/homez.1813/gzxgloe/www"
UID
"gzxgloe"
0. Whoops\Handler\PrettyPageHandler