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

EmailLogSystemInfo::get_plugin_version()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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