Version Description
- Fixed: Some WPvivid Backup Plugin settings were reset to default after restore.
- Fixed: Some urls could not be replaced because of escape format problems after restore.
- Fixed: Unused image could not be scanned in PHP 8.
- Fixed: Staging site admin url did not display correctly when the live site has a 'custom login url'.
- Optimized the plugin code.
Download this release
Release Info
Developer | wpvivid |
Plugin | Migration, Backup, Staging – WPvivid |
Version | 0.9.65 |
Comparing to | |
See all releases |
Code changes from version 0.9.64 to 0.9.65
- admin/class-wpvivid-admin.php +30 -3
- admin/css/wpvivid-staging-custom.css +8 -8
- includes/class-wpvivid-log.php +4 -1
- includes/class-wpvivid-restore-database.php +18 -0
- includes/customclass/class-wpvivid-one-drive.php +1 -0
- includes/staging/class-wpvivid-fresh-install-create-ui-display.php +85 -64
- includes/staging/class-wpvivid-staging-list-ui-display.php +28 -3
- includes/staging/class-wpvivid-staging-task-ex.php +1 -0
- includes/staging/class-wpvivid-staging-ui-display.php +26 -1
- includes/staging/class-wpvivid-staging.php +17 -1
- includes/upload-cleaner/class-wpvivid-uploads-scanner.php +5 -0
- readme.txt +7 -1
- vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlHandle.php +19 -5
- wpvivid-backuprestore.php +2 -2
admin/class-wpvivid-admin.php
CHANGED
@@ -335,9 +335,36 @@ class WPvivid_Admin {
|
|
335 |
|
336 |
public function add_action_links( $links )
|
337 |
{
|
338 |
-
$
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
return array_merge( $settings_link, $links );
|
342 |
}
|
343 |
|
335 |
|
336 |
public function add_action_links( $links )
|
337 |
{
|
338 |
+
$active_plugins = get_option('active_plugins');
|
339 |
+
if(!function_exists('get_plugins'))
|
340 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
341 |
+
$plugins=get_plugins();
|
342 |
+
$pro_wpvivid_slug='wpvivid-backup-pro/wpvivid-backup-pro.php';
|
343 |
+
$is_active_pro=false;
|
344 |
+
if(!empty($plugins))
|
345 |
+
{
|
346 |
+
if(isset($plugins[$pro_wpvivid_slug]))
|
347 |
+
{
|
348 |
+
if(in_array($pro_wpvivid_slug, $active_plugins))
|
349 |
+
{
|
350 |
+
$is_active_pro=true;
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
if($is_active_pro)
|
356 |
+
{
|
357 |
+
$settings_link = array(
|
358 |
+
'<a href="' . admin_url( 'admin.php?page=' . strtolower(sprintf('%s-dashboard', apply_filters('wpvivid_white_label_slug', 'wpvivid'))) ) . '">' . __('Settings', $this->plugin_name) . '</a>',
|
359 |
+
);
|
360 |
+
}
|
361 |
+
else
|
362 |
+
{
|
363 |
+
$settings_link = array(
|
364 |
+
'<a href="' . admin_url( 'admin.php?page=' . apply_filters('wpvivid_white_label_slug', $this->plugin_name) ) . '">' . __('Settings', $this->plugin_name) . '</a>',
|
365 |
+
);
|
366 |
+
}
|
367 |
+
|
368 |
return array_merge( $settings_link, $links );
|
369 |
}
|
370 |
|
admin/css/wpvivid-staging-custom.css
CHANGED
@@ -1131,7 +1131,7 @@ span.dashicons{
|
|
1131 |
transform:translate(-50%, -100%);
|
1132 |
padding:10px 20px;
|
1133 |
color:#444444;
|
1134 |
-
background-color:#
|
1135 |
font-weight:normal;
|
1136 |
font-size:13px;
|
1137 |
border-radius:8px;
|
@@ -1163,7 +1163,7 @@ span.dashicons{
|
|
1163 |
height:12px;
|
1164 |
left:50%;
|
1165 |
transform:translate(-50%,-50%) rotate(45deg);
|
1166 |
-
background-color:#
|
1167 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1168 |
}
|
1169 |
|
@@ -1175,7 +1175,7 @@ span.dashicons{
|
|
1175 |
transform:translate(-50%, 0);
|
1176 |
padding:10px 20px;
|
1177 |
color:#444444;
|
1178 |
-
background-color:#
|
1179 |
font-weight:normal;
|
1180 |
font-size:13px;
|
1181 |
border-radius:8px;
|
@@ -1209,7 +1209,7 @@ span.dashicons{
|
|
1209 |
height:12px;
|
1210 |
left:50%;
|
1211 |
transform:translate(-50%,50%) rotate(45deg);
|
1212 |
-
background-color:#
|
1213 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1214 |
}
|
1215 |
/* tooltip - left */
|
@@ -1221,7 +1221,7 @@ span.dashicons{
|
|
1221 |
transform:translate(0, -50%);
|
1222 |
padding:10px 20px;
|
1223 |
color:#444444;
|
1224 |
-
background-color:#
|
1225 |
font-weight:normal;
|
1226 |
font-size:13px;
|
1227 |
border-radius:8px;
|
@@ -1254,7 +1254,7 @@ span.dashicons{
|
|
1254 |
left:0;
|
1255 |
top:50%;
|
1256 |
transform:translate(-50%,-50%) rotate(-45deg);
|
1257 |
-
background-color:#
|
1258 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1259 |
}
|
1260 |
/* tooltip - right */
|
@@ -1266,7 +1266,7 @@ span.dashicons{
|
|
1266 |
transform:translate(0, -50%);
|
1267 |
padding:10px 20px;
|
1268 |
color:#444444;
|
1269 |
-
background-color:#
|
1270 |
font-weight:normal;
|
1271 |
font-size:13px;
|
1272 |
border-radius:8px;
|
@@ -1303,7 +1303,7 @@ span.dashicons{
|
|
1303 |
left:0;
|
1304 |
top:50%;
|
1305 |
transform:translate(50%,-50%) rotate(-45deg);
|
1306 |
-
background-color:#
|
1307 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1308 |
}
|
1309 |
|
1131 |
transform:translate(-50%, -100%);
|
1132 |
padding:10px 20px;
|
1133 |
color:#444444;
|
1134 |
+
background-color:#FFFFFF;
|
1135 |
font-weight:normal;
|
1136 |
font-size:13px;
|
1137 |
border-radius:8px;
|
1163 |
height:12px;
|
1164 |
left:50%;
|
1165 |
transform:translate(-50%,-50%) rotate(45deg);
|
1166 |
+
background-color:#FFFFFF;
|
1167 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1168 |
}
|
1169 |
|
1175 |
transform:translate(-50%, 0);
|
1176 |
padding:10px 20px;
|
1177 |
color:#444444;
|
1178 |
+
background-color:#FFFFFF;
|
1179 |
font-weight:normal;
|
1180 |
font-size:13px;
|
1181 |
border-radius:8px;
|
1209 |
height:12px;
|
1210 |
left:50%;
|
1211 |
transform:translate(-50%,50%) rotate(45deg);
|
1212 |
+
background-color:#FFFFFF;
|
1213 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1214 |
}
|
1215 |
/* tooltip - left */
|
1221 |
transform:translate(0, -50%);
|
1222 |
padding:10px 20px;
|
1223 |
color:#444444;
|
1224 |
+
background-color:#FFFFFF;
|
1225 |
font-weight:normal;
|
1226 |
font-size:13px;
|
1227 |
border-radius:8px;
|
1254 |
left:0;
|
1255 |
top:50%;
|
1256 |
transform:translate(-50%,-50%) rotate(-45deg);
|
1257 |
+
background-color:#FFFFFF;
|
1258 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1259 |
}
|
1260 |
/* tooltip - right */
|
1266 |
transform:translate(0, -50%);
|
1267 |
padding:10px 20px;
|
1268 |
color:#444444;
|
1269 |
+
background-color:#FFFFFF;
|
1270 |
font-weight:normal;
|
1271 |
font-size:13px;
|
1272 |
border-radius:8px;
|
1303 |
left:0;
|
1304 |
top:50%;
|
1305 |
transform:translate(50%,-50%) rotate(-45deg);
|
1306 |
+
background-color:#FFFFFF;
|
1307 |
box-shadow:0 1px 8px rgba(0,0,0,0.5);
|
1308 |
}
|
1309 |
|
includes/class-wpvivid-log.php
CHANGED
@@ -82,7 +82,10 @@ class WPvivid_Log
|
|
82 |
|
83 |
if(!isset($options['log_save_location']))
|
84 |
{
|
85 |
-
WPvivid_Setting::set_default_common_option();
|
|
|
|
|
|
|
86 |
$options = WPvivid_Setting::get_option('wpvivid_common_setting');
|
87 |
}
|
88 |
|
82 |
|
83 |
if(!isset($options['log_save_location']))
|
84 |
{
|
85 |
+
//WPvivid_Setting::set_default_common_option();
|
86 |
+
$options['log_save_location']=WPVIVID_DEFAULT_LOG_DIR;
|
87 |
+
update_option('wpvivid_common_setting', $options);
|
88 |
+
|
89 |
$options = WPvivid_Setting::get_option('wpvivid_common_setting');
|
90 |
}
|
91 |
|
includes/class-wpvivid-restore-database.php
CHANGED
@@ -1378,6 +1378,15 @@ class WPvivid_RestoreDB
|
|
1378 |
}
|
1379 |
}
|
1380 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1381 |
}
|
1382 |
else
|
1383 |
{
|
@@ -1386,6 +1395,15 @@ class WPvivid_RestoreDB
|
|
1386 |
|
1387 |
$from[]=str_replace('/', '\/', $this->old_site_url);
|
1388 |
$to[]=str_replace('/', '\/', $this->new_site_url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1389 |
}
|
1390 |
}
|
1391 |
|
1378 |
}
|
1379 |
}
|
1380 |
}
|
1381 |
+
|
1382 |
+
$tmp_old_site_url = str_replace(':', '%3A', $this->old_site_url);
|
1383 |
+
$tmp_old_site_url = str_replace('/', '%2F', $tmp_old_site_url);
|
1384 |
+
|
1385 |
+
$tmp_new_site_url = str_replace(':', '%3A', $this->new_site_url);
|
1386 |
+
$tmp_new_site_url = str_replace('/', '%2F', $tmp_new_site_url);
|
1387 |
+
|
1388 |
+
$from[]=$tmp_old_site_url;
|
1389 |
+
$to[]=$tmp_new_site_url;
|
1390 |
}
|
1391 |
else
|
1392 |
{
|
1395 |
|
1396 |
$from[]=str_replace('/', '\/', $this->old_site_url);
|
1397 |
$to[]=str_replace('/', '\/', $this->new_site_url);
|
1398 |
+
|
1399 |
+
$tmp_old_site_url = str_replace(':', '%3A', $this->old_site_url);
|
1400 |
+
$tmp_old_site_url = str_replace('/', '%2F', $tmp_old_site_url);
|
1401 |
+
|
1402 |
+
$tmp_new_site_url = str_replace(':', '%3A', $this->new_site_url);
|
1403 |
+
$tmp_new_site_url = str_replace('/', '%2F', $tmp_new_site_url);
|
1404 |
+
|
1405 |
+
$from[]=$tmp_old_site_url;
|
1406 |
+
$to[]=$tmp_new_site_url;
|
1407 |
}
|
1408 |
}
|
1409 |
|
includes/customclass/class-wpvivid-one-drive.php
CHANGED
@@ -710,6 +710,7 @@ class WPvivid_one_drive extends WPvivid_Remote
|
|
710 |
$args['method']='POST';
|
711 |
$args['wpvivid_refresh_token']=1;
|
712 |
$args['timeout']=15;
|
|
|
713 |
$args['body']=array( 'wpvivid_refresh_token' => '1', 'refresh_token' => $this->options['token']['refresh_token']);
|
714 |
$response=wp_remote_post('https://auth.wpvivid.com/onedrive_v2/',$args);
|
715 |
if(!is_wp_error($response) && ($response['response']['code'] == 200))
|
710 |
$args['method']='POST';
|
711 |
$args['wpvivid_refresh_token']=1;
|
712 |
$args['timeout']=15;
|
713 |
+
$args['sslverify']=FALSE;
|
714 |
$args['body']=array( 'wpvivid_refresh_token' => '1', 'refresh_token' => $this->options['token']['refresh_token']);
|
715 |
$response=wp_remote_post('https://auth.wpvivid.com/onedrive_v2/',$args);
|
716 |
if(!is_wp_error($response) && ($response['response']['code'] == 200))
|
includes/staging/class-wpvivid-fresh-install-create-ui-display.php
CHANGED
@@ -341,13 +341,13 @@ class WPvivid_Fresh_Install_Create_UI_Display_Free
|
|
341 |
<div>
|
342 |
<div class="wpvivid-two-col">
|
343 |
<h2 style="padding-left:0em;"><span class="dashicons dashicons-admin-page wpvivid-dashicons-orange"></span><span>Choose Themes to Be Copied to The Fresh Install</span></h2>
|
344 |
-
<div style="padding:0em 1em 0 1em; overflow-y:auto;border:1px solid #f1f1f1;max-height: 468px">
|
345 |
<?php echo $this->output_themes_plugins_info('theme'); ?>
|
346 |
</div>
|
347 |
</div>
|
348 |
<div class="wpvivid-two-col" style="">
|
349 |
<h2 style="padding-left:0em;"><span class="dashicons dashicons-admin-page wpvivid-dashicons-orange"></span><span>Choose Plugins to Be Copied to The Fresh Install</span></h2>
|
350 |
-
<div style="padding:0em 1em 0 1em;overflow-y:auto;border:1px solid #f1f1f1;max-height: 468px">
|
351 |
<?php echo $this->output_themes_plugins_info('plugin'); ?>
|
352 |
</div>
|
353 |
</div>
|
@@ -521,9 +521,10 @@ class WPvivid_Fresh_Install_Create_UI_Display_Free
|
|
521 |
|
522 |
var ajax_data =
|
523 |
{
|
524 |
-
'action': '
|
525 |
'root_dir':staging_root_dir,
|
526 |
-
'path': path
|
|
|
527 |
};
|
528 |
wpvivid_post_request(ajax_data, function (data)
|
529 |
{
|
@@ -534,75 +535,95 @@ class WPvivid_Fresh_Install_Create_UI_Display_Free
|
|
534 |
}
|
535 |
else
|
536 |
{
|
537 |
-
var
|
538 |
-
|
539 |
-
var additional_database_option = '0';
|
540 |
-
jQuery('input[option=create_wp][name=choose_create_staging_db]').each(function ()
|
541 |
-
{
|
542 |
-
if (jQuery(this).prop('checked'))
|
543 |
{
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
{
|
550 |
-
|
551 |
-
|
552 |
-
additional_database_json['additional_database_info']['db_user'] = jQuery('input[option=create_wp][name=database-user]').val();
|
553 |
-
additional_database_json['additional_database_info']['db_pass'] = jQuery('input[option=create_wp][name=database-pass]').val();
|
554 |
-
additional_database_json['additional_database_info']['db_host'] = jQuery('input[option=create_wp][name=database-host]').val();
|
555 |
-
additional_database_json['additional_database_info']['db_name'] = jQuery('input[option=create_wp][name=database-name]').val();
|
556 |
-
if (additional_database_json['additional_database_info']['db_name'] === '')
|
557 |
-
{
|
558 |
-
alert('Database Name is required.');
|
559 |
-
return;
|
560 |
-
}
|
561 |
-
if (additional_database_json['additional_database_info']['db_user'] === '')
|
562 |
{
|
563 |
-
alert(
|
564 |
-
return;
|
565 |
}
|
566 |
-
|
567 |
{
|
568 |
-
|
569 |
-
return;
|
570 |
-
}
|
571 |
-
}
|
572 |
-
else {
|
573 |
-
additional_database_json['additional_database_check'] = '0';
|
574 |
-
}
|
575 |
-
var additional_database_info=JSON.stringify(additional_database_json);
|
576 |
-
var custom_dir_json = wpvivid_get_custom_create_new_wp_option();
|
577 |
-
var custom_dir = JSON.stringify(custom_dir_json);
|
578 |
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
};
|
588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
|
590 |
-
|
591 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
});
|
607 |
}
|
608 |
}, function (XMLHttpRequest, textStatus, errorThrown) {
|
341 |
<div>
|
342 |
<div class="wpvivid-two-col">
|
343 |
<h2 style="padding-left:0em;"><span class="dashicons dashicons-admin-page wpvivid-dashicons-orange"></span><span>Choose Themes to Be Copied to The Fresh Install</span></h2>
|
344 |
+
<div style="padding:0em 1em 0 1em; height: 300px; overflow-y:auto;border:1px solid #f1f1f1;max-height: 468px">
|
345 |
<?php echo $this->output_themes_plugins_info('theme'); ?>
|
346 |
</div>
|
347 |
</div>
|
348 |
<div class="wpvivid-two-col" style="">
|
349 |
<h2 style="padding-left:0em;"><span class="dashicons dashicons-admin-page wpvivid-dashicons-orange"></span><span>Choose Plugins to Be Copied to The Fresh Install</span></h2>
|
350 |
+
<div style="padding:0em 1em 0 1em; height: 300px; overflow-y:auto;border:1px solid #f1f1f1;max-height: 468px">
|
351 |
<?php echo $this->output_themes_plugins_info('plugin'); ?>
|
352 |
</div>
|
353 |
</div>
|
521 |
|
522 |
var ajax_data =
|
523 |
{
|
524 |
+
'action': 'wpvividstg_check_staging_dir_free',
|
525 |
'root_dir':staging_root_dir,
|
526 |
+
'path': path,
|
527 |
+
'table_prefix': table_prefix,
|
528 |
};
|
529 |
wpvivid_post_request(ajax_data, function (data)
|
530 |
{
|
535 |
}
|
536 |
else
|
537 |
{
|
538 |
+
var ajax_data =
|
|
|
|
|
|
|
|
|
|
|
539 |
{
|
540 |
+
'action': 'wpvividstg_check_filesystem_permissions_free',
|
541 |
+
'root_dir':staging_root_dir,
|
542 |
+
'path': path
|
543 |
+
};
|
544 |
+
wpvivid_post_request(ajax_data, function (data)
|
545 |
{
|
546 |
+
var jsonarray = jQuery.parseJSON(data);
|
547 |
+
if (jsonarray.result === 'failed')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
548 |
{
|
549 |
+
alert(jsonarray.error);
|
|
|
550 |
}
|
551 |
+
else
|
552 |
{
|
553 |
+
var additional_database_json = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
|
555 |
+
var additional_database_option = '0';
|
556 |
+
jQuery('input[option=create_wp][name=choose_create_staging_db]').each(function ()
|
557 |
+
{
|
558 |
+
if (jQuery(this).prop('checked'))
|
559 |
+
{
|
560 |
+
additional_database_option = jQuery(this).val();
|
561 |
+
}
|
562 |
+
});
|
|
|
563 |
|
564 |
+
if (additional_database_option === '1')
|
565 |
+
{
|
566 |
+
additional_database_json['additional_database_check'] = '1';
|
567 |
+
additional_database_json['additional_database_info'] = {};
|
568 |
+
additional_database_json['additional_database_info']['db_user'] = jQuery('input[option=create_wp][name=database-user]').val();
|
569 |
+
additional_database_json['additional_database_info']['db_pass'] = jQuery('input[option=create_wp][name=database-pass]').val();
|
570 |
+
additional_database_json['additional_database_info']['db_host'] = jQuery('input[option=create_wp][name=database-host]').val();
|
571 |
+
additional_database_json['additional_database_info']['db_name'] = jQuery('input[option=create_wp][name=database-name]').val();
|
572 |
+
if (additional_database_json['additional_database_info']['db_name'] === '')
|
573 |
+
{
|
574 |
+
alert('Database Name is required.');
|
575 |
+
return;
|
576 |
+
}
|
577 |
+
if (additional_database_json['additional_database_info']['db_user'] === '')
|
578 |
+
{
|
579 |
+
alert('Database User is required.');
|
580 |
+
return;
|
581 |
+
}
|
582 |
+
if (additional_database_json['additional_database_info']['db_host'] === '')
|
583 |
+
{
|
584 |
+
alert('Database Host is required.');
|
585 |
+
return;
|
586 |
+
}
|
587 |
+
}
|
588 |
+
else {
|
589 |
+
additional_database_json['additional_database_check'] = '0';
|
590 |
+
}
|
591 |
+
var additional_database_info=JSON.stringify(additional_database_json);
|
592 |
+
var custom_dir_json = wpvivid_get_custom_create_new_wp_option();
|
593 |
+
var custom_dir = JSON.stringify(custom_dir_json);
|
594 |
|
595 |
+
var ajax_data = {
|
596 |
+
'action': 'wpvividstg_start_staging_free',
|
597 |
+
'create_new_wp':true,
|
598 |
+
'path': path,
|
599 |
+
'table_prefix': table_prefix,
|
600 |
+
'custom_dir': custom_dir,
|
601 |
+
'additional_db': additional_database_info,
|
602 |
+
'root_dir':staging_root_dir,
|
603 |
+
};
|
604 |
|
605 |
+
|
606 |
+
jQuery('#wpvivid_create_new_wp_content').hide();
|
607 |
+
jQuery('#wpvivid_create_new_wp_progress').show();
|
608 |
+
|
609 |
+
wpvivid_post_request(ajax_data, function (data)
|
610 |
+
{
|
611 |
+
setTimeout(function ()
|
612 |
+
{
|
613 |
+
wpvivid_get_create_new_wp_progress();
|
614 |
+
}, staging_requet_timeout);
|
615 |
+
}, function (XMLHttpRequest, textStatus, errorThrown)
|
616 |
+
{
|
617 |
+
jQuery('#wpvivid_create_new_wp_content').hide();
|
618 |
+
jQuery('#wpvivid_create_new_wp_progress').show();
|
619 |
+
setTimeout(function () {
|
620 |
+
wpvivid_get_create_new_wp_progress();
|
621 |
+
}, staging_requet_timeout);
|
622 |
+
});
|
623 |
+
}
|
624 |
+
}, function (XMLHttpRequest, textStatus, errorThrown) {
|
625 |
+
var error_message = wpvivid_output_ajaxerror('creating staging site', textStatus, errorThrown);
|
626 |
+
alert(error_message);
|
627 |
});
|
628 |
}
|
629 |
}, function (XMLHttpRequest, textStatus, errorThrown) {
|
includes/staging/class-wpvivid-staging-list-ui-display.php
CHANGED
@@ -83,8 +83,33 @@ class WPvivid_Staging_List_UI_Display_Free
|
|
83 |
$home_url = untrailingslashit($home_url);
|
84 |
$admin_url = apply_filters('wpvividstg_get_admin_url', '');
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
if(isset($staging['site']['home_url']) && !empty($staging['site']['home_url']))
|
89 |
{
|
90 |
$site_url = esc_url($staging['site']['home_url']);
|
@@ -134,7 +159,7 @@ class WPvivid_Staging_List_UI_Display_Free
|
|
134 |
<div class="wpvivid-two-col">
|
135 |
<p><span class="dashicons dashicons-awards wpvivid-dashicons-blue"></span><span><strong>Site Name: </strong></span><span><?php echo $staging_site_name; ?></span></p>
|
136 |
<p><span class="dashicons dashicons-admin-home wpvivid-dashicons-blue"></span><span><strong>Home URL: </strong></span><span><a href="<?php echo esc_url($site_url); ?>"><?php echo $site_url; ?></a></span></p>
|
137 |
-
<p><span class="dashicons dashicons-rest-api wpvivid-dashicons-blue"></span><span><strong
|
138 |
</div>
|
139 |
|
140 |
<div class="wpvivid-two-col">
|
83 |
$home_url = untrailingslashit($home_url);
|
84 |
$admin_url = apply_filters('wpvividstg_get_admin_url', '');
|
85 |
|
86 |
+
//$admin_name = str_replace($home_url, '', $admin_url);
|
87 |
+
//$admin_name = trim($admin_name, '/');
|
88 |
+
|
89 |
+
if(!isset($staging['login_url']))
|
90 |
+
{
|
91 |
+
$admin_name = str_replace($home_url, '', $admin_url);
|
92 |
+
$admin_name = trim($admin_name, '/');
|
93 |
+
$admin_url_descript = 'Admin URL';
|
94 |
+
}
|
95 |
+
else
|
96 |
+
{
|
97 |
+
$login_url = $staging['login_url'];
|
98 |
+
$login_name = str_replace($home_url, '', $login_url);
|
99 |
+
$login_name = trim($login_name, '/');
|
100 |
+
if($login_name !== 'wp-login.php' && !isset($staging['site']['fresh_install']))
|
101 |
+
{
|
102 |
+
$admin_name = $login_name;
|
103 |
+
$admin_url_descript = 'Login URL';
|
104 |
+
}
|
105 |
+
else
|
106 |
+
{
|
107 |
+
$admin_name = str_replace($home_url, '', $admin_url);
|
108 |
+
$admin_name = trim($admin_name, '/');
|
109 |
+
$admin_url_descript = 'Admin URL';
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
if(isset($staging['site']['home_url']) && !empty($staging['site']['home_url']))
|
114 |
{
|
115 |
$site_url = esc_url($staging['site']['home_url']);
|
159 |
<div class="wpvivid-two-col">
|
160 |
<p><span class="dashicons dashicons-awards wpvivid-dashicons-blue"></span><span><strong>Site Name: </strong></span><span><?php echo $staging_site_name; ?></span></p>
|
161 |
<p><span class="dashicons dashicons-admin-home wpvivid-dashicons-blue"></span><span><strong>Home URL: </strong></span><span><a href="<?php echo esc_url($site_url); ?>"><?php echo $site_url; ?></a></span></p>
|
162 |
+
<p><span class="dashicons dashicons-rest-api wpvivid-dashicons-blue"></span><span><strong><?php echo $admin_url_descript; ?>: </strong></span><span><a href="<?php echo esc_url($admin_url); ?>"><?php echo $admin_url; ?></a></span></p>
|
163 |
</div>
|
164 |
|
165 |
<div class="wpvivid-two-col">
|
includes/staging/class-wpvivid-staging-task-ex.php
CHANGED
@@ -236,6 +236,7 @@ class WPvivid_Staging_Task
|
|
236 |
}
|
237 |
}
|
238 |
$this->task['permalink_structure'] = get_option( 'permalink_structure','');
|
|
|
239 |
}
|
240 |
|
241 |
if(isset($option['data']['core']))
|
236 |
}
|
237 |
}
|
238 |
$this->task['permalink_structure'] = get_option( 'permalink_structure','');
|
239 |
+
$this->task['login_url'] = wp_login_url();
|
240 |
}
|
241 |
|
242 |
if(isset($option['data']['core']))
|
includes/staging/class-wpvivid-staging-ui-display.php
CHANGED
@@ -1250,7 +1250,7 @@ class WPvivid_Staging_UI_Display_Free
|
|
1250 |
$db_home_url = $home->option_value;
|
1251 |
}
|
1252 |
if($site_url !== $db_site_url || $home_url !== $db_home_url){
|
1253 |
-
_e('<div class="notice notice-warning inline"
|
1254 |
This can cause inappropriate staging site url issues. Please change the site url and home url in the Options table of the database to the actual
|
1255 |
url of your website. For example, if the site url and home url of the database is http://test.com, but the actual url of your website is https://test.com.
|
1256 |
You’ll need to change the http to https.
|
@@ -1258,6 +1258,30 @@ class WPvivid_Staging_UI_Display_Free
|
|
1258 |
}
|
1259 |
}
|
1260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1261 |
public function init_page()
|
1262 |
{
|
1263 |
$options=get_option('wpvivid_staging_options',array());
|
@@ -1275,6 +1299,7 @@ class WPvivid_Staging_UI_Display_Free
|
|
1275 |
<?php esc_attr_e('WPvivid Plugins - Staging', 'WpvividPlugins' ); ?>
|
1276 |
</h1>
|
1277 |
<?php self::wpvivid_check_site_url(); ?>
|
|
|
1278 |
<script>
|
1279 |
function wpvivid_include_exclude_folder(type, parent_id, tree_path)
|
1280 |
{
|
1250 |
$db_home_url = $home->option_value;
|
1251 |
}
|
1252 |
if($site_url !== $db_site_url || $home_url !== $db_home_url){
|
1253 |
+
_e('<div class="notice notice-warning inline"><p><strong>Warning:</strong> An inconsistency was detected between the site url, home url of the database and the actual website url.
|
1254 |
This can cause inappropriate staging site url issues. Please change the site url and home url in the Options table of the database to the actual
|
1255 |
url of your website. For example, if the site url and home url of the database is http://test.com, but the actual url of your website is https://test.com.
|
1256 |
You’ll need to change the http to https.
|
1258 |
}
|
1259 |
}
|
1260 |
|
1261 |
+
public static function wpvivid_check_login_url()
|
1262 |
+
{
|
1263 |
+
$home_url = home_url();
|
1264 |
+
global $wpdb;
|
1265 |
+
$home_url_sql = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->options WHERE option_name = %s", 'home' ) );
|
1266 |
+
foreach ( $home_url_sql as $home ){
|
1267 |
+
$home_url = $home->option_value;
|
1268 |
+
}
|
1269 |
+
$home_url = untrailingslashit($home_url);
|
1270 |
+
$login_url = wp_login_url();
|
1271 |
+
$login_name = str_replace($home_url, '', $login_url);
|
1272 |
+
$login_name = trim($login_name, '/');
|
1273 |
+
if($login_name !== 'wp-login.php')
|
1274 |
+
{
|
1275 |
+
?>
|
1276 |
+
<div class="notice notice-warning inline is-dismissible">
|
1277 |
+
<p>
|
1278 |
+
<strong>Warning:</strong> We detected that the login url of your live site is not the default '/wp-admin'. <a href="https://docs.wpvivid.com/wpvivid-staging-site-login-issue.html" target="_blank">Learn more</a>
|
1279 |
+
</p>
|
1280 |
+
</div>
|
1281 |
+
<?php
|
1282 |
+
}
|
1283 |
+
}
|
1284 |
+
|
1285 |
public function init_page()
|
1286 |
{
|
1287 |
$options=get_option('wpvivid_staging_options',array());
|
1299 |
<?php esc_attr_e('WPvivid Plugins - Staging', 'WpvividPlugins' ); ?>
|
1300 |
</h1>
|
1301 |
<?php self::wpvivid_check_site_url(); ?>
|
1302 |
+
<?php self::wpvivid_check_login_url(); ?>
|
1303 |
<script>
|
1304 |
function wpvivid_include_exclude_folder(type, parent_id, tree_path)
|
1305 |
{
|
includes/staging/class-wpvivid-staging.php
CHANGED
@@ -1713,6 +1713,7 @@ class WPvivid_Staging_Free
|
|
1713 |
$wpvivid_plugin->ajax_check_security();
|
1714 |
try
|
1715 |
{
|
|
|
1716 |
if(!isset($_POST['path']) || empty($_POST['path']) || !is_string($_POST['path']))
|
1717 |
{
|
1718 |
$ret['result']='failed';
|
@@ -1767,7 +1768,6 @@ class WPvivid_Staging_Free
|
|
1767 |
$ret['error'] = 'The table prefix already exists.';
|
1768 |
}
|
1769 |
|
1770 |
-
$ret['result'] = 'success';
|
1771 |
echo json_encode($ret);
|
1772 |
}
|
1773 |
catch (Exception $error)
|
@@ -1912,6 +1912,22 @@ class WPvivid_Staging_Free
|
|
1912 |
}
|
1913 |
else{
|
1914 |
$ret['completed_msg'] = 'Updating the staging site completed successfully.';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1915 |
}
|
1916 |
update_option('wpvivid_current_running_staging_task','');
|
1917 |
$ret['continue']=0;
|
1713 |
$wpvivid_plugin->ajax_check_security();
|
1714 |
try
|
1715 |
{
|
1716 |
+
$ret['result'] = 'success';
|
1717 |
if(!isset($_POST['path']) || empty($_POST['path']) || !is_string($_POST['path']))
|
1718 |
{
|
1719 |
$ret['result']='failed';
|
1768 |
$ret['error'] = 'The table prefix already exists.';
|
1769 |
}
|
1770 |
|
|
|
1771 |
echo json_encode($ret);
|
1772 |
}
|
1773 |
catch (Exception $error)
|
1912 |
}
|
1913 |
else{
|
1914 |
$ret['completed_msg'] = 'Updating the staging site completed successfully.';
|
1915 |
+
|
1916 |
+
$db_connect = $task->get_db_connect();
|
1917 |
+
$url = $db_connect['new_site_url'];
|
1918 |
+
$options=array();
|
1919 |
+
$options['timeout']=30;
|
1920 |
+
$response = wp_remote_request( $url,$options);
|
1921 |
+
if(!is_wp_error($response) && ($response['response']['code'] == 200))
|
1922 |
+
{
|
1923 |
+
$this->log->OpenLogFile($task->get_log_file_name());
|
1924 |
+
$this->log->WriteLog('Access staging site successfully.', 'notice');
|
1925 |
+
}
|
1926 |
+
else
|
1927 |
+
{
|
1928 |
+
$this->log->OpenLogFile($task->get_log_file_name());
|
1929 |
+
$this->log->WriteLog('Access staging site failed.', 'notice');
|
1930 |
+
}
|
1931 |
}
|
1932 |
update_option('wpvivid_current_running_staging_task','');
|
1933 |
$ret['continue']=0;
|
includes/upload-cleaner/class-wpvivid-uploads-scanner.php
CHANGED
@@ -463,6 +463,11 @@ class WPvivid_Uploads_Scanner
|
|
463 |
return array();
|
464 |
}
|
465 |
|
|
|
|
|
|
|
|
|
|
|
466 |
libxml_use_internal_errors(true);
|
467 |
$dom = new DOMDocument();
|
468 |
@$dom->loadHTML( $html );
|
463 |
return array();
|
464 |
}
|
465 |
|
466 |
+
if(empty($html))
|
467 |
+
{
|
468 |
+
return array();
|
469 |
+
}
|
470 |
+
|
471 |
libxml_use_internal_errors(true);
|
472 |
$dom = new DOMDocument();
|
473 |
@$dom->loadHTML( $html );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: move, clone, migrate, staging, backup, restore, auto backup, cloud backup
|
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 5.8.1
|
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 |
|
@@ -192,6 +192,12 @@ Thank you for translating WPvivid Backup Plugin to your languages!
|
|
192 |
* [Nima](https://profiles.wordpress.org/nima78600/) (Persian)
|
193 |
|
194 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
= 0.9.64 =
|
196 |
- Fixed: Failed to refresh Dropbox token in some cases.
|
197 |
- Fixed: Custom menu style could not be properly migrated in some cases.
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 5.8.1
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 0.9.65
|
8 |
License: GPLv3 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
|
10 |
|
192 |
* [Nima](https://profiles.wordpress.org/nima78600/) (Persian)
|
193 |
|
194 |
== Changelog ==
|
195 |
+
= 0.9.65 =
|
196 |
+
- Fixed: Some WPvivid Backup Plugin settings were reset to default after restore.
|
197 |
+
- Fixed: Some urls could not be replaced because of escape format problems after restore.
|
198 |
+
- Fixed: Unused image could not be scanned in PHP 8.
|
199 |
+
- Fixed: Staging site admin url did not display correctly when the live site has a 'custom login url'.
|
200 |
+
- Optimized the plugin code.
|
201 |
= 0.9.64 =
|
202 |
- Fixed: Failed to refresh Dropbox token in some cases.
|
203 |
- Fixed: Custom menu style could not be properly migrated in some cases.
|
vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlHandle.php
CHANGED
@@ -209,9 +209,12 @@ class CurlHandle
|
|
209 |
$args[] = $handle;
|
210 |
|
211 |
// PHP 5.5 pushed the handle onto the start of the args
|
212 |
-
if (
|
213 |
array_shift($args);
|
214 |
}
|
|
|
|
|
|
|
215 |
|
216 |
call_user_func_array(array($mediator, 'progress'), $args);
|
217 |
};
|
@@ -233,7 +236,10 @@ class CurlHandle
|
|
233 |
*/
|
234 |
public function __construct($handle, $options)
|
235 |
{
|
236 |
-
if (!is_resource($handle)) {
|
|
|
|
|
|
|
237 |
throw new InvalidArgumentException('Invalid handle provided');
|
238 |
}
|
239 |
if (is_array($options)) {
|
@@ -259,8 +265,12 @@ class CurlHandle
|
|
259 |
*/
|
260 |
public function close()
|
261 |
{
|
262 |
-
if (is_resource($this->handle)) {
|
263 |
curl_close($this->handle);
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
$this->handle = null;
|
266 |
}
|
@@ -272,7 +282,8 @@ class CurlHandle
|
|
272 |
*/
|
273 |
public function isAvailable()
|
274 |
{
|
275 |
-
return
|
|
|
276 |
}
|
277 |
|
278 |
/**
|
@@ -322,9 +333,12 @@ class CurlHandle
|
|
322 |
*/
|
323 |
public function getInfo($option = null)
|
324 |
{
|
325 |
-
if (
|
326 |
return null;
|
327 |
}
|
|
|
|
|
|
|
328 |
|
329 |
if (null !== $option) {
|
330 |
return curl_getinfo($this->handle, $option) ?: null;
|
209 |
$args[] = $handle;
|
210 |
|
211 |
// PHP 5.5 pushed the handle onto the start of the args
|
212 |
+
if (false !== $args[0]) {
|
213 |
array_shift($args);
|
214 |
}
|
215 |
+
/*if (is_resource($args[0])) {
|
216 |
+
array_shift($args);
|
217 |
+
}*/
|
218 |
|
219 |
call_user_func_array(array($mediator, 'progress'), $args);
|
220 |
};
|
236 |
*/
|
237 |
public function __construct($handle, $options)
|
238 |
{
|
239 |
+
/*if (!is_resource($handle)) {
|
240 |
+
throw new InvalidArgumentException('Invalid handle provided');
|
241 |
+
}*/
|
242 |
+
if (false === $handle) {
|
243 |
throw new InvalidArgumentException('Invalid handle provided');
|
244 |
}
|
245 |
if (is_array($options)) {
|
265 |
*/
|
266 |
public function close()
|
267 |
{
|
268 |
+
/*if (is_resource($this->handle)) {
|
269 |
curl_close($this->handle);
|
270 |
+
}*/
|
271 |
+
if (false !== $this->handle && null !== $this->handle) {
|
272 |
+
curl_close($this->handle);
|
273 |
+
unset($this->handle);
|
274 |
}
|
275 |
$this->handle = null;
|
276 |
}
|
282 |
*/
|
283 |
public function isAvailable()
|
284 |
{
|
285 |
+
return false !== $this->handle;
|
286 |
+
//return is_resource($this->handle);
|
287 |
}
|
288 |
|
289 |
/**
|
333 |
*/
|
334 |
public function getInfo($option = null)
|
335 |
{
|
336 |
+
if (false === $this->handle) {
|
337 |
return null;
|
338 |
}
|
339 |
+
/*if (!is_resource($this->handle)) {
|
340 |
+
return null;
|
341 |
+
}*/
|
342 |
|
343 |
if (null !== $option) {
|
344 |
return curl_getinfo($this->handle, $option) ?: null;
|
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.65
|
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.65' );
|
25 |
//
|
26 |
define('WPVIVID_RESTORE_INIT','init');
|
27 |
define('WPVIVID_RESTORE_READY','ready');
|