/wp-content/plugins/better-wp-security/inc/admin/content.php

https://bitbucket.org/adatux_/uakami · PHP · 1139 lines · 920 code · 126 blank · 93 comment · 169 complexity · eeeb2421c75a634ab5174dff85174a64 MD5 · raw file

  1. <?php
  2. if ( ! class_exists( 'bwps_admin_content' ) ) {
  3. class bwps_admin_content extends bwps_admin_common {
  4. function __construct() {
  5. global $bwpsoptions, $bwpstabs;
  6. if ( $bwpsoptions['st_writefiles'] == 0 ) {
  7. $bwpstabs = array(
  8. 'better-wp-security' => 'Dashboard',
  9. 'better-wp-security-adminuser' => 'User',
  10. 'better-wp-security-awaymode' => 'Away',
  11. 'better-wp-security-banusers' => 'Ban',
  12. 'better-wp-security-databasebackup' => 'Backup',
  13. 'better-wp-security-hidebackend' => 'Hide',
  14. 'better-wp-security-intrusiondetection' => 'Detect',
  15. 'better-wp-security-loginlimits' => 'Login',
  16. 'better-wp-security-ssl' => 'SSL',
  17. 'better-wp-security-systemtweaks' => 'Tweaks',
  18. 'better-wp-security-logs' => 'Logs'
  19. );
  20. } else {
  21. $bwpstabs = array(
  22. 'better-wp-security' => 'Dashboard',
  23. 'better-wp-security-adminuser' => 'User',
  24. 'better-wp-security-awaymode' => 'Away',
  25. 'better-wp-security-banusers' => 'Ban',
  26. 'better-wp-security-contentdirectory' => 'Dir',
  27. 'better-wp-security-databasebackup' => 'Backup',
  28. 'better-wp-security-databaseprefix' => 'Prefix',
  29. 'better-wp-security-hidebackend' => 'Hide',
  30. 'better-wp-security-intrusiondetection' => 'Detect',
  31. 'better-wp-security-loginlimits' => 'Login',
  32. 'better-wp-security-ssl' => 'SSL',
  33. 'better-wp-security-systemtweaks' => 'Tweaks',
  34. 'better-wp-security-logs' => 'Logs'
  35. );
  36. }
  37. if ( is_multisite() ) {
  38. add_action( 'network_admin_menu', array( &$this, 'register_settings_page' ) );
  39. } else {
  40. add_action( 'admin_menu', array( &$this, 'register_settings_page' ) );
  41. }
  42. //add settings
  43. add_action( 'admin_init', array( &$this, 'register_settings' ) );
  44. }
  45. /**
  46. * Registers all WordPress admin menu items
  47. *
  48. **/
  49. function register_settings_page() {
  50. global $bwpsoptions, $bwpstabs;
  51. add_menu_page(
  52. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Dashboard', $this->hook ),
  53. __( 'Security', $this->hook ),
  54. $this->accesslvl,
  55. $this->hook,
  56. array( &$this, 'admin_dashboard' ),
  57. BWPS_PU . 'images/shield-small.png'
  58. );
  59. if ( $bwpsoptions['initial_backup'] == 1 && $bwpsoptions['initial_filewrite'] == 1 ) { //they've backed up their database or ignored the warning
  60. add_submenu_page(
  61. $this->hook,
  62. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Change Admin User', $this->hook ),
  63. __( 'Admin User', $this->hook ),
  64. $this->accesslvl,
  65. $this->hook . '-adminuser',
  66. array( &$this, 'admin_adminuser' )
  67. );
  68. add_submenu_page(
  69. $this->hook,
  70. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Away Mode', $this->hook ),
  71. __( 'Away Mode', $this->hook ),
  72. $this->accesslvl,
  73. $this->hook . '-awaymode',
  74. array( &$this, 'admin_awaymode' )
  75. );
  76. add_submenu_page(
  77. $this->hook,
  78. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Ban Users', $this->hook ),
  79. __( 'Ban Users', $this->hook ),
  80. $this->accesslvl,
  81. $this->hook . '-banusers',
  82. array( &$this, 'admin_banusers' )
  83. );
  84. if ( $bwpsoptions['st_writefiles'] == 1 ) {
  85. add_submenu_page(
  86. $this->hook,
  87. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Change Content Directory', $this->hook ),
  88. __( 'Content Directory', $this->hook ),
  89. $this->accesslvl,
  90. $this->hook . '-contentdirectory',
  91. array( &$this, 'admin_contentdirectory' )
  92. );
  93. }
  94. add_submenu_page(
  95. $this->hook,
  96. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Backup WordPress Database', $this->hook ),
  97. __( 'Database Backup', $this->hook ),
  98. $this->accesslvl,
  99. $this->hook . '-databasebackup',
  100. array( &$this, 'admin_databasebackup' )
  101. );
  102. if ( $bwpsoptions['st_writefiles'] == 1 ) {
  103. add_submenu_page(
  104. $this->hook,
  105. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Change Database Prefix', $this->hook ),
  106. __( 'Database Prefix', $this->hook ),
  107. $this->accesslvl,
  108. $this->hook . '-databaseprefix',
  109. array( &$this, 'admin_databaseprefix' )
  110. );
  111. }
  112. add_submenu_page(
  113. $this->hook,
  114. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Hide Backend', $this->hook ),
  115. __( 'Hide Backend', $this->hook ),
  116. $this->accesslvl,
  117. $this->hook . '-hidebackend',
  118. array( &$this, 'admin_hidebackend' )
  119. );
  120. add_submenu_page(
  121. $this->hook,
  122. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Intrusion Detection', $this->hook ),
  123. __( 'Intrusion Detection', $this->hook ),
  124. $this->accesslvl,
  125. $this->hook . '-intrusiondetection',
  126. array( &$this, 'admin_intrusiondetection' )
  127. );
  128. add_submenu_page(
  129. $this->hook,
  130. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Limit Login Attempts', $this->hook ),
  131. __( 'Login Limits', $this->hook ),
  132. $this->accesslvl,
  133. $this->hook . '-loginlimits',
  134. array( &$this, 'admin_loginlimits' )
  135. );
  136. add_submenu_page(
  137. $this->hook,
  138. __( $this->pluginname, $this->hook ) . ' - ' . __( 'Secure Communications With SSL', $this->hook ),
  139. __( 'SSL', $this->hook ),
  140. $this->accesslvl,
  141. $this->hook . '-ssl',
  142. array( &$this, 'admin_ssl' )
  143. );
  144. add_submenu_page(
  145. $this->hook,
  146. __( $this->pluginname, $this->hook ) . ' - ' . __( 'WordPress System Tweaks', $this->hook ),
  147. __( 'System Tweaks', $this->hook ),
  148. $this->accesslvl,
  149. $this->hook . '-systemtweaks',
  150. array( &$this, 'admin_systemtweaks' )
  151. );
  152. add_submenu_page(
  153. $this->hook,
  154. __( $this->pluginname, $this->hook ) . ' - ' . __( 'View Logs', $this->hook ),
  155. __( 'View Logs', $this->hook ),
  156. $this->accesslvl,
  157. $this->hook . '-logs',
  158. array( &$this, 'admin_logs' )
  159. );
  160. //Make the dashboard the first submenu item and the item to appear when clicking the parent.
  161. global $submenu;
  162. if ( isset( $submenu[$this->hook] ) ) {
  163. $submenu[$this->hook][0][0] = __( 'Dashboard', $this->hook );
  164. }
  165. }
  166. }
  167. /**
  168. * Registers content blocks for dashboard page
  169. *
  170. **/
  171. function admin_dashboard() {
  172. global $bwpsoptions, $bwpstabs;
  173. if ( $bwpsoptions['oneclickchosen'] == 1 && $bwpsoptions['initial_backup'] == 1 && $bwpsoptions['initial_filewrite'] == 1 ) { //they've backed up their database or ignored the warning
  174. $this->admin_page(
  175. $this->pluginname . ' - ' . __( 'System Status', $this->hook ),
  176. array(
  177. array( __( 'System Status', $this->hook ), 'dashboard_content_4' ), //Better WP Security System Status
  178. array( __( 'System Information', $this->hook ), 'dashboard_content_7' ), //Generic System Information
  179. array( __( 'Rewrite Rules', $this->hook ), 'dashboard_content_5' ), //Better WP Security Rewrite Rules
  180. array( __( 'Wp-config.php Code', $this->hook ), 'dashboard_content_6' ) //Better WP Security Rewrite Rules
  181. ),
  182. BWPS_PU . 'images/shield-large.png',
  183. $bwpstabs
  184. );
  185. } elseif ( $bwpsoptions['oneclickchosen'] == 0 && $bwpsoptions['initial_backup'] == 1 && $bwpsoptions['initial_filewrite'] == 1 ) { //they've backed up their database or ignored the warning
  186. $this->admin_page(
  187. $this->pluginname . ' - ' . __( 'System Status', $this->hook ),
  188. array(
  189. array( __( 'One-Click Protection', $this->hook ), 'dashboard_content_3' ) //One-click protection
  190. ),
  191. BWPS_PU . 'images/shield-large.png',
  192. $bwpstabs
  193. );
  194. } elseif ( $bwpsoptions['oneclickchosen'] == 0 && $bwpsoptions['initial_backup'] == 1 && $bwpsoptions['initial_filewrite'] == 0 ) {
  195. $this->admin_page(
  196. $this->pluginname . ' - ' . __( 'System Status', $this->hook ),
  197. array(
  198. array( __( 'Important', $this->hook ), 'dashboard_content_2' ), //Ask the user if they want BWPS to automatically write to system files
  199. ),
  200. BWPS_PU . 'images/shield-large.png',
  201. array()
  202. );
  203. } else { //if they haven't backed up their database or ignored the warning
  204. $this->admin_page(
  205. $this->pluginname . ' - ' . __( 'System Status', $this->hook ),
  206. array(
  207. array( __( 'Welcome!', $this->hook ), 'dashboard_content_1' ), //Try to force the user to back up their site before doing anything else
  208. ),
  209. BWPS_PU . 'images/shield-large.png',
  210. array()
  211. );
  212. }
  213. }
  214. /**
  215. * Registers content blocks for change admin user page
  216. *
  217. **/
  218. function admin_adminuser() {
  219. global $bwpstabs;
  220. if ( ! is_multisite() ) {
  221. $this->admin_page(
  222. $this->pluginname . ' - ' . __( 'Change Admin User', $this->hook ),
  223. array(
  224. array( __( 'Before You Begin', $this->hook ), 'adminuser_content_1' ), //information to prevent the user from getting in trouble
  225. array( __( 'Change The Admin User Name', $this->hook ), 'adminuser_content_2' ), //adminuser options
  226. array( __( 'Change The Admin User ID', $this->hook ), 'adminuser_content_3' ) //adminuser options
  227. ),
  228. BWPS_PU . 'images/shield-large.png',
  229. $bwpstabs
  230. );
  231. } else {
  232. $this->admin_page(
  233. $this->pluginname . ' - ' . __( 'Change Admin User', $this->hook ),
  234. array(
  235. array( __( 'Before You Begin', $this->hook ), 'adminuser_content_1' ), //information to prevent the user from getting in trouble
  236. array( __( 'Change The Admin User Name', $this->hook ), 'adminuser_content_2' )
  237. ),
  238. BWPS_PU . 'images/shield-large.png',
  239. $bwpstabs,
  240. $this->hook . '-adminuser'
  241. );
  242. }
  243. }
  244. /**
  245. * Registers content blocks for away mode page
  246. *
  247. **/
  248. function admin_awaymode() {
  249. global $bwpstabs;
  250. $this->admin_page(
  251. $this->pluginname . ' - ' . __( 'Administor Away Mode', $this->hook ),
  252. array(
  253. array( __( 'Before You Begin', $this->hook ), 'awaymode_content_1' ), //information to prevent the user from getting in trouble
  254. array( __( 'Away Mode Options', $this->hook ), 'awaymode_content_2' ), //awaymode options
  255. array( __( 'Away Mode Rules', $this->hook ), 'awaymode_content_3' )
  256. ),
  257. BWPS_PU . 'images/shield-large.png',
  258. $bwpstabs
  259. );
  260. }
  261. /**
  262. * Registers content blocks for ban hosts page
  263. *
  264. **/
  265. function admin_banusers() {
  266. global $bwpstabs;
  267. $this->admin_page(
  268. $this->pluginname . ' - ' . __( 'Ban Users', $this->hook ),
  269. array(
  270. array( __( 'Before You Begin', $this->hook ), 'banusers_content_1' ), //information to prevent the user from getting in trouble
  271. array( __( 'User and Bot Blacklist', $this->hook ), 'banusers_content_2' ), //banusers options
  272. array( __( 'Banned Users Configuration', $this->hook ), 'banusers_content_3' ) //banusers options
  273. ),
  274. BWPS_PU . 'images/shield-large.png'
  275. ,
  276. $bwpstabs
  277. );
  278. }
  279. /**
  280. * Registers content blocks for content directory page
  281. *
  282. **/
  283. function admin_contentdirectory() {
  284. global $bwpstabs;
  285. $this->admin_page(
  286. $this->pluginname . ' - ' . __( 'Change wp-content Directory', $this->hook ),
  287. array(
  288. array( __( 'Before You Begin', $this->hook ), 'contentdirectory_content_1' ), //information to prevent the user from getting in trouble
  289. array( __( 'Change The wp-content Directory', $this->hook ), 'contentdirectory_content_2' ) //contentdirectory options
  290. ),
  291. BWPS_PU . 'images/shield-large.png',
  292. $bwpstabs
  293. );
  294. }
  295. /**
  296. * Registers content blocks for database backup page
  297. *
  298. **/
  299. function admin_databasebackup() {
  300. global $bwpstabs;
  301. $this->admin_page(
  302. $this->pluginname . ' - ' . __( 'Backup WordPress Database', $this->hook ),
  303. array(
  304. array( __( 'Before You Begin', $this->hook ), 'databasebackup_content_1' ), //information to prevent the user from getting in trouble
  305. array( __( 'Backup Your WordPress Database', $this->hook ), 'databasebackup_content_2' ), //backup switch
  306. array( __( 'Schedule Automated Backups', $this->hook ), 'databasebackup_content_3' ), //scheduled backup options
  307. array( __( 'Backup Information', $this->hook ), 'databasebackup_content_4' ) //where to find downloads
  308. ),
  309. BWPS_PU . 'images/shield-large.png',
  310. $bwpstabs
  311. );
  312. }
  313. /**
  314. * Registers content blocks for database prefix page
  315. *
  316. **/
  317. function admin_databaseprefix() {
  318. global $bwpstabs;
  319. $this->admin_page(
  320. $this->pluginname . ' - ' . __( 'Change Database Prefix', $this->hook ),
  321. array(
  322. array( __( 'Before You Begin', $this->hook ), 'databaseprefix_content_1' ), //information to prevent the user from getting in trouble
  323. array( __( 'Change The Database Prefix', $this->hook ), 'databaseprefix_content_2' ) //databaseprefix options
  324. ),
  325. BWPS_PU . 'images/shield-large.png',
  326. $bwpstabs
  327. );
  328. }
  329. /**
  330. * Registers content blocks for hide backend page
  331. *
  332. **/
  333. function admin_hidebackend() {
  334. global $bwpstabs;
  335. $this->admin_page(
  336. $this->pluginname . ' - ' . __( 'Hide WordPress Backend', $this->hook ),
  337. array(
  338. array( __( 'Before You Begin', $this->hook ), 'hidebackend_content_1' ), //information to prevent the user from getting in trouble
  339. array( __( 'Hide Backend Options', $this->hook ), 'hidebackend_content_2' ), //hidebackend options
  340. array( __( 'Secret Key', $this->hook ), 'hidebackend_content_3' ) //hidebackend secret key information
  341. ),
  342. BWPS_PU . 'images/shield-large.png',
  343. $bwpstabs
  344. );
  345. }
  346. /**
  347. * Registers content blocks for intrusion detection page
  348. *
  349. **/
  350. function admin_intrusiondetection() {
  351. global $bwpsoptions, $bwpstabs;
  352. if ( $bwpsoptions['id_fileenabled'] == 1 && defined( 'BWPS_FILECHECK' ) && BWPS_FILECHECK === true ) {
  353. $this->admin_page(
  354. $this->pluginname . ' - ' . __( 'Intrusion Detection', $this->hook ),
  355. array(
  356. array( __( 'Before You Begin', $this->hook ), 'intrusiondetection_content_1' ), //information to prevent the user from getting in trouble
  357. array( __( 'Check For File Changes', $this->hook ), 'intrusiondetection_content_2' ), //Manually check for file changes
  358. array( __( 'Intrusion Detection', $this->hook ), 'intrusiondetection_content_3' ) //intrusiondetection options
  359. ),
  360. BWPS_PU . 'images/shield-large.png',
  361. $bwpstabs
  362. );
  363. } else {
  364. $this->admin_page(
  365. $this->pluginname . ' - ' . __( 'Intrusion Detection', $this->hook ),
  366. array(
  367. array( __( 'Before You Begin', $this->hook ), 'intrusiondetection_content_1' ), //information to prevent the user from getting in trouble
  368. array( __( 'Intrusion Detection', $this->hook ), 'intrusiondetection_content_3' ) //intrusiondetection options
  369. ),
  370. BWPS_PU . 'images/shield-large.png',
  371. $bwpstabs
  372. );
  373. }
  374. }
  375. /**
  376. * Registers content blocks for login limits page
  377. *
  378. **/
  379. function admin_loginlimits() {
  380. global $bwpstabs;
  381. $this->admin_page(
  382. $this->pluginname . ' - ' . __( 'Limit Login Attempts', $this->hook ),
  383. array(
  384. array( __( 'Before You Begin', $this->hook ), 'loginlimits_content_1' ), //information to prevent the user from getting in trouble
  385. array( __( 'Limit Login Attempts', $this->hook ), 'loginlimits_content_2' ) //loginlimit options
  386. ),
  387. BWPS_PU . 'images/shield-large.png',
  388. $bwpstabs
  389. );
  390. }
  391. /**
  392. * Registers content blocks for SSL page
  393. *
  394. **/
  395. function admin_ssl() {
  396. global $bwpstabs;
  397. $this->admin_page(
  398. $this->pluginname . ' - ' . __( 'SSL', $this->hook ),
  399. array(
  400. array( __( 'Before You Begin', $this->hook ), 'ssl_content_1' ), //information to prevent the user from getting in trouble
  401. array( __( 'SSL Options', $this->hook ), 'ssl_content_2' ) //ssl options
  402. ),
  403. BWPS_PU . 'images/shield-large.png',
  404. $bwpstabs
  405. );
  406. }
  407. /**
  408. * Registers content blocks for system tweaks page
  409. *
  410. **/
  411. function admin_systemtweaks() {
  412. global $bwpstabs;
  413. $this->admin_page(
  414. $this->pluginname . ' - ' . __( 'Various Security Tweaks', $this->hook ),
  415. array(
  416. array( __( 'Before You Begin', $this->hook ), 'systemtweaks_content_1' ), //information to prevent the user from getting in trouble
  417. array( __( 'System Tweaks', $this->hook ), 'systemtweaks_content_2' ) //systemtweaks htaccess (or other rewrite) options
  418. ),
  419. BWPS_PU . 'images/shield-large.png',
  420. $bwpstabs
  421. );
  422. }
  423. /**
  424. * Registers content blocks for view logs page
  425. *
  426. **/
  427. function admin_logs() {
  428. global $bwpstabs;
  429. $this->admin_page(
  430. $this->pluginname . ' - ' . __( 'Better WP Security Logs', $this->hook ),
  431. array(
  432. array( __( 'Before You Begin', $this->hook ), 'logs_content_1' ), //information to prevent the user from getting in trouble
  433. array( __( 'Clean Database', $this->hook ), 'logs_content_2' ), //Clean Database
  434. array( __( 'Current Lockouts', $this->hook ), 'logs_content_3' ), //Current Lockouts log
  435. array( __( '404 Errors', $this->hook ), 'logs_content_4' ), //404 Errors
  436. array( __( 'Bad Login Attempts', $this->hook ), 'logs_content_7' ), //404 Errors
  437. array( __( 'All Lockouts', $this->hook ), 'logs_content_5' ), //All Lockouts
  438. array( __( 'Changed Files', $this->hook ), 'logs_content_6' ) //Changed Files
  439. ),
  440. BWPS_PU . 'images/shield-large.png',
  441. $bwpstabs
  442. );
  443. }
  444. /**
  445. * Dashboard intro prior to first backup
  446. *
  447. **/
  448. function dashboard_content_1() {
  449. ?>
  450. <p><?php _e( 'Welcome to Better WP Security!', $this->hook ); ?></p>
  451. <p><?php echo __( 'Before we begin it is extremely important that you make a backup of your database. This will make sure you can get your site back to the way it is right now should something go wrong. Click the button below to make a backup which will be emailed to the website administrator at ', $this->hook ) . '<strong>' . get_option( 'admin_email' ) . '</strong>'; ?></p>
  452. <form method="post" action="">
  453. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  454. <input type="hidden" name="bwps_page" value="dashboard_1" />
  455. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'Create Database Backup', $this->hook ); ?>" /></p>
  456. </form>
  457. <form method="post" action="">
  458. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  459. <input type="hidden" name="bwps_page" value="dashboard_2" />
  460. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'No, thanks. I already have a backup', $this->hook ); ?>" /></p>
  461. </form>
  462. <?php
  463. }
  464. /**
  465. * Ask the user if they want the plugin to automatically write to system files
  466. *
  467. **/
  468. function dashboard_content_2() {
  469. ?>
  470. <p><?php _e( 'Just one more question:', $this->hook ); ?></p>
  471. <p><?php _e( 'Better WP Security can automatically write to WordPress core files for you (wp-config.php and .htaccess). This saves time and prevents you from having to edit code yourself. While this is safe to do in nearly all systems it can, on some server configurations, cause problems. For this reason, before continuing, you have the option to allow this plugin to write to wp-config.php and .htaccess or not.', $this->hook ); ?></p>
  472. <p><?php _e( 'Note, that this option can be changed later in the "System Tweaks" menu of this plugin. In addition, disabling file writes here will prevent this plugin from activation features such as changing the wp-content directory and changing the database prefix.', $this->hook ); ?></p>
  473. <p><?php _e( 'Finally, please remember that in nearly all cases there is no issue with allowing this plugin to edit your files. However if you know your have a unique server setup or simply would rather edit these files yourself I would recommend selecting "Do not allow this plugin to change WordPress core files."', $this->hook ); ?></p>
  474. <form method="post" action="">
  475. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  476. <input type="hidden" name="bwps_page" value="dashboard_3" />
  477. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'Allow this plugin to change WordPress core files', $this->hook ); ?>" /></p>
  478. </form>
  479. <form method="post" action="">
  480. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  481. <input type="hidden" name="bwps_page" value="dashboard_4" />
  482. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'Do not allow this plugin to change WordPress core files.', $this->hook ); ?>" /></p>
  483. </form>
  484. <?php
  485. }
  486. /**
  487. * One-click mode
  488. *
  489. * Information and form to turn on basic security with 1-click
  490. *
  491. **/
  492. function dashboard_content_3() {
  493. ?>
  494. <form method="post" action="">
  495. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  496. <input type="hidden" name="bwps_page" value="dashboard_5" />
  497. <input type="hidden" name="oneclick" value="1" />
  498. <p><?php _e( 'The button below will turn on all the basic features of Better WP Security which will help automatically protect your site from potential attacks. Please note that it will NOT automatically activate any features which may interfere with other plugins, themes, or content on your site. As such, not all the items in the status will turn green by using the "Secure My Site From Basic Attacks" button. The idea is to activate basic features in one-click so you don\'t have to worry about it.', $this->hook ); ?></p>
  499. <p><?php _e( 'Please note this will not make any changes to any files on your site including .htaccess and wp-config.php.', $this->hook ); ?></p>
  500. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'Secure My Site From Basic Attacks', $this->hook ); ?>" /></p>
  501. </form>
  502. <form method="post" action = "">
  503. <?php wp_nonce_field( 'BWPS_admin_save','wp_nonce' ); ?>
  504. <input type="hidden" name="bwps_page" value="dashboard_5" />
  505. <input type="hidden" name="oneclick" value="0" />
  506. <p class="submit"><input type="submit" class="button-primary" value="<?php _e( 'No thanks, I prefer to do configure everything myself.', $this->hook ); ?>" /></p>
  507. </form>
  508. <?php
  509. }
  510. /**
  511. * Better WP Security System Status
  512. *
  513. **/
  514. function dashboard_content_4() {
  515. global $wpdb, $bwpsoptions, $bwpsmemlimit;
  516. ?>
  517. <ol>
  518. <li class="securecheck">
  519. <?php
  520. $isOn = $bwpsoptions['st_enablepassword'];
  521. $role = $bwpsoptions['st_passrole'];
  522. ?>
  523. <?php if ( $isOn == 1 && $role == 'subscriber' ) { ?>
  524. <span style="color: green;"><?php _e( 'You are enforcing strong passwords for all users.', $this-> hook ); ?></span>
  525. <?php } elseif ( $isOn == 1 ) { ?>
  526. <span style="color: orange;"><?php _e( 'You are enforcing strong passwords, but not for all users.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_passrole"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  527. <?php } else { ?>
  528. <span style="color: red;"><?php _e( 'You are not enforcing strong passwords.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_enablepassword"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  529. <?php } ?>
  530. </li>
  531. <li class="securecheck">
  532. <?php $hcount = intval( $bwpsoptions['st_manifest'] ) + intval( $bwpsoptions['st_generator'] ) + intval( $bwpsoptions['st_edituri'] ); ?>
  533. <?php if ( $hcount == 3 ) { ?>
  534. <span style="color: green;"><?php _e( 'Your WordPress header is revealing as little information as possible.', $this-> hook ); ?></span>
  535. <?php } elseif ( $hcount > 0 ) { ?>
  536. <span style="color: blue;"><?php _e( 'Your WordPress header is still revealing some information to users.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_generator"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  537. <?php } else { ?>
  538. <span style="color: red;"><?php _e( 'Your WordPress header is showing too much information to users.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_generator"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  539. <?php } ?>
  540. </li>
  541. <li class="securecheck">
  542. <?php $hcount = intval( $bwpsoptions['st_themenot'] ) + intval( $bwpsoptions['st_pluginnot'] ) + intval( $bwpsoptions['st_corenot'] ); ?>
  543. <?php if ( $hcount == 3 ) { ?>
  544. <span style="color: green;"><?php _e( 'Non-administrators cannot see available updates.', $this-> hook ); ?></span>
  545. <?php } elseif ( $hcount > 0 ) { ?>
  546. <span style="color: orange;"><?php _e( 'Non-administrators can see some updates.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_themenot"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  547. <?php } else { ?>
  548. <span style="color: red;"><?php _e( 'Non-administrators can see all updates.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_themenot"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  549. <?php } ?>
  550. </li>
  551. <li class="securecheck">
  552. <?php if ( $this->user_exists( 'admin' ) ) { ?>
  553. <span style="color: red;"><?php _e( 'The <em>admin</em> user still exists.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-adminuser"><?php _e( 'Click here to rename admin.', $this-> hook ); ?></a></span>
  554. <?php } else { ?>
  555. <span style="color: green;"><?php _e( 'The <em>admin</em> user has been removed.', $this-> hook ); ?></span>
  556. <?php } ?>
  557. </li>
  558. <li class="securecheck">
  559. <?php if ( $this->user_exists( '1' ) ) { ?>
  560. <span style="color: red;"><?php _e( 'A user with id 1 still exists.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-adminuser"><?php _e( 'Click here to change user 1\'s ID.', $this-> hook ); ?></a></span>
  561. <?php } else { ?>
  562. <span style="color: green;"><?php _e( 'The user with id 1 has been removed.', $this-> hook ); ?></span>
  563. <?php } ?>
  564. </li>
  565. <?php if ( $bwpsoptions['st_writefiles'] == 1 ) { ?>
  566. <li class="securecheck">
  567. <?php if ( $wpdb->base_prefix == 'wp_' ) { ?>
  568. <span style="color: red;"><?php _e( 'Your table prefix should not be ', $this->hook ); ?><em>wp_</em>. <a href="admin.php?page=better-wp-security-databaseprefix"><?php _e( 'Click here to rename it.', $this->hook ); ?></a></span>
  569. <?php } else { ?>
  570. <span style="color: green;"><?php echo __( 'Your table prefix is', $this->hook ) . ' ' . $wpdb->base_prefix; ?></span>
  571. <?php } ?>
  572. </li>
  573. <?php } ?>
  574. <li class="securecheck">
  575. <?php if ( $bwpsoptions['backup_enabled'] == 1 ) { ?>
  576. <span style="color: green;"><?php _e( 'You have scheduled regular backups of your WordPress database.', $this->hook ); ?></span>
  577. <?php } else { ?>
  578. <span style="color: blue;"><?php _e( 'You are not scheduling regular backups of your WordPress database.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-databasebackup"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  579. <?php } ?>
  580. </li>
  581. <li class="securecheck">
  582. <?php if ( $bwpsoptions['am_enabled'] == 1 ) { ?>
  583. <span style="color: green;"><?php _e( 'Your WordPress admin area is not available when you will not be needing it.', $this->hook ); ?>. </span>
  584. <?php } else { ?>
  585. <span style="color: orange;"><?php _e( 'Your WordPress admin area is available 24/7. Do you really update 24 hours a day?', $this->hook ); ?> <a href="admin.php?page=better-wp-security-awaymode"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  586. <?php } ?>
  587. </li>
  588. <li class="securecheck">
  589. <?php if ( $bwpsoptions['bu_blacklist'] == 1 ) { ?>
  590. <span style="color: green;"><?php _e( 'You are blocking known bad hosts and agents with HackRepair.com\'s blacklist.', $this->hook ); ?>. </span>
  591. <?php } else { ?>
  592. <span style="color: orange;"><?php _e( 'You are not blocking known bad hosts and agents with HackRepair.com\'s blacklist?', $this->hook ); ?> <a href="admin.php?page=better-wp-security-banusers"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  593. <?php } ?>
  594. </li>
  595. <li class="securecheck">
  596. <?php if ( $bwpsoptions['ll_enabled'] == 1 ) { ?>
  597. <span style="color: green;"><?php _e( 'Your login area is protected from brute force attacks.', $this->hook ); ?></span>
  598. <?php } else { ?>
  599. <span style="color: red;"><?php _e( 'Your login area is not protected from brute force attacks.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-loginlimits"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  600. <?php } ?>
  601. </li>
  602. <li class="securecheck">
  603. <?php if ( $bwpsoptions['hb_enabled'] == 1 ) { ?>
  604. <span style="color: green;"><?php _e( 'Your WordPress admin area is hidden.', $this->hook ); ?></span>
  605. <?php } else { ?>
  606. <span style="color: blue;"><?php _e( 'Your WordPress admin area is not hidden.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-hidebackend"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  607. <?php } ?>
  608. </li>
  609. <li class="securecheck">
  610. <?php $hcount = intval( $bwpsoptions['st_ht_files'] ) + intval( $bwpsoptions['st_ht_browsing'] ) + intval( $bwpsoptions['st_ht_request'] ) + intval( $bwpsoptions['st_ht_query'] ); ?>
  611. <?php if ( $hcount == 4 ) { ?>
  612. <span style="color: green;"><?php _e( 'Your .htaccess file is fully secured.', $this-> hook ); ?></span>
  613. <?php } elseif ( $hcount > 0 ) { ?>
  614. <span style="color: blue;"><?php _e( 'Your .htaccess file is partially secured.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_ht_files"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  615. <?php } else { ?>
  616. <span style="color: blue;"><?php _e( 'Your .htaccess file is NOT secured.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_ht_files"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  617. <?php } ?>
  618. </li>
  619. <li class="securecheck">
  620. <?php if ( $bwpsoptions['id_enabled'] == 1 ) { ?>
  621. <span style="color: green;"><?php _e( 'Your installation is actively blocking attackers trying to scan your site for vulnerabilities.', $this->hook ); ?></span>
  622. <?php } else { ?>
  623. <span style="color: red;"><?php _e( 'Your installation is not actively blocking attackers trying to scan your site for vulnerabilities.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-intrusiondetection"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  624. <?php } ?>
  625. </li>
  626. <li class="securecheck">
  627. <?php if ( $bwpsoptions['id_fileenabled'] == 1 ) { ?>
  628. <span style="color: green;"><?php _e( 'Your installation is actively looking for changed files.', $this->hook ); ?></span>
  629. <?php } else { ?>
  630. <?php
  631. if ( $bwpsmemlimit >= 128 ) {
  632. $idfilecolor = 'red';
  633. } else {
  634. $idfilecolor = 'blue';
  635. }
  636. ?>
  637. <span style="color: <?php echo $idfilecolor; ?>;"><?php _e( 'Your installation is not actively looking for changed files.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-intrusiondetection#id_fileenabled"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  638. <?php } ?>
  639. </li>
  640. <li class="securecheck">
  641. <?php if ( $bwpsoptions['st_longurl'] == 1 ) { ?>
  642. <span style="color: green;"><?php _e( 'Your installation does not accept long URLs.', $this->hook ); ?></span>
  643. <?php } else { ?>
  644. <span style="color: blue;"><?php _e( 'Your installation accepts long (over 255 character) URLS. This can lead to vulnerabilities.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_longurl"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  645. <?php } ?>
  646. </li>
  647. <li class="securecheck">
  648. <?php if ( $bwpsoptions['st_fileedit'] == 1 ) { ?>
  649. <span style="color: green;"><?php _e( 'You are not allowing users to edit theme and plugin files from the WordPress backend.', $this->hook ); ?></span>
  650. <?php } else { ?>
  651. <span style="color: blue;"><?php _e( 'You are allowing users to edit theme and plugin files from the WordPress backend.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_fileedit"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  652. <?php } ?>
  653. </li>
  654. <li class="securecheck">
  655. <?php if ( $bwpsoptions['st_writefiles'] == 1 ) { ?>
  656. <span style="color: green;"><?php _e( 'Better WP Security is allowed to write to wp-config.php and .htaccess.', $this->hook ); ?></span>
  657. <?php } else { ?>
  658. <span style="color: blue;"><?php _e( 'Better WP Security is not allowed to write to wp-config.php and .htaccess.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_writefiles"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  659. <?php } ?>
  660. </li>
  661. <li class="securecheck">
  662. <?php if ( $bwpsoptions['st_fileperm'] == 1 ) { ?>
  663. <span style="color: green;"><?php _e( 'wp-config.php and .htacess are not writeable.', $this->hook ); ?></span>
  664. <?php } else { ?>
  665. <span style="color: blue;"><?php _e( 'wp-config.php and .htacess are writeable.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_fileperm"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  666. <?php } ?>
  667. </li>
  668. <li class="securecheck">
  669. <?php if ( $bwpsoptions['st_randomversion'] == 1 ) { ?>
  670. <span style="color: green;"><?php _e( 'Version information is obscured to all non admin users.', $this->hook ); ?></span>
  671. <?php } else { ?>
  672. <span style="color: blue;"><?php _e( 'Users may still be able to get version information from various plugins and themes.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-systemtweaks#st_randomversion"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  673. <?php } ?>
  674. </li>
  675. <?php if ( $bwpsoptions['st_writefiles'] == 1 ) { ?>
  676. <li class="securecheck">
  677. <?php if ( ! strstr( WP_CONTENT_DIR, 'wp-content' ) || ! strstr( WP_CONTENT_URL, 'wp-content' ) ) { ?>
  678. <span style="color: green;"><?php _e( 'You have renamed the wp-content directory of your site.', $this->hook ); ?></span>
  679. <?php } else { ?>
  680. <span style="color: blue;"><?php _e( 'You should rename the wp-content directory of your site.', $this->hook ); ?> <a href="admin.php?page=better-wp-security-contentdirectory"><?php _e( 'Click here to do so.', $this->hook ); ?></a></span>
  681. <?php } ?>
  682. </li>
  683. <?php } ?>
  684. <li class="securecheck">
  685. <?php if ( FORCE_SSL_LOGIN === true && FORCE_SSL_ADMIN === true ) { ?>
  686. <span style="color: green;"><?php _e( 'You are requiring a secure connection for logins and the admin area.', $this-> hook ); ?></span>
  687. <?php } elseif ( FORCE_SSL_LOGIN === true || FORCE_SSL_ADMIN === true ) { ?>
  688. <span style="color: blue;"><?php _e( 'You are requiring a secure connection for logins or the admin area but not both.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-ssl#ssl_frontend"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  689. <?php } else { ?>
  690. <span style="color: blue;"><?php _e( 'You are not requiring a secure connection for logins or for the admin area.', $this-> hook ); ?> <a href="admin.php?page=better-wp-security-ssl#ssl_frontend"><?php _e( 'Click here to fix.', $this-> hook ); ?></a></span>
  691. <?php } ?>
  692. </li>
  693. <?php if ( $bwpsoptions['st_writefiles'] == 0 ) { ?>
  694. <li class="securecheck">
  695. <span style="color: orange;"><?php _e( 'Notice: Some items are hidden as you are not allowing this plugin to write to core files.', $this->hook ); ?></span> <a href="admin.php?page=better-wp-security-systemtweaks#st_writefiles"><?php _e( 'Click here to fix.', $this->hook ); ?></a></span>
  696. </li>
  697. <?php } ?>
  698. </ol>
  699. <hr />
  700. <ul>
  701. <li><span style="color: green;"><?php _e( 'Items in green are fully secured. Good Job!', $this->hook ); ?></span></li>
  702. <li><span style="color: orange;"><?php _e( 'Items in orange are partially secured. Turn on more options to fully secure these areas.', $this->hook ); ?></span></li>
  703. <li><span style="color: red;"><?php _e( 'Items in red are not secured. You should secure these items immediately', $this->hook ); ?></span></li>
  704. <li><span style="color: blue;"><?php _e( 'Items in blue are not fully secured but may conflict with other themes, plugins, or the other operation of your site. Secure them if you can but if you cannot do not worry about them.', $this->hook ); ?></span></li>
  705. </ul>
  706. <?php
  707. }
  708. /**
  709. * Rewrite rules
  710. *
  711. * Rewrite rules generated by better wp security
  712. *
  713. **/
  714. function dashboard_content_5() {
  715. $rules = $this->getrules();
  716. if ( $rules == '') {
  717. ?>
  718. <p><?php _e( 'No rules have been generated. Turn on more features to see rewrite rules.', $this->hook ); ?></p>
  719. <?php
  720. } else {
  721. ?>
  722. <style type="text/css">
  723. code {
  724. overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
  725. overflow-y: hidden;
  726. background-color: transparent;
  727. white-space: pre-wrap; /* css-3 */
  728. white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
  729. white-space: -pre-wrap; /* Opera 4-6 */
  730. white-space: -o-pre-wrap; /* Opera 7 */
  731. /* width: 99%; */
  732. word-wrap: break-word; /* Internet Explorer 5.5+ */
  733. }
  734. </style>
  735. <?php echo highlight_string( $rules, true ); ?>
  736. <?php
  737. }
  738. }
  739. /**
  740. * wp-content.php Rules
  741. *
  742. * wp-content.php generated by better wp security
  743. *
  744. **/
  745. function dashboard_content_6() {
  746. $rules = $this->getwpcontent();
  747. if ( $rules == '') {
  748. ?>
  749. <p><?php _e( 'No rules have been generated. Turn on more features to see wp-content rules.', $this->hook ); ?></p>
  750. <?php
  751. } else {
  752. ?>
  753. <textarea style="width: 100%; height: 300px;"><?php echo $rules; ?></textarea>
  754. <?php
  755. }
  756. }
  757. /**
  758. * General System Information
  759. *
  760. **/
  761. function dashboard_content_7() {
  762. global $wpdb, $bwpsoptions, $bwpsdata;
  763. ?>
  764. <ul>
  765. <li>
  766. <h4><?php _e( 'User Information', $this->hook ); ?></h4>
  767. <ul>
  768. <li><?php _e( 'Public IP Address', $this->hook ); ?>: <strong><a target="_blank" title="<?php _e( 'Get more information on this address', $this->hook ); ?>" href="http://whois.domaintools.com/<?php echo $_SERVER['REMOTE_ADDR']; ?>"><?php echo $_SERVER['REMOTE_ADDR']; ?></a></strong></li>
  769. <li><?php _e( 'User Agent', $this->hook ); ?>: <strong><?php echo filter_var( $_SERVER['HTTP_USER_AGENT'], FILTER_SANITIZE_STRING ); ?></strong></li>
  770. </ul>
  771. </li>
  772. <li>
  773. <h4><?php _e( 'File System Information', $this->hook ); ?></h4>
  774. <ul>
  775. <li><?php _e( 'Website Root Folder', $this->hook ); ?>: <strong><?php echo get_site_url(); ?></strong></li>
  776. <li><?php _e( 'Document Root Path', $this->hook ); ?>: <strong><?php echo filter_var( $_SERVER['DOCUMENT_ROOT'], FILTER_SANITIZE_STRING ); ?></strong></li>
  777. <?php
  778. $htaccess = ABSPATH . '.htaccess';
  779. if ( $f = @fopen( $htaccess, 'a' ) ) {
  780. @fclose( $f );
  781. $copen = '<font color="red">';
  782. $cclose = '</font>';
  783. $htaw = __( 'Yes', $this->hook );
  784. } else {
  785. $copen = '';
  786. $cclose = '';
  787. $htaw = __( 'No.', $this->hook );
  788. }
  789. if ( $bwpsoptions['st_fileperm'] == 1 ) {
  790. @chmod( $htaccess, 0444 ); //make sure the config file is no longer writable
  791. }
  792. ?>
  793. <li><?php _e( '.htaccess File is Writable', $this->hook ); ?>: <strong><?php echo $copen . $htaw . $cclose; ?></strong></li>
  794. <?php
  795. $conffile = $this->getConfig();
  796. if ( $f = @fopen( $conffile, 'a' ) ) {
  797. @fclose( $f );
  798. $copen = '<font color="red">';
  799. $cclose = '</font>';
  800. $wconf = __( 'Yes', $this->hook );
  801. } else {
  802. $copen = '';
  803. $cclose = '';
  804. $wconf = __( 'No.', $this->hook );
  805. }
  806. if ( $bwpsoptions['st_fileperm'] == 1 ) {
  807. @chmod( $conffile, 0444 ); //make sure the config file is no longer writable
  808. }
  809. ?>
  810. <li><?php _e( 'wp-config.php File is Writable', $this->hook ); ?>: <strong><?php echo $copen . $wconf . $cclose; ?></strong></li>
  811. </ul>
  812. </li>
  813. <li>
  814. <h4><?php _e( 'Database Information', $this->hook ); ?></h4>
  815. <ul>
  816. <li><?php _e( 'MySQL Database Version', $this->hook ); ?>: <?php $sqlversion = $wpdb->get_var( "SELECT VERSION() AS version" ); ?><strong><?php echo $sqlversion; ?></strong></li>
  817. <li><?php _e( 'MySQL Client Version', $this->hook ); ?>: <strong><?php echo mysql_get_client_info(); ?></strong></li>
  818. <li><?php _e( 'Database Host', $this->hook ); ?>: <strong><?php echo DB_HOST; ?></strong></li>
  819. <li><?php _e( 'Database Name', $this->hook ); ?>: <strong><?php echo DB_NAME; ?></strong></li>
  820. <li><?php _e( 'Database User', $this->hook ); ?>: <strong><?php echo DB_USER; ?></strong></li>
  821. <?php $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
  822. if ( is_array( $mysqlinfo ) ) $sql_mode = $mysqlinfo[0]->Value;
  823. if ( empty( $sql_mode ) ) $sql_mode = __( 'Not Set', $this->hook );
  824. else $sql_mode = __( 'Off', $this->hook );
  825. ?>
  826. <li><?php _e( 'SQL Mode', $this->hook ); ?>: <strong><?php echo $sql_mode; ?></strong></li>
  827. </ul>
  828. </li>
  829. <li>
  830. <h4><?php _e( 'Server Information', $this->hook ); ?></h4>
  831. <ul>
  832. <li><?php _e( 'Server / Website IP Address', $this->hook ); ?>: <strong><a target="_blank" title="<?php _e( 'Get more information on this address', $this->hook ); ?>" href="http://whois.domaintools.com/<?php echo $_SERVER['SERVER_ADDR']; ?>"><?php echo $_SERVER['SERVER_ADDR']; ?></a></strong></li>
  833. <li><?php _e( 'Server Type', $this->hook ); ?>: <strong><?php echo filter_var( filter_var( $_SERVER['SERVER_SOFTWARE'], FILTER_SANITIZE_STRING ), FILTER_SANITIZE_STRING ); ?></strong></li>
  834. <li><?php _e( 'Operating System', $this->hook ); ?>: <strong><?php echo PHP_OS; ?></strong></li>
  835. <li><?php _e( 'Browser Compression Supported', $this->hook ); ?>: <strong><?php echo filter_var( $_SERVER['HTTP_ACCEPT_ENCODING'], FILTER_SANITIZE_STRING ); ?></strong></li>
  836. </ul>
  837. </li>
  838. <li>
  839. <h4><?php _e( 'PHP Information', $this->hook ); ?></h4>
  840. <ul>
  841. <li><?php _e( 'PHP Version', $this->hook ); ?>: <strong><?php echo PHP_VERSION; ?></strong></li>
  842. <li><?php _e( 'PHP Memory Usage', $this->hook ); ?>: <strong><?php echo round(memory_get_usage() / 1024 / 1024, 2) . __( ' MB', $this->hook ); ?></strong> </li>
  843. <?php
  844. if ( ini_get( 'memory_limit' ) ) {
  845. $memory_limit = filter_var( ini_get( 'memory_limit' ), FILTER_SANITIZE_STRING );
  846. } else {
  847. $memory_limit = __( 'N/A', $this->hook );
  848. }
  849. ?>
  850. <li><?php _e( 'PHP Memory Limit', $this->hook ); ?>: <strong><?php echo $memory_limit; ?></strong></li>
  851. <?php
  852. if ( ini_get( 'upload_max_filesize' ) ) {
  853. $upload_max = filter_var( ini_get( 'upload_max_filesize' ), FILTER_SANITIZE_STRING );
  854. } else {
  855. $upload_max = __( 'N/A', $this->hook );
  856. }
  857. ?>
  858. <li><?php _e( 'PHP Max Upload Size', $this->hook ); ?>: <strong><?php echo $upload_max; ?></strong></li>
  859. <?php
  860. if ( ini_get( 'post_max_size' ) ) {
  861. $post_max = filter_var( ini_get( 'post_max_size' ), FILTER_SANITIZE_STRING );
  862. } else {
  863. $post_max = __( 'N/A', $this->hook );
  864. }
  865. ?>
  866. <li><?php _e( 'PHP Max Post Size', $this->hook ); ?>: <strong><?php echo $post_max; ?></strong></li>
  867. <?php
  868. if ( ini_get( 'safe_mode' ) ) {
  869. $safe_mode = __( 'On', $this->hook );
  870. } else {
  871. $safe_mode = __( 'Off', $this->hook );
  872. }
  873. ?>
  874. <li><?php _e( 'PHP Safe Mode', $this->hook ); ?>: <strong><?php echo $safe_mode; ?></strong></li>
  875. <?php
  876. if ( ini_get( 'allow_url_fopen' ) ) {
  877. $allow_url_fopen = __( 'On', $this->hook );
  878. } else {
  879. $allow_url_fopen = __( 'Off', $this->hook );
  880. }
  881. ?>
  882. <li><?php _e( 'PHP Allow URL fopen', $this->hook ); ?>: <strong><?php echo $allow_url_fopen; ?></strong></li>
  883. <?php
  884. if ( ini_get( 'allow_url_include' ) ) {
  885. $allow_url_include = __( 'On', $this->hook );
  886. } else {
  887. $allow_url_include = __( 'Off', $this->hook );
  888. }
  889. ?>
  890. <li><?php _e( 'PHP Allow URL Include' ); ?>: <strong><?php echo $allow_url_include; ?></strong></li>
  891. <?php
  892. if ( ini_get( 'display_errors' ) ) {
  893. $display_errors = __( 'On', $this->hook );
  894. } else {
  895. $display_errors = __( 'Off', $this->hook );
  896. }
  897. ?>
  898. <li><?php _e( 'PHP Display Errors', $this->hook ); ?>: <strong><?php echo $display_errors; ?></strong></li>
  899. <?php
  900. if ( ini_get( 'display_startup_errors' ) ) {
  901. $display_startup_errors = __( 'On', $this->hook );
  902. } else {
  903. $display_startup_errors = __( 'Off', $this->hook );
  904. }
  905. ?>
  906. <li><?php _e( 'PHP Display Startup Errors', $this->hook ); ?>: <strong><?php echo $display_startup_errors; ?></strong></li>
  907. <?php
  908. if ( ini_get( 'expose_php' ) ) {
  909. $expose_php = __( 'On', $this->hook );
  910. } else {
  911. $expose_php = __( 'Off', $this->hook );
  912. }
  913. ?>
  914. <li><?php _e( 'PHP Expose PHP', $this->hook ); ?>: <strong><?php echo $expose_php; ?></strong></li>
  915. <?php
  916. if ( ini_get( 'register_globals' ) ) {
  917. $register_globals = __( 'On', $this->hook );
  918. } else {
  919. $register_globals = __( 'Off', $this->hook );
  920. }
  921. ?>
  922. <li><?php _e( 'PHP Register Globals', $this->hook ); ?>: <strong><?php echo $register_globals; ?></strong></li>
  923. <?php
  924. if ( ini_get( 'max_execution_time' ) ) {
  925. $max_execute = ini_get( 'max_execution_time' );
  926. } else {
  927. $max_execute = __( 'N/A', $this->hook );
  928. }
  929. ?>
  930. <li><?php _e( 'PHP Max Script Execution Time' ); ?>: <strong><?php echo $max_execute; ?> <?php _e( 'Seconds' ); ?></strong></li>
  931. <?php
  932. if ( ini_get( 'magic_quotes_gpc' ) ) {
  933. $magic_quotes_gpc = __( 'On', $this->hook );
  934. } else {
  935. $magic_quotes_gpc = __( 'Off', $this->hook );
  936. }
  937. ?>
  938. <li><?php _e( 'PHP Magic Quotes GPC', $this->hook ); ?>: <strong><?php echo $magic_quotes_gpc; ?></strong></li>
  939. <?php
  940. if ( ini_get( 'open_basedir' ) ) {
  941. $open_basedir = __( 'On', $this->hook );
  942. } else {
  943. $open_basedir = __( 'Off', $this->hook );
  944. }
  945. ?>
  946. <li><?php _e( 'PHP open_basedir', $this->hook ); ?>: <strong><?php echo $open_basedir; ?></strong></li>
  947. <?php
  948. if ( is_callable( 'xml_parser_create' ) ) {
  949. $xml = __( 'Yes', $this->hook );
  950. } else {
  951. $xml = __( 'No', $this->hook );
  952. }
  953. ?>
  954. <li><?php _e( 'PHP XML Support', $this->hook ); ?>: <strong><?php echo $xml; ?></strong></li>
  955. <?php
  956. if ( is_callable( 'iptcparse' ) ) {
  957. $iptc = __( 'Yes', $this->hook );
  958. } else {
  959. $iptc = __( 'No', $this->hook );
  960. }
  961. ?>
  962. <li><?php _e( 'PHP IPTC Support', $this->hook ); ?>: <strong><?php echo $iptc; ?></strong></li>
  963. <?php
  964. if ( is_callable( 'exif_read_data' ) ) {
  965. $exif = __( 'Yes', $this->hook ). " ( V" . substr(phpversion( 'exif' ),0,4) . ")" ;
  966. } else {
  967. $exif = __( 'No', $this->hook );
  968. }
  969. ?>
  970. <li><?php _e( 'PHP Exif Support', $this->hook ); ?>: <strong><?php echo $exif; ?></strong></li>
  971. </ul>
  972. </li>
  973. <li>
  974. <h4><?php _e( 'WordPress Configuration', $this->hook ); ?></h4>
  975. <ul>
  976. <?php
  977. if ( is_multisite() ) {
  978. $multSite = __( 'Multisite is enabled', $this->hook );
  979. } else {
  980. $multSite = __( 'Multisite is NOT enabled', $this->hook );
  981. }
  982. ?>
  983. <li><?php _e( ' Multisite', $this->hook );?>: <strong><?php echo $multSite; ?></strong></li>
  984. <?php
  985. if ( get_option( 'permalink_structure' ) != '' ) {
  986. $copen = '';
  987. $cclose = '';
  988. $permalink_structure = __( 'Enabled', $this->hook );
  989. } else {
  990. $copen = '<font color="red">';
  991. $cclose = '</font>';
  992. $permalink_structure = __( 'WARNING! Permalinks are NOT Enabled. Permalinks MUST be enabled for Better WP Security to function correctly', $this->hook );
  993. }
  994. ?>
  995. <li><?php _e( 'WP Permalink Structure', $this->hook ); ?>: <strong> <?php echo $copen . $permalink_structure . $cclose; ?></strong></li>
  996. <li><?php _e( 'Wp-config Location', $this->hook );?>: <strong><?php echo $this->getConfig(); ?></strong></li>
  997. </ul>
  998. </li>
  999. <li>
  1000. <h4><?php _e( 'Better WP Security variables', $this->hook ); ?></h4>
  1001. <ul>
  1002. <?php
  1003. if ( $bwpsoptions['hb_key'] == '' ) {
  1004. $hbkey = __( 'Not Yet Available. Enable Hide Backend mode to generate key.', $this->hook );
  1005. } else {
  1006. $hbkey = $bwpsoptions['hb_key'];
  1007. }
  1008. ?>
  1009. <li><?php _e( 'Hide Backend Key', $this->hook );?>: <strong><?php echo $hbkey; ?></strong></li>
  1010. <li><?php _e( 'Better WP Build Version', $this->hook );?>: <strong><?php echo $bwpsdata['version']; ?></strong><br />
  1011. <em><?php _e( 'Note: this is NOT the same as the version number on the plugins page and is instead used for support.', $this->hook ); ?></em></li>
  1012. </ul>
  1013. </l