Make upgrades per user instead of per site

So I am looking at offering advanced features to users who pay a fee. Pro Sites seems to fir the bill for this expect one thing. With pro sites upgrades are per site, I want the upgrades to apply to all sites of the user who purchased the upgrade. Any suggestions on how to accomplish this?

  • Tom Eagles
    • Syntax Hero

    @Ryan

    This is what the bulk upgrades feature is for, if they have more than one site they can upgrade them. Obviously without them having more than one site it would be impossible to upgrade non existing sites. Although this is actually quite an interesting idea. I will tag the developer @Aaron to see if there is a way this could be incorporated into a new release at some stage,

    Cheers!

  • Ryan
    • WPMU DEV Initiate

    That would be really great to see this functionality built into the plugin in the future.

    In the mean time I question if the plugin has any action hooks I could hook into. For example when a site level is changed, is there an action hook I can hook into and see what site is being changed and to what level. If so I could write my own code that will then identify the user's other sites then call the function to change the level to change the level on each of the other sites.

    Then I could hook into the site creation process, check the level of that user's other sites and if its not a free site, call the function to upgrade the new site to the same level.

    The big question, does pro sites offer such a hook, and also what function would I need to call to change the level of the other sites.

  • Aaron
    • CTO

    The big question, does pro sites offer such a hook, and also what function would I need to call to change the level of the other sites.

    There is this:
    do_action('psts_upgrade', $blog_id, $level, $old_level); and do_action('psts_downgrade', $blog_id, $level, $old_level);
    Those only happen on level changes, not subscription payments.
    do_action('psts_extend', $blog_id, $new_expire, $level); is what you want if you want to extend on every subscription payment.

    The $psts->extend() function is what you use to give access to other sites, or change level.
    extend($blog_id, $extend, $gateway = false, $level = 1, $amount = false)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.