Title: Optimization Request
Last modified: August 21, 2016

---

# Optimization Request

 *  Resolved [jackennils](https://wordpress.org/support/users/jackennilsen/)
 * (@jackennilsen)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/)
 * Hello,
 * I really enjoy your plugin, it’s truly the best HTML5 audio player for WordPress.
 * However, I have noticed that the JS files are always loaded, even if there’s 
   no player on the current page. Since it is quite some kilobytes, would it be 
   possible to only load JS when there’s a player on the post/page?
 * Thanks for considering this.
 * Regards
    Nils
 * [https://wordpress.org/plugins/wp-miniaudioplayer/](https://wordpress.org/plugins/wp-miniaudioplayer/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [aquapan](https://wordpress.org/support/users/aquapan/)
 * (@aquapan)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687490)
 * I was just about to post the same post about this and found yours Nils.
 * +1 on this feature request… at the moment it is a little inefficient and slowing
   page loads for me.
 * Thanks
    A
 *  Plugin Author [pupunzi](https://wordpress.org/support/users/pupunzi/)
 * (@pupunzi)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687540)
 * That is quite impossible as I can’t know via PHP if there are audio players (
   they are just anchors pointing to an mp3 file) on the page before loading script;
   players are not persisted on the DB. Consider also that players could also be
   loaded in the page in a second time via an Ajax call and if the javascript is
   not loaded before they wouldn’t work. I don’t think that 50kb of scripts (cached
   by the browser) can slow down the page load :-).
 * Bye,
    M
 *  [Guy Scharf](https://wordpress.org/support/users/guy-scharf/)
 * (@guy-scharf)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687712)
 * I have a similar desire. My site will have perhaps 30 pages, only one of which
   contains audio and will be frequently accessed. I’d rather not load the script
   for most users who won’t be looking at the audio-containing page.
 * The CFORMS II plugin has this same issue and handles it with an optional Settings
   field. It allows you to specify which post id’s the plugin is to be loaded for.
   If you don’t specify any, then it loads the script for all pages. If you specify
   some ids, then the script is loaded only for those pages.
 *  Thread Starter [jackennils](https://wordpress.org/support/users/jackennilsen/)
 * (@jackennilsen)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687715)
 * Sounds good! A child theme can also be a DIY solution…
 *  Plugin Author [pupunzi](https://wordpress.org/support/users/pupunzi/)
 * (@pupunzi)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687716)
 * Specifying the ID of the page could be a solution… but do you really think that
   40 kb of cached scripts can make the difference when the page loads? I don’t 
   think this could be an improve…
 *  Thread Starter [jackennils](https://wordpress.org/support/users/jackennilsen/)
 * (@jackennilsen)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687717)
 * Well it’s 3 files plus inline script.
 * jplayer.js = 48 kb
    mb.miniplayer.js = 42 kb miniplayer.css = 10 kb inline script
   = 1 – 2 kb
 * overall we’re talking about 100 kb and 3 additional requests
 * if you ask Google pagespeed or other optimization websites / guides, this totally
   makes a difference
 *  Plugin Author [pupunzi](https://wordpress.org/support/users/pupunzi/)
 * (@pupunzi)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687718)
 * Those file are loaded the first time you get in the site, then are served by 
   the browser cache. For the general use of this plug in the js files must be loaded
   on every pages; wordpress itself loads all the needed script to render its own
   player on all the pages even if the player is not invoked.
 *  Thread Starter [jackennils](https://wordpress.org/support/users/jackennilsen/)
 * (@jackennilsen)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687719)
 * That’s correct, but it’s not the point. Why do people have to load the files 
   at all, even if they may never open a page with a player?
 * Maybe it’s time to find another more lightweight player.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Optimization Request’ is closed to new replies.

 * ![](https://ps.w.org/wp-miniaudioplayer/assets/icon.svg?rev=983692)
 * [mb.miniAudioPlayer - an HTML5 audio player for your mp3 files](https://wordpress.org/plugins/wp-miniaudioplayer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-miniaudioplayer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-miniaudioplayer/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-miniaudioplayer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-miniaudioplayer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-miniaudioplayer/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [jackennils](https://wordpress.org/support/users/jackennilsen/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/optimization-request/#post-4687719)
 * Status: resolved