sync = new Sync(); $this->connection = new Connection(); $this->admin = new Admin($this->connection, $this->sync); } public function boot() { $this->sync->register(); $this->connection->register(); if (is_admin()) { $this->admin->register(); } } public static function activate() { set_transient(self::ACTIVATION_REDIRECT, 1, 60); if (!wp_next_scheduled(self::CRON_HEARTBEAT)) { wp_schedule_event(time() + HOUR_IN_SECONDS, 'daily', self::CRON_HEARTBEAT); } } public static function deactivate() { wp_clear_scheduled_hook(self::CRON_HEARTBEAT); wp_clear_scheduled_hook(self::CRON_SYNC); delete_transient(self::ACTIVATION_REDIRECT); } }