I have an own class that deregisters all scripts and styles and creates 2 cached files one for scripts and one for styles that is registered in the end. This runs inside theme, my problem is that I cant move it into plugin, as soon as i move it into plugin it wont work.
currently this code works inside theme
add_filter('wp_print_styles', array($this, 'optimize_styles'), 1); add_filter('wp_print_scripts', array($this, 'optimize_scripts'), 1);
i have tried add action add filter, change priorities.... also i want some way to make my plugin load as last to ensure all plugin styles and scripts will be "compiled" into one.