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

/views/icwp_wpsf_index.php

https://github.com/stackgrinder/wp-simple-firewall
PHP | 311 lines | 293 code | 18 blank | 0 comment | 52 complexity | dfba0701faaa7eded55f80eb3ded9241 MD5 | raw file
  1. <?php
  2. include_once( 'icwp_wpsf_config_header.php' );
  3. ?>
  4. <div class="wrap">
  5. <div class="bootstrap-wpadmin">
  6. <?php echo printOptionsPageHeader( 'Dashboard' ); ?>
  7. <?php if ( $icwp_fShowAds ) : ?>
  8. <div class="row" id="worpit_promo">
  9. <div class="span12">
  10. <?php echo getWidgetIframeHtml( 'dashboard-widget-worpit-wtb' ); ?>
  11. </div>
  12. </div><!-- / row -->
  13. <?php endif; ?>
  14. <div class="row">
  15. <div class="<?php echo $icwp_fShowAds? 'span9' : 'span12'; ?>">
  16. <?php include_once( dirname(__FILE__).'/icwp_wpsf_state_summary.php' ); ?>
  17. <form action="<?php echo $icwp_form_action; ?>" method="post" class="form-horizontal">
  18. <?php
  19. wp_nonce_field( $icwp_nonce_field );
  20. printAllPluginOptionsForm( $icwp_aAllOptions, $icwp_var_prefix, 1 );
  21. ?>
  22. <div class="form-actions">
  23. <input type="hidden" name="<?php echo $icwp_var_prefix; ?>all_options_input" value="<?php echo $icwp_all_options_input; ?>" />
  24. <input type="hidden" name="icwp_plugin_form_submit" value="Y" />
  25. <button type="submit" class="btn btn-primary" name="submit"><?php _wpsf_e( 'Save All Settings' ); ?></button>
  26. </div>
  27. </form>
  28. </div><!-- / span9 -->
  29. <?php if ( $icwp_fShowAds ) : ?>
  30. <div class="span3" id="side_widgets">
  31. <?php echo getWidgetIframeHtml('side-widgets-wtb'); ?>
  32. </div>
  33. <?php endif; ?>
  34. </div><!-- / row -->
  35. <?php include_once( dirname(__FILE__).'/widgets/icwp_common_widgets.php' ); ?>
  36. <?php if ( $icwp_fShowAds ) : ?>
  37. <div class="row" id="developer_channel_promo">
  38. <div class="span12">
  39. <?php echo getWidgetIframeHtml('dashboard-widget-developerchannel-wtb'); ?>
  40. </div>
  41. </div><!-- / row -->
  42. <?php endif; ?>
  43. <div class="row" id="tbs_docs">
  44. <h2><?php _wpsf_e( 'Plugin Configuration Summary'); ?></h2>
  45. <div class="span6" id="tbs_docs_shortcodes">
  46. <div class="well">
  47. <h4 style="margin-top:20px;">
  48. <?php printf( _wpsf__('Firewall is %s'), $fFirewallOn ? $sOn : $sOff ); ?>
  49. [ <a href="admin.php?page=icwp-wpsf-firewall"><?php _wpsf_e('Configure Now'); ?></a> ]</h4>
  50. <?php if ( $fFirewallOn ) : ?>
  51. <ul>
  52. <li><?php printf( _wpsf__('Firewall logging is %s'), ($icwp_aFirewallOptions['enable_firewall_log'] == 'Y') ? $sOn : $sOff ); ?></li>
  53. <li><?php _wpsf_e( 'When the firewall blocks a visit, it will:'); ?>
  54. <?php
  55. if( $icwp_aFirewallOptions['block_response'] == 'redirect_die' ) {
  56. _wpsf_e( 'Die' );
  57. }
  58. else if ( $icwp_aFirewallOptions['block_response'] == 'redirect_die_message' ) {
  59. _wpsf_e( 'Die with a message' );
  60. }
  61. else if ( $icwp_aFirewallOptions['block_response'] == 'redirect_home' ) {
  62. _wpsf_e( 'Redirect to home page' );
  63. }
  64. else if ( $icwp_aFirewallOptions['block_response'] == 'redirect_404' ) {
  65. _wpsf_e( 'Redirect to 404 page' );
  66. }
  67. else {
  68. _wpsf_e( 'Unknown' );
  69. }
  70. ?>
  71. </li>
  72. <?php if ( isset($icwp_aFirewallOptions['ips_whitelist']['ips']) ) : ?>
  73. <li>
  74. <?php printf( _wpsf__('You have %s whitelisted IP addresses'), count( $icwp_aFirewallOptions['ips_whitelist']['ips'] ) ); ?>
  75. <?php foreach( $icwp_aFirewallOptions['ips_whitelist']['ips'] as $sIp ) : ?>
  76. <br />
  77. <?php printf( _wpsf__('%s labelled as %s'), long2ip($sIp), $icwp_aFirewallOptions['ips_whitelist']['meta'][md5( $sIp )] ); ?>
  78. <?php endforeach; ?>
  79. </li>
  80. <?php endif; ?>
  81. <?php if ( isset($icwp_aFirewallOptions['ips_blacklist']['ips']) ) : ?>
  82. <li>
  83. <?php printf( _wpsf__('You have %s blacklisted IP addresses'), count( $icwp_aFirewallOptions['ips_blacklist']['ips'] ) ); ?>
  84. <?php foreach( $icwp_aFirewallOptions['ips_blacklist']['ips'] as $sIp ) : ?>
  85. <br />
  86. <?php printf( _wpsf__('%s labelled as %s'), long2ip($sIp), $icwp_aFirewallOptions['ips_blacklist']['meta'][md5( $sIp )] ); ?>
  87. <?php endforeach; ?>
  88. </li>
  89. <?php endif; ?>
  90. <li><?php printf( _wpsf__('Firewall blocks Directory Traversals: %s'), ($icwp_aFirewallOptions['block_dir_traversal'] == 'Y')? $sOn : $sOff ); ?></li>
  91. <li><?php printf( _wpsf__('Firewall blocks SQL Queries: %s'), ($icwp_aFirewallOptions['block_sql_queries'] == 'Y')? $sOn : $sOff ); ?></li>
  92. <li><?php printf( _wpsf__('Firewall blocks WordPress Specific Terms: %s'), ($icwp_aFirewallOptions['block_wordpress_terms'] == 'Y')? $sOn : $sOff ); ?></li>
  93. <li><?php printf( _wpsf__('Firewall blocks Field Truncation Attacks: %s'), ($icwp_aFirewallOptions['block_field_truncation'] == 'Y')? $sOn : $sOff ); ?></li>
  94. <li><?php printf( _wpsf__('Firewall blocks Directory Traversals: %s'), ($icwp_aFirewallOptions['block_dir_traversal'] == 'Y')? $sOn : $sOff ); ?></li>
  95. <li><?php printf( _wpsf__('Firewall blocks Executable File Uploads: %s'), ($icwp_aFirewallOptions['block_exe_file_uploads'] == 'Y')? $sOn : $sOff ); ?></li>
  96. <li><?php printf( _wpsf__('Firewall blocks Leading Schemas (HTTPS / HTTP): %s'), ($icwp_aFirewallOptions['block_leading_schema'] == 'Y')? $sOn : $sOff ); ?></li>
  97. <li><?php printf( _wpsf__('Firewall Logging is %s'), ($icwp_aFirewallOptions['enable_firewall_log'] == 'Y')? $sOn : $sOff ); ?></li>
  98. </ul>
  99. <?php endif; ?>
  100. <hr/>
  101. <h4 style="margin-top:20px;">
  102. <?php printf( _wpsf__('Login Protection is %s'), $fLoginProtectOn ? $sOn : $sOff ); ?>
  103. [ <a href="admin.php?page=icwp-wpsf-login_protect"><?php _wpsf_e('Configure Now'); ?></a> ]</h4>
  104. <?php if ( $fLoginProtectOn ) : ?>
  105. <ul>
  106. <?php if ( isset($icwp_aLoginProtectOptions['ips_whitelist']['ips']) ) : ?>
  107. <li>
  108. <?php printf( _wpsf__('You have %s whitelisted IP addresses'), count( $icwp_aLoginProtectOptions['ips_whitelist']['ips'] ) ); ?>
  109. <?php foreach( $icwp_aLoginProtectOptions['ips_whitelist']['ips'] as $sIp ) : ?>
  110. <br />
  111. <?php printf( _wpsf__('%s labelled as %s'), long2ip($sIp), $icwp_aLoginProtectOptions['ips_whitelist']['meta'][md5( $sIp )] ); ?>
  112. <?php endforeach; ?>
  113. </li>
  114. <?php endif; ?>
  115. <li><?php printf( _wpsf__('Two Factor Login Authentication: %s'), ($icwp_aLoginProtectOptions['enable_two_factor_auth_by_ip'] == 'Y')? $sOn : $sOff ); ?></li>
  116. <li><?php printf( _wpsf__('Two Factor Login By Pass: %s'), ($icwp_aLoginProtectOptions['enable_two_factor_bypass_on_email_fail'] == 'Y')? $sOn : $sOff ); ?></li>
  117. <li><?php printf( _wpsf__('Login Cooldown Interval: %s'), ($icwp_aLoginProtectOptions['login_limit_interval'] == '0')? $sOff : sprintf( _wpsf__('%s seconds'), $icwp_aLoginProtectOptions['login_limit_interval'] ) ); ?></li>
  118. <li><?php printf( _wpsf__('Login Form GASP Protection: %s'), ($icwp_aLoginProtectOptions['enable_login_gasp_check'] == 'Y')? $sOn : $sOff ); ?></li>
  119. <li><?php printf( _wpsf__('Login Protect Logging: %s'), ($icwp_aLoginProtectOptions['enable_login_protect_log'] == 'Y')? $sOn : $sOff ); ?></li>
  120. </ul>
  121. <?php endif; ?>
  122. <hr/>
  123. <h4 style="margin-top:20px;">
  124. <?php printf( _wpsf__('Comments Filtering is %s'), $fCommentsFilteringOn ? $sOn : $sOff ); ?>
  125. [ <a href="admin.php?page=icwp-wpsf-comments_filter"><?php _wpsf_e('Configure Now'); ?></a> ]</h4>
  126. <?php if ( $fCommentsFilteringOn ) : ?>
  127. <ul>
  128. <li><?php printf( _wpsf__('Enchanced GASP Protection: %s'), ($icwp_aCommentsFilterOptions['enable_comments_gasp_protection'] == 'Y')? $sOn : $sOff ); ?></li>
  129. <li><?php printf( _wpsf__('Comments Cooldown Interval: %s'), ($icwp_aCommentsFilterOptions['comments_cooldown_interval'] == '0')? $sOff : sprintf( _wpsf__('%s seconds'), $icwp_aCommentsFilterOptions['comments_cooldown_interval'] ) ); ?></li>
  130. <li><?php printf( _wpsf__('Comments Token Expire: %s'), ($icwp_aCommentsFilterOptions['comments_token_expire_interval'] == '0')? $sOff : sprintf( _wpsf__('%s seconds'), $icwp_aCommentsFilterOptions['comments_token_expire_interval'] ) ); ?></li>
  131. </ul>
  132. <?php endif; ?>
  133. <hr/>
  134. <h4 style="margin-top:20px;">
  135. <?php printf( _wpsf__('WordPress Lockdown is %s'), $fLockdownOn ? $sOn : $sOff ); ?>
  136. [ <a href="admin.php?page=icwp-wpsf-lockdown"><?php _wpsf_e('Configure Now'); ?></a> ]</h4>
  137. <?php if ( $fLockdownOn ) : ?>
  138. <ul>
  139. <li><?php printf( _wpsf__('Disable File Editing: %s'), ($icwp_aLockdownOptions['disable_file_editing'] == 'Y')? $sOn : $sOff ); ?></li>
  140. <li><?php printf( _wpsf__('Mask WordPress Version: %s'), empty($icwp_aLockdownOptions['mask_wordpress_version'])? $sOff : $icwp_aLockdownOptions['mask_wordpress_version'] ); ?></li>
  141. </ul>
  142. <?php endif; ?>
  143. <hr/>
  144. <h4 style="margin-top:20px;">
  145. <?php printf( _wpsf__('Auto Updates is %s'), $fAutoUpdatesOn ? $sOn : $sOff ); ?>
  146. [ <a href="admin.php?page=icwp-wpsf-autoupdates"><?php _wpsf_e('Configure Now'); ?></a> ]</h4>
  147. <?php if ( $fAutoUpdatesOn ) :
  148. if ( $icwp_aAutoUpdatesOptions['autoupdate_core'] == 'core_never' ) {
  149. $sAutoCoreUpdateOption = $sOff;
  150. }
  151. else if ( $icwp_aAutoUpdatesOptions['autoupdate_core'] == 'core_minor' ) {
  152. $sAutoCoreUpdateOption = _wpsf__('Minor Versions Only');
  153. }
  154. else {
  155. $sAutoCoreUpdateOption = _wpsf__('Major and Minor Versions');
  156. }
  157. ?>
  158. <ul>
  159. <li><?php printf( _wpsf__('Automatically Update WordPress Simple Firewall Plugin: %s'), ($icwp_aAutoUpdatesOptions['autoupdate_plugin_self'] == 'Y')? $sOn : $sOff ); ?></li>
  160. <li><?php printf( _wpsf__('Automatically Update WordPress Core: %s'), $sAutoCoreUpdateOption ); ?></li>
  161. <li><?php printf( _wpsf__('Automatically Update Plugins: %s'), ($icwp_aAutoUpdatesOptions['enable_autoupdate_plugins'] == 'Y')? $sOn : $sOff ); ?></li>
  162. <li><?php printf( _wpsf__('Automatically Update Themes: %s'), ($icwp_aAutoUpdatesOptions['enable_autoupdate_themes'] == 'Y')? $sOn : $sOff ); ?></li>
  163. <li><?php printf( _wpsf__('Automatically Update Translations: %s'), ($icwp_aAutoUpdatesOptions['enable_autoupdate_translations'] == 'Y')? $sOn : $sOff ); ?></li>
  164. <li><?php printf( _wpsf__('Ignore Version Control Systems: %s'), ($icwp_aAutoUpdatesOptions['enable_autoupdate_ignore_vcs'] == 'Y')? $sOn : $sOff ); ?></li>
  165. </ul>
  166. <?php endif; ?>
  167. </div>
  168. </div><!-- / span6 -->
  169. <div class="span6" id="tbs_docs_examples">
  170. <div class="well">
  171. <h3><?php printf( _wpsf__('Release v%s'), $sLatestVersionBranch ) ; ?></h3>
  172. <p><?php printf( _wpsf__('The following summarises the main changes to the plugin in the v%s release'), $sLatestVersionBranch ) ; ?></p>
  173. <p><?php printf( _wpsf__('%snew%s refers to the absolute latest release.'), '<span class="label">', '</span>' ) ; ?></p>
  174. <?php
  175. $aNewLog = array(
  176. 'ADDED: Options to automatic updates to control where and whether email notifications are sent.',
  177. 'ADDED: Various fixes and verification of WordPress 3.8 compatibility.',
  178. 'ADDED: Integration with iControlWP and the automatic updates system.',
  179. 'ADDED: Better filesystem handling methods.',
  180. 'ADDED: Better firewall logic for whitelisting rules.',
  181. 'ADDED: Some new firewall white listing parameters to help with post editing.',
  182. 'ADDED: Option to run automatic updates upon demand according to your settings',
  183. 'ADDED: Localization capabilities. All we need now are translators.',
  184. 'ADDED: Option to mask the WordPress version so the real version is never publicly visible.'
  185. );
  186. ?>
  187. <ul>
  188. <?php foreach( $aNewLog as $sItem ) : ?>
  189. <li><span class="label"><?php _wpsf_e('new'); ?></span> <?php echo $sItem; ?></li>
  190. <?php endforeach; ?>
  191. </ul>
  192. <?php
  193. $aLog = array(
  194. );
  195. ?>
  196. <ul>
  197. <?php foreach( $aLog as $sItem ) : ?>
  198. <li><?php echo $sItem; ?></li>
  199. <?php endforeach; ?>
  200. </ul>
  201. </div>
  202. <div class="well">
  203. <?php
  204. $aLog = array(
  205. '1.9.x' => array(
  206. 'ADDED: Block deactivation of plugin if admin access restriction is on.',
  207. 'ADDED: New feature to manage WordPress Automatic Updates.',
  208. 'FIXED: Several small bugs and streamlined codebase.',
  209. ),
  210. '1.8.x' => array(
  211. 'ADDED: Admin Access Key Restriction feature.',
  212. 'ADDED: WordPress Lockdown feature.'
  213. ),
  214. '1.7.x' => array(
  215. 'ADDED: Support for WPMU sites (only manageable as Super Admin).',
  216. 'CHANGE: Serious performance optimizations and a few bug fixes.',
  217. ),
  218. '1.6.x' => array(
  219. 'ADDED: GASP-based, and further enhanced, SPAM comments filtering functionality.',
  220. ),
  221. '1.5.x' => array(
  222. 'IMPROVED: Whitelisting/Blacklisting operations and options',
  223. 'NEW Option: Login Protect Dedicated IP Whitelist.',
  224. 'REMOVED Option: Firewall wp-login.php blocking'
  225. ),
  226. '1.4.x' => array(
  227. 'NEW Option: Plugin will automatically upgrade itself when an update is detected - ensures plugin always remains current.',
  228. 'Now displays an admin notice when a plugin upgrade is available with a link to immediately update.',
  229. 'Plugin collision protection: removes collision with All In One WordPress Security.',
  230. 'Improved Login Cooldown Feature- works more like email throttling as it now uses an extra filesystem-based level of protection.',
  231. "Fix - Login Cooldown Feature didn't take effect in certain circumstances.",
  232. 'Brand new plugin options system making them more efficient, easier to manage/update, using fewer WordPress database options',
  233. 'Huge improvements on database calls and efficiency in loading plugin options'
  234. ),
  235. '1.3.x' => array(
  236. "New Feature - Email Throttle. It will prevent you getting bombarded by 1000s of emails in case you're hit by a bot.",
  237. "Another Firewall die() option. New option will print a message and uses the wp_die() function instead.",
  238. "Option to separately log Login Protect features.",
  239. "Refactored and improved the logging system.",
  240. "Option to by-pass 2-factor authentication in the case sending the verification email fails.",
  241. "Login Protect checking now better logs out users immediately with a redirect.",
  242. "We now escape the log data being printed - just in case there's any HTML/JS etc in there we don't want.",
  243. "Optimized and cleaned a lot of the option caching code to improve reliability and performance (more to come).",
  244. ),
  245. '1.2.x' => array(
  246. 'New Feature - Ability to import settings from WordPress Firewall 2 Plugin.',
  247. 'New Feature - Login Form GASP-based Anti-Bot Protection.',
  248. 'New Feature - Login Cooldown Interval.',
  249. 'Performance optimizations.',
  250. 'UI Cleanup and code improvements.',
  251. 'Added new Login Protect feature where you can add 2-Factor Authentication to your WordPress user logins.',
  252. 'Improved method for processing the IP address lists to be more cross-platform reliable.',
  253. 'Improved .htaccess rules (thanks MickeyRoush).',
  254. 'Mailing method now uses WP_MAIL.'
  255. ),
  256. '1.1.x' => array(
  257. 'Option to check Cookies values in firewall testing.',
  258. 'Ability to whitelist particular pages and their parameters.',
  259. 'Quite a few improvements made to the reliability of the firewall processing.',
  260. 'Option to completely ignore logged-in Administrators from the Firewall processing (they wont even trigger logging etc).',
  261. 'Ability to (un)blacklist and (un)whitelist IP addresses directly from within the log.',
  262. 'Helpful link to IP WHOIS from within the log.',
  263. 'Firewall logging now has its own dedicated database table.',
  264. 'Fix: Block email not showing the IPv4 friendly address.',
  265. 'You can now specify IP ranges in whitelists and blacklists.',
  266. 'You can now specify which email address to send the notification emails.',
  267. "You can now add a comment to IP addresses in the whitelist/blacklist. To do this, write your IP address then type a SPACE and write whatever you want (don't take a new line').",
  268. 'You can now set to delete ALL firewall settings when you deactivate the plugin.',
  269. 'Improved formatting of the firewall log.'
  270. )
  271. );
  272. ?>
  273. <?php foreach( $aLog as $sVersion => $aItems ) : ?>
  274. <h3><?php printf( _wpsf__('Change log for the v%s release'), $sVersion ); ?></h3>
  275. <ul>
  276. <?php foreach( $aItems as $sItem ) : ?>
  277. <li><?php echo $sItem; ?></li>
  278. <?php endforeach; ?>
  279. </ul>
  280. <?php endforeach; ?>
  281. </div>
  282. </div><!-- / span6 -->
  283. </div><!-- / row -->
  284. <div class="row">
  285. <div class="span6">
  286. </div><!-- / span6 -->
  287. <div class="span6">
  288. <p></p>
  289. </div><!-- / span6 -->
  290. </div><!-- / row -->
  291. </div><!-- / bootstrap-wpadmin -->
  292. <?php include_once( dirname(__FILE__).'/include_js.php' ); ?>
  293. </div><!-- / wrap -->