WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Ashton.Sanders
    Member
    Posted 5 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
    Member
    Posted 5 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
    Member
    Posted 5 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,
    Ashton

  4. scompt
    Member
    Posted 4 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,
    Edward

  5. Alex King
    Member
    Posted 4 years ago #

    Good idea, added to 2.0.

Topic Closed

This topic has been closed to new replies.

About this Topic