PluginProbe
WP Database Backup – Unlimited Database & Files Backup by Backup for WP / 6.11
WP Database Backup – Unlimited Database & Files Backup by Backup for WP v6.11
7.13 7.12 trunk 1.1 2.1.1 5.9 6.0 6.1 6.10 6.11 6.12 6.12.1 6.2 6.3 6.4 6.5 6.5.1 6.6 6.7 6.8 6.9 7.0 7.0.1 7.1 7.10 All 34 releases
wp-database-backup / includes / admin / Destination / FTP / check-repo.php

check-repo.php in WP Database Backup – Unlimited Database & Files Backup by Backup for WP 6.11, at includes/admin/Destination/FTP/check-repo.php

67 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Destination ftp
4 *
5 * @package wpdbbkp
6 */
7
8 if ( ! function_exists( 'add_action' ) ) {
9 header( 'Status: 403 Forbidden' );
10 header( 'HTTP/1.1 403 Forbidden' );
11 exit();
12 }
13
14 if ( ! current_user_can( 'manage_options' ) ) {
15 header( 'Status: 403 Forbidden' );
16 header( 'HTTP/1.1 403 Forbidden' );
17 exit();
18 }
19
20 ?>
21 <p><strong>Here's a list of BackupBreeze in your repository:</strong></p>
22 <?php
23 /**
24 * Set up variables
25 *
26 * @package wpdbbkp
27 */
28 $host = get_option( 'snapshot_ftp_host' );
29 $user = get_option( 'snapshot_ftp_user' );
30 $pass = get_option( 'snapshot_ftp_pass' );
31 $subdir = get_option( 'snapshot_ftp_subdir' );
32 if ( '' === $subdir ) {
33 $subdir = '/';
34 }
35
36 // If in WP Dashboard or Admin Panels.
37 if ( is_admin() ) {
38 // If user has WP manage options permissions.
39 if ( current_user_can( 'manage_options' ) ) {
40 $conn_id = ftp_connect( $host );
41 }
42 }
43
44 // Login with username and password.
45 $login_result = ftp_login( $conn_id, $user, $pass );
46
47 // Get contents of the current directory.
48 $contents = ftp_nlist( $conn_id, "$subdir/*.tar" );
49
50 ?>
51 <ol></em>
52
53 <?php
54 foreach ( $contents as $key => $value ) {
55 echo '<li>' . esc_attr( substr( $value, ( strlen( $subdir ) ) ) ) . '</li>';
56 }
57 ?>
58 </ol>
59 <p><br />
60 <em><?php echo esc_html__('This section shows a list of Backup in your repository. ', 'wpdbbkp') ?></em></p>
61 <p><em><?php echo esc_html__("If you're using the Auto-Delete option under Automation: ", 'wpdbbkp') ?> <br />
62 </em><em><?php echo esc_html__('the files at the bottom of this list will be deleted, the ones at the top will stay in place. ', 'wpdbbkp') ?></em>
63 <?php
64 ftp_close( $conn_id );
65 ?>
66 </p>
67