[Plugin: Google Analytics for WordPress] Load jQuery and comment tracking only if have comments
Could you make jQuery loading conditional? Right now jQuery loads as a dependency when the plugin loads the Google Analytics tracking code for comments as shown below:
On pages that have no comments there is no need to load jQuery or the comment-reply script. I would propose using a condition that checks to see if comments are greater than zero before loading jQuery and the Google Analytics comment tracking code to decrease page load time on pages that have no comments. This is one enhancement that would help our pages load faster.
if ( get_comments_number() > 0 )
Thank you for a great plugin.
- The topic ‘[Plugin: Google Analytics for WordPress] Load jQuery and comment tracking only if have comments’ is closed to new replies.