|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Display System Info. |
|
4
|
|
|
* |
|
5
|
|
|
* Also provide an option to download system info for using in support requests. |
|
6
|
|
|
* |
|
7
|
|
|
* @since 5.5.4 |
|
8
|
|
|
* @note Based on the code from Easy Digital Downloads plugin |
|
9
|
|
|
* @author Sudar |
|
10
|
|
|
* @package BulkDelete\Admin |
|
11
|
|
|
*/ |
|
12
|
|
|
|
|
13
|
|
|
defined( 'ABSPATH' ) || exit; // Exit if accessed directly |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Encapsulates System info. |
|
17
|
|
|
* |
|
18
|
|
|
* @since 5.5.4 |
|
19
|
|
|
*/ |
|
20
|
|
|
class BD_System_Info_page extends BD_Base_Page { |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Make this class a "hybrid Singleton". |
|
24
|
|
|
* |
|
25
|
|
|
* @static |
|
26
|
|
|
* @since 5.5.4 |
|
27
|
|
|
*/ |
|
28
|
|
|
public static function factory() { |
|
29
|
|
|
static $instance = false; |
|
30
|
|
|
|
|
31
|
|
|
if ( ! $instance ) { |
|
32
|
|
|
$instance = new self; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
return $instance; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Initialize and setup variables. |
|
40
|
|
|
* |
|
41
|
|
|
* @since 5.5.4 |
|
42
|
|
|
*/ |
|
43
|
|
|
protected function initialize() { |
|
44
|
|
|
$this->page_slug = 'bulk-delete-info'; |
|
45
|
|
|
$this->menu_action = 'bd_after_all_menus'; |
|
46
|
|
|
$this->actions = array( 'download_sysinfo' ); |
|
47
|
|
|
|
|
48
|
|
|
$this->label = array( |
|
49
|
|
|
'page_title' => __( 'Bulk Delete - System Info', 'bulk-delete' ), |
|
50
|
|
|
'menu_title' => __( 'System Info', 'bulk-delete' ), |
|
51
|
|
|
); |
|
52
|
|
|
|
|
53
|
|
|
$this->messages = array( |
|
54
|
|
|
'info_message' => __( 'Please include this information when posting support requests.', 'bulk-delete' ), |
|
55
|
|
|
); |
|
56
|
|
|
|
|
57
|
|
|
add_action( 'bd_download_sysinfo', array( $this, 'generate_sysinfo_download' ) ); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Render header. |
|
62
|
|
|
* |
|
63
|
|
|
* @since 5.5.4 |
|
64
|
|
|
*/ |
|
65
|
|
|
protected function render_header() { |
|
66
|
|
|
?> |
|
67
|
|
|
<div class="updated"> |
|
68
|
|
|
<p><strong><?php echo $this->messages['info_message']; ?></strong></p> |
|
69
|
|
|
</div> |
|
70
|
|
|
|
|
71
|
|
|
<?php if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { ?> |
|
72
|
|
|
<div class="notice notice-warning"> |
|
73
|
|
|
<p><strong> |
|
74
|
|
|
<?php printf( __( 'SAVEQUERIES is <a href="%s" target="_blank">enabled</a>. This puts additional load on the memory and will restrict the number of items that can be deleted.', 'bulk-delete' ), 'https://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis' ); ?> |
|
75
|
|
|
</strong></p> |
|
76
|
|
|
</div> |
|
77
|
|
|
<?php } ?> |
|
78
|
|
|
|
|
79
|
|
|
<?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) { ?> |
|
80
|
|
|
<div class="notice notice-warning"> |
|
81
|
|
|
<p><strong> |
|
82
|
|
|
<?php printf( __( 'DISABLE_WP_CRON is <a href="%s" target="_blank">enabled</a>. This prevents scheduler from running.', 'bulk-delete' ), 'https://codex.wordpress.org/Editing_wp-config.php#Disable_Cron_and_Cron_Timeout' ); ?> |
|
83
|
|
|
</strong></p> |
|
84
|
|
|
</div> |
|
85
|
|
|
<?php } ?> |
|
86
|
|
|
|
|
87
|
|
|
<?php bd_render_sidebar_iframe(); ?> |
|
88
|
|
|
<?php |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Shows the system info panel which contains version data and debug info. |
|
93
|
|
|
* |
|
94
|
|
|
* @since 5.5.4 |
|
95
|
|
|
* @global $wpdb Global object $wpdb Used to query the database using the WordPress Database API |
|
96
|
|
|
*/ |
|
97
|
|
|
protected function render_body() { |
|
98
|
|
|
global $wpdb; |
|
99
|
|
|
|
|
100
|
|
|
if ( get_bloginfo( 'version' ) < '3.4' ) { |
|
101
|
|
|
$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
102
|
|
|
$theme = $theme_data['Name'] . ' ' . $theme_data['Version']; |
|
103
|
|
|
} else { |
|
104
|
|
|
$theme_data = wp_get_theme(); |
|
105
|
|
|
$theme = $theme_data->Name . ' ' . $theme_data->Version; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
// Try to identity the hosting provider |
|
109
|
|
|
$host = false; |
|
110
|
|
|
if ( defined( 'WPE_APIKEY' ) ) { |
|
111
|
|
|
$host = 'WP Engine'; |
|
112
|
|
|
} elseif ( defined( 'PAGELYBIN' ) ) { |
|
113
|
|
|
$host = 'Pagely'; |
|
114
|
|
|
} |
|
115
|
|
|
?> |
|
116
|
|
|
<textarea wrap="off" style="width:100%;height:500px;font-family:Menlo,Monaco,monospace;white-space:pre;" readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="bulk-delete-sysinfo" title="<?php _e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'bulk-delete' ); ?>"> |
|
117
|
|
|
### Begin System Info ### |
|
118
|
|
|
<?php |
|
119
|
|
|
/** |
|
120
|
|
|
* Runs before displaying system info. |
|
121
|
|
|
* |
|
122
|
|
|
* This action is primarily for adding extra content in System Info. |
|
123
|
|
|
*/ |
|
124
|
|
|
do_action( 'bd_system_info_before' ); |
|
125
|
|
|
?> |
|
126
|
|
|
|
|
127
|
|
|
Multisite: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n" ?> |
|
128
|
|
|
|
|
129
|
|
|
SITE_URL: <?php echo site_url() . "\n"; ?> |
|
130
|
|
|
HOME_URL: <?php echo home_url() . "\n"; ?> |
|
131
|
|
|
Browser: <?php echo esc_html( $_SERVER['HTTP_USER_AGENT'] ), "\n"; ?> |
|
132
|
|
|
|
|
133
|
|
|
Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; ?> |
|
134
|
|
|
Active Theme: <?php echo $theme . "\n"; ?> |
|
135
|
|
|
<?php |
|
136
|
|
|
if ( false !== $host ) { ?> |
|
137
|
|
|
Host: <?php echo $host . "\n\n"; ?> |
|
138
|
|
|
<?php |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
$post_types = get_post_types(); |
|
142
|
|
|
?> |
|
143
|
|
|
Registered Post types: <?php echo implode( ', ', $post_types ) . "\n"; ?> |
|
144
|
|
|
<?php |
|
145
|
|
|
foreach ( $post_types as $post_type ) { |
|
146
|
|
|
echo $post_type; |
|
147
|
|
|
if ( strlen( $post_type ) < 26 ) { |
|
148
|
|
|
echo str_repeat( ' ', 26 - strlen( $post_type ) ); |
|
149
|
|
|
} |
|
150
|
|
|
$post_count = wp_count_posts( $post_type ); |
|
151
|
|
|
foreach ( $post_count as $key => $value ) { |
|
152
|
|
|
echo $key, '=', $value, ', '; |
|
153
|
|
|
} |
|
154
|
|
|
echo "\n"; |
|
155
|
|
|
} |
|
156
|
|
|
?> |
|
157
|
|
|
|
|
158
|
|
|
Bulk Delete Version: <?php echo Bulk_Delete::VERSION . "\n"; ?> |
|
159
|
|
|
WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?> |
|
160
|
|
|
PHP Version: <?php echo PHP_VERSION . "\n"; ?> |
|
161
|
|
|
MySQL Version: <?php echo $wpdb->db_version() . "\n"; ?> |
|
162
|
|
|
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?> |
|
163
|
|
|
|
|
164
|
|
|
WordPress Memory Limit: <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?> |
|
165
|
|
|
WordPress Max Limit: <?php echo WP_MAX_MEMORY_LIMIT; ?><?php echo "\n"; ?> |
|
166
|
|
|
PHP Memory Limit: <?php echo ini_get( 'memory_limit' ) . "\n"; ?> |
|
167
|
|
|
|
|
168
|
|
|
SAVEQUERIES: <?php echo defined( 'SAVEQUERIES' ) ? SAVEQUERIES ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?> |
|
169
|
|
|
WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?> |
|
170
|
|
|
WP_SCRIPT_DEBUG: <?php echo defined( 'WP_SCRIPT_DEBUG' ) ? WP_SCRIPT_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n" ?> |
|
171
|
|
|
|
|
172
|
|
|
GMT Offset: <?php echo esc_html( get_option( 'gmt_offset' ) ), "\n\n"; ?> |
|
173
|
|
|
DISABLE_WP_CRON: <?php echo defined( 'DISABLE_WP_CRON' ) ? DISABLE_WP_CRON ? 'Yes' . "\n" : 'No' . "\n" : 'Not set' . "\n" ?> |
|
174
|
|
|
WP_CRON_LOCK_TIMEOUT: <?php echo defined( 'WP_CRON_LOCK_TIMEOUT' ) ? WP_CRON_LOCK_TIMEOUT : 'Not set', "\n" ?> |
|
175
|
|
|
EMPTY_TRASH_DAYS: <?php echo defined( 'EMPTY_TRASH_DAYS' ) ? EMPTY_TRASH_DAYS : 'Not set', "\n" ?> |
|
176
|
|
|
|
|
177
|
|
|
PHP Safe Mode: <?php echo ini_get( 'safe_mode' ) ? 'Yes' : 'No', "\n"; ?> |
|
178
|
|
|
PHP Upload Max Size: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?> |
|
179
|
|
|
PHP Post Max Size: <?php echo ini_get( 'post_max_size' ) . "\n"; ?> |
|
180
|
|
|
PHP Upload Max Filesize: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?> |
|
181
|
|
|
PHP Time Limit: <?php echo ini_get( 'max_execution_time' ) . "\n"; ?> |
|
182
|
|
|
PHP Max Input Vars: <?php echo ini_get( 'max_input_vars' ) . "\n"; ?> |
|
183
|
|
|
PHP Arg Separator: <?php echo ini_get( 'arg_separator.output' ) . "\n"; ?> |
|
184
|
|
|
PHP Allow URL File Open: <?php echo ini_get( 'allow_url_fopen' ) ? 'Yes' : 'No', "\n"; ?> |
|
185
|
|
|
|
|
186
|
|
|
WP Table Prefix: <?php echo 'Length: '. strlen( $wpdb->prefix ), "\n";?> |
|
187
|
|
|
|
|
188
|
|
|
Session: <?php echo isset( $_SESSION ) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?> |
|
189
|
|
|
Session Name: <?php echo esc_html( ini_get( 'session.name' ) ); ?><?php echo "\n"; ?> |
|
190
|
|
|
Cookie Path: <?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?><?php echo "\n"; ?> |
|
191
|
|
|
Save Path: <?php echo esc_html( ini_get( 'session.save_path' ) ); ?><?php echo "\n"; ?> |
|
192
|
|
|
Use Cookies: <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?> |
|
193
|
|
|
Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?> |
|
194
|
|
|
|
|
195
|
|
|
DISPLAY ERRORS: <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?> |
|
196
|
|
|
FSOCKOPEN: <?php echo ( function_exists( 'fsockopen' ) ) ? 'Your server supports fsockopen.' : 'Your server does not support fsockopen.'; ?><?php echo "\n"; ?> |
|
197
|
|
|
cURL: <?php echo ( function_exists( 'curl_init' ) ) ? 'Your server supports cURL.' : 'Your server does not support cURL.'; ?><?php echo "\n"; ?> |
|
198
|
|
|
SOAP Client: <?php echo ( class_exists( 'SoapClient' ) ) ? 'Your server has the SOAP Client enabled.' : 'Your server does not have the SOAP Client enabled.'; ?><?php echo "\n"; ?> |
|
199
|
|
|
SUHOSIN: <?php echo ( extension_loaded( 'suhosin' ) ) ? 'Your server has SUHOSIN installed.' : 'Your server does not have SUHOSIN installed.'; ?><?php echo "\n"; ?> |
|
200
|
|
|
|
|
201
|
|
|
ACTIVE PLUGINS: |
|
202
|
|
|
|
|
203
|
|
|
<?php |
|
204
|
|
|
$plugins = get_plugins(); |
|
205
|
|
|
$active_plugins = get_option( 'active_plugins', array() ); |
|
206
|
|
|
|
|
207
|
|
|
foreach ( $plugins as $plugin_path => $plugin ) { |
|
208
|
|
|
// If the plugin isn't active, don't show it. |
|
209
|
|
|
if ( ! in_array( $plugin_path, $active_plugins ) ) { |
|
210
|
|
|
continue; |
|
211
|
|
|
} |
|
212
|
|
|
|
|
213
|
|
|
echo $plugin['Name'] . ': ' . $plugin['Version'] ."\n"; |
|
214
|
|
|
} |
|
215
|
|
|
|
|
216
|
|
|
if ( is_multisite() ) { |
|
217
|
|
|
?> |
|
218
|
|
|
|
|
219
|
|
|
NETWORK ACTIVE PLUGINS: |
|
220
|
|
|
|
|
221
|
|
|
<?php |
|
222
|
|
|
$plugins = wp_get_active_network_plugins(); |
|
223
|
|
|
$active_plugins = get_site_option( 'active_sitewide_plugins', array() ); |
|
224
|
|
|
|
|
225
|
|
|
foreach ( $plugins as $plugin_path ) { |
|
226
|
|
|
$plugin_base = plugin_basename( $plugin_path ); |
|
227
|
|
|
|
|
228
|
|
|
// If the plugin isn't active, don't show it. |
|
229
|
|
|
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) { |
|
230
|
|
|
continue; |
|
231
|
|
|
} |
|
232
|
|
|
|
|
233
|
|
|
$plugin = get_plugin_data( $plugin_path ); |
|
234
|
|
|
|
|
235
|
|
|
echo $plugin['Name'] . ' :' . $plugin['Version'] ."\n"; |
|
236
|
|
|
} |
|
237
|
|
|
} |
|
238
|
|
|
do_action( 'bd_system_info_after' ); |
|
239
|
|
|
?> |
|
240
|
|
|
### End System Info ###</textarea> |
|
241
|
|
|
<p class="submit"> |
|
242
|
|
|
<input type="hidden" name="bd_action" value="download_sysinfo"> |
|
243
|
|
|
<?php submit_button( 'Download System Info File', 'primary', 'bulk-delete-download-sysinfo', false ); ?> |
|
244
|
|
|
</p> |
|
245
|
|
|
<?php |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* Generates the System Info Download File. |
|
250
|
|
|
* |
|
251
|
|
|
* @since 5.0 |
|
252
|
|
|
* @return void |
|
253
|
|
|
*/ |
|
254
|
|
|
public function generate_sysinfo_download() { |
|
255
|
|
|
nocache_headers(); |
|
256
|
|
|
|
|
257
|
|
|
header( 'Content-type: text/plain' ); |
|
258
|
|
|
header( 'Content-Disposition: attachment; filename="bulk-delete-system-info.txt"' ); |
|
259
|
|
|
|
|
260
|
|
|
echo wp_strip_all_tags( $_POST['bulk-delete-sysinfo'] ); |
|
261
|
|
|
die(); |
|
262
|
|
|
} |
|
263
|
|
|
} |
|
264
|
|
|
|
|
265
|
|
|
BD_System_Info_page::factory(); |
|
266
|
|
|
|