Forum Replies Created

Viewing 4 replies - 31 through 34 (of 34 total)
  • Thread Starter glouton

    (@glouton)

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

    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://wordpress.org/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,

    Thread Starter glouton

    (@glouton)

    PS: wonder who marked this as resolved…

    Thread Starter glouton

    (@glouton)

    Hello,

    Thank you for getting back to me promptly.

    I was pretty sure I had ruled out all other possible causes but to be on the safe side here’s what I’ve done :

    1. Install a fresh WordPress 5.2.3
    2. Install CF7
    3. Install CF7 Multi-Step

    On this brand new installation I didn’t have any error.
    Then after installing and activating CBX Poll it came back once. By the way I have open the same thread on their side: https://wordpress.org/support/topic/headers-already-sent-39/

    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/#!FzwzyYQa!Q_tHIjQJuV5Tdt1m_gXoJE_u9RO1nhKgPD5iBL92_vQ

    Regards,

Viewing 4 replies - 31 through 34 (of 34 total)