Helping Organisations get organised!

Cron jobs

Cron events are scheduled per site when the plugin is activated. On network activation this covers up to 500 existing sites; a site created later has no LH CRM cron events until the plugin is reactivated. Deactivation clears the recurring and initial events on the same sites.

Hook Schedule What it does
lh_crm_initial_run Once, up to a minute after activation Gives the edit_enquiries capability to every role that has edit_others_pages, and removes it from the rest. The main plugin class also listens but does nothing.
lh_crm_wakeup Hourly Moves up to five scheduled (future) enquiries whose date has passed back to New, oldest first. Until 1.5.8 it also resynced relationship triples for the site’s 100 most recent enquiries; that sync has been removed.
lh_crm_activate_future_enquiry Single event per enquiry, at its date Scheduled when a New enquiry is saved with a future date. At that time it moves the enquiry back to New, or reschedules itself if the date has moved later.

The hourly job works entirely in UTC: it uses get_posts() with a date_query on post_date_gmt, up to and including current_time( 'mysql', true ), so the site’s timezone does not affect when an enquiry is released. Before 1.5.9 it passed a GMT offset (from the now-removed lh_crm_gmt_offset filter) into current_time()‘s true/false GMT flag, which released enquiries 10 to 11 hours late on sites ahead of UTC such as Melbourne. Before 1.5.11 the lookup was a direct database query.

If you like this plugin please consider making a donation to further development