parisholley / wordpress-asynchronous-javascript

Improve page load performance by asynchronously loading javascript and files using head.js in your wordpress website.
http://wordpress.org/extend/plugins/asynchronous-javascript/
24 stars 3 forks source link

Add ability to select which head.js file to use #4

Closed DeanStr closed 11 years ago

DeanStr commented 11 years ago

I wanted the ability to use the full head.js file (head.min.js) rather than the asset loader version (head.load.min.js), this change adds the option in the admin settings and adds the appropriate file into the js folder.

I initially thought of using a check box, but instead went with a textbox so other versions of head.js can also be put in the js folder and then loaded instead, if the user so wishes.

parisholley commented 11 years ago

is $options['head_file'] on a fresh install if you have never visited the options page?

DeanStr commented 11 years ago

I just tested it on a fresh install and its blank, you have to click reset to defaults to get the default value, my understanding from the NHP Options was that 'std' is the default value but it appears to only work on reset to defaults

parisholley commented 11 years ago

That isn't very intuitive :) Change it to default to the 'std' value if it isn't set

DeanStr commented 11 years ago

That should do it

parisholley commented 11 years ago

should be done in filter_headjs, not that way. calling ->get just results in unnecessary database hits

DeanStr commented 11 years ago

I fixed the unnecessary db hits. I also added a check to filter_headjs, but I kept it in the admin function too because what if the user opens the admin settings first, they would have an empty field there, so it seems to me that its needed in both.

parisholley commented 11 years ago

not quite what I meant, but I will merge and tweak, thanks for contributing!