SendPress Newsletters
[resolved] SendPress adds new wp-cron entry without limit or sanity (3 posts)

  1. octareenroon91
    Posted 2 years ago #

    I observed this plugin add one wp-cron entry each time the page loaded, easily going over 1000, all scheduled to go off every hour.

    Looking at the code, we see this

    function &init() {
    		static $instance = array();
    		if ( !$instance ) {
    /* trimmed for brevity */
    wp_schedule_event( time(), 'hourly', 'sendpress_cron_action_run' );
    /* trimmed for brevity */
    		return $instance[0];

    I suggest adding sanity as described right here in the WordPress documentation.

    Basically, the wp_schedule_event() call needs to be guaranteed to only run if there is no event already scheduled.
    if ( !wp_next_scheduled( 'sendpress_cron_action_run' ) ) { /* */ }

    Maybe WP previously corrected this misbehavior automatically, but if so, no more!


  2. Josh Lyford
    Plugin Author

    Posted 2 years ago #

    Hi octareenroon91,

    Your right about the cron. Thanks for letting us know. We will have a fix out for it shortly.

  3. Josh Lyford
    Plugin Author

    Posted 2 years ago #

    This was fixed with

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SendPress Newsletters
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic