Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp...
File: admin.php
<?php $this->settings_formcontents(); ?>
[3000] Fix | Delete
</form>
[3001] Fix | Delete
<?php
[3002] Fix | Delete
$our_keys = UpdraftPlus_Options::get_updraft_option('updraft_central_localkeys');
[3003] Fix | Delete
if (!is_array($our_keys)) $our_keys = array();
[3004] Fix | Delete
[3005] Fix | Delete
// Hide the UpdraftCentral Cloud wizard If the user already has a key created for either
[3006] Fix | Delete
// updraftplus.com or self hosted version.
[3007] Fix | Delete
if (empty($our_keys)) {
[3008] Fix | Delete
?>
[3009] Fix | Delete
<div id="updraftcentral_cloud_connect_container" class="updraftcentral_cloud_connect hidden-in-updraftcentral">
[3010] Fix | Delete
<?php
[3011] Fix | Delete
[3012] Fix | Delete
$email = '';
[3013] Fix | Delete
[3014] Fix | Delete
// Checking email from "Premium / Extensions" tab
[3015] Fix | Delete
if (defined('UDADDONS2_SLUG')) {
[3016] Fix | Delete
global $updraftplus_addons2;
[3017] Fix | Delete
[3018] Fix | Delete
if (is_a($updraftplus_addons2, 'UpdraftPlusAddons2') && is_callable(array($updraftplus_addons2, 'get_option'))) {
[3019] Fix | Delete
$options = $updraftplus_addons2->get_option(UDADDONS2_SLUG.'_options');
[3020] Fix | Delete
[3021] Fix | Delete
if (!empty($options['email'])) {
[3022] Fix | Delete
$email = htmlspecialchars($options['email']);
[3023] Fix | Delete
}
[3024] Fix | Delete
}
[3025] Fix | Delete
}
[3026] Fix | Delete
[3027] Fix | Delete
// Check the vault's email if we fail to get the "email" from the "Premium / Extensions" tab
[3028] Fix | Delete
if (empty($email)) {
[3029] Fix | Delete
$settings = UpdraftPlus_Storage_Methods_Interface::update_remote_storage_options_format('updraftvault');
[3030] Fix | Delete
if (!is_wp_error($settings)) {
[3031] Fix | Delete
if (!empty($settings['settings'])) {
[3032] Fix | Delete
foreach ($settings['settings'] as $storage_options) {
[3033] Fix | Delete
if (!empty($storage_options['email'])) {
[3034] Fix | Delete
$email = $storage_options['email'];
[3035] Fix | Delete
break;
[3036] Fix | Delete
}
[3037] Fix | Delete
}
[3038] Fix | Delete
}
[3039] Fix | Delete
}
[3040] Fix | Delete
}
[3041] Fix | Delete
[3042] Fix | Delete
// Checking any possible email we could find from the "updraft_email" option in case the
[3043] Fix | Delete
// above two checks failed.
[3044] Fix | Delete
if (empty($email)) {
[3045] Fix | Delete
$possible_emails = $updraftplus->just_one_email(UpdraftPlus_Options::get_updraft_option('updraft_email'));
[3046] Fix | Delete
if (!empty($possible_emails)) {
[3047] Fix | Delete
// If we get an array from the 'just_one_email' result then we're going
[3048] Fix | Delete
// to pull the very first entry and make use of that on the succeeding process.
[3049] Fix | Delete
if (is_array($possible_emails)) $possible_emails = array_shift($possible_emails);
[3050] Fix | Delete
[3051] Fix | Delete
if (is_string($possible_emails)) {
[3052] Fix | Delete
$emails = explode(',', $possible_emails);
[3053] Fix | Delete
$email = trim($emails[0]);
[3054] Fix | Delete
}
[3055] Fix | Delete
}
[3056] Fix | Delete
}
[3057] Fix | Delete
[3058] Fix | Delete
$this->include_template('wp-admin/settings/updraftcentral-connect.php', false, array('email' => $email));
[3059] Fix | Delete
?>
[3060] Fix | Delete
</div>
[3061] Fix | Delete
<?php
[3062] Fix | Delete
}
[3063] Fix | Delete
?>
[3064] Fix | Delete
</div>
[3065] Fix | Delete
[3066] Fix | Delete
<div id="updraft-navtab-expert-content"<?php if ('expert' != $tabflag) echo ' class="updraft-hidden"'; ?> style="<?php if ('expert' != $tabflag) echo 'display:none;'; ?>">
[3067] Fix | Delete
<?php $this->settings_advanced_tools(); ?>
[3068] Fix | Delete
</div>
[3069] Fix | Delete
[3070] Fix | Delete
<div id="updraft-navtab-addons-content"<?php if ('addons' != $tabflag) echo ' class="updraft-hidden"'; ?> style="<?php if ('addons' != $tabflag) echo 'display:none;'; ?>">
[3071] Fix | Delete
[3072] Fix | Delete
<?php
[3073] Fix | Delete
$tab_addons = $this->include_template('wp-admin/settings/tab-addons.php', true, array('tabflag' => $tabflag));
[3074] Fix | Delete
[3075] Fix | Delete
echo apply_filters('updraftplus_addonstab_content', $tab_addons);
[3076] Fix | Delete
[3077] Fix | Delete
?>
[3078] Fix | Delete
[3079] Fix | Delete
</div>
[3080] Fix | Delete
[3081] Fix | Delete
<?php
[3082] Fix | Delete
do_action('updraftplus_after_main_tab_content', $tabflag);
[3083] Fix | Delete
// settings_header() opens a div
[3084] Fix | Delete
$this->settings_footer();
[3085] Fix | Delete
}
[3086] Fix | Delete
[3087] Fix | Delete
/**
[3088] Fix | Delete
* Get main tabs array
[3089] Fix | Delete
*
[3090] Fix | Delete
* @return Array Array which have key as a tab key and value as tab label
[3091] Fix | Delete
*/
[3092] Fix | Delete
private function get_main_tabs_array() {
[3093] Fix | Delete
return apply_filters(
[3094] Fix | Delete
'updraftplus_main_tabs',
[3095] Fix | Delete
array(
[3096] Fix | Delete
'backups' => __('Backup / Restore', 'updraftplus'),
[3097] Fix | Delete
'migrate' => __('Migrate / Clone', 'updraftplus'),
[3098] Fix | Delete
'settings' => __('Settings', 'updraftplus'),
[3099] Fix | Delete
'expert' => __('Advanced Tools', 'updraftplus'),
[3100] Fix | Delete
'addons' => __('Premium / Extensions', 'updraftplus'),
[3101] Fix | Delete
)
[3102] Fix | Delete
);
[3103] Fix | Delete
}
[3104] Fix | Delete
[3105] Fix | Delete
/**
[3106] Fix | Delete
* Potentially register an action for showing restore progress
[3107] Fix | Delete
*/
[3108] Fix | Delete
private function print_restore_in_progress_box_if_needed() {
[3109] Fix | Delete
global $updraftplus;
[3110] Fix | Delete
$check_restore_progress = $updraftplus->check_restore_progress();
[3111] Fix | Delete
// Check to see if the restore is still in progress
[3112] Fix | Delete
if (is_array($check_restore_progress) && true == $check_restore_progress['status']) {
[3113] Fix | Delete
[3114] Fix | Delete
$restore_jobdata = $check_restore_progress['restore_jobdata'];
[3115] Fix | Delete
$restore_jobdata['jobid'] = $check_restore_progress['restore_in_progress'];
[3116] Fix | Delete
$this->restore_in_progress_jobdata = $restore_jobdata;
[3117] Fix | Delete
[3118] Fix | Delete
add_action('all_admin_notices', array($this, 'show_admin_restore_in_progress_notice'));
[3119] Fix | Delete
}
[3120] Fix | Delete
}
[3121] Fix | Delete
[3122] Fix | Delete
/**
[3123] Fix | Delete
* This function is called via the command class, it will get the resume restore notice to be shown when a restore is taking place over AJAX
[3124] Fix | Delete
*
[3125] Fix | Delete
* @param string $job_id - the id of the job
[3126] Fix | Delete
*
[3127] Fix | Delete
* @return WP_Error|string - can return a string containing html or a WP_Error
[3128] Fix | Delete
*/
[3129] Fix | Delete
public function get_restore_resume_notice($job_id) {
[3130] Fix | Delete
global $updraftplus;
[3131] Fix | Delete
[3132] Fix | Delete
if (empty($job_id)) return new WP_Error('missing_parameter', 'Missing parameters.');
[3133] Fix | Delete
[3134] Fix | Delete
$restore_jobdata = $updraftplus->jobdata_getarray($job_id);
[3135] Fix | Delete
[3136] Fix | Delete
if (!is_array($restore_jobdata) && empty($restore_jobdata)) return new WP_Error('missing_jobdata', 'Job data not found.');
[3137] Fix | Delete
[3138] Fix | Delete
$restore_jobdata['jobid'] = $job_id;
[3139] Fix | Delete
$this->restore_in_progress_jobdata = $restore_jobdata;
[3140] Fix | Delete
[3141] Fix | Delete
$html = $this->show_admin_restore_in_progress_notice(true, true);
[3142] Fix | Delete
[3143] Fix | Delete
if (empty($html)) return new WP_Error('job_aborted', 'Job aborted.');
[3144] Fix | Delete
[3145] Fix | Delete
return $html;
[3146] Fix | Delete
}
[3147] Fix | Delete
[3148] Fix | Delete
/**
[3149] Fix | Delete
* If added, then runs upon the WP action all_admin_notices, or can be called via get_restore_resume_notice() for when a restore is running over AJAX
[3150] Fix | Delete
*
[3151] Fix | Delete
* @param Boolean $return_instead_of_echo - indicates if we want to add the tfa UI
[3152] Fix | Delete
* @param Boolean $exclude_js - indicates if we want to exclude the js in the returned html
[3153] Fix | Delete
*
[3154] Fix | Delete
* @return void|string - can return a string containing html or echo the html to page
[3155] Fix | Delete
*/
[3156] Fix | Delete
public function show_admin_restore_in_progress_notice($return_instead_of_echo = false, $exclude_js = false) {
[3157] Fix | Delete
[3158] Fix | Delete
if (isset($_REQUEST['action']) && 'updraft_restore_abort' === $_REQUEST['action'] && !empty($_REQUEST['job_id'])) {
[3159] Fix | Delete
delete_site_option('updraft_restore_in_progress');
[3160] Fix | Delete
return;
[3161] Fix | Delete
}
[3162] Fix | Delete
[3163] Fix | Delete
$restore_jobdata = $this->restore_in_progress_jobdata;
[3164] Fix | Delete
$seconds_ago = time() - (int) $restore_jobdata['job_time_ms'];
[3165] Fix | Delete
$minutes_ago = floor($seconds_ago/60);
[3166] Fix | Delete
$seconds_ago = $seconds_ago - $minutes_ago*60;
[3167] Fix | Delete
$time_ago = sprintf(__("%s minutes, %s seconds", 'updraftplus'), $minutes_ago, $seconds_ago);
[3168] Fix | Delete
[3169] Fix | Delete
$html = '<div class="updated show_admin_restore_in_progress_notice">';
[3170] Fix | Delete
$html .= '<span class="unfinished-restoration"><strong>UpdraftPlus: '.__('Unfinished restoration', 'updraftplus').'</strong></span><br>';
[3171] Fix | Delete
$html .= '<p>'.sprintf(__('You have an unfinished restoration operation, begun %s ago.', 'updraftplus'), $time_ago).'</p>';
[3172] Fix | Delete
$html .= '<form method="post" action="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">';
[3173] Fix | Delete
$html .= wp_nonce_field('updraftplus-credentialtest-nonce');
[3174] Fix | Delete
$html .= '<input id="updraft_restore_continue_action" type="hidden" name="action" value="updraft_restore_continue">';
[3175] Fix | Delete
$html .= '<input type="hidden" name="updraftplus_ajax_restore" value="continue_ajax_restore">';
[3176] Fix | Delete
$html .= '<input type="hidden" name="job_id" value="'.$restore_jobdata['jobid'].'" value="'.esc_attr($restore_jobdata['jobid']).'">';
[3177] Fix | Delete
[3178] Fix | Delete
if ($exclude_js) {
[3179] Fix | Delete
$html .= '<button id="updraft_restore_resume" type="submit" class="button-primary">'.__('Continue restoration', 'updraftplus').'</button>';
[3180] Fix | Delete
} else {
[3181] Fix | Delete
$html .= '<button id="updraft_restore_resume" onclick="jQuery(\'#updraft_restore_continue_action\').val(\'updraft_restore_continue\'); jQuery(this).parent(\'form\').trigger(\'submit\');" type="submit" class="button-primary">'.__('Continue restoration', 'updraftplus').'</button>';
[3182] Fix | Delete
}
[3183] Fix | Delete
$html .= '<button id="updraft_restore_abort" onclick="jQuery(\'#updraft_restore_continue_action\').val(\'updraft_restore_abort\'); jQuery(this).parent(\'form\').trigger(\'submit\');" class="button-secondary">'.__('Dismiss', 'updraftplus').'</button>';
[3184] Fix | Delete
[3185] Fix | Delete
$html .= '</form></div>';
[3186] Fix | Delete
[3187] Fix | Delete
if ($return_instead_of_echo) return $html;
[3188] Fix | Delete
[3189] Fix | Delete
echo $html;
[3190] Fix | Delete
}
[3191] Fix | Delete
[3192] Fix | Delete
/**
[3193] Fix | Delete
* This method will build the UpdraftPlus.com login form and echo it to the page.
[3194] Fix | Delete
*
[3195] Fix | Delete
* @param String $option_page - the option page this form is being output to
[3196] Fix | Delete
* @param Boolean $tfa - indicates if we want to add the tfa UI
[3197] Fix | Delete
* @param Boolean $include_form_container - indicates if we want the form container
[3198] Fix | Delete
* @param Array $further_options - other options (see below for the possibilities + defaults)
[3199] Fix | Delete
*
[3200] Fix | Delete
* @return void
[3201] Fix | Delete
*/
[3202] Fix | Delete
public function build_credentials_form($option_page, $tfa = false, $include_form_container = true, $further_options = array()) {
[3203] Fix | Delete
[3204] Fix | Delete
global $updraftplus;
[3205] Fix | Delete
[3206] Fix | Delete
$further_options = wp_parse_args($further_options, array(
[3207] Fix | Delete
'under_username' => __("Not yet got an account (it's free)? Go get one!", 'updraftplus'),
[3208] Fix | Delete
'under_username_link' => $updraftplus->get_url('my-account')
[3209] Fix | Delete
));
[3210] Fix | Delete
[3211] Fix | Delete
if ($include_form_container) {
[3212] Fix | Delete
$enter_credentials_begin = UpdraftPlus_Options::options_form_begin('', false, array(), 'updraftplus_com_login');
[3213] Fix | Delete
if (is_multisite()) $enter_credentials_begin .= '<input type="hidden" name="action" value="update">';
[3214] Fix | Delete
} else {
[3215] Fix | Delete
$enter_credentials_begin = '<div class="updraftplus_com_login">';
[3216] Fix | Delete
}
[3217] Fix | Delete
[3218] Fix | Delete
$interested = htmlspecialchars(__('Interested in knowing about your UpdraftPlus.Com password security? Read about it here.', 'updraftplus'));
[3219] Fix | Delete
[3220] Fix | Delete
$connect = htmlspecialchars(__('Connect', 'updraftplus'));
[3221] Fix | Delete
[3222] Fix | Delete
$enter_credentials_end = '<p class="updraft-after-form-table">';
[3223] Fix | Delete
[3224] Fix | Delete
if ($include_form_container) {
[3225] Fix | Delete
$enter_credentials_end .= '<input type="submit" class="button-primary ud_connectsubmit" value="'.$connect.'" />';
[3226] Fix | Delete
} else {
[3227] Fix | Delete
$enter_credentials_end .= '<button class="button-primary ud_connectsubmit">'.$connect.'</button>';
[3228] Fix | Delete
}
[3229] Fix | Delete
[3230] Fix | Delete
$enter_credentials_end .= '<span class="updraftplus_spinner spinner">' . __('Processing', 'updraftplus') . '...</span></p>';
[3231] Fix | Delete
[3232] Fix | Delete
$enter_credentials_end .= '<p class="updraft-after-form-table" style="font-size: 70%"><em><a href="https://updraftplus.com/faqs/tell-me-about-my-updraftplus-com-account/" target="_blank">'.$interested.'</a></em></p>';
[3233] Fix | Delete
[3234] Fix | Delete
$enter_credentials_end .= $include_form_container ? '</form>' : '</div>';
[3235] Fix | Delete
[3236] Fix | Delete
echo $enter_credentials_begin;
[3237] Fix | Delete
[3238] Fix | Delete
$options = apply_filters('updraftplus_com_login_options', array("email" => "", "password" => ""));
[3239] Fix | Delete
[3240] Fix | Delete
if ($include_form_container) {
[3241] Fix | Delete
// We have to duplicate settings_fields() in order to set our referer
[3242] Fix | Delete
// settings_fields(UDADDONS2_SLUG.'_options');
[3243] Fix | Delete
[3244] Fix | Delete
$option_group = $option_page.'_options';
[3245] Fix | Delete
echo "<input type='hidden' name='option_page' value='" . esc_attr($option_group) . "' />";
[3246] Fix | Delete
echo '<input type="hidden" name="action" value="update" />';
[3247] Fix | Delete
[3248] Fix | Delete
// wp_nonce_field("$option_group-options");
[3249] Fix | Delete
[3250] Fix | Delete
// This one is used on multisite
[3251] Fix | Delete
echo '<input type="hidden" name="tab" value="addons" />';
[3252] Fix | Delete
[3253] Fix | Delete
$name = "_wpnonce";
[3254] Fix | Delete
$action = esc_attr($option_group."-options");
[3255] Fix | Delete
$nonce_field = '<input type="hidden" name="' . $name . '" value="' . wp_create_nonce($action) . '" />';
[3256] Fix | Delete
[3257] Fix | Delete
echo $nonce_field;
[3258] Fix | Delete
[3259] Fix | Delete
$referer = esc_attr(UpdraftPlus_Manipulation_Functions::wp_unslash($_SERVER['REQUEST_URI']));
[3260] Fix | Delete
[3261] Fix | Delete
// This one is used on single site installs
[3262] Fix | Delete
if (false === strpos($referer, '?')) {
[3263] Fix | Delete
$referer .= '?tab=addons';
[3264] Fix | Delete
} else {
[3265] Fix | Delete
$referer .= '&tab=addons';
[3266] Fix | Delete
}
[3267] Fix | Delete
[3268] Fix | Delete
echo '<input type="hidden" name="_wp_http_referer" value="'.$referer.'" />';
[3269] Fix | Delete
// End of duplication of settings-fields()
[3270] Fix | Delete
}
[3271] Fix | Delete
?>
[3272] Fix | Delete
[3273] Fix | Delete
<h2> <?php _e('Connect with your UpdraftPlus.Com account', 'updraftplus'); ?></h2>
[3274] Fix | Delete
<p class="updraftplus_com_login_status"></p>
[3275] Fix | Delete
[3276] Fix | Delete
<table class="form-table">
[3277] Fix | Delete
<tbody>
[3278] Fix | Delete
<tr class="non_tfa_fields">
[3279] Fix | Delete
<th><?php _e('Email', 'updraftplus'); ?></th>
[3280] Fix | Delete
<td>
[3281] Fix | Delete
<label for="<?php echo $option_page; ?>_options_email">
[3282] Fix | Delete
<input id="<?php echo $option_page; ?>_options_email" type="text" size="36" name="<?php echo $option_page; ?>_options[email]" value="<?php echo htmlspecialchars($options['email']); ?>" />
[3283] Fix | Delete
<br/>
[3284] Fix | Delete
<a target="_blank" href="<?php echo $further_options['under_username_link']; ?>"><?php echo $further_options['under_username']; ?></a>
[3285] Fix | Delete
</label>
[3286] Fix | Delete
</td>
[3287] Fix | Delete
</tr>
[3288] Fix | Delete
<tr class="non_tfa_fields">
[3289] Fix | Delete
<th><?php _e('Password', 'updraftplus'); ?></th>
[3290] Fix | Delete
<td>
[3291] Fix | Delete
<label for="<?php echo $option_page; ?>_options_password">
[3292] Fix | Delete
<input id="<?php echo $option_page; ?>_options_password" type="password" size="36" name="<?php echo $option_page; ?>_options[password]" value="<?php echo empty($options['password']) ? '' : htmlspecialchars($options['password']); ?>" />
[3293] Fix | Delete
<br/>
[3294] Fix | Delete
<a target="_blank" href="<?php echo $updraftplus->get_url('lost-password'); ?>"><?php _e('Forgotten your details?', 'updraftplus'); ?></a>
[3295] Fix | Delete
</label>
[3296] Fix | Delete
</td>
[3297] Fix | Delete
</tr>
[3298] Fix | Delete
<?php
[3299] Fix | Delete
if ('updraftplus-addons' == $option_page) {
[3300] Fix | Delete
?>
[3301] Fix | Delete
<tr class="non_tfa_fields">
[3302] Fix | Delete
<th></th>
[3303] Fix | Delete
<td>
[3304] Fix | Delete
<label>
[3305] Fix | Delete
<input type="checkbox" id="<?php echo $option_page; ?>_options_auto_updates" data-updraft_settings_test="updraft_auto_updates" name="<?php echo $option_page; ?>_options[updraft_auto_update]" value="1" <?php if ($updraftplus->is_automatic_updating_enabled()) echo 'checked="checked"'; ?> />
[3306] Fix | Delete
<?php _e('Ask WordPress to update UpdraftPlus automatically when an update is available', 'updraftplus');?>
[3307] Fix | Delete
</label>
[3308] Fix | Delete
<?php
[3309] Fix | Delete
$our_keys = UpdraftPlus_Options::get_updraft_option('updraft_central_localkeys');
[3310] Fix | Delete
if (!is_array($our_keys)) $our_keys = array();
[3311] Fix | Delete
[3312] Fix | Delete
if (empty($our_keys)) :
[3313] Fix | Delete
?>
[3314] Fix | Delete
<p class="<?php echo $option_page; ?>-connect-to-udc">
[3315] Fix | Delete
<label>
[3316] Fix | Delete
<input type="checkbox" id="<?php echo $option_page; ?>_options_auto_udc_connect" name="<?php echo $option_page; ?>_options[updraft_auto_udc_connect]" value="1" checked="checked" />
[3317] Fix | Delete
<?php _e('Add this website to UpdraftCentral (remote, centralised control) - free for up to 5 sites.', 'updraftplus'); ?> <a target="_blank" href="https://updraftcentral.com"><?php _e('Learn more about UpdraftCentral', 'updraftplus'); ?></a>
[3318] Fix | Delete
</label>
[3319] Fix | Delete
</p>
[3320] Fix | Delete
[3321] Fix | Delete
<?php endif; ?>
[3322] Fix | Delete
[3323] Fix | Delete
</td>
[3324] Fix | Delete
</tr>
[3325] Fix | Delete
<?php
[3326] Fix | Delete
}
[3327] Fix | Delete
?>
[3328] Fix | Delete
<?php
[3329] Fix | Delete
if (isset($further_options['terms_and_conditions']) && isset($further_options['terms_and_conditions_link'])) {
[3330] Fix | Delete
?>
[3331] Fix | Delete
<tr class="non_tfa_fields">
[3332] Fix | Delete
<th></th>
[3333] Fix | Delete
<td>
[3334] Fix | Delete
<input type="checkbox" class="<?php echo $option_page; ?>_terms_and_conditions" name="<?php echo $option_page; ?>_terms_and_conditions" value="1">
[3335] Fix | Delete
<a target="_blank" href="<?php echo $further_options['terms_and_conditions_link']; ?>"><?php echo $further_options['terms_and_conditions']; ?></a>
[3336] Fix | Delete
</td>
[3337] Fix | Delete
</tr>
[3338] Fix | Delete
<?php
[3339] Fix | Delete
}
[3340] Fix | Delete
?>
[3341] Fix | Delete
<?php if ($tfa) { ?>
[3342] Fix | Delete
<tr class="tfa_fields" style="display:none;">
[3343] Fix | Delete
<th><?php _e('One Time Password (check your OTP app to get this password)', 'updraftplus'); ?></th>
[3344] Fix | Delete
<td>
[3345] Fix | Delete
<label for="<?php echo $option_page; ?>_options_two_factor_code">
[3346] Fix | Delete
<input id="<?php echo $option_page; ?>_options_two_factor_code" type="text" size="10" name="<?php echo $option_page; ?>_options[two_factor_code]" />
[3347] Fix | Delete
</label>
[3348] Fix | Delete
</td>
[3349] Fix | Delete
</tr>
[3350] Fix | Delete
<?php } ?>
[3351] Fix | Delete
</tbody>
[3352] Fix | Delete
</table>
[3353] Fix | Delete
[3354] Fix | Delete
<?php
[3355] Fix | Delete
[3356] Fix | Delete
echo $enter_credentials_end;
[3357] Fix | Delete
}
[3358] Fix | Delete
[3359] Fix | Delete
/**
[3360] Fix | Delete
* Return widgetry for the 'backup now' modal.
[3361] Fix | Delete
* Don't optimise this method away; it's used by third-party plugins (e.g. EUM).
[3362] Fix | Delete
*
[3363] Fix | Delete
* @return String
[3364] Fix | Delete
*/
[3365] Fix | Delete
public function backupnow_modal_contents() {
[3366] Fix | Delete
return $this->include_template('wp-admin/settings/backupnow-modal.php', true);
[3367] Fix | Delete
}
[3368] Fix | Delete
[3369] Fix | Delete
/**
[3370] Fix | Delete
* Also used by the auto-backups add-on
[3371] Fix | Delete
*
[3372] Fix | Delete
* @param Boolean $wide_format Whether to return data in a wide format
[3373] Fix | Delete
* @param Boolean $print_active_jobs Whether to include currently active jobs
[3374] Fix | Delete
* @return String - the HTML output
[3375] Fix | Delete
*/
[3376] Fix | Delete
public function render_active_jobs_and_log_table($wide_format = false, $print_active_jobs = true) {
[3377] Fix | Delete
global $updraftplus;
[3378] Fix | Delete
?>
[3379] Fix | Delete
<div id="updraft_activejobs_table">
[3380] Fix | Delete
<?php $active_jobs = ($print_active_jobs) ? $this->print_active_jobs() : '';?>
[3381] Fix | Delete
<div id="updraft_activejobsrow" class="<?php
[3382] Fix | Delete
if (!$active_jobs && !$wide_format) {
[3383] Fix | Delete
echo 'hidden';
[3384] Fix | Delete
}
[3385] Fix | Delete
if ($wide_format) {
[3386] Fix | Delete
echo ".minimum-height";
[3387] Fix | Delete
}
[3388] Fix | Delete
?>">
[3389] Fix | Delete
<div id="updraft_activejobs" class="<?php echo $wide_format ? 'wide-format' : ''; ?>">
[3390] Fix | Delete
<?php echo $active_jobs;?>
[3391] Fix | Delete
</div>
[3392] Fix | Delete
</div>
[3393] Fix | Delete
<div id="updraft_lastlogmessagerow">
[3394] Fix | Delete
<?php if ($wide_format) {
[3395] Fix | Delete
// Hide for now - too ugly
[3396] Fix | Delete
?>
[3397] Fix | Delete
<div class="last-message"><strong><?php _e('Last log message', 'updraftplus');?>:</strong><br>
[3398] Fix | Delete
<span id="updraft_lastlogcontainer"><?php echo htmlspecialchars(UpdraftPlus_Options::get_updraft_lastmessage()); ?></span><br>
[3399] Fix | Delete
<?php $this->most_recently_modified_log_link(); ?>
[3400] Fix | Delete
</div>
[3401] Fix | Delete
<?php } else { ?>
[3402] Fix | Delete
<div>
[3403] Fix | Delete
<strong><?php _e('Last log message', 'updraftplus');?>:</strong>
[3404] Fix | Delete
<span id="updraft_lastlogcontainer"><?php echo htmlspecialchars(UpdraftPlus_Options::get_updraft_lastmessage()); ?></span><br>
[3405] Fix | Delete
<?php $this->most_recently_modified_log_link(); ?>
[3406] Fix | Delete
</div>
[3407] Fix | Delete
<?php } ?>
[3408] Fix | Delete
</div>
[3409] Fix | Delete
<?php
[3410] Fix | Delete
// Currently disabled - not sure who we want to show this to
[3411] Fix | Delete
if (1==0 && !defined('UPDRAFTPLUS_NOADS_B')) {
[3412] Fix | Delete
$feed = $updraftplus->get_updraftplus_rssfeed();
[3413] Fix | Delete
if (is_a($feed, 'SimplePie')) {
[3414] Fix | Delete
echo '<tr><th style="vertical-align:top;">'.__('Latest UpdraftPlus.com news:', 'updraftplus').'</th><td class="updraft_simplepie">';
[3415] Fix | Delete
echo '<ul class="disc;">';
[3416] Fix | Delete
foreach ($feed->get_items(0, 5) as $item) {
[3417] Fix | Delete
echo '<li>';
[3418] Fix | Delete
echo '<a href="'.esc_attr($item->get_permalink()).'">';
[3419] Fix | Delete
echo htmlspecialchars($item->get_title());
[3420] Fix | Delete
// D, F j, Y H:i
[3421] Fix | Delete
echo "</a> (".htmlspecialchars($item->get_date('j F Y')).")";
[3422] Fix | Delete
echo '</li>';
[3423] Fix | Delete
}
[3424] Fix | Delete
echo '</ul></td></tr>';
[3425] Fix | Delete
}
[3426] Fix | Delete
}
[3427] Fix | Delete
?>
[3428] Fix | Delete
</div>
[3429] Fix | Delete
<?php
[3430] Fix | Delete
}
[3431] Fix | Delete
[3432] Fix | Delete
/**
[3433] Fix | Delete
* Output directly a link allowing download of the most recently modified log file
[3434] Fix | Delete
*/
[3435] Fix | Delete
private function most_recently_modified_log_link() {
[3436] Fix | Delete
[3437] Fix | Delete
global $updraftplus;
[3438] Fix | Delete
list($mod_time, $log_file, $nonce) = $updraftplus->last_modified_log();// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[3439] Fix | Delete
[3440] Fix | Delete
?>
[3441] Fix | Delete
<a href="?page=updraftplus&amp;action=downloadlatestmodlog&amp;wpnonce=<?php echo wp_create_nonce('updraftplus_download'); ?>" <?php if (!$mod_time) echo 'style="display:none;"'; ?> class="updraft-log-link" onclick="event.preventDefault(); updraft_popuplog('');"><?php _e('Download most recently modified log file', 'updraftplus');?></a>
[3442] Fix | Delete
<?php
[3443] Fix | Delete
}
[3444] Fix | Delete
[3445] Fix | Delete
public function settings_downloading_and_restoring($backup_history = array(), $return_result = false, $options = array()) {
[3446] Fix | Delete
return $this->include_template('wp-admin/settings/downloading-and-restoring.php', $return_result, array('backup_history' => $backup_history, 'options' => $options));
[3447] Fix | Delete
}
[3448] Fix | Delete
[3449] Fix | Delete
/**
[3450] Fix | Delete
* Renders take backup content
[3451] Fix | Delete
*/
[3452] Fix | Delete
public function take_backup_content() {
[3453] Fix | Delete
global $updraftplus;
[3454] Fix | Delete
$updraft_dir = $updraftplus->backups_dir_location();
[3455] Fix | Delete
$backup_disabled = UpdraftPlus_Filesystem_Functions::really_is_writable($updraft_dir) ? '' : 'disabled="disabled"';
[3456] Fix | Delete
$this->include_template('wp-admin/settings/take-backup.php', false, array('backup_disabled' => $backup_disabled));
[3457] Fix | Delete
}
[3458] Fix | Delete
[3459] Fix | Delete
/**
[3460] Fix | Delete
* Output a table row using the updraft_debugrow class
[3461] Fix | Delete
*
[3462] Fix | Delete
* @param String $head - header cell contents
[3463] Fix | Delete
* @param String $content - content cell contents
[3464] Fix | Delete
*/
[3465] Fix | Delete
public function settings_debugrow($head, $content) {
[3466] Fix | Delete
echo "<tr class=\"updraft_debugrow\"><th>$head</th><td>$content</td></tr>";
[3467] Fix | Delete
}
[3468] Fix | Delete
[3469] Fix | Delete
public function settings_advanced_tools($return_instead_of_echo = false, $pass_through = array()) {
[3470] Fix | Delete
return $this->include_template('wp-admin/advanced/advanced-tools.php', $return_instead_of_echo, $pass_through);
[3471] Fix | Delete
}
[3472] Fix | Delete
[3473] Fix | Delete
/**
[3474] Fix | Delete
* Paint the HTML for the form for deleting old directories
[3475] Fix | Delete
*
[3476] Fix | Delete
* @param Boolean $include_blurb - whether to include explanatory text
[3477] Fix | Delete
* @param Boolean $include_div - whether to wrap inside a div tag
[3478] Fix | Delete
*/
[3479] Fix | Delete
public function print_delete_old_dirs_form($include_blurb = true, $include_div = true) {
[3480] Fix | Delete
if ($include_blurb) {
[3481] Fix | Delete
if ($include_div) {
[3482] Fix | Delete
echo '<div id="updraft_delete_old_dirs_pagediv" class="updated delete-old-directories">';
[3483] Fix | Delete
}
[3484] Fix | Delete
echo '<p>'.__('Your WordPress install has old directories from its state before you restored/migrated (technical information: these are suffixed with -old). You should press this button to delete them as soon as you have verified that the restoration worked.', 'updraftplus').'</p>';
[3485] Fix | Delete
}
[3486] Fix | Delete
?>
[3487] Fix | Delete
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'), UpdraftPlus_Options::admin_page_url())); ?>">
[3488] Fix | Delete
<?php wp_nonce_field('updraftplus-credentialtest-nonce', 'updraft_delete_old_dirs_nonce'); ?>
[3489] Fix | Delete
<input type="hidden" name="action" value="updraft_delete_old_dirs">
[3490] Fix | Delete
<input type="submit" class="button-primary" value="<?php echo esc_attr(__('Delete Old Directories', 'updraftplus'));?>">
[3491] Fix | Delete
</form>
[3492] Fix | Delete
<?php
[3493] Fix | Delete
if ($include_blurb && $include_div) echo '</div>';
[3494] Fix | Delete
}
[3495] Fix | Delete
[3496] Fix | Delete
/**
[3497] Fix | Delete
* Return cron status information about a specified in-progress job
[3498] Fix | Delete
*
[3499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function