Prevent plugin from deleting important directories
To answer my own question here is what I’ve found for the sake of keeping questions answered. What this does is copying the important directory before upgrade and recovering it after upgrade: function my_dir_copy($source, $dest) { if (is_link($source)) { return symlink(readlink($source), $dest); } if (is_file($source)) { return copy($source, $dest); } if (!is_dir($dest)) { mkdir($dest); } … Read more