Hi,
opr18 is correct. The script (add_js function in this case) is injecting the javascript before any queued javascript files. This produces the following scenario as part of wp_footer() (tidied up for eligibility):
<script type="text/javascript">
jQuery(document).ready(function($){
if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar
$("html").addClass("has-cookie-bar");
$("html").addClass("cookie-bar-bottom-bar");
$("html").addClass("cookie-bar-bar");
}
});
</script>
<script type='text/javascript' src='<domain></wp-includes/js/admin-bar.min.js?ver=4.4.2'></script>
<script type='text/javascript' src='<domain>/wp-content/themes/<theme>/bower_components/jquery/dist/jquery.js?ver=2.1.1'></script>
This is due to the lack of priority on the action for add_js. Setting the priority of the jquery enqueue in functions.php doesn’t work, so the only solution is to add priority to the plugin add_action as per opr18’s suggestion.
Plugin author: I’d recommend adding priority 1000 to all actions in init() as per add_notification_bar to avoid this issue.