PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / trunk
WP STAGING – WordPress Backup, Restore, Migration & Clone vtrunk
4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / views / clone / ajax / scan.php
wp-staging / views / clone / ajax Last commit date
cron-setting.php 4 months ago custom-directory.php 1 month ago directory-navigation.php 1 week ago exclude-settings.php 4 months ago external-database.php 2 months ago login-data.php 3 months ago mail-setting.php 4 months ago plugins-update.php 1 year ago process-lock.php 1 year ago scan.php 1 week ago start.php 1 year ago symlink-uploads.php 1 year ago update.php 1 year ago
scan.php
150 lines
1 <?php
2
3 /**
4 * @see \WPStaging\Backend\Administrator::ajaxCloneScan Context where this is included.
5 *
6 * @var \WPStaging\Backend\Modules\Jobs\Scan $scan
7 * @var stdClass $options
8 * @var \WPStaging\Framework\Filesystem\Filters\ExcludeFilter $excludeUtils
9 * @var bool $isPro
10 *
11 * @see \WPStaging\Backend\Modules\Jobs\Scan::start For details on $options.
12 */
13
14 use WPStaging\Backend\Modules\Jobs\Job;
15 use WPStaging\Framework\Facades\Escape;
16 use WPStaging\Framework\Facades\Sanitize;
17 use WPStaging\Framework\Facades\UI\Checkbox;
18
19 ?>
20 <label id="wpstg-clone-label" for="wpstg-new-clone-id">
21 <input type="text" id="wpstg-new-clone-id" class="wpstg-input wpstg-input-lg"
22 placeholder="<?php esc_html_e('Enter Site Name (Optional)', 'wp-staging') ?>"
23 data-clone="<?php echo esc_attr($options->current); ?>"
24 <?php if ($options->current !== null) {
25 $siteName = isset($options->currentClone['cloneName']) ? Sanitize::sanitizeString(wpstg_urldecode($options->currentClone['cloneName'])) : $options->currentClone['directoryName'];
26 echo ' value="' . esc_attr($siteName) . '"';
27 echo " disabled='disabled'";
28 } ?> />
29 </label>
30
31 <div id="wpstg-clone-id-error" class="wpstg-callout wpstg-callout-warning wpstg-mt-2" style="display:none;">
32 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>
33 <div class="wpstg-text-sm" id="wpstg-clone-id-error-msg"></div>
34 </div>
35 <?php require_once WPSTG_VIEWS_DIR . 'staging/_partials/file-size-notice.php';?>
36 <section class="wpstg-card wpstg-card-body wpstg-mt-4">
37 <div class="wpstg-tabs-wrapper">
38 <p class="wpstg-tables-selection-note">
39 <b class="wpstg--red"><?php esc_html_e("Note: ", "wp-staging") ?></b>
40 <?php esc_html_e("These table and folder selections will be remembered for future updates and resets of this staging site.", "wp-staging") ?>
41 </p>
42 <a href="#" class="wpstg-tab-header active" data-id="#wpstg-scanning-db">
43 <span class="wpstg-tab-triangle"></span>
44 <?php echo esc_html__("Database Tables", "wp-staging") ?>
45 <span id="wpstg-tables-count" class="wpstg-selection-preview"></span>
46 </a>
47
48 <fieldset class="wpstg-tab-section" id="wpstg-scanning-db">
49 <?php require(WPSTG_VIEWS_DIR . 'selections/database-tables.php'); ?>
50 </fieldset>
51
52 <a href="#" class="wpstg-tab-header" data-id="#wpstg-scanning-files">
53 <span class="wpstg-tab-triangle"></span>
54 <?php echo esc_html__("Files", "wp-staging") ?>
55 <span id="wpstg-files-count" class="wpstg-selection-preview"></span>
56 </a>
57
58 <fieldset class="wpstg-tab-section" id="wpstg-scanning-files">
59 <?php require(WPSTG_VIEWS_DIR . 'selections/files.php'); ?>
60 </fieldset>
61
62 <a href="#" class="wpstg-tab-header" data-id="#wpstg-advanced-settings">
63 <span class="wpstg-tab-triangle"></span>
64 <?php
65 $advanceSettingsTitle = esc_html__("Advanced Settings (Requires Pro Version)", "wp-staging");
66 echo esc_html($advanceSettingsTitle);
67 ?>
68 </a>
69
70 <div class="wpstg-tab-section" id="wpstg-advanced-settings">
71 <?php
72 if ($options->mainJob !== Job::UPDATE) {
73 require_once(__DIR__ . '/login-data.php');
74 require_once(__DIR__ . '/external-database.php');
75 require_once(__DIR__ . '/custom-directory.php');
76 require_once(__DIR__ . '/symlink-uploads.php');
77 }
78
79 if ($options->mainJob === Job::STAGING) {
80 require_once(__DIR__ . '/cron-setting.php');
81 }
82
83 require_once(__DIR__ . '/mail-setting.php');
84 require_once(__DIR__ . '/plugins-update.php');
85 ?>
86 </div>
87 </div>
88
89 <?php
90
91 if ($options->current !== null && $options->mainJob === Job::UPDATE) {
92 $uploadsSymlinked = isset($options->existingClones[$options->current]['uploadsSymlinked']) ? (bool)$options->existingClones[$options->current]['uploadsSymlinked'] : false;
93
94 ?>
95 <fieldset class="wpstg-fieldset" style="margin-left: 16px;">
96 <p class="wpstg--advanced-settings--checkbox">
97 <label for="wpstg-clean-plugins-themes"><?php esc_html_e('Clean Plugins/Themes', 'wp-staging'); ?></label>
98 <?php Checkbox::render('wpstg-clean-plugins-themes', 'wpstg-clean-plugins-themes', 'true'); ?>
99 <span class="wpstg--tooltip">
100 <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
101 <span class="wpstg--tooltiptext">
102 <?php esc_html_e('Delete all plugins & themes on staging site before starting update process.', 'wp-staging'); ?>
103 </span>
104 </span>
105 </p>
106 <p class="wpstg--advanced-settings--checkbox">
107 <label for="wpstg-clean-uploads"><?php esc_html_e('Clean Uploads', 'wp-staging'); ?></label>
108 <?php Checkbox::render('wpstg-clean-uploads', 'wpstg-clean-uploads', 'true'); ?>
109 <span class="wpstg--tooltip">
110 <img class="wpstg--dashicons" src="<?php echo esc_url($scan->getInfoIcon()); ?>" alt="info" />
111 <span class="wpstg--tooltiptext">
112 <?php esc_html_e('Delete entire folder wp-content/uploads on staging site including all images before starting update process.', 'wp-staging'); ?>
113 <?php echo $uploadsSymlinked ? "<br/><br/><b>" . esc_html__("Note: This option is disabled as uploads directory is symlinked", "wp-staging") . "</b>" : '' ?>
114 </span>
115 </span>
116 </p>
117 </fieldset>
118 <?php
119 }
120 ?>
121 </section>
122 <div class="wpstg-mb-6"></div>
123 <div class="wpstg-flex wpstg-items-center wpstg-gap-3 wpstg-flex-wrap">
124 <button type="button" class="wpstg-prev-step-link wpstg-btn wpstg-btn-md wpstg-btn-secondary">
125 <svg class="wpstg-btn-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
126 <?php esc_html_e("Back", "wp-staging") ?>
127 </button>
128
129 <?php
130 $label = esc_html__("Start Cloning", "wp-staging");
131 $action = 'wpstg_cloning';
132 $btnId = 'wpstg-start-cloning';
133 if ($options->current !== null && $options->mainJob === Job::UPDATE) {
134 $label = esc_html__("Update Staging Site", "wp-staging");
135 $action = 'wpstg_update';
136 $btnId = 'wpstg-start-updating';
137 }
138 ?>
139
140 <button type="button" id="<?php echo esc_attr($btnId); ?>" class="wpstg-next-step-link wpstg-btn wpstg-btn-md wpstg-btn-primary" data-action="<?php echo esc_attr($action); ?>" data-url="<?php echo esc_attr(isset($options->currentClone['url']) ? $options->currentClone['url'] : ''); ?>"><?php echo esc_html($label); ?></button>
141
142 <a href="#" id="wpstg-check-space" class="wpstg-btn wpstg-btn-ghost"><?php esc_html_e('Check required disk space', 'wp-staging'); ?></a>
143 <div id="wpstg-disk-space-result" class="wpstg-callout wpstg-callout-warning wpstg-mt-2" style="display:none;">
144 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
145 <path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>
146 </svg>
147 <div class="wpstg-text-sm" id="wpstg-disk-space-result-msg"></div>
148 </div>
149 </div>
150