impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

Transients not working properly for multiple mashup groups #262

Closed MALIK-0 closed 6 years ago

MALIK-0 commented 6 years ago

Hi there, I want to report a bug regarding transients not working properly for multiple mashup groups.

Reason: Transient name is generated like this for every mashup group.

// class-gmb-mashups-builder.php on line 543

$transient_name = 'gmb_mashup_' . $post_type . '_' . md5( http_build_query( $args ) )

// example output: gmb_mashup_customer_840uakdjfoi498

If you use multiple mashup groups on the same map like me, the transient name will be the same for each transient therefore overwriting each other.

Solution: Solution is fairly simple, just append a unique id to transients. You can also replace the md5 hash with uniqid if your intention was to use the md5 hash as unique id (what's not the case, since arguments can be the same for multiple mashup groups).

// class-gmb-mashups-builder.php on line 543

$transient_name = 'gmb_mashup_' . $post_type . '_' . md5( http_build_query( $args ) ) . '_' . uniqid();

// example output: gmb_mashup_customer_840uakdjfoi498_484048

Please add this to the core.

Thank you,

Tobias

nishitlangaliya commented 6 years ago

Issue moved to WordImpress/Maps-Builder-Pro #105 via ZenHub