| 1 |
<?php |
| 2 |
defined('ABSPATH') or die('Unauthorized Access'); |
| 3 |
|
| 4 |
$eol = Phpinfo_WP_EOL::status(); |
| 5 |
$is_pro = Phpinfo_WP_License::is_valid(); |
| 6 |
$sites = Phpinfo_WP_Network::sites(); |
| 7 |
$db = $is_pro ? Phpinfo_WP_DB_Health::server_info() : null; |
| 8 |
?> |
| 9 |
|
| 10 |
<div class="phpinfowp-pro-page"> |
| 11 |
|
| 12 |
<div class="phpinfowp-page-header"> |
| 13 |
<div> |
| 14 |
<h1><?php _e('phpinfo() WP — Network', 'phpinfo-wp'); ?></h1> |
| 15 |
<p class="phpinfowp-page-subtitle"><?php _e('Server-level info applies to all sites in the network. Per-site stats appear below.', 'phpinfo-wp'); ?></p> |
| 16 |
</div> |
| 17 |
</div> |
| 18 |
|
| 19 |
<!-- Shared server info --> |
| 20 |
<div class="phpinfowp-report-grid"> |
| 21 |
<div class="phpinfowp-report-stat"> |
| 22 |
<div class="phpinfowp-report-stat-label"><?php _e('PHP', 'phpinfo-wp'); ?></div> |
| 23 |
<div class="phpinfowp-report-stat-value"><?php echo esc_html(PHP_VERSION); ?></div> |
| 24 |
<div class="phpinfowp-report-stat-sub"> |
| 25 |
<?php if ($eol['status'] === 'eol'): ?> |
| 26 |
<span style="color:#d63638"><?php _e('End of life', 'phpinfo-wp'); ?></span> |
| 27 |
<?php elseif ($eol['status'] === 'warning'): ?> |
| 28 |
<span style="color:#dba617">EOL in <?php echo (int)$eol['days']; ?> days</span> |
| 29 |
<?php else: ?> |
| 30 |
<span style="color:#00a32a"><?php _e('Supported', 'phpinfo-wp'); ?></span> |
| 31 |
<?php endif; ?> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
<div class="phpinfowp-report-stat"> |
| 35 |
<div class="phpinfowp-report-stat-label"><?php _e('WordPress', 'phpinfo-wp'); ?></div> |
| 36 |
<div class="phpinfowp-report-stat-value"><?php echo esc_html(get_bloginfo('version')); ?></div> |
| 37 |
<div class="phpinfowp-report-stat-sub"><?php echo count($sites); ?> sites</div> |
| 38 |
</div> |
| 39 |
<div class="phpinfowp-report-stat"> |
| 40 |
<div class="phpinfowp-report-stat-label"><?php _e('Memory', 'phpinfo-wp'); ?></div> |
| 41 |
<div class="phpinfowp-report-stat-value"><?php echo esc_html(ini_get('memory_limit')); ?></div> |
| 42 |
</div> |
| 43 |
<?php if ($db): ?> |
| 44 |
<div class="phpinfowp-report-stat"> |
| 45 |
<div class="phpinfowp-report-stat-label"><?php _e('Database', 'phpinfo-wp'); ?></div> |
| 46 |
<div class="phpinfowp-report-stat-value"><?php echo esc_html($db['engine'] . ' ' . $db['version']); ?></div> |
| 47 |
</div> |
| 48 |
<?php endif; ?> |
| 49 |
</div> |
| 50 |
|
| 51 |
<h2 class="phpinfowp-section-heading" style="margin-top:28px"><?php _e('Per-site health', 'phpinfo-wp'); ?></h2> |
| 52 |
|
| 53 |
<?php if (!$is_pro): ?> |
| 54 |
<div class="notice notice-info inline"><p>Per-site autoload analysis requires a Pro license. <a href="<?php echo esc_url(network_admin_url('admin.php?page=phpinfowp-network')); ?>">Activate one</a>.</p></div> |
| 55 |
<?php endif; ?> |
| 56 |
|
| 57 |
<table class="wp-list-table widefat fixed striped"> |
| 58 |
<thead> |
| 59 |
<tr> |
| 60 |
<th style="width:60px"><?php _e('ID', 'phpinfo-wp'); ?></th> |
| 61 |
<th><?php _e('Site', 'phpinfo-wp'); ?></th> |
| 62 |
<th><?php _e('URL', 'phpinfo-wp'); ?></th> |
| 63 |
<th style="width:160px"><?php _e('Autoload data', 'phpinfo-wp'); ?></th> |
| 64 |
</tr> |
| 65 |
</thead> |
| 66 |
<tbody> |
| 67 |
<?php foreach ($sites as $site): |
| 68 |
$color = '#888'; |
| 69 |
if ($site['autoload_status'] === 'warning') $color = '#dba617'; |
| 70 |
if ($site['autoload_status'] === 'fail') $color = '#d63638'; |
| 71 |
if ($site['autoload_status'] === 'ok') $color = '#00a32a'; |
| 72 |
?> |
| 73 |
<tr> |
| 74 |
<td><?php echo (int)$site['blog_id']; ?></td> |
| 75 |
<td><?php echo esc_html($site['name']); ?></td> |
| 76 |
<td><a href="<?php echo esc_url($site['url']); ?>" target="_blank"><?php echo esc_html($site['url']); ?></a></td> |
| 77 |
<td> |
| 78 |
<?php if ($site['autoload'] !== null): ?> |
| 79 |
<span style="color:<?php echo $color; ?>;font-weight:600"> |
| 80 |
<?php echo size_format((int)$site['autoload']); ?> |
| 81 |
</span> |
| 82 |
<?php else: ?> |
| 83 |
<span style="color:#aaa">—</span> |
| 84 |
<?php endif; ?> |
| 85 |
</td> |
| 86 |
</tr> |
| 87 |
<?php endforeach; ?> |
| 88 |
</tbody> |
| 89 |
</table> |
| 90 |
</div> |
| 91 |
|