| @@ 101-106 (lines=6) @@ | ||
| 98 | ||
| 99 | $time = $scheduler->check_cron( $args[0] ); |
|
| 100 | ||
| 101 | if ( ! $time ) { |
|
| 102 | WP_CLI::success( __( 'The cron is not scheduled to run.', 'jetpack' ) ); |
|
| 103 | ||
| 104 | } else { |
|
| 105 | WP_CLI::success( sprintf( __( 'Cron will run at: %s GMT', 'jetpack' ), gmdate( 'Y-m-d H:i:s', $time ) ) ); |
|
| 106 | } |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| @@ 275-284 (lines=10) @@ | ||
| 272 | ||
| 273 | $is_dry_run = ! empty( $assoc_args['dry-run'] ); |
|
| 274 | ||
| 275 | if ( $is_dry_run ) { |
|
| 276 | WP_CLI::warning( |
|
| 277 | __( "\nThis is a dry run.\n", 'jetpack' ) . |
|
| 278 | __( "No actions will be taken.\n", 'jetpack' ) . |
|
| 279 | __( "The following messages will give you preview of what will happen when you run this command.\n\n", 'jetpack' ) |
|
| 280 | ); |
|
| 281 | } else { |
|
| 282 | // We only need to confirm "Are you sure?" when we are not doing a dry run. |
|
| 283 | jetpack_cli_are_you_sure(); |
|
| 284 | } |
|
| 285 | ||
| 286 | switch ( $action ) { |
|
| 287 | case 'options': |
|
| @@ 968-979 (lines=12) @@ | ||
| 965 | } else { |
|
| 966 | WP_CLI::log( __( 'Initialized a new full sync', 'jetpack' ) ); |
|
| 967 | } |
|
| 968 | } else { |
|
| 969 | ||
| 970 | // Reset sync settings to original. |
|
| 971 | Settings::update_settings( $original_settings ); |
|
| 972 | ||
| 973 | if ( $modules ) { |
|
| 974 | /* translators: %s is a comma separated list of Jetpack modules */ |
|
| 975 | WP_CLI::error( sprintf( __( 'Could not start a new full sync with modules: %s', 'jetpack' ), join( ', ', $modules ) ) ); |
|
| 976 | } else { |
|
| 977 | WP_CLI::error( __( 'Could not start a new full sync', 'jetpack' ) ); |
|
| 978 | } |
|
| 979 | } |
|
| 980 | ||
| 981 | // Keep sending to WPCOM until there's nothing to send |
|
| 982 | $i = 1; |
|