WordPress.org

Ready to get started?Download WordPress

Forums

Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)
[resolved] javascript on all pages (9 posts)

  1. Pepperbase
    Member
    Posted 1 year ago #

    Hi,

    Great plugin. Using 3.0.

    Was looking at my site's loading times and saw that the Leaflet Maps Marker is loading JS files on all pages, also those without maps. Is there an option to only include JS on pages where there is actually a map included? Or should I manually deregister the scripts on other pages?

    Thanks.

    http://wordpress.org/extend/plugins/leaflet-maps-marker/

  2. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    currently not possible (yet) to configure this in the plugin as there are some difficulties I couldnt solve yet - I havent found a way yet how to check if my shortcode is used in a content and embedd js+css files afterwards only...
    regards,
    Robert

    PS: as I give support for free, I'd really appreciate a vote for my plugin on http://wordpress.org/support/view/plugin-reviews/leaflet-maps-marker ;-)

  3. Pepperbase
    Member
    Posted 1 year ago #

    Hi,

    Good to know you are working on it.

    What are the (register) names of the JS an CSS files? I would like to deregister them manually on pages where I do not use maps.

    Regards.

  4. Pepperbase
    Member
    Posted 1 year ago #

    Already found it: leafletmapsmarker

  5. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    just found a solution (with help from John ;-) to include js in footer only if a shortcode is used :-) will be included in v3.1, which will be released in about 1 or 2 weeks probably

  6. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    FYI: I just release v3.1 which loads js in footer and only of a shortcode is used
    best regards,
    Robert

  7. Pepperbase
    Member
    Posted 1 year ago #

    Great that you have got this working now. Hopefully this becomes common practive among all plugin builders.

    Are there more loading time improvements on the roadmap?

  8. Pepperbase
    Member
    Posted 1 year ago #

    Are you going to do the same with the style sheet? Only add the css file when a shortcode is included?

  9. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    I try to follow the kaizen approach - continuos improvements step by step ;-) conditional css inserts are planned for v3.2

    if you have further suggestions how to improve performance, let me know!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags