Added checks to load JS only if widgets or shortcodes are on the page