WordPress.org

Ready to get started?Download WordPress

Forums

HMS Testimonials
[resolved] Remove inline JS to enable caching. (6 posts)

  1. Danny van Kooten
    Member
    Posted 11 months ago #

    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!

    Danny

    http://wordpress.org/plugins/hms-testimonials/

  2. Jeff K
    Member
    Plugin Author

    Posted 11 months ago #

    Hey Danny,

    Thanks.

    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.

    Thanks,
    Jeff

  3. Danny van Kooten
    Member
    Posted 11 months ago #

    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?

  4. Danny van Kooten
    Member
    Posted 11 months ago #

    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?

  5. Jeff K
    Member
    Plugin Author

    Posted 11 months ago #

    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.

    Jeff

  6. Jeff K
    Member
    Plugin Author

    Posted 10 months ago #

    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.

    Jeff

Reply

You must log in to post.

About this Plugin

About this Topic

Tags