golden hour
/home/doctorbruno/public_html/pgmed.org/wp-content/plugins/backupbuddy/controllers/ajax
⬆️ Go Up
Upload
File/Folder
Size
Actions
_destination_picker.php
24.64 KB
Del
OK
backup_status.php
586 B
Del
OK
db_check.php
853 B
Del
OK
db_repair.php
765 B
Del
OK
deploy.php
1.64 KB
Del
OK
deploy_confirm.php
2.69 KB
Del
OK
deploy_status.php
1.72 KB
Del
OK
deployment_regenerateKey.php
705 B
Del
OK
destinationTabs.php
15 KB
Del
OK
destination_ftp_pathpicker.php
4.74 KB
Del
OK
destination_picker.php
306 B
Del
OK
disalert.php
298 B
Del
OK
download_archive.php
2.96 KB
Del
OK
email_error_test.php
485 B
Del
OK
exclude_tree.php
2.67 KB
Del
OK
file_tree.php
7.35 KB
Del
OK
forceSpawnCron.php
421 B
Del
OK
gdrive_folder_create.php
1.96 KB
Del
OK
gdrive_folder_select.php
2.39 KB
Del
OK
getMainLog.php
360 B
Del
OK
hash.php
951 B
Del
OK
icicle.php
386 B
Del
OK
importbuddy.php
609 B
Del
OK
importexport_settings.php
3.84 KB
Del
OK
index.php
28 B
Del
OK
integrity_status.php
8.82 KB
Del
OK
live_last_snapshot_details.php
6.34 KB
Del
OK
live_settings.php
3.77 KB
Del
OK
live_setup.php
4.65 KB
Del
OK
live_snapshot_status.php
1.32 KB
Del
OK
live_stash_files.php
1.03 KB
Del
OK
live_stats.php
2.56 KB
Del
OK
live_troubleshooting_download.php
754 B
Del
OK
migrate_status.php
4.69 KB
Del
OK
migration_picker.php
343 B
Del
OK
php_max_runtime_test.php
1.27 KB
Del
OK
pinfo.php
171 B
Del
OK
profile_settings.php
327 B
Del
OK
quickstart.php
246 B
Del
OK
quickstart_form.php
6.97 KB
Del
OK
refresh_database_size.php
415 B
Del
OK
refresh_database_size_excluded.php
461 B
Del
OK
refresh_site_objects.php
384 B
Del
OK
refresh_site_objects_excluded.php
448 B
Del
OK
refresh_site_size.php
382 B
Del
OK
refresh_site_size_excluded.php
428 B
Del
OK
refresh_zip_methods.php
1.36 KB
Del
OK
remoteClient.php
867 B
Del
OK
remote_delete.php
635 B
Del
OK
remote_save.php
2.36 KB
Del
OK
remote_send.php
3.15 KB
Del
OK
remote_test.php
978 B
Del
OK
remotesend_abort.php
1.11 KB
Del
OK
remotesend_details.php
1.69 KB
Del
OK
remotesend_retry.php
2.59 KB
Del
OK
restore_file_restore.php
3.71 KB
Del
OK
restore_file_view.php
2.61 KB
Del
OK
rollback.php
1.86 KB
Del
OK
run_php_memory_test.php
856 B
Del
OK
run_php_memory_test_results.php
647 B
Del
OK
run_php_runtime_test.php
859 B
Del
OK
run_php_runtime_test_results.php
657 B
Del
OK
send_status.php
4.32 KB
Del
OK
set_backup_note.php
1.74 KB
Del
OK
site_size_listing.php
7.72 KB
Del
OK
stop_backup.php
208 B
Del
OK
testErrorLog.php
371 B
Del
OK
view_log.php
1.44 KB
Del
OK
Edit: quickstart_form.php
<?php backupbuddy_core::verifyAjaxAccess(); pb_backupbuddy::verify_nonce(); // Quick Start form saving. /* quickstart_form() * * Saving Quickstart form. * */ $errors = array(); $form = pb_backupbuddy::_POST(); //print_r( $form ); if ( ( '' != $form['email'] ) && ( false !== stristr( $form['email'], '@' ) ) ) { pb_backupbuddy::$options['email_notify_error'] = strip_tags( $form['email'] ); } else { $errors[] = 'Invalid email address.'; } if ( ( '' != $form['password'] ) && ( $form['password'] == $form['password_confirm'] ) ) { pb_backupbuddy::$options['importbuddy_pass_hash'] = md5( $form['password'] ); pb_backupbuddy::$options['importbuddy_pass_length'] = strlen( $form['password'] ); } elseif ( '' == $form['password'] ) { $errors[] = 'Please enter a password for restoring / migrating.'; } else { $errors[] = 'Passwords do not match.'; } /***** BEGIN STASH v2 SETUP *****/ // Note: If existing Stash2 exists with this username then use that instead of making a new stash2 destination. if ( 'stash2' == pb_backupbuddy::_POST( 'destination' ) ) { if ( ( '' == pb_backupbuddy::_POST( 'stash2_username' ) ) || ( '' == pb_backupbuddy::_POST( 'stash2_password' ) ) ) { // A field is blank. $errors[] = 'You must enter your iThemes username & password to log in to the remote destination BackupBuddy Stash (v2).'; } else { // Username and password provided. require_once( pb_backupbuddy::plugin_path() . '/destinations/stash2/class.itx_helper2.php' ); require_once( pb_backupbuddy::plugin_path() . '/destinations/stash2/init.php' ); global $wp_version; $itxapi_username = strtolower( pb_backupbuddy::_POST( 'stash2_username' ) ); // See if this user already exists. foreach( pb_backupbuddy::$options['remote_destinations'] as $destination_index => $destination ) { // Loop through ending with the last created destination of this type. if ( 'stash2' == $destination['type'] ) { if ( $itxapi_username == $destination['itxapi_username'] ) { // Existing destination match. $destination_id = $destination_index; } } } if ( ! isset( $destination_id ) ) { // Did not already find the same Stash destination. $password_hash = iThemes_Credentials::get_password_hash( $itxapi_username, pb_backupbuddy::_POST( 'stash2_password' ) ); $access_token = ITXAPI_Helper2::get_access_token( $itxapi_username, $password_hash, site_url(), $wp_version ); $settings = array( 'itxapi_username' => $itxapi_username, 'itxapi_password' => $access_token, ); $response = pb_backupbuddy_destination_stash2::stashAPI( $settings, 'connect' ); if ( ! is_array( $response ) ) { // Error message. $errors[] = 'Error #32898973: Unexpected server response. Check your Stash login and try again. Detailed response: `' . print_r( $response, true ) .'`.'; } else { if ( isset( $response['error'] ) ) { $errors[] = $response['error']['message']; } else { if ( isset( $response['token'] ) ) { $itxapi_token = $response['token']; } else { $errors[] = 'Error #32977932: Unexpected server response. Token missing. Check your Stash login and try again. Detailed response: `' . print_r( $response, true ) .'`.'; } } } // If we have the token then create the Stash2 destination. if ( isset( $itxapi_token ) ) { if ( count( pb_backupbuddy::$options['remote_destinations'] ) > 0 ) { $nextDestKey = max( array_keys( pb_backupbuddy::$options['remote_destinations'] ) ) + 1; } else { // no destinations yet. first index. $nextDestKey = 0; } pb_backupbuddy::$options['remote_destinations'][ $nextDestKey ] = pb_backupbuddy_destination_stash2::$default_settings; pb_backupbuddy::$options['remote_destinations'][ $nextDestKey ]['itxapi_username'] = pb_backupbuddy::_POST( 'stash2_username' ); pb_backupbuddy::$options['remote_destinations'][ $nextDestKey ]['itxapi_token'] = $itxapi_token; pb_backupbuddy::$options['remote_destinations'][ $nextDestKey ]['title'] = 'My Stash (v2)'; pb_backupbuddy::save(); $destination_id = $nextDestKey; } } // end $destination_id not set. } // end if user and pass set. } // end stash setup. /***** END STASH v2 SETUP *****/ if ( '' != $form['schedule'] ) { if ( ! isset( $destination_id ) ) { $destination_id = ''; if ( '' != $form['destination_id'] ) { // Dest id explicitly set. $destination_id = $form['destination_id']; } else { // No explicit destination ID; deduce it. if ( '' != $form['destination'] ) { foreach( pb_backupbuddy::$options['remote_destinations'] as $destination_index => $destination ) { // Loop through ending with the last created destination of this type. if ( $destination['type'] == $form['destination'] ) { $destination_id = $destination_index; } } // end foreach. } } } // end if ! isset( $destination_id ). function pb_backupbuddy_schedule_exist_by_title( $title ) { foreach( pb_backupbuddy::$options['schedules'] as $schedule ) { if ( $schedule['title'] == $title ) { return true; } } return false; } // STARTER if ( 'starter' == $form['schedule'] ) { $title = 'Weekly Database (Quick Setup - Starter)'; if ( false === pb_backupbuddy_schedule_exist_by_title( $title ) ) { $add_response = backupbuddy_api::addSchedule( $title, $profile = '1', $interval = 'weekly', $first_run = ( time() + ( get_option( 'gmt_offset' ) * 3600 ) + 86400 ), $remote_destinations = array( $destination_id ) ); if ( true !== $add_response ) { $errors[] = $add_response; } } $title = 'Monthly Full (Quick Setup - Starter)'; if ( false === pb_backupbuddy_schedule_exist_by_title( $title ) ) { $add_response = backupbuddy_api::addSchedule( $title, $profile = '2', $interval = 'monthly', $first_run = ( time() + ( get_option( 'gmt_offset' ) * 3600 ) + 86400 + 18000 ), $remote_destinations = array( $destination_id ) ); if ( true !== $add_response ) { $errors[] = $add_response; } } } // BLOGGER if ( 'blogger' == $form['schedule'] ) { $title = 'Daily Database (Quick Setup - Blogger)'; if ( false === pb_backupbuddy_schedule_exist_by_title( $title ) ) { $add_response = backupbuddy_api::addSchedule( $title, $profile = '1', $interval = 'daily', $first_run = ( time() + ( get_option( 'gmt_offset' ) * 3600 ) + 86400 ), $remote_destinations = array( $destination_id ) ); if ( true !== $add_response ) { $errors[] = $add_response; } } $title = 'Weekly Full (Quick Setup - Blogger)'; if ( false === pb_backupbuddy_schedule_exist_by_title( $title ) ) { $add_response = backupbuddy_api::addSchedule( $title, $profile = '2', $interval = 'weekly', $first_run = ( time() + ( get_option( 'gmt_offset' ) * 3600 ) + 86400 + 18000 ), $remote_destinations = array( $destination_id ) ); if ( true !== $add_response ) { $errors[] = $add_response; } } } } // end set schedule. if ( 0 == count( $errors ) ) { pb_backupbuddy::save(); die( 'Success.' ); } else { die( '* ' . implode( "\n* ", $errors ) ); }
Save