| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Page - Status Report. |
| 4 |
*/ |
| 5 |
|
| 6 |
if ( ! defined( 'ABSPATH' ) ) { |
| 7 |
exit; |
| 8 |
} |
| 9 |
|
| 10 |
global $wpdb; |
| 11 |
|
| 12 |
$environment = UsersWP_Status::get_environment_info(); |
| 13 |
$database = UsersWP_Status::get_database_info(); |
| 14 |
$active_plugins = UsersWP_Status::get_active_plugins(); |
| 15 |
$theme = UsersWP_Status::get_theme_info(); |
| 16 |
$security = UsersWP_Status::get_security_info(); |
| 17 |
$pages = UsersWP_Status::get_pages(); |
| 18 |
|
| 19 |
?> |
| 20 |
<style type="text/css"> |
| 21 |
table.uwp-status-table { |
| 22 |
margin-bottom: 1em; |
| 23 |
} |
| 24 |
table.uwp-status-table th { |
| 25 |
font-weight: 700; |
| 26 |
padding: 9px; |
| 27 |
} |
| 28 |
table.uwp-status-table td, |
| 29 |
table.uwp-status-table th { |
| 30 |
font-size: 1.1em; |
| 31 |
font-weight: 400; |
| 32 |
} |
| 33 |
table.uwp-status-table h2 { |
| 34 |
font-size: 14px; |
| 35 |
margin: 0; |
| 36 |
} |
| 37 |
table.uwp-status-table td:first-child { |
| 38 |
width: 33%; |
| 39 |
} |
| 40 |
table.uwp-status-table td mark, |
| 41 |
table.uwp-status-table th mark { |
| 42 |
background: transparent none; |
| 43 |
} |
| 44 |
table.uwp-status-table td mark.yes, |
| 45 |
table.uwp-status-table th mark.yes { |
| 46 |
color: #7ad03a; |
| 47 |
} |
| 48 |
p.submit { |
| 49 |
margin: .5em 0; |
| 50 |
padding: 2px; |
| 51 |
} |
| 52 |
#debug-report { |
| 53 |
display: none; |
| 54 |
margin: 10px 0; |
| 55 |
padding: 0; |
| 56 |
position: relative; |
| 57 |
} |
| 58 |
#debug-report textarea { |
| 59 |
font-family: monospace; |
| 60 |
width: 100%; |
| 61 |
margin: 0; |
| 62 |
height: 300px; |
| 63 |
padding: 20px; |
| 64 |
border-radius: 0; |
| 65 |
resize: none; |
| 66 |
font-size: 12px; |
| 67 |
line-height: 20px; |
| 68 |
outline: 0; |
| 69 |
} |
| 70 |
</style> |
| 71 |
<div class="notice"> |
| 72 |
<p><?php esc_html_e( 'Please copy and paste this information in your ticket when contacting support:', 'userswp' ); ?> </p> |
| 73 |
<p class="submit"><a href="javascript:void" class="button-primary debug-report"><?php esc_html_e( 'Get system report', 'userswp' ); ?></a></p> |
| 74 |
<div id="debug-report"> |
| 75 |
<textarea readonly="readonly"></textarea> |
| 76 |
<p class="submit"><button id="copy-for-support" class="button-primary" href="javascript:void"><?php esc_html_e( 'Copy for Support', 'userswp' ); ?></button></p> |
| 77 |
<p class="copy-error hidden"><?php esc_html_e( 'Copying to clipboard failed. Please press Ctrl/Cmd+C to copy.', 'userswp' ); ?></p> |
| 78 |
</div> |
| 79 |
</div> |
| 80 |
<table class="uwp-status-table widefat"> |
| 81 |
<thead> |
| 82 |
<tr> |
| 83 |
<th colspan="3" data-export-label="WordPress Environment"><h2><?php esc_html_e( 'WordPress Environment', 'userswp' ); ?></h2></th> |
| 84 |
</tr> |
| 85 |
</thead> |
| 86 |
<tbody> |
| 87 |
<tr> |
| 88 |
<td data-export-label="Home URL"><?php esc_html_e( 'Home URL', 'userswp' ); ?>:</td> |
| 89 |
<td><?php echo esc_html( $environment['home_url'] ) ?></td> |
| 90 |
</tr> |
| 91 |
<tr> |
| 92 |
<td data-export-label="Site URL"><?php esc_html_e( 'Site URL', 'userswp' ); ?>:</td> |
| 93 |
<td><?php echo esc_html( $environment['site_url'] ) ?></td> |
| 94 |
</tr> |
| 95 |
<tr> |
| 96 |
<td data-export-label="UWP Version"><?php esc_html_e( 'UWP version', 'userswp' ); ?>:</td> |
| 97 |
<td><?php echo esc_html( $environment['version'] ) ?></td> |
| 98 |
</tr> |
| 99 |
<tr> |
| 100 |
<td data-export-label="WP Version"><?php esc_html_e( 'WP version', 'userswp' ); ?>:</td> |
| 101 |
<td><?php echo esc_html( $environment['wp_version'] ) ?></td> |
| 102 |
</tr> |
| 103 |
<tr> |
| 104 |
<td data-export-label="WP Multisite"><?php esc_html_e( 'WP multisite', 'userswp' ); ?>:</td> |
| 105 |
<td><?php echo ( $environment['wp_multisite'] ) ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
| 106 |
</tr> |
| 107 |
<tr> |
| 108 |
<td data-export-label="WP Memory Limit"><?php esc_html_e( 'WP memory limit', 'userswp' ); ?>:</td> |
| 109 |
<td><?php |
| 110 |
if ( $environment['wp_memory_limit'] < 67108864 ) { |
| 111 |
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', 'userswp' ), 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', 'userswp' ) . '</a>' ) . '</mark>'; |
| 112 |
} else { |
| 113 |
echo '<mark class="yes">' . esc_html( size_format( $environment['wp_memory_limit'] ) ) . '</mark>'; |
| 114 |
} |
| 115 |
?></td> |
| 116 |
</tr> |
| 117 |
<tr> |
| 118 |
<td data-export-label="WP Debug Mode"><?php esc_html_e( 'WP debug mode', 'userswp' ); ?>:</td> |
| 119 |
<td> |
| 120 |
<?php if ( $environment['wp_debug_mode'] ) : ?> |
| 121 |
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
| 122 |
<?php else : ?> |
| 123 |
<mark class="no">–</mark> |
| 124 |
<?php endif; ?> |
| 125 |
</td> |
| 126 |
</tr> |
| 127 |
<tr> |
| 128 |
<td data-export-label="WP Cron"><?php esc_html_e( 'WP cron', 'userswp' ); ?>:</td> |
| 129 |
<td> |
| 130 |
<?php if ( $environment['wp_cron'] ) : ?> |
| 131 |
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
| 132 |
<?php else : ?> |
| 133 |
<mark class="no">–</mark> |
| 134 |
<?php endif; ?> |
| 135 |
</td> |
| 136 |
</tr> |
| 137 |
<tr> |
| 138 |
<td data-export-label="Language"><?php esc_html_e( 'Language', 'userswp' ); ?>:</td> |
| 139 |
<td><?php echo esc_html( $environment['language'] ); ?></td> |
| 140 |
</tr> |
| 141 |
<tr> |
| 142 |
<td data-export-label="UWP Mode"><?php esc_html_e( 'UWP Installation Mode', 'userswp' ); ?>:</td> |
| 143 |
<?php $install_type = uwp_get_installation_type(); |
| 144 |
switch ($install_type) { |
| 145 |
case "multi_na_all": |
| 146 |
$mode = __('UsersWP is Network Activate for All Site', 'userswp'); |
| 147 |
break; |
| 148 |
case "multi_na_site_id": |
| 149 |
$mode = __('UsersWP is Network Activate for Specific Site', 'userswp'); |
| 150 |
break; |
| 151 |
case "multi_na_default": |
| 152 |
$mode = __('UsersWP is Activate for Main Site', 'userswp'); |
| 153 |
break; |
| 154 |
case "multi_not_na": |
| 155 |
case "single": |
| 156 |
default: |
| 157 |
$mode = __('UsersWP is Activate for Single Site', 'userswp'); |
| 158 |
} |
| 159 |
?> |
| 160 |
<td><?php echo esc_html( $mode ); ?></td> |
| 161 |
</tr> |
| 162 |
</tbody> |
| 163 |
</table> |
| 164 |
|
| 165 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 166 |
<thead> |
| 167 |
<tr> |
| 168 |
<th colspan="3" data-export-label="Server Environment"><h2><?php esc_html_e( 'Server Environment', 'userswp' ); ?></h2></th> |
| 169 |
</tr> |
| 170 |
</thead> |
| 171 |
<tbody> |
| 172 |
<tr> |
| 173 |
<td data-export-label="Server Info"><?php esc_html_e( 'Server info', 'userswp' ); ?>:</td> |
| 174 |
<td><?php echo esc_html( $environment['server_info'] ); ?></td> |
| 175 |
</tr> |
| 176 |
<tr> |
| 177 |
<td data-export-label="PHP Version"><?php esc_html_e( 'PHP version', 'userswp' ); ?>:</td> |
| 178 |
<td><?php |
| 179 |
if ( version_compare( $environment['php_version'], '5.6', '<' ) ) { |
| 180 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - We recommend a minimum PHP version of 5.6.', 'userswp' ), esc_html( $environment['php_version'] ) ) . '</mark>'; |
| 181 |
} else { |
| 182 |
echo '<mark class="yes">' . esc_html( $environment['php_version'] ) . '</mark>'; |
| 183 |
} |
| 184 |
?></td> |
| 185 |
</tr> |
| 186 |
<?php if ( function_exists( 'ini_get' ) ) : ?> |
| 187 |
<tr> |
| 188 |
<td data-export-label="PHP Post Max Size"><?php esc_html_e( 'PHP post max size', 'userswp' ); ?>:</td> |
| 189 |
<td><?php echo esc_html( size_format( $environment['php_post_max_size'] ) ) ?></td> |
| 190 |
</tr> |
| 191 |
<tr> |
| 192 |
<td data-export-label="PHP Time Limit"><?php esc_html_e( 'PHP time limit', 'userswp' ); ?>:</td> |
| 193 |
<td><?php echo esc_html( $environment['php_max_execution_time'] ) ?></td> |
| 194 |
</tr> |
| 195 |
<tr> |
| 196 |
<td data-export-label="PHP Max Input Vars"><?php esc_html_e( 'PHP max input vars', 'userswp' ); ?>:</td> |
| 197 |
<td><?php echo esc_html( $environment['php_max_input_vars'] ) ?></td> |
| 198 |
</tr> |
| 199 |
<tr> |
| 200 |
<td data-export-label="cURL Version"><?php esc_html_e( 'cURL version', 'userswp' ); ?>:</td> |
| 201 |
<td><?php echo esc_html( $environment['curl_version'] ) ?></td> |
| 202 |
</tr> |
| 203 |
<tr> |
| 204 |
<td data-export-label="SUHOSIN Installed"><?php esc_html_e( 'SUHOSIN installed', 'userswp' ); ?>:</td> |
| 205 |
<td><?php echo $environment['suhosin_installed'] ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
| 206 |
</tr> |
| 207 |
<?php endif; |
| 208 |
if ( $wpdb->use_mysqli ) { |
| 209 |
$ver = mysqli_get_server_info( $wpdb->dbh ); |
| 210 |
} else { |
| 211 |
$ver = mysql_get_server_info(); |
| 212 |
} |
| 213 |
if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?> |
| 214 |
<tr> |
| 215 |
<td data-export-label="MySQL Version"><?php esc_html_e( 'MySQL version', 'userswp' ); ?>:</td> |
| 216 |
<td> |
| 217 |
<?php |
| 218 |
if ( version_compare( $environment['mysql_version'], '5.6', '<' ) ) { |
| 219 |
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', 'userswp' ), esc_html( $environment['mysql_version'] ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . esc_html__( 'WordPress requirements', 'userswp' ) . '</a>' ) . '</mark>'; |
| 220 |
} else { |
| 221 |
echo '<mark class="yes">' . esc_html( $environment['mysql_version'] ) . '</mark>'; |
| 222 |
} |
| 223 |
?> |
| 224 |
</td> |
| 225 |
</tr> |
| 226 |
<?php endif; ?> |
| 227 |
<tr> |
| 228 |
<td data-export-label="Max Upload Size"><?php esc_html_e( 'Max upload size', 'userswp' ); ?>:</td> |
| 229 |
<td><?php echo esc_html( size_format( $environment['max_upload_size'] ) ) ?></td> |
| 230 |
</tr> |
| 231 |
<tr> |
| 232 |
<td data-export-label="Default Timezone is UTC"><?php esc_html_e( 'Default timezone is UTC', 'userswp' ); ?>:</td> |
| 233 |
<td><?php |
| 234 |
if ( 'UTC' !== $environment['default_timezone'] ) { |
| 235 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Default timezone is %s - it should be UTC', 'userswp' ), esc_html( $environment['default_timezone'] ) ) . '</mark>'; |
| 236 |
} else { |
| 237 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 238 |
} ?> |
| 239 |
</td> |
| 240 |
</tr> |
| 241 |
<tr> |
| 242 |
<td data-export-label="fsockopen/cURL"><?php esc_html_e( 'fsockopen/cURL', 'userswp' ); ?>:</td> |
| 243 |
<td><?php |
| 244 |
if ( $environment['fsockopen_or_curl_enabled'] ) { |
| 245 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 246 |
} else { |
| 247 |
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.', 'userswp' ) . '</mark>'; |
| 248 |
} ?> |
| 249 |
</td> |
| 250 |
</tr> |
| 251 |
<tr> |
| 252 |
<td data-export-label="SoapClient"><?php esc_html_e( 'SoapClient', 'userswp' ); ?>:</td> |
| 253 |
<td><?php |
| 254 |
if ( $environment['soapclient_enabled'] ) { |
| 255 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 256 |
} else { |
| 257 |
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.', 'userswp' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' ) . '</mark>'; |
| 258 |
} ?> |
| 259 |
</td> |
| 260 |
</tr> |
| 261 |
<tr> |
| 262 |
<td data-export-label="DOMDocument"><?php esc_html_e( 'DOMDocument', 'userswp' ); ?>:</td> |
| 263 |
<td><?php |
| 264 |
if ( $environment['domdocument_enabled'] ) { |
| 265 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 266 |
} else { |
| 267 |
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.', 'userswp' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' ) . '</mark>'; |
| 268 |
} ?> |
| 269 |
</td> |
| 270 |
</tr> |
| 271 |
<tr> |
| 272 |
<td data-export-label="GZip"><?php esc_html_e( 'GZip', 'userswp' ); ?>:</td> |
| 273 |
<td><?php |
| 274 |
if ( $environment['gzip_enabled'] ) { |
| 275 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 276 |
} else { |
| 277 |
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.', 'userswp' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' ) . '</mark>'; |
| 278 |
} ?> |
| 279 |
</td> |
| 280 |
</tr> |
| 281 |
<tr> |
| 282 |
<td data-export-label="GD Library"><?php esc_html_e( 'GD Library', 'userswp' ); ?>:</td> |
| 283 |
<td><?php |
| 284 |
if ( $environment['gd_library'] ) { |
| 285 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 286 |
} else { |
| 287 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Your server does not have enabled %s - this is required for image processing.', 'userswp' ), '<a href="https://secure.php.net/manual/en/image.installation.php">GD Library</a>' ) . '</mark>'; |
| 288 |
} ?> |
| 289 |
</td> |
| 290 |
</tr> |
| 291 |
<tr> |
| 292 |
<td data-export-label="Multibyte String"><?php esc_html_e( 'Multibyte string', 'userswp' ); ?>:</td> |
| 293 |
<td><?php |
| 294 |
if ( $environment['mbstring_enabled'] ) { |
| 295 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 296 |
} else { |
| 297 |
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.', 'userswp' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' ) . '</mark>'; |
| 298 |
} ?> |
| 299 |
</td> |
| 300 |
</tr> |
| 301 |
<tr> |
| 302 |
<td data-export-label="Remote Post"><?php esc_html_e( 'Remote POST', 'userswp' ); ?>:</td> |
| 303 |
<td><?php |
| 304 |
if ( $environment['remote_post_successful'] ) { |
| 305 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 306 |
} else { |
| 307 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%s failed. Contact your hosting provider.', 'userswp' ), 'wp_remote_post()' ) . ' ' . esc_html( $environment['remote_post_response'] ) . '</mark>'; |
| 308 |
} ?> |
| 309 |
</td> |
| 310 |
</tr> |
| 311 |
<tr> |
| 312 |
<td data-export-label="Remote Get"><?php esc_html_e( 'Remote GET', 'userswp' ); ?>:</td> |
| 313 |
<td><?php |
| 314 |
if ( $environment['remote_get_successful'] ) { |
| 315 |
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
| 316 |
} else { |
| 317 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%s failed. Contact your hosting provider.', 'userswp' ), 'wp_remote_get()' ) . ' ' . esc_html( $environment['remote_get_response'] ) . '</mark>'; |
| 318 |
} ?> |
| 319 |
</td> |
| 320 |
</tr> |
| 321 |
<?php |
| 322 |
$rows = apply_filters( 'uwp_system_status_environment_rows', array() ); |
| 323 |
if(count($rows) > 0) { |
| 324 |
foreach ($rows as $row) { |
| 325 |
if (!empty($row['success'])) { |
| 326 |
$css_class = 'yes'; |
| 327 |
$icon = '<span class="dashicons dashicons-yes"></span>'; |
| 328 |
} else { |
| 329 |
$css_class = 'error'; |
| 330 |
$icon = '<span class="dashicons dashicons-no-alt"></span>'; |
| 331 |
} |
| 332 |
?> |
| 333 |
<tr> |
| 334 |
<td data-export-label="<?php echo esc_attr($row['name']); ?>"><?php echo esc_html($row['name']); ?> |
| 335 |
: |
| 336 |
</td> |
| 337 |
<td> |
| 338 |
<mark class="<?php echo esc_attr($css_class); ?>"> |
| 339 |
<?php echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php echo !empty($row['note']) ? wp_kses_data($row['note']) : ''; ?> |
| 340 |
</mark> |
| 341 |
</td> |
| 342 |
</tr><?php |
| 343 |
} |
| 344 |
}?> |
| 345 |
</tbody> |
| 346 |
</table> |
| 347 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 348 |
<thead> |
| 349 |
<tr> |
| 350 |
<th colspan="3" data-export-label="User Platform"><h2><?php esc_html_e( 'User Platform', 'userswp' ); ?></h2></th> |
| 351 |
</tr> |
| 352 |
</thead> |
| 353 |
<tbody> |
| 354 |
<tr> |
| 355 |
<td data-export-label="Platform"><?php esc_html_e( 'Platform', 'userswp' ); ?>:</td> |
| 356 |
<td><?php echo esc_html( $environment['platform'] ); ?></td> |
| 357 |
</tr> |
| 358 |
<tr> |
| 359 |
<td data-export-label="Browser name"><?php esc_html_e( 'Browser name', 'userswp' ); ?>:</td> |
| 360 |
<td><?php echo esc_html( $environment['browser_name'] ); ?></td> |
| 361 |
</tr> |
| 362 |
<tr> |
| 363 |
<td data-export-label="Browser version"><?php esc_html_e( 'Browser version', 'userswp' ); ?>:</td> |
| 364 |
<td><?php echo esc_html( $environment['browser_version'] ); ?></td> |
| 365 |
</tr> |
| 366 |
<tr> |
| 367 |
<td data-export-label="User agent"><?php esc_html_e( 'User agent', 'userswp' ); ?>:</td> |
| 368 |
<td><?php echo esc_html( $environment['user_agent'] ); ?></td> |
| 369 |
</tr> |
| 370 |
</tbody> |
| 371 |
</table> |
| 372 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 373 |
<thead> |
| 374 |
<tr> |
| 375 |
<th colspan="3" data-export-label="Database"><h2><?php esc_html_e( 'Database', 'userswp' ); ?></h2></th> |
| 376 |
</tr> |
| 377 |
</thead> |
| 378 |
<tbody> |
| 379 |
<tr> |
| 380 |
<td data-export-label="UWP Database Version"><?php esc_html_e( 'UWP database version', 'userswp' ); ?>:</td> |
| 381 |
<td><?php echo esc_html( $database['uwp_db_version'] ); ?></td> |
| 382 |
</tr> |
| 383 |
<tr> |
| 384 |
<td data-export-label="UWP Database Prefix"><?php esc_html_e( 'Database Prefix', 'userswp' ); ?></td> |
| 385 |
<td><?php |
| 386 |
if ( strlen( $database['database_prefix'] ) > 20 ) { |
| 387 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( '%1$s - We recommend using a prefix with less than 20 characters.', 'userswp' ), esc_html( $database['database_prefix'] ) ) . '</mark>'; |
| 388 |
} else { |
| 389 |
echo '<mark class="yes">' . esc_html( $database['database_prefix'] ) . '</mark>'; |
| 390 |
} |
| 391 |
?> |
| 392 |
</td> |
| 393 |
</tr> |
| 394 |
<tr> |
| 395 |
<td><?php esc_html_e( 'Total Database Size', 'userswp' ); ?></td> |
| 396 |
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['data'] + $database['database_size']['index'] ) ); ?></td> |
| 397 |
</tr> |
| 398 |
|
| 399 |
<tr> |
| 400 |
<td><?php esc_html_e( 'Database Data Size', 'userswp' ); ?></td> |
| 401 |
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['data'] ) ); ?></td> |
| 402 |
</tr> |
| 403 |
|
| 404 |
<tr> |
| 405 |
<td><?php esc_html_e( 'Database Index Size', 'userswp' ); ?></td> |
| 406 |
<td><?php printf( '%.2fMB', esc_html( $database['database_size']['index'] ) ); ?></td> |
| 407 |
</tr> |
| 408 |
|
| 409 |
<?php foreach ( $database['database_tables']['userswp'] as $table => $table_data ) { ?> |
| 410 |
<tr> |
| 411 |
<td><?php echo esc_html( $table ); ?></td> |
| 412 |
<td> |
| 413 |
<?php if( ! $table_data ) { |
| 414 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Table does not exist', 'userswp' ) . '</mark>'; |
| 415 |
} else { |
| 416 |
printf( esc_html__( 'Data: %.2fMB + Index: %.2fMB', 'userswp' ), esc_html( uwp_format_decimal( $table_data['data'], 2 ) ), esc_html( uwp_format_decimal( $table_data['index'], 2 ) ) ); |
| 417 |
} ?> |
| 418 |
</td> |
| 419 |
</tr> |
| 420 |
<?php } ?> |
| 421 |
|
| 422 |
<?php foreach ( $database['database_tables']['other'] as $table => $table_data ) { ?> |
| 423 |
<tr> |
| 424 |
<td><?php echo esc_html( $table ); ?></td> |
| 425 |
<td> |
| 426 |
<?php printf( esc_html__( 'Data: %.2fMB + Index: %.2fMB', 'userswp' ), esc_html( uwp_format_decimal( $table_data['data'], 2 ) ), esc_html( uwp_format_decimal( $table_data['index'], 2 ) ) ); ?> |
| 427 |
</td> |
| 428 |
</tr> |
| 429 |
<?php } ?> |
| 430 |
</tbody> |
| 431 |
</table> |
| 432 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 433 |
<thead> |
| 434 |
<tr> |
| 435 |
<th colspan="3" data-export-label="Security"><h2><?php esc_html_e( 'Security', 'userswp' ); ?></h2></th> |
| 436 |
</tr> |
| 437 |
</thead> |
| 438 |
<tbody> |
| 439 |
<tr> |
| 440 |
<td data-export-label="Secure connection (HTTPS)"><?php esc_html_e( 'Secure connection (HTTPS)', 'userswp' ); ?>:</td> |
| 441 |
<td> |
| 442 |
<?php if ( $security['secure_connection'] ) : ?> |
| 443 |
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
| 444 |
<?php else : ?> |
| 445 |
<mark class="error"><span class="dashicons dashicons-warning"></span><?php echo esc_html__( 'Your site is not using HTTPS.', 'userswp' ); ?></mark> |
| 446 |
<?php endif; ?> |
| 447 |
</td> |
| 448 |
</tr> |
| 449 |
<tr> |
| 450 |
<td data-export-label="Hide errors from visitors"><?php esc_html_e( 'Hide errors from visitors', 'userswp' ); ?></td> |
| 451 |
<td> |
| 452 |
<?php if ( $security['hide_errors'] ) : ?> |
| 453 |
<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
| 454 |
<?php else : ?> |
| 455 |
<mark class="error"><span class="dashicons dashicons-warning"></span><?php esc_html_e( 'Error messages should not be shown to visitors.', 'userswp' ); ?></mark> |
| 456 |
<?php endif; ?> |
| 457 |
</td> |
| 458 |
</tr> |
| 459 |
</tbody> |
| 460 |
</table> |
| 461 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 462 |
<thead> |
| 463 |
<tr> |
| 464 |
<th colspan="3" data-export-label="Active Plugins (<?php echo count( $active_plugins ) ?>)"><h2><?php esc_html_e( 'Active Plugins', 'userswp' ); ?> (<?php echo count( $active_plugins ) ?>)</h2></th> |
| 465 |
</tr> |
| 466 |
</thead> |
| 467 |
<tbody> |
| 468 |
<?php |
| 469 |
foreach ( $active_plugins as $plugin ) { |
| 470 |
if ( ! empty( $plugin['name'] ) ) { |
| 471 |
$dirname = dirname( $plugin['plugin'] ); |
| 472 |
|
| 473 |
$version_string = ''; |
| 474 |
$network_string = ''; |
| 475 |
if ( ! empty( $plugin['latest_verison'] ) && version_compare( $plugin['latest_verison'], $plugin['version'], '>' ) ) { |
| 476 |
/* translators: %s: plugin latest version */ |
| 477 |
$version_string = ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'userswp' ), $plugin['latest_verison'] ) . '</strong>'; |
| 478 |
} |
| 479 |
|
| 480 |
if ( false != $plugin['network_activated'] ) { |
| 481 |
$network_string = ' – <strong style="color:black;">' . esc_html__( 'Network enabled', 'userswp' ) . '</strong>'; |
| 482 |
} |
| 483 |
?> |
| 484 |
<tr> |
| 485 |
<td> |
| 486 |
<?php if ( ! empty( $plugin['url'] ) ) { ?> |
| 487 |
<a href="<?php echo esc_url( $plugin['url'] ); ?>" aria-label="<?php esc_attr_e( 'Visit plugin homepage' , 'userswp' ); ?>" target="_blank"><?php echo esc_html( $plugin['name'] ); ?></a> |
| 488 |
<?php } else { echo esc_html( $plugin['name'] ); } ?> |
| 489 |
</td> |
| 490 |
<td><?php |
| 491 |
/* translators: %s: plugin author */ |
| 492 |
printf( esc_html__( 'by %s', 'userswp' ), esc_html( $plugin['author_name'] ) ); |
| 493 |
echo ' – ' . esc_html( $plugin['version'] ) . $version_string . $network_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 494 |
?></td> |
| 495 |
</tr> |
| 496 |
<?php |
| 497 |
} |
| 498 |
} |
| 499 |
?> |
| 500 |
</tbody> |
| 501 |
</table> |
| 502 |
|
| 503 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 504 |
<thead> |
| 505 |
<tr> |
| 506 |
<th colspan="3" data-export-label="UWP Pages"><h2><?php esc_html_e( 'UWP Pages', 'userswp' ); ?></h2></th> |
| 507 |
</tr> |
| 508 |
</thead> |
| 509 |
<tbody> |
| 510 |
<?php |
| 511 |
foreach ( $pages as $page ) { |
| 512 |
$error = false; |
| 513 |
|
| 514 |
echo '<tr><td data-export-label="' . esc_attr( $page['page_name'] ) . '">'; |
| 515 |
if ( $page['page_id'] ) { |
| 516 |
echo '<a href="' . esc_url( get_edit_post_link( $page['page_id'] ) ) . '" aria-label="' . esc_attr( wp_sprintf( __( 'Edit %s page', 'userswp' ), $page['page_name'] ) ) . '">' . esc_html( $page['page_name'] ) . '</a>'; |
| 517 |
} else { |
| 518 |
echo esc_html( $page['page_name'] ); |
| 519 |
} |
| 520 |
echo ':</td><td>'; |
| 521 |
|
| 522 |
$has_shortcode = false; |
| 523 |
// Page ID check. |
| 524 |
if ( ! $page['page_set'] ) { |
| 525 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Page not set', 'userswp' ) . '</mark>'; |
| 526 |
$error = true; |
| 527 |
} else if ( ! $page['page_exists'] ) { |
| 528 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Page ID is set, but the page does not exist', 'userswp' ) . '</mark>'; |
| 529 |
$error = true; |
| 530 |
} else if ( ! $page['page_visible'] ) { |
| 531 |
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . wp_kses_post( wp_sprintf( __( 'Page visibility should be <a href="%s" target="_blank">public</a>', 'userswp' ), 'https://codex.wordpress.org/Content_Visibility' ) ) . '</mark>'; |
| 532 |
$error = true; |
| 533 |
} else { |
| 534 |
// Shortcode check |
| 535 |
if ( $page['shortcode_present'] ) { |
| 536 |
$has_shortcode = true; |
| 537 |
} |
| 538 |
} |
| 539 |
|
| 540 |
if ( ! $error ) { |
| 541 |
if ( $has_shortcode ) { |
| 542 |
echo '<span class="dashicons dashicons-shortcode" title="' . esc_attr( wp_sprintf( __( 'Page contains shortcode %s', 'userswp' ), $page['shortcode'] ) ) . '"><font style="display:none">[/]</font></span> '; |
| 543 |
} |
| 544 |
echo '<mark class="yes">#' . absint( $page['page_id'] ) . ' - ' . esc_html( str_replace( home_url(), '', get_permalink( $page['page_id'] ) ) ) . '</mark>'; |
| 545 |
} |
| 546 |
echo '</td></tr>'; |
| 547 |
} |
| 548 |
?> |
| 549 |
</tbody> |
| 550 |
</table> |
| 551 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 552 |
<thead> |
| 553 |
<tr> |
| 554 |
<th colspan="3" data-export-label="Theme"><h2><?php esc_html_e( 'Theme', 'userswp' ); ?></h2></th> |
| 555 |
</tr> |
| 556 |
</thead> |
| 557 |
<tbody> |
| 558 |
<tr> |
| 559 |
<td data-export-label="Name"><?php esc_html_e( 'Name', 'userswp' ); ?>:</td> |
| 560 |
<td><?php echo esc_html( $theme['name'] ) ?></td> |
| 561 |
</tr> |
| 562 |
<tr> |
| 563 |
<td data-export-label="Version"><?php esc_html_e( 'Version', 'userswp' ); ?>:</td> |
| 564 |
<td><?php |
| 565 |
echo esc_html( $theme['version'] ); |
| 566 |
if ( version_compare( $theme['version'], $theme['latest_verison'], '<' ) ) { |
| 567 |
/* translators: %s: theme latest version */ |
| 568 |
echo ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'userswp' ), esc_html( $theme['latest_verison'] ) ) . '</strong>'; |
| 569 |
} |
| 570 |
?></td> |
| 571 |
</tr> |
| 572 |
<tr> |
| 573 |
<td data-export-label="Author URL"><?php esc_html_e( 'Author URL', 'userswp' ); ?>:</td> |
| 574 |
<td><?php echo esc_html( $theme['author_url'] ) ?></td> |
| 575 |
</tr> |
| 576 |
<tr> |
| 577 |
<td data-export-label="Child Theme"><?php esc_html_e( 'Child theme', 'userswp' ); ?>:</td> |
| 578 |
<td><?php |
| 579 |
echo $theme['is_child_theme'] ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>' : '<span class="dashicons dashicons-no-alt"></span> – ' . sprintf( __( 'If you are modifying userswp on a parent theme that you did not build personally we recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'userswp' ), 'https://codex.wordpress.org/Child_Themes' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 580 |
?></td> |
| 581 |
</tr> |
| 582 |
<?php |
| 583 |
if ( $theme['is_child_theme'] ) : |
| 584 |
?> |
| 585 |
<tr> |
| 586 |
<td data-export-label="Parent Theme Name"><?php esc_html_e( 'Parent theme name', 'userswp' ); ?>:</td> |
| 587 |
<td><?php echo esc_html( $theme['parent_name'] ); ?></td> |
| 588 |
</tr> |
| 589 |
<tr> |
| 590 |
<td data-export-label="Parent Theme Version"><?php esc_html_e( 'Parent theme version', 'userswp' ); ?>:</td> |
| 591 |
<td><?php |
| 592 |
echo esc_html( $theme['parent_version'] ); |
| 593 |
if ( version_compare( $theme['parent_version'], $theme['parent_latest_verison'], '<' ) ) { |
| 594 |
/* translators: %s: parant theme latest version */ |
| 595 |
echo ' – <strong style="color:red;">' . sprintf( esc_html__( '%s is available', 'userswp' ), esc_html( $theme['parent_latest_verison'] ) ) . '</strong>'; |
| 596 |
} |
| 597 |
?></td> |
| 598 |
</tr> |
| 599 |
<tr> |
| 600 |
<td data-export-label="Parent Theme Author URL"><?php esc_html_e( 'Parent theme author URL', 'userswp' ); ?>:</td> |
| 601 |
<td><?php echo esc_html( $theme['parent_author_url'] ) ?></td> |
| 602 |
</tr> |
| 603 |
<?php endif ?> |
| 604 |
</tbody> |
| 605 |
</table> |
| 606 |
<table class="uwp-status-table widefat" cellspacing="0"> |
| 607 |
<thead> |
| 608 |
<tr> |
| 609 |
<th colspan="3" data-export-label="Templates"><h2><?php esc_html_e( 'Templates', 'userswp' ); ?></h2></th> |
| 610 |
</tr> |
| 611 |
</thead> |
| 612 |
<tbody> |
| 613 |
<?php |
| 614 |
if ( ! empty( $theme['overrides'] ) ) { ?> |
| 615 |
<tr> |
| 616 |
<td data-export-label="Overrides"><?php esc_html_e( 'Overrides', 'userswp' ); ?></td> |
| 617 |
<td> |
| 618 |
<?php |
| 619 |
$total_overrides = count( $theme['overrides'] ); |
| 620 |
for ( $i = 0; $i < $total_overrides; $i++ ) { |
| 621 |
$override = $theme['overrides'][ $i ]; |
| 622 |
if ( $override['core_version'] && ( empty( $override['version'] ) || version_compare( $override['version'], $override['core_version'], '<' ) ) ) { |
| 623 |
$current_version = $override['version'] ? $override['version'] : '-'; |
| 624 |
printf( |
| 625 |
esc_html__( '%1$s version %2$s is out of date. The core version is %3$s', 'userswp' ), |
| 626 |
'<code>' . esc_html( $override['file'] ) . '</code>', |
| 627 |
'<strong style="color:red">' . esc_html( $current_version ) . '</strong>', |
| 628 |
esc_html( $override['core_version'] ) |
| 629 |
); |
| 630 |
} else { |
| 631 |
echo esc_html( $override['file'] ); |
| 632 |
} |
| 633 |
if ( ( count( $theme['overrides'] ) - 1 ) !== $i ) { |
| 634 |
echo ', '; |
| 635 |
} |
| 636 |
echo '<br />'; |
| 637 |
} |
| 638 |
?> |
| 639 |
</td> |
| 640 |
</tr> |
| 641 |
<?php |
| 642 |
} else { |
| 643 |
?> |
| 644 |
<tr> |
| 645 |
<td data-export-label="Overrides"><?php esc_html_e( 'Overrides', 'userswp' ); ?>:</td> |
| 646 |
<td>–</td> |
| 647 |
</tr> |
| 648 |
<?php |
| 649 |
} |
| 650 |
|
| 651 |
if ( true === $theme['has_outdated_templates'] ) { |
| 652 |
?> |
| 653 |
<tr> |
| 654 |
<td data-export-label="Outdated Templates"><?php esc_html_e( 'Outdated templates', 'userswp' ); ?>:</td> |
| 655 |
<td><mark class="error"><span class="dashicons dashicons-warning"></span></mark></td> |
| 656 |
</tr> |
| 657 |
<?php |
| 658 |
} |
| 659 |
?> |
| 660 |
</tbody> |
| 661 |
</table> |