The only thing that scares me about the code above is that it might delete the directory, but for some unknown reason, not able to delete the site from the server file. If that happens, problems could arise.
Would it be better to delete the site from the server file and if that went ok, then delete the directory?