ajax
2 years ago
multi-site
3 years ago
single-site
3 years ago
staging-site
2 years ago
wordpress-com
2 years ago
index.php
2 years ago
index.php
157 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @see \WPStaging\Backend\Administrator::getClonePage() |
| 5 | * @see \WPStaging\Backend\Administrator::getBackupPage() |
| 6 | * @var bool $isBackupPage |
| 7 | */ |
| 8 | |
| 9 | use WPStaging\Core\WPStaging; |
| 10 | use WPStaging\Framework\Notices\BackupPluginsNotice; |
| 11 | use WPStaging\Framework\Notices\Notices; |
| 12 | use WPStaging\Framework\Notices\OutdatedWpStagingNotice; |
| 13 | |
| 14 | $backupNotice = WPStaging::make(BackupPluginsNotice::class); |
| 15 | |
| 16 | ?> |
| 17 | |
| 18 | <div id="wpstg-clonepage-wrapper"> |
| 19 | <?php |
| 20 | require_once($this->path . 'views/_main/header.php'); |
| 21 | |
| 22 | do_action('wpstg_notifications'); |
| 23 | |
| 24 | if (isset($isBackupPage)) { |
| 25 | echo "<script>window.addEventListener('DOMContentLoaded', function() {window.dispatchEvent(new Event('backups-tab'));});</script>"; |
| 26 | $classStagingPageActive = ''; |
| 27 | $classBackupPageActive = 'wpstg--tab--active'; |
| 28 | } else { |
| 29 | $classStagingPageActive = 'wpstg--tab--active'; |
| 30 | $classBackupPageActive = ''; |
| 31 | } |
| 32 | |
| 33 | ?> |
| 34 | <div class="wpstg--tab--wrapper"> |
| 35 | <div class="wpstg--tab--header"> |
| 36 | <ul> |
| 37 | <li> |
| 38 | <a class="wpstg--tab--content <?php echo esc_attr($classStagingPageActive); ?> wpstg-button" data-target="#wpstg--tab--staging" id="wpstg--tab--toggle--staging"> |
| 39 | <?php esc_html_e('Staging', 'wp-staging') ?> |
| 40 | </a> |
| 41 | </li> |
| 42 | <li> |
| 43 | <a class="wpstg-button <?php echo esc_attr($classBackupPageActive); ?>" data-target="#wpstg--tab--backup" id="wpstg--tab--toggle--backup"> |
| 44 | <?php esc_html_e('Backup & Migration', 'wp-staging') ?> |
| 45 | </a> |
| 46 | <?php $backupNotice->maybeShowBackupNotice(); ?> |
| 47 | </li> |
| 48 | <li> |
| 49 | <a href="<?php echo esc_url(get_admin_url()) . 'admin.php?page=wpstg-settings'; ?>" class="wpstg-button" data-target="" id="wpstg--tab--toggle--settigs"> |
| 50 | <?php esc_html_e('Settings', 'wp-staging') ?> |
| 51 | </a> |
| 52 | </li> |
| 53 | <li> |
| 54 | <a href="<?php echo esc_url(get_admin_url()) . 'admin.php?page=wpstg-tools'; ?>" class="wpstg-button" data-target="" id="wpstg--tab--toggle--systeminfo"> |
| 55 | <?php esc_html_e('System Info', 'wp-staging') ?> |
| 56 | </a> |
| 57 | </li> |
| 58 | <?php |
| 59 | if (defined('WPSTGPRO_VERSION')) { |
| 60 | $licenseMessage = isset($license->license) && $license->license === 'valid' ? '' : __('(Unregistered)', 'wp-staging'); |
| 61 | ?> |
| 62 | <li> |
| 63 | <a href="<?php echo esc_url(get_admin_url()) . 'admin.php?page=wpstg-license'; ?>" class="wpstg-button" data-target="" id="wpstg--tab--toggle--license"> |
| 64 | <?php esc_html_e('License', 'wp-staging'); ?> <span class="wpstg--red-warning"><?php echo esc_html($licenseMessage); ?></span> |
| 65 | </a> |
| 66 | </li> |
| 67 | <?php |
| 68 | } else { |
| 69 | ?> |
| 70 | <li> |
| 71 | <a href="https://wp-staging.com" target="_blank" class="wpstg-button" data-target="" id="wpstg--tab--toggle--license"> |
| 72 | <span class="wpstg--red-warning" style=""><?php echo esc_html(__('Upgrade to Pro', 'wp-staging')); ?> </span> |
| 73 | </a> |
| 74 | </li> |
| 75 | <?php |
| 76 | } |
| 77 | ?> |
| 78 | <li class="wpstg-contact-us-wrapper"> |
| 79 | <?php |
| 80 | require_once(WPSTG_PLUGIN_DIR . 'Backend/views/_main/contact-us.php'); |
| 81 | ?> |
| 82 | </li> |
| 83 | <li class="wpstg-tab-item--vert-center"> |
| 84 | <span class="wpstg-loader"></span> |
| 85 | </li> |
| 86 | </ul> |
| 87 | </div> |
| 88 | <div class="wpstg-header"> |
| 89 | <?php if (isset($_GET['page']) && $_GET['page'] === 'wpstg_clone' || $_GET['page'] === 'wpstg_backup') { ?> |
| 90 | <?php |
| 91 | $latestReleasedVersion = get_option('wpstg_version_latest'); |
| 92 | $display = 'none;'; |
| 93 | |
| 94 | if (defined('WPSTGPRO_VERSION')) { |
| 95 | $outdatedVersionCheck = new OutdatedWpStagingNotice(); |
| 96 | $latestReleasedVersion = $outdatedVersionCheck->getLatestWpstgProVersion(); |
| 97 | if ($outdatedVersionCheck->isOutdatedWpStagingProVersion()) { |
| 98 | $display = 'block;'; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | if (Notices::SHOW_ALL_NOTICES){ |
| 103 | $display = 'block;'; |
| 104 | } |
| 105 | ?> |
| 106 | |
| 107 | <div id="wpstg-update-notify" style="display:<?php echo esc_attr($display); ?>"> |
| 108 | <strong><?php echo sprintf(__("New: WP Staging Pro v. %s is available.", 'wp-staging'), esc_html($latestReleasedVersion)); ?></strong><br/> |
| 109 | <?php echo sprintf(__('Important: It\'s recommended to update the plugin before pushing a staging site to the live site. <a href="%s" target="_blank">What\'s New?</a>', 'wp-staging'), 'https://wp-staging.com/wp-staging-pro-changelog'); ?> |
| 110 | </div> |
| 111 | |
| 112 | <?php } ?> |
| 113 | </div> |
| 114 | <div class="wpstg-loading-bar-container"> |
| 115 | <div class="wpstg-loading-bar"></div> |
| 116 | </div> |
| 117 | <div class="wpstg--tab--contents"> |
| 118 | <div id="wpstg--tab--staging" class="wpstg--tab--content <?php echo esc_attr($classStagingPageActive); ?>"> |
| 119 | <?php |
| 120 | if (!$this->siteInfo->isCloneable()) { |
| 121 | // Staging site but not cloneable |
| 122 | require_once($this->path . "views/clone/staging-site/index.php"); |
| 123 | } elseif (!defined('WPSTGPRO_VERSION') && is_multisite()) { |
| 124 | require_once($this->path . "views/clone/multi-site/index.php"); |
| 125 | } else { |
| 126 | require_once($this->path . "views/clone/single-site/index.php"); |
| 127 | } |
| 128 | ?> |
| 129 | </div> |
| 130 | <div id="wpstg--tab--backup" class="wpstg--tab--content <?php echo esc_attr($classBackupPageActive); ?>"> |
| 131 | <?php |
| 132 | if (!WPStaging::isPro()) { |
| 133 | esc_html_e('Loading...', 'wp-staging'); |
| 134 | } elseif (is_multisite() && is_main_site()) { |
| 135 | esc_html_e('Loading...', 'wp-staging'); |
| 136 | } else { |
| 137 | require_once($this->path . "views/backup/free-version.php"); |
| 138 | } |
| 139 | ?> |
| 140 | </div> |
| 141 | </div> |
| 142 | <?php |
| 143 | // Show ad for pro version |
| 144 | if (!defined('WPSTGPRO_VERSION')) { |
| 145 | echo ' <div class="wpstg--tab-contents">'; |
| 146 | require $this->path . 'views/ads/advert-pro-version.php'; |
| 147 | echo '</div>'; |
| 148 | } |
| 149 | ?> |
| 150 | </div> |
| 151 | <div id="wpstg-error-wrapper"> |
| 152 | <div id="wpstg-error-details"></div> |
| 153 | </div> |
| 154 | <?php require_once($this->path . 'views/_main/faq.php') ?> |
| 155 | <?php require_once($this->path . 'views/_main/footer.php') ?> |
| 156 | </div> |
| 157 |