I think the way you guarded the download in the plug-in code should make this OK to run on most pages.
Alternately to skip the extra request, that code could be inlined into here.