Why doesn't PPV allow you to set the number of views for a single item?

Maybe I am misunderstanding the set up, but it appears that the number of views can only be set for daily passes and subscriptions. That presents a major drawback. In my case, I would like to set the the number of times (or a days) a person can watch an instructional video. That seems natural to me.

I'm not giving my visitors much of a choice if I say "Hey, you can only watch this video once. If you want to watch it more than once, you have to pay for a full access pass." I prefer to say "You can pay a few dollars and you are entitled to watch this as much as you want. You can purchase access to as many videos as you want this way, but you may find it more economical to pay for a full access pass."

I look forward to your response.

  • Kimberly
    • Champion of Loops

    Hi Mark,

    It sounds like using our Membership Plugin might be more appropriate for what you are wanting to do.

    You can protect content until someone signs up for a specific package, and you can define subscription times (days, weeks, months) supply drip content (access to video a for a day, access to vid b for 2 days,etc) and you can take one time payments through PayPal.

    I think this is just a matter of finding the right tool for the job, as they do provide very similar possibilities, but one is more well suited than the other for what you are asking. IMHO. :slight_smile:



  • Mark
    • The Incredible Code Injector

    Hi Kimberly, I'm not so sure that would work. My goal is to have a large catalog of audio and video files which someone can view on my site (the files won't be available for download). Wouldn't using Membership require that I create a separate membership level for each file? That sounds very unpractical. Please correct me if I'm wrong.

    I'm surprised that Pay Per View doesn't have this ability built-in, i.e. allowing multiple views of a single file without full site access. It seems like a basic function to me.

    Other thoughts?

    This functionality is extremely important for my site, so please .. whomever has an idea, please contribute.

  • Hakan
    • The Incredible Smush

    Hi Mark,

    First of all I cannot imagine how many of our users need "first view of the video will be free, second, third views will be paid". This may be important for your application, but we didn't see any requests until now.

    You see, we develop plugins according to general user needs. We may not cover all the requests, because there are so many. However, you are free to customize them according to your needs.

    On the other hand, "3 views of any content from my website will be free, the rest will be paid" seems applicable to me and we had at least one more request for that.

    So, here is a solution that I developed for this latter one.

    add_action('the_posts', 'free_page_views');
    function free_page_views( $posts ) {
    	if ( empty($posts) || is_admin() )
    		return $posts;
    	$shortcode_found = false;
    	foreach ($posts as $post) {
    		if (stripos($post->post_content, '[ppw') !== false) {
    			$shortcode_found = true;
    	// Use an unusual arbitrary name here. Dont use special characters.
    	$cookie_name = "yubdcn49kl67";
    	// Enter your free page view count here
    	$free = 3;
    	// Cookie expires after 1 year. You can change this.
    	$expire = time()+ 365 * 24 * 3600;
    	if ( $shortcode_found ) {
    		if ( isset( $_COOKIE[$cookie_name] ) )
    			$count = $_COOKIE[$cookie_name];
    			$count = 0;
    		if ( $count < $free ) {
    			global $ppw;
    			remove_filter( 'the_content', array( $ppw, 'content' ), 12 );
    		@setcookie( $cookie_name, $count + 1, $expire, "/" );
    	return $posts;

    Include this code inside functions.php of your theme.

    This will give free access to ALL protected content on the website, until a set free page view count.

    This will work with Selection Tool method only.

    I have tested it and it works fine. However please note that this is not 100% safe. A smart visitor can bypass it.

    Please also note that there is no 100% safe solution against faking such codes. This is technically impossible, because it is always possible to behave like a "new" visitor. The simplest thing vistor can do is opening the website in a new browser. There is no technology to distinguish if the visitor is a new one, or visited the website before.

    This is why we are reluctant to add such "free" options to the plugin. We will never add it, because money talks here :slight_smile: Yes, these are paid contents. Not as simple as liking with Facebook.

    But you are free to apply it at your own risk, of course.

    I hope I could express the situation and I hope this solution helps.


    PS: I want to emphasize that PPV is 100% safe without the above code, because it doesn't reveal content to the browser unless payment is done. However that above code (or any other code that gives a "free" option) can be violated, and I don't recommend it for a paid content.

  • Mark
    • The Incredible Code Injector

    Hi Hakan,

    I think you may have misread my post, or maybe I wasn't clear enough. I never mentioned a need for, as you said, "first view of the video will be free, second, third views will be paid". That's not functionality I need (or would even really expect to be included). I understand you must design for the general user, so I'm not giving you hassle about that. But hear me out...

    The plug in does not offer much for someone who needs control over a single piece of content, e.g. an instructional video. The whole marketing game requires greater flexibility from a Pay Per View plugin where people may need to watch the instructional videos more than once.

    The PPV plugin does not appear to allow people to "pick and choose" which videos they want to watch. It's either one video one time*, or all the videos for a set number of days. It would be great to have the same access controls for a single video.

    I haven't been able to figure out a way to do this using PPV, Marketpress or Membership in an out of the box manner. And frankly, that surprises me. Not to say that it can't be done, but no one on the forums has been able to shed any light on it. So when I say that this functionality is basic, I don't mean any offense. I just mean that people would really like this basic level of control, as per Jonathan's feature request. I'm not a developer so I have no idea how pie in the sky it is, but man it would be great!

    *It's just "One time", correct? I haven't been able to test this because I can't get the plug in to work; please see a related post.

  • Jonathan
    • The Incredible Code Injector


    Can I make a suggestion?

    Firstly a Pay per Post plugin isn't hard to create, the issue is hiring someone to keep it up to date. I am not a fan of maintance of plugins, which is why I look at 3rd party plugins.

    I have recently found this
    It is super slim, lightweight shopping cart type deal. But it works on user purchases a product which is a post and gets to download that product.

    I wouldn't have the user download the videos - what I would do is make the download product a pdf which is a thank you for you order - and it has a link to the page which has video on it. But this page which has video on it you can write up a simple shortcode that checks that user id has purchased product id and if yes shows content or gives nice message to buy :wink:

    Or, you can wait for some demand for a pay per post plugin - it all depends on when you need it by.

    If I am off the mark, I blame it on my extreme out of the box thinking :wink:

    Edit: if you want to have full access - create a full access product @ $xxx and you can run a check in shortcode if user is full access product holder then allow access, or if he has purchased x product then allow access etc etc

  • Mark
    • The Incredible Code Injector

    @ Jonathan

    Suggestions are always welcomed!

    It's funny, it looks like we were thinking on exactly the same lines.

    If you scroll down on this thread where I mention Plan B in bold, it's almost the same thing you are suggesting. I will definitely check out the plugin link you sent (thanks!) though I will probably use the Marketpress + Membership combo I laid out in the thread since I'll be using those two for other things as well.

    Unfortunately, I don't think PPV is going to work for me and at this point I'm probably just giving Hakan heartache.

  • Jonathan
    • The Incredible Code Injector

    Yip, seems most logical way to achieve it. PPV is geared more to newspaper type sites in my opinion. I thought PPV and Pay per post were one and the same, but I was wrong - and now know better :wink:

    Good luck with combo marketpress+membership. I like membership - it is one of my favorite here at wpmu

    Sidenote: The fundraiser plugin is pretty much a pay per post plugin and with a little modification can be just that. Just another way out the box thinking.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.