@@ -27,13 +27,16 @@ discard block |
||
27 | 27 | <?php if ($storage_selection): ?> |
28 | 28 | <option value="" |
29 | 29 | selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option> |
30 | - <?php else: ?> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
31 | 32 | <option value="" |
32 | 33 | selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option> |
33 | - <?php endif; ?> |
|
34 | + <?php endif; |
|
35 | +} |
|
36 | +?> |
|
34 | 37 | |
35 | 38 | <?php foreach ($available_storages as $storage => $text): ?> |
36 | - <option value="<?php echo $storage ?>"<?php if ($storage == $storage_selection) |
|
39 | + <option value="<?php echo $storage ?>"<?php if ($storage == $storage_selection) { |
|
37 | 40 | echo "selected" ?>><?php echo $text ?></option> |
38 | 41 | <?php endforeach ?> |
39 | 42 | </select> |
@@ -62,6 +65,7 @@ discard block |
||
62 | 65 | |
63 | 66 | <?php |
64 | 67 | $i = 0; |
68 | +} |
|
65 | 69 | foreach ($backup_list as $file_info):?> |
66 | 70 | <?php |
67 | 71 | if ($storage_selection == "gdrive") { |
@@ -136,12 +140,14 @@ discard block |
||
136 | 140 | </ul> |
137 | 141 | <?php endif; ?> |
138 | 142 | </td> |
139 | - <td><?php if (isset($file_info['timestamp'])) |
|
143 | + <td><?php if (isset($file_info['timestamp'])) { |
|
140 | 144 | echo date("Y-m-d H:i", $file_info['timestamp']) ?></td> |
141 | 145 | <td><?php echo size_format($file_info['size']) ?></td> |
142 | 146 | <td> |
143 | 147 | <?php if (!$storage_selection): ?> |
144 | - <a href="#<?php echo $file_info['basename']; ?>" class="download" |
|
148 | + <a href="#<?php echo $file_info['basename']; |
|
149 | +} |
|
150 | +?>" class="download" |
|
145 | 151 | title="<?php echo __('Download Backup', 'xcloner-backup-and-restore') ?>"><i |
146 | 152 | class="material-icons">file_download</i></a> |
147 | 153 |
@@ -110,7 +110,8 @@ discard block |
||
110 | 110 | echo date( $date_format . " " . $time_format, $latest_backup['timestamp'] + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) |
111 | 111 | ?> |
112 | 112 | </div> |
113 | - <?php else: ?> |
|
113 | + <?php else { |
|
114 | + : ?> |
|
114 | 115 | <div class="item"> |
115 | 116 | <div class="title"><?php echo __( "No Backup Yet", 'xcloner-backup-and-restore' ) ?></div> |
116 | 117 | </div> |
@@ -123,7 +124,9 @@ discard block |
||
123 | 124 | <div class="title"><?php echo __( "Total Size", 'xcloner-backup-and-restore' ) ?> |
124 | 125 | : |
125 | 126 | </div> |
126 | - <?php echo size_format( $xcloner_file_system->get_storage_usage() ); ?> |
|
127 | + <?php echo size_format( $xcloner_file_system->get_storage_usage() ); |
|
128 | +} |
|
129 | +?> |
|
127 | 130 | </div> |
128 | 131 | </blockquote> |
129 | 132 | <h5><?php echo __( "Next Scheduled Backup", 'xcloner-backup-and-restore' ) ?></h5> |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | <label> |
27 | 27 | Off |
28 | 28 | <input type="checkbox" name="xcloner_ftp_enable" class="status" |
29 | - value="1" <?php if ( get_option( "xcloner_ftp_enable" ) ) |
|
29 | + value="1" <?php if ( get_option( "xcloner_ftp_enable" ) ) { |
|
30 | 30 | echo "checked" ?> \> |
31 | 31 | <span class="lever"></span> |
32 | 32 | On |
@@ -340,6 +340,7 @@ discard block |
||
340 | 340 | value=""><?php echo __( "Please Select AWS S3 Region or Leave Unselected for Custom Endpoint" ) ?></option> |
341 | 341 | <?php |
342 | 342 | $aws_regions = $remote_storage->get_aws_regions(); |
343 | +} |
|
343 | 344 | |
344 | 345 | foreach ( $aws_regions as $key => $region ) { |
345 | 346 | ?> |
@@ -423,7 +424,7 @@ discard block |
||
423 | 424 | <label> |
424 | 425 | Off |
425 | 426 | <input type="checkbox" name="xcloner_dropbox_enable" class="status" |
426 | - value="1" <?php if ( get_option( "xcloner_dropbox_enable" ) ) |
|
427 | + value="1" <?php if ( get_option( "xcloner_dropbox_enable" ) ) { |
|
427 | 428 | echo "checked" ?> \> |
428 | 429 | <span class="lever"></span> |
429 | 430 | On |
@@ -957,6 +958,7 @@ discard block |
||
957 | 958 | <div class="center"> |
958 | 959 | <?php |
959 | 960 | $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=xcloner-google-drive' ), 'install-plugin_xcloner-google-drive' ); |
961 | +} |
|
960 | 962 | ?> |
961 | 963 | <h6><?php echo __( "This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated." ) ?></h6> |
962 | 964 | <h6><?php echo __( "PHP 5.5 minimum version is required." ) ?></h6> |
@@ -213,8 +213,7 @@ |
||
213 | 213 | |
214 | 214 | if( $action == 'e' && function_exists('openssl_encrypt')) { |
215 | 215 | $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) ); |
216 | - } |
|
217 | - else if( $action == 'd' && function_exists('openssl_decrypt') && base64_decode( $string )){ |
|
216 | + } else if( $action == 'd' && function_exists('openssl_decrypt') && base64_decode( $string )){ |
|
218 | 217 | $decrypt = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv ); |
219 | 218 | if($decrypt) { |
220 | 219 | //we check if decrypt was succesful |
@@ -707,9 +707,11 @@ |
||
707 | 707 | foreach ($_backup_files_list as $file) { |
708 | 708 | //processing rule folder capacity |
709 | 709 | if ($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit') && |
710 | - $_storage_size >= ($set_storage_limit = 1024 * 1024 * $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) //bytes |
|
710 | + $_storage_size >= ($set_storage_limit = 1024 * 1024 * $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) { |
|
711 | + //bytes |
|
711 | 712 | { |
712 | 713 | $this->storage_filesystem->delete($file['path']); |
714 | + } |
|
713 | 715 | $_storage_size -= $file['size']; |
714 | 716 | $this->logger->info("Deleting backup " . $file['path'] . " matching rule", array( |
715 | 717 | "STORAGE SIZE LIMIT", |