Changeset 1646940
- Timestamp:
- 04/27/2017 10:11:53 PM (9 years ago)
- Location:
- ab-wp-security
- Files:
-
- 4 added
- 2 edited
-
assets/screenshot-1.png (added)
-
tags/1.30 (added)
-
tags/1.30/ab-wp-security-plugin.php (added)
-
tags/1.30/readme.txt (added)
-
trunk/ab-wp-security-plugin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ab-wp-security/trunk/ab-wp-security-plugin.php
r1646091 r1646940 3 3 Plugin Name: AB WP Security 4 4 Plugin URI: http://aleksandar.bjelosevic.info/abwps 5 Description: Security plugin that stop User Enumeration in WordPress 6 Version: 1. 205 Description: Security plugin that stop User Enumeration in WordPress, Disable XML-RPC and Remove WordPress Version Number 6 Version: 1.30 7 7 Author: Aleksandar Bjelosevic 8 8 Author URI: http://aleksandar.bjelosevic.info … … 10 10 */ 11 11 12 13 14 15 function ab_wp_security_menu_item() 16 { 17 add_submenu_page("options-general.php", "AB WP Security", "AB WP Security", "manage_options", "abwps", "abwpstools_page"); 18 } 19 20 //create page 21 function abwpstools_page() 22 { 23 24 ?> 25 <div class="wrap"> 26 <!-- Add the icon to the page --> 27 <div id="icon-themes" class="icon32"></div> 28 <h2>AB WP Security</h2> 29 <!-- Make a call to the WordPress function for rendering errors when settings are saved. --> 30 <?php settings_errors(); ?> 31 32 <!-- Create the form that will be used to render our options --> 33 <form method="post" action="options.php"> 34 <?php 35 settings_fields("section"); 36 37 do_settings_sections("abwps"); 38 39 submit_button(); 40 ?> 41 </form> 42 43 </div> 44 <?php 45 } 46 47 function abwps_settings() 48 { 49 add_settings_section("section", "Settings", null, "abwps"); 50 add_settings_field("ab-wp-security-userenumeration", "Stop User Enumeration in WordPress", "abwps_userenumeration_display", "abwps", "section"); 51 add_settings_field("ab-wp-security-wp-version", "Remove WordPress Version Number", "abwps_wpversion_display", "abwps", "section"); 52 add_settings_field("ab-wp-security-xml-rpc", "Disable XML-RPC", "abwps_xmlrpc_display", "abwps", "section"); 53 register_setting("section", "ab-wp-security-user-enumeration"); 54 register_setting("section", "ab-wp-security-wp-version"); 55 register_setting("section", "ab-wp-security-xml-rpc"); 56 } 57 58 function abwps_userenumeration_display() 59 { 60 ?> 61 <input type="checkbox" name="ab-wp-security-user-enumeration" value="1" <?php checked(1, get_option('ab-wp-security-user-enumeration'), true); ?>> 62 63 64 <?php 65 } 66 67 function abwps_wpversion_display() 68 { 69 ?> 70 <input type="checkbox" name="ab-wp-security-wp-version" value="1" <?php checked(1, get_option('ab-wp-security-wp-version'), true); ?>> 71 <?php 72 } 73 74 function abwps_xmlrpc_display() 75 { 76 ?> 77 <input type="checkbox" name="ab-wp-security-xml-rpc" value="1" <?php checked(1, get_option('ab-wp-security-xml-rpc'), true); ?>> 78 <?php 79 } 80 81 82 83 12 84 // block WP enum scans 13 85 14 if (!is_admin()) { 15 // default URL format 16 if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) die(); 17 add_filter('redirect_canonical', 'abwp_check_enum', 10, 2); 18 } 86 19 87 function abwp_check_enum($redirect, $request) { 20 88 // permalink URL format … … 23 91 } 24 92 25 // Remove WordPress Version Number 26 function ab_wp_security_remove_version() { 27 return ''; 93 94 function ab_wp_security_clean() { 95 96 // Remove WordPress Version Number 97 if (get_option('ab-wp-security-wp-version')) 98 { 99 add_filter('the_generator', ''); 100 } 101 // disable xmlrpc in WordPress 102 if (get_option('ab-wp-security-xml-rpc')) 103 { 104 add_filter('xmlrpc_enabled', '__return_false'); 105 } 106 if (get_option('ab-wp-security-user-enumeration')) 107 { 108 if (!is_admin()) { 109 // default URL format 110 if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) die(); 111 add_filter('redirect_canonical', 'abwp_check_enum', 10, 2); 112 } 113 114 115 116 } 117 28 118 } 29 add_filter('the_generator', 'ab_wp_security_remove_version'); 30 add_filter('xmlrpc_enabled', '__return_false'); 119 120 add_action("admin_menu", "ab_wp_security_menu_item"); 121 add_action("admin_init", "abwps_settings"); 122 123 add_action('init', 'ab_wp_security_clean'); 124 31 125 ?> -
ab-wp-security/trunk/readme.txt
r1646092 r1646940 5 5 Requires at least: 3.8 6 6 Tested up to: 4.7.4 7 Stable tag: 1. 207 Stable tag: 1.30 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 23 23 == Changelog == 24 24 25 = V1.30 = 26 Added custom submenu in settings menu, for user selection 27 25 28 = V1.20 = 26 29 Disable XML-RPC … … 36 39 37 40 == Screenshots == 41 1. Settings->AB WP Security page 38 42 39 43 == Frequently Asked Questions ==
Note: See TracChangeset
for help on using the changeset viewer.