UpdraftPlus WordPress Backup Plugin - Version 1.9.15

Version Description

  • 2014/09/06 =

  • FEATURE: New search/replace expert tool (Premium)

  • TWEAK: UI has been simplified - see: http://updraftplus.com/gentle-re-design/

  • TWEAK: "Backup Now" now avoids the WordPress scheduler - thus meaning it can work on sites where the WordPress scheduler is broken (e.g. Heart Internet)

  • TWEAK: Make sure that server HTTP-level errors are shown directly to the user at the 'Processing files...' stage of a restore

  • TWEAK: Amend SQL which prevented options/sitemeta tables backing up at full speed on large sites

  • TWEAK: Dropbox will now display some error messages more prominently, where relevant

  • TWEAK: Dropbox account user's name is stored when you authorise

  • TWEAK: Show link to FAQ if user's zip upload is corrupt

  • TWEAK: Work around annoying Google Drive issue whereby Google's end sometimes returns an incomplete list of folders

  • TWEAK: Interpret time in imported backup sets as being in destination WP install's timezone

  • TWEAK: Auto-correct Dropbox folder configuration if the user erroneously enters a full URL instead of a folder path

  • TWEAK: Bitcasa back-end now checks account quota and logs a warning if it looks like it will be exceeded

  • TWEAK: Email reports created by UpdraftPlus (free) now include the latest blog headlines from updraftplus.com

  • TWEAK: Make sure all relevant restoration options in restore dialogue are shown (works around Firefox issue upon page reload/navigation)

  • FIX: Reporting add-on could mis-display number of warnings when saying "X errors, Y warnings".

  • TRANSLATION: New Tagalog translation (thanks to Kristen Macasero)

Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 UpdraftPlus WordPress Backup Plugin
Version 1.9.15
Comparing to
See all releases

Code changes from version 1.9.13 to 1.9.15

admin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if (!defined ('ABSPATH')) die('No direct access allowed');
4
 
5
- // For the purposes of improving site performance (don't load in 10s of Kilobytes of un-needed code on every page load), admin-area code is being progressively moved here.
6
 
7
  // This gets called in admin_menu, earlier than admin_init
8
 
