Best place to keep files that are called by cron jobs?
I am interesting in setting up a Wordpress Website which needs to keep updating certain custom database tables after fetching data from RESTful Web Services, lets say once in a day.
I can achieve this by having a script to make request to REST API, process data and then store it into required tables.
However, I am not sure where to put this script file so cron can call it without any issues (security wise)
- Can I place these script files at root level of wordpress directory (such as
/script1.php
,script2.php
etc)? - Or I create a plugin of the script, would cron be able to access this file placed inside a plugins directory?
UPDATE
- There will be multiple scripts used by cron, therefore, I want to make plugins out of each script.. Would cron be table to access files in the plugins directory?
Anyone who can help?
Topic rest-api cron plugin-development Wordpress
Category Web