PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / trunk
WP STAGING – WordPress Backups, Restore, Migration & Clone vtrunk
4.11.1 4.11.0 4.10.0 4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / Backup / UpdateProtectionPausedNotice.php
wp-staging / Backup Last commit date
Ajax 2 days ago BackgroundProcessing 6 days ago Dto 2 days ago Entity 6 days ago Exceptions 6 days ago FileHeader 6 days ago Interfaces 6 days ago Job 2 days ago Request 6 days ago Service 2 days ago Storage 6 days ago Task 2 days ago Traits 6 days ago Utils 6 days ago AfterRestore.php 6 days ago BackupDeleter.php 6 days ago BackupDownload.php 6 days ago BackupFileIndex.php 6 days ago BackupGlitchReason.php 6 days ago BackupHeader.php 2 days ago BackupNextOffer.php 6 days ago BackupRepairer.php 6 days ago BackupRetentionHandler.php 6 days ago BackupScheduler.php 2 days ago BackupServiceProvider.php 6 days ago BackupValidator.php 2 days ago BeforeUpdateRowStatus.php 6 days ago FileHeader.php 6 days ago FileHeaderAttribute.php 6 days ago UpdateProtectionPausedNotice.php 6 days ago WithBackupIdentifier.php 6 days ago
UpdateProtectionPausedNotice.php
88 lines
1 <?php
2
3 namespace WPStaging\Backup;
4
5 use WPStaging\Backup\Service\UpdateProtectionHealth;
6 use WPStaging\Backup\Service\UpdateProtectionSettings;
7 use WPStaging\Framework\Security\Capabilities;
8 use WPStaging\Framework\Traits\PagesTrait;
9
10
11
12
13
14
15
16
17 class UpdateProtectionPausedNotice
18 {
19 use PagesTrait;
20
21
22 private $health;
23
24
25 private $settings;
26
27
28 private $capabilities;
29
30
31
32
33
34
35 public function __construct(UpdateProtectionHealth $health, UpdateProtectionSettings $settings, Capabilities $capabilities)
36 {
37 $this->health = $health;
38 $this->settings = $settings;
39 $this->capabilities = $capabilities;
40 }
41
42
43
44
45
46 public function render()
47 {
48 if (!$this->isWordPressUpdatePage() || !current_user_can($this->capabilities->manageWPSTG())) {
49 return;
50 }
51
52 if (!$this->settings->isEnabled() || !$this->health->isPaused()) {
53 return;
54 }
55
56 ?>
57 <div class="notice notice-warning wpstg-update-protection-paused">
58 <p>
59 <strong><?php esc_html_e('WP STAGING Update Protection is temporarily unavailable', 'wp-staging'); ?></strong><br>
60 <?php esc_html_e('A recovery backup couldn\'t be created. Plugin updates will continue normally until backup protection is available again.', 'wp-staging'); ?>
61 <?php echo $this->getReasonSentence(); // phpcs:ignore WPStaging.Security.EscapeOutput -- Both branches return an escaped string. ?>
62 </p>
63 <p>
64 <button type="button" class="button" data-wpstg-resume-update-protection>
65 <?php esc_html_e('Try protection again', 'wp-staging'); ?>
66 </button>
67 </p>
68 </div>
69 <?php
70 }
71
72
73
74
75 private function getReasonSentence(): string
76 {
77 if ($this->health->getReason() === UpdateProtectionHealth::REASON_DISK_SPACE) {
78 return esc_html__('There was not enough free disk space to create the backup.', 'wp-staging');
79 }
80
81 if ($this->health->getReason() === UpdateProtectionHealth::REASON_PERMISSIONS) {
82 return esc_html__('WP STAGING could not write to the backup directory.', 'wp-staging');
83 }
84
85 return '';
86 }
87 }
88