• Resolved webtent

    (@webtent)


    We installed the WP Crontrol plugin and see this wp-cron job sitting at the top of the list. It says it should only run every 14 days, but has not moved from the top of the list with the current time and ‘now’ as the next run time. After a search, it seems this job is related to the BackWPup plugin. How long should it take to run and why would it not complete?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support BWU support

    (@duongcuong96)

    @webtent
    Weird, in my sites, the phone home cron job is run every 14 days:

    Thread Starter webtent

    (@webtent)

    I have plenty of other jobs that cycle as expected, but not this one. Wonder if there is a way to reset or see results? Backup works fine.

    Plugin Support BWU support

    (@duongcuong96)

    @webtent
    For now, try to deactivate BWP and then reactive again.
    Is there is something different with the cron job?

    Plugin Support BWU support

    (@duongcuong96)

    @webtent

    since we haven’t heard back from you, I’m going to mark it as resolved.
    If you’re still having problems, feel free to let us know ;),

    Btw, If you find BackWPUp is useful for you, we would really appreciate if you leave a positive review and rating.
    This would encourage us to develop new free features and provide free support 😀
    https://wordpress.org/support/plugin/backwpup/reviews/

    webtent, recreate jobs. It will help.

    UPD: Sorry, wrong. Re-creating the task did not help. Not correctly looked at the log.

    Settings – Jobs – Maximum script execution time, change from 0 to 300. Reduce the frequency, but wp-cron.php? Doing_wp_cron = will still appear too often.

    In the next folder there is another wordpress, also with this plugin. There are no such problems. I unfortunately deactivate the plugin.

    • This reply was modified 5 years, 4 months ago by elimS.

    I have also encountered this problem, and I’ve found a workaround for it.

    The problem is that the plugin’s ‘cron_schedules’ hook is initialized in the Inpsyde_PhoneHome_CronController::schedule() function. But this code is not reached when the wp-cron.php file executes the cron job.

    Due to this, the wp_reschedule_event() function will try to reschedule it, but because the ‘twice_weekly’ schedule isn’t initialized, it will fall back to rescheduling the event to be executed initially.

    On my solution, this gave a 2-300 ms overhead on every single request.

    The fix would be to ensure the ‘cron_schedules’ hook is also called for cron requests.

    My workaround was to add the following lines to my functions.php file:

    //
    // WORKAROUND: The BackWpUp plugin doesn't reschedule events correctly
    // This hook fixes a problem where each request would call the WP cron and perform a remote request
    // The problem happened because the plugin doesn't initialize its cron schedule on the wp-cron.php page
    //
    if ( class_exists('Inpsyde_PhoneHome_CronController') ) {
      function fix_backwpup_cron_schedule( $schedules ) {
    
        is_array( $schedules ) or $schedules = array();
        $label = __( 'Every %d days', 'inpsyde-phone-home' );
    
        $interval = apply_filters( 'inpsyde-phone-home-cron-interval', Inpsyde_PhoneHome_CronController::RECURRENCE_INTERVAL );
        is_int( $interval ) or $interval = Inpsyde_PhoneHome_CronController::RECURRENCE_INTERVAL;
    
        $schedules[ Inpsyde_PhoneHome_CronController::RECURRENCE_KEY ] = array(
          'interval' => $interval,
          'display'  => sprintf( $label, ceil( $interval / DAY_IN_SECONDS ) )
        );
    
        return $schedules;
      }
      add_filter( 'cron_schedules', 'fix_backwpup_cron_schedule' );
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘inpsyde_phone-home_checkin’ is closed to new replies.