--- a/wp-google-maps/html/atlas-novus/settings-page.html.php
+++ b/wp-google-maps/html/atlas-novus/settings-page.html.php
@@ -2980,6 +2980,27 @@
</div>
</div>
+ <!-- WP Rocket -->
+ <div class="tab-row has-hint">
+ <div class="title"><?php esc_html_e("Disable WP Rocket Exclusion Fix", "wp-google-maps"); ?></div>
+ <div class="switch switch-inline">
+ <input name="disable_wprocket_compatibility_fix"
+ id="disable_wprocket_compatibility_fix"
+ class="cmn-toggle cmn-toggle-round-flat"
+ type="checkbox"/>
+
+ <label for="disable_wprocket_compatibility_fix"></label>
+ <label for="disable_wprocket_compatibility_fix">
+ <small>
+ <?php
+ esc_html_e("We exclude our inline settings object script from the WP Rocket JS Deferred optimzations. As defer loading of the inline script may lead to initialization issues. You can disable this fix, if you prefer.", "wp-google-maps");
+ ?>
+ </small>
+ </label>
+
+ </div>
+ </div>
+
<!-- Sub heading : Infrastructure -->
<div class="tab-row as-heading">
<strong>
--- a/wp-google-maps/includes/class.admin-notices.php
+++ b/wp-google-maps/includes/class.admin-notices.php
@@ -328,7 +328,9 @@
* @return void
*/
public function dismissFromPostAjax(){
- if (empty($_POST['slug']) || empty($_POST['wpgmza_security']) || !wp_verify_nonce($_POST['wpgmza_security'], 'wpgmza_ajaxnonce')) {
+ global $wpgmza;
+
+ if (empty($_POST['slug']) || empty($_POST['wpgmza_security']) || !wp_verify_nonce($_POST['wpgmza_security'], 'wpgmza_ajaxnonce') || !$wpgmza->isUserAllowedToEdit()) {
wp_send_json_error(__( 'Security check failed, import will continue, however, we cannot provide you with live updates', 'wp-google-maps' ));
}
@@ -347,7 +349,9 @@
* @return void
*/
public function processBackgroundAction(){
- if (empty($_POST['relay']) || empty($_POST['wpgmza_security']) || !wp_verify_nonce($_POST['wpgmza_security'], 'wpgmza_ajaxnonce')) {
+ global $wpgmza;
+
+ if (empty($_POST['relay']) || empty($_POST['wpgmza_security']) || !wp_verify_nonce($_POST['wpgmza_security'], 'wpgmza_ajaxnonce') || !$wpgmza->isUserAllowedToEdit()) {
wp_send_json_error(__( 'Security check failed, import will continue, however, we cannot provide you with live updates', 'wp-google-maps' ));
}
--- a/wp-google-maps/includes/class.plugin.php
+++ b/wp-google-maps/includes/class.plugin.php
@@ -224,6 +224,11 @@
define('WPE_GOVERNOR', false);
}
}
+
+ /* WP Rocket Exclusion - Inline JS */
+ if(empty($this->settings->disable_wprocket_compatibility_fix)){
+ add_filter('rocket_defer_inline_exclusions', array($this, 'enableWPRocketCompat'), 10, 1);
+ }
}
public function __set($name, $value)
@@ -1080,6 +1085,31 @@
}
}
+ /**
+ * Excludes our inline JS from WP Rocket defer loading
+ *
+ * This is done to prevent an asset timing incompatibility which prevents map initialization
+ *
+ * This means users do not need to configure additional settings to allow WP Go Maps to function well with WP Rocket
+ *
+ * Importantly, all assets can still be deferred, but our initializer, and settings will not be deferred loaded
+ *
+ * @param mixed $excludeList The current list of exclusions
+ *
+ * @return array
+ */
+ public function enableWPRocketCompat($excludeList){
+ if(!is_array($excludeList)){
+ /* Not yet in array format */
+ $excludeList = array();
+ }
+
+ /* Add our inline JS Localizer block - We still have a delayed loader system integrated here */
+ $excludeList[] = 'wpgmza-js-extra';
+
+ return $excludeList;
+ }
+
public static function get_rss_feed_as_html($feed_url, $max_item_cnt = 10, $show_date = true, $show_description = true, $max_words = 0, $cache_timeout = 7200, $cache_prefix = "/tmp/rss2html-") {
$result = "";
// get feeds and parse items
--- a/wp-google-maps/includes/class.script-loader.php
+++ b/wp-google-maps/includes/class.script-loader.php
@@ -667,17 +667,17 @@
// Get library scripts
$libraries = $this->getLibraryScripts();
-
+
// Enqueue Google API call if necessary
switch($wpgmza->settings->engine)
{
case "open-layers":
$loader = new OLLoader(OLLoader::VERSION_TYPE_LEGACY);
- $loader->loadOpenLayers();
+ $loader->loadOpenLayers($forceLoad);
break;
case "open-layers-latest":
$loader = new OLLoader();
- $loader->loadOpenLayers();
+ $loader->loadOpenLayers($forceLoad);
break;
case "leaflet":
case "leaflet-azure":
@@ -686,11 +686,11 @@
case "leaflet-locationiq":
case "leaflet-zerocost":
$loader = LeafletLoader::createInstance();
- $loader->load();
+ $loader->load($forceLoad);
break;
default:
$loader = ($wpgmza->isProVersion() ? new GoogleProMapsLoader() : new GoogleMapsLoader());
- $loader->loadGoogleMaps();
+ $loader->loadGoogleMaps($forceLoad);
break;
}
--- a/wp-google-maps/includes/google-maps/class.google-maps-loader.php
+++ b/wp-google-maps/includes/google-maps/class.google-maps-loader.php
@@ -135,11 +135,11 @@
* This function loads the Google API if it hasn't been called already
* @return void
*/
- public function loadGoogleMaps()
+ public function loadGoogleMaps($forceLoad = false)
{
global $wpgmza;
- if(GoogleMapsLoader::$googleAPILoadCalled)
+ if(GoogleMapsLoader::$googleAPILoadCalled && empty($forceLoad))
return;
$apiLoader = new GoogleMapsAPILoader();
--- a/wp-google-maps/includes/leaflet/class.leaflet-loader.php
+++ b/wp-google-maps/includes/leaflet/class.leaflet-loader.php
@@ -32,10 +32,10 @@
/**
* Loads the OpenLayers libraries and styles
*/
- public function load() {
+ public function load($forceLoad = false) {
global $wpgmza;
- if(LeafletLoader::$leafletAPILoadCalled){
+ if(LeafletLoader::$leafletAPILoadCalled && empty($forceLoad)){
return;
}
@@ -87,7 +87,6 @@
}
}
-
LeafletLoader::$leafletAPILoadCalled = true;
}
}
--- a/wp-google-maps/includes/open-layers/class.ol-loader.php
+++ b/wp-google-maps/includes/open-layers/class.ol-loader.php
@@ -33,10 +33,10 @@
/**
* Loads the OpenLayers libraries and styles
*/
- public function loadOpenLayers() {
+ public function loadOpenLayers($forceLoad = false) {
global $wpgmza;
- if(OLLoader::$olAPILoadCalled){
+ if(OLLoader::$olAPILoadCalled && empty($forceLoad)){
return;
}
--- a/wp-google-maps/wpGoogleMaps.php
+++ b/wp-google-maps/wpGoogleMaps.php
@@ -3,7 +3,7 @@
Plugin Name: WP Go Maps (formerly WP Google Maps)
Plugin URI: https://www.wpgmaps.com
Description: The easiest to use Google Maps plugin! Create custom Google Maps or a map block with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
-Version: 10.0.04
+Version: 10.0.05
Author: WP Go Maps (formerly WP Google Maps)
Author URI: https://www.wpgmaps.com
Text Domain: wp-google-maps
@@ -12,6 +12,14 @@
/*
+ * 10.0.05 - 2026-01-14
+ * Fixed issue where notice actions were missing permission checks. Low level users could trigger actions like switching map engines. Security issue. Thanks Moose Love (Nagasaki Prefectural University) (Wordfence)
+ * Fixed issue where deferred loading with WP Rocket would lead to initialization error. We now exclude inline initializer and settings object from this system. Can be disabled in settings
+ * Fixed issue where batch marker loading would incorrectly trigger final shape fetch request
+ * Fixed issue where internal map library loaders would not respect force-load flag when enqueueing scripts
+ * Fixed issue with setMap calls on point labels
+ * Improved point label architecture to support regeneration and map ID changes if needed
+ *
* 10.0.04 - 2025-12-04
* Added pro features page and menu item
* Added additional page construction hooks