admin管理员组

文章数量:1335670

I have a plugin which I have deployed on four different websites. Part of that extension is a Cron job which triggers every hour.

On one of my deployments my job gets removed from the schedule. I used WP Control plugin to add it again (avoiding the reinstall of plugin). It worked for some time but then it was removed again.

I checked the logs and the removal of job from the schedule coincides with these other Cron jobs that were running at about that time wp_update_themes, wp_update_plugins, wp_version_check, woocommerce_cleanup_sessions

  • Bellow is the list of the installed plugins:
  • Advanced Custom Fields PRO
  • Advanced Order Export For WooCommerce
  • All In One SEO Pack
  • Autoptimize
  • Async JavaScript
  • Complete Open Graph
  • Custom Post Type UI
  • Easy WP SMTP
  • Disable Comments
  • Gettext override translations
  • Google Analytics Dashboard for WP (GADWP)
  • Invisible reCaptcha
  • iThemes Security
  • WooCommerce
  • WP Super Cache
  • WP Crontrol

Is it possible that some these plugins is removing my Cron job from the scedule? What is causing this?

EDIT

This is how I add the Cron job in my init file of the plugin.

register_activation_hook(__FILE__, 'hourly_processing');

function hourly_processing() {
  if (!wp_next_scheduled('process-subscriptions-hourly')) {
    wp_schedule_event(time(), 'hourly', 'process-subscriptions-hourly');
  }
}


add_action('process-subscriptions-hourly', 'process_subscriptions_hourly');


    function process_subscriptions_hourly() {

//I do the processing here.
}

本文标签: pluginsCron task gets removed from the schedule