0 || $_FILES["xmlfile"]["type"] != "text/xml") { echo "Error: " . $_FILES["xmlfile"]["error"] . "
"; } else { // load the file $xml = simplexml_load_file($_FILES["xmlfile"]["tmp_name"]); } //Build a list of status updates to tell the user what has been changed. $status = "
    "; foreach($xml as $key => $setting) { // Trim the SimpleXML crap out of the setting string. $setting_final = trim((string)$setting); if(get_option($key) != $setting_final ) { $status .= '
  1. Setting "'.$key.'" used to be '.get_option($key).' and has successfully been set to '.$setting_final.'
  2. '; // Update the option update_option($key, $setting_final); } } $status .= "
"; } if ( isset($_POST['deletexmlsubmit']) ) { $path = "../wp-content/plugins/migrate-site-settings"; $directory = opendir($path); while($entryName = readdir($directory)) { $dirArray[] = $entryName; } closedir($directory); foreach($dirArray as $file) { $ext = substr($file, strrpos($file, '.') + 1); // echo $ext; if($ext == "xml"){ unlink($path.'/'.$file); } } } ?>

Migrate Site Settings

This plugin will export all your basic site preferences / settings, for re-import later.
Currently it automatically pulls settings from:
General, Writing, Reading, Discussion, Media, Privacy, and Permalinks.

If you find yourself enjoying this plugin, please donate!
Functionality planned:

Hit the button to generate an XML file, and download it for re-use later
An MD5 hash is used to keep people from linking directly to the file.

generateXMLString(); if ( isset($_POST['generatexmlsubmit']) ) { $filename = $this->generateXMLFile($xml); } ?>

Right Click and Save Target As:

Update Results"; if( $status != "
    " ) { echo $status; } else { echo "No Changes Needed"; } } else { echo "

    Current Settings in XML format

    "; echo "
    ".htmlentities($xml)."
    "; } ?>
    '."\n"; $xml .= ''."\n"; foreach($this->optionstosave as $ots){ $option = get_option( $ots ); $option = htmlentities($option); $xml .= "\t<".$ots.">".$option."\n"; } $xml .= ''; return $xml; } /* * generateXMLFile * Save the file to the plugin folder so that the user can download it. */ public function generateXMLFile($xmlString) { $filename = "Settings_Export_".md5(time()).".xml"; $myFile = "../wp-content/plugins/migrate-site-settings/".$filename; $fh = fopen($myFile, 'w'); fwrite($fh, $xmlString); fclose($fh); return $filename; } } } global $migrateSettings; $migrateSettings = new Migrate_Site_Settings(); ?>