pro-upgrade-card.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Compact, dismissible general "Upgrade to Pro" card. |
| 5 | * |
| 6 | * Shown below the main operational UI on the Staging dashboard for any Free |
| 7 | * build (including when the Pro plugin is installed but inactive), when the |
| 8 | * admin can manage settings and has not snoozed it. The caller |
| 9 | * (views/staging/listing.php) handles the eligibility gate. |
| 10 | * |
| 11 | * Dismissal reuses the shared wpstg_dismiss_notice AJAX via the notice id |
| 12 | * "general_pro_card" (handled by the page-level delegated handler in |
| 13 | * views/clone/index.php, since the listing is injected via innerHTML). It |
| 14 | * snoozes the card for 90 days per admin; it never disables contextual Pro |
| 15 | * prompts, Pro badges, the Upgrade navigation, or the permanent Compare card. |
| 16 | * |
| 17 | * @see \WPStaging\Staging\Ajax\Listing::ajaxListing |
| 18 | * @see \WPStaging\Basic\Notices\GeneralProCardNotice |
| 19 | */ |
| 20 | |
| 21 | use WPStaging\Framework\Language\Language; |
| 22 | |
| 23 | $upgradeUrl = Language::getUpgradeUrl('dashboard_upgrade_card'); |
| 24 | $compareUrl = Language::localizeUrl('https://wp-staging.com/pro-features/?utm_source=wp-admin&utm_medium=staging_dashboard&utm_campaign=pro_card'); |
| 25 | |
| 26 | $proFeatures = [ |
| 27 | esc_html__('Push to production', 'wp-staging'), |
| 28 | esc_html__('Cloud backups', 'wp-staging'), |
| 29 | esc_html__('Unlimited schedules', 'wp-staging'), |
| 30 | esc_html__('Migrations', 'wp-staging'), |
| 31 | esc_html__('Multisite', 'wp-staging'), |
| 32 | esc_html__('CLI and local Docker', 'wp-staging'), |
| 33 | ]; |
| 34 | ?> |
| 35 | <div class="wpstg-general-pro-card wpstg-card wpstg-mt-5" style="position:relative;max-width:777px;"> |
| 36 | <a href="javascript:void(0);" |
| 37 | class="wpstg-pro-card-dismiss wpstg-text-gray-400" |
| 38 | aria-label="<?php esc_attr_e('Dismiss Pro upgrade card', 'wp-staging'); ?>" |
| 39 | title="<?php esc_attr_e('Dismiss Pro upgrade card', 'wp-staging'); ?>" |
| 40 | style="position:absolute;top:12px;right:16px;font-size:18px;line-height:1;text-decoration:none;">×</a> |
| 41 | <div class="wpstg-card-body"> |
| 42 | <p class="wpstg-text-lg wpstg-font-semibold wpstg-mt-0 wpstg-mb-1"> |
| 43 | <?php esc_html_e('Need push-to-live, cloud backups, or migrations?', 'wp-staging'); ?> |
| 44 | </p> |
| 45 | <p class="wpstg-mt-0 wpstg-mb-4 wpstg-text-sm wpstg-text-gray-500 dark:wpstg-text-slate-400"> |
| 46 | <?php esc_html_e('WP Staging Pro adds one-click deployment, off-site cloud backups, unlimited schedules, site migrations, Multisite support, and developer workflows.', 'wp-staging'); ?> |
| 47 | </p> |
| 48 | <ul class="wpstg-flex wpstg-flex-wrap wpstg-gap-x-4 wpstg-gap-y-1 wpstg-mb-3" style="list-style:none;padding:0;margin:0 0 16px;max-width:640px;"> |
| 49 | <?php foreach ($proFeatures as $feature) : ?> |
| 50 | <li class="wpstg-flex wpstg-items-center wpstg-gap-1 wpstg-text-sm" style="flex:0 0 calc(50% - 16px);"> |
| 51 | <span class="wpstg-text-blue-700" aria-hidden="true" style="font-weight:700;">✓</span> |
| 52 | <?php echo esc_html($feature); ?> |
| 53 | </li> |
| 54 | <?php endforeach; ?> |
| 55 | </ul> |
| 56 | <div class="wpstg-flex wpstg-flex-wrap wpstg-gap-3"> |
| 57 | <a class="wpstg-btn wpstg-btn-md wpstg-btn-pro" href="<?php echo esc_url($upgradeUrl); ?>" target="_blank" rel="noopener noreferrer"> |
| 58 | <?php esc_html_e('Upgrade to Pro', 'wp-staging'); ?> |
| 59 | </a> |
| 60 | <a class="wpstg-btn wpstg-btn-md wpstg-btn-outline" href="<?php echo esc_url($compareUrl); ?>" target="_blank" rel="noopener noreferrer"> |
| 61 | <?php esc_html_e('Compare Free vs Pro', 'wp-staging'); ?> |
| 62 | </a> |
| 63 | </div> |
| 64 | </div> |
| 65 | </div> |
| 66 |