2020-03-26 14:05:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class MainWP_Debug {
|
|
|
|
/**
|
|
|
|
* @param $mainwpChild MainWP_Child
|
|
|
|
*/
|
|
|
|
public static function process( &$mainwpChild) {
|
|
|
|
if ( ! isset( $_GET['mainwpdebug'] ) || ! defined( 'MAINWP_DEBUG' ) || ( MAINWP_DEBUG !== true ) ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<pre>';
|
|
|
|
$start = microtime( true );
|
|
|
|
|
|
|
|
if ( 'fullbackup' == $_GET['mainwpdebug'] ) {
|
|
|
|
//Full backup
|
|
|
|
$_POST['type'] = 'full';
|
|
|
|
$_POST['excludebackup'] = '1';
|
|
|
|
$_POST['excludecache'] = '1';
|
|
|
|
$_POST['excludezip'] = '1';
|
|
|
|
$_POST['excludenonwp'] = '1';
|
|
|
|
$_POST['ext'] = 'tar.gz';
|
|
|
|
print_r( $mainwpChild->backup( false ) );
|
2020-03-26 14:11:33 +00:00
|
|
|
} elseif ( 'test' == $_GET['mainwpdebug'] ) {
|
2020-03-26 14:05:04 +00:00
|
|
|
print_r( get_included_files() );
|
|
|
|
} else {
|
|
|
|
print_r( $mainwpChild->getSiteStats( array(), false ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
$stop = microtime( true );
|
|
|
|
die( "\n\n\n" . 'duration: ' . ( $stop - $start ) . 's</pre>' );
|
|
|
|
}
|
|
|
|
}
|