Version Description
- Fixed: Failed to upload backups to Dropbox in some cases.
- Updated: Changed timezone in email report title to local time.
- Optimized the plugin code.
Download this release
Release Info
Developer | wpvivid |
Plugin | Migration, Backup, Staging – WPvivid |
Version | 0.9.68 |
Comparing to | |
See all releases |
Code changes from version 0.9.67 to 0.9.68
- includes/class-wpvivid-mail-report.php +7 -3
- includes/class-wpvivid.php +2 -2
- includes/customclass/class-wpvivid-base-dropbox.php +38 -1
- includes/customclass/class-wpvivid-dropbox.php +135 -130
- includes/customclass/class-wpvivid-google-drive.php +189 -182
- includes/customclass/class-wpvivid-one-drive.php +153 -157
- readme.txt +5 -1
- wpvivid-backuprestore.php +2 -2
includes/class-wpvivid-mail-report.php
CHANGED
@@ -87,7 +87,10 @@ class WPvivid_mail_report
|
|
87 |
{
|
88 |
$status='Failed';
|
89 |
}
|
90 |
-
|
|
|
|
|
|
|
91 |
return $header;
|
92 |
}
|
93 |
|
@@ -103,8 +106,9 @@ class WPvivid_mail_report
|
|
103 |
$status='failed. '.$task['status']['error'];
|
104 |
}
|
105 |
$type=$task['type'];
|
106 |
-
$
|
107 |
-
$
|
|
|
108 |
$running_time=($task['status']['run_time']-$task['status']['start_time']).'s';
|
109 |
$remote_options= $task['options']['remote_options'];
|
110 |
if($remote_options!==false)
|
87 |
{
|
88 |
$status='Failed';
|
89 |
}
|
90 |
+
|
91 |
+
$offset=get_option('gmt_offset');
|
92 |
+
$localtime=gmdate('m-d-Y H:i:s', $task['status']['start_time']+$offset*60*60);
|
93 |
+
$header='[Backup '.$status.']'.$localtime.' - By WPvivid Backup Plugin';
|
94 |
return $header;
|
95 |
}
|
96 |
|
106 |
$status='failed. '.$task['status']['error'];
|
107 |
}
|
108 |
$type=$task['type'];
|
109 |
+
$offset=get_option('gmt_offset');
|
110 |
+
$start_time=date("m-d-Y H:i:s",$task['status']['start_time']+$offset*60*60);
|
111 |
+
$end_time=date("m-d-Y H:i:s",time()+$offset*60*60);
|
112 |
$running_time=($task['status']['run_time']-$task['status']['start_time']).'s';
|
113 |
$remote_options= $task['options']['remote_options'];
|
114 |
if($remote_options!==false)
|
includes/class-wpvivid.php
CHANGED
@@ -5756,9 +5756,9 @@ class WPvivid {
|
|
5756 |
<td>'.__($storage_type, 'wpvivid-backuprestore').'</td>
|
5757 |
<td class="row-title"><label for="tablecell">'.__($value['name'], 'wpvivid-backuprestore').'</label></td>
|
5758 |
<td>
|
5759 |
-
<div style="float: left;"><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Edit.png').'" onclick="click_retrieve_remote_storage(\''.
|
5760 |
);" style="vertical-align:middle; cursor:pointer;" title="Edit the remote storage"/></div>
|
5761 |
-
<div><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Delete.png').'" onclick="wpvivid_delete_remote_storage(\''.
|
5762 |
);" style="vertical-align:middle; cursor:pointer;" title="Remove the remote storage"/></div>
|
5763 |
</td>
|
5764 |
</tr>';
|
5756 |
<td>'.__($storage_type, 'wpvivid-backuprestore').'</td>
|
5757 |
<td class="row-title"><label for="tablecell">'.__($value['name'], 'wpvivid-backuprestore').'</label></td>
|
5758 |
<td>
|
5759 |
+
<div style="float: left;"><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Edit.png').'" onclick="click_retrieve_remote_storage(\''.esc_attr($key, 'wpvivid-backuprestore').'\',\''.esc_attr($value['type'], 'wpvivid-backuprestore').'\',\''.esc_attr($value['name'], 'wpvivid-backuprestore').'\'
|
5760 |
);" style="vertical-align:middle; cursor:pointer;" title="Edit the remote storage"/></div>
|
5761 |
+
<div><img src="'.esc_url(WPVIVID_PLUGIN_URL.'/admin/partials/images/Delete.png').'" onclick="wpvivid_delete_remote_storage(\''.esc_attr($key, 'wpvivid-backuprestore').'\'
|
5762 |
);" style="vertical-align:middle; cursor:pointer;" title="Remove the remote storage"/></div>
|
5763 |
</td>
|
5764 |
</tr>';
|
includes/customclass/class-wpvivid-base-dropbox.php
CHANGED
@@ -81,8 +81,20 @@ class Dropbox_Base{
|
|
81 |
$postdata = file_get_contents($file_data);
|
82 |
else
|
83 |
$postdata = $file_data;
|
84 |
-
|
85 |
$returnData = $this ->postRequest($endpoint, $headers, $postdata);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
return $returnData;
|
87 |
}
|
88 |
|
@@ -93,7 +105,20 @@ class Dropbox_Base{
|
|
93 |
"Content-Type: application/octet-stream",
|
94 |
"Dropbox-API-Arg: {\"close\": false}"
|
95 |
);
|
|
|
96 |
$returnData = $this ->postRequest($endpoint, $headers,null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
return $returnData;
|
98 |
}
|
99 |
|
@@ -106,6 +131,18 @@ class Dropbox_Base{
|
|
106 |
);
|
107 |
|
108 |
$returnData = $this ->postRequest($endpoint, $headers, $postdata);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
return $returnData;
|
110 |
}
|
111 |
|
81 |
$postdata = file_get_contents($file_data);
|
82 |
else
|
83 |
$postdata = $file_data;
|
84 |
+
|
85 |
$returnData = $this ->postRequest($endpoint, $headers, $postdata);
|
86 |
+
if(preg_match( "/Invalid or expired token. Please remove .* from the storage list and re-authenticate it/", $returnData, $matches ))
|
87 |
+
{
|
88 |
+
$ret=$this->check_token();
|
89 |
+
if($ret['result']=='failed')
|
90 |
+
{
|
91 |
+
return $returnData;
|
92 |
+
}
|
93 |
+
else
|
94 |
+
{
|
95 |
+
$returnData = $this ->postRequest($endpoint, $headers, $postdata);
|
96 |
+
}
|
97 |
+
}
|
98 |
return $returnData;
|
99 |
}
|
100 |
|
105 |
"Content-Type: application/octet-stream",
|
106 |
"Dropbox-API-Arg: {\"close\": false}"
|
107 |
);
|
108 |
+
|
109 |
$returnData = $this ->postRequest($endpoint, $headers,null);
|
110 |
+
if(preg_match( "/Invalid or expired token. Please remove .* from the storage list and re-authenticate it/", $returnData, $matches ))
|
111 |
+
{
|
112 |
+
$ret=$this->check_token();
|
113 |
+
if($ret['result']=='failed')
|
114 |
+
{
|
115 |
+
return $returnData;
|
116 |
+
}
|
117 |
+
else
|
118 |
+
{
|
119 |
+
$returnData = $this ->postRequest($endpoint, $headers,null);
|
120 |
+
}
|
121 |
+
}
|
122 |
return $returnData;
|
123 |
}
|
124 |
|
131 |
);
|
132 |
|
133 |
$returnData = $this ->postRequest($endpoint, $headers, $postdata);
|
134 |
+
if(preg_match( "/Invalid or expired token. Please remove .* from the storage list and re-authenticate it/", $returnData, $matches ))
|
135 |
+
{
|
136 |
+
$ret=$this->check_token();
|
137 |
+
if($ret['result']=='failed')
|
138 |
+
{
|
139 |
+
return $returnData;
|
140 |
+
}
|
141 |
+
else
|
142 |
+
{
|
143 |
+
$returnData = $this ->postRequest($endpoint, $headers,null);
|
144 |
+
}
|
145 |
+
}
|
146 |
return $returnData;
|
147 |
}
|
148 |
|
includes/customclass/class-wpvivid-dropbox.php
CHANGED
@@ -327,163 +327,168 @@ class WPvivid_Dropbox extends WPvivid_Remote
|
|
327 |
|
328 |
public function handle_auth_actions()
|
329 |
{
|
330 |
-
if(isset($_GET['action']))
|
331 |
{
|
332 |
-
if($_GET['
|
333 |
{
|
334 |
-
|
335 |
-
|
336 |
-
{
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
340 |
|
341 |
-
|
342 |
|
343 |
-
|
344 |
-
|
345 |
-
{
|
346 |
-
if (isset($value['name']) && $value['name'] == $_GET['name'])
|
347 |
{
|
348 |
-
|
349 |
-
|
|
|
|
|
|
|
350 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
}
|
352 |
-
$auth_id = uniqid('wpvivid-auth-');
|
353 |
-
$state = admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_dropbox_finish_auth&name=' . $_GET['name'] . '&bdefault=' . $_GET['bdefault'].'&auth_id='.$auth_id;
|
354 |
-
$url = Dropbox_Base::getUrl($this->redirect_url, $state);
|
355 |
-
header('Location: ' . filter_var($url, FILTER_SANITIZE_URL));
|
356 |
-
}
|
357 |
-
catch (Exception $e){
|
358 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
359 |
}
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
}
|
370 |
-
|
371 |
-
|
372 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive&result=error&resp_msg=' . 'Get Dropbox token failed.');
|
373 |
-
} else {
|
374 |
-
global $wpvivid_plugin;
|
375 |
-
$remote_options['type'] = WPVIVID_REMOTE_DROPBOX;
|
376 |
-
$remote_options['access_token']= $_POST['code'];
|
377 |
-
$remote_options['expires_in'] = $_POST['expires_in'];
|
378 |
-
$remote_options['refresh_token'] = $_POST['refresh_token'];
|
379 |
-
$remote_options['created']=time();
|
380 |
-
$remote_options['name'] = $_GET['name'];
|
381 |
-
$remote_options['path'] = WPVIVID_DROPBOX_DEFAULT_FOLDER;
|
382 |
-
$remote_options['default'] = $_GET['bdefault'];
|
383 |
-
$remote_options['auth_id'] = $_GET['auth_id'];
|
384 |
-
$ret = $wpvivid_plugin->remote_collection->add_remote($remote_options);
|
385 |
-
if ($ret['result'] == 'success') {
|
386 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive&result=success');
|
387 |
-
return;
|
388 |
} else {
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
}
|
392 |
}
|
|
|
|
|
|
|
393 |
}
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_dropbox_success'));
|
404 |
-
} else if ($_GET['result'] == 'error') {
|
405 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_dropbox_error'));
|
406 |
}
|
407 |
}
|
408 |
-
|
409 |
-
|
410 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
411 |
-
}
|
412 |
-
}
|
413 |
-
else if($_GET['action'] === 'wpvivid_dropbox_update_auth')
|
414 |
-
{
|
415 |
-
try {
|
416 |
-
if (!isset($_GET['name']) || empty($_GET['name'])) {
|
417 |
-
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
418 |
-
return;
|
419 |
}
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
427 |
return;
|
428 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
}
|
430 |
-
$state = admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_dropbox_finish_update_auth&name=' . $_GET['name'] . '&id=' . $_GET['id'].'&auth_id='.$auth_id;
|
431 |
-
$url = Dropbox_Base::getUrl($this->redirect_url, $state);
|
432 |
-
header('Location: ' . filter_var($url, FILTER_SANITIZE_URL));
|
433 |
-
}
|
434 |
-
catch (Exception $e){
|
435 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
436 |
}
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
}
|
447 |
-
|
448 |
-
|
449 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive_update&result=error&resp_msg=' . 'Get Dropbox token failed.');
|
450 |
-
} else {
|
451 |
-
global $wpvivid_plugin;
|
452 |
-
$remote_options['type'] = WPVIVID_REMOTE_DROPBOX;
|
453 |
-
$remote_options['access_token']= $_POST['code'];
|
454 |
-
$remote_options['expires_in'] = $_POST['expires_in'];
|
455 |
-
$remote_options['refresh_token'] = $_POST['refresh_token'];
|
456 |
-
$remote_options['created']=time();
|
457 |
-
$remote_options['name'] = $_GET['name'];
|
458 |
-
$remote_options['path'] = WPVIVID_DROPBOX_DEFAULT_FOLDER;
|
459 |
-
$remote_options['auth_id'] = $_GET['auth_id'];
|
460 |
-
$ret = $wpvivid_plugin->remote_collection->update_remote($_GET['id'], $remote_options);
|
461 |
-
if ($ret['result'] == 'success') {
|
462 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive_update&result=success');
|
463 |
-
return;
|
464 |
} else {
|
465 |
-
|
466 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
}
|
468 |
}
|
|
|
|
|
|
|
469 |
}
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_dropbox_success'));
|
480 |
-
} else if ($_GET['result'] == 'error') {
|
481 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_dropbox_error'));
|
482 |
}
|
483 |
}
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
}
|
488 |
}
|
489 |
}
|
327 |
|
328 |
public function handle_auth_actions()
|
329 |
{
|
330 |
+
if(isset($_GET['action']) && isset($_GET['page']))
|
331 |
{
|
332 |
+
if($_GET['page'] === 'WPvivid')
|
333 |
{
|
334 |
+
if($_GET['action'] === 'wpvivid_dropbox_auth')
|
335 |
+
{
|
336 |
+
try {
|
337 |
+
if (!isset($_GET['name']) || empty($_GET['name']))
|
338 |
+
{
|
339 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
340 |
+
return;
|
341 |
+
}
|
342 |
|
343 |
+
$alias_name = sanitize_text_field($_GET['name']);
|
344 |
|
345 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
346 |
+
foreach ($remoteslist as $key => $value)
|
|
|
|
|
347 |
{
|
348 |
+
if (isset($value['name']) && $value['name'] == $alias_name)
|
349 |
+
{
|
350 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
351 |
+
return;
|
352 |
+
}
|
353 |
}
|
354 |
+
$default = sanitize_text_field($_GET['bdefault']);
|
355 |
+
$auth_id = uniqid('wpvivid-auth-');
|
356 |
+
$state = admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_dropbox_finish_auth&name=' . $alias_name . '&bdefault=' . $default.'&auth_id='.$auth_id;
|
357 |
+
$url = Dropbox_Base::getUrl($this->redirect_url, $state);
|
358 |
+
header('Location: ' . filter_var($url, FILTER_SANITIZE_URL));
|
359 |
+
}
|
360 |
+
catch (Exception $e){
|
361 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
362 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
}
|
364 |
+
else if($_GET['action'] === 'wpvivid_dropbox_finish_auth')
|
365 |
+
{
|
366 |
+
try {
|
367 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
368 |
+
foreach ($remoteslist as $key => $value) {
|
369 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
370 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have authenticated the Dropbox account as your remote storage.</p></div>');
|
371 |
+
return;
|
372 |
+
}
|
373 |
}
|
374 |
+
if (!isset($_POST['code'])) {
|
375 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive&result=error&resp_msg=' . 'Get Dropbox token failed.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
} else {
|
377 |
+
global $wpvivid_plugin;
|
378 |
+
$remote_options['type'] = WPVIVID_REMOTE_DROPBOX;
|
379 |
+
$remote_options['access_token']= sanitize_text_field($_POST['code']);
|
380 |
+
$remote_options['expires_in'] = sanitize_text_field($_POST['expires_in']);
|
381 |
+
$remote_options['refresh_token'] = sanitize_text_field($_POST['refresh_token']);
|
382 |
+
$remote_options['created']=time();
|
383 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
384 |
+
$remote_options['path'] = WPVIVID_DROPBOX_DEFAULT_FOLDER;
|
385 |
+
$remote_options['default'] = sanitize_text_field($_GET['bdefault']);
|
386 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
387 |
+
$ret = $wpvivid_plugin->remote_collection->add_remote($remote_options);
|
388 |
+
if ($ret['result'] == 'success') {
|
389 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive&result=success');
|
390 |
+
return;
|
391 |
+
} else {
|
392 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive&result=error&resp_msg=' . $ret['error']);
|
393 |
+
return;
|
394 |
+
}
|
395 |
}
|
396 |
}
|
397 |
+
catch (Exception $e){
|
398 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
399 |
+
}
|
400 |
}
|
401 |
+
else if($_GET['action']=='wpvivid_dropbox_drive')
|
402 |
+
{
|
403 |
+
try {
|
404 |
+
if (isset($_GET['result'])) {
|
405 |
+
if ($_GET['result'] == 'success') {
|
406 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_dropbox_success'));
|
407 |
+
} else if ($_GET['result'] == 'error') {
|
408 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_dropbox_error'));
|
409 |
+
}
|
|
|
|
|
|
|
410 |
}
|
411 |
}
|
412 |
+
catch (Exception $e){
|
413 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
}
|
415 |
+
}
|
416 |
+
else if($_GET['action'] === 'wpvivid_dropbox_update_auth')
|
417 |
+
{
|
418 |
+
try {
|
419 |
+
if (!isset($_GET['name']) || empty($_GET['name'])) {
|
420 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
|
|
421 |
return;
|
422 |
}
|
423 |
+
|
424 |
+
$alias_name = sanitize_text_field($_GET['name']);
|
425 |
+
$id = sanitize_text_field($_GET['id']);
|
426 |
+
$auth_id = uniqid('wpvivid-auth-');
|
427 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
428 |
+
foreach ($remoteslist as $key => $value) {
|
429 |
+
if (isset($value['name']) && $value['name'] == $alias_name && $key != $id) {
|
430 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
431 |
+
return;
|
432 |
+
}
|
433 |
+
}
|
434 |
+
$state = admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_dropbox_finish_update_auth&name=' . $alias_name . '&id=' . $id.'&auth_id='.$auth_id;
|
435 |
+
$url = Dropbox_Base::getUrl($this->redirect_url, $state);
|
436 |
+
header('Location: ' . filter_var($url, FILTER_SANITIZE_URL));
|
437 |
+
}
|
438 |
+
catch (Exception $e){
|
439 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
440 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
}
|
442 |
+
else if($_GET['action'] === 'wpvivid_dropbox_finish_update_auth')
|
443 |
+
{
|
444 |
+
try {
|
445 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
446 |
+
foreach ($remoteslist as $key => $value) {
|
447 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
448 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have successfully updated the storage alias.</p></div>');
|
449 |
+
return;
|
450 |
+
}
|
451 |
}
|
452 |
+
if (!isset($_POST['code'])) {
|
453 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive_update&result=error&resp_msg=' . 'Get Dropbox token failed.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
} else {
|
455 |
+
global $wpvivid_plugin;
|
456 |
+
$remote_options['type'] = WPVIVID_REMOTE_DROPBOX;
|
457 |
+
$remote_options['access_token']= sanitize_text_field($_POST['code']);
|
458 |
+
$remote_options['expires_in'] = sanitize_text_field($_POST['expires_in']);
|
459 |
+
$remote_options['refresh_token'] = sanitize_text_field($_POST['refresh_token']);
|
460 |
+
$remote_options['created']=time();
|
461 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
462 |
+
$remote_options['path'] = WPVIVID_DROPBOX_DEFAULT_FOLDER;
|
463 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
464 |
+
$ret = $wpvivid_plugin->remote_collection->update_remote($remote_options['auth_id'], $remote_options);
|
465 |
+
if ($ret['result'] == 'success') {
|
466 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive_update&result=success');
|
467 |
+
return;
|
468 |
+
} else {
|
469 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_dropbox_drive_update&result=error&resp_msg=' . $ret['error']);
|
470 |
+
return;
|
471 |
+
}
|
472 |
}
|
473 |
}
|
474 |
+
catch (Exception $e){
|
475 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
476 |
+
}
|
477 |
}
|
478 |
+
else if($_GET['action']=='wpvivid_dropbox_drive_update')
|
479 |
+
{
|
480 |
+
try {
|
481 |
+
if (isset($_GET['result'])) {
|
482 |
+
if ($_GET['result'] == 'success') {
|
483 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_dropbox_success'));
|
484 |
+
} else if ($_GET['result'] == 'error') {
|
485 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_dropbox_error'));
|
486 |
+
}
|
|
|
|
|
|
|
487 |
}
|
488 |
}
|
489 |
+
catch (Exception $e){
|
490 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
491 |
+
}
|
492 |
}
|
493 |
}
|
494 |
}
|
includes/customclass/class-wpvivid-google-drive.php
CHANGED
@@ -69,226 +69,233 @@ class Wpvivid_Google_drive extends WPvivid_Remote
|
|
69 |
|
70 |
public function handle_auth_actions()
|
71 |
{
|
72 |
-
if (isset($_GET['action']))
|
73 |
{
|
74 |
-
if($_GET['
|
75 |
{
|
76 |
-
if(
|
77 |
{
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
81 |
|
82 |
-
|
83 |
-
|
|
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
{
|
88 |
-
if(isset($value['name'])&&$value['name'] == $_GET['name'])
|
89 |
{
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
92 |
}
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
return ;
|
98 |
-
}
|
99 |
-
try {
|
100 |
-
include_once WPVIVID_PLUGIN_DIR . '/vendor/autoload.php';
|
101 |
-
$client = new Google_Client();
|
102 |
-
$client->setAuthConfig($this->google_drive_secrets);
|
103 |
-
$client->setApprovalPrompt('force');
|
104 |
-
$client->addScope(Google_Service_Drive::DRIVE_FILE);
|
105 |
-
$client->setAccessType('offline');
|
106 |
-
$client->setState(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_google_drive_finish_auth&name=' . $_GET['name'] . '&default=' . $_GET['default'].'&auth_id='.$auth_id);
|
107 |
-
$auth_url = $client->createAuthUrl();
|
108 |
-
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
|
109 |
-
}
|
110 |
-
catch (Exception $e){
|
111 |
-
if($e->getMessage() === 'file does not exist'){
|
112 |
-
$error_msg = __('Authentication failed, the client_secrets.json file is missing. Please make sure the client_secrets.json file is in wpvivid-backuprestore\includes\customclass directory.', 'wpvivid-backuprestore');
|
113 |
-
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
114 |
}
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
}
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
130 |
|
131 |
-
return;
|
132 |
-
}
|
133 |
-
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
134 |
-
foreach ($remoteslist as $key => $value) {
|
135 |
-
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == $_GET['auth_id']) {
|
136 |
-
_e('<div class="notice notice-success is-dismissible"><p>You have authenticated the Google Drive account as your remote storage.</p></div>');
|
137 |
return;
|
138 |
}
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
-
|
146 |
-
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
}
|
170 |
-
}
|
171 |
-
catch (Exception $e){
|
172 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
173 |
-
}
|
174 |
-
}
|
175 |
-
else if($_GET['action']=='wpvivid_google_drive')
|
176 |
-
{
|
177 |
-
try {
|
178 |
-
if (isset($_GET['result'])) {
|
179 |
-
if ($_GET['result'] == 'success') {
|
180 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_google_drive_success'));
|
181 |
-
} else if ($_GET['result'] == 'error') {
|
182 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_google_drive_error'));
|
183 |
}
|
184 |
}
|
|
|
|
|
|
|
185 |
}
|
186 |
-
|
187 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
188 |
-
}
|
189 |
-
}
|
190 |
-
else if($_GET['action']=='wpvivid_google_drive_update_auth')
|
191 |
-
{
|
192 |
-
if(!isset($_GET['name'])||empty($_GET['name']))
|
193 |
{
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
}
|
197 |
-
|
198 |
-
$_GET['name']=sanitize_text_field($_GET['name']);
|
199 |
-
$auth_id = uniqid('wpvivid-auth-');
|
200 |
-
|
201 |
-
$remoteslist=WPvivid_Setting::get_all_remote_options();
|
202 |
-
foreach ($remoteslist as $key=>$value)
|
203 |
{
|
204 |
-
if(isset($
|
205 |
{
|
206 |
-
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning:
|
207 |
return;
|
208 |
}
|
209 |
-
}
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
$
|
214 |
-
|
215 |
-
$
|
216 |
-
$
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
if($e->getMessage() === 'file does not exist'){
|
224 |
-
$error_msg = __('Authentication failed, the client_secrets.json file is missing. Please make sure the client_secrets.json file is in wpvivid-backuprestore\includes\customclass directory.', 'wpvivid-backuprestore');
|
225 |
-
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
226 |
}
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
}
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
header('Location: '.admin_url().'admin.php?page='.WPVIVID_PLUGIN_SLUG.'&action=wpvivid_google_drive_update&result=error&resp_msg='.$_GET['error']);
|
242 |
|
243 |
-
return;
|
244 |
-
}
|
245 |
-
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
246 |
-
foreach ($remoteslist as $key => $value) {
|
247 |
-
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == $_GET['auth_id']) {
|
248 |
-
_e('<div class="notice notice-success is-dismissible"><p>You have successfully updated the storage alias.</p></div>');
|
249 |
return;
|
250 |
}
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
273 |
}
|
274 |
}
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_google_drive_success'));
|
285 |
-
} else if ($_GET['result'] == 'error') {
|
286 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_google_drive_error'));
|
287 |
}
|
288 |
}
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
}
|
293 |
}
|
294 |
}
|
69 |
|
70 |
public function handle_auth_actions()
|
71 |
{
|
72 |
+
if (isset($_GET['action']) && isset($_GET['page']))
|
73 |
{
|
74 |
+
if($_GET['page'] === 'WPvivid')
|
75 |
{
|
76 |
+
if($_GET['action']=='wpvivid_google_drive_auth')
|
77 |
{
|
78 |
+
if(!isset($_GET['name'])||empty($_GET['name']))
|
79 |
+
{
|
80 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
81 |
+
return;
|
82 |
+
}
|
83 |
|
84 |
+
$alias_name=sanitize_text_field($_GET['name']);
|
85 |
+
$auth_id = uniqid('wpvivid-auth-');
|
86 |
+
$default = sanitize_text_field($_GET['default']);
|
87 |
|
88 |
+
$remoteslist=WPvivid_Setting::get_all_remote_options();
|
89 |
+
foreach ($remoteslist as $key=>$value)
|
|
|
|
|
90 |
{
|
91 |
+
if(isset($value['name'])&&$value['name'] == $alias_name)
|
92 |
+
{
|
93 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
94 |
+
return;
|
95 |
+
}
|
96 |
}
|
97 |
+
$res = $this -> compare_php_version();
|
98 |
+
if($res['result'] == WPVIVID_FAILED){
|
99 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.$res['error'].'</p></div>';
|
100 |
+
return ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
+
try {
|
103 |
+
include_once WPVIVID_PLUGIN_DIR . '/vendor/autoload.php';
|
104 |
+
$client = new Google_Client();
|
105 |
+
$client->setAuthConfig($this->google_drive_secrets);
|
106 |
+
$client->setApprovalPrompt('force');
|
107 |
+
$client->addScope(Google_Service_Drive::DRIVE_FILE);
|
108 |
+
$client->setAccessType('offline');
|
109 |
+
$client->setState(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_google_drive_finish_auth&name=' . $alias_name . '&default=' . $default.'&auth_id='.$auth_id);
|
110 |
+
$auth_url = $client->createAuthUrl();
|
111 |
+
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
|
112 |
}
|
113 |
+
catch (Exception $e){
|
114 |
+
if($e->getMessage() === 'file does not exist'){
|
115 |
+
$error_msg = __('Authentication failed, the client_secrets.json file is missing. Please make sure the client_secrets.json file is in wpvivid-backuprestore\includes\customclass directory.', 'wpvivid-backuprestore');
|
116 |
+
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
117 |
+
}
|
118 |
+
else if($e->getMessage() === 'invalid json for auth config'){
|
119 |
+
$error_msg = __('Authentication failed, the format of the client_secrets.json file is incorrect. Please delete and re-install the plugin to recreate the file.', 'wpvivid-backuprestore');
|
120 |
+
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
121 |
+
}
|
122 |
+
else{
|
123 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
124 |
+
}
|
125 |
}
|
126 |
}
|
127 |
+
else if($_GET['action']=='wpvivid_google_drive_finish_auth')
|
128 |
+
{
|
129 |
+
file_put_contents('D:\page.txt', json_encode($_GET));
|
130 |
+
try {
|
131 |
+
|
132 |
+
if(isset($_GET['error']))
|
133 |
+
{
|
134 |
+
header('Location: '.admin_url().'admin.php?page='.WPVIVID_PLUGIN_SLUG.'&action=wpvivid_google_drive&result=error&resp_msg='.sanitize_text_field($_GET['error']));
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
return;
|
137 |
}
|
138 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
139 |
+
foreach ($remoteslist as $key => $value) {
|
140 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
141 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have authenticated the Google Drive account as your remote storage.</p></div>');
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
if(isset($_POST) && !empty($_POST) && !isset($_POST['refresh_token']))
|
146 |
+
{
|
147 |
+
$err = 'No refresh token was received from Google, which means that you entered client secret incorrectly, or that you did not re-authenticated yet after you corrected it. Please authenticate again.';
|
148 |
+
header('Location: '.admin_url().'admin.php?page='.WPVIVID_PLUGIN_SLUG.'&action=wpvivid_google_drive&result=error&resp_msg='.$err);
|
149 |
|
150 |
+
return;
|
151 |
+
}
|
152 |
|
153 |
+
global $wpvivid_plugin;
|
154 |
+
|
155 |
+
$remote_options['type'] = WPVIVID_REMOTE_GOOGLEDRIVE;
|
156 |
+
$remote_options['token']['access_token'] = sanitize_text_field($_POST['access_token']);
|
157 |
+
$remote_options['token']['expires_in'] = sanitize_text_field($_POST['expires_in']);
|
158 |
+
$remote_options['token']['refresh_token'] = sanitize_text_field($_POST['refresh_token']);
|
159 |
+
$remote_options['token']['scope'] = sanitize_text_field($_POST['scope']);
|
160 |
+
$remote_options['token']['token_type'] = sanitize_text_field($_POST['token_type']);
|
161 |
+
$remote_options['token']['created'] = sanitize_text_field($_POST['created']);
|
162 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
163 |
+
$remote_options['default'] = sanitize_text_field($_GET['default']);
|
164 |
+
$remote_options['path'] = WPVIVID_GOOGLEDRIVE_DEFAULT_FOLDER;
|
165 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
166 |
+
$ret = $wpvivid_plugin->remote_collection->add_remote($remote_options);
|
167 |
+
|
168 |
+
if ($ret['result'] == 'success') {
|
169 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_google_drive&result=success');
|
170 |
+
return;
|
171 |
+
} else {
|
172 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_google_drive&result=error&resp_msg=' . $ret['error']);
|
173 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
}
|
176 |
+
catch (Exception $e){
|
177 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
178 |
+
}
|
179 |
}
|
180 |
+
else if($_GET['action']=='wpvivid_google_drive')
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
{
|
182 |
+
try {
|
183 |
+
if (isset($_GET['result'])) {
|
184 |
+
if ($_GET['result'] == 'success') {
|
185 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_google_drive_success'));
|
186 |
+
} else if ($_GET['result'] == 'error') {
|
187 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_google_drive_error'));
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
catch (Exception $e){
|
192 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
193 |
+
}
|
194 |
}
|
195 |
+
else if($_GET['action']=='wpvivid_google_drive_update_auth')
|
|
|
|
|
|
|
|
|
|
|
196 |
{
|
197 |
+
if(!isset($_GET['name'])||empty($_GET['name']))
|
198 |
{
|
199 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
200 |
return;
|
201 |
}
|
|
|
202 |
|
203 |
+
$alias_name=sanitize_text_field($_GET['name']);
|
204 |
+
$id = sanitize_text_field($_GET['id']);
|
205 |
+
$auth_id = uniqid('wpvivid-auth-');
|
206 |
+
|
207 |
+
$remoteslist=WPvivid_Setting::get_all_remote_options();
|
208 |
+
foreach ($remoteslist as $key=>$value)
|
209 |
+
{
|
210 |
+
if(isset($value['name'])&&$value['name'] == $alias_name&&$key!=$id)
|
211 |
+
{
|
212 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
213 |
+
return;
|
214 |
+
}
|
|
|
|
|
|
|
215 |
}
|
216 |
+
|
217 |
+
try {
|
218 |
+
include_once WPVIVID_PLUGIN_DIR . '/vendor/autoload.php';
|
219 |
+
$client = new Google_Client();
|
220 |
+
$client->setAuthConfig($this->google_drive_secrets);
|
221 |
+
$client->setApprovalPrompt('force');
|
222 |
+
$client->addScope(Google_Service_Drive::DRIVE_FILE);
|
223 |
+
$client->setAccessType('offline');
|
224 |
+
$client->setState(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_google_drive_finish_update_auth&name=' . $alias_name . '&id=' . $id.'&auth_id='.$auth_id);
|
225 |
+
$auth_url = $client->createAuthUrl();
|
226 |
+
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
|
227 |
}
|
228 |
+
catch (Exception $e){
|
229 |
+
if($e->getMessage() === 'file does not exist'){
|
230 |
+
$error_msg = __('Authentication failed, the client_secrets.json file is missing. Please make sure the client_secrets.json file is in wpvivid-backuprestore\includes\customclass directory.', 'wpvivid-backuprestore');
|
231 |
+
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
232 |
+
}
|
233 |
+
else if($e->getMessage() === 'invalid json for auth config'){
|
234 |
+
$error_msg = __('Authentication failed, the format of the client_secrets.json file is incorrect. Please delete and re-install the plugin to recreate the file.', 'wpvivid-backuprestore');
|
235 |
+
echo '<div class="notice notice-error"><p>'.$error_msg.'</p></div>';
|
236 |
+
}
|
237 |
+
else{
|
238 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
239 |
+
}
|
240 |
}
|
241 |
}
|
242 |
+
else if($_GET['action']=='wpvivid_google_drive_finish_update_auth')
|
243 |
+
{
|
244 |
+
try {
|
245 |
+
if(isset($_GET['error']))
|
246 |
+
{
|
247 |
+
header('Location: '.admin_url().'admin.php?page='.WPVIVID_PLUGIN_SLUG.'&action=wpvivid_google_drive_update&result=error&resp_msg='.sanitize_text_field($_GET['error']));
|
|
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
return;
|
250 |
}
|
251 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
252 |
+
foreach ($remoteslist as $key => $value) {
|
253 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
254 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have successfully updated the storage alias.</p></div>');
|
255 |
+
return;
|
256 |
+
}
|
257 |
+
}
|
258 |
|
259 |
+
global $wpvivid_plugin;
|
260 |
+
|
261 |
+
$remote_options['type'] = WPVIVID_REMOTE_GOOGLEDRIVE;
|
262 |
+
$remote_options['token']['access_token'] = sanitize_text_field($_POST['access_token']);
|
263 |
+
$remote_options['token']['expires_in'] = sanitize_text_field($_POST['expires_in']);
|
264 |
+
$remote_options['token']['refresh_token'] = sanitize_text_field($_POST['refresh_token']);
|
265 |
+
$remote_options['token']['scope'] = sanitize_text_field($_POST['scope']);
|
266 |
+
$remote_options['token']['token_type'] = sanitize_text_field($_POST['token_type']);
|
267 |
+
$remote_options['token']['created'] = sanitize_text_field($_POST['created']);
|
268 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
269 |
+
$remote_options['path'] = WPVIVID_GOOGLEDRIVE_DEFAULT_FOLDER;
|
270 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
271 |
+
$ret = $wpvivid_plugin->remote_collection->update_remote($remote_options['auth_id'], $remote_options);
|
272 |
+
|
273 |
+
if ($ret['result'] == 'success') {
|
274 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_google_drive_update&result=success');
|
275 |
+
return;
|
276 |
+
} else {
|
277 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_google_drive_update&result=error&resp_msg=' . $ret['error']);
|
278 |
+
return;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
catch (Exception $e){
|
282 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
283 |
}
|
284 |
}
|
285 |
+
else if($_GET['action']=='wpvivid_google_drive_update')
|
286 |
+
{
|
287 |
+
try {
|
288 |
+
if (isset($_GET['result'])) {
|
289 |
+
if ($_GET['result'] == 'success') {
|
290 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_google_drive_success'));
|
291 |
+
} else if ($_GET['result'] == 'error') {
|
292 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_google_drive_error'));
|
293 |
+
}
|
|
|
|
|
|
|
294 |
}
|
295 |
}
|
296 |
+
catch (Exception $e){
|
297 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
298 |
+
}
|
299 |
}
|
300 |
}
|
301 |
}
|
includes/customclass/class-wpvivid-one-drive.php
CHANGED
@@ -71,196 +71,192 @@ class WPvivid_one_drive extends WPvivid_Remote
|
|
71 |
|
72 |
public function handle_auth_actions()
|
73 |
{
|
74 |
-
if (isset($_GET['action']))
|
75 |
{
|
76 |
-
if($_GET['
|
77 |
{
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
|
|
|
|
83 |
|
84 |
-
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
91 |
}
|
92 |
-
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
109 |
}
|
110 |
-
|
111 |
-
else if($_GET['action']=='wpvivid_one_drive_finish_auth')
|
112 |
-
{
|
113 |
-
try
|
114 |
{
|
115 |
-
|
116 |
{
|
117 |
-
$
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
|
|
|
|
128 |
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
return;
|
134 |
}
|
135 |
}
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
$remote_options['type'] = WPVIVID_REMOTE_ONEDRIVE;
|
140 |
-
$remote_options['token']['access_token']=$_POST['access_token'];
|
141 |
-
$remote_options['token']['refresh_token']=$_POST['refresh_token'];
|
142 |
-
$remote_options['token']['expires']=time()+$_POST['expires_in'];
|
143 |
-
|
144 |
-
$remote_options['name'] = $_GET['name'];
|
145 |
-
$remote_options['default'] = $_GET['default'];
|
146 |
-
$remote_options['path'] = WPVIVID_ONEDRIVE_DEFAULT_FOLDER;
|
147 |
-
$remote_options['auth_id'] = $_GET['auth_id'];
|
148 |
-
$ret = $wpvivid_plugin->remote_collection->add_remote($remote_options);
|
149 |
-
|
150 |
-
if ($ret['result'] == 'success') {
|
151 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive&result=success');
|
152 |
-
return;
|
153 |
-
} else {
|
154 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive&result=error&resp_msg=' . $ret['error']);
|
155 |
-
return;
|
156 |
}
|
157 |
}
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_onedrive_success'));
|
168 |
-
} else if ($_GET['result'] == 'error') {
|
169 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_add_onedrive_error'));
|
170 |
}
|
171 |
}
|
|
|
|
|
|
|
172 |
}
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
-
$alias_name = sanitize_text_field($_GET['name']);
|
186 |
-
$id = sanitize_text_field($_GET['id']);
|
187 |
-
$auth_id = uniqid('wpvivid-auth-');
|
188 |
-
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
189 |
-
foreach ($remoteslist as $key => $value) {
|
190 |
-
if (isset($value['name']) && $value['name'] == $alias_name && $key != $id) {
|
191 |
-
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
192 |
return;
|
193 |
}
|
194 |
-
}
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
. '&locale=en';
|
204 |
-
header('Location: ' . esc_url_raw($url));
|
205 |
-
}
|
206 |
-
catch (Exception $e){
|
207 |
-
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
208 |
-
}
|
209 |
-
}
|
210 |
-
else if($_GET['action']=='wpvivid_one_drive_update_finish_auth')
|
211 |
-
{
|
212 |
-
try {
|
213 |
-
if (isset($_GET['auth_error'])) {
|
214 |
-
$error = urldecode($_GET['auth_error']);
|
215 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=error&resp_msg=' . $error);
|
216 |
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
224 |
return;
|
225 |
}
|
226 |
}
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
$remote_options['type'] = WPVIVID_REMOTE_ONEDRIVE;
|
231 |
-
$remote_options['token']['access_token']=$_POST['access_token'];
|
232 |
-
$remote_options['token']['refresh_token']=$_POST['refresh_token'];
|
233 |
-
$remote_options['token']['expires']=time()+$_POST['expires_in'];
|
234 |
-
$remote_options['name'] = $_GET['name'];
|
235 |
-
$remote_options['path'] = WPVIVID_ONEDRIVE_DEFAULT_FOLDER;
|
236 |
-
$remote_options['auth_id'] = $_GET['auth_id'];
|
237 |
-
$ret = $wpvivid_plugin->remote_collection->update_remote($_GET['id'], $remote_options);
|
238 |
-
|
239 |
-
if ($ret['result'] == 'success') {
|
240 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=success');
|
241 |
-
return;
|
242 |
-
} else {
|
243 |
-
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=error&resp_msg=' . $ret['error']);
|
244 |
-
return;
|
245 |
}
|
246 |
}
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_onedrive_success'));
|
257 |
-
} else if ($_GET['result'] == 'error') {
|
258 |
-
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_onedrive_error'));
|
259 |
}
|
260 |
}
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
}
|
265 |
}
|
266 |
}
|
71 |
|
72 |
public function handle_auth_actions()
|
73 |
{
|
74 |
+
if (isset($_GET['action']) && isset($_GET['page']))
|
75 |
{
|
76 |
+
if($_GET['page'] === 'WPvivid')
|
77 |
{
|
78 |
+
if($_GET['action']=='wpvivid_one_drive_auth')
|
79 |
+
{
|
80 |
+
try {
|
81 |
+
if (!isset($_GET['name']) || empty($_GET['name'])) {
|
82 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
83 |
+
return;
|
84 |
+
}
|
85 |
|
86 |
+
$alias_name = sanitize_text_field($_GET['name']);
|
87 |
|
88 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
89 |
+
foreach ($remoteslist as $key => $value) {
|
90 |
+
if (isset($value['name']) && $value['name'] == $alias_name) {
|
91 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
92 |
+
return;
|
93 |
+
}
|
94 |
}
|
|
|
95 |
|
96 |
+
$default = sanitize_text_field($_GET['default']);
|
97 |
+
$auth_id = uniqid('wpvivid-auth-');
|
98 |
+
|
99 |
+
$url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'
|
100 |
+
. '?client_id=' . urlencode('37668be9-b55f-458f-b6a3-97e6f8aa10c9')
|
101 |
+
. '&scope=' . urlencode('offline_access files.readwrite')
|
102 |
+
. '&response_type=code'
|
103 |
+
. '&redirect_uri=' . urlencode('https://auth.wpvivid.com/onedrive_v2/')
|
104 |
+
. '&state=' . urlencode(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_one_drive_finish_auth&name='.$alias_name.'&default='.$default.'&auth_id='.$auth_id)
|
105 |
+
. '&display=popup'
|
106 |
+
. '&locale=en';
|
107 |
+
header('Location: ' . esc_url_raw($url));
|
108 |
+
}
|
109 |
+
catch (Exception $e){
|
110 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
111 |
+
}
|
112 |
}
|
113 |
+
else if($_GET['action']=='wpvivid_one_drive_finish_auth')
|
|
|
|
|
|
|
114 |
{
|
115 |
+
try
|
116 |
{
|
117 |
+
if (isset($_GET['auth_error']))
|
118 |
+
{
|
119 |
+
$error = urldecode($_GET['auth_error']);
|
120 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive&result=error&resp_msg=' . $error);
|
121 |
+
return;
|
122 |
+
}
|
123 |
|
124 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
125 |
+
foreach ($remoteslist as $key => $value) {
|
126 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
127 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have authenticated the Microsoft OneDrive account as your remote storage.</p></div>');
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
global $wpvivid_plugin;
|
133 |
|
134 |
+
$remote_options['type'] = WPVIVID_REMOTE_ONEDRIVE;
|
135 |
+
$remote_options['token']['access_token']=sanitize_text_field($_POST['access_token']);
|
136 |
+
$remote_options['token']['refresh_token']=sanitize_text_field($_POST['refresh_token']);
|
137 |
+
$remote_options['token']['expires']=time()+sanitize_text_field($_POST['expires_in']);
|
138 |
+
|
139 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
140 |
+
$remote_options['default'] = sanitize_text_field($_GET['default']);
|
141 |
+
$remote_options['path'] = WPVIVID_ONEDRIVE_DEFAULT_FOLDER;
|
142 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
143 |
+
$ret = $wpvivid_plugin->remote_collection->add_remote($remote_options);
|
144 |
+
|
145 |
+
if ($ret['result'] == 'success') {
|
146 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive&result=success');
|
147 |
+
return;
|
148 |
+
} else {
|
149 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive&result=error&resp_msg=' . $ret['error']);
|
150 |
return;
|
151 |
}
|
152 |
}
|
153 |
+
catch (Exception $e){
|
154 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
}
|
157 |
+
else if($_GET['action']=='wpvivid_one_drive')
|
158 |
+
{
|
159 |
+
try {
|
160 |
+
if (isset($_GET['result'])) {
|
161 |
+
if ($_GET['result'] == 'success') {
|
162 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_onedrive_success'));
|
163 |
+
} else if ($_GET['result'] == 'error') {
|
164 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_add_onedrive_error'));
|
165 |
+
}
|
|
|
|
|
|
|
166 |
}
|
167 |
}
|
168 |
+
catch (Exception $e){
|
169 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
170 |
+
}
|
171 |
}
|
172 |
+
else if($_GET['action']=='wpvivid_one_drive_update_auth')
|
173 |
+
{
|
174 |
+
try {
|
175 |
+
if (!isset($_GET['name']) || empty($_GET['name'])) {
|
176 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: An alias for remote storage is required.', 'wpvivid-backuprestore').'</p></div>';
|
177 |
+
return;
|
178 |
+
}
|
179 |
+
|
180 |
+
$alias_name = sanitize_text_field($_GET['name']);
|
181 |
+
$id = sanitize_text_field($_GET['id']);
|
182 |
+
$auth_id = uniqid('wpvivid-auth-');
|
183 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
184 |
+
foreach ($remoteslist as $key => $value) {
|
185 |
+
if (isset($value['name']) && $value['name'] == $alias_name && $key != $id) {
|
186 |
+
echo '<div class="notice notice-warning is-dismissible"><p>'.__('Warning: The alias already exists in storage list.', 'wpvivid-backuprestore').'</p></div>';
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
$url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'
|
192 |
+
. '?client_id=' . urlencode('37668be9-b55f-458f-b6a3-97e6f8aa10c9')
|
193 |
+
. '&scope=' . urlencode('offline_access files.readwrite')
|
194 |
+
. '&response_type=code'
|
195 |
+
. '&redirect_uri=' . urlencode('https://auth.wpvivid.com/onedrive_v2/')
|
196 |
+
. '&state=' . urlencode(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_one_drive_update_finish_auth&name='.$alias_name.'&id='.$id.'&auth_id='.$auth_id)
|
197 |
+
. '&display=popup'
|
198 |
+
. '&locale=en';
|
199 |
+
header('Location: ' . esc_url_raw($url));
|
200 |
+
}
|
201 |
+
catch (Exception $e){
|
202 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
203 |
}
|
204 |
+
}
|
205 |
+
else if($_GET['action']=='wpvivid_one_drive_update_finish_auth')
|
206 |
+
{
|
207 |
+
try {
|
208 |
+
if (isset($_GET['auth_error'])) {
|
209 |
+
$error = urldecode($_GET['auth_error']);
|
210 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=error&resp_msg=' . $error);
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
return;
|
213 |
}
|
|
|
214 |
|
215 |
+
$remoteslist = WPvivid_Setting::get_all_remote_options();
|
216 |
+
foreach ($remoteslist as $key => $value) {
|
217 |
+
if (isset($value['auth_id']) && isset($_GET['auth_id']) && $value['auth_id'] == sanitize_text_field($_GET['auth_id'])) {
|
218 |
+
_e('<div class="notice notice-success is-dismissible"><p>You have successfully updated the storage alias.</p></div>');
|
219 |
+
return;
|
220 |
+
}
|
221 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
+
global $wpvivid_plugin;
|
224 |
+
|
225 |
+
$remote_options['type'] = WPVIVID_REMOTE_ONEDRIVE;
|
226 |
+
$remote_options['token']['access_token']=sanitize_text_field($_POST['access_token']);
|
227 |
+
$remote_options['token']['refresh_token']=sanitize_text_field($_POST['refresh_token']);
|
228 |
+
$remote_options['token']['expires']=time()+sanitize_text_field($_POST['expires_in']);
|
229 |
+
$remote_options['name'] = sanitize_text_field($_GET['name']);
|
230 |
+
$remote_options['path'] = WPVIVID_ONEDRIVE_DEFAULT_FOLDER;
|
231 |
+
$remote_options['auth_id'] = sanitize_text_field($_GET['auth_id']);
|
232 |
+
$ret = $wpvivid_plugin->remote_collection->update_remote($remote_options['auth_id'], $remote_options);
|
233 |
|
234 |
+
if ($ret['result'] == 'success') {
|
235 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=success');
|
236 |
+
return;
|
237 |
+
} else {
|
238 |
+
header('Location: ' . admin_url() . 'admin.php?page=' . WPVIVID_PLUGIN_SLUG . '&action=wpvivid_one_drive_update&result=error&resp_msg=' . $ret['error']);
|
239 |
return;
|
240 |
}
|
241 |
}
|
242 |
+
catch (Exception $e){
|
243 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
}
|
245 |
}
|
246 |
+
else if($_GET['action']=='wpvivid_one_drive_update')
|
247 |
+
{
|
248 |
+
try {
|
249 |
+
if (isset($_GET['result'])) {
|
250 |
+
if ($_GET['result'] == 'success') {
|
251 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_onedrive_success'));
|
252 |
+
} else if ($_GET['result'] == 'error') {
|
253 |
+
add_action('show_notice', array($this, 'wpvivid_show_notice_edit_onedrive_error'));
|
254 |
+
}
|
|
|
|
|
|
|
255 |
}
|
256 |
}
|
257 |
+
catch (Exception $e){
|
258 |
+
echo '<div class="notice notice-error"><p>'.$e->getMessage().'</p></div>';
|
259 |
+
}
|
260 |
}
|
261 |
}
|
262 |
}
|
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.2
|
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,10 @@ Thank you for translating WPvivid Backup Plugin to your languages!
|
|
192 |
* [Nima](https://profiles.wordpress.org/nima78600/) (Persian)
|
193 |
|
194 |
== Changelog ==
|
|
|
|
|
|
|
|
|
195 |
= 0.9.67 =
|
196 |
- Fixed: The object-cache.php file and protection files generated by Wordfence were not excluded during restore.
|
197 |
- Fixed: Some used images were falsely identified as unused.
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 5.8.2
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 0.9.68
|
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.68 =
|
196 |
+
- Fixed: Failed to upload backups to Dropbox in some cases.
|
197 |
+
- Updated: Changed timezone in email report title to local time.
|
198 |
+
- Optimized the plugin code.
|
199 |
= 0.9.67 =
|
200 |
- Fixed: The object-cache.php file and protection files generated by Wordfence were not excluded during restore.
|
201 |
- Fixed: Some used images were falsely identified as unused.
|
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.68
|
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.68' );
|
25 |
//
|
26 |
define('WPVIVID_RESTORE_INIT','init');
|
27 |
define('WPVIVID_RESTORE_READY','ready');
|