PageRenderTime 76ms CodeModel.GetById 37ms RepoModel.GetById 1ms app.codeStats 0ms

/dt-the7/inc/admin/screens/the7-status.php

https://bitbucket.org/tulsagraphics/themes
PHP | 328 lines | 314 code | 12 blank | 2 comment | 26 complexity | 328e38314fdeb06e6062cedda2a0f0bb MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, GPL-2.0
  1. <?php
  2. // Do not allow directly accessing this file.
  3. if ( ! defined( 'ABSPATH' ) ) {
  4. exit;
  5. }
  6. global $wp_filesystem;
  7. ?>
  8. <div class="updated the7-dashboard-notice">
  9. <p><?php _e( 'Please copy and paste this information in your ticket when contacting support:', 'the7mk2' ); ?> </p>
  10. <p class="submit"><a href="#" class="button-primary debug-report"><?php _e( 'Get system report', 'the7mk2' ); ?></a>
  11. </p>
  12. <div id="the7-debug-report">
  13. <textarea readonly="readonly"></textarea>
  14. <p class="copy-error"><?php _e( 'Please press Ctrl/Cmd+C to copy.', 'the7mk2' ); ?></p>
  15. </div>
  16. </div>
  17. <div id="the7-dashboard" class="wrap the7-status">
  18. <h1><?php esc_html_e( 'Service Information', 'the7mk2' ); ?></h1>
  19. <div class="the7-column-container">
  20. <div class="the7-column the7-column-double">
  21. <table class="the7-status-table widefat" cellspacing="0">
  22. <thead>
  23. <tr>
  24. <th colspan="3" data-export-label="WordPress Environment"><?php _e( 'WordPress Environment', 'the7mk2' ); ?></th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <tr>
  29. <td data-export-label="Home URL"><?php _e( 'Home URL:', 'the7mk2' ); ?></td>
  30. <td><?php echo home_url(); ?></td>
  31. </tr>
  32. <tr>
  33. <td data-export-label="Site URL"><?php _e( 'Site URL:', 'the7mk2' ); ?></td>
  34. <td><?php echo site_url(); ?></td>
  35. </tr>
  36. <tr>
  37. <td data-export-label="WP Version"><?php _e( 'WP Version:', 'the7mk2' ); ?></td>
  38. <td><?php bloginfo( 'version' ); ?></td>
  39. </tr>
  40. <tr>
  41. <td data-export-label="WP Multisite"><?php _e( 'WP Multisite:', 'the7mk2' ); ?></td>
  42. <td>
  43. <?php if( is_multisite() ): ?>
  44. <span class="yes">&#10004;</span>
  45. <?php else: ?>
  46. &ndash;
  47. <?php endif ?>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit:', 'the7mk2' ); ?></td>
  52. <td>
  53. <?php echo size_format( presscore_get_wp_memory_limit() ); ?>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td data-export-label="FS Accessible"><?php _e( 'FS Accessible:', 'the7mk2' ); ?></td>
  58. <td>
  59. <?php if ( $wp_filesystem || WP_Filesystem() ) : ?>
  60. <span class="yes">&#10004;</span>
  61. <?php else : ?>
  62. <span class="error">No.</span>
  63. <?php endif; ?>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode:', 'the7mk2' ); ?></td>
  68. <td>
  69. <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?>
  70. <span class="yes">&#10004;</span>
  71. <?php else : ?>
  72. <span class="no">&ndash;</span>
  73. <?php endif; ?>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td data-export-label="Language"><?php _e( 'Language:', 'the7mk2' ); ?></td>
  78. <td><?php echo get_locale() ?></td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. <table class="the7-status-table widefat" cellspacing="0">
  83. <thead>
  84. <tr>
  85. <th colspan="3" data-export-label="Server Environment"><?php _e( 'Server Environment', 'the7mk2' ); ?></th>
  86. </tr>
  87. </thead>
  88. <tbody>
  89. <tr>
  90. <td data-export-label="Server Info"><?php _e( 'Server Info:', 'the7mk2' ); ?></td>
  91. <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
  92. </tr>
  93. <tr>
  94. <td data-export-label="PHP Version"><?php _e( 'PHP Version:', 'the7mk2' ); ?></td>
  95. <td><?php if ( function_exists( 'phpversion' ) ) {
  96. echo esc_html( phpversion() );
  97. } ?></td>
  98. </tr>
  99. <?php if ( function_exists( 'ini_get' ) ) : ?>
  100. <tr>
  101. <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size:', 'the7mk2' ); ?></td>
  102. <td><?php echo size_format( wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ) ); ?></td>
  103. </tr>
  104. <tr>
  105. <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit:', 'the7mk2' ); ?></td>
  106. <td>
  107. <?php
  108. $time_limit = ini_get( 'max_execution_time' );
  109. echo $time_limit;
  110. ?>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars:', 'the7mk2' ); ?></td>
  115. <?php
  116. $registered_navs = get_nav_menu_locations();
  117. $menu_items_count = array( '0' => '0' );
  118. foreach ( $registered_navs as $handle => $registered_nav ) {
  119. $menu = wp_get_nav_menu_object( $registered_nav );
  120. if ( $menu ) {
  121. $menu_items_count[] = $menu->count;
  122. }
  123. }
  124. $max_items = max( $menu_items_count );
  125. $required_input_vars = $max_items * 20;
  126. ?>
  127. <td>
  128. <?php
  129. $max_input_vars = ini_get( 'max_input_vars' );
  130. $required_input_vars = $required_input_vars + ( 500 + 1000 );
  131. echo $max_input_vars;
  132. ?>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed:', 'the7mk2' ); ?></td>
  137. <td><?php echo extension_loaded( 'suhosin' ) ? '&#10004;' : '&ndash;'; ?></td>
  138. </tr>
  139. <?php if ( extension_loaded( 'suhosin' ) ) : ?>
  140. <tr>
  141. <td data-export-label="Suhosin Post Max Vars"><?php _e( 'Suhosin Post Max Vars:', 'the7mk2' ); ?></td>
  142. <?php
  143. $registered_navs = get_nav_menu_locations();
  144. $menu_items_count = array( '0' => '0' );
  145. foreach ( $registered_navs as $handle => $registered_nav ) {
  146. $menu = wp_get_nav_menu_object( $registered_nav );
  147. if ( $menu ) {
  148. $menu_items_count[] = $menu->count;
  149. }
  150. }
  151. $max_items = max( $menu_items_count );
  152. $required_input_vars = $max_items * 20;
  153. ?>
  154. <td>
  155. <?php
  156. $max_input_vars = ini_get( 'suhosin.post.max_vars' );
  157. $required_input_vars = $required_input_vars + ( 500 + 1000 );
  158. echo $max_input_vars;
  159. ?>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td data-export-label="Suhosin Request Max Vars"><?php _e( 'Suhosin Request Max Vars:', 'the7mk2' ); ?></td>
  164. <?php
  165. $registered_navs = get_nav_menu_locations();
  166. $menu_items_count = array( '0' => '0' );
  167. foreach ( $registered_navs as $handle => $registered_nav ) {
  168. $menu = wp_get_nav_menu_object( $registered_nav );
  169. if ( $menu ) {
  170. $menu_items_count[] = $menu->count;
  171. }
  172. }
  173. $max_items = max( $menu_items_count );
  174. $required_input_vars = $max_items * 20;
  175. ?>
  176. <td>
  177. <?php
  178. $max_input_vars = ini_get( 'suhosin.request.max_vars' );
  179. $required_input_vars = $required_input_vars + ( 500 + 1000 );
  180. echo $max_input_vars;
  181. ?>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td data-export-label="Suhosin Post Max Value Length"><?php _e( 'Suhosin Post Max Value Length:', 'the7mk2' ); ?></td>
  186. <td><?php
  187. $suhosin_max_value_length = ini_get( 'suhosin.post.max_value_length' );
  188. $recommended_max_value_length = 2000000;
  189. echo $suhosin_max_value_length;
  190. ?></td>
  191. </tr>
  192. <?php endif; ?>
  193. <?php endif; ?>
  194. <tr>
  195. <td data-export-label="ZipArchive"><?php _e( 'ZipArchive:', 'the7mk2' ); ?></td>
  196. <td><?php echo class_exists( 'ZipArchive' ) ? '<span class="yes">&#10004;</span>' : '<span class="error">No.</span>'; ?></td>
  197. </tr>
  198. <tr>
  199. <td data-export-label="MySQL Version"><?php _e( 'MySQL Version:', 'the7mk2' ); ?></td>
  200. <td>
  201. <?php global $wpdb; ?>
  202. <?php echo $wpdb->db_version(); ?>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td data-export-label="Max Upload Size"><?php _e( 'Max Upload Size:', 'the7mk2' ); ?></td>
  207. <td><?php echo size_format( wp_max_upload_size() ); ?></td>
  208. </tr>
  209. <tr>
  210. <td data-export-label="GD Library"><?php _e( 'GD Library:', 'the7mk2' ); ?></td>
  211. <td>
  212. <?php
  213. $info = esc_attr__( 'Not Installed', 'the7mk2' );
  214. if ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) {
  215. $info = esc_attr__( 'Installed', 'the7mk2' );
  216. $gd_info = gd_info();
  217. if ( isset( $gd_info['GD Version'] ) ) {
  218. $info = $gd_info['GD Version'];
  219. }
  220. }
  221. echo $info;
  222. ?>
  223. </td>
  224. </tr>
  225. <tr>
  226. <td data-export-label="cURL"><?php _e( 'cURL:', 'the7mk2' ); ?></td>
  227. <td>
  228. <?php
  229. $info = esc_attr__( 'Not Enabled', 'the7mk2' );
  230. if ( function_exists( 'curl_version' ) ) {
  231. $curl_info = curl_version();
  232. $info = $curl_info['version'];
  233. }
  234. echo $info;
  235. ?>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. </div>
  241. <div class="the7-column the7-column-double">
  242. <table class="the7-status-table widefat" cellspacing="0">
  243. <thead>
  244. <tr>
  245. <th colspan="3" data-export-label="The7 Information"><?php _e( 'The7 Information', 'the7mk2' ); ?></th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td data-export-label="Current Version"><?php _e( 'Current Version:', 'the7mk2' ); ?></td>
  251. <td><?php echo THE7_VERSION; ?></td>
  252. </tr>
  253. <tr>
  254. <td data-export-label="Installation Path"><?php _e( 'Installation Path:', 'the7mk2' ); ?></td>
  255. <td><code><?php echo get_template_directory(); ?></code></td>
  256. </tr>
  257. <tr>
  258. <td data-export-label="The7 Server Available"><?php _e( 'The7 Server Available:', 'the7mk2' ); ?></td>
  259. <td>
  260. <?php
  261. $the7_server_code = wp_remote_retrieve_response_code( wp_safe_remote_get( 'https://repo.the7.io/theme/info.json', array( 'decompress' => false ) ) );
  262. if ( $the7_server_code >= 200 && $the7_server_code < 300 ) {
  263. echo '<span class="yes">&#10004;</span>';
  264. } else {
  265. printf( __( '<span class="error">No</span> Service is temporary unavailable. Please check back later.
  266. If the issue persists, contact your hosting provider and make sure that %1$s is not blocked.', 'the7mk2' ), 'https://repo.the7.io/' );
  267. }
  268. ?>
  269. </td>
  270. </tr>
  271. <?php if ( class_exists( 'The7_Dev_Beta_Tester' ) && The7_Dev_Beta_Tester::get_status() ): ?>
  272. <tr>
  273. <td data-export-label="The7 BETA tester"><?php _e( 'The7 BETA tester:' ) ?></td>
  274. <td><span class="yes">&#10004;</span></td>
  275. </tr>
  276. <?php endif ?>
  277. </tbody>
  278. </table>
  279. <table class="the7-status-table widefat" cellspacing="0" id="status">
  280. <thead>
  281. <tr>
  282. <th colspan="3" data-export-label="Active Plugins (<?php echo count( (array) get_option( 'active_plugins' ) ); ?>)"><?php _e( 'Active Plugins', 'the7mk2' ); ?> (<?php echo count( (array) get_option( 'active_plugins' ) ); ?>)</th>
  283. </tr>
  284. </thead>
  285. <tbody>
  286. <?php
  287. $active_plugins = (array) get_option( 'active_plugins', array() );
  288. if ( is_multisite() ) {
  289. $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
  290. }
  291. foreach ( $active_plugins as $plugin ) {
  292. $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
  293. if ( empty( $plugin_data['Name'] ) ) {
  294. continue;
  295. }
  296. // Link the plugin name to the plugin url if available.
  297. $plugin_name = esc_html( $plugin_data['Name'] );
  298. if ( ! empty( $plugin_data['PluginURI'] ) ) {
  299. $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . __( 'Visit plugin homepage', 'the7mk2' ) . '">' . $plugin_name . '</a>';
  300. }
  301. ?>
  302. <tr>
  303. <td><?php echo $plugin_name; ?></td>
  304. <td><?php
  305. printf( _x( 'by %s', 'admin status', 'the7mk2' ), $plugin_data['Author'] );
  306. echo ' &ndash; ' . esc_html( $plugin_data['Version'] );
  307. ?></td>
  308. </tr>
  309. <?php
  310. }
  311. ?>
  312. </tbody>
  313. </table>
  314. </div>
  315. </div>
  316. </div>