Skip to content

Subscription Plugin

Daniel Neto edited this page Nov 12, 2026 · 24 revisions

Subscription plans and member access

Start with the visual access and payment guide for a complete example with the actual editor, checkout, animation and confirmed Stripe test subscription.

What it does

The Subscription plugin sells plans that put a user into one or more user groups for a period of time (for example 30 days). These memberships grant the corresponding video access. Sites can also offer PPV or viewing with ads; use mandatory playback access rules when a category must require a particular group regardless of those other options. A viewer without that group sees the plans linked to it on an Unlock this content page.

Example: create a user group called "Premium", put your premium videos in that group, and create a plan "Premium monthly" linked to the group. When a user pays, they join "Premium" until the plan expires. You never add or remove users by hand.

When the period ends, the plan renews if the user's wallet has enough balance (recurring gateway payments add that balance automatically).

Subscription is a paid add-on, available from the AVideo plugin marketplace. If you are not sure how to install plugins, read How to install a new plugin.

How to configure it

  1. Set up the YPTWallet plugin and at least one payment gateway, with its webhook:
  2. Create your user groups in Admin Panel → Contents → Users Groups, and put the paid videos in those groups. See Create non-public videos and deal with user groups.
  3. Go to Admin Panel → Plugins, enable Subscription and click Install tables.
  4. Install the Scheduler cron job (see below). It renews the plans.
  5. Create your plans (next section).

Create your first plan.

Go to Admin Panel → Monetize → Create Subscription Plans, or click Edit on the Subscription row in Admin Panel → Plugins. There are two tabs: Subscriptions lists who subscribed, Plans is where you create plans.

Fill in:

  • Name and Description
  • Plan Price
  • How many trial days (0 for no trial)
  • How many days the plan lasts before it renews
  • Status
  • Mark as Most Popular (optional badge on the plans page)
  • The user groups the subscriber will join

Save. The Reports button on the Subscription row shows your subscription numbers.

Subscription Plans page with the monthly Academy plan selected

Select the group that the plan grants, as well as linking the lessons to that group. Manual permanent membership is independent of paid membership and can retain access after a subscription ends.

Academy Members selected on the subscription plan

Subscribing

Users reach the plans page (/plugin/Subscription/showPlans.php) in these ways:

  1. A subscribe button in the top bar (displayTopBarSubscribeButton) and in the left menu (displayLeftMenuSubscribeButton). The button text is textSubscribe.
  2. A user who opens a video they are not allowed to watch is sent to the plans page.

On the plans page the user chooses a plan and pays:

  • With recurrentPaymentsOnly on (default), only recurring payment buttons are shown (for example Subscribe With PayPal). The gateway charges the user every period and AVideo renews the plan.
  • With recurrentPaymentsOnly off, the user can also add funds once; the plan is then paid from the wallet balance.

The plan price goes from the user's wallet to the site owner's wallet (the user ID in the YPTWallet option manualWithdrawFundsTransferToUserId).

Other options: expiresAtTheEndOfTheDay (access lasts until the end of the last day, on by default), allowFreePlayWithAds, thanksForSubscribe, and notifyUsersOnTrial (e-mail sent when a trial starts).

plansThatRemoveAdsOnlyFromTheirVideos (empty by default): IDs of plans that remove ads only from their own videos, such as a plan for one members-only category. Without it, any active subscription counts as a paid user, and ad plugins set to hide ads for paid users hide them on the whole site. See ads for a plan that covers only one category.

Use the coordinated FlixHouse, GoogleAds_IMA and Streamer updates for the same decision in app VMAP responses and Aniview SSAI. GoogleAds_IMA is distributed separately. With either scoped subscriptions or restricted-title rentals enabled, the VMAP cache separates responses with ads from those without ads; reload after changing a plan or finishing a rental.

Follow the buyer's checkout

  1. Sign in with a normal viewer account, open the member lesson and choose an eligible plan.
  2. Review the price and period. Subscribe With Credit Card (Stripe) opens the card form; PayPal opens its own approval flow. Available buttons depend on your configured gateways.
  3. Submit once and wait for You are subscribed and Watch Now. Payment approval and access activation are separate stages.
  4. Open My Account → Subscription History, panel Subscription Plans, to check the expiration and the supported cancellation/card controls.

Monthly plan checkout and recurring payment options

Stripe test subscription from card entry to activated membership

MP4 with playback controls · Confirmed test subscription, still image

This local example completed a $9.99 test subscription and verified that the buyer could access the member lesson. It does not prove later renewals, expiry or refunds. If payment is approved but activation is pending, use Check payment status and inspect the existing subscription and wallet history before paying again.

Manage or cancel recurring billing

Open My Account → Subscription History. Manage Credit cards is available for the supported Stripe subscription. To cancel, select Cancel → Confirm, then reload and check for Canceled. Canceling recurring billing does not refund a previous charge. The access already granted may remain valid until its recorded expiration, as it did in this demonstration.

Subscription History with membership expiration and cancellation/card controls

Still image after cancellation. The dedicated recurring Stripe test subscription was canceled after capturing activation, so it will not continue billing in the sandbox.

How to Add a Crontab on Ubuntu

Advanced (server access needed).

Plans are renewed by the Scheduler plugin, which must run every minute. Every minute it charges the wallet of each user whose plan just expired and extends the plan.

  1. Make sure the Scheduler plugin is enabled in Admin Panel → Plugins.
  2. Open a terminal on the server (SSH) and paste this command. It adds the Scheduler job to the crontab of the web server user (www-data) without touching your other cron jobs. If AVideo is not in /var/www/html/AVideo, replace that path with yours.
( sudo crontab -u www-data -l 2>/dev/null | grep -v 'plugin/Scheduler/run.php'; echo "* * * * * php /var/www/html/AVideo/plugin/Scheduler/run.php" ) | sudo crontab -u www-data -
  1. Check it with:
sudo crontab -u www-data -l

You should see the line ending with plugin/Scheduler/run.php.

Older versions of this page asked you to add a separate line for plugin/Subscription/crontab.php with an authKey. That line is no longer needed when the Scheduler job is installed.

Common questions

Why did paid access not activate? Check the gateway webhook (see the gateway's page), the user's wallet History, the subscription in the Subscriptions tab, and that the plan is linked to the video's user group.

Why was the plan not renewed? Check that the Scheduler cron job runs and that the user's wallet had enough balance when the plan expired.

Why did expired access remain active? With expiresAtTheEndOfTheDay on, access lasts until the end of the last day. Also check the server time zone.

Can I change a plan used by existing subscribers? Changing the price does not change payments the gateway already scheduled. Test on a new plan first.

Clone this wiki locally