| 1 |
<?php |
| 2 |
|
| 3 |
// don't load directly |
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
|
| 7 |
/*-----------------------------------------------------------------------------------*/ |
| 8 |
/* *. Borderless - System Info |
| 9 |
/*-----------------------------------------------------------------------------------*/ |
| 10 |
|
| 11 |
function Borderless_System_Info() { ?> |
| 12 |
|
| 13 |
<div class="wrap borderless-system-info"> |
| 14 |
|
| 15 |
<table class="widefat" cellspacing="0"> |
| 16 |
<thead> |
| 17 |
<tr> |
| 18 |
<th colspan="2"><b><?php _e( 'WordPress Environment', 'borderless' ); ?></b></th> |
| 19 |
</tr> |
| 20 |
</thead> |
| 21 |
<tbody> |
| 22 |
<tr> |
| 23 |
<td><?php _e( 'Home URL', 'borderless' ); ?>:</td> |
| 24 |
<td><?php form_option( 'home' ); ?></td> |
| 25 |
</tr> |
| 26 |
<tr> |
| 27 |
<td><?php _e( 'Site URL', 'borderless' ); ?>:</td> |
| 28 |
<td><?php form_option( 'siteurl' ); ?></td> |
| 29 |
</tr> |
| 30 |
<tr> |
| 31 |
<td><?php _e( 'WP Version', 'borderless' ); ?>:</td> |
| 32 |
<td><?php bloginfo( 'version' ); ?></td> |
| 33 |
</tr> |
| 34 |
<tr> |
| 35 |
<td><?php _e( 'WP Multisite', 'borderless' ); ?>:</td> |
| 36 |
<td><?php |
| 37 |
if ( is_multisite() ) |
| 38 |
echo '✔'; |
| 39 |
else |
| 40 |
echo '–'; |
| 41 |
?></td> |
| 42 |
</tr> |
| 43 |
<tr> |
| 44 |
<td><?php _e( 'WP Memory Limit', 'borderless' ); ?>:</td> |
| 45 |
<td><?php //echo "kok"; |
| 46 |
$memory_limit = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ); |
| 47 |
if ($memory_limit < 67108864) { |
| 48 |
echo '<mark>' . sprintf( __( '%1$s - We recommend setting wp memory at least 64MB.</mark> See: <a href="%2$s" target="_blank">Increasing WP Memory Limit</a>', 'borderless' ), size_format($memory_limit), 'https://visualmodo.com/fix-maximum-upload-php-memory-limit-wordpress/' ); |
| 49 |
} else { |
| 50 |
echo size_format( $memory_limit ); |
| 51 |
} |
| 52 |
?></td> |
| 53 |
</tr> |
| 54 |
<tr> |
| 55 |
<td><?php _e( 'WP Path', 'borderless' ); ?>:</td> |
| 56 |
<td><?php echo ABSPATH; ?></td> |
| 57 |
</tr> |
| 58 |
|
| 59 |
|
| 60 |
<tr> |
| 61 |
<td><?php _e( 'WP Debug Mode', 'borderless' ); ?>:</td> |
| 62 |
<td><?php |
| 63 |
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) |
| 64 |
echo '✔'; |
| 65 |
else |
| 66 |
echo '–'; |
| 67 |
?></td> |
| 68 |
</tr> |
| 69 |
<tr> |
| 70 |
<td><?php _e( 'Language', 'borderless' ); ?>:</td> |
| 71 |
<td><?php echo get_locale() ?></td> |
| 72 |
</tr> |
| 73 |
</tbody> |
| 74 |
</table> |
| 75 |
<br> |
| 76 |
<table class="widefat" cellspacing="0"> |
| 77 |
<thead> |
| 78 |
<tr> |
| 79 |
<th colspan="2" data-export-label="Server Environment"><b><?php _e( 'Server Environment', 'borderless' ); ?></b></th> |
| 80 |
</tr> |
| 81 |
</thead> |
| 82 |
<tbody> |
| 83 |
<tr> |
| 84 |
<td><?php _e( 'Server Info', 'borderless' ); ?>:</td> |
| 85 |
<td><?php echo esc_html( $_SERVER[ 'SERVER_SOFTWARE' ] ); ?></td> |
| 86 |
</tr> |
| 87 |
<tr> |
| 88 |
<td><?php _e( 'PHP Version', 'borderless' ); ?>:</td> |
| 89 |
<td><?php |
| 90 |
// Check if phpversion function exists |
| 91 |
if ( function_exists( 'phpversion' ) ) { |
| 92 |
$php_version = phpversion(); |
| 93 |
|
| 94 |
echo esc_html( $php_version ); |
| 95 |
} else { |
| 96 |
_e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'borderless' ); |
| 97 |
} |
| 98 |
?></td> |
| 99 |
</tr> |
| 100 |
<?php if ( function_exists( 'ini_get' ) ) : ?> |
| 101 |
<tr> |
| 102 |
<td><?php _e( 'PHP Memory Limit', 'borderless' ); ?>:</td> |
| 103 |
<td><?php echo size_format( wp_convert_hr_to_bytes( ini_get( 'memory_limit' ) ) ); ?></td> |
| 104 |
</tr> |
| 105 |
<tr> |
| 106 |
<td><?php _e( 'PHP Post Max Size', 'borderless' ); ?>:</td> |
| 107 |
<td><?php echo size_format( wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ) ); ?></td> |
| 108 |
</tr> |
| 109 |
<tr> |
| 110 |
<td ><?php _e( 'PHP Time Limit', 'borderless' ); ?>:</td> |
| 111 |
<td> |
| 112 |
<?php |
| 113 |
$time_limit = ini_get('max_execution_time'); |
| 114 |
if ( $time_limit < 120 && $time_limit != 0 ) { |
| 115 |
echo '<mark>' . sprintf( __( '%s - We recommend setting max execution time at least 300.</mark> See: <a href="%2$s" target="_blank">Increasing WP Time Limit</a>', 'borderless' ), $time_limit, 'https://visualmodo.com/fix-maximum-upload-php-memory-limit-wordpress/' ); |
| 116 |
} else { |
| 117 |
echo $time_limit; |
| 118 |
} |
| 119 |
?></td> |
| 120 |
</tr> |
| 121 |
<tr> |
| 122 |
<td><?php _e( 'PHP Max Input Vars', 'borderless' ); ?>:</td> |
| 123 |
<td><?php echo ini_get( 'max_input_vars' ); ?></td> |
| 124 |
</tr> |
| 125 |
<tr> |
| 126 |
<td ><?php _e( 'SUHOSIN Installed', 'borderless' ); ?>:</td> |
| 127 |
<td><?php echo extension_loaded( 'suhosin' ) ? '✔' : '–'; ?></td> |
| 128 |
</tr> |
| 129 |
<?php endif; ?> |
| 130 |
<tr> |
| 131 |
<td><?php _e( 'MySQL Version', 'borderless' ); ?>:</td> |
| 132 |
<td> |
| 133 |
<?php |
| 134 |
/** @global wpdb $wpdb */ |
| 135 |
global $wpdb; |
| 136 |
echo $wpdb->db_version(); |
| 137 |
?> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
<tr> |
| 141 |
<td><?php _e( 'Max Upload Size', 'borderless' ); ?>:</td> |
| 142 |
<td><?php echo size_format( wp_max_upload_size() ); ?></td> |
| 143 |
</tr> |
| 144 |
</tbody> |
| 145 |
</table> |
| 146 |
<br> |
| 147 |
<table class="widefat" cellspacing="0"> |
| 148 |
<thead> |
| 149 |
<tr> |
| 150 |
<th colspan="2" data-export-label="PHP Extensions"><b><?php _e( 'PHP Extensions', 'borderless' ); ?></b></th> |
| 151 |
</tr> |
| 152 |
</thead> |
| 153 |
<tbody> |
| 154 |
<tr> |
| 155 |
<td><?php _e( 'cURL', 'borderless' ); ?>:</td> |
| 156 |
<td><?php echo (function_exists('curl_init') ? 'Supported' : 'Not Supported'); ?></td> |
| 157 |
</tr> |
| 158 |
<tr> |
| 159 |
<td><?php _e( 'fsockopen', 'borderless' ); ?>:</td> |
| 160 |
<td><?php echo (function_exists('fsockopen') ? 'Supported' : 'Not Supported'); ?></td> |
| 161 |
</tr> |
| 162 |
<tr> |
| 163 |
<td><?php _e( 'SOAP Client', 'borderless' ); ?>:</td> |
| 164 |
<td><?php echo (class_exists('SoapClient') ? 'Installed' : 'Not Installed'); ?></td> |
| 165 |
</tr> |
| 166 |
<tr> |
| 167 |
<td><?php _e( 'Suhosin', 'borderless' ); ?>:</td> |
| 168 |
<td><?php echo (extension_loaded('suhosin') ? 'Installed' : 'Not Installed'); ?></td> |
| 169 |
</tr> |
| 170 |
</tbody> |
| 171 |
</table> |
| 172 |
<br> |
| 173 |
<table class="widefat" cellspacing="0"> |
| 174 |
<thead> |
| 175 |
<tr> |
| 176 |
<th colspan="2"><b><?php _e( 'Active Plugins', 'borderless' ); ?> (<?php echo count( (array) get_option( 'active_plugins' ) ); ?>)</b></th> |
| 177 |
</tr> |
| 178 |
</thead> |
| 179 |
<tbody> |
| 180 |
<?php |
| 181 |
|
| 182 |
$active_plugins = (array) get_option( 'active_plugins', array() ); |
| 183 |
|
| 184 |
if ( is_multisite() ) { |
| 185 |
$network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); |
| 186 |
$active_plugins = array_merge( $active_plugins, $network_activated_plugins ); |
| 187 |
} |
| 188 |
|
| 189 |
foreach ( $active_plugins as $plugin ) { |
| 190 |
|
| 191 |
$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
| 192 |
$dirname = dirname( $plugin ); |
| 193 |
$version_string = ''; |
| 194 |
$network_string = ''; |
| 195 |
|
| 196 |
if ( ! empty( $plugin_data[ 'Name' ] ) ) { |
| 197 |
|
| 198 |
// link the plugin name to the plugin url if available |
| 199 |
$plugin_name = esc_html( $plugin_data[ 'Name' ] ); |
| 200 |
|
| 201 |
if ( !empty( $plugin_data[ 'PluginURI' ] ) ) { |
| 202 |
$plugin_name = '<a href="' . esc_url( $plugin_data[ 'PluginURI' ] ) . '" title="' . esc_attr__( 'Visit plugin homepage', 'borderless' ) . '" target="_blank">' . $plugin_name . '</a>'; |
| 203 |
} |
| 204 |
?> |
| 205 |
<tr> |
| 206 |
<td><?php echo $plugin_name; ?></td> |
| 207 |
<td><?php echo sprintf( _x( 'by %s', 'by author', 'borderless' ), $plugin_data[ 'Author' ] ) . ' – ' . esc_html( $plugin_data[ 'Version' ] ) . $version_string . $network_string; ?></td> |
| 208 |
</tr> |
| 209 |
<?php |
| 210 |
} |
| 211 |
} |
| 212 |
?> |
| 213 |
</tbody> |
| 214 |
</table> |
| 215 |
</div> |
| 216 |
|
| 217 |
<?php } ?> |