Completed
Push — master ( 5841c7...d52f43 )
by Sudar
03:55
created

AddonListPage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 52
ccs 0
cts 19
cp 0
rs 10
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 3 1
A register_page() 0 12 1
A render_page() 0 9 1
A load_page() 0 4 1
1
<?php namespace EmailLog\Core\UI\Page;
2
3
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
4
5
/**
6
 * Addon List Page
7
 *
8
 * @since 2.0
9
 */
10
class AddonListPage extends BasePage {
11
	/**
12
	 * Page slug.
13
	 */
14
	const PAGE_SLUG = 'email-log-addon-list';
15
16
	/**
17
	 * Setup hooks.
18
	 */
19
	public function load() {
20
		parent::load();
21
	}
22
23
	/**
24
	 * Register page.
25
	 *
26
	 * @inheritdoc
27
	 */
28
	public function register_page() {
29
		$this->page = add_submenu_page(
30
			LogListPage::PAGE_SLUG,
31
			__( 'Addons', 'bulk-delete' ),
32
			__( 'Addons', 'bulk-delete' ),
33
			'manage_options',
34
			self::PAGE_SLUG,
35
			array( $this, 'render_page' )
36
		);
37
38
		add_action( "load-{$this->page}", array( $this, 'load_page' ) );
1 ignored issue
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $this instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
39
	}
40
41
	/**
42
	 * Render page.
43
	 */
44
	public function render_page() {
45
		?>
46
		<div class="wrap">
47
			<h2><?php _e( 'Email Log Addons', 'email-log' ); ?></h2>
48
			<?php settings_errors(); ?>
49
50
		</div>
51
		<?php
52
	}
53
54
	/**
55
	 * Load page.
56
	 */
57
	public function load_page() {
58
		$this->render_help_tab();
59
60
	}
61
}