Title: Multisite Compatibility?
Last modified: August 21, 2016

---

# Multisite Compatibility?

 *  Resolved [spiffywiffy](https://wordpress.org/support/users/spiffywiffy/)
 * (@spiffywiffy)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/)
 * Does this plugin work properly with multisite yet?
 * If not, any suggestions for a good alternative?
 * [https://wordpress.org/plugins/login-lockdown/](https://wordpress.org/plugins/login-lockdown/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/multisite-compatibility-22/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multisite-compatibility-22/page/2/?output_format=md)

 *  [GrayHunter](https://wordpress.org/support/users/grayhunter/)
 * (@grayhunter)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993578)
 * +1:
 * There is another topic ([http://wordpress.org/support/topic/multisite-php-log-errors?replies=3](http://wordpress.org/support/topic/multisite-php-log-errors?replies=3))
   on the same question.
 * Dear, mvandemar, answer us pls 🙂
 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993582)
 * Hi all, interested in this aspect (how does Login LockDown perform on a multisite)
   I can share my experience with Limit Login Attempts [http://wordpress.org/plugins/limit-login-attempts/](http://wordpress.org/plugins/limit-login-attempts/):
 * Although Limit Login Attempts does not provide specific multisite options it 
   does work well on a multisite when Network activated. The default settings provide
   all the security you expect right out of the box on all sites in the network.
 * I would not be surprised if it turns out that Login LockDown behaves the same
   way. Can the developer confirm this?
 * However, it would be even better if there was full multisite compatibility in
   that it provides a network admin options page where super admin can define different
   default settings and (for example) allow or prevent individual site admins to
   change settings on their own site…
 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993589)
 * UPDATE: just had the chance to test Login LockDown on a multisite installation.
   Activated network-wide, it seems to function only on the main site, not on sub-
   sites. At least not on a subdir installation…
 *  [mvandemar](https://wordpress.org/support/users/mvandemar/)
 * (@mvandemar)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993590)
 * Sorry, no, I still have not fixed this. I do know what I need to change now, 
   I just haven’t had a chance to do so. I will try and get it updated soon.
 * -Michael
 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993591)
 * Hi Michael, thanks for the update 🙂 … is this issue occurring because the plugin
   needs it’s own database tables that are not created for all sites on network-
   activation?
 * May I make a suggestion? Instead of fixing the plugin so that it does start working
   after a network activation just like it would after activation on a single site
   installation (hope you understand what I’m trying to say), you might want to 
   move forward and make it truely a multisite compatible plugin. Just like the 
   plugin Login Security Solution does it: after network-wide activation we get 
   ONE network admin settings page (to control the plugin network-wide) instead 
   of a settings page on each site in the network.
 * Advantages are: 1. easy control by super admin without bothering site admins 
   with new options 2. no need for the plugin to create new database tables for 
   all sites and 3. global network-wide lockouts of attacker IPs.
 * Hope that helps 🙂
 *  [GrayHunter](https://wordpress.org/support/users/grayhunter/)
 * (@grayhunter)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993592)
 * Nice idea!
 * **mvandemar**, answer here pls when you update the plugin – I am subscribed at
   this topic.
 *  [mvandemar](https://wordpress.org/support/users/mvandemar/)
 * (@mvandemar)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993593)
 * Hey guys, I plan to make it fully multisite compatible when I update it, and 
   not just fix the symptoms. I will update this thread and the other one once I
   get it fixed.
 * -Michael
 *  [GrayHunter](https://wordpress.org/support/users/grayhunter/)
 * (@grayhunter)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993594)
 * Ok, thank you!
 * The main problem I can not use it for now – simple sites admins have too much
   settings. I don’t remember which exactly but the definitely should not have the
   opportunity to see/change paths, modify vital files, no JS/PHP/ect text area,
   block super admins and the server must be safed from them to be overloaded…
 * So, it’s ok they have some options (may be they want to set 3 attempts or 30 
   but not 10), but they still should stay in a sandbox. Only super-admin should
   rule vital server/net things.
 * Good coding – waiting your success! 🙂
 *  [David Sword](https://wordpress.org/support/users/davidsword/)
 * (@davidsword)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993600)
 * any progress on this? my error logs flooded!
 * (again — love the plugin, one of the greats – saying this with positivity!)
 *  [progresst](https://wordpress.org/support/users/progresst/)
 * (@progresst)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993602)
 * +1 on this for multisite…any ETA for when it will be fully Multiste compatible?
 *  [jorgeorpinel](https://wordpress.org/support/users/jorgeorpinel/)
 * (@jorgeorpinel)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993605)
 * Just commenting here to get subscribed to the topic. Would like to see this implemented.
   Cheers
 *  [David Sword](https://wordpress.org/support/users/davidsword/)
 * (@davidsword)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993607)
 * I’ve written a patch for multi-site support. Based off of [shibashake.com](http://shibashake.com/wordpress-theme/write-a-plugin-for-wordpress-multi-site)
 * This patch runs the install for a network site when:
    - Login lockdowns “network enable” plugin button is pressed
    - adding a new network site
    - entering a special URL to patch sites missing these tables from before
 * General Installation:
    1. Add the code below into the bottom of `/wp-content/plugins/loginlockdown/loginlockdown.
       php`, right before the closing `?>`
 * Legacy Patch Instructions: _(if you hit “network enable” before this and now 
   your error logs are endless) _
    1. For legacy support visit your websites dashboard, and add the following to the
       url: ? loginlockdown_network_patch, i.e. `http://example.com/wp-admin/? loginlockdown_network_patch`–
       this triggers a cycle that checks for the missing tables and installs when missing
 *     ```
       /**
        * multisite: network wide plugin-activation patch
        *
        * small patch for Login Lockdown that activates Login Lockdown for all sites when set to network enabled
        *
        * @since 1.6.(?)
        * @author davidsword
        */
       register_activation_hook( __FILE__, 'handsomefox_loginlockdown_multisite_activate' );
       function handsomefox_loginlockdown_multisite_activate($networkwide) {
           global $wpdb;
   
           if (function_exists('is_multisite') && is_multisite()) {
               // check if it is a network activation - if so, run the activation function for each blog id
               if ($networkwide) {
                   $old_blog = $wpdb->blogid;
                   // Get all blog ids
                   $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
                   foreach ($blogids as $blog_id) {
                       switch_to_blog($blog_id);
                       loginLockdown_install();
                   }
                   switch_to_blog($old_blog);
                   return;
               }
           }
       }
       ```
   
 *     ```
       /**
        * multisite: new site activation patch
        *
        * small patch for Login Lockdown that runs the table+options creations for newly created sites when LL is network enabled
        *
        * @since 1.6.(?)
        * @author davidsword
        */
       add_action( 'wpmu_new_blog', 'handsomefox_loginlockdown_multisite_newsite', 10, 6);
       function handsomefox_loginlockdown_multisite_newsite($blog_id, $user_id, $domain, $path, $site_id, $meta ) {
           global $wpdb;
   
           if (is_plugin_active_for_network('loginlockdown/loginlockdown.php')) {
               $old_blog = $wpdb->blogid;
               switch_to_blog($blog_id);
               loginLockdown_install();
               switch_to_blog($old_blog);
           }
       }
       ```
   
 *     ```
       /**
        * multisite: old sites check
        *
        * prior to these patches you could network enable, see the options page, but none of the tables exsist
        * this function repairs all instances where the plugin is network enabled but not properly installed.
        * to prevent this from firing unessisaryly, we'll add a GET var to trigger it
        *
        * @since 1.6.(?)
        * @author davidsword
        */
       add_action('admin_init','handsomefox_loginlockdown_multisite_legacy');
       function handsomefox_loginlockdown_multisite_legacy() {
       	global $wpdb;
   
           if (function_exists('is_multisite') && is_multisite() && isset($_GET['loginlockdown_network_patch'])) {
   
               $old_blog = $wpdb->blogid;
   
               // Get all blog ids
               $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
               foreach ($blogids as $blog_id) {
   
                   // check if already exists
       			$bed_check = $wpdb->query("SHOW TABLES LIKE '{$wpdb->base_prefix}{$blog_id}_login_fails'");
                   if (!$bed_check) {
   
                       switch_to_blog($blog_id);
       				loginLockdown_install();
   
       			}
               }
               switch_to_blog($old_blog);
               return;
           }
       }
       ```
   
 * Hope you all enjoy and the author integrates this!
 *  [mvandemar](https://wordpress.org/support/users/mvandemar/)
 * (@mvandemar)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993608)
 * [@davidsword](https://wordpress.org/support/users/davidsword/) – thank you for
   coming up with this. I have stickied this thread in the support forum until I
   can get to patching the plugin itself.
 * -Michael
 *  [kimstuart](https://wordpress.org/support/users/kimstuart/)
 * (@kimstuart)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993615)
 * So I’m slightly confused – all three bits of code need to be added to the same
   file – /wp-content/plugins/loginlockdown/loginlockdown.php – or they need to 
   be added in different places?
 * This enables the settings for all sites to be managed by SuperAdmin instead of
   individual site management, correct? Or it does not do that yet?
 *  [David Sword](https://wordpress.org/support/users/davidsword/)
 * (@davidsword)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/#post-4993616)
 * yes, add 3 snippets to bottom of `loginlockdown.php` .. then trigger the patch
   for your already created sites by visiting:
 * `.../wp-admin/?loginlockdown_network_patch`
 * (in retrospect I should of just made that patch fire and checked against it with
   a wp option value.. oops)
 * no, doesn’t allow for only-superadmin

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/multisite-compatibility-22/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multisite-compatibility-22/page/2/?output_format=md)

The topic ‘Multisite Compatibility?’ is closed to new replies.

 * ![](https://ps.w.org/login-lockdown/assets/icon-256x256.png?rev=2901919)
 * [Login Lockdown & Protection](https://wordpress.org/plugins/login-lockdown/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/login-lockdown/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/login-lockdown/)
 * [Active Topics](https://wordpress.org/support/plugin/login-lockdown/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/login-lockdown/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/login-lockdown/reviews/)

## Tags

 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * 16 replies
 * 8 participants
 * Last reply from: [kimstuart](https://wordpress.org/support/users/kimstuart/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/multisite-compatibility-22/page/2/#post-4993617)
 * Status: resolved