'; esc_html_e('To ensure cron jobs run on time, we recommend setting up server-side cron jobs. Below are the instructions:', 'ai-sports-writer'); ?>

* * * * * wget -q -O - 
            

getCronHooks() as $hook => $config) { echo '

' . esc_html($this->checkCronStatus($hook, $config['interval'], $config['offset'])) . '

'; } ?>
['interval' => 60 * 60, 'offset' => 10], 'aisprtsw_fetch_cron' => ['interval' => 3 * 60 * 60, 'offset' => 0], ]; } /** * Checks the status of a specific cron hook. * * @param string $hookName The name of the cron hook. * @param int $expectedInterval The expected execution interval in seconds. * @param int $offsetMinutes The offset in minutes for the cron execution. * @return string A message indicating the next scheduled run or lack of schedule. */ private function checkCronStatus(string $hookName, int $expectedInterval, int $offsetMinutes): string { $nextRun = wp_next_scheduled($hookName); if ($nextRun) { return sprintf( // translators: %1$s is the cron hook name, %2$s is the next scheduled time __('Next run for %1$s is scheduled at %2$s.', 'ai-sports-writer'), $hookName, gmdate('Y-m-d H:i:s', $nextRun) ); } else { return sprintf( // translators: %1$s is the cron hook name __('No scheduled run found for %1$s.', 'ai-sports-writer'), $hookName ); } } }