@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio-doc&#038;p=147703>
  a sioc:Post ;
  dc:title "Cron jobs" ;
  dcterms:identifier 147703 ;
  dc:modified "2026-09-18T14:31:07Z"^^xsd:dateTime ;
  dc:created "2026-09-17T23:25:20Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-crm/cron-jobs/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-crm/">LH Customer Relationship Management</a></li></ul>
<p class="wp-block-paragraph">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.</p>



<figure class="wp-block-table"><table><thead><tr><th>Hook</th><th>Schedule</th><th>What it does</th></tr></thead><tbody><tr><td><code>lh_crm_initial_run</code></td><td>Once, up to a minute after activation</td><td>Gives the <code>edit_enquiries</code> capability to every role that has <code>edit_others_pages</code>, and removes it from the rest. The main plugin class also listens but does nothing.</td></tr><tr><td><code>lh_crm_wakeup</code></td><td>Hourly</td><td>Moves up to five scheduled (<code>future</code>) enquiries whose date has passed back to New, oldest first. Until 1.5.8 it also resynced relationship triples for the site&#8217;s 100 most recent enquiries; that sync has been removed.</td></tr><tr><td><code>lh_crm_activate_future_enquiry</code></td><td>Single event per enquiry, at its date</td><td>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.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">The hourly job works entirely in UTC: it uses <code>get_posts()</code> with a <code>date_query</code> on <code>post_date_gmt</code>, up to and including <code>current_time( 'mysql', true )</code>, so the site&#8217;s timezone does not affect when an enquiry is released. Before 1.5.9 it passed a GMT offset (from the now-removed <code>lh_crm_gmt_offset</code> filter) into <code>current_time()</code>&#8216;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.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Customer Relationship Management
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.



HookScheduleWhat it doeslh_crm_initial_runOnce, up to a minute after activationGives 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_wakeupHourlyMoves 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&#8217;s 100 most recent enquiries; that sync has been removed.lh_crm_activate_future_enquirySingle event per enquiry, at its dateScheduled 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&#8217;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()&#8216;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.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
