Skip to main content

Documentation

IMPORTANT

This is the outdated SI-documentation which will be adapted soon. A huge part may be obsolete!

Cronjobs

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.

  1. Login to your cPanel account and click on the Cronjob icon as shown in the diagram below.

    Cronjobs

  2. Upon clicking on the cronjob icon, you will be presented with the following screen. You will need to enter the following configuration.

    Cronjobs

    Minute - Enter the interval for minute. The example above uses */5 which means the script is executed every 5 minutes

    Hour - Enter the interval for minute. The example above uses * which means the script is executed every hour

    Day - Enter the interval for minute. The example above uses * which means the script is executed every day

    Month - Enter the interval for minute. The example above uses * which means the script is executed every month

    Weekday - Enter the interval for minute. The example above uses * which means the script is executed every week

    Command - 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>&1
    

    You will need to get the correct wget path and replace the 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.

    Important

    Different 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

Cronjobs interval


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.

Cronjobs interval

We use cookies
We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience. You can decide whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.