" from a scheduler. Add &force=1 (or "force" as the // second CLI argument) to send immediately regardless of schedule. require_once __DIR__ . '/inc/report.php'; header('Content-Type: text/plain; charset=UTF-8'); header('Cache-Control: no-store'); $token = (string)($_GET['token'] ?? $argv[1] ?? ''); $stored = setting_get('cron_token'); if ($stored === null || $token === '' || !hash_equals($stored, $token)) { http_response_code(403); exit("Forbidden.\n"); } $force = isset($_GET['force']) || in_array('force', array_slice($argv ?? [], 2), true); if ($force) { $to = (string)setting_get('report_email', ''); if ($to === '') { exit("No report email configured — set one on report.php first.\n"); } $ok = send_report_email($to, $err); setting_set('report_last_status', ($ok ? "Sent to $to" : 'FAILED: ' . $err) . ' — ' . date('Y-m-d H:i') . ' (forced)'); if (!$ok) { http_response_code(500); } exit(($ok ? "Sent to $to" : "FAILED: $err") . "\n"); } maybe_send_daily_report(); echo 'OK. Last report: ' . (setting_get('report_last_status') ?? 'never sent') . "\n";