- changed WP Cron scheduled events;

This commit is contained in:
Nikita Sinelnikov
2022-01-03 13:25:43 +02:00
parent 96b7837d16
commit 7e635967f6
3 changed files with 22 additions and 18 deletions
+2 -17
View File
@@ -19,15 +19,8 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
* Plugin_Updater constructor.
*/
function __construct() {
//create cron event
if ( ! wp_next_scheduled( 'um_check_extensions_licenses' ) ) {
wp_schedule_event( time() + ( 24*60*60 ), 'daily', 'um_check_extensions_licenses' );
}
register_deactivation_hook( um_plugin, array( &$this, 'um_plugin_updater_deactivation_hook' ) );
//cron request to UM()->store_url;
add_action( 'um_check_extensions_licenses', array( &$this, 'um_checklicenses' ) );
add_action( 'um_daily_scheduled_events', array( &$this, 'um_checklicenses' ) );
// clean update plugin cache
add_action( 'upgrader_process_complete', array( &$this, 'clean_update_plugins_cache' ), 20, 2 );
@@ -248,14 +241,6 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
}
/**
* Remove CRON events on deactivation hook
*/
function um_plugin_updater_deactivation_hook() {
wp_clear_scheduled_hook( 'um_check_extensions_licenses' );
}
/**
* Check license function
*/
@@ -665,4 +650,4 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
}
}
}
}