works with WP 4.0

I just had to modify a couple lines and now it works with the latest wordpress