Support » Plugin: Autoptimize » Plugin conflict with Leaflet Maps Marker & Maps Marker Pro

  • Hi,

    a user of my mapping plugin “Leaflet Maps Marker” reported an incompatibility of my plugin with your plugin.

    I installed your plugin and activated the javascript optimize option. Afterwards I added leaflet.js to the exclude option. Nevertheless the map couldnt be loaded (example: https://www.mapsmarker.com/dev/free/2015/05/30/shortcode-test-2/) as it seems as the Google API javascript also gets optimized by your plugin and I do not know how to add this to the exclude list.

    Here is the code for loading Google API:

    wp_enqueue_script( 'leafletmapsmarker-googlemaps-loader', $protocol_handler . '://www.google.com/jsapi?key='.$google_maps_api_key, array(), NULL);

    As you exclusion list only seems to support filenames (like leaflet.js), I wonder if you could add an option to also support script-handles here, so that my users can add leafletmapsmarker-googlemaps-loader too, which would hopefully result in maps being loaded again.

    Looking forward to your reply!

    Robert

    https://wordpress.org/plugins/autoptimize/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Hi Robert;
    Exclusion is not only on file name, you can use any string really, so try with jsapi maybe? Do take into account that if you insert inline JS, that might have to be excluded too and that if you rely on jquery, that need to be added as well.

    I’m on holiday now, so can’t have a look myself, but I’ll gladly assist when I get back if you wouldn’t have been able to crack this yet.

    Kind regards,
    Frank

    Hi Frank,
    thanks for the info – will give it another try. Would be glad if you could have a look at the issue too in detail when back from holidays…
    best,
    Robert

    Hi again,
    I did some tests and added jsapi and other strings to the exclusion list – unfortunately with no result.
    Any hints here would be appreciated!
    best,
    Robert

    Plugin Author Frank Goossens

    (@futtta)

    had a look at https://www.mapsmarker.com/dev/free/map-test/, seems like you might need;
    * jquery js
    * google’s jsapi
    * leafletmarker js
    * 2 blocks of inline js

    start with excluding your inline JS, adding “mapsmarkerjs” and “markermap” (without the quotes) to the comma-seperated list of JS excludes and click the checkbox “force JS into head”. If that does not work, uncheck “force JS into head” and exclude a combination of the others.

    hope this helps,
    frank

    Hi Frank,
    thanks for taking a look into this issue! I checked “force JS into head” and added the following to “Exclude scripts from autooptimize”: mapsmarkerjs,leaflet
    result: it works again.
    Will add this to my built-in compatibility check…
    best,
    Robert

    Plugin Author Frank Goossens

    (@futtta)

    Great! Glad to have been able to work together to solve this 🙂

    frank

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Plugin conflict with Leaflet Maps Marker & Maps Marker Pro’ is closed to new replies.