Limit specific plugins to Supporters only!

Hey guys, I know you'll love this as a lot of you are requesting it around here.

After getting the Supporter plugin, I took a day to create a new plugin managment plugin that supports the native WPMU plugins page and the WPMUdev Premium Supporter plugin!

This is a rewrite of Plugin Commander and is intended to replace it. It uses a backend site admin options page to adjust plugin permissions. The big difference is that users can activate their plugins on the regular WP plugins page! This is the first plugin of it's kind to use the new hooks added in the WPMU 2.7 plugins page and a little creative genius to allow no hacking of core files. Also, if you use the excellent Supporter plugin from premium.wpmudev.org you will be able to choose which plugins can be accessed by supporters only!

For WPMU 2.7.1+ only! Might work for 2.7, but before that the hooks were not in plugins.php yet.

Check it out: http://wpmudev.org/project/wpmu-plugin-manager

  • Ovidiu
    • Code Wrangler

    WOW. I didn't see the announcement here, so I mentioned it at the default mu forums, with some questions and suggestions: http://mu.wordpress.org/forums/topic/12603?replies=5

    will make a short list of them here:

  • - users can unfortunately decide to deactivate plugins that were set to automatically be activated at blog creation so I can't force plugin onto users, except by putting them into mu-plugins :slight_frown:
  • - wpmu plugin manager doesn't work with firestats, at least on my isntall, it gives me a 500 server error when trying to mass activate it for all blogs
  • - also some of the features from this old plugin could be implemented, i.e. the ability to see which blgo has which plugins activated: http://wpmudev.org/project/Plugin-Manager
  • - I'd suggest an improvement: I started autoactivating quite a few plugin, but this has to be done one-by-one, so it woudl be useful, if those plugins could be visually marked so I know where I have to continue and maybe checkboxes os I can autoactivate several plugins in one batch?
  • Aaron
    • CTO

    Here is a screenshot of it with Supporter activated.

    - users can unfortunately decide to deactivate plugins that were set to automatically be activated at blog creation so I can't force plugin onto users, except by putting them into mu-plugins :slight_frown:

    That's because I didn't want to recreate the "Activate All" option found on the plugins page in 2.7.1 which emulates putting it in the mu-plugins folder.

    As far as the firestats problem, I am not sure what is causing that as the mass activation code is an exact copy of Plugin Commander's. Maybe try mu-plugins instead.?

  • Ovidiu
    • Code Wrangler

    ok, thx guys for the quick responses and screenshots, still:

    That's because I didn't want to recreate the "Activate All" option found on the plugins page in 2.7.1 which emulates putting it in the mu-plugins folder.

    meaning that "activate all" activates plugins for all existing blogs and sets them to auto activate for new blogs too? wasn't aware of that.

    As far as the firestats problem, I am not sure what is causing that as the mass activation code is an exact copy of Plugin Commander's. Maybe try mu-plugins instead.?

    did you try the mass activation of firestats? is it just me with this problem?
    What do you mean by try mu-plugins? meaning I should put firestats there? the reason plugin commander was written was that firestats doesn't work from mu-plugins :slight_smile:

    btw. just activated and configured supporters plugin and wpmu plugin manager and now, all existing blogs I declared to be supporter blogs by extending their free demo period, lost their "active plugins" meaning they are all naked :slight_frown: or did I do something wrong?

  • Aaron
    • CTO

    meaning that "activate all" activates plugins for all existing blogs and sets them to auto activate for new blogs too? wasn't aware of that.

    Yes

    did you try the mass activation of firestats? is it just me with this problem?
    What do you mean by try mu-plugins? meaning I should put firestats there? the reason plugin commander was written was that firestats doesn't work from mu-plugins :slight_smile:

    No, have no experience with firestats and can't imagine what is different between this and Plugin Commander to cause a problem. Try the "Activate All" option on the plugins page.

    btw. just activated and configured supporters plugin and wpmu plugin manager and now, all existing blogs I declared to be supporter blogs by extending their free demo period, lost their "active plugins" meaning they are all naked :slight_frown: or did I do something wrong?

    Wpmu plugin manager may have caused that. There is no functionality to deactivate plugins when you change permissions. The only time it will deactivate plugins is when they load or reload the plugins.php page so there is no way it could deactivate current plugins for ALL users. It could also have been caused while installing the supporter plugin if you didn't leave out the plugins functionality.

    I'll look into that more.

  • terry hall
    • Design Lord, Child of Thor

    Hi Aaron,

    I love what I see. I'm using buddypress 1.0 with wpmu 2.7.1 and version 1.2 of Plugin Manager. [see edit below]

    When I update plugin manager i get this error:

    "Cannot load wp-content/mu-plugins/mp-plugin-manager.php" and the configuration is not saved.

    Is this BP compatible, I didn't see that it was not.

    [edit] I am using Statspress Reloaded, I deactivated and the plugin works without error and updates.

    thanks, -terry

  • Ovidiu
    • Code Wrangler

    another question:

    if we are now using the built-in site wide activation to make plugins active for all blgos and automatically activate them for new ones, then use your plugin to allow certain plugins for everyone, nobody or supporters we catually have to use your auto-activate feature to have plugins active for all users upon blog creation AND give them the chance to turn them off, right?

    I noticed not even saite admins are able to deactivate a site wide activated plugin for a certain blog without deactivating it globally :slight_frown:

    (I know its not really related to your plugin but I am trying to grasp hwo your plugin and the built in features work together)

  • Tracy
    • The Incredible Code Injector

    Great work Aaron, this was badly needed! I'm thinking the perfect trifecta to this plugin and the supporter plugin would be......... the ability to add domain mapping as an option offered only to supporters..... which would be possible if the domain mapping plugin liked living in the plugins folder vs mu-plugins, but it doesn't. :slight_smile:

    I will probably be putting up an job desc on the new job board for this shortly if anyone is interested in building this capability...

  • anointed
    • Flash Drive

    Wow that was fast LOL

    I installed the modified domain mapping plugin and it seems to work perfectly.

    Only one minor request if it's possible:
    Can we set it so that the 'master admin/me' can use domain mapping without being a supporter?

    I have a few sites already mapped that are my personal blogs on the network, thankfully the new domain mapping plugin from you did not mess with them as they still work.

    I did however try to make another one of my blogs a mapped domain, but received the 'supporter message' so that I was not able to use it myself.

    also, as I am a non-profit network, there will be customers that I would like to offer free domain mapping to. I am not sure how to allow it so that the master admin/me can map domains for people that I choose.

    sorry to complicate the issue....

    btw.. I used your contact form on your website as there seems to be no pm's on this site. We run very similar Christian networks and I was really impressed with what you have setup, very nice indeed.

    thanks again

  • anointed
    • Flash Drive

    LOL. yet another question:

    I went into the plugins management and set a few to 'allow all'

    I then went to one of my blogs that requires a few plugins to work, having already set them to allow all.

    I then activate a plugin, it says activated, however if I leave the plugin page and then come back, the plugin is no longer activated, but shows as inactive.

    Running wpmu 2.7.1/buddypress 1.0.1

    Am I missing a step somewhere?

    also:
    As the admin I have a number of my own blogs, some custom, some not so much. Some of my blogs require custom plugins to function properly. What I can't figure out is how to allow my 'admin' blogs to use these plugins but to not present them to other users to use.

    Is there a setting somewhere that I can tick to allow certain blogs to use certain plugins, and not other blogs?

    I know this would probably be easy if the supporter plugin allowed multiple 'groups' as we could then assign abilities to a supporter group #1, that supporter group #2 does not have, however I don't think supporter plugin does this yet.

    finally:
    I have a ton of plugins installed on the server that I have set to 'supporter only' however when a 'non-supporter' blog goes to their plugin directory they still see all the plugins, which I am sure is going to confuse them. Is there a way to hide the plugins list from those that are not supporters?

    sorry for so many questions, just trying to figure out the best way to handle this as there is not 'multi-level' supporter plugins available yet.

  • Aaron
    • CTO

    I then went to one of my blogs that requires a few plugins to work, having already set them to allow all.

    I then activate a plugin, it says activated, however if I leave the plugin page and then come back, the plugin is no longer activated, but shows as inactive.

    Can't understand how that would happen. Perhaps you didn't click the save options button on the plugin management page?

    Is there a setting somewhere that I can tick to allow certain blogs to use certain plugins, and not other blogs?

    You can go in as site admin and activate any plugin for a specific blog by going into it's dashboard.

    I have a ton of plugins installed on the server that I have set to 'supporter only' however when a 'non-supporter' blog goes to their plugin directory they still see all the plugins, which I am sure is going to confuse them. Is there a way to hide the plugins list from those that are not supporters?

    Not planning on changing that. That is the entire reason for the plugin as it makes the users know what they are missing until they become a supporter.

  • Aaron
    • CTO

    also, as I am a non-profit network, there will be customers that I would like to offer free domain mapping to. I am not sure how to allow it so that the master admin/me can map domains for people that I choose.

    I have updated the plugin to always allow site admins.

  • anointed
    • Flash Drive

    I have done some more testing and here is what I have found so far.

    1. If I turn a blog into a 'supporter' blog, and set the plugin to either 'allow all' or 'supporter only' I can then activate a plugin on the blog in question without problem.

    2. The problem arrises if I do the following.
    Set the plugin to 'allow all'
    ***I do not turn the blog into a supporter blog***
    I then go to the blog and activate the plugin.
    The plugin says activated, but If I leave the plugin page and then return later, the plugin is deactivated. Same thing happens if I try to activate more than one plugin for a non-supporter blog.

  • Aaron
    • CTO

    Are you sure you have the latest plugin version 1.2? Try as I might, I can't reproduce your problem. It just works. Under the management page are you sure you saved your permission preferences?

    With the latest version, the only time it can possibly deactivate a plugin is when you do a bulk activate action. Do you have WPMU 2.7.1? This might not work on any other version.

  • anointed
    • Flash Drive

    I am using the plugin from your link
    http://media.missionsplace.com/domain_mapping.php
    it says version 0.4.1

    under management page I have always clicked the submit button to set the changes I make.

    I am running wp 2.7.1 with buddypress 1.0.1, though I'm pretty sure buddypress would not be causing any of these problems.

    I'll keep digging around to see if anything else is possibly causing this.

    I do have a minor suggestion though:

    There are plugins that I ONLY want to run on either my blogs or very trusted friends blogs such as the plugins that allow php/javascript insertion into posts. Other plugins like buddypress for obvious reasons would never be run by a regular blog on the network *this is why I suggested being able to hide certain plugins" same goes for themes.

    I have some themes on the system that require certain plugins, but if those plugins were 'accidentally' activated by other blogs using other themes it would cause conflicts, jquery etc... That is another reason to 'hide' certain plugins from users.

    I would be more than interested in paying for development of the 'ultimate' vs. of this plugin if that is possible. Features like allowing admin override of any plugin for blogs whether they are supporter status or not. Ability to hide admin defined plugins from everyone. I can go on and on so I'll stop now LOL..

    thanks for all your help in this. If I can provide any information that would help to solve this issue just let me know.

  • Aaron
    • CTO

    Are you really sure you're running 1.2 (checked the source of mp-plugin-manager.php)? http://wpmudev.org/project/wpmu-plugin-manager.

    When you return to the plugin management page do the select boxes reflect the permissions you saved previously? Also when you recreate the plugin deactivation are you logged in as site admin or the non-supporter?

    Features like allowing admin override of any plugin for blogs whether they are supporter status or not.

    Site admin already can activate plugins for non-supporter blogs.

    As for the other suggestions, I'll contact you via email for those changes.

  • Lori
    • Design Lord, Child of Thor

    I just installed the plugin manager and when I go to my admin and look in the Plugin Management there are no plugins there. Should it automatically show the plugins that I had previously in the mu-plugins file? Or am I missing a step here??
    Thanks!

  • Ovidiu
    • Code Wrangler

    @Aaron: did you forget to change the version number? mine still says 1.2

    besides, would it be possible/desireable to change the sort order of plugins on the plugins page? I have loads of plugins and I thought it would be better if the plugin could be changed so there are sections, i.e. right now there are links for ALL plugins, active plugins, recently active plugins, inactive ones.

    Could your plugin maybe show the ones available for users on top, followed by the supporter ones? and if a user is a supporter, just show them all in one list?

    does this make sense to you?

  • e.yatsik
    • WPMU DEV Initiate

    WMPU 2.7.1 + Supporter + Plugin Manager

    I made some usefull plugin autoactivated, but when user create blog, Plugin Manager automatically set it to disabled because user is not supporter. How can I make some plugin not to be switched off by Plugin Manager?

  • e.yatsik
    • WPMU DEV Initiate

    @hiranthi: No, I set some plugins to be auto-activated on blog create. But I found some mistery in supporter-plugins.php:

    function supporter_plugins_disable_plugins() {
    if ( !is_supporter() ) {
    $active_plugins = get_option('active_plugins');
    if ( !empty( $active_plugins ) ) {
    deactivate_plugins( $active_plugins );
    }
    }
    }

    Maybe this lines disable ALL plugins to unsupporters. I think, I need remove supporter-plugins.php in order to use Plugin Manager. Am I right?

  • joshmac
    • Site Builder, Child of Zeus

    @e.yatsik, yes you are correct. This plugin manager automatically senses the use of the supporter plugin. So the supporter-plugins.php file that comes with the supporter plugin package needs to be deleted because it will cause issues like the one you are experiencing.

  • Mitch Levinson
    • Flash Drive

    When I try to adjust the plugins options in the "Plugin Management" page and click "update", the settings are not sdaved and I am directed to the dashboard page. Has any one else experienced this?

    I am using the supporter plugin as well and have removed the support-plugins.php file.

  • Aaron
    • CTO

    If you ever get around to adding Auto-Activate (Supporters) that would be just grand! in your copious free time that is... :wink:

    If someone wants to sponsor that change for the community contact me at aaron
    AT
    missionsplace.com

    Free time is short right now :wink:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.