Category Archives: Base Plugin

Base Plugin information.

Q. Why am I seeing a message that I do not have sufficient permissions when I am trying to manage my locations?

You Do Not Have Sufficient Permissions

If you are getting the message “you do not have sufficient permissions to access this page” when trying to access the “Manage Locations” or “Map Settings” page, but “Add Locations ” is working it is because another plugin is interfering with the submenu management module in WordPress. You will likely find that any plugin that has a separate sidebar menu with multiple entries underneath will only work on the first entry. There is little we can do to remedy the situation without risking breaking other plugins. We suggest deactivating other plugins, one-at-a-time, until you find the plugin causing problems then ask them to rewrite their menu and submenu process and admin panel filters to ensure the basic menu system remains intact.

Q. I see a gray map or blank map and search does not work

JavaScript Problems

Issues with the JavaScript part of the plugin usually manifest themselves by showing the search form but either a blank map, a map that is all gray, or a map that appears but search does not work. To debug these issues use the Firebug add-on with Firefox as noted above.

The WordPress Store Locator Plus map rendering is managed by the slp.js JavaScript file.  It sets up the communication with the built-in WordPress AJAX handler, admin-ajax.   Your server must be setup to allow the built-in WordPress AJAX handler to execute.

The PHP JavaScript connector did not load

We have come across this error on several installations. The short answer to this problem is that something in the WordPress installation prevented the Store Locator Plus JavaScript component from loading. This means that the map system cannot communicate with Google. This prevents the map from appearing and search results from working properly on your locations page.

Here are some issues we’ve come across that cause this to happen:

    • PHP version is < 5.2, this generates an error message that you will not see in the browser. Any error message will prevent the JavaScript PHP file from loading.
    • PHP Error Reporting Enabled, if PHP error reporting is enabled and ANY PLUGIN has bugs, uses deprecated WordPress functions, or uses deprecated PHP functions they will generate an error message. This error message can be hidden in the browser if the error happens in something that is creating page header information. This will also break the page loading process and prevent the JavaScript PHP from loading.
    • Plugin Errors, any plugin that does not load properly and does ANYTHING with page header output will break and thus cause a domino effect prevent the Store Locator Plus PHP JavaScript component from loading.

In many cases the cause of the maps not loading is because our PHP JavaScript file could not load. We can often detect this and pop-up the “PHP JavaScript connector did not load” warning. However we cannot catch all errors.

One of the best tools for searching for errors in the HTML page headers is to use Firefox with the Firebug plugin. Turn on the console and check the responses tab for any errors. We have resolved many client installation and map problems with this plugin. More often than not we are finding errors in other plugins, themes, or server configuration settings on the servers. No, our plugin is not perfect and is not 100% bug free (we wish it were) but we are no longer finding bugs in our plugin as the primary culprit in broke installations.

The PHP JavaScript page header is a critical part of a working Store Locator Plus installation. Since it loads very late in the page creation process it is susceptible to failures from almost anything else you may be loading on the page or your WordPress site. The the map is not loading and you are receiving this message get some page debugging/tracking tools like Firebug and isolate any plugins that are generating coding/output errors.

Search and results not loading

AJAX Blocked

It is common for web hosts and system administrators to disable the built-in WordPress AJAX processing.   Store Locator Plus requires AJAX to be enabled.   This typically manifests itself with the AJAX call to the admin-ajax.php script not executing.

You can test this by directly surfing to the admin-ajax script on your server with a URL similar to this:

/wp-admin/admin-ajax.php?action=csl_ajax_onload&addressInput=&ignore_radius=1

