Support » Plugins and Hacks » [Resolved] Remove inline JS to enable caching.

[Resolved] Remove inline JS to enable caching.

  • Hi Jeff,

    First of all, nice plugin! Appreciate all the work you put into it.

    I just read you’re house was flooded, sorry to hear that. I noticed the huge piece of inline JavaScript the plugin outputs after the widget when you have rotating enabled.

    I was wondering if you were willing to look into optimizing this piece of JS. Eg: move it into a separate file to enable caching, minifying and combining. Reducing the lines of code. Or, keep it like this but output it after the other footer scripts have been loaded (using the wp_footer action hook).

    Main reason is I want to combine all my JS files into 1 script and load this before the closing body tag. If I find myself having some spare time over the weekend I might look into it myself.

    Thanks a bunch!



Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff K


    Hey Danny,


    I am looking to optimize the js as its current form got hit by a worst disaster than my house. It is loaded in the footer and I can increase the priority number to move it further along down the hook.

    I do plan on reworking a version into it’s own file when I can. I am always open to user feedback and input. If you come across a better way then please let me know.


    Hey Jeff,

    I’d have to look into your code but I noticed you were using a random string. You could save this random string in a JS variable using wp_localize_script and then use it in a JS file.

    PS. Just noticed your plugins jquery-ui.css file is loaded on every page of the admin panel. I would use the global $pagenow variable or the $_GET['page'] variable so your scripts will only be enqueued on your settings pages. 🙂

    Great work Jeff. Hope everything regarding your house is going to be fine?

    That was quick, thanks Jeff! I noticed because I was using the accordion in one of my own plugins, had some minimal styling applied to it and suddenly it looked a whole lot better when I moved it to a production server. 🙂

    PS. Do you have a donate link?

    Plugin Author Jeff K


    Thanks Danny.

    There is one on the documentation page. I call it a thank you license. If that looks to much of a pain in the butt, paypal {@} hitmyserver.com.

    Thanks for your input. Cleaning up the JS is one of the next things on my todo list.


    Plugin Author Jeff K


    Hey Danny,

    I am letting you know that I am finally removing the giant block on inline code to it’s own file. Load once, run on unlimited blocks. I still need to test in the different browsers but it seems to be working.

    Hopefully this update will be pushed out by the end of this weekend.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Remove inline JS to enable caching.’ is closed to new replies.