• 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 ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter feelexit

    (@feelexit)

    please help.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to write a plugin that runs automatically’ is closed to new replies.