backups_dir_location()); touch($updraft_dir . 'ready_for_restore'); if (!function_exists('WP_Filesystem')) require_once ABSPATH.'wp-admin/includes/file.php'; WP_Filesystem(); // Create maintenance file with current clone status contents if (!$wp_filesystem->exists(trailingslashit(WP_CONTENT_DIR).'maintenance.php')) { ob_start(); if (!class_exists('UpdraftPlus_Temporary_Clone_Status')) { include_once trailingslashit(plugin_dir_path(__FILE__)).'temporary-clone-status.php'; } $updraftplus_temporary_clone_status = new UpdraftPlus_Temporary_Clone_Status(); $updraftplus_temporary_clone_status->output_status_page(false); $contents = ob_get_clean(); $wp_filesystem->put_contents( trailingslashit(WP_CONTENT_DIR).'maintenance.php', $contents, FS_CHMOD_FILE ); } } /** * Remove maintenance file created before the DB restoration. */ public function remove_maintenance_file() { global $updraftplus, $wp_filesystem; $updraft_dir = trailingslashit($updraftplus->backups_dir_location()); if (!file_exists($updraft_dir . 'ready_for_restore')) return; if (!function_exists('WP_Filesystem')) require_once ABSPATH.'wp-admin/includes/file.php'; WP_Filesystem(); $wp_filesystem->delete(trailingslashit(WP_CONTENT_DIR).'maintenance.php'); } } if (defined('UPDRAFTPLUS_THIS_IS_CLONE') && UPDRAFTPLUS_THIS_IS_CLONE) { $updraftplus_temporary_clone_restore = new UpdraftPlus_Temporary_Clone_Restore(); }