Geopress and no maps?

Recently I have been playing with YSlow quite a bit, mainly for Geograph. A useful feature is it gives the load time for every page (without doing a full scan) in the status bar and I happened to visit this blog and the results where quite surprising.

Geopress which I have installed for adding GeoRSS to rss feeds and creating kml files, (and geotagging the post itself, which is custom), actually includes it’s javascript on each an every page! So 6kb for the core, 34kb for mapstraction, and then because I had blindly entered a API key for Google and Yahoo, get both of their apis thrown in (about 150kb I think), and no maps for all that effort!
I use a Google map for geocoding the post in the first place, so don’t want to blindly disable the whole lot, so as a quick bodge, I just commented out the following line in geopress.php

add_action(‘wp_head’, array(‘GeoPress’, ‘wp_head’));

leaving the ‘admin_head’, so that it would get included in the admin , which is just me.

If I knew more I would digg in and make it a preference, or better yet just make it auto-detected. But posting this here in the hope it useful to someone.

2 Responses to “Geopress and no maps?”

  1. Hey Barry – very good points – and something we need to address. The foremost would be deploying a compressed version of Mapstraction.

    But also – only including the headers if/when a map is displayed on a page (easy by including the first time a map is inserted on a page).

    We’ve also considered having the Google, Yahoo, or other headers wrapped up within mapstraction itself, so that Mapstraction would handle including only the necessary JS.

    But your modification is a good one in the meantime. :)

  2. Tom says:

    Thanks for this – saved me quite a lot of hunting. Like you, I only want Geopress to include GeoRSS info in my feed, so I don’t need lots of extra JS cluttering up the front-end as a result!