command_handler = $command_handler; $this->cron_scheduler = $cron_scheduler; } /** * Registers the unscheduling of the cron to the deactivation action. * * @return void */ public function register_hooks() { \add_action( 'wpseo_deactivate', [ $this, 'maybe_remove_llms_file' ] ); } /** * Call the command handler to remove the file. * * @return void */ public function maybe_remove_llms_file(): void { $this->command_handler->handle(); $this->cron_scheduler->unschedule_llms_txt_population(); } }