@@ -13,11 +13,11 @@ class UpdraftPlus_Admin {
13
 
14
  public $logged = array();
15
 
16
- function __construct() {
17
  $this->admin_init();
18
  }
19
 
20
- function admin_init() {
21
 
22
  add_action('core_upgrade_preamble', array($this, 'core_upgrade_preamble'));
23
  add_action('admin_action_upgrade-plugin', array($this, 'admin_action_upgrade_pluginortheme'));
@@ -50,8 +50,11 @@ class UpdraftPlus_Admin {
50
  if (!empty($clientid) && empty($token)) add_action('all_admin_notices', array($this,'show_admin_warning_googledrive'));
51
  }
52
 
53
- if (UpdraftPlus_Options::user_can_manage() && ('dropbox' === $service || is_array($service) && in_array('dropbox', $service)) && UpdraftPlus_Options::get_updraft_option('updraft_dropboxtk_request_token','') == '') {
54
- add_action('all_admin_notices', array($this,'show_admin_warning_dropbox') );
 
 
 
55
  }
56
 
57
  if (UpdraftPlus_Options::user_can_manage() && ('bitcasa' === $service || is_array($service) && in_array('bitcasa', $service))) {
@@ -74,6 +77,10 @@ class UpdraftPlus_Admin {
74
  add_action('all_admin_notices', array($this, 'show_admin_debug_warning'));
75
  }
76
 
 
 
 
 
77
  # Avoid false positives, by attempting to raise the limit (as happens when we actually do a backup)
78
  @set_time_limit(900);
79
  $max_execution_time = (int)@ini_get('max_execution_time');
@@ -106,9 +113,9 @@ class UpdraftPlus_Admin {
106
  wp_enqueue_script('jquery');
107
  # No plupload until 3.3
108
  # Put in footer, to make sure that jQuery loads first
109
- wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog'), '35', true);
110
  } else {
111
- wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog', 'plupload-all'), '35');
112
  }
113
 
114
  wp_localize_script( 'updraftplus-admin-ui', 'updraftlion', array(
@@ -270,6 +277,22 @@ class UpdraftPlus_Admin {
270
  <?php } ?>
271
  </script>
272
  <style type="text/css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  .updraftplus-morefiles-row-delete {
274
  cursor: pointer;
275
  color: red;
@@ -389,6 +412,10 @@ class UpdraftPlus_Admin {
389
  echo '<div class="updraftmessage '.$class.'">'."<p>$message</p></div>";
390
  }
391
 
 
 
 
 
392
  public function show_admin_warning_execution_time() {
393
  $this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.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'), (int)@ini_get('max_execution_time'), 90));
394
  }
@@ -1008,13 +1035,21 @@ class UpdraftPlus_Admin {
1008
  echo '<strong>',__('Schedule backup','updraftplus').':</strong> ';
1009
  $backupnow_nocloud = (empty($_REQUEST['backupnow_nocloud'])) ? false : true;
1010
  $event = (!empty($_REQUEST['backupnow_nofiles'])) ? 'updraft_backupnow_backup_database' : ((!empty($_REQUEST['backupnow_nodb'])) ? 'updraft_backupnow_backup' : 'updraft_backupnow_backup_all');
1011
- if (wp_schedule_single_event(time()+5, $event, array($backupnow_nocloud)) === false) {
1012
- $updraftplus->log("A backup run failed to schedule");
1013
- echo __("Failed.",'updraftplus')."</div>";
1014
- } else {
1015
- echo htmlspecialchars(__('OK. You should soon see activity in the "Last log message" field below.','updraftplus'))." <a href=\"http://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/\"><br>".__('Nothing happening? Follow this link for help.','updraftplus')."</a></div>";
1016
- $updraftplus->log("A backup run has been scheduled");
1017
- }
 
 
 
 
 
 
 
 
1018
 
1019
  } elseif (isset($_GET['subaction']) && 'lastbackup' == $_GET['subaction']) {
1020
  echo $this->last_backup_html();
@@ -1060,7 +1095,7 @@ class UpdraftPlus_Admin {
1060
  $backup_history = (is_array($backup_history)) ? $backup_history : array();
1061
  $output = $this->existing_backup_table($backup_history);
1062
 
1063
- if (is_array($messages) && !empty($messages)) {
1064
  $noutput = '<div style="margin-left: 100px; margin-top: 10px;"><ul style="list-style: disc inside;">';
1065
  foreach ($messages as $msg) {
1066
  $noutput .= '<li>'.(($msg['desc']) ? $msg['desc'].': ' : '').'<em>'.$msg['message'].'</em></li>';
@@ -1174,7 +1209,7 @@ class UpdraftPlus_Admin {
1174
  return $response;
1175
  }
1176
 
1177
- function analyse_db_file($timestamp, $res) {
1178
 
1179
  $mess = array(); $warn = array(); $err = array();
1180
 
@@ -1376,6 +1411,13 @@ CREATE TABLE $wpdb->signups (
1376
  }
1377
 
1378
  private function gzopen_for_read($file, &$warn, &$err) {
 
 
 
 
 
 
 
1379
  if (false === ($dbhandle = gzopen($file, 'r'))) return false;
1380
  if (false === ($bytes = gzread($dbhandle, 3))) return false;
1381
  # Double-gzipped?
@@ -1647,7 +1689,7 @@ CREATE TABLE $wpdb->signups (
1647
  /*
1648
  we use request here because the initial restore is triggered by a POSTed form. we then may need to obtain credentials
1649
  for the WP_Filesystem. to do this WP outputs a form, but we don't pass our parameters via that. So the values are
1650
- passed back in as GET parameters. REQUEST covers both GET and POST so this logic works.
1651
  */
1652
  if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'updraft_restore' && isset($_REQUEST['backup_timestamp'])) {
1653
  $backup_success = $this->restore_backup($_REQUEST['backup_timestamp']);
@@ -1682,22 +1724,29 @@ CREATE TABLE $wpdb->signups (
1682
  return;
1683
  }
1684
 
 
 
 
 
 
 
 
1685
  if(isset($_GET['error'])) $this->show_admin_warning(htmlspecialchars($_GET['error']), 'error');
1686
  if(isset($_GET['message'])) $this->show_admin_warning(htmlspecialchars($_GET['message']));
1687
 
1688
  if(isset($_GET['action']) && $_GET['action'] == 'updraft_create_backup_dir' && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {
1689
  $created = $this->create_backup_dir();
1690
  if(is_wp_error($created)) {
1691
- echo '<p>'.__('Backup directory could not be created','updraftplus').'...<br/>';
1692
  echo '<ul style="list-style: disc inside;">';
1693
  foreach ($created->get_error_messages() as $key => $msg) {
1694
  echo '<li>'.htmlspecialchars($msg).'</li>';
1695
  }
1696
  echo '</ul></p>';
1697
  } elseif ($created !== false) {
1698
- echo '<p>'.__('Backup directory successfully created.','updraftplus').'</p><br/>';
1699
  }
1700
- echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration','updraftplus').'</a>';
1701
  return;
1702
  }
1703
 
@@ -1705,11 +1754,11 @@ CREATE TABLE $wpdb->signups (
1705
 
1706
  echo '<div id="updraft_backup_started" class="updated fade" style="display:none; max-width: 800px; font-size:140%; line-height: 140%; padding:14px; clear:left;"></div>';
1707
 
1708
- // updraft_file_ids is not deleted
1709
- if(isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_all') { $updraftplus->boot_backup(true,true); }
1710
- elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_backup_debug_db') {
1711
  $updraftplus->boot_backup(false, true, false, true);
1712
- } elseif (isset($_POST['action']) && $_POST['action'] == 'updraft_wipesettings') {
1713
  $settings = $this->get_settings_keys();
1714
  foreach ($settings as $s) UpdraftPlus_Options::delete_updraft_option($s);
1715
 
@@ -1720,14 +1769,14 @@ CREATE TABLE $wpdb->signups (
1720
  $site_options = array('updraft_oneshotnonce');
1721
  foreach ($site_options as $s) delete_site_option($s);
1722
 
1723
- $this->show_admin_warning(__("Your settings have been wiped.",'updraftplus'));
1724
  }
1725
-
1726
  ?>
 
1727
  <div class="wrap" id="updraft-wrap">
1728
  <h1><?php echo $updraftplus->plugin_title; ?></h1>
1729
 
1730
- <?php _e('By UpdraftPlus.Com','updraftplus')?> ( <a href="http://updraftplus.com">UpdraftPlus.Com</a> | <a href="http://updraftplus.com/news/"><?php _e('News','updraftplus');?></a> | <?php if (!defined('UPDRAFTPLUS_NOADS_A')) { ?><a href="http://updraftplus.com/shop/"><?php _e("Premium",'updraftplus');?></a> | <?php } ?><a href="http://updraftplus.com/support/"><?php _e("Support",'updraftplus');?></a> | <a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> | <?php if (1==0 && !defined('UPDRAFTPLUS_NOADS_A')) { ?><a href="http://wordshell.net">WordShell - WordPress command line</a> | <a href="http://david.dw-perspective.org.uk/donate"><?php _e('Donate','updraftplus');?></a> | <?php } ?><a href="http://updraftplus.com/support/frequently-asked-questions/">FAQs</a> | <a href="http://profiles.wordpress.org/davidanderson/"><?php _e('More plugins','updraftplus');?></a> ) <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
1731
  <br>
1732
 
1733
  <div id="updraft-hidethis">
@@ -1737,7 +1786,6 @@ CREATE TABLE $wpdb->signups (
1737
 
1738
  <?php
1739
  if(isset($_GET['updraft_restore_success'])) {
1740
-
1741
  echo "<div class=\"updated fade\" style=\"padding:8px;\"><strong>".__('Your backup has been restored.','updraftplus').'</strong> '.__('If your restore included files, then your old (themes, uploads, plugins, whatever) directories have been retained with "-old" appended to their name. Remove them when you are satisfied that the backup worked properly.')."</div>";
1742
  }
1743
 
@@ -1756,50 +1804,75 @@ CREATE TABLE $wpdb->signups (
1756
  }
1757
  ?>
1758
 
1759
- <h2 style="clear:left;"><?php _e('Existing Schedule And Backups','updraftplus');?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
1760
 
1761
  <div id="updraft-insert-admin-warning"></div>
1762
 
1763
- <table class="form-table" style="float:left; clear: both; width:605px;">
1764
  <noscript>
1765
  <tr>
1766
  <th><?php _e('JavaScript warning','updraftplus');?>:</th>
1767
  <td style="color:red"><?php _e('This admin interface uses JavaScript heavily. You either need to activate it within your browser, or to use a JavaScript-capable browser.','updraftplus');?></td>
1768
  </tr>
1769
  </noscript>
1770
- <?php
1771
- $updraft_dir = $updraftplus->backups_dir_location();
1772
- // UNIX timestamp
1773
- $next_scheduled_backup = wp_next_scheduled('updraft_backup');
1774
- if ($next_scheduled_backup) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1775
  // Convert to GMT
1776
- $next_scheduled_backup_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup);
1777
  // Convert to blog time zone
1778
- $next_scheduled_backup = get_date_from_gmt($next_scheduled_backup_gmt, 'D, F j, Y H:i');
1779
- } else {
1780
- $next_scheduled_backup = __('Nothing currently scheduled','updraftplus');
1781
- }
1782
-
1783
- $next_scheduled_backup_database = wp_next_scheduled('updraft_backup_database');
1784
- if (UpdraftPlus_Options::get_updraft_option('updraft_interval_database',UpdraftPlus_Options::get_updraft_option('updraft_interval')) == UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
1785
- $next_scheduled_backup_database = ('Nothing currently scheduled' == $next_scheduled_backup) ? $next_scheduled_backup : __("At the same time as the files backup", 'updraftplus');
1786
  } else {
1787
- if ($next_scheduled_backup_database) {
1788
- // Convert to GMT
1789
- $next_scheduled_backup_database_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup_database);
1790
- // Convert to blog time zone
1791
- $next_scheduled_backup_database = get_date_from_gmt($next_scheduled_backup_database_gmt, 'D, F j, Y H:i');
1792
- } else {
1793
- $next_scheduled_backup_database = __('Nothing currently scheduled','updraftplus');
1794
- }
1795
  }
1796
- $current_time = get_date_from_gmt(gmdate('Y-m-d H:i:s'), 'D, F j, Y H:i');
1797
-
1798
- $backup_disabled = ($updraftplus->really_is_writable($updraft_dir)) ? '' : 'disabled="disabled"';
1799
 
1800
- $last_backup_html = $this->last_backup_html();
1801
 
1802
- ?>
1803
 
1804
  <script>var lastbackup_laststatus = '<?php echo esc_js($last_backup_html);?>';</script>
1805
 
@@ -1808,9 +1881,9 @@ CREATE TABLE $wpdb->signups (
1808
  <td>
1809
  <table style="border: 0px; padding: 0px; margin: 0 10px 0 0;">
1810
  <tr>
1811
- <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Files','updraftplus'); ?>:</td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $next_scheduled_backup?></td>
1812
  </tr><tr>
1813
- <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Database','updraftplus');?>: </td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $next_scheduled_backup_database?></td>
1814
  </tr><tr>
1815
  <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Time now','updraftplus');?>: </td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $current_time?></td>
1816
  </table>
@@ -1822,25 +1895,14 @@ CREATE TABLE $wpdb->signups (
1822
  </tr>
1823
  </table>
1824
 
1825
- <div style="float:left; width:200px; margin-top: <?php echo (class_exists('UpdraftPlus_Addons_Migrator')) ? "20" : "0" ?>px;">
1826
- <div style="margin-bottom: 10px;">
1827
- <button type="button" <?php echo $backup_disabled ?> class="button-primary updraft-bigbutton" style="padding-top:2px;padding-bottom:2px;font-size:22px !important; min-height: 32px; min-width: 180px;" <?php if ($backup_disabled) echo 'title="'.esc_attr(__('This button is disabled because your backup directory is not writable (see the setting futher down the page).', 'updraftplus')).'" ';?> onclick="jQuery('#updraft-backupnow-modal').dialog('open');"><?php _e('Backup Now', 'updraftplus');?></button>
1828
- </div>
1829
- <div style="margin-bottom: 10px;">
1830
- <?php
1831
- $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
1832
- if (empty($backup_history)) {
1833
- $this->rebuild_backup_history();
1834
- $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
1835
- }
1836
- $backup_history = (is_array($backup_history))?$backup_history:array();
1837
- ?>
1838
- <input type="button" class="button-primary updraft-bigbutton" value="<?php _e('Restore','updraftplus');?>" style="padding-top:2px;padding-bottom:2px;font-size:22px !important; min-height: 32px; min-width: 180px;" onclick="jQuery('.download-backups').slideDown(); updraft_historytimertoggle(1); jQuery('html,body').animate({scrollTop: jQuery('#updraft_lastlogcontainer').offset().top},'slow');">
1839
- </div>
1840
- <div>
1841
- <button type="button" class="button-primary updraft-bigbutton" style="padding-top:2px;padding-bottom:2px;font-size:22px !important; min-height: 32px; min-width: 180px;" onclick="jQuery('#updraft-migrate-modal').dialog('open');"><?php _e('Clone/Migrate','updraftplus');?></button>
1842
- </div>
1843
- </div>
1844
 
1845
  <br style="clear:both" />
1846
  <table class="form-table">
@@ -1861,173 +1923,28 @@ CREATE TABLE $wpdb->signups (
1861
 
1862
  <tr>
1863
  <th><?php echo htmlspecialchars(__('Backups, logs & restoring','updraftplus')); ?>:</th>
1864
- <td><a id="updraft_showbackups" href="#" title="<?php _e('Press to see available backups','updraftplus');?>" onclick="jQuery('.download-backups').fadeToggle(); updraft_historytimertoggle(0); return false;"><?php echo sprintf(__('%d set(s) available', 'updraftplus'), count($backup_history)); ?></a></td>
1865
  </tr>
1866
  <?php
1867
- if (defined('UPDRAFTPLUS_EXPERIMENTAL_MISC') && UPDRAFTPLUS_EXPERIMENTAL_MISC == true) {
1868
- ?>
1869
- <tr>
1870
- <th><?php echo __('Latest UpdraftPlus.com news:', 'updraftplus'); ?></th>
1871
- <td>Blah blah blah. Move to right-hand col?</td>
1872
- </tr>
1873
- <?php } ?>
1874
-
1875
- </table>
1876
-
1877
- <table class="form-table">
1878
- <tr>
1879
- <td style="">&nbsp;</td><td class="download-backups" style="display:none; border: 2px dashed #aaa;">
1880
- <h2><?php echo __('Downloading and restoring', 'updraftplus'); ?></h2>
1881
- <p style="display:none; background-color:pink; padding:8px; margin:4px;border: 1px dotted;" id="ud-whitespace-warning">
1882
- <?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="http://updraftplus.com/problems-with-extra-white-space/">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
1883
- </p>
1884
- <ul style="list-style: disc inside; max-width: 1000px;">
1885
- <li><strong><?php _e('Downloading','updraftplus');?>:</strong> <?php _e("Pressing a button for Database/Plugins/Themes/Uploads/Others will make UpdraftPlus try to bring the backup file back from the remote storage (if any - e.g. Amazon S3, Dropbox, Google Drive, FTP) to your webserver. Then you will be allowed to download it to your computer. If the fetch from the remote storage stops progressing (wait 30 seconds to make sure), then press again to resume. Remember that you can also visit the cloud storage vendor's website directly.",'updraftplus');?></li>
1886
- <li>
1887
- <strong><?php _e('Restoring:','updraftplus');?></strong> <?php _e('Press the Restore button next to the chosen backup set.', 'updraftplus');?>
1888
- </li>
1889
- <li>
1890
- <strong><?php _e('More tasks:','updraftplus');?></strong>
1891
- <a href="#" onclick="jQuery('#updraft-plupload-modal').slideToggle(); return false;"><?php _e('Upload backup files','updraftplus');?></a>
1892
- | <a href="#" onclick="updraft_updatehistory(1, 0); return false;" title="<?php _e('Press here to look inside your UpdraftPlus directory (in your web hosting space) for any new backup sets that you have uploaded. The location of this directory is set in the expert settings, below.','updraftplus'); ?>"><?php _e('Rescan local folder for new backup sets','updraftplus');?></a>
1893
- | <a href="#" onclick="updraft_updatehistory(1, 1); return false;" title="<?php _e('Press here to look inside any remote storage methods for any existing backup sets.','updraftplus'); ?>"><?php _e('Rescan remote storage','updraftplus');?></a>
1894
- </li>
1895
- <?php
1896
- if (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') || false !== strpos($_SERVER['HTTP_USER_AGENT'], 'OPR/')) { ?>
1897
- <li><strong><?php _e('Opera web browser','updraftplus');?>:</strong> <?php _e('If you are using this, then turn Turbo/Road mode off.','updraftplus');?></li>
1898
- <?php } ?>
1899
- <?php
1900
- $service = UpdraftPlus_Options::get_updraft_option('updraft_service');
1901
- if ($service === 'googledrive' || (is_array($service) && in_array('googledrive', $service))) {
1902
- ?><li><strong><?php _e('Google Drive','updraftplus');?>:</strong> <?php _e('Google changed their permissions setup recently (April 2013). To download or restore from Google Drive, you <strong>must</strong> first re-authenticate (using the link in the Google Drive configuration section).','updraftplus');?></li>
1903
- <?php } ?>
1904
-
1905
- <li title="<?php _e('This is a count of the contents of your Updraft directory','updraftplus');?>"><strong><?php _e('Web-server disk space in use by UpdraftPlus','updraftplus');?>:</strong> <span id="updraft_diskspaceused"><em>(calculating...)</em></span> <a href="#" onclick="updraftplus_diskspace(); return false;"><?php _e('refresh','updraftplus');?></a></li></ul>
1906
-
1907
- <div id="updraft-plupload-modal" title="<?php _e('UpdraftPlus - Upload backup files','updraftplus'); ?>" style="width: 75%; margin: 16px; display:none; margin-left: 100px;">
1908
- <p style="max-width: 610px;"><em><?php _e("Upload files into UpdraftPlus. Use this to import backups made on a different WordPress installation." ,'updraftplus');?> <?php echo htmlspecialchars(__('Or, you can place them manually into your UpdraftPlus directory (usually wp-content/updraft), e.g. via FTP, and then use the "rescan" link above.', 'updraftplus'));?></em></p>
1909
- <?php
1910
- global $wp_version;
1911
- if (version_compare($wp_version, '3.3', '<')) {
1912
- echo '<em>'.sprintf(__('This feature requires %s version %s or later', 'updraftplus'), 'WordPress', '3.3').'</em>';
1913
- } else {
1914
- ?>
1915
- <div id="plupload-upload-ui" style="width: 70%;">
1916
- <div id="drag-drop-area">
1917
- <div class="drag-drop-inside">
1918
- <p class="drag-drop-info"><?php _e('Drop backup files here', 'updraftplus'); ?></p>
1919
- <p><?php _ex('or', 'Uploader: Drop backup files here - or - Select Files'); ?></p>
1920
- <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
1921
- </div>
1922
- </div>
1923
- <div id="filelist">
1924
- </div>
1925
- </div>
1926
- <?php
1927
- }
1928
- ?>
1929
-
1930
- </div>
1931
-
1932
- <div id="ud_downloadstatus"></div>
1933
- <div id="updraft_existing_backups" style="margin-bottom:12px;">
1934
- <?php
1935
- print $this->existing_backup_table($backup_history);
1936
- ?>
1937
- </div>
1938
- </td>
1939
- </tr>
1940
- </table>
1941
-
1942
- <div id="updraft-message-modal" title="UpdraftPlus">
1943
- <div id="updraft-message-modal-innards" style="padding: 4px;">
1944
- </div>
1945
- </div>
1946
-
1947
- <div id="updraft-delete-modal" title="<?php _e('Delete backup set', 'updraftplus');?>">
1948
- <form id="updraft_delete_form" method="post">
1949
- <p style="margin-top:3px; padding-top:0">
1950
- <?php _e('Are you sure that you wish to remove this backup set from UpdraftPlus?', 'updraftplus'); ?>
1951
- </p>
1952
- <fieldset>
1953
- <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>">
1954
- <input type="hidden" name="action" value="updraft_ajax">
1955
- <input type="hidden" name="subaction" value="deleteset">
1956
- <input type="hidden" name="backup_timestamp" value="0" id="updraft_delete_timestamp">
1957
- <input type="hidden" name="backup_nonce" value="0" id="updraft_delete_nonce">
1958
- <div id="updraft-delete-remote-section"><input checked="checked" type="checkbox" name="delete_remote" id="updraft_delete_remote" value="1"> <label for="updraft_delete_remote"><?php _e('Also delete from remote storage', 'updraftplus');?></label><br>
1959
- <p id="updraft-delete-waitwarning" style="display:none;"><em><?php _e('Deleting... please allow time for the communications with the remote storage to complete.', 'updraftplus');?></em></p>
1960
- </div>
1961
- </fieldset>
1962
- </form>
1963
- </div>
1964
-
1965
- <div id="updraft-restore-modal" title="UpdraftPlus - <?php _e('Restore backup','updraftplus');?>">
1966
- <p><strong><?php _e('Restore backup from','updraftplus');?>:</strong> <span class="updraft_restore_date"></span></p>
1967
-
1968
- <div id="updraft-restore-modal-stage2">
1969
-
1970
- <p><strong><?php _e('Retrieving (if necessary) and preparing backup files...', 'updraftplus');?></strong></p>
1971
- <div id="ud_downloadstatus2"></div>
1972
-
1973
- <div id="updraft-restore-modal-stage2a"></div>
1974
-
1975
- </div>
1976
-
1977
- <div id="updraft-restore-modal-stage1">
1978
- <p><?php _e("Restoring will replace this site's themes, plugins, uploads, database and/or other content directories (according to what is contained in the backup set, and your selection).",'updraftplus');?> <?php _e('Choose the components to restore','updraftplus');?>:</p>
1979
- <form id="updraft_restore_form" method="post">
1980
- <fieldset>
1981
- <input type="hidden" name="action" value="updraft_restore">
1982
- <input type="hidden" name="backup_timestamp" value="0" id="updraft_restore_timestamp">
1983
- <input type="hidden" name="meta_foreign" value="0" id="updraft_restore_meta_foreign">
1984
- <?php
1985
-
1986
- # 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
1987
- if($updraftplus->detect_safe_mode()) {
1988
- 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="http://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</a>.', 'updraftplus')."</em></p><br/>";
1989
- }
1990
-
1991
- $backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
1992
- foreach ($backupable_entities as $type => $info) {
1993
- if (!isset($info['restorable']) || $info['restorable'] == true) {
1994
- echo '<div><input id="updraft_restore_'.$type.'" type="checkbox" name="updraft_restore[]" value="'.$type.'"> <label id="updraft_restore_label_'.$type.'" for="updraft_restore_'.$type.'">'.$info['description'].'</label><br>';
1995
-
1996
- do_action("updraftplus_restore_form_$type");
1997
-
1998
- echo '</div>';
1999
- } else {
2000
- $sdescrip = isset($info['shortdescription']) ? $info['shortdescription'] : $info['description'];
2001
- echo "<div style=\"margin: 8px 0;\"><em>".htmlspecialchars(sprintf(__('The following entity cannot be restored automatically: "%s".', 'updraftplus'), $sdescrip))." ".__('You will need to restore it manually.', 'updraftplus')."</em><br>".'<input id="updraft_restore_'.$type.'" type="hidden" name="updraft_restore[]" value="'.$type.'"></div>';
2002
  }
2003
- }
2004
- ?>
2005
- <div><input id="updraft_restore_db" type="checkbox" name="updraft_restore[]" value="db"> <label for="updraft_restore_db"><?php _e('Database','updraftplus'); ?></label><br>
2006
-
2007
-
2008
- <div id="updraft_restorer_dboptions" style="display:none; padding:12px; margin: 8px 0 4px; border: dashed 1px;"><h4 style="margin: 0px 0px 6px; padding:0px;"><?php echo sprintf(__('%s restoration options:','updraftplus'),__('Database','updraftplus')); ?></h4>
2009
-
2010
- <?php
2011
-
2012
- do_action("updraftplus_restore_form_db");
2013
-
2014
- if (!class_exists('UpdraftPlus_Addons_Migrator')) {
2015
-
2016
- echo '<a href="http://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>';
2017
-
2018
- }
2019
-
2020
  ?>
2021
-
2022
- </div>
2023
-
2024
- </div>
2025
- </fieldset>
2026
- </form>
2027
- <p><em><a href="http://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/" target="_new"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
2028
- </div>
2029
-
2030
- </div>
2031
 
2032
  <div id="updraft-migrate-modal" title="<?php _e('Migrate Site', 'updraftplus'); ?>">
2033
 
@@ -2070,88 +1987,263 @@ CREATE TABLE $wpdb->signups (
2070
  </tr>
2071
  </table>
2072
  <?php } ?>
 
 
 
 
 
 
 
 
2073
  <h2 style="margin-top: 6px;"><?php _e('Configure Backup Contents And Schedule','updraftplus');?></h2>
2074
  <?php UpdraftPlus_Options::options_form_begin(); ?>
2075
  <?php $this->settings_formcontents($last_backup_html); ?>
2076
  </form>
2077
- <div style="padding-top: 40px; display:none;" class="expertmode">
2078
- <hr>
2079
- <h2><?php _e('Debug Information And Expert Options','updraftplus');?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2080
  <p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2081
  <?php
2082
- echo sprintf(__('Web server:','updraftplus'), 'PHP').' '.htmlspecialchars($_SERVER["SERVER_SOFTWARE"]).' ('.htmlspecialchars(php_uname()).')<br />';
2083
- echo 'ABSPATH: '.htmlspecialchars(ABSPATH).'<br/>';
2084
- echo 'WP_CONTENT_DIR: '.htmlspecialchars(WP_CONTENT_DIR).'<br/>';
2085
- echo 'WP_PLUGIN_DIR: '.htmlspecialchars(WP_PLUGIN_DIR).'<br/>';
2086
- echo 'Table prefix: '.htmlspecialchars($updraftplus->get_table_prefix()).'<br/>';
 
 
2087
  $peak_memory_usage = memory_get_peak_usage(true)/1024/1024;
2088
  $memory_usage = memory_get_usage(true)/1024/1024;
2089
- echo __('Peak memory usage','updraftplus').': '.$peak_memory_usage.' MB<br/>';
2090
- echo __('Current memory usage','updraftplus').': '.$memory_usage.' MB<br/>';
2091
- echo __('PHP memory limit','updraftplus').': '.ini_get('memory_limit').' <br/>';
2092
- echo sprintf(__('%s version:','updraftplus'), 'PHP').' '.phpversion().' - ';
2093
- echo '<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><br/>';
2094
- global $wpdb;
2095
- echo sprintf(__('%s version:','updraftplus'), 'MySQL').' '.htmlspecialchars($wpdb->db_version()).'<br>';
2096
- echo sprintf(__('%s version:','updraftplus'), 'Curl').' ';
2097
  if (function_exists('curl_version') && function_exists('curl_exec')) {
2098
  $cv = curl_version();
2099
- echo $cv['version'].' / SSL: '.$cv['ssl_version'].' / libz: '.$cv['libz_version'];
2100
  } else {
2101
- echo '-';
2102
  }
2103
-
2104
- echo '<br>';
2105
-
2106
  if (version_compare(phpversion(), '5.2.0', '>=') && extension_loaded('zip')) {
2107
  $ziparchive_exists = __('Yes', 'updraftplus');
2108
  } else {
2109
  # First do class_exists, because method_exists still sometimes segfaults due to a rare PHP bug
2110
  $ziparchive_exists = (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? __('Yes', 'updraftplus') : __('No', 'updraftplus');
2111
  }
2112
-
2113
- echo __('PHP has support for ZipArchive::addFile:', 'updraftplus').' '.$ziparchive_exists.'<br>';
2114
-
2115
  $binzip = $updraftplus->find_working_bin_zip(false, false);
2116
-
2117
- echo __('zip executable found:', 'updraftplus').' '.((is_string($binzip)) ? __('Yes').': '.$binzip : __('No')).'<br>';
2118
-
2119
  $hosting_bytes_free = $updraftplus->get_hosting_disk_quota_free();
2120
  if (is_array($hosting_bytes_free)) {
2121
  $perc = round(100*$hosting_bytes_free[1]/(max($hosting_bytes_free[2], 1)), 1);
2122
- echo sprintf(__('Free disk space in account: %s (%s used)', 'updraftplus'), round($hosting_bytes_free[3]/1048576, 1)." Mb", "$perc %")."<br>";
2123
  }
 
 
2124
 
2125
- echo '<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><br/>';
2126
 
2127
- echo __('Install 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> | <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><br>';
2128
 
2129
- echo "HTTP Get: ";
2130
- echo '<input id="updraftplus_httpget_uri" type="text" style="width: 300px; height: 22px;"> ';
2131
- echo '<a href="#" id="updraftplus_httpget_go">'.__('Fetch', 'updraftplus').'</a> ';
2132
- echo '<a href="#" id="updraftplus_httpget_gocurl">'.__('Fetch', 'updraftplus').' (Curl)</a>';
2133
- echo '<p id="updraftplus_httpget_results"></p>';
2134
 
2135
- echo "Call WordPress action: ";
2136
- echo '<input id="updraftplus_callwpaction" type="text" style="width: 300px; height: 22px;"> ';
2137
- echo '<a href="#" id="updraftplus_callwpaction_go">'.__('Call', 'updraftplus').'</a> ';
2138
- echo '<p id="updraftplus_callwpaction_results"></p>';
2139
 
2140
  echo '<h3>'.__('Total (uncompressed) on-disk data:','updraftplus').'</h3>';
2141
- echo '<p style="clear: left; max-width: 600px;"><em>'.__('N.B. This count is based upon what was, or was not, excluded the last time you saved the options.', 'updraftplus').'</em></p>';
2142
 
2143
  foreach ($backupable_entities as $key => $info) {
2144
 
2145
  $sdescrip = preg_replace('/ \(.*\)$/', '', $info['description']);
2146
  if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
2147
 
2148
- echo '<div style="clear: left;float:left; width:150px;">'.ucfirst($sdescrip).':</strong></div><div style="float:left;"><span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a></div>';
 
2149
  }
2150
 
2151
  ?>
2152
 
2153
- </p>
2154
- <p style="clear: left; padding-top: 20px; max-width: 600px; margin:0;"><?php _e('The buttons below will immediately execute a backup run, independently of WordPress\'s scheduler. If these work whilst your scheduled backups and the "Backup Now" button do absolutely nothing (i.e. not even produce a log file), then it means that your scheduler is broken. You should then disable all your other plugins, and try the "Backup Now" button. If that fails, then contact your web hosting company and ask them if they have disabled wp-cron. If it succeeds, then re-activate your other plugins one-by-one, and find the one that is the problem and report a bug to them.','updraftplus');?></p>
2155
 
2156
  <table border="0" style="border: none;">
2157
  <tbody>
@@ -2177,8 +2269,7 @@ CREATE TABLE $wpdb->signups (
2177
  <p><input type="submit" class="button-primary" value="<?php _e('Wipe All Settings','updraftplus'); ?>" onclick="return(confirm('<?php echo htmlspecialchars(__('This will delete all your UpdraftPlus settings - are you sure you want to do this?'));?>'))" /></p>
2178
  </form>
2179
  </div>
2180
-
2181
- <?php
2182
  }
2183
 
2184
  function print_delete_old_dirs_form($include_blurb = true) {
@@ -2601,32 +2692,37 @@ CREATE TABLE $wpdb->signups (
2601
 
2602
  }
2603
 
2604
- function settings_formcontents($last_backup_html) {
 
 
 
 
 
 
 
 
 
 
 
 
 
2605
 
2606
  global $updraftplus;
2607
 
2608
  $updraft_dir = $updraftplus->backups_dir_location();
2609
 
2610
  ?>
2611
- <table class="form-table" style="width:900px;">
2612
  <tr>
2613
  <th><?php _e('File backup intervals','updraftplus'); ?>:</th>
2614
- <td><select id="updraft_interval" name="updraft_interval" onchange="updraft_check_same_times();">
2615
  <?php
2616
- $intervals = apply_filters('updraftplus_backup_intervals', array(
2617
- "manual" => _x("Manual", 'i.e. Non-automatic', 'updraftplus'),
2618
- 'every4hours' => __("Every 4 hours", 'updraftplus'),
2619
- 'every8hours' => __("Every 8 hours", 'updraftplus'),
2620
- 'twicedaily' => __("Every 12 hours", 'updraftplus'),
2621
- 'daily' => __("Daily", 'updraftplus'),
2622
- 'weekly' => __("Weekly", 'updraftplus'),
2623
- 'fortnightly' => __("Fortnightly", 'updraftplus'),
2624
- 'monthly' => __("Monthly", 'updraftplus')
2625
- ));
2626
  foreach ($intervals as $cronsched => $descrip) {
2627
  echo "<option value=\"$cronsched\" ";
2628
- if ($cronsched == UpdraftPlus_Options::get_updraft_option('updraft_interval','manual')) echo 'selected="selected"';
2629
- echo ">$descrip</option>\n";
2630
  }
2631
  ?>
2632
  </select> <span id="updraft_files_timings"><?php echo apply_filters('updraftplus_schedule_showfileopts', '<input type="hidden" name="updraftplus_starttime_files" value="">'); ?></span>
@@ -2637,6 +2733,7 @@ CREATE TABLE $wpdb->signups (
2637
  ?> <input type="number" min="1" step="1" name="updraft_retain" value="<?php echo $updraft_retain ?>" style="width:48px;" />
2638
  </td>
2639
  </tr>
 
2640
  <tr>
2641
  <th><?php _e('Database backup intervals','updraftplus'); ?>:</th>
2642
  <td><select id="updraft_interval_database" name="updraft_interval_database" onchange="updraft_check_same_times();">
@@ -2656,9 +2753,9 @@ CREATE TABLE $wpdb->signups (
2656
  </td>
2657
  </tr>
2658
  <tr class="backup-interval-description">
2659
- <td></td><td><p><?php echo htmlspecialchars(__('If you would like to automatically schedule backups, choose schedules from the dropdowns above. Backups will occur at the intervals specified. If the two schedules are the same, then the two backups will take place together. If you choose "manual" then you must click the "Backup Now" button whenever you wish a backup to occur.', 'updraftplus')); ?></p>
2660
  <?php echo apply_filters('updraftplus_fixtime_ftinfo', '<p><strong>'.__('To fix the time at which a backup should take place,','updraftplus').' </strong> ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), <a href="http://updraftplus.com/shop/updraftplus-premium/">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>'); ?>
2661
- </td>
2662
  </tr>
2663
  <tr>
2664
  <th><?php _e('Include in files backup','updraftplus');?>:</th>
@@ -2700,7 +2797,7 @@ CREATE TABLE $wpdb->signups (
2700
 
2701
  </table>
2702
 
2703
- <h2><?php _e('Database options','updraftplus');?></h2>
2704
 
2705
  <table class="form-table" style="width:900px;">
2706
 
@@ -2891,10 +2988,7 @@ CREATE TABLE $wpdb->signups (
2891
  <tr>
2892
  <td colspan="2"><h2><?php _e('Advanced / Debugging Settings','updraftplus'); ?></h2></td>
2893
  </tr>
2894
- <tr>
2895
- <th><?php _e('Debug mode','updraftplus');?>:</th>
2896
- <td><input type="checkbox" id="updraft_debug_mode" name="updraft_debug_mode" value="1" <?php echo $debug_mode; ?> /> <br><label for="updraft_debug_mode"><?php _e('Check this to receive more information and emails on the backup process - useful if something is going wrong.','updraftplus');?> <?php _e('This will also cause debugging output from all plugins to be shown upon this screen - please do not be surprised to see these.', 'updraftplus');?></label></td>
2897
- </tr>
2898
  <tr>
2899
  <th><?php _e('Expert settings','updraftplus');?>:</th>
2900
  <td><a id="enableexpertmode" href="#enableexpertmode"><?php _e('Show expert settings','updraftplus');?></a> - <?php _e("click this to show some further options; don't bother with this unless you have a problem or are curious.",'updraftplus');?> <?php do_action('updraftplus_expertsettingsdescription'); ?></td>
@@ -2906,6 +3000,11 @@ CREATE TABLE $wpdb->signups (
2906
  if ($split_every_mb < UPDRAFTPLUS_SPLIT_MIN) $split_every_mb = UPDRAFTPLUS_SPLIT_MIN;
2907
  ?>
2908
 
 
 
 
 
 
2909
  <tr class="expertmode" style="display:none;">
2910
  <th><?php _e('Split archives every:','updraftplus');?></th>
2911
  <td><input type="text" name="updraft_split_every" id="updraft_split_every" value="<?php echo $split_every_mb ?>" size="5" /> Mb<br><?php _e('UpdraftPlus will split up backup archives when they exceed this file size. The default value is 800 megabytes. Be careful to leave some margin if your web-server has a hard size limit (e.g. the 2 Gb / 2048 Mb limit on some 32-bit servers/file systems).','updraftplus'); ?></td>
@@ -3120,7 +3219,11 @@ CREATE TABLE $wpdb->signups (
3120
 
3121
  $nonce_field = wp_nonce_field('updraftplus_download', '_wpnonce', true, false);
3122
 
3123
- foreach($backup_history as $key=>$backup) {
 
 
 
 
3124
  # https://core.trac.wordpress.org/ticket/25331
3125
  # $pretty_date = date_i18n('Y-m-d G:i',$key);
3126
  // Convert to blog time zone
@@ -3280,7 +3383,7 @@ ENDHERE;
3280
  $ret .= '<td>';
3281
  if (isset($backup['nonce']) && preg_match("/^[0-9a-f]{12}$/",$backup['nonce']) && is_readable($updraft_dir.'/log.'.$backup['nonce'].'.txt')) {
3282
  $nval = $backup['nonce'];
3283
- $lt = __('Backup Log','updraftplus');
3284
  $url = UpdraftPlus_Options::admin_page();
3285
  $ret .= <<<ENDHERE
3286
  <form action="$url" method="get">
@@ -3328,6 +3431,7 @@ ENDHERE;
3328
 
3329
  global $updraftplus;
3330
  $messages = array();
 
3331
 
3332
  $known_files = array();
3333
  $known_nonces = array();
@@ -3426,7 +3530,12 @@ ENDHERE;
3426
  $potmessage = false;
3427
  if ('.' == $entry || '..' == $entry) continue;
3428
  if (preg_match('/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-([\-a-z]+)([0-9]+(of[0-9]+)?)?\.(zip|gz|gz\.crypt)$/i', $entry, $matches)) {
3429
- $btime = strtotime($matches[1]);
 
 
 
 
 
3430
  $nonce = $matches[2];
3431
  $type = $matches[3];
3432
  if ('db' == $type) {
@@ -3522,7 +3631,9 @@ ENDHERE;
3522
  $index = (empty($matches[4])) ? '0' : (max((int)$matches[4]-1,0));
3523
  }
3524
  $itext = ($index == 0) ? '' : $index;
3525
- $btime = strtotime($matches[1]);
 
 
3526
  if (isset($known_nonces[$nonce])) $btime = $known_nonces[$nonce];
3527
  if ($btime <= 100) continue;
3528
  # Remember that at this point, we already know that the file is not known about locally
@@ -3613,7 +3724,6 @@ ENDHERE;
3613
 
3614
  $this->show_admin_warning('<a target="_new" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($updraftplus->nonce).'">'.__('Follow this link to download the log file for this restoration (needed for any support requests).', 'updraftplus').'</a>');
3615
 
3616
-
3617
  $updraft_dir = trailingslashit($updraftplus->backups_dir_location());
3618
  $foreign_known = apply_filters('updraftplus_accept_archivename', array());
3619
 
@@ -3911,9 +4021,10 @@ ENDHERE;
3911
  return $input;
3912
  }
3913
 
 
3914
  private function get_settings_keys() {
3915
- return array('updraft_autobackup_default', 'updraft_googledrive', 'updraftplus_tmp_googledrive_access_token', 'updraftplus_dismissedautobackup', 'updraftplus_dismissedexpiry', 'updraft_interval', 'updraft_interval_database', 'updraft_retain', 'updraft_retain_db', 'updraft_encryptionphrase', 'updraft_service', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_wpcore', 'updraft_include_wpcore_exclude', 'updraft_include_more', 'updraft_include_blogs', 'updraft_include_mu-plugins', 'updraft_include_others_exclude', 'updraft_include_uploads_exclude', 'updraft_lastmessage', 'updraft_googledrive_token',
3916
- 'updraft_dropboxtk_request_token', 'updraft_dropboxtk_access_token', 'updraft_dropbox_folder',
3917
  'updraft_last_backup', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_db', 'updraft_startday_files', 'updraft_sftp_settings', 'updraft_s3', 'updraft_s3generic', 'updraft_dreamhost', 'updraft_s3generic_login', 'updraft_s3generic_pass', 'updraft_s3generic_remote_path', 'updraft_s3generic_endpoint', 'updraft_webdav_settings', 'updraft_disable_ping', 'updraft_openstack', 'updraft_bitcasa', 'updraft_cloudfiles', 'updraft_cloudfiles_user', 'updraft_cloudfiles_apikey', 'updraft_cloudfiles_path', 'updraft_cloudfiles_authurl', 'updraft_ssl_useservercerts', 'updraft_ssl_disableverify', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dreamobjects_login', 'updraft_dreamobjects_pass', 'updraft_dreamobjects_remote_path', 'updraft_report_warningsonly', 'updraft_report_wholebackup', 'updraft_log_syslog', 'updraft_extradatabases');
3918
  }
3919
 
2
 
3
  if (!defined ('ABSPATH')) die('No direct access allowed');
4
 
5
+ // For the purposes of improving site performance (don't load in 10s of Kilobytes of un-needed code on every page load), admin-area code lives here
6
 
7
  // This gets called in admin_menu, earlier than admin_init
8
 
13
 
14
  public $logged = array();
15
 
16
+ public function __construct() {
17
  $this->admin_init();
18
  }
19
 
20
+ private function admin_init() {
21
 
22
  add_action('core_upgrade_preamble', array($this, 'core_upgrade_preamble'));
23
  add_action('admin_action_upgrade-plugin', array($this, 'admin_action_upgrade_pluginortheme'));
50
  if (!empty($clientid) && empty($token)) add_action('all_admin_notices', array($this,'show_admin_warning_googledrive'));
51
  }
52
 
53
+ if (UpdraftPlus_Options::user_can_manage() && ('dropbox' === $service || is_array($service) && in_array('dropbox', $service))) {
54
+ $opts = UpdraftPlus_Options::get_updraft_option('updraft_dropbox');
55
+ if (empty($opts['tk_request_token'])) {
56
+ add_action('all_admin_notices', array($this,'show_admin_warning_dropbox') );
57
+ }
58
  }
59
 
60
  if (UpdraftPlus_Options::user_can_manage() && ('bitcasa' === $service || is_array($service) && in_array('bitcasa', $service))) {
77
  add_action('all_admin_notices', array($this, 'show_admin_debug_warning'));
78
  }
79
 
80
+ if (null === UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
81
+ add_action('all_admin_notices', array($this, 'show_admin_nosettings_warning'));
82
+ }
83
+
84
  # Avoid false positives, by attempting to raise the limit (as happens when we actually do a backup)
85
  @set_time_limit(900);
86
  $max_execution_time = (int)@ini_get('max_execution_time');
113
  wp_enqueue_script('jquery');
114
  # No plupload until 3.3
115
  # Put in footer, to make sure that jQuery loads first
116
+ wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog'), '37', true);
117
  } else {
118
+ wp_enqueue_script('updraftplus-admin-ui', UPDRAFTPLUS_URL.'/includes/updraft-admin-ui.js', array('jquery', 'jquery-ui-dialog', 'plupload-all'), '37');
119
  }
120
 
121
  wp_localize_script( 'updraftplus-admin-ui', 'updraftlion', array(
277
  <?php } ?>
278
  </script>
279
  <style type="text/css">
280
+ .updraft-bigbutton {
281
+ padding: 2px 0px;
282
+ margin-right: 14px !important;
283
+ font-size:22px !important;
284
+ min-height: 32px;
285
+ min-width: 180px;
286
+ }
287
+ .updraft_debugrow th {
288
+ text-align: right;
289
+ font-weight: bold;
290
+ padding-right: 8px;
291
+ min-width: 140px;
292
+ }
293
+ .updraft_debugrow td {
294
+ min-width: 300px;
295
+ }
296
  .updraftplus-morefiles-row-delete {
297
  cursor: pointer;
298
  color: red;
412
  echo '<div class="updraftmessage '.$class.'">'."<p>$message</p></div>";
413
  }
414
 
415
+ public function show_admin_nosettings_warning() {
416
+ $this->show_admin_warning('<strong>'.__('Welcome to UpdraftPlus!', 'updraftplus').'</strong> '.__('To make a backup, just press the Backup Now button.', 'updraftplus').' <a href="#" id="updraft-navtab-settings2">'.__('To change any of the default settings of what is backed up, to configure scheduled backups, to send your backups to remote storage (recommended), and more, go to the settings tab.', 'updraftplus').'</a>');
417
+ }
418
+
419
  public function show_admin_warning_execution_time() {
420
  $this->show_admin_warning('<strong>'.__('Warning','updraftplus').':</strong> '.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'), (int)@ini_get('max_execution_time'), 90));
421
  }
1035
  echo '<strong>',__('Schedule backup','updraftplus').':</strong> ';
1036
  $backupnow_nocloud = (empty($_REQUEST['backupnow_nocloud'])) ? false : true;
1037
  $event = (!empty($_REQUEST['backupnow_nofiles'])) ? 'updraft_backupnow_backup_database' : ((!empty($_REQUEST['backupnow_nodb'])) ? 'updraft_backupnow_backup' : 'updraft_backupnow_backup_all');
1038
+
1039
+ $msg = htmlspecialchars(__('OK. You should soon see activity in the "Last log message" field below.','updraftplus'));
1040
+ $updraftplus->log("A backup run has been started");
1041
+ $this->close_browser_connection($msg);
1042
+ do_action($event, $backupnow_nocloud);
1043
+
1044
+ # Old-style: schedule an event in 5 seconds time. This has the advantage of testing out the scheduler, and alerting the user if it doesn't work... but has the disadvantage of not working in that case.
1045
+ # I don't think the </div>s should be here - in case this is ever re-activated
1046
+ // if (wp_schedule_single_event(time()+5, $event, array($backupnow_nocloud)) === false) {
1047
+ // $updraftplus->log("A backup run failed to schedule");
1048
+ // echo __("Failed.", 'updraftplus')."</div>";
1049
+ // } else {
1050
+ // echo htmlspecialchars(__('OK. You should soon see activity in the "Last log message" field below.','updraftplus'))." <a href=\"http://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/\"><br>".__('Nothing happening? Follow this link for help.','updraftplus')."</a></div>";
1051
+ // $updraftplus->log("A backup run has been scheduled");
1052
+ // }
1053
 
1054
  } elseif (isset($_GET['subaction']) && 'lastbackup' == $_GET['subaction']) {
1055
  echo $this->last_backup_html();
1095
  $backup_history = (is_array($backup_history)) ? $backup_history : array();
1096
  $output = $this->existing_backup_table($backup_history);
1097
 
1098
+ if (!empty($messages) && is_array($messages)) {
1099
  $noutput = '<div style="margin-left: 100px; margin-top: 10px;"><ul style="list-style: disc inside;">';
1100
  foreach ($messages as $msg) {
1101
  $noutput .= '<li>'.(($msg['desc']) ? $msg['desc'].': ' : '').'<em>'.$msg['message'].'</em></li>';
1209
  return $response;
1210
  }
1211
 
1212
+ private function analyse_db_file($timestamp, $res) {
1213
 
1214
  $mess = array(); $warn = array(); $err = array();
1215
 
1411
  }
1412
 
1413
  private function gzopen_for_read($file, &$warn, &$err) {
1414
+ if (!function_exists('gzopen') || !function_exists('gzread')) {
1415
+ $missing = '';
1416
+ if (!function_exists('gzopen')) $missing .= 'gzopen';
1417
+ if (!function_exists('gzread')) $missing .= ($missing) ? ', gzread' : 'gzread';
1418
+ $err[] = sprintf(__("Your web server's PHP installation has these functions disabled: %s.", 'updraftplus'), implode(', ', $missing)).' '.sprintf(__('Your hosting company must enable these functions before %s can work.', 'updraftplus'), __('restoration', 'updraftplus'));
1419
+ return false;
1420
+ }
1421
  if (false === ($dbhandle = gzopen($file, 'r'))) return false;
1422
  if (false === ($bytes = gzread($dbhandle, 3))) return false;
1423
  # Double-gzipped?
1689
  /*
1690
  we use request here because the initial restore is triggered by a POSTed form. we then may need to obtain credentials
1691
  for the WP_Filesystem. to do this WP outputs a form, but we don't pass our parameters via that. So the values are
1692
+ passed back in as GET parameters.
1693
  */
1694
  if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'updraft_restore' && isset($_REQUEST['backup_timestamp'])) {
1695
  $backup_success = $this->restore_backup($_REQUEST['backup_timestamp']);
1724
  return;
1725
  }
1726
 
1727
+ if(!empty($_REQUEST['action']) && 'updraftplus_broadcastaction' == $_REQUEST['action'] && !empty($_REQUEST['subaction'])) {
1728
+ $nonce = (empty($_REQUEST['nonce'])) ? "" : $_REQUEST['nonce'];
1729
+ if (!wp_verify_nonce($nonce, 'updraftplus-credentialtest-nonce')) die('Security check');
1730
+ do_action($_REQUEST['subaction']);
1731
+ return;
1732
+ }
1733
+
1734
  if(isset($_GET['error'])) $this->show_admin_warning(htmlspecialchars($_GET['error']), 'error');
1735
  if(isset($_GET['message'])) $this->show_admin_warning(htmlspecialchars($_GET['message']));
1736
 
1737
  if(isset($_GET['action']) && $_GET['action'] == 'updraft_create_backup_dir' && isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'create_backup_dir')) {
1738
  $created = $this->create_backup_dir();
1739
  if(is_wp_error($created)) {
1740
+ echo '<p>'.__('Backup directory could not be created', 'updraftplus').'...<br/>';
1741
  echo '<ul style="list-style: disc inside;">';
1742
  foreach ($created->get_error_messages() as $key => $msg) {
1743
  echo '<li>'.htmlspecialchars($msg).'</li>';
1744
  }
1745
  echo '</ul></p>';
1746
  } elseif ($created !== false) {
1747
+ echo '<p>'.__('Backup directory successfully created.', 'updraftplus').'</p><br/>';
1748
  }
1749
+ echo '<b>'.__('Actions','updraftplus').':</b> <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus">'.__('Return to UpdraftPlus Configuration', 'updraftplus').'</a>';
1750
  return;
1751
  }
1752
 
1754
 
1755
  echo '<div id="updraft_backup_started" class="updated fade" style="display:none; max-width: 800px; font-size:140%; line-height: 140%; padding:14px; clear:left;"></div>';
1756
 
1757
+ if(isset($_POST['action']) && 'updraft_backup_debug_all' == $_POST['action']) {
1758
+ $updraftplus->boot_backup(true,true);
1759
+ } elseif (isset($_POST['action']) && 'updraft_backup_debug_db' == $_POST['action']) {
1760
  $updraftplus->boot_backup(false, true, false, true);
1761
+ } elseif (isset($_POST['action']) && 'updraft_wipesettings' == $_POST['action']) {
1762
  $settings = $this->get_settings_keys();
1763
  foreach ($settings as $s) UpdraftPlus_Options::delete_updraft_option($s);
1764
 
1769
  $site_options = array('updraft_oneshotnonce');
1770
  foreach ($site_options as $s) delete_site_option($s);
1771
 
1772
+ $this->show_admin_warning(__("Your settings have been wiped.", 'updraftplus'));
1773
  }
 
1774
  ?>
1775
+
1776
  <div class="wrap" id="updraft-wrap">
1777
  <h1><?php echo $updraftplus->plugin_title; ?></h1>
1778
 
1779
+ <?php _e('By UpdraftPlus.Com','updraftplus')?> ( <a href="http://updraftplus.com">UpdraftPlus.Com</a> | <a href="http://updraftplus.com/news/"><?php _e('News','updraftplus');?></a> | <?php if (!defined('UPDRAFTPLUS_NOADS_A')) { ?><a href="http://updraftplus.com/shop/updraftplus-premium/"><?php _e("Premium",'updraftplus');?></a> | <?php } ?><a href="http://updraftplus.com/support/"><?php _e("Support",'updraftplus');?></a> | <a href="http://david.dw-perspective.org.uk"><?php _e("Lead developer's homepage",'updraftplus');?></a> | <?php if (1==0 && !defined('UPDRAFTPLUS_NOADS_A')) { ?><a href="http://wordshell.net">WordShell - WordPress command line</a> | <a href="http://david.dw-perspective.org.uk/donate"><?php _e('Donate', 'updraftplus');?></a> | <?php } ?><a href="http://updraftplus.com/support/frequently-asked-questions/">FAQs</a> | <a href="https://www.simbahosting.co.uk/s3/shop/"><?php _e('More plugins', 'updraftplus');?></a> ) <?php _e('Version','updraftplus');?>: <?php echo $updraftplus->version; ?>
1780
  <br>
1781
 
1782
  <div id="updraft-hidethis">
1786
 
1787
  <?php
1788
  if(isset($_GET['updraft_restore_success'])) {
 
1789
  echo "<div class=\"updated fade\" style=\"padding:8px;\"><strong>".__('Your backup has been restored.','updraftplus').'</strong> '.__('If your restore included files, then your old (themes, uploads, plugins, whatever) directories have been retained with "-old" appended to their name. Remove them when you are satisfied that the backup worked properly.')."</div>";
1790
  }
1791
 
1804
  }
1805
  ?>
1806
 
1807
+ <h2 class="nav-tab-wrapper" style="margin: 14px 0px;">
1808
+ <a class="nav-tab nav-tab-active" href="#updraft-navtab-status-content" id="updraft-navtab-status"><?php _e('Current Status', 'updraftplus');?></a>
1809
+ <a class="nav-tab" href="#updraft-navtab-backups-contents" id="updraft-navtab-backups"><?php _e('Existing Backups', 'updraftplus');?></a>
1810
+ <a class="nav-tab" id="updraft-navtab-settings" href="#updraft-navtab-settings-content"><?php _e('Settings', 'updraftplus');?></a>
1811
+ <a class="nav-tab" id="updraft-navtab-expert" href="#updraft-navtab-expert-content"><?php _e('Debugging / Expert Tools', 'updraftplus');?></a>
1812
+ </h2>
1813
+
1814
+ <?php
1815
+ $updraft_dir = $updraftplus->backups_dir_location();
1816
+ $backup_disabled = ($updraftplus->really_is_writable($updraft_dir)) ? '' : 'disabled="disabled"';
1817
+ ?>
1818
+
1819
+ <div id="updraft-navtab-status-content">
1820
 
1821
  <div id="updraft-insert-admin-warning"></div>
1822
 
1823
+ <table class="form-table" style="float:left; clear: both;">
1824
  <noscript>
1825
  <tr>
1826
  <th><?php _e('JavaScript warning','updraftplus');?>:</th>
1827
  <td style="color:red"><?php _e('This admin interface uses JavaScript heavily. You either need to activate it within your browser, or to use a JavaScript-capable browser.','updraftplus');?></td>
1828
  </tr>
1829
  </noscript>
1830
+
1831
+ <tr>
1832
+ <th><?php _e('Actions', 'updraftplus');?>:</th>
1833
+ <td>
1834
+
1835
+ <button type="button" <?php echo $backup_disabled ?> class="button-primary updraft-bigbutton" <?php if ($backup_disabled) echo 'title="'.esc_attr(__('This button is disabled because your backup directory is not writable (see the settings).', 'updraftplus')).'" ';?> onclick="jQuery('#updraft-backupnow-modal').dialog('open');"><?php _e('Backup Now', 'updraftplus');?></button>
1836
+
1837
+ <button type="button" class="button-primary updraft-bigbutton" onclick="updraft_openrestorepanel();">
1838
+ <?php _e('Restore','updraftplus');?>
1839
+ </button>
1840
+
1841
+ <button type="button" class="button-primary updraft-bigbutton" onclick="jQuery('#updraft-migrate-modal').dialog('open');"><?php _e('Clone/Migrate','updraftplus');?></button>
1842
+
1843
+ </td>
1844
+ </tr>
1845
+
1846
+ <?php
1847
+ // UNIX timestamp
1848
+ $next_scheduled_backup = wp_next_scheduled('updraft_backup');
1849
+ if ($next_scheduled_backup) {
1850
+ // Convert to GMT
1851
+ $next_scheduled_backup_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup);
1852
+ // Convert to blog time zone
1853
+ $next_scheduled_backup = get_date_from_gmt($next_scheduled_backup_gmt, 'D, F j, Y H:i');
1854
+ } else {
1855
+ $next_scheduled_backup = __('Nothing currently scheduled','updraftplus');
1856
+ }
1857
+
1858
+ $next_scheduled_backup_database = wp_next_scheduled('updraft_backup_database');
1859
+ if (UpdraftPlus_Options::get_updraft_option('updraft_interval_database',UpdraftPlus_Options::get_updraft_option('updraft_interval')) == UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
1860
+ $next_scheduled_backup_database = ('Nothing currently scheduled' == $next_scheduled_backup) ? $next_scheduled_backup : __("At the same time as the files backup", 'updraftplus');
1861
+ } else {
1862
+ if ($next_scheduled_backup_database) {
1863
  // Convert to GMT
1864
+ $next_scheduled_backup_database_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup_database);
1865
  // Convert to blog time zone
1866
+ $next_scheduled_backup_database = get_date_from_gmt($next_scheduled_backup_database_gmt, 'D, F j, Y H:i');
 
 
 
 
 
 
 
1867
  } else {
1868
+ $next_scheduled_backup_database = __('Nothing currently scheduled','updraftplus');
 
 
 
 
 
 
 
1869
  }
1870
+ }
1871
+ $current_time = get_date_from_gmt(gmdate('Y-m-d H:i:s'), 'D, F j, Y H:i');
 
1872
 
1873
+ $last_backup_html = $this->last_backup_html();
1874
 
1875
+ ?>
1876
 
1877
  <script>var lastbackup_laststatus = '<?php echo esc_js($last_backup_html);?>';</script>
1878
 
1881
  <td>
1882
  <table style="border: 0px; padding: 0px; margin: 0 10px 0 0;">
1883
  <tr>
1884
+ <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Files','updraftplus'); ?>:</td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $next_scheduled_backup?></td>
1885
  </tr><tr>
1886
+ <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Database','updraftplus');?>: </td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $next_scheduled_backup_database?></td>
1887
  </tr><tr>
1888
  <td style="width: 124px; vertical-align:top; margin: 0px; padding: 0px;"><?php _e('Time now','updraftplus');?>: </td><td style="color:blue; margin: 0px; padding: 0px;"><?php echo $current_time?></td>
1889
  </table>
1895
  </tr>
1896
  </table>
1897
 
1898
+ <?php
1899
+ $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
1900
+ if (empty($backup_history)) {
1901
+ $this->rebuild_backup_history();
1902
+ $backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
1903
+ }
1904
+ $backup_history = (is_array($backup_history))?$backup_history:array();
1905
+ ?>
 
 
 
 
 
 
 
 
 
 
 
1906
 
1907
  <br style="clear:both" />
1908
  <table class="form-table">
1923
 
1924
  <tr>
1925
  <th><?php echo htmlspecialchars(__('Backups, logs & restoring','updraftplus')); ?>:</th>
1926
+ <td><a id="updraft_showbackups" href="#" title="<?php _e('Press to see available backups','updraftplus');?>" onclick="updraft_openrestorepanel(0); return false;"><?php echo sprintf(__('%d set(s) available', 'updraftplus'), count($backup_history)); ?></a></td>
1927
  </tr>
1928
  <?php
1929
+ # Currently disabled - not sure who we want to show this to
1930
+ if (1==0 && !defined('UPDRAFTPLUS_NOADS_A')) {
1931
+ $feed = $updraftplus->get_updraftplus_rssfeed();
1932
+ if (is_a($feed, 'SimplePie')) {
1933
+ echo '<tr><th style="vertical-align:top;">'.__('Latest UpdraftPlus.com news:', 'updraftplus').'</th><td style="vertical-align:top;">';
1934
+ echo '<ul style="list-style: disc inside;">';
1935
+ foreach ($feed->get_items(0, 5) as $item) {
1936
+ echo '<li>';
1937
+ echo '<a href="'.esc_attr($item->get_permalink()).'">';
1938
+ echo htmlspecialchars($item->get_title());
1939
+ # D, F j, Y H:i
1940
+ echo "</a> (".htmlspecialchars($item->get_date('j F Y')).")";
1941
+ echo '</li>';
1942
+ }
1943
+ echo '</ul></td></tr>';
1944
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1945
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1946
  ?>
1947
+ </table>
 
 
 
 
 
 
 
 
 
1948
 
1949
  <div id="updraft-migrate-modal" title="<?php _e('Migrate Site', 'updraftplus'); ?>">
1950
 
1987
  </tr>
1988
  </table>
1989
  <?php } ?>
1990
+
1991
+ </div>
1992
+
1993
+ <div id="updraft-navtab-backups-content" style="display:none;">
1994
+ <?php $this->settings_downloadingandrestoring($backup_history); ?>
1995
+ </div>
1996
+
1997
+ <div id="updraft-navtab-settings-content" style="display:none;">
1998
  <h2 style="margin-top: 6px;"><?php _e('Configure Backup Contents And Schedule','updraftplus');?></h2>
1999
  <?php UpdraftPlus_Options::options_form_begin(); ?>
2000
  <?php $this->settings_formcontents($last_backup_html); ?>
2001
  </form>
2002
+ </div>
2003
+
2004
+ <div id="updraft-navtab-expert-content" style="display:none;">
2005
+ <?php $this->settings_expertsettings($backup_disabled); ?>
2006
+ </div>
2007
+
2008
+ <?php
2009
+ }
2010
+
2011
+ private function settings_downloadingandrestoring($backup_history = array()) {
2012
+ global $updraftplus;
2013
+ //<td class="download-backups" style="display:none; border: 2px dashed #aaa;">
2014
+ ?>
2015
+ <div class="download-backups form-table">
2016
+ <h2><?php echo __('Existing Backups: Downloading And Restoring', 'updraftplus'); ?></h2>
2017
+ <p style="display:none; background-color:pink; padding:8px; margin:4px;border: 1px dotted;" id="ud-whitespace-warning">
2018
+ <?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="http://updraftplus.com/problems-with-extra-white-space/">'.__('Please consult this FAQ for help on what to do about it.', 'updraftplus').'</a>';?>
2019
+ </p>
2020
  <p>
2021
+ <ul style="list-style: disc inside; max-width: 1000px;">
2022
+ <li><strong><?php _e('Downloading','updraftplus');?>:</strong> <?php _e("Pressing a button for Database/Plugins/Themes/Uploads/Others will make UpdraftPlus try to bring the backup file back from the remote storage (if any - e.g. Amazon S3, Dropbox, Google Drive, FTP) to your webserver. Then you will be allowed to download it to your computer. If the fetch from the remote storage stops progressing (wait 30 seconds to make sure), then press again to resume. Remember that you can also visit the cloud storage vendor's website directly.",'updraftplus');?></li>
2023
+ <li>
2024
+ <strong><?php _e('Restoring:','updraftplus');?></strong> <?php _e('Press the Restore button next to the chosen backup set.', 'updraftplus');?>
2025
+ </li>
2026
+ <li>
2027
+ <strong><?php _e('More tasks:','updraftplus');?></strong>
2028
+ <a href="#" onclick="jQuery('#updraft-plupload-modal').slideToggle(); return false;"><?php _e('Upload backup files','updraftplus');?></a>
2029
+ | <a href="#" onclick="updraft_updatehistory(1, 0); return false;" title="<?php _e('Press here to look inside your UpdraftPlus directory (in your web hosting space) for any new backup sets that you have uploaded. The location of this directory is set in the expert settings, below.','updraftplus'); ?>"><?php _e('Rescan local folder for new backup sets','updraftplus');?></a>
2030
+ | <a href="#" onclick="updraft_updatehistory(1, 1); return false;" title="<?php _e('Press here to look inside any remote storage methods for any existing backup sets.','updraftplus'); ?>"><?php _e('Rescan remote storage','updraftplus');?></a>
2031
+ </li>
2032
+ <?php
2033
+ if (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') || false !== strpos($_SERVER['HTTP_USER_AGENT'], 'OPR/')) { ?>
2034
+ <li><strong><?php _e('Opera web browser','updraftplus');?>:</strong> <?php _e('If you are using this, then turn Turbo/Road mode off.','updraftplus');?></li>
2035
+ <?php } ?>
2036
+ <?php
2037
+ $service = UpdraftPlus_Options::get_updraft_option('updraft_service');
2038
+ if ($service === 'googledrive' || (is_array($service) && in_array('googledrive', $service))) {
2039
+ ?><li><strong><?php _e('Google Drive','updraftplus');?>:</strong> <?php _e('Google changed their permissions setup recently (April 2013). To download or restore from Google Drive, you <strong>must</strong> first re-authenticate (using the link in the Google Drive configuration section).','updraftplus');?></li>
2040
+ <?php } ?>
2041
+
2042
+ <li title="<?php _e('This is a count of the contents of your Updraft directory','updraftplus');?>"><strong><?php _e('Web-server disk space in use by UpdraftPlus','updraftplus');?>:</strong> <span id="updraft_diskspaceused"><em>(calculating...)</em></span> <a href="#" onclick="updraftplus_diskspace(); return false;"><?php _e('refresh','updraftplus');?></a></li></ul>
2043
+ </p>
2044
+
2045
+ <div id="updraft-plupload-modal" title="<?php _e('UpdraftPlus - Upload backup files','updraftplus'); ?>" style="width: 75%; margin: 16px; display:none; margin-left: 100px;">
2046
+ <p style="max-width: 610px;"><em><?php _e("Upload files into UpdraftPlus. Use this to import backups made on a different WordPress installation." ,'updraftplus');?> <?php echo htmlspecialchars(__('Or, you can place them manually into your UpdraftPlus directory (usually wp-content/updraft), e.g. via FTP, and then use the "rescan" link above.', 'updraftplus'));?></em></p>
2047
+ <?php
2048
+ global $wp_version;
2049
+ if (version_compare($wp_version, '3.3', '<')) {
2050
+ echo '<em>'.sprintf(__('This feature requires %s version %s or later', 'updraftplus'), 'WordPress', '3.3').'</em>';
2051
+ } else {
2052
+ ?>
2053
+ <div id="plupload-upload-ui" style="width: 70%;">
2054
+ <div id="drag-drop-area">
2055
+ <div class="drag-drop-inside">
2056
+ <p class="drag-drop-info"><?php _e('Drop backup files here', 'updraftplus'); ?></p>
2057
+ <p><?php _ex('or', 'Uploader: Drop backup files here - or - Select Files'); ?></p>
2058
+ <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
2059
+ </div>
2060
+ </div>
2061
+ <div id="filelist">
2062
+ </div>
2063
+ </div>
2064
+ <?php
2065
+ }
2066
+ ?>
2067
+
2068
+ </div>
2069
+
2070
+ <div id="ud_downloadstatus"></div>
2071
+ <div id="updraft_existing_backups" style="margin-bottom:12px;">
2072
+ <?php
2073
+ print $this->existing_backup_table($backup_history);
2074
+ ?>
2075
+ </div>
2076
+ </div>
2077
+
2078
+ <div id="updraft-message-modal" title="UpdraftPlus">
2079
+ <div id="updraft-message-modal-innards" style="padding: 4px;">
2080
+ </div>
2081
+ </div>
2082
+
2083
+ <div id="updraft-delete-modal" title="<?php _e('Delete backup set', 'updraftplus');?>">
2084
+ <form id="updraft_delete_form" method="post">
2085
+ <p style="margin-top:3px; padding-top:0">
2086
+ <?php _e('Are you sure that you wish to remove this backup set from UpdraftPlus?', 'updraftplus'); ?>
2087
+ </p>
2088
+ <fieldset>
2089
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('updraftplus-credentialtest-nonce');?>">
2090
+ <input type="hidden" name="action" value="updraft_ajax">
2091
+ <input type="hidden" name="subaction" value="deleteset">
2092
+ <input type="hidden" name="backup_timestamp" value="0" id="updraft_delete_timestamp">
2093
+ <input type="hidden" name="backup_nonce" value="0" id="updraft_delete_nonce">
2094
+ <div id="updraft-delete-remote-section"><input checked="checked" type="checkbox" name="delete_remote" id="updraft_delete_remote" value="1"> <label for="updraft_delete_remote"><?php _e('Also delete from remote storage', 'updraftplus');?></label><br>
2095
+ <p id="updraft-delete-waitwarning" style="display:none;"><em><?php _e('Deleting... please allow time for the communications with the remote storage to complete.', 'updraftplus');?></em></p>
2096
+ </div>
2097
+ </fieldset>
2098
+ </form>
2099
+ </div>
2100
+
2101
+ <div id="updraft-restore-modal" title="UpdraftPlus - <?php _e('Restore backup','updraftplus');?>">
2102
+ <p><strong><?php _e('Restore backup from','updraftplus');?>:</strong> <span class="updraft_restore_date"></span></p>
2103
+
2104
+ <div id="updraft-restore-modal-stage2">
2105
+
2106
+ <p><strong><?php _e('Retrieving (if necessary) and preparing backup files...', 'updraftplus');?></strong></p>
2107
+ <div id="ud_downloadstatus2"></div>
2108
+
2109
+ <div id="updraft-restore-modal-stage2a"></div>
2110
+
2111
+ </div>
2112
+
2113
+ <div id="updraft-restore-modal-stage1">
2114
+ <p><?php _e("Restoring will replace this site's themes, plugins, uploads, database and/or other content directories (according to what is contained in the backup set, and your selection).",'updraftplus');?> <?php _e('Choose the components to restore','updraftplus');?>:</p>
2115
+ <form id="updraft_restore_form" method="post">
2116
+ <fieldset>
2117
+ <input type="hidden" name="action" value="updraft_restore">
2118
+ <input type="hidden" name="backup_timestamp" value="0" id="updraft_restore_timestamp">
2119
+ <input type="hidden" name="meta_foreign" value="0" id="updraft_restore_meta_foreign">
2120
+ <?php
2121
+
2122
+ # 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
2123
+ if($updraftplus->detect_safe_mode()) {
2124
+ 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="http://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</a>.', 'updraftplus')."</em></p><br/>";
2125
+ }
2126
+
2127
+ $backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
2128
+ foreach ($backupable_entities as $type => $info) {
2129
+ if (!isset($info['restorable']) || $info['restorable'] == true) {
2130
+ echo '<div><input id="updraft_restore_'.$type.'" type="checkbox" name="updraft_restore[]" value="'.$type.'"> <label id="updraft_restore_label_'.$type.'" for="updraft_restore_'.$type.'">'.$info['description'].'</label><br>';
2131
+
2132
+ do_action("updraftplus_restore_form_$type");
2133
+
2134
+ echo '</div>';
2135
+ } else {
2136
+ $sdescrip = isset($info['shortdescription']) ? $info['shortdescription'] : $info['description'];
2137
+ echo "<div style=\"margin: 8px 0;\"><em>".htmlspecialchars(sprintf(__('The following entity cannot be restored automatically: "%s".', 'updraftplus'), $sdescrip))." ".__('You will need to restore it manually.', 'updraftplus')."</em><br>".'<input id="updraft_restore_'.$type.'" type="hidden" name="updraft_restore[]" value="'.$type.'"></div>';
2138
+ }
2139
+ }
2140
+ ?>
2141
+ <div><input id="updraft_restore_db" type="checkbox" name="updraft_restore[]" value="db"> <label for="updraft_restore_db"><?php _e('Database','updraftplus'); ?></label><br>
2142
+
2143
+
2144
+ <div id="updraft_restorer_dboptions" style="display:none; padding:12px; margin: 8px 0 4px; border: dashed 1px;"><h4 style="margin: 0px 0px 6px; padding:0px;"><?php echo sprintf(__('%s restoration options:','updraftplus'),__('Database','updraftplus')); ?></h4>
2145
+
2146
+ <?php
2147
+
2148
+ do_action("updraftplus_restore_form_db");
2149
+
2150
+ if (!class_exists('UpdraftPlus_Addons_Migrator')) {
2151
+
2152
+ echo '<a href="http://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>';
2153
+
2154
+ }
2155
+
2156
+ ?>
2157
+
2158
+ </div>
2159
+
2160
+ </div>
2161
+ </fieldset>
2162
+ </form>
2163
+ <p><em><a href="http://updraftplus.com/faqs/what-should-i-understand-before-undertaking-a-restoration/" target="_new"><?php _e('Do read this helpful article of useful things to know before restoring.','updraftplus');?></a></em></p>
2164
+ </div>
2165
+
2166
+ </div>
2167
+
2168
+ <?php
2169
+ }
2170
+
2171
+ public function settings_debugrow($head, $content) {
2172
+ echo "<tr class=\"updraft_debugrow\"><th>$head</th><td>$content</td></tr>";
2173
+ }
2174
+
2175
+ private function settings_expertsettings($backup_disabled) {
2176
+ global $updraftplus, $wpdb;
2177
+ $backupable_entities = $updraftplus->get_backupable_file_entities(true, true);
2178
+ ?>
2179
+ <div class="expertmode">
2180
+ <!-- <h2><?php _e('Debug Information And Expert Options','updraftplus');?></h2> -->
2181
+ <table>
2182
  <?php
2183
+
2184
+ $this->settings_debugrow(__('Web server:','updraftplus'), htmlspecialchars($_SERVER["SERVER_SOFTWARE"]).' ('.htmlspecialchars(php_uname()).')');
2185
+
2186
+ $this->settings_debugrow('ABSPATH:', htmlspecialchars(ABSPATH));
2187
+ $this->settings_debugrow('WP_CONTENT_DIR:', htmlspecialchars(WP_CONTENT_DIR));
2188
+ $this->settings_debugrow('WP_PLUGIN_DIR:', htmlspecialchars(WP_PLUGIN_DIR));
2189
+ $this->settings_debugrow('Table prefix:', htmlspecialchars($updraftplus->get_table_prefix()));
2190
  $peak_memory_usage = memory_get_peak_usage(true)/1024/1024;
2191
  $memory_usage = memory_get_usage(true)/1024/1024;
2192
+ $this->settings_debugrow(__('Peak memory usage','updraftplus').':', $peak_memory_usage.' MB');
2193
+ $this->settings_debugrow(__('Current memory usage','updraftplus').':', $memory_usage.' MB');
2194
+ $this->settings_debugrow(__('Memory limit', 'updraftplus').':', htmlspecialchars(ini_get('memory_limit')));
2195
+ $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>');
2196
+ $this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'MySQL'), htmlspecialchars($wpdb->db_version()));
 
 
 
2197
  if (function_exists('curl_version') && function_exists('curl_exec')) {
2198
  $cv = curl_version();
2199
+ $cvs = $cv['version'].' / SSL: '.$cv['ssl_version'].' / libz: '.$cv['libz_version'];
2200
  } else {
2201
+ $cvs = '-';
2202
  }
2203
+ $this->settings_debugrow(sprintf(__('%s version:','updraftplus'), 'Curl'), htmlspecialchars($cvs));
 
 
2204
  if (version_compare(phpversion(), '5.2.0', '>=') && extension_loaded('zip')) {
2205
  $ziparchive_exists = __('Yes', 'updraftplus');
2206
  } else {
2207
  # First do class_exists, because method_exists still sometimes segfaults due to a rare PHP bug
2208
  $ziparchive_exists = (class_exists('ZipArchive') && method_exists('ZipArchive', 'addFile')) ? __('Yes', 'updraftplus') : __('No', 'updraftplus');
2209
  }
2210
+ $this->settings_debugrow('ZipArchive::addFile:', $ziparchive_exists);
 
 
2211
  $binzip = $updraftplus->find_working_bin_zip(false, false);
2212
+ $this->settings_debugrow(__('zip executable found:', 'updraftplus'), __('zip executable found:', 'updraftplus').' '.((is_string($binzip)) ? __('Yes').': '.$binzip : __('No')));
 
 
2213
  $hosting_bytes_free = $updraftplus->get_hosting_disk_quota_free();
2214
  if (is_array($hosting_bytes_free)) {
2215
  $perc = round(100*$hosting_bytes_free[1]/(max($hosting_bytes_free[2], 1)), 1);
2216
+ $this->settings_debugrow(__('Free disk space in account:', 'updraftplus'), sprintf(__('%s (%s used)', 'updraftplus'), round($hosting_bytes_free[3]/1048576, 1)." Mb", "$perc %"));
2217
  }
2218
+
2219
+ $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> | <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>');
2220
 
2221
+ $this->settings_debugrow("HTTP Get: ", '<input id="updraftplus_httpget_uri" type="text" style="width: 300px; height: 22px;"> <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>');
2222
 
2223
+ $this->settings_debugrow("Call WordPress action:", '<input id="updraftplus_callwpaction" type="text" style="width: 300px; height: 22px;"> <a href="#" id="updraftplus_callwpaction_go">'.__('Call', 'updraftplus').'</a><div id="updraftplus_callwpaction_results"></div>');
2224
 
2225
+ $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>');
 
 
 
 
2226
 
2227
+ echo '</table>';
2228
+
2229
+ do_action('updraftplus_debugtools_dashboard');
 
2230
 
2231
  echo '<h3>'.__('Total (uncompressed) on-disk data:','updraftplus').'</h3>';
2232
+ echo '<p style="clear: left; max-width: 600px;"><em>'.__('N.B. This count is based upon what was, or was not, excluded the last time you saved the options.', 'updraftplus').'</em></p><table>';
2233
 
2234
  foreach ($backupable_entities as $key => $info) {
2235
 
2236
  $sdescrip = preg_replace('/ \(.*\)$/', '', $info['description']);
2237
  if (strlen($sdescrip) > 20 && isset($info['shortdescription'])) $sdescrip = $info['shortdescription'];
2238
 
2239
+ // echo '<div style="clear: left;float:left; width:150px;">'.ucfirst($sdescrip).':</strong></div><div style="float:left;"><span id="updraft_diskspaceused_'.$key.'"><em></em></span> <a href="#" onclick="updraftplus_diskspace_entity(\''.$key.'\'); return false;">'.__('count','updraftplus').'</a></div>';
2240
+ $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>');
2241
  }
2242
 
2243
  ?>
2244
 
2245
+ </table></p>
2246
+ <p style="clear: left; padding-top: 20px; max-width: 600px; margin:0;"><?php _e('The buttons below will immediately execute a backup run, independently of WordPress\'s scheduler. If these work whilst your scheduled backups do absolutely nothing (i.e. not even produce a log file), then it means that your scheduler is broken.','updraftplus');?> <a href="http://updraftplus.com/faqs/my-scheduled-backups-and-pressing-backup-now-does-nothing-however-pressing-debug-backup-does-produce-a-backup/"><?php _e('Go here for more information.', 'updraftplus'); ?></a></p>
2247
 
2248
  <table border="0" style="border: none;">
2249
  <tbody>
2269
  <p><input type="submit" class="button-primary" value="<?php _e('Wipe All Settings','updraftplus'); ?>" onclick="return(confirm('<?php echo htmlspecialchars(__('This will delete all your UpdraftPlus settings - are you sure you want to do this?'));?>'))" /></p>
2270
  </form>
2271
  </div>
2272
+ <?php
 
2273
  }
2274
 
2275
  function print_delete_old_dirs_form($include_blurb = true) {
2692
 
2693
  }
2694
 
2695
+ public function get_intervals() {
2696
+ return apply_filters('updraftplus_backup_intervals', array(
2697
+ "manual" => _x("Manual", 'i.e. Non-automatic', 'updraftplus'),
2698
+ 'every4hours' => sprintf(__("Every %s hours", 'updraftplus'), '4'),
2699
+ 'every8hours' => sprintf(__("Every %s hours", 'updraftplus'), '8'),
2700
+ 'twicedaily' => sprintf(__("Every %s hours", 'updraftplus'), '12'),
2701
+ 'daily' => __("Daily", 'updraftplus'),
2702
+ 'weekly' => __("Weekly", 'updraftplus'),
2703
+ 'fortnightly' => __("Fortnightly", 'updraftplus'),
2704
+ 'monthly' => __("Monthly", 'updraftplus')
2705
+ ));
2706
+ }
2707
+
2708
+ private function settings_formcontents($last_backup_html) {
2709
 
2710
  global $updraftplus;
2711
 
2712
  $updraft_dir = $updraftplus->backups_dir_location();
2713
 
2714
  ?>
2715
+ <table class="form-table">
2716
  <tr>
2717
  <th><?php _e('File backup intervals','updraftplus'); ?>:</th>
2718
+ <td><select id="updraft_interval" name="updraft_interval" onchange="jQuery(document).trigger('updraftplus_interval_changed'); updraft_check_same_times();">
2719
  <?php
2720
+ $intervals = $this->get_intervals();
2721
+ $selected_interval = UpdraftPlus_Options::get_updraft_option('updraft_interval','manual');
 
 
 
 
 
 
 
 
2722
  foreach ($intervals as $cronsched => $descrip) {
2723
  echo "<option value=\"$cronsched\" ";
2724
+ if ($cronsched == $selected_interval) echo 'selected="selected"';
2725
+ echo ">".htmlspecialchars($descrip)."</option>\n";
2726
  }
2727
  ?>
2728
  </select> <span id="updraft_files_timings"><?php echo apply_filters('updraftplus_schedule_showfileopts', '<input type="hidden" name="updraftplus_starttime_files" value="">'); ?></span>
2733
  ?> <input type="number" min="1" step="1" name="updraft_retain" value="<?php echo $updraft_retain ?>" style="width:48px;" />
2734
  </td>
2735
  </tr>
2736
+ <?php apply_filters('updraftplus_after_file_intervals', false, $selected_interval); ?>
2737
  <tr>
2738
  <th><?php _e('Database backup intervals','updraftplus'); ?>:</th>
2739
  <td><select id="updraft_interval_database" name="updraft_interval_database" onchange="updraft_check_same_times();">
2753
  </td>
2754
  </tr>
2755
  <tr class="backup-interval-description">
2756
+ <td></td><td><div style="max-width:670px;"><p><?php echo htmlspecialchars(__('If you would like to automatically schedule backups, choose schedules from the dropdowns above. Backups will occur at the intervals specified. If the two schedules are the same, then the two backups will take place together. If you choose "manual" then you must click the "Backup Now" button whenever you wish a backup to occur.', 'updraftplus')); ?></p>
2757
  <?php echo apply_filters('updraftplus_fixtime_ftinfo', '<p><strong>'.__('To fix the time at which a backup should take place,','updraftplus').' </strong> ('.__('e.g. if your server is busy at day and you want to run overnight','updraftplus').'), <a href="http://updraftplus.com/shop/updraftplus-premium/">'.htmlspecialchars(__('use UpdraftPlus Premium', 'updraftplus')).'</a></p>'); ?>
2758
+ </div></td>
2759
  </tr>
2760
  <tr>
2761
  <th><?php _e('Include in files backup','updraftplus');?>:</th>
2797
 
2798
  </table>
2799
 
2800
+ <h2><?php _e('Database Options','updraftplus');?></h2>
2801
 
2802
  <table class="form-table" style="width:900px;">
2803
 
2988
  <tr>
2989
  <td colspan="2"><h2><?php _e('Advanced / Debugging Settings','updraftplus'); ?></h2></td>
2990
  </tr>
2991
+
 
 
 
2992
  <tr>
2993
  <th><?php _e('Expert settings','updraftplus');?>:</th>
2994
  <td><a id="enableexpertmode" href="#enableexpertmode"><?php _e('Show expert settings','updraftplus');?></a> - <?php _e("click this to show some further options; don't bother with this unless you have a problem or are curious.",'updraftplus');?> <?php do_action('updraftplus_expertsettingsdescription'); ?></td>
3000
  if ($split_every_mb < UPDRAFTPLUS_SPLIT_MIN) $split_every_mb = UPDRAFTPLUS_SPLIT_MIN;
3001
  ?>
3002
 
3003
+ <tr class="expertmode" style="display:none;">
3004
+ <th><?php _e('Debug mode','updraftplus');?>:</th>
3005
+ <td><input type="checkbox" id="updraft_debug_mode" name="updraft_debug_mode" value="1" <?php echo $debug_mode; ?> /> <br><label for="updraft_debug_mode"><?php _e('Check this to receive more information and emails on the backup process - useful if something is going wrong.','updraftplus');?> <?php _e('This will also cause debugging output from all plugins to be shown upon this screen - please do not be surprised to see these.', 'updraftplus');?></label></td>
3006
+ </tr>
3007
+
3008
  <tr class="expertmode" style="display:none;">
3009
  <th><?php _e('Split archives every:','updraftplus');?></th>
3010
  <td><input type="text" name="updraft_split_every" id="updraft_split_every" value="<?php echo $split_every_mb ?>" size="5" /> Mb<br><?php _e('UpdraftPlus will split up backup archives when they exceed this file size. The default value is 800 megabytes. Be careful to leave some margin if your web-server has a hard size limit (e.g. the 2 Gb / 2048 Mb limit on some 32-bit servers/file systems).','updraftplus'); ?></td>
3219
 
3220
  $nonce_field = wp_nonce_field('updraftplus_download', '_wpnonce', true, false);
3221
 
3222
+ if (empty($backup_history)) {
3223
+ $ret .= "<p><em>".__('You have not yet made any backups.', 'updraftplus')."</em></p>";
3224
+ }
3225
+
3226
+ foreach ($backup_history as $key=>$backup) {
3227
  # https://core.trac.wordpress.org/ticket/25331
3228
  # $pretty_date = date_i18n('Y-m-d G:i',$key);
3229
  // Convert to blog time zone
3383
  $ret .= '<td>';
3384
  if (isset($backup['nonce']) && preg_match("/^[0-9a-f]{12}$/",$backup['nonce']) && is_readable($updraft_dir.'/log.'.$backup['nonce'].'.txt')) {
3385
  $nval = $backup['nonce'];
3386
+ $lt = esc_attr(__('Backup Log','updraftplus'));
3387
  $url = UpdraftPlus_Options::admin_page();
3388
  $ret .= <<<ENDHERE
3389
  <form action="$url" method="get">
3431
 
3432
  global $updraftplus;
3433
  $messages = array();
3434
+ $gmt_offset = get_option('gmt_offset');
3435
 
3436
  $known_files = array();
3437
  $known_nonces = array();
3530
  $potmessage = false;
3531
  if ('.' == $entry || '..' == $entry) continue;
3532
  if (preg_match('/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-([\-a-z]+)([0-9]+(of[0-9]+)?)?\.(zip|gz|gz\.crypt)$/i', $entry, $matches)) {
3533
+
3534
+ // Interpret the time as one from the blog's local timezone, rather than as UTC
3535
+ # $matches[1] is YYYY-MM-DD-HHmm, to be interpreted as being the local timezone
3536
+ $btime2 = strtotime($matches[1]);
3537
+ $btime = (!empty($offset)) ? $btime2 - $gmt_offset*3600 : $btime2;
3538
+
3539
  $nonce = $matches[2];
3540
  $type = $matches[3];
3541
  if ('db' == $type) {
3631
  $index = (empty($matches[4])) ? '0' : (max((int)$matches[4]-1,0));
3632
  }
3633
  $itext = ($index == 0) ? '' : $index;
3634
+ $btime2 = strtotime($matches[1]);
3635
+ $btime = (!empty($offset)) ? $btime2 - $gmt_offset*3600 : $btime2;
3636
+
3637
  if (isset($known_nonces[$nonce])) $btime = $known_nonces[$nonce];
3638
  if ($btime <= 100) continue;
3639
  # Remember that at this point, we already know that the file is not known about locally
3724
 
3725
  $this->show_admin_warning('<a target="_new" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($updraftplus->nonce).'">'.__('Follow this link to download the log file for this restoration (needed for any support requests).', 'updraftplus').'</a>');
3726
 
 
3727
  $updraft_dir = trailingslashit($updraftplus->backups_dir_location());
3728
  $foreign_known = apply_filters('updraftplus_accept_archivename', array());
3729
 
4021
  return $input;
4022
  }
4023
 
4024
+ # TODO: Remove legacy storage setting keys from here
4025
  private function get_settings_keys() {
4026
+ return array('updraft_autobackup_default', 'updraft_dropbox', 'updraft_googledrive', 'updraftplus_tmp_googledrive_access_token', 'updraftplus_dismissedautobackup', 'updraftplus_dismissedexpiry', 'updraft_interval', 'updraft_interval_increments', 'updraft_interval_database', 'updraft_retain', 'updraft_retain_db', 'updraft_encryptionphrase', 'updraft_service', 'updraft_dropbox_appkey', 'updraft_dropbox_secret', 'updraft_googledrive_clientid', 'updraft_googledrive_secret', 'updraft_googledrive_remotepath', 'updraft_ftp_login', 'updraft_ftp_pass', 'updraft_ftp_remote_path', 'updraft_server_address', 'updraft_dir', 'updraft_email', 'updraft_delete_local', 'updraft_debug_mode', 'updraft_include_plugins', 'updraft_include_themes', 'updraft_include_uploads', 'updraft_include_others', 'updraft_include_wpcore', 'updraft_include_wpcore_exclude', 'updraft_include_more', 'updraft_include_blogs', 'updraft_include_mu-plugins', 'updraft_include_others_exclude', 'updraft_include_uploads_exclude',
4027
+ 'updraft_lastmessage', 'updraft_googledrive_token', 'updraft_dropboxtk_request_token', 'updraft_dropboxtk_access_token', 'updraft_dropbox_folder',
4028
  'updraft_last_backup', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_db', 'updraft_startday_files', 'updraft_sftp_settings', 'updraft_s3', 'updraft_s3generic', 'updraft_dreamhost', 'updraft_s3generic_login', 'updraft_s3generic_pass', 'updraft_s3generic_remote_path', 'updraft_s3generic_endpoint', 'updraft_webdav_settings', 'updraft_disable_ping', 'updraft_openstack', 'updraft_bitcasa', 'updraft_cloudfiles', 'updraft_cloudfiles_user', 'updraft_cloudfiles_apikey', 'updraft_cloudfiles_path', 'updraft_cloudfiles_authurl', 'updraft_ssl_useservercerts', 'updraft_ssl_disableverify', 'updraft_s3_login', 'updraft_s3_pass', 'updraft_s3_remote_path', 'updraft_dreamobjects_login', 'updraft_dreamobjects_pass', 'updraft_dreamobjects_remote_path', 'updraft_report_warningsonly', 'updraft_report_wholebackup', 'updraft_log_syslog', 'updraft_extradatabases');
4029
  }
4030
 
backup.php CHANGED
@@ -527,7 +527,26 @@ class UpdraftPlus_Backup {
527
 
528
  $subject = apply_filters('updraft_report_subject', sprintf(__('Backed up: %s', 'updraftplus'), get_bloginfo('name')).' (UpdraftPlus '.$updraftplus->version.') '.get_date_from_gmt(gmdate('Y-m-d H:i:s', time()), 'Y-m-d H:i'), $error_count, count($warnings));
529
 
530
- $body = apply_filters('updraft_report_body', __('Backup of:').' '.site_url()."\r\nUpdraftPlus ".__('WordPress backup is complete','updraftplus').".\r\n".__('Backup contains:','updraftplus').' '.$backup_contains."\r\n".__('Latest status:', 'updraftplus').' '.$final_message."\r\n\r\n".$updraftplus->wordshell_random_advert(0)."\r\n".$append_log, $final_message, $backup_contains, $updraftplus->errors, $warnings);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
 
532
  $this->attachments = apply_filters('updraft_report_attachments', $attachments);
533
 
@@ -871,6 +890,7 @@ class UpdraftPlus_Backup {
871
  $file_base = 'backup_'.get_date_from_gmt(gmdate('Y-m-d H:i:s', $updraftplus->backup_time), 'Y-m-d-Hi').'_'.$this->blog_name.'_'.$updraftplus->nonce;
872
  $backup_file_base = $this->updraft_dir.'/'.$file_base;
873
 
 
874
  if ('encrypted' == $already_done) return basename($backup_file_base).'-db'.(('wp' == $whichdb) ? '' : $whichdb).'.gz.crypt';
875
 
876
  $updraftplus->jobdata_set('jobstatus', 'dbcreating'.$this->whichdb_suffix);
@@ -970,8 +990,7 @@ class UpdraftPlus_Backup {
970
  $where = '';
971
  }
972
 
973
- # TODO: If no check-in last time, then try the other method (but - any point in retrying slow method on large tables??)
974
-
975
  $bindump = (isset($rows) && $rows>8000 && is_string($binsqldump)) ? $this->backup_table_bindump($binsqldump, $table, $where) : false;
976
  if (true !== $bindump) $this->backup_table($table, $where);
977
 
@@ -1085,6 +1104,7 @@ class UpdraftPlus_Backup {
1085
  $pfile = md5(time().rand()).'.tmp';
1086
  file_put_contents($this->updraft_dir.'/'.$pfile, "[mysqldump]\npassword=".$this->dbinfo['pass']."\n");
1087
 
 
1088
  if ($where) $where="--where=".escapeshellarg($where);
1089
 
1090
  $exec = "cd ".escapeshellarg($this->updraft_dir)."; $potsql --defaults-file=$pfile $where --max_allowed_packet=1M --quote-names --add-drop-table --skip-comments --skip-set-charset --allow-keywords --dump-date --extended-insert --user=".escapeshellarg($this->dbinfo['user'])." --host=".escapeshellarg($this->dbinfo['host'])." ".$this->dbinfo['name']." ".escapeshellarg($table_name);
527
 
528
  $subject = apply_filters('updraft_report_subject', sprintf(__('Backed up: %s', 'updraftplus'), get_bloginfo('name')).' (UpdraftPlus '.$updraftplus->version.') '.get_date_from_gmt(gmdate('Y-m-d H:i:s', time()), 'Y-m-d H:i'), $error_count, count($warnings));
529
 
530
+ # The class_exists() check here is a micro-optimization to prevent a possible HTTP call whose results may be disregarded by the filter
531
+ $feed = '';
532
+ if (!class_exists('UpdraftPlus_Addon_Reporting') && !defined('UPDRAFTPLUS_NOADS_A') && !defined('UPDRAFTPLUS_NONEWSFEED')) {
533
+ $updraftplus->log('Fetching RSS news feed');
534
+ $rss = $updraftplus->get_updraftplus_rssfeed();
535
+ $updraftplus->log('Fetched RSS news feed; result is a: '.get_class($rss));
536
+ if (is_a($rss, 'SimplePie')) {
537
+ $feed .= __('Email reports created by UpdraftPlus (free edition) bring you the latest UpdraftPlus.com news', 'updraftplus')." - ".sprintf(__('read more at %s', 'updraftplus'), 'http://updraftplus.com/news/')."\r\n\r\n";
538
+ foreach ($rss->get_items(0, 6) as $item) {
539
+ $feed .= '* ';
540
+ $feed .= $item->get_title();
541
+ $feed .= " (".$item->get_date('j F Y').")";
542
+ #$feed .= ' - '.$item->get_permalink();
543
+ $feed .= "\r\n";
544
+ }
545
+ }
546
+ $feed .= "\r\n\r\n";
547
+ }
548
+
549
+ $body = apply_filters('updraft_report_body', __('Backup of:').' '.site_url()."\r\nUpdraftPlus ".__('WordPress backup is complete','updraftplus').".\r\n".__('Backup contains:','updraftplus').' '.$backup_contains."\r\n".__('Latest status:', 'updraftplus').' '.$final_message."\r\n\r\n".$feed.$updraftplus->wordshell_random_advert(0)."\r\n".$append_log, $final_message, $backup_contains, $updraftplus->errors, $warnings);
550
 
551
  $this->attachments = apply_filters('updraft_report_attachments', $attachments);
552
 
890
  $file_base = 'backup_'.get_date_from_gmt(gmdate('Y-m-d H:i:s', $updraftplus->backup_time), 'Y-m-d-Hi').'_'.$this->blog_name.'_'.$updraftplus->nonce;
891
  $backup_file_base = $this->updraft_dir.'/'.$file_base;
892
 
893
+ if ('finished' == $already_done) return basename($backup_file_base).'-db'.(('wp' == $whichdb) ? '' : $whichdb).'.gz';
894
  if ('encrypted' == $already_done) return basename($backup_file_base).'-db'.(('wp' == $whichdb) ? '' : $whichdb).'.gz.crypt';
895
 
896
  $updraftplus->jobdata_set('jobstatus', 'dbcreating'.$this->whichdb_suffix);
990
  $where = '';
991
  }
992
 
993
+ # If no check-in last time, then we could in future try the other method (but - any point in retrying slow method on large tables??)
 
994
  $bindump = (isset($rows) && $rows>8000 && is_string($binsqldump)) ? $this->backup_table_bindump($binsqldump, $table, $where) : false;
995
  if (true !== $bindump) $this->backup_table($table, $where);
996
 
1104
  $pfile = md5(time().rand()).'.tmp';
1105
  file_put_contents($this->updraft_dir.'/'.$pfile, "[mysqldump]\npassword=".$this->dbinfo['pass']."\n");
1106
 
1107
+ # Note: escapeshellarg() adds quotes around the string
1108
  if ($where) $where="--where=".escapeshellarg($where);
1109
 
1110
  $exec = "cd ".escapeshellarg($this->updraft_dir)."; $potsql --defaults-file=$pfile $where --max_allowed_packet=1M --quote-names --add-drop-table --skip-comments --skip-set-charset --allow-keywords --dump-date --extended-insert --user=".escapeshellarg($this->dbinfo['user'])." --host=".escapeshellarg($this->dbinfo['host'])." ".$this->dbinfo['name']." ".escapeshellarg($table_name);
includes/Dropbox/OAuth/Consumer/ConsumerAbstract.php CHANGED
@@ -93,7 +93,9 @@ abstract class Dropbox_ConsumerAbstract
93
  }
94
  global $updraftplus;
95
  $updraftplus->log('Dropbox reauthorisation needed; but we are running from cron, AJAX or the CLI, so this is not possible');
96
- UpdraftPlus_Options::update_updraft_option("updraft_dropboxtk_request_token", '');
 
 
97
  throw new Dropbox_Exception(sprintf(__('You need to re-authenticate with %s, as your existing credentials are not working.', 'updraftplus'), 'Dropbox'));
98
  #$updraftplus->log(sprintf(__('You need to re-authenticate with %s, as your existing credentials are not working.', 'updraftplus'), 'Dropbox'), 'error');
99
  return false;
93
  }
94
  global $updraftplus;
95
  $updraftplus->log('Dropbox reauthorisation needed; but we are running from cron, AJAX or the CLI, so this is not possible');
96
+ $opts = UpdraftPlus_Options::get_updraft_option("updraft_dropbox");
97
+ $opts['tk_request_token'] = '';
98
+ UpdraftPlus_Options::update_updraft_option("updraft_dropbox", $opts);
99
  throw new Dropbox_Exception(sprintf(__('You need to re-authenticate with %s, as your existing credentials are not working.', 'updraftplus'), 'Dropbox'));
100
  #$updraftplus->log(sprintf(__('You need to re-authenticate with %s, as your existing credentials are not working.', 'updraftplus'), 'Dropbox'), 'error');
101
  return false;
includes/Dropbox/OAuth/Storage/WordPress.php CHANGED
@@ -18,6 +18,12 @@ class Dropbox_WordPress implements Dropbox_StorageInterface
18
  */
19
  protected $option_name_prefix = 'dropbox_token';
20
 
 
 
 
 
 
 
21
  /**
22
  * Encyption object
23
  * @var Encrypter|null
@@ -28,13 +34,14 @@ class Dropbox_WordPress implements Dropbox_StorageInterface
28
  * Check if an instance of the encrypter is passed, set the encryption object
29
  * @return void
30
  */
31
- public function __construct(Dropbox_Encrypter $encrypter = null, $option_name_prefix = 'dropbox_token')
32
  {
33
  if ($encrypter instanceof Dropbox_Encrypter) {
34
  $this->encrypter = $encrypter;
35
  }
36
 
37
  $this->option_name_prefix = $option_name_prefix;
 
38
 
39
  }
40
 
@@ -49,9 +56,12 @@ class Dropbox_WordPress implements Dropbox_StorageInterface
49
  if ($type != 'request_token' && $type != 'access_token') {
50
  throw new Dropbox_Exception("Expected a type of either 'request_token' or 'access_token', got '$type'");
51
  } else {
52
- if (false !== ($gettoken = UpdraftPlus_Options::get_updraft_option($this->option_name_prefix.$type))) {
53
- $token = $this->decrypt($gettoken);
54
- return $token;
 
 
 
55
  }
56
  return false;
57
  }
@@ -70,7 +80,9 @@ class Dropbox_WordPress implements Dropbox_StorageInterface
70
  throw new Dropbox_Exception("Expected a type of either 'request_token' or 'access_token', got '$type'");
71
  } else {
72
  $token = $this->encrypt($token);
73
- UpdraftPlus_Options::update_updraft_option($this->option_name_prefix.$type, $token);
 
 
74
  }
75
  }
76
 
@@ -80,8 +92,10 @@ class Dropbox_WordPress implements Dropbox_StorageInterface
80
  */
81
  public function delete()
82
  {
83
- UpdraftPlus_Options::delete_updraft_option($this->option_name_prefix.'request_token');
84
- UpdraftPlus_Options::delete_updraft_option($this->option_name_prefix.'access_token');
 
 
85
  return true;
86
  }
87
 
18
  */
19
  protected $option_name_prefix = 'dropbox_token';
20
 
21
+ /**
22
+ * Option name (array storage)
23
+ * @var string
24
+ */
25
+ protected $option_array = '';
26
+
27
  /**
28
  * Encyption object
29
  * @var Encrypter|null
34
  * Check if an instance of the encrypter is passed, set the encryption object
35
  * @return void
36
  */
37
+ public function __construct(Dropbox_Encrypter $encrypter = null, $option_name_prefix = 'dropbox_token', $option_array = 'dropbox')
38
  {
39
  if ($encrypter instanceof Dropbox_Encrypter) {
40
  $this->encrypter = $encrypter;
41
  }
42
 
43
  $this->option_name_prefix = $option_name_prefix;
44
+ $this->option_array = $option_array;
45
 
46
  }
47
 
56
  if ($type != 'request_token' && $type != 'access_token') {
57
  throw new Dropbox_Exception("Expected a type of either 'request_token' or 'access_token', got '$type'");
58
  } else {
59
+ if (false !== ($opts = UpdraftPlus_Options::get_updraft_option($this->option_array))) {
60
+ if (!empty($opts[$this->option_name_prefix.$type])) {
61
+ $gettoken = $opts[$this->option_name_prefix.$type];
62
+ $token = $this->decrypt($gettoken);
63
+ return $token;
64
+ }
65
  }
66
  return false;
67
  }
80
  throw new Dropbox_Exception("Expected a type of either 'request_token' or 'access_token', got '$type'");
81
  } else {
82
  $token = $this->encrypt($token);
83
+ $opts = UpdraftPlus_Options::get_updraft_option($this->option_array);
84
+ $opts[$this->option_name_prefix.$type] = $token;
85
+ UpdraftPlus_Options::update_updraft_option($this->option_array, $opts);
86
  }
87
  }
88
 
92
  */
93
  public function delete()
94
  {
95
+ $opts = UpdraftPlus_Options::get_updraft_option($this->option_array);
96
+ $opts[$this->option_name_prefix.'request_token'] = '';
97
+ $opts[$this->option_name_prefix.'access_token'] = '';
98
+ UpdraftPlus_Options::update_updraft_option($this->option_array, $opts);
99
  return true;
100
  }
101
 
includes/updraft-admin-ui.js CHANGED
@@ -9,6 +9,19 @@ function updraft_delete(key, nonce, showremote) {
9
  jQuery('#updraft-delete-modal').dialog('open');
10
  }
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  function updraft_delete_old_dirs() {
13
  //jQuery('#updraft_delete_old_dirs_pagediv').slideUp().remove();
14
  //updraft_iframe_modal('delete_old_dirs', updraftlion.delete_old_dirs);
@@ -25,7 +38,11 @@ function updraft_restore_setoptions(entities) {
25
  if (ematch) {
26
  jQuery(y).removeAttr('disabled').data('howmany', ematch[1]).parent().show();
27
  howmany++;
28
- if (entity == 'db') { howmany += 4.5;}
 
 
 
 
29
  } else {
30
  jQuery(y).attr('disabled','disabled').parent().hide();
31
  }
@@ -88,7 +105,6 @@ function updraft_activejobs_update(force) {
88
  if (resp.ds != null && resp.ds != '') {
89
  jQuery(resp.ds).each(function(x, dstatus){
90
  if (dstatus.base != '') {
91
- //trycatch
92
  updraft_downloader_status_update(dstatus.base, dstatus.timestamp, dstatus.what, dstatus.findex, dstatus, response);
93
  }
94
  });
@@ -301,10 +317,10 @@ function updraft_downloader(base, nonce, what, whicharea, set_contents, prettyda
301
  jQuery(document).ajaxError(function( event, jqxhr, settings, exception ) {
302
  if (exception == null || exception == '') return;
303
  if (jqxhr.responseText == null || jqxhr.responseText == '') return;
304
- console.log("Error caught by UpdraftPlus ajaxError handler (follows)");
305
  console.log(exception);
306
  if (settings.url.search(ajaxurl) == 0) {
307
- if (settings.url.search('subaction=downloadstatus')) {
308
  var timestamp = settings.url.match(/timestamp=\d+/);
309
  var type = settings.url.match(/type=[a-z]+/);
310
  var findex = settings.url.match(/findex=\d+/);
@@ -317,6 +333,9 @@ jQuery(document).ajaxError(function( event, jqxhr, settings, exception ) {
317
  var stid = base+timestamp+'_'+type+'_'+findex;
318
  jQuery('#'+stid+' .raw').html('<strong>'+updraftlion.error+'</strong> '+updraftlion.servererrorcode);
319
  }
 
 
 
320
  }
321
  }
322
  });
@@ -568,20 +587,18 @@ jQuery(document).ready(function($){
568
 
569
  jQuery(this).dialog("close");
570
  jQuery('#updraft_backup_started').html('<em>'+updraftlion.requeststart+'</em>').slideDown('');
 
 
 
 
 
 
 
571
  jQuery.post(ajaxurl, { action: 'updraft_ajax', subaction: 'backupnow', nonce: updraft_credentialtest_nonce, backupnow_nodb: backupnow_nodb, backupnow_nofiles: backupnow_nofiles, backupnow_nocloud: backupnow_nocloud }, function(response) {
572
  jQuery('#updraft_backup_started').html(response);
573
  // Kick off some activity to get WP to get the scheduled task moving as soon as possible
574
- setTimeout(function() {jQuery.get(updraft_siteurl);}, 5100);
575
- setTimeout(function() {jQuery.get(updraft_siteurl+'/wp-cron.php');}, 13500);
576
- //setTimeout(function() {updraft_showlastlog();}, 6000);
577
- setTimeout(function() {updraft_activejobs_update(true);}, 6000);
578
- setTimeout(function() {
579
- jQuery('#updraft_lastlogmessagerow').fadeOut('slow', function() {
580
- jQuery(this).fadeIn('slow');
581
- });
582
- }, 3200);
583
- setTimeout(function() {jQuery('#updraft_backup_started').fadeOut('slow');}, 75000);
584
- // Should be redundant (because of the polling for the last log line), but harmless (invokes page load)
585
  });
586
  };
587
  backupnow_modal_buttons[updraftlion.cancel] = function() { jQuery(this).dialog("close"); };
@@ -636,6 +653,44 @@ jQuery(document).ready(function($){
636
  updraft_iframe_modal('rawbackuphistory', updraftlion.raw);
637
  });
638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  jQuery.get(ajaxurl, { action: 'updraft_ajax', subaction: 'ping', nonce: updraft_credentialtest_nonce }, function(data, response) {
640
  if ('success' == response && data != 'pong' && data.indexOf('pong')>=0) {
641
  jQuery('#ud-whitespace-warning').show();
9
  jQuery('#updraft-delete-modal').dialog('open');
10
  }
11
 
12
+ function updraft_openrestorepanel(toggly) {
13
+ //jQuery('.download-backups').slideDown(); updraft_historytimertoggle(1); jQuery('html,body').animate({scrollTop: jQuery('#updraft_lastlogcontainer').offset().top},'slow');
14
+ updraft_historytimertoggle(toggly);
15
+ jQuery('#updraft-navtab-status-content').hide();
16
+ jQuery('#updraft-navtab-expert-content').hide();
17
+ jQuery('#updraft-navtab-settings-content').hide();
18
+ jQuery('#updraft-navtab-backups-content').show();
19
+ jQuery('#updraft-navtab-backups').addClass('nav-tab-active');
20
+ jQuery('#updraft-navtab-expert').removeClass('nav-tab-active');
21
+ jQuery('#updraft-navtab-settings').removeClass('nav-tab-active');
22
+ jQuery('#updraft-navtab-status').removeClass('nav-tab-active');
23
+ }
24
+
25
  function updraft_delete_old_dirs() {
26
  //jQuery('#updraft_delete_old_dirs_pagediv').slideUp().remove();
27
  //updraft_iframe_modal('delete_old_dirs', updraftlion.delete_old_dirs);
38
  if (ematch) {
39
  jQuery(y).removeAttr('disabled').data('howmany', ematch[1]).parent().show();
40
  howmany++;
41
+ if ('db' == entity) { howmany += 4.5;}
42
+ if (jQuery(y).is(':checked')) {
43
+ // This element may or may not exist. The purpose of explicitly calling show() is that Firefox, when reloading (including via forwards/backwards navigation) will remember checkbox states, but not which DOM elements were showing/hidden - which can result in some being hidden when they should be shown, and the user not seeing the options that are/are not checked.
44
+ jQuery('#updraft_restorer_'+entity+'options').show();
45
+ }
46
  } else {
47
  jQuery(y).attr('disabled','disabled').parent().hide();
48
  }
105
  if (resp.ds != null && resp.ds != '') {
106
  jQuery(resp.ds).each(function(x, dstatus){
107
  if (dstatus.base != '') {
 
108
  updraft_downloader_status_update(dstatus.base, dstatus.timestamp, dstatus.what, dstatus.findex, dstatus, response);
109
  }
110
  });
317
  jQuery(document).ajaxError(function( event, jqxhr, settings, exception ) {
318
  if (exception == null || exception == '') return;
319
  if (jqxhr.responseText == null || jqxhr.responseText == '') return;
320
+ console.log("Error caught by UpdraftPlus ajaxError handler (follows) for "+settings.url);
321
  console.log(exception);
322
  if (settings.url.search(ajaxurl) == 0) {
323
+ if (settings.url.search('subaction=downloadstatus') >= 0) {
324
  var timestamp = settings.url.match(/timestamp=\d+/);
325
  var type = settings.url.match(/type=[a-z]+/);
326
  var findex = settings.url.match(/findex=\d+/);
333
  var stid = base+timestamp+'_'+type+'_'+findex;
334
  jQuery('#'+stid+' .raw').html('<strong>'+updraftlion.error+'</strong> '+updraftlion.servererrorcode);
335
  }
336
+ } else if (settings.url.search('subaction=restore_alldownloaded') >= 0) {
337
+ //var timestamp = settings.url.match(/timestamp=\d+/);
338
+ jQuery('#updraft-restore-modal-stage2a').append('<br><strong>'+updraftlion.error+'</strong> '+updraftlion.servererrorcode+': '+exception);
339
  }
340
  }
341
  });
587
 
588
  jQuery(this).dialog("close");
589
  jQuery('#updraft_backup_started').html('<em>'+updraftlion.requeststart+'</em>').slideDown('');
590
+ setTimeout(function() {
591
+ jQuery('#updraft_lastlogmessagerow').fadeOut('slow', function() {
592
+ jQuery(this).fadeIn('slow');
593
+ });
594
+ }, 1700);
595
+ setTimeout(function() {updraft_activejobs_update(true);}, 1000);
596
+ setTimeout(function() {jQuery('#updraft_backup_started').fadeOut('slow');}, 75000);
597
  jQuery.post(ajaxurl, { action: 'updraft_ajax', subaction: 'backupnow', nonce: updraft_credentialtest_nonce, backupnow_nodb: backupnow_nodb, backupnow_nofiles: backupnow_nofiles, backupnow_nocloud: backupnow_nocloud }, function(response) {
598
  jQuery('#updraft_backup_started').html(response);
599
  // Kick off some activity to get WP to get the scheduled task moving as soon as possible
600
+ // setTimeout(function() {jQuery.get(updraft_siteurl);}, 5100);
601
+ // setTimeout(function() {jQuery.get(updraft_siteurl+'/wp-cron.php');}, 13500);
 
 
 
 
 
 
 
 
 
602
  });
603
  };
604
  backupnow_modal_buttons[updraftlion.cancel] = function() { jQuery(this).dialog("close"); };
653
  updraft_iframe_modal('rawbackuphistory', updraftlion.raw);
654
  });
655
 
656
+ jQuery('#updraft-navtab-status').click(function(e) {
657
+ e.preventDefault();
658
+ jQuery(this).addClass('nav-tab-active');
659
+ jQuery('#updraft-navtab-expert-content').hide();
660
+ jQuery('#updraft-navtab-settings-content').hide();
661
+ jQuery('#updraft-navtab-backups-content').hide();
662
+ jQuery('#updraft-navtab-status-content').show();
663
+ jQuery('#updraft-navtab-expert').removeClass('nav-tab-active');
664
+ jQuery('#updraft-navtab-backups').removeClass('nav-tab-active');
665
+ jQuery('#updraft-navtab-settings').removeClass('nav-tab-active');
666
+ });
667
+ jQuery('#updraft-navtab-expert').click(function(e) {
668
+ e.preventDefault();
669
+ jQuery(this).addClass('nav-tab-active');
670
+ jQuery('#updraft-navtab-settings-content').hide();
671
+ jQuery('#updraft-navtab-status-content').hide();
672
+ jQuery('#updraft-navtab-backups-content').hide();
673
+ jQuery('#updraft-navtab-expert-content').show();
674
+ jQuery('#updraft-navtab-status').removeClass('nav-tab-active');
675
+ jQuery('#updraft-navtab-backups').removeClass('nav-tab-active');
676
+ jQuery('#updraft-navtab-settings').removeClass('nav-tab-active');
677
+ });
678
+ jQuery('#updraft-navtab-settings, #updraft-navtab-settings2').click(function(e) {
679
+ e.preventDefault();
680
+ jQuery('#updraft-navtab-status-content').hide();
681
+ jQuery('#updraft-navtab-backups-content').hide();
682
+ jQuery('#updraft-navtab-expert-content').hide();
683
+ jQuery('#updraft-navtab-settings-content').show();
684
+ jQuery('#updraft-navtab-settings').addClass('nav-tab-active');
685
+ jQuery('#updraft-navtab-expert').removeClass('nav-tab-active');
686
+ jQuery('#updraft-navtab-backups').removeClass('nav-tab-active');
687
+ jQuery('#updraft-navtab-status').removeClass('nav-tab-active');
688
+ });
689
+ jQuery('#updraft-navtab-backups').click(function(e) {
690
+ e.preventDefault();
691
+ updraft_openrestorepanel(1);
692
+ });
693
+
694
  jQuery.get(ajaxurl, { action: 'updraft_ajax', subaction: 'ping', nonce: updraft_credentialtest_nonce }, function(data, response) {
695
  if ('success' == response && data != 'pong' && data.indexOf('pong')>=0) {
696
  jQuery('#ud-whitespace-warning').show();
languages/updraftplus-el.mo CHANGED
Binary file
languages/updraftplus-el.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the UpdraftPlus package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2014-05-19 09:16:09+0000\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
@@ -10,6 +10,126 @@ msgstr ""
10
  "X-Generator: GlotPress/0.1\n"
11
  "Project-Id-Version: UpdraftPlus\n"
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  #: addons/moredatabase.php:276
14
  msgid "If you enter text here, it is used to encrypt database backups (Rijndael). <strong>Do make a separate record of it and do not lose it, or all your backups <em>will</em> be useless.</strong> This is also the key used to decrypt backups from this admin interface (so if you change it, then automatic decryption will not work until you change it back)."
15
  msgstr "Εάν πληκτρολογήσετε ένα κείμενο εδώ, θα χρησιμοποιηθεί για την κρυπτογράφηση των αντιγράφων ασφαλείας της βάσης δεδομένων (Rijndael). <strong>Κάντε ένα ξεχωριστό αρχείο με αυτό και μην θα το χάσετε αλλιώς όλα τα αντίγραφα ασφαλείας σας<em>θα</em> είναι άχρηστα.</strong> Αυτό είναι το κλειδί το οποίο θα χρησιμοποιείται για την αποκρυπτογράφηση των αντιγράφων ασφαλείας από αυτό το interface του διαχειριστή (έτσι αν το αλλάξετε, τότε η αυτόματη αποκρυπτογράφηση δεν θα λειτουργήσει μέχρι να το επαναφέρετε στο αρχικό)."
@@ -94,47 +214,43 @@ msgstr "αδυναμία πρόσβασης στο γονικό φάκελο"
94
  msgid "However, subsequent access attempts failed:"
95
  msgstr "Ωστόσο, οι επόμενες προσπάθειες πρόσβασης απέτυχαν:"
96
 
97
- #: admin.php:3176
98
  msgid "External database"
99
  msgstr "Εξωτερική βάση δεδομένων"
100
 
101
- #: admin.php:2896
102
  msgid "This will also cause debugging output from all plugins to be shown upon this screen - please do not be surprised to see these."
103
  msgstr "Αυτό θα προκαλέσει επίσης αποσφαλμάτωση όλων των πρόσθετων που αναγράφονται σε αυτήν την οθόνη - παρακαλώ μην εκπλαγείτε επειδή τα βλέπετε αυτά."
104
 
105
- #: admin.php:2761
106
  msgid "Back up more databases"
107
  msgstr "Λήψη αντιγράφου ασφαλείας περισσότερων βάσεων δεδομένων"
108
 
109
- #: admin.php:2712
110
  msgid "Don't want to be spied on? UpdraftPlus Premium can encrypt your database backup."
111
  msgstr "Δεν θέλετε να κατασκοπεύουν; Το UpdraftPlus Premium μπορεί να κρυπτογραφήσει τα αντιγράφα ασφαλείας της βάσης δεδομένων σας."
112
 
113
- #: admin.php:2712
114
  msgid "It can also backup external databases."
115
  msgstr "Μπορεί επίσης να κρατήσει αντίγραφα ασφαλείας εξωτερικών βάσεων δεδομένων."
116
 
117
- #: admin.php:2721
118
  msgid "You can manually decrypt an encrypted database here."
119
  msgstr "Μπορείτε να αποκρυπτογραφήσετε χειροκίνητα μια κρυπτογραφημένη βάση δεδομένων εδώ."
120
 
121
- #: admin.php:2739
122
  msgid "First, enter the decryption key"
123
  msgstr "Πρώτα, εισάγετε το κλειδί της κρυπτογράφησης"
124
 
125
- #: admin.php:2703
126
- msgid "Database options"
127
- msgstr "Επιλογές βάσης δεδομένων"
128
-
129
- #: admin.php:2660
130
  msgid "use UpdraftPlus Premium"
131
  msgstr "χρησιμοποιήστε το UpdraftPlus Premium"
132
 
133
- #: admin.php:1205
134
  msgid "Decryption failed. The database file is encrypted."
135
  msgstr "Η αποκρυπτογράφηση απέτυχε. Η βάση δεδομένων είναι κρυπτογραφημένη."
136
 
137
- #: admin.php:764
138
  msgid "Only the WordPress database can be restored; you will need to deal with the external database manually."
139
  msgstr "Μόνο η βάση δεδομένων του WordPress μπορεί να αποκατασταθεί, θα πρέπει να ασχοληθείτε με την εξωτερική βάση δεδομένων με μη αυτόματο τ