The incredible possibilities offered by the Scheduled Tasks in Joomla
Present slides: https://slides.woluweb.be
This presentation was / will be made at
- JoomlaCamp Essen Germany - 2024.03.01 + 2024.03.02 - #jc24de #jcamp
- JoomlaDay USA - 2024.04.12 - #jdayusa - login to see the video as soon as it is made available
- JoomlaDagen Netherlands - 2024.05.31 - #jd24nl
- JoomlaDay D.A.CH - 2024.09.20 - #jd24dach
- JoomlaDay France - 2024.10.18 - #jd24fr
1 INTRODUCTION
Since version 4.1 (and so also in 5.x series) Joomla introduced a very interesting new feature called Scheduled Tasks.
Even though it has been present for more than two years, everytime I exchange with other Joomlers I realize that the majority has overlooked the power of this feature.
So the goal of this article is to shed some light on the possibilities at the hand of different examples / usecases:
- some are native Plugins, ready to be used within Joomla
- some are third-party Plugins, typically open source and available for free on Github
- and of course the whole idea is that you can also create your own, in order to meet your specific needs
2 Other sources about the Task Scheduler
Quite luckily different people have already produced interesting content about the Task Scheduler.
So let me start by thanking and referencing them:
- Brendan Hedges wrote in March 2023 an introduction in the current Joomla Community Magazine:
- Get to know the new Joomla! Task Scheduler
- He was concluding his article by 20 giving plugin ideas
- Nicholas Dionysopoulos made several presentations at Joomla events
- JoomlaDay D.A.CH 2023
- see the video on https://www.youtube.com/watch?v=Owih9M7I2_w
- download the slides on https://akee.ba/jtasks2023
- Joomla NXT
- see the video on https://www.youtube.com/watch?v=k28_tQzCLlU
- see the slides on https://akee.ba/shceduledtaskspresentation
- JoomlaDay D.A.CH 2023
- JoomShaper wrote a tutorial about using the (native) Image Size Check Scheduled Task: https://www.joomshaper.com/blog/joomla-4-task-scheduler
- TechFry wrote a small tutorial about how to create your own Task Scheduler Plugin: https://www.techfry.com/joomla/how-to-create-joomla-task-scheduler-plugin
3 Scheduled Tasks - native Plugins
Go to your backend > System > Scheduled Tasks.
Click on the New button and see what is already natively available in J5:
- Delete ActionLogs - Task
Delete Action logs after days - Expiration of privacy consents
Manage the expiration of privacy consents - Rotate Logs
Periodically rotates log files. - Task - Session Data Purge
Task Plugin that purges expired data and metadata depending on the session handler set in Global Configuration. - Joomla! Update Notification
This task periodically checks for the availability of new Joomla! versions. When one is found it will send you an email, reminding you to update. You can customise the email - Image Size Check
Check images, resize if larger than allowed. Attention: The original file will be overwritten! - GET Request
Make GET requests to a server. Supports a custom timeout and authorization headers. - Toggle Offline
Toggles the site’s status on each run. - Set Site Online
Sets site status to online on each run. - Set Site Offline
Sets site status to offline on each run. - Global Check-in
Check in checked out items.
3.1 My favourite ones
My favourite ones are
3.1.1 Global Check-in
Gosh, how many times end-users called me in the last ten years because they were editing from the front-end but some Articles were “checked out” by “accident”, preventing them from opening them. Every time I would have to go to the back-end to “check-in” all Items.
Now I can automate this action every night at 3PM for example
3.1.2 Image Size Check
In many cases you want to have a maximum width or height for images in a given Folder. But even if you make your end-users aware of the importance or resizing (in order to have a better performance for the visitors but also to have smaller backups etc) still people “forget” to resize their images.
Now I can for given Folders automatically resize the images (for example I set a maximum width of 600 pixels for all images in the Newsletter folder)
3.1.3 Get request
For some of my websites, I need to trigger some synchronization thanks to a script which is accessible on a given URL. The Get request does exactly that…
4 Scheduled Tasks - third-party Plugins
4.1 Check-in all your Content in J4
As mentioned above, in Joomla 5 there is a Native Plugin to check-in all your Content. But what is your website is still running J4?
Free - by Tobias Zulauf
4.2 Auto-delete files
What about auto-deleting files older than a certain timeframe in a given folder only (and not its subfolders)
Free - by Tom van der Laan
See https://github.com/TLWebdesignNL/Auto-Delete-Files-Task-Scheduler-Plugin
4.3 Change different Parameters of Articles automatically
What about being able to move Articles to other Categories in function of a certain date (or do similar things)
4.3.1 Kick Manage Article
A Task Scheduler to move articles from some Category to another Category when older than X days, based on the following dates:
- created
- modified
- published
- unpublished
Free - by KickTemp
4.3.2 CCC Timewarp
With this plugin, you can
- move your Articles to a different Category depending on a certain Date
- change the publication Status
- adjust the Access Level
- …
This is particularly useful if you use Joomla Articles to display Events, but also, for example, to make your news only available to a closed circle for x days and only make them public after some time.
NB: on top of the usual Types of Dates, you can also use a Custom Field of Type Date in your conditions, which is handy.
Paid - by Elisa Foltyn
See https://coolcat-campus.com/en/extensions/joomla-task-scheduler-plugin-ccc-timewarp and https://coolcat-campus.com/en/subscribe/joomla-plugins
4.4 Reset Hits
For a given project where I needed to display “the most popular Films of the month”, I wanted to reset the number of Hits on the 1st day of every month.
In the Configuration you can choose to reset Hits for any of the following:
- Articles
- Tags
- Categories
Free - by Marc Studer and Marc Dechèvre
4.5 Synchronize my Custom Fields with some external Web Service
Yet for another project I needed to synchronize the value of 20 Custom Fields for 300 Articles with the latest data coming from some external Web Service.
Let’s take a practical example: social.brussels is a kind of Directory of all Social Services and Associations in Brussels. You can access the details of each organization:
- either direclty from their website (for humans): https://social.brussels/organisation/13219
- either in json-format (for programs): https://social.brussels/rest/organisation/13219
On the Joomla website there are hundreds of articles having Custom Fields for the Address, Phone number etc.
So the idea was to automate a daily synchronization between the external source and our website so that the end users would not spend hours every month checking whether some information were outdated since last time…
Free - by Dimitris Grammatikogiannis
4.6 Delete Trashed
With this Task Plugin you can schedule the execution of the Empty Trash task.
Free - by Nicola Galgano
See https://extensions.joomla.org/extension/task-delete-trashed
4.7 TF Auto Update
Two Tasks are available:
- Update any column in any Joomla! database automatically
- Delete records from any Joomla database table based on defined rules
Free - by Tech Fry
4.8 Force password reset
This Joomla! task plugin will help You to force users of selected groups to reset their password periodically.
You can set different periods for different users groups.
When task run , user will forced to reset his password after their next login
Paid - by Mishel Naguib
See https://extensions.joomla.org/extension/force-password-reset-task
4.9 Manage Inactive Users
This task plugin will help You to manage inactive users.
Paid - by Mishel Naguib
See https://extensions.joomla.org/extension/manage-inactive-users-task
4.10 Feeding Articles from an external API
It reads an external API (a kind of Job Board) and feeds Joomla Articles of a given Category.
Official description: API interface for Apicodo Dorfapp. Task plugin to import the data time-controlled via the APICODO API. A category must be selected in the plugin to which the data records can be transferred. With each new request, all data records in the category are deleted and rewritten.
Free - by Claudia
4.11 Executing a query
(Coming soon)
Free - by Oliver
4.12 Scheduled Tasks provided directly by some Extensions
As mentioned in the Sources, some extensions provide their own Task Schedulers. Examples:
- Backup Task : <akee.ba/scheduledtasks>
- PHP File Scanner : https://www.akeeba.com/documentation/admin-tools-joomla/php-file-scanner-joomlascheduled.html
6 Conclusion
Have fun and enjoy the power of Joomla! ❤️💙🧡💚
7 Get in touch
Any suggestion about this presentation?
Please feel free to contact me. I’ll be happy to keep improving it 🙂
Marc Dechèvre | woluweb
+32 474 37 13 12 | +32 2 772 58 69