make check_xref work when plugins dir is empty
optimising refactor of check_xref