| @@ -4,8 +4,12 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 8 | 12 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 9 | 13 | |
| 10 | 14 | /** |
| 11 | 15 | * VideoPress command line utilities. |
| @@ -72,9 +76,9 @@ | ||
| 72 | 76 | WP_CLI::success( sprintf( _n( 'Found %d available cron job.', 'Found %d available cron jobs.', $crons_count, 'jetpack' ), $crons_count ) ); |
| 73 | 77 | } |
| 74 | 78 | |
| 75 | 79 | foreach ( $crons as $cron_name => $cron ) { |
| 76 | - $interval = isset( $schedules[ $cron['interval'] ]['display'] ) ? $schedules[ $cron['interval'] ]['display'] : $cron['interval']; | |
| 80 | + $interval = $schedules[ $cron['interval'] ]['display'] ?? $cron['interval']; | |
| 77 | 81 | $runs_next = $scheduler->check_cron( $cron_name ); |
| 78 | 82 | $status = $runs_next ? sprintf( 'Scheduled - Runs Next at %s GMT', gmdate( 'Y-m-d H:i:s', $runs_next ) ) : 'Not Scheduled'; |
| 79 | 83 | |
| 80 | 84 | WP_CLI::log( 'Name: ' . $cron_name ); |
| @@ -185,7 +189,6 @@ | ||
| 185 | 189 | WP_CLI::success( sprintf( __( 'The cron named `%s` was removed from the schedule.', 'jetpack' ), $args[0] ) ); |
| 186 | 190 | } |
| 187 | 191 | } |
| 188 | 192 | |
| 189 | - // @phan-suppress-next-line PhanUndeclaredFunctionInCallable -- https://github.com/phan/phan/issues/4763 | |
| 190 | 193 | WP_CLI::add_command( 'videopress', 'VideoPress_CLI' ); |
| 191 | 194 | } |