AA-Template.php
11 months ago
other_config.php
11 months ago
save-button.php
11 months ago
staging.php
11 months ago
store_config.php
11 months ago
troubleshooting.php
11 months ago
what_backed_up.php
11 months ago
where_config.php
11 months ago
staging.php
215 lines
| 1 | <?php |
| 2 | |
| 3 | // Namespace |
| 4 | namespace BMI\Plugin\Dashboard; |
| 5 | |
| 6 | // Exit on direct access |
| 7 | if (!defined('ABSPATH')) exit; |
| 8 | |
| 9 | ?> |
| 10 | |
| 11 | <!-- Templates --> |
| 12 | <div style="display: none; visibility: none;" class="hide"> |
| 13 | |
| 14 | <!-- Staging Option Row Template --> |
| 15 | <?php include BMI_INCLUDES . '/dashboard/templates/stg-option-template.php'; ?> |
| 16 | |
| 17 | </div> |
| 18 | |
| 19 | <?php if (!file_exists(ABSPATH . '.bmi_staging')): ?> |
| 20 | |
| 21 | <!-- STAGING SITES: MODE SELECTOR HEADING --> |
| 22 | <div class="staging-heading"> |
| 23 | <?php _e('Create a <b>staging site</b> on:', 'backup-backup'); ?> |
| 24 | </div> |
| 25 | |
| 26 | <!-- STAGING SITES: MODE SELECTOR --> |
| 27 | <div class="bmi-stg-flex"> |
| 28 | <div class="bmi-stg-sel-box bmi-active" data-mode="local"> |
| 29 | <div class="bmi-stg-sel-header"><?php _e('Your server & domain', 'backup-backup'); ?></div> |
| 30 | <div class="bmi-stg-sel-benefits"> |
| 31 | <ul> |
| 32 | <li><?php _e('Keep all files on <b>your server</b>', 'backup-backup'); ?></li> |
| 33 | <li><?php _e('<b>Define the subpath</b> for your staging site', 'backup-backup'); ?></li> |
| 34 | <li><?php _e('Use (all) your <b>current live files</b> for the copy', 'backup-backup'); ?></li> |
| 35 | <li><?php _e('<b>Free</b> for any size & <b>no expiry</b>', 'backup-backup'); ?></li> |
| 36 | </ul> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="bmi-stg-sel-box" data-mode="tastewp"> |
| 40 | <div class="bmi-stg-sel-header"><?php echo str_replace('%s1%', 'href="https://tastewp.com" target="_blank"', __('TasteWP <a %s1%>(external server)</a>', 'backup-backup')); ?></div> |
| 41 | <div class="bmi-stg-sel-benefits"> |
| 42 | <ul> |
| 43 | <li><?php echo str_replace('%s', 'href="https://tastewp.com/?open=privacy" target="_blank"', __('Files are <b>protected</b> and <a %s>stay confidential</a>', 'backup-backup')); ?></li> |
| 44 | <li><?php _e('<b>Play around</b> without impacting your live server & domain', 'backup-backup'); ?></li> |
| 45 | <li><?php _e('Use <b>any (partial or full) backup</b> for the copy', 'backup-backup'); ?></li> |
| 46 | <li><?php echo str_replace('%s1%', 'href="https://tastewp.com/?open=login" target="_blank"', str_replace('%s2%', 'href="https://tastewp.com/premium-show" target="_blank"', __('Free for <b>up to 1GB & 2 days</b> (or 7 days if <a %s1%>logged in</a>) – remove limits by <a %s2%>upgrading</a>', 'backup-backup'))); ?></li> |
| 47 | </ul> |
| 48 | </div> |
| 49 | </div> |
| 50 | </div> |
| 51 | |
| 52 | <!-- STAGING SITES: LOCAL OPTION --> |
| 53 | <div class="bmi-stg-creation-box shadow bmi-stg-creation-box-local"> |
| 54 | <div class="bmi-stg-creation-title"> |
| 55 | <?php _e('Define the path for your staging site:', 'backup-backup'); ?> |
| 56 | </div> |
| 57 | <div class="bmi-stg-creation-content"> |
| 58 | <div class="bmi-stg-creation-menu"> |
| 59 | <span id="bmi-stg-homeurl"><?php echo home_url(); ?>/</span> <input type="text" autocomplete="off" id="bmi-stg-subname-input" placeholder="<?php _e('staging', 'backup-backup'); ?>"> |
| 60 | </div> |
| 61 | </div> |
| 62 | <div class="bmi-stg-creation-button"> |
| 63 | <button |
| 64 | c-error="<?php _e('There was some error during validation, please refresh and try again.', 'backup-backup'); ?>" |
| 65 | c-errorProcess="<?php _e('There was some error during the process, please follow after error instructions.', 'backup-backup'); ?>" |
| 66 | c-empty="<?php _e('You have to provide some staging site name before process.', 'backup-backup'); ?>" |
| 67 | c-long="<?php _e('Staging site name cannot be longer than 24 characters.', 'backup-backup'); ?>" |
| 68 | c-invalid="<?php _e('Provided name contains prohibited characters.', 'backup-backup'); ?>" |
| 69 | type="button" |
| 70 | class="btn i-staging-creator-local" |
| 71 | id="stg-notices-button"> |
| 72 | <?php _e('Create staging site!', 'backup-backup'); ?> |
| 73 | </button> |
| 74 | </div> |
| 75 | </div> |
| 76 | |
| 77 | <!-- STAGING SITES: TASTEWP SELECTED --> |
| 78 | <div class="bmi-stg-creation-box shadow bmi-stg-creation-box-tastewp" style="display: none;"> |
| 79 | <div class="bmi-stg-creation-title"> |
| 80 | <?php _e('Which backup do you want to use for your staging site?', 'backup-backup'); ?> |
| 81 | </div> |
| 82 | <div class="bmi-stg-creation-content"> |
| 83 | <div class="bmi-stg-creation-menu"> |
| 84 | <input type="text" hidden id="bmi-stg-current-backup-selected" value="" autocomplete="off"> |
| 85 | <div class="bmi-stg-dropdown-area"> |
| 86 | <div class="bmi-stg-dropdown-area-selector"> |
| 87 | <div class="bmi-stg-option-name"><?php _e('Loading, please wait...', 'backup-backup'); ?></div> |
| 88 | <span class="bmi-stg-option-date"><b><?php _e('Created:', 'backup-backup'); ?></b> <i>---</i></span> |
| 89 | <span class="bmi-stg-option-size"><b><?php _e('Size:', 'backup-backup'); ?></b> <i>---</i></span> |
| 90 | </div> |
| 91 | <div class="bmi-stg-dropdown-area-options"> |
| 92 | <div class="bmi-stg-dropdown-area-inner-scroll"></div> |
| 93 | </div> |
| 94 | </div> |
| 95 | </div> |
| 96 | <div class="bmi-stg-creation-description"> |
| 97 | <?php echo str_replace('%s1%', '<a href="#!" class="bmi-stg-tab-backups i-backup-creator-trigger">', str_replace('%s2%', '</a>', __('To take the current live files, please first %s1%create a backup%s2%.', 'backup-backup'))); ?> |
| 98 | </div> |
| 99 | </div> |
| 100 | <div class="bmi-stg-creation-button"> |
| 101 | <button type="button" class="btn i-staging-creator-tastewp"><?php _e('Create staging site!', 'backup-backup'); ?></button> |
| 102 | </div> |
| 103 | </div> |
| 104 | |
| 105 | <!-- STAGING SITES: TASTEWP SELECTED BUT NO BACKUPS --> |
| 106 | <div class="bmi-stg-creation-box shadow bmi-stg-creation-box-tastewp-empty" style="display: none;"> |
| 107 | <div class="bmi-stg-creation-content"> |
| 108 | <div class="bmi-stg-creation-description"> |
| 109 | <i><?php echo str_replace('%s1%', '<a href="#!" class="bmi-stg-tab-backups i-backup-creator-trigger">', str_replace('%s2%', '</a>', __('Please first %s1%create a backup%s2% so that it can be used for your staging site.', 'backup-backup'))); ?></i> |
| 110 | </div> |
| 111 | </div> |
| 112 | <div class="bmi-stg-creation-button"> |
| 113 | <button type="button" class="btn i-backup-creator-trigger"><?php _e('Create backup!', 'backup-backup'); ?></button> |
| 114 | </div> |
| 115 | </div> |
| 116 | |
| 117 | <!-- STAGING SITES LIST HEADING --> |
| 118 | <div class="staging-heading"> |
| 119 | <?php _e('Your <b>staging site(s)</b> list:', 'backup-backup'); ?> |
| 120 | </div> |
| 121 | |
| 122 | <!-- STAGING SITES LIST --> |
| 123 | <div class="staging-list-wrapper shadow fullwidth rbb rbt"> |
| 124 | |
| 125 | <div class="f22 regular m mbl"><?php _e("Your active staging sites:", 'backup-backup'); ?></div> |
| 126 | |
| 127 | <div class="table-wrapper" id="bmi-stg-table"> |
| 128 | <table> |
| 129 | <thead> |
| 130 | <tr> |
| 131 | <th> |
| 132 | <div class="inline tooltip" tooltip="<?php _e('Name of desired staging site - can be modified', 'backup-backup') ?>." data-top="5"> |
| 133 | <?php _e('Name', 'backup-backup') ?> |
| 134 | </div> |
| 135 | </th> |
| 136 | <th> |
| 137 | <div class="inline tooltip" tooltip="<?php _e('URL of the staging site', 'backup-backup') ?>." data-top="5"> |
| 138 | <?php _e('URL', 'backup-backup') ?> |
| 139 | </div> |
| 140 | </th> |
| 141 | <th> |
| 142 | <div class="inline tooltip" tooltip="<?php _e('Size and files at moment of creation', 'backup-backup') ?>." data-top="5"> |
| 143 | <?php _e('Size (files)', 'backup-backup') ?> |
| 144 | </div> |
| 145 | </th> |
| 146 | <th> |
| 147 | <div class="inline tooltip" tooltip="<?php _e('Where the site is created', 'backup-backup') ?>." data-top="5"> |
| 148 | <?php _e('Server', 'backup-backup') ?> |
| 149 | </div> |
| 150 | </th> |
| 151 | <th> |
| 152 | <div class="inline tooltip" tooltip="<?php _e('When the staging site was created', 'backup-backup') ?>." data-top="5"> |
| 153 | <?php _e('Creation date', 'backup-backup') ?> |
| 154 | </div> |
| 155 | </th> |
| 156 | <th> |
| 157 | <div class="inline tooltip" tooltip="<?php _e('When the staging site will be removed', 'backup-backup') ?>." data-top="5"> |
| 158 | <?php _e('Expires in', 'backup-backup') ?> |
| 159 | </div> |
| 160 | </th> |
| 161 | <th> |
| 162 | <div class="inline tooltip" tooltip="<?php _e('Move over the icons to see what you can do with staging site', 'backup-backup') ?>." data-top="5"> |
| 163 | <?php _e('Actions', 'backup-backup') ?> |
| 164 | </div> |
| 165 | </th> |
| 166 | </tr> |
| 167 | </thead> |
| 168 | <tbody id="stg-tbody-table" data-empty="<?php _e('You have not created any staging site yet.', 'backup-backup'); ?>" data-local="<?php _e('Local', 'backup-backup'); ?>" data-prefix="<?php _e('Database Prefix', 'backup-backup') ?>" data-never="<?php _e('Never', 'backup-backup') ?>" data-display="<?php _e('Display name', 'backup-backup') ?>" data-original="<?php _e('Original name', 'backup-backup') ?>"> |
| 169 | <tr> |
| 170 | <td colspan="100%" class="center"><?php _e('You have not created any staging site yet.', 'backup-backup'); ?></td> |
| 171 | </tr> |
| 172 | </tbody> |
| 173 | </table> |
| 174 | </div> |
| 175 | |
| 176 | <div class="cf lh28 valign-staging"> |
| 177 | |
| 178 | <div class="left cf"> |
| 179 | <div class="left"> |
| 180 | <img class="a1" src="<?php echo $this->get_asset('images', 'search-min.png'); ?>" width="15px" alt="image"> |
| 181 | </div> |
| 182 | <div class="left f16"> |
| 183 | <?php _e('Update status of staging sites:', 'backup-backup') ?> |
| 184 | <a href="#" id="rescan-for-staging" class="secondary hoverable"><?php _e('Refresh', 'backup-backup') ?></a> |
| 185 | <span id="reloading-bm-stg-list" style="display: none;"><div class="spinner-loader"></div></span> |
| 186 | </div> |
| 187 | </div> |
| 188 | |
| 189 | </div> |
| 190 | </div> |
| 191 | |
| 192 | <?php else: ?> |
| 193 | |
| 194 | <!-- ON STAGING SITE --> |
| 195 | <style media="screen"> |
| 196 | .stg-restore-btn { display: none !important; } |
| 197 | </style> |
| 198 | <div class="bmi-stg-creation-box shadow bmi-stg-creation-box-local"> |
| 199 | <div class="bmi-stg-creation-title"> |
| 200 | <?php _e('You are already on a staging site!', 'backup-backup'); ?> |
| 201 | </div> |
| 202 | <div class="bmi-stg-creation-content"> |
| 203 | <div class="bmi-stg-creation-description"> |
| 204 | <br /> |
| 205 | <br /> |
| 206 | <i> |
| 207 | <?php _e("Currently that's all you can do, we're working on a feature that will allow you to merge your staging site with your live site in one click.", 'backup-backup'); ?><br /> |
| 208 | <?php _e('For now, you can simply create a backup of this (staging) site, and restore it on your live site which will do the trick as well :)'); ?> |
| 209 | </i> |
| 210 | </div> |
| 211 | </div> |
| 212 | </div> |
| 213 | |
| 214 | <?php endif; ?> |
| 215 |