PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.1.2
Backup Migration v2.1.2
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / includes / dashboard / chapter / staging.php
backup-backup / includes / dashboard / chapter Last commit date
AA-Template.php 3 months ago other_config.php 3 months ago save-button.php 3 months ago staging.php 3 months ago store_config.php 3 months ago troubleshooting.php 3 months ago what_backed_up.php 3 months ago where_config.php 3 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 echo wp_kses_post( __('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 esc_html_e('Your server & domain', 'backup-backup'); ?></div>
30 <div class="bmi-stg-sel-benefits">
31 <ul>
32 <li><?php echo wp_kses_post( __('Keep all files on <b>your server</b>', 'backup-backup') ); ?></li>
33 <li><?php echo wp_kses_post( __('<b>Define the subpath</b> for your staging site', 'backup-backup') ); ?></li>
34 <li><?php esc_html_e('Free for any size and no expiry', 'backup-backup'); ?></li>
35 <li><?php echo wp_kses_post( __('<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 wp_kses_post( 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 wp_kses_post( 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 echo wp_kses_post( __('<b>Play around</b> without impacting your live server and domain', 'backup-backup') ); ?></li>
45 <li><?php echo wp_kses_post( __('Use <b>any (partial or full) backup</b> for the copy', 'backup-backup') ); ?></li>
46 <li><?php echo wp_kses_post( 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 and 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 esc_html_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 esc_url( home_url() ); ?>/</span> <input type="text" autocomplete="off" id="bmi-stg-subname-input" placeholder="<?php esc_attr_e('staging', 'backup-backup'); ?>">
60 </div>
61 </div>
62 <div class="bmi-stg-creation-button">
63 <button
64 c-error="<?php esc_attr_e('There was some error during validation, please refresh and try again.', 'backup-backup'); ?>"
65 c-errorProcess="<?php esc_attr_e('There was some error during the process, please follow after error instructions.', 'backup-backup'); ?>"
66 c-empty="<?php esc_attr_e('You have to provide some staging site name before process.', 'backup-backup'); ?>"
67 c-long="<?php esc_attr_e('Staging site name cannot be longer than 24 characters.', 'backup-backup'); ?>"
68 c-invalid="<?php esc_attr_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 esc_html_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 esc_html_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 esc_html_e('Loading, please wait...', 'backup-backup'); ?></div>
88 <span class="bmi-stg-option-date"><b><?php esc_html_e('Created:', 'backup-backup'); ?></b>&nbsp;<i>---</i></span>
89 <span class="bmi-stg-option-size"><b><?php esc_html_e('Size:', 'backup-backup'); ?></b>&nbsp;<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 wp_kses_post( 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 esc_html_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 wp_kses_post( 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 esc_html_e('Create backup!', 'backup-backup'); ?></button>
114 </div>
115 </div>
116
117 <!-- STAGING SITES LIST HEADING -->
118 <div class="staging-heading">
119 <?php echo wp_kses_post( __('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 esc_html_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 esc_attr_e('Name of desired staging site - can be modified', 'backup-backup') ?>." data-top="5">
133 <?php esc_html_e('Name', 'backup-backup') ?>
134 </div>
135 </th>
136 <th>
137 <div class="inline tooltip" tooltip="<?php esc_attr_e('URL of the staging site', 'backup-backup') ?>." data-top="5">
138 <?php esc_html_e('URL', 'backup-backup') ?>
139 </div>
140 </th>
141 <th>
142 <div class="inline tooltip" tooltip="<?php esc_attr_e('Size and files at moment of creation', 'backup-backup') ?>." data-top="5">
143 <?php esc_html_e('Size (files)', 'backup-backup') ?>
144 </div>
145 </th>
146 <th>
147 <div class="inline tooltip" tooltip="<?php esc_attr_e('Where the site is created', 'backup-backup') ?>." data-top="5">
148 <?php esc_html_e('Server', 'backup-backup') ?>
149 </div>
150 </th>
151 <th>
152 <div class="inline tooltip" tooltip="<?php esc_attr_e('When the staging site was created', 'backup-backup') ?>." data-top="5">
153 <?php esc_html_e('Creation date', 'backup-backup') ?>
154 </div>
155 </th>
156 <th>
157 <div class="inline tooltip" tooltip="<?php esc_attr_e('When the staging site will be removed', 'backup-backup') ?>." data-top="5">
158 <?php esc_html_e('Expires in', 'backup-backup') ?>
159 </div>
160 </th>
161 <th>
162 <div class="inline tooltip" tooltip="<?php esc_attr_e('Move over the icons to see what you can do with staging site', 'backup-backup') ?>." data-top="5">
163 <?php esc_html_e('Actions', 'backup-backup') ?>
164 </div>
165 </th>
166 </tr>
167 </thead>
168 <tbody id="stg-tbody-table" data-empty="<?php esc_attr_e('You have not created any staging site yet.', 'backup-backup'); ?>" data-local="<?php esc_attr_e('Local', 'backup-backup'); ?>" data-prefix="<?php esc_attr_e('Database Prefix', 'backup-backup') ?>" data-never="<?php esc_attr_e('Never', 'backup-backup') ?>" data-display="<?php esc_attr_e('Display name', 'backup-backup') ?>" data-original="<?php esc_attr_e('Original name', 'backup-backup') ?>">
169 <tr>
170 <td colspan="100%" class="center"><?php esc_html_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 esc_url($this->get_asset('images', 'search-min.png')); ?>" width="15px" alt="image">
181 </div>
182 <div class="left f16">
183 <?php esc_html_e('Update status of staging sites:', 'backup-backup') ?>
184 <a href="#" id="rescan-for-staging" class="secondary hoverable"><?php esc_html_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 esc_html_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 esc_html_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 esc_html_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 :)', 'backup-backup'); ?>
209 </i>
210 </div>
211 </div>
212 </div>
213
214 <?php endif; ?>
215