PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.11.2
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.11.2
4.11.2 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 1 week ago BackgroundProcessing 2 weeks ago Dto 1 week ago Entity 2 weeks ago Exceptions 4 days ago FileHeader 2 weeks ago Interfaces 2 weeks ago Job 4 days ago Request 2 weeks ago Service 4 days ago Storage 2 weeks ago Task 4 days ago Traits 2 weeks ago Utils 2 weeks ago AdminMenuBadge.php 4 days ago AfterRestore.php 2 weeks ago BackupDeleter.php 2 weeks ago BackupDownload.php 2 weeks ago BackupFileIndex.php 2 weeks ago BackupGlitchReason.php 2 weeks ago BackupHeader.php 1 week ago BackupNextOffer.php 4 days ago BackupRepairer.php 2 weeks ago BackupRetentionHandler.php 2 weeks ago BackupScheduler.php 4 days ago BackupServiceProvider.php 2 weeks ago BackupValidator.php 1 week ago BeforeUpdateRowStatus.php 2 weeks ago FileHeader.php 2 weeks ago FileHeaderAttribute.php 2 weeks ago UpdateProtectionPausedNotice.php 2 weeks ago WithBackupIdentifier.php 2 weeks 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