| 1 |
<?php |
| 2 |
/** |
| 3 |
* Show header notification in dashboard |
| 4 |
* |
| 5 |
* @package wpdbbkp |
| 6 |
*/ |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
exit; |
| 10 |
} // Exit if accessed directly |
| 11 |
$wpdbbkp_bg_notify = get_option('wpdbbkp_dashboard_notify',false); |
| 12 |
if (true === isset($_GET['notification']) && true === isset($_GET['_wpnonce']) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce']) , 'wp-database-backup') || $wpdbbkp_bg_notify) { //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- using as nonce ?> |
| 13 |
|
| 14 |
<div class="text-center wpdbbkp_notification"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL. "/assets/images/success.png"); /* phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */ ?>"> |
| 15 |
<h4 class="text-success"><?php if ((isset($_GET['notification']) && 'create' === $_GET['notification']) || $wpdbbkp_bg_notify=='create') { |
| 16 |
$wpdbbkp_backup_list = get_option('wp_db_backup_backups'); |
| 17 |
if(!empty($wpdbbkp_backup_list) && is_array($wpdbbkp_backup_list)){ |
| 18 |
$wpdbbkp_download_backup = end($wpdbbkp_backup_list); |
| 19 |
if($wpdbbkp_download_backup && !empty($wpdbbkp_download_backup) && isset($wpdbbkp_download_backup['url'])) |
| 20 |
{ |
| 21 |
$wpdbbkp_backup_link = '<a href="' . esc_url(admin_url('?wpdbbkp_download='.basename($wpdbbkp_download_backup['url']))) . '" style="color: #21759B;">' . __('Click Here to Download Backup.', 'wpdbbkp') . '</a>'; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
update_option('wpdbbkp_dashboard_notify',false); |
| 26 |
esc_html_e('Backup Created Successfully. ', 'wpdbbkp'); |
| 27 |
} elseif ('restore' === $_GET['notification']) { |
| 28 |
esc_html_e('Backup Restore Successfully', 'wpdbbkp'); |
| 29 |
} elseif ('restore_limit' === $_GET['notification']) { |
| 30 |
esc_html_e('Restore Limit for Backup reached. Please update to PRO to remove this limit', 'wpdbbkp'); |
| 31 |
}elseif ('delete' === $_GET['notification']) { |
| 32 |
esc_html_e('Backup deleted Successfully', 'wpdbbkp'); |
| 33 |
}elseif ('deleteall' === $_GET['notification']) { |
| 34 |
esc_html_e('All Backup data is deleted Successfully', 'wpdbbkp'); |
| 35 |
} elseif ('clear_temp_db_backup_file' === $_GET['notification']) { |
| 36 |
esc_html_e('Clear all old/temp database backup files Successfully', 'wpdbbkp'); |
| 37 |
} elseif ('Invalid' === $_GET['notification']) { |
| 38 |
esc_html_e('Invalid Access!!!!', 'wpdbbkp'); |
| 39 |
} elseif ('deleteauth' === $_GET['notification']) { |
| 40 |
esc_html_e('Dropbox account unlink Successfully', 'wpdbbkp'); |
| 41 |
} elseif ('save' === $_GET['notification']) { |
| 42 |
esc_html_e('Backup Setting Saved Successfully', 'wpdbbkp'); |
| 43 |
} |
| 44 |
?></h4> |
| 45 |
<?php if (isset($_GET['notification']) && 'create' === $_GET['notification'] && isset($wpdbbkp_backup_link)) { ?> |
| 46 |
<h5 class="text-success"><strong><?php echo wp_kses_post($wpdbbkp_backup_link); ?> </strong></h5> |
| 47 |
<?php } ?> |
| 48 |
</div> |
| 49 |
<?php } ?> |
| 50 |
|
| 51 |
<div id="wpdb-backup-process" style="display:none"> |
| 52 |
<div class="text-center"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL . "/assets/images/icon_loading.gif"); /* phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */ ?>"> |
| 53 |
<h5 class="text-success"><strong><?php echo esc_html__('Backup process is working in background, it may take some time depending on size of your |
| 54 |
website. You can close this tab if you want', 'wpdbbkp') ?></strong></h5> |
| 55 |
<div class="progress"> |
| 56 |
<div id="wpdbbkp_progressbar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" |
| 57 |
style="width:0%"> |
| 58 |
0% |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
<h4 class="text-success" id="wpdbbkup_process_stats"><?php echo esc_html__('Processing...', 'wpdbbkp') ?></h4> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
|
| 65 |
<div id="backup_process" style="display:none"> |
| 66 |
<div class="text-center"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL . "/assets/images/icon_loading.gif"); /* phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage */ ?>"> |
| 67 |
<h4 class="text-success" id="wpdbbkup_process_stats"><?php echo esc_html__('Creating Database Backup...', 'wpdbbkp') ?></h4> |
| 68 |
<h5 class="text-success"><strong><?php echo esc_html__('It may take some time depending on size of your |
| 69 |
Database. Do not close this window.', 'wpdbbkp') ?></strong></h5> |
| 70 |
</div> |
| 71 |
</div> |