Title: Sloppy implementation
Last modified: September 3, 2016

---

# Sloppy implementation

 *  [M Designs](https://wordpress.org/support/users/mcmorrisdesigns/)
 * (@mcmorrisdesigns)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sloppy-implementation/)
 * The script is loaded unconditionally(it loads in modern browsers when it should
   only be loading in IE6-8).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * (@ramoonus)
 * [11 years ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887516)
 * not true, the javascript detects on the first lines if its the right browser
 *  [Julie](https://wordpress.org/support/users/habannah/)
 * (@habannah)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887517)
 * No, it’s true. The plugin loads the script everywhere.
 * From selectivizr/selectivizr.php:
 *     ```
       // init
       function rw_selectivizr() {
           wp_enqueue_script('selectivizr',plugins_url( '/js/selectivizr.js' , __FILE__ ), array(), '1.0.b3' );
       }
       // load
       add_action('wp_head', 'rw_selectivizr');
       ```
   
 * The script is what detects the browser.
 * From selectivizr/js/selectivizr.js:
 *     ```
       (function(win) {
   
           // Determine IE version and stop execution if browser isn't IE. This
           // handles the script being loaded by non IE browsers because the
           // developer didn't use conditional comments.
           var ieUserAgent = navigator.userAgent.match(/MSIE (\d+)/);
           if (!ieUserAgent) {
               return false;
           }
       ```
   
 * I think [@m](https://wordpress.org/support/users/m/) Designs means that the script
   shouldn’t even be loaded unless it’s needed. I agree. Why load yet another script
   if it’s not needed, even if it does die right away? Perhaps using `global $is_IE`
   along with a condition in the php file would be the solution…
 *  Plugin Author [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * (@ramoonus)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887518)
 * I used the Original javascript as provided
    [https://github.com/keithclark/selectivizr](https://github.com/keithclark/selectivizr)
 *  Plugin Author [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * (@ramoonus)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887519)
 * I`m working on a new version;
    [https://github.com/Ramoonus/Powerpack](https://github.com/Ramoonus/Powerpack)
 *  [Julie](https://wordpress.org/support/users/habannah/)
 * (@habannah)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887520)
 * Looks nice, but it’s too much for me. I like this plugin 🙂
 * This is what I did in selectivizr.php:
 *     ```
       function rw_selectivizr() {
       	global $is_IE;
       	if ($is_IE) {
       		wp_enqueue_script('selectivizr',plugins_url( '/js/selectivizr.js' , __FILE__ ), array(), '1.0.b3' );
       	}
       }
       ```
   
 * Can you update the plugin with this code (or similar), please?
 *  Plugin Author [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * (@ramoonus)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887521)
 * I`m working on a new version of this plugin on GitHub
    [https://github.com/Ramoonus/Powerpack](https://github.com/Ramoonus/Powerpack)
 * I will not edit the current version
 *  Plugin Author [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * (@ramoonus)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887522)
 * I also found a more neat approach to the is_IE

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Sloppy implementation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/selectivizr.svg)
 * [Selectivizr for WordPress](https://wordpress.org/plugins/selectivizr/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/selectivizr/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/selectivizr/)
 * [Active Topics](https://wordpress.org/support/plugin/selectivizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/selectivizr/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/selectivizr/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Ramoonus](https://wordpress.org/support/users/ramoonus/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/sloppy-implementation/#post-7887522)