Skip to content

Instantly share code, notes, and snippets.

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

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/" , preg_replace("#<\?php /\* start WPide(.*)end WPide restore code \*/ \?>#s", "", file_get_contents("/var/www/sites/") ) ) ){
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.";
echo "-1";
/* 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.