After releasing version 1.4.4 of the Cardinal Store Locator plugin several support requests were submitted about issues with geocoding locations when using the default or alternative custom post type for location data. Prior to version 1.4.4 no key was used for the request because none was required but since Google changed their requirements, the Cardinal 1.4.4 patch added the value of the Google Maps API key field from the plugin’s Primary Settings tab to the requests. If you had followed the instructions to secure your API key by using the HTTP referrers restriction the back-end requests would still return an error because it turns out the back-end geocoding requests are not accepted with that HTTP referrers restriction in place. While this may seem like an inconvenient extra step it is the Google requirement and there’s no getting around it.
Several attempts were made to try to work around this issue so that another key would not be required but nothing worked when considering that some license holders are using the plugin on shared hosting environments. In version 1.4.5 of the plugin when looking at the Primary Settings tab two API key fields will now appear if you are using the default or alternative custom post type for your location data. If your site is running on a dedicated IP address you can instead switch to IP address restrictions for the API key restrictions and continue only using the Google Maps API key. Otherwise, it’s recommended to create a new key for the back-end requests and leave it unrestricted.
To create a secondary API key for the back-end requests:
- Login to the Google Cloud Console
- Select the appropriate project from the drop-down at the top left
- Click on APIs & Services in the left column
- Click Credentials in the left column
- Click Create Credentials > API key >copy the presented key
- Paste into the new Geocoding API key field under Primary Settings in the plugin settings
TL;DR There is a new field for back-end geocoding requests under Primary Settings in v1.4.5. If you use the HTTP referrers restriction you need to create a second key with just the Geocoding API enabled and no restrictions. Then add the key to the Google Geocoding API key (back-end) field.