Troubleshooting

Store Locator Plus works well in most installations, however WordPress is a highly customizable product that is heavily modified by plugins and themes.  Some plugins and themes are professionally developed while others are built on a whim.    Not all plugins or themes are created equal, and not all are fully tested before being “released into the wild”.   The combination of thousands of themes, thousands of plugins, and a wide variety of production quality created millions of variations of WordPress installations.    While our plugins work well in most standard scenarios, there are always going to be environments that cause problems.  Hopefully these troubleshooting tips will help.

Check Your Add On Versions

The base plugin and add-on packs are updated on a regular basis.  Often the updates include fundamental changes that are designed to improve performance by reducing the memory and/or disk request load when your visitors are interacting with the map.   Making these baseline changes often requires removing unused code or relocating it within the Store Locator Plus system.  What does this mean for the casual plugin user or system administrator?

Whenever you update the base plugin make sure ALL of  your SLP add-on packs are updated to the latest version as well.

Since this is a significant issue when it comes to maintaining site stability, newer versions of the add-on packs now communicate more details to the base plugin to help provide at-a-glance add-on pack information on the main Store Locator Plus / Info tab.    However if you have not yet upgraded your add-on packs or if the upgrade communication server is offline you can still check your add-on packs manually.

Upgrading An Add-On Pack

First upgrade the base plugin.   It is a standard WordPress plugin and the WordPress plugin directory is kept up-to-date with the latest release.  Go to dashboard / updates and click “check again”.   If there is a newer version of Store Locator Plus available it will show up here.  Install the update as usual.

If there are any SLP add-on packs available they should show up on the upgrade list, however the WordPress hooks that query remote servers do not always respond fast enough to notify you when a non-WordPress-hosted add-on pack has an upgrade available.   Follow these steps to upgrade your add-on packs:

  • Check the release notes page to see what the latest add-on versions are.
  • Go to  your WordPress admin panel plugins page.    Compare your installed versions to those listed.
  • Login to your account on the Store Locator Plus website.
  • Download your add-on packs for any that are out-of-date.
  • Via your WordPress admin panel, deactivate and delete the outdated add-on packs.
  • Via your WordPress admin panel, install the zip files you downloaded from the Store Locator Plus site, activate the add-on packs.

Store Locator Plus 4 Version Upgrade

Mixing Store Locator Plus 4 (SLP4) with Store Locator Plus 3 (SLP3) add-on packs (or vice-versa) can cause a wide variety of problems on your website.  Many error messages can and probably will show up on  your admin panel, main web pages, or in the WordPress error logs.   They are the most common indicators of mixing SLP3 and SLP4 products:

  • Fatal error: Cannot use object of type SLPlus_Data as array
  • The setResultsString method is no longer available.
  • The create_InputElement method is no longer available.
  • Call to undefined method SLPlus::VersionCheck()

Version 3 and Version 4 Do Not Mix

You cannot use Store Locator Plus 3 add-on packs with the Store Locator Plus 4 base plugin.  Version SLP 3 is not maintained nor supported and we are not responsible for any security issues or compatibility issues  if you downgrade to 3.xx

When you upgrade your base plugin from SLP3 to SLP4 you must de-activate and delete ALL older versions 3 or below add-on packs until you purchase the SLP4 compatible version of the add-on pack.   Make sure you download the SLP4 zip file from your account on the Store Locator Plus website, upload and activate the new version.

Downgrade The Base Plugin From SLP4 To SLP3

NOT recommended: But if you do not wish to purchase the SLP4 add-ons and  compatible upgrades you can always downgrade to SLP version 3.11.23.

 

Checking For SLP3 or SLP4 Add Ons

Checking if your base plugin or add-on packs are version 3 or version 4 compatible releases is easy.

Go to the WordPress plugins page and look at the plugin versions.

All of the  compatible add-on packs start with version 4.  Most are version 4.4 or version 4.3 (legacy).  If your add-on pack starts with anything lower than version 4 it is NOT an SLP4 add-on pack and is no longer supported or maintained.   The Store Locator Plus plugin and all add-on packs must start with version 4 or you will have  functional issues on your site.

If the base plugin and add-on packs start with version 0, 1, 2, or 3 then they are SLP3 add-on packs. .

Make sure all of your plugins are up-to-date.

The versions info page will show all add-on versions.

No Locations Are Being Shown

The most common causes of locations not appearing are shown below.   The best way to see what is going on is to look at the Debugging entry on this page and follow the section about “Debugging JavaScript”.  Web browser tools such as Firebug in firefox are very helpful.  Especially the Network/XHR panel that shows the communication to your WordPress server via AJAX.  It will show the post request and the results returned.  If things are breaking there is usually an error message in the results that are coming back.

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:

http://charleston.wordcamp.directory/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.

