Passed
Push — 106-feature/store-attachment-n... ( 67d8e5...acae6a )
by Maria Daniel Deepak
07:00 queued 03:41
created

EmailLogSystemInfo::get_default_config()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 5
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
 * @since 2.3.0
10
 */
11
class EmailLogSystemInfo extends SystemInfo {
12
13
	/**
14
	 * Setup hooks and filters.
15
	 */
16
	public function load() {
17
		add_action( 'system_info_before', array( $this, 'print_version' ), 10, 2 );
18
	}
19
20
	public function print_version() {
21
		?>
22
Email Log Version:        <?php echo $this->get_plugin_version(); ?>
23
		<?php
24
	}
25
26
	protected function get_default_config() {
27
		$config = parent::get_default_config();
28
29
		$config['show_posts']      = false;
30
		$config['show_taxonomies'] = false;
31
32
		return $config;
33
	}
34
35
	protected function get_plugin_version() {
36
		$plugin_path = WP_PLUGIN_DIR . '/email-log/email-log.php';
37
		$plugin_data = get_plugin_data( $plugin_path );
38
39
		return $plugin_data['Version'];
40
	}
41
}
42