WordPress crob job performance

No, The action will trigger when someone visits your WordPress site, if the scheduled time has passed. So if there no visitors crob job will not be triggered. In your case, it is better if you can run server cron job. Performance issue depend on the function you need to run as a cron job.

WordPress Cron function is not working

Are you constructing the class properly? Is the file writable? Do you need the interval or can you add the scheduled item if it doesn’t exist. This example is working, and sets an event 10 seconds into the future. wp_schedule_event( time() + 10, null, ‘ga_order_syn’ ); class CronTest { function __construct() { add_action( ‘init’, array … Read more

Schedule reminder at exact time

I second SamuelElh comment and YES cron is the way to go. BUT, which cron? The WordPress implementation of cron is a tricky implementation. How? Actually it is a cron fired by the visits your site gets, both (back-end and front-end), so, if your site is not getting a visitor every 10 minutes as suggested … Read more

How to insert post from external php file?

The best way to do this is, write the above code in your themes function.php. In this way you will have access to all the WP inbuilt functions, hooks, actions etc. Then use Cronjob Scheduler plugin – https://wordpress.org/plugins/cronjob-scheduler/ to run your function periodically.

wp_schedule_event function reference

I think if you need to call page every hour you can do it with a simple cron (not wp_cron) and set it in your panel or via shell a string like this: */1 * * * wget -O – /path/to/link >/dev/null 2>&1 But if you need to do it via wp add_action(‘wp’, ‘set_cron’ ); … Read more

Cron Job Scheduling in wordpress

You an use following: add_filter(‘cron_schedules’, ‘add_scheduled_interval’); function add_scheduled_interval($schedules) { /* add your time to ‘interval’ option, it should be in seconds */ $schedules[‘hourly’] = array( ‘interval’ => 5, ‘display’ => ‘Once 5 sec’ ); return $schedules; }

Updating an intensive wp_query result once daily

I am using transients for this scenarios. Result is saved to database (wp_options table) with expiration set. It’s usable if the slow load time is below some reasonable treshold … one (first) visitor will have to wait that long to render his request, every other will see saved result. $results = get_transient(‘my_results’); if( ! $results … Read more