miya0001 / simple-map

Display Google Map Shortcode for WordPress
21 stars 15 forks source link

Deferred loading of Google Maps API script? #23

Closed glueckpress closed 5 years ago

glueckpress commented 7 years ago

Thanks for this great plugin, I love the simplicity! 🙏

I wondered what you may think about loading scripts deferred? Tested with this little helper plugin, works like a charm for me. https://gist.github.com/glueckpress/56c88900aad391b95b5d44f4e752a1a4

Would there be any objections making this a default?

miya0001 commented 7 years ago

I am sorry for late reply.

It looks nice. Do you know are there any problems if we make this as a default. Thanks!

glueckpress commented 7 years ago

As long as no other (inline) JavaScript that depends on the deferred scripts gets loaded before the two deferred ones, I don’t see any issues.

Hadn’t had a chance to test extensively, though, it was just a quick tweak for me. Ideally this would be tested by a couple of more people to get a bit of data in.

glueckpress commented 5 years ago

Yeah. Sorry for leaving this open so long. 😄 Can’t seem to make time for testing, so closing.