PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.10.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.10.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 / views / notices / cron-warning-notice.php
wp-staging / views / notices Last commit date
_partial 1 month ago aios-salt-postfix-enabled.php 1 year ago analytics-consent-failed.php 1 year ago analytics-consent-refused.php 1 year ago analytics-modal.php 4 days ago backup-plugins-notice.php 8 months ago beta.php 1 year ago cache-directory-permission-problem.php 1 year ago cli-integration-notice.php 1 week ago cron-warning-notice.php 4 days ago directory-listing-could-not-be-prevented.php 8 months ago disabled-items-notice.php 1 year ago disabled-optimizer-notice.php 1 year ago elementor-cloud-notice.php 5 months ago logs-directory-permission-problem.php 1 year ago low-memory-limit.php 1 year ago mu-plugin-directory-permission-problem.php 1 year ago next-gen-engine-notice.php 1 month ago no-db-prefix-notice.php 1 year ago object-cache-skipped.php 1 year ago outdated-wp-staging-hooks.php 1 year ago outdated-wp-staging-version.php 1 year ago pro-crons-notice.php 1 year ago review-prompt-handlers.php 1 month ago review-prompt-modal.php 1 month ago settings_option_corrupt.php 1 year ago staging-directory-permission-problem.php 1 week ago staging-symlink-enabled-notice.php 11 months ago table-tmp-prefix-conflict-notice.php 1 year ago transient.php 1 year ago uploads-outside-wp-root.php 1 year ago vars-directory-permission-problem.php 1 year ago wordfence-userini-renamed.php 7 months ago wp-options-missing-pk.php 7 months ago wp-version-compat-notice.php 5 months ago wpe-permalink-issue-notice.php 1 year ago wrong-scheme.php 1 year ago
cron-warning-notice.php
141 lines
1 <?php
2
3 /**
4 * Cron Warning Notice - Compact banner for WP-Cron status warnings
5 *
6 * Uses UI primitives for buttons and badges, with minimal custom layout styles.
7 *
8 * @var BackupScheduler $backupScheduler
9 * @var bool $cronStatus
10 */
11
12 use WPStaging\Backup\BackupScheduler;
13 use WPStaging\Core\WPStaging;
14 use WPStaging\Framework\Utils\ServerVars;
15
16 // Don't show if no cron issues
17 if ($backupScheduler->getWarningType() === '') {
18 return;
19 }
20
21 $overdueCount = $backupScheduler->getOverdueCronJobsCount();
22 $hasOverdue = $backupScheduler->hasOverdueCronJobs();
23 $isWpCronDisabled = $backupScheduler->isWpCronDisabled();
24 $isLitespeed = WPStaging::make(ServerVars::class)->isLitespeed();
25 $isPro = WPStaging::isPro();
26 $warningType = $backupScheduler->getWarningType();
27 $failureMessage = $backupScheduler->getLastBackupFailureMessage();
28
29 // Help article URL
30 $helpUrl = $isPro
31 ? 'https://wp-staging.com/docs/wp-cron-is-not-working-correctly/'
32 : 'https://wordpress.org/support/plugin/wp-staging/';
33 ?>
34
35 <div class="wpstg-cron-banner" id="wpstg-cron-warning-notice">
36 <!-- Collapsed row: icon + message + badge + buttons -->
37 <div class="wpstg-cron-banner-row">
38 <!-- Icon Box - uses UI primitive -->
39 <div class="wpstg-icon-box wpstg-icon-box-amber wpstg-cron-banner-icon">
40 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
41 <circle cx="12" cy="12" r="10"></circle>
42 <line x1="12" y1="8" x2="12" y2="12"></line>
43 <line x1="12" y1="16" x2="12.01" y2="16"></line>
44 </svg>
45 </div>
46
47 <!-- Message + Badge -->
48 <div class="wpstg-cron-banner-message">
49 <span class="wpstg-cron-banner-text">
50 <?php if ($warningType === BackupScheduler::CRON_WARNING_TYPE_FAILURE) : ?>
51 <?php esc_html_e('Last scheduled backup failed.', 'wp-staging'); ?>
52 <?php else : ?>
53 <?php esc_html_e('Scheduled backup is overdue.', 'wp-staging'); ?>
54 <?php endif; ?>
55 </span>
56 <?php if ($hasOverdue) : ?>
57 <span class="wpstg-badge wpstg-cron-banner-badge"><?php echo esc_html((string)$overdueCount); ?> <?php esc_html_e('overdue', 'wp-staging'); ?></span>
58 <?php endif; ?>
59 </div>
60
61 <!-- Actions - uses UI primitive buttons -->
62 <div class="wpstg-cron-banner-actions">
63 <a href="<?php echo esc_url($helpUrl); ?>" target="_blank" rel="noopener" class="wpstg-btn wpstg-btn-sm wpstg-btn-warning">
64 <?php esc_html_e('Get Help', 'wp-staging'); ?>
65 <svg class="wpstg-btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
66 <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
67 <polyline points="15 3 21 3 21 9"></polyline>
68 <line x1="10" y1="14" x2="21" y2="3"></line>
69 </svg>
70 </a>
71 <button
72 type="button"
73 class="wpstg-btn wpstg-btn-sm wpstg-btn-warning-outline wpstg-cron-banner-toggle"
74 aria-expanded="false"
75 aria-controls="wpstg-cron-banner-details"
76 >
77 <?php esc_html_e('Details', 'wp-staging'); ?>
78 <svg class="wpstg-cron-banner-caret wpstg-btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
79 <polyline points="6 9 12 15 18 9"></polyline>
80 </svg>
81 </button>
82 </div>
83 </div>
84
85 <!-- Expandable details panel -->
86 <div id="wpstg-cron-banner-details" class="wpstg-cron-banner-details" hidden>
87 <div class="wpstg-cron-banner-details-content">
88 <?php if ($warningType === BackupScheduler::CRON_WARNING_TYPE_FAILURE && $failureMessage !== '') : ?>
89 <p class="wpstg-cron-banner-cause">
90 <?php esc_html_e('Error:', 'wp-staging'); ?>
91 <code class="wpstg-code-chip"><?php echo esc_html($failureMessage); ?></code>
92 </p>
93 <?php endif; ?>
94 <?php if ($isWpCronDisabled) : ?>
95 <p class="wpstg-cron-banner-cause">
96 <?php esc_html_e('Detected', 'wp-staging'); ?>
97 <code class="wpstg-code-chip">DISABLE_WP_CRON=true</code>
98 <?php esc_html_e('in wp-config.php.', 'wp-staging'); ?>
99 </p>
100 <?php endif; ?>
101 <p class="wpstg-cron-banner-guidance">
102 <?php esc_html_e('Enable WP-Cron or configure a server cron job.', 'wp-staging'); ?>
103 <?php if ($hasOverdue) : ?>
104 <?php esc_html_e('This could also indicate a development site with no visitors.', 'wp-staging'); ?>
105 <?php endif; ?>
106 </p>
107 <?php if ($isLitespeed) : ?>
108 <p class="wpstg-cron-banner-litespeed">
109 <?php esc_html_e('LiteSpeed server detected.', 'wp-staging'); ?>
110 <a href="https://wp-staging.com/docs/scheduled-backups-do-not-work-hosting-company-uses-the-litespeed-webserver-fix-wp-cron/" target="_blank" rel="noopener">
111 <?php esc_html_e('Learn more', 'wp-staging'); ?>
112 <svg class="wpstg-btn-icon-sm wpstg-inline" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
113 <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
114 <polyline points="15 3 21 3 21 9"></polyline>
115 <line x1="10" y1="14" x2="21" y2="3"></line>
116 </svg>
117 </a>
118 </p>
119 <?php endif; ?>
120 </div>
121 </div>
122 </div>
123
124 <script>
125 (function() {
126 'use strict';
127
128 var toggle = document.querySelector('.wpstg-cron-banner-toggle');
129 if (!toggle) return;
130
131 toggle.onclick = function() {
132 var details = document.getElementById('wpstg-cron-banner-details');
133 var isExpanded = this.getAttribute('aria-expanded') === 'true';
134
135 this.setAttribute('aria-expanded', !isExpanded);
136 details.hidden = isExpanded;
137 this.classList.toggle('wpstg-expanded', !isExpanded);
138 };
139 })();
140 </script>
141