Completed
Push — dev/2.3.0 ( 23c18a...fbe3e4 )
by Sudar
04:23
created

EmailLogSystemInfo   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 29
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 2 1
A get_default_config() 0 7 1
A get_plugin_version() 0 5 1
A print_version() 0 4 1
1
<?php
2
3
namespace EmailLog\Core\UI\Component;
4
5
/**
6
 * Email Log System Info.
7
 *
8
 * @see \EmailLog\Core\UI\Component\SystemInfo
9
 *
10
 * @since 2.3.0
11
 */
12
class EmailLogSystemInfo extends SystemInfo {
13
14
	/**
15
	 * Setup hooks and filters.
16
	 */
17
	public function load() {
18
		add_action( 'system_info_before', array( $this, 'print_version' ), 10, 2 );
19
	}
20
21
	public function print_version() {
22
		?>
23
Email Log Version:        <?php echo $this->get_plugin_version(); ?>
24
		<?php
25
	}
26
27
	protected function get_default_config() {
28
		$config = parent::get_default_config();
29
30
		$config['show_posts']      = false;
31
		$config['show_taxonomies'] = false;
32
33
		return $config;
34
	}
35
36
	protected function get_plugin_version() {
37
		$plugin_path = WP_PLUGIN_DIR . '/email-log/email-log.php';
38
		$plugin_data = get_plugin_data( $plugin_path );
39
40
		return $plugin_data['Version'];
41
	}
42
}
43