1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace EmailLog\Core\UI\Component; |
4
|
|
|
|
5
|
|
|
use EmailLog\Core\DB\TableManager; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Email Log System Info. |
9
|
|
|
* |
10
|
|
|
* @see \EmailLog\Core\UI\Component\SystemInfo |
11
|
|
|
* @since 2.3.0 |
12
|
|
|
*/ |
13
|
|
|
class EmailLogSystemInfo extends SystemInfo { |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Setup hooks and filters. |
17
|
|
|
*/ |
18
|
|
|
public function load() { |
19
|
|
|
add_action( 'system_info_before', array( $this, 'print_email_log_config' ), 10, 2 ); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* ##RefactorMe |
24
|
|
|
* Dummy method which should return license key or keys based on license type. |
25
|
|
|
* |
26
|
|
|
* @return string |
27
|
|
|
*/ |
28
|
|
|
public function get_license_key(){ |
29
|
|
|
return ''; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function print_email_log_config() { |
33
|
|
|
$email_log = email_log(); |
34
|
|
|
?> |
35
|
|
|
-- Email Log Configuration |
36
|
|
|
|
37
|
|
|
Email Log Version: <?php echo $this->get_plugin_version() . "\n"; ?> |
38
|
|
|
Number of Logs: <?php echo $email_log->table_manager->get_logs_count() . "\n"; ?> |
39
|
|
|
Email Log DB Version: <?php echo get_option( TableManager::DB_OPTION_NAME ) . "\n"; ?> |
|
|
|
|
40
|
|
|
<?php if ( $this->get_license_key() === '' ) : ?> |
41
|
|
|
License Key: <?php echo $this->get_license_key() . "\n"; ?> |
42
|
|
|
<?php endif; ?> |
43
|
|
|
<?php $email_log_core = get_option('email-log-core'); ?> |
44
|
|
|
<?php if ( $email_log_core ) : ?> |
45
|
|
|
Allowed Roles for Email Log View: <?php echo implode( ', ', $email_log_core['allowed_user_roles'] ) . "\n"; ?> |
46
|
|
|
Remove All Data on Uninstallation: <?php echo $email_log_core['remove_on_uninstall'] !== '' ? 'Yes' : 'No' . "\n"; ?> |
47
|
|
|
Disable Dash Board Widget: <?php echo $email_log_core['hide_dashboard_widget'] === 'true' ? 'Yes' : 'No' . "\n"; ?> |
48
|
|
|
<?php endif; ?> |
49
|
|
|
<?php |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
protected function get_default_config() { |
53
|
|
|
$config = parent::get_default_config(); |
54
|
|
|
|
55
|
|
|
$config['show_posts'] = false; |
56
|
|
|
$config['show_taxonomies'] = false; |
57
|
|
|
|
58
|
|
|
return $config; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
protected function get_plugin_version() { |
62
|
|
|
$plugin_path = WP_PLUGIN_DIR . '/email-log/email-log.php'; |
63
|
|
|
$plugin_data = get_plugin_data( $plugin_path ); |
64
|
|
|
|
65
|
|
|
return $plugin_data['Version']; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|