News

Location Import Process Improved With Power 4.9

With the release of the WordPress plugins version 4.9 of Store Locator Plus and the Power add on we focused on improving the location import process for large lists.      MySLP Power users will see this release by the end of the year after it has passed full testing on our SaaS platform.

Why Did We Change The Process?

Prior to version 4.9 there were a number of limitations that could prevent larger lists of locations from importing properly.    For the fastest servers with lots of memory and super-fast networking as well as a premium tier on the Google API service, Store Locator Plus could import 40,000 locations without any problem.

As WordPress started adding more network overhead, all those update notifications and the news feed in the WordPress dashboard comes from somewhere, the network started to become an issue.   On top of that Google started tracking every single map request so they could start charging people using their maps on a per-lookup basis.     Both of these changes increased the network traffic, slowing down how quickly Store Locator Plus could get a latitude/longitude for those new locations being imported.

Often your server would give up, saying “you had your 30 seconds of my time” and stopping the import mid-stream.    The PHP time limitation on processing is often the first thing that “gives out” when importing large lists of locations.   For most shared hosts the limit is 30 seconds.   Even on a dedicated host it is good practice to not let a PHP process consume more than 120 seconds of CPU time.  This prevents “runaway” processes that take over the entire server which can grind EVERYTHING to a halt forcing a server restart.

The bad news is that if you are importing 10,000 locations and the process gives up after 9,800 locations you have to start over.   At least that is how it USED TO BE with SLP 4.8 and earlier.

How Imports Improved In Power 4.9

With version 4.8 the location import process was “tied to the browser” until it was complete.    When you clicked the “upload CSV” button your browser would sit there attached to the website while the file was uploaded, read line-by-line, each location sent to Google to get a latitude and longitude and then get added to the Store Locator Plus locations list.     If the network was slow this could take a long time, often 10 minutes or more.   That is FOREVER to keep a browser window open these days.

With Power 4.9 we split this process into 3 stages.

Stage 1 : Get The File On The server

This is the only step of the process that stays “attached to your browser”.    The browser will bar processing the page while the file is copied from your laptop to the web server.   This is typically a quick process even for a file with 250,000 locations.    The time it takes depends on how fast your local network and ISP connection is.

Previous versions stored  the uploaded location files in a “hidden” SLP-specific directory under WordPress uploads.   Version 4.9 stores them in the media library.     This gives you an easy way to see that the file was uploaded properly, see what the current import state is, and later download or delete the files when the import is complete.

Stage 2 : Import The Locations Into SLP

After the file is uploaded a detached process starts to work on the actual location import. This ensures your browser doesn’t time out as this part happens in the background.    Your browser is “free to go” while your server does the work of loading in the locations.

It runs a WP Cron job in the background to import the locations WITHOUT geocoding. This is much faster and ensures the import doesn’t disconnect partway through.

As part of improving visibility into this process, Power 4.9.1 will be out soon and will be included in our end-of-year MySLP update.  It includes a cool interactive progress bar as well showing you how many records have been read.

Power 4.9.2 Import Processing Progress
Power 4.9.2 Import Processing Progress Bar

If your server times out before our background location loader finishes reading the file , SLP remembers the last record read and re-spawns a new background job to pick up where it left off. It will do this until it reaches the end of the file no matter how often PHP times out.

Stage 3: Geocode The Locations

AFTER the file has been loaded it will then geocode all uncoded locations.   That means you may catch SLP with a list of locations none of which are geocoded and not showing up on the map.  This is a temporary state while SLP talks to Google.    Since that is always the slowest part of an import we decided to do this in a separate process so at least SOME locations start showing up right away and eventually of them are loaded.

Power 4.9.2 Geocoding Progress
Power 4.9.2 Geocoding Progress

This is similar to the import. It does it in the background and if PHP times out it will re-spawn itself until it has tried to geocode very location at least once. This is a big step toward not having an import time out. It also keeps you from manually having to re-geocode if you hit your daily 2500 location limit and didn’t opt for a paid API key.

Store Locator Plus and WordPress 4.9.1 Updates

It has been a busy week for WordPress and all the updates and patches going around.    For those on our MySLP managed service, sit back and relax.  You’re good.    While you may wait a little longer for some new features and a couple of minor patches you are not going to be affected by software updates.   You’re good.

For WordPress users we’ve been busy chasing down some notable functionality issues with Store Locator Plus and the Add Ons for WordPress since WordPress 4.9 and 4.9.1 hit the update queue on your sites.

Store Locator Plus for WordPress 4.9.1

Any time WordPress puts out a major release we get a slew of new support requests.   4.9 was not exception.   People that have put off updating their site tend to “do everything at once”.  When you are updating a complex system with software from potentially dozens of different companies there are bound to be some problems.    We’ve been busy squashing bugs reported in our software and guiding people towards solutions that are caused by other elements in their software stack.

While WordPress 4.9 does not have “breaking changes” to WordPress itself, we do recommend updating to get the latest security features.  For those staying on WordPress 4.8.2 you can read about the breaking changes in WordPress 4.8.2 that forced users to upgrade Store Locator Plus.

PHP 5.3 Compatibility

As of Store Locator Plus 4.9 we no longer support PHP version 5.2.   We are now properly checking the WordPress version and disabling Store Locator Plus if you are not on at least version 5.3 of PHP.

