Title: Bugs with composer (autoload.php) and wp_enqueue_scripts
Last modified: August 30, 2016

---

# Bugs with composer (autoload.php) and wp_enqueue_scripts

 *  Resolved [ade11](https://wordpress.org/support/users/ade11/)
 * (@ade11)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/bugs-with-composer-autoloadphp-and-wp_enqueue_scripts/)
 * We’ve been asked to look into your plugin for a client, unfortunately it crashes
   their wordpress with a whitescreen.
 * We investigated, and discovered some issues. I’ll write them here, as unfortunately
   I don’t speak Dutch so can’t really partake of your other support forum.
 * First, we get WordPress errors, thus;
 *     ```
       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.
       ```
   
 * We find we can get rid of these errors by wrapping each of those wp_enqueue_script/
   style blocks of calls in Plugin.php, initAdmin() and initAdminPlugins() in an
   action;
 *     ```
       add_action('wp_enqueue_scripts',function(){
           wp_enqueue_etc_etc;
       });
       ```
   
 * The second issue we get is with the autoload.php (composer?).
 * If another plugin uses this, then either that, or this plugins’s autoload.php
   doesn’t load (require_once!) and so either this or both plugins are broken.
 * We explored this error by renaming autoload.php to for instance bolcom-autoload.
   php and adjusting the require_once in the main plugin file, then both plugins
   work together, and we get no white screens.
 * Obviously, we are unsure of the ongoing effects of either of these issues, and
   await you advice, and hopefully a fix in your plugin!
 * Many thanks!
 * [https://wordpress.org/plugins/bolcom-partnerprogramma-wordpress-plugin/](https://wordpress.org/plugins/bolcom-partnerprogramma-wordpress-plugin/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jordy de Ruijter](https://wordpress.org/support/users/jordy-de-ruijter/)
 * (@jordy-de-ruijter)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/bugs-with-composer-autoloadphp-and-wp_enqueue_scripts/#post-6685513)
 * Hi there,
 * Thanks a lot for your contributions.
    We have just released a version 1.3.10 
   of the plugin which includes these improvements.
 * Greetings,
    Jordy de Ruijter – Netvlies

Viewing 1 replies (of 1 total)

The topic ‘Bugs with composer (autoload.php) and wp_enqueue_scripts’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bolcom-partnerprogramma-wordpress-
   plugin_91b2c3.svg)
 * [Bol.com Partner Program Plugin](https://wordpress.org/plugins/bolcom-partnerprogramma-wordpress-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bolcom-partnerprogramma-wordpress-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bolcom-partnerprogramma-wordpress-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/bolcom-partnerprogramma-wordpress-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bolcom-partnerprogramma-wordpress-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bolcom-partnerprogramma-wordpress-plugin/reviews/)

## Tags

 * [autoload](https://wordpress.org/support/topic-tag/autoload/)
 * [bugs](https://wordpress.org/support/topic-tag/bugs/)
 * [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: [Jordy de Ruijter](https://wordpress.org/support/users/jordy-de-ruijter/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/bugs-with-composer-autoloadphp-and-wp_enqueue_scripts/#post-6685513)
 * Status: resolved