run( false ); $history = get_option( 'evoka_score_history', array() ); $history[] = array( 'date' => gmdate( 'Y-m-d' ), 'score' => $result['score'], ); $history = array_slice( $history, -52 ); // Keep ~1 year of weekly points. update_option( 'evoka_score_history', $history, false ); ( new Evoka_Citation_Tracker() )->run_all(); } } /** * Register a "weekly" cron schedule if the installed WP version lacks one. */ add_filter( 'cron_schedules', // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected function ( $schedules ) { if ( ! isset( $schedules['weekly'] ) ) { $schedules['weekly'] = array( 'interval' => WEEK_IN_SECONDS, 'display' => __( 'Once Weekly', 'evoka' ), ); } return $schedules; } );