I have a few custom tables in the database and I need to clean expired data from time to time.
If I was using WP-Cron, it would be easy, but WP-Cron sucks and is a no-go (especially for what I am doing). Having that in mind, I need to launch some code using
crontab. How should I do it in a clean, effective manner that would not require nasty hacks?
I was thinking of creating a REST endpoint, but how to protect it so it could only be opened by the crontab?
The solution should be inside the plugin folder so it could be stored in GIT easily (i.e. nasty workarounds storing files in the main folder (a.k.a
public_html) are not welcomed).
Was searching for a good solution for hours with no success... Thanks in advance!