Geocoding Locations On A Schedule

The Premier Add On includes an option to run location geocoding on a regularly scheduled interval. This can be useful for a hands-off approach when loading locations remotely through direct data connections.

Scheduling Geocoding

To setup recurring geocoding you will need the Premier Add On and Power Add On running with Store Locator Plus 4.7.1.

Go to the General tab.

Select the Schedule subtab.

Select the recurring interval for the geocoding event from the drop down.    All of the events will run “on the hour” other than now and never.

The Intervals

Never

Select never to turn off the recurring geocoding.  This will take any scheduled geocoding events out of the queue.  You can manually recode your locations via the Manage Locations bulk action provided by the Power Add On.

Now

Now will run the geocoding event one time through the cron process.  It will be scheduled to run 10 seconds from the time you save the change.

This can be useful in cases where you want to immediately geocode all uncoded locations but do not want to tie up a browser session with the process as happens via the Manage Locations bulk actions.

Hourly

Runs every hour on the hour, starting at the next “top of the hour”.

Twice Daily

Runs every 12 hours starting at the next “top of the hour” and every 12 hours thereafter.

Daily

Runs every 24 hours starting at the next “top of the hour” and every 24 hours thereafter.

Notes

Geocoding Limits

The geocoding process through the scheduler follows the same rules as other geocoding processes.  It is held to the same geocoding limits imposed by Google for number of locations that can be geocoded at one time.  Obtaining a Google API Key is a good idea to help alleviate limitations, especially on shared hosts.

PHP Time Limits

Large sets of locations may take longer to geocode than can be processed before the cron job reaches the PHP time limit.   It can take multiple sessions to geocode locations.

Session Lag

Cron events are a new session that runs in parallel to active web sessions.  WordPress triggers these cron sessions by users interacting with your website.   A user that is loading a page when WordPress fires the cron trigger may notice a slower initial page load.    That is a side effect of WordPress cron jobs versus system-level cron jobs.  The WordPress Cron development guide explains this further.

WP Cron Not  A Perfect Timer

WordPress Cron events are an imperfect scheduler.   There are some benefits to this however there is a notable side effect of events not necessarily running when scheduled.   On high traffic sites the events run near the scheduled time but on low traffic sites the events could run hours after the scheduled time.

Related Articles

https://docs.storelocatorplus.com/blog/viewing-wordpress-scheduled-events/

https://docs.storelocatorplus.com/blog/getting-started/

 

Add Ons That Support This Feature

Enroll in a Premier Subscription
Support product development : Purchase a Premier Subscription
Buy The Power Add On
Buy The Power Add On