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.