Google Server (Browser) Key for WPSLP

Get A Google API Key

This section pertains to the WordPress Store Locator Plus plug-in   which is the free base plugin for those WordPress administrators who are controlling the plugin and updates.  If you are a subscriber to  MySLP, our fully managed locator SaaS service, you can ignore this page.

Before you get started you will need to get a Google Maps Javascript API Key.

Please note, there are some misleading instructions in the Google developer console telling you to  create a browser-restricted API key when you move your site to production. You do not need to do that but if you do then you will also need a second unique key to add in the second field under the SLP/General settings the Geocoding API key.  Either way you must “enable” both the Maps  and Geocoding APIs.  When you create your project , obtain  your Maps Javascript API you will see selections under the Maps Javascript API for more options.   One of those options is Geocoding API.  Check to see that is also enabled for your project. View the support documents under google for more information. They have added many different APIs. The ones you need for WPSLP to work properly are the two in the screenshot below, referred to as Maps Javascript and geocoding (not to be confused with geolocation). The Geocoding API  converts addresses into geographic coordinates (geocoding), which you can use to place markers or position the map. This API also allows you to convert geographic coordinates into an address (reverse geocoding).

Step 1: Go To the Google Developer Site

T_PAAMAYIM_NEKUDOTAYIM

T_PAAMAYIM_NEKUDOTAYIM is the scope resolution operator.    In most languages it is the double-colon (::).

Most people that are looking for this odd-looking word are probably running into an issue with a PHP program.   For as often as it comes up, there is very little information on what is causing the problem.

With PHP it typically means the application has a syntax error.    The PHP interpreter cannot figure out how to compile your code properly and crashes with the Unexpected T_PAAMAYIM_NEKUDOTAYIM error message.   Often it is due to a class name or static method reference that PHP cannot handle.  Either the class name is entered incorrectly OR your PHP version is so old it cannot process variable names before the double-colon operator.

For Store Locator Plus™ users that are still using the WordPress plugins it most likely means the version of PHP you are running on your web server is very outdated.  Upgrade PHP to a newer version, preferably something that is supported in the past 5 years like PHP 7.

User that chose the fully managed Store Locator Plus™ service don’t have to worry about things like this.

Location Sensor Aware

The Location Sensor capability is a Power feature in WPSLP or Professional feature in MYSLP.

Location sensor feature can be  turned on/off with a simple check box under the SLP/General/User Interface tab.

MYSLP Power Level or higher Plan
WPSLP Power add-on General tab

 

 

 

 

 

When the box is checked and a visitor to your site performs a search , SLP queries the browser and requests their current location.    If the browser allows location queries it will return their geographic location which will be used to set the default search location.

Note:  This will only work with most browsers if you have a secure site or if your site visitor “allows” there location to be visible to you.  Google Chrome has had restrictions since Chrome version 50 (released in 2016)  that they will only return locations using location sensor if the  request is generated within the url of a valid secured site (https://).  See the Google developers console for more information.

Google  returns a “No results found” if you do NOT have an HTTPS site and will stop the javascript from loading. An update to SLP with the Power add-on will negate Location sensor settings entirely if you do not have https://  so that your page continues to load.   If you require the location sensor functionality to work properly you must have  a valid SSL certification.

Location Aware Browsing

Accuracy varies greatly from location to location. In some places, service providers may be able to provide a location to within a few meters.  All locations returned by service providers are estimates only and we do not guarantee the accuracy of the locations provided.  Your SLP settings also determine the number of locations shown nearest the site visitor.  Settings for radius, number of results to return and center of map  all interact to show locations nearest to the site visitor.

Location Limit URL control

Location Limit

The location limit feature is available exclusively to our Store Locator Plus Premier/Enterprise customers.

When the URL Control module is active you can enable location ID passing by turning on “Location Limit” under the General / User Interface tab.

When this is enabled you can pass in a limit for the number of locations to be returned when the map initially loads and when a search is performed by adding ?limit=<id> to the end of the page address where your locator map is deployed with the [slplus] shortcode.

Example: Client has 250  results to return by default but when the site via a URL link loaded they only wanted 5 to come back.

Location Limit functionality supersedes the initial default limit.

Store Locator Plus INFO Plug-in Environment

Plug-in environment

We often have questions posted from users asking why something is or is not working. The information needed to be able to assist them properly and efficiently is shown under the SLP/INFO tab. It is called the Plugin environment.

 

Plugin environment example

What is meant by the  Plugin Environment.

The plugin environment shows the versions of Store Locator Plus, and any active SLP add-ons you have installed, as well as the WordPress version, php version, MYSQL , the domain name and other useful data specific to the WPSLP environment.

This information is required when posting in forums. You can also  find the latest release versions under your account Downloads List, and/or review the Versions under the Support tab on the WordPress Store Locator Plus  home site  to see if you have the most recent version of Store Locator Plus and the various add-on packs.

 

CSV Import Zip / Postal Codes

When creating a CSV import file make sure the zip / postal code column is properly formatted as text so you do not lose leading zeros.

The column header for postal/zip codes is zip or sl_zip.

In the United States many northeastern postal codes start with zero.   Many sheets, Microsoft Excel in particular, LOVE to lead off the leading zero if you enter a zip code as 03907 and save as CSV.

Invalid Postal Codes
Invalid Postal Codes

In Excel, and many other apps, you can force a field where you are typing in numbers to be text by starting your entry with an apostrophe (‘).  Type ‘03907 when entering the data NOT 03907.

A good test is to open your CSV file in Google Sheets and see what it looks like.  Does it look like the sheet above missing a zero?  The data is likely wrong.

Another indicator that this column is set to a numeric type and not an text type is the data is on the RIGHT SIDE of the cell.  Text is left-justified (like sl_state) and numbers are right-justified.

Note:

If you are using the WPSLP “do it yourself” plugin with Power add-on and you have not included the latitude and longitude and require geocoding , make sure you have a Google API account and have checked off the Maps and Geocoding APIs in your library.

 

MySLP: Deploying On WordPress

These instructions are for MySLP users only.  

MySLP is a monthly subscription service that allows you to deploy a locator map on ANY platform including WordPress.   It is a managed service where we handle the hosting of the locations, settings, and map software.   We keep the software updated so you don’t have to worry about it.

These instructions DO NOT APPLY to WordPress plugins.

For our buy-it-and-own-it solution you will want to look at the WPSLP plugins instead.

If you are NOT using My Store Locator Plus® you should think about it.

 

 

If you are using MySLP, read on…

You’ve already added your locations and generated your embed code per the instructions in our Getting Started post.  Now you are ready to deploy on your WordPress site.

Here we are going to deploy the script in a new page on our site.

MySLP : Deploying With Basic HTML

My Store Locator Plus can be deployed on any website technology that can publish basic HTML pages.   The functionality of the service depends more on the browser technology used by your site visitors than your web stack.

The most basic deployment is a local HTML file that is opened by your web browser.   Your desktop or laptop and even some mobile devices will allow you to create a basic HTML file on your device.   You can then open this file using that device’s web browser.