This should return a JSON response showing curly braces that start with {“success”:true,…

If it comes back with nothing, or a warning/error about being blocked, your AJAX security is not set properly.  Check you web server log files and talk to your system admin for assistance on configuring access to WordPress AJAX scripts.

Downgrading Store Locator Plus

As we continue to phase out the legacy add ons you may find that one of the add ons you purchased no longer works with the latest version of the free Store Locator Plus plugin for WordPress.  You have a few options when this happens.

Option 1 : Upgrade Your WordPress Add On

Enhanced Map, Enhanced Search, Enhanced Results, and the Widget Pack features are now part of the Experience add on along with dozens of new features.

Pro Pack, Tagalong, Pages, Contact Extender and Directory Builder are not part of the Power add on.  It also has new features that were not part of the legacy add ons.

Combining multiple add ons into a single larger add on allowed us to make the code more efficient.  It is a little faster, uses a less memory (important for high traffic sites), and works with the latest features of Store Locator Plus and WordPress.

Option 2 : Downgrade Store Locator Plus

If you upgraded moments ago and have not published new blog posts, received WooCommerce orders, or had other activity you want to retain since upgrading the base plugin you should be able to restore your latest site backup.  You are backing up your site with a solution like VaultPress, aren’t you?    If so a few clicks will put your Store Locator Plus plugin back to the version you were running earlier today.

No backup or too risky to restore?  You can download and re-install the older version of Store Locator Plus.  You can get the older versions of the install zip files from the WordPress directory.

https://wordpress.org/plugins/store-locator-le/developers/

Select the latest version that did not disable your legacy add on.  It will download a zip file.

Login to your WordPress admin panel.

Deactivate Store Locator Plus and delete it (your locations and most* settings will be retained).

Add a new plugin, select “upload” and select the SLP zip file you just downloaded.

*Most settings will be retained.   Sometimes we migrate settings between versions to speed up the options processor.  When we add a new feature or fix a bug we may find that we need to rename a setting.    If something is not exactly the same check your settings first.  99% of your settings will not change.  We also try not to change settings between upgrades but sometimes it is inevitable.    Also – this is ANOTHER great reason to be using a backup service.    Point-in-time restores will not only restore the plugin code but all the settings in the options table!

Option 3 : Migrate to My Store Locator Plus

MySLP is our SaaS service that works with any web or mobile app including WordPress and brings most of the features you find in the base plugin plus some extras with it.   The Professional level includes all of the Experience and Power add on features.  The Enterprise level includes all of that plus the Premier features.

We take care of backing up the data, fully testing the software between releases, and are adding custom MySLP features on a regular basis.     We manage the location server, geocoding limits, and all the other overhead of the locator.  You just enter locations , turn the “dials” to set the look and feel of the locator, and paste a short snippet of JavaScript code on any page or post where you want your locator to appear.

 

Using Custom Map Markers

Store Locator Plus allows you to set a custom marker for all of your locations.

Upload Your Marker

Start by uploading the marker to a web accessible location.

WP SLP

Go to Media / Add New in the WordPress admin panel.

Upload your marker.

View the attachment details for the newly uploaded marker and copy the URL.
Continue reading

The [slp_search_element] Shortcode

The [slp_search_element] shortcode is only processed within the Search Layout setting.   It is used to display user input elements on the search form.

Attributes

Attributes are the keywords that appear after the opening [slp_search_element and before the closing ].

Default attributes include:

button=<slug>

Output a form button.  <slug> should be an input supported by the base plugin or an add on such as:

submit

Output the Find Locations button.

 

dropdown_with_label=<slug>

Output a dropdown selector with a preceding label for the specified input.  <slug> should be an input supported by the base plugin or an add on such as:

radius

Output a dropdown of radius selections based on the Experience / Search / Radii Options setting.

hard_coded_value=<value>

Outputs the specified value.  Used by some add ons to add a specific [slp_search_element] output.

input_with_label=<slug>

Output a input selector with a preceding label for the specified input.  <slug> should be an input supported by the base plugin or an add on such as:

address

Output a the address/zip-code input box.

Tech Geek Stuff

Processed by the SLP_UI class via add_shortcode in create string_SearchForm() which calls crease_SearchElement().

Filter shortcode_slp_searchelement is used to manipulate attributes.  Many add ons use this to render specific output using attribute ‘hard_coded_value’ => ‘xyz’ to output a specific value.