Version Description
- Improved the upload function. Now when uploading a zip(part) failed, you will be notified immediately, and you can continue to upload the problematic zip rather than uploading all zips again.
- Added: Cloud storage credentials in the database are encrypted now.
- Changed: Cloud storage credentials are not showing in the storage edit page.
- Fixed: Selected themes were not copied when creating a fresh install in some cases.
- Fixed the wpvivid_request error that could appear in some cases when scanning unused images.
- Fixed: some used images were falsely scanned as unused.
- Optimized the plugin code to reduce server consumption.
- Fixed some bugs in the plugin code.
Download this release
Release Info
Developer | wpvivid |
Plugin | Migration, Backup, Staging – WPvivid |
Version | 0.9.72 |
Comparing to | |
See all releases |
Code changes from version 0.9.71 to 0.9.72
- admin/class-wpvivid-admin.php +47 -5
- admin/partials/wpvivid-admin-display.php +2 -1
- admin/partials/wpvivid-remote-storage-page-display.php +2 -2
- admin/partials/wpvivid-settings-page-display.php +3 -3
- includes/class-wpvivid-backup-uploader.php +348 -183
- includes/class-wpvivid-export-import.php +2 -2
- includes/class-wpvivid-importer.php +1 -1
- includes/class-wpvivid-tab-page-container.php +10 -2
- includes/class-wpvivid-zipclass.php +12 -0
- includes/class-wpvivid.php +4 -4
- includes/customclass/class-wpvivid-amazons3-plus.php +4 -2
- includes/customclass/class-wpvivid-ftpclass.php +2 -0
- includes/customclass/class-wpvivid-s3compat.php +2 -0
- includes/customclass/class-wpvivid-sftpclass.php +2 -0
- includes/staging/class-wpvivid-staging-log-page.php +35 -5
- includes/staging/class-wpvivid-staging-setting.php +40 -40
- includes/staging/class-wpvivid-staging.php +42 -5
- includes/upload-cleaner/class-wpvivid-uploads-cleaner.php +4 -3
- includes/upload-cleaner/class-wpvivid-uploads-scanner.php +89 -1
- readme.txt +11 -2
- wpvivid-backuprestore.php +2 -2
admin/class-wpvivid-admin.php
CHANGED
@@ -60,7 +60,8 @@ class WPvivid_Admin {
|
|
60 |
add_filter('wpvivid_get_screen_ids',array($this,'get_screen_ids'),10);
|
61 |
add_filter('wpvivid_get_toolbar_menus',array($this,'get_toolbar_menus'),10);
|
62 |
add_filter('wpvivid_get_admin_menus',array($this,'get_admin_menus'),10);
|
63 |
-
add_filter('wpvivid_add_side_bar', array($this, 'wpvivid_add_side_bar'), 10, 2);
|
|
|
64 |
|
65 |
add_action('wpvivid_before_setup_page',array($this,'migrate_notice'));
|
66 |
add_action('wpvivid_before_setup_page',array($this,'show_add_my_review'));
|
@@ -146,7 +147,48 @@ class WPvivid_Admin {
|
|
146 |
$wpvivid_version = WPVIVID_PLUGIN_VERSION;
|
147 |
$wpvivid_version = apply_filters('wpvivid_display_pro_version', $wpvivid_version);
|
148 |
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
<h2>
|
151 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">'.__('Current Version:', 'wpvivid-backuprestore').' '.$wpvivid_version.'</span></div>
|
152 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
@@ -185,7 +227,7 @@ class WPvivid_Admin {
|
|
185 |
</table>
|
186 |
</div>
|
187 |
</div>';
|
188 |
-
return $html
|
189 |
}
|
190 |
|
191 |
/**
|
@@ -1076,7 +1118,7 @@ class WPvivid_Admin {
|
|
1076 |
<table class="widefat">
|
1077 |
<div style="padding: 0 0 20px 10px;"><?php _e('There are two ways available to send us the debug information. The first one is recommended.', 'wpvivid-backuprestore'); ?></div>
|
1078 |
<div style="padding-left: 10px;">
|
1079 |
-
<strong><?php _e('Method 1.'); ?></strong> <?php _e('If you have configured SMTP on your site, enter your email address and click the button below to send us the relevant information (website info and errors logs) when you are encountering errors. This will help us figure out what happened. Once the issue is resolved, we will inform you by your email address.', 'wpvivid-backuprestore'); ?>
|
1080 |
</div>
|
1081 |
<div style="padding:10px 10px 0">
|
1082 |
<span class="wpvivid-element-space-right"><?php echo __('WPvivid support email:', 'wpvivid-backuprestore'); ?></span><input type="text" id="wpvivid_support_mail" value="support@wpvivid.com" readonly />
|
@@ -1113,7 +1155,7 @@ class WPvivid_Admin {
|
|
1113 |
</div>
|
1114 |
<div style="clear:both;"></div>
|
1115 |
<div style="padding-left: 10px;">
|
1116 |
-
<strong><?php _e('Method 2.'); ?></strong> <?php _e('If you didn’t configure SMTP on your site, click the button below to download the relevant information (website info and error logs) to your PC when you are encountering some errors. Sending the files to us will help us diagnose what happened.', 'wpvivid-backuprestore'); ?>
|
1117 |
</div>
|
1118 |
<div class="schedule-tab-block">
|
1119 |
<input class="button-primary" id="wpvivid_download_website_info" type="submit" name="download-website-info" value="<?php esc_attr_e( 'Download', 'wpvivid-backuprestore' ); ?>" />
|
60 |
add_filter('wpvivid_get_screen_ids',array($this,'get_screen_ids'),10);
|
61 |
add_filter('wpvivid_get_toolbar_menus',array($this,'get_toolbar_menus'),10);
|
62 |
add_filter('wpvivid_get_admin_menus',array($this,'get_admin_menus'),10);
|
63 |
+
//add_filter('wpvivid_add_side_bar', array($this, 'wpvivid_add_side_bar'), 10, 2);
|
64 |
+
add_action('wpvivid_add_side_bar', array($this, 'wpvivid_add_side_bar'), 10, 2);
|
65 |
|
66 |
add_action('wpvivid_before_setup_page',array($this,'migrate_notice'));
|
67 |
add_action('wpvivid_before_setup_page',array($this,'show_add_my_review'));
|
147 |
$wpvivid_version = WPVIVID_PLUGIN_VERSION;
|
148 |
$wpvivid_version = apply_filters('wpvivid_display_pro_version', $wpvivid_version);
|
149 |
|
150 |
+
?>
|
151 |
+
<div class="postbox">
|
152 |
+
<h2>
|
153 |
+
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0"><?php _e('Current Version: ', 'wpvivid-backuprestore'); ?><?php echo $wpvivid_version; ?></span></div>
|
154 |
+
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
155 |
+
<div style="float: left; margin-left: 0;">
|
156 |
+
<span style="margin: 0; padding: 0"><a href="https://wordpress.org/plugins/wpvivid-backuprestore/#developers" target="_blank" style="text-decoration: none;"><?php _e('ChangeLog', 'wpvivid-backuprestore'); ?></a></span>
|
157 |
+
</div>
|
158 |
+
<div style="clear: both;"></div>
|
159 |
+
</h2>
|
160 |
+
</div>
|
161 |
+
<div id="wpvivid_backup_schedule_part"></div>
|
162 |
+
<div class="postbox">
|
163 |
+
<h2><span><?php _e('Troubleshooting', 'wpvivid-backuprestore'); ?></span></h2>
|
164 |
+
<div class="inside">
|
165 |
+
<table class="widefat" cellpadding="0">
|
166 |
+
<tbody>
|
167 |
+
<tr class="alternate">
|
168 |
+
<td class="row-title"><?php _e('Read <a href="https://docs.wpvivid.com/troubleshooting-issues-wpvivid-backup-plugin.html" target="_blank">Troubleshooting page</a> for faster solutions.', 'wpvivid-backuprestore'); ?></td>
|
169 |
+
</tr>
|
170 |
+
<tr>
|
171 |
+
<td class="row-title"><?php _e('Adjust <a href="https://docs.wpvivid.com/wpvivid-backup-free-advanced-settings.html" target="_blank">Advanced Settings</a> for higher task success rate.', 'wpvivid-backuprestore'); ?></td>
|
172 |
+
</tr>
|
173 |
+
</tbody>
|
174 |
+
</table>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
<div class="postbox">
|
178 |
+
<h2><span><?php _e('How-to', 'wpvivid-backuprestore'); ?></span></h2>
|
179 |
+
<div class="inside">
|
180 |
+
<table class="widefat" cellpadding="0">
|
181 |
+
<tbody>
|
182 |
+
<tr class="alternate"><td class="row-title"><a href="https://docs.wpvivid.com/wpvivid-backup-free-general-settings.html" target="_blank"><?php _e('WPvivid Backup Settings', 'wpvivid-backuprestore'); ?></a></td></tr>
|
183 |
+
<tr><td class="row-title"><a href="https://docs.wpvivid.com/get-started-create-manual-backup.html" target="_blank"><?php _e('Create a Manual Backup', 'wpvivid-backuprestore'); ?></a></td></tr>
|
184 |
+
<tr class="alternate"><td class="row-title"><a href="https://docs.wpvivid.com/get-started-restore-site.html" target="_blank"><?php _e('Restore Your Site from a Backup', 'wpvivid-backuprestore'); ?></a></td></tr>
|
185 |
+
<tr><td class="row-title"><a href="https://docs.wpvivid.com/get-started-transfer-site.html" target="_blank"><?php _e('Migrate WordPress', 'wpvivid-backuprestore'); ?></a></td></tr>
|
186 |
+
</tbody>
|
187 |
+
</table>
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
<?php
|
191 |
+
/*$html = '<div class="postbox">
|
192 |
<h2>
|
193 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">'.__('Current Version:', 'wpvivid-backuprestore').' '.$wpvivid_version.'</span></div>
|
194 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
227 |
</table>
|
228 |
</div>
|
229 |
</div>';
|
230 |
+
return $html;*/
|
231 |
}
|
232 |
|
233 |
/**
|
1118 |
<table class="widefat">
|
1119 |
<div style="padding: 0 0 20px 10px;"><?php _e('There are two ways available to send us the debug information. The first one is recommended.', 'wpvivid-backuprestore'); ?></div>
|
1120 |
<div style="padding-left: 10px;">
|
1121 |
+
<strong><?php _e('Method 1.', 'wpvivid-backuprestore'); ?></strong> <?php _e('If you have configured SMTP on your site, enter your email address and click the button below to send us the relevant information (website info and errors logs) when you are encountering errors. This will help us figure out what happened. Once the issue is resolved, we will inform you by your email address.', 'wpvivid-backuprestore'); ?>
|
1122 |
</div>
|
1123 |
<div style="padding:10px 10px 0">
|
1124 |
<span class="wpvivid-element-space-right"><?php echo __('WPvivid support email:', 'wpvivid-backuprestore'); ?></span><input type="text" id="wpvivid_support_mail" value="support@wpvivid.com" readonly />
|
1155 |
</div>
|
1156 |
<div style="clear:both;"></div>
|
1157 |
<div style="padding-left: 10px;">
|
1158 |
+
<strong><?php _e('Method 2.', 'wpvivid-backuprestore'); ?></strong> <?php _e('If you didn’t configure SMTP on your site, click the button below to download the relevant information (website info and error logs) to your PC when you are encountering some errors. Sending the files to us will help us diagnose what happened.', 'wpvivid-backuprestore'); ?>
|
1159 |
</div>
|
1160 |
<div class="schedule-tab-block">
|
1161 |
<input class="button-primary" id="wpvivid_download_website_info" type="submit" name="download-website-info" value="<?php esc_attr_e( 'Download', 'wpvivid-backuprestore' ); ?>" />
|
admin/partials/wpvivid-admin-display.php
CHANGED
@@ -89,7 +89,8 @@ foreach ($page_array as $page_name){
|
|
89 |
<div class="meta-box-sortables">
|
90 |
<?php
|
91 |
$html = '';
|
92 |
-
echo apply_filters('wpvivid_add_side_bar' ,$html, true);
|
|
|
93 |
?>
|
94 |
</div>
|
95 |
</div>
|
89 |
<div class="meta-box-sortables">
|
90 |
<?php
|
91 |
$html = '';
|
92 |
+
//echo apply_filters('wpvivid_add_side_bar' ,$html, true);
|
93 |
+
do_action('wpvivid_add_side_bar' ,$html, true);
|
94 |
?>
|
95 |
</div>
|
96 |
</div>
|
admin/partials/wpvivid-remote-storage-page-display.php
CHANGED
@@ -259,14 +259,14 @@ function wpvivid_add_page_storage_list()
|
|
259 |
var jsonarray = jQuery.parseJSON(data);
|
260 |
if (jsonarray.result === 'success')
|
261 |
{
|
262 |
-
jQuery('input:text[option=edit-'+jsonarray.type+']').each(function(){
|
263 |
var key = jQuery(this).prop('name');
|
264 |
jQuery(this).val(jsonarray[key]);
|
265 |
});
|
266 |
jQuery('input:password[option=edit-'+jsonarray.type+']').each(function(){
|
267 |
var key = jQuery(this).prop('name');
|
268 |
jQuery(this).val(jsonarray[key]);
|
269 |
-
})
|
270 |
jQuery('input:checkbox[option=edit-'+jsonarray.type+']').each(function() {
|
271 |
var key = jQuery(this).prop('name');
|
272 |
var value;
|
259 |
var jsonarray = jQuery.parseJSON(data);
|
260 |
if (jsonarray.result === 'success')
|
261 |
{
|
262 |
+
/*jQuery('input:text[option=edit-'+jsonarray.type+']').each(function(){
|
263 |
var key = jQuery(this).prop('name');
|
264 |
jQuery(this).val(jsonarray[key]);
|
265 |
});
|
266 |
jQuery('input:password[option=edit-'+jsonarray.type+']').each(function(){
|
267 |
var key = jQuery(this).prop('name');
|
268 |
jQuery(this).val(jsonarray[key]);
|
269 |
+
});*/
|
270 |
jQuery('input:checkbox[option=edit-'+jsonarray.type+']').each(function() {
|
271 |
var key = jQuery(this).prop('name');
|
272 |
var value;
|
admin/partials/wpvivid-settings-page-display.php
CHANGED
@@ -341,7 +341,7 @@ function wpvivid_clean_junk()
|
|
341 |
<input type="checkbox" id="wpvivid_junk_temporary_file" option="junk-files" name="old_files" value="junk-temporary-files" />
|
342 |
<span class="wpvivid-element-space-right"><?php _e( 'Temporary Files', 'wpvivid-backuprestore' ); ?></span>
|
343 |
<span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore'); ?></span><span id="wpvivid_restore_temp_file_path"><?php _e($junk_file['old_files_path'], 'wpvivid-backuprestore'); ?></span>
|
344 |
-
<p><?php echo __('Temporary Files are created by
|
345 |
</label>
|
346 |
</fieldset>
|
347 |
</div>
|
@@ -496,7 +496,7 @@ function wpvivid_export_import_settings()
|
|
496 |
try {
|
497 |
var jsonarray = jQuery.parseJSON(data);
|
498 |
if (jsonarray.result === 'success') {
|
499 |
-
alert('The plugin settings
|
500 |
location.reload();
|
501 |
}
|
502 |
else {
|
@@ -615,7 +615,7 @@ function wpvivid_advanced_settings()
|
|
615 |
</label>
|
616 |
<label>
|
617 |
<input type="radio" option="setting" name="no_compress" value="0" <?php esc_attr_e($wpvivid_setting_compress, 'wpvivid-backuprestore'); ?> />
|
618 |
-
<span class="wpvivid-element-space-right" title="<?php _e( 'It will cause a higher CPU
|
619 |
</label>
|
620 |
<label style="display: none;">
|
621 |
<input type="radio" option="setting" name="compress_type" value="zip" checked />
|
341 |
<input type="checkbox" id="wpvivid_junk_temporary_file" option="junk-files" name="old_files" value="junk-temporary-files" />
|
342 |
<span class="wpvivid-element-space-right"><?php _e( 'Temporary Files', 'wpvivid-backuprestore' ); ?></span>
|
343 |
<span style="margin-right: 2px;"><?php _e('Path:', 'wpvivid-backuprestore'); ?></span><span id="wpvivid_restore_temp_file_path"><?php _e($junk_file['old_files_path'], 'wpvivid-backuprestore'); ?></span>
|
344 |
+
<p><?php echo __('Temporary Files are created by WPvivid when restoring a website.', 'wpvivid-backuprestore'); ?></p>
|
345 |
</label>
|
346 |
</fieldset>
|
347 |
</div>
|
496 |
try {
|
497 |
var jsonarray = jQuery.parseJSON(data);
|
498 |
if (jsonarray.result === 'success') {
|
499 |
+
alert('The plugin settings were imported successfully.');
|
500 |
location.reload();
|
501 |
}
|
502 |
else {
|
615 |
</label>
|
616 |
<label>
|
617 |
<input type="radio" option="setting" name="no_compress" value="0" <?php esc_attr_e($wpvivid_setting_compress, 'wpvivid-backuprestore'); ?> />
|
618 |
+
<span class="wpvivid-element-space-right" title="<?php _e( 'It will cause a higher CPU usage and is recommended in a VPS or dedicated hosting environment.', 'wpvivid-backuprestore' ); ?>"><?php _e( 'Compress and Archive', 'wpvivid-backuprestore' ); ?></span>
|
619 |
</label>
|
620 |
<label style="display: none;">
|
621 |
<input type="radio" option="setting" name="compress_type" value="zip" checked />
|
includes/class-wpvivid-backup-uploader.php
CHANGED
@@ -9,6 +9,9 @@ class Wpvivid_BackupUploader
|
|
9 |
{
|
10 |
public function __construct()
|
11 |
{
|
|
|
|
|
|
|
12 |
add_action('wp_ajax_wpvivid_get_file_id',array($this,'get_file_id'));
|
13 |
add_action('wp_ajax_wpvivid_upload_files',array($this,'upload_files'));
|
14 |
add_action('wp_ajax_wpvivid_upload_files_finish',array($this,'upload_files_finish'));
|
@@ -18,6 +21,128 @@ class Wpvivid_BackupUploader
|
|
18 |
add_action('wpvivid_rebuild_backup_list', array($this, 'wpvivid_rebuild_backup_list'), 10);
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
function get_file_id()
|
22 |
{
|
23 |
global $wpvivid_plugin;
|
@@ -98,54 +223,71 @@ class Wpvivid_BackupUploader
|
|
98 |
{
|
99 |
global $wpvivid_plugin;
|
100 |
$wpvivid_plugin->ajax_check_security();
|
101 |
-
$options['test_form'] =true;
|
102 |
-
$options['action'] ='wpvivid_upload_files';
|
103 |
-
$options['test_type'] = false;
|
104 |
-
$options['ext'] = 'zip';
|
105 |
-
$options['type'] = 'application/zip';
|
106 |
|
107 |
-
|
|
|
|
|
|
|
108 |
|
109 |
-
|
110 |
|
111 |
-
|
|
|
|
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
118 |
|
119 |
-
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
$file_handle = fopen($path.$file_name, 'wb');
|
129 |
-
if ($file_handle)
|
130 |
{
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
fwrite($file_handle, $line);
|
139 |
-
}
|
140 |
-
fclose($chunks_handle);
|
141 |
-
@unlink($path.$file_name.'_'.$i.'.tmp');
|
142 |
-
}
|
143 |
-
}
|
144 |
-
fclose($file_handle);
|
145 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
-
echo json_encode(array('result'=>WPVIVID_SUCCESS));
|
149 |
die();
|
150 |
}
|
151 |
|
@@ -500,21 +642,25 @@ class Wpvivid_BackupUploader
|
|
500 |
static function upload_meta_box()
|
501 |
{
|
502 |
?>
|
503 |
-
<div id="wpvivid_plupload-upload-ui" class="hide-if-no-js">
|
504 |
<div id="drag-drop-area">
|
505 |
<div class="drag-drop-inside">
|
506 |
-
<p class="drag-drop-info"><?php _e('Drop files here'
|
507 |
<p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
|
508 |
-
<p class="drag-drop-buttons"><input id="wpvivid_select_file_button" type="button" value="<?php esc_attr_e('Select Files'
|
509 |
</div>
|
510 |
</div>
|
511 |
</div>
|
512 |
-
<div id="
|
513 |
-
<
|
|
|
|
|
|
|
|
|
|
|
514 |
<?php
|
515 |
-
$chunk_size = min(wp_max_upload_size()
|
516 |
$plupload_init = array(
|
517 |
-
'runtimes' => 'html5,silverlight,flash,html4',
|
518 |
'browse_button' => 'wpvivid_select_file_button',
|
519 |
'container' => 'wpvivid_plupload-upload-ui',
|
520 |
'drop_element' => 'drag-drop-area',
|
@@ -524,8 +670,6 @@ class Wpvivid_BackupUploader
|
|
524 |
'max_file_size' => '10Gb',
|
525 |
'chunk_size' => $chunk_size.'b',
|
526 |
'url' => admin_url('admin-ajax.php'),
|
527 |
-
'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
528 |
-
'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
529 |
'multipart' => true,
|
530 |
'urlstream_upload' => true,
|
531 |
// additional post data to send to our ajax hook
|
@@ -535,61 +679,56 @@ class Wpvivid_BackupUploader
|
|
535 |
),
|
536 |
);
|
537 |
|
538 |
-
if (is_file(ABSPATH.WPINC.'/js/plupload/Moxie.swf')) {
|
539 |
-
$plupload_init['flash_swf_url'] = includes_url('js/plupload/Moxie.swf');
|
540 |
-
} else {
|
541 |
-
$plupload_init['flash_swf_url'] = includes_url('js/plupload/plupload.flash.swf');
|
542 |
-
}
|
543 |
-
|
544 |
-
if (is_file(ABSPATH.WPINC.'/js/plupload/Moxie.xap')) {
|
545 |
-
$plupload_init['silverlight_xap_url'] = includes_url('js/plupload/Moxie.xap');
|
546 |
-
} else {
|
547 |
-
$plupload_init['silverlight_xap_url'] = includes_url('js/plupload/plupload.silverlight.swf');
|
548 |
-
}
|
549 |
-
|
550 |
// we should probably not apply this filter, plugins may expect wp's media uploader...
|
551 |
$plupload_init = apply_filters('plupload_init', $plupload_init);
|
552 |
$upload_file_image = includes_url( '/images/media/archive.png' );
|
553 |
?>
|
554 |
|
555 |
-
|
556 |
<script type="text/javascript">
|
557 |
-
|
558 |
var uploader;
|
559 |
-
jQuery(document).ready(function($)
|
560 |
-
{
|
561 |
-
// create the uploader and pass the config from above
|
562 |
-
jQuery('#wpvivid_upload_submit_btn').hide();
|
563 |
-
uploader = new plupload.Uploader(<?php echo json_encode($plupload_init); ?>);
|
564 |
|
565 |
-
|
566 |
-
|
|
|
|
|
|
|
|
|
567 |
{
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
|
|
580 |
});
|
581 |
-
|
582 |
-
// a file was added in the queue
|
583 |
-
var wpvivid_upload_id='';
|
584 |
|
585 |
-
|
|
|
|
|
|
|
586 |
{
|
587 |
-
|
|
|
|
|
588 |
{
|
589 |
-
|
|
|
|
|
|
|
|
|
590 |
|
|
|
|
|
591 |
var ajax_data = {
|
592 |
-
'action': '
|
593 |
'file_name':file.name
|
594 |
};
|
595 |
wpvivid_post_request(ajax_data, function (data)
|
@@ -597,10 +736,18 @@ class Wpvivid_BackupUploader
|
|
597 |
var jsonarray = jQuery.parseJSON(data);
|
598 |
if (jsonarray.result === "success")
|
599 |
{
|
600 |
-
|
601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
}
|
603 |
-
else if(jsonarray.result === "failed")
|
|
|
604 |
uploader.removeFile(file);
|
605 |
alert(jsonarray.error);
|
606 |
}
|
@@ -611,66 +758,94 @@ class Wpvivid_BackupUploader
|
|
611 |
alert(error_message);
|
612 |
});
|
613 |
}
|
614 |
-
else
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
{
|
619 |
-
|
620 |
-
var file_list = jQuery('#wpvivid_upload_file_list span');
|
621 |
-
file_list.each(function (index, value) {
|
622 |
-
if (value.innerHTML === file.name) {
|
623 |
-
brepeat=true;
|
624 |
-
}
|
625 |
-
});
|
626 |
-
if(!brepeat) {
|
627 |
-
var wpvivid_file_regex = new RegExp(wpvivid_upload_id + '_.*_.*\\.zip$');
|
628 |
-
if (wpvivid_file_regex.test(file.name)) {
|
629 |
-
jQuery('#wpvivid_upload_file_list').append(
|
630 |
-
'<div id="' + file.id + '" style="width: 100%; height: 36px; background: #fff; margin-bottom: 1px;">' +
|
631 |
-
'<img src=" <?php echo $upload_file_image; ?> " alt="" style="float: left; margin: 2px 10px 0 3px; max-width: 40px; max-height: 32px;">' +
|
632 |
-
'<div style="line-height: 36px; float: left; margin-left: 5px;"><span>' + file.name + '</span></div>' +
|
633 |
-
'<div class="fileprogress" style="line-height: 36px; float: right; margin-right: 5px;"></div>' +
|
634 |
-
'</div>' +
|
635 |
-
'<div style="clear: both;"></div>'
|
636 |
-
);
|
637 |
-
jQuery('#wpvivid_upload_submit_btn').show();
|
638 |
-
jQuery("#wpvivid_upload_submit_btn").prop('disabled', false);
|
639 |
-
}
|
640 |
-
else {
|
641 |
-
alert(file.name + " is not belong to the backup package uploaded.");
|
642 |
-
uploader.removeFile(file);
|
643 |
-
}
|
644 |
-
}
|
645 |
-
else{
|
646 |
-
if(repeat_files === ''){
|
647 |
-
repeat_files += file.name;
|
648 |
-
}
|
649 |
-
else{
|
650 |
-
repeat_files += ', ' + file.name;
|
651 |
-
}
|
652 |
-
}
|
653 |
-
});
|
654 |
-
if(repeat_files !== ''){
|
655 |
-
alert(repeat_files + " already exists in upload list.");
|
656 |
-
repeat_files = '';
|
657 |
}
|
658 |
}
|
|
|
|
|
|
|
|
|
659 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
|
661 |
uploader.bind('FilesAdded', wpvivid_check_plupload_added_files);
|
662 |
|
663 |
uploader.bind('Error', function(up, error)
|
664 |
{
|
665 |
alert('Upload ' + error.file.name +' error, error code: ' + error.code + ', ' + error.message);
|
666 |
-
|
667 |
});
|
668 |
|
669 |
uploader.bind('FileUploaded', function(up, file, response)
|
670 |
{
|
671 |
var jsonarray = jQuery.parseJSON(response.response);
|
672 |
-
if(jsonarray.result == 'failed')
|
|
|
673 |
alert('upload ' + file.name + ' failed, ' + jsonarray.error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
}
|
675 |
});
|
676 |
|
@@ -682,38 +857,32 @@ class Wpvivid_BackupUploader
|
|
682 |
uploader.bind('UploadComplete',function(up, files)
|
683 |
{
|
684 |
jQuery('#wpvivid_upload_file_list').html("");
|
685 |
-
wpvivid_upload_id='';
|
686 |
jQuery('#wpvivid_upload_submit_btn').hide();
|
|
|
687 |
jQuery("#wpvivid_select_file_button").prop('disabled', false);
|
688 |
var ajax_data = {
|
689 |
-
'action': '
|
690 |
-
'files':JSON.stringify(files)
|
691 |
};
|
692 |
wpvivid_post_request(ajax_data, function (data)
|
693 |
{
|
694 |
-
try
|
|
|
695 |
var jsonarray = jQuery.parseJSON(data);
|
696 |
-
if(jsonarray.result === 'success')
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
jQuery('#wpvivid_backup_list').html('');
|
704 |
-
jQuery('#wpvivid_backup_list').append(jsonarray.html);
|
705 |
-
wpvivid_click_switch_page('backup', 'wpvivid_tab_backup', true);
|
706 |
-
}
|
707 |
}
|
708 |
-
else
|
709 |
-
|
710 |
-
|
711 |
-
unlinked = jsonarray.unlinked;
|
712 |
-
}
|
713 |
-
alert(jsonarray.error + ' ' + unlinked);
|
714 |
}
|
715 |
}
|
716 |
-
catch(err)
|
|
|
717 |
alert(err);
|
718 |
}
|
719 |
}, function (XMLHttpRequest, textStatus, errorThrown)
|
@@ -732,37 +901,33 @@ class Wpvivid_BackupUploader
|
|
732 |
uploader.removeFile(file.id);
|
733 |
}
|
734 |
});
|
735 |
-
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
});
|
737 |
|
738 |
function wpvivid_submit_upload()
|
739 |
{
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
var ajax_data = {
|
746 |
-
'action': 'wpvivid_get_backup_count'
|
747 |
-
};
|
748 |
-
wpvivid_post_request(ajax_data, function (data)
|
749 |
-
{
|
750 |
-
var backuplist_count = data;
|
751 |
-
if(parseInt(backuplist_count) >= parseInt(backup_max_count)){
|
752 |
-
alert("The backup retention limit for localhost(web server) is reached, please either increase the retention from WPvivid General Settings, or manually delete some old backups.");
|
753 |
-
}
|
754 |
-
else {
|
755 |
-
jQuery("#wpvivid_upload_submit_btn").prop('disabled', true);
|
756 |
-
jQuery("#wpvivid_select_file_button").prop('disabled', true);
|
757 |
-
uploader.refresh();
|
758 |
-
uploader.start();
|
759 |
-
}
|
760 |
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
alert(error_message);
|
765 |
-
});
|
766 |
}
|
767 |
</script>
|
768 |
<?php
|
9 |
{
|
10 |
public function __construct()
|
11 |
{
|
12 |
+
add_action('wp_ajax_wpvivid_cancel_upload_backup_free', array($this, 'cancel_upload_backup_free'));
|
13 |
+
add_action('wp_ajax_wpvivid_is_backup_file_free', array($this, 'is_backup_file_free'));
|
14 |
+
add_action('wp_ajax_wpvivid_upload_files_finish_free', array($this, 'upload_files_finish_free'));
|
15 |
add_action('wp_ajax_wpvivid_get_file_id',array($this,'get_file_id'));
|
16 |
add_action('wp_ajax_wpvivid_upload_files',array($this,'upload_files'));
|
17 |
add_action('wp_ajax_wpvivid_upload_files_finish',array($this,'upload_files_finish'));
|
21 |
add_action('wpvivid_rebuild_backup_list', array($this, 'wpvivid_rebuild_backup_list'), 10);
|
22 |
}
|
23 |
|
24 |
+
function cancel_upload_backup_free()
|
25 |
+
{
|
26 |
+
global $wpvivid_plugin;
|
27 |
+
$wpvivid_plugin->ajax_check_security();
|
28 |
+
try{
|
29 |
+
$path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR;
|
30 |
+
if(is_dir($path))
|
31 |
+
{
|
32 |
+
$handler = opendir($path);
|
33 |
+
if($handler!==false)
|
34 |
+
{
|
35 |
+
while (($filename = readdir($handler)) !== false)
|
36 |
+
{
|
37 |
+
if ($filename != "." && $filename != "..")
|
38 |
+
{
|
39 |
+
if (is_dir($path . $filename))
|
40 |
+
{
|
41 |
+
continue;
|
42 |
+
}
|
43 |
+
else
|
44 |
+
{
|
45 |
+
if (preg_match('/.*\.tmp$/', $filename))
|
46 |
+
{
|
47 |
+
@unlink($path . $filename);
|
48 |
+
}
|
49 |
+
|
50 |
+
if (preg_match('/.*\.part$/', $filename))
|
51 |
+
{
|
52 |
+
@unlink($path . $filename);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
if($handler)
|
58 |
+
@closedir($handler);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
catch (Exception $error) {
|
63 |
+
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
64 |
+
error_log($message);
|
65 |
+
echo json_encode(array('result'=>'failed','error'=>$message));
|
66 |
+
}
|
67 |
+
die();
|
68 |
+
}
|
69 |
+
|
70 |
+
public function is_wpvivid_backup($file_name)
|
71 |
+
{
|
72 |
+
if (preg_match('/wpvivid-.*_.*_.*\.zip$/', $file_name))
|
73 |
+
{
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
else {
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
function is_backup_file_free()
|
82 |
+
{
|
83 |
+
global $wpvivid_plugin;
|
84 |
+
$wpvivid_plugin->ajax_check_security();
|
85 |
+
|
86 |
+
try
|
87 |
+
{
|
88 |
+
if (isset($_POST['file_name']))
|
89 |
+
{
|
90 |
+
if ($this->is_wpvivid_backup($_POST['file_name']))
|
91 |
+
{
|
92 |
+
$ret['result'] = WPVIVID_SUCCESS;
|
93 |
+
|
94 |
+
$backupdir=WPvivid_Setting::get_backupdir();
|
95 |
+
$filePath = WP_CONTENT_DIR.DIRECTORY_SEPARATOR.$backupdir.DIRECTORY_SEPARATOR.$_POST['file_name'];
|
96 |
+
if(file_exists($filePath))
|
97 |
+
{
|
98 |
+
$ret['is_exists']=true;
|
99 |
+
}
|
100 |
+
else
|
101 |
+
{
|
102 |
+
$ret['is_exists']=false;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
else
|
106 |
+
{
|
107 |
+
$ret['result'] = WPVIVID_FAILED;
|
108 |
+
$ret['error'] = $_POST['file_name'] . ' is not created by WPvivid backup plugin.';
|
109 |
+
}
|
110 |
+
}
|
111 |
+
else
|
112 |
+
{
|
113 |
+
$ret['result'] = WPVIVID_FAILED;
|
114 |
+
$ret['error'] = 'Failed to post file name.';
|
115 |
+
}
|
116 |
+
|
117 |
+
echo json_encode($ret);
|
118 |
+
}
|
119 |
+
catch (Exception $error)
|
120 |
+
{
|
121 |
+
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
122 |
+
echo json_encode(array('result'=>'failed','error'=>$message));
|
123 |
+
}
|
124 |
+
|
125 |
+
die();
|
126 |
+
}
|
127 |
+
|
128 |
+
function upload_files_finish_free()
|
129 |
+
{
|
130 |
+
global $wpvivid_plugin;
|
131 |
+
$wpvivid_plugin->ajax_check_security();
|
132 |
+
|
133 |
+
try {
|
134 |
+
$ret = $this->_rescan_local_folder_set_backup();
|
135 |
+
echo json_encode($ret);
|
136 |
+
}
|
137 |
+
catch (Exception $error)
|
138 |
+
{
|
139 |
+
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
140 |
+
error_log($message);
|
141 |
+
echo json_encode(array('result'=>'failed','error'=>$message));
|
142 |
+
}
|
143 |
+
die();
|
144 |
+
}
|
145 |
+
|
146 |
function get_file_id()
|
147 |
{
|
148 |
global $wpvivid_plugin;
|
223 |
{
|
224 |
global $wpvivid_plugin;
|
225 |
$wpvivid_plugin->ajax_check_security();
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
+
try
|
228 |
+
{
|
229 |
+
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
|
230 |
+
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
|
231 |
|
232 |
+
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"];
|
233 |
|
234 |
+
$backupdir=WPvivid_Setting::get_backupdir();
|
235 |
+
$filePath = WP_CONTENT_DIR.DIRECTORY_SEPARATOR.$backupdir.DIRECTORY_SEPARATOR.$fileName;
|
236 |
+
$out = @fopen("{$filePath}.part", $chunk == 0 ? "wb" : "ab");
|
237 |
|
238 |
+
if ($out)
|
239 |
+
{
|
240 |
+
// Read binary input stream and append it to temp file
|
241 |
+
$options['test_form'] =true;
|
242 |
+
$options['action'] ='wpvivid_upload_files';
|
243 |
+
$options['test_type'] = false;
|
244 |
+
$options['ext'] = 'zip';
|
245 |
+
$options['type'] = 'application/zip';
|
246 |
|
247 |
+
add_filter('upload_dir', array($this, 'upload_dir'));
|
248 |
|
249 |
+
$status = wp_handle_upload($_FILES['async-upload'],$options);
|
250 |
+
|
251 |
+
remove_filter('upload_dir', array($this, 'upload_dir'));
|
252 |
+
|
253 |
+
$in = @fopen($status['file'], "rb");
|
254 |
+
|
255 |
+
if ($in)
|
|
|
|
|
256 |
{
|
257 |
+
while ($buff = fread($in, 4096))
|
258 |
+
fwrite($out, $buff);
|
259 |
+
}
|
260 |
+
else
|
261 |
+
{
|
262 |
+
echo json_encode(array('result'=>'failed','error'=>"Failed to open tmp file.path:".$status['file']));
|
263 |
+
die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
+
|
266 |
+
@fclose($in);
|
267 |
+
@fclose($out);
|
268 |
+
|
269 |
+
@unlink($status['file']);
|
270 |
+
}
|
271 |
+
else
|
272 |
+
{
|
273 |
+
echo json_encode(array('result'=>'failed','error'=>"Failed to open input stream.path:{$filePath}.part"));
|
274 |
+
die();
|
275 |
+
}
|
276 |
+
|
277 |
+
if (!$chunks || $chunk == $chunks - 1)
|
278 |
+
{
|
279 |
+
// Strip the temp .part suffix off
|
280 |
+
rename("{$filePath}.part", $filePath);
|
281 |
}
|
282 |
+
|
283 |
+
echo json_encode(array('result' => WPVIVID_SUCCESS));
|
284 |
+
}
|
285 |
+
catch (Exception $error)
|
286 |
+
{
|
287 |
+
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
288 |
+
error_log($message);
|
289 |
+
echo json_encode(array('result'=>'failed','error'=>$message));
|
290 |
}
|
|
|
291 |
die();
|
292 |
}
|
293 |
|
642 |
static function upload_meta_box()
|
643 |
{
|
644 |
?>
|
645 |
+
<div id="wpvivid_plupload-upload-ui" class="hide-if-no-js" style="margin-bottom: 10px;">
|
646 |
<div id="drag-drop-area">
|
647 |
<div class="drag-drop-inside">
|
648 |
+
<p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
|
649 |
<p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
|
650 |
+
<p class="drag-drop-buttons"><input id="wpvivid_select_file_button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
|
651 |
</div>
|
652 |
</div>
|
653 |
</div>
|
654 |
+
<div id="wpvivid_uploaded_file_list" class="hide-if-no-js" style="margin-bottom: 10px;"></div>
|
655 |
+
<div id="wpvivid_upload_file_list" class="hide-if-no-js" style="margin-bottom: 10px;"></div>
|
656 |
+
<div style="margin-bottom: 10px;">
|
657 |
+
<input type="submit" class="button-primary" id="wpvivid_upload_submit_btn" value="Upload" onclick="wpvivid_submit_upload();" />
|
658 |
+
<input type="submit" class="button-primary" id="wpvivid_stop_upload_btn" value="Cancel" onclick="wpvivid_cancel_upload();" />
|
659 |
+
</div>
|
660 |
+
<div style="clear: both;"></div>
|
661 |
<?php
|
662 |
+
$chunk_size = min(wp_max_upload_size(), 1048576*2);
|
663 |
$plupload_init = array(
|
|
|
664 |
'browse_button' => 'wpvivid_select_file_button',
|
665 |
'container' => 'wpvivid_plupload-upload-ui',
|
666 |
'drop_element' => 'drag-drop-area',
|
670 |
'max_file_size' => '10Gb',
|
671 |
'chunk_size' => $chunk_size.'b',
|
672 |
'url' => admin_url('admin-ajax.php'),
|
|
|
|
|
673 |
'multipart' => true,
|
674 |
'urlstream_upload' => true,
|
675 |
// additional post data to send to our ajax hook
|
679 |
),
|
680 |
);
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
// we should probably not apply this filter, plugins may expect wp's media uploader...
|
683 |
$plupload_init = apply_filters('plupload_init', $plupload_init);
|
684 |
$upload_file_image = includes_url( '/images/media/archive.png' );
|
685 |
?>
|
686 |
|
|
|
687 |
<script type="text/javascript">
|
|
|
688 |
var uploader;
|
|
|
|
|
|
|
|
|
|
|
689 |
|
690 |
+
function wpvivid_stop_upload()
|
691 |
+
{
|
692 |
+
var ajax_data = {
|
693 |
+
'action': 'wpvivid_cancel_upload_backup_free',
|
694 |
+
};
|
695 |
+
wpvivid_post_request(ajax_data, function (data)
|
696 |
{
|
697 |
+
jQuery("#wpvivid_select_file_button").prop('disabled', false);
|
698 |
+
jQuery('#wpvivid_upload_file_list').html("");
|
699 |
+
jQuery('#wpvivid_upload_submit_btn').hide();
|
700 |
+
jQuery('#wpvivid_stop_upload_btn').hide();
|
701 |
+
wpvivid_init_upload_list();
|
702 |
+
}, function (XMLHttpRequest, textStatus, errorThrown)
|
703 |
+
{
|
704 |
+
var error_message = wpvivid_output_ajaxerror('cancelling upload backups', textStatus, errorThrown);
|
705 |
+
alert(error_message);
|
706 |
+
jQuery('#wpvivid_upload_file_list').html("");
|
707 |
+
jQuery('#wpvivid_upload_submit_btn').hide();
|
708 |
+
jQuery('#wpvivid_stop_upload_btn').hide();
|
709 |
+
wpvivid_init_upload_list();
|
710 |
});
|
711 |
+
}
|
|
|
|
|
712 |
|
713 |
+
function wpvivid_check_plupload_added_files(up,files)
|
714 |
+
{
|
715 |
+
var repeat_files = '';
|
716 |
+
plupload.each(files, function(file)
|
717 |
{
|
718 |
+
var brepeat=false;
|
719 |
+
var file_list = jQuery('#wpvivid_upload_file_list span');
|
720 |
+
file_list.each(function (index, value)
|
721 |
{
|
722 |
+
if (value.innerHTML === file.name)
|
723 |
+
{
|
724 |
+
brepeat=true;
|
725 |
+
}
|
726 |
+
});
|
727 |
|
728 |
+
if(!brepeat)
|
729 |
+
{
|
730 |
var ajax_data = {
|
731 |
+
'action': 'wpvivid_is_backup_file_free',
|
732 |
'file_name':file.name
|
733 |
};
|
734 |
wpvivid_post_request(ajax_data, function (data)
|
736 |
var jsonarray = jQuery.parseJSON(data);
|
737 |
if (jsonarray.result === "success")
|
738 |
{
|
739 |
+
if(jsonarray.is_exists==true)
|
740 |
+
{
|
741 |
+
wpvivid_file_uploaded_queued(file);
|
742 |
+
uploader.removeFile(file);
|
743 |
+
}
|
744 |
+
else
|
745 |
+
{
|
746 |
+
wpvivid_fileQueued( file );
|
747 |
+
}
|
748 |
}
|
749 |
+
else if(jsonarray.result === "failed")
|
750 |
+
{
|
751 |
uploader.removeFile(file);
|
752 |
alert(jsonarray.error);
|
753 |
}
|
758 |
alert(error_message);
|
759 |
});
|
760 |
}
|
761 |
+
else{
|
762 |
+
if(repeat_files === ''){
|
763 |
+
repeat_files += file.name;
|
764 |
+
}
|
765 |
+
else{
|
766 |
+
repeat_files += ', ' + file.name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
}
|
768 |
}
|
769 |
+
});
|
770 |
+
if(repeat_files !== ''){
|
771 |
+
alert(repeat_files + " already exists in upload list.");
|
772 |
+
repeat_files = '';
|
773 |
}
|
774 |
+
}
|
775 |
+
|
776 |
+
function wpvivid_fileQueued(file)
|
777 |
+
{
|
778 |
+
jQuery('#wpvivid_upload_file_list').append(
|
779 |
+
'<div id="' + file.id + '" style="width: 100%; height: 36px; background: #fff; margin-bottom: 1px;">' +
|
780 |
+
'<img src=" <?php echo $upload_file_image; ?> " alt="" style="float: left; margin: 2px 10px 0 3px; max-width: 40px; max-height: 32px;">' +
|
781 |
+
'<div style="line-height: 36px; float: left; margin-left: 5px;"><span>' + file.name + '</span></div>' +
|
782 |
+
'<div class="fileprogress" style="line-height: 36px; float: right; margin-right: 5px;"></div>' +
|
783 |
+
'</div>' +
|
784 |
+
'<div style="clear: both;"></div>'
|
785 |
+
);
|
786 |
+
jQuery('#wpvivid_upload_submit_btn').show();
|
787 |
+
jQuery('#wpvivid_stop_upload_btn').show();
|
788 |
+
jQuery("#wpvivid_upload_submit_btn").prop('disabled', false);
|
789 |
+
}
|
790 |
+
|
791 |
+
function wpvivid_file_uploaded_queued(file)
|
792 |
+
{
|
793 |
+
jQuery('#'+file.id).remove();
|
794 |
+
jQuery('#wpvivid_uploaded_file_list').append(
|
795 |
+
'<div id="' + file.id + '" style="width: 100%; height: 36px; background: #8bc34a; margin-bottom: 1px;">' +
|
796 |
+
'<img src=" <?php echo $upload_file_image; ?> " alt="" style="float: left; margin: 2px 10px 0 3px; max-width: 40px; max-height: 32px;">' +
|
797 |
+
'<div style="line-height: 36px; float: left; margin-left: 5px;"><span>' + file.name + '</span></div>' +
|
798 |
+
'<div class="fileprogress" style="line-height: 36px; float: right; margin-right: 5px;"></div>' +
|
799 |
+
'</div>' +
|
800 |
+
'<div style="clear: both;"></div>'
|
801 |
+
);
|
802 |
+
}
|
803 |
+
|
804 |
+
function wpvivid_init_upload_list()
|
805 |
+
{
|
806 |
+
uploader = new plupload.Uploader(<?php echo json_encode($plupload_init); ?>);
|
807 |
+
|
808 |
+
// checks if browser supports drag and drop upload, makes some css adjustments if necessary
|
809 |
+
uploader.bind('Init', function(up)
|
810 |
+
{
|
811 |
+
var uploaddiv = jQuery('#wpvivid_plupload-upload-ui');
|
812 |
+
|
813 |
+
if(up.features.dragdrop){
|
814 |
+
uploaddiv.addClass('drag-drop');
|
815 |
+
jQuery('#drag-drop-area')
|
816 |
+
.bind('dragover.wp-uploader', function(){ uploaddiv.addClass('drag-over'); })
|
817 |
+
.bind('dragleave.wp-uploader, drop.wp-uploader', function(){ uploaddiv.removeClass('drag-over'); });
|
818 |
+
|
819 |
+
}else{
|
820 |
+
uploaddiv.removeClass('drag-drop');
|
821 |
+
jQuery('#drag-drop-area').unbind('.wp-uploader');
|
822 |
+
}
|
823 |
+
});
|
824 |
+
|
825 |
+
uploader.init();
|
826 |
+
// a file was added in the queue
|
827 |
|
828 |
uploader.bind('FilesAdded', wpvivid_check_plupload_added_files);
|
829 |
|
830 |
uploader.bind('Error', function(up, error)
|
831 |
{
|
832 |
alert('Upload ' + error.file.name +' error, error code: ' + error.code + ', ' + error.message);
|
833 |
+
wpvivid_stop_upload();
|
834 |
});
|
835 |
|
836 |
uploader.bind('FileUploaded', function(up, file, response)
|
837 |
{
|
838 |
var jsonarray = jQuery.parseJSON(response.response);
|
839 |
+
if(jsonarray.result == 'failed')
|
840 |
+
{
|
841 |
alert('upload ' + file.name + ' failed, ' + jsonarray.error);
|
842 |
+
|
843 |
+
uploader.stop();
|
844 |
+
wpvivid_stop_upload();
|
845 |
+
}
|
846 |
+
else
|
847 |
+
{
|
848 |
+
wpvivid_file_uploaded_queued(file);
|
849 |
}
|
850 |
});
|
851 |
|
857 |
uploader.bind('UploadComplete',function(up, files)
|
858 |
{
|
859 |
jQuery('#wpvivid_upload_file_list').html("");
|
|
|
860 |
jQuery('#wpvivid_upload_submit_btn').hide();
|
861 |
+
jQuery('#wpvivid_stop_upload_btn').hide();
|
862 |
jQuery("#wpvivid_select_file_button").prop('disabled', false);
|
863 |
var ajax_data = {
|
864 |
+
'action': 'wpvivid_upload_files_finish_free'
|
|
|
865 |
};
|
866 |
wpvivid_post_request(ajax_data, function (data)
|
867 |
{
|
868 |
+
try
|
869 |
+
{
|
870 |
var jsonarray = jQuery.parseJSON(data);
|
871 |
+
if(jsonarray.result === 'success')
|
872 |
+
{
|
873 |
+
alert('The upload has completed.');
|
874 |
+
jQuery('#wpvivid_backup_list').html('');
|
875 |
+
jQuery('#wpvivid_backup_list').append(jsonarray.html);
|
876 |
+
wpvivid_click_switch_page('backup', 'wpvivid_tab_backup', true);
|
877 |
+
location.href = '<?php echo admin_url() . 'admin.php?page=WPvivid'; ?>';
|
|
|
|
|
|
|
|
|
878 |
}
|
879 |
+
else
|
880 |
+
{
|
881 |
+
alert(jsonarray.error);
|
|
|
|
|
|
|
882 |
}
|
883 |
}
|
884 |
+
catch(err)
|
885 |
+
{
|
886 |
alert(err);
|
887 |
}
|
888 |
}, function (XMLHttpRequest, textStatus, errorThrown)
|
901 |
uploader.removeFile(file.id);
|
902 |
}
|
903 |
});
|
904 |
+
});
|
905 |
+
|
906 |
+
uploader.bind('Destroy', function(up, file)
|
907 |
+
{
|
908 |
+
wpvivid_stop_upload();
|
909 |
+
});
|
910 |
+
}
|
911 |
+
|
912 |
+
jQuery(document).ready(function($)
|
913 |
+
{
|
914 |
+
// create the uploader and pass the config from above
|
915 |
+
jQuery('#wpvivid_upload_submit_btn').hide();
|
916 |
+
jQuery('#wpvivid_stop_upload_btn').hide();
|
917 |
+
wpvivid_init_upload_list();
|
918 |
});
|
919 |
|
920 |
function wpvivid_submit_upload()
|
921 |
{
|
922 |
+
jQuery("#wpvivid_upload_submit_btn").prop('disabled', true);
|
923 |
+
jQuery("#wpvivid_select_file_button").prop('disabled', true);
|
924 |
+
uploader.refresh();
|
925 |
+
uploader.start();
|
926 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
927 |
|
928 |
+
function wpvivid_cancel_upload()
|
929 |
+
{
|
930 |
+
uploader.destroy();
|
|
|
|
|
931 |
}
|
932 |
</script>
|
933 |
<?php
|
includes/class-wpvivid-export-import.php
CHANGED
@@ -1486,7 +1486,7 @@ class WPvivid_Export_Import
|
|
1486 |
}
|
1487 |
|
1488 |
$admin_url = admin_url();
|
1489 |
-
echo '<a href="'.$admin_url.'admin.php?page=wpvivid-export-import">'.__('File not found.
|
1490 |
die();
|
1491 |
}
|
1492 |
}
|
@@ -1526,7 +1526,7 @@ class WPvivid_Export_Import
|
|
1526 |
<div style="clear: both;"></div>
|
1527 |
|
1528 |
<div style="background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 10px; padding: 10px;">
|
1529 |
-
<div style="margin-right: 10px; float: left; height: 28px; line-height: 28px;"><?php echo sprintf(__('Imported files will be temporarily stored in
|
1530 |
<div style="float: left;"><input class="button" type="submit" id="wpvivid_empty_import_folder" value="<?php esc_attr_e('Delete Exported Files In Folder', 'wpvivid-backuprestore'); ?>" onclick="wpvivid_clean_import_folder();" /></div>
|
1531 |
<div style="clear: both;"></div>
|
1532 |
</div>
|
1486 |
}
|
1487 |
|
1488 |
$admin_url = admin_url();
|
1489 |
+
echo '<a href="'.$admin_url.'admin.php?page=wpvivid-export-import">'.__('File not found. Please retry again.', 'wpvivid-backuprestore').'</a>';
|
1490 |
die();
|
1491 |
}
|
1492 |
}
|
1526 |
<div style="clear: both;"></div>
|
1527 |
|
1528 |
<div style="background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 10px; padding: 10px;">
|
1529 |
+
<div style="margin-right: 10px; float: left; height: 28px; line-height: 28px;"><?php echo sprintf(__('Imported files will be temporarily stored in %s directory', 'wpvivid-backuprestore'), $import_dir) ?></div>
|
1530 |
<div style="float: left;"><input class="button" type="submit" id="wpvivid_empty_import_folder" value="<?php esc_attr_e('Delete Exported Files In Folder', 'wpvivid-backuprestore'); ?>" onclick="wpvivid_clean_import_folder();" /></div>
|
1531 |
<div style="clear: both;"></div>
|
1532 |
</div>
|
includes/class-wpvivid-importer.php
CHANGED
@@ -1779,7 +1779,7 @@ class WPvivid_media_importer
|
|
1779 |
|
1780 |
if(!file_exists($new_file))
|
1781 |
{
|
1782 |
-
return new WP_Error( 'import_file_error', __('File not exist file:'.$new_file, 'wpvivid-backuprestore') );
|
1783 |
}
|
1784 |
|
1785 |
return apply_filters(
|
1779 |
|
1780 |
if(!file_exists($new_file))
|
1781 |
{
|
1782 |
+
return new WP_Error( 'import_file_error', __('File not exist, file:'.$new_file, 'wpvivid-backuprestore') );
|
1783 |
}
|
1784 |
|
1785 |
return apply_filters(
|
includes/class-wpvivid-tab-page-container.php
CHANGED
@@ -77,8 +77,16 @@ class WPvivid_Tab_Page_Container
|
|
77 |
$side_bar = '0';
|
78 |
}
|
79 |
//$side_bar = '';
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
?>
|
83 |
</div>
|
84 |
</div>
|
77 |
$side_bar = '0';
|
78 |
}
|
79 |
//$side_bar = '';
|
80 |
+
if(get_current_screen()->id=='wpvivid-backup_page_wpvivid-staging')
|
81 |
+
{
|
82 |
+
do_action('wpvivid_add_staging_side_bar_ex' ,$side_bar, false);
|
83 |
+
}
|
84 |
+
else
|
85 |
+
{
|
86 |
+
do_action('wpvivid_add_side_bar' ,$side_bar, false);
|
87 |
+
}
|
88 |
+
//$side_bar = apply_filters('wpvivid_add_side_bar', $side_bar, false);
|
89 |
+
//echo $side_bar;
|
90 |
?>
|
91 |
</div>
|
92 |
</div>
|
includes/class-wpvivid-zipclass.php
CHANGED
@@ -1316,6 +1316,18 @@ function wpvivid_function_per_add_callback($p_event, &$p_header)
|
|
1316 |
return 0;
|
1317 |
}
|
1318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1319 |
global $wpvivid_old_time;
|
1320 |
if(time()-$wpvivid_old_time>30)
|
1321 |
{
|
1316 |
return 0;
|
1317 |
}
|
1318 |
|
1319 |
+
$plugins = substr(WP_PLUGIN_DIR, strpos(WP_PLUGIN_DIR, 'wp-content/'));
|
1320 |
+
|
1321 |
+
if(strpos($p_header['filename'],$plugins.'/wpvivid-backuprestore')!==false)
|
1322 |
+
{
|
1323 |
+
return 0;
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
if(strpos($p_header['filename'],$plugins.'/wpvivid-backup-pro')!==false)
|
1327 |
+
{
|
1328 |
+
return 0;
|
1329 |
+
}
|
1330 |
+
|
1331 |
global $wpvivid_old_time;
|
1332 |
if(time()-$wpvivid_old_time>30)
|
1333 |
{
|
includes/class-wpvivid.php
CHANGED
@@ -3050,7 +3050,7 @@ class WPvivid {
|
|
3050 |
$ret['remote_storage'] = $remote_storage;
|
3051 |
} else {
|
3052 |
$ret['result'] = 'failed';
|
3053 |
-
$ret['error'] = __('
|
3054 |
}
|
3055 |
}
|
3056 |
catch (Exception $error) {
|
@@ -4474,7 +4474,7 @@ class WPvivid {
|
|
4474 |
}
|
4475 |
|
4476 |
$ret['result']='success';
|
4477 |
-
$ret['msg']=__('The selected junk
|
4478 |
$ret['data']=$this->_junk_files_info();
|
4479 |
$html = '';
|
4480 |
$html = apply_filters('wpvivid_get_log_list', $html);
|
@@ -5061,12 +5061,12 @@ class WPvivid {
|
|
5061 |
|
5062 |
if(!isset($data['staging_memory_limit']))
|
5063 |
{
|
5064 |
-
$ret['error']=__('The value of \'Staging
|
5065 |
}
|
5066 |
$data['staging_memory_limit']=sanitize_text_field($data['staging_memory_limit']);
|
5067 |
if(empty($data['staging_memory_limit']) && $data['staging_memory_limit'] != '0')
|
5068 |
{
|
5069 |
-
$ret['error']=__('The value of \'Staging
|
5070 |
return $ret;
|
5071 |
}
|
5072 |
|
3050 |
$ret['remote_storage'] = $remote_storage;
|
3051 |
} else {
|
3052 |
$ret['result'] = 'failed';
|
3053 |
+
$ret['error'] = __('Failed to delete the remote storage, can not retrieve the storage infomation. Please try again.', 'wpvivid-backuprestore');
|
3054 |
}
|
3055 |
}
|
3056 |
catch (Exception $error) {
|
4474 |
}
|
4475 |
|
4476 |
$ret['result']='success';
|
4477 |
+
$ret['msg']=__('The selected junk files have been deleted.', 'wpvivid-backuprestore');
|
4478 |
$ret['data']=$this->_junk_files_info();
|
4479 |
$html = '';
|
4480 |
$html = apply_filters('wpvivid_get_log_list', $html);
|
5061 |
|
5062 |
if(!isset($data['staging_memory_limit']))
|
5063 |
{
|
5064 |
+
$ret['error']=__('The value of \'Staging Memory Limit\' can\'t be empty.', 'wpvivid-backuprestore');
|
5065 |
}
|
5066 |
$data['staging_memory_limit']=sanitize_text_field($data['staging_memory_limit']);
|
5067 |
if(empty($data['staging_memory_limit']) && $data['staging_memory_limit'] != '0')
|
5068 |
{
|
5069 |
+
$ret['error']=__('The value of \'Staging Memory Limit\' can\'t be empty.', 'wpvivid-backuprestore');
|
5070 |
return $ret;
|
5071 |
}
|
5072 |
|
includes/customclass/class-wpvivid-amazons3-plus.php
CHANGED
@@ -96,7 +96,7 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
|
|
96 |
</td>
|
97 |
<td class="column-description desc">
|
98 |
<div class="wpvivid-storage-form-desc">
|
99 |
-
<i><?php _e('Enter your Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></i><a href="https://wpvivid.com/get-amazon-access-secret-key.html" target="_blank"> <?php _e('How to get an
|
100 |
</div>
|
101 |
</td>
|
102 |
</tr>
|
@@ -234,7 +234,7 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
|
|
234 |
</td>
|
235 |
<td class="column-description desc">
|
236 |
<div class="wpvivid-storage-form-desc">
|
237 |
-
<i><?php _e('Enter your Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></i><a href="https://wpvivid.com/get-amazon-access-secret-key.html" target="_blank"> <?php _e('How to get an
|
238 |
</div>
|
239 |
</td>
|
240 |
</tr>
|
@@ -401,6 +401,8 @@ class WPvivid_AMAZONS3Class extends WPvivid_Remote{
|
|
401 |
$ret['error']="Warning: The storage secret key is required.";
|
402 |
return $ret;
|
403 |
}
|
|
|
|
|
404 |
|
405 |
if(!isset($this->options['bucket']))
|
406 |
{
|
96 |
</td>
|
97 |
<td class="column-description desc">
|
98 |
<div class="wpvivid-storage-form-desc">
|
99 |
+
<i><?php _e('Enter your Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></i><a href="https://wpvivid.com/get-amazon-access-secret-key.html" target="_blank"> <?php _e('How to get an Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></a>
|
100 |
</div>
|
101 |
</td>
|
102 |
</tr>
|
234 |
</td>
|
235 |
<td class="column-description desc">
|
236 |
<div class="wpvivid-storage-form-desc">
|
237 |
+
<i><?php _e('Enter your Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></i><a href="https://wpvivid.com/get-amazon-access-secret-key.html" target="_blank"> <?php _e('How to get an Amazon S3 secret key.', 'wpvivid-backuprestore'); ?></a>
|
238 |
</div>
|
239 |
</td>
|
240 |
</tr>
|
401 |
$ret['error']="Warning: The storage secret key is required.";
|
402 |
return $ret;
|
403 |
}
|
404 |
+
$this->options['secret'] = base64_encode($this->options['secret']);
|
405 |
+
$this->options['is_encrypt'] = 1;
|
406 |
|
407 |
if(!isset($this->options['bucket']))
|
408 |
{
|
includes/customclass/class-wpvivid-ftpclass.php
CHANGED
@@ -368,6 +368,8 @@ class WPvivid_FTPClass extends WPvivid_Remote{
|
|
368 |
$ret['error']="Warning: The FTP password is required.";
|
369 |
return $ret;
|
370 |
}
|
|
|
|
|
371 |
|
372 |
if(!isset($this->options['path'])||empty($this->options['path']))
|
373 |
{
|
368 |
$ret['error']="Warning: The FTP password is required.";
|
369 |
return $ret;
|
370 |
}
|
371 |
+
$this->options['password'] = base64_encode($this->options['password']);
|
372 |
+
$this->options['is_encrypt'] = 1;
|
373 |
|
374 |
if(!isset($this->options['path'])||empty($this->options['path']))
|
375 |
{
|
includes/customclass/class-wpvivid-s3compat.php
CHANGED
@@ -697,6 +697,8 @@ class Wpvivid_S3Compat extends WPvivid_Remote{
|
|
697 |
$ret['error']="Warning: The storage secret key is required.";
|
698 |
return $ret;
|
699 |
}
|
|
|
|
|
700 |
|
701 |
if(empty($this->options['bucket']))
|
702 |
{
|
697 |
$ret['error']="Warning: The storage secret key is required.";
|
698 |
return $ret;
|
699 |
}
|
700 |
+
$this->options['secret'] = base64_encode($this->options['secret']);
|
701 |
+
$this->options['is_encrypt'] = 1;
|
702 |
|
703 |
if(empty($this->options['bucket']))
|
704 |
{
|
includes/customclass/class-wpvivid-sftpclass.php
CHANGED
@@ -365,6 +365,8 @@ class WPvivid_SFTPClass extends WPvivid_Remote{
|
|
365 |
$ret['error']="Warning: The password is required.";
|
366 |
return $ret;
|
367 |
}
|
|
|
|
|
368 |
|
369 |
if(!isset($this->options['port']))
|
370 |
{
|
365 |
$ret['error']="Warning: The password is required.";
|
366 |
return $ret;
|
367 |
}
|
368 |
+
$this->options['password'] = base64_encode($this->options['password']);
|
369 |
+
$this->options['is_encrypt'] = 1;
|
370 |
|
371 |
if(!isset($this->options['port']))
|
372 |
{
|
includes/staging/class-wpvivid-staging-log-page.php
CHANGED
@@ -1084,7 +1084,12 @@ class WPvivid_Staging_Log_Page_Free
|
|
1084 |
else
|
1085 |
{
|
1086 |
$message= __('The log not found.', 'wpvivid');
|
1087 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
1088 |
die();
|
1089 |
}
|
1090 |
|
@@ -1093,7 +1098,12 @@ class WPvivid_Staging_Log_Page_Free
|
|
1093 |
if (!file_exists($path))
|
1094 |
{
|
1095 |
$message= __('The log not found.', 'wpvivid');
|
1096 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
1097 |
die();
|
1098 |
}
|
1099 |
|
@@ -1140,13 +1150,23 @@ class WPvivid_Staging_Log_Page_Free
|
|
1140 |
}
|
1141 |
else
|
1142 |
{
|
1143 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
1144 |
die();
|
1145 |
}
|
1146 |
|
1147 |
} else {
|
1148 |
$message = __('Reading the log failed. Please try again.', 'wpvivid');
|
1149 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
1150 |
die();
|
1151 |
}
|
1152 |
}
|
@@ -1154,7 +1174,17 @@ class WPvivid_Staging_Log_Page_Free
|
|
1154 |
{
|
1155 |
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
1156 |
error_log($message);
|
1157 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1158 |
die();
|
1159 |
}
|
1160 |
}
|
1084 |
else
|
1085 |
{
|
1086 |
$message= __('The log not found.', 'wpvivid');
|
1087 |
+
echo sprintf(
|
1088 |
+
__( $message. '%1$stry again%2$s.', 'wpvivid' ),
|
1089 |
+
'<a href="' . $admin_url . '">',
|
1090 |
+
'</a>'
|
1091 |
+
);
|
1092 |
+
//echo __($message.' <a href="'.$admin_url.'">retry</a> again.');
|
1093 |
die();
|
1094 |
}
|
1095 |
|
1098 |
if (!file_exists($path))
|
1099 |
{
|
1100 |
$message= __('The log not found.', 'wpvivid');
|
1101 |
+
echo sprintf(
|
1102 |
+
__( $message. '%1$stry again%2$s.', 'wpvivid' ),
|
1103 |
+
'<a href="' . $admin_url . '">',
|
1104 |
+
'</a>'
|
1105 |
+
);
|
1106 |
+
//echo __($message.' <a href="'.$admin_url.'">retry</a> again.');
|
1107 |
die();
|
1108 |
}
|
1109 |
|
1150 |
}
|
1151 |
else
|
1152 |
{
|
1153 |
+
echo sprintf(
|
1154 |
+
__( 'File not found. Please %1$stry again%2$s.', 'wpvivid' ),
|
1155 |
+
'<a href="' . $admin_url . '">',
|
1156 |
+
'</a>'
|
1157 |
+
);
|
1158 |
+
//echo __(' file not found. please <a href="'.$admin_url.'">retry</a> again.');
|
1159 |
die();
|
1160 |
}
|
1161 |
|
1162 |
} else {
|
1163 |
$message = __('Reading the log failed. Please try again.', 'wpvivid');
|
1164 |
+
echo sprintf(
|
1165 |
+
__( $message. '%1$stry again%2$s.', 'wpvivid' ),
|
1166 |
+
'<a href="' . $admin_url . '">',
|
1167 |
+
'</a>'
|
1168 |
+
);
|
1169 |
+
//echo __($message.' <a href="'.$admin_url.'">retry</a> again.');
|
1170 |
die();
|
1171 |
}
|
1172 |
}
|
1174 |
{
|
1175 |
$message = 'An exception has occurred. class: '.get_class($error).';msg: '.$error->getMessage().';code: '.$error->getCode().';line: '.$error->getLine().';in_file: '.$error->getFile().';';
|
1176 |
error_log($message);
|
1177 |
+
echo sprintf(
|
1178 |
+
__( 'An exception has occurred. class: %1$s; msg: %2$s; code: %3$s; line: %4$s; in_file: %5$s. Please %6$stry again%7$s.', 'wpvivid' ),
|
1179 |
+
get_class($error),
|
1180 |
+
$error->getMessage(),
|
1181 |
+
$error->getCode(),
|
1182 |
+
$error->getLine(),
|
1183 |
+
$error->getFile(),
|
1184 |
+
'<a href="' . $admin_url . '">',
|
1185 |
+
'</a>'
|
1186 |
+
);
|
1187 |
+
//echo __($message.' <a href="'.$admin_url.'">retry</a> again.');
|
1188 |
die();
|
1189 |
}
|
1190 |
}
|
includes/staging/class-wpvivid-staging-setting.php
CHANGED
@@ -84,7 +84,7 @@ class WPvivid_Staging_Setting_Free
|
|
84 |
?>
|
85 |
<div style="margin-top: 10px;">
|
86 |
<div class="postbox schedule-tab-block wpvivid-setting-addon" style="margin-bottom: 10px; padding-bottom: 0;">
|
87 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Copy Count', 'wpvivid'); ?></strong></div>
|
88 |
<div class="wpvivid-element-space-bottom">
|
89 |
<input type="text" class="all-options" option="setting" name="staging_db_insert_count" value="<?php esc_attr_e($staging_db_insert_count); ?>"
|
90 |
placeholder="10000" onkeyup="value=value.replace(/\D/g,'')" />
|
@@ -92,39 +92,39 @@ class WPvivid_Staging_Setting_Free
|
|
92 |
<div class="wpvivid-element-space-bottom">
|
93 |
<?php _e( 'Number of DB rows, that are copied within one ajax query. The higher value makes the database copy process faster.
|
94 |
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no
|
95 |
-
more errors occur.', 'wpvivid' ); ?>
|
96 |
</div>
|
97 |
|
98 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Replace Count', 'wpvivid'); ?></strong></div>
|
99 |
<div class="wpvivid-element-space-bottom">
|
100 |
<input type="text" class="all-options" option="setting" name="staging_db_replace_count" value="<?php esc_attr_e($staging_db_replace_count); ?>"
|
101 |
placeholder="5000" onkeyup="value=value.replace(/\D/g,'')" />
|
102 |
</div>
|
103 |
<div class="wpvivid-element-space-bottom">
|
104 |
<?php _e( 'Number of DB rows, that are processed within one ajax query. The higher value makes the DB replacement process faster.
|
105 |
-
If timeout erros occur, decrease the value because this process consumes a lot of memory.', 'wpvivid' ); ?>
|
106 |
</div>
|
107 |
|
108 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('File Copy Count', 'wpvivid'); ?></strong></div>
|
109 |
<div class="wpvivid-element-space-bottom">
|
110 |
<input type="text" class="all-options" option="setting" name="staging_file_copy_count" value="<?php esc_attr_e($staging_file_copy_count); ?>"
|
111 |
placeholder="500" onkeyup="value=value.replace(/\D/g,'')" />
|
112 |
</div>
|
113 |
<div class="wpvivid-element-space-bottom">
|
114 |
-
<?php _e( 'Number of files to copy that will be copied within one ajax request. The higher value makes the file
|
115 |
-
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no more errors occur.', 'wpvivid' ); ?>
|
116 |
</div>
|
117 |
|
118 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Max File Size', 'wpvivid'); ?></strong></div>
|
119 |
<div class="wpvivid-element-space-bottom">
|
120 |
<input type="text" class="all-options" option="setting" name="staging_exclude_file_size" value="<?php esc_attr_e($staging_exclude_file_size); ?>"
|
121 |
placeholder="30" onkeyup="value=value.replace(/\D/g,'')" />MB
|
122 |
</div>
|
123 |
<div class="wpvivid-element-space-bottom">
|
124 |
-
<?php _e( 'Maximum size of the files copied to a staging site. All files larger than this value will be ignored. If you set the value of 0 MB, all files will be copied to a staging site.', 'wpvivid' ); ?>
|
125 |
</div>
|
126 |
|
127 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Staging Memory Limit', 'wpvivid'); ?></strong></div>
|
128 |
<div class="wpvivid-element-space-bottom">
|
129 |
<input type="text" class="all-options" option="setting" name="staging_memory_limit" value="<?php esc_attr_e($staging_memory_limit); ?>"
|
130 |
placeholder="256" onkeyup="value=value.replace(/\D/g,'')" />MB
|
@@ -132,10 +132,10 @@ class WPvivid_Staging_Setting_Free
|
|
132 |
<div class="wpvivid-element-space-bottom">
|
133 |
<?php _e('Adjust this value to apply for a temporary PHP memory limit for the plugin to create a staging site.
|
134 |
We set this value to 256M by default. Increase the value if you encounter a memory exhausted error. Note: some
|
135 |
-
web hosting providers may not support this.', 'wpvivid'); ?>
|
136 |
</div>
|
137 |
|
138 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('PHP Script Execution Timeout', 'wpvivid'); ?></strong></div>
|
139 |
<div class="wpvivid-element-space-bottom">
|
140 |
<input type="text" class="all-options" option="setting" name="staging_max_execution_time" value="<?php esc_attr_e($staging_max_execution_time); ?>"
|
141 |
placeholder="900" onkeyup="value=value.replace(/\D/g,'')" />
|
@@ -143,16 +143,16 @@ class WPvivid_Staging_Setting_Free
|
|
143 |
<div class="wpvivid-element-space-bottom">
|
144 |
<?php _e( 'The time-out is not your server PHP time-out. With the execution time exhausted, our plugin will shut down the progress of
|
145 |
creating a staging site. If the progress encounters a time-out, that means you have a medium or large sized website. Please try to
|
146 |
-
scale the value bigger.', 'wpvivid' ); ?>
|
147 |
</div>
|
148 |
|
149 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Delay Between Requests', 'wpvivid'); ?></strong></div>
|
150 |
<div class="wpvivid-element-space-bottom">
|
151 |
<input type="text" class="all-options" option="setting" name="staging_request_timeout" value="<?php esc_attr_e($staging_request_timeout); ?>"
|
152 |
placeholder="1500" onkeyup="value=value.replace(/\D/g,'')" />ms
|
153 |
</div>
|
154 |
<div class="wpvivid-element-space-bottom">
|
155 |
-
<?php _e( 'A lower value will help speed up the process of creating a staging site. However, if your server has a limit on the number of requests, a higher value is recommended.', 'wpvivid' ); ?>
|
156 |
</div>
|
157 |
|
158 |
<div class="wpvivid-element-space-bottom">
|
@@ -168,13 +168,13 @@ class WPvivid_Staging_Setting_Free
|
|
168 |
}
|
169 |
}
|
170 |
?>
|
171 |
-
</select><strong><?php _e(' times when encountering a time-out error', 'wpvivid'); ?></strong>
|
172 |
</div>
|
173 |
|
174 |
<div class="wpvivid-element-space-bottom">
|
175 |
<label>
|
176 |
<input type="checkbox" option="setting" name="not_need_login" <?php esc_attr_e($staging_not_need_login_check); ?> />
|
177 |
-
<span><strong><?php _e('Anyone can visit the staging site', 'wpvivid'); ?></strong></span>
|
178 |
</label>
|
179 |
</div>
|
180 |
|
@@ -185,7 +185,7 @@ class WPvivid_Staging_Setting_Free
|
|
185 |
<div class="wpvivid-element-space-bottom">
|
186 |
<label>
|
187 |
<input type="checkbox" option="setting" name="staging_overwrite_permalink" <?php esc_attr_e($staging_overwrite_permalink_check); ?> />
|
188 |
-
<span><strong><?php _e('Keep permalink when transferring website', 'wpvivid'); ?></strong></span>
|
189 |
</label>
|
190 |
</div>
|
191 |
|
@@ -196,7 +196,7 @@ class WPvivid_Staging_Setting_Free
|
|
196 |
<div class="wpvivid-element-space-bottom">
|
197 |
<label>
|
198 |
<input type="checkbox" option="setting" name="staging_keep_setting" <?php esc_attr_e($staging_keep_setting); ?> />
|
199 |
-
<span><strong><?php _e('Keep staging sites when deleting the plugin', 'wpvivid'); ?></strong></span>
|
200 |
</label>
|
201 |
</div>
|
202 |
|
@@ -263,7 +263,7 @@ class WPvivid_Staging_Setting_Free
|
|
263 |
}
|
264 |
?>
|
265 |
<div class="postbox schedule-tab-block wpvivid-setting-addon" style="margin-bottom: 10px; padding-bottom: 0;">
|
266 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Copy Count', 'wpvivid'); ?></strong></div>
|
267 |
<div class="wpvivid-element-space-bottom">
|
268 |
<input type="text" class="all-options" option="setting" name="staging_db_insert_count" value="<?php esc_attr_e($staging_db_insert_count); ?>"
|
269 |
placeholder="10000" onkeyup="value=value.replace(/\D/g,'')" />
|
@@ -271,39 +271,39 @@ class WPvivid_Staging_Setting_Free
|
|
271 |
<div class="wpvivid-element-space-bottom">
|
272 |
<?php _e( 'Number of DB rows, that are copied within one ajax query. The higher value makes the database copy process faster.
|
273 |
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no
|
274 |
-
more errors occur.', 'wpvivid' ); ?>
|
275 |
</div>
|
276 |
|
277 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Replace Count', 'wpvivid'); ?></strong></div>
|
278 |
<div class="wpvivid-element-space-bottom">
|
279 |
<input type="text" class="all-options" option="setting" name="staging_db_replace_count" value="<?php esc_attr_e($staging_db_replace_count); ?>"
|
280 |
placeholder="5000" onkeyup="value=value.replace(/\D/g,'')" />
|
281 |
</div>
|
282 |
<div class="wpvivid-element-space-bottom">
|
283 |
<?php _e( 'Number of DB rows, that are processed within one ajax query. The higher value makes the DB replacement process faster.
|
284 |
-
If timeout erros occur, decrease the value because this process consumes a lot of memory.', 'wpvivid' ); ?>
|
285 |
</div>
|
286 |
|
287 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('File Copy Count', 'wpvivid'); ?></strong></div>
|
288 |
<div class="wpvivid-element-space-bottom">
|
289 |
<input type="text" class="all-options" option="setting" name="staging_file_copy_count" value="<?php esc_attr_e($staging_file_copy_count); ?>"
|
290 |
placeholder="500" onkeyup="value=value.replace(/\D/g,'')" />
|
291 |
</div>
|
292 |
<div class="wpvivid-element-space-bottom">
|
293 |
-
<?php _e( 'Number of files to copy that will be copied within one ajax request. The higher value makes the file
|
294 |
-
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no more errors occur.', 'wpvivid' ); ?>
|
295 |
</div>
|
296 |
|
297 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Max File Size', 'wpvivid'); ?></strong></div>
|
298 |
<div class="wpvivid-element-space-bottom">
|
299 |
<input type="text" class="all-options" option="setting" name="staging_exclude_file_size" value="<?php esc_attr_e($staging_exclude_file_size); ?>"
|
300 |
placeholder="30" onkeyup="value=value.replace(/\D/g,'')" />MB
|
301 |
</div>
|
302 |
<div class="wpvivid-element-space-bottom">
|
303 |
-
<?php _e( 'Maximum size of the files copied to a staging site. All files larger than this value will be ignored. If you set the value of 0 MB, all files will be copied to a staging site.', 'wpvivid' ); ?>
|
304 |
</div>
|
305 |
|
306 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Staging Memory Limit', 'wpvivid'); ?></strong></div>
|
307 |
<div class="wpvivid-element-space-bottom">
|
308 |
<input type="text" class="all-options" option="setting" name="staging_memory_limit" value="<?php esc_attr_e($staging_memory_limit); ?>"
|
309 |
placeholder="256" onkeyup="value=value.replace(/\D/g,'')" />MB
|
@@ -311,10 +311,10 @@ class WPvivid_Staging_Setting_Free
|
|
311 |
<div class="wpvivid-element-space-bottom">
|
312 |
<?php _e('Adjust this value to apply for a temporary PHP memory limit for the plugin to create a staging site.
|
313 |
We set this value to 256M by default. Increase the value if you encounter a memory exhausted error. Note: some
|
314 |
-
web hosting providers may not support this.', 'wpvivid'); ?>
|
315 |
</div>
|
316 |
|
317 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('PHP Script Execution Timeout', 'wpvivid'); ?></strong></div>
|
318 |
<div class="wpvivid-element-space-bottom">
|
319 |
<input type="text" class="all-options" option="setting" name="staging_max_execution_time" value="<?php esc_attr_e($staging_max_execution_time); ?>"
|
320 |
placeholder="900" onkeyup="value=value.replace(/\D/g,'')" />
|
@@ -322,20 +322,20 @@ class WPvivid_Staging_Setting_Free
|
|
322 |
<div class="wpvivid-element-space-bottom">
|
323 |
<?php _e( 'The time-out is not your server PHP time-out. With the execution time exhausted, our plugin will shut down the progress of
|
324 |
creating a staging site. If the progress encounters a time-out, that means you have a medium or large sized website. Please try to
|
325 |
-
scale the value bigger.', 'wpvivid' ); ?>
|
326 |
</div>
|
327 |
|
328 |
-
<div class="wpvivid-element-space-bottom"><strong><?php _e('Delay Between Requests', 'wpvivid'); ?></strong></div>
|
329 |
<div class="wpvivid-element-space-bottom">
|
330 |
<input type="text" class="all-options" option="setting" name="staging_request_timeout" value="<?php esc_attr_e($staging_request_timeout); ?>"
|
331 |
placeholder="1500" onkeyup="value=value.replace(/\D/g,'')" />ms
|
332 |
</div>
|
333 |
<div class="wpvivid-element-space-bottom">
|
334 |
-
<?php _e( 'A lower value will help speed up the process of creating a staging site. However, if your server has a limit on the number of requests, a higher value is recommended.', 'wpvivid' ); ?>
|
335 |
</div>
|
336 |
|
337 |
<div class="wpvivid-element-space-bottom">
|
338 |
-
<strong
|
339 |
<select option="setting" name="staging_resume_count">
|
340 |
<?php
|
341 |
for($resume_count=3; $resume_count<10; $resume_count++){
|
@@ -347,13 +347,13 @@ class WPvivid_Staging_Setting_Free
|
|
347 |
}
|
348 |
}
|
349 |
?>
|
350 |
-
</select><strong><?php _e(' times when encountering a time-out error', 'wpvivid'); ?></strong>
|
351 |
</div>
|
352 |
|
353 |
<div class="wpvivid-element-space-bottom">
|
354 |
<label>
|
355 |
<input type="checkbox" option="setting" name="not_need_login" <?php esc_attr_e($staging_not_need_login_check); ?> />
|
356 |
-
<span><strong><?php _e('Anyone can visit the staging site', 'wpvivid'); ?></strong></span>
|
357 |
</label>
|
358 |
</div>
|
359 |
|
@@ -364,7 +364,7 @@ class WPvivid_Staging_Setting_Free
|
|
364 |
<div class="wpvivid-element-space-bottom">
|
365 |
<label>
|
366 |
<input type="checkbox" option="setting" name="staging_overwrite_permalink" <?php esc_attr_e($staging_overwrite_permalink_check); ?> />
|
367 |
-
<span><strong><?php _e('Keep permalink when transferring website', 'wpvivid'); ?></strong></span>
|
368 |
</label>
|
369 |
</div>
|
370 |
|
@@ -375,7 +375,7 @@ class WPvivid_Staging_Setting_Free
|
|
375 |
<div class="wpvivid-element-space-bottom">
|
376 |
<label>
|
377 |
<input type="checkbox" option="setting" name="staging_keep_setting" <?php esc_attr_e($staging_keep_setting); ?> />
|
378 |
-
<span><strong><?php _e('Keep staging sites when deleting the plugin', 'wpvivid'); ?></strong></span>
|
379 |
</label>
|
380 |
</div>
|
381 |
|
@@ -383,7 +383,7 @@ class WPvivid_Staging_Setting_Free
|
|
383 |
<span>With this option checked, all staging sites you have created will be retained when the plugin is deleted, just in case you still need them later. The sites will show up again after the plugin is reinstalled.</span>
|
384 |
</div>
|
385 |
</div>
|
386 |
-
<div><input class="button-primary wpvividstg_save_setting" type="submit" value="<?php esc_attr_e( 'Save Changes', 'wpvivid' ); ?>" /></div>
|
387 |
<script>
|
388 |
jQuery('.wpvividstg_save_setting').click(function()
|
389 |
{
|
84 |
?>
|
85 |
<div style="margin-top: 10px;">
|
86 |
<div class="postbox schedule-tab-block wpvivid-setting-addon" style="margin-bottom: 10px; padding-bottom: 0;">
|
87 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Copy Count', 'wpvivid-backuprestore'); ?></strong></div>
|
88 |
<div class="wpvivid-element-space-bottom">
|
89 |
<input type="text" class="all-options" option="setting" name="staging_db_insert_count" value="<?php esc_attr_e($staging_db_insert_count); ?>"
|
90 |
placeholder="10000" onkeyup="value=value.replace(/\D/g,'')" />
|
92 |
<div class="wpvivid-element-space-bottom">
|
93 |
<?php _e( 'Number of DB rows, that are copied within one ajax query. The higher value makes the database copy process faster.
|
94 |
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no
|
95 |
+
more errors occur.', 'wpvivid-backuprestore' ); ?>
|
96 |
</div>
|
97 |
|
98 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Replace Count', 'wpvivid-backuprestore'); ?></strong></div>
|
99 |
<div class="wpvivid-element-space-bottom">
|
100 |
<input type="text" class="all-options" option="setting" name="staging_db_replace_count" value="<?php esc_attr_e($staging_db_replace_count); ?>"
|
101 |
placeholder="5000" onkeyup="value=value.replace(/\D/g,'')" />
|
102 |
</div>
|
103 |
<div class="wpvivid-element-space-bottom">
|
104 |
<?php _e( 'Number of DB rows, that are processed within one ajax query. The higher value makes the DB replacement process faster.
|
105 |
+
If timeout erros occur, decrease the value because this process consumes a lot of memory.', 'wpvivid-backuprestore' ); ?>
|
106 |
</div>
|
107 |
|
108 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('File Copy Count', 'wpvivid-backuprestore'); ?></strong></div>
|
109 |
<div class="wpvivid-element-space-bottom">
|
110 |
<input type="text" class="all-options" option="setting" name="staging_file_copy_count" value="<?php esc_attr_e($staging_file_copy_count); ?>"
|
111 |
placeholder="500" onkeyup="value=value.replace(/\D/g,'')" />
|
112 |
</div>
|
113 |
<div class="wpvivid-element-space-bottom">
|
114 |
+
<?php _e( 'Number of files to copy that will be copied within one ajax request. The higher value makes the file copy process faster.
|
115 |
+
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no more errors occur.', 'wpvivid-backuprestore' ); ?>
|
116 |
</div>
|
117 |
|
118 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Max File Size', 'wpvivid-backuprestore'); ?></strong></div>
|
119 |
<div class="wpvivid-element-space-bottom">
|
120 |
<input type="text" class="all-options" option="setting" name="staging_exclude_file_size" value="<?php esc_attr_e($staging_exclude_file_size); ?>"
|
121 |
placeholder="30" onkeyup="value=value.replace(/\D/g,'')" />MB
|
122 |
</div>
|
123 |
<div class="wpvivid-element-space-bottom">
|
124 |
+
<?php _e( 'Maximum size of the files copied to a staging site. All files larger than this value will be ignored. If you set the value of 0 MB, all files will be copied to a staging site.', 'wpvivid-backuprestore' ); ?>
|
125 |
</div>
|
126 |
|
127 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Staging Memory Limit', 'wpvivid-backuprestore'); ?></strong></div>
|
128 |
<div class="wpvivid-element-space-bottom">
|
129 |
<input type="text" class="all-options" option="setting" name="staging_memory_limit" value="<?php esc_attr_e($staging_memory_limit); ?>"
|
130 |
placeholder="256" onkeyup="value=value.replace(/\D/g,'')" />MB
|
132 |
<div class="wpvivid-element-space-bottom">
|
133 |
<?php _e('Adjust this value to apply for a temporary PHP memory limit for the plugin to create a staging site.
|
134 |
We set this value to 256M by default. Increase the value if you encounter a memory exhausted error. Note: some
|
135 |
+
web hosting providers may not support this.', 'wpvivid-backuprestore'); ?>
|
136 |
</div>
|
137 |
|
138 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('PHP Script Execution Timeout', 'wpvivid-backuprestore'); ?></strong></div>
|
139 |
<div class="wpvivid-element-space-bottom">
|
140 |
<input type="text" class="all-options" option="setting" name="staging_max_execution_time" value="<?php esc_attr_e($staging_max_execution_time); ?>"
|
141 |
placeholder="900" onkeyup="value=value.replace(/\D/g,'')" />
|
143 |
<div class="wpvivid-element-space-bottom">
|
144 |
<?php _e( 'The time-out is not your server PHP time-out. With the execution time exhausted, our plugin will shut down the progress of
|
145 |
creating a staging site. If the progress encounters a time-out, that means you have a medium or large sized website. Please try to
|
146 |
+
scale the value bigger.', 'wpvivid-backuprestore' ); ?>
|
147 |
</div>
|
148 |
|
149 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Delay Between Requests', 'wpvivid-backuprestore'); ?></strong></div>
|
150 |
<div class="wpvivid-element-space-bottom">
|
151 |
<input type="text" class="all-options" option="setting" name="staging_request_timeout" value="<?php esc_attr_e($staging_request_timeout); ?>"
|
152 |
placeholder="1500" onkeyup="value=value.replace(/\D/g,'')" />ms
|
153 |
</div>
|
154 |
<div class="wpvivid-element-space-bottom">
|
155 |
+
<?php _e( 'A lower value will help speed up the process of creating a staging site. However, if your server has a limit on the number of requests, a higher value is recommended.', 'wpvivid-backuprestore' ); ?>
|
156 |
</div>
|
157 |
|
158 |
<div class="wpvivid-element-space-bottom">
|
168 |
}
|
169 |
}
|
170 |
?>
|
171 |
+
</select><strong><?php _e(' times when encountering a time-out error', 'wpvivid-backuprestore'); ?></strong>
|
172 |
</div>
|
173 |
|
174 |
<div class="wpvivid-element-space-bottom">
|
175 |
<label>
|
176 |
<input type="checkbox" option="setting" name="not_need_login" <?php esc_attr_e($staging_not_need_login_check); ?> />
|
177 |
+
<span><strong><?php _e('Anyone can visit the staging site', 'wpvivid-backuprestore'); ?></strong></span>
|
178 |
</label>
|
179 |
</div>
|
180 |
|
185 |
<div class="wpvivid-element-space-bottom">
|
186 |
<label>
|
187 |
<input type="checkbox" option="setting" name="staging_overwrite_permalink" <?php esc_attr_e($staging_overwrite_permalink_check); ?> />
|
188 |
+
<span><strong><?php _e('Keep permalink when transferring website', 'wpvivid-backuprestore'); ?></strong></span>
|
189 |
</label>
|
190 |
</div>
|
191 |
|
196 |
<div class="wpvivid-element-space-bottom">
|
197 |
<label>
|
198 |
<input type="checkbox" option="setting" name="staging_keep_setting" <?php esc_attr_e($staging_keep_setting); ?> />
|
199 |
+
<span><strong><?php _e('Keep staging sites when deleting the plugin', 'wpvivid-backuprestore'); ?></strong></span>
|
200 |
</label>
|
201 |
</div>
|
202 |
|
263 |
}
|
264 |
?>
|
265 |
<div class="postbox schedule-tab-block wpvivid-setting-addon" style="margin-bottom: 10px; padding-bottom: 0;">
|
266 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Copy Count', 'wpvivid-backuprestore'); ?></strong></div>
|
267 |
<div class="wpvivid-element-space-bottom">
|
268 |
<input type="text" class="all-options" option="setting" name="staging_db_insert_count" value="<?php esc_attr_e($staging_db_insert_count); ?>"
|
269 |
placeholder="10000" onkeyup="value=value.replace(/\D/g,'')" />
|
271 |
<div class="wpvivid-element-space-bottom">
|
272 |
<?php _e( 'Number of DB rows, that are copied within one ajax query. The higher value makes the database copy process faster.
|
273 |
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no
|
274 |
+
more errors occur.', 'wpvivid-backuprestore' ); ?>
|
275 |
</div>
|
276 |
|
277 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('DB Replace Count', 'wpvivid-backuprestore'); ?></strong></div>
|
278 |
<div class="wpvivid-element-space-bottom">
|
279 |
<input type="text" class="all-options" option="setting" name="staging_db_replace_count" value="<?php esc_attr_e($staging_db_replace_count); ?>"
|
280 |
placeholder="5000" onkeyup="value=value.replace(/\D/g,'')" />
|
281 |
</div>
|
282 |
<div class="wpvivid-element-space-bottom">
|
283 |
<?php _e( 'Number of DB rows, that are processed within one ajax query. The higher value makes the DB replacement process faster.
|
284 |
+
If timeout erros occur, decrease the value because this process consumes a lot of memory.', 'wpvivid-backuprestore' ); ?>
|
285 |
</div>
|
286 |
|
287 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('File Copy Count', 'wpvivid-backuprestore'); ?></strong></div>
|
288 |
<div class="wpvivid-element-space-bottom">
|
289 |
<input type="text" class="all-options" option="setting" name="staging_file_copy_count" value="<?php esc_attr_e($staging_file_copy_count); ?>"
|
290 |
placeholder="500" onkeyup="value=value.replace(/\D/g,'')" />
|
291 |
</div>
|
292 |
<div class="wpvivid-element-space-bottom">
|
293 |
+
<?php _e( 'Number of files to copy that will be copied within one ajax request. The higher value makes the file copy process faster.
|
294 |
+
Please try a high value to find out the highest possible value. If you encounter timeout errors, try lower values until no more errors occur.', 'wpvivid-backuprestore' ); ?>
|
295 |
</div>
|
296 |
|
297 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Max File Size', 'wpvivid-backuprestore'); ?></strong></div>
|
298 |
<div class="wpvivid-element-space-bottom">
|
299 |
<input type="text" class="all-options" option="setting" name="staging_exclude_file_size" value="<?php esc_attr_e($staging_exclude_file_size); ?>"
|
300 |
placeholder="30" onkeyup="value=value.replace(/\D/g,'')" />MB
|
301 |
</div>
|
302 |
<div class="wpvivid-element-space-bottom">
|
303 |
+
<?php _e( 'Maximum size of the files copied to a staging site. All files larger than this value will be ignored. If you set the value of 0 MB, all files will be copied to a staging site.', 'wpvivid-backuprestore' ); ?>
|
304 |
</div>
|
305 |
|
306 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Staging Memory Limit', 'wpvivid-backuprestore'); ?></strong></div>
|
307 |
<div class="wpvivid-element-space-bottom">
|
308 |
<input type="text" class="all-options" option="setting" name="staging_memory_limit" value="<?php esc_attr_e($staging_memory_limit); ?>"
|
309 |
placeholder="256" onkeyup="value=value.replace(/\D/g,'')" />MB
|
311 |
<div class="wpvivid-element-space-bottom">
|
312 |
<?php _e('Adjust this value to apply for a temporary PHP memory limit for the plugin to create a staging site.
|
313 |
We set this value to 256M by default. Increase the value if you encounter a memory exhausted error. Note: some
|
314 |
+
web hosting providers may not support this.', 'wpvivid-backuprestore'); ?>
|
315 |
</div>
|
316 |
|
317 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('PHP Script Execution Timeout', 'wpvivid-backuprestore'); ?></strong></div>
|
318 |
<div class="wpvivid-element-space-bottom">
|
319 |
<input type="text" class="all-options" option="setting" name="staging_max_execution_time" value="<?php esc_attr_e($staging_max_execution_time); ?>"
|
320 |
placeholder="900" onkeyup="value=value.replace(/\D/g,'')" />
|
322 |
<div class="wpvivid-element-space-bottom">
|
323 |
<?php _e( 'The time-out is not your server PHP time-out. With the execution time exhausted, our plugin will shut down the progress of
|
324 |
creating a staging site. If the progress encounters a time-out, that means you have a medium or large sized website. Please try to
|
325 |
+
scale the value bigger.', 'wpvivid-backuprestore' ); ?>
|
326 |
</div>
|
327 |
|
328 |
+
<div class="wpvivid-element-space-bottom"><strong><?php _e('Delay Between Requests', 'wpvivid-backuprestore'); ?></strong></div>
|
329 |
<div class="wpvivid-element-space-bottom">
|
330 |
<input type="text" class="all-options" option="setting" name="staging_request_timeout" value="<?php esc_attr_e($staging_request_timeout); ?>"
|
331 |
placeholder="1500" onkeyup="value=value.replace(/\D/g,'')" />ms
|
332 |
</div>
|
333 |
<div class="wpvivid-element-space-bottom">
|
334 |
+
<?php _e( 'A lower value will help speed up the process of creating a staging site. However, if your server has a limit on the number of requests, a higher value is recommended.', 'wpvivid-backuprestore' ); ?>
|
335 |
</div>
|
336 |
|
337 |
<div class="wpvivid-element-space-bottom">
|
338 |
+
<strong><?php _e('Retrying', 'wpvivid-backuprestore'); ?></strong>
|
339 |
<select option="setting" name="staging_resume_count">
|
340 |
<?php
|
341 |
for($resume_count=3; $resume_count<10; $resume_count++){
|
347 |
}
|
348 |
}
|
349 |
?>
|
350 |
+
</select><strong><?php _e(' times when encountering a time-out error', 'wpvivid-backuprestore'); ?></strong>
|
351 |
</div>
|
352 |
|
353 |
<div class="wpvivid-element-space-bottom">
|
354 |
<label>
|
355 |
<input type="checkbox" option="setting" name="not_need_login" <?php esc_attr_e($staging_not_need_login_check); ?> />
|
356 |
+
<span><strong><?php _e('Anyone can visit the staging site', 'wpvivid-backuprestore'); ?></strong></span>
|
357 |
</label>
|
358 |
</div>
|
359 |
|
364 |
<div class="wpvivid-element-space-bottom">
|
365 |
<label>
|
366 |
<input type="checkbox" option="setting" name="staging_overwrite_permalink" <?php esc_attr_e($staging_overwrite_permalink_check); ?> />
|
367 |
+
<span><strong><?php _e('Keep permalink when transferring website', 'wpvivid-backuprestore'); ?></strong></span>
|
368 |
</label>
|
369 |
</div>
|
370 |
|
375 |
<div class="wpvivid-element-space-bottom">
|
376 |
<label>
|
377 |
<input type="checkbox" option="setting" name="staging_keep_setting" <?php esc_attr_e($staging_keep_setting); ?> />
|
378 |
+
<span><strong><?php _e('Keep staging sites when deleting the plugin', 'wpvivid-backuprestore'); ?></strong></span>
|
379 |
</label>
|
380 |
</div>
|
381 |
|
383 |
<span>With this option checked, all staging sites you have created will be retained when the plugin is deleted, just in case you still need them later. The sites will show up again after the plugin is reinstalled.</span>
|
384 |
</div>
|
385 |
</div>
|
386 |
+
<div><input class="button-primary wpvividstg_save_setting" type="submit" value="<?php esc_attr_e( 'Save Changes', 'wpvivid-backuprestore' ); ?>" /></div>
|
387 |
<script>
|
388 |
jQuery('.wpvividstg_save_setting').click(function()
|
389 |
{
|
includes/staging/class-wpvivid-staging.php
CHANGED
@@ -44,7 +44,8 @@ class WPvivid_Staging_Free
|
|
44 |
add_action('admin_enqueue_scripts',array( $this,'enqueue_styles'));
|
45 |
add_action('admin_enqueue_scripts',array( $this,'enqueue_scripts'));
|
46 |
|
47 |
-
add_filter('wpvivid_add_side_bar', array($this, 'add_side_bar'), 11, 2);
|
|
|
48 |
|
49 |
add_filter('wpvivid_get_toolbar_menus',array($this,'get_toolbar_menus'),22);
|
50 |
add_filter('wpvivid_get_admin_menus',array($this,'get_admin_menus'),22);
|
@@ -66,7 +67,43 @@ class WPvivid_Staging_Free
|
|
66 |
$wpvivid_version = WPVIVID_PLUGIN_VERSION;
|
67 |
$wpvivid_version = apply_filters('wpvivid_display_pro_version', $wpvivid_version);
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<h2>
|
71 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">'.__('Current Version:', 'wpvivid-backuprestore').' '.$wpvivid_version.'</span></div>
|
72 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
@@ -99,10 +136,10 @@ class WPvivid_Staging_Free
|
|
99 |
</tbody>
|
100 |
</table>
|
101 |
</div>
|
102 |
-
</div>'
|
103 |
}
|
104 |
|
105 |
-
return $html;
|
106 |
}
|
107 |
|
108 |
public function get_admin_url($admin_url)
|
@@ -2457,7 +2494,7 @@ class WPvivid_Staging_Free
|
|
2457 |
$option['data']['theme']['exclude_regex'] = array();
|
2458 |
foreach ($staging_options['themes_list'] as $theme)
|
2459 |
{
|
2460 |
-
$option['data']['theme']['exclude_regex'][] = '#^'.preg_quote($this -> transfer_path(get_theme_root().DIRECTORY_SEPARATOR.$theme), '/').'
|
2461 |
}
|
2462 |
}
|
2463 |
|
44 |
add_action('admin_enqueue_scripts',array( $this,'enqueue_styles'));
|
45 |
add_action('admin_enqueue_scripts',array( $this,'enqueue_scripts'));
|
46 |
|
47 |
+
//add_filter('wpvivid_add_side_bar', array($this, 'add_side_bar'), 11, 2);
|
48 |
+
add_action('wpvivid_add_staging_side_bar_ex', array($this, 'add_side_bar'), 11, 2);
|
49 |
|
50 |
add_filter('wpvivid_get_toolbar_menus',array($this,'get_toolbar_menus'),22);
|
51 |
add_filter('wpvivid_get_admin_menus',array($this,'get_admin_menus'),22);
|
67 |
$wpvivid_version = WPVIVID_PLUGIN_VERSION;
|
68 |
$wpvivid_version = apply_filters('wpvivid_display_pro_version', $wpvivid_version);
|
69 |
|
70 |
+
?>
|
71 |
+
<div class="postbox">
|
72 |
+
<h2>
|
73 |
+
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0"><?php _e('Current Version: ', 'wpvivid-backuprestore'); ?><?php echo $wpvivid_version; ?></span></div>
|
74 |
+
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
75 |
+
<div style="float: left; margin-left: 0;">
|
76 |
+
<span style="margin: 0; padding: 0"><a href="https://wordpress.org/plugins/wpvivid-backuprestore/#developers" target="_blank" style="text-decoration: none;"><?php _e('ChangeLog', 'wpvivid-backuprestore'); ?></a></span>
|
77 |
+
</div>
|
78 |
+
<div style="clear: both;"></div>
|
79 |
+
</h2>
|
80 |
+
</div>
|
81 |
+
<div id="wpvivid_backup_schedule_part"></div>
|
82 |
+
<div class="postbox">
|
83 |
+
<h2><span><?php _e('Troubleshooting', 'wpvivid-backuprestore'); ?></span></h2>
|
84 |
+
<div class="inside">
|
85 |
+
<table class="widefat" cellpadding="0">
|
86 |
+
<tbody>
|
87 |
+
<tr class="alternate">
|
88 |
+
<td class="row-title"><?php _e('Read <a href="https://docs.wpvivid.com/troubleshooting-issues-wpvivid-backup-plugin.html" target="_blank">Troubleshooting page</a> for faster solutions.', 'wpvivid-backuprestore'); ?></td>
|
89 |
+
</tr>
|
90 |
+
</tbody>
|
91 |
+
</table>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
<div class="postbox">
|
95 |
+
<h2><span><?php _e('How-to', 'wpvivid-backuprestore'); ?></span></h2>
|
96 |
+
<div class="inside">
|
97 |
+
<table class="widefat" cellpadding="0">
|
98 |
+
<tbody>
|
99 |
+
<tr class="alternate"><td class="row-title"><a href="https://docs.wpvivid.com/wpvivid-backup-pro-create-staging-site.html" target="_blank"><?php _e('Create A Staging Site', 'wpvivid-backuprestore'); ?></a></td></tr>
|
100 |
+
<tr><td class="row-title"><a href="https://docs.wpvivid.com/wpvivid-staging-pro-create-fresh-install.html" target="_blank"><?php _e('Create A Fresh WordPress Install', 'wpvivid-backuprestore'); ?></a></td></tr>
|
101 |
+
</tbody>
|
102 |
+
</table>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
<?php
|
106 |
+
/*$html = '<div class="postbox">
|
107 |
<h2>
|
108 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">'.__('Current Version:', 'wpvivid-backuprestore').' '.$wpvivid_version.'</span></div>
|
109 |
<div style="float: left; margin-right: 5px;"><span style="margin: 0; padding: 0">|</span></div>
|
136 |
</tbody>
|
137 |
</table>
|
138 |
</div>
|
139 |
+
</div>';*/
|
140 |
}
|
141 |
|
142 |
+
//return $html;
|
143 |
}
|
144 |
|
145 |
public function get_admin_url($admin_url)
|
2494 |
$option['data']['theme']['exclude_regex'] = array();
|
2495 |
foreach ($staging_options['themes_list'] as $theme)
|
2496 |
{
|
2497 |
+
$option['data']['theme']['exclude_regex'][] = '#^'.preg_quote($this -> transfer_path(get_theme_root().DIRECTORY_SEPARATOR.$theme), '/').'$#';
|
2498 |
}
|
2499 |
}
|
2500 |
|
includes/upload-cleaner/class-wpvivid-uploads-cleaner.php
CHANGED
@@ -1001,9 +1001,6 @@ class WPvivid_Uploads_Cleaner
|
|
1001 |
include_once WPVIVID_PLUGIN_DIR . '/includes/upload-cleaner/class-wpvivid-isolate-files.php';
|
1002 |
include_once WPVIVID_PLUGIN_DIR. '/includes/upload-cleaner/class-wpvivid-upload-cleaner-setting.php';
|
1003 |
|
1004 |
-
$scan=new WPvivid_Uploads_Scanner();
|
1005 |
-
$scan->check_table_exist();
|
1006 |
-
$scan->check_unused_uploads_files_table_exist();
|
1007 |
$iso=new WPvivid_Isolate_Files();
|
1008 |
$iso->check_folder();
|
1009 |
|
@@ -1085,6 +1082,10 @@ class WPvivid_Uploads_Cleaner
|
|
1085 |
|
1086 |
public function display()
|
1087 |
{
|
|
|
|
|
|
|
|
|
1088 |
$upload_dir=wp_upload_dir();
|
1089 |
|
1090 |
$path=$this->transfer_path($upload_dir['basedir']);
|
1001 |
include_once WPVIVID_PLUGIN_DIR . '/includes/upload-cleaner/class-wpvivid-isolate-files.php';
|
1002 |
include_once WPVIVID_PLUGIN_DIR. '/includes/upload-cleaner/class-wpvivid-upload-cleaner-setting.php';
|
1003 |
|
|
|
|
|
|
|
1004 |
$iso=new WPvivid_Isolate_Files();
|
1005 |
$iso->check_folder();
|
1006 |
|
1082 |
|
1083 |
public function display()
|
1084 |
{
|
1085 |
+
$scan=new WPvivid_Uploads_Scanner();
|
1086 |
+
$scan->check_table_exist();
|
1087 |
+
$scan->check_unused_uploads_files_table_exist();
|
1088 |
+
|
1089 |
$upload_dir=wp_upload_dir();
|
1090 |
|
1091 |
$path=$this->transfer_path($upload_dir['basedir']);
|
includes/upload-cleaner/class-wpvivid-uploads-scanner.php
CHANGED
@@ -270,7 +270,14 @@ class WPvivid_Uploads_Scanner
|
|
270 |
if ( !empty( $widget_data[$instance_id]['ids'] ) )
|
271 |
{
|
272 |
$newIds = $widget_data[$instance_id]['ids'];
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
// Recent Blog Posts
|
276 |
if ( !empty( $widget_data[$instance_id]['thumbnail'] ) )
|
@@ -965,6 +972,87 @@ class WPvivid_Uploads_Scanner
|
|
965 |
}
|
966 |
}
|
967 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
968 |
}
|
969 |
|
970 |
if(!empty($element_data['elements']))
|
270 |
if ( !empty( $widget_data[$instance_id]['ids'] ) )
|
271 |
{
|
272 |
$newIds = $widget_data[$instance_id]['ids'];
|
273 |
+
if(is_array($newIds))
|
274 |
+
{
|
275 |
+
$ids = array_merge( $ids, $newIds );
|
276 |
+
}
|
277 |
+
else
|
278 |
+
{
|
279 |
+
$ids = array_merge( $ids, array($newIds) );
|
280 |
+
}
|
281 |
}
|
282 |
// Recent Blog Posts
|
283 |
if ( !empty( $widget_data[$instance_id]['thumbnail'] ) )
|
972 |
}
|
973 |
}
|
974 |
}
|
975 |
+
|
976 |
+
if(isset($settings['carousel']) && !empty($settings['carousel']))
|
977 |
+
{
|
978 |
+
foreach ($settings['carousel'] as $item)
|
979 |
+
{
|
980 |
+
if(isset($item['id']))
|
981 |
+
{
|
982 |
+
if(!in_array($item['id'],$attachment_added_ids))
|
983 |
+
{
|
984 |
+
$element_image[]=$item['id'];
|
985 |
+
$attachment_added_ids[]=$item['id'];
|
986 |
+
}
|
987 |
+
}
|
988 |
+
}
|
989 |
+
}
|
990 |
+
|
991 |
+
if(isset($settings['slides']) && !empty($settings['slides']))
|
992 |
+
{
|
993 |
+
foreach ($settings['slides'] as $item)
|
994 |
+
{
|
995 |
+
if(isset($item['image']['id']))
|
996 |
+
{
|
997 |
+
if(!in_array($item['image']['id'],$attachment_added_ids))
|
998 |
+
{
|
999 |
+
$element_image[]=$item['image']['id'];
|
1000 |
+
$attachment_added_ids[]=$item['image']['id'];
|
1001 |
+
}
|
1002 |
+
}
|
1003 |
+
}
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
if(isset($settings['poster']) && !empty($settings['poster']))
|
1007 |
+
{
|
1008 |
+
if(isset($settings['poster']['id']))
|
1009 |
+
{
|
1010 |
+
if(!in_array($settings['poster']['id'],$attachment_added_ids))
|
1011 |
+
{
|
1012 |
+
$element_image[]=$settings['poster']['id'];
|
1013 |
+
$attachment_added_ids[]=$settings['poster']['id'];
|
1014 |
+
}
|
1015 |
+
}
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
if(isset($settings['image_overlay']) && !empty($settings['image_overlay']))
|
1019 |
+
{
|
1020 |
+
if(isset($settings['image_overlay']['id']))
|
1021 |
+
{
|
1022 |
+
if(!in_array($settings['image_overlay']['id'],$attachment_added_ids))
|
1023 |
+
{
|
1024 |
+
$element_image[]=$settings['image_overlay']['id'];
|
1025 |
+
$attachment_added_ids[]=$settings['image_overlay']['id'];
|
1026 |
+
}
|
1027 |
+
}
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
if(isset($settings['background_video_fallback']))
|
1031 |
+
{
|
1032 |
+
if(isset($settings['background_video_fallback']['id']))
|
1033 |
+
{
|
1034 |
+
if(!in_array($settings['background_video_fallback']['id'],$attachment_added_ids))
|
1035 |
+
{
|
1036 |
+
$element_image[]=$settings['background_video_fallback']['id'];
|
1037 |
+
$attachment_added_ids[]=$settings['background_video_fallback']['id'];
|
1038 |
+
}
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
if(isset($settings['background_slideshow_gallery']) && !empty($settings['background_slideshow_gallery']))
|
1043 |
+
{
|
1044 |
+
foreach ($settings['background_slideshow_gallery'] as $item)
|
1045 |
+
{
|
1046 |
+
if(isset($item['id']))
|
1047 |
+
{
|
1048 |
+
if(!in_array($item['id'],$attachment_added_ids))
|
1049 |
+
{
|
1050 |
+
$element_image[]=$item['id'];
|
1051 |
+
$attachment_added_ids[]=$item['id'];
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
}
|
1055 |
+
}
|
1056 |
}
|
1057 |
|
1058 |
if(!empty($element_data['elements']))
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: wpvivid
|
3 |
Tags: move, clone, migrate, staging, backup, restore, auto backup, cloud backup
|
4 |
Requires at least: 4.5
|
5 |
-
Tested up to:
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv3 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
10 |
|
@@ -196,6 +196,15 @@ Thank you so much for translating WPvivid Backup Plugin to your languages!
|
|
196 |
* [Khoi](https://profiles.wordpress.org/khoipro/) (Vietnamese)
|
197 |
* [Jairo Ochoa](https://profiles.wordpress.org/jairoochoa/) and [Carlos Macías](https://profiles.wordpress.org/cmacias/) (Galician)
|
198 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
= 0.9.71 =
|
200 |
- Fixed the warning: Undefined array key "page" when editing pages in some cases.
|
201 |
- Fixed: Creating a fresh install failed when Elementor plugin is enabled.
|
2 |
Contributors: wpvivid
|
3 |
Tags: move, clone, migrate, staging, backup, restore, auto backup, cloud backup
|
4 |
Requires at least: 4.5
|
5 |
+
Tested up to: 6.0
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 0.9.72
|
8 |
License: GPLv3 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
10 |
|
196 |
* [Khoi](https://profiles.wordpress.org/khoipro/) (Vietnamese)
|
197 |
* [Jairo Ochoa](https://profiles.wordpress.org/jairoochoa/) and [Carlos Macías](https://profiles.wordpress.org/cmacias/) (Galician)
|
198 |
== Changelog ==
|
199 |
+
= 0.9.72 =
|
200 |
+
- Improved the upload function. Now when uploading a zip(part) failed, you will be notified immediately, and you can continue to upload the problematic zip rather than uploading all zips again.
|
201 |
+
- Added: Cloud storage credentials in the database are encrypted now.
|
202 |
+
- Changed: Cloud storage credentials are not showing in the storage edit page.
|
203 |
+
- Fixed: Selected themes were not copied when creating a fresh install in some cases.
|
204 |
+
- Fixed the wpvivid_request error that could appear in some cases when scanning unused images.
|
205 |
+
- Fixed: some used images were falsely scanned as unused.
|
206 |
+
- Optimized the plugin code to reduce server consumption.
|
207 |
+
- Fixed some bugs in the plugin code.
|
208 |
= 0.9.71 =
|
209 |
- Fixed the warning: Undefined array key "page" when editing pages in some cases.
|
210 |
- Fixed: Creating a fresh install failed when Elementor plugin is enabled.
|
wpvivid-backuprestore.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @wordpress-plugin
|
8 |
* Plugin Name: WPvivid Backup Plugin
|
9 |
* Description: Clone or copy WP sites then move or migrate them to new host (new domain), schedule backups, transfer backups to leading remote storage. All in one.
|
10 |
-
* Version: 0.9.
|
11 |
* Author: WPvivid Team
|
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.
|
25 |
//
|
26 |
define('WPVIVID_RESTORE_INIT','init');
|
27 |
define('WPVIVID_RESTORE_READY','ready');
|
7 |
* @wordpress-plugin
|
8 |
* Plugin Name: WPvivid Backup Plugin
|
9 |
* Description: Clone or copy WP sites then move or migrate them to new host (new domain), schedule backups, transfer backups to leading remote storage. All in one.
|
10 |
+
* Version: 0.9.72
|
11 |
* Author: WPvivid Team
|
12 |
* Author URI: https://wpvivid.com
|
13 |
* License: GPL-3.0+
|
21 |
die;
|
22 |
}
|
23 |
|
24 |
+
define( 'WPVIVID_PLUGIN_VERSION', '0.9.72' );
|
25 |
//
|
26 |
define('WPVIVID_RESTORE_INIT','init');
|
27 |
define('WPVIVID_RESTORE_READY','ready');
|