[Plugin: Twitter Tools] Removing JQuery (5 posts)

  1. Ashton.Sanders
    Posted 7 years ago #

    For some reason, this plugin (Twitter Tools) is adding Jquery to my front end... Why?

    Jquery is over 50K and I don't see why Twitter-Tools needs it.

    Any thoughts would be great.

  2. Alex King
    Posted 7 years ago #

    You have turned on the option to "Create tweets from your sidebar?", so a JavaScript library has to available to send the AJAX request to post the tweet. Turn this option off, no JavaScript gets added to the front end.

    Also, there is an option to use either jQuery or Prototype so that you don't have to load an extra JavaScript library if you are already using one.

    That's pretty darn efficient if you ask me.

  3. Ashton.Sanders
    Posted 7 years ago #

    Thank you very much Alex.

    I was hoping it was that simple. Thanks for the great plugin. I did a review of a handful of twitter plugins, and this was one of my favorites.

    Thanks again,

  4. scompt
    Posted 6 years ago #

    Alex, it's definitely efficient, but it could be a hair more efficient to completely JQuery when it's not needed.

    Replace line 975 of 2.0rc1:
    if (is_admin() || $aktt->tweet_from_sidebar) {

    with the following line:

    if (is_admin() || ($aktt->tweet_from_sidebar && current_user_can('publish_posts'))) {

    This will keep JQuery completely out of the front-end if it's not needed.

    Thanks for the plugin,

  5. Alex King
    Posted 6 years ago #

    Good idea, added to 2.0.

Topic Closed

This topic has been closed to new replies.

About this Topic