Support » Plugin: Bounce Handler MailPoet 3 » cron jobs causing php errors

  • Resolved Tim Reeves

    (@tim-reeves)


    Repeatedly errors were appearing in my php error log, like this:

    [15-Oct-2020 22:26:00] WARNING: [pool example.com] child 3338 said into stderr: "NOTICE: PHP message: PHP Warning: session_start(): Cannot start session when headers already sent in /var/www/vhosts/example.com/httpdocs/wp-content/plugins/whmcs-bridge-sso/includes/hooks.inc.php on line 0"
    
    [15-Oct-2020 22:26:00] WARNING: [pool example.com] child 3338 said into stderr: "NOTICE: PHP message: PHP Warning: session_start(): Cannot start session when headers already sent in /var/www/vhosts/example.com/httpdocs/wp-content/plugins/whmcs-bridge/bridge.init.php on line 973"
    
    [15-Oct-2020 22:26:00] WARNING: [pool example.com] child 3338 said into stderr: "NOTICE: PHP message: PHP Warning: Cannot modify header information - headers already sent in /var/www/vhosts/example.com/httpdocs/wp-content/plugins/zero-spam/classes/class-wpzerospam.php on line 938"

    Normally such errors are caused when visitors (or admins) access the site, and some plugin is causing output through white space at start of file. So at first I thought that there may be some log buffering going on somewhere, as the error messages did not correspond to my visiting the site. But finally I traced it to this plugin: Using “WP Crontrol” I manually started some of the “bdt” cron jobs – and zack there were the error messages in the log. Every time.

    Could you look into this please and clean it up?

    Thanks, Tim

Viewing 4 replies - 1 through 4 (of 4 total)
  • @tim-reeves
    We are going to check the issue. Thank you for informing us.

    Thread Starter Tim Reeves

    (@tim-reeves)

    Having looked deeper into this: Whenever ANY wp-cron job is run, the PHP errors happen. Since wp-cron jobs run when due *at the end of a page display call*, then the functions hooked as scheduled events may not do things like starting a session or sending headers, as they have nothing to do with the GUI. But some naughty plugins seem to be doing exactly that:

    o WHMCS Bridge Free
    o WHMCS Bridge Pro
    o WordPress Zero Spam

    WHMCS Bridge Pro is encoded, but I’ll be looking at the code of the other two now.

    So obviously this is not any problem with your plugin – sorry for the false alarm.

    Tim

    Thread Starter Tim Reeves

    (@tim-reeves)

    BTW I believe you may not be removing wp-cron jobs on deactivation via wp_clear_scheduled_hook…
    See https://wpshout.com/wp_schedule_event-examples/

    Thread Starter Tim Reeves

    (@tim-reeves)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cron jobs causing php errors’ is closed to new replies.