• Resolved glouton

    (@glouton)


    Hi there,

    I have the following PHP warnings in my log:

    PHP Warning: session_start(): Cannot start session when headers already sent in /wp-content/plugins/cbxpoll/public/class-cbxpoll-public.php on line 71
    PHP Warning: Cannot modify header information – headers already sent in /wp-content/plugins/cbxpoll/includes/class-cbxpoll-helper.php on line 47

    WordPress version: 5.2.3
    PHP version: 7.3.9

    I’ve search for days and couldn’t find any ouput anywhere (no whitespace, no BOM… no nothing).
    With the headers_sent() function I’ve managed to narrow it down to wp-cron.php on line 23 with fastcgi_finish_request().

    Maybe session_start() as to be hooked differently. No error if I disable the cron.

    Regards,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter glouton

    (@glouton)

    Hello,

    I was pretty sure I had ruled out all other possible causes but having same issue with another plugin I wanted to be on the safe side. Here’s what I’ve done :

    1. Install a fresh WordPress 5.2.3
    2. Install CBX Poll

    By the way I have open the same thread for Contact Form 7 Multi-step forms: https://www.ads-software.com/support/topic/hea/

    As I’ve previously managed to narrow it down to the WordPress schedule task system and their wp-cron.php file, I’ve quickly created a dummy plugin to register minutely task:

    
    <?php
    /**
     * Plugin Name: Cron Test
     */
    function my_add_minutely( $schedules ) {
        // add a 'minutely' schedule to the existing set
        $schedules['minutely'] = array(
            'interval' => 60,
            'display' => __('Once Minutely')
        );
        return $schedules;
    }
    add_filter( 'cron_schedules', 'my_add_minutely' );
    
    register_activation_hook(__FILE__, 'my_activation');
    
    function my_activation() {
        if (! wp_next_scheduled ( 'my_minutely_event' )) {
            wp_schedule_event(time(), 'minutely', 'my_minutely_event');
        }
    }
    
    add_action('my_minutely_event', 'do_this_minutely');
    
    function do_this_minutely() {
        // do something every minute
        error_log( 'My minutely event.' );
    }
    
    register_deactivation_hook(__FILE__, 'my_deactivation');
    
    function my_deactivation() {
            wp_clear_scheduled_hook('my_minutely_event');
    }
    

    And now I do have the PHP warning repeatedly:
    https://mega.nz/#!cvZEwChI!FPrpr9XTdrhMerRZ6KYKPYKEeYihyZQwWaghH8kJnCg

    Regards,

    Plugin Author Sabuj Kundu

    (@manchumahara)

    We are checking, will give feedback asap.

    Thread Starter glouton

    (@glouton)

    Thank you for that and may the Force be with You.

    Plugin Author Sabuj Kundu

    (@manchumahara)

    Released a new version today, pls check
    New version 1.1.9

    Thread Starter glouton

    (@glouton)

    Hi there,

    Thank you for this new version.

    It seems to fix the “header already sent” warning indeed.

    Regards,

    Plugin Author Sabuj Kundu

    (@manchumahara)

    You are welcome, hope you will write review about our support and plugin’s usages.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Headers already sent’ is closed to new replies.