Title: Missing dependency in wp_enqueue_script functions
Last modified: August 24, 2016

---

# Missing dependency in wp_enqueue_script functions

 *  Resolved [Sim3k86](https://wordpress.org/support/users/sim3k86/)
 * (@sim3k86)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/missing-dependency-in-wp_enqueue_script-functions/)
 * When I installed this plugin, I’ve noticed it’s not working, because it loads
   its libraries before jquery.
    Next I’ve checked your plugin php files and noticed
   in mousewheel-smooth-scroll.php that it doesn’t have dependencies stated in wp_enqueue_script
   functions.
 * Before correction:
 *     ```
       function plugin_scripts_load() {
       			wp_enqueue_script( 'wpmss_jquery_mousewheel', plugins_url( 'js/jquery.mousewheel.min.js' , __FILE__ ));
       			wp_enqueue_script( 'wpmss_jquery_easing', plugins_url( 'js/jquery.easing.1.3.js' , __FILE__ ));
       			$options = array(
       				'step' => isset( $this->settings['general']['step'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['step'] : 120,
       				'speed' => isset( $this->settings['general']['speed'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['speed'] : 800,
       				'ease' => isset( $this->settings['general']['ease'] ) ? $this->settings['general']['ease'] : 'easeOutCubic',
       				'enableAll' => isset( $this->settings['general']['enable_mac'] ) ? 1 : 0
       			);
       			wp_enqueue_script( 'wpmss_simplr_smoothscroll', plugins_url( 'js/jquery.simplr.smoothscroll.js' , __FILE__ ));
       			wp_enqueue_script( 'wpmss_script', plugins_url( 'js/wpmss.php?'.http_build_query($options) , __FILE__ ));
       		}
       ```
   
 * After correction:
 *     ```
       function plugin_scripts_load() {
       			wp_enqueue_script( 'wpmss_jquery_mousewheel', plugins_url( 'js/jquery.mousewheel.min.js' , __FILE__ ), array( 'jquery' ));
       			wp_enqueue_script( 'wpmss_jquery_easing', plugins_url( 'js/jquery.easing.1.3.js' , __FILE__ ), array( 'jquery' ));
       			$options = array(
       				'step' => isset( $this->settings['general']['step'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['step'] : 120,
       				'speed' => isset( $this->settings['general']['speed'] ) && trim( $this->settings['general']['step'] ) != "" ? $this->settings['general']['speed'] : 800,
       				'ease' => isset( $this->settings['general']['ease'] ) ? $this->settings['general']['ease'] : 'easeOutCubic',
       				'enableAll' => isset( $this->settings['general']['enable_mac'] ) ? 1 : 0
       			);
       			wp_enqueue_script( 'wpmss_simplr_smoothscroll', plugins_url( 'js/jquery.simplr.smoothscroll.js' , __FILE__ ), array( 'jquery' ));
       			wp_enqueue_script( 'wpmss_script', plugins_url( 'js/wpmss.php?'.http_build_query($options) , __FILE__ ), array( 'jquery' ));
       		}
       ```
   
 * There’s array( ‘jquery’ ) argument in end of every wp_enqueue_script line.
 * Now it’s working fine. Please correct this in next update, so others won’t have
   any problems.
 * [https://wordpress.org/plugins/mousewheel-smooth-scroll/](https://wordpress.org/plugins/mousewheel-smooth-scroll/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [kubiq](https://wordpress.org/support/users/kubiq/)
 * (@kubiq)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/missing-dependency-in-wp_enqueue_script-functions/#post-6175558)
 * Thanks for your remark 🙂
    Please update plugin, it should be working.

Viewing 1 replies (of 1 total)

The topic ‘Missing dependency in wp_enqueue_script functions’ is closed to new replies.

 * ![](https://ps.w.org/mousewheel-smooth-scroll/assets/icon-256x256.png?rev=1063217)
 * [MouseWheel Smooth Scroll](https://wordpress.org/plugins/mousewheel-smooth-scroll/)
 * [Support Threads](https://wordpress.org/support/plugin/mousewheel-smooth-scroll/)
 * [Active Topics](https://wordpress.org/support/plugin/mousewheel-smooth-scroll/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mousewheel-smooth-scroll/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mousewheel-smooth-scroll/reviews/)

## Tags

 * [dependency](https://wordpress.org/support/topic-tag/dependency/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * 1 reply
 * 2 participants
 * Last reply from: [kubiq](https://wordpress.org/support/users/kubiq/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/missing-dependency-in-wp_enqueue_script-functions/#post-6175558)
 * Status: resolved