WordPress.org

Forums

J Shortcodes
Hard coding to jQuery 1.4.4....why?? (6 posts)

  1. Yaron Guez
    Member
    Posted 2 years ago #

    This plugin de-registers the jQuery script alias and then re-registers it to Google CDN, using the wrong version. This is bad! If you want to load a specific version of jQuery for your plugin, just load it for your plugin. Don't break every other use of the jQuery alias across the site.

    http://wordpress.org/extend/plugins/j-shortcodes/

  2. anielsen
    Member
    Posted 2 years ago #

    I second this, 1.4.4 isn't even close to being current.

    Couldn't you just use http://code.jquery.com/jquery.min.js so that it will always be the latest version of jQuery?

  3. jrf
    Member
    Posted 2 years ago #

    I third that. Better even to just default to the current version installed with WP.

    If you need a minimum version of jQuery, check if the WP jquery version complies, if not - AND ONLY IF NOT - load the required version in another way.

  4. ssiddiqi1
    Member
    Posted 2 years ago #

    It is not the best solution, but Comment out following code from line 189-194 in j-shortcodes.php. It works and load WordPress 3.5.1 default jquery, instead of hardcoded ancient 1.4.4 which creates conflicts.

    $jquery_version      = "1.4.4";
          $jquery_ui_version   = "1.8.9";
    
          wp_deregister_script ('jquery');             // using wp_deregister_script() to disable the version that comes packaged with WordPress
          wp_register_script   ('jquery',           "http://ajax.googleapis.com/ajax/libs/jquery/{$jquery_version}/jquery.min.js");         // using wp_register_script() to register updated libraries (this example uses the CDN from Google but you can use any other CDN or host the scripts yourself)
          wp_enqueue_script    ('jquery');          // using wp_enqueue_script() to load the updated libraries

    Change to:

    // $jquery_version      = "1.4.4";
         // $jquery_ui_version   = "1.8.9";
    
         // wp_deregister_script ('jquery');             // using wp_deregister_script() to disable the version that comes packaged with WordPress
        //  wp_register_script   ('jquery',           "http://ajax.googleapis.com/ajax/libs/jquery/{$jquery_version}/jquery.min.js");         // using wp_register_script() to register updated libraries (this example uses the CDN from Google but you can use any other CDN or host the scripts yourself)
        //  wp_enqueue_script    ('jquery');          // using wp_enqueue_script() to load the updated libraries
  5. jrf
    Member
    Posted 2 years ago #

    If you do so, then don't forget to also comment out the three lines after the if statement just below it:

    /*         wp_deregister_script ('jquery-ui-core');
             wp_deregister_script ('jquery-ui-tabs');
    
             wp_register_script   ('jquery-ui-core',   "http://ajax.googleapis.com/ajax/libs/jqueryui/{$jquery_ui_version}/jquery-ui.min.js");
    */
  6. ssiddiqi1
    Member
    Posted 2 years ago #

    @jrf

    Actually I did that... sorry I overlooked to post that here. Thanks for correction.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.