| @@ 413-419 (lines=7) @@ | ||
| 410 | * Clear the whitelist |
|
| 411 | */ |
|
| 412 | if ( isset( $args[1] ) && 'clear' == $args[1] ) { |
|
| 413 | if ( ! empty( $whitelist ) ) { |
|
| 414 | $whitelist = array(); |
|
| 415 | jetpack_protect_save_whitelist( $whitelist ); |
|
| 416 | WP_CLI::success( __( 'Cleared all whitelisted IPs', 'jetpack' ) ); |
|
| 417 | } else { |
|
| 418 | WP_CLI::line( __( 'Whitelist is empty.', "jetpack" ) ) ; |
|
| 419 | } |
|
| 420 | break; |
|
| 421 | } |
|
| 422 | ||
| @@ 639-643 (lines=5) @@ | ||
| 636 | ||
| 637 | // Kick off a full sync |
|
| 638 | if ( Jetpack_Sync_Actions::do_full_sync() ) { |
|
| 639 | if ( $modules ) { |
|
| 640 | WP_CLI::log( sprintf( __( 'Initialized a new full sync with modules: ', 'jetpack' ), join( ', ', $modules ) ) ); |
|
| 641 | } else { |
|
| 642 | WP_CLI::log( __( 'Initialized a new full sync', 'jetpack' ) ); |
|
| 643 | } |
|
| 644 | } else { |
|
| 645 | ||
| 646 | // Reset sync settings to original. |
|
| @@ 644-654 (lines=11) @@ | ||
| 641 | } else { |
|
| 642 | WP_CLI::log( __( 'Initialized a new full sync', 'jetpack' ) ); |
|
| 643 | } |
|
| 644 | } else { |
|
| 645 | ||
| 646 | // Reset sync settings to original. |
|
| 647 | Jetpack_Sync_Settings::update_settings( $original_settings ); |
|
| 648 | ||
| 649 | if ( $modules ) { |
|
| 650 | WP_CLI::error( sprintf( __( 'Could not start a new full sync with modules: %s', 'jetpack' ), join( ', ', $modules ) ) ); |
|
| 651 | } else { |
|
| 652 | WP_CLI::error( __( 'Could not start a new full sync', 'jetpack' ) ); |
|
| 653 | } |
|
| 654 | } |
|
| 655 | ||
| 656 | // Keep sending to WPCOM until there's nothing to send |
|
| 657 | $i = 1; |
|
| @@ 24-28 (lines=5) @@ | ||
| 21 | public function import( $args ) { |
|
| 22 | $guid = $args[0]; |
|
| 23 | $attachment_id = create_local_media_library_for_videopress_guid( $guid ); |
|
| 24 | if ( $attachment_id && ! is_wp_error( $attachment_id ) ) { |
|
| 25 | WP_CLI::success( sprintf( __( 'The video has been imported as Attachment ID %d', 'jetpack' ), $attachment_id ) ); |
|
| 26 | } else { |
|
| 27 | WP_CLI::error( __( 'An error has been encountered.', 'jetpack' ) ); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| @@ 106-111 (lines=6) @@ | ||
| 103 | ||
| 104 | $time = $scheduler->check_cron( $args[0] ); |
|
| 105 | ||
| 106 | if ( ! $time ) { |
|
| 107 | WP_CLI::success( __( 'The cron is not scheduled to run.', 'jetpack' ) ); |
|
| 108 | ||
| 109 | } else { |
|
| 110 | WP_CLI::success( sprintf( __( 'Cron will run at: %s GMT', 'jetpack' ), gmdate( 'Y-m-d H:i:s', $time ) ) ); |
|
| 111 | } |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|