/** * Displays a row in the manage backups table * * @param string $file * @param HMBKP_Scheduled_Backup $schedule */ function hmbkp_get_backup_row($file, HMBKP_Scheduled_Backup $schedule) { $encoded_file = urlencode(base64_encode($file)); $offset = get_option('gmt_offset') * 3600; ?> <tr class="hmbkp_manage_backups_row"> <th scope="row"> <?php echo esc_html(date_i18n(get_option('date_format') . ' - ' . get_option('time_format'), @filemtime($file) + $offset)); ?> </th> <td class="code"> <?php echo esc_html(size_format(@filesize($file))); ?> </td> <td><?php echo esc_html(hmbkp_human_get_type($file, $schedule)); ?> </td> <td> <?php if (hmbkp_is_path_accessible(hmbkp_path())) { ?> <a href="<?php echo esc_url(wp_nonce_url(add_query_arg(array('hmbkp_backup_archive' => $encoded_file, 'hmbkp_schedule_id' => $schedule->get_id(), 'action' => 'hmbkp_request_download_backup'), admin_url('admin-post.php')), 'hmbkp_download_backup', 'hmbkp_download_backup_nonce')); ?> " class="download-action"><?php _e('Download', 'hmbkp'); ?> </a> | <?php } ?> <a href="<?php echo esc_url(wp_nonce_url(add_query_arg(array('hmbkp_backup_archive' => $encoded_file, 'hmbkp_schedule_id' => $schedule->get_id(), 'action' => 'hmbkp_request_delete_backup'), admin_url('admin-post.php')), 'hmbkp_delete_backup', 'hmbkp_delete_backup_nonce')); ?> " class="delete-action"><?php _e('Delete', 'hmbkp'); ?> </a> </td> </tr> <?php }
/** * Displays a row in the manage backups table * * @param string $file * @param HMBKP_Scheduled_Backup $schedule */ function hmbkp_get_backup_row($file, HMBKP_Scheduled_Backup $schedule) { $encoded_file = urlencode(base64_encode($file)); $offset = get_option('gmt_offset') * 3600; ?> <tr class="hmbkp_manage_backups_row<?php if (file_exists(hmbkp_path() . '/.backup_complete')) { ?> completed<?php unlink(hmbkp_path() . '/.backup_complete'); } ?> "> <th scope="row"> <?php echo esc_html(date_i18n(get_option('date_format') . ' - ' . get_option('time_format'), @filemtime($file) + $offset)); ?> </th> <td class="code"> <?php echo esc_html(size_format(@filesize($file))); ?> </td> <td><?php echo esc_html(hmbkp_human_get_type($file, $schedule)); ?> </td> <td> <?php if (hmbkp_is_path_accessible(hmbkp_path())) { ?> <a href="<?php echo wp_nonce_url(admin_url('tools.php?page=' . HMBKP_PLUGIN_SLUG . '&hmbkp_download_backup=' . $encoded_file . '&hmbkp_schedule_id=' . $schedule->get_id()), 'hmbkp-download_backup'); ?> "><?php _e('Download', 'hmbkp'); ?> </a> | <?php } ?> <a href="<?php echo wp_nonce_url(admin_url('tools.php?page=' . HMBKP_PLUGIN_SLUG . '&hmbkp_delete_backup=' . $encoded_file . '&hmbkp_schedule_id=' . $schedule->get_id()), 'hmbkp-delete_backup'); ?> " class="delete-action"><?php _e('Delete', 'hmbkp'); ?> </a> </td> </tr> <?php }
function hmbkp_get_backup_row($file, HM\BackUpWordPress\Scheduled_Backup $schedule) { $encoded_file = urlencode(base64_encode($file)); $offset = get_option('gmt_offset') * 3600; ?> <tr class="hmbkp_manage_backups_row"> <th scope="row"> <?php echo esc_html(date_i18n(get_option('date_format') . ' - ' . get_option('time_format'), @filemtime($file) + $offset)); ?> </th> <td class="code"> <?php echo esc_html(size_format(@filesize($file))); ?> </td> <td><?php echo esc_html(hmbkp_human_get_type($file, $schedule)); ?> </td> <td> <?php if (hmbkp_is_path_accessible(hmbkp_path())) { ?> <a href="#" onclick="event.preventDefault(); mainwp_backupwp_download_backup('<?php echo $encoded_file; ?> ', <?php echo $schedule->get_id(); ?> , this);" class="download-action"><?php _e('Download', 'backupwordpress'); ?> </a> | <?php } ?> <a href="#" onclick="event.preventDefault(); mainwp_backupwp_delete_backup('<?php echo $encoded_file; ?> ', <?php echo $schedule->get_id(); ?> , this);" class="delete-action"><?php _e('Delete', 'backupwordpress'); ?> </a> </td> </tr> <?php }