PageRenderTime 40ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/wp-content/plugins/bulletproof-security/admin/options.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 2318 lines | 2024 code | 150 blank | 144 comment | 274 complexity | a2bd079aa25cc7afa3ded71f8a352628 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. // Direct calls to this file are Forbidden when core files are not present
  3. if ( !function_exists('add_action') ){
  4. header('Status: 403 Forbidden');
  5. header('HTTP/1.1 403 Forbidden');
  6. exit();
  7. }
  8. if ( !current_user_can('manage_options') ){
  9. header('Status: 403 Forbidden');
  10. header('HTTP/1.1 403 Forbidden');
  11. exit();
  12. }
  13. ?>
  14. <div id="message" class="updated" style="border:1px solid #999999; margin-left:70px; margin-top:9px;">
  15. <?php
  16. // HUD - Heads Up Display - Warnings and Error messages
  17. echo bps_check_php_version_error();
  18. echo bps_check_permalinks_error();
  19. echo bps_check_iis_supports_permalinks();
  20. echo bps_hud_check_bpsbackup();
  21. echo bps_check_safemode();
  22. echo @bps_w3tc_htaccess_check($plugin_var);
  23. echo @bps_wpsc_htaccess_check($plugin_var);
  24. // Form - copy and rename htaccess file to root folder
  25. // BulletProof Security and Default Mode
  26. $bpsecureroot = 'unchecked';
  27. $bpdefaultroot = 'unchecked';
  28. if (isset($_POST['submit12']) && current_user_can('manage_options')) {
  29. check_admin_referer( 'bulletproof_security_root_copy' );
  30. $old = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/default.htaccess';
  31. $new = ABSPATH . '/.htaccess';
  32. $old1 = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/secure.htaccess';
  33. $new1 = ABSPATH . '/.htaccess';
  34. $selected_radio = $_POST['selection12'];
  35. if ($selected_radio == 'bpsecureroot') {
  36. $bpsecureroot = 'checked';
  37. @copy($old1, $new1);
  38. chmod($new1, 0644);
  39. if (!copy($old1, $new1)) {
  40. _e('<font color="red"><strong>Failed to Activate BulletProof Security Root Folder Protection! Your Website is NOT protected with BulletProof Security!</strong></font><br>');
  41. } else {
  42. _e('<font color="green"><strong>BulletProof Security Root Folder Protection Activated. Your website Root folder is now protected with BulletProof Security.</strong></font><br><font color="red"><strong>IMPORTANT!</strong></font><strong> BulletProof Mode for the wp-admin folder MUST also be activated when you have BulletProof Mode activated for the Root folder.</strong><br>');
  43. }
  44. }
  45. elseif ($selected_radio == 'bpdefaultroot') {
  46. $bpdefaultroot = 'checked';
  47. copy($old, $new);
  48. chmod($new, 0644);
  49. if (!copy($old, $new)) {
  50. _e('<font color="red"><strong>Failed to Activate Default .htaccess Mode!</strong></font><br>');
  51. } else {
  52. _e('<font color="red"><strong>Warning: Default .htaccess Mode Is Activated In Your Website Root Folder. Your Website Is Not Protected With BulletProof Security.</strong></font>');
  53. }
  54. }
  55. }
  56. // Form - copy and rename htaccess file to wp-admin folder
  57. // BulletProof Security wp-admin
  58. $bpsecurewpadmin = 'unchecked';
  59. $Removebpsecurewpadmin = 'unchecked';
  60. if (isset($_POST['submit13']) && current_user_can('manage_options')) {
  61. check_admin_referer( 'bulletproof_security_wpadmin_copy' );
  62. $oldadmin1 = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/wpadmin-secure.htaccess';
  63. $newadmin1 = ABSPATH . 'wp-admin/.htaccess';
  64. $deleteWpadminHtaccess = ABSPATH . 'wp-admin/.htaccess';
  65. $selected_radio = $_POST['selection13'];
  66. if ($selected_radio == 'bpsecurewpadmin') {
  67. $bpsecurewpadmin = 'checked';
  68. copy($oldadmin1, $newadmin1);
  69. chmod($newadmin1, 0644);
  70. if (!copy($oldadmin1, $newadmin1)) {
  71. _e('<font color="red"><strong>Failed to Activate BulletProof Security wp-admin Folder Protection! Your wp-admin folder is NOT protected with BulletProof Security!</strong></font><br>');
  72. } else {
  73. _e('<font color="green"><strong>BulletProof Security wp-admin Folder Protection Activated. Your wp-admin folder is now protected with BulletProof Security.</strong></font>');
  74. }
  75. }
  76. elseif ($selected_radio == 'Removebpsecurewpadmin') {
  77. $Removebpsecurewpadmin = 'checked';
  78. $fh = fopen($deleteWpadminHtaccess, 'a');
  79. fwrite($fh, 'delete');
  80. fclose($fh);
  81. unlink($deleteWpadminHtaccess);
  82. if (file_exists($deleteWpadminHtaccess)) {
  83. _e('<font color="red"><strong>Failed to Delete the wp-admin .htaccess file! The file does not exist. It may have been deleted or renamed already.</strong></font><br>');
  84. } else {
  85. _e('<font color="green"><strong>The wp-admin .htaccess file has been Deleted. </strong></font><font color="red"><strong>Your wp-admin folder is no longer .htaccess protected.</strong></font> If you are testing then be sure to reactivate BulletProof Mode for your wp-admin folder when you are done testing. If you are removing BPS from your website then be sure to also Activate Default Mode for your Root folder. The Root and wp-admin BulletProof Modes must be activated together or removed togeher.</strong></font><br>');
  86. }
  87. }
  88. }
  89. // Form rename Deny All htaccess file to .htaccess for the BPS Master htaccess folder
  90. $bps_rename_htaccess_files = 'unchecked';
  91. if (isset($_POST['submit8']) && current_user_can('manage_options')) {
  92. check_admin_referer( 'bulletproof_security_denyall_master' );
  93. $bps_rename_htaccess = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/deny-all.htaccess';
  94. $bps_rename_htaccess_renamed = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/.htaccess';
  95. $selected_radio = $_POST['selection8'];
  96. if ($selected_radio == 'bps_rename_htaccess_files') {
  97. $bps_rename_htaccess_files = 'checked';
  98. copy($bps_rename_htaccess, $bps_rename_htaccess_renamed);
  99. if (!copy($bps_rename_htaccess, $bps_rename_htaccess_renamed)) {
  100. _e('<font color="red"><strong>Failed to Activate BulletProof Security Deny All Folder Protection! Your BPS Master htaccess folder is NOT Protected with Deny All htaccess folder protection!</strong></font><br>');
  101. } else {
  102. _e('BulletProof Security Deny All Folder Protection <font color="green"><strong>Activated.</strong></font> Your BPS Master htaccess folder is Now Protected with Deny All htaccess folder protection.');
  103. }
  104. }
  105. }
  106. // Form copy and rename the Deny All htaccess file to the BPS backup folder
  107. // /wp-content/bps-backup
  108. $bps_rename_htaccess_files_backup = 'unchecked';
  109. if (isset($_POST['submit14']) && current_user_can('manage_options')) {
  110. check_admin_referer( 'bulletproof_security_denyall_bpsbackup' );
  111. $bps_rename_htaccess_backup = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/deny-all.htaccess';
  112. $bps_rename_htaccess_backup_online = ABSPATH . '/wp-content/bps-backup/.htaccess';
  113. $selected_radio = $_POST['selection14'];
  114. if ($selected_radio == 'bps_rename_htaccess_files_backup') {
  115. $bps_rename_htaccess_files_backup = 'checked';
  116. copy($bps_rename_htaccess_backup, $bps_rename_htaccess_backup_online);
  117. if (!copy($bps_rename_htaccess_backup, $bps_rename_htaccess_backup_online)) {
  118. _e('<font color="red"><strong>Failed to Activate BulletProof Security Deny All Folder Protection! Your BPS /wp-content/bps-backup folder is NOT Protected with Deny All htaccess folder protection!</strong></font><br>');
  119. } else {
  120. _e('BulletProof Security Deny All Folder Protection <font color="green"><strong>Activated.</strong></font> Your BPS /wp-content/bps-backup folder is Now Protected with Deny All htaccess folder protection.');
  121. }
  122. }
  123. }
  124. // Form - Backup and rename existing and / or currently active htaccess files from
  125. // the root and wpadmin folders to /wp-content/bps-backup
  126. $backup_htaccess = 'unchecked';
  127. if (isset($_POST['submit9']) && current_user_can('manage_options')) {
  128. check_admin_referer( 'bulletproof_security_backup_active_htaccess_files' );
  129. $old_backroot = ABSPATH . '/.htaccess';
  130. $new_backroot = ABSPATH . '/wp-content/bps-backup/root.htaccess';
  131. $old_backwpadmin = ABSPATH . '/wp-admin/.htaccess';
  132. $new_backwpadmin = ABSPATH . '/wp-content/bps-backup/wpadmin.htaccess';
  133. $selected_radio = $_POST['selection9'];
  134. if ($selected_radio == 'backup_htaccess') {
  135. $backup_htaccess = 'checked';
  136. if ( !file_exists($old_backroot)) {
  137. _e('<font color="red"><strong>You do not currently have an .htaccess file in your Root folder to backup.</strong></font><br>');
  138. } else {
  139. if (file_exists($old_backroot)) {
  140. copy($old_backroot, $new_backroot);
  141. if (!copy($old_backroot, $new_backroot)) {
  142. _e('<font color="red"><strong>Failed to Backup Your Root .htaccess File! File copy function failed. Check the folder permissions for the /wp-content/bps-backup folder. Folder permissions should be set to 755.</strong></font><br><br>');
  143. } else {
  144. _e('<font color="green"><strong>Your currently active Root .htaccess file has been backed up successfully!</strong></font><br>Use the Restore feature to restore your .htaccess files if you run into a problem at any time. If you make additional changes or install a plugin that writes to the htaccess files then back them up again. This will overwrite the currently backed up htaccess files. Please read the <font color="red"><strong>CAUTION:</strong></font> Read Me ToolTip on the Backup & Restore Page for more detailed information.<br><br>');
  145. if ( !file_exists($old_backwpadmin)) {
  146. _e('<font color="red"><strong>You do not currently have an .htaccess file in your wp-admin folder to backup.</strong></font><br>');
  147. } else {
  148. if (file_exists($old_backwpadmin)) {
  149. copy($old_backwpadmin, $new_backwpadmin);
  150. if (!copy($old_backwpadmin, $new_backwpadmin)) {
  151. _e('<font color="red"><strong>Failed to Backup Your wp-admin .htaccess File! File copy function failed. Check the folder permissions for the /wp-content/bps-backup folder. Folder permissions should be set to 755.</strong></font><br>');
  152. } else {
  153. _e('<font color="green"><strong>Your currently active wp-admin .htaccess file has been backed up successfully!</strong></font><br>');
  154. }
  155. }}}}}}}
  156. // Form - Restore backed up htaccess files
  157. $restore_htaccess = 'unchecked';
  158. if (isset($_POST['submit10']) && current_user_can('manage_options')) {
  159. check_admin_referer( 'bulletproof_security_restore_active_htaccess_files' );
  160. $old_restoreroot = ABSPATH . '/wp-content/bps-backup/root.htaccess';
  161. $new_restoreroot = ABSPATH . '/.htaccess';
  162. $old_restorewpadmin = ABSPATH . '/wp-content/bps-backup/wpadmin.htaccess';
  163. $new_restorewpadmin = ABSPATH . '/wp-admin/.htaccess';
  164. $selected_radio = $_POST['selection10'];
  165. if ($selected_radio == 'restore_htaccess') {
  166. $restore_htaccess = 'checked';
  167. if (file_exists($old_restoreroot)) {
  168. copy($old_restoreroot, $new_restoreroot);
  169. if (!copy($old_restoreroot, $new_restoreroot)) {
  170. _e('<font color="red"><strong>Failed to Restore Your Root .htaccess File! This is most likely because you DO NOT currently have a Backed up Root .htaccess file.</strong></font><br>');
  171. } else {
  172. _e('<font color="green"><strong>Your Root .htaccess file has been Restored successfully!</strong></font><br>');
  173. if (file_exists($old_restorewpadmin)) {
  174. copy($old_restorewpadmin, $new_restorewpadmin);
  175. if (!copy($old_restorewpadmin, $new_restorewpadmin)) {
  176. _e('<font color="red"><strong>Failed to Restore Your wp-admin .htaccess File! This is most likely because you DO NOT currently have a Backed up wp-admin .htaccess file.</strong></font><br>');
  177. } else {
  178. _e('<font color="green"><strong>Your wp-admin .htaccess file has been Restored successfully!</strong></font><br>');
  179. }
  180. }}}}}
  181. // Form - Backup the BPS Master Files to /wp-content/bps-backup/master-backups
  182. $backup_master_htaccess_files = 'unchecked';
  183. if (isset($_POST['submit11']) && current_user_can('manage_options')) {
  184. check_admin_referer( 'bulletproof_security_backup_master_htaccess_files' );
  185. $default_master = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/default.htaccess';
  186. $default_master_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_default.htaccess';
  187. $secure_master = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/secure.htaccess';
  188. $secure_master_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_secure.htaccess';
  189. $wpadmin_master = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/wpadmin-secure.htaccess';
  190. $wpadmin_master_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_wpadmin-secure.htaccess';
  191. $maintenance_master = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/maintenance.htaccess';
  192. $maintenance_master_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_maintenance.htaccess';
  193. $bp_maintenance_master = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/bp-maintenance.php';
  194. $bp_maintenance_master_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_bp-maintenance.php';
  195. $bps_maintenance_values = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/bps-maintenance-values.php';
  196. $bps_maintenance_values_backup = ABSPATH . '/wp-content/bps-backup/master-backups/backup_bps-maintenance-values.php';
  197. $selected_radio = $_POST['selection11'];
  198. if ($selected_radio == 'backup_master_htaccess_files') {
  199. $backup_master_htaccess_files = 'checked';
  200. if (file_exists($default_master)) {
  201. copy($default_master, $default_master_backup);
  202. if (!copy($default_master, $default_master_backup)) {
  203. _e('<font color="red"><strong>Failed to Backup Your default.htaccess File!</strong></font><br>');
  204. } else {
  205. _e('<font color="green"><strong>The default.htaccess file has been backed up successfully!</strong></font><br>');
  206. }
  207. if (file_exists($secure_master)) {
  208. copy($secure_master, $secure_master_backup);
  209. if (!copy($secure_master, $secure_master_backup)) {
  210. _e('<font color="red"><strong>Failed to Backup Your secure.htaccess File!</strong></font><br>');
  211. } else {
  212. _e('<font color="green"><strong>The secure.htaccess file has been backed up successfully!</strong></font><br>');
  213. }
  214. if (file_exists($wpadmin_master)) {
  215. copy($wpadmin_master, $wpadmin_master_backup);
  216. if (!copy($wpadmin_master, $wpadmin_master_backup)) {
  217. _e('<font color="red"><strong>Failed to Backup Your wpadmin-secure.htaccess File!</strong></font><br>');
  218. } else {
  219. _e('<font color="green"><strong>The wpadmin-secure.htaccess file has been backed up successfully!</strong></font><br>');
  220. }
  221. if (file_exists($maintenance_master)) {
  222. copy($maintenance_master, $maintenance_master_backup);
  223. if (!copy($maintenance_master, $maintenance_master_backup)) {
  224. _e('<font color="red"><strong>Failed to Backup Your maintenance.htaccess File!</strong></font><br>');
  225. } else {
  226. _e('<font color="green"><strong>The maintenance.htaccess file has been backed up successfully!</strong></font><br>');
  227. }
  228. if (file_exists($bp_maintenance_master)) {
  229. copy($bp_maintenance_master, $bp_maintenance_master_backup);
  230. if (!copy($bp_maintenance_master, $bp_maintenance_master_backup)) {
  231. _e('<font color="red"><strong>Failed to Backup Your bp-maintenance.php File!</strong></font><br>');
  232. } else {
  233. _e('<font color="green"><strong>The bp-maintenance.php file has been backed up successfully!</strong></font><br>');
  234. }
  235. if (file_exists($bps_maintenance_values)) {
  236. copy($bps_maintenance_values, $bps_maintenance_values_backup);
  237. if (!copy($bps_maintenance_values, $bps_maintenance_values_backup)) {
  238. _e('<font color="red"><strong>Failed to Backup Your bps-maintenance-values.php File!</strong></font><br>');
  239. } else {
  240. _e('<font color="green"><strong>The bps-maintenance-values.php file has been backed up successfully!</strong></font><br>');
  241. }
  242. }}}}}}}}
  243. // Form - Activate Maintenance Mode copy and rename maintenance htaccess, bp-maintenance.php and bps-maintenance-values.php to root
  244. $bpmaintenance = 'unchecked';
  245. if (isset($_POST['submit15']) && current_user_can('manage_options')) {
  246. check_admin_referer( 'bulletproof_security_maintenance_copy' );
  247. $oldmaint = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/maintenance.htaccess';
  248. $newmaint = ABSPATH . '/.htaccess';
  249. $oldmaint1 = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/bp-maintenance.php';
  250. $newmaint1 = ABSPATH . '/bp-maintenance.php';
  251. $oldmaint_values = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/bps-maintenance-values.php';
  252. $newmaint_values = ABSPATH . '/bps-maintenance-values.php';
  253. $selected_radio = $_POST['selection15'];
  254. if ($selected_radio == 'bpmaintenance') {
  255. $bpmaintenance = 'checked';
  256. copy($oldmaint, $newmaint);
  257. copy($oldmaint1, $newmaint1);
  258. copy($oldmaint_values, $newmaint_values);
  259. if (!copy($oldmaint, $newmaint)) {
  260. _e('<p><font color="red"><strong>Failed to Activate Maintenance Mode! Your Website is NOT in Maintenance Mode!<br>If your Root .htaccess file is locked you must unlock it first before activating Maintenance Mode.</strong></font></p>');
  261. } else {
  262. _e('<font color="red"><strong>Warning: </strong></font>Maintenance Mode Is Activated. Your website is now displaying the Website Under Maintenance page to everyone except you. To switch out of Maintenance mode activate BulletProof Security Mode. You can log in and out of your Dashboard / WordPress website in Maintenance Mode as long as your current IP address does not change. If your current IP address changes you will have to FTP to your website and delete the .htaccess file in your website root folder (or download the .htaccess file and add your new IP address and upload it back to your root website folder) to be able to log back into your WordPress Dashboard. Your ISP provides your current Public IP address. If you reboot your computer or disconnect from the Internet there is a good chance that you will get a new Public IP address from your ISP.');
  263. }
  264. }
  265. }
  266. // Create maintenance htaccess file
  267. if (isset($_POST['bps-auto-write-maint']) && current_user_can('manage_options')) {
  268. check_admin_referer( 'bulletproof_security_auto_write_maint' );
  269. $bps_string_replace_maint = array(".");
  270. $bps_get_IP_maint = str_replace($bps_string_replace_maint, "\.", $_SERVER['REMOTE_ADDR']) . "$";
  271. $bps_get_wp_root_maint = bps_wp_get_root_folder();
  272. $bps_auto_write_maint_file = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/maintenance.htaccess';
  273. $bps_maint_content = "# BULLETPROOF .46.6 MAINTENANCE .HTACCESS \n
  274. RewriteEngine On
  275. RewriteBase $bps_get_wp_root_maint\n
  276. RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK|DEBUG) [NC]
  277. RewriteRule ^(.*)$ - [F,L]\n
  278. # ALLOW THUMBNAILER SCRIPTS TO DISPLAY IMAGES
  279. RewriteCond %{REQUEST_FILENAME} thumb.php [NC,OR]
  280. RewriteCond %{REQUEST_FILENAME} thumbs.php [NC,OR]
  281. RewriteCond %{REQUEST_FILENAME} timthumb.php [NC,OR]
  282. RewriteCond %{REQUEST_FILENAME} phpthumb.php [NC]
  283. RewriteRule . - [F,L]\n
  284. # BPSQSE BPS QUERY STRING EXPLOITS
  285. RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
  286. RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  287. RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|".'"'."|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
  288. RewriteCond %{THE_REQUEST} \?\ HTTP/ [NC,OR]
  289. RewriteCond %{THE_REQUEST} \/\*\ HTTP/ [NC,OR]
  290. RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
  291. RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
  292. RewriteCond %{THE_REQUEST} (\\r|\\n|%0A|%0D) [NC,OR]
  293. RewriteCond %{REQUEST_URI} owssvr\.dll [NC,OR]
  294. RewriteCond %{HTTP_REFERER} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  295. RewriteCond %{HTTP_REFERER} \.opendirviewer\. [NC,OR]
  296. RewriteCond %{HTTP_REFERER} users\.skynet\.be.* [NC,OR]
  297. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
  298. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
  299. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
  300. RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
  301. RewriteCond %{QUERY_STRING} \.\./\.\. [OR]
  302. RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
  303. RewriteCond %{QUERY_STRING} http\: [NC,OR]
  304. RewriteCond %{QUERY_STRING} https\: [NC,OR]
  305. RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
  306. RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
  307. RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
  308. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
  309. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  310. RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
  311. RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
  312. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
  313. RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
  314. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  315. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
  316. RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
  317. RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
  318. RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
  319. RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
  320. RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  321. RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
  322. RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
  323. RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
  324. RewriteCond %{QUERY_STRING} (;|<|>|'|".'"'."|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
  325. RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
  326. RewriteRule ^(.*)$ - [F,L]\n
  327. RewriteCond %{REMOTE_ADDR} !^$bps_get_IP_maint
  328. RewriteCond %{REQUEST_URI} !^$bps_get_wp_root_maint"."bp-maintenance\.php$
  329. RewriteCond %{REQUEST_URI} !^$bps_get_wp_root_maint"."wp-content/plugins/bulletproof-security/abstract-blue-bg\.png$
  330. RewriteRule ^(.*)$ $bps_get_wp_root_maint"."bp-maintenance.php [L]
  331. RewriteCond %{REQUEST_FILENAME} !-f
  332. RewriteCond %{REQUEST_FILENAME} !-d
  333. RewriteRule . $bps_get_wp_root_maint"."index.php [L]";
  334. if (is_writable($bps_auto_write_maint_file)) {
  335. if (!$handle = fopen($bps_auto_write_maint_file, 'w+b')) {
  336. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_maint_file" . '</strong></font>');
  337. exit;
  338. }
  339. if (fwrite($handle, $bps_maint_content) === FALSE) {
  340. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_maint_file" . '</strong></font>');
  341. exit;
  342. }
  343. _e('<font color="green"><strong>Success! Your Maintenance Mode htaccess file was created successfully! Select the Maintenance Mode radio button and click Activate to put your website in Maintenance Mode.</strong></font>');
  344. fclose($handle);
  345. } else {
  346. _e('<font color="red"><strong>The file ' . "$bps_auto_write_maint_file" . ' is not writable or does not exist.</strong></font><br><strong>Check that the file is named maintenance.htaccess and that the file exists in the /bulletproof-security/admin/htaccess master folder. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>');
  347. }
  348. }
  349. // default.htaccess and secure.htaccess fwrite content for all WP site types
  350. $bps_get_wp_root_default = bps_wp_get_root_folder();
  351. $bps_auto_write_default_file = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/default.htaccess';
  352. $bpsSuccessMessageDef = '<font color="green"><strong>Success! Your Default Mode Master htaccess file was created successfully!</strong></font><br><font color="red"><strong>CAUTION: Default Mode should only be activated for testing or troubleshooting purposes. Default Mode does not protect your website with any security protection.</strong></font><br><font color="black"><strong>To activate Default Mode select the Default Mode radio button and click Activate to put your website in Default Mode.</strong></font>';
  353. $bpsFailMessageDef = '<font color="red"><strong>The file ' . "$bps_auto_write_default_file" . ' is not writable or does not exist.</strong></font><br><strong>Check that the file is named default.htaccess and that the file exists in the /bulletproof-security/admin/htaccess master folder. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>';
  354. $bpsTopMU = "\nRewriteEngine On
  355. RewriteBase $bps_get_wp_root_default
  356. RewriteRule ^index\.php$ - [L]\n\n";
  357. $bps_default_content_top = "# BULLETPROOF .46.D >>>>>>> DEFAULT .HTACCESS \n
  358. # If you edit the line of code above you will see error messages on the BPS status page
  359. # WARNING!!! THE default.htaccess FILE DOES NOT PROTECT YOUR WEBSITE AGAINST HACKERS
  360. # This is a standard generic htaccess file that does NOT provide any website security
  361. # The DEFAULT .HTACCESS file should be used for testing and troubleshooting purposes only\n
  362. # BEGIN WordPress";
  363. $bps_default_content_bottom = "\n<IfModule mod_rewrite.c>
  364. RewriteEngine On
  365. RewriteBase $bps_get_wp_root_default
  366. RewriteRule ^index\.php$ - [L]
  367. RewriteCond %{REQUEST_FILENAME} !-f
  368. RewriteCond %{REQUEST_FILENAME} !-d
  369. RewriteRule . $bps_get_wp_root_default"."index.php [L]
  370. </IfModule>\n
  371. # END WordPress";
  372. $bpsMUEndWP = "# END WordPress";
  373. $bpsMUSDirTop = "# uploaded files
  374. RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]\n
  375. # add a trailing slash to /wp-admin
  376. RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]\n\n";
  377. $bpsMUSDomTop = "# uploaded files
  378. RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]\n\n";
  379. $bpsMUSDirBottom = "RewriteCond %{REQUEST_FILENAME} -f [OR]
  380. RewriteCond %{REQUEST_FILENAME} -d
  381. RewriteRule ^ - [L]
  382. RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
  383. RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
  384. RewriteRule . index.php [L]\n\n";
  385. $bpsMUSDomBottom = "RewriteCond %{REQUEST_FILENAME} -f [OR]
  386. RewriteCond %{REQUEST_FILENAME} -d
  387. RewriteRule ^ - [L]
  388. RewriteRule . index.php [L]\n\n";
  389. // Create Default htaccess file - Single Site
  390. if (isset($_POST['bps-auto-write-default']) && current_user_can('manage_options')) {
  391. check_admin_referer( 'bulletproof_security_auto_write_default' );
  392. if (is_writable($bps_auto_write_default_file)) {
  393. if (!$handle = fopen($bps_auto_write_default_file, 'w+b')) {
  394. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_default_file" . '</strong></font>');
  395. exit;
  396. }
  397. if (fwrite($handle, $bps_default_content_top.$bps_default_content_bottom) === FALSE) {
  398. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_default_file" . '</strong></font>');
  399. exit;
  400. }
  401. _e($bpsSuccessMessageDef);
  402. fclose($handle);
  403. } else {
  404. _e($bpsFailMessageDef);
  405. }
  406. }
  407. // Create Default htaccess file - MU Subdirectory
  408. if (isset($_POST['bps-auto-write-default-MUSDir']) && current_user_can('manage_options')) {
  409. check_admin_referer( 'bulletproof_security_auto_write_default_MUSDir' );
  410. if (is_writable($bps_auto_write_default_file)) {
  411. if (!$handle = fopen($bps_auto_write_default_file, 'w+b')) {
  412. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_default_file" . '</strong></font>');
  413. exit;
  414. }
  415. if (fwrite($handle, $bps_default_content_top.$bpsTopMU.$bpsMUSDirTop.$bpsMUSDirBottom.$bpsMUEndWP) === FALSE) {
  416. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_default_file" . '</strong></font>');
  417. exit;
  418. }
  419. _e($bpsSuccessMessageDef);
  420. fclose($handle);
  421. } else {
  422. _e($bpsFailMessageDef);
  423. }
  424. }
  425. // Create Default htaccess file - MU Subdomain
  426. if (isset($_POST['bps-auto-write-default-MUSDom']) && current_user_can('manage_options')) {
  427. check_admin_referer( 'bulletproof_security_auto_write_default_MUSDom' );
  428. if (is_writable($bps_auto_write_default_file)) {
  429. if (!$handle = fopen($bps_auto_write_default_file, 'w+b')) {
  430. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_default_file" . '</strong></font>');
  431. exit;
  432. }
  433. if (fwrite($handle, $bps_default_content_top.$bpsTopMU.$bpsMUSDomTop.$bpsMUSDomBottom.$bpsMUEndWP) === FALSE) {
  434. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_default_file" . '</strong></font>');
  435. exit;
  436. }
  437. _e($bpsSuccessMessageDef);
  438. fclose($handle);
  439. } else {
  440. _e($bpsFailMessageDef);
  441. }
  442. }
  443. // secure.htaccess fwrite content for all WP site types
  444. $bps_get_wp_root_secure = bps_wp_get_root_folder();
  445. $bps_auto_write_secure_file = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/secure.htaccess';
  446. $bpsSuccessMessageSec = '<font color="green"><strong>Success! Your BulletProof Security Root Master htaccess file was created successfully!</strong></font><br><font color="black"><strong>You can now Activate BulletProof Mode for your Root folder. Select the BulletProof Mode radio button and click Activate to put your website in BulletProof Mode.</strong></font>';
  447. $bpsFailMessageSec = '<font color="red"><strong>The file ' . "$bps_auto_write_secure_file" . ' is not writable or does not exist.</strong></font><br><strong>Check that the file is named secure.htaccess and that the file exists in the /bulletproof-security/admin/htaccess master folder. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>';
  448. $bps_secure_content_top = "# BULLETPROOF .46.6 >>>>>>> SECURE .HTACCESS \n
  449. # If you edit the BULLETPROOF .46.6 >>>>>>> SECURE .HTACCESS text above
  450. # you will see error messages on the BPS status page
  451. # BPS is reading the version number in the htaccess file to validate checks
  452. # If you would like to change what is displayed above you
  453. # will need to edit the BPS /includes/functions.php file to match your changes
  454. # If you update your WordPress Permalinks the code between BEGIN WordPress and
  455. # END WordPress is replaced by WP htaccess code.
  456. # This removes all of the BPS security code and replaces it with just the default WP htaccess code
  457. # To restore this file use BPS Restore or activate BulletProof Mode for your Root folder again.\n
  458. # BEGIN WordPress
  459. # IMPORTANT!!! DO NOT DELETE!!! - BEGIN Wordpress above or END WordPress - text in this file
  460. # They are reference points for WP, BPS and other plugins to write to this htaccess file.
  461. # IMPORTANT!!! DO NOT DELETE!!! - BPSQSE BPS QUERY STRING EXPLOITS - text
  462. # BPS needs to find the - BPSQSE - text string in this file to validate that your security filters exist\n
  463. # TURN OFF YOUR SERVER SIGNATURE
  464. ServerSignature Off\n
  465. # ADD PHP HANDLER - Add your hosts php Handler below if you are using a php handler
  466. # Example GoDaddy PHP 5.2.x php handler is shown commented out directly below
  467. #AddHandler x-httpd-php5 .php\n
  468. # CUSTOM PHP.INI FILES - handlers and mod_suphp htaccess code for Web Hosts
  469. # If you are using either a BPS Pro custom php.ini file or one that you created yourself
  470. # If your host is GoDaddy and you have a custom php.ini file
  471. # uncomment the 1 line of code directly below
  472. #AddHandler x-httpd-php5 .php
  473. # If your host is BlueHost, HostMonster FastDomain and you have a custom php.ini file
  474. # uncomment the 1 line of code directly below
  475. #AddHandler application/x-httpd-php5s .php
  476. # If your host is HostGator and you have a custom php.ini file
  477. # uncomment the 3 lines of code below and replace xxxxx with your account/username
  478. #<IfModule mod_suphp.c>
  479. #suPHP_ConfigPath /home/xxxxx/public_html/php.ini
  480. #</IfModule>\n
  481. # DO NOT SHOW DIRECTORY LISTING
  482. # If you are getting 500 Errors when activating BPS then comment out Options -Indexes
  483. # by adding a # sign in front of it. If there is a typo anywhere in this file you will also see 500 errors.
  484. Options -Indexes\n
  485. # DIRECTORY INDEX FORCE INDEX.PHP
  486. # Use index.php as default directory index file
  487. # index.html will be ignored will not load.
  488. DirectoryIndex index.php index.html /index.php\n
  489. # BPS PRO ERROR LOGGING AND TRACKING - Available in BPS Pro only
  490. # BPS Pro has premade 403 Forbidden, 400 Bad Request and 404 Not Found files that are used
  491. # to track and log 403, 400 and 404 errors that occur on your website. When a hacker attempts to
  492. # hack your website the hackers IP address, Host name, Request Method, Referering link, the file name or
  493. # requested resource, the user agent of the hacker and the query string used in the hack attempt are logged.
  494. # BPS Pro Log files are added to the P-Security All Purpose File Manager to view them.
  495. # All BPS Pro log files are htaccess protected so that only you can view them.
  496. # The 400.php, 403.php and 404.php files are located in /wp-content/plugins/bulletproof-security/
  497. # The 400 and 403 Error logging files are already set up and will automatically start logging errors
  498. # after you install BPS Pro and have activated BulletProof Mode for your Root folder.
  499. # If you would like to log 404 errors you will need to copy the logging code in the BPS Pro 404.php file
  500. # to your Theme's 404.php template file. Simple instructions are included in the BPS Pro 404.php file.
  501. # You can open the BPS Pro 404.php file using the WP Plugins Editor or by using the BPS Pro File Manager.
  502. # NOTE: By default WordPress automatically looks in your Theme's folder for a 404.php template file.\n
  503. #ErrorDocument 400 $bps_get_wp_root_secure"."wp-content/plugins/bulletproof-security/400.php
  504. #ErrorDocument 403 $bps_get_wp_root_secure"."wp-content/plugins/bulletproof-security/403.php
  505. ErrorDocument 404 $bps_get_wp_root_secure"."404.php\n
  506. # DENY ACCESS TO PROTECTED SERVER FILES - .htaccess, .htpasswd and all file names starting with dot
  507. RedirectMatch 403 /\..*$\n
  508. RewriteEngine On
  509. RewriteBase $bps_get_wp_root_secure
  510. RewriteRule ^wp-admin/includes/ - [F,L]
  511. RewriteRule !^wp-includes/ - [S=3]
  512. RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
  513. RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
  514. RewriteRule ^wp-includes/theme-compat/ - [F,L]\n
  515. RewriteEngine On
  516. RewriteBase $bps_get_wp_root_secure
  517. RewriteRule ^index\.php$ - [L]\n\n";
  518. $bps_secure_content_mid_top = "# REQUEST METHODS FILTERED
  519. # This filter is for blocking junk bots and spam bots from making a HEAD request, but may also block some
  520. # HEAD request from bots that you want to allow in certains cases. This is not a security filter and is just
  521. # a nuisance filter. This filter will not block any important bots like the google bot. If you want to allow
  522. # all bots to make a HEAD request then remove HEAD from the Request Method filter.
  523. # The TRACE, DELETE, TRACK and DEBUG request methods should never be allowed against your website.
  524. RewriteEngine On
  525. RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK|DEBUG) [NC]
  526. RewriteRule ^(.*)$ - [F,L]\n
  527. # PLUGINS AND VARIOUS EXPLOIT FILTER SKIP RULES
  528. # IMPORTANT!!! If you add or remove a skip rule you must change S= to the new skip number
  529. # Example: If RewriteRule S=5 is deleted than change S=6 to S=5, S=7 to S=6, etc.
  530. # Adminer MySQL management tool data populate
  531. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/plugins/adminer/ [NC]
  532. RewriteRule . - [S=11]
  533. # Comment Spam Pack MU Plugin - CAPTCHA images not displaying
  534. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/mu-plugins/custom-anti-spam/ [NC]
  535. RewriteRule . - [S=10]
  536. # Peters Custom Anti-Spam display CAPTCHA Image
  537. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/plugins/peters-custom-anti-spam-image/ [NC]
  538. RewriteRule . - [S=9]
  539. # Status Updater plugin fb connect
  540. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/plugins/fb-status-updater/ [NC]
  541. RewriteRule . - [S=8]
  542. # Stream Video Player - Adding FLV Videos Blocked
  543. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/plugins/stream-video-player/ [NC]
  544. RewriteRule . - [S=7]
  545. # XCloner 404 or 403 error when updating settings
  546. RewriteCond %{REQUEST_URI} ^$bps_get_wp_root_secure"."wp-content/plugins/xcloner-backup-and-restore/ [NC]
  547. RewriteRule . - [S=6]
  548. # BuddyPress Logout Redirect
  549. RewriteCond %{QUERY_STRING} action=logout&redirect_to=http%3A%2F%2F(.*) [NC]
  550. RewriteRule . - [S=5]
  551. # redirect_to=
  552. RewriteCond %{QUERY_STRING} redirect_to=(.*) [NC]
  553. RewriteRule . - [S=4]
  554. # Login Plugins Password Reset And Redirect 1
  555. RewriteCond %{QUERY_STRING} action=resetpass&key=(.*) [NC]
  556. RewriteRule . - [S=3]
  557. # Login Plugins Password Reset And Redirect 2
  558. RewriteCond %{QUERY_STRING} action=rp&key=(.*) [NC]
  559. RewriteRule . - [S=2]\n
  560. # ALLOW THUMBNAILER SCRIPTS TO DISPLAY IMAGES
  561. # By default BPS is forbidding allowing these thumbnailer scripts filename requests
  562. # This will Log lots of hacking attempts on your website in your BPS Pro Error Log
  563. # If you are using one of these thumbnailer scripts on your website and you want to allow
  564. # your thumbnailer script images to display then change [F,L] to [S=1]
  565. # Make sure that you have a security patched version or recent versions of these scripts
  566. # before changing [F,L] to [S=1] and allowing these files to be requested on your website
  567. # If you delete or remove the RewriteRule below you will need to change the above skip rules
  568. # Example: RewriteRule S=2 above will need to be changed to S=1, change S=3 to S=2, etc.
  569. RewriteCond %{REQUEST_FILENAME} thumb.php [NC,OR]
  570. RewriteCond %{REQUEST_FILENAME} thumbs.php [NC,OR]
  571. RewriteCond %{REQUEST_FILENAME} timthumb.php [NC,OR]
  572. RewriteCond %{REQUEST_FILENAME} phpthumb.php [NC]
  573. RewriteRule . - [F,L]\n
  574. # BPSQSE BPS QUERY STRING EXPLOITS
  575. # The libwww-perl User Agent is forbidden - Many bad bots use libwww-perl modules, but some good bots use it too.
  576. # Good sites such as W3C use it for their W3C-LinkChecker.
  577. # Add or remove user agents temporarily or permanently from the first User Agent filter below.
  578. # If you want a list of bad bots / User Agents to block then scroll to the end of this file.
  579. RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
  580. RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  581. RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|".'"'."|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
  582. RewriteCond %{THE_REQUEST} \?\ HTTP/ [NC,OR]
  583. RewriteCond %{THE_REQUEST} \/\*\ HTTP/ [NC,OR]
  584. RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
  585. RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
  586. RewriteCond %{THE_REQUEST} (\\r|\\n|%0A|%0D) [NC,OR]
  587. RewriteCond %{REQUEST_URI} owssvr\.dll [NC,OR]
  588. RewriteCond %{HTTP_REFERER} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  589. RewriteCond %{HTTP_REFERER} \.opendirviewer\. [NC,OR]
  590. RewriteCond %{HTTP_REFERER} users\.skynet\.be.* [NC,OR]
  591. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
  592. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
  593. RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
  594. RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
  595. RewriteCond %{QUERY_STRING} \.\./\.\. [OR]
  596. RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
  597. RewriteCond %{QUERY_STRING} http\: [NC,OR]
  598. RewriteCond %{QUERY_STRING} https\: [NC,OR]
  599. RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
  600. RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
  601. RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
  602. RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
  603. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  604. RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
  605. RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
  606. RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
  607. RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
  608. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  609. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
  610. RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
  611. RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
  612. RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
  613. RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
  614. RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
  615. RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
  616. RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
  617. RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
  618. RewriteCond %{QUERY_STRING} (;|<|>|'|".'"'."|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
  619. RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
  620. RewriteRule ^(.*)$ - [F,L]\n";
  621. $bps_secure_content_mid_bottom = "RewriteCond %{REQUEST_FILENAME} !-f
  622. RewriteCond %{REQUEST_FILENAME} !-d
  623. RewriteRule . $bps_get_wp_root_secure"."index.php [L]\n\n";
  624. $bps_secure_content_bottom = "# DENY BROWSER ACCESS TO THESE FILES
  625. # wp-config.php, bb-config.php, php.ini, php5.ini, readme.html
  626. # Replace Allow from 88.77.66.55 with your current IP address and remove the
  627. # pound sign # from in front of the Allow from line of code below to access these
  628. # files directly from your browser.\n
  629. <FilesMatch ".'"'."^(wp-config\.php|php\.ini|php5\.ini|readme\.html|bb-config\.php)".'"'.">
  630. Order allow,deny
  631. Deny from all
  632. #Allow from 88.77.66.55
  633. </FilesMatch>\n
  634. # IMPORTANT!!! DO NOT DELETE!!! the END WordPress text below
  635. # END WordPress\n
  636. # BLOCK HOTLINKING TO IMAGES
  637. # To Test that your Hotlinking protection is working visit http://altlab.com/htaccess_tutorial.html
  638. #RewriteEngine On
  639. #RewriteCond %{HTTP_REFERER} !^https?://(www\.)?add-your-domain-here\.com [NC]
  640. #RewriteCond %{HTTP_REFERER} !^$
  641. #RewriteRule .*\.(jpeg|jpg|gif|bmp|png)$ - [F]\n
  642. # BLOCK MORE BAD BOTS RIPPERS AND OFFLINE BROWSERS
  643. # If you would like to block more bad bots you can get a blacklist from
  644. # http://perishablepress.com/press/2007/06/28/ultimate-htaccess-blacklist/
  645. # You should monitor your site very closely for at least a week if you add a bad bots list
  646. # to see if any website traffic problems or other problems occur.
  647. # Copy and paste your bad bots user agent code list directly below.";
  648. // Create Secure htaccess master Root file - Single Site
  649. if (isset($_POST['bps-auto-write-secure-root']) && current_user_can('manage_options')) {
  650. check_admin_referer( 'bulletproof_security_auto_write_secure_root' );
  651. if (is_writable($bps_auto_write_secure_file)) {
  652. if (!$handle = fopen($bps_auto_write_secure_file, 'w+b')) {
  653. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_secure_file" . '</strong></font>');
  654. exit;
  655. }
  656. if (fwrite($handle, $bps_secure_content_top.$bps_secure_content_mid_top.$bps_secure_content_mid_bottom.$bps_secure_content_bottom) === FALSE) {
  657. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_secure_file" . '</strong></font>');
  658. exit;
  659. }
  660. _e($bpsSuccessMessageSec);
  661. fclose($handle);
  662. } else {
  663. _e($bpsFailMessageSec);
  664. }
  665. }
  666. // Create Secure htaccess master Root file - MU Subdirectory
  667. if (isset($_POST['bps-auto-write-secure-root-MUSDir']) && current_user_can('manage_options')) {
  668. check_admin_referer( 'bulletproof_security_auto_write_secure_root_MUSDir' );
  669. if (is_writable($bps_auto_write_secure_file)) {
  670. if (!$handle = fopen($bps_auto_write_secure_file, 'w+b')) {
  671. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_secure_file" . '</strong></font>');
  672. exit;
  673. }
  674. if (fwrite($handle, $bps_secure_content_top.$bpsMUSDirTop.$bps_secure_content_mid_top.$bpsMUSDirBottom.$bps_secure_content_bottom) === FALSE) {
  675. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_secure_file" . '</strong></font>');
  676. exit;
  677. }
  678. _e($bpsSuccessMessageSec);
  679. fclose($handle);
  680. } else {
  681. _e($bpsFailMessageSec);
  682. }
  683. }
  684. // Create Secure htaccess master Root file - MU Subdomain
  685. if (isset($_POST['bps-auto-write-secure-root-MUSDom']) && current_user_can('manage_options')) {
  686. check_admin_referer( 'bulletproof_security_auto_write_secure_MUSDom' );
  687. if (is_writable($bps_auto_write_secure_file)) {
  688. if (!$handle = fopen($bps_auto_write_secure_file, 'w+b')) {
  689. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_secure_file" . '</strong></font>');
  690. exit;
  691. }
  692. if (fwrite($handle, $bps_secure_content_top.$bpsMUSDomTop.$bps_secure_content_mid_top.$bpsMUSDomBottom.$bps_secure_content_bottom) === FALSE) {
  693. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_secure_file" . '</strong></font>');
  694. exit;
  695. }
  696. _e($bpsSuccessMessageSec);
  697. fclose($handle);
  698. } else {
  699. _e($bpsFailMessageSec);
  700. }
  701. }
  702. // Create the Maintenance Mode Settings Values Form File - values from DB
  703. if (isset($_POST['bps-maintenance-create-values_submit']) && current_user_can('manage_options')) {
  704. check_admin_referer( 'bulletproof_security_create_values_form' );
  705. $options = get_option('bulletproof_security_options_maint');
  706. $bps_retry_after_write = $options['bps-retry-after'];
  707. $bps_site_title_write = $options['bps-site-title'];
  708. $bps_message1_write = $options['bps-message-1'];
  709. $bps_message2_write = $options['bps-message-2'];
  710. $bps_body_background_image_write = $options['bps-background-image'];
  711. $bps_auto_write_maint_file_form = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/bps-maintenance-values.php';
  712. $bps_maint_content_form = "<?php".'
  713. $bps_retry_after'." = '$bps_retry_after_write';\n"
  714. .'$bps_site_title'." = '$bps_site_title_write';\n"
  715. .'$bps_message1'." = '$bps_message1_write';\n"
  716. .'$bps_message2'." = '$bps_message2_write';\n"
  717. .'$bps_body_background_image'." = '$bps_body_background_image_write';
  718. ?>";
  719. if (is_writable($bps_auto_write_maint_file_form)) {
  720. if (!$handle = fopen($bps_auto_write_maint_file_form, 'w+b')) {
  721. _e('<font color="red"><strong>Cannot open file' . "$bps_auto_write_maint_file_form" . '</strong></font>');
  722. exit;
  723. }
  724. if (fwrite($handle, $bps_maint_content_form) === FALSE) {
  725. _e('<font color="red"><strong>Cannot write to file' . "$bps_auto_write_maint_file_form" . '</strong></font>');
  726. exit;
  727. }
  728. _e('<font color="green"><strong>Success! Your Maintenance Mode Form has been created successfully! Click the Preview button to preview your Website Under Maintenance page.</strong></font>');
  729. fclose($handle);
  730. } else {
  731. _e('<font color="red"><strong>The file ' . "$bps_auto_write_maint_file_form" . ' is not writable or does not exist.</strong></font><br><strong>Check that the bps-maintenance-values.php file exists in the /bulletproof-security/admin/htaccess master folder. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>');
  732. }
  733. }
  734. // Simple Secure Old School PHP file upload
  735. if (isset($_POST['submit-bps-upload']) && current_user_can('manage_options')) {
  736. check_admin_referer( 'bulletproof_security_upload' );
  737. $tmp_file = $_FILES['bps_file_upload']['tmp_name'];
  738. $folder_path = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/';
  739. $bps_uploaded_file = str_replace('//','/',$folder_path) . $_FILES['bps_file_upload']['name'];
  740. if (!empty($_FILES)) {
  741. move_uploaded_file($tmp_file,$bps_uploaded_file);
  742. _e('<font color="black"><strong>File Upload Path and File Name: </strong></font><br>');
  743. echo "$bps_uploaded_file";
  744. } else {
  745. _e('<font color="red"><strong>File upload error. File was not successfully uploaded.</strong></font><br>');
  746. }
  747. }
  748. // Enable File Downloading for Master Files - writes a new denyall htaccess file with the current IP address
  749. if (isset($_POST['bps-enable-download']) && current_user_can('manage_options')) {
  750. check_admin_referer( 'bulletproof_security_enable_download' );
  751. $bps_get_IP = $_SERVER['REMOTE_ADDR'];
  752. $denyall_htaccess_file = ABSPATH . '/wp-content/plugins/bulletproof-security/admin/htaccess/.htaccess';
  753. $bps_denyall_content = "order deny,allow\ndeny from all\nallow from $bps_get_IP";
  754. if (is_writable($denyall_htaccess_file)) {
  755. if (!$handle = fopen($denyall_htaccess_file, 'w+b')) {
  756. _e('<font color="red"><strong>Cannot open file' . "$denyall_htaccess_file" . '</strong></font>');
  757. exit;
  758. }
  759. if (fwrite($handle, $bps_denyall_content) === FALSE) {
  760. _e('<font color="red"><strong>Cannot write to file' . "$denyall_htaccess_file" . '</strong></font>');
  761. exit;
  762. }
  763. _e('<font color="green"><strong>Success! File open, preview and downloading for your BPS Master Files is enabled for your IP address only ===' . "$bps_get_IP." .'</strong></font>');
  764. fclose($handle);
  765. } else {
  766. _e('<font color="red"><strong>The file ' . "$denyall_htaccess_file" . ' is not writable or does not exist yet.</strong></font><br><strong>Check the BPS Status page to see if Deny All protection has been activated. Activate Deny All htaccess Folder Protection For The BPS Master htaccess Folder on the BPS Security Modes page. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>');
  767. }
  768. }
  769. // Enable File Downloading for BPS Backup Folder - writes a new denyall htaccess file with the current IP address
  770. if (isset($_POST['bps-enable-download-backup']) && current_user_can('manage_options')) {
  771. check_admin_referer( 'bulletproof_security_enable_download-backup' );
  772. $bps_get_IP2 = $_SERVER['REMOTE_ADDR'];
  773. $denyall_htaccess_file_backup = ABSPATH . '/wp-content/bps-backup/.htaccess';
  774. $bps_denyall_content_backup = "order deny,allow\ndeny from all\nallow from $bps_get_IP2";
  775. if (is_writable($denyall_htaccess_file_backup)) {
  776. if (!$handle = fopen($denyall_htaccess_file_backup, 'w+b')) {
  777. _e('<font color="red"><strong>Cannot open file' . "$denyall_htaccess_file_backup" . '</strong></font>');
  778. exit;
  779. }
  780. if (fwrite($handle, $bps_denyall_content_backup) === FALSE) {
  781. _e('<font color="red"><strong>Cannot write to file' . "$denyall_htaccess_file_backup" . '</strong></font>');
  782. exit;
  783. }
  784. _e('<font color="green"><strong>Success! File open, preview and downloading for your Backed Up htaccess Files is enabled for your IP address only ===' . "$bps_get_IP2." .'</strong></font>');
  785. fclose($handle);
  786. } else {
  787. _e('<font color="red"><strong>The file ' . "$denyall_htaccess_file_backup" . ' is not writable or does not exist yet.</strong></font><br><strong>Check the BPS Status page to see if Deny All protection has been activated. Activate Deny All htaccess Folder Protection For The BPS Backup Folder on the BPS Security Modes page. If this is not the problem click <a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank">here</a> for more help info.</strong><br>');
  788. }
  789. }
  790. // General all purpose "Settings Saved." message for forms
  791. if (current_user_can('manage_options')) {
  792. if (@$_GET['settings-updated'] == true) {
  793. _e('<font color="green"><strong><p>Settings Saved.</p></strong></font>');
  794. }
  795. }
  796. ?>
  797. </div>
  798. <div id="bpspaypal">
  799. <a href="http://www.ait-pro.com/po/" target="_blank" title="Link opens in new browser window">Why Upgrade to BulletProof Security Pro?</a>
  800. </div>
  801. <div class="wrap">
  802. <?php $bulletproof_ver = '.46.6'; ?>
  803. <h2 style="margin-left:70px;"><?php _e('BulletProof Security ~ htaccess Core'); ?></h2>
  804. <!-- jQuery UI Tab Menu -->
  805. <div id="bps-container">
  806. <div id="bps-tabs" class="bps-menu">
  807. <div id="bpsHead" style="position:relative; top:0px; left:0px;"><img src="<?php echo get_site_url(); ?>/wp-content/plugins/bulletproof-security/admin/images/bps-security-shield.png" style="float:left; padding:0px 8px 0px 0px; margin:-68px 0px 0px 0px;" /></div>
  808. <ul>
  809. <li><a href="#bps-tabs-1">Security Modes</a></li>
  810. <li><a href="#bps-tabs-2">Security Status</a></li>
  811. <li><a href="#bps-tabs-3">System Info</a></li>
  812. <li><a href="#bps-tabs-4">Backup &amp; Restore</a></li>
  813. <li><a href="#bps-tabs-5">Edit/Upload/Download</a></li>
  814. <li><a href="#bps-tabs-6">Maintenance Mode</a></li>
  815. <li><a href="#bps-tabs-7">Help &amp; FAQ</a></li>
  816. <li><a href="#bps-tabs-8">Whats New</a></li>
  817. <li><a href="#bps-tabs-9">My Notes</a></li>
  818. <li><a href="#bps-tabs-10">BPS Pro Features</a></li>
  819. </ul>
  820. <div id="bps-tabs-1" class="bps-tab-page">
  821. <h2><?php _e('BulletProof Security Modes'); ?></h2>
  822. <div id="bpsMonitoringAlerting" style="border-top:1px solid #999999;">
  823. <h3><?php _e('AutoMagic - Create Your htaccess Master Files'); ?> <a href="#" onmouseover="Tip('<strong>Backup your existing htaccess files if you have any first by clicking on the Backup & Restore menu tab - click on the Backup htaccess files radio button to select it and click on the Backup Files button to back up your existing htaccess files.</strong><br><br><strong>AutoMagic - BPS will create Your Master .htaccess Files For You Automatically</strong><br>BPS detects what type of WordPress installation you have and will tell you which AutoMagic buttons to use for your website.<br><br> -- Click the <strong>Create default.htaccess File</strong> button and click the <strong>Create secure.htaccess File</strong> button<br> -- Click on the Edit/Upload/Download menu tab, click on the secure.htaccess menu tab to view you new master .htaccess file, make any changes, edit it or add any additional .htaccess code to it before you activate it.<br> -- Activate BulletProof Mode for your Root folder<br> -- Activate BulletProof Mode for your wp-admin folder<br> -- Activate BulletProof Mode for the BPS Master htaccess folder and the BPS Backup folder<br><br><strong>IMPORTANT!!! YOU MUST HAVE BOTH THE ROOT BULLETPROOF MODE AND THE WP-ADMIN BULLETPROOF MODE ACTIVATED</strong><br>If you do not activate both BulletProof Mode for your root folder and BulletProof Mode for your wp-admin folder then BPS and WP will not work correctly.<br><br><strong>Explanation Of The Steps Above:</strong><br>If you see error messages when performing a first time backup do not worry about it. BPS will backup whatever files should be or are available to backup for your website.<br>Clicking the <strong>Create default.htaccess File</strong> button and the <strong>Create secure.htaccess File</strong> button will create these two master htaccess files for you. The correct RewriteBase and RewriteRule for your website will be automatically added to these files. The default.htaccess file is the master .htaccess file that is copied to your root folder when you activate Default Mode. Default Mode should only be activated for testing and troubleshooting purposes - it does not provide any website security. The secure.htaccess file is the master .htaccess file that is copied to your root folder when you activate BulletProof Mode for your Root folder. The plugin conflict fixes in the secure.htaccess master file will also have your correct WordPress installation folder name automatically added to it. The htaccess file for your wp-admin folder does not require any editing nor do the Deny All htaccess files. This means that once you have created the default.htaccess file and the secure.htaccess file you can go ahead and activate all BulletProof Modes.<br><br><strong>Manual Control of htaccess Files Instead of Using AutoMagic</strong><br>If you want manual control and want to edit your htacess files using the built-in BPS File Editor instead of having them automatically created for you then there is no need to click on the AutoMagic create files buttons.<br><br><strong>AutoMagic Instruction for WordPress Network (Multisite) Sites</strong><br>BPS will automatically detect whether you have a subdomain or subdirectory Network (Multisite) installation and tell you which AutoMagic buttons to use. BPS menus will only be displayed to Super Admins. BPS only needs to be activated and set up on your Primary site to automatically add protection to all your subsites so DO NOT Network Activate BPS. BPS will not work correctly if you choose Network Activate. There is also no need to activate and set up BPS on any of your other sites. Once BPS is set up on your Primary site it protects all of your sites.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 800, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  824. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  825. <table width="100%" border="0">
  826. <tr>
  827. <td width="33%"><?php echo bps_multsite_check_smode_single(); ?></td>
  828. <td width="33%"><?php echo bps_multsite_check_smode_MUSDir(); ?></td>
  829. <td width="34%"><?php echo bps_multsite_check_smode_MUSDom(); ?></td>
  830. </tr>
  831. <tr>
  832. <td>
  833. <form name="bps-auto-write-default" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  834. <?php wp_nonce_field('bulletproof_security_auto_write_default'); ?>
  835. <input type="hidden" name="filename" value="bps-auto-write-default_write" />
  836. <p class="submit">
  837. <input type="submit" name="bps-auto-write-default" value="<?php _e('Create default.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized default.htaccess Master file for your website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nNOTE: Default Mode should ONLY be activated for Testing and Troubleshooting.\n\nClick OK to Create your new default.htaccess Master file or click Cancel.'); ?>')" />
  838. </p>
  839. </form>
  840. <form name="bps-auto-write-secure-root" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  841. <?php wp_nonce_field('bulletproof_security_auto_write_secure_root'); ?>
  842. <input type="hidden" name="filename" value="bps-auto-write-secure_write" />
  843. <p class="submit">
  844. <input type="submit" name="bps-auto-write-secure-root" value="<?php _e('Create secure.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized secure.htaccess Master file for your website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nClick OK to Create your new secure.htaccess Master file or click Cancel.'); ?>')" />
  845. </p>
  846. </form>
  847. </td>
  848. <td>
  849. <form name="bps-auto-write-default-MUSDir" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  850. <?php wp_nonce_field('bulletproof_security_auto_write_default_MUSDir'); ?>
  851. <input type="hidden" name="filename" value="bps-auto-write-default_write-MUSDir" />
  852. <p class="submit">
  853. <input type="submit" name="bps-auto-write-default-MUSDir" value="<?php _e('Create default.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized default.htaccess Master file for your Network / Multisite subdirectory website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nNOTE: Default Mode should ONLY be activated for Testing and Troubleshooting.\n\nClick OK to Create your new default.htaccess Master file or click Cancel.'); ?>')" />
  854. </p>
  855. </form>
  856. <form name="bps-auto-write-secure-root-MUSDir" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  857. <?php wp_nonce_field('bulletproof_security_auto_write_secure_root_MUSDir'); ?>
  858. <input type="hidden" name="filename" value="bps-auto-write-secure_write_MUSDir" />
  859. <p class="submit">
  860. <input type="submit" name="bps-auto-write-secure-root-MUSDir" value="<?php _e('Create secure.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized secure.htaccess Master file for your Network / Multisite subdirectory website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nClick OK to Create your new secure.htaccess Master file or click Cancel.'); ?>')" />
  861. </p>
  862. </form>
  863. </td>
  864. <td>
  865. <form name="bps-auto-write-default-MUSDom" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  866. <?php wp_nonce_field('bulletproof_security_auto_write_default_MUSDom'); ?>
  867. <input type="hidden" name="filename" value="bps-auto-write-default_write_MUSDom" />
  868. <p class="submit">
  869. <input type="submit" name="bps-auto-write-default-MUSDom" value="<?php _e('Create default.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized default.htaccess Master file for your Network / Multisite subdomain website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nNOTE: Default Mode should ONLY be activated for Testing and Troubleshooting.\n\nClick OK to Create your new default.htaccess Master file or click Cancel.'); ?>')" />
  870. </p>
  871. </form>
  872. <form name="bps-auto-write-secure-root-MUSDom" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  873. <?php wp_nonce_field('bulletproof_security_auto_write_secure_MUSDom'); ?>
  874. <input type="hidden" name="filename" value="bps-auto-write-secure_write_MUSDom" />
  875. <p class="submit">
  876. <input type="submit" name="bps-auto-write-secure-root-MUSDom" value="<?php _e('Create secure.htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Clicking OK will create a new customized secure.htaccess Master file for your Network / Multisite subdomain website.\n\nThis is only creating a Master file and NOT activating it. To activate Master files go to the Activate Security Modes section below.\n\nClick OK to Create your new secure.htaccess Master file or click Cancel.'); ?>')" />
  877. </p>
  878. </form>
  879. </td>
  880. </tr>
  881. </table>
  882. <?php } ?>
  883. </div>
  884. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  885. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  886. <tr>
  887. <td class="bps-table_title">&nbsp;</td>
  888. </tr>
  889. <tr>
  890. <td class="bps-table_cell_help">
  891. <h2><?php _e('Activate Security Modes'); ?></h2>
  892. <h3><?php _e('Activate Website Root Folder .htaccess Security Mode'); ?> <a href="#" onmouseover="Tip('<strong>Installing the BulletProof Security plugin does not activate any security modes.<br>If you activate BulletProof Mode for your Root folder you must also activate BulletProof Mode for your wp-admin folder.</strong><br>Perform a backup first before activating any BulletProof Security modes (backs up both currently active root and wp-admin htaccess files at the same time).<br><br><strong>What Is Going On here?</strong><br>When you use the AutoMagic buttons you are creating master .htaccess files for your website. Activating Default Mode or BulletProof Mode copies, renames and moves those master .htaccess files default.htaccess or secure.htaccess, depending on what radio button option you choose, from /plugins/bulletproof-security/admin/htaccess/ to your root folder. Default Mode does not have any security protection - it is just a standard generic WordPress .htaccess file that you should only use for testing purposes.<br><br><strong>If you are installing BPS for the first time - Help and FAQ links are available on the BPS Help and FAQ page</strong><br><br><strong>Info for people who are upgrading BPS</strong><br>Before upgrading or any time you add some additional custom code to your .htaccess files you can save that custom .htaccess code on the My Notes page. This code is saved permanently to your WP database until you edit or delete it. When you upgrade BPS your currently active root and wp-admin .htaccess files are not affected. BPS master .htaccess files are replaced when you upgrade BPS so if you have made changes to your BPS master files that you want to keep make sure they are backed up using Backup and Restore first before upgrading. You can also download copies of the BPS master files to your computer using the BPS File Downloader if you want. When you backup your BPS files this is an online backup so the files will be available to you to restore from if you run into any problems at any point. You should always be using the newest BPS master htaccess files for the latest security protection updates and plugin conflict fixes. Before activating new BPS master files you can use the BPS File Editor to copy and paste any existing htaccess code that you want to keep from your current active htaccess files to the new BPS master htaccess files and save your changes before activating your new BPS htaccess files. You can copy from one .htaccess file editing window to any other window and then save your changes. Or you can copy any new htaccess code from the new BPS master files to your existing currently active htaccess files. If you do this be sure to edit the BPS version number at the top of your currently active htaccess files or you will see BPS error messages. And the My Notes page allows you to save any code you want to save permanently for later use or reminders.<br><br><strong>Troubleshooting Error Messages</strong><br>Check the Edit/Upload/Download page to view your .htaccess files. Click on Your Current Root htaccess File menu tab to view your actual root .htaccess file. The top of the file tells you which BPS .htaccess file is activated and the BPS version. Check that BPS QUERY STRING EXPLOITS code does exist in your root .htaccess file. When you update your WordPress Permalinks the BPSQSE BPS QUERY STRING EXPLOITS code is overwritten with the WordPress standard default .htaccess code. You will either need to use Backup and Restore to restore you backed up .htaccess files or activate BulletProof Mode again for your Root Folder. To check your wp-admin .htaccess file click on the Your Current wp-admin htaccess File menu tab.<br><br><strong>Testing or Removing / Uninstalling BPS</strong><br>If you are testing BPS to determine if there is a plugin conflict or other conflict then Activate Default Mode and select the Delete wp-admin htaccess File radio button and click the Activate button or you can now just go to the WordPress Permalinks page and update / resave your permalinks. This overwrites all BPS security code with the standard default WP .htaccess code. This puts your site in a standard WordPress state with a default or generic Root .htaccess file and no .htaccess file in your wp-admin folder if you selected Delete wp-admin htaccess file. After testing or troubleshooting is completed reactivate BulletProof Modes for both the Root and wp-admin folders. If you are removing / uninstalling BPS then follow the same steps and then select Deactivate from the Wordpress Plugins page and then click Delete to uninstall the BPS plugin.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 800, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  893. <form name="BulletProof-Root" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  894. <?php wp_nonce_field('bulletproof_security_root_copy'); ?>
  895. <table class="form-table">
  896. <tr>
  897. <th><label><input name="selection12" type="radio" value="bpsecureroot" class="tog" <?php checked('', $bpsecureroot); ?> /> <?php _e('BulletProof Mode'); ?></label></th>
  898. <td class="url-path"><?php echo get_site_url(); ?>/.htaccess<br /><?php _e('<font color="green">Copies the file secure.htaccess to your root folder and renames the file name to just .htaccess</font>'); ?></td>
  899. </tr>
  900. <tr>
  901. <th><label><input name="selection12" type="radio" value="bpdefaultroot" class="tog" <?php checked('', $bpdefaultroot); ?> /><?php _e('<font color="red">Default Mode<br>WP Default htaccess File</font>'); ?></label></th>
  902. <td class="url-path"><?php echo get_site_url(); ?>/.htaccess<br /><?php _e('<font color="red"> CAUTION: </font>Your site will not be protected if you activate Default Mode. ONLY activate Default Mode for Testing and Troubleshooting.'); ?></td>
  903. </tr>
  904. </table>
  905. <p class="submit">
  906. <input type="submit" name="submit12" class="button" value="<?php esc_attr_e('Activate') ?>" />
  907. </p></form>
  908. <h3><?php _e('Activate Website wp-admin Folder .htaccess Security Mode'); ?> <a href="#" onmouseover="Tip('<strong>Installing the BulletProof Security plugin does not activate any security modes.<br>If you activate BulletProof Mode for your wp-admin folder you must also activate BulletProof Mode for your Root folder.</strong><br>Activating BulletProof Mode copies, renames and moves the master .htaccess file wpadmin-secure.htaccess from /plugins/bulletproof-security/admin/htaccess/ to your /wp-admin folder. If you customize or modify the master .htaccess files then be sure to make an online backup and also download backups of these master .htaccess files to your computer using the BPS File Downloader.<br><br>For more information click this Read Me button link to view the <strong>BulletProof Security Guide.</strong><br><br><strong>Testing or Removing / Uninstalling BPS</strong><br>If you are testing BPS to determine if there is a plugin conflict or other conflict then Activate Default Mode and select the Delete wp-admin htaccess File radio button and click the Activate button. This puts your site in a standard WordPress state with a default or generic Root .htaccess file and no .htaccess file in your wp-admin folder. After testing or troubleshooting is completed reactivate BulletProof Modes for both the Root and wp-admin folders. If you are removing / uninstalling BPS then follow the same steps and then select Deactivate from the Wordpress Plugins page and then click Delete to uninstall the BPS plugin.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  909. <form name="BulletProof-WPadmin" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  910. <?php wp_nonce_field('bulletproof_security_wpadmin_copy'); ?>
  911. <table class="form-table">
  912. <tr>
  913. <th><label><input name="selection13" type="radio" value="bpsecurewpadmin" class="tog" <?php checked('', $bpsecurewpadmin); ?> /> <?php _e('BulletProof Mode'); ?></label></th>
  914. <td class="url-path"><?php echo get_site_url(); ?>/wp-admin/.htaccess<br /><?php _e('<font color="green"> Copies the file wpadmin-secure.htaccess to your /wp-admin folder and renames the file name to just .htaccess</font>'); ?></td>
  915. </tr>
  916. <tr>
  917. <th><label><input name="selection13" type="radio" value="Removebpsecurewpadmin" class="tog" <?php checked('', $Removebpsecurewpadmin); ?> /> <?php _e('<font color="red">Delete wp-admin<br>htaccess File</font>'); ?></label></th>
  918. <td class="url-path"><?php echo get_site_url(); ?>/wp-admin/.htaccess<br /><?php _e('<font color="red"> CAUTION: </font>Deletes the .htaccess file in your /wp-admin folder. ONLY delete For testing or BPS removal.'); ?></td>
  919. </tr>
  920. </table>
  921. <p class="submit"><input type="submit" name="submit13" class="button" value="<?php esc_attr_e('Activate') ?>" />
  922. </p></form>
  923. <h3><?php _e('Activate Deny All htaccess Folder Protection For The BPS Master htaccess Folder'); ?> <a href="#" onmouseover="Tip('<strong>Your BPS Master htaccess folder should already be automatically protected by BPS Pro, but if it is not then activate BulletProof Mode for your BPS Master htaccess folder</strong><br><br>Activating BulletProof Mode for Deny All htaccess Folder Protection copies and renames the deny-all.htaccess file located in the /plugins/bulletproof-security/admin/htaccess/ folder and renames it to just .htaccess. The Deny All htaccess file blocks everyone, except for you, from accessing and viewing the BPS Master htaccess files.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  924. <form name="BulletProof-deny-all-htaccess" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  925. <?php wp_nonce_field('bulletproof_security_denyall_master'); ?>
  926. <table class="form-table">
  927. <tr>
  928. <th><label><input name="selection8" type="radio" value="bps_rename_htaccess_files" class="tog" <?php checked('', $bps_rename_htaccess_files); ?> /> <?php _e('BulletProof Mode'); ?></label></th>
  929. <td class="url-path"><?php echo get_site_url(); ?>/wp-content/plugins/bulletproof-security/admin/htaccess/<br /><?php _e('<font color="green"> Copies the file deny-all.htaccess to the BPS Master htaccess folder and renames the file name to just .htaccess</font>'); ?></td>
  930. </tr>
  931. </table>
  932. <p class="submit"><input type="submit" name="submit8" class="button" value="<?php esc_attr_e('Activate') ?>" />
  933. </p></form>
  934. <h3><?php _e('Activate Deny All htaccess Folder Protection For The BPS Backup Folder'); ?> <a href="#" onmouseover="Tip('<strong>Your BPS Backup Folder is NOT already automatically protected by BPS Pro and requires that you activate BulletProof Mode to htaccess protect it</strong><br><br>Activating BulletProof Mode for Deny All BPS Backup Folder Protection copies and renames the deny-all.htaccess file located in the /bulletproof-security/admin/htaccess/ folder to the BPS Backup folder /wp-content/bps-backup and renames it to just .htaccess. The Deny All htaccess file blocks everyone, except for you, from accessing and viewing your backed up htaccess files.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  935. <form name="BulletProof-deny-all-backup" action="admin.php?page=bulletproof-security/admin/options.php" method="post">
  936. <?php wp_nonce_field('bulletproof_security_denyall_bpsbackup'); ?>
  937. <table class="form-table">
  938. <tr>
  939. <th><label><input name="selection14" type="radio" value="bps_rename_htaccess_files_backup" class="tog" <?php checked('', $bps_rename_htaccess_files_backup); ?> /> <?php _e('BulletProof Mode'); ?></label></th>
  940. <td class="url-path"><?php echo get_site_url(); ?>/wp-content/bps-backup/<br /><?php _e('<font color="green"> Copies and the file deny-all.htaccess to the BPS Backup folder and renames the file name to just .htaccess</font>'); ?></td>
  941. </tr>
  942. </table>
  943. <p class="submit"><input type="submit" name="submit14" class="button" value="<?php esc_attr_e('Activate') ?>" />
  944. </p></form>
  945. </td>
  946. </tr>
  947. <tr>
  948. <td class="bps-table_cell_bottom">&nbsp;</td>
  949. </tr>
  950. </table>
  951. <?php } ?>
  952. </div>
  953. <div id="bps-tabs-2" class="bps-tab-page">
  954. <h2><?php _e('BulletProof Security Status'); ?></h2>
  955. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  956. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-status_table">
  957. <tr>
  958. <td width="49%" class="bps-table_title"><?php _e('Activated BulletProof Security .htaccess Files'); ?> <a href="#" onmouseover="Tip('<strong>Installing the BulletProof Security plugin does not activate any security modes.<br>If you activate BulletProof Mode for your Root folder you must also activate BulletProof Mode for your wp-admin folder.</strong><br>Perform a backup first before activating any BulletProof Security modes (backs up both currently active root and wp-admin htaccess files at the same time).<br><br><strong>If you are installing BPS for the first time - Help and FAQ links are available on the BPS Help and FAQ page</strong><br><br><strong>Info for people who are upgrading BPS</strong><br>Before upgrading or any time you add some additional custom code to your .htaccess files you can save that custom .htaccess code on the My Notes page. This code is saved permanently to your WP database until you edit or delete it. When you upgrade BPS your currently active root and wp-admin .htaccess files are not affected. BPS master .htaccess files are replaced when you upgrade BPS so if you have made changes to your BPS master files that you want to keep make sure they are backed up using Backup and Restore first before upgrading. You can also download copies of the BPS master files to your computer using the BPS File Downloader if you want. When you backup your BPS files this is an online backup so the files will be available to you to restore from if you run into any problems at any point. You should always be using the newest BPS master htaccess files for the latest security protection updates and plugin conflict fixes. Before activating new BPS master files you can use the BPS File Editor to copy and paste any existing htaccess code that you want to keep from your current active htaccess files to the new BPS master htaccess files and save your changes before activating your new BPS htaccess files. You can copy from one .htaccess file editing window to any other window and then save your changes. Or you can copy any new htaccess code from the new BPS master files to your existing currently active htaccess files. If you do this be sure to edit the BPS version number at the top of your currently active htaccess files or you will see BPS error messages. And the My Notes page allows you to save any code you want to save permanently for later use or reminders.<br><br><strong>Troubleshooting Error Messages</strong><br>Check the Edit/Upload/Download page to view your .htaccess files. Click on Your Current Root htaccess File menu tab to view your actual root .htaccess file. The top of the file tells you which BPS .htaccess file is activated and the BPS version. Check that BPS QUERY STRING EXPLOITS code does exist in your root .htaccess file. When you update your WordPress Permalinks the BPSQSE BPS QUERY STRING EXPLOITS code is overwritten with the WordPress standard default .htaccess code. You will either need to use Backup and Restore to restore you backed up .htaccess files or activate BulletProof Mode again for your Root Folder. To check your wp-admin .htaccess file click on the Your Current wp-admin htaccess File menu tab.<br><br><strong>Additional Info - Activated BulletProof Security Status window</strong><br>The Text Strings you see listed in the Activated BulletProof Security Status window if you have an active BulletProof .htaccess file (or an existing .htaccess file) is reading and displaying the actual contents of any existing .htaccess files here. <strong>This is not just a displayed message - this is the actual first 46 string characters (text) of the contents of your .htaccess files.</strong>The BPSQSE BPS QUERY STRING EXPLOITS code check is done by searching the root .htaccess file to verify that the string/text/word BPSQSE is in the file.<br><br>To change or modify the Text String that you see displayed here you would use the BPS built in Text Editor to change the actual text content of the BulletProof Security master .htaccess files. If the change the BULLETPROOF SECURITY title shown here then you must also change the coding contained in the /wp-content/plugins/bulletproof-security/includes/functions.php file to match your changes or you will get some error messages. The rest of the text content in the .htaccess files can be modified just like a normal post. Just this top line ot text in the .htaccess files contains version information that BPS checks to do verifications and other file checking. For detailed instructions on modifying what text is displayed here click this Read Me button link.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 800, PADDING, 8, ABOVE, true, FADEIN, 500, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></td>
  959. <td width="2%">&nbsp;</td>
  960. <td width="49%" class="bps-table_title"><?php _e('Additional Website Security Measures'); ?></td>
  961. </tr>
  962. <tr>
  963. <td class="bps-table_cell">&nbsp;</td>
  964. <td>&nbsp;</td>
  965. <td class="bps-table_cell">&nbsp;</td>
  966. </tr>
  967. <tr>
  968. <td class="bps-table_cell">
  969. <?php
  970. echo root_htaccess_status();
  971. echo denyall_htaccess_status_master();
  972. echo denyall_htaccess_status_backup();
  973. echo wpadmin_htaccess_status();
  974. ?>
  975. <td>&nbsp;</td>
  976. <td class="bps-table_cell">
  977. <?php
  978. echo bps_wpdb_errors_off();
  979. echo bps_wp_remove_version();
  980. echo check_admin_username();
  981. echo bps_filesmatch_check_readmehtml();
  982. echo bps_filesmatch_check_installphp();
  983. //echo bpsPro_sysinfo_message();
  984. ?>
  985. </tr>
  986. <tr>
  987. <td class="bps-table_cell">&nbsp;</td>
  988. <td>&nbsp;</td>
  989. <td class="bps-table_cell">&nbsp;</td>
  990. </tr>
  991. </table>
  992. <?php } ?>
  993. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  994. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-perms_table">
  995. <tr>
  996. <td colspan="4" class="bps-table_title"><?php _e('File and Folder Permissions - CGI or DSO'); ?> <a href="#" onmouseover="Tip('<strong>CGI And DSO File And Folder Permission Recommendations</strong><br>If your Server API (SAPI) is CGI you will see a table displayed with recommendations for file and folder permissions for CGI. If your SAPI is DSO / Apache mod_php you will see a table listing file and folder permission recommendations for DSO. If you Host is using CGI, but they do not allow you to set your folder permissions more restricive to 705 and file permissions more restrictive to 604 then most likely when you change your folder and file permissions they will automatically be changed back to 755 and 644 by your Host. CGI 705 folder permissions have been thoroughly tested with WordPress and no problems have been discovered with WP or with WP Plugins. Changing your folder permissions to 705 helps in protecting against Mass Host Code Injections. CGI 604 file permissions have been thoroughly tested with WordPress and no problems have been discovered with WP or with WP Plugins. Changing your file permissions to 604 helps in protecting your files from Mass Host Code Injections. CGI Mission Critical files should be set to 400 and 404 respectively.<br><br><strong>If you have BPS Pro installed then use F-Lock to Lock or Unlock your Mission Critical files. BPS Pro S-Monitor will automatically display warning messages if your files are unlocked.</strong><br><br><strong>The wp-content/bps-backup/ folder permission recommendation is 755 for CGI or DSO for compatibility reasons. The /bps-backup folder has a deny all .htaccess file in it so that it cannot be accessed by anyone other than you so the folder permissions for this folder are irrelevant.</strong><br><br>Your current file and folder permissions are shown below with suggested file and folder permission settings that you should use for the best website security and functionality.<br><br>I recommend using FileZilla to change your file and folder permissions. FileZilla is a free FTP software that makes changing your file and folder permissions very simple and easy as well as many other very nice FTP features. With FileZilla you can right mouse click on your files or folders and set the permissions with a Numeric value like 755, 644, etc. Takes the confusion out of which attributes to check or uncheck.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 600, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></td>
  997. <td width="2%">&nbsp;</td>
  998. <td width="49%" class="bps-table_title"><?php _e('General BulletProof Security File Checks'); ?> <a href="#" onmouseover="Tip('This is a quick visual check to verify that you have active .htaccess files in your root and /wp-admin folders and that all the required BPS files are in your BulletProof Security plugin folder. The BulletProof Security .htaccess master files (default.htaccess, secure.htaccess, wpadmin-secure.htaccess, maintenance.htaccess and bp-maintenance.php) are located in this folder /wp-content/plugins/bulletproof-security/admin/htaccess/<br><br>For new installations and upgrades of BulletProof Security you will see red warning messages. This is completely normal. These warnings are there to remind you to perform backups if they have not been performed yet. Also you may see warning messages if files do not exist yet.<br><br>You can also download backups of any existing .htaccess files using the BPS File Downloader.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></td>
  999. </tr>
  1000. <tr>
  1001. <td width="16%" class="bps-table_cell_perms_head_left"><?php _e('File Name -<br>Folder Name'); ?></td>
  1002. <td width="13%" class="bps-table_cell_perms_head_middle"><?php _e('File Path -<br>Folder Path'); ?></td>
  1003. <td width="10%" class="bps-table_cell_perms_head_middle"><?php _e('Recommended<br>Permissions'); ?></td>
  1004. <td width="10%" class="bps-table_cell_perms_head_right"><?php _e('Current<br>Permissions'); ?></td>
  1005. <td>&nbsp;</td>
  1006. <td rowspan="4" class="bps-table_cell_file_checks">
  1007. <?php echo general_bps_file_checks(); ?>
  1008. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-file_checks_bottom_table" style="margin-top:32px;">
  1009. <tr>
  1010. <td class="bps-file_checks_bottom_bps-table_cell">&nbsp;</td>
  1011. </tr>
  1012. </table>
  1013. </td>
  1014. </tr>
  1015. <tr>
  1016. <td height="100%" colspan="4" class="bps-table_cell_perms_blank">
  1017. <?php
  1018. $sapi_type = php_sapi_name();
  1019. if (substr($sapi_type, 0, 3) == 'cgi') {
  1020. _e('<div style=\'padding:5px 0px 5px 5px;border-bottom:1px solid black;\'><strong>CGI File and Folder Permissions / Recommendations</strong></div>');
  1021. bps_check_perms(".htaccess","../.htaccess","404");
  1022. bps_check_perms("wp-config.php","../wp-config.php","400");
  1023. bps_check_perms("index.php","../index.php","400");
  1024. bps_check_perms("wp-blog-header.php","../wp-blog-header.php","400");
  1025. bps_check_perms("root folder","../","705");
  1026. bps_check_perms("wp-admin/","../wp-admin","705");
  1027. bps_check_perms("wp-includes/","../wp-includes","705");
  1028. bps_check_perms("wp-content/","../wp-content","705");
  1029. bps_check_perms("wp-content/bps-backup/","../wp-content/bps-backup","755");
  1030. _e('<div style=\'padding-bottom:15px;\'></div>');
  1031. } else {
  1032. _e('<div style=\'padding:5px 0px 5px 5px;border-bottom:1px solid black;\'><strong>DSO File and Folder Permissions / Recommendations</strong></div>');
  1033. bps_check_perms(".htaccess","../.htaccess","644");
  1034. bps_check_perms("wp-config.php","../wp-config.php","644");
  1035. bps_check_perms("index.php","../index.php","644");
  1036. bps_check_perms("wp-blog-header.php","../wp-blog-header.php","644");
  1037. bps_check_perms("root folder","../","755");
  1038. bps_check_perms("wp-admin/","../wp-admin","755");
  1039. bps_check_perms("wp-includes/","../wp-includes","755");
  1040. bps_check_perms("wp-content/","../wp-content","755");
  1041. bps_check_perms("wp-content/bps-backup/","../wp-content/bps-backup","755");
  1042. _e('<div style=\'padding-bottom:15px;\'></div>');
  1043. }
  1044. ?>
  1045. </td>
  1046. <td>&nbsp;</td>
  1047. </tr>
  1048. <tr>
  1049. <td colspan="4">
  1050. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-file_checks_bottom_table_special">
  1051. <tr>
  1052. <td class="bps-file_checks_bottom_bps-table_cell">&nbsp;</td>
  1053. </tr>
  1054. </table>
  1055. </td>
  1056. <td>&nbsp;</td>
  1057. </tr>
  1058. </table>
  1059. <br />
  1060. <?php } ?>
  1061. </div>
  1062. <div id="bps-tabs-3">
  1063. <h2><?php _e('System Information'); ?></h2>
  1064. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  1065. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-system_info_table">
  1066. <tr>
  1067. <td width="49%" class="bps-table_title"><?php _e('Website / Server / IP Info'); ?></td>
  1068. <td width="2%">&nbsp;</td>
  1069. <td width="49%" class="bps-table_title"><?php _e('SQL Database / Permalink Structure / WP Installation Folder'); ?></td>
  1070. </tr>
  1071. <tr>
  1072. <td class="bps-table_cell">&nbsp;</td>
  1073. <td>&nbsp;</td>
  1074. <td class="bps-table_cell">&nbsp;</td>
  1075. </tr>
  1076. <tr>
  1077. <td class="bps-table_cell"><?php _e('Website Root Folder'); ?>: <strong><?php echo get_site_url(); ?></strong></td>
  1078. <td>&nbsp;</td>
  1079. <td rowspan="12" class="bps-table_cell">
  1080. <?php _e('MySQL Database Version'); ?>: <?php $sqlversion = $wpdb->get_var("SELECT VERSION() AS version"); ?><strong><?php echo $sqlversion; ?></strong><br />
  1081. <?php _e('MySQL Client Version'); ?>
  1082. : <strong><?php echo mysql_get_client_info(); ?></strong><br />
  1083. <?php _e('Database Host'); ?>
  1084. : <strong><?php echo DB_HOST; ?></strong>&nbsp;</strong><br />
  1085. <?php _e('Database Name'); ?>
  1086. : <strong><?php echo DB_NAME; ?></strong>&nbsp;</strong><br />
  1087. <?php _e('Database User'); ?>
  1088. : <strong><?php echo DB_USER; ?></strong><br />
  1089. <?php _e('SQL Mode'); ?>
  1090. :
  1091. <?php $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
  1092. if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
  1093. if (empty($sql_mode)) $sql_mode = __('Not Set');
  1094. else $sql_mode = __('Off'); ?> <strong><?php echo $sql_mode; ?></strong><br /><br />
  1095. <?php _e('WordPress Installation Folder'); ?>
  1096. : <strong><?php echo bps_wp_get_root_folder(); ?></strong><br />
  1097. <?php _e('WordPress Installation Type'); ?>
  1098. : <strong><?php echo bps_wp_get_root_folder_display_type(); ?></strong><br />
  1099. <?php _e('WP Permalink Structure'); ?>
  1100. : <strong><?php $permalink_structure = get_option('permalink_structure'); echo $permalink_structure; ?></strong><br />
  1101. <?php echo bps_check_permalinks(); ?><br />
  1102. <?php echo bps_check_php_version (); ?>
  1103. </td>
  1104. </tr>
  1105. <tr>
  1106. <td class="bps-table_cell"><?php _e('Document Root Path'); ?>: <strong><?php echo $_SERVER['DOCUMENT_ROOT']; ?></strong></td>
  1107. <td>&nbsp;</td>
  1108. </tr>
  1109. <tr>
  1110. <td class="bps-table_cell"><?php _e('WP ABSPATH'); ?>: <strong><?php echo ABSPATH; ?></strong></td>
  1111. <td>&nbsp;</td>
  1112. </tr>
  1113. <tr>
  1114. <td class="bps-table_cell"><?php _e('Parent Directory'); ?>: <strong><?php echo dirname(ABSPATH); ?></strong></td>
  1115. <td>&nbsp;</td>
  1116. </tr>
  1117. <tr>
  1118. <td class="bps-table_cell"><?php _e('Server / Website IP Address'); ?>: <strong><?php echo $_SERVER['SERVER_ADDR']; ?></strong></td>
  1119. <td>&nbsp;</td>
  1120. </tr>
  1121. <tr>
  1122. <td class="bps-table_cell"><?php _e('Host by Address'); ?>: <strong><?php echo gethostbyaddr($_SERVER['SERVER_ADDR']); ?></strong></td>
  1123. <td>&nbsp;</td>
  1124. </tr>
  1125. <tr>
  1126. <td class="bps-table_cell"><?php _e('Public IP / Your Computer IP Address'); ?>: <strong><?php echo $_SERVER['REMOTE_ADDR']; ?></strong></td>
  1127. <td>&nbsp;</td>
  1128. </tr>
  1129. <tr>
  1130. <td class="bps-table_cell"><?php _e('Server Type'); ?>: <strong><?php echo $_SERVER['SERVER_SOFTWARE']; ?></strong></td>
  1131. <td>&nbsp;</td>
  1132. </tr>
  1133. <tr>
  1134. <td class="bps-table_cell"><?php _e('Operating System'); ?>: <strong><?php echo PHP_OS; ?></strong></td>
  1135. <td>&nbsp;</td>
  1136. </tr>
  1137. <tr>
  1138. <td class="bps-table_cell"><?php _e('Server API'); ?>: <strong><?php $sapi_type = php_sapi_name();
  1139. if (substr($sapi_type, 0, 3) == 'cgi') {
  1140. _e($sapi_type.' - Your Host Server is using CGI.');
  1141. } else {
  1142. _e($sapi_type.' - Your Host Server is using DSO or another SAPI type.');
  1143. } ?></strong>
  1144. </td>
  1145. <td>&nbsp;</td>
  1146. </tr>
  1147. <tr>
  1148. <td class="bps-table_cell"><?php echo bps_multsite_check(); ?></td>
  1149. <td>&nbsp;</td>
  1150. </tr>
  1151. <tr>
  1152. <td class="bps-table_cell"><?php _e('Browser Compression Supported'); ?>: <strong><?php echo $_SERVER['HTTP_ACCEPT_ENCODING']; ?></strong></td>
  1153. <td>&nbsp;</td>
  1154. </tr>
  1155. <tr>
  1156. <td class="bps-table_cell">&nbsp;</td>
  1157. <td>&nbsp;</td>
  1158. <td class="bps-table_cell">&nbsp;</td>
  1159. </tr>
  1160. <tr>
  1161. <td class="bps-table_title"><?php _e('PHP Server / PHP.ini Info'); ?></td>
  1162. <td>&nbsp;</td>
  1163. <td class="bps-table_title"><?php _e('BPS Pro Security Modules Info'); ?></td>
  1164. </tr>
  1165. <tr>
  1166. <td class="bps-table_cell">&nbsp;</td>
  1167. <td>&nbsp;</td>
  1168. <td class="bps-table_cell">&nbsp;</td>
  1169. </tr>
  1170. <tr>
  1171. <td class="bps-table_cell"><?php _e('PHP Version'); ?>: <strong><?php echo PHP_VERSION; ?></strong></td>
  1172. <td>&nbsp;</td>
  1173. <td rowspan="18" class="bps-table_cell">
  1174. <?php // BPS Pro ONLY ?>
  1175. <?php //echo bpsPro_sysinfo_mod_checks_smon(); ?><br />
  1176. <?php //echo bpsPro_sysinfo_mod_checks_hud(); ?><br />
  1177. <?php //echo bpsPro_sysinfo_mod_checks_phpini(); ?><br />
  1178. <?php //echo bpsPro_sysinfo_mod_checks_elog(); ?><br />
  1179. </td>
  1180. </tr>
  1181. <tr>
  1182. <td class="bps-table_cell"><?php _e('PHP Memory Usage'); ?>: <strong><?php echo round(memory_get_usage() / 1024 / 1024, 2) . __(' MB'); ?></strong></td>
  1183. <td>&nbsp;</td>
  1184. </tr>
  1185. <tr>
  1186. <td class="bps-table_cell"><?php _e('PHP Memory Limit'); ?>: <?php if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
  1187. else $memory_limit = __('N/A'); ?><strong><?php echo $memory_limit; ?></strong></td>
  1188. <td>&nbsp;</td>
  1189. </tr>
  1190. <tr>
  1191. <td class="bps-table_cell"><?php _e('PHP Max Upload Size'); ?>: <?php if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
  1192. else $upload_max = __('N/A'); ?><strong><?php echo $upload_max; ?></strong></td>
  1193. <td>&nbsp;</td>
  1194. </tr>
  1195. <tr>
  1196. <td class="bps-table_cell"><?php _e('PHP Max Post Size'); ?>: <?php if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
  1197. else $post_max = __('N/A'); ?><strong><?php echo $post_max; ?></strong></td>
  1198. <td>&nbsp;</td>
  1199. </tr>
  1200. <tr>
  1201. <td class="bps-table_cell"><?php _e('PHP Safe Mode'); ?>: <?php if(ini_get('safe_mode')) $safe_mode = __('On');
  1202. else $safe_mode = __('Off'); ?><strong><?php echo $safe_mode; ?></strong></td>
  1203. <td>&nbsp;</td>
  1204. </tr>
  1205. <tr>
  1206. <td class="bps-table_cell"><?php _e('PHP Allow URL fopen'); ?>: <?php if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On');
  1207. else $allow_url_fopen = __('Off'); ?><strong><?php echo $allow_url_fopen; ?></strong></td>
  1208. <td>&nbsp;</td>
  1209. </tr>
  1210. <tr>
  1211. <td class="bps-table_cell"><?php _e('PHP Allow URL Include'); ?>: <?php if(ini_get('allow_url_include')) $allow_url_include = __('On');
  1212. else $allow_url_include = __('Off'); ?><strong><?php echo $allow_url_include; ?></strong></td>
  1213. <td>&nbsp;</td>
  1214. </tr>
  1215. <tr>
  1216. <td class="bps-table_cell"><?php _e('PHP Display Errors'); ?>: <?php if(ini_get('display_errors')) $display_errors = __('On');
  1217. else $display_errors = __('Off'); ?><strong><?php echo $display_errors; ?></strong></td>
  1218. <td>&nbsp;</td>
  1219. </tr>
  1220. <tr>
  1221. <td class="bps-table_cell"><?php _e('PHP Display Startup Errors'); ?>: <?php if(ini_get('display_startup_errors')) $display_startup_errors = __('On');
  1222. else $display_startup_errors = __('Off'); ?><strong><?php echo $display_startup_errors; ?></strong></td>
  1223. <td>&nbsp;</td>
  1224. </tr>
  1225. <tr>
  1226. <td class="bps-table_cell"><?php _e('PHP Expose PHP'); ?>: <?php if(ini_get('expose_php')) $expose_php = __('On');
  1227. else $expose_php = __('Off'); ?><strong><?php echo $expose_php; ?></strong></td>
  1228. <td>&nbsp;</td>
  1229. </tr>
  1230. <tr>
  1231. <td class="bps-table_cell"><?php _e('PHP Register Globals'); ?>: <?php if(ini_get('register_globals')) $register_globals = __('On');
  1232. else $register_globals = __('Off'); ?><strong><?php echo $register_globals; ?></strong></td>
  1233. <td>&nbsp;</td>
  1234. </tr>
  1235. <tr>
  1236. <td class="bps-table_cell"><?php _e('PHP Max Script Execution Time'); ?>: <?php if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
  1237. else $max_execute = __('N/A'); ?><strong><?php echo $max_execute; ?> Seconds</strong></td>
  1238. <td>&nbsp;</td>
  1239. </tr>
  1240. <tr>
  1241. <td class="bps-table_cell"><?php _e('PHP Magic Quotes GPC'); ?>: <?php if(ini_get('magic_quotes_gpc')) $magic_quotes_gpc = __('On');
  1242. else $magic_quotes_gpc = __('Off'); ?><strong><?php echo $magic_quotes_gpc; ?></strong></td>
  1243. <td>&nbsp;</td>
  1244. </tr>
  1245. <tr>
  1246. <td class="bps-table_cell"><?php _e('PHP open_basedir'); ?>: <?php if(ini_get('open_basedir')) $open_basedir = __('On');
  1247. else $open_basedir = __('Off'); ?><strong><?php echo $open_basedir; ?></strong></td>
  1248. <td>&nbsp;</td>
  1249. </tr>
  1250. <tr>
  1251. <td class="bps-table_cell"><?php _e('PHP XML Support'); ?>: <?php if (is_callable('xml_parser_create')) $xml = __('Yes');
  1252. else $xml = __('No'); ?><strong><?php echo $xml; ?></strong></td>
  1253. <td>&nbsp;</td>
  1254. </tr>
  1255. <tr>
  1256. <td class="bps-table_cell"><?php _e('PHP IPTC Support'); ?>: <?php if (is_callable('iptcparse')) $iptc = __('Yes');
  1257. else $iptc = __('No'); ?><strong><?php echo $iptc; ?></strong></td>
  1258. <td>&nbsp;</td>
  1259. </tr>
  1260. <tr>
  1261. <td class="bps-table_cell"><?php _e('PHP Exif Support'); ?>: <?php if (is_callable('exif_read_data')) $exif = __('Yes'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
  1262. else $exif = __('No'); ?><strong><?php echo $exif; ?></strong></td>
  1263. <td>&nbsp;</td>
  1264. </tr>
  1265. <tr>
  1266. <td class="bps-table_cell">&nbsp;</td>
  1267. <td>&nbsp;</td>
  1268. <td class="bps-table_cell">&nbsp;</td>
  1269. </tr>
  1270. <tr>
  1271. <td class="bps-table_cell_bottom">&nbsp;</td>
  1272. <td>&nbsp;</td>
  1273. <td class="bps-table_cell_bottom">&nbsp;</td>
  1274. </tr>
  1275. </table>
  1276. <br />
  1277. <?php } ?>
  1278. </div>
  1279. <div id="bps-tabs-4" class="bps-tab-page">
  1280. <h2><?php _e('BulletProof Security Backup &amp; Restore'); ?></h2>
  1281. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  1282. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  1283. <tr>
  1284. <td class="bps-table_title">&nbsp;</td>
  1285. </tr>
  1286. <tr>
  1287. <td class="bps-table_cell_help">
  1288. <h3><?php _e('Backup Your Currently Active .htaccess Files'); ?></h3>
  1289. <h3><?php _e('<font color="red"><strong>CAUTION: </strong></font>'); ?><a href="#" onmouseover="Tip('Back up your existing .htaccess files first before activating any BulletProof Security Modes in case of a problem when you first install and activate any BulletProof Security Modes. Once you have backed up your original existing .htaccess files you will see the status listed in the <strong>Current Backed Up .htaccess Files Status</strong> window below. <br><br><strong>Backup files are stored in this folder /wp-content/bps-backup.</strong><br><br>In cases where you install a plugin that writes to your htaccess files you will want to perform another backup of your htaccess files. Each time you perform a backup you are overwriting older backed up htaccess files. Backed up files are stored in the /wp-content/bps-folder.<br><br>You could also use the BPS File Downloader to download any existing .htaccess files, customized .htaccess files or other BPS files that you have personally customized or modified just for an additional local backup.<br><br><strong>The BPS Master .htaccess files are stored in your /plugins/bulletproof-security/admin/htaccess folder and can also be backed up to the /wp-content/bps-backup/master-backups folder.</strong><br>Backed up files are stored online so they will be available to you after upgrading to a newer version of BPS if you run into a problem. There is no Restore feature for the BPS Master files because you should be using the latest versions of the BPS master .htaccess files after you upgrade BPS. You can manually download the files from this folder /wp-content/bps-backup/master-backups using FTP or your web host file downloader.<br><br>When you upgrade BPS your current root and wp-admin htaccess files are not affected. BPS master htaccess files are replaced when you upgrade BPS so if you have made changes to your BPS master files that you want to keep make sure they are backed up first before upgrading. You can also download copies of the BPS master files to your computer using the BPS File Downloader if you want. When you backup your BPS files it is an online backup so the files will be available to you to restore from if you run into any problems at any point. You should always be using the newest BPS master htaccess files for the latest security protection updates and plugin conflict fixes. Before activating new BPS master files you can use the BPS File Editor to copy and paste any existing htaccess code that you want to keep from your current active htaccess files to the new BPS master htaccess files and save your changes before activating the new BPS htaccess files. Or you can copy any new htaccess code from the new BPS master files to your existing currently active htaccess files. If you do this be sure to edit the BPS version number in your currently active htaccess files or you will get error messages.<br><br><strong>If something goes wrong in the .htaccess file editing process or at any point you can restore your good .htaccess files with one click as long as you already backed them up.</strong><br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 550, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()"><strong>Read Me</strong></a></h3>
  1290. <form name="BulletProof-Backup" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-4" method="post">
  1291. <?php wp_nonce_field('bulletproof_security_backup_active_htaccess_files'); ?>
  1292. <table class="form-table">
  1293. <tr>
  1294. <th><label><input name="selection9" type="radio" value="backup_htaccess" class="tog" <?php echo checked('', $backup_htaccess); ?> />
  1295. <?php _e('Backup .htaccess Files'); ?></label></th>
  1296. <td><?php _e('<font color="green"><strong>Backs up your currently active .htaccess files in your root and /wp-admin folders.</strong></font><br><strong>Backup your htaccess files for first time installations of BPS or whenever new modifications have been made to your htaccess files. Read the <font color="red"><strong>CAUTION: </strong></font>Read Me ToolTip.</strong>'); ?></td>
  1297. <td>
  1298. </td>
  1299. </tr>
  1300. </table>
  1301. <p class="submit">
  1302. <input type="submit" name="submit9" class="button" value="<?php esc_attr_e('Backup Files') ?>" />
  1303. </p></form>
  1304. <h3><?php _e('Restore Your .htaccess Files From Backup'); ?><a href="#" onmouseover="Tip('Restores your backed up .htaccess files that you backed up. Your backed up .htaccess files were renamed to root.htaccess and wpadmin.htaccess and copied to the /wp-content/bps-backup folder. Restoring your backed up .htaccess files will rename them back to .htaccess and copy them back to your root and /wp-admin folders respectively.<br><br><strong>If you did not have any original .htaccess files to begin with and / or you did not back up any files then you will not have any backed up .htaccess files.</strong><br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 550, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()"><strong>Read Me</strong></a></h3>
  1305. <form name="BulletProof-Restore" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-4" method="post">
  1306. <?php wp_nonce_field('bulletproof_security_restore_active_htaccess_files'); ?>
  1307. <table class="form-table">
  1308. <tr>
  1309. <th><label><input name="selection10" type="radio" value="restore_htaccess" class="tog" <?php checked('', $restore_htaccess); ?> />
  1310. <?php _e('Restore .htaccess Files'); ?></label></th>
  1311. <td><?php _e('<font color="green"><strong>Restores your backed up .htaccess files to your root and /wp-admin folders.</strong></font><br><strong>Restore your backed up .htaccess files if you have any problems or for use between BPS ugrades.</strong>'); ?></td>
  1312. <td>
  1313. </td>
  1314. </tr>
  1315. </table>
  1316. <p class="submit">
  1317. <input type="submit" name="submit10" class="button" value="<?php esc_attr_e('Restore Files') ?>" />
  1318. </p></form>
  1319. <h3><?php _e('Backup Your BPS Master .htaccess Files'); ?><a href="#" onmouseover="Tip('The BPS Master .htaccess files are stored in your /plugins/bulletproof-security/admin/htaccess folder and can also be backed up using this Master Backup feature. The backed up BPS Master .htaccess files are copied to this folder /wp-content/bps-backup/master-backups folder. This way they will be available to you online after upgrading to a newer version of BPS. There is no Restore feature for the BPS Master files because you should be using the latest versions of the BPS master .htaccess files after you upgrade BPS. You can manually download the files from this folder /wp-content/bps-backup/master-backups using FTP or your web host file downloader.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()"><strong>Read Me</strong></a></h3>
  1320. <form name="BPS-Master-Htaccess-Backup" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-4" method="post">
  1321. <?php wp_nonce_field('bulletproof_security_backup_master_htaccess_files'); ?>
  1322. <table class="form-table">
  1323. <tr>
  1324. <th><label><input name="selection11" type="radio" value="backup_master_htaccess_files" class="tog" <?php checked('', $backup_master_htaccess_files); ?> />
  1325. <?php _e('Backup BPS Master .htaccess Files'); ?></label></th>
  1326. <td><?php _e('<font color="green"><strong>Backs up your BPS Master .htaccess files to the /wp-content/bps-backup/master-backups folder.</strong></font><br><strong>There is no Restore feature for the BPS Master .htaccess files because you should be using the latest most current BPS Master .htaccess security coding and plugin fixes included in the most current version of the BPS master .htacess files.</strong>'); ?></td>
  1327. <td>
  1328. </td>
  1329. </tr>
  1330. </table>
  1331. <p class="submit">
  1332. <input type="submit" name="submit11" class="button" value="<?php esc_attr_e('Backup Master Files') ?>" />
  1333. </p></form>
  1334. </td>
  1335. </tr>
  1336. <tr>
  1337. <td class="bps-table_cell_bottom">&nbsp;</td>
  1338. </tr>
  1339. </table>
  1340. <?php } ?>
  1341. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-backup_restore_table">
  1342. <tr>
  1343. <td class="bps-table_title"><?php _e('Current Backed Up .htaccess Files Status'); ?> <a href="#" onmouseover="Tip('General file checks to check which files have been backed up or not.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 400, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></td>
  1344. </tr>
  1345. <tr>
  1346. <td class="bps-table_cell">&nbsp;</td>
  1347. </tr>
  1348. <tr>
  1349. <td class="bps-table_cell"><strong><?php general_bps_file_checks_backup_restore(); ?></strong></td>
  1350. </tr>
  1351. <tr>
  1352. <td class="bps-table_cell">&nbsp;</td>
  1353. </tr>
  1354. <tr>
  1355. <td class="bps-table_cell"><?php echo backup_restore_checks(); ?></td>
  1356. </tr>
  1357. <tr>
  1358. <td class="bps-table_cell">&nbsp;</td>
  1359. </tr>
  1360. <tr>
  1361. <td class="bps-table_cell"><?php echo bps_master_file_backups(); ?></td>
  1362. </tr>
  1363. <tr>
  1364. <td class="bps-table_cell">&nbsp;</td>
  1365. </tr>
  1366. <tr>
  1367. <td class="bps-table_cell_bottom">&nbsp;</td>
  1368. </tr>
  1369. </table>
  1370. <br />
  1371. </div>
  1372. <div id="bps-tabs-5" class="bps-tab-page">
  1373. <table width="100%" border="0">
  1374. <tr>
  1375. <td width="33%"><h2><?php _e('BulletProof Security File Editing'); ?></h2></td>
  1376. <td width="21%"><h3><a href="#" onmouseover="Tip('<strong>Lock / Unlock .htaccess Files</strong><br>If your Server API is using CGI then you will see Lock and Unlock buttons to lock your Root .htaccess file with 404 Permissions and unlock your root .htaccess file with 644 Permissions. If your Server API is using CLI - DSO / Apache / mod_php then you will not see lock and unlock buttons. 644 Permissions are required to write to / edit the root .htaccess file. Once you are done editing your root .htaccess file use the lock button to lock it with 404 Permissions. 644 Permissions for DSO are considered secure for DSO because of the different way that file security is handled with DSO.<br><br>A help link is provided in the Help & FAQ page <strong>File Editing Within The Dashboard Help Info.</strong> File Editing is also demonstrated and explained in the B-Core htaccess Video Tutorial.<strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 600, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3></td>
  1377. <td width="19%" align="right">
  1378. <h3 style="margin-right:0px;"><a href="#" onmouseover="Tip('<strong>File Uploading</strong><br>The file upload location is preset to the /wp-content/plugins/bulletproof-security/admin/htaccess folder and the intended use is just for uploading the BPS Master files: secure.htaccess, default.htaccess, wpadmin-secure.htaccess, maintenance.htaccess, bp-maintenance.php, bps-maintenance-values.php, http_error_log.txt (BPS Pro only) or other files from your computer to the BPS Master htaccess folder.<br><br><strong>File Downloading</strong><br><strong>File Downloading is automatically not allowed. Folder permissions must be set to a minimum of 705 for the /htaccess and /bps-backup folders in order to open and download files.</strong><br>Click the Enable Master File Downloading button to enable file downloading. This will write your current IP address to the deny all htaccess file and allow ONLY you access to the /plugins/bulletproof-security/admin/htaccess folder to open and download files. To open and download your Backed up files click the Enable Backed Up File Downloading button. After clicking the Enable File Downloading buttons you can click the download buttons below to open or download files. If your IP address changes which it will do frequently then click the Enable File Downloading buttons again to write a new IP address to the deny all htaccess files.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 600, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  1379. </td>
  1380. <td width="27%" align="center"><h2><?php _e('Uploads - Downloads'); ?></h2></td>
  1381. </tr>
  1382. </table>
  1383. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  1384. <table width="100%" border="0">
  1385. <tr>
  1386. <td colspan="2">
  1387. <div id="bps_file_editor" class="bps_file_editor_update">
  1388. <?php
  1389. echo secure_htaccess_file_check();
  1390. echo default_htaccess_file_check();
  1391. echo maintenance_htaccess_file_check();
  1392. echo wpadmin_htaccess_file_check();
  1393. /*
  1394. $options = get_option('bulletproof_security_options_flock');
  1395. if ($options['bps_lock_root_htaccess'] == 'yes') {
  1396. _e('The ');
  1397. }
  1398. */
  1399. // Perform File Open and Write test first by appending a literal blank space
  1400. // or nothing at all to end of the htaccess files.
  1401. // If append write test is successful file is writable on submit
  1402. if (current_user_can('manage_options')) {
  1403. $secure_htaccess_file = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/secure.htaccess';
  1404. $write_test = "";
  1405. if (is_writable($secure_htaccess_file)) {
  1406. if (!$handle = fopen($secure_htaccess_file, 'a+b')) {
  1407. _e('<font color="red"><strong>Cannot open file' . "$secure_htaccess_file" . '</strong></font><br>');
  1408. exit;
  1409. }
  1410. if (fwrite($handle, $write_test) === FALSE) {
  1411. _e('<font color="red"><strong>Cannot write to file' . "$secure_htaccess_file" . '</strong></font><br>');
  1412. exit;
  1413. }
  1414. _e('<strong>File Open and Write test successful! The secure.htaccess file is writable.</strong><br>');
  1415. } else {
  1416. if (file_exists($secure_htaccess_file)) {
  1417. _e('<font color="blue"><strong>Cannot write to file: ' . "$secure_htaccess_file" . '</strong></font><br>');
  1418. }
  1419. }
  1420. }
  1421. if (isset($_POST['submit1']) && current_user_can('manage_options')) {
  1422. check_admin_referer( 'bulletproof_security_save_settings_1' );
  1423. $newcontent1 = stripslashes($_POST['newcontent1']);
  1424. if ( is_writable($secure_htaccess_file) ) {
  1425. $handle = fopen($secure_htaccess_file, 'w+b');
  1426. fwrite($handle, $newcontent1);
  1427. _e('<font color="green"><strong>Success! The secure.htaccess file has been updated.</strong></font><br>');
  1428. fclose($handle);
  1429. }
  1430. }
  1431. if (current_user_can('manage_options')) {
  1432. $default_htaccess_file = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/default.htaccess';
  1433. $write_test = "";
  1434. if (is_writable($default_htaccess_file)) {
  1435. if (!$handle = fopen($default_htaccess_file, 'a+b')) {
  1436. _e('<font color="red"><strong>Cannot open file' . "$default_htaccess_file" . '</strong></font><br>');
  1437. exit;
  1438. }
  1439. if (fwrite($handle, $write_test) === FALSE) {
  1440. _e('<font color="red"><strong>Cannot write to file' . "$default_htaccess_file" . '</strong></font><br>');
  1441. exit;
  1442. }
  1443. _e('<strong>File Open and Write test successful! The default.htaccess file is writable.</strong><br>');
  1444. } else {
  1445. if (file_exists($default_htaccess_file)) {
  1446. _e('<font color="blue"><strong>Cannot write to file: ' . "$default_htaccess_file" . '</strong></font><br>');
  1447. }
  1448. }
  1449. }
  1450. if (isset($_POST['submit2']) && current_user_can('manage_options')) {
  1451. check_admin_referer( 'bulletproof_security_save_settings_2' );
  1452. $newcontent2 = stripslashes($_POST['newcontent2']);
  1453. if ( is_writable($default_htaccess_file) ) {
  1454. $handle = fopen($default_htaccess_file, 'w+b');
  1455. fwrite($handle, $newcontent2);
  1456. _e('<font color="green"><strong>Success! The default.htaccess file has been updated.</strong></font><br>');
  1457. fclose($handle);
  1458. }
  1459. }
  1460. if (current_user_can('manage_options')) {
  1461. $maintenance_htaccess_file = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/maintenance.htaccess';
  1462. $write_test = "";
  1463. if (is_writable($maintenance_htaccess_file)) {
  1464. if (!$handle = fopen($maintenance_htaccess_file, 'a+b')) {
  1465. _e('<font color="red"><strong>Cannot open file' . "$maintenance_htaccess_file" . '</strong></font><br>');
  1466. exit;
  1467. }
  1468. if (fwrite($handle, $write_test) === FALSE) {
  1469. _e('<font color="red"><strong>Cannot write to file' . "$maintenance_htaccess_file" . '</strong></font><br>');
  1470. exit;
  1471. }
  1472. _e('<strong>File Open and Write test successful! The maintenance.htaccess file is writable.</strong><br>');
  1473. } else {
  1474. if (file_exists($maintenance_htaccess_file)) {
  1475. _e('<font color="blue"><strong>Cannot write to file: ' . "$maintenance_htaccess_file" . '</strong></font><br>');
  1476. }
  1477. }
  1478. }
  1479. if (isset($_POST['submit3']) && current_user_can('manage_options')) {
  1480. check_admin_referer( 'bulletproof_security_save_settings_3' );
  1481. $newcontent3 = stripslashes($_POST['newcontent3']);
  1482. if ( is_writable($maintenance_htaccess_file) ) {
  1483. $handle = fopen($maintenance_htaccess_file, 'w+b');
  1484. fwrite($handle, $newcontent3);
  1485. _e('<font color="green"><strong>Success! The maintenance.htaccess file has been updated.</strong></font><br>');
  1486. fclose($handle);
  1487. }
  1488. }
  1489. if (current_user_can('manage_options')) {
  1490. $wpadmin_htaccess_file = ABSPATH . 'wp-content/plugins/bulletproof-security/admin/htaccess/wpadmin-secure.htaccess';
  1491. $write_test = "";
  1492. if (is_writable($wpadmin_htaccess_file)) {
  1493. if (!$handle = fopen($wpadmin_htaccess_file, 'a+b')) {
  1494. _e('<font color="red"><strong>Cannot open file' . "$wpadmin_htaccess_file" . '</strong></font><br>');
  1495. exit;
  1496. }
  1497. if (fwrite($handle, $write_test) === FALSE) {
  1498. _e('<font color="red"><strong>Cannot write to file' . "$wpadmin_htaccess_file" . '</strong></font><br>');
  1499. exit;
  1500. }
  1501. _e('<strong>File Open and Write test successful! The wpadmin-secure.htaccess file is writable.</strong><br>');
  1502. } else {
  1503. if (file_exists($wpadmin_htaccess_file)) {
  1504. _e('<font color="blue"><strong>Cannot write to file: ' . "$wpadmin_htaccess_file" . '</strong></font><br>');
  1505. }
  1506. }
  1507. }
  1508. if (isset($_POST['submit4']) && current_user_can('manage_options')) {
  1509. check_admin_referer( 'bulletproof_security_save_settings_4' );
  1510. $newcontent4 = stripslashes($_POST['newcontent4']);
  1511. if ( is_writable($wpadmin_htaccess_file) ) {
  1512. $handle = fopen($wpadmin_htaccess_file, 'w+b');
  1513. fwrite($handle, $newcontent4);
  1514. _e('<font color="green"><strong>Success! The wpadmin-secure.htaccess file has been updated.</strong></font><br>');
  1515. fclose($handle);
  1516. }
  1517. }
  1518. if (current_user_can('manage_options')) {
  1519. $root_htaccess_file = ABSPATH . '.htaccess';
  1520. $write_test = "";
  1521. if (is_writable($root_htaccess_file)) {
  1522. if (!$handle = fopen($root_htaccess_file, 'a+b')) {
  1523. _e('<font color="black"><strong>Cannot open file' . "$root_htaccess_file" . '</strong></font><br>');
  1524. exit;
  1525. }
  1526. if (fwrite($handle, $write_test) === FALSE) {
  1527. _e('<font color="black"><strong>Cannot write to file' . "$root_htaccess_file" . '</strong></font><br>');
  1528. exit;
  1529. }
  1530. _e('<strong>File Open and Write test successful! Your currently active root .htaccess file is writable.</strong><br>');
  1531. } else {
  1532. if (file_exists($root_htaccess_file)) {
  1533. _e('<font color="blue"><strong>Your root .htaccess file is Locked with Read Only Permissions.<br>Use the Lock and Unlock buttons below to Lock or Unlock your root .htaccess file for editing.</strong></font><br>');
  1534. } else {
  1535. _e('<font color="black"><strong>Cannot write to file: ' . "$root_htaccess_file" . '</strong></font><br>');
  1536. }
  1537. }
  1538. }
  1539. if (isset($_POST['submit5']) && current_user_can('manage_options')) {
  1540. check_admin_referer( 'bulletproof_security_save_settings_5' );
  1541. $newcontent5 = stripslashes($_POST['newcontent5']);
  1542. if ( !is_writable($root_htaccess_file) ) {
  1543. _e('<font color="red"><strong>Error: Unable to write to the Root .htaccess file. If your Root .htaccess file is locked you must unlock first.</strong></font><br>');
  1544. }
  1545. if ( is_writable($root_htaccess_file) ) {
  1546. $handle = fopen($root_htaccess_file, 'w+b');
  1547. fwrite($handle, $newcontent5);
  1548. _e('<font color="green"><strong>Success! Your currently active root .htaccess file has been updated.</strong></font><br>');
  1549. fclose($handle);
  1550. }
  1551. }
  1552. if (current_user_can('manage_options')) {
  1553. $current_wpadmin_htaccess_file = ABSPATH . 'wp-admin/.htaccess';
  1554. $write_test = "";
  1555. if (is_writable($current_wpadmin_htaccess_file)) {
  1556. if (!$handle = fopen($current_wpadmin_htaccess_file, 'a+b')) {
  1557. _e('<font color="red"><strong>Cannot open file' . "$current_wpadmin_htaccess_file" . '</strong></font><br>');
  1558. exit;
  1559. }
  1560. if (fwrite($handle, $write_test) === FALSE) {
  1561. _e('<font color="red"><strong>Cannot write to file' . "$current_wpadmin_htaccess_file" . '</strong></font><br>');
  1562. exit;
  1563. }
  1564. _e('<strong>File Open and Write test successful! Your currently active wp-admin .htaccess file is writable.</strong><br>');
  1565. } else {
  1566. if (file_exists($current_wpadmin_htaccess_file)) {
  1567. _e('<font color="blue"><strong>Cannot write to file: ' . "$current_wpadmin_htaccess_file" . '</strong></font><br>');
  1568. }
  1569. }
  1570. }
  1571. if (isset($_POST['submit6']) && current_user_can('manage_options')) {
  1572. check_admin_referer( 'bulletproof_security_save_settings_6' );
  1573. $newcontent6 = stripslashes($_POST['newcontent6']);
  1574. if ( is_writable($current_wpadmin_htaccess_file) ) {
  1575. $handle = fopen($current_wpadmin_htaccess_file, 'w+b');
  1576. fwrite($handle, $newcontent6);
  1577. _e('<font color="green"><strong>Success! Your currently active wp-admin .htaccess file has been updated.</strong></font><br>');
  1578. fclose($handle);
  1579. }
  1580. }
  1581. // BPS Pro Only - Lock and Unlock Root .htaccess file
  1582. if (isset($_POST['submit-ProFlockLock']) && current_user_can('manage_options')) {
  1583. check_admin_referer( 'bulletproof_security_flock_lock' );
  1584. $bpsRootHtaccessOL = ABSPATH . '.htaccess';
  1585. if (file_exists($bpsRootHtaccessOL)) {
  1586. chmod($bpsRootHtaccessOL, 0404);
  1587. _e('<font color="blue"><strong><br>Your Root .htaccess file has been Locked.</strong></font><br>');
  1588. } else {
  1589. _e('<font color="red"><strong><br>Unable to Lock your Root .htaccess file.</strong></font><br>');
  1590. }
  1591. }
  1592. if (isset($_POST['submit-ProFlockUnLock']) && current_user_can('manage_options')) {
  1593. check_admin_referer( 'bulletproof_security_flock_unlock' );
  1594. $bpsRootHtaccessOL = ABSPATH . '.htaccess';
  1595. if (file_exists($bpsRootHtaccessOL)) {
  1596. chmod($bpsRootHtaccessOL, 0644);
  1597. _e('<font color="blue"><strong><br>Your Root .htaccess file has been Unlocked.</strong></font><br>');
  1598. } else {
  1599. _e('<font color="red"><strong><br>Unable to Unlock your Root .htaccess file.</strong></font><br>');
  1600. }
  1601. }
  1602. ?>
  1603. </div>
  1604. </td>
  1605. <td width="33%" align="center" valign="top">
  1606. <?php _e("<div class=\"bps-file_upload_title\"><strong>File Uploads<br></strong></div>"); ?>
  1607. <form name="BPS-upload" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post" enctype="multipart/form-data"><?php wp_nonce_field('bulletproof_security_upload'); ?>
  1608. <p class="submit">
  1609. <input id="bps_file_upload" name="bps_file_upload" type="file" />
  1610. </p>
  1611. <p class="submit" style="margin:-5px 0px 0px -12px;">
  1612. <input type="submit" name="submit-bps-upload" class="button" value="<?php esc_attr_e('Upload File') ?>" />
  1613. </p>
  1614. </form></td>
  1615. </tr>
  1616. <tr>
  1617. <td width="22%">
  1618. <?php // Detect the SAPI - display form submit button only if sapi is cgi
  1619. $sapi_type = php_sapi_name();
  1620. if (substr($sapi_type, 0, 3) == 'cgi') { ?>
  1621. <form name="bpsFlockLockForm" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1622. <?php wp_nonce_field('bulletproof_security_flock_lock'); ?>
  1623. <p class="submit">
  1624. <input type="submit" name="submit-ProFlockLock" value="<?php _e('Lock .htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Click OK to Lock your Root .htaccess file or click Cancel.\n\nNote: The File Open and Write Test window will still display the last status of the file as Unlocked until the next time you refresh your browser.'); ?>')" /></p>
  1625. </form>
  1626. <?php } else { echo ''; } ?>
  1627. </td>
  1628. <td width="45%">
  1629. <?php // Detect the SAPI - display form submit button only if sapi is cgi
  1630. $sapi_type = php_sapi_name();
  1631. if (substr($sapi_type, 0, 3) == 'cgi') { ?>
  1632. <form name="bpsFlockUnLockForm" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1633. <?php wp_nonce_field('bulletproof_security_flock_unlock'); ?>
  1634. <p class="submit">
  1635. <input type="submit" name="submit-ProFlockUnLock" value="<?php _e('Unlock .htaccess File'); ?>" class="button" onClick="return confirm('<?php _e('Click OK to Unlock your Root .htaccess file or click Cancel.\n\nNote: The File Open and Write Test window will still display the last status of the file as Locked until the next time you refresh your browser.'); ?>')" /></p>
  1636. </form>
  1637. <?php } else { echo ''; } ?>
  1638. </td>
  1639. <td>&nbsp;</td>
  1640. </tr>
  1641. <tr>
  1642. <td colspan="2">
  1643. <!-- jQuery UI File Editor Tab Menu -->
  1644. <div id="bps-edittabs" class="bps-edittabs-class">
  1645. <ul>
  1646. <li><a href="#bps-edittabs-1">secure.htaccess</a></li>
  1647. <li><a href="#bps-edittabs-2">default.htaccess</a></li>
  1648. <li><a href="#bps-edittabs-3">maintenance.htaccess</a></li>
  1649. <li><a href="#bps-edittabs-4">wpadmin-secure.htaccess</a></li>
  1650. <li><a href="#bps-edittabs-5">Your Current Root htaccess File</a></li>
  1651. <li><a href="#bps-edittabs-6">Your Current wp-admin htaccess File</a></li>
  1652. </ul>
  1653. <?php
  1654. $scrollto1 = isset($_REQUEST['scrollto1']) ? (int) $_REQUEST['scrollto1'] : 0;
  1655. $scrollto2 = isset($_REQUEST['scrollto2']) ? (int) $_REQUEST['scrollto2'] : 0;
  1656. $scrollto3 = isset($_REQUEST['scrollto3']) ? (int) $_REQUEST['scrollto3'] : 0;
  1657. $scrollto4 = isset($_REQUEST['scrollto4']) ? (int) $_REQUEST['scrollto4'] : 0;
  1658. $scrollto5 = isset($_REQUEST['scrollto5']) ? (int) $_REQUEST['scrollto5'] : 0;
  1659. $scrollto6 = isset($_REQUEST['scrollto6']) ? (int) $_REQUEST['scrollto6'] : 0;
  1660. ?>
  1661. <div id="bps-edittabs-1" class="bps-edittabs-page-class">
  1662. <form name="template1" id="template1" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1663. <?php wp_nonce_field('bulletproof_security_save_settings_1'); ?>
  1664. <div>
  1665. <textarea cols="115" rows="27" name="newcontent1" id="newcontent1" tabindex="1"><?php echo get_secure_htaccess(); ?></textarea>
  1666. <input type="hidden" name="action" value="update" />
  1667. <input type="hidden" name="filename" value="<?php echo esc_attr($secure_htaccess_file) ?>" />
  1668. <input type="hidden" name="scrollto1" id="scrollto1" value="<?php echo $scrollto1; ?>" />
  1669. <p class="submit">
  1670. <input type="submit" name="submit1" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1671. </div>
  1672. </form>
  1673. <script type="text/javascript">
  1674. /* <![CDATA[ */
  1675. jQuery(document).ready(function($){
  1676. $('#template1').submit(function(){ $('#scrollto1').val( $('#newcontent1').scrollTop() ); });
  1677. $('#newcontent1').scrollTop( $('#scrollto1').val() );
  1678. });
  1679. /* ]]> */
  1680. </script>
  1681. </div>
  1682. <div id="bps-edittabs-2" class="bps-edittabs-page-class">
  1683. <form name="template2" id="template2" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1684. <?php wp_nonce_field('bulletproof_security_save_settings_2'); ?>
  1685. <div>
  1686. <textarea cols="115" rows="27" name="newcontent2" id="newcontent2" tabindex="2"><?php echo get_default_htaccess(); ?></textarea>
  1687. <input type="hidden" name="action" value="update" />
  1688. <input type="hidden" name="filename" value="<?php echo esc_attr($default_htaccess_file) ?>" />
  1689. <input type="hidden" name="scrollto2" id="scrollto2" value="<?php echo $scrollto2; ?>" />
  1690. <p class="submit">
  1691. <input type="submit" name="submit2" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1692. </div>
  1693. </form>
  1694. <script type="text/javascript">
  1695. /* <![CDATA[ */
  1696. jQuery(document).ready(function($){
  1697. $('#template2').submit(function(){ $('#scrollto2').val( $('#newcontent2').scrollTop() ); });
  1698. $('#newcontent2').scrollTop( $('#scrollto2').val() );
  1699. });
  1700. /* ]]> */
  1701. </script>
  1702. </div>
  1703. <div id="bps-edittabs-3" class="bps-edittabs-page-class">
  1704. <form name="template3" id="template3" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1705. <?php wp_nonce_field('bulletproof_security_save_settings_3'); ?>
  1706. <div>
  1707. <textarea cols="115" rows="27" name="newcontent3" id="newcontent3" tabindex="3"><?php echo get_maintenance_htaccess(); ?></textarea>
  1708. <input type="hidden" name="action" value="update" />
  1709. <input type="hidden" name="filename" value="<?php echo esc_attr($maintenance_htaccess_file) ?>" />
  1710. <input type="hidden" name="scrollto3" id="scrollto3" value="<?php echo $scrollto3; ?>" />
  1711. <p class="submit">
  1712. <input type="submit" name="submit3" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1713. </div>
  1714. </form>
  1715. <script type="text/javascript">
  1716. /* <![CDATA[ */
  1717. jQuery(document).ready(function($){
  1718. $('#template3').submit(function(){ $('#scrollto3').val( $('#newcontent3').scrollTop() ); });
  1719. $('#newcontent3').scrollTop( $('#scrollto3').val() );
  1720. });
  1721. /* ]]> */
  1722. </script>
  1723. </div>
  1724. <div id="bps-edittabs-4" class="bps-edittabs-page-class">
  1725. <form name="template4" id="template4" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1726. <?php wp_nonce_field('bulletproof_security_save_settings_4'); ?>
  1727. <div>
  1728. <textarea cols="115" rows="27" name="newcontent4" id="newcontent4" tabindex="4"><?php echo get_wpadmin_htaccess(); ?></textarea>
  1729. <input type="hidden" name="action" value="update" />
  1730. <input type="hidden" name="filename" value="<?php echo esc_attr($wpadmin_htaccess_file) ?>" />
  1731. <input type="hidden" name="scrollto4" id="scrollto4" value="<?php echo $scrollto4; ?>" />
  1732. <p class="submit">
  1733. <input type="submit" name="submit4" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1734. </div>
  1735. </form>
  1736. <script type="text/javascript">
  1737. /* <![CDATA[ */
  1738. jQuery(document).ready(function($){
  1739. $('#template4').submit(function(){ $('#scrollto4').val( $('#newcontent4').scrollTop() ); });
  1740. $('#newcontent4').scrollTop( $('#scrollto4').val() );
  1741. });
  1742. /* ]]> */
  1743. </script>
  1744. </div>
  1745. <div id="bps-edittabs-5" class="bps-edittabs-page-class">
  1746. <form name="template5" id="template5" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1747. <?php wp_nonce_field('bulletproof_security_save_settings_5'); ?>
  1748. <div>
  1749. <textarea cols="115" rows="27" name="newcontent5" id="newcontent5" tabindex="5"><?php echo get_root_htaccess(); ?></textarea>
  1750. <input type="hidden" name="action" value="update" />
  1751. <input type="hidden" name="filename" value="<?php echo esc_attr($root_htaccess_file) ?>" />
  1752. <input type="hidden" name="scrollto5" id="scrollto5" value="<?php echo $scrollto5; ?>" />
  1753. <p class="submit">
  1754. <input type="submit" name="submit5" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1755. </div>
  1756. </form>
  1757. <script type="text/javascript">
  1758. /* <![CDATA[ */
  1759. jQuery(document).ready(function($){
  1760. $('#template5').submit(function(){ $('#scrollto5').val( $('#newcontent5').scrollTop() ); });
  1761. $('#newcontent5').scrollTop( $('#scrollto5').val() );
  1762. });
  1763. /* ]]> */
  1764. </script>
  1765. </div>
  1766. <div id="bps-edittabs-6" class="bps-edittabs-page-class">
  1767. <form name="template6" id="template6" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1768. <?php wp_nonce_field('bulletproof_security_save_settings_6'); ?>
  1769. <div>
  1770. <textarea cols="115" rows="27" name="newcontent6" id="newcontent6" tabindex="6"><?php echo get_current_wpadmin_htaccess_file(); ?></textarea>
  1771. <input type="hidden" name="action" value="update" />
  1772. <input type="hidden" name="filename" value="<?php echo esc_attr($current_wpadmin_htaccess_file) ?>" />
  1773. <input type="hidden" name="scrollto6" id="scrollto6" value="<?php echo $scrollto6; ?>" />
  1774. <p class="submit">
  1775. <input type="submit" name="submit6" class="button" value="<?php esc_attr_e('Update File') ?>" /></p>
  1776. </div>
  1777. </form>
  1778. <script type="text/javascript">
  1779. /* <![CDATA[ */
  1780. jQuery(document).ready(function($){
  1781. $('#template6').submit(function(){ $('#scrollto6').val( $('#newcontent6').scrollTop() ); });
  1782. $('#newcontent6').scrollTop( $('#scrollto6').val() );
  1783. });
  1784. /* ]]> */
  1785. </script>
  1786. </div>
  1787. </div></td>
  1788. <td align="center" valign="top">
  1789. <?php _e("<div class=\"bps-file_download_title\"><strong>File Downloads</strong></div>"); ?>
  1790. <form name="bps-enable-download" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1791. <?php wp_nonce_field('bulletproof_security_enable_download'); ?>
  1792. <input type="hidden" name="filename" value="bps-enable-download-edit" />
  1793. <p class="submit">
  1794. <input type="submit" name="bps-enable-download" class="button" value="<?php esc_attr_e('Enable Master File Downloading') ?>" /></p>
  1795. </form>
  1796. <div id="bps-enable_bu_file_dl_button">
  1797. <form name="bps-enable-download-backup" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-5" method="post">
  1798. <?php wp_nonce_field('bulletproof_security_enable_download-backup'); ?>
  1799. <input type="hidden" name="filename" value="bps-enable-download-edit-backup" />
  1800. <p class="submit">
  1801. <input type="submit" name="bps-enable-download-backup" class="button" value="<?php esc_attr_e('Enable Backed Up File Downloading') ?>" /></p>
  1802. </form>
  1803. </div>
  1804. <div id="bps-download_buttons_table">
  1805. <?php _e("<p class=\"bps-download_titles\">BPS Master Files</p>");
  1806. if (isset($_POST['bps-master-secure-download']) && current_user_can('manage_options')) {
  1807. check_admin_referer( 'bulletproof_security_download_secure' );
  1808. header('Content-Description: File Transfer');
  1809. header('Content-type: application/force-download');
  1810. header('Content-Disposition: attachment; filename="secure.htaccess"');
  1811. }
  1812. if (isset($_POST['bps-master-default-download']) && current_user_can('manage_options')) {
  1813. check_admin_referer( 'bulletproof_security_download_default' );
  1814. header("Content-Description: File Transfer");
  1815. header("Content-type: application/force-download");
  1816. header("Content-Disposition: attachment; filename=default.htaccess");
  1817. }
  1818. if (isset($_POST['bps-master-maintenance-download']) && current_user_can('manage_options')) {
  1819. check_admin_referer( 'bulletproof_security_download_maintenance' );
  1820. header("Content-Description: File Transfer");
  1821. header("Content-type: application/force-download");
  1822. header("Content-Disposition: attachment; filename=maintenance.htaccess");
  1823. }
  1824. if (isset($_POST['bps-master-wpadmin-secure-download']) && current_user_can('manage_options')) {
  1825. check_admin_referer( 'bulletproof_security_download_wpadmin-secure' );
  1826. header("Content-Description: File Transfer");
  1827. header("Content-type: application/force-download");
  1828. header("Content-Disposition: attachment; filename=wpadmin-secure.htaccess");
  1829. }
  1830. if (isset($_POST['bps-master-root-backup-htaccess-download']) && current_user_can('manage_options')) {
  1831. check_admin_referer( 'bulletproof_security_download_root-backup-htaccess' );
  1832. header("Content-Description: File Transfer");
  1833. header("Content-type: application/force-download");
  1834. header("Content-Disposition: attachment; filename=root.htaccess_backup");
  1835. }
  1836. if (isset($_POST['bps-master-wpadmin-backup-htaccess-download']) && current_user_can('manage_options')) {
  1837. check_admin_referer( 'bulletproof_security_download_wpadmin-backup-htaccess' );
  1838. header("Content-Description: File Transfer");
  1839. header("Content-type: application/force-download");
  1840. header("Content-Disposition: attachment; filename=wpadmin.htaccess_backup");
  1841. }
  1842. ?>
  1843. <form name="bps-master-secure-download" action="<?php echo get_site_url() .'/wp-content/plugins/bulletproof-security/admin/htaccess/secure.htaccess'; ?>" method="post">
  1844. <?php wp_nonce_field('bulletproof_security_download_secure'); ?>
  1845. <input type="submit" name="bps-master-secure-download" class="button" value="<?php esc_attr_e('secure.htaccess') ?>" onClick="return confirm('<?php _e('Click OK to Download the file now or click Cancel to cancel the download.'); ?>')" /></p>
  1846. </form>
  1847. <form name="bps-master-default-download" action="<?php echo get_site_url() .'/wp-content/plugins/bulletproof-security/admin/htaccess/default.htaccess'; ?>" method="post">
  1848. <?php wp_nonce_field('bulletproof_security_download_default'); ?>
  1849. <input type="hidden" name="filename" value="bps-default-download" />
  1850. <input type="submit" name="bps-master-default-download" class="button" value="<?php esc_attr_e('default.htaccess') ?>" /></p>
  1851. </form>
  1852. <form name="bps-master-maintenance-download" action="<?php echo get_site_url() .'/wp-content/plugins/bulletproof-security/admin/htaccess/maintenance.htaccess'; ?>" method="post">
  1853. <?php wp_nonce_field('bulletproof_security_download_maintenance'); ?>
  1854. <input type="hidden" name="filename" value="bps-maintenance-download" />
  1855. <input type="submit" name="bps-master-maintenance-download" class="button" value="<?php esc_attr_e('maintenance.htaccess') ?>" /></p>
  1856. </form>
  1857. <form name="bps-master-wpadmin-secure-download" action="<?php echo get_site_url() .'/wp-content/plugins/bulletproof-security/admin/htaccess/wpadmin-secure.htaccess'; ?>" method="post">
  1858. <?php wp_nonce_field('bulletproof_security_download_wpadmin-secure'); ?>
  1859. <input type="hidden" name="filename" value="bps-wpadmin-secure-download" />
  1860. <input type="submit" name="bps-master-wpadmin-secure-download" class="button" value="<?php esc_attr_e('wpadmin-secure.htaccess') ?>" /></p>
  1861. </form>
  1862. <?php _e("<p class=\"bps-download_titles\">Backed Up htaccess Files</p>"); ?>
  1863. <form name="bps-master-root-backup-htaccess-download" action="<?php echo get_site_url() . '/wp-content/bps-backup/root.htaccess'; ?>" method="post">
  1864. <?php wp_nonce_field('bulletproof_security_download_root-backup-htaccess'); ?>
  1865. <input type="hidden" name="filename" value="bps-root-backup-htaccess-download" />
  1866. <input type="submit" name="bps-master-root-backup-htaccess-download" class="button" value="<?php esc_attr_e('root.htaccess Backup File') ?>" /></p>
  1867. </form>
  1868. <form name="bps-master-wpadmin-backup-htaccess-download" action="<?php echo get_site_url() . '/wp-content/bps-backup/wpadmin.htaccess'; ?>" method="post">
  1869. <?php wp_nonce_field('bulletproof_security_download_wpadmin-backup-htaccess'); ?>
  1870. <input type="hidden" name="filename" value="bps-wpadmin-backup-htaccess-download" />
  1871. <input type="submit" name="bps-master-wpadmin-backup-htaccess-download" class="button" value="<?php esc_attr_e('wpadmin.htaccess Backup File') ?>" /></p>
  1872. </form>
  1873. </div> </td>
  1874. </tr>
  1875. </table>
  1876. <?php } ?>
  1877. </div>
  1878. <div id="bps-tabs-6" class="bps-tab-page">
  1879. <h2><?php _e('BulletProof Security Maintenance Mode'); ?></h2>
  1880. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  1881. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  1882. <tr>
  1883. <td class="bps-table_title">&nbsp;</td>
  1884. </tr>
  1885. <tr>
  1886. <td class="bps-table_cell_help">
  1887. <div id="bps-maintenance_form_table">
  1888. <h3><?php _e('Website Maintenance Mode Settings'); ?></h3>
  1889. <h3><?php _e('<font color="red"><strong>CAUTION: </strong></font>'); ?> <a href="#" onmouseover="Tip('<strong>Your Maintenance Mode Form data is saved to the WordPress Database and will remain permanently until you delete it. When you upgrade BPS your form data will still be saved in your database.</strong><br><br><strong>Maintenance Mode Activation Steps</strong><br><br><strong>Filling In The Maintenance Mode Settings Form</strong><br><strong>1. Fill out the Website Maintenance Mode Form</strong><br> -- For the Retry-After text field I recommend using 259200. 259200 is 72 hours in seconds. 3600 = 1hr 43200 = 12hrs 86400 = 24hrs<br> -- You can copy and paste the example Background Image URL into the Background Image text field if you want to use the background image file that comes with BPS. If you have another background image file that you want to use then just name it with the same name as the example image file and copy it to the /bulletproof-security folder. If you do not want a background image then leave this text field blank. The background color will be white. If you want to customize the Website Under Maintenance template then download this file located in this folder /bulletproof-security/admin/htaccess/bp-maintenance.php.<br> -- The javascript countdown timer has been removed. It was a silly and useless feature.<br><strong>2. Click the Save Form Settings button to save your form data to your database.</strong><br><strong>3. Click the Create Form button to create your Website Under Maintenance form.</strong><br><strong>4. Click the Preview Form button to preview your Website Under Maintenance page.</strong><br> -- If you see a 404 or 403 Forbidden message in the popup preview window refresh the popup preview window or just close the popup window and click the Preview button again.<br> -- You can use the Preview button at any time to preview how your site will be displayed to everyone else except you when your website is in Maintenance Mode.<br><br><strong>Create Your Maintenance Mode .htaccess File</strong><br>After you have finished previewing your Website Under Maintenance page, click the Create htaccess File button. This creates your Maintenance Mode .htaccess file for your website. Your current Public IP address and correct RewriteBase and RewriteRule are included when this new Maintenance Mode .htaccess file is created.<br><br><strong>Activate Website Under Maintenance Mode</strong><br>Select the Maintenance Mode radio button and click the Activate Maintenance Mode button. Your website is now in Maintenance Mode. Everyone else will see your Website Under Maintenance page while you can still view and work on your site as you normally would.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 600, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  1890. <form name="bps-maintenance-values" action="options.php" method="post">
  1891. <?php settings_fields('bulletproof_security_options_maint'); ?>
  1892. <?php $options = get_option('bulletproof_security_options_maint'); ?>
  1893. <table class="form-table">
  1894. <tr valign="top">
  1895. <th scope="row"><label for="bps-site-title"><?php _e('Site Title:') ?></label></th>
  1896. <td><input name="bulletproof_security_options_maint[bps-site-title]" type="text" value="<?php echo $options['bps-site-title']; ?>" class="regular-text" /><span class="description"><?php _e('Add Your Page Title') ?></span></td>
  1897. </tr>
  1898. <tr valign="top">
  1899. <th scope="row"><label for="bps-message-1"><?php _e('Message 1:') ?></label></th>
  1900. <td><input name="bulletproof_security_options_maint[bps-message-1]" type="text" value="<?php echo $options['bps-message-1']; ?>" class="regular-text" /><span class="description"><?php _e('Add Your Message') ?></span></td>
  1901. </tr>
  1902. <tr valign="top">
  1903. <th scope="row"><label for="bps-message-2"><?php _e('Message 2:') ?></label></th>
  1904. <td><input name="bulletproof_security_options_maint[bps-message-2]" type="text" value="<?php echo $options['bps-message-2']; ?>" class="regular-text" /><span class="description"><?php _e('Add Another Message or Not') ?></span></td>
  1905. </tr>
  1906. <tr valign="top">
  1907. <th scope="row"><label for="bps-retry-after"><?php _e('Retry-After:') ?></label></th>
  1908. <td><input name="bulletproof_security_options_maint[bps-retry-after]" type="text" value="<?php echo $options['bps-retry-after']; ?>" class="regular-text" /><span class="description"><?php _e('259200') ?></span></td>
  1909. </tr>
  1910. <tr valign="top">
  1911. <th scope="row"><label for="bps-background-image"><?php _e('Background Image') ?></label></th>
  1912. <td><input name="bulletproof_security_options_maint[bps-background-image]" type="text" value="<?php echo $options['bps-background-image']; ?>" class="regular-text" /><span class="description"><?php echo get_site_url(); ?>/wp-content/plugins/bulletproof-security/abstract-blue-bg.png</span></td>
  1913. </tr>
  1914. </table>
  1915. <p class="submit">
  1916. <input type="submit" name="bps-maintenance-values_submit" class="button" value="<?php esc_attr_e('Save Form Settings') ?>" />
  1917. </p>
  1918. </form>
  1919. <form name="bps-maintenance-create-values" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-6" method="post">
  1920. <?php wp_nonce_field('bulletproof_security_create_values_form'); ?>
  1921. <input type="hidden" name="mmfilename" value="bps-maintenance-create-valuesH" />
  1922. <p class="submit">
  1923. <input type="submit" name="bps-maintenance-create-values_submit" class="button" value="<?php esc_attr_e('Create Form') ?>" /></p>
  1924. </form>
  1925. <!-- this is the Enable Download form reused for maintenance mode Preview -->
  1926. <form name="bps-enable-download" method="POST" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-6" target="" onSubmit="window.open('<?php echo get_site_url(); ?>/wp-content/plugins/bulletproof-security/admin/htaccess/bp-maintenance.php','','scrollbars=yes,menubar=yes,width=800,height=600,resizable=yes,status=yes,toolbar=yes')">
  1927. <?php wp_nonce_field('bulletproof_security_enable_download'); ?>
  1928. <input type="hidden" name="filename" value="bps-enable-download-edit" />
  1929. <p class="submit">
  1930. <input type="submit" name="bps-enable-download" class="button" value="<?php esc_attr_e('Preview Form') ?>" /></p>
  1931. </form>
  1932. </div>
  1933. <h3><?php _e('Activate Website Under Maintenance Mode'); ?></h3>
  1934. <h3><?php _e('<font color="red"><strong>CAUTION: </strong></font>'); ?> <a href="#" onmouseover="Tip('<strong>You must click the Create htaccess File button FIRST to create your Maintenance Mode htaccess file before activating Maintenance Mode if you want to be able to continue working on your website while everyone else sees the Website Under Maintenance page</strong><br>After you have created your Maintenance Mode .htaccess file - Select the Maintenance Mode radio button and click Activate.<br><br><strong>To switch out of or exit Maintenance Mode just activate BulletProof Security Mode for your Root folder on the Security Modes page.</strong> You can see what everyone is seeing except for you by clicking on the Preview Form button at any time.<br><br>When you activate Maintenance Mode your website will be put in HTTP 503 Service Temporarily Unavailable status and display a Website Under Maintenance page to everyone except you. Your current Public IP address was automatically added to the Maintenance Mode file as well as the correct .htaccess RewriteRule and RewriteBase for your website when you clicked the Create File button.<br><br>To manually add additional IP addresses that are allowed to view your website normally use the BPS File Editor to add them. To view your current Public IP address click on the System Info tab menu.<br><br><strong>Your current Public IP address is also displayed on the Website Under Maintenance page itself.</strong><br><br>Your SERPs (website or web page ranking) will not be affected by putting your website in Maintenance Mode for several days for existing websites. To manually add additional IP addresses that can view your website you would add them using the BPS File Editor.<br><br>If you are unable to log back into your WordPress Dashboard and are also seeing the Website Under Maintenance page then you will need to FTP to your website and either delete the .htaccess file in your website root folder or download the .htaccess file - add your correct current Public IP address and upload it back to your website.<br><br><strong>BPS Pro Video Tutorial links can be found in the Help & FAQ pages.</strong>', WIDTH, 600, PADDING, 8, ABOVE, true, FADEIN, 400, FADEOUT, 300)" onmouseout="UnTip()">Read Me</a></h3>
  1935. <form name="bps-auto-write-maint" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-6" method="post">
  1936. <?php wp_nonce_field('bulletproof_security_auto_write_maint'); ?>
  1937. <input type="hidden" name="filename" value="bps-auto-write-maint_write" />
  1938. <p class="submit">
  1939. <input type="submit" name="bps-auto-write-maint" class="button" value="<?php esc_attr_e('Create htaccess File') ?>" /></p>
  1940. </form>
  1941. <form name="BulletProof-Maintenance" action="admin.php?page=bulletproof-security/admin/options.php#bps-tabs-6" method="post">
  1942. <?php wp_nonce_field('bulletproof_security_maintenance_copy'); ?>
  1943. <table class="form-table">
  1944. <tr>
  1945. <th><label><input name="selection15" type="radio" value="bpmaintenance" class="tog" <?php checked('', $bpmaintenance); ?> />
  1946. <?php _e('Maintenance Mode'); ?></label></th>
  1947. <td class="url-path"><?php _e('<font color="green">Click the Create htaccess File button first to create your Maintenance Mode .htaccess file. To switch out of or exit Maintenance Mode just activate BulletProof Security Mode for your Root Folder.</font><strong> Read the <font color="red">CAUTION:</font> Read Me ToolTip for more detailed information.</strong>'); ?></td>
  1948. </tr>
  1949. </table>
  1950. <p class="submit">
  1951. <input type="submit" name="submit15" class="button" value="<?php esc_attr_e('Activate Maintenance Mode') ?>" />
  1952. </p>
  1953. </form>
  1954. </td>
  1955. </tr>
  1956. <tr>
  1957. <td class="bps-table_cell_bottom">&nbsp;</td>
  1958. </tr>
  1959. </table>
  1960. <?php } ?>
  1961. </div>
  1962. <div id="bps-tabs-7">
  1963. <h2><?php _e('BulletProof Security Help &amp; FAQ'); ?></h2>
  1964. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  1965. <tr>
  1966. <td colspan="2" class="bps-table_title">&nbsp;</td>
  1967. </tr>
  1968. <tr>
  1969. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/category/bulletproof-security-contributors/" target="_blank"><?php _e('Contributors Page'); ?></a></td>
  1970. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/#root-or-subfolder-wordpress-installation" target="_blank"><?php _e('Website Domain Root Help Info'); ?></a></td>
  1971. </tr>
  1972. <tr>
  1973. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/331/bulletproof-security-plugin-support/bulletproof-security-donations-page/" target="_blank"><?php _e('BPS Donations'); ?></a></td>
  1974. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/#bps-backup-restore" target="_blank"><?php _e('Backup & Restore Help Info'); ?></a></td>
  1975. </tr>
  1976. <tr>
  1977. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/" target="_blank"><?php _e('BPS .46.4 Guide'); ?></a></td>
  1978. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2585/bulletproof-security-plugin-support/wordpress-website-maintenance-wordpress-maintenance-mode" target="_blank"><?php _e('Maintenance Mode Help Info'); ?></a></td>
  1979. </tr>
  1980. <tr>
  1981. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/#bps-45-new-features" target="_blank"><?php _e('BPS .46.4 Features'); ?></a></td>
  1982. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/#bps-advanced-coding-modfications" target="_blank"><?php _e('BPS .46.4 Coding Modifications Help Info'); ?></a></td>
  1983. </tr>
  1984. <tr>
  1985. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/319/bulletproof-security-plugin-support/bulletproof-security-comments-questions-problems-wishlist/" target="_blank"><?php _e('Post Questions and Comments for Assistance'); ?></a></td>
  1986. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1166/bulletproof-security-plugin-support/bulletproof-security-plugin-guide-bps-version-45/#modifying-htaccess-files" target="_blank"><?php _e('Modifying BPS .htaccess Files for WordPress Subfolders'); ?></a></td>
  1987. </tr>
  1988. <tr>
  1989. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/1183/bulletproof-security-plugin-support/bulletproof-security-plugin-bps-version-45-screenshots/" target="_blank"><?php _e('BPS .46.4 Screenshots'); ?></a></td>
  1990. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2185/bulletproof-security-plugin-support/bulletproof-security-file-editing-editing-files-within-the-wordpress-dashboard/" target="_blank"><?php _e('File Editing Within The Dashboard Help Info'); ?></a></td>
  1991. </tr>
  1992. <tr>
  1993. <td width="50%" class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2330/bulletproof-security-plugin-support/bps-future-features-that-will-be-included-in-future-releases-of-bps" target="_blank"><?php _e('BPS Future and Whats New From Previous Versions'); ?></a></td>
  1994. <td width="50%" class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2190/bulletproof-security-plugin-support/bulletproof-security-file-uploading-and-file-downloading-uploading-and-downloading-files-within-the-wordpress-dashboard/" target="_blank"><?php _e('File Uploading &amp; Downloading Within The Dashboard Help Info'); ?></a></td>
  1995. </tr>
  1996. <tr>
  1997. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2252/bulletproof-security-plugin-support/checking-plugin-compatibility-with-bps-plugin-testing-to-do-list/" target="_blank"><?php _e('Plugin Compatibility Testing - Recent New Permanent Fixes'); ?></a></td>
  1998. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2304/wordpress-tips-tricks-fixes/permalinks-wordpress-custom-permalinks-wordpress-best-wordpress-permalinks-structure/" target="_blank"><?php _e('WP Permalinks - Custom Permalink Structure Help Info'); ?></a></td>
  1999. </tr>
  2000. <tr>
  2001. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2566/bulletproof-security-plugin-support/bulletproof-security-error-messages" target="_blank"><?php _e('BulletProof Security Error, Warning and HUD Messages'); ?></a></td>
  2002. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2239/bulletproof-security-plugin-support/adding-a-custom-403-forbidden-page-htaccess-403-errordocument-directive-examples/" target="_blank"><?php _e('Adding a Custom 403 Forbidden Page For Your Website'); ?></a></td>
  2003. </tr>
  2004. <tr>
  2005. <td class="bps-table_cell_help">&nbsp;</td>
  2006. <td class="bps-table_cell_help">&nbsp;</td>
  2007. </tr>
  2008. <tr>
  2009. <td colspan="2" class="bps-table_cell_bottom">&nbsp;</td>
  2010. </tr>
  2011. </table>
  2012. </div>
  2013. <div id="bps-tabs-8">
  2014. <h2><?php _e('Whats New in'); ?><?php echo bpsWhatVersion(); ?></h2>
  2015. <h3><?php _e('The Whats New page will list new changes that were made in each new version release of BulletProof Security'); ?></h3>
  2016. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-whats_new_table">
  2017. <tr>
  2018. <td width="1%" class="bps-table_title_no_border">&nbsp;</td>
  2019. <td width="99%" class="bps-table_title_no_border">&nbsp;</td>
  2020. </tr>
  2021. <tr>
  2022. <td class="bps-table_cell_no_border">&nbsp;</td>
  2023. <td class="bps-table_cell_no_border">&nbsp;</td>
  2024. </tr>
  2025. <tr>
  2026. <td class="bps-table_cell_no_border">&bull;</td>
  2027. <td class="bps-table_cell_no_border"><strong><?php _e('<font color="red">Heads Up Security Warning!!!</font>'); ?></strong><br /><?php _e('BPS .46.6 is forbidding thumbnailer scripts by default. To allow thumbnailer scripts on your website see the root .htaccess file for instructions on allowing thumbnailer scripts on your website. If your Theme or any of your Plugins are using a Thumbnailer script such as TimThumb, phpThumb, Thumb or variations of these thumbnailer scripts then you should check (ask the author, creator or Google it) and make sure that you have a recently patched version of the thumbnailer script that you are using. A Zero Day Vulnerability exists in older versions of these thumbnailer scripts and your website might be vulnerable. Thumbnailer scripts are automatically seen by BPS as a threat, exploit or vulnerability because of the general nature of these scripts.'); ?></td>
  2028. </tr>
  2029. <tr>
  2030. <td class="bps-table_cell_no_border">&nbsp;</td>
  2031. <td class="bps-table_cell_no_border">&nbsp;</td>
  2032. </tr>
  2033. <tr>
  2034. <td class="bps-table_cell_no_border">&bull;</td>
  2035. <td class="bps-table_cell_no_border"><strong><?php _e('Cookie filter removed from BPS QUERY STRING EXPLOITS'); ?></strong><br /><?php _e('The Cookie String Exploit filter is problematic with plugins that are using PHP SESSION. This filter has been removed.'); ?></td>
  2036. </tr>
  2037. <tr>
  2038. <td class="bps-table_cell_no_border">&nbsp;</td>
  2039. <td class="bps-table_cell_no_border">&nbsp;</td>
  2040. </tr>
  2041. <tr>
  2042. <td class="bps-table_cell_no_border">&bull;</td>
  2043. <td class="bps-table_cell_no_border"><strong><?php _e('Explicit "exec" and "execute" filter removed from BPS QUERY STRING EXPLOITS'); ?></strong><br /><?php _e('The filtered words "exec" and "execute" have been removed as they are not necessary.'); ?></td>
  2044. </tr>
  2045. <tr>
  2046. <td class="bps-table_cell_no_border">&nbsp;</td>
  2047. <td class="bps-table_cell_no_border">&nbsp;</td>
  2048. </tr>
  2049. <tr>
  2050. <td class="bps-table_cell_no_border">&bull;</td>
  2051. <td class="bps-table_cell_no_border"><strong><?php _e('non-GPL Javascript Countdown Timer removed'); ?></strong><br /><?php _e('The Javascript Countdown Timer has been removed due to not being GPL compliant. This was a silly useless feature so no big loss.'); ?></td>
  2052. </tr>
  2053. <tr>
  2054. <td class="bps-table_cell_no_border">&nbsp;</td>
  2055. <td class="bps-table_cell_no_border">&nbsp;</td>
  2056. </tr>
  2057. <tr>
  2058. <td class="bps-table_cell_no_border">&bull;</td>
  2059. <td class="bps-table_cell_no_border"><strong><?php _e('BPS Pro 5.1 Officially Released'); ?></strong><br /><?php _e('At this point in the evolution of BPS Pro it is safe to say that BPS Pro 5.1 is by far the most comprehensive, effective and complete Website Security Solution for WordPress websites. The BPS Pro 5.1 .htaccess files contain a massive amount of new Security Exploits Filters to block browser based hacking attempts, the php.ini files contain optimum Security and Performance settings for maximum security and performance boosts for WordPress websites, file locking on the fly for WordPress Mission Critical files to protect against Mass Code Injection attacks on Web Hosts, PHP Error logging, automatic HTTP 400, 403 and 404 Error Logging to log and track hacking attempts against your website, built-in Monitoring and Alerting, extensive System Info and lots more. We are not stopping here – Lots More To Come!'); ?></td>
  2060. </tr>
  2061. <tr>
  2062. <td class="bps-table_cell_no_border">&nbsp;</td>
  2063. <td class="bps-table_cell_no_border">&nbsp;</td>
  2064. </tr>
  2065. <tr>
  2066. <td class="bps-table_cell_bottom_no_border">&nbsp;</td>
  2067. <td class="bps-table_cell_bottom_no_border">&nbsp;</td>
  2068. </tr>
  2069. </table>
  2070. </div>
  2071. <div id="bps-tabs-9" class="bps-tab-page">
  2072. <h2><?php _e('My Notes'); ?></h2>
  2073. <div id="bpsMyNotesborder" style="border-top:1px solid #999999;">
  2074. <h3><?php _e('Save any personal notes or htaccess code to your WordPress Database'); ?></h3>
  2075. </div>
  2076. <?php if (!current_user_can('manage_options')) { echo 'Permission Denied'; } else { ?>
  2077. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  2078. <tr>
  2079. <td class="bps-table_title">&nbsp;</td>
  2080. </tr>
  2081. <tr>
  2082. <td class="bps-table_cell_help">
  2083. <?php $scrolltoNotes = isset($_REQUEST['scrolltoNotes']) ? (int) $_REQUEST['scrolltoNotes'] : 0; ?>
  2084. <form name="myNotes" action="options.php" method="post">
  2085. <?php settings_fields('bulletproof_security_options_mynotes'); ?>
  2086. <?php $options = get_option('bulletproof_security_options_mynotes'); ?>
  2087. <div>
  2088. <textarea cols="130" rows="27" name="bulletproof_security_options_mynotes[bps_my_notes]" tabindex="1"><?php echo $options['bps_my_notes']; ?></textarea>
  2089. <input type="hidden" name="scrolltoNotes" value="<?php echo $scrolltoNotes; ?>" />
  2090. <p class="submit">
  2091. <input type="submit" name="myNotes_submit" class="button" value="<?php esc_attr_e('Save My Notes') ?>" /></p>
  2092. </div>
  2093. </form>
  2094. <script type="text/javascript">
  2095. /* <![CDATA[ */
  2096. jQuery(document).ready(function($){
  2097. $('#myNotes').submit(function(){ $('#scrolltoNotes').val( $('#bulletproof_security_options_mynotes[bps_my_notes]').scrollTop() ); });
  2098. $('#bulletproof_security_options_mynotes[bps_my_notes]').scrollTop( $('#scrolltoNotes').val() );
  2099. });
  2100. /* ]]> */
  2101. </script>
  2102. </td>
  2103. </tr>
  2104. <tr>
  2105. <td class="bps-table_cell_bottom">&nbsp;</td>
  2106. </tr>
  2107. </table>
  2108. <?php } ?>
  2109. </div>
  2110. <div id="bps-tabs-10">
  2111. <h2><?php _e('BulletProof Security Pro Feature Highlights'); ?></h2>
  2112. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="bps-help_faq_table">
  2113. <tr>
  2114. <td colspan="2" class="bps-table_title">&nbsp;</td>
  2115. </tr>
  2116. <tr>
  2117. <td width="62%" class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2835/bulletproof-security-pro/bulletproof-security-pro-features/" target="_blank" title="Link Opens in New Browser Window"><?php _e('BPS Pro Features'); ?></a></td>
  2118. <td width="38%" class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2841/bulletproof-security-pro/bulletproof-security-pro-overview-video-tutorial/" target="_blank" title="Link Opens in New Browser Window"><?php _e('BPS Pro Overview Video Tutorial'); ?></a></td>
  2119. </tr>
  2120. <tr>
  2121. <td class="bps-table_cell_help"><strong><?php _e('Custom php.ini File Creator, php.ini File Manager, php.ini Editor, Protected PHP Error Log, Secure phpinfo Viewer'); ?></strong></td>
  2122. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2849/bulletproof-security-pro/bulletproof-security-pro-b-core-htaccess-video-tutorial/" target="_blank" title="Link Opens in New Browser Window"><?php _e('B-Core htaccess Video Tutorial'); ?></a></td>
  2123. </tr>
  2124. <tr>
  2125. <td class="bps-table_cell_help"><strong><?php _e('Monitoring &amp; Alerting Options: WP Dashboard, BPS Pro pages only, Turned off, PHP Error Email Alerts'); ?></strong></td>
  2126. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2851/bulletproof-security-pro/bulletproof-security-pro-p-security-php-ini-video-tutorial/" target="_blank" title="Link Opens in New Browser Window"><?php _e('P-Security Video Tutorial'); ?></a></td>
  2127. </tr>
  2128. <tr>
  2129. <td class="bps-table_cell_help"><strong><?php _e('Base64 Decoder/Encoder, Mcrypt Decrypt/Encrypt, Crypt Encryption'); ?></strong></td>
  2130. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2847/bulletproof-security-pro/bulletproof-security-pro-s-monitor-video-tutorial/" target="_blank" title="Link Opens in New Browser Window"><?php _e('S-Monitor Video Tutorial'); ?></a></td>
  2131. </tr>
  2132. <tr>
  2133. <td class="bps-table_cell_help"><strong><?php _e('File String Finder, Replacer, Remover: Search all files for text, code, etc.'); ?></strong></td>
  2134. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2855/bulletproof-security-pro/bulletproof-security-pro-pro-tools-video-tutorial/" target="_blank" title="Link Opens in New Browser Window"><?php _e('Pro-Tools Video Tutorial'); ?></a></td>
  2135. </tr>
  2136. <tr>
  2137. <td class="bps-table_cell_help"><strong><?php _e('Database String Finder: Search entire Database for text, code, etc.'); ?></strong></td>
  2138. <td class="bps-table_cell_help"><a href="http://www.ait-pro.com/aitpro-blog/2837/bulletproof-security-pro/bulletproof-security-pro-screenshots/" target="_blank" title="Link Opens in New Browser Window"><?php _e('BPS Pro Screenshots'); ?></a> </td>
  2139. </tr>
  2140. <tr>
  2141. <td class="bps-table_cell_help"><strong><?php _e('HTTP Error Logging / 400, 403 and 404 Error Logging - Log hacking attempts against your website. When a hacker attempts to hack your website the hackers IP address, Host name, Request Method, Referering link, the file name or requested resource, the user agent of the hacker and the query string used in the hack attempt are logged. And if you feel like collecting hackers scripts then just follow the hackers links back to their personal sites or their Botnet sites.'); ?></strong></td>
  2142. <td class="bps-table_cell_help">&nbsp;</td>
  2143. </tr>
  2144. <tr>
  2145. <td class="bps-table_cell_help">&nbsp;</td>
  2146. <td class="bps-table_cell_help">&nbsp;</td>
  2147. </tr>
  2148. <tr>
  2149. <td colspan="2" class="bps-table_cell_bottom">&nbsp;</td>
  2150. </tr>
  2151. </table>
  2152. </div>
  2153. <div id="AITpro-link">BulletProof Security Plugin by <a href="http://www.ait-pro.com/" target="_blank" title="AITpro Website Design">AITpro Website Design</a>
  2154. </div>
  2155. </div>
  2156. <!-- this script needs to be on the options.php page - will not register or enqueue correctly due to tt_aElt.0.style issue -->
  2157. <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/bulletproof-security/admin/js/wz_tooltip.js"></script>
  2158. </div>