Completed
Push — 105-fix/add-tests-for-all-util... ( fd3f8c...252e7a )
by Maria Daniel Deepak
10:11 queued 04:31
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
 * @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