Completed
Push — update/redirect-lib-params ( b15b53...5f7d13 )
by
unknown
25:28 queued 14:32
created

VaultPress_CLI::register_via_jetpack()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
/**
3
 * WP CLI commands for vaultpress.
4
 *
5
 * @package automattic/vaultpress
6
 */
7
8
WP_CLI::add_command( 'vaultpress', 'VaultPress_CLI' );
9
10
/**
11
 * Filter spam comments.
12
 */
13
class VaultPress_CLI extends WP_CLI_Command {
14
	/**
15
	 * Automatically registers VaultPress via the Jetpack plugin (if already signed up).
16
	 *
17
	 * ## EXAMPLES
18
	 *
19
	 *     wp vaultpress register_via_jetpack
20
	 *
21
	 * @alias comment-check
22
	 */
23
	public function register_via_jetpack() {
24
		$result = VaultPress::init()->register_via_jetpack( true );
25
		if ( is_wp_error( $result ) ) {
26
			WP_CLI::error( 'Failed to register VaultPress: ' . $result->get_error_message() );
27
		} else {
28
			WP_CLI::line( 'Successfully registered VaultPress via Jetpack.' );
29
		}
30
	}
31
}
32