Cronjob is a scheduled task that is executed on the server to run automatically at a specified time and date or an interval. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks. PayPlans need to perform the following tasks with cronjob:
Send activation and expiration emails
Process recurring and expiring subscriptions
Process GDPR download requests by users on your site
Process plan scheduling
Process & Update statistics that appears on the back-end
Perform maintenance to delete expired logs, orders and temporary pdf invoices
There are currently three ways to setup cronjobs for PayPlans:
Server cronjobs (Recommended)
Automated cronjob
Cronjob file
Server Cronjobs
Setting up cronjobs from your server allows you to control when and how often the cronjob executes. Different hosting companies will have different ways or steps to setup cronjobs. Ultimately, the url you have to use to connect to PayPlans endpoint is as below:
https://site.com/index.php?option=com_payplans&view=cron&task=trigger
For this example, we will be using cPanel to setup the cronjob for PayPlans.
Login to your cPanel account and click on the Cronjob icon as shown in the diagram below.
Upon clicking on the cronjob icon, you will be presented with the following screen. You will need to enter the following configuration.
Minute- Enter the interval for minute. The example above uses*/5which means the script is executed every 5 minutesHour- Enter the interval for minute. The example above uses*which means the script is executed every hourDay- Enter the interval for minute. The example above uses*which means the script is executed every dayMonth- Enter the interval for minute. The example above uses*which means the script is executed every monthWeekday- Enter the interval for minute. The example above uses*which means the script is executed every weekCommand- In the example above, we are running the following command,/bin/wget -O /dev/null "https://yoursite.com/index.php?option=com_payplans&view=cron&task=trigger" >/dev/null 2>&1You will need to get the correct
wget pathandreplacethe domain name above with your site's domain. Different hosting has a different /bin/wget. Please consult with your hosting provider for further details and assistance.ImportantDifferent webhosting providers may have different ways of setting up cronjobs. Therefore, it is important that you find out about the process from the respective providers.
Automated Cronjobs
Automated cronjob is executed automatically every time a visitor visits any of PayPlan pages on the front end. This also means that if your site has no visitors, there will not be any tasks being updated.
This is the primary reason why Server Cronjobs are recommended as it is consistent and does not require any visitors on the site.
To setup automated cron, navigate to PayPlans > Settings > System > General and enable the Enable Automated Cron setting. Set an automated cron frequency to determine how often the automated cron is allowed to execute. The intervals are as below:
Lowest - 1 hour
Low - 30 minutes
Normal - 15 minutes
High - 5 minutes
Cronjob File
Cronjob file path - JoomlaFolder/components/com_payplans/cron.php
You'll need to edit the cron.php file from your site. Locate the cron.php file at /components/com_payplans/cron.php from your site. In this file, change the $host value to your domain.



