Replace `dirname( __FILE__ )` with `WPSEO_FILE` as that works better in some cases.