• Resolved chrisgfw

    (@chrisgfw)


    I want to add the ability to limit the number of downloads (images) per week by Paid Membership members. I see several plugins that accomplish this, but have no idea what might be compatable with your plugin. I looked at Download Manager as an example. I am not the IT guy, just the owner of the site. I typically hear “great idea but how do you know it will work with what we have” from him. Just thought I’d try and ask you if you know of compatible plugins that can accomplish this before I go back to him. We have both Paid Memberships and Paid Memberships Pro.

    Thanks for your time in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Jarryd Long

    (@jarryd-long)

    Hi there, thank you for reaching out to Paid Memberships Pro.

    You could make use of Download Monitor (https://www.ads-software.com/plugins/download-monitor/) along with our integration (https://www.paidmembershipspro.com/add-ons/pmpro-download-monitor/).

    This monitors if members can download a file while Download Monitor should handle limiting the number of downloads allowed – if however that part isn’t supported, it would likely require some custom development.

    Thread Starter chrisgfw

    (@chrisgfw)

    I’m not sure Download Monitor will do what I want, but I’ll check. Assuming no, the plugin that does exactly what I want is a plugin called “Download Limit” (https://www.wpdownloadmanager.com/download/download-limit/). I think that is a plugin to “Download Manager” (a plugin to their plugin).

    If you see what Download Limit does, you may know of another plugin that can do similar that is easier to integrate. But if that’s the only one out there, maybe will need to talk about some customization. If we get closer to that stage, I’d involve the IT guy so everyone can talk the same language.

    Thanks for you time helping me with this. It’s something I’m going to need going forward.

    Plugin Author Jason Coleman

    (@strangerstudios)

    Good luck with the project. I’m going to resolve this thread. If you need further help, feel free to open a new one.

    If you get into writing custom code for this, often the most challenging bit is figuring out where to hook in your limit and how to notify the user of the limit. That’s going to depend on what a “download” really is, what plugin you are using to manage them.

    But once you do that coding the limit per level is fairly straightforward. You can set up an array to store the limits or a big if/then/switch like:

    // Get the limit based on their membership level.
    if ( pmpro_hasMembershipLevel( array( 1, 2 ) ) ) {
        // Levels 1 and 2 get 5 downloads.
        $limit = 5;
    } elseif ( pmpro_hasMembershipLevel( 3 ) ) {
        // Level 3 has "unlimited" downloads.
        $limit = 99999;
    } else {
        // Default to no downloads.
        $limit = 0;
    }
    
    // Get (from user meta or plugin DBs) how many downloads used.
    $used = ...;
    
    // Check vs limit.
    if ( $used >= $limit ) {
        // Throw a warning somehow
    } else {
        // Do nothing. Allow the download.
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Download Limiter’ is closed to new replies.