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