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