insert( 'albert/allowed-user-expired', $user_id, 'success' ); } } catch ( \Throwable $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch // Never let a cron failure surface to the site. } } /** * Schedule the daily sweep if not already scheduled. * * @return void * @since 1.4.0 */ public static function schedule(): void { if ( ! wp_next_scheduled( self::HOOK ) ) { wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', self::HOOK ); } } /** * Unschedule the daily sweep. * * @return void * @since 1.4.0 */ public static function unschedule(): void { $timestamp = wp_next_scheduled( self::HOOK ); while ( $timestamp !== false ) { wp_unschedule_event( $timestamp, self::HOOK ); $timestamp = wp_next_scheduled( self::HOOK ); } } }