Title: [Plugin: Plugin Dependencies] Script load order bug
Last modified: August 20, 2016

---

# [Plugin: Plugin Dependencies] Script load order bug

 *  Resolved [elyobo](https://wordpress.org/support/users/elyobo/)
 * (@elyobo)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/)
 * The plugin dependencies plugin echos a script in the admin_footer action; this
   fires *before* admin print scripts, so this fails if we’ve followed best practice
   and pushed our scripts into the footer.
 * The issue can easily be resolved by outputing the same javascript in the admin_print_footer_scripts
   action instead, using a weight greater than 10, to ensure that it goes out after
   any other scripts. This will continue to work with code that queues JS in the
   head, but will also work with JS queued in the footer.
 * Replace
 *     ```
       add_action( 'admin_footer', array( __CLASS__, 'admin_footer' ) );
       ```
   
 * with
 *     ```
       add_action( 'admin_print_footer_scripts', array( __CLASS__, 'admin_footer' ), 20 );
       ```
   

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

 *  [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/#post-2307917)
 * The few lines of JavaScript have only jQuery as a dependency, which normally 
   loads in the header.
 * Are you saying that you made jQuery load in the footer?
 *  Thread Starter [elyobo](https://wordpress.org/support/users/elyobo/)
 * (@elyobo)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/#post-2307918)
 * Indeed.
 *  [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/#post-2307919)
 * [Done.](https://github.com/scribu/wp-plugin-dependencies/commit/191f9b78ce6cfa2afa21f3d183310450fd81f232)
   Will be present in the next release. Thanks for the suggestion.
 *  Thread Starter [elyobo](https://wordpress.org/support/users/elyobo/)
 * (@elyobo)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/#post-2307920)
 * Thanks 🙂

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

The topic ‘[Plugin: Plugin Dependencies] Script load order bug’ is closed to new
replies.

 * 4 replies
 * 2 participants
 * Last reply from: [elyobo](https://wordpress.org/support/users/elyobo/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-plugin-dependencies-script-load-order-bug/#post-2307920)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
