WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
plugin conflict with Leaflet Maps Marker (CDN/js issue) (3 posts)

  1. RobertHarm
    Member
    Posted 1 year ago #

    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/

  2. RobertHarm
    Member
    Posted 1 year ago #

    any updates on this issue? 0.9.2.10 didnt seem to fix this issue...
    thanks for your help!
    Robert

  3. RobertHarm
    Member
    Posted 1 year ago #

    Hi,
    are there any updates on this ticket? I am getting more and more feedback from my users that they are experiencing this issue...
    thx,
    Robert

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic