That feature has been asked for and I’ve tried. Unfortunately users and roles don’t exist before plugins are loaded so there’s no way to do it.
Yes I see that, how about if on logging in a transient for each role is set for a time period before clearing. Then use this to activate a plugin or not?
so the code is not actually looking at the roles but the transients. the user will need to login and then on the next page refresh the plugins required for their role will then be available for a period of time.
?
Actually I think I can make a transient work by using the logged in cookie to find the right one. I can store the users roles in that transient and then load plugins based on that. Great idea! Give me about a week to get it all working. It might be less if this week isn’t as busy as the last few.
Your saying that the whole collective of which roles are currently logged in are spread over the user cookies, Sounds neat.
Adding it in it will really be a great way for removing even more plugin cluter and dynamically expand & collapse the active plugins.
Since you’d be adding possibility of increased occurrence for hidden plugin conflicts etc. Some sort of logging of who and which plugin was active would be a good idea to help debug any issue.
I can save an array of the roles that a user belongs to in a transient and then use a value from the cookie’s that wordpress already uses to retrieve the correct set of roles. The only problem I’m running into so far is that each row in the database table has a unique identifier that is the post ID. To save a different set of plugins for each role I will need to save more than one entry for each post. I might be able to get past that but it will take some work.
I’m still working on this. It is looking good though. I have made serious changes to the plugin and I can now save a different set of plugins for each role. It still needs some work but it is getting there. I want to have it done by the end of the week but I’m really busy this week and it may take a little longer. I’ll keep you posted.
Jeff thanks for the update if you need me to test anything let me know.
Hi Jeff just wondered if you managed to grab any more time for this?
It’s really close. Redoing the admin to get roles working wasn’t easy. I’m still having an issue prioritizing the roles because a user can have more than one role and the admin can assign settings to the same url for more than one role. So I need to decide which set of plugins to use when more than one is found in the database. But I am able to have different plugins for different roles for global plugins and find parents with the same role or no role.
Ok that’s good to hear, let me know if I can help with any testing 🙂
I have a beta version ready for testing if you would like to test it. Make sure you aren’t testing it on a live site since this makes a lot of changes to Plugin Organizer. It allows disabling plugins based on role as well as other fixes and changes. Here is a link to the beta. http://www.jsterup.com/wp-content/uploads/2015/07/plugin-organizer.7.b.1.zip
That’s great, I’ll have a look and get back to you.
I’ve found the first hurdle…php error on saving Global Plugins..this was after it previously saved OK and then de-activating some plugins before attempting to re-save a new Global Plugins. I’m assuming that de-activating the plugins caused this issue..
I sent contact request in via http://www.jsterup.com/ if you respond there we can use email.
What is the php error you are getting?