feelexit
Member
Posted 2 years ago #
I write a plugin that creates weekly summery post. it supposed to run once a week to generate a post for current week.
I can have a cron job to schedule a task to run it once a week, but since its a plugin, you need to login as admin first, but cron job wont be able to do that. Is there a way I can do it ?
feelexit
Member
Posted 2 years ago #
k_nitin_r
Member
Posted 2 years ago #
What you can do to simulate a scheduled job is to create a script with a wget that calls a Php file in the plugin directory. You can schedule the script to get the Php page to run every week. To avoid accidentally creating a summary more than once, you can store the last execution date to ensure that a week has passed since the last summary post.