Search Parameters Are Incorrect

If the map is rendering but the search is not behaving as expected, read our article on How Search Works.

Check your radius and make sure the default is large enough.  Keep in mind there are two sets of parameters in the User Experience panels.  There is a radius and number of results parameter for immediate mode (locations loaded when map is first shown) and search mode.

Also check that the map zoom is set far enough out to show locations.

Different Host or Domain Name

Some sites use a variety of host and domain names for different sections of their site.   Web servers and browsers will block most AJAX requests that do not original from the same host and domain as the back end server process.    The easiest way to manage this conflict is to use web configuration, such as Apache’s mod_rewrite rules via the .htaccess file,  to redirect AJAX requests to the proper URL.

On this site the natural fully qualified host name is charlestonsw.com.  However I often employ the alias StoreLocatorPlus.com as it is easier for people to remember.   The customer location map will break if I do not have a domain redirect setup that automatically changes the URL from www.charlestonsw.com to www.StoreLocatorPlus.com when the user visits my site.   This is done with basic mod_rewrite rules like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# StoreLocatorPlus redirect
RewriteCond %{HTTP_HOST} !^(www.)?charlestonsw.com$ [NC]
RewriteRule ^(.*)$ /$1 [L,R]

</IfModule>

Map Issues

Map not appearing

ARE YOU ON WordPress 4.5?

READ THIS POST about what is breaking your map and what needs to be done.

This happens when there is a problem with the JavaScript coding. This can happen if you do not have all of the PHP modules necessary to run the plugin or if you have an older version of PHP running your site or if your theme or another plugin is using an old version of jquery.  You can check the Store Locator Plus Info  page to see what version of PHP you are using.

This plugin requires:

* PHP v5.1 with SimpleXML enabled

* PHP v5.2 or higher has SimpleXML built-in by default

  • Optimal PHP v 5.4 or higher

Using Firebug To Debug Map Display Issues

We strongly recommend using Firefox with the Firebug plugin to track down any problems with the CSS or JavaScript on your site. 90% of the problems with the map not appearing are due to either bad JavaScript prior to the Store Locator code being called, or themes the overtake all image output. The map is very image heavy using hundreds of small images from Google’s server to draw the map. If your theme does not play well with images it can override the settings we’ve built into the plugin.

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.

Store Locator Plus map rendering is primarily driven by a pair of JavaScript files the work closely together. The csl.js file sets up the environment. That plugin has error reporting disabled as it can cause problems for the site if general PHP errors are encountered. You can change that setting during debugging sessions by going to the plugin editor. Look for the csl.js file, and edit the first line of code to read error_reporting(1). When you are done debugging set it back to error_reporting(0).

If there are PHP problems with the plugin you will see them by surfing to your map page, then looking at the console tab inFirebug.

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.

Manage Location Issues

Manage Locations not showing locations

Check your Display settings. If it was set too high and your server cannot accommodate or load that much data at one time and , you will not see the back-end locations page even though they appear on your site front end.  Use the RESET Manage Locations  button under General settings. This will set it back to the default of 10.  If you are using an older version of SLP, this can be achieved with the free Janitor plugin.

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.

Currently we know of these plugins that break the submenu module: WP Shopping Cart v3.7.6.1 – possibly newer versions as well.

Map Settings Issue

You Do Not Have Sufficient Permissions

See the same topic in “Manage Location Issues” above.

Installation Issues

PCLZIP_ERR_BAD_FORMAT

This error most often occurs when the user installing a plugin file cannot unzip the file to the local drive.   The reasons for this include:

    • Incorrect permissions on the plugin directory.
    • Incorrect permissions on the uploads directory.
    • Overly restrictive SE Linux settings.
    • Insufficient disk space on the drive where WordPress is installed.
    • Disk quota on user account has been reached.
    • Disk quota on server account has been reached.

Debugging

The “Map” Page

JavaScript Issues

The first thing to do when you are having a problem is to check for JavaScript conflicts.  It is the number one reason that Store Locator Plus fails.    If JavaScript breaks, even from within another plugin, it can prevent SLP from loading.    Use Firefox with the Firebug add-on.   Turn on the console and script debugging and look for errors.  Also check to make sure the /store-locator-le/js/slp.js script is loading on the page where your map is supposed to appear.

Admin and Map Issues

WordPress Debugging

Often there are hidden warnings or errors.  Sometimes they are generated by the plugin.   Many times they are generated by OTHER plugins or your custom WordPress theme.   The first stage of debugging is to turn on the built-in WordPress debugging messages and debug log.

Find your wp-config.php file and make the following changes.

Find the line:

define('WP_DEBUG', false);

Edit that line and add another to the wp-config file to turn on logging:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Read this Debugging WordPress article for more info.