Version Description
29/Aug/2016 =
FEATURE: OpenStack uploads (including Rackspace Cloudfiles) can now adapt their upload rate to network conditions, leading to much faster uploads on many networks
FEATURE: Updated the OneDrive configuration to make it easier to setup. A custom Microsoft Developer App is no longer required
FEATURE: The "Advanced Tools" tab now has tools for importing and exporting settings
TWEAK: Honour the "do not verify SSL certificates" setting with WebDAV storage on PHP 5.6+
TWEAK: When there's a connection problem to updraftplus.com when claiming licences, provide more error info and guidance
TWEAK: In particular circumstances (malfunctioning WP scheduler, expert option to keep backups after despatching remotely selected (non-default)), zips could be sent to Google Drive more than once
TWEAK: Tweak issue in 1.12.18 with automatic backup pop-up appearing under another pop-up if you update themes via the themes pop-up (instead of the direct link)
TWEAK: When rescanning remote storage, don't log a potentially confusing message for an unconfigured storage module
TWEAK: Show a visual indicator and advice if an invalid hostname is entered for WebDAV
TWEAK: Removed the no-longer-useful debug backup buttons
TWEAK: Add a message when generating a key on a server without php-openssl, with information about how to make it faster
TWEAK: Prevent PHP installs which print PHP logging information to the browser from messing up the WebDAV settings in some situations
TWEAK: If PHP reports the current memory limit as a non-positive integer, do not display any message to the user about a low memory limit
TWEAK: If the user deletes their Google API project, then show clearer information on what to do when a backup fails
TWEAK: If you changed your OneDrive client ID, UD will now more clearly advise you of the need to re-authenticate
COMPATABILITY: Updated the OneDrive authentication procedure to make it compatible with the new Microsoft Developer Apps
Release Info
Developer | DavidAnderson |
Plugin | UpdraftPlus WordPress Backup Plugin |
Version | 1.12.20 |
Comparing to | |
See all releases |
Code changes from version 1.12.17 to 1.12.20
- admin.php +237 -171
- backup.php +2 -2
- central/bootstrap.php +118 -35
- central/updraftplus-commands.php +28 -0
- class-updraftplus.php +113 -69
- css/admin.css +5 -11
- includes/S3compat.php +2 -2
- includes/updraft-admin-ui.js +186 -76
- languages/updraftplus-ar.mo +0 -0
- languages/updraftplus-ar.po +3095 -3056
- languages/updraftplus-bn_BD.mo +0 -0
- languages/updraftplus-bn_BD.po +2798 -2759
- languages/updraftplus-ca.mo +0 -0
- languages/updraftplus-ca.po +2347 -2301
@@ -51,7 +51,12 @@ class UpdraftPlus_Admin {
|
|
51 |
}
|
52 |
if ('onedrive' === $service || (is_array($service) && in_array('onedrive', $service))) {
|
53 |
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
54 |
-
if (!empty($opts['clientid']) && !empty($opts['secret'])
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
if ('updraftvault' === $service || (is_array($service) && in_array('updraftvault', $service))) {
|
@@ -184,6 +189,9 @@ class UpdraftPlus_Admin {
|
|
184 |
// Add a new Ajax action for saving settings
|
185 |
add_action('wp_ajax_updraft_savesettings', array($this, 'updraft_ajax_savesettings'));
|
186 |
|
|
|
|
|
|
|
187 |
global $updraftplus, $wp_version, $pagenow;
|
188 |
add_filter('updraftplus_dirlist_others', array($updraftplus, 'backup_others_dirlist'));
|
189 |
add_filter('updraftplus_dirlist_uploads', array($updraftplus, 'backup_uploads_dirlist'));
|
@@ -371,7 +379,7 @@ class UpdraftPlus_Admin {
|
|
371 |
'id' => 'updraft_admin_node_premium',
|
372 |
'title' => 'UpdraftPlus Premium',
|
373 |
'parent' => 'updraft_admin_node',
|
374 |
-
'href' => 'https://updraftplus.com/shop/updraftplus-premium/'
|
375 |
);
|
376 |
$wp_admin_bar->add_node($args);
|
377 |
}
|
@@ -390,12 +398,12 @@ class UpdraftPlus_Admin {
|
|
390 |
|
391 |
<h3 class="thank-you"><?php _e('Thank you for backing up with UpdraftPlus!', 'updraftplus');?></h3>
|
392 |
|
393 |
-
<a href="https://updraftplus.com/"><img class="udp-logo" alt="UpdraftPlus" src="<?php echo UPDRAFTPLUS_URL.'/images/ud-logo-150.png' ?>"></a>
|
394 |
|
395 |
<?php
|
396 |
-
echo '<p><strong>'.__('Free Newsletter', 'updraftplus').'</strong> <br>'.__('UpdraftPlus news, high-quality training materials for WordPress developers and site-owners, and general WordPress news. You can de-subscribe at any time.', 'updraftplus').' <a href="https://updraftplus.com/newsletter-signup">'.__('Follow this link to sign up.', 'updraftplus').'</a></p>';
|
397 |
|
398 |
-
echo '<p><strong>'.__('UpdraftPlus Premium', 'updraftplus').'</strong> <br>'.__('For personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more, take a look at the premium version of UpdraftPlus - the world’s most popular backup plugin.', 'updraftplus').' <a href="https://updraftplus.com/comparison-updraftplus-free-updraftplus-premium/">'.__('Compare with the free version', 'updraftplus').'</a> / <a href="https://updraftplus.com/shop/updraftplus-premium/">'.__('Go to the shop.', 'updraftplus').'</a></p>';
|
399 |
|
400 |
echo '<p><strong>'.__('More Quality Plugins', 'updraftplus').'</strong> <br> <a href="https://wordpress.org/plugins/two-factor-authentication/">'.__('Free two-factor security plugin', 'updraftplus').'</a> | <a href="https://www.simbahosting.co.uk/s3/shop/">'.__('Premium WooCommerce plugins', 'updraftplus').'</a></p>';
|
401 |
?>
|
@@ -497,7 +505,7 @@ class UpdraftPlus_Admin {
|
|
497 |
'delete_old_dirs' => __('Delete Old Directories', 'updraftplus'),
|
498 |
'raw' => __('Raw backup history', 'updraftplus'),
|
499 |
'notarchive' => __('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').' '.__('However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern.','updraftplus'),
|
500 |
-
'notarchive2' => '<p>'.__('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').'</p> '.apply_filters('updraftplus_if_foreign_then_premium_message', '<p><a href="https://updraftplus.com/shop/updraftplus-premium/">'.__('If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you.', 'updraftplus').'</a></p>'),
|
501 |
'makesure' => __('(make sure that you were trying to upload a zip file previously created by UpdraftPlus)','updraftplus'),
|
502 |
'uploaderror' => __('Upload error:','updraftplus'),
|
503 |
'notdba' => __('This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz).','updraftplus'),
|
@@ -528,7 +536,7 @@ class UpdraftPlus_Admin {
|
|
528 |
'addingsite' => __('Adding...', 'updraftplus'),
|
529 |
'addsite' => __('Add site', 'updraftplus'),
|
530 |
// 'resetting' => __('Resetting...', 'updraftplus'),
|
531 |
-
'
|
532 |
'sendtosite' => __('Send to site:', 'updraftplus'),
|
533 |
'checkrpcsetup' => sprintf(__('You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version %s or later active and that the keys have been entered correctly.', 'updraftplus'), '2.10.3'),
|
534 |
'pleasenamekey' => __('Please give this key a name (e.g. indicate the site it is for):', 'updraftplus'),
|
@@ -543,6 +551,7 @@ class UpdraftPlus_Admin {
|
|
543 |
'migratemodalwidth' => class_exists('UpdraftPlus_Addons_Migrator') ? 770 : 500,
|
544 |
'download' => _x('Download', '(verb)', 'updraftplus'),
|
545 |
'unsavedsettingsbackup' => __('You have made changes to your settings, and not saved.', 'updraftplus')."\n".__('You should save your changes to ensure that they are used for making your backup.','updraftplus'),
|
|
|
546 |
'dayselector' => $day_selector,
|
547 |
'mdayselector' => $mday_selector,
|
548 |
'day' => __('day', 'updraftplus'),
|
@@ -558,6 +567,13 @@ class UpdraftPlus_Admin {
|
|
558 |
'testing_settings' => __('Testing %s Settings...', 'updraftplus'),
|
559 |
'settings_test_result' => __('%s settings test result:', 'updraftplus'),
|
560 |
'nothing_yet_logged' => __('Nothing yet logged', 'updraftplus'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
) );
|
562 |
}
|
563 |
|
@@ -594,9 +610,9 @@ class UpdraftPlus_Admin {
|
|
594 |
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
|
595 |
|
596 |
$ret = '<div class="autobackup-description"><img class="autobackup-image" src="'.UPDRAFTPLUS_URL.'/images/automaticbackup.png" class="automation-icon"/>';
|
597 |
-
$ret .= '<div class="advert-description">'.__('UpdraftPlus Premium can automatically take a backup of your plugins or themes and database before you update. <a href="https://updraftplus.com/shop/autobackup/" target="_blank">Be safe every time, without needing to remember - follow this link to learn more
|
598 |
-
$ret .= '<div class="advert-btn"><a href="https://updraftplus.com/shop/autobackup/" class="btn btn-get-started">'.__('Just this add-on', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
599 |
-
$ret .= '<div class="advert-btn"><a href="https://updraftplus.com/shop/updraftplus-premium/" class="btn btn-get-started">'.__('Full Premium plugin', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
600 |
return $ret;
|
601 |
}
|
602 |
|
@@ -710,7 +726,7 @@ class UpdraftPlus_Admin {
|
|
710 |
array_unshift($links, $settings_link);
|
711 |
// $settings_link = '<a href="http://david.dw-perspective.org.uk/donate">'.__("Donate","UpdraftPlus").'</a>';
|
712 |
// array_unshift($links, $settings_link);
|
713 |
-
$settings_link = '<a href="https://updraftplus.com">'.__("Add-Ons / Pro Support","updraftplus").'</a>';
|
714 |
array_unshift($links, $settings_link);
|
715 |
}
|
716 |
return $links;
|
@@ -770,7 +786,7 @@ class UpdraftPlus_Admin {
|
|
770 |
}
|
771 |
|
772 |
public function show_admin_warning_disabledcron() {
|
773 |
-
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.__('The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even "Backup Now") unless either you have set up a facility to call the scheduler manually, or until it is enabled.','updraftplus').' <a href="https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/#disablewpcron">'.__('Go here for more information.','updraftplus').'</a>', 'updated updraftplus-disable-wp-cron-warning');
|
774 |
}
|
775 |
|
776 |
public function show_admin_warning_diskspace() {
|
@@ -782,7 +798,7 @@ class UpdraftPlus_Admin {
|
|
782 |
}
|
783 |
|
784 |
public function show_admin_warning_litespeed() {
|
785 |
-
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('Your website is hosted using the %s web server.','updraftplus'),'LiteSpeed').' <a href="https://updraftplus.com/faqs/i-am-having-trouble-backing-up-and-my-web-hosting-company-uses-the-litespeed-webserver/">'.__('Please consult this FAQ if you have problems backing up.', 'updraftplus').'</a>');
|
786 |
}
|
787 |
|
788 |
public function show_admin_debug_warning() {
|
@@ -791,7 +807,7 @@ class UpdraftPlus_Admin {
|
|
791 |
|
792 |
public function show_admin_warning_overdue_crons($howmany) {
|
793 |
$ret = '<div class="updraftmessage updated"><p>';
|
794 |
-
$ret .= '<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'updraftplus'), $howmany).' <a href="https://updraftplus.com/faqs/scheduler-wordpress-installation-working/">'.__('Read this page for a guide to possible causes and how to fix it.', 'updraftplus').'</a>';
|
795 |
$ret .= '</p></div>';
|
796 |
return $ret;
|
797 |
}
|
@@ -2164,14 +2180,14 @@ class UpdraftPlus_Admin {
|
|
2164 |
<div class="wrap" id="updraft-wrap">
|
2165 |
<h1><?php echo $updraftplus->plugin_title; ?></h1>
|
2166 |
|
2167 |
-
<a href="https://updraftplus.com">UpdraftPlus.Com</a> |
|
2168 |
-
<?php if (!defined('UPDRAFTPLUS_NOADS_B')) { ?><a href="https://updraftplus.com/shop/updraftplus-premium/"><?php _e("Premium",'updraftplus');?></a> | <?php } ?>
|
2169 |
-
<a href="https://updraftplus.com/news/"><?php _e('News','updraftplus');?></a> |
|
2170 |
<a href="https://twitter.com/updraftplus"><?php _e('Twitter', 'updraftplus');?></a> |
|
2171 |
-
<a href="https://updraftplus.com/support/"><?php _e("Support",'updraftplus');?></a> |
|
2172 |
-
<?php if (!is_file(UPDRAFTPLUS_DIR.'/udaddons/updraftplus-addons.php')) { ?><a href="https://updraftplus.com/newsletter-signup"><?php _e("Newsletter sign-up", 'updraftplus');?></a> | <?php } ?>
|
2173 |
<a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> |
|
2174 |
-
<a href="https://updraftplus.com/support/frequently-asked-questions/"><?php _e('FAQs', 'updraftplus'); ?></a> | <a href="https://www.simbahosting.co.uk/s3/shop/"><?php _e('More plugins', 'updraftplus');?></a> - <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
|
2175 |
<br>
|
2176 |
<?php
|
2177 |
}
|
@@ -2240,6 +2256,7 @@ class UpdraftPlus_Admin {
|
|
2240 |
}
|
2241 |
}
|
2242 |
$pval = ($updraftplus->have_addons) ? 1 : 0;
|
|
|
2243 |
echo '<strong>'.__('Actions','updraftplus').':</strong> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&updraft_restore_success='.$s_val.'&pval='.$pval.'">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
|
2244 |
return;
|
2245 |
} elseif (is_wp_error($backup_success)) {
|
@@ -2291,14 +2308,14 @@ class UpdraftPlus_Admin {
|
|
2291 |
if (isset($_GET['action']) && $_GET['action'] == 'updraft_create_backup_dir' && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {
|
2292 |
$created = $this->create_backup_dir();
|
2293 |
if (is_wp_error($created)) {
|
2294 |
-
echo '<p>'.__('Backup directory could not be created', 'updraftplus').'...<br
|
2295 |
echo '<ul class="disc">';
|
2296 |
foreach ($created->get_error_messages() as $key => $msg) {
|
2297 |
echo '<li>'.htmlspecialchars($msg).'</li>';
|
2298 |
}
|
2299 |
echo '</ul></p>';
|
2300 |
} elseif ($created !== false) {
|
2301 |
-
echo '<p>'.__('Backup directory successfully created.', 'updraftplus').'</p><br
|
2302 |
}
|
2303 |
echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration', 'updraftplus').'</a>';
|
2304 |
return;
|
@@ -2306,11 +2323,7 @@ class UpdraftPlus_Admin {
|
|
2306 |
|
2307 |
echo '<div id="updraft_backup_started" class="updated updraft-hidden" style="display:none;"></div>';
|
2308 |
|
2309 |
-
if (isset($_POST['action']) && '
|
2310 |
-
$updraftplus->boot_backup(true,true);
|
2311 |
-
} elseif (isset($_POST['action']) && 'updraft_backup_debug_db' == $_POST['action']) {
|
2312 |
-
$updraftplus->boot_backup(false, true, false, true);
|
2313 |
-
} elseif (isset($_POST['action']) && 'updraft_wipesettings' == $_POST['action']) {
|
2314 |
$settings = $updraftplus->get_settings_keys();
|
2315 |
foreach ($settings as $s) UpdraftPlus_Options::delete_updraft_option($s);
|
2316 |
|
@@ -2335,7 +2348,7 @@ class UpdraftPlus_Admin {
|
|
2335 |
<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>
|
2336 |
<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>
|
2337 |
<?php } else { ?>
|
2338 |
-
<a href="https://updraftplus.com/do-you-have-a-javascript-or-jquery-error/"><?php _e('Go here for more information.', 'updraftplus'); ?></a>
|
2339 |
<?php } ?>
|
2340 |
</p>
|
2341 |
</div>
|
@@ -2346,7 +2359,11 @@ class UpdraftPlus_Admin {
|
|
2346 |
|
2347 |
// Opens a div, which needs closing later
|
2348 |
if (isset($_GET['updraft_restore_success'])) {
|
2349 |
-
|
|
|
|
|
|
|
|
|
2350 |
|
2351 |
echo "<div class=\"updated backup-restored\"><span><strong>".__('Your backup has been restored.','updraftplus').'</strong></span><br>';
|
2352 |
// Unnecessary - will be advised of this below
|
@@ -2366,12 +2383,14 @@ class UpdraftPlus_Admin {
|
|
2366 |
$ws_advert = $updraftplus->wordshell_random_advert(1);
|
2367 |
if ($ws_advert && empty($success_advert) && empty($this->no_settings_warning)) { echo '<div class="updated ws_advert" style="clear:left;">'.$ws_advert.'</div>'; }
|
2368 |
|
2369 |
-
if (!$updraftplus->memory_check(64)) {
|
2370 |
-
|
2371 |
-
|
|
|
|
|
|
|
2372 |
}
|
2373 |
|
2374 |
-
|
2375 |
if (!empty($updraftplus->errors)) {
|
2376 |
echo '<div class="error updraft_list_errors">';
|
2377 |
$updraftplus->list_errors();
|
@@ -2485,7 +2504,7 @@ class UpdraftPlus_Admin {
|
|
2485 |
if (class_exists('UpdraftPlus_Addons_Migrator')) {
|
2486 |
do_action('updraftplus_migrate_modal_output');
|
2487 |
} else {
|
2488 |
-
echo '<p id="updraft_migrate_modal_main">'.__('Do you want to migrate or clone/duplicate a site?', 'updraftplus').'</p><p>'.__('Then, try out our "Migrator" add-on. After using it once, you\'ll have saved the purchase price compared to the time needed to copy a site by hand.', 'updraftplus').'</p><p><a href="https://updraftplus.com/landing/migrator">'.__('Get it here.', 'updraftplus').'</a></p>';
|
2489 |
}
|
2490 |
?>
|
2491 |
</div>
|
@@ -2510,7 +2529,7 @@ class UpdraftPlus_Admin {
|
|
2510 |
<table>
|
2511 |
<tr>
|
2512 |
<td>
|
2513 |
-
<p class="multisite-advert-width"><?php echo __('Do you need WordPress Multisite support?','updraftplus').' <a href="https://updraftplus.com/shop/updraftplus-premium/">'. __('Please check out UpdraftPlus Premium, or the stand-alone Multisite add-on.','updraftplus');?></a>.</p>
|
2514 |
</td>
|
2515 |
</tr>
|
2516 |
</table>
|
@@ -2553,12 +2572,12 @@ class UpdraftPlus_Admin {
|
|
2553 |
<div>
|
2554 |
<h2>UpdraftPlus Premium</h2>
|
2555 |
<p>
|
2556 |
-
<span class="premium-upgrade-prompt"><?php _e('You are currently using the free version of UpdraftPlus from wordpress.org.', 'updraftplus');?> <a href="https://updraftplus.com/support/installing-updraftplus-premium-your-add-on/"><br><?php echo __('If you have made a purchase from UpdraftPlus.Com, then follow this link to the instructions to install your purchase.', 'updraftplus').' '.__('The first step is to de-install the free version.', 'updraftplus')?></a></span>
|
2557 |
<ul class="updraft_premium_description_list">
|
2558 |
-
<li><a href="https://updraftplus.com/shop/updraftplus-premium/"><strong><?php _e('Get UpdraftPlus Premium', 'updraftplus');?></strong></a></li>
|
2559 |
-
<li><a href="https://updraftplus.com/updraftplus-full-feature-list/"><?php _e('Full feature list', 'updraftplus');?></a></li>
|
2560 |
-
<li><a href="https://updraftplus.com/faq-category/general-and-pre-sales-questions/"><?php _e('Pre-sales FAQs', 'updraftplus');?></a></li>
|
2561 |
-
<li class="last"><a href="https://updraftplus.com/ask-a-pre-sales-question/"><?php _e('Ask a pre-sales question', 'updraftplus');?></a> - <a href="https://updraftplus.com/support/"><?php _e('Support', 'updraftplus');?></a></li>
|
2562 |
</ul>
|
2563 |
</p>
|
2564 |
</div>
|
@@ -2567,14 +2586,14 @@ class UpdraftPlus_Admin {
|
|
2567 |
<tr>
|
2568 |
<th class="updraft_feat_th" style="text-align:left;"></th>
|
2569 |
<th class="updraft_feat_th"><img src="<?php echo $freev;?>" height="120"></th>
|
2570 |
-
<th class="updraft_feat_th" style='background-color:#DF6926;'><a href="https://updraftplus.com/shop/updraftplus-premium/"><img src="<?php echo $premv;?>" height="120"></a></th>
|
2571 |
</tr>
|
2572 |
<tr>
|
2573 |
<td class="updraft_feature_cell"><?php _e('Get it from', 'updraftplus');?></td>
|
2574 |
<td class="updraft_tick_cell" style="vertical-align:top; line-height: 120%; margin-top:6px; padding-top:6px;">WordPress.Org</td>
|
2575 |
<td class="updraft_tick_cell" style="padding: 6px; line-height: 120%;">
|
2576 |
UpdraftPlus.Com<br>
|
2577 |
-
<a href="https://updraftplus.com/shop/updraftplus-premium/"><strong><?php _e('Buy It Now!', 'updraftplus');?></strong></a><br>
|
2578 |
</td>
|
2579 |
</tr>
|
2580 |
<tr>
|
@@ -2867,7 +2886,7 @@ class UpdraftPlus_Admin {
|
|
2867 |
<?php /* echo '<h2>'.__('Existing Backups: Downloading And Restoring', 'updraftplus').'</h2>'; */ ?>
|
2868 |
<?php if (!empty($options['include_whitespace_warning'])) { ?>
|
2869 |
<p class="ud-whitespace-warning updraft-hidden" style="display:none;">
|
2870 |
-
<?php echo '<strong>'.__('Warning','updraftplus').':</strong> '.__('Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here.','updraftplus').' <a href="https://updraftplus.com/problems-with-extra-white-space/">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
|
2871 |
</p>
|
2872 |
<?php } ?>
|
2873 |
|
@@ -2986,7 +3005,7 @@ class UpdraftPlus_Admin {
|
|
2986 |
|
2987 |
# The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
|
2988 |
if ($updraftplus->detect_safe_mode()) {
|
2989 |
-
echo "<p><em>".__("Your web server has PHP's so-called safe_mode active.", 'updraftplus').' '.__('This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time, <a href="https://updraftplus.com/faqs/i-want-to-restore-but-have-either-cannot-or-have-failed-to-do-so-from-the-wp-admin-console/">or to restore manually
|
2990 |
}
|
2991 |
|
2992 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
@@ -3014,7 +3033,7 @@ class UpdraftPlus_Admin {
|
|
3014 |
|
3015 |
if (!class_exists('UpdraftPlus_Addons_Migrator')) {
|
3016 |
|
3017 |
-
echo '<a href="https://updraftplus.com/faqs/tell-me-more-about-the-search-and-replace-site-location-in-the-database-option/">'.__('You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information','updraftplus').'</a>';
|
3018 |
|
3019 |
}
|
3020 |
|
@@ -3025,7 +3044,7 @@ class UpdraftPlus_Admin {
|
|
3025 |
</div>
|
3026 |
</fieldset>
|
3027 |
</form>
|
3028 |
-
<p><em><a href="https://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/" target="_blank"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
|
3029 |
</div>
|
3030 |
</div>
|
3031 |
|
@@ -3037,133 +3056,161 @@ class UpdraftPlus_Admin {
|
|
3037 |
echo "<tr class=\"updraft_debugrow\"><th>$head</th><td>$content</td></tr>";
|
3038 |
}
|
3039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3040 |
private function settings_expertsettings($backup_disabled) {
|
3041 |
global $updraftplus, $wpdb;
|
3042 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
3043 |
?>
|
3044 |
<div class="expertmode">
|
3045 |
-
<p
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
// It appears (Mar 2015) that some mod_security distributions block the output of the string el6.x86_64 in PHP output, on the silly assumption that only hackers are interested in knowing what environment PHP is running on.
|
3050 |
-
// $uname_info = @php_uname();
|
3051 |
-
$uname_info = @php_uname('s').' '.@php_uname('n').' ';
|
3052 |
-
|
3053 |
-
$release_name = @php_uname('r');
|
3054 |
-
if (preg_match('/^(.*)\.(x86_64|[3456]86)$/', $release_name, $matches)) {
|
3055 |
-
$release_name = $matches[1].' ';
|
3056 |
-
} else {
|
3057 |
-
$release_name = '';
|
3058 |
-
}
|
3059 |
-
|
3060 |
-
// In case someone does something similar with just the processor type string
|
3061 |
-
$mtype = @php_uname('m');
|
3062 |
-
if ('x86_64' == $mtype) {
|
3063 |
-
$mtype = '64-bit';
|
3064 |
-
} elseif (preg_match('/^i([3456]86)$/', $mtype, $matches)) {
|
3065 |
-
$mtype = $matches[1];
|
3066 |
-
}
|
3067 |
-
|
3068 |
-
$uname_info .= $release_name.$mtype.' '.@php_uname('v');
|
3069 |
-
|
3070 |
-
$this->settings_debugrow(__('Web server:','updraftplus'), htmlspecialchars($_SERVER["SERVER_SOFTWARE"]).' ('.htmlspecialchars($uname_info).')');
|
3071 |
-
|
3072 |
-
$this->settings_debugrow('ABSPATH:', htmlspecialchars(ABSPATH));
|
3073 |
-
$this->settings_debugrow('WP_CONTENT_DIR:', htmlspecialchars(WP_CONTENT_DIR));
|
3074 |
-
$this->settings_debugrow('WP_PLUGIN_DIR:', htmlspecialchars(WP_PLUGIN_DIR));
|
3075 |
-
$this->settings_debugrow('Table prefix:', htmlspecialchars($updraftplus->get_table_prefix()));
|
3076 |
-
|
3077 |
-
$peak_memory_usage = memory_get_peak_usage(true)/1024/1024;
|
3078 |
-
$memory_usage = memory_get_usage(true)/1024/1024;
|
3079 |
-
$this->settings_debugrow(__('Peak memory usage','updraftplus').':', $peak_memory_usage.' MB');
|
3080 |
-
$this->settings_debugrow(__('Current memory usage','updraftplus').':', $memory_usage.' MB');
|
3081 |
-
$this->settings_debugrow(__('Memory limit', 'updraftplus').':', htmlspecialchars(ini_get('memory_limit')));
|
3082 |
-
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'PHP'), htmlspecialchars(phpversion()).' - <a href="admin-ajax.php?page=updraftplus&action=updraft_ajax&subaction=phpinfo&nonce='.wp_create_nonce('updraftplus-credentialtest-nonce').'" id="updraftplus-phpinfo">'.__('show PHP information (phpinfo)', 'updraftplus').'</a>');
|
3083 |
-
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'MySQL'), htmlspecialchars($wpdb->db_version()));
|
3084 |
-
if (function_exists('curl_version') && function_exists('curl_exec')) {
|
3085 |
-
$cv = curl_version();
|
3086 |
-
$cvs = $cv['version'].' / SSL: '.$cv['ssl_version'].' / libz: '.$cv['libz_version'];
|
3087 |
-
} else {
|
3088 |
-
$cvs = __('Not installed', 'updraftplus').' ('.__('required for some remote storage providers', 'updraftplus').')';
|
3089 |
-
}
|
3090 |
-
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'Curl'), htmlspecialchars($cvs));
|
3091 |
-
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'OpenSSL'), defined('OPENSSL_VERSION_TEXT') ? OPENSSL_VERSION_TEXT : '-');
|
3092 |
-
$this->settings_debugrow('MCrypt:', function_exists('mcrypt_encrypt') ? __('Yes') : __('No'));
|
3093 |
-
|
3094 |
-
if (version_compare(phpversion(), '5.2.0', '>=') && extension_loaded('zip')) {
|
3095 |
-
$ziparchive_exists = __('Yes', 'updraftplus');
|
3096 |
-
} else {
|
3097 |
-
# First do class_exists, because method_exists still sometimes segfaults due to a rare PHP bug
|
3098 |
-
$ziparchive_exists = (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? __('Yes', 'updraftplus') : __('No', 'updraftplus');
|
3099 |
-
}
|
3100 |
-
$this->settings_debugrow('ZipArchive::addFile:', $ziparchive_exists);
|
3101 |
-
$binzip = $updraftplus->find_working_bin_zip(false, false);
|
3102 |
-
$this->settings_debugrow(__('zip executable found:', 'updraftplus'), ((is_string($binzip)) ? __('Yes').': '.$binzip : __('No')));
|
3103 |
-
$hosting_bytes_free = $updraftplus->get_hosting_disk_quota_free();
|
3104 |
-
if (is_array($hosting_bytes_free)) {
|
3105 |
-
$perc = round(100*$hosting_bytes_free[1]/(max($hosting_bytes_free[2], 1)), 1);
|
3106 |
-
$this->settings_debugrow(__('Free disk space in account:', 'updraftplus'), sprintf(__('%s (%s used)', 'updraftplus'), round($hosting_bytes_free[3]/1048576, 1)." MB", "$perc %"));
|
3107 |
-
}
|
3108 |
-
|
3109 |
-
$this->settings_debugrow(__('Plugins for debugging:', 'updraftplus'),'<a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-crontrol'), 'install-plugin_wp-crontrol').'">WP Crontrol</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=sql-executioner'), 'install-plugin_sql-executioner').'">SQL Executioner</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=advanced-code-editor'), 'install-plugin_advanced-code-editor').'">Advanced Code Editor</a> '.(current_user_can('edit_plugins') ? '<a href="'.self_admin_url('plugin-editor.php?file=updraftplus/updraftplus.php').'">(edit UpdraftPlus)</a>' : '').' | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-filemanager'), 'install-plugin_wp-filemanager').'">WP Filemanager</a>');
|
3110 |
-
|
3111 |
-
$this->settings_debugrow("HTTP Get: ", '<input id="updraftplus_httpget_uri" type="text" class="call-action"> <a href="#" id="updraftplus_httpget_go">'.__('Fetch', 'updraftplus').'</a> <a href="#" id="updraftplus_httpget_gocurl">'.__('Fetch', 'updraftplus').' (Curl)</a><p id="updraftplus_httpget_results"></p>');
|
3112 |
-
|
3113 |
-
$this->settings_debugrow(__("Call WordPress action:", 'updraftplus'), '<input id="updraftplus_callwpaction" type="text" class="call-action"> <a href="#" id="updraftplus_callwpaction_go">'.__('Call', 'updraftplus').'</a><div id="updraftplus_callwpaction_results"></div>');
|
3114 |
-
|
3115 |
-
$this->settings_debugrow('Site ID:', '(used to identify any Vault connections) <span id="updraft_show_sid">'.htmlspecialchars($updraftplus->siteid()).'</span> - <a href="#" id="updraft_reset_sid">'.__('reset', 'updraftplus')."</a>");
|
3116 |
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
|
3121 |
-
|
|
|
|
|
3122 |
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
|
|
|
|
|
|
3126 |
|
3127 |
-
|
3128 |
-
|
|
|
|
|
|
|
|
|
|
|
3129 |
|
3130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3131 |
|
3132 |
-
$
|
3133 |
-
if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
|
3134 |
|
3135 |
-
|
3136 |
-
$this->settings_debugrow(ucfirst($sdescrip).':', '<span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a>');
|
3137 |
-
}
|
3138 |
|
3139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3140 |
|
3141 |
-
|
3142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3143 |
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
<
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
</
|
3157 |
-
</td>
|
3158 |
-
</tr>
|
3159 |
-
</tbody>
|
3160 |
-
</table>
|
3161 |
-
<h3><?php _e('Wipe settings', 'updraftplus');?></h3>
|
3162 |
-
<p class="max-width-600"><?php echo __('This button will delete all UpdraftPlus settings and progress information for in-progress backups (but not any of your existing backups from your cloud storage).', 'updraftplus').' '.__('You will then need to enter all your settings again. You can also do this before deactivating/deinstalling UpdraftPlus if you wish.','updraftplus');?></p>
|
3163 |
-
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
|
3164 |
-
<input type="hidden" name="action" value="updraft_wipesettings" />
|
3165 |
-
<p><input type="submit" class="button-primary" value="<?php _e('Wipe settings','updraftplus'); ?>" onclick="return(confirm('<?php echo esc_js(__('This will delete all your UpdraftPlus settings - are you sure you want to do this?', 'updraftplus'));?>'))" /></p>
|
3166 |
-
</form>
|
3167 |
</div>
|
3168 |
<?php
|
3169 |
}
|
@@ -3418,9 +3465,9 @@ class UpdraftPlus_Admin {
|
|
3418 |
echo ($show_return) ? '<h1>UpdraftPlus - '.__('Remove old directories', 'updraftplus').'</h1>' : '<h2>'.__('Remove old directories', 'updraftplus').'</h2>';
|
3419 |
|
3420 |
if ($this->delete_old_dirs()) {
|
3421 |
-
echo '<p>'.__('Old directories successfully removed.','updraftplus').'</p><br
|
3422 |
} else {
|
3423 |
-
echo '<p>',__('Old directory removal failed for some reason. You may want to do this manually.','updraftplus').'</p><br
|
3424 |
}
|
3425 |
if ($show_return) echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
|
3426 |
}
|
@@ -3727,7 +3774,7 @@ class UpdraftPlus_Admin {
|
|
3727 |
<th><?php _e('Incremental file backup schedule', 'updraftplus'); ?>:</th>
|
3728 |
<td>
|
3729 |
<?php do_action('updraftplus_incremental_cell', $selected_interval); ?>
|
3730 |
-
<a href="https://updraftplus.com/support/tell-me-more-about-incremental-backups/"><em><?php _e('Tell me more about incremental backups', 'updraftplus'); ?><em></a>
|
3731 |
</td>
|
3732 |
</tr>
|
3733 |
<?php } ?>
|
@@ -3763,7 +3810,7 @@ class UpdraftPlus_Admin {
|
|
3763 |
<th></th>
|
3764 |
<td><div>
|
3765 |
<?php
|
3766 |
-
echo apply_filters('updraftplus_fixtime_ftinfo', '<p>'.__('To fix the time at which a backup should take place,','updraftplus').' ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), '.__('or to configure more complex schedules', 'updraftplus').', <a href="https://updraftplus.com/shop/updraftplus-premium/">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>');
|
3767 |
?>
|
3768 |
</div></td>
|
3769 |
</tr>
|
@@ -3803,7 +3850,7 @@ class UpdraftPlus_Admin {
|
|
3803 |
if (false === apply_filters('updraftplus_storage_printoptions', false, $active_service)) {
|
3804 |
|
3805 |
echo '</div>';
|
3806 |
-
echo '<p><a href="https://updraftplus.com/shop/morestorage/">'.htmlspecialchars(__('You can send a backup to more than one destination with an add-on.','updraftplus')).'</a></p>';
|
3807 |
echo '</td></tr>';
|
3808 |
}
|
3809 |
?>
|
@@ -3837,7 +3884,7 @@ class UpdraftPlus_Admin {
|
|
3837 |
<th><?php _e('Include in files backup', 'updraftplus');?>:</th>
|
3838 |
<td>
|
3839 |
<?php echo $this->files_selector_widgetry(); ?>
|
3840 |
-
<p><?php echo apply_filters('updraftplus_admin_directories_description', __('The above directories are everything, except for WordPress core itself which you can download afresh from WordPress.org.', 'updraftplus').' <a href="https://updraftplus.com/shop/">'.htmlspecialchars(__('See also the "More Files" add-on from our shop.', 'updraftplus')).'</a>'); ?></p>
|
3841 |
</td>
|
3842 |
</tr>
|
3843 |
</table>
|
@@ -3851,7 +3898,7 @@ class UpdraftPlus_Admin {
|
|
3851 |
|
3852 |
<td>
|
3853 |
<?php
|
3854 |
-
echo apply_filters('updraft_database_encryption_config', '<a href="https://updraftplus.com/shop/updraftplus-premium/">'.__("Don't want to be spied on? UpdraftPlus Premium can encrypt your database backup.", 'updraftplus').'</a> '.__('It can also backup external databases.', 'updraftplus'));
|
3855 |
?>
|
3856 |
</td>
|
3857 |
</tr>
|
@@ -3933,7 +3980,7 @@ class UpdraftPlus_Admin {
|
|
3933 |
?>
|
3934 |
<input type="checkbox" id="updraft_email" name="updraft_email" value="<?php esc_attr_e(get_bloginfo('admin_email')); ?>"<?php if (!empty($updraft_email)) echo ' checked="checked"';?> > <br><label for="updraft_email"><?php echo __("Check this box to have a basic report sent to", 'updraftplus').' <a href="'.admin_url('options-general.php').'">'.__("your site's admin address", 'updraftplus').'</a> ('.htmlspecialchars(get_bloginfo('admin_email')).")."; ?></label>
|
3935 |
<?php
|
3936 |
-
if (!class_exists('UpdraftPlus_Addon_Reporting')) echo '<a href="https://updraftplus.com/shop/reporting/">'.__('For more reporting features, use the Reporting add-on.', 'updraftplus').'</a>';
|
3937 |
?>
|
3938 |
</td>
|
3939 |
</tr>
|
@@ -4009,7 +4056,7 @@ class UpdraftPlus_Admin {
|
|
4009 |
|
4010 |
<tr class="expertmode updraft-hidden" style="display:none;">
|
4011 |
<th><?php _e('Disable SSL entirely where possible', 'updraftplus');?>:</th>
|
4012 |
-
<td><input data-updraft_settings_test="nossl" type="checkbox" id="updraft_ssl_nossl" name="updraft_ssl_nossl" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_nossl')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_nossl"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from using SSL for authentication and encrypted transport at all, where possible. Note that some cloud storage providers do not allow this (e.g. Dropbox), so with those providers this setting will have no effect.','updraftplus');?> <a href="https://updraftplus.com/faqs/i-get-ssl-certificate-errors-when-backing-up-andor-restoring/"><?php _e('See this FAQ also.', 'updraftplus');?></a></label></td>
|
4013 |
</tr>
|
4014 |
|
4015 |
<?php do_action('updraftplus_configprint_expertoptions'); ?>
|
@@ -4662,7 +4709,7 @@ ENDHERE;
|
|
4662 |
global $wp_filesystem, $updraftplus;
|
4663 |
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
4664 |
if (!isset($backup_history[$timestamp]) || !is_array($backup_history[$timestamp])) {
|
4665 |
-
echo '<p>'.__('This backup does not exist in the backup history - restoration aborted. Timestamp:','updraftplus')." $timestamp</p><br
|
4666 |
return new WP_Error('does_not_exist', __('Backup does not exist in the backup history', 'updraftplus'));
|
4667 |
}
|
4668 |
|
@@ -4692,7 +4739,7 @@ ENDHERE;
|
|
4692 |
$credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=updraft_restore&backup_timestamp=$timestamp", '', false, false, $extra_fields);
|
4693 |
WP_Filesystem($credentials);
|
4694 |
if ( $wp_filesystem->errors->get_error_code() ) {
|
4695 |
-
echo '<p><em><a href="https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/">'.__('Why am I seeing this?', 'updraftplus').'</a></em></p>';
|
4696 |
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message);
|
4697 |
exit;
|
4698 |
}
|
@@ -4991,7 +5038,7 @@ ENDHERE;
|
|
4991 |
$pdata = (is_string($data)) ? $data : serialize($data);
|
4992 |
echo '<strong>'.__('Error data:', 'updraftplus').'</strong> '.htmlspecialchars($pdata).'<br>';
|
4993 |
if (false !== strpos($pdata, 'PCLZIP_ERR_BAD_FORMAT (-10)')) {
|
4994 |
-
echo '<a href="https://updraftplus.com/faqs/error-message-pclzip_err_bad_format-10-invalid-archive-structure-mean/"><strong>'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</strong></a><br>';
|
4995 |
}
|
4996 |
}
|
4997 |
}
|
@@ -5100,6 +5147,25 @@ ENDHERE;
|
|
5100 |
die;
|
5101 |
}
|
5102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5103 |
private function backup_now_remote_message() {
|
5104 |
global $updraftplus;
|
5105 |
|
@@ -5110,7 +5176,7 @@ ENDHERE;
|
|
5110 |
$no_remote_configured = (empty($service) || array('none') === $service || array('') === $service) ? true : false;
|
5111 |
|
5112 |
if ($no_remote_configured) {
|
5113 |
-
return '<input type="checkbox" disabled="disabled" id="backupnow_includecloud"> <em>'.sprintf(__("Backup won't be sent to any remote storage - none has been saved in the %s", 'updraftplus'), '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings" id="updraft_backupnow_gotosettings">'.__('settings', 'updraftplus')).'</a>. '.__('Not got any remote storage?', 'updraftplus').' <a href="https://updraftplus.com/landing/vault">'.__("Check out UpdraftPlus Vault.", 'updraftplus').'</a></em>';
|
5114 |
} else {
|
5115 |
return '<input type="checkbox" id="backupnow_includecloud" checked="checked"> <label for="backupnow_includecloud">'.__("Send this backup to remote storage", 'updraftplus').'</label>';
|
5116 |
}
|
51 |
}
|
52 |
if ('onedrive' === $service || (is_array($service) && in_array('onedrive', $service))) {
|
53 |
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
54 |
+
//if (((!empty($opts['clientid']) && !empty($opts['secret'])) || !empty($opts['use_master'])) && empty($opts['refresh_token']))
|
55 |
+
if((defined('UPDRAFTPLUS_CUSTOM_ONEDRIVE_APP') && UPDRAFTPLUS_CUSTOM_ONEDRIVE_APP)){
|
56 |
+
if(!empty($opts['clientid']) && !empty($opts['secret']) && empty($opts['refresh_token'])) add_action('all_admin_notices', array($this,'show_admin_warning_onedrive') );
|
57 |
+
} else{
|
58 |
+
if(empty($opts['refresh_token']))add_action('all_admin_notices', array($this,'show_admin_warning_onedrive') );
|
59 |
+
}
|
60 |
}
|
61 |
|
62 |
if ('updraftvault' === $service || (is_array($service) && in_array('updraftvault', $service))) {
|
189 |
// Add a new Ajax action for saving settings
|
190 |
add_action('wp_ajax_updraft_savesettings', array($this, 'updraft_ajax_savesettings'));
|
191 |
|
192 |
+
// Ajax for settings import and export
|
193 |
+
add_action('wp_ajax_updraft_importsettings', array($this, 'updraft_ajax_importsettings'));
|
194 |
+
|
195 |
global $updraftplus, $wp_version, $pagenow;
|
196 |
add_filter('updraftplus_dirlist_others', array($updraftplus, 'backup_others_dirlist'));
|
197 |
add_filter('updraftplus_dirlist_uploads', array($updraftplus, 'backup_uploads_dirlist'));
|
379 |
'id' => 'updraft_admin_node_premium',
|
380 |
'title' => 'UpdraftPlus Premium',
|
381 |
'parent' => 'updraft_admin_node',
|
382 |
+
'href' => apply_filters('updraftplus_com_link','https://updraftplus.com/shop/updraftplus-premium/')
|
383 |
);
|
384 |
$wp_admin_bar->add_node($args);
|
385 |
}
|
398 |
|
399 |
<h3 class="thank-you"><?php _e('Thank you for backing up with UpdraftPlus!', 'updraftplus');?></h3>
|
400 |
|
401 |
+
<a href="<?php echo apply_filters('updraftplus_com_link','https://updraftplus.com/');?>"><img class="udp-logo" alt="UpdraftPlus" src="<?php echo UPDRAFTPLUS_URL.'/images/ud-logo-150.png' ?>"></a>
|
402 |
|
403 |
<?php
|
404 |
+
echo '<p><strong>'.__('Free Newsletter', 'updraftplus').'</strong> <br>'.__('UpdraftPlus news, high-quality training materials for WordPress developers and site-owners, and general WordPress news. You can de-subscribe at any time.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/newsletter-signup").'">'.__('Follow this link to sign up.', 'updraftplus').'</a></p>';
|
405 |
|
406 |
+
echo '<p><strong>'.__('UpdraftPlus Premium', 'updraftplus').'</strong> <br>'.__('For personal support, the ability to copy sites, more storage destinations, encrypted backups for security, multiple backup destinations, better reporting, no adverts and plenty more, take a look at the premium version of UpdraftPlus - the world’s most popular backup plugin.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/comparison-updraftplus-free-updraftplus-premium/").'">'.__('Compare with the free version', 'updraftplus').'</a> / <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'.__('Go to the shop.', 'updraftplus').'</a></p>';
|
407 |
|
408 |
echo '<p><strong>'.__('More Quality Plugins', 'updraftplus').'</strong> <br> <a href="https://wordpress.org/plugins/two-factor-authentication/">'.__('Free two-factor security plugin', 'updraftplus').'</a> | <a href="https://www.simbahosting.co.uk/s3/shop/">'.__('Premium WooCommerce plugins', 'updraftplus').'</a></p>';
|
409 |
?>
|
505 |
'delete_old_dirs' => __('Delete Old Directories', 'updraftplus'),
|
506 |
'raw' => __('Raw backup history', 'updraftplus'),
|
507 |
'notarchive' => __('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').' '.__('However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern.','updraftplus'),
|
508 |
+
'notarchive2' => '<p>'.__('This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz)).', 'updraftplus').'</p> '.apply_filters('updraftplus_if_foreign_then_premium_message', '<p><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'.__('If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you.', 'updraftplus').'</a></p>'),
|
509 |
'makesure' => __('(make sure that you were trying to upload a zip file previously created by UpdraftPlus)','updraftplus'),
|
510 |
'uploaderror' => __('Upload error:','updraftplus'),
|
511 |
'notdba' => __('This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz).','updraftplus'),
|
536 |
'addingsite' => __('Adding...', 'updraftplus'),
|
537 |
'addsite' => __('Add site', 'updraftplus'),
|
538 |
// 'resetting' => __('Resetting...', 'updraftplus'),
|
539 |
+
'creating_please_allow' => __('Creating...', 'updraftplus').(function_exists('openssl_encrypt') ? '' : ' ('.__('your PHP install lacks the openssl module; as a result, this can take minutes; if nothing has happened by then, then you should either try a smaller key size, or ask your web hosting company how to enable this PHP module on your setup.', 'updraftplus').')'),
|
540 |
'sendtosite' => __('Send to site:', 'updraftplus'),
|
541 |
'checkrpcsetup' => sprintf(__('You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version %s or later active and that the keys have been entered correctly.', 'updraftplus'), '2.10.3'),
|
542 |
'pleasenamekey' => __('Please give this key a name (e.g. indicate the site it is for):', 'updraftplus'),
|
551 |
'migratemodalwidth' => class_exists('UpdraftPlus_Addons_Migrator') ? 770 : 500,
|
552 |
'download' => _x('Download', '(verb)', 'updraftplus'),
|
553 |
'unsavedsettingsbackup' => __('You have made changes to your settings, and not saved.', 'updraftplus')."\n".__('You should save your changes to ensure that they are used for making your backup.','updraftplus'),
|
554 |
+
'unsaved_settings_export' => __('You have made changes to your settings, and not saved.', 'updraftplus')."\n".__('Your export file will be of your displayed settings, not your saved ones.','updraftplus'),
|
555 |
'dayselector' => $day_selector,
|
556 |
'mdayselector' => $mday_selector,
|
557 |
'day' => __('day', 'updraftplus'),
|
567 |
'testing_settings' => __('Testing %s Settings...', 'updraftplus'),
|
568 |
'settings_test_result' => __('%s settings test result:', 'updraftplus'),
|
569 |
'nothing_yet_logged' => __('Nothing yet logged', 'updraftplus'),
|
570 |
+
'import_select_file' => __('You have not yet selected a file to import.','updraftplus'),
|
571 |
+
'updraft_settings_url' => UpdraftPlus_Options::admin_page_url().'?page=updraftplus',
|
572 |
+
'network_site_url' => network_site_url(),
|
573 |
+
'importing' => __('Importing...', 'updraftplus'),
|
574 |
+
'importing_data_from' => __('This will import data from:', 'updraftplus'),
|
575 |
+
'exported_on' => __('Which was exported on:','updraftplus'),
|
576 |
+
'continue_import' => __('Do you want to carry out the import?','updraftplus'),
|
577 |
) );
|
578 |
}
|
579 |
|
610 |
wp_enqueue_style('updraft-admin-css', UPDRAFTPLUS_URL.'/css/admin.css', array(), $our_version);
|
611 |
|
612 |
$ret = '<div class="autobackup-description"><img class="autobackup-image" src="'.UPDRAFTPLUS_URL.'/images/automaticbackup.png" class="automation-icon"/>';
|
613 |
+
$ret .= '<div class="advert-description">'.__('UpdraftPlus Premium can automatically take a backup of your plugins or themes and database before you update.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/autobackup/").'" target="_blank">'.__('Be safe every time, without needing to remember - follow this link to learn more', 'updraftplus').'</a></div></div>';
|
614 |
+
$ret .= '<div class="advert-btn"><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/autobackup/").'" class="btn btn-get-started">'.__('Just this add-on', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
615 |
+
$ret .= '<div class="advert-btn"><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'" class="btn btn-get-started">'.__('Full Premium plugin', 'updraftplus').' <span class="circle-dblarrow">»</span></a></div>';
|
616 |
return $ret;
|
617 |
}
|
618 |
|
726 |
array_unshift($links, $settings_link);
|
727 |
// $settings_link = '<a href="http://david.dw-perspective.org.uk/donate">'.__("Donate","UpdraftPlus").'</a>';
|
728 |
// array_unshift($links, $settings_link);
|
729 |
+
$settings_link = '<a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/").'">'.__("Add-Ons / Pro Support","updraftplus").'</a>';
|
730 |
array_unshift($links, $settings_link);
|
731 |
}
|
732 |
return $links;
|
786 |
}
|
787 |
|
788 |
public function show_admin_warning_disabledcron() {
|
789 |
+
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.__('The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even "Backup Now") unless either you have set up a facility to call the scheduler manually, or until it is enabled.','updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/#disablewpcron/").'">'.__('Go here for more information.','updraftplus').'</a>', 'updated updraftplus-disable-wp-cron-warning');
|
790 |
}
|
791 |
|
792 |
public function show_admin_warning_diskspace() {
|
798 |
}
|
799 |
|
800 |
public function show_admin_warning_litespeed() {
|
801 |
+
$this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('Your website is hosted using the %s web server.','updraftplus'),'LiteSpeed').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/i-am-having-trouble-backing-up-and-my-web-hosting-company-uses-the-litespeed-webserver/").'">'.__('Please consult this FAQ if you have problems backing up.', 'updraftplus').'</a>');
|
802 |
}
|
803 |
|
804 |
public function show_admin_debug_warning() {
|
807 |
|
808 |
public function show_admin_warning_overdue_crons($howmany) {
|
809 |
$ret = '<div class="updraftmessage updated"><p>';
|
810 |
+
$ret .= '<strong>'.__('Warning','updraftplus').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'updraftplus'), $howmany).' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/scheduler-wordpress-installation-working/").'">'.__('Read this page for a guide to possible causes and how to fix it.', 'updraftplus').'</a>';
|
811 |
$ret .= '</p></div>';
|
812 |
return $ret;
|
813 |
}
|
2180 |
<div class="wrap" id="updraft-wrap">
|
2181 |
<h1><?php echo $updraftplus->plugin_title; ?></h1>
|
2182 |
|
2183 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/");?>">UpdraftPlus.Com</a> |
|
2184 |
+
<?php if (!defined('UPDRAFTPLUS_NOADS_B')) { ?><a href="<?php echo apply_filters('updraftplus_com_link','https://updraftplus.com/shop/updraftplus-premium/');?>"><?php _e("Premium",'updraftplus');?></a> | <?php } ?>
|
2185 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/news/");?>"><?php _e('News','updraftplus');?></a> |
|
2186 |
<a href="https://twitter.com/updraftplus"><?php _e('Twitter', 'updraftplus');?></a> |
|
2187 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/support/");?>"><?php _e("Support",'updraftplus');?></a> |
|
2188 |
+
<?php if (!is_file(UPDRAFTPLUS_DIR.'/udaddons/updraftplus-addons.php')) { ?><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/newsletter-signup");?>"><?php _e("Newsletter sign-up", 'updraftplus');?></a> | <?php } ?>
|
2189 |
<a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> |
|
2190 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/support/frequently-asked-questions/");?>"><?php _e('FAQs', 'updraftplus'); ?></a> | <a href="https://www.simbahosting.co.uk/s3/shop/"><?php _e('More plugins', 'updraftplus');?></a> - <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
|
2191 |
<br>
|
2192 |
<?php
|
2193 |
}
|
2256 |
}
|
2257 |
}
|
2258 |
$pval = ($updraftplus->have_addons) ? 1 : 0;
|
2259 |
+
|
2260 |
echo '<strong>'.__('Actions','updraftplus').':</strong> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&updraft_restore_success='.$s_val.'&pval='.$pval.'">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
|
2261 |
return;
|
2262 |
} elseif (is_wp_error($backup_success)) {
|
2308 |
if (isset($_GET['action']) && $_GET['action'] == 'updraft_create_backup_dir' && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {
|
2309 |
$created = $this->create_backup_dir();
|
2310 |
if (is_wp_error($created)) {
|
2311 |
+
echo '<p>'.__('Backup directory could not be created', 'updraftplus').'...<br>';
|
2312 |
echo '<ul class="disc">';
|
2313 |
foreach ($created->get_error_messages() as $key => $msg) {
|
2314 |
echo '<li>'.htmlspecialchars($msg).'</li>';
|
2315 |
}
|
2316 |
echo '</ul></p>';
|
2317 |
} elseif ($created !== false) {
|
2318 |
+
echo '<p>'.__('Backup directory successfully created.', 'updraftplus').'</p><br>';
|
2319 |
}
|
2320 |
echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration', 'updraftplus').'</a>';
|
2321 |
return;
|
2323 |
|
2324 |
echo '<div id="updraft_backup_started" class="updated updraft-hidden" style="display:none;"></div>';
|
2325 |
|
2326 |
+
if (isset($_POST['action']) && 'updraft_wipesettings' == $_POST['action']) {
|
|
|
|
|
|
|
|
|
2327 |
$settings = $updraftplus->get_settings_keys();
|
2328 |
foreach ($settings as $s) UpdraftPlus_Options::delete_updraft_option($s);
|
2329 |
|
2348 |
<?php if (false !== strpos(basename(UPDRAFTPLUS_URL), ' ')) { ?>
|
2349 |
<strong><?php _e('The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem.', 'updraftplus');?></strong>
|
2350 |
<?php } else { ?>
|
2351 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/do-you-have-a-javascript-or-jquery-error/");?>"><?php _e('Go here for more information.', 'updraftplus'); ?></a>
|
2352 |
<?php } ?>
|
2353 |
</p>
|
2354 |
</div>
|
2359 |
|
2360 |
// Opens a div, which needs closing later
|
2361 |
if (isset($_GET['updraft_restore_success'])) {
|
2362 |
+
|
2363 |
+
if (get_template() === 'optimizePressTheme' || is_plugin_active('optimizePressPlugin') || is_plugin_active_for_network('optimizePressPlugin')){
|
2364 |
+
$this->show_admin_warning("<a href='https://optimizepress.zendesk.com/hc/en-us/articles/203699826-Update-URL-References-after-moving-domain' target='_blank'>" . __("OptimizePress 2.0 encodes its contents, so search/replace does not work.","updraftplus") . ' ' . __("To fix this problem go here.","updraftplus") . "</a>", "notice notice-warning");
|
2365 |
+
}
|
2366 |
+
$success_advert = (isset($_GET['pval']) && 0 == $_GET['pval'] && !$updraftplus->have_addons) ? '<p>'.__('For even more features and personal support, check out ','updraftplus').'<strong><a href="'.apply_filters("updraftplus_com_link",'https://updraftplus.com/shop/updraftplus-premium/').'" target="_blank">UpdraftPlus Premium</a>.</strong></p>' : "";
|
2367 |
|
2368 |
echo "<div class=\"updated backup-restored\"><span><strong>".__('Your backup has been restored.','updraftplus').'</strong></span><br>';
|
2369 |
// Unnecessary - will be advised of this below
|
2383 |
$ws_advert = $updraftplus->wordshell_random_advert(1);
|
2384 |
if ($ws_advert && empty($success_advert) && empty($this->no_settings_warning)) { echo '<div class="updated ws_advert" style="clear:left;">'.$ws_advert.'</div>'; }
|
2385 |
|
2386 |
+
if (!$updraftplus->memory_check(64)) {
|
2387 |
+
// HS8390 - A case where UpdraftPlus::memory_check_current() returns -1
|
2388 |
+
$memory_check_current = $updraftplus->memory_check_current();
|
2389 |
+
if ($memory_check_current > 0) { ?>
|
2390 |
+
<div class="updated memory-limit"><?php _e('Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary).', 'updraftplus');?> <?php _e('Current limit is:', 'updraftplus');?> <?php echo $updraftplus->memory_check_current(); ?> MB</div>
|
2391 |
+
<?php }
|
2392 |
}
|
2393 |
|
|
|
2394 |
if (!empty($updraftplus->errors)) {
|
2395 |
echo '<div class="error updraft_list_errors">';
|
2396 |
$updraftplus->list_errors();
|
2504 |
if (class_exists('UpdraftPlus_Addons_Migrator')) {
|
2505 |
do_action('updraftplus_migrate_modal_output');
|
2506 |
} else {
|
2507 |
+
echo '<p id="updraft_migrate_modal_main">'.__('Do you want to migrate or clone/duplicate a site?', 'updraftplus').'</p><p>'.__('Then, try out our "Migrator" add-on. After using it once, you\'ll have saved the purchase price compared to the time needed to copy a site by hand.', 'updraftplus').'</p><p><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/landing/migrator/").'">'.__('Get it here.', 'updraftplus').'</a></p>';
|
2508 |
}
|
2509 |
?>
|
2510 |
</div>
|
2529 |
<table>
|
2530 |
<tr>
|
2531 |
<td>
|
2532 |
+
<p class="multisite-advert-width"><?php echo __('Do you need WordPress Multisite support?','updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'. __('Please check out UpdraftPlus Premium, or the stand-alone Multisite add-on.','updraftplus');?></a>.</p>
|
2533 |
</td>
|
2534 |
</tr>
|
2535 |
</table>
|
2572 |
<div>
|
2573 |
<h2>UpdraftPlus Premium</h2>
|
2574 |
<p>
|
2575 |
+
<span class="premium-upgrade-prompt"><?php _e('You are currently using the free version of UpdraftPlus from wordpress.org.', 'updraftplus');?> <a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/support/installing-updraftplus-premium-your-add-on/");?>"><br><?php echo __('If you have made a purchase from UpdraftPlus.Com, then follow this link to the instructions to install your purchase.', 'updraftplus').' '.__('The first step is to de-install the free version.', 'updraftplus')?></a></span>
|
2576 |
<ul class="updraft_premium_description_list">
|
2577 |
+
<li><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/");?>"><strong><?php _e('Get UpdraftPlus Premium', 'updraftplus');?></strong></a></li>
|
2578 |
+
<li><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/updraftplus-full-feature-list/");?>"><?php _e('Full feature list', 'updraftplus');?></a></li>
|
2579 |
+
<li><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/faq-category/general-and-pre-sales-questions/");?>"><?php _e('Pre-sales FAQs', 'updraftplus');?></a></li>
|
2580 |
+
<li class="last"><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/ask-a-pre-sales-question/");?>"><?php _e('Ask a pre-sales question', 'updraftplus');?></a> - <a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/support/");?>"><?php _e('Support', 'updraftplus');?></a></li>
|
2581 |
</ul>
|
2582 |
</p>
|
2583 |
</div>
|
2586 |
<tr>
|
2587 |
<th class="updraft_feat_th" style="text-align:left;"></th>
|
2588 |
<th class="updraft_feat_th"><img src="<?php echo $freev;?>" height="120"></th>
|
2589 |
+
<th class="updraft_feat_th" style='background-color:#DF6926;'><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/");?>"><img src="<?php echo $premv;?>" height="120"></a></th>
|
2590 |
</tr>
|
2591 |
<tr>
|
2592 |
<td class="updraft_feature_cell"><?php _e('Get it from', 'updraftplus');?></td>
|
2593 |
<td class="updraft_tick_cell" style="vertical-align:top; line-height: 120%; margin-top:6px; padding-top:6px;">WordPress.Org</td>
|
2594 |
<td class="updraft_tick_cell" style="padding: 6px; line-height: 120%;">
|
2595 |
UpdraftPlus.Com<br>
|
2596 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/");?>"><strong><?php _e('Buy It Now!', 'updraftplus');?></strong></a><br>
|
2597 |
</td>
|
2598 |
</tr>
|
2599 |
<tr>
|
2886 |
<?php /* echo '<h2>'.__('Existing Backups: Downloading And Restoring', 'updraftplus').'</h2>'; */ ?>
|
2887 |
<?php if (!empty($options['include_whitespace_warning'])) { ?>
|
2888 |
<p class="ud-whitespace-warning updraft-hidden" style="display:none;">
|
2889 |
+
<?php echo '<strong>'.__('Warning','updraftplus').':</strong> '.__('Your WordPress installation has a problem with outputting extra whitespace. This can corrupt backups that you download from here.','updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/problems-with-extra-white-space/").'">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
|
2890 |
</p>
|
2891 |
<?php } ?>
|
2892 |
|
3005 |
|
3006 |
# The 'off' check is for badly configured setups - http://wordpress.org/support/topic/plugin-wp-super-cache-warning-php-safe-mode-enabled-but-safe-mode-is-off
|
3007 |
if ($updraftplus->detect_safe_mode()) {
|
3008 |
+
echo "<p><em>".__("Your web server has PHP's so-called safe_mode active.", 'updraftplus').' '.__('This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/i-want-to-restore-but-have-either-cannot-or-have-failed-to-do-so-from-the-wp-admin-console/").'">'.__('or to restore manually', 'updraftplus').'.</a></em></p><br>';
|
3009 |
}
|
3010 |
|
3011 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
3033 |
|
3034 |
if (!class_exists('UpdraftPlus_Addons_Migrator')) {
|
3035 |
|
3036 |
+
echo '<a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/tell-me-more-about-the-search-and-replace-site-location-in-the-database-option/").'">'.__('You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information','updraftplus').'</a>';
|
3037 |
|
3038 |
}
|
3039 |
|
3044 |
</div>
|
3045 |
</fieldset>
|
3046 |
</form>
|
3047 |
+
<p><em><a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/");?>" target="_blank"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
|
3048 |
</div>
|
3049 |
</div>
|
3050 |
|
3056 |
echo "<tr class=\"updraft_debugrow\"><th>$head</th><td>$content</td></tr>";
|
3057 |
}
|
3058 |
|
3059 |
+
public function get_settings_expertsettings($backup_disabled){
|
3060 |
+
ob_start();
|
3061 |
+
$this->settings_expertsettings($backup_disabled);
|
3062 |
+
return ob_get_clean();
|
3063 |
+
}
|
3064 |
+
|
3065 |
private function settings_expertsettings($backup_disabled) {
|
3066 |
global $updraftplus, $wpdb;
|
3067 |
$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
|
3068 |
?>
|
3069 |
<div class="expertmode">
|
3070 |
+
<p>
|
3071 |
+
<em><?php _e('Unless you have a problem, you can completely ignore everything here.', 'updraftplus');?></em>
|
3072 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3073 |
|
3074 |
+
<div class="site_info">
|
3075 |
+
<table>
|
3076 |
+
<?php
|
3077 |
|
3078 |
+
// It appears (Mar 2015) that some mod_security distributions block the output of the string el6.x86_64 in PHP output, on the silly assumption that only hackers are interested in knowing what environment PHP is running on.
|
3079 |
+
//$uname_info = @php_uname();
|
3080 |
+
$uname_info = @php_uname('s').' '.@php_uname('n').' ';
|
3081 |
|
3082 |
+
$release_name = @php_uname('r');
|
3083 |
+
if (preg_match('/^(.*)\.(x86_64|[3456]86)$/', $release_name, $matches)) {
|
3084 |
+
$release_name = $matches[1].' ';
|
3085 |
+
} else {
|
3086 |
+
$release_name = '';
|
3087 |
+
}
|
3088 |
|
3089 |
+
// In case someone does something similar with just the processor type string
|
3090 |
+
$mtype = @php_uname('m');
|
3091 |
+
if ('x86_64' == $mtype) {
|
3092 |
+
$mtype = '64-bit';
|
3093 |
+
} elseif (preg_match('/^i([3456]86)$/', $mtype, $matches)) {
|
3094 |
+
$mtype = $matches[1];
|
3095 |
+
}
|
3096 |
|
3097 |
+
$uname_info .= $release_name.$mtype.' '.@php_uname('v');
|
3098 |
+
|
3099 |
+
$this->settings_debugrow(__('Web server:','updraftplus'), htmlspecialchars($_SERVER["SERVER_SOFTWARE"]).' ('.htmlspecialchars($uname_info).')');
|
3100 |
+
|
3101 |
+
$this->settings_debugrow('ABSPATH:', htmlspecialchars(ABSPATH));
|
3102 |
+
$this->settings_debugrow('WP_CONTENT_DIR:', htmlspecialchars(WP_CONTENT_DIR));
|
3103 |
+
$this->settings_debugrow('WP_PLUGIN_DIR:', htmlspecialchars(WP_PLUGIN_DIR));
|
3104 |
+
$this->settings_debugrow('Table prefix:', htmlspecialchars($updraftplus->get_table_prefix()));
|
3105 |
+
|
3106 |
+
$peak_memory_usage = memory_get_peak_usage(true)/1024/1024;
|
3107 |
+
$memory_usage = memory_get_usage(true)/1024/1024;
|
3108 |
+
$this->settings_debugrow(__('Peak memory usage','updraftplus').':', $peak_memory_usage.' MB');
|
3109 |
+
$this->settings_debugrow(__('Current memory usage','updraftplus').':', $memory_usage.' MB');
|
3110 |
+
$this->settings_debugrow(__('Memory limit', 'updraftplus').':', htmlspecialchars(ini_get('memory_limit')));
|
3111 |
+
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'PHP'), htmlspecialchars(phpversion()).' - <a href="admin-ajax.php?page=updraftplus&action=updraft_ajax&subaction=phpinfo&nonce='.wp_create_nonce('updraftplus-credentialtest-nonce').'" id="updraftplus-phpinfo">'.__('show PHP information (phpinfo)', 'updraftplus').'</a>');
|
3112 |
+
$this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'MySQL'), htmlspecialchars($wpdb->db_version()));
|
3113 |
+
if (function_exists('curl_version') && function_exists('curl_exec')) {
|
3114 |
+
$cv = curl_version();
|
3115 |
+
$cvs = $cv['version'].' / SSL: '.$cv['ssl_version'].' / libz: '.$cv['libz_version'];
|
3116 |
+
} else {
|
3117 |
+
$cvs = __('Not installed', 'updraftplus').' ('.__('required for some remote storage providers', 'updraftplus').')';
|
3118 |
+
}
|
3119 |
+
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'Curl'), htmlspecialchars($cvs));
|
3120 |
+
$this->settings_debugrow(sprintf(__('%s version:', 'updraftplus'), 'OpenSSL'), defined('OPENSSL_VERSION_TEXT') ? OPENSSL_VERSION_TEXT : '-');
|
3121 |
+
$this->settings_debugrow('MCrypt:', function_exists('mcrypt_encrypt') ? __('Yes') : __('No'));
|
3122 |
+
|
3123 |
+
if (version_compare(phpversion(), '5.2.0', '>=') && extension_loaded('zip')) {
|
3124 |
+
$ziparchive_exists = __('Yes', 'updraftplus');
|
3125 |
+
} else {
|
3126 |
+
# First do class_exists, because method_exists still sometimes segfaults due to a rare PHP bug
|
3127 |
+
$ziparchive_exists = (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? __('Yes', 'updraftplus') : __('No', 'updraftplus');
|
3128 |
+
}
|
3129 |
+
$this->settings_debugrow('ZipArchive::addFile:', $ziparchive_exists);
|
3130 |
+
$binzip = $updraftplus->find_working_bin_zip(false, false);
|
3131 |
+
$this->settings_debugrow(__('zip executable found:', 'updraftplus'), ((is_string($binzip)) ? __('Yes').': '.$binzip : __('No')));
|
3132 |
+
$hosting_bytes_free = $updraftplus->get_hosting_disk_quota_free();
|
3133 |
+
if (is_array($hosting_bytes_free)) {
|
3134 |
+
$perc = round(100*$hosting_bytes_free[1]/(max($hosting_bytes_free[2], 1)), 1);
|
3135 |
+
$this->settings_debugrow(__('Free disk space in account:', 'updraftplus'), sprintf(__('%s (%s used)', 'updraftplus'), round($hosting_bytes_free[3]/1048576, 1)." MB", "$perc %"));
|
3136 |
+
}
|
3137 |
+
|
3138 |
+
$this->settings_debugrow(__('Plugins for debugging:', 'updraftplus'),'<a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-crontrol'), 'install-plugin_wp-crontrol').'">WP Crontrol</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=sql-executioner'), 'install-plugin_sql-executioner').'">SQL Executioner</a> | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=advanced-code-editor'), 'install-plugin_advanced-code-editor').'">Advanced Code Editor</a> '.(current_user_can('edit_plugins') ? '<a href="'.self_admin_url('plugin-editor.php?file=updraftplus/updraftplus.php').'">(edit UpdraftPlus)</a>' : '').' | <a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&updraftplus_noautobackup=1&plugin=wp-filemanager'), 'install-plugin_wp-filemanager').'">WP Filemanager</a>');
|
3139 |
|
3140 |
+
$this->settings_debugrow("HTTP Get: ", '<input id="updraftplus_httpget_uri" type="text" class="call-action"> <a href="#" id="updraftplus_httpget_go">'.__('Fetch', 'updraftplus').'</a> <a href="#" id="updraftplus_httpget_gocurl">'.__('Fetch', 'updraftplus').' (Curl)</a><p id="updraftplus_httpget_results"></p>');
|
|
|
3141 |
|
3142 |
+
$this->settings_debugrow(__("Call WordPress action:", 'updraftplus'), '<input id="updraftplus_callwpaction" type="text" class="call-action"> <a href="#" id="updraftplus_callwpaction_go">'.__('Call', 'updraftplus').'</a><div id="updraftplus_callwpaction_results"></div>');
|
|
|
|
|
3143 |
|
3144 |
+
$this->settings_debugrow('Site ID:', '(used to identify any Vault connections) <span id="updraft_show_sid">'.htmlspecialchars($updraftplus->siteid()).'</span> - <a href="#" id="updraft_reset_sid">'.__('reset', 'updraftplus')."</a>");
|
3145 |
+
|
3146 |
+
$this->settings_debugrow('', '<a href="admin-ajax.php?page=updraftplus&action=updraft_ajax&subaction=backuphistoryraw&nonce='.wp_create_nonce('updraftplus-credentialtest-nonce').'" id="updraftplus-rawbackuphistory">'.__('Show raw backup and file list', 'updraftplus').'</a>');
|
3147 |
+
|
3148 |
+
?>
|
3149 |
+
</table>
|
3150 |
+
</div>
|
3151 |
+
|
3152 |
+
<div class="debug_tools">
|
3153 |
+
<?php do_action('updraftplus_debugtools_dashboard'); ?>
|
3154 |
+
</div>
|
3155 |
+
|
3156 |
+
<?php if (!class_exists('UpdraftPlus_Addon_LockAdmin')): ?>
|
3157 |
+
<div class="lock_admin">
|
3158 |
+
<p class="updraftplus-lock-advert">
|
3159 |
+
<a href="<?php apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/")?>">
|
3160 |
+
<em><?php _e('For the ability to lock access to UpdraftPlus settings with a password, upgrade to UpdraftPlus Premium.', 'updraftplus'); ?></em>
|
3161 |
+
</a>
|
3162 |
+
</p>
|
3163 |
+
</div>
|
3164 |
+
<?php endif; ?>
|
3165 |
+
|
3166 |
+
<div class="total_size">
|
3167 |
+
<h3> <?php _e('Total (uncompressed) on-disk data:','updraftplus');?></h3>
|
3168 |
+
<p class="uncompressed-data">
|
3169 |
+
<em>
|
3170 |
+
<?php _e('N.B. This count is based upon what was, or was not, excluded the last time you saved the options.', 'updraftplus')?>
|
3171 |
+
</em>
|
3172 |
+
</p>
|
3173 |
+
<table>
|
3174 |
+
<?php
|
3175 |
+
foreach ($backupable_entities as $key => $info) {
|
3176 |
|
3177 |
+
$sdescrip = preg_replace('/ \(.*\)$/', '', $info['description']);
|
3178 |
+
if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
|
3179 |
+
|
3180 |
+
$this->settings_debugrow(ucfirst($sdescrip).':', '<span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" class="count" data-type="' . $key . '" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a>');
|
3181 |
+
}
|
3182 |
+
?>
|
3183 |
+
</table>
|
3184 |
+
</div>
|
3185 |
+
|
3186 |
+
<h3><?php _e('Export / import settings', 'updraftplus');?></h3>
|
3187 |
+
<p class="max-width-600">
|
3188 |
+
|
3189 |
+
<?php printf(__('Here, you can export your UpdraftPlus settings (%s), either for using on another site, or to keep as a backup. This tool will export what is currently in the settings tab.', 'updraftplus'), '<strong>'.__('including any passwords', 'updraftplus').'</strong>');?>
|
3190 |
+
|
3191 |
+
<br>
|
3192 |
+
|
3193 |
+
<button type="button" style="clear:left;" class="button-primary" id="updraftplus-settings-export"><?php _e('Export settings', 'updraftplus');?></button>
|
3194 |
+
|
3195 |
+
</p><p class="max-width-600">
|
3196 |
+
|
3197 |
+
<?php _e('You can also import previously-exported settings. This tool will replace all your saved settings.', 'updraftplus'); ?>
|
3198 |
+
|
3199 |
+
<br>
|
3200 |
|
3201 |
+
<button type="button" style="clear:left;" class="button-primary" id="updraftplus-settings-import"><?php _e('Import settings', 'updraftplus');?></button>
|
3202 |
+
<input type="file" name="settings_file" id="import_settings">
|
3203 |
+
|
3204 |
+
</p>
|
3205 |
+
|
3206 |
+
<div class="wipe_settings">
|
3207 |
+
<h3><?php _e('Wipe settings', 'updraftplus');?></h3>
|
3208 |
+
<p class="max-width-600"><?php echo __('This button will delete all UpdraftPlus settings and progress information for in-progress backups (but not any of your existing backups from your cloud storage).', 'updraftplus').' '.__('You will then need to enter all your settings again. You can also do this before deactivating/deinstalling UpdraftPlus if you wish.','updraftplus');?></p>
|
3209 |
+
<form method="post" action="<?php echo esc_url(add_query_arg(array('error' => false, 'updraft_restore_success' => false, 'action' => false, 'page' => 'updraftplus'))); ?>">
|
3210 |
+
<input type="hidden" name="action" value="updraft_wipesettings" />
|
3211 |
+
<p><input type="submit" class="button-primary" value="<?php _e('Wipe settings','updraftplus'); ?>" onclick="return(confirm('<?php echo esc_js(__('This will delete all your UpdraftPlus settings - are you sure you want to do this?', 'updraftplus'));?>'))" /></p>
|
3212 |
+
</form>
|
3213 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3214 |
</div>
|
3215 |
<?php
|
3216 |
}
|
3465 |
echo ($show_return) ? '<h1>UpdraftPlus - '.__('Remove old directories', 'updraftplus').'</h1>' : '<h2>'.__('Remove old directories', 'updraftplus').'</h2>';
|
3466 |
|
3467 |
if ($this->delete_old_dirs()) {
|
3468 |
+
echo '<p>'.__('Old directories successfully removed.','updraftplus').'</p><br>';
|
3469 |
} else {
|
3470 |
+
echo '<p>',__('Old directory removal failed for some reason. You may want to do this manually.','updraftplus').'</p><br>';
|
3471 |
}
|
3472 |
if ($show_return) echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
|
3473 |
}
|
3774 |
<th><?php _e('Incremental file backup schedule', 'updraftplus'); ?>:</th>
|
3775 |
<td>
|
3776 |
<?php do_action('updraftplus_incremental_cell', $selected_interval); ?>
|
3777 |
+
<a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/support/tell-me-more-about-incremental-backups/");?>"><em><?php _e('Tell me more about incremental backups', 'updraftplus'); ?><em></a>
|
3778 |
</td>
|
3779 |
</tr>
|
3780 |
<?php } ?>
|
3810 |
<th></th>
|
3811 |
<td><div>
|
3812 |
<?php
|
3813 |
+
echo apply_filters('updraftplus_fixtime_ftinfo', '<p>'.__('To fix the time at which a backup should take place,','updraftplus').' ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), '.__('or to configure more complex schedules', 'updraftplus').', <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>');
|
3814 |
?>
|
3815 |
</div></td>
|
3816 |
</tr>
|
3850 |
if (false === apply_filters('updraftplus_storage_printoptions', false, $active_service)) {
|
3851 |
|
3852 |
echo '</div>';
|
3853 |
+
echo '<p><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/morestorage/").'">'.htmlspecialchars(__('You can send a backup to more than one destination with an add-on.','updraftplus')).'</a></p>';
|
3854 |
echo '</td></tr>';
|
3855 |
}
|
3856 |
?>
|
3884 |
<th><?php _e('Include in files backup', 'updraftplus');?>:</th>
|
3885 |
<td>
|
3886 |
<?php echo $this->files_selector_widgetry(); ?>
|
3887 |
+
<p><?php echo apply_filters('updraftplus_admin_directories_description', __('The above directories are everything, except for WordPress core itself which you can download afresh from WordPress.org.', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/").'">'.htmlspecialchars(__('See also the "More Files" add-on from our shop.', 'updraftplus')).'</a>'); ?></p>
|
3888 |
</td>
|
3889 |
</tr>
|
3890 |
</table>
|
3898 |
|
3899 |
<td>
|
3900 |
<?php
|
3901 |
+
echo apply_filters('updraft_database_encryption_config', '<a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/updraftplus-premium/").'">'.__("Don't want to be spied on? UpdraftPlus Premium can encrypt your database backup.", 'updraftplus').'</a> '.__('It can also backup external databases.', 'updraftplus'));
|
3902 |
?>
|
3903 |
</td>
|
3904 |
</tr>
|
3980 |
?>
|
3981 |
<input type="checkbox" id="updraft_email" name="updraft_email" value="<?php esc_attr_e(get_bloginfo('admin_email')); ?>"<?php if (!empty($updraft_email)) echo ' checked="checked"';?> > <br><label for="updraft_email"><?php echo __("Check this box to have a basic report sent to", 'updraftplus').' <a href="'.admin_url('options-general.php').'">'.__("your site's admin address", 'updraftplus').'</a> ('.htmlspecialchars(get_bloginfo('admin_email')).")."; ?></label>
|
3982 |
<?php
|
3983 |
+
if (!class_exists('UpdraftPlus_Addon_Reporting')) echo '<a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/shop/reporting/").'">'.__('For more reporting features, use the Reporting add-on.', 'updraftplus').'</a>';
|
3984 |
?>
|
3985 |
</td>
|
3986 |
</tr>
|
4056 |
|
4057 |
<tr class="expertmode updraft-hidden" style="display:none;">
|
4058 |
<th><?php _e('Disable SSL entirely where possible', 'updraftplus');?>:</th>
|
4059 |
+
<td><input data-updraft_settings_test="nossl" type="checkbox" id="updraft_ssl_nossl" name="updraft_ssl_nossl" value="1" <?php if (UpdraftPlus_Options::get_updraft_option('updraft_ssl_nossl')) echo 'checked="checked"'; ?>> <br><label for="updraft_ssl_nossl"><?php _e('Choosing this option lowers your security by stopping UpdraftPlus from using SSL for authentication and encrypted transport at all, where possible. Note that some cloud storage providers do not allow this (e.g. Dropbox), so with those providers this setting will have no effect.','updraftplus');?> <a href="<?php echo apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/i-get-ssl-certificate-errors-when-backing-up-andor-restoring/");?>"><?php _e('See this FAQ also.', 'updraftplus');?></a></label></td>
|
4060 |
</tr>
|
4061 |
|
4062 |
<?php do_action('updraftplus_configprint_expertoptions'); ?>
|
4709 |
global $wp_filesystem, $updraftplus;
|
4710 |
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
4711 |
if (!isset($backup_history[$timestamp]) || !is_array($backup_history[$timestamp])) {
|
4712 |
+
echo '<p>'.__('This backup does not exist in the backup history - restoration aborted. Timestamp:','updraftplus')." $timestamp</p><br>";
|
4713 |
return new WP_Error('does_not_exist', __('Backup does not exist in the backup history', 'updraftplus'));
|
4714 |
}
|
4715 |
|
4739 |
$credentials = request_filesystem_credentials(UpdraftPlus_Options::admin_page()."?page=updraftplus&action=updraft_restore&backup_timestamp=$timestamp", '', false, false, $extra_fields);
|
4740 |
WP_Filesystem($credentials);
|
4741 |
if ( $wp_filesystem->errors->get_error_code() ) {
|
4742 |
+
echo '<p><em><a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/").'">'.__('Why am I seeing this?', 'updraftplus').'</a></em></p>';
|
4743 |
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) show_message($message);
|
4744 |
exit;
|
4745 |
}
|
5038 |
$pdata = (is_string($data)) ? $data : serialize($data);
|
5039 |
echo '<strong>'.__('Error data:', 'updraftplus').'</strong> '.htmlspecialchars($pdata).'<br>';
|
5040 |
if (false !== strpos($pdata, 'PCLZIP_ERR_BAD_FORMAT (-10)')) {
|
5041 |
+
echo '<a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/faqs/error-message-pclzip_err_bad_format-10-invalid-archive-structure-mean/").'"><strong>'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</strong></a><br>';
|
5042 |
}
|
5043 |
}
|
5044 |
}
|
5147 |
die;
|
5148 |
}
|
5149 |
|
5150 |
+
public function updraft_ajax_importsettings() {
|
5151 |
+
global $updraftplus;
|
5152 |
+
|
5153 |
+
if (empty($_POST) || empty($_POST['subaction']) || 'importsettings' != $_POST['subaction'] || !isset($_POST['nonce']) || !is_user_logged_in() || !UpdraftPlus_Options::user_can_manage() || !wp_verify_nonce($_POST['nonce'], 'updraftplus-settings-nonce')) die('Security check');
|
5154 |
+
|
5155 |
+
if (empty($_POST['settings']) || !is_string($_POST['settings'])) die('Invalid data');
|
5156 |
+
|
5157 |
+
$this->import_settings($_POST);
|
5158 |
+
}
|
5159 |
+
|
5160 |
+
public function import_settings($settings) {
|
5161 |
+
|
5162 |
+
$settings = json_decode(stripslashes($settings['settings']),true);
|
5163 |
+
|
5164 |
+
echo json_encode($this->save_settings($settings));
|
5165 |
+
|
5166 |
+
die;
|
5167 |
+
}
|
5168 |
+
|
5169 |
private function backup_now_remote_message() {
|
5170 |
global $updraftplus;
|
5171 |
|
5176 |
$no_remote_configured = (empty($service) || array('none') === $service || array('') === $service) ? true : false;
|
5177 |
|
5178 |
if ($no_remote_configured) {
|
5179 |
+
return '<input type="checkbox" disabled="disabled" id="backupnow_includecloud"> <em>'.sprintf(__("Backup won't be sent to any remote storage - none has been saved in the %s", 'updraftplus'), '<a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&tab=settings" id="updraft_backupnow_gotosettings">'.__('settings', 'updraftplus')).'</a>. '.__('Not got any remote storage?', 'updraftplus').' <a href="'.apply_filters("updraftplus_com_link","https://updraftplus.com/landing/vault/").'">'.__("Check out UpdraftPlus Vault.", 'updraftplus').'</a></em>';
|
5180 |
} else {
|
5181 |
return '<input type="checkbox" id="backupnow_includecloud" checked="checked"> <label for="backupnow_includecloud">'.__("Send this backup to remote storage", 'updraftplus').'</label>';
|
5182 |
}
|
@@ -407,7 +407,7 @@ class UpdraftPlus_Backup {
|
|
407 |
return;
|
408 |
}
|
409 |
|
410 |
-
if (method_exists($wpdb, 'check_connection')) {
|
411 |
if (!$wpdb->check_connection(false)) {
|
412 |
$updraftplus->reschedule(60);
|
413 |
$updraftplus->log("It seems the database went away; scheduling a resumption and terminating for now");
|
@@ -1375,7 +1375,7 @@ class UpdraftPlus_Backup {
|
|
1375 |
$total_tables = 0;
|
1376 |
|
1377 |
# WP 3.9 onwards - https://core.trac.wordpress.org/browser/trunk/src/wp-includes/wp-db.php?rev=27925 - check_connection() allows us to get the database connection back if it had dropped
|
1378 |
-
if ('wp' == $whichdb && method_exists($this->wpdb_obj, 'check_connection')) {
|
1379 |
if (!$this->wpdb_obj->check_connection(false)) {
|
1380 |
$updraftplus->reschedule(60);
|
1381 |
$updraftplus->log("It seems the database went away; scheduling a resumption and terminating for now");
|
407 |
return;
|
408 |
}
|
409 |
|
410 |
+
if (method_exists($wpdb, 'check_connection') && (!defined('UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS') || !UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS)) {
|
411 |
if (!$wpdb->check_connection(false)) {
|
412 |
$updraftplus->reschedule(60);
|
413 |
$updraftplus->log("It seems the database went away; scheduling a resumption and terminating for now");
|
1375 |
$total_tables = 0;
|
1376 |
|
1377 |
# WP 3.9 onwards - https://core.trac.wordpress.org/browser/trunk/src/wp-includes/wp-db.php?rev=27925 - check_connection() allows us to get the database connection back if it had dropped
|
1378 |
+
if ('wp' == $whichdb && method_exists($this->wpdb_obj, 'check_connection') && (!defined('UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS') || !UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS)) {
|
1379 |
if (!$this->wpdb_obj->check_connection(false)) {
|
1380 |
$updraftplus->reschedule(60);
|
1381 |
$updraftplus->log("It seems the database went away; scheduling a resumption and terminating for now");
|
@@ -23,6 +23,7 @@ class UpdraftPlus_UpdraftCentral_Main {
|
|
23 |
'updraftplus' => 'UpdraftPlus_RemoteControl_Commands',
|
24 |
'updates' => 'UpdraftCentral_Updates_Commands',
|
25 |
'users' => 'UpdraftCentral_Users_Commands',
|
|
|
26 |
));
|
27 |
|
28 |
// Remote control keys
|
@@ -269,7 +270,7 @@ class UpdraftPlus_UpdraftCentral_Main {
|
|
269 |
|
270 |
$key_size = (empty($extra_info['key_size']) || !is_numeric($extra_info['key_size']) || $extra_info['key_size'] < 512) ? 2048 : (int)$extra_info['key_size'];
|
271 |
// unset($extra_info['key_size']);
|
272 |
-
|
273 |
if (is_object($ud_rpc) && $ud_rpc->generate_new_keypair($key_size)) {
|
274 |
|
275 |
if ($post_it && empty($extra_info['mothership_firewalled'])) {
|
@@ -372,8 +373,6 @@ class UpdraftPlus_UpdraftCentral_Main {
|
|
372 |
public function get_keys_table() {
|
373 |
|
374 |
$ret = '';
|
375 |
-
|
376 |
-
$ret .= '<table><thead><tr><th style="text-align:left;">'.__('Key description', 'updraftplus').'</th><th style="text-align:left;">'.__('Details', 'updraftplus').'</th></thead></tr><tbody>';
|
377 |
|
378 |
$our_keys = UpdraftPlus_Options::get_updraft_option('updraft_central_localkeys');
|
379 |
if (!is_array($our_keys)) $our_keys = array();
|
@@ -422,44 +421,128 @@ class UpdraftPlus_UpdraftCentral_Main {
|
|
422 |
}
|
423 |
|
424 |
$ret .= '<a href="#" data-key_id="'.esc_attr($i).'" class="updraftcentral_key_delete">'.__('Delete...', 'updraftplus').'</a></td></tr>';
|
425 |
-
|
426 |
}
|
427 |
|
428 |
-
$ret .= '</tbody></table>';
|
429 |
-
|
430 |
-
$ret .= '<h4>'.__('Create new key', 'updraftplus').'</h4><table style="width: 760px; table-layout:fixed;"><thead><tbody>';
|
431 |
-
|
432 |
-
$ret .= '<tr class="updraft_debugrow"><th style="width: 20%;">'.__('Description', 'updraftplus').':</th><td style="width:80%;"><input id="updraftcentral_keycreate_description" type="text" size="20" placeholder="'.__('Enter any description', 'updraftplus').'" value=""></td></tr>';
|
433 |
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
<
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
|
|
|
|
|
|
454 |
}
|
455 |
|
456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
}
|
464 |
|
465 |
}
|
23 |
'updraftplus' => 'UpdraftPlus_RemoteControl_Commands',
|
24 |
'updates' => 'UpdraftCentral_Updates_Commands',
|
25 |
'users' => 'UpdraftCentral_Users_Commands',
|
26 |
+
// 'advanced' => 'UpdraftCentral_Advanced_Commands'
|
27 |
));
|
28 |
|
29 |
// Remote control keys
|
270 |
|
271 |
$key_size = (empty($extra_info['key_size']) || !is_numeric($extra_info['key_size']) || $extra_info['key_size'] < 512) ? 2048 : (int)$extra_info['key_size'];
|
272 |
// unset($extra_info['key_size']);
|
273 |
+
|
274 |
if (is_object($ud_rpc) && $ud_rpc->generate_new_keypair($key_size)) {
|
275 |
|
276 |
if ($post_it && empty($extra_info['mothership_firewalled'])) {
|
373 |
public function get_keys_table() {
|
374 |
|
375 |
$ret = '';
|
|
|
|
|
376 |
|
377 |
$our_keys = UpdraftPlus_Options::get_updraft_option('updraft_central_localkeys');
|
378 |
if (!is_array($our_keys)) $our_keys = array();
|
421 |
}
|
422 |
|
423 |
$ret .= '<a href="#" data-key_id="'.esc_attr($i).'" class="updraftcentral_key_delete">'.__('Delete...', 'updraftplus').'</a></td></tr>';
|
|
|
424 |
}
|
425 |
|
|
|
|
|
|
|
|
|
|
|
426 |
|
427 |
+
ob_start();
|
428 |
+
?>
|
429 |
+
<div id="updraftcentral_keys">
|
430 |
+
<div id="updraftcentral_keys_content">
|
431 |
+
<table>
|
432 |
+
<thead>
|
433 |
+
<tr>
|
434 |
+
<th style="text-align:left;"><?php _e('Key description', 'updraftplus') ?></th>
|
435 |
+
<th style="text-align:left;"><?php _e('Details', 'updraftplus') ?></th>
|
436 |
+
</tr>
|
437 |
+
</thead>
|
438 |
+
<tbody>
|
439 |
+
<?php
|
440 |
+
|
441 |
+
echo $ret;
|
442 |
+
|
443 |
+
?>
|
444 |
+
</tbody>
|
445 |
+
</table>
|
446 |
+
</div>
|
447 |
+
</div>
|
448 |
+
<?php
|
449 |
+
return ob_get_clean();
|
450 |
}
|
451 |
|
452 |
+
private function create_key_markup(){
|
453 |
+
ob_start(); ?>
|
454 |
+
<div class="create_key_container">
|
455 |
+
<h4> <?php _e('Create new key', 'updraftplus') ?></h4>
|
456 |
+
<table style="width: auto; table-layout:fixed;">
|
457 |
+
<thead></thead>
|
458 |
+
<tbody>
|
459 |
+
<tr class="updraft_debugrow">
|
460 |
+
<th style="width: 20%;">
|
461 |
+
<?php _e('Description', 'updraftplus') ?>:
|
462 |
+
</th>
|
463 |
+
<td style="width:80%;">
|
464 |
+
<input id="updraftcentral_keycreate_description" type="text" size="20" placeholder="<?php _e('Enter any description', 'updraftplus'); ?>" value="" >
|
465 |
+
</td>
|
466 |
+
</tr>
|
467 |
+
|
468 |
+
|
469 |
+
<tr class="updraft_debugrow">
|
470 |
+
<th style=""> <?php _e('Dashboard at', 'updraftplus') ?>:</th>
|
471 |
+
<td style="width:80%;">
|
472 |
+
<label>
|
473 |
+
<input checked="checked" type="radio" name="updraftcentral_mothership" id="updraftcentral_mothership_updraftpluscom">
|
474 |
+
UpdraftPlus.Com (<?php _e('i.e. you have an account there', 'updraftplus') ?>)
|
475 |
+
</label>
|
476 |
+
<br>
|
477 |
+
<label>
|
478 |
+
<input type="radio" name="updraftcentral_mothership" id="updraftcentral_mothership_other">
|
479 |
+
<?php _e('Other (please specify - i.e. the site where you have installed an UpdraftCentral dashboard)', 'updraftplus') ?>:
|
480 |
+
</label>
|
481 |
+
<br>
|
482 |
+
<input disabled="disabled" id="updraftcentral_keycreate_mothership" type="text" size="40" placeholder="<?php _e('URL of mothership', 'updraftplus') ?>" value="">
|
483 |
+
<br>
|
484 |
+
<div id="updraftcentral_keycreate_mothership_firewalled_container">
|
485 |
+
<label>
|
486 |
+
<input id="updraftcentral_keycreate_mothership_firewalled" type="checkbox">
|
487 |
+
<?php _e('Use the alternative method for making a connection with the dashboard.', 'updraftplus') ?>
|
488 |
+
<a href="#" id="updraftcentral_keycreate_altmethod_moreinfo_get">
|
489 |
+
<?php _e('More information...', 'updraftplus') ?>
|
490 |
+
</a>
|
491 |
+
<p id="updraftcentral_keycreate_altmethod_moreinfo" style="display:none;">
|
492 |
+
<?php _e('This is useful if the dashboard webserver cannot be contacted with incoming traffic by this website (for example, this is the case if this website is hosted on the public Internet, but the UpdraftCentral dashboard is on localhost, or on an Intranet, or if this website has an outgoing firewall), or if the dashboard website does not have a SSL certificate.');?>
|
493 |
+
</p>
|
494 |
+
</label>
|
495 |
+
</div>
|
496 |
+
</td>
|
497 |
+
</tr>
|
498 |
+
<tr class="updraft_debugrow">
|
499 |
+
<th style=""></th>
|
500 |
+
<td style="width:80%;">
|
501 |
+
<?php _e('Encryption key size:', 'updraftplus'); ?>
|
502 |
+
<select style="" id="updraftcentral_keycreate_keysize">
|
503 |
+
<option value="512"><?php echo sprintf(__('%s bits', 'updraftplus').' - '.__('easy to break, fastest', 'updraftplus'), '512') ?></option>
|
504 |
+
<option value="1024"><?php echo sprintf(__('%s bits', 'updraftplus').' - '.__('faster (possibility for slow PHP installs)', 'updraftplus'), '1024') ?></option>
|
505 |
+
<option value="2048" selected="selected"><?php echo sprintf(__('%s bytes', 'updraftplus').' - '.__('recommended', 'updraftplus'), '2048') ?></option>
|
506 |
+
<option value="4096"><?php echo sprintf(__('%s bits', 'updraftplus').' - '.__('slower, strongest', 'updraftplus'), '4096') ?></option>
|
507 |
+
</select>
|
508 |
+
</td>
|
509 |
+
</tr>
|
510 |
+
<tr class="updraft_debugrow">
|
511 |
+
<th style=""></th>
|
512 |
+
<td style="width:80%;">
|
513 |
+
<button type="button" class="button button-primary" id="updraftcentral_keycreate_go"><?php _e('Create', 'updraftplus') ?></button>
|
514 |
+
</td>
|
515 |
+
</tr>
|
516 |
+
</tbody>
|
517 |
+
</table>
|
518 |
+
</div>
|
519 |
+
<?php
|
520 |
+
return ob_get_clean();
|
521 |
+
}
|
522 |
|
523 |
+
private function create_log_markup(){
|
524 |
+
ob_start();
|
525 |
+
?>
|
526 |
+
<div id="updraftcentral_view_log_container">
|
527 |
+
<h4><?php _e('View recent UpdraftCentral log events', 'updraftplus') ?> -
|
528 |
+
<a href="#" id="updraftcentral_view_log"><?php _e('fetch...', 'updraftplus') ?></a>
|
529 |
+
</h4>
|
530 |
+
<pre id="updraftcentral_view_log_contents" style="padding: 0 4px;">
|
531 |
+
</pre>
|
532 |
+
</div>
|
533 |
+
<?php
|
534 |
+
return ob_get_clean();
|
535 |
+
}
|
536 |
+
|
537 |
+
public function debugtools_dashboard() {
|
538 |
+
?>
|
539 |
+
<h3><?php _e('UpdraftCentral (Remote Control)', 'updraftplus'); ?></h3>
|
540 |
+
<div id="updraftcentral_keys">
|
541 |
+
<?php echo $this->get_keys_table() ?>
|
542 |
+
<?php echo $this->create_key_markup() ?>
|
543 |
+
<?php echo $this->create_log_markup() ?>
|
544 |
+
</div>
|
545 |
+
<?php
|
546 |
}
|
547 |
|
548 |
}
|
@@ -279,6 +279,22 @@ class UpdraftPlus_RemoteControl_Commands extends UpdraftCentral_Commands {
|
|
279 |
return $this->_response($results);
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
public function get_fragment($fragment) {
|
283 |
|
284 |
if (false === ($updraftplus_admin = $this->_load_ud_admin()) || false === ($updraftplus = $this->_load_ud())) return $this->_generic_error_response('no_updraftplus');
|
@@ -298,6 +314,18 @@ class UpdraftPlus_RemoteControl_Commands extends UpdraftCentral_Commands {
|
|
298 |
$output = ob_get_contents();
|
299 |
ob_end_clean();
|
300 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
case 'backupnow_modal_contents':
|
302 |
$updraft_dir = $updraftplus->backups_dir_location();
|
303 |
if (!$updraftplus->really_is_writable($updraft_dir)) {
|
279 |
return $this->_response($results);
|
280 |
}
|
281 |
|
282 |
+
public function cloudfiles_newuser($data) {
|
283 |
+
|
284 |
+
global $updraftplus_addon_cloudfilesenhanced;
|
285 |
+
if (!is_a($updraftplus_addon_cloudfilesenhanced, 'UpdraftPlus_Addon_CloudFilesEnhanced')) {
|
286 |
+
$data = array('e' => 1, 'm' => sprintf(__('%s add-on not found', 'updraftplus'), 'Rackspace Cloud Files'));
|
287 |
+
} else {
|
288 |
+
$data = $updraftplus_addon_cloudfilesenhanced->create_api_user($data);
|
289 |
+
}
|
290 |
+
|
291 |
+
if ($data["e"] === 0) {
|
292 |
+
return $this->_response($data);
|
293 |
+
} else {
|
294 |
+
return $this->_generic_error_response("error", $data);
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
public function get_fragment($fragment) {
|
299 |
|
300 |
if (false === ($updraftplus_admin = $this->_load_ud_admin()) || false === ($updraftplus = $this->_load_ud())) return $this->_generic_error_response('no_updraftplus');
|
314 |
$output = ob_get_contents();
|
315 |
ob_end_clean();
|
316 |
break;
|
317 |
+
case 'cloudfiles_new_api_user_form':
|
318 |
+
global $updraftplus_addon_cloudfilesenhanced;
|
319 |
+
if (!is_a($updraftplus_addon_cloudfilesenhanced, 'UpdraftPlus_Addon_CloudFilesEnhanced')) {
|
320 |
+
$error = true;
|
321 |
+
$output = 'cloudfiles_addon_not_found';
|
322 |
+
} else {
|
323 |
+
$output = array(
|
324 |
+
'accounts' => $updraftplus_addon_cloudfilesenhanced->account_options(),
|
325 |
+
'regions' => $updraftplus_addon_cloudfilesenhanced->region_options(),
|
326 |
+
);
|
327 |
+
}
|
328 |
+
break;
|
329 |
case 'backupnow_modal_contents':
|
330 |
$updraft_dir = $updraftplus->backups_dir_location();
|
331 |
if (!$updraftplus->really_is_writable($updraft_dir)) {
|
@@ -558,7 +558,6 @@ class UpdraftPlus {
|
|
558 |
$logline .= (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? "Y" : "N";
|
559 |
}
|
560 |
|
561 |
-
// $w3oc = 'N';
|
562 |
if (0 === $this->current_resumption) {
|
563 |
$memlim = $this->memory_check_current();
|
564 |
if ($memlim<65 && $memlim>0) {
|
@@ -567,13 +566,6 @@ class UpdraftPlus {
|
|
567 |
if ($max_execution_time>0 && $max_execution_time<20) {
|
568 |
$this->log(sprintf(__('The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid backup failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)', 'updraftplus'), $max_execution_time, 90), 'warning', 'lowmaxexecutiontime');
|
569 |
}
|
570 |
-
// if (defined('W3TC') && W3TC == true && function_exists('w3_instance')) {
|
571 |
-
// $modules = w3_instance('W3_ModuleStatus');
|
572 |
-
// if ($modules->is_enabled('objectcache')) {
|
573 |
-
// $w3oc = 'Y';
|
574 |
-
// }
|
575 |
-
// }
|
576 |
-
// $logline .= " W3TC/ObjectCache: $w3oc";
|
577 |
|
578 |
}
|
579 |
|
@@ -774,19 +766,19 @@ class UpdraftPlus {
|
|
774 |
}
|
775 |
|
776 |
// $singletons : whether to upload a file that only has one chunk, or whether instead to return 1 in that case
|
777 |
-
public function chunked_upload($caller, $file, $cloudpath, $logname, $chunk_size, $uploaded_size, $singletons=false) {
|
778 |
|
779 |
$fullpath = $this->backups_dir_location().'/'.$file;
|
780 |
$orig_file_size = filesize($fullpath);
|
781 |
if ($uploaded_size >= $orig_file_size) return true;
|
782 |
|
783 |
$chunks = floor($orig_file_size / $chunk_size);
|
784 |
-
// There will be a remnant unless the file size was exactly on a
|
785 |
if ($orig_file_size % $chunk_size > 0) $chunks++;
|
786 |
|
787 |
$this->log("$logname upload: $file (chunks: $chunks, size: $chunk_size) -> $cloudpath ($uploaded_size)");
|
788 |
|
789 |
-
if (
|
790 |
return 1;
|
791 |
} elseif ($chunks < 2 && !$singletons) {
|
792 |
return 1;
|
@@ -799,43 +791,87 @@ class UpdraftPlus {
|
|
799 |
}
|
800 |
|
801 |
$errors_so_far = 0;
|
802 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
803 |
|
804 |
-
$upload_start = ($i-1)*$chunk_size;
|
805 |
-
// The file size minus one equals the byte offset of the final byte
|
806 |
-
$upload_end = min($i*$chunk_size-1, $orig_file_size-1);
|
807 |
// Don't forget the +1; otherwise the last byte is omitted
|
808 |
$upload_size = $upload_end - $upload_start + 1;
|
809 |
|
810 |
-
fseek($fp, $upload_start);
|
811 |
-
|
812 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
|
814 |
// Try again? (Just once - added in 1.12.6 (can make more sophisticated if there is a need))
|
815 |
if (is_wp_error($uploaded) && 'try_again' == $uploaded->get_error_code()) {
|
816 |
// Arbitrary wait
|
817 |
sleep(3);
|
818 |
$this->log("Re-trying after wait (to allow apparent inconsistency to clear)");
|
819 |
-
$uploaded = $caller->chunked_upload($file, $fp, $
|
820 |
}
|
821 |
|
822 |
// This is the only other supported case of a WP_Error - otherwise, a boolean must be returned
|
823 |
// Note that this is only allowed on the first chunk. The caller is responsible to remember its chunk size if it uses this facility.
|
824 |
-
if (1 == $
|
825 |
$this->log("Re-trying with new chunk size: ".$new_chunk_size);
|
826 |
-
return $this->chunked_upload($caller, $file, $cloudpath, $logname, $new_chunk_size, $uploaded_size, $singletons
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
827 |
}
|
828 |
|
829 |
if ($uploaded) {
|
830 |
-
$perc = round(100*(
|
831 |
-
|
832 |
-
// Implementations used a return value of (int)1 (rather than (bool)true) to suppress logging
|
833 |
$log_it = ($uploaded === 1) ? false : true;
|
834 |
-
$this->record_uploaded_chunk($perc, $
|
|
|
|
|
|
|
835 |
} else {
|
836 |
$errors_so_far++;
|
837 |
-
if ($errors_so_far>=3) { @fclose($fp); return false; }
|
838 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
}
|
840 |
|
841 |
@fclose($fp);
|
@@ -2607,7 +2643,7 @@ class UpdraftPlus {
|
|
2607 |
global $wpdb;
|
2608 |
$handle = $wpdb;
|
2609 |
}
|
2610 |
-
if (method_exists($handle, 'check_connection')) {
|
2611 |
if (!$handle->check_connection(false)) {
|
2612 |
if ($logit) $this->log("The database went away, and could not be reconnected to");
|
2613 |
# Almost certainly a no-op
|
@@ -2630,7 +2666,7 @@ class UpdraftPlus {
|
|
2630 |
|
2631 |
$db_connected = $this->check_db_connection(false, true, true);
|
2632 |
|
2633 |
-
$service =
|
2634 |
$shash = $service.'-'.md5($file);
|
2635 |
|
2636 |
$this->jobdata_set("uploaded_".$shash, 'yes');
|
@@ -3075,9 +3111,10 @@ class UpdraftPlus {
|
|
3075 |
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
3076 |
if (!is_array($opts)) $opts = array();
|
3077 |
if (!is_array($onedrive)) return $opts;
|
3078 |
-
$old_client_id =
|
3079 |
-
|
3080 |
-
|
|
|
3081 |
unset($opts['tokensecret']);
|
3082 |
unset($opts['ownername']);
|
3083 |
}
|
@@ -3396,42 +3433,45 @@ class UpdraftPlus {
|
|
3396 |
// This is used as a WordPress options filter
|
3397 |
public function construct_webdav_url($input) {
|
3398 |
|
3399 |
-
$
|
3400 |
-
|
3401 |
-
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
|
3408 |
-
|
3409 |
-
|
3410 |
-
|
3411 |
-
|
3412 |
-
|
3413 |
-
|
3414 |
-
|
3415 |
-
|
3416 |
-
|
3417 |
-
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
-
|
3422 |
-
|
3423 |
-
|
|
|
|
|
3424 |
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
3428 |
-
|
3429 |
-
|
3430 |
-
|
|
|
|
|
|
|
3431 |
}
|
3432 |
|
3433 |
-
// array_splice($input, 1);
|
3434 |
-
|
3435 |
return array('url' => $input['url']);
|
3436 |
}
|
3437 |
|
@@ -3497,7 +3537,11 @@ class UpdraftPlus {
|
|
3497 |
|
3498 |
private function url_start($urls, $url, $https = false) {
|
3499 |
$proto = ($https) ? 'https' : 'http';
|
3500 |
-
|
|
|
|
|
|
|
|
|
3501 |
}
|
3502 |
|
3503 |
private function url_end($urls, $url, $https = false) {
|
@@ -3515,7 +3559,7 @@ class UpdraftPlus {
|
|
3515 |
$rad = rand(0, 8);
|
3516 |
switch ($rad) {
|
3517 |
case 0:
|
3518 |
-
return $this->url_start($urls,'updraftplus.com').__("Want more features or paid, guaranteed support? Check out UpdraftPlus.Com", 'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3519 |
break;
|
3520 |
case 1:
|
3521 |
$wplang = get_locale();
|
@@ -3535,9 +3579,9 @@ class UpdraftPlus {
|
|
3535 |
break;
|
3536 |
case 5:
|
3537 |
if (!defined('UPDRAFTPLUS_NOADS_B')) {
|
3538 |
-
return $this->url_start($urls,'updraftplus.com').__("Need even more features and support? Check out UpdraftPlus Premium",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3539 |
} else {
|
3540 |
-
return "Thanks for being an UpdraftPlus premium user. Keep visiting ".$this->url_start($urls,'updraftplus.com')."updraftplus.com".$this->url_end($urls,'updraftplus.com')." to see what's going on.";
|
3541 |
}
|
3542 |
break;
|
3543 |
case 6:
|
@@ -3545,7 +3589,7 @@ class UpdraftPlus {
|
|
3545 |
return __("Subscribe to the UpdraftPlus blog to get up-to-date news and offers",'updraftplus')." - ".$this->url_start($urls,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end($urls,'updraftplus.com/news/').' - '.$this->url_start($urls,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end($urls,'feeds.feedburner.com/UpdraftPlus');
|
3546 |
break;
|
3547 |
case 7:
|
3548 |
-
return $this->url_start($urls,'updraftplus.com').__("Check out UpdraftPlus.Com for help, add-ons and support",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3549 |
break;
|
3550 |
// case 8:
|
3551 |
// return __("Want to say thank-you for UpdraftPlus?",'updraftplus').$this->url_start($urls,'updraftplus.com/shop/', true)." ".__("Please buy our very cheap 'no adverts' add-on.",'updraftplus').$this->url_end($urls,'updraftplus.com/shop/', true);
|
558 |
$logline .= (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? "Y" : "N";
|
559 |
}
|
560 |
|
|
|
561 |
if (0 === $this->current_resumption) {
|
562 |
$memlim = $this->memory_check_current();
|
563 |
if ($memlim<65 && $memlim>0) {
|
566 |
if ($max_execution_time>0 && $max_execution_time<20) {
|
567 |
$this->log(sprintf(__('The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid backup failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)', 'updraftplus'), $max_execution_time, 90), 'warning', 'lowmaxexecutiontime');
|
568 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
569 |
|
570 |
}
|
571 |
|
766 |
}
|
767 |
|
768 |
// $singletons : whether to upload a file that only has one chunk, or whether instead to return 1 in that case
|
769 |
+
public function chunked_upload($caller, $file, $cloudpath, $logname, $chunk_size, $uploaded_size, $singletons = false) {
|
770 |
|
771 |
$fullpath = $this->backups_dir_location().'/'.$file;
|
772 |
$orig_file_size = filesize($fullpath);
|
773 |
if ($uploaded_size >= $orig_file_size) return true;
|
774 |
|
775 |
$chunks = floor($orig_file_size / $chunk_size);
|
776 |
+
// There will be a remnant unless the file size was exactly on a chunk boundary
|
777 |
if ($orig_file_size % $chunk_size > 0) $chunks++;
|
778 |
|
779 |
$this->log("$logname upload: $file (chunks: $chunks, size: $chunk_size) -> $cloudpath ($uploaded_size)");
|
780 |
|
781 |
+
if (0 == $chunks) {
|
782 |
return 1;
|
783 |
} elseif ($chunks < 2 && !$singletons) {
|
784 |
return 1;
|
791 |
}
|
792 |
|
793 |
$errors_so_far = 0;
|
794 |
+
$upload_start = 0;
|
795 |
+
$upload_end = -1;
|
796 |
+
$chunk_index = 1;
|
797 |
+
// The file size minus one equals the byte offset of the final byte
|
798 |
+
$upload_end = min($chunk_size - 1, $orig_file_size - 1);
|
799 |
+
|
800 |
+
while ($upload_start < $orig_file_size) {
|
801 |
|
|
|
|
|
|
|
802 |
// Don't forget the +1; otherwise the last byte is omitted
|
803 |
$upload_size = $upload_end - $upload_start + 1;
|
804 |
|
805 |
+
if ($upload_start) fseek($fp, $upload_start);
|
806 |
+
|
807 |
+
/*
|
808 |
+
* Valid return values for $uploaded are many, as the possibilities have grown over time.
|
809 |
+
* This could be cleaned up; but, it works, and it's not hugely complex.
|
810 |
+
*
|
811 |
+
* WP_Error : an error occured. The only permissible codes are: reduce_chunk_size (only on the first chunk), try_again
|
812 |
+
* (bool)true : What was requested was done
|
813 |
+
* (int)1 : What was requested was done, but do not log anything
|
814 |
+
* (bool)false : There was an error
|
815 |
+
* (Object) : Properties:
|
816 |
+
* (bool)log: (bool) - if absent, defaults to true
|
817 |
+
* (int)new_chunk_size: advisory amount for the chunk size for future chunks
|
818 |
+
* NOT IMPLEMENTED: (int)bytes_uploaded: Actual number of bytes uploaded (needs to be positive - o/w, should return an error instead)
|
819 |
+
*
|
820 |
+
* N.B. Consumers should consult $fp and $upload_start to get data; they should not re-calculate from $chunk_index, which is not an indicator of file position.
|
821 |
+
*/
|
822 |
+
$uploaded = $caller->chunked_upload($file, $fp, $chunk_index, $upload_size, $upload_start, $upload_end, $orig_file_size);
|
823 |
|
824 |
// Try again? (Just once - added in 1.12.6 (can make more sophisticated if there is a need))
|
825 |
if (is_wp_error($uploaded) && 'try_again' == $uploaded->get_error_code()) {
|
826 |
// Arbitrary wait
|
827 |
sleep(3);
|
828 |
$this->log("Re-trying after wait (to allow apparent inconsistency to clear)");
|
829 |
+
$uploaded = $caller->chunked_upload($file, $fp, $chunk_index, $upload_size, $upload_start, $upload_end, $orig_file_size);
|
830 |
}
|
831 |
|
832 |
// This is the only other supported case of a WP_Error - otherwise, a boolean must be returned
|
833 |
// Note that this is only allowed on the first chunk. The caller is responsible to remember its chunk size if it uses this facility.
|
834 |
+
if (1 == $chunk_index && is_wp_error($uploaded) && 'reduce_chunk_size' == $uploaded->get_error_code() && false != ($new_chunk_size = $uploaded->get_error_data()) && is_numeric($new_chunk_size)) {
|
835 |
$this->log("Re-trying with new chunk size: ".$new_chunk_size);
|
836 |
+
return $this->chunked_upload($caller, $file, $cloudpath, $logname, $new_chunk_size, $uploaded_size, $singletons);
|
837 |
+
}
|
838 |
+
|
839 |
+
$uploaded_amount = $chunk_size;
|
840 |
+
|
841 |
+
/*
|
842 |
+
// Not using this approach for now. Instead, going to allow the consumers to increase the next chunk size
|
843 |
+
if (is_object($uploaded) && isset($uploaded->bytes_uploaded)) {
|
844 |
+
if (!$uploaded->bytes_uploaded) {
|
845 |
+
$uploaded = false;
|
846 |
+
} else {
|
847 |
+
$uploaded_amount = $uploaded->bytes_uploaded;
|
848 |
+
$uploaded = (!isset($uploaded->log) || $uploaded->log) ? true : 1;
|
849 |
+
}
|
850 |
+
}
|
851 |
+
*/
|
852 |
+
if (is_object($uploaded) && isset($uploaded->new_chunk_size)) {
|
853 |
+
if ($uploaded->new_chunk_size >= 1048576) $new_chunk_size = $uploaded->new_chunk_size;
|
854 |
+
$uploaded = (!isset($uploaded->log) || $uploaded->log) ? true : 1;
|
855 |
}
|
856 |
|
857 |
if ($uploaded) {
|
858 |
+
$perc = round(100*($upload_end + 1)/max($orig_file_size, 1), 1);
|
859 |
+
// Consumers use a return value of (int)1 (rather than (bool)true) to suppress logging
|
|
|
860 |
$log_it = ($uploaded === 1) ? false : true;
|
861 |
+
$this->record_uploaded_chunk($perc, $chunk_index, $fullpath, $log_it);
|
862 |
+
|
863 |
+
// $uploaded_bytes = $upload_end + 1;
|
864 |
+
|
865 |
} else {
|
866 |
$errors_so_far++;
|
867 |
+
if ($errors_so_far >= 3) { @fclose($fp); return false; }
|
868 |
}
|
869 |
+
|
870 |
+
$chunk_index++;
|
871 |
+
$upload_start = $upload_end + 1;
|
872 |
+
$upload_end += isset($new_chunk_size) ? $uploaded_amount + $new_chunk_size - $chunk_size : $uploaded_amount;
|
873 |
+
$upload_end = min($upload_end, $orig_file_size - 1);
|
874 |
+
|
875 |
}
|
876 |
|
877 |
@fclose($fp);
|
2643 |
global $wpdb;
|
2644 |
$handle = $wpdb;
|
2645 |
}
|
2646 |
+
if (method_exists($handle, 'check_connection') && (!defined('UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS') || !UPDRAFTPLUS_SUPPRESS_CONNECTION_CHECKS)) {
|
2647 |
if (!$handle->check_connection(false)) {
|
2648 |
if ($logit) $this->log("The database went away, and could not be reconnected to");
|
2649 |
# Almost certainly a no-op
|
2666 |
|
2667 |
$db_connected = $this->check_db_connection(false, true, true);
|
2668 |
|
2669 |
+
$service = empty($updraftplus_backup->current_service) ? '' : $updraftplus_backup->current_service;
|
2670 |
$shash = $service.'-'.md5($file);
|
2671 |
|
2672 |
$this->jobdata_set("uploaded_".$shash, 'yes');
|
3111 |
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
3112 |
if (!is_array($opts)) $opts = array();
|
3113 |
if (!is_array($onedrive)) return $opts;
|
3114 |
+
$old_client_id = empty($opts['clientid']) ? '' : $opts['clientid'];
|
3115 |
+
$now_client_id = empty($onedrive['clientid']) ? '' : $onedrive['clientid'];
|
3116 |
+
if (!empty($opts['refresh_token']) && $old_client_id != $now_client_id) {
|
3117 |
+
unset($opts['refresh_token']);
|
3118 |
unset($opts['tokensecret']);
|
3119 |
unset($opts['ownername']);
|
3120 |
}
|
3433 |
// This is used as a WordPress options filter
|
3434 |
public function construct_webdav_url($input) {
|
3435 |
|
3436 |
+
if (isset($input['webdav'])) {
|
3437 |
+
|
3438 |
+
$url = null;
|
3439 |
+
$slash = "/";
|
3440 |
+
$host = "";
|
3441 |
+
$colon = "";
|
3442 |
+
$port_colon = "";
|
3443 |
+
|
3444 |
+
if ((80 == $input['port'] && 'webdav' == $input['webdav']) || (443 == $input['port'] && 'webdavs' == $input['webdav'])) {
|
3445 |
+
$input['port'] = '';
|
3446 |
+
}
|
3447 |
+
|
3448 |
+
if ('/' == substr($input['path'], 0, 1)){
|
3449 |
+
$slash = "";
|
3450 |
+
}
|
3451 |
+
|
3452 |
+
if (false === strpos($input['host'],"@")){
|
3453 |
+
$host = "@";
|
3454 |
+
}
|
3455 |
+
|
3456 |
+
if ('' != $input['user'] && '' != $input['pass']){
|
3457 |
+
$colon = ":";
|
3458 |
+
}
|
3459 |
+
|
3460 |
+
if ('' != $input['host'] && '' != $input['port']){
|
3461 |
+
$port_colon = ":";
|
3462 |
+
}
|
3463 |
|
3464 |
+
if (!empty($input['url']) && 'http' == strtolower(substr($input['url'], 0, 4))) {
|
3465 |
+
$input['url'] = 'webdav'.substr($input['url'], 4);
|
3466 |
+
} elseif ('' != $input['user'] && '' != $input['pass']) {
|
3467 |
+
$input['url'] = $input['webdav'] . urlencode($input['user']) . $colon . urlencode($input['pass']) . $host . urlencode($input['host']) . $port_colon . $input['port'] . $slash . $input['path'];
|
3468 |
+
} else {
|
3469 |
+
$input['url'] = $input['webdav'] . urlencode($input['host']) . $port_colon . $input['port'] . $slash . $input['path'];
|
3470 |
+
}
|
3471 |
+
|
3472 |
+
// array_splice($input, 1);
|
3473 |
}
|
3474 |
|
|
|
|
|
3475 |
return array('url' => $input['url']);
|
3476 |
}
|
3477 |
|
3537 |
|
3538 |
private function url_start($urls, $url, $https = false) {
|
3539 |
$proto = ($https) ? 'https' : 'http';
|
3540 |
+
if (strpos($url, 'updraftplus.com') !== false){
|
3541 |
+
return ($urls) ? "<a href=".apply_filters('updraftplus_com_link',$proto.'://'.$url).">" : "";
|
3542 |
+
}else{
|
3543 |
+
return ($urls) ? "<a href=\"$proto://$url\">" : "";
|
3544 |
+
}
|
3545 |
}
|
3546 |
|
3547 |
private function url_end($urls, $url, $https = false) {
|
3559 |
$rad = rand(0, 8);
|
3560 |
switch ($rad) {
|
3561 |
case 0:
|
3562 |
+
return $this->url_start($urls,'updraftplus.com/').__("Want more features or paid, guaranteed support? Check out UpdraftPlus.Com", 'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3563 |
break;
|
3564 |
case 1:
|
3565 |
$wplang = get_locale();
|
3579 |
break;
|
3580 |
case 5:
|
3581 |
if (!defined('UPDRAFTPLUS_NOADS_B')) {
|
3582 |
+
return $this->url_start($urls,'updraftplus.com/').__("Need even more features and support? Check out UpdraftPlus Premium",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3583 |
} else {
|
3584 |
+
return "Thanks for being an UpdraftPlus premium user. Keep visiting ".$this->url_start($urls,'updraftplus.com/')."updraftplus.com".$this->url_end($urls,'updraftplus.com')." to see what's going on.";
|
3585 |
}
|
3586 |
break;
|
3587 |
case 6:
|
3589 |
return __("Subscribe to the UpdraftPlus blog to get up-to-date news and offers",'updraftplus')." - ".$this->url_start($urls,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end($urls,'updraftplus.com/news/').' - '.$this->url_start($urls,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end($urls,'feeds.feedburner.com/UpdraftPlus');
|
3590 |
break;
|
3591 |
case 7:
|
3592 |
+
return $this->url_start($urls,'updraftplus.com/').__("Check out UpdraftPlus.Com for help, add-ons and support",'updraftplus').$this->url_end($urls,'updraftplus.com');
|
3593 |
break;
|
3594 |
// case 8:
|
3595 |
// return __("Want to say thank-you for UpdraftPlus?",'updraftplus').$this->url_start($urls,'updraftplus.com/shop/', true)." ".__("Please buy our very cheap 'no adverts' add-on.",'updraftplus').$this->url_end($urls,'updraftplus.com/shop/', true);
|
@@ -328,6 +328,11 @@ a .udp-logo {
|
|
328 |
min-width: 300px;
|
329 |
vertical-align: bottom;
|
330 |
}
|
|
|
|
|
|
|
|
|
|
|
331 |
.updraftplus-morefiles-row-delete {
|
332 |
cursor: pointer;
|
333 |
color: red;
|
@@ -755,17 +760,6 @@ input #backupnow_includefiles_moreoptions {
|
|
755 |
max-width: 600px;
|
756 |
}
|
757 |
|
758 |
-
.immediate-run {
|
759 |
-
clear: left;
|
760 |
-
padding-top: 20px;
|
761 |
-
max-width: 600px;
|
762 |
-
margin:0;
|
763 |
-
}
|
764 |
-
|
765 |
-
.debug-table {
|
766 |
-
border: none;
|
767 |
-
}
|
768 |
-
|
769 |
.delete-old-directories {
|
770 |
padding: 8px;
|
771 |
padding-bottom: 12px;
|
328 |
min-width: 300px;
|
329 |
vertical-align: bottom;
|
330 |
}
|
331 |
+
|
332 |
+
#updraft_webdav_host_error {
|
333 |
+
color: red;
|
334 |
+
}
|
335 |
+
|
336 |
.updraftplus-morefiles-row-delete {
|
337 |
cursor: pointer;
|
338 |
color: red;
|
760 |
max-width: 600px;
|
761 |
}
|
762 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
763 |
.delete-old-directories {
|
764 |
padding: 8px;
|
765 |
padding-bottom: 12px;
|
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
// This is a compatibility library, using Amazon's official PHP SDK (PHP 5.3.3+), but providing the methods of Donovan Schönknecht's S3.php library (which we used to always use) - but we've only cared about making code-paths in UpdraftPlus work, so be careful if re-
|
4 |
|
5 |
/**
|
6 |
*
|
7 |
-
* Copyright (c) 2012-5, David Anderson (
|
8 |
* Portions copyright (c) 2011, Donovan Schönknecht. All rights reserved.
|
9 |
*
|
10 |
* Redistribution and use in source and binary forms, with or without
|
1 |
<?php
|
2 |
|
3 |
+
// This is a compatibility library, using Amazon's official PHP SDK (PHP 5.3.3+), but providing the methods of Donovan Schönknecht's S3.php library (which we used to always use) - but we've only cared about making code-paths in UpdraftPlus work, so be careful if re-deploying this in another project. And, we have a few bits of UpdraftPlus-specific code below, for logging.
|
4 |
|
5 |
/**
|
6 |
*
|
7 |
+
* Copyright (c) 2012-5, David Anderson (https://www.simbahosting.co.uk). All rights reserved.
|
8 |
* Portions copyright (c) 2011, Donovan Schönknecht. All rights reserved.
|
9 |
*
|
10 |
* Redistribution and use in source and binary forms, with or without
|
@@ -1131,6 +1131,11 @@ jQuery(document).ready(function($){
|
|
1131 |
if (updraft_webdav_settings['host'].indexOf("@") >= 0 || updraft_webdav_settings['host'] === "" ) {
|
1132 |
host = "";
|
1133 |
}
|
|
|
|
|
|
|
|
|
|
|
1134 |
|
1135 |
if (updraft_webdav_settings['path'].indexOf("/") == 0 || updraft_webdav_settings['path'] === "" ) {
|
1136 |
slash = "";
|
@@ -1144,7 +1149,7 @@ jQuery(document).ready(function($){
|
|
1144 |
colon_port = "";
|
1145 |
}
|
1146 |
|
1147 |
-
updraft_webdav_url = updraft_webdav_settings['webdav'] + updraft_webdav_settings['user'] + colon + updraft_webdav_settings['pass'] + host +
|
1148 |
|
1149 |
$('#updraft_webdav_settings_url').val(updraft_webdav_url);
|
1150 |
});
|
@@ -1284,7 +1289,7 @@ jQuery(document).ready(function($){
|
|
1284 |
data.mothership_firewalled = jQuery('#updraftcentral_keycreate_mothership_firewalled').is(':checked') ? 1 : 0;
|
1285 |
data.where_send = where_send;
|
1286 |
|
1287 |
-
jQuery('#updraftcentral_keys').block({ message: '<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.
|
1288 |
|
1289 |
try {
|
1290 |
jQuery.post(ajaxurl, data, function(response) {
|
@@ -2254,9 +2259,8 @@ jQuery(document).ready(function($){
|
|
2254 |
|
2255 |
});
|
2256 |
|
2257 |
-
// Save settings via AJAX
|
2258 |
jQuery(document).ready(function($){
|
2259 |
-
|
2260 |
// Pre-load the image so that it doesn't jerk when first used
|
2261 |
var my_image = new Image();
|
2262 |
my_image.src = updraftlion.ud_url+'/images/udlogo-rotating.gif';
|
@@ -2273,21 +2277,7 @@ jQuery(document).ready(function($){
|
|
2273 |
e.preventDefault();
|
2274 |
$.blockUI({ message: '<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+'</div>'});
|
2275 |
|
2276 |
-
|
2277 |
-
var form_data = $("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize();
|
2278 |
-
|
2279 |
-
//include unchecked checkboxes. user filter to only include unchecked boxes.
|
2280 |
-
$.each($('#updraft-navtab-settings-content form input[type=checkbox]')
|
2281 |
-
.filter(function(idx){
|
2282 |
-
return $(this).prop('checked') == false
|
2283 |
-
}),
|
2284 |
-
function(idx, el){
|
2285 |
-
//attach matched element names to the form_data with chosen value.
|
2286 |
-
var empty_val = '0';
|
2287 |
-
form_data += '&' + $(el).attr('name') + '=' + empty_val;
|
2288 |
-
}
|
2289 |
-
);
|
2290 |
-
|
2291 |
// POST the settings back to the AJAX handler
|
2292 |
$.post(ajaxurl, {
|
2293 |
action: 'updraft_savesettings',
|
@@ -2296,73 +2286,193 @@ jQuery(document).ready(function($){
|
|
2296 |
nonce: updraftplus_settings_nonce
|
2297 |
}, function(response) {
|
2298 |
// Add page updates etc based on response
|
|
|
2299 |
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
// var debug = resp.changed.updraft_debug_mode;
|
2305 |
-
|
2306 |
-
// If backup dir is not writable, change the text, and grey out the 'Backup Now' button
|
2307 |
-
var backup_dir_writable = resp.backup_dir.writable;
|
2308 |
-
var backup_dir_message = resp.backup_dir.message;
|
2309 |
-
var backup_button_title = resp.backup_dir.button_title;
|
2310 |
-
} catch (e) {
|
2311 |
-
console.log(e);
|
2312 |
-
console.log(response);
|
2313 |
-
alert(updraftlion.jsonnotunderstood);
|
2314 |
-
$.unblockUI();
|
2315 |
-
return;
|
2316 |
-
}
|
2317 |
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2334 |
}
|
2335 |
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
|
|
|
|
|
|
|
|
|
|
2342 |
} else {
|
2343 |
-
|
2344 |
-
$('#updraft-backupnow-button').removeAttr('title');
|
2345 |
-
//$('.backupdirrow').hide();
|
2346 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2347 |
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
$(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2356 |
|
2357 |
-
|
2358 |
-
|
2359 |
-
scrollTop: $("#updraft-wrap").offset().top
|
2360 |
-
}, 1000);
|
2361 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2362 |
$.unblockUI();
|
2363 |
-
|
2364 |
-
}
|
2365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2366 |
});
|
2367 |
|
2368 |
// https://github.com/richadams/jquery-tripleclick/
|
1131 |
if (updraft_webdav_settings['host'].indexOf("@") >= 0 || updraft_webdav_settings['host'] === "" ) {
|
1132 |
host = "";
|
1133 |
}
|
1134 |
+
if (updraft_webdav_settings['host'].indexOf("/") >= 0 ) {
|
1135 |
+
$('#updraft_webdav_host_error').show();
|
1136 |
+
} else {
|
1137 |
+
$('#updraft_webdav_host_error').hide();
|
1138 |
+
}
|
1139 |
|
1140 |
if (updraft_webdav_settings['path'].indexOf("/") == 0 || updraft_webdav_settings['path'] === "" ) {
|
1141 |
slash = "";
|
1149 |
colon_port = "";
|
1150 |
}
|
1151 |
|
1152 |
+
updraft_webdav_url = updraft_webdav_settings['webdav'] + updraft_webdav_settings['user'] + colon + updraft_webdav_settings['pass'] + host +encodeURIComponent(updraft_webdav_settings['host']) + colon_port + updraft_webdav_settings['port'] + slash + updraft_webdav_settings['path'];
|
1153 |
|
1154 |
$('#updraft_webdav_settings_url').val(updraft_webdav_url);
|
1155 |
});
|
1289 |
data.mothership_firewalled = jQuery('#updraftcentral_keycreate_mothership_firewalled').is(':checked') ? 1 : 0;
|
1290 |
data.where_send = where_send;
|
1291 |
|
1292 |
+
jQuery('#updraftcentral_keys').block({ message: '<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+'</div>'});
|
1293 |
|
1294 |
try {
|
1295 |
jQuery.post(ajaxurl, data, function(response) {
|
2259 |
|
2260 |
});
|
2261 |
|
2262 |
+
// Save/Export/Import settings via AJAX
|
2263 |
jQuery(document).ready(function($){
|
|
|
2264 |
// Pre-load the image so that it doesn't jerk when first used
|
2265 |
var my_image = new Image();
|
2266 |
my_image.src = updraftlion.ud_url+'/images/udlogo-rotating.gif';
|
2277 |
e.preventDefault();
|
2278 |
$.blockUI({ message: '<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+'</div>'});
|
2279 |
|
2280 |
+
var form_data = gather_updraft_settings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2281 |
// POST the settings back to the AJAX handler
|
2282 |
$.post(ajaxurl, {
|
2283 |
action: 'updraft_savesettings',
|
2286 |
nonce: updraftplus_settings_nonce
|
2287 |
}, function(response) {
|
2288 |
// Add page updates etc based on response
|
2289 |
+ |