<?php

class PeepSoCron 
{
	public static function initialize()
	{
		if(0==PeepSo::get_option('disable_mailqueue', 0)) {
			add_action(PeepSo::CRON_MAILQUEUE, array('PeepSoMailQueue', 'process_mailqueue'));
		}

		// Activity ranking runs via PeepSo3_Maintenance_Activity_Ranking on its OWN
		// dedicated 1-minute cron (PeepSo::CRON_RANKING_EVENT), split out of the 5-minute
		// maintenance tick (see peepso.php + install/activate.php). The old rebuild_rank
		// cron was broken (hidden option, static-call fatal) and has been removed.

		if(0==PeepSo::get_option('gdpr_external_cron', 0) && (PeepSo::get_option('gdpr_enable', 1))) {
			add_action(PeepSo::CRON_GDPR_EXPORT_DATA, array('PeepSoGdpr', 'process_export_data'));
			add_action(PeepSo::CRON_GDPR_EXPORT_DATA, array('PeepSoGdpr', 'process_cleanup_data'));
		}

		if(1 == PeepSo::get_option('remove_inactive_users', 0) && 0==PeepSo::get_option('disable_remove_inactive_users_cron')) {
			add_action(PeepSo::CRON_REMOVE_INACTIVE_USERS, array('PeepSoInactiveUsers', 'process_remove_inactive_users'));
		}

		do_action('peepso_cron_init');
	}
}

// EOF