Title: wp_enqueue_script and wp_enqueue_style used incorrectly
Last modified: August 20, 2016

---

# wp_enqueue_script and wp_enqueue_style used incorrectly

 *  Resolved [fancyfiber](https://wordpress.org/support/users/fancyfiber/)
 * (@fancyfiber)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_enqueue_script-and-wp_enqueue_style-used-incorrectly/)
 * Turning on WP_DEBUG gives these errors and troubleshooting down, discovered the
   error is in this plug-in.
 * >  Notice: wp_enqueue_script was called incorrectly. Scripts and styles should
   > not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   > or init hooks. Please see Debugging in WordPress for more information. (This
   > message was added in version 3.3.) in /www/smenet.cloudapp.net/wp-includes/
   > functions.php on line 2959 Notice: wp_enqueue_style was called incorrectly.
   > Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts,
   > admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for
   > more information. (This message was added in version 3.3.) in /www/smenet.cloudapp.
   > net/wp-includes/functions.php on line 2959
 * The issue comes from lines 122 and 123 in start.php
 * One possible solution (not FULLY tested, but should work):
 *     ```
       register_activation_hook( __FILE__, 'plugin_create_table_user_control' );
             add_action('wp_enqueue_scripts', 'usm_wp_enqueue_scripts');
   
       	/******************************* End Of Code To Create Table When Plugin Is Activated ****************************************************/
   
          function usm_wp_enqueue_scripts() {
       		wp_enqueue_script(array('jquery-ui-datepicker','jquery'));
       		wp_enqueue_style( 'jquery-style',plugin_dir_url(__FILE__).'css/jquery-ui.css');
          }
       	function add_user_USM($user_id) {
       ```
   
 * Thanks.
 * [http://wordpress.org/extend/plugins/user-status-manager/](http://wordpress.org/extend/plugins/user-status-manager/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Rahul Balakrishna](https://wordpress.org/support/users/rahulbalakrishna/)
 * (@rahulbalakrishna)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_enqueue_script-and-wp_enqueue_style-used-incorrectly/#post-3403786)
 * Hello fancyfiber,
 * Thank you for your concern, but FYI every plugin is reviewed and the approved
   and if there is any mistake then we get a reply from them as i got for my first
   plugin.
 * And regarding warning, i am keeping this plug-in update on regular basis as you
   can see the change log, so if new version of wordpress is released then I personally
   check if everything is working. So don’t worry about the functionality or performance
   point as I am working hard on it, to provide the best from my side.
 * And again I would thank you for showing interest in the plug-in and for appreciate
   for the concerns raised. Will test the above code then will add it to my next
   version.
 * Regards,
    Rahul

Viewing 1 replies (of 1 total)

The topic ‘wp_enqueue_script and wp_enqueue_style used incorrectly’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-status-manager.svg)
 * [User Status Manager](https://wordpress.org/plugins/user-status-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-status-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-status-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/user-status-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-status-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-status-manager/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Rahul Balakrishna](https://wordpress.org/support/users/rahulbalakrishna/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/wp_enqueue_script-and-wp_enqueue_style-used-incorrectly/#post-3403786)
 * Status: resolved