Migration, Backup, Staging – WPvivid - Version 0.9.17

Version Description

  • Added a sole tab for backup schedules.
  • Refined descriptions in the UI.
  • Fixed a few UI bugs.
  • Successfully tested with WordPress 5.2.
Download this release

Release Info

Developer wpvivid
Plugin Icon 128x128 Migration, Backup, Staging – WPvivid
Version 0.9.17
Comparing to
See all releases

Code changes from version 0.9.16 to 0.9.17

admin/class-wpvivid-admin.php CHANGED
@@ -79,6 +79,7 @@ class WPvivid_Admin {
79
  if ('toplevel_page_'.$this->plugin_name == get_current_screen()->id ||
80
  'wpvivid_page_wpvivid-transfer' == get_current_screen()->id ||
81
  'wpvivid_page_wpvivid-setting' == get_current_screen()->id ||
 
82
  'wpvivid_page_wpvivid-remote' == get_current_screen()->id ||
83
  'wpvivid_page_wpvivid-website' == get_current_screen()->id ||
84
  'wpvivid_page_wpvivid-log' == get_current_screen()->id ||
@@ -108,6 +109,7 @@ class WPvivid_Admin {
108
  if ('toplevel_page_'.$this->plugin_name == get_current_screen()->id ||
109
  'wpvivid_page_wpvivid-transfer' == get_current_screen()->id ||
110
  'wpvivid_page_wpvivid-setting' == get_current_screen()->id ||
 
111
  'wpvivid_page_wpvivid-remote' == get_current_screen()->id ||
112
  'wpvivid_page_wpvivid-website' == get_current_screen()->id ||
113
  'wpvivid_page_wpvivid-log' == get_current_screen()->id ||
@@ -136,12 +138,13 @@ class WPvivid_Admin {
136
  */
137
  add_menu_page(__('WPvivid'), __('WPvivid'), 'administrator', $this->plugin_name, array($this, 'display_plugin_backup_page'), false, 100);
138
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Backup / Restore', 'wpvivid'), 'administrator', $this->plugin_name, array($this, 'display_plugin_backup_page'), false, 100);
139
- add_submenu_page($this->plugin_name, __('WPvivid'), __('Transfer / Migration', 'wpvivid'), 'administrator', 'wpvivid-transfer', array($this, 'display_plugin_transfer_page'), false, 100);
140
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Settings', 'wpvivid'), 'administrator', 'wpvivid-setting', array($this, 'display_plugin_setting_page'), false, 100);
 
141
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Remote Storage', 'wpvivid'), 'administrator', 'wpvivid-remote', array($this, 'display_plugin_remote_page'), false, 100);
142
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Website Info', 'wpvivid'), 'administrator', 'wpvivid-website', array($this, 'display_plugin_website_page'), false, 100);
143
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Logs', 'wpvivid'), 'administrator', 'wpvivid-log', array($this, 'display_plugin_log_page'), false, 100);
144
- add_submenu_page($this->plugin_name, __('WPvivid'), __('Generate Key', 'wpvivid'), 'administrator', 'wpvivid-key', array($this, 'display_plugin_key_page'), false, 100);
145
  }
146
 
147
  function add_toolbar_items($wp_admin_bar){
@@ -162,7 +165,7 @@ class WPvivid_Admin {
162
  $wp_admin_bar->add_menu(array(
163
  'id' => 'wpvivid_admin_menu_transfer',
164
  'parent' => 'wpvivid_admin_menu',
165
- 'title' => 'Transfer / Migration',
166
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-transfer'
167
  ));
168
  $wp_admin_bar->add_menu(array(
@@ -171,6 +174,12 @@ class WPvivid_Admin {
171
  'title' => 'Settings',
172
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-settings'
173
  ));
 
 
 
 
 
 
174
  $wp_admin_bar->add_menu(array(
175
  'id' => 'wpvivid_admin_menu_addons',
176
  'parent' => 'wpvivid_admin_menu',
@@ -192,7 +201,7 @@ class WPvivid_Admin {
192
  $wp_admin_bar->add_menu(array(
193
  'id' => 'wpvivid_admin_menu_key',
194
  'parent' => 'wpvivid_admin_menu',
195
- 'title' => 'Generate Key',
196
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-key'
197
  ));
198
  }
@@ -228,6 +237,9 @@ class WPvivid_Admin {
228
  else if(isset($_REQUEST['tab-settings'])){
229
  self::wpvivid_set_page_request('settings');
230
  }
 
 
 
231
  else if(isset($_REQUEST['tab-remote-storage'])){
232
  self::wpvivid_set_page_request('remote');
233
  }
@@ -249,7 +261,7 @@ class WPvivid_Admin {
249
  $migrate_status=WPvivid_Setting::get_option('wpvivid_migrate_status');
250
  if(!empty($migrate_status) && $migrate_status == 'completed'){
251
  $migrate_notice=true;
252
- _e('<div class="notice notice-warning is-dismissible"><p>Migration is complete and htaccess file is replaced. For website running properly, you\'d better reinstall 301 redirect plugin, firewall and security plugin, and caching plugin if they exist.</p></div>');
253
  WPvivid_Setting::delete_option('wpvivid_migrate_status');
254
  }
255
 
@@ -295,6 +307,11 @@ class WPvivid_Admin {
295
  $this->display_plugin_setup_page();
296
  }
297
 
 
 
 
 
 
298
  public function display_plugin_remote_page(){
299
  self::wpvivid_set_page_request('remote');
300
  $this->display_plugin_setup_page();
79
  if ('toplevel_page_'.$this->plugin_name == get_current_screen()->id ||
80
  'wpvivid_page_wpvivid-transfer' == get_current_screen()->id ||
81
  'wpvivid_page_wpvivid-setting' == get_current_screen()->id ||
82
+ 'wpvivid_page_wpvivid-schedule' == get_current_screen()->id ||
83
  'wpvivid_page_wpvivid-remote' == get_current_screen()->id ||
84
  'wpvivid_page_wpvivid-website' == get_current_screen()->id ||
85
  'wpvivid_page_wpvivid-log' == get_current_screen()->id ||
109
  if ('toplevel_page_'.$this->plugin_name == get_current_screen()->id ||
110
  'wpvivid_page_wpvivid-transfer' == get_current_screen()->id ||
111
  'wpvivid_page_wpvivid-setting' == get_current_screen()->id ||
112
+ 'wpvivid_page_wpvivid-schedule' == get_current_screen()->id ||
113
  'wpvivid_page_wpvivid-remote' == get_current_screen()->id ||
114
  'wpvivid_page_wpvivid-website' == get_current_screen()->id ||
115
  'wpvivid_page_wpvivid-log' == get_current_screen()->id ||
138
  */
139
  add_menu_page(__('WPvivid'), __('WPvivid'), 'administrator', $this->plugin_name, array($this, 'display_plugin_backup_page'), false, 100);
140
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Backup / Restore', 'wpvivid'), 'administrator', $this->plugin_name, array($this, 'display_plugin_backup_page'), false, 100);
141
+ add_submenu_page($this->plugin_name, __('WPvivid'), __('Auto-Migration', 'wpvivid'), 'administrator', 'wpvivid-transfer', array($this, 'display_plugin_transfer_page'), false, 100);
142
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Settings', 'wpvivid'), 'administrator', 'wpvivid-setting', array($this, 'display_plugin_setting_page'), false, 100);
143
+ add_submenu_page($this->plugin_name, __('WPvivid'), __('Schedule', 'wpvivid'), 'administrator', 'wpvivid-schedule', array($this, 'display_plugin_schedule_page'), false, 100);
144
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Remote Storage', 'wpvivid'), 'administrator', 'wpvivid-remote', array($this, 'display_plugin_remote_page'), false, 100);
145
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Website Info', 'wpvivid'), 'administrator', 'wpvivid-website', array($this, 'display_plugin_website_page'), false, 100);
146
  add_submenu_page($this->plugin_name, __('WPvivid'), __('Logs', 'wpvivid'), 'administrator', 'wpvivid-log', array($this, 'display_plugin_log_page'), false, 100);
147
+ add_submenu_page($this->plugin_name, __('WPvivid'), __('Key', 'wpvivid'), 'administrator', 'wpvivid-key', array($this, 'display_plugin_key_page'), false, 100);
148
  }
149
 
150
  function add_toolbar_items($wp_admin_bar){
165
  $wp_admin_bar->add_menu(array(
166
  'id' => 'wpvivid_admin_menu_transfer',
167
  'parent' => 'wpvivid_admin_menu',
168
+ 'title' => 'Auto-Migration',
169
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-transfer'
170
  ));
171
  $wp_admin_bar->add_menu(array(
174
  'title' => 'Settings',
175
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-settings'
176
  ));
177
+ $wp_admin_bar->add_menu(array(
178
+ 'id' => 'wpvivid_admin_menu_schedule',
179
+ 'parent' => 'wpvivid_admin_menu',
180
+ 'title' => 'Schedule',
181
+ 'href' => $admin_url . 'admin.php?page=WPvivid&tab-schedule'
182
+ ));
183
  $wp_admin_bar->add_menu(array(
184
  'id' => 'wpvivid_admin_menu_addons',
185
  'parent' => 'wpvivid_admin_menu',
201
  $wp_admin_bar->add_menu(array(
202
  'id' => 'wpvivid_admin_menu_key',
203
  'parent' => 'wpvivid_admin_menu',
204
+ 'title' => 'Key',
205
  'href' => $admin_url . 'admin.php?page=WPvivid&tab-key'
206
  ));
207
  }
237
  else if(isset($_REQUEST['tab-settings'])){
238
  self::wpvivid_set_page_request('settings');
239
  }
240
+ else if(isset($_REQUEST['tab-schedule'])){
241
+ self::wpvivid_set_page_request('schedule');
242
+ }
243
  else if(isset($_REQUEST['tab-remote-storage'])){
244
  self::wpvivid_set_page_request('remote');
245
  }
261
  $migrate_status=WPvivid_Setting::get_option('wpvivid_migrate_status');
262
  if(!empty($migrate_status) && $migrate_status == 'completed'){
263
  $migrate_notice=true;
264
+ _e('<div class="notice notice-warning is-dismissible"><p>Migration is complete and htaccess file is replaced. In order to successfully complete the migration, you\'d better reinstall 301 redirect plugin, firewall and security plugin, and caching plugin if they exist.</p></div>');
265
  WPvivid_Setting::delete_option('wpvivid_migrate_status');
266
  }
267
 
307
  $this->display_plugin_setup_page();
308
  }
309
 
310
+ public function display_plugin_schedule_page(){
311
+ self::wpvivid_set_page_request('schedule');
312
+ $this->display_plugin_setup_page();
313
+ }
314
+
315
  public function display_plugin_remote_page(){
316
  self::wpvivid_set_page_request('remote');
317
  $this->display_plugin_setup_page();
admin/css/wpvivid-admin.css CHANGED
@@ -162,3 +162,61 @@
162
  width:100%;
163
  }
164
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  width:100%;
163
  }
164
  }
165
+
166
+ /* Popup container */
167
+ .wpvivid-popup {
168
+ position: relative;
169
+ display: inline-block;
170
+ cursor: pointer;
171
+ }
172
+
173
+ /* The actual popup (appears on top) */
174
+ .wpvivid-popup .wpvivid-popuptext {
175
+ visibility: hidden;
176
+ width: 220px;
177
+ background-color: #555;
178
+ color: #fff;
179
+ text-align: center;
180
+ border-radius: 6px;
181
+ padding: 8px 0;
182
+ position: absolute;
183
+ z-index: 1;
184
+ bottom: 75%;
185
+ margin-left: -80px;
186
+ }
187
+
188
+ /* Popup arrow */
189
+ .wpvivid-popup .wpvivid-popuptext::after {
190
+ content: "";
191
+ position: absolute;
192
+ top: 100%;
193
+ left: 50%;
194
+ margin-left: -5px;
195
+ border-width: 5px;
196
+ border-style: solid;
197
+ border-color: #555 transparent transparent transparent;
198
+ }
199
+
200
+ /* Toggle this class when clicking on the popup container (hide and show the popup) */
201
+ .wpvivid-popup .show {
202
+ visibility: visible;
203
+ -webkit-animation: fadeIn 1s;
204
+ animation: fadeIn 1s
205
+ }
206
+
207
+ .wpvivid-popup .hide {
208
+ visibility: hidden;
209
+ -webkit-animation: fadeIn 1s;
210
+ animation: fadeIn 1s
211
+ }
212
+
213
+ /* Add animation (fade in the popup) */
214
+ @-webkit-keyframes fadeIn {
215
+ from {opacity: 0;}
216
+ to {opacity: 1;}
217
+ }
218
+
219
+ @keyframes fadeIn {
220
+ from {opacity: 0;}
221
+ to {opacity:1 ;}
222
+ }
admin/js/wpvivid-admin.js CHANGED
@@ -21,6 +21,9 @@ var wpvivid_restore_timeout = false;
21
  var wpvivid_restore_need_download = false;
22
  var wpvivid_restore_backup_old_site = false;
23
  var wpvivid_display_restore_backup = false;
 
 
 
24
 
25
  (function ($) {
26
  'use strict';
@@ -71,6 +74,11 @@ var wpvivid_display_restore_backup = false;
71
  wpvivid_settings_changed = false;
72
  });
73
 
 
 
 
 
 
74
  $('input[option=add-remote]').click(function(){
75
  var storage_type = $(".storage-providers-active").attr("remote_type");
76
  wpvivid_add_remote_storage(storage_type);
@@ -178,6 +186,13 @@ var wpvivid_display_restore_backup = false;
178
 
179
  })(jQuery);
180
 
 
 
 
 
 
 
 
181
  function click_dismiss_restore_notice(obj){
182
  wpvivid_display_restore_backup = false;
183
  jQuery(obj).parent().remove();
@@ -186,6 +201,8 @@ function click_dismiss_restore_notice(obj){
186
  function wpvivid_click_how_to_restore_backup(){
187
  if(!wpvivid_display_restore_backup){
188
  wpvivid_display_restore_backup = true;
 
 
189
  var div = "<div class='notice notice-info is-dismissible inline'>" +
190
  "<p>Step One: Click the button called 'Restore' which is next to 'Log' button, then a new Tab (Restore Tab) is going to be created</p>" +
191
  "<p>Step Two: Choose an option to complete restore, if any</p>" +
@@ -816,6 +833,7 @@ function wpvivid_control_remote_storage(has_remote){
816
  jQuery("input:radio[name='save_local_remote'][value='remote']").click(function(){
817
  if(!has_remote){
818
  alert("There is no default remote storage configured. Please set it up first.");
 
819
  }
820
  });
821
  }
@@ -843,7 +861,16 @@ function click_retrieve_remote_storage(id,type,name)
843
  {
844
  jQuery('input:text[option=edit-'+jsonarray.type+']').each(function(){
845
  var key = jQuery(this).prop('name');
846
- jQuery(this).val(jsonarray[key]);
 
 
 
 
 
 
 
 
 
847
  });
848
  jQuery('input:password[option=edit-'+jsonarray.type+']').each(function(){
849
  var key = jQuery(this).prop('name');
@@ -860,6 +887,14 @@ function click_retrieve_remote_storage(id,type,name)
860
  }
861
  jQuery(this).prop('checked', value);
862
  });
 
 
 
 
 
 
 
 
863
  if(jsonarray.type == 's3compat'){
864
  var dos_edit_value = jQuery('input:text[option=edit-'+jsonarray.type+'][name=s3directory]').val();
865
  if(dos_edit_value == ''){
@@ -985,11 +1020,9 @@ function wpvivid_handle_backup_data(data){
985
  function wpvivid_set_general_settings()
986
  {
987
  var setting_data = wpvivid_ajax_data_transfer('setting');
988
- var schedule_data = wpvivid_ajax_data_transfer('schedule');
989
  var ajax_data = {
990
  'action': 'wpvivid_set_general_setting',
991
- 'setting': setting_data,
992
- 'schedule': schedule_data
993
  };
994
  jQuery('#wpvivid_setting_general_save').css({'pointer-events': 'none', 'opacity': '0.4'});
995
  wpvivid_post_request(ajax_data, function (data) {
@@ -1015,6 +1048,37 @@ function wpvivid_set_general_settings()
1015
  });
1016
  }
1017
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1018
  /**
1019
  * After enabling email report feature, and test if an email address works or not
1020
  */
@@ -1105,19 +1169,6 @@ function wpvivid_interface_flow_control(){
1105
  }
1106
  });
1107
 
1108
- jQuery('#wpvivid_schedule_enable').click(function(){
1109
- if (jQuery('#wpvivid_schedule_enable').prop('checked') === true){
1110
- jQuery('#wpvivid_schedule_backup_schedule').show();
1111
- jQuery('#wpvivid_schedule_backup_type').show();
1112
- jQuery('#wpvivid_schedule_remote_storage').show();
1113
- }
1114
- else{
1115
- jQuery('#wpvivid_schedule_backup_schedule').hide();
1116
- jQuery('#wpvivid_schedule_backup_type').hide();
1117
- jQuery('#wpvivid_schedule_remote_storage').hide();
1118
- }
1119
- });
1120
-
1121
  jQuery('#wpvivid_general_email_enable').click(function(){
1122
  if(jQuery('#wpvivid_general_email_enable').prop('checked') === true){
1123
  jQuery('#wpvivid_general_email_setting').show();
@@ -1556,6 +1607,9 @@ function wpvivid_getrequest() {
1556
  case "settings":
1557
  wpvivid_click_switch_page('wrap', 'wpvivid_tab_setting', false);
1558
  break;
 
 
 
1559
  case "remote":
1560
  wpvivid_click_switch_page('wrap', 'wpvivid_tab_remote_storage', false);
1561
  break;
@@ -1703,7 +1757,7 @@ function wpvivid_set_backup_lock(backup_id, lock_status){
1703
  });
1704
  }
1705
 
1706
- function wpvivid_initialize_restore(backup_id, backup_time, restore_type='backup'){
1707
  var time_type = 'backup';
1708
  var log_type = '';
1709
  var tab_type = '';
@@ -1720,6 +1774,7 @@ function wpvivid_initialize_restore(backup_id, backup_time, restore_type='backup
1720
  tab_type = 'add_';
1721
  page_type = 'migrate';
1722
  }
 
1723
  jQuery('#wpvivid_restore_'+time_type+'_time').html(backup_time);
1724
  m_restore_backup_id = backup_id;
1725
  jQuery('#wpvivid_restore_'+log_type+'log').html("");
@@ -1728,6 +1783,11 @@ function wpvivid_initialize_restore(backup_id, backup_time, restore_type='backup
1728
  wpvivid_init_restore_data(restore_type);
1729
  }
1730
 
 
 
 
 
 
1731
  /**
1732
  * This function will initialize restore information
1733
  *
@@ -1749,8 +1809,13 @@ function wpvivid_init_restore_data(restore_type){
1749
  jQuery('#wpvivid_restore_'+restore_method+'part').show();
1750
  jQuery('#wpvivid_clean_'+restore_method+'part').hide();
1751
  jQuery('#wpvivid_rollback_'+restore_method+'part').hide();
1752
- jQuery('#wpvivid_restore_is_migrate').show();
1753
- jQuery('#wpvivid_restore_is_migrate').css({'pointer-events': 'none', 'opacity': '0.4'});
 
 
 
 
 
1754
  jQuery('#wpvivid_init_restore_data').addClass('is-active');
1755
  jQuery('#wpvivid_restore_backup_old_site').hide();
1756
  var ajax_data = {
@@ -1768,7 +1833,7 @@ function wpvivid_init_restore_data(restore_type){
1768
  init_status = true;
1769
  wpvivid_restore_download_array = new Array();
1770
  var download_num = 0;
1771
- wpvivid_display_restore_msg("Backup is not found on web server. Prepare to download it from remote storage.", restore_type);
1772
  jQuery.each(jsonarray.files, function (index, value)
1773
  {
1774
  if (value.status === "need_download")
@@ -1788,23 +1853,35 @@ function wpvivid_init_restore_data(restore_type){
1788
  }
1789
 
1790
  if(init_status){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1791
  if (jsonarray.has_exist_restore === 0) {
1792
- jQuery('#wpvivid_restore_' + restore_method + 'btn').css({
1793
- 'pointer-events': 'auto',
1794
- 'opacity': '1'
1795
- });
1796
- jQuery('#wpvivid_clean_' + restore_method + 'restore').css({
1797
- 'pointer-events': 'none',
1798
- 'opacity': '0.4'
1799
- });
1800
- jQuery('#wpvivid_rollback_' + restore_method + 'btn').css({
1801
- 'pointer-events': 'none',
1802
- 'opacity': '0.4'
1803
- });
1804
  jQuery('#wpvivid_restore_' + restore_method + 'part').show();
 
 
1805
  jQuery('#wpvivid_restore_backup_old_site').show();
1806
  jQuery('#wpvivid_restore_is_migrate').css({'pointer-events': 'auto', 'opacity': '1'});
1807
- jQuery('#wpvivid_init_restore_data').removeClass('is-active');
1808
  if (jsonarray.is_migrate === 1) {
1809
  jQuery('#wpvivid_restore_is_migrate').show();
1810
  jQuery('#wpvivid_restore_' + restore_method + 'btn').css({'pointer-events': 'none', 'opacity': '0.4'});
@@ -1824,19 +1901,12 @@ function wpvivid_init_restore_data(restore_type){
1824
  wpvivid_interface_flow_control();
1825
  }
1826
  else if (jsonarray.has_exist_restore === 1) {
1827
- jQuery('#wpvivid_restore_' + restore_method + 'btn').css({
1828
- 'pointer-events': 'none',
1829
- 'opacity': '0.4'
1830
- });
1831
- jQuery('#wpvivid_clean_' + restore_method + 'restore').css({
1832
- 'pointer-events': 'auto',
1833
- 'opacity': '1'
1834
- });
1835
- jQuery('#wpvivid_rollback_' + restore_method + 'btn').css({
1836
- 'pointer-events': 'none',
1837
- 'opacity': '0.4'
1838
- });
1839
- jQuery('#wpvivid_clean_' + restore_method + 'part').show();
1840
  jQuery('#wpvivid_restore_is_migrate').hide();
1841
  jQuery('#wpvivid_restore_backup_old_site').hide();
1842
  wpvivid_display_restore_msg("An uncompleted restore task exists, please terminate it first.", restore_type);
@@ -1847,6 +1917,7 @@ function wpvivid_init_restore_data(restore_type){
1847
  alert(err);
1848
  }
1849
  }, function(XMLHttpRequest, textStatus, errorThrown) {
 
1850
  var error_message = wpvivid_output_ajaxerror('initializing restore information', textStatus, errorThrown);
1851
  wpvivid_display_restore_msg(error_message, restore_type);
1852
  });
@@ -1856,10 +1927,15 @@ function wpvivid_init_restore_data(restore_type){
1856
  * This function will start the process of restoring a backup
1857
  */
1858
  function wpvivid_start_restore(restore_type = 'backup'){
1859
- var descript = 'Are you sure to continue?';
1860
- var ret = confirm(descript);
 
 
 
 
 
1861
  if (ret === true) {
1862
-
1863
  var restore_method = '';
1864
  if (restore_type == 'backup') {
1865
  restore_method = '';
@@ -2723,8 +2799,10 @@ function wpvivid_click_send_debug_info(){
2723
  * @returns {string}
2724
  */
2725
  function wpvivid_output_ajaxerror(action, textStatus, errorThrown){
2726
- var error_msg = "wpvivid_request: "+ textStatus + "(" + errorThrown + "): an error occurred while " + action + ". " +
2727
- "This error could be caused by an unstable internet connection. Please try again later.";
 
 
2728
  return error_msg;
2729
  }
2730
 
21
  var wpvivid_restore_need_download = false;
22
  var wpvivid_restore_backup_old_site = false;
23
  var wpvivid_display_restore_backup = false;
24
+ var wpvivid_restore_backup_type = '';
25
+ var wpvivid_display_restore_check = false;
26
+ var wpvivid_restore_sure = false;
27
 
28
  (function ($) {
29
  'use strict';
74
  wpvivid_settings_changed = false;
75
  });
76
 
77
+ $('#wpvivid_schedule_save').click(function(){
78
+ wpvivid_set_schedule();
79
+ wpvivid_settings_changed = false;
80
+ });
81
+
82
  $('input[option=add-remote]').click(function(){
83
  var storage_type = $(".storage-providers-active").attr("remote_type");
84
  wpvivid_add_remote_storage(storage_type);
186
 
187
  })(jQuery);
188
 
189
+ function wpvivid_popup_tour(style) {
190
+ var popup = document.getElementById("wpvivid_popup_tour");
191
+ if (popup != null) {
192
+ popup.classList.add(style);
193
+ }
194
+ }
195
+
196
  function click_dismiss_restore_notice(obj){
197
  wpvivid_display_restore_backup = false;
198
  jQuery(obj).parent().remove();
201
  function wpvivid_click_how_to_restore_backup(){
202
  if(!wpvivid_display_restore_backup){
203
  wpvivid_display_restore_backup = true;
204
+ var top = jQuery('#wpvivid_how_to_restore_backup_describe').offset().top-jQuery('#wpvivid_how_to_restore_backup_describe').height();
205
+ jQuery('html, body').animate({scrollTop:top}, 'slow');
206
  var div = "<div class='notice notice-info is-dismissible inline'>" +
207
  "<p>Step One: Click the button called 'Restore' which is next to 'Log' button, then a new Tab (Restore Tab) is going to be created</p>" +
208
  "<p>Step Two: Choose an option to complete restore, if any</p>" +
833
  jQuery("input:radio[name='save_local_remote'][value='remote']").click(function(){
834
  if(!has_remote){
835
  alert("There is no default remote storage configured. Please set it up first.");
836
+ jQuery("input:radio[name='save_local_remote'][value='local']").prop('checked', true);
837
  }
838
  });
839
  }
861
  {
862
  jQuery('input:text[option=edit-'+jsonarray.type+']').each(function(){
863
  var key = jQuery(this).prop('name');
864
+ if(key == 's3Path' && jsonarray.type == 'amazons3'){
865
+ var iLength = jsonarray[key].lastIndexOf('/wpvivid_backup');
866
+ if(iLength != -1) {
867
+ jsonarray[key] = jsonarray[key].substring(0, iLength);
868
+ }
869
+ jQuery(this).val(jsonarray[key]);
870
+ }
871
+ else {
872
+ jQuery(this).val(jsonarray[key]);
873
+ }
874
  });
875
  jQuery('input:password[option=edit-'+jsonarray.type+']').each(function(){
876
  var key = jQuery(this).prop('name');
887
  }
888
  jQuery(this).prop('checked', value);
889
  });
890
+ if(jsonarray.type == 'amazons3'){
891
+ var amazons3_edit_value = jQuery('input:text[option=edit-'+jsonarray.type+'][name=s3Path]').val();
892
+ if(amazons3_edit_value == ''){
893
+ amazons3_edit_value = '*';
894
+ }
895
+ amazons3_edit_value = amazons3_edit_value + '/wpvivid_backup';
896
+ jQuery('#wpvivid_edit_amazons3_root_path').html(amazons3_edit_value);
897
+ }
898
  if(jsonarray.type == 's3compat'){
899
  var dos_edit_value = jQuery('input:text[option=edit-'+jsonarray.type+'][name=s3directory]').val();
900
  if(dos_edit_value == ''){
1020
  function wpvivid_set_general_settings()
1021
  {
1022
  var setting_data = wpvivid_ajax_data_transfer('setting');
 
1023
  var ajax_data = {
1024
  'action': 'wpvivid_set_general_setting',
1025
+ 'setting': setting_data
 
1026
  };
1027
  jQuery('#wpvivid_setting_general_save').css({'pointer-events': 'none', 'opacity': '0.4'});
1028
  wpvivid_post_request(ajax_data, function (data) {
1048
  });
1049
  }
1050
 
1051
+ function wpvivid_set_schedule()
1052
+ {
1053
+ var schedule_data = wpvivid_ajax_data_transfer('schedule');
1054
+ var ajax_data = {
1055
+ 'action': 'wpvivid_set_schedule',
1056
+ 'schedule': schedule_data
1057
+ };
1058
+ jQuery('#wpvivid_schedule_save').css({'pointer-events': 'none', 'opacity': '0.4'});
1059
+ wpvivid_post_request(ajax_data, function (data) {
1060
+ try {
1061
+ var jsonarray = jQuery.parseJSON(data);
1062
+
1063
+ jQuery('#wpvivid_schedule_save').css({'pointer-events': 'auto', 'opacity': '1'});
1064
+ if (jsonarray.result === 'success') {
1065
+ location.reload();
1066
+ }
1067
+ else {
1068
+ alert(jsonarray.error);
1069
+ }
1070
+ }
1071
+ catch (err) {
1072
+ alert(err);
1073
+ jQuery('#wpvivid_schedule_save').css({'pointer-events': 'auto', 'opacity': '1'});
1074
+ }
1075
+ }, function (XMLHttpRequest, textStatus, errorThrown) {
1076
+ jQuery('#wpvivid_schedule_save').css({'pointer-events': 'auto', 'opacity': '1'});
1077
+ var error_message = wpvivid_output_ajaxerror('changing schedule', textStatus, errorThrown);
1078
+ alert(error_message);
1079
+ });
1080
+ }
1081
+
1082
  /**
1083
  * After enabling email report feature, and test if an email address works or not
1084
  */
1169
  }
1170
  });
1171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1172
  jQuery('#wpvivid_general_email_enable').click(function(){
1173
  if(jQuery('#wpvivid_general_email_enable').prop('checked') === true){
1174
  jQuery('#wpvivid_general_email_setting').show();
1607
  case "settings":
1608
  wpvivid_click_switch_page('wrap', 'wpvivid_tab_setting', false);
1609
  break;
1610
+ case "schedule":
1611
+ wpvivid_click_switch_page('wrap', 'wpvivid_tab_schedule', false);
1612
+ break;
1613
  case "remote":
1614
  wpvivid_click_switch_page('wrap', 'wpvivid_tab_remote_storage', false);
1615
  break;
1757
  });
1758
  }
1759
 
1760
+ function wpvivid_initialize_restore(backup_id, backup_time, backup_type, restore_type='backup'){
1761
  var time_type = 'backup';
1762
  var log_type = '';
1763
  var tab_type = '';
1774
  tab_type = 'add_';
1775
  page_type = 'migrate';
1776
  }
1777
+ wpvivid_restore_backup_type = backup_type;
1778
  jQuery('#wpvivid_restore_'+time_type+'_time').html(backup_time);
1779
  m_restore_backup_id = backup_id;
1780
  jQuery('#wpvivid_restore_'+log_type+'log').html("");
1783
  wpvivid_init_restore_data(restore_type);
1784
  }
1785
 
1786
+ function click_dismiss_restore_check_notice(obj){
1787
+ wpvivid_display_restore_check = false;
1788
+ jQuery(obj).parent().remove();
1789
+ }
1790
+
1791
  /**
1792
  * This function will initialize restore information
1793
  *
1809
  jQuery('#wpvivid_restore_'+restore_method+'part').show();
1810
  jQuery('#wpvivid_clean_'+restore_method+'part').hide();
1811
  jQuery('#wpvivid_rollback_'+restore_method+'part').hide();
1812
+ if(wpvivid_restore_backup_type == 'Migration' || wpvivid_restore_backup_type == 'Upload') {
1813
+ jQuery('#wpvivid_restore_is_migrate').show();
1814
+ jQuery('#wpvivid_restore_is_migrate').css({'pointer-events': 'none', 'opacity': '0.4'});
1815
+ }
1816
+ else{
1817
+ jQuery('#wpvivid_restore_is_migrate').hide();
1818
+ }
1819
  jQuery('#wpvivid_init_restore_data').addClass('is-active');
1820
  jQuery('#wpvivid_restore_backup_old_site').hide();
1821
  var ajax_data = {
1833
  init_status = true;
1834
  wpvivid_restore_download_array = new Array();
1835
  var download_num = 0;
1836
+ //wpvivid_display_restore_msg("Backup is not found on web server. Prepare to download it from remote storage.", restore_type);
1837
  jQuery.each(jsonarray.files, function (index, value)
1838
  {
1839
  if (value.status === "need_download")
1853
  }
1854
 
1855
  if(init_status){
1856
+ if(jsonarray.max_allow_packet_warning != false || jsonarray.memory_limit_warning != false) {
1857
+ if(!wpvivid_display_restore_check) {
1858
+ wpvivid_display_restore_check = true;
1859
+ var output = '';
1860
+ if(jsonarray.max_allow_packet_warning != false){
1861
+ output += "<p>" + jsonarray.max_allow_packet_warning + "</p>";
1862
+ }
1863
+ if(jsonarray.memory_limit != false){
1864
+ output += "<p>" + jsonarray.memory_limit_warning + "</p>";
1865
+ }
1866
+ var div = "<div class='notice notice-warning is-dismissible inline'>" +
1867
+ output +
1868
+ "<button type='button' class='notice-dismiss' onclick='click_dismiss_restore_check_notice(this);'>" +
1869
+ "<span class='screen-reader-text'>Dismiss this notice.</span>" +
1870
+ "</button>" +
1871
+ "</div>";
1872
+ jQuery('#wpvivid_restore_check').append(div);
1873
+ }
1874
+ }
1875
+ jQuery('#wpvivid_init_restore_data').removeClass('is-active');
1876
  if (jsonarray.has_exist_restore === 0) {
1877
+ jQuery('#wpvivid_restore_' + restore_method + 'btn').css({'pointer-events': 'auto', 'opacity': '1'});
1878
+ jQuery('#wpvivid_clean_' + restore_method + 'restore').css({'pointer-events': 'none', 'opacity': '0.4'});
1879
+ jQuery('#wpvivid_rollback_' + restore_method + 'btn').css({'pointer-events': 'none', 'opacity': '0.4'});
 
 
 
 
 
 
 
 
 
1880
  jQuery('#wpvivid_restore_' + restore_method + 'part').show();
1881
+ jQuery('#wpvivid_clean_'+restore_method+'part').hide();
1882
+ jQuery('#wpvivid_rollback_'+restore_method+'part').hide();
1883
  jQuery('#wpvivid_restore_backup_old_site').show();
1884
  jQuery('#wpvivid_restore_is_migrate').css({'pointer-events': 'auto', 'opacity': '1'});
 
1885
  if (jsonarray.is_migrate === 1) {
1886
  jQuery('#wpvivid_restore_is_migrate').show();
1887
  jQuery('#wpvivid_restore_' + restore_method + 'btn').css({'pointer-events': 'none', 'opacity': '0.4'});
1901
  wpvivid_interface_flow_control();
1902
  }
1903
  else if (jsonarray.has_exist_restore === 1) {
1904
+ jQuery('#wpvivid_restore_' + restore_method + 'btn').css({'pointer-events': 'none', 'opacity': '0.4'});
1905
+ jQuery('#wpvivid_clean_' + restore_method + 'restore').css({'pointer-events': 'auto', 'opacity': '1'});
1906
+ jQuery('#wpvivid_rollback_' + restore_method + 'btn').css({'pointer-events': 'none', 'opacity': '0.4'});
1907
+ jQuery('#wpvivid_restore_'+restore_method+'part').hide();
1908
+ jQuery('#wpvivid_clean_'+restore_method+'part').show();
1909
+ jQuery('#wpvivid_rollback_'+restore_method+'part').hide();
 
 
 
 
 
 
 
1910
  jQuery('#wpvivid_restore_is_migrate').hide();
1911
  jQuery('#wpvivid_restore_backup_old_site').hide();
1912
  wpvivid_display_restore_msg("An uncompleted restore task exists, please terminate it first.", restore_type);
1917
  alert(err);
1918
  }
1919
  }, function(XMLHttpRequest, textStatus, errorThrown) {
1920
+ jQuery('#wpvivid_init_restore_data').removeClass('is-active');
1921
  var error_message = wpvivid_output_ajaxerror('initializing restore information', textStatus, errorThrown);
1922
  wpvivid_display_restore_msg(error_message, restore_type);
1923
  });
1927
  * This function will start the process of restoring a backup
1928
  */
1929
  function wpvivid_start_restore(restore_type = 'backup'){
1930
+ if(!wpvivid_restore_sure){
1931
+ var descript = 'Are you sure to continue?';
1932
+ var ret = confirm(descript);
1933
+ }
1934
+ else{
1935
+ ret = true;
1936
+ }
1937
  if (ret === true) {
1938
+ wpvivid_restore_sure = true;
1939
  var restore_method = '';
1940
  if (restore_type == 'backup') {
1941
  restore_method = '';
2799
  * @returns {string}
2800
  */
2801
  function wpvivid_output_ajaxerror(action, textStatus, errorThrown){
2802
+ action = 'trying to establish communication with your server';
2803
+ var error_msg = "wpvivid_request: "+ textStatus + "(" + errorThrown + "): an error occurred when " + action + ". " +
2804
+ "This error may be request not reaching or server not responding. Please try again later.";
2805
+ //"This error could be caused by an unstable internet connection. Please try again later.";
2806
  return error_msg;
2807
  }
2808
 
admin/partials/wpvivid-admin-display.php CHANGED
@@ -11,7 +11,8 @@
11
  * @subpackage WPvivid/admin/partials
12
  */
13
 
14
- if (!defined('WPVIVID_PLUGIN_DIR')){
 
15
  die;
16
  }
17
 
@@ -51,6 +52,12 @@ function add_tab_setting(){
51
  <?php
52
  }
53
 
 
 
 
 
 
 
54
  function add_tab_remote_storage(){
55
  ?>
56
  <a href="#" id="wpvivid_tab_remote_storage" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,'storage-page')"><?php _e('Remote Storage', 'wpvivid'); ?></a>
@@ -81,11 +88,12 @@ function add_tab_read_log(){
81
  }
82
 
83
  add_action('wpvivid_backuprestore_add_tab', 'add_tab_general', 10);
84
- add_action('wpvivid_backuprestore_add_tab', 'add_tab_setting', 12);
 
85
  add_action('wpvivid_backuprestore_add_tab', 'add_tab_remote_storage', 13);
86
- add_action('wpvivid_backuprestore_add_tab', 'add_tab_website_info', 14);
87
- add_action('wpvivid_backuprestore_add_tab', 'add_tab_log', 15);
88
- add_action('wpvivid_backuprestore_add_tab', 'add_tab_read_log', 17);
89
  ?>
90
 
91
  <div class="wrap">
@@ -120,6 +128,9 @@ add_action('wpvivid_backuprestore_add_tab', 'add_tab_read_log', 17);
120
  <div id="settings-page" class="wrap-tab-content wpvivid_tab_setting" name="tab-setting" style="display:none;">
121
  <?php include_once WPVIVID_PLUGIN_DIR .'/admin/partials/wpvivid-settings-page-display.php'; ?>
122
  </div>
 
 
 
123
  <div id="debug-page" class="wrap-tab-content wpvivid_tab_debug" name="tab-debug" style="display:none;">
124
  <?php include_once WPVIVID_PLUGIN_DIR .'/admin/partials/wpvivid-website-info-page-display.php'; ?>
125
  </div>
@@ -139,6 +150,20 @@ add_action('wpvivid_backuprestore_add_tab', 'add_tab_read_log', 17);
139
  <div class="postbox">
140
  <h2><span>Current Version: <?php _e($wpvivid_version, 'wpvivid'); ?></span></h2>
141
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </div>
143
  </div>
144
  </div>
11
  * @subpackage WPvivid/admin/partials
12
  */
13
 
14
+ if (!defined('WPVIVID_PLUGIN_DIR'))
15
+ {
16
  die;
17
  }
18
 
52
  <?php
53
  }
54
 
55
+ function add_tab_schedule(){
56
+ ?>
57
+ <a href="#" id="wpvivid_tab_schedule" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,'schedule-page')"><?php _e('Schedule', 'wpvivid'); ?></a>
58
+ <?php
59
+ }
60
+
61
  function add_tab_remote_storage(){
62
  ?>
63
  <a href="#" id="wpvivid_tab_remote_storage" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,'storage-page')"><?php _e('Remote Storage', 'wpvivid'); ?></a>
88
  }
89
 
90
  add_action('wpvivid_backuprestore_add_tab', 'add_tab_general', 10);
91
+ add_action('wpvivid_backuprestore_add_tab', 'add_tab_setting', 14);
92
+ add_action('wpvivid_backuprestore_add_tab', 'add_tab_schedule', 11);
93
  add_action('wpvivid_backuprestore_add_tab', 'add_tab_remote_storage', 13);
94
+ add_action('wpvivid_backuprestore_add_tab', 'add_tab_website_info', 15);
95
+ add_action('wpvivid_backuprestore_add_tab', 'add_tab_log', 16);
96
+ add_action('wpvivid_backuprestore_add_tab', 'add_tab_read_log', 18);
97
  ?>
98
 
99
  <div class="wrap">
128
  <div id="settings-page" class="wrap-tab-content wpvivid_tab_setting" name="tab-setting" style="display:none;">
129
  <?php include_once WPVIVID_PLUGIN_DIR .'/admin/partials/wpvivid-settings-page-display.php'; ?>
130
  </div>
131
+ <div id="schedule-page" class="wrap-tab-content wpvivid_tab_schedule" name="tab-schedule" style="display: none;">
132
+ <?php include_once WPVIVID_PLUGIN_DIR .'/admin/partials/wpvivid-schedule-page-display.php'; ?>
133
+ </div>
134
  <div id="debug-page" class="wrap-tab-content wpvivid_tab_debug" name="tab-debug" style="display:none;">
135
  <?php include_once WPVIVID_PLUGIN_DIR .'/admin/partials/wpvivid-website-info-page-display.php'; ?>
136
  </div>
150
  <div class="postbox">
151
  <h2><span>Current Version: <?php _e($wpvivid_version, 'wpvivid'); ?></span></h2>
152
  </div>
153
+
154
+ <div class="postbox">
155
+ <h2><span>How-to</span></h2>
156
+ <div class="inside">
157
+ <table class="widefat" cellpadding="0">
158
+ <tbody>
159
+ <tr class="alternate"><td class="row-title"><a href="https://wpvivid.com/get-started-settings.html" target="_blank">WPvivid Backup Settings</a></td></tr>
160
+ <tr><td class="row-title"><a href="https://wpvivid.com/get-started-create-a-manual-backup.html" target="_blank">Create a Manual Backup</a></td></tr>
161
+ <tr class="alternate"><td class="row-title"><a href="https://wpvivid.com/get-started-restore-site.html" target="_blank">Restore Your Site from a Backup</a></td></tr>
162
+ <tr><td class="row-title"><a href="https://wpvivid.com/get-started-transfer-site.html" target="_blank">Migrate WordPress</a></td></tr>
163
+ </tbody>
164
+ </table>
165
+ </div>
166
+ </div>
167
  </div>
168
  </div>
169
  </div>
admin/partials/wpvivid-backup-restore-page-display.php CHANGED
@@ -195,6 +195,7 @@ function wpvivid_add_page_backup(){
195
  <th><?php _e( 'Backup','wpvivid'); ?></th>
196
  <th><?php _e( 'Storage','wpvivid'); ?></th>
197
  <th><?php _e( 'Download','wpvivid'); ?></th>
 
198
  <th><?php _e( 'Delete','wpvivid'); ?></th>
199
  </tr>
200
  </thead>
@@ -208,7 +209,7 @@ function wpvivid_add_page_backup(){
208
  <tfoot>
209
  <tr>
210
  <th><input name="" type="checkbox" id="backup_list_all_check" value="1" /></th>
211
- <th class="row-title" colspan="4"><a onclick="wpvivid_delete_backups_inbatches();" style="cursor: pointer;"><?php _e('Delete the selected backups', 'wpvivid'); ?></a></th>
212
  </tr>
213
  </tfoot>
214
  </table>
@@ -334,10 +335,10 @@ function wpvivid_add_page_restore(){
334
  <p><?php _e('Restore function will replace the current site\'s themes, plugins, uploads, database and/or other content directories with the existing equivalents in the selected backup.', 'wpvivid'); ?></p>
335
  <div id="wpvivid_restore_is_migrate" style="padding-bottom: 10px;">
336
  <label >
337
- <input type="radio" id="wpvivid_replace_domain" option="restore" name="restore_domain" value="1" /><?php _e('Complete migration (choose this one if the webhosting is changed or you need to replace old domain with new one)', 'wpvivid'); ?>
338
  </label><br>
339
  <label >
340
- <input type="radio" id="wpvivid_keep_domain" option="restore" name="restore_domain" value="0" /><?php _e('Restore to the original webhosting and domain', 'wpvivid'); ?>
341
  </label><br>
342
  </div>
343
  <div id="wpvivid_restore_backup_old_site">
@@ -345,14 +346,13 @@ function wpvivid_add_page_restore(){
345
  <input type="checkbox" option="restore" name="skip_backup_old_site" /><?php _e('Checking this option will create a backup for this site before website restoration, which will help you stand a chance to rollback your site', 'wpvivid'); ?>
346
  </label><br>-->
347
  </div>
 
348
  <div class="restore-button-position" id="wpvivid_restore_part"><input class="button-primary" id="wpvivid_restore_btn" type="submit" name="restore" value="<?php esc_attr_e( 'Restore', 'wpvivid' ); ?>" onclick="wpvivid_start_restore();" /></div>
349
  <div class="restore-button-position" id="wpvivid_clean_part"><input class="button-primary" id="wpvivid_clean_restore" type="submit" name="clear_restore" value="<?php esc_attr_e( 'Terminate', 'wpvivid' ); ?>" /></div>
350
  <div class="restore-button-position" id="wpvivid_rollback_part"><input class="button-primary" id="wpvivid_rollback_btn" type="submit" name="rollback" value="<?php esc_attr_e( 'Rollback', 'wpvivid' ); ?>" /></div>
351
  <div class="spinner" id="wpvivid_init_restore_data" style="float:left;width:auto;height:auto;padding:10px 20px 20px 0;background-position:0 10px;"></div>
352
  </div>
353
- <div class="postbox restore_log" id="wpvivid_restore_log">
354
- <!--<div id="wpvivid_restore_log" style="overflow-y: scroll;"></div>-->
355
- </div>
356
  </div>
357
  <?php
358
  }
@@ -427,7 +427,7 @@ function wpvivid_download_backup_descript($html){
427
  }
428
 
429
  function wpvivid_restore_website_dexcript($html){
430
- $html = '<p><a href="#" onclick="wpvivid_click_how_to_restore_backup();">'.__('How to restore your website from a backup(scheduled, manual, uploaded and received backup)', 'wpvivid').'</a></p>';
431
  $html .= '<div id="wpvivid_how_to_restore_backup"></div>';
432
  return $html;
433
  }
@@ -456,6 +456,7 @@ add_filter('wpvivid_restore_website_dexcript', 'wpvivid_restore_website_dexcript
456
 
457
  <?php do_action('wpvivid_backup_add_page'); ?>
458
  </div>
 
459
  <script>
460
  <?php do_action('wpvivid_backup_do_js'); ?>
461
  </script>
195
  <th><?php _e( 'Backup','wpvivid'); ?></th>
196
  <th><?php _e( 'Storage','wpvivid'); ?></th>
197
  <th><?php _e( 'Download','wpvivid'); ?></th>
198
+ <th><?php _e( 'Restore', 'wpvivid'); ?></th>
199
  <th><?php _e( 'Delete','wpvivid'); ?></th>
200
  </tr>
201
  </thead>
209
  <tfoot>
210
  <tr>
211
  <th><input name="" type="checkbox" id="backup_list_all_check" value="1" /></th>
212
+ <th class="row-title" colspan="5"><a onclick="wpvivid_delete_backups_inbatches();" style="cursor: pointer;"><?php _e('Delete the selected backups', 'wpvivid'); ?></a></th>
213
  </tr>
214
  </tfoot>
215
  </table>
335
  <p><?php _e('Restore function will replace the current site\'s themes, plugins, uploads, database and/or other content directories with the existing equivalents in the selected backup.', 'wpvivid'); ?></p>
336
  <div id="wpvivid_restore_is_migrate" style="padding-bottom: 10px;">
337
  <label >
338
+ <input type="radio" id="wpvivid_replace_domain" option="restore" name="restore_domain" value="1" /><?php echo 'Restore and replace original domain(URL) with '.home_url().'(migration)'; ?>
339
  </label><br>
340
  <label >
341
+ <input type="radio" id="wpvivid_keep_domain" option="restore" name="restore_domain" value="0" /><?php _e('Restore and keep the original domain(URL) unchanged', 'wpvivid'); ?>
342
  </label><br>
343
  </div>
344
  <div id="wpvivid_restore_backup_old_site">
346
  <input type="checkbox" option="restore" name="skip_backup_old_site" /><?php _e('Checking this option will create a backup for this site before website restoration, which will help you stand a chance to rollback your site', 'wpvivid'); ?>
347
  </label><br>-->
348
  </div>
349
+ <div id="wpvivid_restore_check"></div>
350
  <div class="restore-button-position" id="wpvivid_restore_part"><input class="button-primary" id="wpvivid_restore_btn" type="submit" name="restore" value="<?php esc_attr_e( 'Restore', 'wpvivid' ); ?>" onclick="wpvivid_start_restore();" /></div>
351
  <div class="restore-button-position" id="wpvivid_clean_part"><input class="button-primary" id="wpvivid_clean_restore" type="submit" name="clear_restore" value="<?php esc_attr_e( 'Terminate', 'wpvivid' ); ?>" /></div>
352
  <div class="restore-button-position" id="wpvivid_rollback_part"><input class="button-primary" id="wpvivid_rollback_btn" type="submit" name="rollback" value="<?php esc_attr_e( 'Rollback', 'wpvivid' ); ?>" /></div>
353
  <div class="spinner" id="wpvivid_init_restore_data" style="float:left;width:auto;height:auto;padding:10px 20px 20px 0;background-position:0 10px;"></div>
354
  </div>
355
+ <div class="postbox restore_log" id="wpvivid_restore_log"></div>
 
 
356
  </div>
357
  <?php
358
  }
427
  }
428
 
429
  function wpvivid_restore_website_dexcript($html){
430
+ $html = '<p><a href="#" id="wpvivid_how_to_restore_backup_describe" onclick="wpvivid_click_how_to_restore_backup();">'.__('How to restore your website from a backup(scheduled, manual, uploaded and received backup)', 'wpvivid').'</a></p>';
431
  $html .= '<div id="wpvivid_how_to_restore_backup"></div>';
432
  return $html;
433
  }
456
 
457
  <?php do_action('wpvivid_backup_add_page'); ?>
458
  </div>
459
+
460
  <script>
461
  <?php do_action('wpvivid_backup_do_js'); ?>
462
  </script>
admin/partials/wpvivid-remote-storage-page-display.php CHANGED
@@ -29,7 +29,7 @@ function wpvivid_add_page_storage_list(){
29
  <th></th>
30
  <th></th>
31
  <th><?php _e( 'Storage Provider', 'wpvivid' ); ?></th>
32
- <th class="row-title"><?php _e( 'Remote Storage Name', 'wpvivid' ); ?></th>
33
  <th><?php _e( 'Actions', 'wpvivid' ); ?></th>
34
  </tr>
35
  </thead>
29
  <th></th>
30
  <th></th>
31
  <th><?php _e( 'Storage Provider', 'wpvivid' ); ?></th>
32
+ <th class="row-title"><?php _e( 'Remote Storage Alias', 'wpvivid' ); ?></th>
33
  <th><?php _e( 'Actions', 'wpvivid' ); ?></th>
34
  </tr>
35
  </thead>
admin/partials/wpvivid-schedule-page-display.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wpvivid_schedule_settings()
4
+ {
5
+ ?>
6
+ <tr>
7
+ <td class="row-title wpvivid-backup-settings-table tablelistcolumn"><label for="tablecell"><?php _e('Schedule Settings', 'wpvivid'); ?></label></td>
8
+ <td class="tablelistcolumn">
9
+ <div id="storage-brand-3">
10
+ <div>
11
+ <div>
12
+ <div class="postbox schedule-tab-block">
13
+ <label for="wpvivid_schedule_enable">
14
+ <input option="schedule" name="enable" type="checkbox" id="wpvivid_schedule_enable" />
15
+ <span><?php _e( 'Enable backup schedule', 'wpvivid' ); ?></span>
16
+ </label>
17
+ <div>
18
+ <?php
19
+ $notice='';
20
+ $notice= apply_filters('wpvivid_schedule_notice',$notice);
21
+ echo $notice;
22
+ ?>
23
+ </div>
24
+ </div>
25
+ <div id="wpvivid_schedule_backup_schedule"">
26
+ <div class="postbox schedule-tab-block">
27
+ <fieldset>
28
+ <legend class="screen-reader-text"><span>input type="radio"</span></legend>
29
+ <?php
30
+ $time='';
31
+ $time= apply_filters('wpvivid_schedule_time',$time);
32
+ echo $time;
33
+ ?>
34
+ </fieldset>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <div class="postbox schedule-tab-block" id="wpvivid_schedule_backup_type">
39
+ <div>
40
+ <div>
41
+ <fieldset>
42
+ <legend class="screen-reader-text"><span>input type="radio"</span></legend>
43
+ <?php
44
+ $backup_type='';
45
+ $backup_type= apply_filters('wpvivid_schedule_backup_type',$backup_type);
46
+ echo $backup_type;
47
+ ?>
48
+ </fieldset>
49
+ </div>
50
+ <div style="clear:both;"></div>
51
+ </div>
52
+ </div>
53
+ <div class="postbox schedule-tab-block" id="wpvivid_schedule_remote_storage">
54
+ <div id="wpvivid_schedule_backup_local_remote">
55
+ <?php
56
+ $html='';
57
+ $html= apply_filters('wpvivid_schedule_local_remote',$html);
58
+ echo $html;
59
+ ?>
60
+ </div>
61
+ <div id="schedule_upload_storage" style="cursor:pointer;" title="Highlighted icon illuminates that you have choosed a remote storage to store backups">
62
+ <?php
63
+ $pic='';
64
+ $pic= apply_filters('wpvivid_schedule_add_remote_pic',$pic);
65
+ echo $pic;
66
+ ?>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </td>
72
+ </tr>
73
+ <script>
74
+ <?php
75
+ do_action('wpvivid_schedule_do_js');
76
+ ?>
77
+ </script>
78
+ <?php
79
+ }
80
+
81
+ function wpvivid_schedule_notice($html)
82
+ {
83
+ $html='<p>1) Scheduled job will start at web server time: </p>';
84
+ $html.='<p>2) Being subjected to mechanisms of PHP, a scheduled backup task for your site will be triggered only when the site receives at least a visit at any page.</p>';
85
+ return $html;
86
+ }
87
+
88
+ function wpvivid_schedule_backup_type($html)
89
+ {
90
+ $html='<label>';
91
+ $html.='<input type="radio" option="schedule" name="backup_type" value="files+db"/>';
92
+ $html.='<span>Database + Files (Entire website)</span>';
93
+ $html.='</label><br>';
94
+
95
+ $html.='<label>';
96
+ $html.='<input type="radio" option="schedule" name="backup_type" value="files"/>';
97
+ $html.='<span>All Files (Exclude Database)</span>';
98
+ $html.='</label><br>';
99
+
100
+ $html.='<label>';
101
+ $html.='<input type="radio" option="schedule" name="backup_type" value="db"/>';
102
+ $html.='<span>Only Database</span>';
103
+ $html.='</label><br>';
104
+
105
+ return $html;
106
+ }
107
+
108
+ function wpvivid_schedule_do_js()
109
+ {
110
+ $schedule=WPvivid_Schedule::get_schedule();
111
+ if($schedule['enable'] == true)
112
+ {
113
+ ?>
114
+ jQuery("#wpvivid_schedule_enable").prop('checked', true);
115
+ <?php
116
+ if($schedule['backup']['remote'] === 1)
117
+ {
118
+ $schedule_remote='remote';
119
+ }
120
+ else{
121
+ $schedule_remote='local';
122
+ }
123
+ }
124
+ else{
125
+ $schedule['recurrence']='wpvivid_daily';
126
+ $schedule['backup']['backup_files']='files+db';
127
+ $schedule_remote='local';
128
+ }
129
+ ?>
130
+ jQuery("input:radio[value='<?php echo $schedule['recurrence']?>']").prop('checked', true);
131
+ jQuery("input:radio[value='<?php echo $schedule['backup']['backup_files']?>']").prop('checked', true);
132
+ jQuery("input:radio[name='save_local_remote'][value='remote']").click(function(){
133
+ <?php
134
+ $remote_id_array = WPvivid_Setting::get_user_history('remote_selected');
135
+ $remote_id = '';
136
+ foreach ($remote_id_array as $value){
137
+ $remote_id = $value;
138
+ }
139
+ if(empty($remote_id)){
140
+ ?>
141
+ alert("There is no default remote storage configured. Please set it up first.");
142
+ jQuery("input:radio[name='save_local_remote'][value='local']").prop('checked', true);
143
+ <?php
144
+ }
145
+ ?>
146
+ });
147
+ <?php
148
+ }
149
+
150
+ add_action('wpvivid_schedule_add_cell','wpvivid_schedule_settings',11);
151
+ add_action('wpvivid_schedule_do_js','wpvivid_schedule_do_js',10);
152
+ add_filter('wpvivid_schedule_backup_type','wpvivid_schedule_backup_type');
153
+ add_filter('wpvivid_schedule_notice','wpvivid_schedule_notice',10);
154
+ ?>
155
+
156
+ <div>
157
+ <table class="widefat">
158
+ <tbody>
159
+ <?php do_action('wpvivid_schedule_add_cell'); ?>
160
+ <tfoot>
161
+ <tr>
162
+ <th class="row-title"><input class="button-primary storage-account-button" id="wpvivid_schedule_save" type="submit" name="" value="<?php esc_attr_e( 'Save Changes', 'wpvivid' ); ?>" /></th>
163
+ <th></th>
164
+ </tr>
165
+ </tfoot>
166
+ </tbody>
167
+ </table>
168
+ </div>
admin/partials/wpvivid-settings-page-display.php CHANGED
@@ -13,25 +13,6 @@ function wpvivid_general_settings()
13
  }
14
  global $wpvivid_pulgin;
15
  $out_of_date=$wpvivid_pulgin->_get_out_of_date_info();
16
- $out_of_date_remote='There is no path for remote storage, please set it up first.';
17
-
18
- if($out_of_date['remote_options'] !== false)
19
- {
20
- foreach ($out_of_date['remote_options'] as $value)
21
- {
22
- if($value['type'] === 'ftp' || $value['type'] === 'sftp')
23
- {
24
- $out_of_date_remote=$value['path'];
25
- }
26
- else if($value['type'] === WPVIVID_REMOTE_AMAZONS3)
27
- {
28
- $out_of_date_remote=$value['s3Path'];
29
- }
30
- else{
31
- $out_of_date_remote='There is no path for remote storage, please set it up first.';
32
- }
33
- }
34
- }
35
  ?>
36
  <tr>
37
  <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('General Settings', 'wpvivid'); ?></label></td>
@@ -120,7 +101,7 @@ function wpvivid_compressing()
120
  }
121
  ?>
122
  <tr>
123
- <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('Choose How to Archive Your Backups', 'wpvivid'); ?></label></td>
124
  <td class="tablelistcolumn">
125
  <div class="postbox schedule-tab-block setting-page-content" id="wpvivid_archive_type">
126
  <fieldset>
@@ -167,9 +148,9 @@ function wpvivid_email_report()
167
  }
168
  ?>
169
  <tr>
170
- <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('Email Report', 'wpvivid'); ?></label></td>
171
  <td class="tablelistcolumn">
172
- <div class="postbox schedule-tab-block">
173
  <div><p><?php _e('In order to use this function, please install a ', 'wpvivid'); ?><strong><a target="_blank" href="https://wpvivid.com/8-best-smtp-plugins-for-wordpress.html"><?php _e('WordPress SMTP plugin', 'wpvivid'); ?></a></strong><?php _e(' of your preference and configure your SMTP server first. This is because WordPress uses the PHP Mail function to send its emails by default, which is not supported by many hosts and can cause issues if it is not set properly.', 'wpvivid'); ?></p>
174
  </div>
175
  <div>
@@ -210,9 +191,9 @@ function wpvivid_clean_junk()
210
  $junk_file=$wpvivid_pulgin->_junk_files_info();
211
  ?>
212
  <tr>
213
- <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('Clean Junk', 'wpvivid'); ?></label></td>
214
  <td class="tablelistcolumn">
215
- <div class="postbox schedule-tab-block">
216
  <div><p><?php _e('Web-server disk space in use by WPvivid:', 'wpvivid'); ?></p>
217
  <div class="schedule-tab-block"><span class="schedule-tab-block"><?php _e('Total Size:', 'wpvivid'); ?></span><span id="wpvivid_junk_sum_size"><?php _e($junk_file['sum_size'], 'wpvivid'); ?></span><input class="button-secondary" id="wpvivid_calculate_size" style="margin-left:10px;" type="submit" name="Calculate-Sizes" value="<?php esc_attr_e( 'Calculate Sizes', 'wpvivid' ); ?>" /></div>
218
 
@@ -257,9 +238,9 @@ function wpvivid_export_import_settings()
257
  {
258
  ?>
259
  <tr>
260
- <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('Export / import settings', 'wpvivid'); ?></label></td>
261
  <td class="tablelistcolumn">
262
- <div class="postbox schedule-tab-block">
263
  <div class="schedule-tab-block">
264
  <input class="button-primary" id="wpvivid_setting_export" type="button" name="" value="<?php esc_attr_e( 'Export', 'wpvivid' ); ?>" />
265
  <p><?php _e('Click \'Export\' button to save WPvivid settings on your local computer.', 'wpvivid'); ?> </p>
@@ -276,166 +257,11 @@ function wpvivid_export_import_settings()
276
  <?php
277
  }
278
 
279
- function wpvivid_schedule_settings()
280
- {
281
- ?>
282
- <tr>
283
- <td class="row-title wpvivid-backup-settings-table tablelistcolumn"><label for="tablecell"><?php _e('Schedule Settings', 'wpvivid'); ?></label></td>
284
- <td class="tablelistcolumn">
285
- <div id="storage-brand-3" style="">
286
- <div>
287
- <div>
288
- <div class="postbox schedule-tab-block">
289
- <label for="wpvivid_schedule_enable">
290
- <input option="schedule" name="enable" type="checkbox" id="wpvivid_schedule_enable" />
291
- <span><?php _e( 'Enable backup schedule', 'wpvivid' ); ?></span>
292
- <div>
293
- <?php
294
- $notice='';
295
- $notice= apply_filters('wpvivid_schedule_notice',$notice);
296
- echo $notice;
297
- ?>
298
- </div>
299
- </label><br>
300
- </div>
301
- <div id="wpvivid_schedule_backup_schedule"">
302
- <div class="postbox schedule-tab-block">
303
- <fieldset>
304
- <legend class="screen-reader-text"><span>input type="radio"</span></legend>
305
- <?php
306
- $time='';
307
- $time= apply_filters('wpvivid_schedule_time',$time);
308
- echo $time;
309
- ?>
310
- </fieldset>
311
- </div>
312
- </div>
313
- </div>
314
- <div class="postbox schedule-tab-block" id="wpvivid_schedule_backup_type">
315
- <div>
316
- <div>
317
- <fieldset>
318
- <legend class="screen-reader-text"><span>input type="radio"</span></legend>
319
- <?php
320
- $backup_type='';
321
- $backup_type= apply_filters('wpvivid_schedule_backup_type',$backup_type);
322
- echo $backup_type;
323
- ?>
324
- </fieldset>
325
- </div>
326
- <div style="clear:both;"></div>
327
- </div>
328
- </div>
329
- <div class="postbox schedule-tab-block" id="wpvivid_schedule_remote_storage">
330
- <div id="wpvivid_schedule_backup_local_remote">
331
- <?php
332
- $html='';
333
- $html= apply_filters('wpvivid_schedule_local_remote',$html);
334
- echo $html;
335
- ?>
336
- </div>
337
- <div id="schedule_upload_storage" style="cursor:pointer;" title="Highlighted icon illuminates that you have choosed a remote storage to store backups">
338
- <?php
339
- $pic='';
340
- $pic= apply_filters('wpvivid_schedule_add_remote_pic',$pic);
341
- echo $pic;
342
- ?>
343
- </div>
344
- </div>
345
- </div>
346
- </div>
347
- </td>
348
- </tr>
349
- <script>
350
- <?php
351
- do_action('wpvivid_schedule_do_js');
352
- ?>
353
- </script>
354
- <?php
355
- }
356
-
357
- function wpvivid_schedule_notice($html)
358
- {
359
- $html='<p>1) Scheduled job will start at web server time: </p>';
360
- $html.='<p>2) Being subjected to mechanisms of PHP, a scheduled backup task for your site will be triggered only when the site receives at least a visit at any page.</p>';
361
- return $html;
362
- }
363
-
364
- function wpvivid_schedule_backup_type($html)
365
- {
366
- $html='<label>';
367
- $html.='<input type="radio" option="schedule" name="backup_type" value="files+db"/>';
368
- $html.='<span>Database + Files (Entire website)</span>';
369
- $html.='</label><br>';
370
-
371
- $html.='<label>';
372
- $html.='<input type="radio" option="schedule" name="backup_type" value="files"/>';
373
- $html.='<span>All Files (Exclude Database)</span>';
374
- $html.='</label><br>';
375
-
376
- $html.='<label>';
377
- $html.='<input type="radio" option="schedule" name="backup_type" value="db"/>';
378
- $html.='<span>Only Database</span>';
379
- $html.='</label><br>';
380
-
381
- return $html;
382
- }
383
-
384
- function wpvivid_schedule_do_js()
385
- {
386
- $schedule=WPvivid_Schedule::get_schedule();
387
- if($schedule['enable'] == true)
388
- {
389
- ?>
390
- jQuery("#wpvivid_schedule_enable").prop('checked', true);
391
- <?php
392
- if($schedule['backup']['remote'] === 1)
393
- {
394
- $schedule_remote='remote';
395
- }
396
- else{
397
- $schedule_remote='local';
398
- }
399
- }
400
- else{
401
- ?>
402
- jQuery("#wpvivid_schedule_backup_schedule").hide();
403
- jQuery("#wpvivid_schedule_backup_type").hide();
404
- jQuery("#wpvivid_schedule_remote_storage").hide();
405
- <?php
406
- $schedule['recurrence']='wpvivid_daily';
407
- $schedule['backup']['backup_files']='files+db';
408
- $schedule_remote='local';
409
- }
410
- ?>
411
- jQuery("input:radio[value='<?php echo $schedule['recurrence']?>']").prop('checked', true);
412
- jQuery("input:radio[value='<?php echo $schedule['backup']['backup_files']?>']").prop('checked', true);
413
- jQuery("input:radio[name='save_local_remote'][value='remote']").click(function(){
414
- <?php
415
- $remote_id_array = WPvivid_Setting::get_user_history('remote_selected');
416
- $remote_id = '';
417
- foreach ($remote_id_array as $value){
418
- $remote_id = $value;
419
- }
420
- if(empty($remote_id)){
421
- ?>
422
- alert("There is no default remote storage configured. Please set it up first.");
423
- <?php
424
- }
425
- ?>
426
- });
427
- <?php
428
- }
429
-
430
  add_action('wpvivid_setting_add_cell','wpvivid_general_settings',10);
431
- add_action('wpvivid_setting_add_cell','wpvivid_schedule_settings',11);
432
  add_action('wpvivid_setting_add_cell','wpvivid_compressing',12);
433
  add_action('wpvivid_setting_add_cell','wpvivid_email_report',13);
434
  add_action('wpvivid_setting_add_cell','wpvivid_clean_junk',14);
435
  add_action('wpvivid_setting_add_cell','wpvivid_export_import_settings',15);
436
- add_action('wpvivid_schedule_do_js','wpvivid_schedule_do_js',10);
437
- add_filter('wpvivid_schedule_backup_type','wpvivid_schedule_backup_type');
438
- add_filter('wpvivid_schedule_notice','wpvivid_schedule_notice',10);
439
  ?>
440
  <div>
441
  <table class="widefat">
13
  }
14
  global $wpvivid_pulgin;
15
  $out_of_date=$wpvivid_pulgin->_get_out_of_date_info();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ?>
17
  <tr>
18
  <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell"><?php _e('General Settings', 'wpvivid'); ?></label></td>
101
  }
102
  ?>
103
  <tr>
104
+ <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell" id="wpvivid_archive_type_item"><?php _e('Choose How to Archive Your Backups', 'wpvivid'); ?></label></td>
105
  <td class="tablelistcolumn">
106
  <div class="postbox schedule-tab-block setting-page-content" id="wpvivid_archive_type">
107
  <fieldset>
148
  }
149
  ?>
150
  <tr>
151
+ <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell" id="wpvivid_email_report_item"><?php _e('Email Report', 'wpvivid'); ?></label></td>
152
  <td class="tablelistcolumn">
153
+ <div class="postbox schedule-tab-block" id="wpvivid_email_report">
154
  <div><p><?php _e('In order to use this function, please install a ', 'wpvivid'); ?><strong><a target="_blank" href="https://wpvivid.com/8-best-smtp-plugins-for-wordpress.html"><?php _e('WordPress SMTP plugin', 'wpvivid'); ?></a></strong><?php _e(' of your preference and configure your SMTP server first. This is because WordPress uses the PHP Mail function to send its emails by default, which is not supported by many hosts and can cause issues if it is not set properly.', 'wpvivid'); ?></p>
155
  </div>
156
  <div>
191
  $junk_file=$wpvivid_pulgin->_junk_files_info();
192
  ?>
193
  <tr>
194
+ <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell" id="wpvivid_clean_junk_item"><?php _e('Clean Junk', 'wpvivid'); ?></label></td>
195
  <td class="tablelistcolumn">
196
+ <div class="postbox schedule-tab-block" id="wpvivid_clean_junk">
197
  <div><p><?php _e('Web-server disk space in use by WPvivid:', 'wpvivid'); ?></p>
198
  <div class="schedule-tab-block"><span class="schedule-tab-block"><?php _e('Total Size:', 'wpvivid'); ?></span><span id="wpvivid_junk_sum_size"><?php _e($junk_file['sum_size'], 'wpvivid'); ?></span><input class="button-secondary" id="wpvivid_calculate_size" style="margin-left:10px;" type="submit" name="Calculate-Sizes" value="<?php esc_attr_e( 'Calculate Sizes', 'wpvivid' ); ?>" /></div>
199
 
238
  {
239
  ?>
240
  <tr>
241
+ <td class="row-title wpvivid-backup-settings-table-left tablelistcolumn"><label for="tablecell" id="wpvivid_export_import_item"><?php _e('Export / import settings', 'wpvivid'); ?></label></td>
242
  <td class="tablelistcolumn">
243
+ <div class="postbox schedule-tab-block" id="wpvivid_export_import">
244
  <div class="schedule-tab-block">
245
  <input class="button-primary" id="wpvivid_setting_export" type="button" name="" value="<?php esc_attr_e( 'Export', 'wpvivid' ); ?>" />
246
  <p><?php _e('Click \'Export\' button to save WPvivid settings on your local computer.', 'wpvivid'); ?> </p>
257
  <?php
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  add_action('wpvivid_setting_add_cell','wpvivid_general_settings',10);
 
261
  add_action('wpvivid_setting_add_cell','wpvivid_compressing',12);
262
  add_action('wpvivid_setting_add_cell','wpvivid_email_report',13);
263
  add_action('wpvivid_setting_add_cell','wpvivid_clean_junk',14);
264
  add_action('wpvivid_setting_add_cell','wpvivid_export_import_settings',15);
 
 
 
265
  ?>
266
  <div>
267
  <table class="widefat">
includes/class-wpvivid-backup-uploader.php CHANGED
@@ -247,7 +247,8 @@ class Wpvivid_BackupUploader
247
  }
248
  $ret['result']='success';
249
  $html = '';
250
- $html = apply_filters('wpvivid_add_backup_list', $html);
 
251
  $ret['html'] = $html;
252
  echo json_encode($ret);
253
  die();
@@ -261,7 +262,7 @@ class Wpvivid_BackupUploader
261
  <span>Tips: Click the button below to scan all uploaded or received backups in directory <?php echo WP_CONTENT_DIR.'/'.$backupdir; ?></span>
262
  </div>
263
  <div style="padding-top: 10px;">
264
- <input type="submit" class="button-primary" value="Scan localhost" onclick="wpvivid_rescan_local_folder();" />
265
  </div>
266
  <script type="text/javascript">
267
  function wpvivid_rescan_local_folder()
@@ -276,7 +277,7 @@ class Wpvivid_BackupUploader
276
  if(jsonarray.html !== false){
277
  jQuery('#wpvivid_backuplist').html('');
278
  jQuery('#wpvivid_backuplist').append(jsonarray.html);
279
- wpvivid_click_switch_page('backup', 'wpvivid_tab_backup', true);
280
  }
281
  }
282
  catch(err) {
247
  }
248
  $ret['result']='success';
249
  $html = '';
250
+ $tour = true;
251
+ $html = apply_filters('wpvivid_add_backup_list', $html, $tour);
252
  $ret['html'] = $html;
253
  echo json_encode($ret);
254
  die();
262
  <span>Tips: Click the button below to scan all uploaded or received backups in directory <?php echo WP_CONTENT_DIR.'/'.$backupdir; ?></span>
263
  </div>
264
  <div style="padding-top: 10px;">
265
+ <input type="submit" class="button-primary" value="Scan uploaded backup or received backup" onclick="wpvivid_rescan_local_folder();" />
266
  </div>
267
  <script type="text/javascript">
268
  function wpvivid_rescan_local_folder()
277
  if(jsonarray.html !== false){
278
  jQuery('#wpvivid_backuplist').html('');
279
  jQuery('#wpvivid_backuplist').append(jsonarray.html);
280
+ wpvivid_popup_tour('show');
281
  }
282
  }
283
  catch(err) {
includes/class-wpvivid-backup.php CHANGED
@@ -116,7 +116,6 @@ class WPvivid_Backup_Task
116
  $this->task['options']['log_file_name']=$id.'_backup';
117
  $log=new WPvivid_Log();
118
  $log->CreateLogFile($this->task['options']['log_file_name'],'no_folder','backup');
119
- $log->CloseFile();
120
 
121
  $this->task['options']['backup_options']['prefix']=$this->task['options']['file_prefix'];
122
  $this->task['options']['backup_options']['compress']=WPvivid_Setting::get_option('wpvivid_compress_setting');
@@ -167,7 +166,6 @@ class WPvivid_Backup_Task
167
  }
168
  }
169
  }
170
-
171
  $this->task['data']['doing']='backup';
172
  $this->task['data']['backup']['doing']='';
173
  $this->task['data']['backup']['finished']=0;
@@ -184,7 +182,7 @@ class WPvivid_Backup_Task
184
  WPvivid_Setting::update_task($id,$this->task);
185
  $ret['result']='success';
186
  $ret['task_id']=$this->task['id'];
187
-
188
  return $ret;
189
  }
190
 
@@ -192,6 +190,8 @@ class WPvivid_Backup_Task
192
  {
193
  if(is_string($backup))
194
  {
 
 
195
  $backup_data['key']=$backup;
196
  $backup_data['result']=false;
197
  $backup_data['compress']=$this->task['options']['backup_options']['compress'];
@@ -248,10 +248,10 @@ class WPvivid_Backup_Task
248
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir(), '/').'#';
249
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR.DIRECTORY_SEPARATOR.'plugins'), '/').'#';
250
  $upload_dir = wp_upload_dir();
251
- $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']), '/').'#';
252
- $exclude_regex[]='#^'.preg_quote($this->transfer_path(get_theme_root()), '/').'#';
253
  $backup_data['exclude_regex']=$exclude_regex;
254
  $backup_data['include_regex']=array();
 
255
  }
256
  else if($backup==WPVIVID_BACKUP_TYPE_CORE)
257
  {
@@ -1186,7 +1186,7 @@ class WPvivid_Backup_Item
1186
  if ($task === false) {
1187
  $ret['result'] = WPVIVID_SUCCESS;
1188
  $ret['files'][$file['file_name']]['status']='need_download';
1189
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1190
  <span>Part'.$format_part.'</span></br>
1191
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1192
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -1196,7 +1196,7 @@ class WPvivid_Backup_Item
1196
  $ret['result'] = WPVIVID_SUCCESS;
1197
  if($task['status'] === 'running'){
1198
  $ret['files'][$file['file_name']]['status'] = 'running';
1199
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1200
  <span>Part'.$format_part.'</span></br>
1201
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
1202
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -1206,7 +1206,7 @@ class WPvivid_Backup_Item
1206
  }
1207
  elseif($task['status'] === 'timeout'){
1208
  $ret['files'][$file['file_name']]['status']='timeout';
1209
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1210
  <span>Part'.$format_part.'</span></br>
1211
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1212
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -1216,7 +1216,7 @@ class WPvivid_Backup_Item
1216
  }
1217
  elseif($task['status'] === 'completed'){
1218
  $ret['files'][$file['file_name']]['status']='completed';
1219
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1220
  <span>Part'.$format_part.'</span></br>
1221
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Download</a></span></br>
1222
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
@@ -1226,7 +1226,7 @@ class WPvivid_Backup_Item
1226
  }
1227
  elseif($task['status'] === 'error'){
1228
  $ret['files'][$file['file_name']]['status']='error';
1229
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1230
  <span>Part'.$format_part.'</span></br>
1231
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1232
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -1244,7 +1244,7 @@ class WPvivid_Backup_Item
1244
  WPvivid_taskmanager::delete_download_task_v2($file['file_name']);
1245
  $ret['files'][$file['file_name']]['status']='completed';
1246
  $ret['files'][$file['file_name']]['download_path']=$path;
1247
- $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1248
  <span>Part'.$format_part.'</span></br>
1249
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Download</a></span></br>
1250
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
@@ -1263,7 +1263,7 @@ class WPvivid_Backup_Item
1263
  else{
1264
  $format_part=$file_count;
1265
  }
1266
- $ret['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px; color:#cccccc;">
1267
  <span>Part'.$format_part.'</span></br>
1268
  <span>Download</span></br>
1269
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
116
  $this->task['options']['log_file_name']=$id.'_backup';
117
  $log=new WPvivid_Log();
118
  $log->CreateLogFile($this->task['options']['log_file_name'],'no_folder','backup');
 
119
 
120
  $this->task['options']['backup_options']['prefix']=$this->task['options']['file_prefix'];
121
  $this->task['options']['backup_options']['compress']=WPvivid_Setting::get_option('wpvivid_compress_setting');
166
  }
167
  }
168
  }
 
169
  $this->task['data']['doing']='backup';
170
  $this->task['data']['backup']['doing']='';
171
  $this->task['data']['backup']['finished']=0;
182
  WPvivid_Setting::update_task($id,$this->task);
183
  $ret['result']='success';
184
  $ret['task_id']=$this->task['id'];
185
+ $log->CloseFile();
186
  return $ret;
187
  }
188
 
190
  {
191
  if(is_string($backup))
192
  {
193
+ if(!function_exists('get_home_path'))
194
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
195
  $backup_data['key']=$backup;
196
  $backup_data['result']=false;
197
  $backup_data['compress']=$this->task['options']['backup_options']['compress'];
248
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR).DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir(), '/').'#';
249
  $exclude_regex[]='#^'.preg_quote($this -> transfer_path(WP_CONTENT_DIR.DIRECTORY_SEPARATOR.'plugins'), '/').'#';
250
  $upload_dir = wp_upload_dir();
251
+ $exclude_regex[]='#^'.preg_quote($this -> transfer_path($upload_dir['basedir']), '/').'#';$exclude_regex[]='#^'.preg_quote($this->transfer_path(get_theme_root()), '/').'#';
 
252
  $backup_data['exclude_regex']=$exclude_regex;
253
  $backup_data['include_regex']=array();
254
+
255
  }
256
  else if($backup==WPVIVID_BACKUP_TYPE_CORE)
257
  {
1186
  if ($task === false) {
1187
  $ret['result'] = WPVIVID_SUCCESS;
1188
  $ret['files'][$file['file_name']]['status']='need_download';
1189
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1190
  <span>Part'.$format_part.'</span></br>
1191
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1192
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
1196
  $ret['result'] = WPVIVID_SUCCESS;
1197
  if($task['status'] === 'running'){
1198
  $ret['files'][$file['file_name']]['status'] = 'running';
1199
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1200
  <span>Part'.$format_part.'</span></br>
1201
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
1202
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
1206
  }
1207
  elseif($task['status'] === 'timeout'){
1208
  $ret['files'][$file['file_name']]['status']='timeout';
1209
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1210
  <span>Part'.$format_part.'</span></br>
1211
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1212
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
1216
  }
1217
  elseif($task['status'] === 'completed'){
1218
  $ret['files'][$file['file_name']]['status']='completed';
1219
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1220
  <span>Part'.$format_part.'</span></br>
1221
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Download</a></span></br>
1222
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
1226
  }
1227
  elseif($task['status'] === 'error'){
1228
  $ret['files'][$file['file_name']]['status']='error';
1229
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1230
  <span>Part'.$format_part.'</span></br>
1231
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Prepare to Download</a></span></br>
1232
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
1244
  WPvivid_taskmanager::delete_download_task_v2($file['file_name']);
1245
  $ret['files'][$file['file_name']]['status']='completed';
1246
  $ret['files'][$file['file_name']]['download_path']=$path;
1247
+ $ret['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1248
  <span>Part'.$format_part.'</span></br>
1249
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer;">Download</a></span></br>
1250
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
1263
  else{
1264
  $format_part=$file_count;
1265
  }
1266
+ $ret['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px; color:#cccccc;">
1267
  <span>Part'.$format_part.'</span></br>
1268
  <span>Download</span></br>
1269
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
includes/class-wpvivid-migrate.php CHANGED
@@ -9,8 +9,8 @@ class WPvivid_Migrate
9
  {
10
  public function __construct()
11
  {
12
- add_action('wpvivid_backuprestore_add_tab',array($this,'add_addon_tab_transfer'), 11);
13
- add_action('wpvivid_backuprestore_add_tab',array($this,'add_addon_tab_key'), 16);
14
  add_action('wpvivid_backuprestore_add_page',array($this,'add_addon_page_transfer'));
15
  add_action('wpvivid_backuprestore_add_page',array($this,'add_addon_page_key'));
16
  add_action('wp_ajax_wpvivid_generate_url',array( $this,'generate_url'));
@@ -304,6 +304,51 @@ class WPvivid_Migrate
304
  die();
305
  }
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  if (WPvivid_taskmanager::is_tasks_backup_running()) {
308
  $ret['result'] = 'failed';
309
  $ret['error'] = __('A task is already running. Please wait until the running task is complete, and try again.', 'wpvivid');
@@ -478,12 +523,12 @@ class WPvivid_Migrate
478
 
479
  public function add_addon_tab_transfer()
480
  {
481
- $html=' <a href="#" id="wpvivid_tab_migrate" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,\'migrate-page\')">Transfer/Migration</a>';
482
  echo $html;
483
  }
484
 
485
  public function add_addon_tab_key(){
486
- $html='<a href="#" id="wpvivid_tab_key" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,\'key-page\')">Generate Key</a>';
487
  echo $html;
488
  }
489
 
@@ -505,11 +550,11 @@ class WPvivid_Migrate
505
  $expires=$value['expires'];
506
 
507
  if ($expires != 0 && time() > $expires) {
508
- $key_status='The key has expired.';
509
  }
510
  else{
511
  $time_diff = $expires - time();
512
- $key_status = date("H:i:s",$time_diff);
513
  }
514
  }
515
  $html .= '<div style="padding: 10px 0 10px 0;">
@@ -517,8 +562,8 @@ class WPvivid_Migrate
517
  <input type="text" id="wpvivid_send_remote_site_url_text" value="'.$token.'" readonly="readonly" />
518
  <input class="button-primary" id="wpvivid_delete_key_button" type="submit" value="'.esc_attr( 'Delete', 'wpvivid' ).'" onclick="wpvivid_click_delete_transfer_key();" />
519
  </div>
520
- <p>'.__('The key will expire in: ', 'wpvivid').$key_status.__('. Once the key expires, you need to generate a new key.', 'wpvivid').'</p>
521
- <p>The connection is ok. Now you can transfer the site <strong>'.$source_dir.'</strong> to the site <strong>'.$target_dir.'</strong></p>';
522
  }
523
  return $html;
524
  }
@@ -575,6 +620,8 @@ class WPvivid_Migrate
575
  </div>
576
  </div>
577
 
 
 
578
  <div style="padding: 0 0 10px 0;">
579
  <div id="wpvivid_transfer_btn" style="float: left;">
580
  <input class="button-primary quicktransfer-btn" type="submit" value="<?php esc_attr_e( 'Transfer', 'wpvivid'); ?>" onclick="wpvivid_click_send_backup();" />
@@ -587,7 +634,7 @@ class WPvivid_Migrate
587
  <p>1. Download a backup in backups list to your computer.</p>
588
  <p>2. Upload the backup to destination site. There are two ways available to use:</p>
589
  <p style="margin-left: 20px;">2.1 Upload the backup to the upload section of WPvivid backup plugin in destination site.</p>
590
- <p style="margin-left: 20px;">2.2 Upload the backup with FTP client to backup directory <?php echo WP_CONTENT_DIR.'/'.$backupdir; ?> in destination site, then click <strong>Scan localhost</strong> button.</p>
591
  <p>3. Once done, the backup appears in backups list. Then, restore the backup.</p>
592
  </div>
593
  </div>
@@ -753,7 +800,7 @@ class WPvivid_Migrate
753
  }
754
  }, function (XMLHttpRequest, textStatus, errorThrown)
755
  {
756
- var error_message = wpvivid_output_ajaxerror('prepare to export website', textStatus, errorThrown);
757
  wpvivid_delete_transfer_ready_task(error_message);
758
  });
759
  }
@@ -827,7 +874,7 @@ class WPvivid_Migrate
827
  if(!wpvivid_display_get_key) {
828
  wpvivid_display_get_key = true;
829
  var div = "<div class='notice notice-info is-dismissible inline'>" +
830
- "<p>1. Visit Generate Key tab page of WPvivid backup plugin of destination site.</p>" +
831
  "<p>2. Generate a key by clicking Generate button and copy it.</p>" +
832
  "<p>3. Go back to this page and paste the key in key box below. Lastly, click Save button.</p>" +
833
  "<button type='button' class='notice-dismiss' onclick='click_dismiss_key_notice(this);'>" +
9
  {
10
  public function __construct()
11
  {
12
+ add_action('wpvivid_backuprestore_add_tab',array($this,'add_addon_tab_transfer'), 12);
13
+ add_action('wpvivid_backuprestore_add_tab',array($this,'add_addon_tab_key'), 17);
14
  add_action('wpvivid_backuprestore_add_page',array($this,'add_addon_page_transfer'));
15
  add_action('wpvivid_backuprestore_add_page',array($this,'add_addon_page_key'));
16
  add_action('wp_ajax_wpvivid_generate_url',array( $this,'generate_url'));
304
  die();
305
  }
306
 
307
+ $json['test_connect']=1;
308
+ $json=json_encode($json);
309
+ $crypt=new WPvivid_crypt(base64_decode($options[$url]['token']));
310
+ $data=$crypt->encrypt_message($json);
311
+ $data=base64_encode($data);
312
+ $args['body']=array('data'=>$data,'action'=>'wpvivid_send_to_site_connect');
313
+ $response=wp_remote_post($url,$args);
314
+
315
+ if ( is_wp_error( $response ) )
316
+ {
317
+ $ret['result']=WPVIVID_FAILED;
318
+ $ret['error']= $response->get_error_message();
319
+ echo json_encode($ret);
320
+ die();
321
+ }
322
+ else
323
+ {
324
+ if($response['response']['code']==200) {
325
+ $res=json_decode($response['body'],1);
326
+ if($res!=null) {
327
+ if($res['result']==WPVIVID_SUCCESS) {
328
+ }
329
+ else {
330
+ $ret['result']=WPVIVID_FAILED;
331
+ $ret['error']= $res['error'];
332
+ echo json_encode($ret);
333
+ die();
334
+ }
335
+ }
336
+ else {
337
+ $ret['result']=WPVIVID_FAILED;
338
+ $ret['error']= 'bad request. '.$response['body'];
339
+ $ret['response']=$response;
340
+ echo json_encode($ret);
341
+ die();
342
+ }
343
+ }
344
+ else {
345
+ $ret['result']=WPVIVID_FAILED;
346
+ $ret['error']= 'upload error '.$response['response']['code'].' '.$response['body'];
347
+ echo json_encode($ret);
348
+ die();
349
+ }
350
+ }
351
+
352
  if (WPvivid_taskmanager::is_tasks_backup_running()) {
353
  $ret['result'] = 'failed';
354
  $ret['error'] = __('A task is already running. Please wait until the running task is complete, and try again.', 'wpvivid');
523
 
524
  public function add_addon_tab_transfer()
525
  {
526
+ $html=' <a href="#" id="wpvivid_tab_migrate" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,\'migrate-page\')">Auto-Migration</a>';
527
  echo $html;
528
  }
529
 
530
  public function add_addon_tab_key(){
531
+ $html='<a href="#" id="wpvivid_tab_key" class="nav-tab wrap-nav-tab" onclick="switchTabs(event,\'key-page\')">Key</a>';
532
  echo $html;
533
  }
534
 
550
  $expires=$value['expires'];
551
 
552
  if ($expires != 0 && time() > $expires) {
553
+ $key_status='The key has expired. Please delete it first and generate a new one.';
554
  }
555
  else{
556
  $time_diff = $expires - time();
557
+ $key_status = 'The key will expire in: '.date("H:i:s",$time_diff).'. Once the key expires, you need to generate a new key.';
558
  }
559
  }
560
  $html .= '<div style="padding: 10px 0 10px 0;">
562
  <input type="text" id="wpvivid_send_remote_site_url_text" value="'.$token.'" readonly="readonly" />
563
  <input class="button-primary" id="wpvivid_delete_key_button" type="submit" value="'.esc_attr( 'Delete', 'wpvivid' ).'" onclick="wpvivid_click_delete_transfer_key();" />
564
  </div>
565
+ <p>'.$key_status.'</p>
566
+ <p>The connection is ok. Now you can transfer the site <strong>'.$source_dir.'</strong> to the site <strong>'.$target_dir.'</strong></p>';
567
  }
568
  return $html;
569
  }
620
  </div>
621
  </div>
622
 
623
+ <p><strong>Note: In order to successfully complete the migration, you'd better deactivate 301 redirect plugin, firewall and security plugin, and caching plugin (if they exist) before transferring website.</strong></p>
624
+
625
  <div style="padding: 0 0 10px 0;">
626
  <div id="wpvivid_transfer_btn" style="float: left;">
627
  <input class="button-primary quicktransfer-btn" type="submit" value="<?php esc_attr_e( 'Transfer', 'wpvivid'); ?>" onclick="wpvivid_click_send_backup();" />
634
  <p>1. Download a backup in backups list to your computer.</p>
635
  <p>2. Upload the backup to destination site. There are two ways available to use:</p>
636
  <p style="margin-left: 20px;">2.1 Upload the backup to the upload section of WPvivid backup plugin in destination site.</p>
637
+ <p style="margin-left: 20px;">2.2 Upload the backup with FTP client to backup directory <?php echo WP_CONTENT_DIR.'/'.$backupdir; ?> in destination site, then click <strong>Scan uploaded backup or received backup</strong> button.</p>
638
  <p>3. Once done, the backup appears in backups list. Then, restore the backup.</p>
639
  </div>
640
  </div>
800
  }
801
  }, function (XMLHttpRequest, textStatus, errorThrown)
802
  {
803
+ var error_message = wpvivid_output_ajaxerror('trying to establish communication with your server', textStatus, errorThrown);
804
  wpvivid_delete_transfer_ready_task(error_message);
805
  });
806
  }
874
  if(!wpvivid_display_get_key) {
875
  wpvivid_display_get_key = true;
876
  var div = "<div class='notice notice-info is-dismissible inline'>" +
877
+ "<p>1. Visit Key tab page of WPvivid backup plugin of destination site.</p>" +
878
  "<p>2. Generate a key by clicking Generate button and copy it.</p>" +
879
  "<p>3. Go back to this page and paste the key in key box below. Lastly, click Save button.</p>" +
880
  "<button type='button' class='notice-dismiss' onclick='click_dismiss_key_notice(this);'>" +
includes/class-wpvivid-restore-database.php CHANGED
@@ -562,14 +562,6 @@ class WPvivid_RestoreDB
562
 
563
  $query = 'SELECT COUNT(*) FROM `'.$table_name.'`';
564
 
565
- /*if(substr($this->replacing_table, strlen($this->new_prefix))=='postmeta')
566
- {
567
- if($this->get_remove_http_slash_link($this->old_site_url)!=false)
568
- {
569
- $query = 'SELECT COUNT(*) FROM `'.$table_name.'` WHERE meta_value LIKE "%'.$this->get_remove_http_slash_link($this->old_site_url).'%"';
570
- }
571
- }*/
572
-
573
  $result=$this->db->query($query);
574
 
575
  if($result && $result->rowCount()>0)
@@ -606,14 +598,7 @@ class WPvivid_RestoreDB
606
  $wpvivid_pulgin->restore_data->write_log('Replace the row in '.$current_row. ' line.', 'notice');
607
  $end_row=$current_row+$page;
608
  $query = 'SELECT * FROM `'.$table_name.'` LIMIT '.$current_row.', '.$end_row;
609
- /*if(substr($this->replacing_table, strlen($this->new_prefix))=='postmeta')
610
- {
611
- if($this->get_remove_http_slash_link($this->old_site_url)!=false)
612
- {
613
- $query = 'SELECT * FROM `'.$table_name.'` WHERE meta_value LIKE "%'.$this->get_remove_http_slash_link($this->old_site_url).'%" LIMIT '.$current_row.', '.$end_row;
614
- $wpvivid_pulgin->restore_data->write_log($query, 'notice');
615
- }
616
- }*/
617
  $result=$this->db->query($query);
618
 
619
  if($result && $result->rowCount()>0)
@@ -655,7 +640,18 @@ class WPvivid_RestoreDB
655
  if(!empty($update)&&!empty($where))
656
  {
657
  $temp_query = 'UPDATE `'.$table_name.'` SET '.implode(', ', $update).' WHERE '.implode(' AND ', array_filter($where)).';';
658
- if(strlen($temp_query)+strlen($update_query)>$this->max_allow_packet)
 
 
 
 
 
 
 
 
 
 
 
659
  {
660
  $wpvivid_pulgin->restore_data->write_log('update replace rows', 'notice');
661
  $this->execute_sql($update_query);
@@ -995,6 +991,27 @@ class WPvivid_RestoreDB
995
  }
996
  }
997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  private function execute_sql($query)
999
  {
1000
  global $wpvivid_pulgin;
562
 
563
  $query = 'SELECT COUNT(*) FROM `'.$table_name.'`';
564
 
 
 
 
 
 
 
 
 
565
  $result=$this->db->query($query);
566
 
567
  if($result && $result->rowCount()>0)
598
  $wpvivid_pulgin->restore_data->write_log('Replace the row in '.$current_row. ' line.', 'notice');
599
  $end_row=$current_row+$page;
600
  $query = 'SELECT * FROM `'.$table_name.'` LIMIT '.$current_row.', '.$end_row;
601
+
 
 
 
 
 
 
 
602
  $result=$this->db->query($query);
603
 
604
  if($result && $result->rowCount()>0)
640
  if(!empty($update)&&!empty($where))
641
  {
642
  $temp_query = 'UPDATE `'.$table_name.'` SET '.implode(', ', $update).' WHERE '.implode(' AND ', array_filter($where)).';';
643
+ if($update_query=='')
644
+ {
645
+ $update_query=$temp_query;
646
+ if(strlen($update_query)>$this->max_allow_packet)
647
+ {
648
+ $wpvivid_pulgin->restore_data->write_log('update replace rows', 'notice');
649
+ $this->execute_sql($update_query);
650
+
651
+ $update_query='';
652
+ }
653
+ }
654
+ else if(strlen($temp_query)+strlen($update_query)>$this->max_allow_packet)
655
  {
656
  $wpvivid_pulgin->restore_data->write_log('update replace rows', 'notice');
657
  $this->execute_sql($update_query);
991
  }
992
  }
993
 
994
+ public function check_max_allow_packet_ex()
995
+ {
996
+ $max_all_packet_warning=false;
997
+ $ret=$this->connect_db();
998
+ if($ret['result']==WPVIVID_SUCCESS)
999
+ {
1000
+ $max_allowed_packet = $this->db->query("SELECT @@session.max_allowed_packet;");
1001
+ if($max_allowed_packet)
1002
+ {
1003
+ $max_allowed_packet = $max_allowed_packet -> fetchAll();
1004
+ if(is_array($max_allowed_packet)&&isset($max_allowed_packet[0])&&isset($max_allowed_packet[0][0]))
1005
+ {
1006
+ if($max_allowed_packet[0][0]<16777216){
1007
+ $max_all_packet_warning = 'max_allow_packet = '.$max_allowed_packet[0][0].' is too small. The recommended value is 16M or higher. Too small value could lead to a failure when importing a larger database.';
1008
+ }
1009
+ }
1010
+ }
1011
+ }
1012
+ return $max_all_packet_warning;
1013
+ }
1014
+
1015
  private function execute_sql($query)
1016
  {
1017
  global $wpvivid_pulgin;
includes/class-wpvivid-zipclass.php CHANGED
@@ -21,6 +21,8 @@ class WPvivid_ZipClass extends Wpvivid_Compress_Default{
21
 
22
  public function compress($data)
23
  {
 
 
24
  global $wpvivid_pulgin;
25
  $wpvivid_pulgin->wpvivid_log->WriteLog('Start compressing '.$data['key'],'notice');
26
  $files = $this -> filesplit($data['compress']['max_file_size'],$data['files']);
21
 
22
  public function compress($data)
23
  {
24
+ if(!function_exists('get_home_path'))
25
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
26
  global $wpvivid_pulgin;
27
  $wpvivid_pulgin->wpvivid_log->WriteLog('Start compressing '.$data['key'],'notice');
28
  $files = $this -> filesplit($data['compress']['max_file_size'],$data['files']);
includes/class-wpvivid.php CHANGED
@@ -92,7 +92,7 @@ class WPvivid {
92
 
93
  add_filter('pre_update_option',array( $this,'wpjam_pre_update_option_cache'),10,2);
94
 
95
- add_filter('wpvivid_add_backup_list', array( $this, 'wpvivid_add_backup_list' ), 10);
96
  add_filter('wpvivid_add_remote_storage_list', array( $this, 'wpvivid_add_remote_storage_list' ), 10);
97
  add_filter('wpvivid_schedule_add_remote_pic', array( $this, 'wpvivid_schedule_add_remote_pic' ), 10);
98
  add_filter('wpvivid_get_remote_directory', array( $this, 'wpvivid_get_remote_directory' ), 10);
@@ -261,6 +261,7 @@ class WPvivid {
261
  //Update settings
262
  add_action('wp_ajax_wpvivid_update_setting',array( $this,'update_setting'));
263
  add_action('wp_ajax_wpvivid_set_general_setting',array( $this,'set_general_setting'));
 
264
  //Export settings
265
  add_action('wp_ajax_wpvivid_export_setting',array( $this,'export_setting'));
266
  //Import settings
@@ -342,7 +343,7 @@ class WPvivid {
342
  die();
343
  }
344
 
345
- $ret = $this->check_backup_option($backup_options);
346
  if($ret['result']!=WPVIVID_SUCCESS)
347
  {
348
  echo json_encode($ret);
@@ -369,7 +370,7 @@ class WPvivid {
369
  die();
370
  }
371
  }
372
- public function check_backup_option($data)
373
  {
374
  $ret['result']=WPVIVID_FAILED;
375
  if(!isset($data['backup_files']))
@@ -401,14 +402,16 @@ class WPvivid {
401
  return $ret;
402
  }
403
 
404
- if($data['remote'] === '1')
405
- {
406
- $remote_storage=WPvivid_Setting::get_remote_options();
407
- if($remote_storage == false) {
408
- $ret['error']=__('There is no default remote storage configured. Please set it up first.', 'wpvivid');
409
- return $ret;
 
410
  }
411
  }
 
412
  $ret['result']=WPVIVID_SUCCESS;
413
  $ret=apply_filters('wpvivid_check_backup_options_valid',$ret,$data);
414
  return $ret;
@@ -668,7 +671,7 @@ class WPvivid {
668
  $schedule_options['backup']['ismerge']=strval($schedule_options['backup']['ismerge']);
669
  $schedule_options['backup']['lock']=strval($schedule_options['backup']['lock']);
670
 
671
- $ret = $this->check_backup_option($schedule_options['backup']);
672
  if($ret['result']!=WPVIVID_SUCCESS)
673
  {
674
  echo json_encode($ret);
@@ -786,43 +789,6 @@ class WPvivid {
786
  @unlink($file);
787
  }
788
  }
789
- /*$files=array();
790
- $download_dir=$backup['local']['path'];
791
- if($backup['backup']['ismerge'])
792
- {
793
- foreach ($backup['backup']['data']['meta']['files'] as $file)
794
- {
795
- $files[]=$file['file_name'];
796
- $files[]=$file['file_name'].'.txt';
797
- }
798
-
799
- foreach ($backup['backup']['data']['type'] as $type)
800
- {
801
- foreach ($type['files'] as $file)
802
- {
803
- $files[]=$file['file_name'].'.txt';
804
- }
805
- }
806
- }
807
- else
808
- {
809
- foreach ($backup['backup']['data']['type'] as $type)
810
- {
811
- foreach ($type['files'] as $file)
812
- {
813
- $files[]=$file['file_name'];
814
- }
815
- }
816
- }
817
-
818
- foreach ($files as $file)
819
- {
820
- $download_path = WP_CONTENT_DIR .DIRECTORY_SEPARATOR . $download_dir . DIRECTORY_SEPARATOR . $file;
821
- if (file_exists($download_path))
822
- {
823
- unlink($download_path);
824
- }
825
- }*/
826
 
827
  if(!empty($backup['remote']))
828
  {
@@ -1861,27 +1827,6 @@ class WPvivid {
1861
  $backup_item=new WPvivid_Backup_Item($backup);
1862
  $ret=$backup_item->get_download_backup_files($backup_id);
1863
 
1864
- //echo json_encode($ret);
1865
-
1866
- //$type_list = $backup_item->get_download_type();
1867
- /*if($backup['backup']['ismerge']==1)
1868
- {
1869
- $type_list[]='all';
1870
-
1871
- }
1872
- else
1873
- {
1874
- foreach ($backup['backup']['data']['type'] as $type)
1875
- {
1876
- $type_list[]=$type['type_name'];
1877
- }
1878
- }*/
1879
- /*$ret['data']=array();
1880
- foreach ($type_list as $type_name)
1881
- {
1882
- $ret['data']['type'][$type_name]=$download_item->check_backup_download($backup_id,$type_name);
1883
- }*/
1884
-
1885
  WPvivid_taskmanager::update_download_cache($backup_id,$ret);
1886
  return $ret;
1887
  }
@@ -1947,7 +1892,7 @@ class WPvivid {
1947
  if($b_has_remote)
1948
  {
1949
  $data['files'][$file['file_name']]['status']='need_download';
1950
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1951
  <span>Part'.$format_part.'</span></br>
1952
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1953
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -1966,7 +1911,7 @@ class WPvivid {
1966
  if(time()-$task['run_time']>60)
1967
  {
1968
  $data['files'][$file['file_name']]['status']='timeout';
1969
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1970
  <span>Part'.$format_part.'</span></br>
1971
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1972
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -1976,7 +1921,7 @@ class WPvivid {
1976
  else
1977
  {
1978
  $data['files'][$file['file_name']]['status'] = 'running';
1979
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1980
  <span>Part'.$format_part.'</span></br>
1981
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
1982
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -1990,7 +1935,7 @@ class WPvivid {
1990
  if($b_has_remote)
1991
  {
1992
  $data['files'][$file['file_name']]['status']='need_download';
1993
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
1994
  <span>Part'.$format_part.'</span></br>
1995
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1996
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2009,7 +1954,7 @@ class WPvivid {
2009
  if($b_has_remote)
2010
  {
2011
  $data['files'][$file['file_name']]['status']='need_download';
2012
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2013
  <span>Part'.$format_part.'</span></br>
2014
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2015
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2033,7 +1978,7 @@ class WPvivid {
2033
  $data['files'][$file['file_name']]['status']='completed';
2034
  $download_path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.$download_dir.DIRECTORY_SEPARATOR.$file['file_name'];
2035
  $data['files'][$file['file_name']]['download_path']=$download_path;
2036
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2037
  <span>Part'.$format_part.'</span></br>
2038
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Download</a></span></br>
2039
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
@@ -2052,7 +1997,7 @@ class WPvivid {
2052
  else{
2053
  $format_part=$file_count;
2054
  }
2055
- $data['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px; color:#cccccc;">
2056
  <span>Part'.$format_part.'</span></br>
2057
  <span>Download</span></br>
2058
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2110,7 +2055,7 @@ class WPvivid {
2110
  if(time()-$task['run_time']>60)
2111
  {
2112
  $data['files'][$file['file_name']]['status']='timeout';
2113
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2114
  <span>Part'.$format_part.'</span></br>
2115
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2116
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -2120,7 +2065,7 @@ class WPvivid {
2120
  else
2121
  {
2122
  $data['files'][$file['file_name']]['status'] = 'running';
2123
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2124
  <span>Part'.$format_part.'</span></br>
2125
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
2126
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
@@ -2131,7 +2076,7 @@ class WPvivid {
2131
  } else if ($task['files'][$file['file_name']]['status'] == 'completed')
2132
  {
2133
  $data['files'][$file['file_name']]['status'] = 'completed';
2134
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2135
  <span>Part'.$format_part.'</span></br>
2136
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Download</a></span></br>
2137
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
@@ -2143,7 +2088,7 @@ class WPvivid {
2143
  } else if ($task['files'][$file['file_name']]['status'] == 'error')
2144
  {
2145
  $data['files'][$file['file_name']]['status'] = 'error';
2146
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2147
  <span>Part'.$format_part.'</span></br>
2148
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2149
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2158,7 +2103,7 @@ class WPvivid {
2158
  if($data['files'][$file['file_name']]['status']=='error')
2159
  {
2160
  $data['files'][$file['file_name']]['status']='need_download';
2161
- $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px;">
2162
  <span>Part'.$format_part.'</span></br>
2163
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2164
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2178,7 +2123,7 @@ class WPvivid {
2178
  else{
2179
  $format_part=$file_count;
2180
  }
2181
- $data['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:290px; color:#cccccc;">
2182
  <span>Part'.$format_part.'</span></br>
2183
  <span>Download</span></br>
2184
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
@@ -2328,6 +2273,7 @@ class WPvivid {
2328
  }
2329
  else
2330
  {
 
2331
  $download_rate = 1024*10;
2332
  $file = fopen($path, "r");
2333
  while(!feof($file))
@@ -2575,6 +2521,9 @@ class WPvivid {
2575
  }
2576
 
2577
  $remote_options['type']=$_POST['type'];
 
 
 
2578
  $ret=$this->remote_collection->add_remote($remote_options);
2579
 
2580
  if($ret['result']=='success')
@@ -2695,6 +2644,9 @@ class WPvivid {
2695
  die();
2696
  }
2697
  $remote_options['type']=$_POST['type'];
 
 
 
2698
  $ret=$this->remote_collection->update_remote($_POST['id'],$remote_options);
2699
 
2700
  if($ret['result']=='success')
@@ -2867,6 +2819,27 @@ class WPvivid {
2867
 
2868
  $ret=array_merge($ret,$ret_scan_last_restore);
2869
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2870
  echo json_encode($ret);
2871
  die();
2872
  }
@@ -4180,7 +4153,24 @@ class WPvivid {
4180
  $setting_data= apply_filters('wpvivid_set_general_setting',$setting_data, $setting, $options);
4181
  $ret['setting']=WPvivid_Setting::update_setting($setting_data);
4182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4183
 
 
4184
  if(isset($_POST['schedule'])&&!empty($_POST['schedule']))
4185
  {
4186
  $json = $_POST['schedule'];
@@ -4850,7 +4840,7 @@ class WPvivid {
4850
  die();
4851
  }
4852
 
4853
- public function wpvivid_add_backup_list($html)
4854
  {
4855
  $html = '';
4856
  $backuplist=WPvivid_Backuplist::get_backuplist();
@@ -4916,7 +4906,16 @@ class WPvivid {
4916
  $remote_pic_html .= '<img src="' . esc_url(WPVIVID_PLUGIN_URL . $pic) . '" style="vertical-align:middle; " title="' . $title . '"/>';
4917
  }
4918
  }
4919
- //<tr style="'.$row_style.'">
 
 
 
 
 
 
 
 
 
4920
  $html .= '<tr style="'.$row_style.'">
4921
  <th class="check-column"><input name="check_backup" type="checkbox" id="'.esc_attr($key, 'wpvivid').'" value="'.esc_attr($key, 'wpvivid').'" onclick="wpvivid_click_check_backup(\''.__($key, 'wpvivid').'\');" /></th>
4922
  <td class="tablelistcolumn">
@@ -4928,14 +4927,13 @@ class WPvivid {
4928
  </span>
4929
  <span style="margin:0;">|</span> <span>'.__('Type:', 'wpvivid').'</span><span>'.__($value['type'], 'wpvivid').'</span>
4930
  <span style="margin:0;">|</span> <span title="Backup log"><a href="#" onclick="wpvivid_read_log(\''.__('wpvivid_view_backup_log').'\', \''.__($key).'\');"><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Log.png').'" style="vertical-align:middle;cursor:pointer;"/><span style="margin:0;">'.__('Log', 'wpvivid').'</span></a></span>
4931
- <span style="margin:0;">|</span> <span title="Restore Website from The Backup"><a href="#" onclick="wpvivid_initialize_restore(\''.__($key, 'wpvivid').'\',\''.__(date('M d, Y H:i',$value['create_time']), 'wpvivid').'\');"><img src="'.esc_url(WPVIVID_PLUGIN_URL. '/admin/partials/images/Restore.png').'" style="vertical-align:middle;cursor:pointer;"/><span style="margin:0;">'.__('Restore', 'wpvivid').'</span></a></span>
4932
  </div>
4933
  </div>
4934
  </td>
4935
  <td class="tablelistcolumn">
4936
  <div style="float:left;padding:10px 10px 10px 0;">'.$remote_pic_html.'</div>
4937
  </td>
4938
- <td class="tablelistcolumn">
4939
  <div id="wpvivid_file_part_'.__($key, 'wpvivid').'" style="float:left;padding:10px 10px 10px 0;">
4940
  <div style="cursor:pointer;" onclick="wpvivid_initialize_download(\''.__($key, 'wpvivid').'\');" title="Prepare to download the backup">
4941
  <img id="wpvivid_download_btn_'.__($key, 'wpvivid').'" src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/download.png').'" style="vertical-align:middle;" /><span>'.__('Download', 'wpvivid').'</span>
@@ -4943,8 +4941,15 @@ class WPvivid {
4943
  </div>
4944
  </div>
4945
  </td>
 
 
 
 
 
 
 
4946
  <td class="tablelistcolumn">
4947
- <div class="backuplist-delete-backup">
4948
  <img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Delete.png').'" style="vertical-align:middle; cursor:pointer;" title="Delete the backup" onclick="wpvivid_delete_selected_backup(\''.__($key, 'wpvivid').'\');"/>
4949
  </div>
4950
  </td>
92
 
93
  add_filter('pre_update_option',array( $this,'wpjam_pre_update_option_cache'),10,2);
94
 
95
+ add_filter('wpvivid_add_backup_list', array( $this, 'wpvivid_add_backup_list' ), 10, 2);
96
  add_filter('wpvivid_add_remote_storage_list', array( $this, 'wpvivid_add_remote_storage_list' ), 10);
97
  add_filter('wpvivid_schedule_add_remote_pic', array( $this, 'wpvivid_schedule_add_remote_pic' ), 10);
98
  add_filter('wpvivid_get_remote_directory', array( $this, 'wpvivid_get_remote_directory' ), 10);
261
  //Update settings
262
  add_action('wp_ajax_wpvivid_update_setting',array( $this,'update_setting'));
263
  add_action('wp_ajax_wpvivid_set_general_setting',array( $this,'set_general_setting'));
264
+ add_action('wp_ajax_wpvivid_set_schedule',array( $this,'set_schedule' ));
265
  //Export settings
266
  add_action('wp_ajax_wpvivid_export_setting',array( $this,'export_setting'));
267
  //Import settings
343
  die();
344
  }
345
 
346
+ $ret = $this->check_backup_option($backup_options, 'Manual');
347
  if($ret['result']!=WPVIVID_SUCCESS)
348
  {
349
  echo json_encode($ret);
370
  die();
371
  }
372
  }
373
+ public function check_backup_option($data, $backup_method = 'Manual')
374
  {
375
  $ret['result']=WPVIVID_FAILED;
376
  if(!isset($data['backup_files']))
402
  return $ret;
403
  }
404
 
405
+ if($backup_method == 'Manual') {
406
+ if ($data['remote'] === '1') {
407
+ $remote_storage = WPvivid_Setting::get_remote_options();
408
+ if ($remote_storage == false) {
409
+ $ret['error'] = __('There is no default remote storage configured. Please set it up first.', 'wpvivid');
410
+ return $ret;
411
+ }
412
  }
413
  }
414
+
415
  $ret['result']=WPVIVID_SUCCESS;
416
  $ret=apply_filters('wpvivid_check_backup_options_valid',$ret,$data);
417
  return $ret;
671
  $schedule_options['backup']['ismerge']=strval($schedule_options['backup']['ismerge']);
672
  $schedule_options['backup']['lock']=strval($schedule_options['backup']['lock']);
673
 
674
+ $ret = $this->check_backup_option($schedule_options['backup'], 'Cron');
675
  if($ret['result']!=WPVIVID_SUCCESS)
676
  {
677
  echo json_encode($ret);
789
  @unlink($file);
790
  }
791
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
 
793
  if(!empty($backup['remote']))
794
  {
1827
  $backup_item=new WPvivid_Backup_Item($backup);
1828
  $ret=$backup_item->get_download_backup_files($backup_id);
1829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1830
  WPvivid_taskmanager::update_download_cache($backup_id,$ret);
1831
  return $ret;
1832
  }
1892
  if($b_has_remote)
1893
  {
1894
  $data['files'][$file['file_name']]['status']='need_download';
1895
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1896
  <span>Part'.$format_part.'</span></br>
1897
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1898
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
1911
  if(time()-$task['run_time']>60)
1912
  {
1913
  $data['files'][$file['file_name']]['status']='timeout';
1914
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1915
  <span>Part'.$format_part.'</span></br>
1916
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1917
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
1921
  else
1922
  {
1923
  $data['files'][$file['file_name']]['status'] = 'running';
1924
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1925
  <span>Part'.$format_part.'</span></br>
1926
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
1927
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
1935
  if($b_has_remote)
1936
  {
1937
  $data['files'][$file['file_name']]['status']='need_download';
1938
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1939
  <span>Part'.$format_part.'</span></br>
1940
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1941
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
1954
  if($b_has_remote)
1955
  {
1956
  $data['files'][$file['file_name']]['status']='need_download';
1957
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1958
  <span>Part'.$format_part.'</span></br>
1959
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
1960
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
1978
  $data['files'][$file['file_name']]['status']='completed';
1979
  $download_path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.$download_dir.DIRECTORY_SEPARATOR.$file['file_name'];
1980
  $data['files'][$file['file_name']]['download_path']=$download_path;
1981
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
1982
  <span>Part'.$format_part.'</span></br>
1983
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Download</a></span></br>
1984
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
1997
  else{
1998
  $format_part=$file_count;
1999
  }
2000
+ $data['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px; color:#cccccc;">
2001
  <span>Part'.$format_part.'</span></br>
2002
  <span>Download</span></br>
2003
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
2055
  if(time()-$task['run_time']>60)
2056
  {
2057
  $data['files'][$file['file_name']]['status']='timeout';
2058
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
2059
  <span>Part'.$format_part.'</span></br>
2060
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2061
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
2065
  else
2066
  {
2067
  $data['files'][$file['file_name']]['status'] = 'running';
2068
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
2069
  <span>Part'.$format_part.'</span></br>
2070
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a >Retriving(remote storage to web server)</a></span></br>
2071
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:'.$task['progress_text'].'%;height:5px;"></div></div>
2076
  } else if ($task['files'][$file['file_name']]['status'] == 'completed')
2077
  {
2078
  $data['files'][$file['file_name']]['status'] = 'completed';
2079
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
2080
  <span>Part'.$format_part.'</span></br>
2081
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_download(\''.$backup_id.'\', \''.$check_type.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Download</a></span></br>
2082
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:100%;height:5px;"></div></div>
2088
  } else if ($task['files'][$file['file_name']]['status'] == 'error')
2089
  {
2090
  $data['files'][$file['file_name']]['status'] = 'error';
2091
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
2092
  <span>Part'.$format_part.'</span></br>
2093
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2094
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
2103
  if($data['files'][$file['file_name']]['status']=='error')
2104
  {
2105
  $data['files'][$file['file_name']]['status']='need_download';
2106
+ $data['files'][$file['file_name']]['html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px;">
2107
  <span>Part'.$format_part.'</span></br>
2108
  <span id=\''.$backup_id.'-text-part-'.$file_part_num.'\'><a onclick="wpvivid_prepare_download(\''.$file_part_num.'\', \''.$backup_id.'\', \''.$file['file_name'].'\');" style="cursor: pointer">Prepare to Download</a></span></br>
2109
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div id=\''.$backup_id.'-progress-part-'.$file_part_num.'\' style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
2123
  else{
2124
  $format_part=$file_count;
2125
  }
2126
+ $data['place_html']='<div style="float:left;margin:10px 10px 10px 0;text-align:center; width:180px; color:#cccccc;">
2127
  <span>Part'.$format_part.'</span></br>
2128
  <span>Download</span></br>
2129
  <div style="width:100%;height:5px; background-color:#dcdcdc;"><div style="background-color:#0085ba; float:left;width:0;height:5px;"></div></div>
2273
  }
2274
  else
2275
  {
2276
+ ob_end_clean();
2277
  $download_rate = 1024*10;
2278
  $file = fopen($path, "r");
2279
  while(!feof($file))
2521
  }
2522
 
2523
  $remote_options['type']=$_POST['type'];
2524
+ if($remote_options['type'] == 'amazons3'){
2525
+ $remote_options['s3Path'] = rtrim($remote_options['s3Path'], "/");
2526
+ }
2527
  $ret=$this->remote_collection->add_remote($remote_options);
2528
 
2529
  if($ret['result']=='success')
2644
  die();
2645
  }
2646
  $remote_options['type']=$_POST['type'];
2647
+ if($remote_options['type'] == 'amazons3'){
2648
+ $remote_options['s3Path'] = rtrim($remote_options['s3Path'], "/");
2649
+ }
2650
  $ret=$this->remote_collection->update_remote($_POST['id'],$remote_options);
2651
 
2652
  if($ret['result']=='success')
2819
 
2820
  $ret=array_merge($ret,$ret_scan_last_restore);
2821
 
2822
+ $restore_db_data = new WPvivid_RestoreDB();
2823
+ $ret['max_allow_packet_warning']=$restore_db_data ->check_max_allow_packet_ex();
2824
+
2825
+ $memory_limit = ini_get('memory_limit');
2826
+ $unit = substr($memory_limit, -1);
2827
+ if($unit == 'K'){
2828
+ $memory_limit = intval($memory_limit) * 1024;
2829
+ }
2830
+ else if($unit == 'M'){
2831
+ $memory_limit = intval($memory_limit) * 1024 * 1024;
2832
+ }
2833
+ else if($unit == 'G'){
2834
+ $memory_limit = intval($memory_limit) * 1024 * 1024 * 1024;
2835
+ }
2836
+ if($memory_limit<256 * 1024 * 1024){
2837
+ $ret['memory_limit_warning']='memory_limit = '.$memory_limit.' is too small. The recommended value is 256M or higher. Too small value could result in a failure of website restore.';
2838
+ }
2839
+ else{
2840
+ $ret['memory_limit_warning']=false;
2841
+ }
2842
+
2843
  echo json_encode($ret);
2844
  die();
2845
  }
4153
  $setting_data= apply_filters('wpvivid_set_general_setting',$setting_data, $setting, $options);
4154
  $ret['setting']=WPvivid_Setting::update_setting($setting_data);
4155
  }
4156
+ }
4157
+ catch (Exception $error)
4158
+ {
4159
+ $message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
4160
+ error_log($message);
4161
+ echo json_encode(array('result'=>'failed','error'=>$message));
4162
+ die();
4163
+ }
4164
+ echo json_encode($ret);
4165
+ die();
4166
+ }
4167
+
4168
+ public function set_schedule(){
4169
+ $this->ajax_check_security('manage_options');
4170
+
4171
+ $ret=array();
4172
 
4173
+ try{
4174
  if(isset($_POST['schedule'])&&!empty($_POST['schedule']))
4175
  {
4176
  $json = $_POST['schedule'];
4840
  die();
4841
  }
4842
 
4843
+ public function wpvivid_add_backup_list($html, $tour = false)
4844
  {
4845
  $html = '';
4846
  $backuplist=WPvivid_Backuplist::get_backuplist();
4906
  $remote_pic_html .= '<img src="' . esc_url(WPVIVID_PLUGIN_URL . $pic) . '" style="vertical-align:middle; " title="' . $title . '"/>';
4907
  }
4908
  }
4909
+ if($tour){
4910
+ $tour = false;
4911
+ $tour_message = '<div class="wpvivid-popuptext" id="wpvivid_popup_tour">Click the button to complete website restore or migration</div>';
4912
+ $tour_class = 'wpvivid-popup';
4913
+ }
4914
+ else{
4915
+ $tour_message = '';
4916
+ $tour_class = '';
4917
+ }
4918
+ $hide = 'hide';
4919
  $html .= '<tr style="'.$row_style.'">
4920
  <th class="check-column"><input name="check_backup" type="checkbox" id="'.esc_attr($key, 'wpvivid').'" value="'.esc_attr($key, 'wpvivid').'" onclick="wpvivid_click_check_backup(\''.__($key, 'wpvivid').'\');" /></th>
4921
  <td class="tablelistcolumn">
4927
  </span>
4928
  <span style="margin:0;">|</span> <span>'.__('Type:', 'wpvivid').'</span><span>'.__($value['type'], 'wpvivid').'</span>
4929
  <span style="margin:0;">|</span> <span title="Backup log"><a href="#" onclick="wpvivid_read_log(\''.__('wpvivid_view_backup_log').'\', \''.__($key).'\');"><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Log.png').'" style="vertical-align:middle;cursor:pointer;"/><span style="margin:0;">'.__('Log', 'wpvivid').'</span></a></span>
 
4930
  </div>
4931
  </div>
4932
  </td>
4933
  <td class="tablelistcolumn">
4934
  <div style="float:left;padding:10px 10px 10px 0;">'.$remote_pic_html.'</div>
4935
  </td>
4936
+ <td class="tablelistcolumn" style="min-width:100px;">
4937
  <div id="wpvivid_file_part_'.__($key, 'wpvivid').'" style="float:left;padding:10px 10px 10px 0;">
4938
  <div style="cursor:pointer;" onclick="wpvivid_initialize_download(\''.__($key, 'wpvivid').'\');" title="Prepare to download the backup">
4939
  <img id="wpvivid_download_btn_'.__($key, 'wpvivid').'" src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/download.png').'" style="vertical-align:middle;" /><span>'.__('Download', 'wpvivid').'</span>
4941
  </div>
4942
  </div>
4943
  </td>
4944
+ <td class="tablelistcolumn" style="min-width:100px;">
4945
+ <div class="'.$tour_class.'" onclick="wpvivid_popup_tour(\''.$hide.'\');">
4946
+ '.$tour_message.'<div style="cursor:pointer;padding:10px 0 10px 0;" onclick="wpvivid_initialize_restore(\''.__($key, 'wpvivid').'\',\''.__(date('M d, Y H:i',$value['create_time']), 'wpvivid').'\',\''.__($value['type'], 'wpvivid').'\');" style="float:left;padding:10px 10px 10px 0;">
4947
+ <img src="'.esc_url(WPVIVID_PLUGIN_URL. '/admin/partials/images/Restore.png').'" style="vertical-align:middle;" /><span>'.__('Restore', 'wpvivid').'</span>
4948
+ </div>
4949
+ </div>
4950
+ </td>
4951
  <td class="tablelistcolumn">
4952
+ <div class="backuplist-delete-backup" style="padding:10px 0 10px 0;">
4953
  <img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Delete.png').'" style="vertical-align:middle; cursor:pointer;" title="Delete the backup" onclick="wpvivid_delete_selected_backup(\''.__($key, 'wpvivid').'\');"/>
4954
  </div>
4955
  </td>
includes/customclass/class-wpvivid-amazons3-plus.php CHANGED
@@ -5,6 +5,8 @@ if (!defined('WPVIVID_PLUGIN_DIR')){
5
 
6
  define('WPVIVID_REMOTE_AMAZONS3','amazons3');
7
 
 
 
8
  require_once WPVIVID_PLUGIN_DIR . '/includes/customclass/class-wpvivid-remote.php';
9
  require_once 'class-wpvivid-base-s3.php';
10
  class WPvivid_AMAZONS3Class extends WPvivid_Remote{
@@ -47,7 +49,7 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
47
  <div id="storage_account_amazons3" class="storage-account-page" style="display:none;">
48
  <h2><span><?php _e( 'Enter Your Amazon S3 Account ','wpvivid'); ?></span></h2>
49
  <div class="storage-account-form">
50
- <input type="text" autocomplete="off" option="amazons3" name="name" placeholder="Custom an unique name: e.g. Amazon S3-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
51
  </div>
52
  <div class="storage-account-form">
53
  <input type="text" autocomplete="off" option="amazons3" name="access" placeholder="Amazon S3 access key" class="regular-text"/>
@@ -56,7 +58,11 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
56
  <input type="password" autocomplete="new-password" option="amazons3" name="secret" placeholder="Amazon S3 secret key" class="regular-text"/>
57
  </div>
58
  <div class="storage-account-form">
59
- <input type="text" autocomplete="off" option="amazons3" name="s3Path" placeholder="Amazon S3 path(e.g. test/test)" class="regular-text" onkeyup="value=value.replace(/^\//g, '')" />
 
 
 
 
60
  </div>
61
  <div class="remote-storage-set-default-block">
62
  <label>
@@ -76,6 +82,16 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
76
  <div id="wpvivid_storage_account_notice"></div>
77
  <div class=""><input class="button-primary storage-account-button" option="add-remote" type="button" name="Example" value="<?php _e( 'Test and Add', 'wpvivid' ); ?>" /></div>
78
  </div>
 
 
 
 
 
 
 
 
 
 
79
  <?php
80
  }
81
 
@@ -85,7 +101,7 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
85
  <div id="remote_storage_edit_amazons3" class="postbox storage-account-block remote-storage-edit" style="display:none;">
86
  <h2><span><?php _e( 'Enter Your Amazon S3 Account ','wpvivid'); ?></span></h2>
87
  <div class="storage-account-form">
88
- <input type="text" option="edit-amazons3" name="name" placeholder="Custom an unique name: e.g. Amazon S3-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
89
  </div>
90
  <div class="storage-account-form">
91
  <input type="text" option="edit-amazons3" name="access" placeholder="Amazon S3 access key" class="regular-text"/>
@@ -94,7 +110,11 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
94
  <input type="password" option="edit-amazons3" name="secret" placeholder="Amazon S3 secret key" class="regular-text"/>
95
  </div>
96
  <div class="storage-account-form">
97
- <input type="text" autocomplete="off" option="edit-amazons3" name="s3Path" placeholder="Amazon S3 path(e.g. test/test)" class="regular-text" onkeyup="value=value.replace(/^\//g, '')" />
 
 
 
 
98
  </div>
99
  <div class="remote-storage-amazons3-storage-class">
100
  <label>
@@ -108,6 +128,16 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
108
  </div>
109
  <div class=""><input class="button-primary storage-account-button" option="edit-remote" type="button" name="amazons3" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
110
  </div>
 
 
 
 
 
 
 
 
 
 
111
  <?php
112
  }
113
 
@@ -207,6 +237,8 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
207
  return $ret;
208
  }
209
 
 
 
210
  $ret['result']=WPVIVID_SUCCESS;
211
  $ret['options']=$this->options;
212
  return $ret;
5
 
6
  define('WPVIVID_REMOTE_AMAZONS3','amazons3');
7
 
8
+ define('WPVIVID_AMAZONS3_DEFAULT_FOLDER','/wpvivid_backup');
9
+
10
  require_once WPVIVID_PLUGIN_DIR . '/includes/customclass/class-wpvivid-remote.php';
11
  require_once 'class-wpvivid-base-s3.php';
12
  class WPvivid_AMAZONS3Class extends WPvivid_Remote{
49
  <div id="storage_account_amazons3" class="storage-account-page" style="display:none;">
50
  <h2><span><?php _e( 'Enter Your Amazon S3 Account ','wpvivid'); ?></span></h2>
51
  <div class="storage-account-form">
52
+ <input type="text" autocomplete="off" option="amazons3" name="name" placeholder="Enter an unique alias: e.g. Amazon S3-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
53
  </div>
54
  <div class="storage-account-form">
55
  <input type="text" autocomplete="off" option="amazons3" name="access" placeholder="Amazon S3 access key" class="regular-text"/>
58
  <input type="password" autocomplete="new-password" option="amazons3" name="secret" placeholder="Amazon S3 secret key" class="regular-text"/>
59
  </div>
60
  <div class="storage-account-form">
61
+ <input type="text" autocomplete="off" option="amazons3" name="s3Path" placeholder="Amazon S3 path(e.g. test)" class="regular-text" onkeyup="value=value.replace(/^\//g, '')" style="width: 245px;" />
62
+ <span><?php _e(WPVIVID_AMAZONS3_DEFAULT_FOLDER); ?></span>
63
+ </div>
64
+ <div style="padding-left: 10px; margin-bottom: -16px;">
65
+ <p><span>Amazon S3 storage path:</span><span id="wpvivid_amazons3_root_path">*<?php _e(WPVIVID_AMAZONS3_DEFAULT_FOLDER); ?></span></p>
66
  </div>
67
  <div class="remote-storage-set-default-block">
68
  <label>
82
  <div id="wpvivid_storage_account_notice"></div>
83
  <div class=""><input class="button-primary storage-account-button" option="add-remote" type="button" name="Example" value="<?php _e( 'Test and Add', 'wpvivid' ); ?>" /></div>
84
  </div>
85
+ <script>
86
+ jQuery("input:text[option=amazons3][name=s3Path]").keyup(function(){
87
+ var value = jQuery(this).val();
88
+ if(value == ''){
89
+ value = '*';
90
+ }
91
+ value = value + '/wpvivid_backup';
92
+ jQuery('#wpvivid_amazons3_root_path').html(value);
93
+ });
94
+ </script>
95
  <?php
96
  }
97
 
101
  <div id="remote_storage_edit_amazons3" class="postbox storage-account-block remote-storage-edit" style="display:none;">
102
  <h2><span><?php _e( 'Enter Your Amazon S3 Account ','wpvivid'); ?></span></h2>
103
  <div class="storage-account-form">
104
+ <input type="text" option="edit-amazons3" name="name" placeholder="Enter an unique alias: e.g. Amazon S3-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
105
  </div>
106
  <div class="storage-account-form">
107
  <input type="text" option="edit-amazons3" name="access" placeholder="Amazon S3 access key" class="regular-text"/>
110
  <input type="password" option="edit-amazons3" name="secret" placeholder="Amazon S3 secret key" class="regular-text"/>
111
  </div>
112
  <div class="storage-account-form">
113
+ <input type="text" autocomplete="off" option="edit-amazons3" name="s3Path" placeholder="Amazon S3 path(e.g. test)" class="regular-text" onkeyup="value=value.replace(/^\//g, '')" style="width: 245px;" />
114
+ <span><?php _e(WPVIVID_AMAZONS3_DEFAULT_FOLDER); ?></span>
115
+ </div>
116
+ <div style="padding-left: 10px;">
117
+ <p><span>Amazon S3 storage path:</span><span id="wpvivid_edit_amazons3_root_path"><?php _e(WPVIVID_AMAZONS3_DEFAULT_FOLDER); ?></span></p>
118
  </div>
119
  <div class="remote-storage-amazons3-storage-class">
120
  <label>
128
  </div>
129
  <div class=""><input class="button-primary storage-account-button" option="edit-remote" type="button" name="amazons3" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
130
  </div>
131
+ <script>
132
+ jQuery("input:text[option=edit-amazons3][name=s3Path]").keyup(function(){
133
+ var value = jQuery(this).val();
134
+ if(value == ''){
135
+ value = '*';
136
+ }
137
+ value = value + '/wpvivid_backup';
138
+ jQuery('#wpvivid_edit_amazons3_root_path').html(value);
139
+ });
140
+ </script>
141
  <?php
142
  }
143
 
237
  return $ret;
238
  }
239
 
240
+ $this->options['s3Path'] = $this->options['s3Path'] . WPVIVID_AMAZONS3_DEFAULT_FOLDER;
241
+
242
  $ret['result']=WPVIVID_SUCCESS;
243
  $ret['options']=$this->options;
244
  return $ret;
includes/customclass/class-wpvivid-dropbox.php CHANGED
@@ -416,13 +416,14 @@ class WPvivid_Dropbox extends WPvivid_Remote {
416
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Dropbox authorization app (none of your backup data is sent to us).</p>
417
  <h2><span><?php _e( 'Enter Your Dropbox Information','wpvivid'); ?></span></h2>
418
  <div class="storage-account-form">
419
- <input type="text" autocomplete="off" option="dropbox" name="name" placeholder="Custom an unique name: e.g. Dropbox-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
420
  </div>
421
  <div style="padding-left: 10px; margin-bottom: -16px;">
422
  <p><span><?php _e( 'Dropbox Folder:','wpvivid'); ?></span><span option="dropbox" name="path"><?php
423
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_DROPBOX);
424
  _e($root_path.WPVIVID_DROPBOX_DEFAULT_FOLDER); ?>
425
  </span></p>
 
426
  </div>
427
  <div class="remote-storage-set-default-block">
428
  <label>
@@ -491,7 +492,7 @@ class WPvivid_Dropbox extends WPvivid_Remote {
491
  <div id="remote_storage_edit_dropbox" class="postbox storage-account-block remote-storage-edit" style="display:none;">
492
  <h2><span><?php _e( 'Enter an alias for Dropbox','wpvivid'); ?></span></h2>
493
  <div class="storage-account-form">
494
- <input type="text" option="edit-dropbox" name="name" placeholder="Custom an unique name: e.g. Dropbox-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
495
  </div>
496
  <div class=""><input onclick="wpvivid_dropbox_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
497
  <div style="clear:both;"></div>
416
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Dropbox authorization app (none of your backup data is sent to us).</p>
417
  <h2><span><?php _e( 'Enter Your Dropbox Information','wpvivid'); ?></span></h2>
418
  <div class="storage-account-form">
419
+ <input type="text" autocomplete="off" option="dropbox" name="name" placeholder="Enter an unique alias: e.g. Dropbox-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
420
  </div>
421
  <div style="padding-left: 10px; margin-bottom: -16px;">
422
  <p><span><?php _e( 'Dropbox Folder:','wpvivid'); ?></span><span option="dropbox" name="path"><?php
423
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_DROPBOX);
424
  _e($root_path.WPVIVID_DROPBOX_DEFAULT_FOLDER); ?>
425
  </span></p>
426
+ <p><?php _e('All backups will be uploaded to this directory.', 'wpvivid'); ?></p>
427
  </div>
428
  <div class="remote-storage-set-default-block">
429
  <label>
492
  <div id="remote_storage_edit_dropbox" class="postbox storage-account-block remote-storage-edit" style="display:none;">
493
  <h2><span><?php _e( 'Enter an alias for Dropbox','wpvivid'); ?></span></h2>
494
  <div class="storage-account-form">
495
+ <input type="text" option="edit-dropbox" name="name" placeholder="Enter an unique alias: e.g. Dropbox-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
496
  </div>
497
  <div class=""><input onclick="wpvivid_dropbox_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
498
  <div style="clear:both;"></div>
includes/customclass/class-wpvivid-ftpclass.php CHANGED
@@ -42,7 +42,7 @@ class WPvivid_FTPClass extends WPvivid_Remote{
42
  <div id="storage_account_ftp" class="storage-account-page">
43
  <h2><span><?php _e( 'Enter Your FTP Account ','wpvivid'); ?></span></h2>
44
  <div class="storage-account-form">
45
- <input type="text" autocomplete="off" option="ftp" name="name" placeholder="Custom an unique name: e.g. FTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
46
  </div>
47
  <div class="storage-account-form">
48
  <input type="text" autocomplete="off" option="ftp" name="server" placeholder="FTP server (server's port 21)" class="regular-text"/>
@@ -78,7 +78,7 @@ class WPvivid_FTPClass extends WPvivid_Remote{
78
  <div id="remote_storage_edit_ftp" class="postbox storage-account-block remote-storage-edit" style="display:none;">
79
  <h2><span><?php _e( 'Enter Your FTP Account ','wpvivid'); ?></span></h2>
80
  <div class="storage-account-form">
81
- <input type="text" option="edit-ftp" name="name" placeholder="Custom an unique name: e.g. FTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
82
  </div>
83
  <div class="storage-account-form">
84
  <input type="text" option="edit-ftp" name="server" placeholder="FTP server (server's port 21)" class="regular-text"/>
42
  <div id="storage_account_ftp" class="storage-account-page">
43
  <h2><span><?php _e( 'Enter Your FTP Account ','wpvivid'); ?></span></h2>
44
  <div class="storage-account-form">
45
+ <input type="text" autocomplete="off" option="ftp" name="name" placeholder="Enter an unique alias: e.g. FTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
46
  </div>
47
  <div class="storage-account-form">
48
  <input type="text" autocomplete="off" option="ftp" name="server" placeholder="FTP server (server's port 21)" class="regular-text"/>
78
  <div id="remote_storage_edit_ftp" class="postbox storage-account-block remote-storage-edit" style="display:none;">
79
  <h2><span><?php _e( 'Enter Your FTP Account ','wpvivid'); ?></span></h2>
80
  <div class="storage-account-form">
81
+ <input type="text" option="edit-ftp" name="name" placeholder="Enter an unique alias: e.g. FTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
82
  </div>
83
  <div class="storage-account-form">
84
  <input type="text" option="edit-ftp" name="server" placeholder="FTP server (server's port 21)" class="regular-text"/>
includes/customclass/class-wpvivid-google-drive.php CHANGED
@@ -285,13 +285,14 @@ class Wpvivid_Google_drive extends WPvivid_Remote
285
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Google Drive authorization app (none of your backup data is sent to us).</p>
286
  <h2><span><?php _e( 'Enter Your Google Drive Information','wpvivid'); ?></span></h2>
287
  <div class="storage-account-form">
288
- <input type="text" autocomplete="off" option="googledrive" name="name" placeholder="Custom an unique name: e.g. Google Drive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
289
  </div>
290
  <div style="padding-left: 10px; margin-bottom: -16px;">
291
  <p><span><?php _e( 'Google Drive Folder:','wpvivid'); ?></span><span option="googledrive" name="path"><?php
292
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_GOOGLEDRIVE);
293
  _e($root_path.WPVIVID_GOOGLEDRIVE_DEFAULT_FOLDER); ?>
294
  </span></p>
 
295
  </div>
296
  <div class="remote-storage-set-default-block">
297
  <label>
@@ -363,7 +364,7 @@ class Wpvivid_Google_drive extends WPvivid_Remote
363
  <div id="remote_storage_edit_googledrive" class="postbox storage-account-block remote-storage-edit" style="display:none;">
364
  <h2><span><?php _e( 'Enter an alias for Google Drive','wpvivid'); ?></span></h2>
365
  <div class="storage-account-form">
366
- <input type="text" option="edit-googledrive" name="name" placeholder="Custom an unique name: e.g. Google Drive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
367
  </div>
368
  <div class=""><input onclick="wpvivid_google_drive_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
369
  <div style="clear:both;"></div>
285
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Google Drive authorization app (none of your backup data is sent to us).</p>
286
  <h2><span><?php _e( 'Enter Your Google Drive Information','wpvivid'); ?></span></h2>
287
  <div class="storage-account-form">
288
+ <input type="text" autocomplete="off" option="googledrive" name="name" placeholder="Enter an unique alias: e.g. Google Drive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
289
  </div>
290
  <div style="padding-left: 10px; margin-bottom: -16px;">
291
  <p><span><?php _e( 'Google Drive Folder:','wpvivid'); ?></span><span option="googledrive" name="path"><?php
292
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_GOOGLEDRIVE);
293
  _e($root_path.WPVIVID_GOOGLEDRIVE_DEFAULT_FOLDER); ?>
294
  </span></p>
295
+ <p><?php _e('All backups will be uploaded to this directory.', 'wpvivid'); ?></p>
296
  </div>
297
  <div class="remote-storage-set-default-block">
298
  <label>
364
  <div id="remote_storage_edit_googledrive" class="postbox storage-account-block remote-storage-edit" style="display:none;">
365
  <h2><span><?php _e( 'Enter an alias for Google Drive','wpvivid'); ?></span></h2>
366
  <div class="storage-account-form">
367
+ <input type="text" option="edit-googledrive" name="name" placeholder="Enter an unique alias: e.g. Google Drive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
368
  </div>
369
  <div class=""><input onclick="wpvivid_google_drive_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
370
  <div style="clear:both;"></div>
includes/customclass/class-wpvivid-one-drive.php CHANGED
@@ -254,13 +254,14 @@ class WPvivid_one_drive extends WPvivid_Remote
254
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Microsoft OneDrive authorization app (none of your backup data is sent to us).</p>
255
  <h2><span><?php _e( 'Enter Your Microsoft OneDrive Information','wpvivid'); ?></span></h2>
256
  <div class="storage-account-form">
257
- <input type="text" autocomplete="off" option="one_drive" name="name" placeholder="Custom an unique name: e.g. OneDrive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
258
  </div>
259
  <div style="padding-left: 10px; margin-bottom: -16px;">
260
  <p><span><?php _e( 'Microsoft OneDrive Folder:','wpvivid'); ?></span><span option="one_drive" name="path"><?php
261
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_ONEDRIVE);
262
  _e($root_path.WPVIVID_ONEDRIVE_DEFAULT_FOLDER); ?>
263
  </span></p>
 
264
  </div>
265
  <div class="remote-storage-set-default-block">
266
  <label>
@@ -332,7 +333,7 @@ class WPvivid_one_drive extends WPvivid_Remote
332
  <div id="remote_storage_edit_onedrive" class="postbox storage-account-block remote-storage-edit" style="display:none;">
333
  <h2><span><?php _e( 'Enter an alias for Microsoft OneDrive','wpvivid'); ?></span></h2>
334
  <div class="storage-account-form">
335
- <input type="text" option="edit-onedrive" name="name" placeholder="Custom an unique name: e.g. OneDrive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
336
  </div>
337
  <div class=""><input onclick="wpvivid_one_drive_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
338
  <div style="clear:both;"></div>
254
  <p style="padding-left: 10px;">Please read <a target="_blank" href="https://wpvivid.com/privacy-policy">this privacy policy</a> for use of our Microsoft OneDrive authorization app (none of your backup data is sent to us).</p>
255
  <h2><span><?php _e( 'Enter Your Microsoft OneDrive Information','wpvivid'); ?></span></h2>
256
  <div class="storage-account-form">
257
+ <input type="text" autocomplete="off" option="one_drive" name="name" placeholder="Enter an unique alias: e.g. OneDrive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
258
  </div>
259
  <div style="padding-left: 10px; margin-bottom: -16px;">
260
  <p><span><?php _e( 'Microsoft OneDrive Folder:','wpvivid'); ?></span><span option="one_drive" name="path"><?php
261
  $root_path=apply_filters('wpvivid_get_root_path', WPVIVID_REMOTE_ONEDRIVE);
262
  _e($root_path.WPVIVID_ONEDRIVE_DEFAULT_FOLDER); ?>
263
  </span></p>
264
+ <p><?php _e('All backups will be uploaded to this directory.', 'wpvivid'); ?></p>
265
  </div>
266
  <div class="remote-storage-set-default-block">
267
  <label>
333
  <div id="remote_storage_edit_onedrive" class="postbox storage-account-block remote-storage-edit" style="display:none;">
334
  <h2><span><?php _e( 'Enter an alias for Microsoft OneDrive','wpvivid'); ?></span></h2>
335
  <div class="storage-account-form">
336
+ <input type="text" option="edit-onedrive" name="name" placeholder="Enter an unique alias: e.g. OneDrive-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
337
  </div>
338
  <div class=""><input onclick="wpvivid_one_drive_update_auth()" class="button-primary storage-account-button" type="button" value="<?php _e( 'Save Changes', 'wpvivid' ); ?>" /></div>
339
  <div style="clear:both;"></div>
includes/customclass/class-wpvivid-s3compat.php CHANGED
@@ -354,7 +354,7 @@ class Wpvivid_S3Compat extends WPvivid_Remote{
354
  <div id="storage_account_s3compat" class="storage-account-page" style="display:none;">
355
  <h2><span><?php _e( 'Enter Your DigitalOcean Spaces Account ','wpvivid'); ?></span></h2>
356
  <div class="storage-account-form">
357
- <input type="text" autocomplete="off" option="s3compat" name="name" placeholder="Custom an unique name: e.g. DOS-001" class="regular-text" />
358
  </div>
359
  <div class="storage-account-form">
360
  <input type="text" autocomplete="off" option="s3compat" name="access" placeholder="DigitalOcean Spaces access key" class="regular-text"/>
@@ -399,7 +399,7 @@ class Wpvivid_S3Compat extends WPvivid_Remote{
399
  <div id="remote_storage_edit_s3compat" class="postbox storage-account-block remote-storage-edit" style="display:none;">
400
  <h2><span><?php _e( 'Enter Your S3-Compatible Account ','wpvivid'); ?></span></h2>
401
  <div class="storage-account-form">
402
- <input type="text" option="edit-s3compat" name="name" placeholder="Custom an unique name: e.g. DOS-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
403
  </div>
404
  <div class="storage-account-form">
405
  <input type="text" option="edit-s3compat" name="access" placeholder="S3-Compatible access key" class="regular-text"/>
354
  <div id="storage_account_s3compat" class="storage-account-page" style="display:none;">
355
  <h2><span><?php _e( 'Enter Your DigitalOcean Spaces Account ','wpvivid'); ?></span></h2>
356
  <div class="storage-account-form">
357
+ <input type="text" autocomplete="off" option="s3compat" name="name" placeholder="Enter an unique alias: e.g. DOS-001" class="regular-text" />
358
  </div>
359
  <div class="storage-account-form">
360
  <input type="text" autocomplete="off" option="s3compat" name="access" placeholder="DigitalOcean Spaces access key" class="regular-text"/>
399
  <div id="remote_storage_edit_s3compat" class="postbox storage-account-block remote-storage-edit" style="display:none;">
400
  <h2><span><?php _e( 'Enter Your S3-Compatible Account ','wpvivid'); ?></span></h2>
401
  <div class="storage-account-form">
402
+ <input type="text" option="edit-s3compat" name="name" placeholder="Enter an unique alias: e.g. DOS-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
403
  </div>
404
  <div class="storage-account-form">
405
  <input type="text" option="edit-s3compat" name="access" placeholder="S3-Compatible access key" class="regular-text"/>
includes/customclass/class-wpvivid-sftpclass.php CHANGED
@@ -46,7 +46,7 @@ class WPvivid_SFTPClass extends WPvivid_Remote{
46
  <div id="storage_account_sftp" class="storage-account-page" style="display:none;">
47
  <h2><span><?php _e( 'Enter Your SFTP Account ','wpvivid'); ?></span></h2>
48
  <div class="storage-account-form">
49
- <input type="text" autocomplete="off" option="sftp" name="name" placeholder="Custom an unique name: e.g. SFTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
50
  </div>
51
  <div class="storage-account-form">
52
  <input type="text" autocomplete="off" option="sftp" name="host" placeholder="Server IP Address" class="regular-text"/>
@@ -80,7 +80,7 @@ class WPvivid_SFTPClass extends WPvivid_Remote{
80
  <div id="remote_storage_edit_sftp" class="postbox storage-account-block remote-storage-edit" style="display:none;">
81
  <h2><span><?php _e( 'Enter Your SFTP Account ','wpvivid'); ?></span></h2>
82
  <div class="storage-account-form">
83
- <input type="text" option="edit-sftp" name="name" placeholder="Custom an unique name: e.g. SFTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
84
  </div>
85
  <div class="storage-account-form">
86
  <input type="text" option="edit-sftp" name="host" placeholder="Server IP Address" class="regular-text"/>
46
  <div id="storage_account_sftp" class="storage-account-page" style="display:none;">
47
  <h2><span><?php _e( 'Enter Your SFTP Account ','wpvivid'); ?></span></h2>
48
  <div class="storage-account-form">
49
+ <input type="text" autocomplete="off" option="sftp" name="name" placeholder="Enter an unique alias: e.g. SFTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
50
  </div>
51
  <div class="storage-account-form">
52
  <input type="text" autocomplete="off" option="sftp" name="host" placeholder="Server IP Address" class="regular-text"/>
80
  <div id="remote_storage_edit_sftp" class="postbox storage-account-block remote-storage-edit" style="display:none;">
81
  <h2><span><?php _e( 'Enter Your SFTP Account ','wpvivid'); ?></span></h2>
82
  <div class="storage-account-form">
83
+ <input type="text" option="edit-sftp" name="name" placeholder="Enter an unique alias: e.g. SFTP-001" class="regular-text" onkeyup="value=value.replace(/[^a-zA-Z0-9\-_]/g,'')" />
84
  </div>
85
  <div class="storage-account-form">
86
  <input type="text" option="edit-sftp" name="host" placeholder="Server IP Address" class="regular-text"/>
readme.txt CHANGED
@@ -1,16 +1,18 @@
1
- === Transfer-Backup WordPress Site - WPvivid Backup Plugin ===
2
  Contributors: wpvivid
3
  Tags: transfer, move, duplicate, clone, backup, migrate, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
- Tested up to: 5.1
6
  Requires PHP: 5.3
7
- Stable tag: 0.9.16
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
11
  Transfer site to a new domain. Off-site backup schedule, transfer backups to leading remote storage (dropbox, onedrive, google drive etc). All in one.
12
 
13
  == Description ==
 
 
14
  Transfer a WordPress site to a new domain (especially useful for developers). Off-site backup schedules, transfer backups to leading remote storage (dropbox, onedrive, google drive etc), 1-click restore. All in one.
15
 
16
  == Core Features ==
@@ -142,6 +144,11 @@ Please try to contact your web hosting provider for changing PHP memory limit, o
142
  Feel free to let us know how we can help using the [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore) for the plugin on WordPress.org or our [contact form](https://wpvivid.com/contact-us). You can also reach us with a direct message on [Twitter](https://twitter.com/WPvividcom).
143
 
144
  == Changelog ==
 
 
 
 
 
145
  = 0.9.16 =
146
  - Fixed a fatal error occurred during website transfer.
147
  = 0.9.15 =
1
+ === Transfer&Backup WordPress Site - WPvivid Backup Plugin ===
2
  Contributors: wpvivid
3
  Tags: transfer, move, duplicate, clone, backup, migrate, restore, auto backup, cloud backup
4
  Requires at least: 4.5
5
+ Tested up to: 5.2
6
  Requires PHP: 5.3
7
+ Stable tag: 0.9.17
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10
 
11
  Transfer site to a new domain. Off-site backup schedule, transfer backups to leading remote storage (dropbox, onedrive, google drive etc). All in one.
12
 
13
  == Description ==
14
+ WPvivid Backup Plugin is the only free all-in-one backup, restore and migration WordPress plugin.
15
+
16
  Transfer a WordPress site to a new domain (especially useful for developers). Off-site backup schedules, transfer backups to leading remote storage (dropbox, onedrive, google drive etc), 1-click restore. All in one.
17
 
18
  == Core Features ==
144
  Feel free to let us know how we can help using the [support forum](https://wordpress.org/support/plugin/wpvivid-backuprestore) for the plugin on WordPress.org or our [contact form](https://wpvivid.com/contact-us). You can also reach us with a direct message on [Twitter](https://twitter.com/WPvividcom).
145
 
146
  == Changelog ==
147
+ = 0.9.17 =
148
+ - Added a sole tab for backup schedules.
149
+ - Refined descriptions in the UI.
150
+ - Fixed a few UI bugs.
151
+ - Successfully tested with WordPress 5.2.
152
  = 0.9.16 =
153
  - Fixed a fatal error occurred during website transfer.
154
  = 0.9.15 =
wpvivid-backuprestore.php CHANGED
@@ -7,7 +7,7 @@
7
  * @wordpress-plugin
8
  * Plugin Name: WPvivid Backup Plugin
9
  * Description: Transfer site to a new domain. Off-site backup schedule, transfer backups to leading remote storage (dropbox, onedrive, google drive etc). All in one.
10
- * Version: 0.9.16
11
  * Author: wpvivid.com
12
  * Author URI: https://wpvivid.com
13
  * License: GPL-3.0+
@@ -21,7 +21,7 @@ if ( ! defined( 'WPINC' ) ) {
21
  die;
22
  }
23
 
24
- define( 'WPVIVID_PLUGIN_VERSION', '0.9.16' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');
7
  * @wordpress-plugin
8
  * Plugin Name: WPvivid Backup Plugin
9
  * Description: Transfer site to a new domain. Off-site backup schedule, transfer backups to leading remote storage (dropbox, onedrive, google drive etc). All in one.
10
+ * Version: 0.9.17
11
  * Author: wpvivid.com
12
  * Author URI: https://wpvivid.com
13
  * License: GPL-3.0+
21
  die;
22
  }
23
 
24
+ define( 'WPVIVID_PLUGIN_VERSION', '0.9.17' );
25
  //
26
  define('WPVIVID_RESTORE_INIT','init');
27
  define('WPVIVID_RESTORE_READY','ready');