PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 1.0.7
Adminify – White Label, Admin Menu Editor, Login Customizer v1.0.7
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 +420 -414 4.2.141.0.7 View file →
@@ -1,500 +1,506 @@
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\Modules\ServerInformation\ServerInfo_WP_Details;
6 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Server_Details;
7 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_PHP_INI_Details;
8 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Htaccess_Details;
9 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Robots_Details;
10 +use WPAdminify\Inc\Modules\ServerInformation\ServerInfo_Error_Logs_Details;
12 11
13 12 // no direct access allowed
14 -if ( ! defined( 'ABSPATH' ) ) {
15 - exit;
16 -}
13 +if (!defined('ABSPATH')) exit;
17 14
18 15 /**
19 - * PXLBSAdminify
20 - *
16 + * WPAdminify
21 17 * @package Server Information
22 18 *
23 19 * @author WP Adminify <support@wpadminify.com>
24 20 */
25 21
26 -class ServerInformation {
22 +class ServerInformation
23 +{
24 + private $url;
25 + public $prefix = '_wpadminify_server_info';
27 26
28 - private $url;
29 - public $prefix = 'pxlbsadminify_server_info';
27 + public function __construct()
28 + {
29 + $this->url = WP_ADMINIFY_URL . 'Inc/Modules/ServerInformation';
30 + add_action('adminify_loaded', [$this, 'jltwp_adminify_server_info_menu']);
30 31
31 - public function __construct() {
32 - // if ( is_multisite() && ! is_network_admin() ) {
33 - // return; // only display to network admin if multisite is enbaled
34 - // }
32 + if (is_admin()) {
33 + add_action('admin_enqueue_scripts', [$this, 'jltwp_adminify_server_info_styles'], 99);
35 34
36 - $this->url = PXLBSADMINIFY_URL . 'Inc/Modules/ServerInformation';
37 - add_action( 'adminify_loaded', [ $this, 'server_info_menu' ] );
38 35
39 - if ( is_admin() ) {
40 - add_action( 'admin_enqueue_scripts', [ $this, 'server_info_styles' ], 99999 );
36 + // Refresh Debug Log
37 + add_action('wp_ajax_jltwp_adminify_error_log_content_refresh', [$this, 'jltwp_adminify_error_log_content_refresh']);
38 + add_action('wp_ajax_nopriv_jltwp_adminify_error_log_content_refresh', [$this, 'jltwp_adminify_error_log_content_refresh']);
41 39
42 - // Refresh Debug Log
43 - add_action( 'wp_ajax_pxlbsadminify_error_log_content_refresh', [ $this, 'pxlbsadminify_error_log_content_refresh' ] );
40 + // Clear Debug Log
41 + add_action('wp_ajax_jltwp_adminify_error_log_content_clear', [$this, 'jltwp_adminify_error_log_content_clear']);
42 + add_action('wp_ajax_nopriv_jltwp_adminify_error_log_content_clear', [$this, 'jltwp_adminify_error_log_content_clear']);
43 + }
44 + }
44 45
45 - // Clear Debug Log
46 - add_action( 'wp_ajax_pxlbsadminify_error_log_content_clear', [ $this, 'pxlbsadminify_error_log_content_clear' ] );
47 - }
48 - }
49 46
50 47
48 + /**
49 + * Server Information Script/Styles
50 + *
51 + * @return void
52 + */
53 + public function jltwp_adminify_server_info_styles()
54 + {
55 + global $pagenow;
51 56
52 - /**
53 - * Server Information Script/Styles
54 - *
55 - * @return void
56 - */
57 - public function server_info_styles() {
58 - global $pagenow;
57 + if (('admin.php' === $pagenow) && ('adminify-server-info' === $_GET['page'])) {
58 + 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;}
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 ) ) {
63 - 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;}
60 + /* If needed for white top-bar */
61 + .wp-adminify_page_adminify-server-info .adminify-header-inner {
62 + background-color: #fafafa !important;
63 + border-bottom: 1px solid #f5f5f5;
64 + }
65 + .wp-adminify .adminify-server-info .adminify-buttons{
66 + display: none !important;
67 + }
68 + </style>';
64 69
65 - /* If needed for white top-bar */
66 - .wp-adminify_page_adminify-server-info .adminify-header-inner {
67 - background-color: #fafafa !important;
68 - border-bottom: 1px solid #f5f5f5;
69 - }
70 - .wp-adminify .adminify-server-info .adminify-buttons{
71 - display: none !important;
72 - }
73 - </style>';
70 + wp_enqueue_script('wp-adminify-error-logs', $this->url . '/error-logs.js', ['jquery'], null, true);
71 + wp_localize_script('wp-adminify-error-logs', 'WPAdminify', $this->adminify_error_logs_object());
72 + }
73 + }
74 74
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() );
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 );
80 - }
81 - }
82 76
77 + /**
78 + * JS Object
79 + *
80 + * @return void
81 + */
82 + public function adminify_error_logs_object()
83 + {
84 + return array(
85 + 'ajax_url' => admin_url('admin-ajax.php'),
86 + 'security_nonce' => wp_create_nonce('adminify-error-logs-security-nonce'),
87 + 'label_update' => esc_html__('Will be updated...', WP_ADMINIFY_TD),
88 + 'label_clear' => esc_html__('Will be cleared...', WP_ADMINIFY_TD),
89 + 'label_done' => esc_html__('Done!', WP_ADMINIFY_TD)
90 + );
91 + }
83 92
93 + public function jltwp_adminify_server_info_menu()
94 + {
95 + if (!class_exists('ADMINIFY')) {
96 + return;
97 + }
84 98
85 - /**
86 - * JS Object
87 - *
88 - * @return void
89 - */
90 - public function adminify_error_logs_object() {
91 - return [
92 - 'ajax_url' => admin_url( 'admin-ajax.php' ),
93 - 'security_nonce' => wp_create_nonce( 'pxlbsadminify-error-logs-security-nonce' ),
94 - 'label_update' => esc_html__( 'Will be updated...', 'adminify' ),
95 - 'label_clear' => esc_html__( 'Will be cleared...', 'adminify' ),
96 - 'label_done' => esc_html__( 'Done!', 'adminify' ),
97 - ];
98 - }
99 99
100 - public function server_info_menu() {
101 - if ( ! class_exists( 'ADMINIFY' ) ) {
102 - return;
103 - }
100 + // WP Adminify Server Infos Settings
101 + \ADMINIFY::createOptions($this->prefix, array(
104 102
105 - // WP Adminify Server Infos Settings
106 - \ADMINIFY::createOptions(
107 - $this->prefix,
108 - [
103 + // Framework Title
104 + 'framework_title' => 'WP Adminify Server Info <small>by Jewel Theme</small>',
105 + 'framework_class' => 'adminify-server-info',
109 106
110 - // Framework Title
111 - 'framework_title' => __( 'Adminify Server Info <small>by Jewel Theme</small>', 'adminify' ),
112 - 'framework_class' => 'adminify-server-info',
107 + // menu settings
108 + 'menu_title' => 'Server Info',
109 + 'menu_slug' => 'adminify-server-info',
110 + 'menu_type' => 'submenu', // menu, submenu, options, theme, etc.
111 + 'menu_capability' => 'manage_options',
112 + 'menu_icon' => '',
113 + 'menu_position' => 56,
114 + 'menu_hidden' => false,
115 + 'menu_parent' => 'wp-adminify-settings',
113 116
114 - // menu settings
115 - 'menu_title' => 'Server Info',
116 - 'menu_slug' => 'adminify-server-info',
117 - 'menu_type' => 'submenu', // menu, submenu, options, theme, etc.
118 - 'menu_capability' => 'manage_options',
119 - 'menu_icon' => '',
120 - 'menu_position' => 59,
121 - 'menu_hidden' => false,
122 - 'menu_parent' => 'wp-adminify-settings',
117 + //Footer Credits
118 + 'footer_text' => ' ',
119 + 'footer_after' => ' ',
120 + 'footer_credit' => ' ',
123 121
124 - // Footer Credits
125 - 'footer_text' => ' ',
126 - 'footer_after' => ' ',
127 - 'footer_credit' => ' ',
122 + // menu extras
123 + 'show_bar_menu' => false,
124 + 'show_sub_menu' => false,
125 + 'show_in_network' => false,
126 + 'show_in_customizer' => false,
128 127
129 - // menu extras
130 - 'show_bar_menu' => false,
131 - 'show_sub_menu' => false,
132 - 'show_in_network' => true,
133 - 'show_in_customizer' => false,
128 + 'show_search' => false,
129 + 'show_reset_all' => false,
130 + 'show_reset_section' => false,
131 + 'show_footer' => false,
132 + 'show_all_options' => false,
133 + 'show_form_warning' => false,
134 + 'sticky_header' => false,
135 + 'save_defaults' => false,
136 + 'ajax_save' => false,
134 137
135 - 'show_search' => false,
136 - 'show_reset_all' => false,
137 - 'show_reset_section' => false,
138 - 'show_footer' => false,
139 - 'show_all_options' => false,
140 - 'show_form_warning' => false,
141 - 'sticky_header' => false,
142 - 'save_defaults' => false,
143 - 'ajax_save' => false,
138 + // admin bar menu settings
139 + 'admin_bar_menu_icon' => '',
140 + 'admin_bar_menu_priority' => 45,
144 141
145 - // admin bar menu settings
146 - 'admin_bar_menu_icon' => '',
147 - 'admin_bar_menu_priority' => 45,
148 142
149 - // database model
150 - 'database' => 'network', // options, transient, theme_mod, network(multisite support)
151 - 'transient_time' => 0,
143 + // database model
144 + 'database' => 'network', // options, transient, theme_mod, network(multisite support)
145 + 'transient_time' => 0,
152 146
153 - // typography options
154 - 'enqueue_webfont' => false,
155 - 'async_webfont' => false,
156 147
157 - // others
158 - 'output_css' => false,
148 + // typography options
149 + 'enqueue_webfont' => false,
150 + 'async_webfont' => false,
159 151
160 - // theme and wrapper classname
161 - 'nav' => 'normal',
162 - 'theme' => 'dark',
163 - 'class' => 'wp-adminify_page_adminify-server-info',
164 - ]
165 - );
152 + // others
153 + 'output_css' => false,
166 154
167 - // Server Info Section
168 - \ADMINIFY::createSection(
169 - $this->prefix,
170 - [
171 - 'title' => 'Server Info',
172 - 'icon' => 'fas fa-rocket',
173 - 'fields' => [
155 + // theme and wrapper classname
156 + 'nav' => 'normal',
157 + 'theme' => 'dark',
158 + 'class' => 'wp-adminify_page_adminify-server-info',
159 + ));
174 160
175 - [
176 - 'id' => 'server-info-tab',
177 - 'type' => 'tabbed',
178 - 'title' => '',
179 - 'tabs' => [
180 161
181 - [
182 - 'title' => __( 'WordPress', 'adminify' ),
183 - 'icon' => 'fab fa-wordpress',
184 - 'fields' => [
185 - [
186 - 'id' => 'wordpress',
187 - 'type' => 'callback',
188 - 'class' => 'adminify-one-col',
189 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_wordpress_details',
190 - ],
191 - ],
192 - ],
193 - [
194 - 'title' => __( 'Server', 'adminify' ),
195 - 'icon' => 'fa fa-gear',
196 - 'fields' => [
197 - [
198 - 'id' => 'server',
199 - 'type' => 'callback',
200 - 'class' => 'adminify-one-col',
201 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_server_details',
202 - ],
203 - ],
204 - ],
205 - [
206 - 'title' => __( 'PHP Info', 'adminify' ),
207 - 'icon' => 'fa fa-gear',
208 - 'fields' => [
209 - [
210 - 'id' => 'php_info',
211 - 'type' => 'callback',
212 - 'class' => 'adminify-one-col',
213 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_get_phpinfo',
214 - ],
215 - ],
216 - ],
217 - [
218 - 'title' => __( 'MySQL', 'adminify' ),
219 - 'icon' => 'fa fa-gear',
220 - 'fields' => [
221 - [
222 - 'id' => 'mysql_info',
223 - 'type' => 'callback',
224 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_get_mysqlinfo',
225 - ],
226 - ],
227 - ],
228 - [
229 - 'title' => __( 'Constants', 'adminify' ),
230 - 'icon' => 'fa fa-gear',
231 - 'fields' => [
232 - [
233 - 'id' => 'constants',
234 - 'type' => 'callback',
235 - 'class' => 'adminify-one-col',
236 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_constant_details',
237 - ],
238 - ],
239 - ],
240 - [
241 - 'title' => __( '.htaccess File', 'adminify' ),
242 - 'icon' => 'fa fa-gear',
243 - 'fields' => [
244 - [
245 - 'id' => 'htaccess',
246 - 'type' => 'callback',
247 - 'class' => 'adminify-one-col',
248 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_htacces_details',
249 - ],
250 - ],
251 - ],
252 - [
253 - 'title' => __( 'php.ini File', 'adminify' ),
254 - 'icon' => 'fa fa-gear',
255 - 'fields' => [
256 - [
257 - 'id' => 'php_ini',
258 - 'type' => 'callback',
259 - 'class' => 'adminify-one-col',
260 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_php_ini_details',
261 - ],
262 - ],
263 - ],
264 - [
265 - 'title' => __( 'Robots.txt File', 'adminify' ),
266 - 'icon' => 'fa fa-gear',
267 - 'fields' => [
268 - [
269 - 'id' => 'robots_txt',
270 - 'type' => 'callback',
271 - 'class' => 'adminify-one-col',
272 - 'function' => 'PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_robots_details',
273 - ],
274 - ],
275 - ],
276 - [
277 - 'title' => __( 'Error Logs', 'adminify' ),
278 - 'icon' => 'fa fa-gear',
279 - 'fields' => [
280 - [
281 - 'id' => 'error_logs',
282 - 'type' => 'callback',
283 - 'class' => 'adminify-one-col',
284 - 'function' => '\PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation::pxlbsadminify_error_log_details',
285 - ],
286 - ],
287 - ],
162 + // Server Info Section
163 + \ADMINIFY::createSection(
164 + $this->prefix,
165 + array(
166 + 'title' => 'Server Info',
167 + 'icon' => 'fas fa-rocket',
168 + 'fields' => array(
288 169
289 - ],
290 - ],
170 + array(
171 + 'id' => 'server-info-tab',
172 + 'type' => 'tabbed',
173 + 'title' => '',
174 + 'tabs' => array(
291 175
292 - ],
293 - ]
294 - );
295 - }
176 + array(
177 + 'title' => 'WordPress',
178 + 'icon' => 'fab fa-wordpress',
179 + 'fields' => array(
180 + array(
181 + 'id' => 'wordpress',
182 + 'type' => 'callback',
183 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_wordpress_details'
184 + ),
185 + )
186 + ),
187 + array(
188 + 'title' => 'Server',
189 + 'icon' => 'fa fa-gear',
190 + 'fields' => array(
191 + array(
192 + 'id' => 'server',
193 + 'type' => 'callback',
194 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_server_details'
195 + ),
196 + )
197 + ),
198 + array(
199 + 'title' => 'PHP Info',
200 + 'icon' => 'fa fa-gear',
201 + 'fields' => array(
202 + array(
203 + 'id' => 'php_info',
204 + 'type' => 'callback',
205 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_get_phpinfo'
206 + ),
207 + )
208 + ),
209 + array(
210 + 'title' => 'MySQL',
211 + 'icon' => 'fa fa-gear',
212 + 'fields' => array(
213 + array(
214 + 'id' => 'mysql_info',
215 + 'type' => 'callback',
216 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_get_mysqlinfo'
217 + ),
218 + )
219 + ),
220 + array(
221 + 'title' => 'Constants',
222 + 'icon' => 'fa fa-gear',
223 + 'fields' => array(
224 + array(
225 + 'id' => 'constants',
226 + 'type' => 'callback',
227 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_constant_details'
228 + ),
229 + )
230 + ),
231 + array(
232 + 'title' => '.htaccess File',
233 + 'icon' => 'fa fa-gear',
234 + 'fields' => array(
235 + array(
236 + 'id' => 'htaccess',
237 + 'type' => 'callback',
238 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_htacces_details'
239 + ),
240 + )
241 + ),
242 + array(
243 + 'title' => 'php.ini File',
244 + 'icon' => 'fa fa-gear',
245 + 'fields' => array(
246 + array(
247 + 'id' => 'php_ini',
248 + 'type' => 'callback',
249 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_php_ini_details'
250 + ),
251 + )
252 + ),
253 + array(
254 + 'title' => 'Robots.txt File',
255 + 'icon' => 'fa fa-gear',
256 + 'fields' => array(
257 + array(
258 + 'id' => 'robots_txt',
259 + 'type' => 'callback',
260 + 'function' => 'WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_robots_details'
261 + ),
262 + )
263 + ),
264 + array(
265 + 'title' => 'Error Logs',
266 + 'icon' => 'fa fa-gear',
267 + 'fields' => array(
268 + array(
269 + 'id' => 'error_logs',
270 + 'type' => 'callback',
271 + 'function' => '\WPAdminify\Inc\Modules\ServerInformation\ServerInformation::jltwp_adminify_error_log_details'
272 + ),
273 + )
274 + ),
296 275
297 276
298 - /**
299 - * Server Details
300 - */
301 - public static function pxlbsadminify_server_details() {
302 - new ServerInfo_Server_Details();
303 - }
277 + )
278 + ),
304 279
305 280
306 - /**
307 - * WordPress Details
308 - */
309 - public static function pxlbsadminify_wordpress_details() {
310 - new ServerInfo_WP_Details();
311 - }
312 281
282 + )
283 + )
284 + );
285 + }
313 286
314 - /**
315 - * Constant Details
316 - */
317 - public static function pxlbsadminify_constant_details() {
318 - new ServerInfo_Constant_Details();
319 - }
320 287
321 - /**
322 - * .htaccess file Details
323 - */
324 - public static function pxlbsadminify_htacces_details() {
325 - new ServerInfo_Htaccess_Details();
326 - }
288 + /**
289 + * Server Details
290 + */
291 + public static function jltwp_adminify_server_details()
292 + {
293 + new ServerInfo_Server_Details();
294 + }
327 295
328 - /**
329 - * php.ini file Details
330 - */
331 - public static function pxlbsadminify_php_ini_details() {
332 - new ServerInfo_PHP_INI_Details();
333 - }
334 296
335 - /**
336 - * Robots file Details
337 - */
338 - public static function pxlbsadminify_robots_details() {
339 - new ServerInfo_Robots_Details();
340 - }
297 + /**
298 + * WordPress Details
299 + */
300 + public static function jltwp_adminify_wordpress_details()
301 + {
302 + new ServerInfo_WP_Details();
303 + }
341 304
342 - /**
343 - * Error Logs Details
344 - */
345 - public static function pxlbsadminify_error_log_details() {
346 - new ServerInfo_Error_Logs_Details();
347 - }
348 305
349 - /**
350 - * Error Logs Details
351 - */
352 - public static function pxlbsadminify_get_phpinfo() {
353 - if ( ! class_exists( 'DOMDocument' ) ) {
354 - echo '<div class="wrap" id="PHPinfo">';
355 - echo '<h2>' . esc_html__( 'PHP', 'adminify' ) . ' ' . esc_html( phpversion() ) . '</h2>';
356 - 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 - echo '</div>';
358 - } else {
359 - ob_start();
360 - phpinfo(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_phpinfo -- intentional server-info display on a capability-gated admin screen.
361 - $phpinfo = ob_get_contents();
362 - ob_end_clean();
306 + /**
307 + * Constant Details
308 + */
309 + public static function jltwp_adminify_constant_details()
310 + {
311 + new ServerInfo_Constant_Details();
312 + }
363 313
364 - // Use DOMDocument to parse phpinfo()
365 - $html = new \DOMDocument( '1.0', 'UTF-8' );
366 - $internal_errors = libxml_use_internal_errors( true );
367 - $html->loadHTML( $phpinfo );
368 - libxml_use_internal_errors( $internal_errors );
314 + /**
315 + * .htaccess file Details
316 + */
317 + public static function jltwp_adminify_htacces_details()
318 + {
319 + new ServerInfo_Htaccess_Details();
320 + }
369 321
370 - // Style process
371 - $tables = $html->getElementsByTagName( 'table' );
372 - foreach ( $tables as $table ) {
373 - $table->setAttribute( 'class', 'widefat' );
374 - }
322 + /**
323 + * php.ini file Details
324 + */
325 + public static function jltwp_adminify_php_ini_details()
326 + {
327 + new ServerInfo_PHP_INI_Details();
328 + }
375 329
376 - // We only need the <body>
377 - $xpath = new \DOMXPath( $html );
378 - $body = $xpath->query( '/html/body' );
330 + /**
331 + * Robots file Details
332 + */
333 + public static function jltwp_adminify_robots_details()
334 + {
335 + new ServerInfo_Robots_Details();
336 + }
379 337
380 - // Save HTML fragment
381 - $phpinfo_html = $html->saveXml( $body->item( 0 ) );
338 + /**
339 + * Error Logs Details
340 + */
341 + public static function jltwp_adminify_error_log_details()
342 + {
343 + new ServerInfo_Error_Logs_Details();
344 + }
382 345
383 - echo '<div class="wrap" id="PHPinfo">';
384 - echo '<h2>' . esc_html__( 'PHP', 'adminify' ) . ' ' . esc_html( phpversion() ) . '</h2>';
385 - echo wp_kses_post( Utils::kses_custom( $phpinfo_html ) );
386 - echo '</div>';
387 - }
388 - }
346 + /**
347 + * Error Logs Details
348 + */
349 + public static function jltwp_adminify_get_phpinfo()
350 + {
389 351
352 + if (!class_exists('DOMDocument')) {
353 + echo '<div class="wrap" id="PHPinfo">';
354 + echo '<h2>PHP ' . phpversion() . '</h2>';
355 + echo 'You need <a href="http://php.net/manual/en/class.domdocument.php" target="_blank">DOMDocument extension</a> to be enabled.';
356 + echo '</div>';
357 + } else {
358 + ob_start();
359 + phpinfo();
360 + $phpinfo = ob_get_contents();
361 + ob_end_clean();
390 362
391 - /**
392 - * Get MYSQL Information
393 - *
394 - * @return void
395 - */
396 - public static function pxlbsadminify_get_mysqlinfo() {
397 - 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 - $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' );
363 + // Use DOMDocument to parse phpinfo()
364 + $html = new \DOMDocument('1.0', 'UTF-8');
365 + $html->loadHTML($phpinfo);
402 366
403 - if ( is_rtl() ) { ?>
404 - <style type="text/css">
405 - #MYSQLinfo,
406 - #MYSQLinfo table,
407 - #MYSQLinfo th,
408 - #MYSQLinfo td {
409 - direction: ltr;
410 - text-align: left;
411 - }
367 + // Style process
368 + $tables = $html->getElementsByTagName('table');
369 + foreach ($tables as $table) {
370 + $table->setAttribute('class', 'widefat');
371 + }
412 372
413 - #MYSQLinfo h2 {
414 - padding: 0.5em 0 0;
415 - }
416 - </style>
417 - <?php
418 - }
419 - echo '<div class="wrap" id="MYSQLinfo" >' . "\n";
420 - echo '<h2>' . esc_html__( 'MYSQL', 'adminify' ) . ' ' . esc_html( $sqlversion ) . '</h2>';
373 + // We only need the <body>
374 + $xpath = new \DOMXPath($html);
375 + $body = $xpath->query('/html/body');
421 376
422 - if ( $mysqlinfo ) {
423 - echo '<br class="clear" />' . "\n";
424 - echo '<table class="widefat" dir="ltr">' . "\n";
425 - echo '<thead><tr><th>' . esc_html__( 'Variable Name', 'adminify' ) . '</th><th>' . esc_html__( 'Value', 'adminify' ) . '</th></tr></thead><tbody>' . "\n";
426 - foreach ( $mysqlinfo as $info ) {
427 - echo '<tr class="" onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'\'"><td>' . esc_html( $info->Variable_name ) . '</td><td>' . esc_html( htmlspecialchars( $info->Value ) ) . '</td></tr>' . "\n";
428 - }
429 - echo '</tbody></table>' . "\n";
430 - }
431 - echo '</div>' . "\n";
432 - }
377 + // Save HTML fragment
378 + $phpinfo_html = $html->saveXml($body->item(0));
433 379
380 + echo '<div class="wrap" id="PHPinfo">';
381 + echo '<h2>PHP ' . phpversion() . '</h2>';
382 + echo $phpinfo_html;
383 + echo '</div>';
384 + }
385 + }
434 386
435 - // 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 ) {
438 - // Security check - only administrators can access error logs
439 - if ( ! current_user_can( 'manage_options' ) ) {
440 - wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'adminify' ) ) );
441 - }
442 387
443 - if ( ! empty( $_POST['command'] ) ) {
444 - $action = sanitize_key( $_POST['command'] );
388 + /**
389 + * Get MYSQL Information
390 + *
391 + * @return void
392 + */
393 + public static function jltwp_adminify_get_mysqlinfo()
394 + {
395 + global $wpdb;
396 + $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
397 + $mysqlinfo = $wpdb->get_results("SHOW VARIABLES");
445 398
446 - $file_content = '';
399 + if (is_rtl()) { ?>
400 + <style type="text/css">
401 + #MYSQLinfo,
402 + #MYSQLinfo table,
403 + #MYSQLinfo th,
404 + #MYSQLinfo td {
405 + direction: ltr;
406 + text-align: left;
407 + }
447 408
448 - // Check for user refreshing request
449 - if ( $action == 'refresh_error_log' ) {
409 + #MYSQLinfo h2 {
410 + padding: 0.5em 0 0;
411 + }
412 + </style>
413 +<?php }
414 + echo '<div class="wrap" id="MYSQLinfo" >' . "\n";
415 + echo "<h2>MYSQL $sqlversion</h2>\n";
450 416
451 - // Get the wp "debug.log" file
452 - $file = ServerInfo_Error_Logs_Details::custom_error_log();
417 + if ($mysqlinfo) {
418 + echo '<br class="clear" />' . "\n";
419 + echo '<table class="widefat" dir="ltr">' . "\n";
420 + echo '<thead><tr><th>' . __('Variable Name', WP_ADMINIFY_TD) . '</th><th>' . __('Value', WP_ADMINIFY_TD) . '</th></tr></thead><tbody>' . "\n";
421 + foreach ($mysqlinfo as $info) {
422 + echo '<tr class="" onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'\'"><td>' . $info->Variable_name . '</td><td>' . htmlspecialchars($info->Value) . '</td></tr>' . "\n";
423 + }
424 + echo '</tbody></table>' . "\n";
425 + }
426 + echo '</div>' . "\n";
427 + }
453 428
454 - // Get the wp "debug.log" file content
455 - $file_content = ServerInfo_Error_Logs_Details::custom_error_log_content( $file );
456 - }
457 429
458 - wp_send_json( [ 'file_content' => $file_content ] );
459 - }
460 - }
430 + // Refresh Button Ajax
431 + public function jltwp_adminify_error_log_content_refresh()
432 + {
433 + if (defined('DOING_AJAX') && DOING_AJAX && check_ajax_referer('adminify-error-logs-security-nonce', 'security') > 0) {
461 434
462 - die();
463 - }
435 + if ($_POST) {
464 436
437 + // Get user action to refresh error log file
438 + $request = json_decode(stripslashes($_POST['fileData']));
465 439
440 + if (defined('DOING_AJAX') && DOING_AJAX) {
441 + $action = $request[0]->command;
442 + }
466 443
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 ) {
469 - // Security check - only administrators can clear error logs
470 - if ( ! current_user_can( 'manage_options' ) ) {
471 - wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'adminify' ) ) );
472 - }
473 444
474 - if ( ! empty( $_POST['command'] ) ) {
475 - $file_content = '';
476 - $action = sanitize_key( $_POST['command'] );
477 - // Check for user clearing request
478 - if ( $action == 'clear_error_log' ) {
445 + $file_content = '';
479 446
480 - // Call wp file system
481 - global $wp_filesystem;
482 - WP_Filesystem();
447 + // Check for user refreshing request
448 + if ($action == "refresh_error_log") {
483 449
484 - // Get the wp "debug.log" file
485 - $file = ServerInfo_Error_Logs_Details::custom_error_log();
450 + // Get the wp "debug.log" file
451 + $file = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log();
486 452
487 - // Save no content to "debug.log" file the clear the file content
488 - $wp_filesystem->put_contents( $file, '', 0644 );
453 + // Get the wp "debug.log" file content
454 + $file_content = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log_content($file);
455 + }
489 456
490 - // Get the wp "debug.log" file content
491 - $file_content = ServerInfo_Error_Logs_Details::custom_error_log_content( $file );
492 - }
457 + wp_send_json(array('file_content' => $file_content));
458 + }
459 + }
493 460
494 - return wp_send_json( [ 'file_content' => $file_content ] );
495 - }
496 - }
461 + die();
462 + }
497 463
498 - die();
499 - }
464 +
465 +
466 + public function jltwp_adminify_error_log_content_clear()
467 + {
468 +
469 + if (defined('DOING_AJAX') && DOING_AJAX && check_ajax_referer('adminify-error-logs-security-nonce', 'security') > 0) {
470 +
471 + if ($_POST) {
472 +
473 + // Get user action to clear error log file
474 + $request = json_decode(stripslashes($_POST['fileData']));
475 +
476 + if (defined('DOING_AJAX') && DOING_AJAX) {
477 + $action = $request[0]->command;
478 + }
479 +
480 +
481 + $file_content = '';
482 +
483 + // Check for user clearing request
484 + if ($action == "clear_error_log") {
485 +
486 + // Call wp file system
487 + global $wp_filesystem;
488 + WP_Filesystem();
489 +
490 + // Get the wp "debug.log" file
491 + $file = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log();
492 +
493 + // Save no content to "debug.log" file the clear the file content
494 + $wp_filesystem->put_contents($file, '', 0644);
495 +
496 + // Get the wp "debug.log" file content
497 + $file_content = ServerInfo_Error_Logs_Details::jltwp_adminify_error_log_content($file);
498 + }
499 +
500 + return wp_send_json(array('file_content' => $file_content));
501 + }
502 + }
503 +
504 + die();
505 + }
500 506 }