invalid-backup.php
81 lines
| 1 | <?php |
| 2 | |
| 3 | use WPStaging\Core\WPStaging; |
| 4 | use WPStaging\Framework\Utils\Strings; |
| 5 | |
| 6 | /** |
| 7 | * @var string $id |
| 8 | * @var array $missingParts |
| 9 | * @var array $sizeIssues |
| 10 | * @var array $existingBackupParts |
| 11 | * |
| 12 | * Used src/views/backup/listing-single-backup.php |
| 13 | */ |
| 14 | |
| 15 | if (!isset($urlAssets)) { |
| 16 | $urlAssets = trailingslashit(WPSTG_PLUGIN_URL) . 'assets/'; |
| 17 | } |
| 18 | |
| 19 | /** @var Strings $strings */ |
| 20 | $strings = WPStaging::make(Strings::class); |
| 21 | |
| 22 | ?> |
| 23 | |
| 24 | <a href="javascript:void(0)" class="wpstg-tab-header" data-id="#wpstg-invalid-backup-<?php echo esc_attr($id); ?>"> |
| 25 | <?php if (empty($sizeIssues) && empty($missingParts)) : ?> |
| 26 | <span class="wpstg-tab-triangle"></span> |
| 27 | <span class="wpstg-backup-parts-heading"><?php esc_html_e("Show available backup parts", "wp-staging") ?></span> |
| 28 | <?php else : ?> |
| 29 | <span class="wpstg-tab-triangle wpstg--red"></span> |
| 30 | <span class="wpstg--text--danger"><?php esc_html_e("This is a multipart backup with issues!", "wp-staging") ?> </span> |
| 31 | <div class="wpstg--tooltip"> |
| 32 | <img class="wpstg--dashicons wpstg-dashicons-19 wpstg--grey" src="<?php echo esc_url($urlAssets); ?>svg/info-outline.svg" alt="info"/> |
| 33 | <span class="wpstg--tooltiptext wpstg--tooltiptext-backups"> |
| 34 | <?php esc_html_e("This backup contains missing or invalid parts.", 'wp-staging') ?> |
| 35 | </span> |
| 36 | </div> |
| 37 | <?php endif; ?> |
| 38 | </a> |
| 39 | |
| 40 | <fieldset class="wpstg-tab-section" id="wpstg-invalid-backup-<?php echo esc_attr($id); ?>"> |
| 41 | |
| 42 | <h5> |
| 43 | <?php esc_html_e('Multipart backup contains these parts', 'wp-staging') ?> |
| 44 | </h5> |
| 45 | <ol> |
| 46 | <?php foreach ($existingBackupParts as $existingPart) : ?> |
| 47 | <li><?php echo esc_html($strings->maskBackupFilename($existingPart)); ?></li> |
| 48 | <?php endforeach; ?> |
| 49 | </ol> |
| 50 | |
| 51 | |
| 52 | <?php if (!empty($missingParts)) : ?> |
| 53 | <h5> |
| 54 | <?php if (empty($sizeIssues)) : ?> |
| 55 | <?php |
| 56 | if (count($missingParts) === 1) { |
| 57 | esc_html_e('Part below is missing but you can still restore the other backup files!', 'wp-staging'); |
| 58 | } else { |
| 59 | esc_html_e('Parts below are missing but you can still restore the other backup files!', 'wp-staging'); |
| 60 | } |
| 61 | ?> |
| 62 | <?php else : ?> |
| 63 | <?php esc_html_e('Missing Parts', 'wp-staging') ?> |
| 64 | <?php endif; ?> |
| 65 | </h5> |
| 66 | <ol> |
| 67 | <?php foreach ($missingParts as $part) : ?> |
| 68 | <li><?php echo esc_html($strings->maskBackupFilename($part['name'])); ?></li> |
| 69 | <?php endforeach; ?> |
| 70 | </ol> |
| 71 | <?php endif; ?> |
| 72 | <?php if (!empty($sizeIssues)) : ?> |
| 73 | <h5><?php esc_html_e('Parts with invalid size that should be uploaded again:', 'wp-staging') ?></h5> |
| 74 | <ol> |
| 75 | <?php foreach ($sizeIssues as $part) : ?> |
| 76 | <li><?php echo esc_html($strings->maskBackupFilename($part)); ?></li> |
| 77 | <?php endforeach; ?> |
| 78 | </ol> |
| 79 | <?php endif; ?> |
| 80 | </fieldset> |
| 81 |