Title: Credly Login plugin error &#8211; &quot;wp_enqueue_script was called incorrectly&quot;
Last modified: August 22, 2016

---

# Credly Login plugin error – "wp_enqueue_script was called incorrectly"

 *  Resolved [blazeking](https://wordpress.org/support/users/blazeking/)
 * (@blazeking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/)
 * The Credly Login plugin is causing me some trouble. It was working without issue,
   but now when the plugin is enabled, I receive the error:
 * > 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 login_enqueue_scripts hooks. Please see Debugging in WordPress for more 
   > information. (This message was added in version 3.3.) in /var/www/html/wp-includes/
   > functions.php on line 3547
 * When the plugin is enabled, I receive the error above when debug mode is enabled.
   When attempting to log in via Credly, it appears to stop after submitting username/
   password.
 * I’m running 4.1, but it happens with previous versions as well. Any help is appreciated,
   thanks!
 * [https://wordpress.org/plugins/credly-login/](https://wordpress.org/plugins/credly-login/)
 * [https://wordpress.org/plugins/badgeos/](https://wordpress.org/plugins/badgeos/)

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

 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5675943)
 * are these showing up when browsing frontend pages or WP admin pages? Trying to
   pinpoint where may be coming from based on that status.
 *  Thread Starter [blazeking](https://wordpress.org/support/users/blazeking/)
 * (@blazeking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5675947)
 * The error message shows on all frontend pages and wp-admin pages.
 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676021)
 * Looks like I missed an important detail in that this is for the Credly Login 
   plugin, and not BadgeOS core. My oops :D.
 * Anyways, I don’t have the necessary access to fix this in the repo directly, 
   so I forwarded over the following fix to the people who can. Until then, if you
   want to patch it yourself, replace line 32 and 33 from credly-login.php with 
   the following:
 *     ```
       function credly_login_scripts() {
           wp_enqueue_script( 'credly-login-script', CREDLY_LOGIN_URL . 'assets/js/login.js', array( 'jquery' ) );
           wp_localize_script( 'credly-login-script', 'CredlyLogin', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
       }
       add_action( 'wp_enqueue_scripts', 'credly_login_scripts' );
       ```
   
 *  Thread Starter [blazeking](https://wordpress.org/support/users/blazeking/)
 * (@blazeking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676029)
 * I’ve replaced the code. However, now when clicking the “Log in with Credly” button,
   nothing happens. No pop-up.
 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676041)
 * Is the site live at all that I could check on some things at? Otherwise not sure
   what’s going on. Only thing I can think of is some sort of js error in your browser’s
   developer console.
 *  Thread Starter [blazeking](https://wordpress.org/support/users/blazeking/)
 * (@blazeking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676044)
 * [http://edubadger.org](http://edubadger.org)
 * Thanks!
 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676054)
 * aha, I had the wrong hook.
 * change `wp_enqueue_scripts` to `login_enqueue_scripts`
 *  Thread Starter [blazeking](https://wordpress.org/support/users/blazeking/)
 * (@blazeking)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676094)
 * That was it! Thank you!!!

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

The topic ‘Credly Login plugin error – "wp_enqueue_script was called incorrectly"’
is closed to new replies.

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

## Tags

 * [enqueue](https://wordpress.org/support/topic-tag/enqueue/)

 * 8 replies
 * 2 participants
 * Last reply from: [blazeking](https://wordpress.org/support/users/blazeking/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/credly-login-plugin-error-wp_enqueue_script-was-called-incorrectly/#post-5676094)
 * Status: resolved