Changeset 761916
- Timestamp:
- 08/25/2013 04:49:48 AM (12 years ago)
- Location:
- disable-insecure-features/trunk
- Files:
-
- 2 edited
-
functions.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
disable-insecure-features/trunk/functions.php
r722992 r761916 4 4 Plugin URI: http://www.planetzuda.com/news/plugins/ 5 5 Description: This automatically disables pingbacks on old posts and pages, not new ones. This locks down htaccess, hides readme.html, and other files. Credit to Shivanand Sharma from http://binaryturf.com for SQL statements to disable old post pingbacks. Version 0.1 through 0.3 said xmlrpc was turned off. We discovered with the help from tw2113 that the WordPress code that claims it disables the xmlrpc, doesn't disable it. This means the plugin disable xmlrpc is useless. We are working to see if there is a way to disable the xmlrpc via plugin. 6 Version: 0. 46 Version: 0.5 7 7 Author: Planet Zuda, LLC 8 8 Author URI: http://www.planetzuda.com/news/ … … 10 10 */ 11 11 12 13 function swph_is_available() {14 // this function made available by http://stackoverflow.com/questions/3938120/check-if-exec-is-disabled15 static $available;16 17 if (!isset($available)) {18 $available = true;19 if (ini_get('safe_mode')) {20 $available = false;21 ?>22 23 The plugin will not be able to secure everything due to your web hosts setup. <br /> We are working on a solution for your web host setup. It will be available in the future.24 <?php25 } else {26 $d = ini_get('disable_functions');27 $s = ini_get('suhosin.executor.func.blacklist');28 if ("$d$s") {29 $array = preg_split('/,\s*/', "$d,$s");30 if (in_array('chmod', $array)) {31 $available = false;32 echo 'The plugin will not be able to secure everything due to your web hosts setup.' . '<br />' . 'We are working on a solution for your web host setup. It will be available in the future';33 34 }35 }36 }37 }38 39 return $available;40 }41 12 42 13 function swph_setup() … … 46 17 add_action('admin_menu','swph_setup'); 47 18 48 49 50 function swph_auto_disabled_features() 19 function swph_form() 51 20 { 52 21 53 54 // the following turns off pingbacks for already published posts and pages55 global $wpdb;56 57 $wpdb->query("UPDATE $wpdb->posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';");58 $wpdb->query("UPDATE $wpdb->posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';");59 60 //thank you to http://wordpress.stackexchange.com/questions/78780/xmlrpc-enabled-filter-not-called for this answer and tw2113 for helping out in the wordpress IRC. This may be implemented in the future.61 62 $swph_readme = ABSPATH . 'readme.html'; // you don't want people to see what version of WordPress you're running.63 if(file_exists($swph_readme))64 {65 chmod($swph_readme,0600); // makes it seem like the file doesn't exist for users who look for it.66 }67 68 // this will hide the license.txt so hackers can't see it.69 $swph_license = ABSPATH . 'license.txt';70 if(file_exists($swph_license))71 {72 chmod($swph_license,0600);73 }74 // lock down the wp-config.php so hackers can't read it.75 $swph_config = ABSPATH . 'wp-config.php';76 if(file_exists($swph_config))77 {78 chmod($swph_config,0600);79 }80 81 // lock down the .htaccess so hackers can't write to it via bad permissions.82 $swph_access = ABSPATH . '.htaccess';83 if(file_exists($swph_access))84 {85 chmod($swph_access,0644);86 }87 } // closes function88 register_activation_hook(__FILE__,'swph_auto_disabled_features');89 90 91 function swph_form()92 {93 // settings page put all variables up here to make it clean then generate the form.94 95 22 ?> 96 Disable pingbacks for future posts by going to <a href="<?php $swph_url; ?>/wp-admin/options-discussion.php"> settings->discussion </a> and uncheck the box that say "Allow link notifications from other blogs (pingbacks and trackbacks)" 23 This plugin is now just a shell that will be updated when we release our latest security project. 97 24 <br /> 98 25 <?php -
disable-insecure-features/trunk/readme.txt
r722992 r761916 11 11 == Description == 12 12 13 This disables pingbacks on previously published posts and pages,hides the readme.html, license.txt and fixes wp-config.php and .htaccess permissions so hackers can't modify them.13 This plugin doesn't do anything right now. 14 14 == Installation == 15 1. Go to your WordPress admin dashboard and go to plugins > add new and then type disable insecure features. Our plugin will come up. 16 click install now and then hit activate now. 17 2. You are now more secure. 15 18 16 19 17 == Credits == 20 18 We would like to give credit where credit is due. We would like to thank Shivanand Sharma from http://binaryturf.com for his article on disabling pingbacks from previously published posts and pages. 21 19 == Frequently Asked Questions == 22 23 = Is there an admin interface for this plugin? = 24 25 Yes, but it currently doesn't do anything since pingbacks on published posts and pages and the xml-rpc are automatically disabled when you activate the plugin. 26 The admin interface is at settings > disable insecure features. We plan to let you re-enable different insecure features in that area in an update. 27 28 = Does this disable all pingbacks? = 29 Not currently, because There is a built-in feature in WordPress to turn off pingbacks for future posts and pages. It is located in settings > discussion and uncheck llow link notifications from other blogs (pingbacks and trackbacks), then click the Save Changes button. 30 = Will the xml-rpc re-enable if I delete this plugin? = 31 Yes. 32 = Will previously published Posts and pages allow pingbacks if I delete this plugin? = 33 Nope. 34 = Will the readme.html, license.txt, wp-config.php, .htaccess or any other file reset to insecure permissions if I delete this plugin? = 35 No. 36 = Does this plugin disable the XMLRPC? 37 No. Code has been passed around WordPress claiming that it disables the XMLRPC and there is even a plugin called disable xmlrpc using that code, but it doesn't work 38 = Will you be disabling the xmlrpc in the future? 39 Hopefully. We are looking into how we can turn it off via the plugin. 40 = I don't want pingbacks turned off for future posts. WIll this plugin do that? 41 Whenever you update the core or reactivate the plugin your pingbacks for all published posts and pages will be turned off. 20 What does this plugin do? 21 Right now it doesn't do anything. 42 22 == Changelog == 23 == 0.5 == 24 This plugin doesn't do anything anymore. We may update it in the future with a new security plugin. The previous versions weren't functioning properly. 43 25 =0.4= 44 26 We discovered that the code everyone is using to disable the xmlrpc for 3.5 and up isn't disabling the xmlrpc, so we've removed that feature. We hope to actually disable the xmlrpc if at all possible.
Note: See TracChangeset
for help on using the changeset viewer.