PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.1.2
Backup Migration v2.1.2
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / includes / dashboard / modules / plugins-auto-update-notice.php
backup-backup / includes / dashboard / modules Last commit date
backup-ongoing.php 3 months ago backup_controller.php 3 months ago backups-table-header.php 3 months ago backups-under-table.php 3 months ago before-update-backup-errors.php 3 months ago email-errors.php 3 months ago plugins-auto-update-notice.php 3 months ago quota-errors.php 3 months ago security-plugins-warning.php 3 months ago super-quick-migration.php 3 months ago support-chat.php 3 months ago upload-backup.php 3 months ago
plugins-auto-update-notice.php
82 lines
1 <?php
2 // Exit on direct access
3 if (!defined('ABSPATH')) exit;
4
5 use BMI\Plugin\Dashboard as Dashboard;
6 use BMI\Plugin\BMI_Logger as Logger;
7 use BMI\Plugin\Backup_Migration_Plugin as BMP;
8
9 // Determine plugin versions and status
10 $has_premium = defined('BMI_BACKUP_PRO') && BMI_BACKUP_PRO;
11 $free_version = defined('BMI_VERSION') ? BMI_VERSION : null;
12 $premium_version = defined('BMI_PRO_VERSION') ? BMI_PRO_VERSION : null;
13
14 $notices = [];
15
16 // Check if free version needs auto-update
17 $free_needs_update = BMP::bmiNeedsUpdate();
18 $premium_needs_update = BMP::bmiNeedsUpdate(true);
19
20 // Get plugin file paths
21 $free_plugin_file = 'backup-backup/backup-backup.php'; // Adjust to actual plugin file
22 $premium_plugin_file = 'backup-backup-pro/backup-backup-pro.php'; // Adjust to actual premium plugin file
23
24 // Get admin URLs
25 $plugins_page_url = admin_url('plugins.php');
26
27 if ($has_premium && ($free_needs_update || $premium_needs_update)) {
28 // Both free and premium versions, at least one needs update
29 $notices[] = sprintf(
30 __('%sWarning:%s plugin version discrepancy detected. Keeping free and premium plugin auto-updated ensures the quality of our service, provides new features, and enforces security. Please enable auto-updates %shere%s.', 'backup-backup'),
31 '<strong>', '</strong>',
32 '<a class="hoverable secondary" href="' . esc_url($plugins_page_url) . '">','</a>'
33 );
34 } elseif (!$has_premium && $free_needs_update) {
35 // Only free version, needs update
36 // Try to get the enable auto-update link
37 $auto_update_url = wp_nonce_url(
38 add_query_arg(
39 [
40 'action' => 'toggle-auto-update',
41 'plugin' => $free_plugin_file,
42 'paged' => 1,
43 ],
44 admin_url('plugins.php')
45 ),
46 'updates'
47 );
48
49 $notices[] = sprintf(
50 __('Keeping the plugin auto-updated ensures the quality of our service, provides new features and enforces security. Please enable auto-updates %shere%s.', 'backup-backup'),
51 '<a href="' . esc_url($auto_update_url) . '">',
52 '</a>'
53 );
54 }
55
56 if (empty($notices)) {
57 return; // No issues to display
58 }
59 ?>
60
61 <div class="error-noticer" id="backupbliss-issues">
62 <div class="error-header">
63 <div class="cf">
64 <div class="left">
65 <?php esc_html_e('We have some issue(s) regarding BackupBliss.', 'backup-backup'); ?>
66 </div>
67 <div class="right hoverable">
68 <span class="bmi-error-toggle" data-expand="<?php esc_attr_e('Expand', 'backup-backup'); ?>" data-collapse="<?php esc_attr_e('Collapse', 'backup-backup'); ?>">
69 <?php esc_html_e('Expand', 'backup-backup'); ?>
70 </span> |
71 <span id="bmi-error-dismiss" issue-type="backupbliss" onclick="document.getElementById('backupbliss-issues').remove()">
72 <?php esc_html_e('Dismiss', 'backup-backup'); ?>
73 </span>
74 </div>
75 </div>
76 </div>
77 <div class="error-body">
78 <?php
79 echo wp_kses_post(implode("<br /><br />", $notices));
80 ?>
81 </div>
82 </div>