[Plugin: Better WP Security] Broken for Multisite
-
I believe this plugin may be broken for multisite installations.
I was having an issue that some of the features of this plugin will work (changing the admin username, changing the wp_ table prefix) but other features would not work. Specifically, it seemed that when I clicked a checkbox and clicked the save button, the setting would not save. The page would reload with the checkbox unchecked.
As a result, any changes that I requested did not get saved to the .htaccess file.
After doing some digging, I was able to get things to work by commenting out a few lines of code in bwps.php in the saveOptions function as follows…
function saveOptions($opt, $val) {
global $wpdb;
$opts = $this->getOptions();$opts[$opt] = $val;
// Since BWPS settings are network-wide, settings can be saved to the main (network) site
// if (is_multisite()) {
// $blogs = get_blog_list( 0, ‘all’ ); //need to find a non-deprecated alternative// if( is_array( $blogs ) ) {
// foreach( $blogs as $details ) {
// delete_blog_option($details[‘blog_id’],”BWPS_options”);
// update_blog_option($details[‘blog_id’],”BWPS_options”, serialize($opts));
// delete_blog_option($details[‘blog_id’],’BWPS_update’);
// }
// }
//} else {
delete_option(“BWPS_options”);
delete_option(“BWPS_update”);
update_option(“BWPS_options”, serialize($opts));
//}
return $this->getOptions();;
}I haven’t done a lot of testing. There may be other changes necessary. But this solved my immediate problem. Now settings get saved that the .htaccess file gets written.
https://www.ads-software.com/extend/plugins/better-wp-security/
- The topic ‘[Plugin: Better WP Security] Broken for Multisite’ is closed to new replies.