| @@ -8,21 +8,16 @@ | ||
| 8 | 8 | if (!defined('ABSPATH')) { |
| 9 | 9 | exit; |
| 10 | 10 | } // Exit if accessed directly |
| 11 | 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 ?> | |
| 12 | +if (true === isset($_GET['notification']) && true === isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'wp-database-backup') || $wpdbbkp_bg_notify) { ?> | |
| 13 | 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 | - | |
| 14 | + <div class="text-center wpdbbkp_notification"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL. "/assets/images/success.png"); ?>"> | |
| 15 | + <h4 class="text-success"><?php if ('create' === $_GET['notification'] || $wpdbbkp_bg_notify=='create') { | |
| 16 | + $backup_list = get_option('wp_db_backup_backups'); | |
| 17 | + $download_backup = end($backup_list); | |
| 18 | + if($download_backup && !empty($download_backup)) | |
| 19 | + { $backup_link = '<a href="' . esc_url($download_backup['url']) . '" style="color: #21759B;">' . __('Click Here to Download Backup.', 'wpdbbkp') . '</a>';} | |
| 25 | 20 | update_option('wpdbbkp_dashboard_notify',false); |
| 26 | 21 | esc_html_e('Backup Created Successfully. ', 'wpdbbkp'); |
| 27 | 22 | } elseif ('restore' === $_GET['notification']) { |
| 28 | 23 | esc_html_e('Backup Restore Successfully', 'wpdbbkp'); |
| @@ -41,16 +36,16 @@ | ||
| 41 | 36 | } elseif ('save' === $_GET['notification']) { |
| 42 | 37 | esc_html_e('Backup Setting Saved Successfully', 'wpdbbkp'); |
| 43 | 38 | } |
| 44 | 39 | ?></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> | |
| 40 | + <?php if ('create' === $_GET['notification']) { ?> | |
| 41 | + <h5 class="text-success"><strong><?php echo wp_kses_post($backup_link); ?> </strong></h5> | |
| 47 | 42 | <?php } ?> |
| 48 | 43 | </div> |
| 49 | 44 | <?php } ?> |
| 50 | 45 | |
| 51 | 46 | <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 */ ?>"> | |
| 47 | + <div class="text-center"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL . "/assets/images/icon_loading.gif"); ?>"> | |
| 53 | 48 | <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 | 49 | website. You can close this tab if you want', 'wpdbbkp') ?></strong></h5> |
| 55 | 50 | <div class="progress"> |
| 56 | 51 | <div id="wpdbbkp_progressbar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" |
| @@ -62,10 +57,10 @@ | ||
| 62 | 57 | </div> |
| 63 | 58 | </div> |
| 64 | 59 | |
| 65 | 60 | <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 */ ?>"> | |
| 61 | + <div class="text-center"><img width="50" height="50" src="<?php echo esc_url(WPDB_PLUGIN_URL . "/assets/images/icon_loading.gif"); ?>"> | |
| 67 | 62 | <h4 class="text-success" id="wpdbbkup_process_stats"><?php echo esc_html__('Creating Database Backup...', 'wpdbbkp') ?></h4> |
| 68 | 63 | <h5 class="text-success"><strong><?php echo esc_html__('It may take some time depending on size of your |
| 69 | 64 | Database. Do not close this window.', 'wpdbbkp') ?></strong></h5> |
| 70 | 65 | </div> |
| 71 | 66 | </div> |