run(); status_header( 200 ); header( 'Content-Type: application/json; charset=utf-8' ); echo wp_json_encode( [ 'ok' => true, 'processed' => $result['processed'], 'failed' => $result['failed'], ] ); exit; } /** * Full worker URL, including the secret. */ public static function url(): string { return add_query_arg( [ self::PARAM => 1, 'key' => Lifecycle::workerKey(), ], home_url( '/' ) ); } /** * The crontab line to paste on the server. * * Shown verbatim on the health screen — the whole point of the second trigger * is that setting it up takes one copy-paste. */ public static function cronLine(): string { return sprintf( '* * * * * curl -s %s >/dev/null 2>&1', escapeshellarg( self::url() ) ); } }