_partials
1 day ago
setup
2 weeks ago
staging-site
1 year ago
wordpress-com
3 months ago
confirm-delete.php
2 weeks ago
free-version.php
1 day ago
index.php
4 months ago
listing.php
1 day ago
setup.php
1 day ago
staging-site-list-item.php
1 day ago
confirm-delete.php
347 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @see \WPStaging\Staging\Ajax\Delete\DeleteConfirm::ajaxConfirm() |
| 5 | * @var WPStaging\Staging\Dto\StagingSiteDto $stagingSite |
| 6 | * @var WPStaging\Framework\Database\TableDto[] $tables |
| 7 | * @var bool $isDatabaseConnected |
| 8 | * @var string $stagingSiteSize |
| 9 | */ |
| 10 | |
| 11 | use WPStaging\Framework\Facades\UI\Checkbox; |
| 12 | |
| 13 | require_once(WPSTG_VIEWS_DIR . 'job/modal/process.php'); |
| 14 | |
| 15 | $siteName = $stagingSite->getSiteName(); |
| 16 | $tablePrefix = $stagingSite->getUsedPrefix(); |
| 17 | $databaseName = $stagingSite->getDatabaseName(); |
| 18 | $stagingPath = $stagingSite->getPath(); |
| 19 | $stagingUrl = $stagingSite->getUrl(); |
| 20 | $stagingHost = preg_replace('#^https?://#', '', (string)$stagingUrl); |
| 21 | $folderLabel = $stagingSite->getDirectoryName(); |
| 22 | if (empty($folderLabel)) { |
| 23 | $folderLabel = basename($stagingPath); |
| 24 | } |
| 25 | |
| 26 | $stagingTables = []; |
| 27 | foreach ($tables as $table) { |
| 28 | if (strpos($table->getName(), $tablePrefix) === 0) { |
| 29 | $stagingTables[] = $table; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * A staging table holds sensitive data when its name maps to wp_options |
| 35 | * (settings) or wp_users / wp_usermeta (user accounts). Tag it so the design's |
| 36 | * amber chip + critical note can flag it. |
| 37 | */ |
| 38 | $sensitiveTag = function ($tableName) use ($tablePrefix) { |
| 39 | $suffix = substr($tableName, strlen($tablePrefix)); |
| 40 | if ($suffix === 'options') { |
| 41 | return 'settings'; |
| 42 | } |
| 43 | |
| 44 | if ($suffix === 'users' || $suffix === 'usermeta') { |
| 45 | return 'users'; |
| 46 | } |
| 47 | |
| 48 | return ''; |
| 49 | }; |
| 50 | |
| 51 | $wpstgIcons = [ |
| 52 | 'trash' => 'M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0', |
| 53 | 'warn' => 'M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z', |
| 54 | 'check' => 'M4.5 12.75l6 6 9-13.5', |
| 55 | 'server' => 'M21.75 17.25v-.228a4.5 4.5 0 00-.12-1.03l-2.268-9.64a3.375 3.375 0 00-3.285-2.602H7.923a3.375 3.375 0 00-3.285 2.602l-2.268 9.64a4.5 4.5 0 00-.12 1.03v.228m19.5 0a3 3 0 01-3 3H5.25a3 3 0 01-3-3m19.5 0a3 3 0 00-3-3H5.25a3 3 0 00-3 3m16.5 0h.008v.008h-.008v-.008zm-3 0h.008v.008h-.008v-.008z', |
| 56 | 'database' => 'M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125', |
| 57 | 'folder' => 'M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z', |
| 58 | 'clipboard' => 'M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25z', |
| 59 | 'disk' => 'M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z', |
| 60 | 'archive' => 'M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z', |
| 61 | 'external' => 'M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25', |
| 62 | 'x' => 'M6 18L18 6M6 6l12 12', |
| 63 | 'chevron' => 'M19.5 8.25l-7.5 7.5-7.5-7.5', |
| 64 | ]; |
| 65 | |
| 66 | /** |
| 67 | * Render an inline Heroicons-outline glyph. Color is inherited from the parent |
| 68 | * text color (currentColor); size is set in px. |
| 69 | */ |
| 70 | $wpstgIcon = function ($name, $size = 16, $classes = '', $strokeWidth = '1.75') use ($wpstgIcons) { |
| 71 | if (!isset($wpstgIcons[$name])) { |
| 72 | return; |
| 73 | } |
| 74 | |
| 75 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- SVG built from constant icon paths; all interpolated values are escaped. |
| 76 | printf( |
| 77 | '<svg class="%4$s" width="%1$d" height="%1$d" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="%2$s" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="%3$s"></path></svg>', |
| 78 | (int)$size, |
| 79 | esc_attr((string)$strokeWidth), |
| 80 | esc_attr($wpstgIcons[$name]), |
| 81 | esc_attr($classes) |
| 82 | ); |
| 83 | }; |
| 84 | ?> |
| 85 | |
| 86 | <div class="wpstg-delete-setup-modal wpstg-text-left" role="document" |
| 87 | data-wpstg-delete-site-name="<?php echo esc_attr($siteName); ?>"> |
| 88 | |
| 89 | <button type="button" class="wpstg-delete-modal-close" aria-label="<?php esc_attr_e('Close modal', 'wp-staging'); ?>"> |
| 90 | <?php $wpstgIcon('x', 18); ?> |
| 91 | </button> |
| 92 | |
| 93 | <header class="wpstg-delete-setup-modal__header"> |
| 94 | <span class="wpstg-delete-header-badge"> |
| 95 | <?php $wpstgIcon('trash', 20); ?> |
| 96 | </span> |
| 97 | <div class="wpstg-min-w-0 wpstg-flex-1"> |
| 98 | <h2 id="wpstg-delete-title" class="wpstg-u-m-0 wpstg-text-2xl wpstg-font-bold wpstg-leading-8 wpstg-text-[#001b3d] dark:wpstg-text-slate-100"> |
| 99 | <?php esc_html_e('Permanently delete staging site:', 'wp-staging'); ?> |
| 100 | <span class="wpstg-delete-site-name"><?php echo esc_html($siteName); ?></span> |
| 101 | </h2> |
| 102 | <p class="wpstg-u-m-0 wpstg-mt-1 wpstg-text-base wpstg-leading-6 wpstg-text-[#536579] dark:wpstg-text-slate-400"> |
| 103 | <?php esc_html_e('WP STAGING will delete the selected staging tables and staging files.', 'wp-staging'); ?> |
| 104 | </p> |
| 105 | </div> |
| 106 | </header> |
| 107 | |
| 108 | <div class="wpstg-delete-setup-modal__body"> |
| 109 | <div class="wpstg-delete-setup-modal__main"> |
| 110 | |
| 111 | <!-- Target identity — the single staging site being deleted. --> |
| 112 | <section class="wpstg-delete-section"> |
| 113 | <h3 class="wpstg-u-m-0 wpstg-mb-2.5 wpstg-text-[14px] wpstg-font-bold wpstg-text-gray-800 dark:wpstg-text-slate-100"> |
| 114 | <?php esc_html_e('Staging site to delete', 'wp-staging'); ?> |
| 115 | </h3> |
| 116 | <div class="wpstg-delete-identity-card"> |
| 117 | <div class="wpstg-flex wpstg-items-center wpstg-gap-2"> |
| 118 | <?php $wpstgIcon('server', 16, 'wpstg-flex-shrink-0 wpstg-text-red-500 dark:wpstg-text-red-400'); ?> |
| 119 | <span class="wpstg-min-w-0 wpstg-truncate wpstg-text-[14px] wpstg-font-bold wpstg-text-gray-900 dark:wpstg-text-slate-100"><?php echo esc_html($siteName); ?></span> |
| 120 | <span class="wpstg-delete-pill wpstg-delete-pill--blue"><?php esc_html_e('Staging site', 'wp-staging'); ?></span> |
| 121 | </div> |
| 122 | <div class="wpstg-mt-2.5 wpstg-grid wpstg-grid-cols-1 wpstg-gap-2.5 sm:wpstg-grid-cols-3"> |
| 123 | <div class="wpstg-min-w-0"> |
| 124 | <div class="wpstg-delete-field-label"><?php esc_html_e('URL', 'wp-staging'); ?></div> |
| 125 | <div class="wpstg-delete-field-value"><?php echo esc_html($stagingHost); ?></div> |
| 126 | </div> |
| 127 | <div class="wpstg-min-w-0"> |
| 128 | <div class="wpstg-delete-field-label"><?php esc_html_e('Database', 'wp-staging'); ?></div> |
| 129 | <div class="wpstg-delete-field-value"><?php echo esc_html($databaseName); ?></div> |
| 130 | </div> |
| 131 | <div class="wpstg-min-w-0"> |
| 132 | <div class="wpstg-delete-field-label"><?php esc_html_e('Folder', 'wp-staging'); ?></div> |
| 133 | <div class="wpstg-delete-field-value"><?php echo esc_html($stagingPath); ?></div> |
| 134 | </div> |
| 135 | </div> |
| 136 | </div> |
| 137 | </section> |
| 138 | |
| 139 | <!-- Red hero warning + the single green reassurance line. --> |
| 140 | <section class="wpstg-delete-section"> |
| 141 | <div class="wpstg-delete-hero"> |
| 142 | <div class="wpstg-flex wpstg-items-start wpstg-gap-3"> |
| 143 | <span class="wpstg-delete-hero__icon"> |
| 144 | <?php $wpstgIcon('warn', 16, '', '2.2'); ?> |
| 145 | </span> |
| 146 | <div class="wpstg-min-w-0"> |
| 147 | <h3 class="wpstg-u-m-0 wpstg-text-[15px] wpstg-font-bold wpstg-text-red-900 dark:wpstg-text-red-200"> |
| 148 | <?php esc_html_e('This permanently deletes the staging site', 'wp-staging'); ?> |
| 149 | </h3> |
| 150 | <p class="wpstg-u-m-0 wpstg-mt-1 wpstg-text-[13px] wpstg-leading-relaxed wpstg-text-red-800 dark:wpstg-text-red-200/80"> |
| 151 | <?php |
| 152 | echo wp_kses_post(sprintf( |
| 153 | /* translators: %s: staging site name (emphasised). */ |
| 154 | __('The selected staging tables and files for <span class="wpstg-font-semibold">%s</span> are permanently removed. This cannot be undone in WP STAGING.', 'wp-staging'), |
| 155 | esc_html($siteName) |
| 156 | )); |
| 157 | ?> |
| 158 | </p> |
| 159 | </div> |
| 160 | </div> |
| 161 | <p class="wpstg-delete-hero__reassurance"> |
| 162 | <?php $wpstgIcon('check', 14, 'wpstg-mt-0.5 wpstg-flex-shrink-0'); ?> |
| 163 | <span><?php esc_html_e('Production files and non-staging database tables are never selected.', 'wp-staging'); ?></span> |
| 164 | </p> |
| 165 | </div> |
| 166 | </section> |
| 167 | |
| 168 | <!-- What gets deleted — collapsed by default; holds the selection. --> |
| 169 | <section class="wpstg-delete-section"> |
| 170 | <div class="wpstg-delete-accordion"> |
| 171 | <button type="button" class="wpstg-delete-accordion__toggle" aria-expanded="false" aria-controls="wpstg-delete-what-panel"> |
| 172 | <?php $wpstgIcon('trash', 18, 'wpstg-flex-shrink-0 wpstg-text-gray-500 dark:wpstg-text-slate-400'); ?> |
| 173 | <span class="wpstg-min-w-0 wpstg-flex-1"> |
| 174 | <span class="wpstg-flex wpstg-items-center wpstg-gap-2"> |
| 175 | <span class="wpstg-text-[14px] wpstg-font-bold wpstg-text-gray-800 dark:wpstg-text-slate-100"><?php esc_html_e('What gets deleted', 'wp-staging'); ?></span> |
| 176 | <span class="wpstg-delete-pill wpstg-delete-pill--gray" data-wpstg-delete-accordion-chip><?php esc_html_e('All selected', 'wp-staging'); ?></span> |
| 177 | </span> |
| 178 | <span class="wpstg-delete-accordion__subtitle" data-wpstg-delete-accordion-subtitle></span> |
| 179 | </span> |
| 180 | <?php $wpstgIcon('chevron', 16, 'wpstg-delete-accordion__chevron wpstg-flex-shrink-0 wpstg-text-gray-400'); ?> |
| 181 | </button> |
| 182 | |
| 183 | <div id="wpstg-delete-what-panel" class="wpstg-delete-accordion__panel" hidden> |
| 184 | <p class="wpstg-u-m-0 wpstg-text-[12.5px] wpstg-leading-relaxed wpstg-text-gray-500 dark:wpstg-text-slate-400"> |
| 185 | <?php esc_html_e('Everything is selected by default. Deselect items only if you want to keep specific tables or folders.', 'wp-staging'); ?> |
| 186 | </p> |
| 187 | |
| 188 | <?php if (!$isDatabaseConnected) { ?> |
| 189 | <div class="wpstg-delete-db-error"> |
| 190 | <strong><?php esc_html_e('Cannot connect to the staging database.', 'wp-staging'); ?></strong> |
| 191 | <p class="wpstg-u-m-0 wpstg-mt-1"> |
| 192 | <?php esc_html_e('The staging tables cannot be listed — they may already be gone, or the database password changed. You can still delete the staging folder below; any remaining tables must be removed manually.', 'wp-staging'); ?> |
| 193 | </p> |
| 194 | </div> |
| 195 | <?php } ?> |
| 196 | |
| 197 | <?php if ($isDatabaseConnected) { ?> |
| 198 | <div class="wpstg-delete-subblock"> |
| 199 | <div class="wpstg-delete-subblock__label"> |
| 200 | <?php $wpstgIcon('database', 15, 'wpstg-text-gray-500 dark:wpstg-text-slate-400'); ?> |
| 201 | <?php esc_html_e('Database tables', 'wp-staging'); ?> |
| 202 | </div> |
| 203 | <p class="wpstg-u-m-0 wpstg-mb-2 wpstg-text-[12px] wpstg-leading-snug wpstg-text-gray-500 dark:wpstg-text-slate-400"> |
| 204 | <?php |
| 205 | echo wp_kses_post(sprintf( |
| 206 | /* translators: %s: staging database table prefix (monospace). */ |
| 207 | __('These staging tables use the <span class="wpstg-delete-mono-strong">%s</span> prefix. No production tables are selected.', 'wp-staging'), |
| 208 | esc_html($tablePrefix) |
| 209 | )); |
| 210 | ?> |
| 211 | </p> |
| 212 | |
| 213 | <div class="wpstg-delete-list-head"> |
| 214 | <span class="wpstg-delete-list-count" data-wpstg-delete-tablecount></span> |
| 215 | <span class="wpstg-delete-list-actions"> |
| 216 | <button type="button" id="wpstg-select-recommended-tables" class="wpstg-delete-select-all"><?php esc_html_e('Select all', 'wp-staging'); ?></button> |
| 217 | <span class="wpstg-delete-list-sep">·</span> |
| 218 | <button type="button" id="wpstg-clear-table-selection" class="wpstg-delete-deselect-all"><?php esc_html_e('Deselect all', 'wp-staging'); ?></button> |
| 219 | </span> |
| 220 | </div> |
| 221 | |
| 222 | <div class="wpstg-delete-table-list"> |
| 223 | <?php foreach ($stagingTables as $table) : ?> |
| 224 | <?php $tag = $sensitiveTag($table->getName()); ?> |
| 225 | <label class="wpstg-delete-row wpstg-cursor-pointer"> |
| 226 | <?php Checkbox::render('', $table->getName(), $table->getName(), true, ['classes' => 'wpstg-db-table-checkboxes']); ?> |
| 227 | <span class="wpstg-delete-row__name"><?php echo esc_html($table->getName()); ?></span> |
| 228 | <?php if ($tag !== '') : ?> |
| 229 | <span class="wpstg-delete-pill wpstg-delete-pill--amber"><?php echo esc_html($tag); ?></span> |
| 230 | <?php endif; ?> |
| 231 | <span class="wpstg-delete-row__size" data-wpstg-delete-table-size="<?php echo esc_attr((string)(int)$table->getSize()); ?>"><?php echo esc_html($table->getHumanReadableSize()); ?></span> |
| 232 | </label> |
| 233 | <?php endforeach; ?> |
| 234 | </div> |
| 235 | |
| 236 | <p class="wpstg-delete-note wpstg-delete-note--amber" data-wpstg-delete-sensitive-note hidden> |
| 237 | <?php $wpstgIcon('warn', 13, 'wpstg-mt-0.5 wpstg-flex-shrink-0'); ?> |
| 238 | <span><?php esc_html_e('Some selected tables hold settings or user accounts. Deleting them removes that staging data permanently.', 'wp-staging'); ?></span> |
| 239 | </p> |
| 240 | </div> |
| 241 | <?php } ?> |
| 242 | |
| 243 | <div class="wpstg-delete-subblock"> |
| 244 | <div class="wpstg-delete-subblock__label"> |
| 245 | <?php $wpstgIcon('folder', 15, 'wpstg-text-gray-500 dark:wpstg-text-slate-400'); ?> |
| 246 | <?php esc_html_e('Files & folders', 'wp-staging'); ?> |
| 247 | </div> |
| 248 | <p class="wpstg-u-m-0 wpstg-mb-2 wpstg-font-mono wpstg-text-[11.5px] wpstg-text-gray-500 dark:wpstg-text-slate-400"><?php echo esc_html($stagingPath); ?></p> |
| 249 | |
| 250 | <div class="wpstg-delete-list-head"> |
| 251 | <span class="wpstg-delete-list-count" data-wpstg-delete-foldercount></span> |
| 252 | <span class="wpstg-delete-list-actions"> |
| 253 | <button type="button" id="wpstg-select-folder" class="wpstg-delete-select-all"><?php esc_html_e('Select all', 'wp-staging'); ?></button> |
| 254 | <span class="wpstg-delete-list-sep">·</span> |
| 255 | <button type="button" id="wpstg-deselect-folder" class="wpstg-delete-deselect-all"><?php esc_html_e('Deselect all', 'wp-staging'); ?></button> |
| 256 | </span> |
| 257 | </div> |
| 258 | |
| 259 | <div class="wpstg-delete-folder-list"> |
| 260 | <label class="wpstg-delete-row wpstg-cursor-pointer"> |
| 261 | <?php Checkbox::render('deleteDirectory', 'deleteDirectory', '1', true, [], ['deletePath' => urlencode($stagingPath)]); ?> |
| 262 | <?php $wpstgIcon('folder', 15, 'wpstg-flex-shrink-0 wpstg-text-gray-400 dark:wpstg-text-slate-500'); ?> |
| 263 | <span class="wpstg-delete-row__name wpstg-font-semibold"><?php echo esc_html($folderLabel); ?>/</span> |
| 264 | <span class="wpstg-delete-row__size" data-wpstg-delete-folder-size="0"><?php echo empty($stagingSiteSize) ? '' : esc_html($stagingSiteSize); ?></span> |
| 265 | </label> |
| 266 | </div> |
| 267 | |
| 268 | <p class="wpstg-delete-note wpstg-delete-note--amber" data-wpstg-delete-file-caution hidden> |
| 269 | <?php $wpstgIcon('warn', 13, 'wpstg-mt-0.5 wpstg-flex-shrink-0'); ?> |
| 270 | <span><?php esc_html_e('Deleting files is recommended. Keeping the folder can leave an orphaned staging directory that still uses disk space.', 'wp-staging'); ?></span> |
| 271 | </p> |
| 272 | </div> |
| 273 | </div> |
| 274 | </div> |
| 275 | </section> |
| 276 | </div> |
| 277 | |
| 278 | <!-- Deletion summary rail (sticky on desktop). --> |
| 279 | <aside class="wpstg-delete-setup-modal__summary"> |
| 280 | <div class="wpstg-delete-summary-sticky"> |
| 281 | <div class="wpstg-delete-summary__heading"> |
| 282 | <?php $wpstgIcon('clipboard', 16, 'wpstg-flex-shrink-0 wpstg-text-blue-600 dark:wpstg-text-blue-400'); ?> |
| 283 | <?php esc_html_e('Deletion Summary', 'wp-staging'); ?> |
| 284 | </div> |
| 285 | |
| 286 | <dl class="wpstg-delete-summary-list"> |
| 287 | <div class="wpstg-delete-summary-row"> |
| 288 | <dt><?php $wpstgIcon('server', 13, 'wpstg-delete-summary__icon'); ?><?php esc_html_e('Staging site', 'wp-staging'); ?></dt> |
| 289 | <dd><span class="wpstg-font-mono"><?php echo esc_html($siteName); ?></span></dd> |
| 290 | </div> |
| 291 | <div class="wpstg-delete-summary-divider"></div> |
| 292 | <div class="wpstg-delete-summary-row"> |
| 293 | <dt><?php $wpstgIcon('database', 13, 'wpstg-delete-summary__icon'); ?><?php esc_html_e('Tables', 'wp-staging'); ?></dt> |
| 294 | <dd data-wpstg-delete-tables-summary></dd> |
| 295 | </div> |
| 296 | <div class="wpstg-delete-summary-row"> |
| 297 | <dt><?php $wpstgIcon('folder', 13, 'wpstg-delete-summary__icon'); ?><?php esc_html_e('Folders', 'wp-staging'); ?></dt> |
| 298 | <dd data-wpstg-delete-folders-summary></dd> |
| 299 | </div> |
| 300 | <div class="wpstg-delete-summary-row"> |
| 301 | <dt><?php $wpstgIcon('disk', 13, 'wpstg-delete-summary__icon'); ?><?php esc_html_e('Data to delete', 'wp-staging'); ?></dt> |
| 302 | <dd><span class="wpstg-font-mono" data-wpstg-delete-size-summary></span></dd> |
| 303 | </div> |
| 304 | </dl> |
| 305 | |
| 306 | <div class="wpstg-delete-backup-card"> |
| 307 | <div class="wpstg-delete-backup-card__title"> |
| 308 | <?php $wpstgIcon('archive', 15, 'wpstg-flex-shrink-0 wpstg-text-amber-600 dark:wpstg-text-amber-300'); ?> |
| 309 | <?php esc_html_e('Back up first', 'wp-staging'); ?> |
| 310 | <span class="wpstg-delete-backup-card__chip"><?php esc_html_e('Recommended', 'wp-staging'); ?></span> |
| 311 | </div> |
| 312 | <p class="wpstg-u-m-0 wpstg-mt-1.5 wpstg-text-[12px] wpstg-leading-snug wpstg-text-amber-800 dark:wpstg-text-amber-200/85"> |
| 313 | <?php esc_html_e("Deletion can't be undone. Open the staging site and create a backup before continuing.", 'wp-staging'); ?> |
| 314 | </p> |
| 315 | <a href="<?php echo esc_url($stagingUrl); ?>" target="_blank" rel="noopener noreferrer" class="wpstg-delete-backup-card__button"> |
| 316 | <?php $wpstgIcon('external', 13); ?> |
| 317 | <?php esc_html_e('Open staging site', 'wp-staging'); ?> |
| 318 | </a> |
| 319 | </div> |
| 320 | </div> |
| 321 | </aside> |
| 322 | </div> |
| 323 | |
| 324 | <footer class="wpstg-delete-setup-modal__footer"> |
| 325 | <label class="wpstg-delete-confirm-row wpstg-cursor-pointer"> |
| 326 | <?php Checkbox::render('wpstg-delete-acknowledgement', 'wpstg-delete-acknowledgement', '1', false, []); ?> |
| 327 | <span class="wpstg-delete-confirm-row__text"> |
| 328 | <?php |
| 329 | echo wp_kses_post(sprintf( |
| 330 | /* translators: 1: emphasised word "deletes"; 2: staging site name (monospace). */ |
| 331 | __('I understand this permanently %1$s %2$s and cannot be undone.', 'wp-staging'), |
| 332 | '<span class="wpstg-delete-confirm-emphasis">' . esc_html__('deletes', 'wp-staging') . '</span>', |
| 333 | '<span class="wpstg-delete-confirm-name">' . esc_html($siteName) . '</span>' |
| 334 | )); |
| 335 | ?> |
| 336 | </span> |
| 337 | </label> |
| 338 | <div class="wpstg-delete-footer-actions"> |
| 339 | <button type="button" class="wpstg-delete-modal-cancel wpstg-delete-btn-ghost"><?php esc_html_e('Cancel', 'wp-staging'); ?></button> |
| 340 | <button type="button" class="wpstg-delete-cta" data-cloneid="<?php echo esc_attr($stagingSite->getCloneId()); ?>" disabled> |
| 341 | <?php $wpstgIcon('trash', 16, '', '2'); ?> |
| 342 | <span><?php esc_html_e('Delete Staging Site Permanently', 'wp-staging'); ?></span> |
| 343 | </button> |
| 344 | </div> |
| 345 | </footer> |
| 346 | </div> |
| 347 |