backup-next.php
1 week ago
capability-icon.php
1 day ago
first-run.php
1 day ago
next-step.php
1 day ago
open-staging-site.php
1 week ago
pre-consent.php
1 day ago
progress.php
1 day ago
update-protection.php
1 day ago
update-protection.php
89 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Update Protection status line, shown between the lede and the three actions. |
| 5 | * |
| 6 | * Deliberately not a card: it is not a fourth thing to choose, only a sentence |
| 7 | * saying the feature is already on before the user meets it on the plugins |
| 8 | * screen. Rendering it also counts as the modal's introduction, so the same |
| 9 | * explanation is not repeated the first time an update is intercepted. |
| 10 | * |
| 11 | * @see \WPStaging\Backup\Service\UpdateProtectionSettings |
| 12 | */ |
| 13 | |
| 14 | use WPStaging\Backup\Service\UpdateProtectionSettings; |
| 15 | use WPStaging\Core\WPStaging; |
| 16 | |
| 17 | $updateProtection = WPStaging::make(UpdateProtectionSettings::class); |
| 18 | $updateProtection->markIntroSeen('modal'); |
| 19 | |
| 20 | $isProtectionEnabled = $updateProtection->isEnabled(); |
| 21 | ?> |
| 22 | <div |
| 23 | class="wpstg-onboarding-protection" |
| 24 | data-wpstg-update-protection |
| 25 | data-state="<?php echo $isProtectionEnabled ? 'on' : 'off'; ?>" |
| 26 | aria-live="polite" |
| 27 | > |
| 28 | <p class="wpstg-onboarding-protection__line"> |
| 29 | <svg class="wpstg-onboarding-protection__shield" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"> |
| 30 | <path d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"></path> |
| 31 | </svg> |
| 32 | |
| 33 | <span data-wpstg-update-protection-on> |
| 34 | <strong><?php esc_html_e('Plugin updates are now protected', 'wp-staging'); ?></strong> |
| 35 | <?php esc_html_e('WP STAGING checks for a recent backup before plugin updates and offers to create one when needed.', 'wp-staging'); ?> |
| 36 | </span> |
| 37 | |
| 38 | <span data-wpstg-update-protection-off> |
| 39 | <strong><?php esc_html_e('Update Protection is off', 'wp-staging'); ?></strong> |
| 40 | <?php esc_html_e('Plugin updates will run normally without WP STAGING checking for a recent backup first.', 'wp-staging'); ?> |
| 41 | </span> |
| 42 | |
| 43 | <span data-wpstg-update-protection-confirm> |
| 44 | <strong><?php esc_html_e('Turn off Update Protection?', 'wp-staging'); ?></strong> |
| 45 | <?php esc_html_e('Plugin updates will work normally without this backup prompt. WP STAGING will remain active.', 'wp-staging'); ?> |
| 46 | </span> |
| 47 | </p> |
| 48 | |
| 49 | <p class="wpstg-onboarding-protection__actions"> |
| 50 | <span class="wpstg-onboarding-protection__state" data-wpstg-update-protection-on> |
| 51 | <?php esc_html_e('Update Protection is on', 'wp-staging'); ?> |
| 52 | </span> |
| 53 | <button |
| 54 | type="button" |
| 55 | class="wpstg-onboarding-protection__link" |
| 56 | data-wpstg-update-protection-action="confirm-disable" |
| 57 | data-wpstg-update-protection-on |
| 58 | > |
| 59 | <?php esc_html_e('Turn off', 'wp-staging'); ?> |
| 60 | </button> |
| 61 | |
| 62 | <button |
| 63 | type="button" |
| 64 | class="wpstg-onboarding-protection__link" |
| 65 | data-wpstg-update-protection-action="enable" |
| 66 | data-wpstg-update-protection-off |
| 67 | > |
| 68 | <?php esc_html_e('Turn on', 'wp-staging'); ?> |
| 69 | </button> |
| 70 | |
| 71 | <button |
| 72 | type="button" |
| 73 | class="wpstg-onboarding-protection__link wpstg-onboarding-protection__link--strong" |
| 74 | data-wpstg-update-protection-action="disable" |
| 75 | data-wpstg-update-protection-confirm |
| 76 | > |
| 77 | <?php esc_html_e('Turn Off Update Protection', 'wp-staging'); ?> |
| 78 | </button> |
| 79 | <button |
| 80 | type="button" |
| 81 | class="wpstg-onboarding-protection__link" |
| 82 | data-wpstg-update-protection-action="keep" |
| 83 | data-wpstg-update-protection-confirm |
| 84 | > |
| 85 | <?php esc_html_e('Keep Protection', 'wp-staging'); ?> |
| 86 | </button> |
| 87 | </p> |
| 88 | </div> |
| 89 |