PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.2.18
Adminify – White Label, Admin Menu Editor, Login Customizer v4.2.18
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Modules / ServerInformation / ServerInfo_WP_Details.php

ServerInfo_WP_Details.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.2.18, at Inc/Modules/ServerInformation/ServerInfo_WP_Details.php

352 lines 14.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PXLBSAdminify\Inc\Modules\ServerInformation;
4
5 use PXLBSAdminify\Inc\Classes\ServerInfo;
6 use PXLBSAdminify\Inc\Utils;
7
8 // no direct access allowed
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * PXLBSAdminify
15 *
16 * @package Server Information
17 *
18 * @author WP Adminify <support@wpadminify.com>
19 */
20
21 class ServerInfo_WP_Details {
22
23
24 public function __construct() {
25 $this->init();
26 }
27
28 public function init() {
29 $server_info = new ServerInfo();
30
31 $help = '<span class="dashicons dashicons-editor-help"></span>';
32 $enabled = '<span class="adminify-compability enable"><span class="dashicons dashicons-yes"></span> ' . esc_html__( 'Enabled', 'adminify' ) . '</span>';
33 $disabled = '<span class="adminify-compability disable"><span class="dashicons dashicons-no"></span> ' . esc_html__( 'Disabled', 'adminify' ) . '</span>';
34 $yes = '<span class="adminify-compability enable"><span class="dashicons dashicons-yes"></span> ' . esc_html__( 'Yes', 'adminify' ) . '</span>';
35 $no = '<span class="adminify-compability disable"><span class="dashicons dashicons-no"></span> ' . esc_html__( 'No', 'adminify' ) . '</span>';
36 $entered = '<span class="adminify-compability enable"><span class="dashicons dashicons-yes"></span> ' . esc_html__( 'Defined', 'adminify' ) . '</span>';
37 $not_entered = '<span class="adminify-compability disable"><span class="dashicons dashicons-no"></span> ' . esc_html__( 'Not defined', 'adminify' ) . '</span>';
38 $sec_key = '<span class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Please enter this security key in the wp-confiq.php file', 'adminify' ) . '!</span>';
39 ?>
40
41 <div class="wrap">
42 <h1><?php echo wp_kses_post( Utils::admin_page_title( esc_html__( 'Site Information', 'adminify' ) ) ); ?></h1>
43 </div>
44
45
46 <p><?php echo wp_kses_post( 'First, you can see the most important information about your WordPress installation at a glance. Learn more about the <a href="https://wordpress.org/about/requirements/" target="_blank" rel="noopener">requirements</a>' ); ?>.</p>
47 </br>
48
49 <table class="wp-list-table widefat posts mt-5">
50 <thead>
51 <tr>
52 <th width="35%" class="manage-column"><?php esc_html_e( 'Info', 'adminify' ); ?></th>
53 <th class="manage-column"><?php esc_html_e( 'Result', 'adminify' ); ?></th>
54 </tr>
55 </thead>
56 <tbody>
57 <tr>
58 <td width="35%"><?php esc_html_e( 'WP Version', 'adminify' ); ?>:</td>
59 <td><strong><?php bloginfo( 'version' ); ?></strong></td>
60 </tr>
61
62 <tr>
63 <td><?php esc_html_e( 'PHP Version', 'adminify' ); ?>:</td>
64 <td><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_php_version() ) ); ?></td>
65 </tr>
66
67 <tr>
68 <td><?php esc_html_e( 'MySQL Version', 'adminify' ); ?>:</td>
69 <td><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_mysql_version() ) ); ?></td>
70 </tr>
71
72 <tr>
73 <td><?php esc_html_e( 'PHP Memory WP-Limit', 'adminify' ); ?>:</td>
74 <td>
75 <?php
76 $memory = $server_info->convert_memory_size( WP_MEMORY_LIMIT );
77
78 if ( $memory < 67108864 ) {
79 // echo '<span class="warning"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%1$s - For better performance, we recommend setting memory to at least 64MB. See: %2$s', 'adminify' ), size_format( $memory ), '<a href="https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php" target="_blank" rel="noopener">' . __( 'Increasing memory allocated to PHP', 'adminify' ) . '</a>' ) . '</span>';
80
81 echo sprintf(
82 wp_kses_post( '<span class="warning"><span class="dashicons dashicons-warning"></span> %1$s - For better performance, we recommend setting memory to at least 64MB. See: <a href="https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php" target="_blank" rel="noopener">%2$s</a></span>' ),
83 esc_html(size_format( $memory )),
84 esc_html__( 'Increasing memory allocated to PHP', 'adminify' )
85 );
86 } else {
87 echo '<strong>' . esc_html( size_format( $memory ) ) . '</strong>';
88 }
89 ?>
90 </td>
91 </tr>
92
93 <tr>
94 <td><?php esc_html_e( 'PHP Memory Server-Limit', 'adminify' ); ?>:</td>
95 <td>
96 <?php
97 if ( function_exists( 'memory_get_usage' ) ) {
98 $system_memory = $server_info->convert_memory_size( @ini_get( 'memory_limit' ) );
99 $memory = max( $memory, $system_memory );
100 }
101
102 if ( $memory < 67108864 ) {
103 // echo '<span class="warning"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%1$s - For better performance, we recommend setting memory to at least 64MB. See: %2$s', 'adminify' ), esc_html( size_format( $memory ) ), '<a href="https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php" target="_blank" rel="noopener">' . __( 'Increasing memory allocated to PHP', 'adminify' ) . '</a>' ) . '</span>';
104
105 echo sprintf(
106 wp_kses_post('<span class="warning"><span class="dashicons dashicons-warning"></span>%1$s - For better performance, we recommend setting memory to at least 64MB. See: <a href="https://wordpress.org/support/article/editing-wp-config-php/#increasing-memory-allocated-to-php" target="_blank" rel="noopener">%2$s</a></span>'),
107 esc_html( size_format( $memory )),
108 esc_html__( 'Increasing memory allocated to PHP', 'adminify' )
109 );
110 } else {
111 echo '<strong>' . esc_html( size_format( $memory ) ) . '</strong>';
112 }
113 ?>
114 </td>
115 </tr>
116
117 <tr>
118 <td><?php esc_html_e( 'PHP Memory WP-Usage', 'adminify' ); ?>:</td>
119 <td>
120 <?php
121 if ( $server_info->get_wp_memory_usage()['MemLimitGet'] == '-1' ) {
122 echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)';
123 } else {
124 echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemLimitFormat'] ) );
125 ?>
126
127 <div class="adminify-system-progress">
128 <div class="status-progressbar">
129 <span><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ) ) . '% '; ?></span>
130 <div style="width: <?php echo esc_attr( Utils::kses_custom( $server_info->get_wp_memory_usage()['MemUsageCalc'] ) ); ?>%"></div>
131 </div>
132 </div>
133 <?php } ?>
134 </td>
135 </tr>
136
137 <tr>
138 <td><?php esc_html_e( 'PHP Memory Server-Usage', 'adminify' ); ?>:</td>
139 <td>
140 <?php
141 if ( $server_info->get_server_memory_usage()['MemLimitGet'] == '-1' ) {
142 echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . esc_html__( 'Unlimited', 'adminify' ) . ' (-1)';
143 } else {
144 echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageFormat'] ) ) . ' ' . esc_html__( 'of', 'adminify' ) . ' ' . wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemLimitFormat'] ) );
145 ?>
146 <div class="adminify-system-progress">
147 <div class="status-progressbar">
148 <span><?php echo wp_kses_post( Utils::kses_custom( $server_info->get_server_memory_usage()['MemUsageCalc'] ) ) . '% '; ?></span>
149 <div style="width: <?php echo esc_attr( $server_info->get_server_memory_usage()['MemUsageCalc'] ); ?>%"></div>
150 </div>
151 </div>
152 <?php } ?>
153 </td>
154 </tr>
155
156 <tr>
157 <td><?php esc_html_e( 'PHP Max Upload Size (WP)', 'adminify' ); ?>:</td>
158 <td><?php echo esc_html( (int) ini_get( 'upload_max_filesize' ) . ' MB (' . size_format( wp_max_upload_size() ) . ')' ); ?></td>
159 </tr>
160
161 <tr>
162 <td><?php esc_html_e( 'WP Home URL', 'adminify' ); ?>:</td>
163 <td><?php echo esc_html( get_home_url() ); ?></td>
164 </tr>
165
166 <tr>
167 <td><?php esc_html_e( 'WP Site URL', 'adminify' ); ?>:</td>
168 <td><?php echo esc_html( get_site_url() ); ?></td>
169 </tr>
170
171 <tr>
172 <td><?php esc_html_e( 'Document Root', 'adminify' ); ?>:</td>
173 <td><?php echo esc_html( get_home_path() ); ?></td>
174 </tr>
175 </tbody>
176 </table>
177
178 <h2 class="pt-5"><?php echo esc_html__( 'Current Theme', 'adminify' ); ?></h2>
179
180 <table class="wp-list-table widefat posts">
181 <thead>
182 <tr>
183 <th width="35%" class="manage-column"><?php echo esc_html__( 'Info', 'adminify' ); ?></th>
184 <th class="manage-column"><?php echo esc_html__( 'Result', 'adminify' ); ?></th>
185 </tr>
186 </thead>
187
188 <tbody>
189 <?php
190 $active_theme = wp_get_theme();
191 $theme_version = $active_theme->Version;
192 ?>
193 <tr>
194 <td><?php esc_html_e( 'Name', 'adminify' ); ?>:</td>
195 <td><?php echo wp_kses_post( $active_theme->Name ); ?></td>
196 </tr>
197
198 <tr>
199 <td><?php esc_html_e( 'Version', 'adminify' ); ?>:</td>
200 <td>
201 <?php echo esc_html( $theme_version ); ?>
202 </td>
203 </tr>
204
205 <tr>
206 <td><?php esc_html_e( 'Author URL', 'adminify' ); ?>:</td>
207 <td><?php echo esc_url( $active_theme->{'Author URI'} ); ?></td>
208 </tr>
209
210 <tr>
211 <td><?php esc_html_e( 'Image Sizes', 'adminify' ); ?>:</td>
212 <td><?php echo esc_html( implode( ', ', get_intermediate_image_sizes() ) ); ?></td>
213 </tr>
214
215 <tr>
216 <td><?php esc_html_e( 'WooCommerce Compatibility', 'adminify' ); ?>:</td>
217 <td>
218 <?php
219 if ( current_theme_supports( 'woocommerce' ) ) {
220 echo wp_kses_post( $yes );
221 } else {
222 echo wp_kses_post( $no );
223 }
224 ?>
225 </td>
226 </tr>
227
228 <tr>
229 <td><?php esc_html_e( 'Child Theme', 'adminify' ); ?>: <a href="https://developer.wordpress.org/themes/advanced-topics/child-themes/" target="_blank" rel="noopener"><?php echo wp_kses_post( $help ); ?></a></td>
230 <td>
231 <?php
232 // echo is_child_theme() ? '<span class="yes"><span class="dashicons dashicons-yes"></span>Yes</span>' : '<span class="warning"><span class="dashicons dashicons-warning"></span> No. ' . sprintf( __( 'If you\'re want to modifying a theme, it safe to create a child theme. See: <a href="%s" target="_blank" rel="noopener">How to create a child theme</a>', 'adminify' ), 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) . '</span>';
233 ?>
234
235 <?php echo is_child_theme() ?
236 wp_kses_post('<span class="yes"><span class="dashicons dashicons-yes"></span>Yes</span>'):
237 sprintf(
238 wp_kses_post('<span class="warning"><span class="dashicons dashicons-warning"></span> No. If you\'re want to modifying a theme, it safe to create a child theme. See: <a href="%1$s" target="_blank" rel="noopener">%2$s</a></span>'),
239 esc_url('https://developer.wordpress.org/themes/advanced-topics/child-themes/'),
240 esc_html__('How to create a child theme','adminify')
241 );
242 ?>
243 </td>
244 </tr>
245
246 <?php
247 if ( is_child_theme() ) {
248 $parent_theme = wp_get_theme()->parent();
249 ?>
250 <tr>
251 <td><?php esc_html_e( 'Parent Theme Name', 'adminify' ); ?>:</td>
252 <td>
253 <?php
254 if ( ! empty( $parent_theme ) ) {
255 echo esc_html( $parent_theme->Name );}
256 ?>
257 </td>
258 </tr>
259 <tr>
260 <td><?php esc_html_e( 'Parent Theme Version', 'adminify' ); ?>:</td>
261 <td>
262 <?php
263 if ( ! empty( $parent_theme ) ) {
264 echo esc_html( $parent_theme->Version );}
265 if ( version_compare( $parent_theme->Version, $update_theme_version, '<' ) ) {
266 // echo ' &ndash; <strong style="color:red;">' . sprintf( __( '%s is available', 'adminify' ), esc_html( $update_theme_version ) ) . '</strong>';
267 echo sprintf(
268 wp_kses_post(' &ndash; <strong style="color:red;"> %s is available</strong>'),
269 esc_html( $update_theme_version )
270 );
271 }
272 ?>
273 </td>
274 </tr>
275 <tr>
276 <td><?php esc_html_e( 'Parent Theme Author URL', 'adminify' ); ?>:</td>
277 <td>
278 <?php
279 if ( ! empty( $parent_theme ) ) {
280 echo esc_url( $parent_theme->{'Author URI'} );}
281 ?>
282 </td>
283 </tr>
284 <?php } //is_child_theme ?>
285
286 </tbody>
287 </table>
288
289 <div class="adminify-flex-center adminify-justify-between">
290 <h2 class="is-pulled-left pt-5"><?php echo esc_html__( 'Active Plugins', 'adminify' ); ?></h2>
291
292 <button class="adminify-copy-btn adminify-btn adminify-btn-primary is-pulled-right" data-text="COPY" data-text-copied="COPIED">
293 <span class="icon icon-copy dashicons dashicons-admin-page"></span>
294 <span><?php esc_html_e( 'COPY', 'adminify' ); ?></span>
295 </button>
296 </div>
297
298
299 <table class="wp-list-table widefat posts adminify-active-plugins-data">
300 <thead>
301 <tr>
302 <th width="35%" class="manage-column"><?php echo esc_html__( 'Name', 'adminify' ); ?></th>
303 <th class="manage-column"><?php echo esc_html__( 'Version', 'adminify' ); ?></th>
304 <th width="35%" class="manage-column"><?php echo esc_html__( 'Author', 'adminify' ); ?></th>
305 </tr>
306 </thead>
307 <tbody>
308 <?php
309 $active_plugins = (array) get_option( 'active_plugins', [] );
310
311 if ( is_multisite() ) {
312 $network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', [] ) );
313 $active_plugins = array_merge( $active_plugins, $network_activated_plugins );
314 }
315
316 foreach ( $active_plugins as $plugin ) {
317 $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
318 $dirname = dirname( $plugin );
319 $version_string = '';
320 $network_string = '';
321
322 if ( ! empty( $plugin_data['Name'] ) ) {
323
324 // Link the plugin name to the plugin url if available.
325 $plugin_name = esc_html( $plugin_data['Name'] );
326
327 if ( ! empty( $plugin_data['PluginURI'] ) ) {
328 $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage', 'adminify' ) . '" target="_blank" rel="noopener">' . $plugin_name . '</a>';
329 }
330
331 if ( ! empty( $plugin_data['Network'] ) ) {
332 $network_string = ' &ndash; <strong style="color:black;">' . __( 'Network enabled', 'adminify' ) . '</strong>';
333 }
334 ?>
335 <tr>
336 <td><?php echo wp_kses_post( $plugin_name ); ?></td>
337 <td><?php echo esc_html( $plugin_data['Version'] ) .wp_kses_post( $version_string) . wp_kses_post($network_string); ?></td>
338 <td><?php echo wp_kses_post( $plugin_data['Author'] ); ?></td>
339 </tr>
340 <?php
341 }
342 }
343 ?>
344 </tbody>
345 </table>
346
347
348 <?php
349
350 }
351 }
352