Fall 2023 Locator Updates

We have been busy catching up on some much-needed maintenance updates to the Store Locator Plus® family of plugins. While our SaaS service has been running smoothly, there have been several issues that needed to be addressed with the WordPress plugin versions. Some of the issues are related to changes in WordPress core with breaking changes — things they changed that no longer work the way they used to. Other issues, which have come up more recently are due to breaking changes in MySQL — specifically MySQL version 8 and higher.

Large File Imports : November Fall 2023 Locator Updates

Users of the Power add on that were importing large location files would run into issues if they were also using PHP 8.2 or higher. Large files are handed off to a background processor (cron jobs in Linux-speak) for WordPress to prevent browser time out and connection issues. Since larger files often take more than the 300 seconds most PHP servers configurations allow, Store Locator Plus® first uploads the file to the media library (usually takes less than 300 seconds even for large files) , the reads that file in chunks via an asynchronous cron process to ensure the entire file is processed even when the server says “you used up too much of your allowed time, we are shutting you off”.

Store Locator Plus® implemented this “chunk processing” years ago (2018 maybe?). After uploading a CSV file, Store Locator Plus® starts a timer in the background that runs every minute asking “did my file import finish?”. To do so, it keeps track of the import progress via meta tags associated with the media file stored in WordPress. These meta tags including things like how many lines were read, how many were processed, and other metrics that this timer can look at to determine if the entire file was processed. If not, it starts processing more of the file from where it left off. When it finishes the timer is deleted so the app does not keep taking up system resources.

Unfortunately a code patch in the 2310.XX updates disabled this cron process, which stopped all large files from importing. This has been resolved.

MySQL 8 Changes

Last month we updated the Store Locator Plus® WordPress versions to support MySQL 8 and higher. Turns out MySQL (not MariaDB, the open source and free counterpart many hosting services use — MariaDB still works as expected) decided to allocate the word “RANK” for their own internal use. This new “reserved word” happens to match a field name we have been using one of our add-ons for years. Now that field name breaks things for users running the “bona fide” Oracle version of MySQL 8 or higher. Thankfully there is a simple workaround which has been patched in the October Fall 2023 Locator Update.

Unfortunately, anyone that manually upgraded their MySQL version from pre-8 to 8+ probably broke things on their Store Locator Plus® installs; Especially if they decided to activate the location ranking feature after doing so. While generally a good idea to review things like breaking changes BEFORE upgrading a database engine, life it hectic and often the “upgrading is better, get it done” path takes precedence in these situations.

For users that upgraded the database and had an existing Store Locator Plus® installation, the data structures and related functionality for ranking will remain intact and work fine if all our plugins have been updated to 2310.XX or higher. If ranking was enabled AFTER the database was upgraded you may need to remove the wp_slp_extendo and wp_slp_extendo_meta tables, then re-install and re-activate the Experience add-on (you may also need to reset the WordPress meta that marks the current installed version of this plugin).

Anyone installing on a NEW installation of WordPress with Store Locator Plus® add ons for ranking locations likely ran into an issue before our 2310.XX version of the plugin. The best path forward here is to deactivate the Store Locator Plus® plugins, manually remove the related data tables (wp_slp_extendo, wp_slp_extendo_meta, wp_store_locator), and the entries from the wp_options table for SLP related settings (option_name like ‘%slp%’) to clear out any “cruft” before re-installing and re-activating the SLP plugins.

Fall 2023 Random Locator Updates

We’ve also been doing some clean up now that PHP 8 is in play on most servers. PHP 8 is far less forgiving, and yes, they too added breaking changes where the latest version no longer plays nice with code that worked perfectly fine in earlier versions. Multiple PHP 8 warnings have been cleaned up in the past month, though none will break the app it does create extra log entries on the server so it is always nice to clean those up.

Items we addressed include:

  • Fatal Errors : code will stop running
    • SLP_Power_Cron::$addon access level
      The Power add on visibility of the $addon variable was set to the lower-level private access when the base class it extended requires protected or higher visibility.

      Declaration added in 2023.10 per IDE recommendation that dynamically scoped variables are not longer allowed in PHP 8.2 with incorrect private $addon; property declaration on the class. The proper fix was to remove the phpDoc comment block hints that declared a hint for the property, indicating it was private to this class (phpDoc or IDE doc rules processing bug).
  • Warnings : code will run
    • version_compare() – null parameter not allowed
      Happens when a prior version was not installed (null) , which PHP 7 evaluated as “nothing” and version_compare() would return “this version is not newer”. It still does that but explicitly wants a value instead of null to compare against (we set the installed version to match the current version, which returns “this version is not newer”.

Store Category Management Improvements

Store Locator Plus® was updated today with store category management improvements. Users reported an issue where the could not disassociate all store categories from a location. Assigning a store to a new category worked as expected, as did changing the category assigned to a location. The issue only appeared when trying to remove all category associates from a location.

Today’s updates resolves that issue and users can now disconnect all category references from a location.

store category management improvements
Store listing showing active categories.

Store Category Management

Store category management is a feature that is available to Professional or Enterprise level subscribers. It is enabled for WordPress plugin users with the Power add on.

Resolving The Issue

The issue impacts both SaaS platform and WordPress plugin users.

WordPress plugin users will need to upgrade to the latest version of the Power plugin to get the store category management improvements. Users with a SaaS subscription have been automatically updated to the improved experience.

post image via Pixabay

Google Maps for JavaScript Update

Store Locator Plus® was recently updated to accommodate the latest Google Maps for JavaScript update which now requires a callback parameter. Third party hosted scripts such as the Google Maps for JavaScript library, a foundational component of Store Locator Plus®, can change how they operate at any time and without warning to the developers that employ these scripts. Thankfully the recent Google Maps change that makes a new callback parameter required only generates a warning. If this follows in the footsteps of prior Google Maps updates, it will one day suddenly be required and many sites that do not update the script deployment will fail.

For our clients using the WordPress plugins, this means you will need to update the Store Locator Plus® plugin before Google “flips the switch”. For our SaaS users, you do not have to do anything — we’ve already updated the library for you.