Completed
Push — update/deactivation-modal-stat... ( 03d6ae...763765 )
by
unknown
07:34
created

Jetpack_Wizard   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A is_started() 0 4 1
A is_finished() 0 4 1
A can_be_displayed() 0 7 4
1
<?php
2
/**
3
 * Displays the first page of the Wizard in a banner form
4
 *
5
 * @package Jetpack
6
 */
7
8
/**
9
 * Jetpack_Wizard class
10
 */
11
class Jetpack_Wizard {
12
13
	/**
14
	 * Has the user started the Wizard?
15
	 *
16
	 * @return bool
17
	 */
18
	public static function is_started() {
19
		// TODO: check saved Jetpack_Option (to be implemented).
20
		return false;
21
	}
22
23
	/**
24
	 * Has the user finished the Wizard?
25
	 *
26
	 * @return bool
27
	 */
28
	public static function is_finished() {
29
		// TODO: check saved Jetpack_Option (to be implemented).
30
		return false;
31
	}
32
33
	/**
34
	 * Can the Wizard be displayed?
35
	 *
36
	 * @return bool
37
	 */
38
	public static function can_be_displayed() {
39
		/** This filter is documented in _inc/lib/admin-pages/class.jetpack-react-page.php */
40
		return apply_filters( 'jetpack_show_setup_wizard', false )
41
				&& Jetpack::is_active()
42
				&& ! self::is_finished()
43
				&& current_user_can( 'jetpack_manage_modules' );
44
	}
45
}
46