Updated script, tested on WordPress 4.0.
Plugin directory assets.