Skip to content

Instantly share code, notes, and snippets.

@WPsites WPsites/gist:5783087
Created Jun 14, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.