PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.7.6
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.7.6
4.3.2 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 All 165 releases
← All changes | Inc/Modules/ServerInformation/ServerInformation.php +53 -57 4.2.144.0.7.6 View file →
@@ -1,15 +1,15 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Modules\ServerInformation;
3 +namespace WPAdminify\Inc\Modules\ServerInformation;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_WP_Details;
7 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_Server_Details;
8 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_PHP_INI_Details;
9 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_Htaccess_Details;
10 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_Robots_Details;
11 -use PXLBSAdminify\Inc\Modules\ServerInformation\ServerInfo_Error_Logs_Details;
5 +use WPAdminify\Inc\Utils;
6 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_WP_Details;
7 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Server_Details;
8 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_PHP_INI_Details;
9 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Htaccess_Details;
10 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Robots_Details;
11 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Error_Logs_Details;
12 12
13 13 // no direct access allowed
14 14 if ( ! defined( 'ABSPATH' ) ) {
15 15 exit;
@@ -15,9 +15,9 @@
15 15 exit;
16 16 }
17 17
18 18 /**
19 - * PXLBSAdminify
19 + * WPAdminify
20 20 *
21 21 * @package Server Information
22 22 *
23 23 * @author WP Adminify <support@wpadminify.com>
@@ -25,9 +25,9 @@
25 25
26 26 class ServerInformation {
27 27
28 28 private $url;
29 - public $prefix = 'pxlbsadminify_server_info';
29 + public $prefix = '_wpadminify_server_info';
30 30
31 31 public function __construct() {
32 32 // if ( is_multisite() && ! is_network_admin() ) {
33 33 // return; // only display to network admin if multisite is enbaled
@@ -32,19 +32,19 @@
32 32 // if ( is_multisite() && ! is_network_admin() ) {
33 33 // return; // only display to network admin if multisite is enbaled
34 34 // }
35 35
36 - $this->url = PXLBSADMINIFY_URL . 'Inc/Modules/ServerInformation';
37 - add_action( 'adminify_loaded', [ $this, 'server_info_menu' ] );
36 + $this->url = WP_ADMINIFY_URL . 'Inc/Modules/ServerInformation';
37 + add_action( 'adminify_loaded', [ $this, 'jltwp_adminify_server_info_menu' ] );
38 38
39 39 if ( is_admin() ) {
40 - add_action( 'admin_enqueue_scripts', [ $this, 'server_info_styles' ], 99999 );
40 + add_action( 'admin_enqueue_scripts', [ $this, 'jltwp_adminify_server_info_styles' ], 99999 );
41 41
42 42 // Refresh Debug Log
43 - add_action( 'wp_ajax_pxlbsadminify_error_log_content_refresh', [ $this, 'pxlbsadminify_error_log_content_refresh' ] );
43 + add_action( 'wp_ajax_jltwp_adminify_error_log_content_refresh', [ $this, 'jltwp_adminify_error_log_content_refresh' ] );
44 44
45 45 // Clear Debug Log
46 - add_action( 'wp_ajax_pxlbsadminify_error_log_content_clear', [ $this, 'pxlbsadminify_error_log_content_clear' ] );
46 + add_action( 'wp_ajax_jltwp_adminify_error_log_content_clear', [ $this, 'jltwp_adminify_error_log_content_clear' ] );
47 47 }
48 48 }
49 49
50 50
@@ -53,14 +53,12 @@
53 53 * Server Information Script/Styles
54 54 *
55 55 * @return void
56 56 */
57 - public function server_info_styles() {
57 + public function jltwp_adminify_server_info_styles() {
58 58 global $pagenow;
59 59
60 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only check, no state change.
61 - $current_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
62 - if ( ( 'admin.php' === $pagenow ) && ( 'adminify-server-info' === $current_page ) ) {
60 + if ( ( 'admin.php' === $pagenow ) && ( 'adminify-server-info' === $_GET['page'] ) ) {
63 61 echo '<style>.wp-adminify_page_adminify-server-info .adminify-header-inner{padding:0;}.wp-adminify_page_adminify-server-info .adminify-field-subheading{font-size:20px; padding-left:0;}.wp-adminify_page_adminify-server-info .adminify-nav,.wp-adminify_page_adminify-server-info .adminify-search,.wp-adminify_page_adminify-server-info .adminify-footer,.wp-adminify_page_adminify-server-info .adminify-reset-all,.wp-adminify_page_adminify-server-info .adminify-expand-all,.wp-adminify_page_adminify-server-info .adminify-header-left,.wp-adminify_page_adminify-server-info .adminify-reset-section,.wp-adminify_page_adminify-server-info .adminify-nav-background{display: none !important;}.wp-adminify_page_adminify-server-info .adminify-nav-normal + .adminify-content{margin-left: 0;}
64 62
65 63 /* If needed for white top-bar */
66 64 .wp-adminify_page_adminify-server-info .adminify-header-inner {
@@ -71,13 +69,13 @@
71 69 display: none !important;
72 70 }
73 71 </style>';
74 72
75 - wp_enqueue_script( 'adminify-error-logs', $this->url . '/error-logs.js', [ 'jquery' ], PXLBSADMINIFY_VER, true );
76 - wp_localize_script( 'adminify-error-logs', 'PXLBSADMINIFY_ERROR_LOGS', $this->adminify_error_logs_object() );
73 + wp_enqueue_script( 'wp-adminify-error-logs', $this->url . '/error-logs.js', [ 'jquery' ], null, true );
74 + wp_localize_script( 'wp-adminify-error-logs', 'WPAdminify_ErrorL', $this->adminify_error_logs_object() );
77 75
78 - wp_enqueue_style( 'adminify', \ADMINIFY_Setup::include_plugin_url( 'assets/css/style.min.css' ), [], PXLBSADMINIFY_VER, 'all' );
79 - wp_enqueue_script( 'adminify', \ADMINIFY_Setup::include_plugin_url( 'assets/js/main.min.js' ), [ 'jquery' ], PXLBSADMINIFY_VER, true );
76 + wp_enqueue_style( 'adminify', \ADMINIFY_Setup::include_plugin_url( 'assets/css/style.min.css' ), [], WP_ADMINIFY_VER, 'all' );
77 + wp_enqueue_script( 'adminify', \ADMINIFY_Setup::include_plugin_url( 'assets/js/main.min.js' ), [ 'jquery' ], WP_ADMINIFY_VER, true );
80 78 }
81 79 }
82 80
83 81
@@ -89,9 +87,9 @@
89 87 */
90 88 public function adminify_error_logs_object() {
91 89 return [
92 90 'ajax_url' => admin_url( 'admin-ajax.php' ),
93 - 'security_nonce' => wp_create_nonce( 'pxlbsadminify-error-logs-security-nonce' ),
91 + 'security_nonce' => wp_create_nonce( 'adminify-error-logs-security-nonce' ),
94 92 'label_update' => esc_html__( 'Will be updated...', 'adminify' ),
95 93 'label_clear' => esc_html__( 'Will be cleared...', 'adminify' ),
96 94 'label_done' => esc_html__( 'Done!', 'adminify' ),
97 95 ];
@@ -96,9 +94,9 @@
96 94 'label_done' => esc_html__( 'Done!', 'adminify' ),
97 95 ];
98 96 }
99 97
100 - public function server_info_menu() {
98 + public function jltwp_adminify_server_info_menu() {
101 99 if ( ! class_exists( 'ADMINIFY' ) ) {
102 100 return;
103 101 }
104 102
@@ -107,9 +105,9 @@
107 105 $this->prefix,
108 106 [
109 107
110 108 // Framework Title
111 - 'framework_title' => __( 'Adminify Server Info <small>by Jewel Theme</small>', 'adminify' ),
109 + 'framework_title' => __( 'WP Adminify Server Info <small>by Jewel Theme</small>', 'adminify' ),
112 110 'framework_class' => 'adminify-server-info',
113 111
114 112 // menu settings
115 113 'menu_title' => 'Server Info',
@@ -185,9 +183,9 @@
185 183 [
186 184 'id' => 'wordpress',
187 185 'type' => 'callback',
188 186 'class' => 'adminify-one-col',
189 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_wordpress_details',
187 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_wordpress_details',
190 188 ],
191 189 ],
192 190 ],
193 191 [
@@ -197,9 +195,9 @@
197 195 [
198 196 'id' => 'server',
199 197 'type' => 'callback',
200 198 'class' => 'adminify-one-col',
201 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_server_details',
199 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_server_details',
202 200 ],
203 201 ],
204 202 ],
205 203 [
@@ -209,9 +207,9 @@
209 207 [
210 208 'id' => 'php_info',
211 209 'type' => 'callback',
212 210 'class' => 'adminify-one-col',
213 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_get_phpinfo',
211 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_get_phpinfo',
214 212 ],
215 213 ],
216 214 ],
217 215 [
@@ -220,9 +218,9 @@
220 218 'fields' => [
221 219 [
222 220 'id' => 'mysql_info',
223 221 'type' => 'callback',
224 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_get_mysqlinfo',
222 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_get_mysqlinfo',
225 223 ],
226 224 ],
227 225 ],
228 226 [
@@ -232,9 +230,9 @@
232 230 [
233 231 'id' => 'constants',
234 232 'type' => 'callback',
235 233 'class' => 'adminify-one-col',
236 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_constant_details',
234 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_constant_details',
237 235 ],
238 236 ],
239 237 ],
240 238 [
@@ -244,9 +242,9 @@
244 242 [
245 243 'id' => 'htaccess',
246 244 'type' => 'callback',
247 245 'class' => 'adminify-one-col',
248 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_htacces_details',
246 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_htacces_details',
249 247 ],
250 248 ],
251 249 ],
252 250 [
@@ -256,9 +254,9 @@
256 254 [
257 255 'id' => 'php_ini',
258 256 'type' => 'callback',
259 257 'class' => 'adminify-one-col',
260 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_php_ini_details',
258 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_php_ini_details',
261 259 ],
262 260 ],
263 261 ],
264 262 [
@@ -268,9 +266,9 @@
268 266 [
269 267 'id' => 'robots_txt',
270 268 'type' => 'callback',
271 269 'class' => 'adminify-one-col',
272 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_robots_details',
270 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_robots_details',
273 271 ],
274 272 ],
275 273 ],
276 274 [
@@ -280,9 +278,9 @@
280 278 [
281 279 'id' => 'error_logs',
282 280 'type' => 'callback',
283 281 'class' => 'adminify-one-col',
284 - 'function' => '\PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_error_log_details',
282 + 'function' => '\WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_error_log_details',
285 283 ],
286 284 ],
287 285 ],
288 286
@@ -297,9 +295,9 @@
297 295
298 296 /**
299 297 * Server Details
300 298 */
301 - public static function pxlbsadminify_server_details() {
299 + public static function jltwp_adminify_server_details() {
302 300 new ServerInfo_Server_Details();
303 301 }
304 302
305 303
@@ -305,9 +303,9 @@
305 303
306 304 /**
307 305 * WordPress Details
308 306 */
309 - public static function pxlbsadminify_wordpress_details() {
307 + public static function jltwp_adminify_wordpress_details() {
310 308 new ServerInfo_WP_Details();
311 309 }
312 310
313 311
@@ -313,9 +311,9 @@
313 311
314 312 /**
315 313 * Constant Details
316 314 */
317 - public static function pxlbsadminify_constant_details() {
315 + public static function jltwp_adminify_constant_details() {
318 316 new ServerInfo_Constant_Details();
319 317 }
320 318
321 319 /**
@@ -320,9 +318,9 @@
320 318
321 319 /**
322 320 * .htaccess file Details
323 321 */
324 - public static function pxlbsadminify_htacces_details() {
322 + public static function jltwp_adminify_htacces_details() {
325 323 new ServerInfo_Htaccess_Details();
326 324 }
327 325
328 326 /**
@@ -327,9 +325,9 @@
327 325
328 326 /**
329 327 * php.ini file Details
330 328 */
331 - public static function pxlbsadminify_php_ini_details() {
329 + public static function jltwp_adminify_php_ini_details() {
332 330 new ServerInfo_PHP_INI_Details();
333 331 }
334 332
335 333 /**
@@ -334,9 +332,9 @@
334 332
335 333 /**
336 334 * Robots file Details
337 335 */
338 - public static function pxlbsadminify_robots_details() {
336 + public static function jltwp_adminify_robots_details() {
339 337 new ServerInfo_Robots_Details();
340 338 }
341 339
342 340 /**
@@ -341,9 +339,9 @@
341 339
342 340 /**
343 341 * Error Logs Details
344 342 */
345 - public static function pxlbsadminify_error_log_details() {
343 + public static function jltwp_adminify_error_log_details() {
346 344 new ServerInfo_Error_Logs_Details();
347 345 }
348 346
349 347 /**
@@ -348,9 +346,9 @@
348 346
349 347 /**
350 348 * Error Logs Details
351 349 */
352 - public static function pxlbsadminify_get_phpinfo() {
350 + public static function jltwp_adminify_get_phpinfo() {
353 351 if ( ! class_exists( 'DOMDocument' ) ) {
354 352 echo '<div class="wrap" id="PHPinfo">';
355 353 echo '<h2>' . esc_html__( 'PHP', 'adminify' ) . ' ' . esc_html( phpversion() ) . '</h2>';
356 354 echo 'You need <a href="' . esc_url( 'http://php.net/manual/en/class.domdocument.php' ) . '" target="_blank">' . esc_html__('DOMDocument extension' , 'adminify') . '</a> to be enabled.';
@@ -356,9 +354,9 @@
356 354 echo 'You need <a href="' . esc_url( 'http://php.net/manual/en/class.domdocument.php' ) . '" target="_blank">' . esc_html__('DOMDocument extension' , 'adminify') . '</a> to be enabled.';
357 355 echo '</div>';
358 356 } else {
359 357 ob_start();
360 - phpinfo(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_phpinfo -- intentional server-info display on a capability-gated admin screen.
358 + phpinfo();
361 359 $phpinfo = ob_get_contents();
362 360 ob_end_clean();
363 361
364 362 // Use DOMDocument to parse phpinfo()
@@ -381,9 +379,9 @@
381 379 $phpinfo_html = $html->saveXml( $body->item( 0 ) );
382 380
383 381 echo '<div class="wrap" id="PHPinfo">';
384 382 echo '<h2>' . esc_html__( 'PHP', 'adminify' ) . ' ' . esc_html( phpversion() ) . '</h2>';
385 - echo wp_kses_post( Utils::kses_custom( $phpinfo_html ) );
383 + echo Utils::wp_kses_custom( $phpinfo_html );
386 384 echo '</div>';
387 385 }
388 386 }
389 387
@@ -392,14 +390,12 @@
392 390 * Get MYSQL Information
393 391 *
394 392 * @return void
395 393 */
396 - public static function pxlbsadminify_get_mysqlinfo() {
394 + public static function jltwp_adminify_get_mysqlinfo() {
397 395 global $wpdb;
398 - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- direct query required for live server-info display; not cached intentionally.
399 396 $sqlversion = $wpdb->get_var( 'SELECT VERSION() AS version' );
400 - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- direct query required for live server-info display; not cached intentionally.
401 - $mysqlinfo = $wpdb->get_results( 'SHOW VARIABLES' );
397 + $mysqlinfo = $wpdb->get_results( 'SHOW VARIABLES' );
402 398
403 399 if ( is_rtl() ) { ?>
404 400 <style type="text/css">
405 401 #MYSQLinfo,
@@ -432,10 +428,10 @@
432 428 }
433 429
434 430
435 431 // Refresh Button Ajax
436 - public function pxlbsadminify_error_log_content_refresh() {
437 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX && check_ajax_referer( 'pxlbsadminify-error-logs-security-nonce', 'security' ) > 0 ) {
432 + public function jltwp_adminify_error_log_content_refresh() {
433 + if ( defined( 'DOING_AJAX' ) && DOING_AJAX && check_ajax_referer( 'adminify-error-logs-security-nonce', 'security' ) > 0 ) {
438 434 // Security check - only administrators can access error logs
439 435 if ( ! current_user_can( 'manage_options' ) ) {
440 436 wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'adminify' ) ) );
441 437 }
@@ -448,12 +444,12 @@
448 444 // Check for user refreshing request
449 445 if ( $action == 'refresh_error_log' ) {
450 446
451 447 // Get the wp "debug.log" file
452 - $file = ServerInfo_Error_Logs_Details::custom_error_log();
448 + $file = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log();
453 449
454 450 // Get the wp "debug.log" file content
455 - $file_content = ServerInfo_Error_Logs_Details::custom_error_log_content( $file );
451 + $file_content = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log_content( $file );
456 452 }
457 453
458 454 wp_send_json( [ 'file_content' => $file_content ] );
459 455 }
@@ -463,10 +459,10 @@
463 459 }
464 460
465 461
466 462
467 - public function pxlbsadminify_error_log_content_clear() {
468 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX && check_ajax_referer( 'pxlbsadminify-error-logs-security-nonce', 'security' ) > 0 ) {
463 + public function jltwp_adminify_error_log_content_clear() {
464 + if ( defined( 'DOING_AJAX' ) && DOING_AJAX && check_ajax_referer( 'adminify-error-logs-security-nonce', 'security' ) > 0 ) {
469 465 // Security check - only administrators can clear error logs
470 466 if ( ! current_user_can( 'manage_options' ) ) {
471 467 wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'adminify' ) ) );
472 468 }
@@ -481,15 +477,15 @@
481 477 global $wp_filesystem;
482 478 WP_Filesystem();
483 479
484 480 // Get the wp "debug.log" file
485 - $file = ServerInfo_Error_Logs_Details::custom_error_log();
481 + $file = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log();
486 482
487 483 // Save no content to "debug.log" file the clear the file content
488 484 $wp_filesystem->put_contents( $file, '', 0644 );
489 485
490 486 // Get the wp "debug.log" file content
491 - $file_content = ServerInfo_Error_Logs_Details::custom_error_log_content( $file );
487 + $file_content = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log_content( $file );
492 488 }
493 489
494 490 return wp_send_json( [ 'file_content' => $file_content ] );
495 491 }