PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.9.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.9.2
4.9.2 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 / Staging / Service / StagingSetup.php
wp-staging / Staging / Service Last commit date
Database 2 weeks ago AbstractStagingSetup.php 2 weeks ago DirectoryScanner.php 2 weeks ago FileCopier.php 1 week ago LegacyOptionsCache.php 2 weeks ago StagingEngine.php 1 day ago StagingSetup.php 2 weeks ago TableScanner.php 1 week ago
StagingSetup.php
172 lines
1 <?php
2
3 namespace WPStaging\Staging\Service;
4
5 /**
6 * @package WPStaging\Staging\Service
7 */
8 class StagingSetup extends AbstractStagingSetup
9 {
10 /**
11 * @return void
12 */
13 public function renderNetworkCloneSettings()
14 {
15 // no-op for free version
16 }
17
18 public function getAdvanceSettingsTitle(): string
19 {
20 return esc_html__("Advanced Settings (Requires Pro Version)", "wp-staging");
21 }
22
23 /**
24 * @return void
25 */
26 public function renderAdvanceSettingsHeader()
27 {
28 echo $this->templateEngine->render('staging/_partials/advance-settings-header.php'); // phpcs:ignore
29 }
30
31 public function renderAdvanceSettings(string $name, string $label, string $description, bool $checked = false, string $additionalClasses = '', string $dataId = '', string $summary = '', string $content = '', string $tooltip = null)
32 {
33 // We disable the settings by default on FREE version.
34 $this->renderSettings($name, $label, $description, $checked, true, $additionalClasses, $dataId, $summary, $content, $tooltip);
35 }
36
37 /**
38 * @return void
39 */
40 public function renderNewAdminSettings()
41 {
42 $fields = [
43 [
44 'label' => esc_html__('Email: ', 'wp-staging'),
45 'name' => 'wpstg-new-admin-email',
46 'type' => 'email',
47 'placeholder' => '',
48 'value' => '',
49 'autocapitalize' => false,
50 'disabled' => true,
51 ],
52 [
53 'label' => esc_html__('Password: ', 'wp-staging'),
54 'name' => 'wpstg-new-admin-password',
55 'type' => 'password',
56 'placeholder' => '',
57 'value' => '',
58 'autocapitalize' => false,
59 'autocomplete' => false,
60 'disabled' => true,
61 ],
62 ];
63
64 $this->renderSettingsFields($fields);
65 }
66
67 /**
68 * @return void
69 */
70 public function renderCustomDirectorySettings()
71 {
72 $fields = [
73 [
74 'label' => esc_html__('Destination Path: ', 'wp-staging'),
75 'name' => 'wpstg_clone_dir',
76 'type' => 'text',
77 'placeholder' => ABSPATH,
78 'value' => '',
79 'autocapitalize' => false,
80 'disabled' => true,
81 ],
82 [
83 'label' => esc_html__('Target Hostname: ', 'wp-staging'),
84 'name' => 'wpstg_clone_hostname',
85 'type' => 'text',
86 'placeholder' => get_site_url(),
87 'value' => '',
88 'autocapitalize' => false,
89 'disabled' => true,
90 ],
91 ];
92
93 $this->renderSettingsFields($fields);
94 }
95
96 /**
97 * Avoid renaming the 'wpstg-db-user' field to 'wpstg-db-username' or simply 'username',
98 * and 'wpstg-db-pass' to 'wpstg-db-password' or 'password'.
99 * Renaming may lead to unintended autofill behavior if the fields are disabled.
100 * @return void
101 */
102 public function renderExternalDatabaseSettings()
103 {
104 $fields = [
105 [
106 'label' => esc_html__('Server: ', 'wp-staging'),
107 'name' => 'wpstg-db-server',
108 'type' => 'text',
109 'placeholder' => 'localhost',
110 'value' => '',
111 'autocapitalize' => false,
112 'disabled' => true,
113 ],
114 [
115 'label' => esc_html__('User: ', 'wp-staging'),
116 'name' => 'wpstg-db-user',
117 'type' => 'text',
118 'placeholder' => '',
119 'value' => '',
120 'autocapitalize' => false,
121 'disabled' => true,
122 ],
123 [
124 'label' => esc_html__('Password: ', 'wp-staging'),
125 'name' => 'wpstg-db-pass',
126 'type' => 'password',
127 'placeholder' => '',
128 'value' => '',
129 'autocapitalize' => false,
130 'autocomplete' => false,
131 'disabled' => true,
132 ],
133 [
134 'label' => esc_html__('Database: ', 'wp-staging'),
135 'name' => 'wpstg-db-database',
136 'type' => 'text',
137 'placeholder' => '',
138 'value' => '',
139 'autocapitalize' => false,
140 'disabled' => true,
141 ],
142 [
143 'label' => esc_html__('Database Prefix: ', 'wp-staging'),
144 'name' => 'wpstg-db-prefix',
145 'type' => 'text',
146 'placeholder' => 'wp_',
147 'value' => '',
148 'autocapitalize' => false,
149 'disabled' => true,
150 ],
151 [
152 'label' => esc_html__('Enable SSL: ', 'wp-staging'),
153 'name' => 'wpstg-db-ssl',
154 'type' => 'checkbox',
155 'value' => 'true',
156 'checked' => false,
157 'disabled' => true,
158 ],
159 ];
160
161 $this->renderSettingsFields($fields);
162 }
163
164 /**
165 * @return void
166 */
167 public function renderEnableWooSchedulerSettings()
168 {
169 // no-op for free version
170 }
171 }
172