: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
class wp_file_manager_files_restore {
public function extract($source, $destination) {
if (extension_loaded('zip') === true) {
if (file_exists($source) === true) {
$res = $zip->open($source);
for($i = 0; $i < $zip->numFiles; $i++) {
$filename = $zip->getNameIndex($i);
if (strpos($filename,'wp-file-manager') === false) {
$allfiles[] = $zip->getNameIndex($i);
$zip->extractTo($destination, $allfiles);
$isLocal = explode(':\\',$destination);
$path = count($isLocal) > 1 ? str_replace(DIRECTORY_SEPARATOR,'/',$isLocal[1]) : str_replace(DIRECTORY_SEPARATOR,'/',$isLocal[0]);
if(is_dir($destination.'/'.$path)){
$is_copied = copy_dir( $destination.'/'.$path, $destination);
$folderarr = explode('/',$path);
if(is_dir($destination.'/'.$folderarr[0])){
$is_deleted = $this->fm_rmdir($destination.'/'.$folderarr[0]);
public function fm_rmdir($src) {
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
$full = $src . '/' . $file;