1
|
|
|
<?php namespace BulkWP\BulkDelete\Core\SystemInfo; |
2
|
|
|
|
3
|
|
|
use BulkWP\BulkDelete\Core\SystemInfo\BulkDeleteSystemInfo; |
4
|
|
|
use BulkWP\BulkDelete\Core\Base\BasePage; |
5
|
|
|
|
6
|
|
|
defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* System Info Page. |
10
|
|
|
* |
11
|
|
|
* This page displays information about the current WordPress install that can be used in support requests. |
12
|
|
|
* |
13
|
|
|
* @since 6.0.0 |
14
|
|
|
*/ |
15
|
|
|
class SystemInfoPage extends BasePage { |
16
|
|
|
const PAGE_SLUG = 'bulk-delete-system-info'; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Capability to Manage system info. |
20
|
|
|
*/ |
21
|
|
|
const CAPABILITY = 'manage_options'; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* SystemInfo class. |
25
|
|
|
* |
26
|
|
|
* @var BulkDeleteSystemInfo |
27
|
|
|
*/ |
28
|
|
|
protected $system_info; |
29
|
|
|
|
30
|
|
|
public function load() { |
31
|
|
|
parent::load(); |
|
|
|
|
32
|
|
|
|
33
|
|
|
add_action( 'bd-download-system-info', array( $this, 'download_system_info' ) ); |
34
|
|
|
|
35
|
|
|
$this->system_info = new BulkDeleteSystemInfo( 'bulk-delete' ); |
36
|
|
|
$this->system_info->load(); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function register_page() { |
40
|
|
|
$this->page = add_submenu_page( |
|
|
|
|
41
|
|
|
LogListPage::PAGE_SLUG, |
|
|
|
|
42
|
|
|
__( 'System Info', 'bulk-delete' ), |
43
|
|
|
__( 'System Info', 'bulk-delete' ), |
44
|
|
|
self::CAPABILITY, |
45
|
|
|
self::PAGE_SLUG, |
46
|
|
|
array( $this, 'render_page' ) |
47
|
|
|
); |
48
|
|
|
|
49
|
|
|
add_action( "load-{$this->page}", array( $this, 'render_help_tab' ) ); |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Fires before loading Sytem Info page. |
53
|
|
|
* |
54
|
|
|
* @since 2.3.0 |
55
|
|
|
* |
56
|
|
|
* @param string $page Page slug. |
57
|
|
|
*/ |
58
|
|
|
do_action( 'bd_load_system_info_page', $this->page ); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Render the page. |
63
|
|
|
*/ |
64
|
|
|
public function render_page() { |
65
|
|
|
?> |
66
|
|
|
|
67
|
|
|
<form method="post"> |
68
|
|
|
<div class="updated"> |
69
|
|
|
<p> |
70
|
|
|
<strong> |
71
|
|
|
<?php _e( 'Please include this information when posting support requests.', 'bulk-delete' ); ?> |
72
|
|
|
</strong> |
73
|
|
|
</p> |
74
|
|
|
</div> |
75
|
|
|
|
76
|
|
|
<?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
|
|
|
|
77
|
|
|
<div class="notice notice-warning"> |
78
|
|
|
<p><strong> |
79
|
|
|
<?php printf( __( 'DISABLE_WP_CRON is <a href="%s" rel="noopener" target="_blank">enabled</a>. This prevents scheduler from running.', 'bulk-delete' ), 'https://codex.wordpress.org/Editing_wp-config.php#Disable_Cron_and_Cron_Timeout' ); ?> |
80
|
|
|
</strong></p> |
81
|
|
|
</div> |
82
|
|
|
<?php endif; ?> |
83
|
|
|
|
84
|
|
|
<div class="wrap"> |
85
|
|
|
<h1><?php _e( 'Bulk Delete - System Info', 'bulk-delete' ); ?></h1> |
86
|
|
|
|
87
|
|
|
<?php |
88
|
|
|
$this->system_info->render(); |
89
|
|
|
?> |
90
|
|
|
|
91
|
|
|
<p class="submit"> |
92
|
|
|
<input type="hidden" name="bd-action" value="bd-download-system-info"> |
93
|
|
|
<?php |
94
|
|
|
wp_nonce_field( 'bd-download-system-info', 'bd-download-system-info_nonce', false ); |
95
|
|
|
submit_button( __( 'Download System Info File', 'bulk-delete' ), 'primary', 'bd-download-system-info', false ); |
96
|
|
|
?> |
97
|
|
|
</p> |
98
|
|
|
</div> |
99
|
|
|
</form> |
100
|
|
|
|
101
|
|
|
<?php |
102
|
|
|
$this->render_page_footer(); |
|
|
|
|
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Download System info file. |
107
|
|
|
*/ |
108
|
|
|
public function download_system_info() { |
109
|
|
|
$this->system_info->download_as_file(); |
110
|
|
|
} |
111
|
|
|
} |
112
|
|
|
|