According to PHP history, version 5.2 was officially at end-of-life, no longer maintained by PHP, in January 2011.  Version 5.3 is marginally better with end-of-life in August 2014.  WordPress recommends PHP version 7.  We do too, but at the very least you should be on PHP 5.6.

In the meantime we’ve fixed some code that was introduced that only works on PHP 5.4 so we can maintain our PHP 5.3 compatibility.

Non-English Blank Settings Tabs

We finally located and squashed the bug that caused some non-English sites to lose settings tab content when switching sub tabs on the Store Locator Plus | Settings interface.

On a related note, if you are using SLP on a non-English site please read our documentation on how you can translate SLP to your language.  If the language files are not at least 93% complete WordPress will not provide translated text on our admin interfaces. This is handled at Translate.WordPress.Org.

Debugging

When an update generates the dreaded White Screen of Doom (WSOD) we often ask people to enable the WordPress Debug Log so we can quickly find and fix code errors in our plugin.   In version 4.9.1 you can now enable “late loading” WordPress debugging from the Store Locator Plus admin pages (assuming you can at least get to those, which you often can) without having to edit the wp-config file.    While it does not catch all errors it will cover 95% of the Store Locator Plus code base during run time.

You can enable debugging via the Enable WP Debug under Settings | General | Admin | Messages | Enable WP DEBUG.

This often generates warnings and messages on your web pages so we do not recommend doing this at peak hours for your site.   In fact we recommend you use a hosting service, like SiteGround’s GoGeek service, that provides “one-click” staging sites that are an exact replica of your live site.    Managed WordPress hosts are rarely more expensive than other hosts; we recommend you consider switching to a host that provides staging services when your hosting contract comes up for renewal.

On The Radar

This patch is not the end of our punch list for this month.

PATCH: Location Page Export | Bulk Actions Not Working We know about an issue we are still trying to replicate where the Power add on and WordPress 4.9 are colluding to not finish loading the Store Locator Plus | Locations pages.  That means the JavaScript for that page does not load completely and lots of weird things happen.  This is new since Power 4.9 and WordPress 4.9.   Given the problems WordPress has had with JavaScript we are not 100% certain who broke what.  We are still investigating and hope to have Power 4.9.1 out in a few days with a fix.

PATCH: Power Tag Search Not Working – we have been able to reproduce this problem and are tracking it down for a 4.9.2 release of SLP or 4.9.1 of Power.   Both updates should be out within a week.

FEATURE: Add On Auto Update – while we try to “go by the book”,  following WordPress Best Practices, their plugin development guide, and the WordPress Core code style guide that allows us to be contributor to WP Core there are times when you have to “be creative”.   WordPress update notifications for Store Locator Plus add ons have been getting worse with each release of WordPress.   We are finding many sites now get notifications weeks after our updates have been published for our paid add ons.    We are working on a new custom update notification system to automatically download and install the latest add ons for Store Locator Plus when the base plugin is updated and no longer compatible with an addon.  We are hoping to get this feature out in the 4.9.2 release if possible.

Having issues?  Please use the support forums as a first line of communication as it helps others with a similar issue see answers we post.  If you cannot post there you can send us an email but email does not show up in the dev’s Slack Channel feed like forum posts do.

Whether posting in the forum or sending email, make sure you post the exact URL for your locator page and copy the plugin environment from under Store Locator Plus | Info | Plugin Environment on the site that is having the issue.  Without BOTH pieces of information it takes us a LOT longer to figure out what may be happening on your site.   It also helps to provide us with step-by-step instructions to reproduce the problem and see what you are seeing, as in “Go to this page <url here>, type in 29464 as the address, search.   I expect to see store A, B, C and instead I see store B, and C only.”

Example Plugin Environment Detail

Did you know on MacOS you can get a screen shot by holding down the command key + shift + 4?   It is a great way to show us your plugin environment.

 

Store Locator Plus 4.9 and PHP Compatibility

For our MySLP users, these types of issues do not affect you.  All of the MySLP servers are running PHP7 with the latest security patches.   Ahhhh, the benefits of using a managed service.   Sit back and relax, PHP compatibility is one less issue to worry about.

For our WordPress plugin users

Store Locator Plus for WordPress version 4.9 has some PHP compatibility issues.     It currently will only run on sites that are using PHP version 5.4 or higher.

An update to SLP , Power, and Premier 4.9.1 are in development that will restore PHP 5.3 compatibility.    Those updates are slated to be release by the end of November, 2017.  Experience is not impacted by this issue.

PHP 5.2

For our PHP 5.2 users, unfortunately we can no longer support that release of PHP.   We are using a new architecture based on a PHP function that was added to PHP in February 2012.   That change in SLP 4.9 means sites using PHP 5.2 can no longer use PHP.

 

PHP Recommendations and History

For all users it is recommended you upgrade to PHP 5.6 at a minimum.  There are dozens of security patches in PHP between each point release (5.2 => 5.3 => 5.4, etc.) some of which are significant.

For reference, here is the PHP Version Release History.   Supported until means the last date the PHP language was fixing problems and patching security holes.
VersionLatestSupported until
5.25.2.176 January 2011
5.35.3.2914 August 2014
5.45.4.453 September 2015
5.55.5.3821 July 2016

 If your host is not allowing you to upgrade to a newer release or a WordPress plugin or theme breaks on PHP 5.6+ you should ask why.    WordPress (and Store Locator Plus) run perfectly well on PHP 7 which is the current recommendation from WordPress due to the notable performance improvements in version 7.