Contents
Setting Up the Scheduled Tasks
PaddleSubs does its background work as Joomla scheduled tasks. When it is first installed it adds the three tasks every site needs, enabled, with the schedules in the table below: PaddleSubs - Process webhooks, PaddleSubs - Access subscription lifecycle and PaddleSubs - Expiry reminders. You can change their schedules; an update leaves them as you set them, and doesn't add back a task you deleted. You can instead run each job from a CRON job on your server, as in the section called “Run Each Job From Its Own CRON Job”.
-
Go to → and search for
PaddleSubs. The three tasks are listed and enabled. -
If one is missing, for example because Scheduled Tasks was disabled when PaddleSubs was installed, click and choose its task type. A new task of a PaddleSubs type starts with the task's name and the suggested schedule on its Execution Rules tab, so you only need to click .
| Task type | What it does | Suggested schedule |
|---|---|---|
| PaddleSubs - Process webhooks | Works through the webhooks Paddle sent. Until it runs, nothing a customer bought reaches their account. | Every minute |
| PaddleSubs - Access subscription lifecycle | Starts and ends Access Subscriptions on time, adding and removing user groups. | Every 10 minutes |
| PaddleSubs - Expiry reminders | Emails customers before and after one-time access runs out. | Every day at 09:00 UTC |
| PaddleSubs - Resync user groups | Gives users the groups their purchases grant, after you change a product's or level's groups or after an import. | Hourly, or by hand when you need it; not added on install |
Run the Scheduler From Your Server
By default, Joomla runs due tasks when someone visits your site. On a busy site that is often enough. On a quiet one, a customer can pay and then wait until the next visitor for their access. Set up a CRON job on your server that runs Joomla's scheduler every minute:
* * * * * php /path/to/your/site/cli/joomla.php scheduler:run --all --quiet
Your hosting control panel usually has a page for CRON jobs. Once it is set up, you can turn off Lazy Scheduler in the Scheduled Tasks options, so visitors never wait for a task to run.
Emails the tasks send link to your site. PaddleSubs builds those links from the
Site Address option, which it fills in the first time an administrator
opens one of its pages, or from $live_site in configuration.php
when that is set. Open a PaddleSubs page once after installing, and check the option.
Run Each Job From Its Own CRON Job
Joomla's scheduler runs one due task at a time, so a long task can hold up the others. The Console - PaddleSubs plugin adds each PaddleSubs job to Joomla's command line, so your server can run each one on its own schedule, without Joomla's scheduler and whether or not anyone visits the site. For example:
* * * * * php /path/to/your/site/cli/joomla.php paddlesubs:webhooks --quiet */10 * * * * php /path/to/your/site/cli/joomla.php paddlesubs:lifecycle --quiet 0 9 * * * php /path/to/your/site/cli/joomla.php paddlesubs:expiry-reminders --quiet
Run paddlesubs:webhooks every minute: the Purchase Complete page waits about two minutes for a new buyer's purchase before it gives up, and only processing the webhooks signs the buyer in. Run paddlesubs:resync-groups when you need it, as you would its task.
Each command works through every batch until its job is done; --time-limit stops it
sooner. Scheduled Tasks Reference gives each command beside its task, and
php cli/joomla.php help command lists its
options.
Once the CRON jobs run, you can disable or delete the PaddleSubs scheduled tasks the installer added, and the Task - PaddleSubs plugin. Nothing goes wrong if you keep them: a job that is already running, as a task or from CRON, is never started a second time, and the run that finds it running does nothing.
PaddleSubs records each job's runs. If one stops running, because its CRON job stopped or nothing runs its task, every PaddleSubs page and the dashboard say so (see Q: ): Process webhooks after 15 minutes, Access subscription lifecycle after two hours and Expiry reminders after two days.