-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Maps Cache #25
Comments
@TornMarketing, what exactly do you have in mind, in terms of Toolset CLI functionality? Unfortunately, we currently have no capacity to develop new features for this tool, but we accept PRs. |
With toolset maps, I haven't seen an ability to cache google coordinates for Address fields in a programmatic manner. We use wp all import via cli to bulk import and update records for which there is no ability to insert known coordinates into the cache, field only accepts text addresses. So looking at options to get coordinates efficiently to selectively purge, update and insert cache address records. Only solution I have atm is to call the fronend address via the shortcode per record or manually jump in and run the missing records from admin ui |
I have found some pointers, there is a pretty isolated functionality for this in the Toolset Maps code. The class // This data is coming directly from API, and needs to be saved to cache table as is - especially the address,
// which is later on a SQL join point between postmeta and address cache table, so even a single character
// change would break that. That's why any sanitization and/or escaping needs to happen after the data is read
// from database. We are protected from SQL injection, of course, in update_cached_coordinates(). And, actually
// lat and lon are sanitized by db itself when they are inserted using ST_PointFromText() SQL function.
$address_passed = toolset_getpost( 'address' );
$address = toolset_getpost( 'formattedAddress' );
$lat = toolset_getpost( 'lat' );
$lon = toolset_getpost( 'lon' );
if ( ! array_key_exists( $address_passed, Toolset_Addon_Maps_Common::get_cached_coordinates() ) ) {
Toolset_Addon_Maps_Common::update_cached_coordinates( $address_passed, $address, $lat, $lon );
}
|
Is there any scope to support caching google map coordinates?
The text was updated successfully, but these errors were encountered: