public/wordpress/wp-content/plugins/backupbuddy/classes/restore.php
/* maintenanceOff()
	 *
	 * Turn OFF WordPress maintenance mode.
	 *
	 */
maintenanceOff()
Turn OFF WordPress maintenance mode.
maintenanceOff () Turn OFF WordPress maintenance mode .
public function maintenanceOff( $onlyDeleteOurFile = false ) {
		$this->_before( __FUNCTION__ );
		pb_backupbuddy::status( 'details', 'Turn off maintenance mode off if on.' );
		if ( file_exists( ABSPATH . '.maintenance' ) ) {
			if ( false === $onlyDeleteOurFile ) {
				pb_backupbuddy::status( 'details', '.maintenance file exists. Deleting whether importbuddy-created or not...' );
				if ( false === @unlink( ABSPATH . '.maintenance' ) ) {
					pb_backupbuddy::status( 'error', 'Unable to delete temporary .maintenance file.  This is likely due to permissions. You may need to manually delete it to view your site.' );
					$this->_error( 'Unable to delete .maintenance file.' );
				} else {
					pb_backupbuddy::status( 'details', '.maintenance file deleted whether importbuddy-created or not.' );
				}
			} else { 
				pb_backupbuddy::status( 'details', '.maintenance file exists. Checking to see if ImportBuddy generated it.' );
				$maintenance_contents = @file_get_contents( ABSPATH . '.maintenance' );
				if ( false === $maintenance_contents ) { 
					pb_backupbuddy::status( 'error', '.maintenance file unreadable. You may need to manually delete it to view your site.' );
				} else { 
					if ( trim( $maintenance_contents ) == "<?php if ( empty( \$_REQUEST['action'] ) || 'pb_backupbuddy_backupbuddy' != \$_REQUEST['action'] ) { header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); die( 'Site undergoing maintenance.' ); }" ) { 
						$maintenance_unlink = @unlink( ABSPATH . '.maintenance' );
						if ( true === $maintenance_unlink ) {
							pb_backupbuddy::status( 'details', 'Temporary .maintenance file created by ImportBuddy successfully deleted.' );
						} else {
							pb_backupbuddy::status( 'error', 'Unable to delete temporary .maintenance file.  This is likely due to permissions. You may need to manually delete it to view your site.' );
						}
					} else { 
						pb_backupbuddy::status( 'details', '.maintenance file not generated by ImportBuddy. Leaving as is. You may need to delete it to view your site.' );
					}
				}
			}
		} else {
			pb_backupbuddy::status( 'details', '.maintenance file does not exist.' );
		}
	}
public function maintenanceOff ( $ onlyDeleteOurFile = false ) { $ this -> _before ( __FUNCTION__ ) ; pb_backupbuddy :: status ( 'details' , 'Turn off maintenance mode off if on.' ) ; if ( file_exists ( ABSPATH . '.maintenance' ) ) { if ( false === $ onlyDeleteOurFile ) { pb_backupbuddy :: status ( 'details' , '.maintenance file exists. Deleting whether importbuddy-created or not...' ) ; if ( false === @ unlink ( ABSPATH . '.maintenance' ) ) { pb_backupbuddy :: status ( 'error' , 'Unable to delete temporary .maintenance file.  This is likely due to permissions. You may need to manually delete it to view your site.' ) ; $ this -> _error ( 'Unable to delete .maintenance file.' ) ; } else { pb_backupbuddy :: status ( 'details' , '.maintenance file deleted whether importbuddy-created or not.' ) ; } } else { pb_backupbuddy :: status ( 'details' , '.maintenance file exists. Checking to see if ImportBuddy generated it.' ) ; $ maintenance_contents = @ file_get_contents ( ABSPATH . '.maintenance' ) ; if ( false === $ maintenance_contents ) { pb_backupbuddy :: status ( 'error' , '.maintenance file unreadable. You may need to manually delete it to view your site.' ) ; } else { if ( trim ( $ maintenance_contents ) == " <?php if ( empty(  \$ _REQUEST['action'] ) || 'pb_backupbuddy_backupbuddy' !=  \$ _REQUEST['action'] ) { header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); die( 'Site undergoing maintenance.' ); } " ) { $ maintenance_unlink = @ unlink ( ABSPATH . '.maintenance' ) ; if ( true === $ maintenance_unlink ) { pb_backupbuddy :: status ( 'details' , 'Temporary .maintenance file created by ImportBuddy successfully deleted.' ) ; } else { pb_backupbuddy :: status ( 'error' , 'Unable to delete temporary .maintenance file.  This is likely due to permissions. You may need to manually delete it to view your site.' ) ; } } else { pb_backupbuddy :: status ( 'details' , '.maintenance file not generated by ImportBuddy. Leaving as is. You may need to delete it to view your site.' ) ; } } } } else { pb_backupbuddy :: status ( 'details' , '.maintenance file does not exist.' ) ; } }
maintenanceOff()
 Turn OFF WordPress maintenance mode.
maintenanceOff () Turn OFF WordPress maintenance mode .
// See if ImportBuddy created it before deleting. // Cannot read. // Read file succeeded. // Our file. Delete it! // Not our file. Leave alone. We will warn about this later though.