public/wordpress/wp-content/plugins/backupbuddy/classes/core.php
/* schedule_single_event()
	 *
	 * API to wp_schedule_single_event() that also verifies that the schedule actually got created in WordPRess.
	 * Sometimes the database rejects this update so we need to do actual verification.
	 *
	 * @param	int			$rescheduleCount	Numeric counter of how many times this schedule has been 'bumped'.  This helps prevent infinite loops of bumping crons.  BB limits to only one BB cron action per PHP page load to insure full runtime per process.
	 * @return	boolean							True on verified schedule success, else false.
	 */
schedule_single_event()
API to wp_schedule_single_event() that also verifies that the schedule actually got created in WordPRess.
Sometimes the database rejects this update so we need to do actual verification.

@param       int                     $rescheduleCount        Numeric counter of how many times this schedule has been 'bumped'.  This helps prevent infinite loops of bumping crons.  BB limits to only one BB cron action per PHP page load to insure full runtime per process.
@return      boolean                                                 True on verified schedule success, else false.
schedule_single_event () API to wp_schedule_single_event () that also verifies that the schedule actually got created in WordPRess . Sometimes the database rejects this update so we need to do actual verification . @param int $rescheduleCount Numeric counter of how many times this schedule has been ' bumped ' . This helps prevent infinite loops of bumping crons . BB limits to only one BB cron action per PHP page load to insure full runtime per process . @return boolean True on verified schedule success else false .
public static function schedule_single_event( $time, $method, $args, $rescheduleCount = 0 ) {
		$tag = 'backupbuddy_cron';
		if ( 'live_periodic' === $method ) {
			$single_scheduled = wp_next_scheduled( $tag, array( $method, $args, $rescheduleCount ) ); 
			if ( FALSE !== $single_scheduled ) {
				pb_backupbuddy::status( 'warning', 'Warning #839249743: An existing schedule appears to already exist for this tag which is limited to a single instance. This may be a temporary issue or this may be caused by cron interference such as by W3TC. Details: `' . print_r( $single_scheduled, true ) . '`.' );
				return true;
			}
		}
		$schedule_result = wp_schedule_single_event( $time, $tag, array( $method, $args, $rescheduleCount ) ); 
		if ( FALSE === $schedule_result ) { 
			sleep( backupbuddy_constants::SCHEDULE_RETRY_WAIT );
			$schedule_result = wp_schedule_single_event( $time, $tag, array( $method, $args, $rescheduleCount ) ); 
		}
		if ( FALSE === $schedule_result ) { 
		}
		$next_scheduled = wp_next_scheduled( $tag, array( $method, $args, $rescheduleCount ) ); 
		if ( FALSE === $next_scheduled ) {
			sleep( backupbuddy_constants::SCHEDULE_RETRY_WAIT );
			$next_scheduled = wp_next_scheduled( $tag, array( $method, $args, $rescheduleCount ) ); 
		}
		if ( FALSE === $next_scheduled ) {
			pb_backupbuddy::status( 'error', 'Warning #34894934: This may not be a fatal error. Ignore if process proceeds without other errors. WordPress reported success scheduling BUT wp_next_scheduled() could NOT confirm schedule existance. A plugin may have prevented it (eg caching) or it is already scheduled (but could not be detected).' );
			return false;
		}
		return true;
	}
public static function schedule_single_event ( $ time , $ method , $ args , $ rescheduleCount = 0 ) { $ tag = 'backupbuddy_cron' ; if ( 'live_periodic' === $ method ) { $ single_scheduled = wp_next_scheduled ( $ tag , array ( $ method , $ args , $ rescheduleCount ) ) ; if ( FALSE !== $ single_scheduled ) { pb_backupbuddy :: status ( 'warning' , 'Warning #839249743: An existing schedule appears to already exist for this tag which is limited to a single instance. This may be a temporary issue or this may be caused by cron interference such as by W3TC. Details: `' . print_r ( $ single_scheduled , true ) . '`.' ) ; return true ; } } $ schedule_result = wp_schedule_single_event ( $ time , $ tag , array ( $ method , $ args , $ rescheduleCount ) ) ; if ( FALSE === $ schedule_result ) { sleep ( backupbuddy_constants :: SCHEDULE_RETRY_WAIT ) ; $ schedule_result = wp_schedule_single_event ( $ time , $ tag , array ( $ method , $ args , $ rescheduleCount ) ) ; } if ( FALSE === $ schedule_result ) { } $ next_scheduled = wp_next_scheduled ( $ tag , array ( $ method , $ args , $ rescheduleCount ) ) ; if ( FALSE === $ next_scheduled ) { sleep ( backupbuddy_constants :: SCHEDULE_RETRY_WAIT ) ; $ next_scheduled = wp_next_scheduled ( $ tag , array ( $ method , $ args , $ rescheduleCount ) ) ; } if ( FALSE === $ next_scheduled ) { pb_backupbuddy :: status ( 'error' , 'Warning #34894934: This may not be a fatal error. Ignore if process proceeds without other errors. WordPress reported success scheduling BUT wp_next_scheduled() could NOT confirm schedule existance. A plugin may have prevented it (eg caching) or it is already scheduled (but could not be detected).' ) ; return false ; } return true ; }
schedule_single_event()
 API to wp_schedule_single_event() that also verifies that the schedule actually got created in WordPRess.
schedule_single_event () API to wp_schedule_single_event () that also verifies that the schedule actually got created in WordPRess .
// Make sure live_periodic never gets scheduled multiple times. // Check if tag already scheduled. // Schedule. // If failed, sleep 1 then try again. // Schedule. // Still could not schedule. Warn. //pb_backupbuddy::status( 'warning', 'Warning #48393489: This may not be a fatal error. Ignore if process proceeds without other errors. Unable to create schedule as wp_schedule_single_event() returned false. A plugin may have prevented it or it is already scheduled.' ); //return false; // Retrieve schedule to verify it stuck. // Retrieve schedule to verify it stuck.