PageRenderTime 35ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/public/wp-content/plugins/better-wp-security/core/content/system.php

https://gitlab.com/kath.de/cibedo_cibedo.de
PHP | 330 lines | 300 code | 29 blank | 1 comment | 57 complexity | 9ae479f658509903b335363010139ef0 MD5 | raw file
  1. <?php
  2. global $wpdb, $itsec_globals;
  3. $config_file = ITSEC_Lib::get_config();
  4. $htaccess = ITSEC_Lib::get_htaccess();
  5. ?>
  6. <ul class="itsec-support">
  7. <li>
  8. <h4><?php _e( 'User Information', 'better-wp-security' ); ?></h4>
  9. <ul>
  10. <li><?php _e( 'Public IP Address', 'better-wp-security' ); ?>: <strong><a target="_blank"
  11. title="<?php _e( 'Get more information on this address', 'better-wp-security' ); ?>"
  12. href="http://whois.domaintools.com/<?php echo ITSEC_Lib::get_ip(); ?>"><?php echo ITSEC_Lib::get_ip(); ?></a></strong>
  13. </li>
  14. <li><?php _e( 'User Agent', 'better-wp-security' ); ?>:
  15. <strong><?php echo filter_var( $_SERVER['HTTP_USER_AGENT'], FILTER_SANITIZE_STRING ); ?></strong></li>
  16. </ul>
  17. </li>
  18. <li>
  19. <h4><?php _e( 'File System Information', 'better-wp-security' ); ?></h4>
  20. <ul>
  21. <li><?php _e( 'Website Root Folder', 'better-wp-security' ); ?>: <strong><?php echo get_site_url(); ?></strong>
  22. </li>
  23. <li><?php _e( 'Document Root Path', 'better-wp-security' ); ?>:
  24. <strong><?php echo filter_var( $_SERVER['DOCUMENT_ROOT'], FILTER_SANITIZE_STRING ); ?></strong></li>
  25. <?php
  26. if ( @is_writable( $htaccess ) ) {
  27. $copen = '<font color="red">';
  28. $cclose = '</font>';
  29. $htaw = __( 'Yes', 'better-wp-security' );
  30. } else {
  31. $copen = '';
  32. $cclose = '';
  33. $htaw = __( 'No.', 'better-wp-security' );
  34. }
  35. ?>
  36. <li><?php _e( '.htaccess File is Writable', 'better-wp-security' ); ?>:
  37. <strong><?php echo $copen . $htaw . $cclose; ?></strong></li>
  38. <?php
  39. if ( @is_writable( $config_file ) ) {
  40. $copen = '<font color="red">';
  41. $cclose = '</font>';
  42. $wconf = __( 'Yes', 'better-wp-security' );
  43. } else {
  44. $copen = '';
  45. $cclose = '';
  46. $wconf = __( 'No.', 'better-wp-security' );
  47. }
  48. ?>
  49. <li><?php _e( 'wp-config.php File is Writable', 'better-wp-security' ); ?>:
  50. <strong><?php echo $copen . $wconf . $cclose; ?></strong></li>
  51. </ul>
  52. </li>
  53. <li>
  54. <h4><?php _e( 'Database Information', 'better-wp-security' ); ?></h4>
  55. <?php
  56. $use_mysqli = $wpdb->use_mysqli;
  57. $mysql_server_version = $wpdb->get_var( "SELECT VERSION() AS version" );
  58. if ( $use_mysqli && is_callable( 'mysqli_get_client_info' ) ) {
  59. $mysql_client_version = mysqli_get_client_info();
  60. } else if ( ! $use_mysqli && is_callable( 'mysql_get_client_info' ) ) {
  61. $mysql_client_version = mysql_get_client_info();
  62. } else {
  63. $mysql_client_version = __( 'Unknown', 'unknown MySQL version', 'better-wp-security' );
  64. }
  65. $sql_mode = $wpdb->get_var( "SHOW VARIABLES LIKE 'sql_mode'", 1 );
  66. if ( empty( $sql_mode ) ) {
  67. $sql_mode = __( 'Not Set', 'better-wp-security' );
  68. }
  69. ?>
  70. <ul>
  71. <li><?php _e( 'MySQL Database Version', 'better-wp-security' ); ?>: <strong><?php echo esc_html( $mysql_server_version ); ?></strong></li>
  72. <li><?php _e( 'MySQL Client Version', 'better-wp-security' ); ?>: <strong><?php echo esc_html( $mysql_client_version ); ?></strong></li>
  73. <li><?php _e( 'Database Host', 'better-wp-security' ); ?>: <strong><?php echo esc_html( DB_HOST ); ?></strong></li>
  74. <li><?php _e( 'Database Name', 'better-wp-security' ); ?>: <strong><?php echo esc_html( DB_NAME ); ?></strong></li>
  75. <li><?php _e( 'Database User', 'better-wp-security' ); ?>: <strong><?php echo esc_html( DB_USER ); ?></strong></li>
  76. <li><?php _e( 'Use MySQLi', 'better-wp-security' ); ?>: <strong><?php echo esc_html( $use_mysqli ? __( 'Yes', 'better-wp-security' ) : __( 'No', 'better-wp-security' ) ); ?></strong></li>
  77. <li><?php _e( 'SQL Mode', 'better-wp-security' ); ?>: <strong><?php echo esc_html( $sql_mode ); ?></strong></li>
  78. </ul>
  79. </li>
  80. <li>
  81. <h4><?php _e( 'Server Information', 'better-wp-security' ); ?></h4>
  82. <?php $server_addr = array_key_exists( 'SERVER_ADDR', $_SERVER ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']; ?>
  83. <ul>
  84. <li><?php _e( 'Server / Website IP Address', 'better-wp-security' ); ?>: <strong><a target="_blank"
  85. title="<?php _e( 'Get more information on this address', 'better-wp-security' ); ?>"
  86. href="http://whois.domaintools.com/<?php echo $server_addr; ?>"><?php echo $server_addr; ?></a></strong>
  87. </li>
  88. <li><?php _e( 'Server Type', 'better-wp-security' ); ?>:
  89. <strong><?php echo filter_var( filter_var( $_SERVER['SERVER_SOFTWARE'], FILTER_SANITIZE_STRING ), FILTER_SANITIZE_STRING ); ?></strong>
  90. </li>
  91. <li><?php _e( 'Operating System', 'better-wp-security' ); ?>: <strong><?php echo PHP_OS; ?></strong></li>
  92. <li><?php _e( 'Browser Compression Supported', 'better-wp-security' ); ?>:
  93. <strong><?php echo filter_var( $_SERVER['HTTP_ACCEPT_ENCODING'], FILTER_SANITIZE_STRING ); ?></strong></li>
  94. <?php
  95. // from backupbuddy
  96. $disabled_functions = @ini_get( 'disable_functions' );
  97. if ( $disabled_functions == '' || $disabled_functions === false ) {
  98. $disabled_functions = '<i>(' . __( 'none', 'better-wp-security' ) . ')</i>';
  99. }
  100. $disabled_functions = str_replace( ', ', ',', $disabled_functions ); // Normalize spaces or lack of spaces between disabled functions.
  101. $disabled_functions_array = explode( ',', $disabled_functions );
  102. $php_uid = __( 'unavailable', 'better-wp-security' );
  103. $php_user = __( 'unavailable', 'better-wp-security' );
  104. if ( is_callable( 'posix_geteuid' ) && ( false === in_array( 'posix_geteuid', $disabled_functions_array ) ) ) {
  105. $php_uid = @posix_geteuid();
  106. if ( is_callable( 'posix_getpwuid' ) && ( false === in_array( 'posix_getpwuid', $disabled_functions_array ) ) ) {
  107. $php_user = @posix_getpwuid( $php_uid );
  108. $php_user = $php_user['name'];
  109. }
  110. }
  111. $php_gid = __( 'undefined', 'better-wp-security' );
  112. if ( is_callable( 'posix_getegid' ) && ( false === in_array( 'posix_getegid', $disabled_functions_array ) ) ) {
  113. $php_gid = @posix_getegid();
  114. }
  115. ?>
  116. <li><?php _e( 'PHP Process User (UID:GID)', 'better-wp-security' ); ?>:
  117. <strong><?php echo $php_user . ' (' . $php_uid . ':' . $php_gid . ')'; ?></strong></li>
  118. </ul>
  119. </li>
  120. <li>
  121. <h4><?php _e( 'PHP Information', 'better-wp-security' ); ?></h4>
  122. <ul>
  123. <li><?php _e( 'PHP Version', 'better-wp-security' ); ?>: <strong><?php echo PHP_VERSION; ?></strong></li>
  124. <li><?php _e( 'PHP Memory Usage', 'better-wp-security' ); ?>:
  125. <strong><?php echo round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MB', 'better-wp-security' ); ?></strong>
  126. </li>
  127. <?php
  128. if ( ini_get( 'memory_limit' ) ) {
  129. $memory_limit = filter_var( ini_get( 'memory_limit' ), FILTER_SANITIZE_STRING );
  130. } else {
  131. $memory_limit = __( 'N/A', 'better-wp-security' );
  132. }
  133. ?>
  134. <li><?php _e( 'PHP Memory Limit', 'better-wp-security' ); ?>: <strong><?php echo $memory_limit; ?></strong></li>
  135. <?php
  136. if ( ini_get( 'upload_max_filesize' ) ) {
  137. $upload_max = filter_var( ini_get( 'upload_max_filesize' ), FILTER_SANITIZE_STRING );
  138. } else {
  139. $upload_max = __( 'N/A', 'better-wp-security' );
  140. }
  141. ?>
  142. <li><?php _e( 'PHP Max Upload Size', 'better-wp-security' ); ?>: <strong><?php echo $upload_max; ?></strong></li>
  143. <?php
  144. if ( ini_get( 'post_max_size' ) ) {
  145. $post_max = filter_var( ini_get( 'post_max_size' ), FILTER_SANITIZE_STRING );
  146. } else {
  147. $post_max = __( 'N/A', 'better-wp-security' );
  148. }
  149. ?>
  150. <li><?php _e( 'PHP Max Post Size', 'better-wp-security' ); ?>: <strong><?php echo $post_max; ?></strong></li>
  151. <?php
  152. if ( ini_get( 'safe_mode' ) ) {
  153. $safe_mode = __( 'On', 'better-wp-security' );
  154. } else {
  155. $safe_mode = __( 'Off', 'better-wp-security' );
  156. }
  157. ?>
  158. <li><?php _e( 'PHP Safe Mode', 'better-wp-security' ); ?>: <strong><?php echo $safe_mode; ?></strong></li>
  159. <?php
  160. if ( ini_get( 'allow_url_fopen' ) ) {
  161. $allow_url_fopen = __( 'On', 'better-wp-security' );
  162. } else {
  163. $allow_url_fopen = __( 'Off', 'better-wp-security' );
  164. }
  165. ?>
  166. <li><?php _e( 'PHP Allow URL fopen', 'better-wp-security' ); ?>: <strong><?php echo $allow_url_fopen; ?></strong>
  167. </li>
  168. <?php
  169. if ( ini_get( 'allow_url_include' ) ) {
  170. $allow_url_include = __( 'On', 'better-wp-security' );
  171. } else {
  172. $allow_url_include = __( 'Off', 'better-wp-security' );
  173. }
  174. ?>
  175. <li><?php _e( 'PHP Allow URL Include' ); ?>: <strong><?php echo $allow_url_include; ?></strong></li>
  176. <?php
  177. if ( ini_get( 'display_errors' ) ) {
  178. $display_errors = __( 'On', 'better-wp-security' );
  179. } else {
  180. $display_errors = __( 'Off', 'better-wp-security' );
  181. }
  182. ?>
  183. <li><?php _e( 'PHP Display Errors', 'better-wp-security' ); ?>: <strong><?php echo $display_errors; ?></strong>
  184. </li>
  185. <?php
  186. if ( ini_get( 'display_startup_errors' ) ) {
  187. $display_startup_errors = __( 'On', 'better-wp-security' );
  188. } else {
  189. $display_startup_errors = __( 'Off', 'better-wp-security' );
  190. }
  191. ?>
  192. <li><?php _e( 'PHP Display Startup Errors', 'better-wp-security' ); ?>:
  193. <strong><?php echo $display_startup_errors; ?></strong></li>
  194. <?php
  195. if ( ini_get( 'expose_php' ) ) {
  196. $expose_php = __( 'On', 'better-wp-security' );
  197. } else {
  198. $expose_php = __( 'Off', 'better-wp-security' );
  199. }
  200. ?>
  201. <li><?php _e( 'PHP Expose PHP', 'better-wp-security' ); ?>: <strong><?php echo $expose_php; ?></strong></li>
  202. <?php
  203. if ( ini_get( 'register_globals' ) ) {
  204. $register_globals = __( 'On', 'better-wp-security' );
  205. } else {
  206. $register_globals = __( 'Off', 'better-wp-security' );
  207. }
  208. ?>
  209. <li><?php _e( 'PHP Register Globals', 'better-wp-security' ); ?>: <strong><?php echo $register_globals; ?></strong></li>
  210. <?php
  211. if ( ini_get( 'max_execution_time' ) ) {
  212. $max_execute = filter_var( ini_get( 'max_execution_time' ) );
  213. } else {
  214. $max_execute = __( 'N/A', 'better-wp-security' );
  215. }
  216. ?>
  217. <li><?php _e( 'PHP Max Script Execution Time' ); ?>:
  218. <strong><?php echo $max_execute; ?> <?php _e( 'Seconds' ); ?></strong></li>
  219. <?php
  220. if ( ini_get( 'magic_quotes_gpc' ) ) {
  221. $magic_quotes_gpc = __( 'On', 'better-wp-security' );
  222. } else {
  223. $magic_quotes_gpc = __( 'Off', 'better-wp-security' );
  224. }
  225. ?>
  226. <li><?php _e( 'PHP Magic Quotes GPC', 'better-wp-security' ); ?>: <strong><?php echo $magic_quotes_gpc; ?></strong></li>
  227. <?php
  228. if ( ini_get( 'open_basedir' ) ) {
  229. $open_basedir = __( 'On', 'better-wp-security' );
  230. } else {
  231. $open_basedir = __( 'Off', 'better-wp-security' );
  232. }
  233. ?>
  234. <li><?php _e( 'PHP open_basedir', 'better-wp-security' ); ?>: <strong><?php echo $open_basedir; ?></strong></li>
  235. <?php
  236. if ( is_callable( 'xml_parser_create' ) ) {
  237. $xml = __( 'Yes', 'better-wp-security' );
  238. } else {
  239. $xml = __( 'No', 'better-wp-security' );
  240. }
  241. ?>
  242. <li><?php _e( 'PHP XML Support', 'better-wp-security' ); ?>: <strong><?php echo $xml; ?></strong></li>
  243. <?php
  244. if ( is_callable( 'iptcparse' ) ) {
  245. $iptc = __( 'Yes', 'better-wp-security' );
  246. } else {
  247. $iptc = __( 'No', 'better-wp-security' );
  248. }
  249. ?>
  250. <li><?php _e( 'PHP IPTC Support', 'better-wp-security' ); ?>: <strong><?php echo $iptc; ?></strong></li>
  251. <?php
  252. if ( is_callable( 'exif_read_data' ) ) {
  253. $exif = __( 'Yes', 'better-wp-security' ) . " ( V" . substr( phpversion( 'exif' ), 0, 4 ) . ")";
  254. } else {
  255. $exif = __( 'No', 'better-wp-security' );
  256. }
  257. ?>
  258. <li><?php _e( 'PHP Exif Support', 'better-wp-security' ); ?>: <strong><?php echo $exif; ?></strong></li>
  259. <?php $disabled_functions = str_replace( ',', ', ', $disabled_functions ); // Normalize spaces or lack of spaces between disabled functions. ?>
  260. <li><?php _e( 'Disabled PHP Functions', 'better-wp-security' ); ?>: <strong><?php echo $disabled_functions; ?></strong></li>
  261. </ul>
  262. </li>
  263. <li>
  264. <h4><?php _e( 'WordPress Configuration', 'better-wp-security' ); ?></h4>
  265. <ul>
  266. <?php
  267. if ( is_multisite() ) {
  268. $multSite = __( 'Multisite is enabled', 'better-wp-security' );
  269. } else {
  270. $multSite = __( 'Multisite is NOT enabled', 'better-wp-security' );
  271. }
  272. ?>
  273. <li><?php _e( ' Multisite', 'better-wp-security' ); ?>: <strong><?php echo $multSite; ?></strong></li>
  274. <?php
  275. if ( get_option( 'permalink_structure' ) != '' ) {
  276. $copen = '';
  277. $cclose = '';
  278. $permalink_structure = __( 'Enabled', 'better-wp-security' );
  279. } else {
  280. $copen = '<font color="red">';
  281. $cclose = '</font>';
  282. $permalink_structure = __( 'WARNING! Permalinks are NOT Enabled. Permalinks MUST be enabled for this plugin to function correctly', 'better-wp-security' );
  283. }
  284. ?>
  285. <li><?php _e( 'WP Permalink Structure', 'better-wp-security' ); ?>:
  286. <strong> <?php echo $copen . $permalink_structure . $cclose; ?></strong></li>
  287. <li><?php _e( 'wp-config.php Location', 'better-wp-security' ); ?>: <strong><?php echo $config_file ?></strong></li>
  288. <?php $active_plugins = implode( ', ', get_option( 'active_plugins' ) ); ?>
  289. <li><?php _e( 'Active Plugins', 'better-wp-security' ); ?>: <strong><?php echo $active_plugins ?></strong></li>
  290. <li><?php _e( 'Content Directory', 'better-wp-security' ); ?>: <strong><?php echo WP_CONTENT_DIR ?></strong></li>
  291. </ul>
  292. </li>
  293. <li>
  294. <h4><?php echo $itsec_globals['plugin_name'] . __( ' variables', 'better-wp-security' ); ?></h4>
  295. <ul>
  296. <li><?php _e( 'Build Version', 'better-wp-security' ); ?>: <strong><?php echo $itsec_globals['plugin_build']; ?></strong><br/>
  297. <em><?php _e( 'Note: this is NOT the same as the version number on the plugin page or WordPress.org page and is instead used for support.', 'better-wp-security' ); ?></em>
  298. </li>
  299. </ul>
  300. </li>
  301. </ul>