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

Sort WooCommerce data with WP-CRON?

This doesn’t sound like a bad approach to me. The thing to keep in mind about WP_CRON is that it’s not a “real” cron and is only triggered when someone visits the site. To that end, you could also do the check when the product page loads and hide the button as needed.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)