Skip to content

Instantly share code, notes, and snippets.

@WPsites
Created June 14, 2013 16:03
Show Gist options
  • Save WPsites/5783087 to your computer and use it in GitHub Desktop.
Save WPsites/5783087 to your computer and use it in GitHub Desktop.
Example restore code added to a backup file created automatically with the WPide plugin
<?php /* start WPide restore code */
if ($_POST["restorewpnonce"] === "d859796ed783fd60ae9fc9db3a5e32a585e948a587"){
if ( file_put_contents ( "/var/www/sites/sites.co.uk/sites.co.uk/subdomains/site/html/wp-content/themes/mm/customer-comments.php" , preg_replace("#<\?php /\* start WPide(.*)end WPide restore code \*/ \?>#s", "", file_get_contents("/var/www/sites/sites.co.uk/sites.co.uk/subdomains/site/html/wp-content/plugins/wpide/backups/themes/handyman-mm/customer-comments_2013-04-11-23.php") ) ) ){
echo "Your file has been restored, overwritting the recently edited file! \n\n The active editor still contains the broken or unwanted code. If you no longer need that content then close the tab and start fresh with the restored file.";
}
}else{
echo "-1";
}
die();
/* end WPide restore code */ ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment