Bug in WPMUDEV Google Maps Plugin

There is a bug in maps plugin, that leads to empty edit screen:


Due to JS error:



When you click on “Preview/edit”


It makes AJAX request to get_map() function in wpmu_dev_maps_plugin/inc/class-agm-map-model.php on line 549

Where it will first try to get map from cache:

$map = wp_cache_get( $id, ‘agm_map’ );

And if cache is empty, it will recreate the map object and store it in cache using :

$map = $this->prepare_map( $map );

But the same cache object is also created in another function save_map() (same file, line 603), but there is used another function:

$data = $this->prepare_for_save( $map );

But in prepare_for_save() there is ‘defaults’ attribute missing from $map_options, which leads to empty data.defaults in AJAX response and that JS error correspondingly.

So once it was saved using “Save Changes” button, map can’t be viewed again (until map object cache expires). Bug confirmed on all AF sites (where WP Object Cache enabled)


E.g. in save_map() function on line 626 add:

$defaults = $this->get_map_defaults();

$map = $defaults;


wp_cache_set( $ret, $map, ‘agm_map’ );