_partial
1 week 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
1 month ago
backup-plugins-notice.php
7 months ago
beta.php
1 year ago
cache-directory-permission-problem.php
1 year ago
cli-integration-notice.php
1 day ago
cron-warning-notice.php
2 months ago
directory-listing-could-not-be-prevented.php
7 months ago
disabled-items-notice.php
1 year ago
disabled-optimizer-notice.php
1 year ago
elementor-cloud-notice.php
3 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 day ago
no-db-prefix-notice.php
1 year ago
object-cache-skipped.php
11 months 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
2 weeks ago
review-prompt-modal.php
2 weeks ago
settings_option_corrupt.php
1 year ago
staging-directory-permission-problem.php
1 year ago
staging-symlink-enabled-notice.php
9 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
5 months ago
wp-options-missing-pk.php
5 months ago
wp-version-compat-notice.php
3 months ago
wpe-permalink-issue-notice.php
1 year ago
wrong-scheme.php
1 year ago
cli-integration-notice.php
161 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 | |
| 21 | ?> |
| 22 | |
| 23 | <div class="wpstg-banner wpstg-banner-cli" id="wpstg-cli-integration-banner" data-is-developer="<?php echo $isDeveloperOrHigher ? '1' : '0'; ?>"> |
| 24 | <!-- Top-right dismiss control --> |
| 25 | <div class="wpstg-banner-dismiss-top"> |
| 26 | <button |
| 27 | type="button" |
| 28 | class="wpstg-btn wpstg-btn-sm wpstg-btn-ghost wpstg-banner-dismiss-btn" |
| 29 | id="wpstg-cli-notice-close" |
| 30 | aria-label="<?php esc_attr_e('Remind me tomorrow', 'wp-staging'); ?>" |
| 31 | > |
| 32 | <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"> |
| 33 | <circle cx="12" cy="12" r="10"></circle> |
| 34 | <polyline points="12 6 12 12 16 14"></polyline> |
| 35 | </svg> |
| 36 | <?php esc_html_e('Later', 'wp-staging'); ?> |
| 37 | </button> |
| 38 | <button |
| 39 | type="button" |
| 40 | class="wpstg-btn wpstg-btn-sm wpstg-btn-ghost wpstg-banner-dismiss-btn" |
| 41 | id="wpstg-cli-notice-hide-forever" |
| 42 | aria-label="<?php esc_attr_e('Don\'t show this notice again', 'wp-staging'); ?>" |
| 43 | > |
| 44 | <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"> |
| 45 | <path d="M18 6 6 18"/> |
| 46 | <path d="m6 6 12 12"/> |
| 47 | </svg> |
| 48 | <?php esc_html_e('Dismiss', 'wp-staging'); ?> |
| 49 | </button> |
| 50 | </div> |
| 51 | |
| 52 | <!-- Main content area --> |
| 53 | <div class="wpstg-banner-content"> |
| 54 | <!-- Icon box (blue tint) --> |
| 55 | <div class="wpstg-icon-box wpstg-icon-box-blue wpstg-banner-icon-box"> |
| 56 | <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"> |
| 57 | <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> |
| 58 | <polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline> |
| 59 | <line x1="12" y1="22.08" x2="12" y2="12"></line> |
| 60 | </svg> |
| 61 | </div> |
| 62 | |
| 63 | <!-- Text content --> |
| 64 | <div class="wpstg-banner-text"> |
| 65 | <div class="wpstg-banner-header"> |
| 66 | <span class="wpstg-badge-new"><?php esc_html_e('NEW', 'wp-staging'); ?></span> |
| 67 | <h3 class="wpstg-banner-title"> |
| 68 | <?php esc_html_e('Local Docker Environments', 'wp-staging'); ?> |
| 69 | </h3> |
| 70 | </div> |
| 71 | <p class="wpstg-banner-description"> |
| 72 | <?php esc_html_e('Turn backups into local Docker sites with one command. Perfect for development and testing.', 'wp-staging'); ?> |
| 73 | </p> |
| 74 | <?php if ($isDeveloperOrHigher) : ?> |
| 75 | <p class="wpstg-banner-plan-info"> |
| 76 | <?php |
| 77 | printf( |
| 78 | esc_html__('Included in your %s plan.', 'wp-staging'), |
| 79 | '<strong>' . esc_html($planName) . '</strong>' |
| 80 | ); |
| 81 | ?> |
| 82 | </p> |
| 83 | <?php else : ?> |
| 84 | <p class="wpstg-banner-plan-info"> |
| 85 | <?php |
| 86 | printf( |
| 87 | esc_html__('Requires Developer plan or higher. Your plan: %s.', 'wp-staging'), |
| 88 | '<strong>' . esc_html($planName) . '</strong>' |
| 89 | ); |
| 90 | ?> |
| 91 | </p> |
| 92 | <?php endif; ?> |
| 93 | |
| 94 | <!-- Action buttons aligned with text --> |
| 95 | <div class="wpstg-banner-buttons"> |
| 96 | <?php if ($isDeveloperOrHigher) : ?> |
| 97 | <button type="button" class="wpstg-btn wpstg-btn-sm wpstg-btn-primary" id="wpstg-cli-install-button"> |
| 98 | <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"> |
| 99 | <path d="M12 10v6"></path> |
| 100 | <path d="M9 13h6"></path> |
| 101 | <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> |
| 102 | </svg> |
| 103 | <?php esc_html_e('Create Local Site', 'wp-staging'); ?> |
| 104 | </button> |
| 105 | <?php else : ?> |
| 106 | <?php |
| 107 | if ($hasActiveLicense) { |
| 108 | $upgradeUrl = admin_url('admin.php?page=wpstg-license'); |
| 109 | $isExternalUrl = false; |
| 110 | } else { |
| 111 | $upgradeUrl = \WPStaging\Framework\Language\Language::localizeCheckoutUrl('https://wp-staging.com/checkout/?edd_action=add_to_cart&download_id=11&edd_options[price_id]=13'); |
| 112 | $isExternalUrl = true; |
| 113 | } |
| 114 | ?> |
| 115 | <a href="<?php echo esc_url($upgradeUrl); ?>" <?php echo $isExternalUrl ? 'target="_blank" rel="noreferrer noopener"' : ''; ?> class="wpstg-btn wpstg-btn-sm wpstg-btn-primary"> |
| 116 | <?php esc_html_e('Upgrade Plan', 'wp-staging'); ?> |
| 117 | </a> |
| 118 | <?php endif; ?> |
| 119 | <?php |
| 120 | $locale = function_exists('get_user_locale') ? get_user_locale() : get_locale(); |
| 121 | $learnMoreUrl = strpos($locale, 'de_') === 0 |
| 122 | ? 'https://wp-staging.com/de/cli/upgrade/' |
| 123 | : 'https://wp-staging.com/cli/upgrade/'; |
| 124 | |
| 125 | $learnMoreParams = [ |
| 126 | 'utm_source' => 'wp-staging', |
| 127 | 'utm_medium' => 'plugin', |
| 128 | 'utm_campaign' => 'cli_upgrade', |
| 129 | 'utm_content' => 'cli_notice', |
| 130 | ]; |
| 131 | if (!empty($licenseType)) { |
| 132 | $learnMoreParams['plan'] = $licenseType; |
| 133 | } |
| 134 | |
| 135 | if (!empty($licenseId)) { |
| 136 | $learnMoreParams['license_id'] = $licenseId; |
| 137 | } |
| 138 | |
| 139 | $learnMoreUrl = add_query_arg($learnMoreParams, $learnMoreUrl); |
| 140 | ?> |
| 141 | <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"> |
| 142 | <?php esc_html_e('Learn More', 'wp-staging'); ?> |
| 143 | <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"> |
| 144 | <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path> |
| 145 | <polyline points="15 3 21 3 21 9"></polyline> |
| 146 | <line x1="10" y1="14" x2="21" y2="3"></line> |
| 147 | </svg> |
| 148 | </a> |
| 149 | </div> |
| 150 | </div> |
| 151 | </div> |
| 152 | </div> |
| 153 | |
| 154 | <?php |
| 155 | // Include the modal content (hidden until triggered by JS) — only once per page |
| 156 | if (empty($GLOBALS['wpstg_cli_modal_rendered'])) { |
| 157 | include __DIR__ . '/../cli/cli-integration-modal.php'; |
| 158 | $GLOBALS['wpstg_cli_modal_rendered'] = true; |
| 159 | } |
| 160 | ?> |
| 161 |