WordPress – Add CSS & JS in Custom Plugin (with cache-busting & variable-passing)

I used to add custom js & css files to WordPress plugins using the hooks init and admin_init, in which I would call wp_enqueue_script() and wp_enqueue_style(). While it usually works, [...]