Issue reported by customer: marketing_at_am*(902.900)
Add locations & generate embed.
In the resulting locations the Directions link is wrong.
Reproduction
- Login to a newer customer account (any created after the Google Map Domains update in April 20206)
- Ensure the layout shows directions in the location results.
- Generate Embed and look for a location.
- Click the directions link in the results layout.
Resolution
For this update the core store-locator-plus plugin needed to be updated to return modified options to the backend. The key culprit is the slplus.options.map_domain setting. This is no longer widely used and is primarily for results layout and bubble layout directions to route to the proper public maps web server.
- Created a new SLPlus_Location_Services class that determines which provider we are using. Currently only Google. A method will return the map domain.
- Stopped SLP_Admin_Settings from updating the map_domain setting whenever the default_country was changed.
- In \SLP_UI::add_to_js_options, added a modifier to override any data-driven map_domain stored in customer SLP settings (options JSON) database tables and instead use the new \SLP_Location_Services::get_map_domain() method to determine the proper URL.
- This is called by \SLP_UI::localize_script and should mean this is always present in the map presentation to override any layout options.
Research
For customer: 902.900
Generate Embed
Address: 30041
A Wellness Place – Forsyth
Directions (https://maps.googleapis.com/maps?saddr=30041&daddr=1200%20Northside%20Forsyth%20Drive%2C%20Cumming%2C%20GA%2C%2030041%2C%20United%20States)
Change this to: https://maps.google.com/maps?saddr=30041&daddr=1200%20Northside%20Forsyth%20Drive%2C%20Cumming%2C%20GA%2C%2030041%2C%20United%20States
by replacing https://maps.googleapis.com/ => https://maps.google.com/
Which Google the replaces
To this…
Generate Embed Location Search Code Tracing
In the store-locator-plus plugin at /Users/lancecleveland/phpStorm Projects/WordPress/wp-content/plugins/store-locator-plus there is code that outputs the location results via AJAX as called from js/slp_core.js.
The AJAX backend processor eventually calls this PHP method: \SLP_AJAX::csl_ajax_search
Which calls this PHP method:
\SLP_AJAX::find_locations
The directions URL is NOT coming back in the data.
...
{
"name": "A Wellness Place - Forsyth",
"address": "1200 Northside Forsyth Drive",
"address2": "",
"city": "Cumming",
"state": "GA",
"zip": "30041",
"country": "United States",
"lat": "34.17693900",
"lng": "-84.14032600",
"description": "",
"url": "https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/",
"sl_pages_url": "https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/",
"email": "",
"email_link": "",
"hours": "",
"phone": "<a href=\"tel:770-292-2029\">770-292-2029<\/a>",
"fax": "",
"image": "",
"distance": "3.254983139179455",
"tags": "",
"option_value": "",
"attributes": "",
"id": "11",
"linked_postid": "126",
"neat_title": "",
"data": {
"sl_id": "11",
"sl_store": "A Wellness Place - Forsyth",
"sl_address": "1200 Northside Forsyth Drive",
"sl_address2": "",
"sl_city": "Cumming",
"sl_state": "GA",
"sl_zip": "30041",
"sl_country": "United States",
"sl_latitude": "34.17693900",
"sl_longitude": "-84.14032600",
"sl_tags": "",
"sl_description": "",
"sl_email": "",
"sl_url": "",
"sl_hours": "",
"sl_phone": "770-292-2029",
"sl_fax": "",
"sl_image": "",
"sl_private": "",
"sl_neat_title": "",
"sl_linked_postid": "126",
"sl_pages_url": "https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/",
"sl_pages_on": "",
"sl_option_value": "",
"sl_initial_distance": "679.8441587357",
"sl_lastupdated": "2026-05-07 18:08:17",
"id": "2",
"featured": "0",
"rank": null,
"marker": null,
"identifier": null,
"contact": null,
"first_name": null,
"last_name": null,
"title": null,
"department": null,
"training": null,
"facility_type": null,
"office_phone": null,
"mobile_phone": null,
"contact_fax": null,
"contact_email": null,
"office_hours": null,
"contact_address": null,
"notes": null,
"introduction": null,
"year_established": null,
"county": null,
"district": null,
"region": null,
"territory": null,
"contact_image": null,
"sl_distance": "3.254983139179455",
"in_territory": "0",
"in_territory_class": ""
},
"city_state_zip": "Cumming, GA 30041",
"zip_state_city": "<span class=\"slp_zip\">30041<\/span> <span class=\"slp_state\">GA<\/span> <span class=\"slp_city\">Cumming<\/span>",
"web_link": "<a href='https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/' target='_self' class='storelocatorlink'>Website<\/a><br\/>",
"url_link": "<a href='https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/' target='_self' class='storelocatorlink'>https:\/\/local.storelocatorplus.com\/marketing_at_americanbreastcare_dot_com\/store-page\/a-wellness-place-forsyth\/<\/a><br\/>",
"contact_image_html": "",
"categories": [],
"category_count": 0,
"category_names": "",
"icon": "",
"iconarray": "",
"dial": "770-292-2029",
"exdata": {
"featured": "0"
},
"featured": "0",
"rank": ""
}
...
Directions Output Via JavaScript
The directions URL link in the location results output is generated in the file: wp-content/plugins/store-locator-plus/js/slp_core.js via the slp.setup_helpers method.
That happens here:
// MODIFIER: wrap
//
case "wrap":
switch (modarg) {
case "directions":
prefix =
'<a href="https://' +
slplus.options.map_domain +
"/maps?saddr=" +
encodeURIComponent(cslmap.getSearchAddress(cslmap.address)) +
"&daddr=" +
encodeURIComponent(full_mod.marker["fullAddress"]) +
'" target="_blank" class="storelocatorlink">';
suffix = "</a> ";
break;
This pulls the slplus.options[‘map_domain’] setting.
This appears to be hard-coded to maps.googleapis.com.
SLPlus Options map_domain
\SLPlus – The Default Setting
In the main SLPlus class it sets this value as a hard-coded option.
public array $options = array(
'ignore_radius' => '0', // Passed in as form var from Experience
'map_domain' => 'maps.googleapis.com',
'no_autozoom' => '0',
);
This default setting is what is being sent to the SaaS JavaScript rendering for the results_layout processing.
This should be set to maps.google.com for this purpose.
The Initial SaaS Generate Embed
This is called via a REST backend.
The executed method to load this is from \MySLP_REST_API::search_map.
- front-end/locations.js calls the loadOptions() function.
- This fires jQuery AJAX to execute a REST request for action get_myslp_data (not important)
at the URL at data-rest-path=’//local.storelocatorplus.com/<user-account>/wp-json/myslp/v2/locations-map’
That is a REST endpoint (myslp/v2/locations-map) via registered_route in \MySLP_REST_API that points to \MySLP_REST_API::get_map_options(). - The return result from that API call is processed with a jQuery AJAX done() function, which sets all the JavaScript variables and the environment for the standard SLP core script processing.
- The SLP options can be found in mySLP.slplus.options and this then controls future I/O requests via AJAX.
- This fires jQuery AJAX to execute a REST request for action get_myslp_data (not important)
Changing (Saving) The Option
Set via \SLP_Admin_Settings::save_options
Only when changing/saving default_country (in options_nojs).
Was hard-coded to maps.googleapis.com in the April 2026 release.
=> Changed in 2605.07.XX to use \SLP_Location_Services::get_map_domain
The slplus.options.map_domain is invoked in the following places…
The slp_core JavaScript shortcode processor
In String.prototype.shortcode_modifier if the modifier is ‘wrap’ and the modarg is ‘directions’.
The shortcode_modifier is called by
String.prototype.replace_shortcodes
slp.shortcode_output
replace_shortcodes is called by
Premier results header processing: slplus.options.results_header.replace_shortcodes(…)
SLP bubble layout processing via slplus.options.bubblelayout.replace_shortcodes(thisMarker);
SLP results layout processing via slplus.options.resultslayout.replace_shortcodes(currentLocation),
\SLP_UI_Shortcode_slp_location
Used by \SLP_UI_Shortcode_slp_location::format when the [slp_location …] shortcode is employed by the various layout settings (results layout mostly).
Appears to be rarely (if ever) used.
[slp_option map_domain] Layout Shortcodes
map_domain more typical layout settings use is like this:
In results_layout setting for our Default style or Feeding America Sand Diego setting.
In these places it tends to be used as a URL for directions:
<a href=\”https://[slp_option map_domain]/maps?saddr=[slp_location search_address]&daddr=[slp_location location_address]\” target=\”_blank\” class=\”storelocatorlink\”>…</a>
Default
"resultslayout": "<div id=\"slp_results_[slp_location id]\" class=\"results_entry location_primary [slp_location featured]\">\n <div class=\"results_row_left_column\" id=\"slp_left_cell_[slp_location id]\" >\n [slp_addon section=primary position=first]\n <span class=\"location_name\">[slp_location name] [slp_location uml_buttons] [slp_location gfi_buttons]</span>\n <span class=\"location_distance\">[slp_location distance_1] [slp_location distance_unit]</span>\n [slp_addon section=primary position=last]\n </div>\n <div class=\"results_row_center_column location_secondary\" id=\"slp_center_cell_[slp_location id]\" >\n [slp_addon section=secondary position=first]\n <span class=\"slp_result_address slp_result_street\">[slp_location address]</span>\n <span class=\"slp_result_address slp_result_street2\">[slp_location address2]</span>\n <span class=\"slp_result_address slp_result_citystatezip\">[slp_location city_state_zip]</span>\n <span class=\"slp_result_address slp_result_country\">[slp_location country]</span>\n <div class=\"contact_info\">\n <span class=\"slp_result_address slp_result_phone\">[slp_location phone_with_label]</span>\n <span class=\"slp_result_address slp_result_fax\">[slp_location fax]</span>\n </div>\n [slp_addon section=secondary position=last]\n </div>\n <div class=\"results_row_right_column location_tertiary\" id=\"slp_right_cell_[slp_location id]\" >\n [slp_addon section=tertiary position=first]\n <div class=\"online_info\">\n <span class=\"slp_result_contact slp_result_website\">[slp_location web_link]</span>\n <span class=\"slp_result_contact slp_result_email\">[slp_location email_link]</span>\n <span class=\"slp_result_contact slp_result_directions\"><a href=\"https://[slp_option map_domain]/maps?saddr=[slp_location search_address]&daddr=[slp_location location_address]\" target=\"_blank\" class=\"storelocatorlink\">[slp_location directions_text]</a></span>\n </div>\n <span class=\"slp_result_contact slp_result_hours textblock\">[slp_location hours]</span>\n [slp_location pro_tags]\n [slp_location iconarray wrap=\"fullspan\"]\n [slp_location eventiconarray wrap=\"fullspan\"]\n [slp_location socialiconarray wrap=\"fullspan\"]\n [slp_addon section=tertiary position=last]\n </div>\n</div>",
Feeding America – San Diego
"resultslayout": "<div id=\"slp_results_[slp_location id]\" class=\"results_entry location_primary [slp_location featured]\">\n <span class=\"location_name\">[slp_location name]</span>\n <span class=\"slp_result_address slp_result_street\">[slp_location address]</span>\n <span class=\"slp_result_address slp_result_street2\">[slp_location address2]</span>\n <span class=\"slp_result_address slp_result_citystatezip\">[slp_location city_state_zip]</span>\n <span class=\"slp_result_address slp_result_country\">[slp_location country]</span>\n <span class=\"slp_result_address slp_result_phone\">[slp_location phone]</span>\n <span class=\"slp_result_address slp_result_fax\">[slp_location fax]</span>\n <span class=\"slp_result_contact slp_result_website\">[slp_location web_link]</span>\n <span class=\"slp_result_contact slp_result_email\">[slp_location email_link]</span>\n <span class=\"\">[slp_location distance_1] [slp_location distance_unit]</span>\n <span class=\"slp_result_contact slp_result_directions\"><a href=\"http://[slp_option map_domain]/maps?saddr=[slp_location search_address]&daddr=[slp_location location_address]\" target=\"_blank\" class=\"storelocatorlink\">[slp_location directions_text]</a></span>\n <span class=\"slp_result_contact slp_result_hours\">[slp_location hours]</span>\n [slp_location pro_tags]\n [slp_location iconarray wrap=\"fullspan\"]\n</div>"
New \SLP_Location_Services Class
This class manages third party map services.
Only Google Maps at the moment.
There may be others.
Changing Default Country Should Not Change Map Domain
The Google map domains no longer change when changing the country.
This has been removed.
Workaround
Go to Settings
Click the Results tab.
Scroll down to Appearance and look for Results Layout.
Find this in Results Layout <a href=”https://[slp_option map_domain]/maps?=
Replace it with <a href=”https://maps.google.com/maps?
Code Evaluation / Cleanup
Noticed the map_domain reference is called in these places which are likely defunct:
- wp-content/plugins/myslp-dashboard/assets/scripts/settings.js
- wp-content/plugins/myslp-dashboard/assets/scripts/src/settings.js
- Referenced in \MySLP_Admin::admin_hook
Both are references in this defunct workflow helper as well: wp-content/plugins/myslp-dashboard/Gruntfile.js
Removed the defunct scripts:
- wp-content/plugins/myslp-dashboard/assets/scripts/settings.js
- wp-content/plugins/myslp-dashboard/assets/scripts/src/settings.js
- Referenced in \MySLP_Admin::admin_hook
Cleaned up the \MySLP_Admin::admin_hook overhead.