<p>I'm trying to write a Wordpress plug-in that automatically posts a blog post at a certain time of day.  For example, read a bunch of RSS feeds and post a daily digest of all new entries.</p>

<p>There are plug-ins that do something similar to what I want, but many of them rely on a cron job for the automated scheduling.  I'll do that if I have to, but I was hoping there was a better way.  Getting a typical Wordpress user to add a cron job isn't exactly friendly.</p>

<p>Is there a good way to schedule a task that runs from a Wordpress plug-in?  It doesn't have to run at exactly the right time.</p>

[{'answer_id': 54071, 'author': 'MattBelanger', 'author_id': 655, 'author_profile': 'https://Stackoverflow.com/users/655', 'pm_score': 0, 'selected': False, 'text': "<p>vBulletin uses a sort of Pseudo-Cron system, that basically checks a schedule on every page access, and fires any processes that are due then.</p>\n\n<p>It's been a while since I worked with Wordpress, but I think something like this should work if it runs on each page view.  </p>\n"}, {'answer_id': 54085, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>I think the best way to do this is with a pseudo-cron. I have seen it on several occasions, and although not exact in the timing, it should do what you need it to do. Since in Wordpress the index.php is the first thing always hit based upon the settings in the .htaccess, create a file called pseudo-cron.php, dump it into the root directory, and then require it once from the index. Whenever someone hits the site, it will run, and you can use it to initiate a script, and check if another daily digest needs to be generated depending upon the time of the day, and when the previous digest ran.</p>\n'}, {'answer_id': 54126, 'author': 'ceejayoz', 'author_id': 1902010, 'author_profile': 'https://Stackoverflow.com/users/1902010', 'pm_score': 3, 'selected': True, 'text': '<p><a href="http://codex.wordpress.org/Function_Reference/wp_schedule_event" rel="nofollow noreferrer">http://codex.wordpress.org/Function_Reference/wp_schedule_event</a></p>\n'}, {'answer_id': 448426, 'author': 'Stephen Baugh', 'author_id': 55595, 'author_profile': 'https://Stackoverflow.com/users/55595', 'pm_score': 2, 'selected': False, 'text': '<p>pseudo-cron is good but the two issues it has is</p>\n\n<p>1, It requires someone to "hit" the blog to execute. Low volume sites will potentially have wide ranging execution times so don\'t be two specific about the time.</p>\n\n<p>2, The processing happens before the page loads. So if teh execution time happens and you have lots of "cron" entries you potentially upset visitors by giving them a sub standard experience.</p>\n\n<p>Just my 2 cents :-)</p>\n'}]
['https://Stackoverflow.com/questions/54038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5062/']