• Justin Fletcher

    (@justinticktock)


    Hi Jeff,

    I’ve been thinking of putting a plugin together to do things like..

    • Activate a plugin only if a particular role is currently assigned to any logged in users. Some plugins I find are only required by one or 2 roles and this would help dynamically expand or collapse the necessary active plugins as required for the user base logged in.
    • And for the adhoc plugins used by admins have a way to active a plugin for 10min, 20min..1hours, before it automatically becomes in-active. This way Admin type roles can activate a plugin for some temporary functionality knowing that they will not forget to disable it.

    so before I continue to develop something just wondered if you had any such ideas for plugin-organizer’s roadmap.

    ..Justin

    https://wordpress.org/plugins/plugin-organizer/

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Jeff Sterup

    (@foomagoo)

    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.

    Thread Starter Justin Fletcher

    (@justinticktock)

    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.

    ?

    Plugin Author Jeff Sterup

    (@foomagoo)

    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.

    Thread Starter Justin Fletcher

    (@justinticktock)

    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.

    Plugin Author Jeff Sterup

    (@foomagoo)

    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.

    Plugin Author Jeff Sterup

    (@foomagoo)

    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.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Jeff thanks for the update if you need me to test anything let me know.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Hi Jeff just wondered if you managed to grab any more time for this?

    Plugin Author Jeff Sterup

    (@foomagoo)

    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.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Ok that’s good to hear, let me know if I can help with any testing 🙂

    Plugin Author Jeff Sterup

    (@foomagoo)

    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

    Thread Starter Justin Fletcher

    (@justinticktock)

    That’s great, I’ll have a look and get back to you.

    Thread Starter Justin Fletcher

    (@justinticktock)

    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.

    Thread Starter Justin Fletcher

    (@justinticktock)

    also ….just to confirm my test environment..
    testing with 4.2.3
    php 5.4.12
    network install
    active local plugins =
    https://wordpress.org/plugins/user-role-editor/
    https://wordpress.org/plugins/role-based-help-notes/

    network active plugins =
    https://wordpress.org/plugins/query-monitor/
    https://wordpress.org/plugins/user-switching/

    Plugin Author Jeff Sterup

    (@foomagoo)

    What is the php error you are getting?

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

The topic ‘role based features’ is closed to new replies.