• Hi, testing this plugin (nice that Jetpack picks up its geo data too!) I notice the map scripts and styles are loaded on every (!) page of the site instead of only where (posts) and when (depending on settings) a map is displayed.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Yann

    (@ymichel)

    Hi,
    You mean the header libs and css right?
    This results in the registration process within WP for Scripts and CSS.

    Let me analyze if I can optimize this…

    BR,
    Yann

    Plugin Author Yann

    (@ymichel)

    Hi,
    I have spend some time investigating on how to do this. Since that would result in checking all posts prior to rendering the page and thus to provide the libs/css to it, it would mean a bigger change in the complete plugin.

    However, I will put it in the backlog but cannot say anything about the timing…

    Plugin Author Yann

    (@ymichel)

    For completeness, this was added to the backlog as well:
    https://github.com/ymichel/Geolocation-Plugin/issues/25

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Hi, could the header script and css not be moved to the footer or at least to to point where the map is in the DOM? In that case, it would be easier to defer from adding it when not needed… It would also be beneficial for page load speed.

    Plugin Author Yann

    (@ymichel)

    Reopened item but will need to be evaluated.

    Plugin Author Yann

    (@ymichel)

    Feature is available in 1.8.0

    IMHO, the plugin is still loaded across the site.
    However, with Asset Clean Up plugin, it’s possible to set rules, as for any other plugins, to decide which ones to load.

    Plugin Author Yann

    (@ymichel)

    Can you give me an example please. THX.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Improvement suggestion: only load scripts and styles when needed’ is closed to new replies.