/var/www/(Del)hsihk.com/wp-content/plugins/backupbuddy/controllers/ajax/remote_test.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
if ( ! is_admin() ) { die( 'Access denied.' ); }

// Remote destination testing.
/*    remote_test()
 *    
 *    Remote destination testing. Echos.
 *    
 *    @return        null
 */


if ( defined'PB_DEMO_MODE' ) ) {
    die( 
'Access denied in demo mode.' );
}

global 
$pb_backupbuddy_destination_errors;
$pb_backupbuddy_destination_errors = array();


require_once( 
pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php' );

$form_settings = array();
foreach( 
pb_backupbuddy::_POST() as $post_id => $post ) {
    if ( 
substr$post_id015 ) == 'pb_backupbuddy_' ) {
        
$id substr$post_id15 );
        if ( 
$id != '' ) {
            
$form_settings[$id] = $post;
        }
    }
}

$test_result pb_backupbuddy_destinations::test$form_settings );

if ( 
$test_result === true ) {
    echo 
'Test successful.';
} else {
    echo 
"Test failed.\n\n";
    echo 
$test_result;
    foreach( 
$pb_backupbuddy_destination_errors as $pb_backupbuddy_destination_error ) {
        echo 
$pb_backupbuddy_destination_error "\n";
    }
}

die();