PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.9.5
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.9.5
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 / cli-integration-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 2 months 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 6 days ago cron-warning-notice.php 3 months 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 4 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 6 days ago staging-symlink-enabled-notice.php 10 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 6 months ago wp-options-missing-pk.php 6 months ago wp-version-compat-notice.php 4 months ago wpe-permalink-issue-notice.php 1 year ago wrong-scheme.php 1 year ago
cli-integration-notice.php
160 lines
1 <?php
2
3 /**
4 * CLI Integration Notice - Banner promoting WP Staging CLI tool
5 *
6 * This file contains only the banner/notice HTML that appears in the WP admin.
7 * The modal content is loaded from src/views/cli/cli-integration-modal.php
8 *
9 * Variables passed from CliIntegrationNotice::maybeShowCliNotice():
10 * @var bool $isDeveloperOrHigher Whether user has Developer plan or higher
11 * @var string $planName The name of the user's license plan
12 * @var array $backups List of available backups
13 * @var string $urlAssets URL to the assets directory
14 * @var bool $hasActiveLicense Whether user has a valid/expired pro license
15 * @var string $licenseType License type slug (e.g. 'free', 'personal', 'business')
16 * @var string $licenseId License ID or empty
17 */
18
19 use WPStaging\Core\WPStaging;
20 use WPStaging\Framework\Language\Language;
21
22 ?>
23
24 <div class="wpstg-banner wpstg-banner-cli" id="wpstg-cli-integration-banner" data-is-developer="<?php echo $isDeveloperOrHigher ? '1' : '0'; ?>">
25 <!-- Top-right dismiss control -->
26 <div class="wpstg-banner-dismiss-top">
27 <button
28 type="button"
29 class="wpstg-btn wpstg-btn-sm wpstg-btn-ghost wpstg-banner-dismiss-btn"
30 id="wpstg-cli-notice-close"
31 aria-label="<?php esc_attr_e('Remind me tomorrow', 'wp-staging'); ?>"
32 >
33 <svg class="wpstg-btn-icon-sm" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
34 <circle cx="12" cy="12" r="10"></circle>
35 <polyline points="12 6 12 12 16 14"></polyline>
36 </svg>
37 <?php esc_html_e('Later', 'wp-staging'); ?>
38 </button>
39 <button
40 type="button"
41 class="wpstg-btn wpstg-btn-sm wpstg-btn-ghost wpstg-banner-dismiss-btn"
42 id="wpstg-cli-notice-hide-forever"
43 aria-label="<?php esc_attr_e('Don\'t show this notice again', 'wp-staging'); ?>"
44 >
45 <svg class="wpstg-btn-icon-sm" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
46 <path d="M18 6 6 18"/>
47 <path d="m6 6 12 12"/>
48 </svg>
49 <?php esc_html_e('Dismiss', 'wp-staging'); ?>
50 </button>
51 </div>
52
53 <!-- Main content area -->
54 <div class="wpstg-banner-content">
55 <!-- Icon box (blue tint) -->
56 <div class="wpstg-icon-box wpstg-icon-box-blue wpstg-banner-icon-box">
57 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
58 <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
59 <polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
60 <line x1="12" y1="22.08" x2="12" y2="12"></line>
61 </svg>
62 </div>
63
64 <!-- Text content -->
65 <div class="wpstg-banner-text">
66 <div class="wpstg-banner-header">
67 <span class="wpstg-badge-new"><?php esc_html_e('NEW', 'wp-staging'); ?></span>
68 <h3 class="wpstg-banner-title">
69 <?php esc_html_e('Local Docker Environments', 'wp-staging'); ?>
70 </h3>
71 </div>
72 <p class="wpstg-banner-description">
73 <?php esc_html_e('Turn backups into local Docker sites with one command. Perfect for development and testing.', 'wp-staging'); ?>
74 </p>
75 <?php if ($isDeveloperOrHigher) : ?>
76 <p class="wpstg-banner-plan-info">
77 <?php
78 printf(
79 esc_html__('Included in your %s plan.', 'wp-staging'),
80 '<strong>' . esc_html($planName) . '</strong>'
81 );
82 ?>
83 </p>
84 <?php else : ?>
85 <p class="wpstg-banner-plan-info">
86 <?php
87 printf(
88 esc_html__('Requires Developer plan or higher. Your plan: %s.', 'wp-staging'),
89 '<strong>' . esc_html($planName) . '</strong>'
90 );
91 ?>
92 </p>
93 <?php endif; ?>
94
95 <!-- Action buttons aligned with text -->
96 <div class="wpstg-banner-buttons">
97 <?php if ($isDeveloperOrHigher) : ?>
98 <button type="button" class="wpstg-btn wpstg-btn-sm wpstg-btn-primary" id="wpstg-cli-install-button">
99 <svg class="wpstg-btn-icon-sm" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
100 <path d="M12 10v6"></path>
101 <path d="M9 13h6"></path>
102 <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path>
103 </svg>
104 <?php esc_html_e('Create Local Site', 'wp-staging'); ?>
105 </button>
106 <?php else : ?>
107 <?php
108 if ($hasActiveLicense) {
109 $upgradeUrl = admin_url('admin.php?page=wpstg-license');
110 $isExternalUrl = false;
111 } else {
112 $upgradeUrl = \WPStaging\Framework\Language\Language::localizeCheckoutUrl('https://wp-staging.com/checkout/?edd_action=add_to_cart&download_id=11&edd_options[price_id]=13');
113 $isExternalUrl = true;
114 }
115 ?>
116 <a href="<?php echo esc_url($upgradeUrl); ?>" <?php echo $isExternalUrl ? 'target="_blank" rel="noreferrer noopener"' : ''; ?> class="wpstg-btn wpstg-btn-sm wpstg-btn-primary">
117 <?php esc_html_e('Upgrade Plan', 'wp-staging'); ?>
118 </a>
119 <?php endif; ?>
120 <?php
121 $learnMoreParams = [
122 'utm_source' => 'wp-staging',
123 'utm_medium' => 'plugin',
124 'utm_campaign' => 'cli_upgrade',
125 'utm_content' => 'cli_notice',
126 ];
127 if (!empty($licenseType)) {
128 $learnMoreParams['plan'] = $licenseType;
129 }
130
131 if (!empty($licenseId)) {
132 $learnMoreParams['license_id'] = $licenseId;
133 }
134
135 $learnMoreUrl = Language::addClientAttribution(add_query_arg(
136 $learnMoreParams,
137 Language::localizeUrl('https://wp-staging.com/cli/upgrade/')
138 ));
139 ?>
140 <a href="<?php echo esc_url($learnMoreUrl); ?>" target="_blank" rel="noreferrer noopener" class="wpstg-btn wpstg-btn-sm wpstg-btn-ghost wpstg-banner-learn-more">
141 <?php esc_html_e('Learn More', 'wp-staging'); ?>
142 <svg class="wpstg-btn-icon-sm" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
143 <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
144 <polyline points="15 3 21 3 21 9"></polyline>
145 <line x1="10" y1="14" x2="21" y2="3"></line>
146 </svg>
147 </a>
148 </div>
149 </div>
150 </div>
151 </div>
152
153 <?php
154 // Include the modal content (hidden until triggered by JS) — only once per page
155 if (empty($GLOBALS['wpstg_cli_modal_rendered'])) {
156 include __DIR__ . '/../cli/cli-integration-modal.php';
157 $GLOBALS['wpstg_cli_modal_rendered'] = true;
158 }
159 ?>
160