Quantcast
Channel: WordPress.org Forums » [W3 Total Cache] Support
Viewing all articles
Browse latest Browse all 19292

RobertHarm on "[Plugin: W3 Total Cache] plugin conflict with Leaflet Maps Marker (CDN/js issue)"

$
0
0

Hi,

I am the developer of the mapping plugin "Leaflet Maps Marker" (http://wordpress.org/extend/plugins/leaflet-maps-marker/) and found a conflict with w3tc plugin:

If w3tc is active and a CDN (like Amazon Cloudfront) is set up, my layer maps break, as w3tc removes the trailing slash from my icon-dir constants:

javascript output without w3tc and inactive CDN (taken from http://www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-fullscreen.php?layer=1)

iconUrl: (feature.properties.icon != '') ? 'http://www.mapsmarker.com/wp-content/uploads/leaflet-maps-marker-icons/' + feature.properties.icon : 'http://www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-dist/images/marker.png',

javascript output with w3tc and active CDN:

iconUrl: (feature.properties.icon != '') ? 'http://cdn.mapsmarker.com/wp-content/uploads/leaflet-maps-marker-icons' + feature.properties.icon : 'http://www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-dist/images/marker.png',

I tried to fix it on my side, but didnt succeed - I guess this is a bug with w3tc (especially the newer version, as with older versions - dont ask me which one - image url werent replaced within javascript-tags).

Here is the code I use within my plugin to create the output above in case this helps you with analyzing:

$lmm_out .= " iconUrl: (feature.properties.icon != '') ? '" . LEAFLET_PLUGIN_ICONS_URL . "/' + feature.properties.icon : '" . LEAFLET_PLUGIN_URL . "leaflet-dist/images/marker.png" . "',".PHP_EOL;

The current workaround I give is to add
wp-content/uploads/leaflet-maps-marker-icons/*
to the list of rejected files within the w3tc CDN configuration. This is not optimal, as I would like my plugin to work out of the box without any additional configuration needed.

I would really appreciate your help with this issue. If I can assist you in any way, let me know!
best,

Robert

http://wordpress.org/extend/plugins/w3-total-cache/


Viewing all articles
Browse latest Browse all 19292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>