@@ -33,7 +33,10 @@ |
||
33 | 33 | <li class="active"> |
34 | 34 | <div class="collapsible-header active"><i class="material-icons">bug_report</i>XCloner Debugger</div> |
35 | 35 | <div class="collapsible-body"> |
36 | - <div class="console" id="xcloner-console"><?php if(isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div> |
|
36 | + <div class="console" id="xcloner-console"><?php if(isset($logger_content)) { |
|
37 | + echo implode("<br />\n", $logger_content); |
|
38 | +} |
|
39 | +?></div> |
|
37 | 40 | </div> |
38 | 41 | </li> |
39 | 42 | </ul> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
4 | -$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
5 | -$logger_content = $logger->getLastDebugLines(); |
|
3 | +$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
4 | +$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
5 | +$logger_content = $logger->getLastDebugLines(); |
|
6 | 6 | ?> |
7 | 7 | <div class="col s12 "> |
8 | 8 | <div> |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | <?php echo __('XCloner Debugger Dashboard', 'xcloner-backup-and-restore') ?> |
11 | 11 | </h5> |
12 | 12 | |
13 | - <?php if($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
13 | + <?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
14 | 14 | <ul class="collapsible xcloner-debugger" data-collapsible="accordion"> |
15 | 15 | <li class="active"> |
16 | 16 | <div class="collapsible-header active"><i class="material-icons">bug_report</i>XCloner Debugger</div> |
17 | 17 | <div class="collapsible-body"> |
18 | - <div class="console" id="xcloner-console"><?php if(isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div> |
|
18 | + <div class="console" id="xcloner-console"><?php if (isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div> |
|
19 | 19 | </div> |
20 | 20 | </li> |
21 | 21 | </ul> |
@@ -28,6 +28,6 @@ discard block |
||
28 | 28 | }, 2000);*/ |
29 | 29 | }) |
30 | 30 | </script> |
31 | - <?php endif;?> |
|
31 | + <?php endif; ?> |
|
32 | 32 | </div> |
33 | 33 | </div> |
@@ -61,8 +61,9 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function enqueue_styles($hook) { |
63 | 63 | |
64 | - if(!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option']=="com_cloner")) |
|
65 | - return; |
|
64 | + if(!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option']=="com_cloner")) { |
|
65 | + return; |
|
66 | + } |
|
66 | 67 | |
67 | 68 | /** |
68 | 69 | * This function is provided for demonstration purposes only. |
@@ -93,8 +94,9 @@ discard block |
||
93 | 94 | */ |
94 | 95 | public function enqueue_scripts($hook) { |
95 | 96 | |
96 | - if(!stristr($hook, "page_".$this->plugin_name)) |
|
97 | - return; |
|
97 | + if(!stristr($hook, "page_".$this->plugin_name)) { |
|
98 | + return; |
|
99 | + } |
|
98 | 100 | |
99 | 101 | /** |
100 | 102 | * This function is provided for demonstration purposes only. |
@@ -234,15 +236,15 @@ discard block |
||
234 | 236 | settings_fields('xcloner_general_settings_group'); |
235 | 237 | do_settings_sections('xcloner_settings_page'); |
236 | 238 | |
237 | - }elseif( $active_tab == 'mysql_options' ) { |
|
239 | + } elseif( $active_tab == 'mysql_options' ) { |
|
238 | 240 | |
239 | 241 | settings_fields('xcloner_mysql_settings_group'); |
240 | 242 | do_settings_sections('xcloner_mysql_settings_page'); |
241 | - }elseif( $active_tab == 'system_options' ) { |
|
243 | + } elseif( $active_tab == 'system_options' ) { |
|
242 | 244 | |
243 | 245 | settings_fields('xcloner_system_settings_group'); |
244 | 246 | do_settings_sections('xcloner_system_settings_page'); |
245 | - }elseif( $active_tab == 'cleanup_options' ) { |
|
247 | + } elseif( $active_tab == 'cleanup_options' ) { |
|
246 | 248 | |
247 | 249 | settings_fields('xcloner_cleanup_settings_group'); |
248 | 250 | do_settings_sections('xcloner_cleanup_settings_page'); |
@@ -45,8 +45,6 @@ |
||
45 | 45 | * Initialize the class and set its properties. |
46 | 46 | * |
47 | 47 | * @since 1.0.0 |
48 | - * @param string $plugin_name The name of this plugin. |
|
49 | - * @param string $version The version of this plugin. |
|
50 | 48 | */ |
51 | 49 | public function __construct( Xcloner $xcloner_container) { |
52 | 50 |
@@ -221,28 +221,28 @@ discard block |
||
221 | 221 | |
222 | 222 | // add error/update messages |
223 | 223 | |
224 | - // check if the user have submitted the settings |
|
225 | - // wordpress will add the "settings-updated" $_GET parameter to the url |
|
226 | - if (isset($_GET['settings-updated'])) { |
|
227 | - // add settings saved message with the class of "updated" |
|
228 | - add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
229 | - } |
|
224 | + // check if the user have submitted the settings |
|
225 | + // wordpress will add the "settings-updated" $_GET parameter to the url |
|
226 | + if (isset($_GET['settings-updated'])) { |
|
227 | + // add settings saved message with the class of "updated" |
|
228 | + add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
229 | + } |
|
230 | 230 | |
231 | - // show error/update messages |
|
232 | - settings_errors('wporg_messages'); |
|
233 | - ?> |
|
231 | + // show error/update messages |
|
232 | + settings_errors('wporg_messages'); |
|
233 | + ?> |
|
234 | 234 | |
235 | 235 | <?php |
236 | 236 | $xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
237 | 237 | |
238 | - if( isset( $_GET[ 'tab' ] ) ) { |
|
239 | - $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
240 | - } // end if |
|
241 | - else{ |
|
238 | + if( isset( $_GET[ 'tab' ] ) ) { |
|
239 | + $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
240 | + } // end if |
|
241 | + else{ |
|
242 | 242 | $active_tab = "general_options"; |
243 | 243 | } |
244 | 244 | |
245 | - ?> |
|
245 | + ?> |
|
246 | 246 | <h1><?= esc_html(get_admin_page_title()); ?></h1> |
247 | 247 | |
248 | 248 | <ul class="nav-tab-wrapper row"> |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | do_settings_sections('xcloner_cleanup_settings_page'); |
277 | 277 | } |
278 | 278 | |
279 | - // output save settings button |
|
280 | - submit_button('Save Settings'); |
|
281 | - ?> |
|
279 | + // output save settings button |
|
280 | + submit_button('Save Settings'); |
|
281 | + ?> |
|
282 | 282 | </form> |
283 | 283 | |
284 | 284 | </div> |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | * @param string $plugin_name The name of this plugin. |
49 | 49 | * @param string $version The version of this plugin. |
50 | 50 | */ |
51 | - public function __construct( Xcloner $xcloner_container) { |
|
51 | + public function __construct(Xcloner $xcloner_container) { |
|
52 | 52 | |
53 | - $this->plugin_name = $xcloner_container->get_plugin_name(); |
|
54 | - $this->version = $xcloner_container->get_version(); |
|
55 | - $this->xcloner_container = $xcloner_container; |
|
53 | + $this->plugin_name = $xcloner_container->get_plugin_name(); |
|
54 | + $this->version = $xcloner_container->get_version(); |
|
55 | + $this->xcloner_container = $xcloner_container; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function get_xcloner_container() |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function enqueue_styles($hook) { |
69 | 69 | |
70 | - if(!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option']=="com_cloner")) |
|
70 | + if (!stristr($hook, "page_".$this->plugin_name) || (isset($_GET['option']) and $_GET['option'] == "com_cloner")) |
|
71 | 71 | return; |
72 | 72 | |
73 | 73 | /** |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | * class. |
83 | 83 | */ |
84 | 84 | |
85 | - wp_enqueue_style( $this->plugin_name."_materialize", plugin_dir_url( __FILE__ ) . 'css/materialize.min.css', array(), $this->version, 'all' ); |
|
86 | - wp_enqueue_style( $this->plugin_name."_materialize.clockpicker", plugin_dir_url( __FILE__ ) . 'css/materialize.clockpicker.css', array(), $this->version, 'all' ); |
|
87 | - wp_enqueue_style( $this->plugin_name."_materialize.icons", '//fonts.googleapis.com/icon?family=Material+Icons', array(), $this->version, 'all' ); |
|
88 | - wp_enqueue_style( $this->plugin_name."_jquery.datatables", plugin_dir_url( __FILE__ ) . 'css/jquery.dataTables.min.css', array(), $this->version, 'all' ); |
|
89 | - wp_enqueue_style( $this->plugin_name."_jquery.datatables.responsive", plugin_dir_url( __FILE__ ) . 'css/responsive.dataTables.css', array(), $this->version, 'all' ); |
|
90 | - wp_enqueue_style( $this->plugin_name."_jstree", dirname(plugin_dir_url( __FILE__ )) . '/vendor/vakata/jstree/dist/themes/default/style.min.css', array(), '3.3', 'all' ); |
|
91 | - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/xcloner-admin.css', array(), $this->version, 'all' ); |
|
85 | + wp_enqueue_style($this->plugin_name."_materialize", plugin_dir_url(__FILE__).'css/materialize.min.css', array(), $this->version, 'all'); |
|
86 | + wp_enqueue_style($this->plugin_name."_materialize.clockpicker", plugin_dir_url(__FILE__).'css/materialize.clockpicker.css', array(), $this->version, 'all'); |
|
87 | + wp_enqueue_style($this->plugin_name."_materialize.icons", '//fonts.googleapis.com/icon?family=Material+Icons', array(), $this->version, 'all'); |
|
88 | + wp_enqueue_style($this->plugin_name."_jquery.datatables", plugin_dir_url(__FILE__).'css/jquery.dataTables.min.css', array(), $this->version, 'all'); |
|
89 | + wp_enqueue_style($this->plugin_name."_jquery.datatables.responsive", plugin_dir_url(__FILE__).'css/responsive.dataTables.css', array(), $this->version, 'all'); |
|
90 | + wp_enqueue_style($this->plugin_name."_jstree", dirname(plugin_dir_url(__FILE__)).'/vendor/vakata/jstree/dist/themes/default/style.min.css', array(), '3.3', 'all'); |
|
91 | + wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/xcloner-admin.css', array(), $this->version, 'all'); |
|
92 | 92 | |
93 | 93 | } |
94 | 94 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function enqueue_scripts($hook) { |
101 | 101 | |
102 | - if(!stristr($hook, "page_".$this->plugin_name)) |
|
102 | + if (!stristr($hook, "page_".$this->plugin_name)) |
|
103 | 103 | return; |
104 | 104 | |
105 | 105 | /** |
@@ -117,17 +117,17 @@ discard block |
||
117 | 117 | add_thickbox(); |
118 | 118 | wp_enqueue_script('plugin-install'); |
119 | 119 | wp_enqueue_script('updates'); |
120 | - wp_enqueue_script( $this->plugin_name."_materialize", plugin_dir_url( __FILE__ ) . 'js/materialize.min.js', array( 'jquery' ), $this->version, false ); |
|
121 | - wp_enqueue_script( $this->plugin_name."_materialize.clockpicker", plugin_dir_url( __FILE__ ) . 'js/materialize.clockpicker.js', array( 'jquery' ), $this->version, false ); |
|
122 | - wp_enqueue_script( $this->plugin_name."_jquery.datatables", plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false ); |
|
123 | - wp_enqueue_script( $this->plugin_name."_jquery.datatables.respnsive", plugin_dir_url( __FILE__ ) . 'js/dataTables.responsive.js', array( 'jquery' ), $this->version, false ); |
|
124 | - wp_enqueue_script( $this->plugin_name."_vakata", dirname(plugin_dir_url( __FILE__ )) . '/vendor/vakata/jstree/dist/jstree.min.js', array( 'jquery' ), '3.3', false ); |
|
125 | - wp_enqueue_script( $this->plugin_name."_xcloner-backup-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-backup-class.js', array( 'jquery' ), $this->version, false ); |
|
126 | - wp_enqueue_script( $this->plugin_name."_xcloner-scheduler-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-scheduler-class.js', array( 'jquery' ), $this->version, false ); |
|
127 | - wp_enqueue_script( $this->plugin_name."_xcloner-restore-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-restore-class.js', array( 'jquery' ), $this->version, false ); |
|
128 | - wp_enqueue_script( $this->plugin_name."_xcloner-manage-backups-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-manage-backups-class.js', array( 'jquery' ), $this->version, false ); |
|
129 | - wp_enqueue_script( $this->plugin_name."_xcloner-remote-storage-class", plugin_dir_url( __FILE__ ) . 'js/xcloner-remote-storage-class.js', array( 'jquery' ), $this->version, false ); |
|
130 | - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/xcloner-admin.js', array( 'jquery' ), $this->version, false ); |
|
120 | + wp_enqueue_script($this->plugin_name."_materialize", plugin_dir_url(__FILE__).'js/materialize.min.js', array('jquery'), $this->version, false); |
|
121 | + wp_enqueue_script($this->plugin_name."_materialize.clockpicker", plugin_dir_url(__FILE__).'js/materialize.clockpicker.js', array('jquery'), $this->version, false); |
|
122 | + wp_enqueue_script($this->plugin_name."_jquery.datatables", plugin_dir_url(__FILE__).'js/jquery.dataTables.min.js', array('jquery'), $this->version, false); |
|
123 | + wp_enqueue_script($this->plugin_name."_jquery.datatables.respnsive", plugin_dir_url(__FILE__).'js/dataTables.responsive.js', array('jquery'), $this->version, false); |
|
124 | + wp_enqueue_script($this->plugin_name."_vakata", dirname(plugin_dir_url(__FILE__)).'/vendor/vakata/jstree/dist/jstree.min.js', array('jquery'), '3.3', false); |
|
125 | + wp_enqueue_script($this->plugin_name."_xcloner-backup-class", plugin_dir_url(__FILE__).'js/xcloner-backup-class.js', array('jquery'), $this->version, false); |
|
126 | + wp_enqueue_script($this->plugin_name."_xcloner-scheduler-class", plugin_dir_url(__FILE__).'js/xcloner-scheduler-class.js', array('jquery'), $this->version, false); |
|
127 | + wp_enqueue_script($this->plugin_name."_xcloner-restore-class", plugin_dir_url(__FILE__).'js/xcloner-restore-class.js', array('jquery'), $this->version, false); |
|
128 | + wp_enqueue_script($this->plugin_name."_xcloner-manage-backups-class", plugin_dir_url(__FILE__).'js/xcloner-manage-backups-class.js', array('jquery'), $this->version, false); |
|
129 | + wp_enqueue_script($this->plugin_name."_xcloner-remote-storage-class", plugin_dir_url(__FILE__).'js/xcloner-remote-storage-class.js', array('jquery'), $this->version, false); |
|
130 | + wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/xcloner-admin.js', array('jquery'), $this->version, false); |
|
131 | 131 | |
132 | 132 | |
133 | 133 | } |
@@ -145,19 +145,19 @@ discard block |
||
145 | 145 | |
146 | 146 | $_POST['action'] = $xcloner_sanitization->sanitize_input_as_string($_POST['action']); |
147 | 147 | |
148 | - if(isset($_POST['action'])) |
|
148 | + if (isset($_POST['action'])) |
|
149 | 149 | { |
150 | 150 | $remote_storage->save($_POST['action']); |
151 | 151 | } |
152 | 152 | |
153 | - if(isset($_POST['authentification_code']) && $_POST['authentification_code'] != "") |
|
153 | + if (isset($_POST['authentification_code']) && $_POST['authentification_code'] != "") |
|
154 | 154 | { |
155 | 155 | $_POST['authentification_code'] = $xcloner_sanitization->sanitize_input_as_string($_POST['authentification_code']); |
156 | 156 | |
157 | 157 | $remote_storage->set_access_token($_POST['authentification_code']); |
158 | 158 | } |
159 | 159 | |
160 | - if(isset($_POST['connection_check']) && $_POST['connection_check']) |
|
160 | + if (isset($_POST['connection_check']) && $_POST['connection_check']) |
|
161 | 161 | { |
162 | 162 | $remote_storage->check($_POST['action']); |
163 | 163 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | $requirements = $this->xcloner_container->get_xcloner_requirements(); |
172 | 172 | |
173 | - if(!$requirements->check_backup_ready_status()) |
|
173 | + if (!$requirements->check_backup_ready_status()) |
|
174 | 174 | { |
175 | 175 | require_once("partials/xcloner_init_page.php"); |
176 | 176 | return false; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | $requirements = $this->xcloner_container->get_xcloner_requirements(); |
204 | 204 | |
205 | - if(!$requirements->check_backup_ready_status()) |
|
205 | + if (!$requirements->check_backup_ready_status()) |
|
206 | 206 | { |
207 | 207 | require_once("partials/xcloner_init_page.php"); |
208 | 208 | return false; |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | <?php |
236 | 236 | $xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
237 | 237 | |
238 | - if( isset( $_GET[ 'tab' ] ) ) { |
|
239 | - $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
238 | + if (isset($_GET['tab'])) { |
|
239 | + $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET['tab']); |
|
240 | 240 | } // end if |
241 | - else{ |
|
241 | + else { |
|
242 | 242 | $active_tab = "general_options"; |
243 | 243 | } |
244 | 244 | |
@@ -257,20 +257,20 @@ discard block |
||
257 | 257 | <form action="options.php" method="post"> |
258 | 258 | <?php |
259 | 259 | |
260 | - if( $active_tab == 'general_options' ) { |
|
260 | + if ($active_tab == 'general_options') { |
|
261 | 261 | |
262 | 262 | settings_fields('xcloner_general_settings_group'); |
263 | 263 | do_settings_sections('xcloner_settings_page'); |
264 | 264 | |
265 | - }elseif( $active_tab == 'mysql_options' ) { |
|
265 | + }elseif ($active_tab == 'mysql_options') { |
|
266 | 266 | |
267 | 267 | settings_fields('xcloner_mysql_settings_group'); |
268 | 268 | do_settings_sections('xcloner_mysql_settings_page'); |
269 | - }elseif( $active_tab == 'system_options' ) { |
|
269 | + }elseif ($active_tab == 'system_options') { |
|
270 | 270 | |
271 | 271 | settings_fields('xcloner_system_settings_group'); |
272 | 272 | do_settings_sections('xcloner_system_settings_page'); |
273 | - }elseif( $active_tab == 'cleanup_options' ) { |
|
273 | + }elseif ($active_tab == 'cleanup_options') { |
|
274 | 274 | |
275 | 275 | settings_fields('xcloner_cleanup_settings_group'); |
276 | 276 | do_settings_sections('xcloner_cleanup_settings_page'); |
@@ -175,6 +175,9 @@ |
||
175 | 175 | return $wpdb->prefix; |
176 | 176 | } |
177 | 177 | |
178 | + /** |
|
179 | + * @param string $option |
|
180 | + */ |
|
178 | 181 | public function get_xcloner_option($option) |
179 | 182 | { |
180 | 183 | $data = get_option($option); |
@@ -202,348 +202,348 @@ discard block |
||
202 | 202 | |
203 | 203 | public function settings_init() |
204 | 204 | { |
205 | - global $wpdb; |
|
206 | - $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
205 | + global $wpdb; |
|
206 | + $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
207 | 207 | |
208 | - //ADDING MISSING OPTIONS |
|
209 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
208 | + //ADDING MISSING OPTIONS |
|
209 | + if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
210 | 210 | add_option( 'xcloner_mysql_settings_page' ); |
211 | 211 | } // end if |
212 | 212 | |
213 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
213 | + if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
214 | 214 | add_option( 'xcloner_cron_settings_page' ); |
215 | 215 | } // end if |
216 | 216 | |
217 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
217 | + if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
218 | 218 | add_option( 'xcloner_system_settings_page' ); |
219 | 219 | } // end if |
220 | 220 | |
221 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
221 | + if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
222 | 222 | add_option( 'xcloner_cleanup_settings_page' ); |
223 | 223 | } // end if |
224 | 224 | |
225 | 225 | |
226 | - //ADDING SETTING SECTIONS |
|
227 | - //GENERAL section |
|
228 | - add_settings_section( |
|
229 | - 'xcloner_general_settings_group', |
|
230 | - __(' '), |
|
231 | - array($this, 'xcloner_settings_section_cb'), |
|
232 | - 'xcloner_settings_page' |
|
233 | - ); |
|
234 | - //MYSQL section |
|
235 | - add_settings_section( |
|
236 | - 'xcloner_mysql_settings_group', |
|
237 | - __(' '), |
|
238 | - array($this, 'xcloner_settings_section_cb'), |
|
239 | - 'xcloner_mysql_settings_page' |
|
240 | - ); |
|
226 | + //ADDING SETTING SECTIONS |
|
227 | + //GENERAL section |
|
228 | + add_settings_section( |
|
229 | + 'xcloner_general_settings_group', |
|
230 | + __(' '), |
|
231 | + array($this, 'xcloner_settings_section_cb'), |
|
232 | + 'xcloner_settings_page' |
|
233 | + ); |
|
234 | + //MYSQL section |
|
235 | + add_settings_section( |
|
236 | + 'xcloner_mysql_settings_group', |
|
237 | + __(' '), |
|
238 | + array($this, 'xcloner_settings_section_cb'), |
|
239 | + 'xcloner_mysql_settings_page' |
|
240 | + ); |
|
241 | 241 | |
242 | - //SYSTEM section |
|
243 | - add_settings_section( |
|
244 | - 'xcloner_system_settings_group', |
|
245 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
246 | - array($this, 'xcloner_settings_section_cb'), |
|
247 | - 'xcloner_system_settings_page' |
|
248 | - ); |
|
242 | + //SYSTEM section |
|
243 | + add_settings_section( |
|
244 | + 'xcloner_system_settings_group', |
|
245 | + __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
246 | + array($this, 'xcloner_settings_section_cb'), |
|
247 | + 'xcloner_system_settings_page' |
|
248 | + ); |
|
249 | 249 | |
250 | - //CLEANUP section |
|
251 | - add_settings_section( |
|
252 | - 'xcloner_cleanup_settings_group', |
|
253 | - __(' '), |
|
254 | - array($this, 'xcloner_settings_section_cb'), |
|
255 | - 'xcloner_cleanup_settings_page' |
|
256 | - ); |
|
250 | + //CLEANUP section |
|
251 | + add_settings_section( |
|
252 | + 'xcloner_cleanup_settings_group', |
|
253 | + __(' '), |
|
254 | + array($this, 'xcloner_settings_section_cb'), |
|
255 | + 'xcloner_cleanup_settings_page' |
|
256 | + ); |
|
257 | 257 | |
258 | 258 | |
259 | 259 | //CRON section |
260 | - add_settings_section( |
|
261 | - 'xcloner_cron_settings_group', |
|
262 | - __(' '), |
|
263 | - array($this, 'xcloner_settings_section_cb'), |
|
264 | - 'xcloner_cron_settings_page' |
|
265 | - ); |
|
260 | + add_settings_section( |
|
261 | + 'xcloner_cron_settings_group', |
|
262 | + __(' '), |
|
263 | + array($this, 'xcloner_settings_section_cb'), |
|
264 | + 'xcloner_cron_settings_page' |
|
265 | + ); |
|
266 | 266 | |
267 | 267 | |
268 | 268 | |
269 | 269 | //REGISTERING THE 'GENERAL SECTION' FIELDS |
270 | 270 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
271 | - add_settings_field( |
|
272 | - 'xcloner_backup_compression_level', |
|
273 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
274 | - array($this, 'do_form_range_field'), |
|
275 | - 'xcloner_settings_page', |
|
276 | - 'xcloner_general_settings_group', |
|
277 | - array('xcloner_backup_compression_level', |
|
278 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
279 | - 0, |
|
280 | - 9 |
|
281 | - ) |
|
282 | - ); |
|
271 | + add_settings_field( |
|
272 | + 'xcloner_backup_compression_level', |
|
273 | + __('Backup Compression Level','xcloner-backup-and-restore'), |
|
274 | + array($this, 'do_form_range_field'), |
|
275 | + 'xcloner_settings_page', |
|
276 | + 'xcloner_general_settings_group', |
|
277 | + array('xcloner_backup_compression_level', |
|
278 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
279 | + 0, |
|
280 | + 9 |
|
281 | + ) |
|
282 | + ); |
|
283 | 283 | |
284 | - register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
285 | - add_settings_field( |
|
286 | - 'xcloner_start_path', |
|
287 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
288 | - array($this, 'do_form_text_field'), |
|
289 | - 'xcloner_settings_page', |
|
290 | - 'xcloner_general_settings_group', |
|
291 | - array('xcloner_start_path', |
|
284 | + register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
285 | + add_settings_field( |
|
286 | + 'xcloner_start_path', |
|
287 | + __('Backup Start Location','xcloner-backup-and-restore'), |
|
288 | + array($this, 'do_form_text_field'), |
|
289 | + 'xcloner_settings_page', |
|
290 | + 'xcloner_general_settings_group', |
|
291 | + array('xcloner_start_path', |
|
292 | 292 | __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
293 | 293 | $this->get_xcloner_start_path(), |
294 | 294 | //'disabled' |
295 | 295 | ) |
296 | - ); |
|
296 | + ); |
|
297 | 297 | |
298 | - register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
299 | - add_settings_field( |
|
300 | - 'xcloner_store_path', |
|
301 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
302 | - array($this, 'do_form_text_field'), |
|
303 | - 'xcloner_settings_page', |
|
304 | - 'xcloner_general_settings_group', |
|
305 | - array('xcloner_store_path', |
|
298 | + register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
299 | + add_settings_field( |
|
300 | + 'xcloner_store_path', |
|
301 | + __('Backup Storage Location','xcloner-backup-and-restore'), |
|
302 | + array($this, 'do_form_text_field'), |
|
303 | + 'xcloner_settings_page', |
|
304 | + 'xcloner_general_settings_group', |
|
305 | + array('xcloner_store_path', |
|
306 | 306 | __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
307 | 307 | $this->get_xcloner_store_path(), |
308 | 308 | //'disabled' |
309 | 309 | ) |
310 | - ); |
|
310 | + ); |
|
311 | 311 | |
312 | - register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
313 | - add_settings_field( |
|
314 | - 'xcloner_enable_log', |
|
315 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
316 | - array($this, 'do_form_switch_field'), |
|
317 | - 'xcloner_settings_page', |
|
318 | - 'xcloner_general_settings_group', |
|
319 | - array('xcloner_enable_log', |
|
312 | + register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
313 | + add_settings_field( |
|
314 | + 'xcloner_enable_log', |
|
315 | + __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
316 | + array($this, 'do_form_switch_field'), |
|
317 | + 'xcloner_settings_page', |
|
318 | + 'xcloner_general_settings_group', |
|
319 | + array('xcloner_enable_log', |
|
320 | 320 | sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s','xcloner-backup-and-restore'), $this->get_logger_filename()) |
321 | 321 | ) |
322 | 322 | ); |
323 | 323 | |
324 | 324 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
325 | - add_settings_field( |
|
326 | - 'xcloner_regex_exclude', |
|
327 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
328 | - array($this, 'do_form_textarea_field'), |
|
329 | - 'xcloner_settings_page', |
|
330 | - 'xcloner_general_settings_group', |
|
331 | - array('xcloner_regex_exclude', |
|
325 | + add_settings_field( |
|
326 | + 'xcloner_regex_exclude', |
|
327 | + __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
328 | + array($this, 'do_form_textarea_field'), |
|
329 | + 'xcloner_settings_page', |
|
330 | + 'xcloner_general_settings_group', |
|
331 | + array('xcloner_regex_exclude', |
|
332 | 332 | __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
333 | 333 | //$this->get_xcloner_store_path(), |
334 | 334 | //'disabled' |
335 | 335 | ) |
336 | - ); |
|
336 | + ); |
|
337 | 337 | |
338 | 338 | //REGISTERING THE 'MYSQL SECTION' FIELDS |
339 | 339 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
340 | - add_settings_field( |
|
341 | - 'xcloner_enable_mysql_backup', |
|
342 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
343 | - array($this, 'do_form_switch_field'), |
|
344 | - 'xcloner_mysql_settings_page', |
|
345 | - 'xcloner_mysql_settings_group', |
|
346 | - array('xcloner_enable_mysql_backup', |
|
340 | + add_settings_field( |
|
341 | + 'xcloner_enable_mysql_backup', |
|
342 | + __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
343 | + array($this, 'do_form_switch_field'), |
|
344 | + 'xcloner_mysql_settings_page', |
|
345 | + 'xcloner_mysql_settings_group', |
|
346 | + array('xcloner_enable_mysql_backup', |
|
347 | 347 | __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
348 | 348 | ) |
349 | - ); |
|
349 | + ); |
|
350 | 350 | |
351 | - register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
352 | - add_settings_field( |
|
353 | - 'xcloner_backup_only_wp_tables', |
|
354 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
355 | - array($this, 'do_form_switch_field'), |
|
356 | - 'xcloner_mysql_settings_page', |
|
357 | - 'xcloner_mysql_settings_group', |
|
358 | - array('xcloner_backup_only_wp_tables', |
|
351 | + register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
352 | + add_settings_field( |
|
353 | + 'xcloner_backup_only_wp_tables', |
|
354 | + __('Backup only WP tables','xcloner-backup-and-restore'), |
|
355 | + array($this, 'do_form_switch_field'), |
|
356 | + 'xcloner_mysql_settings_page', |
|
357 | + 'xcloner_mysql_settings_group', |
|
358 | + array('xcloner_backup_only_wp_tables', |
|
359 | 359 | sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
360 | 360 | ) |
361 | - ); |
|
361 | + ); |
|
362 | 362 | |
363 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
364 | - add_settings_field( |
|
365 | - 'xcloner_mysql_hostname', |
|
366 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
367 | - array($this, 'do_form_text_field'), |
|
368 | - 'xcloner_mysql_settings_page', |
|
369 | - 'xcloner_mysql_settings_group', |
|
370 | - array('xcloner_mysql_hostname', |
|
363 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
364 | + add_settings_field( |
|
365 | + 'xcloner_mysql_hostname', |
|
366 | + __('Mysql Hostname','xcloner-backup-and-restore'), |
|
367 | + array($this, 'do_form_text_field'), |
|
368 | + 'xcloner_mysql_settings_page', |
|
369 | + 'xcloner_mysql_settings_group', |
|
370 | + array('xcloner_mysql_hostname', |
|
371 | 371 | __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
372 | 372 | $this->get_db_hostname(), |
373 | 373 | 'disabled' |
374 | 374 | ) |
375 | - ); |
|
375 | + ); |
|
376 | 376 | |
377 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
378 | - add_settings_field( |
|
379 | - 'xcloner_mysql_username', |
|
380 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
381 | - array($this, 'do_form_text_field'), |
|
382 | - 'xcloner_mysql_settings_page', |
|
383 | - 'xcloner_mysql_settings_group', |
|
384 | - array('xcloner_mysql_username', |
|
377 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
378 | + add_settings_field( |
|
379 | + 'xcloner_mysql_username', |
|
380 | + __('Mysql Username','xcloner-backup-and-restore'), |
|
381 | + array($this, 'do_form_text_field'), |
|
382 | + 'xcloner_mysql_settings_page', |
|
383 | + 'xcloner_mysql_settings_group', |
|
384 | + array('xcloner_mysql_username', |
|
385 | 385 | __('Wordpress mysql username','xcloner-backup-and-restore'), |
386 | 386 | $this->get_db_username(), |
387 | 387 | 'disabled' |
388 | 388 | ) |
389 | - ); |
|
389 | + ); |
|
390 | 390 | |
391 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
392 | - add_settings_field( |
|
393 | - 'xcloner_mysql_database', |
|
394 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
395 | - array($this, 'do_form_text_field'), |
|
396 | - 'xcloner_mysql_settings_page', |
|
397 | - 'xcloner_mysql_settings_group', |
|
398 | - array('xcloner_mysql_database', |
|
391 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
392 | + add_settings_field( |
|
393 | + 'xcloner_mysql_database', |
|
394 | + __('Mysql Database','xcloner-backup-and-restore'), |
|
395 | + array($this, 'do_form_text_field'), |
|
396 | + 'xcloner_mysql_settings_page', |
|
397 | + 'xcloner_mysql_settings_group', |
|
398 | + array('xcloner_mysql_database', |
|
399 | 399 | __('Wordpress mysql database','xcloner-backup-and-restore'), |
400 | 400 | $this->get_db_database(), |
401 | 401 | 'disabled' |
402 | 402 | ) |
403 | - ); |
|
403 | + ); |
|
404 | 404 | |
405 | - //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
406 | - register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
407 | - add_settings_field( |
|
408 | - 'xcloner_size_limit_per_request', |
|
409 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
410 | - array($this, 'do_form_range_field'), |
|
411 | - 'xcloner_system_settings_page', |
|
412 | - 'xcloner_system_settings_group', |
|
413 | - array('xcloner_size_limit_per_request', |
|
414 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
415 | - 0, |
|
416 | - 1024 |
|
417 | - ) |
|
418 | - ); |
|
405 | + //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
406 | + register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
407 | + add_settings_field( |
|
408 | + 'xcloner_size_limit_per_request', |
|
409 | + __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
410 | + array($this, 'do_form_range_field'), |
|
411 | + 'xcloner_system_settings_page', |
|
412 | + 'xcloner_system_settings_group', |
|
413 | + array('xcloner_size_limit_per_request', |
|
414 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
415 | + 0, |
|
416 | + 1024 |
|
417 | + ) |
|
418 | + ); |
|
419 | 419 | |
420 | 420 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
421 | - add_settings_field( |
|
422 | - 'xcloner_files_to_process_per_request', |
|
423 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
424 | - array($this, 'do_form_range_field'), |
|
425 | - 'xcloner_system_settings_page', |
|
426 | - 'xcloner_system_settings_group', |
|
427 | - array('xcloner_files_to_process_per_request', |
|
428 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
429 | - 0, |
|
430 | - 1000 |
|
431 | - ) |
|
432 | - ); |
|
421 | + add_settings_field( |
|
422 | + 'xcloner_files_to_process_per_request', |
|
423 | + __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
424 | + array($this, 'do_form_range_field'), |
|
425 | + 'xcloner_system_settings_page', |
|
426 | + 'xcloner_system_settings_group', |
|
427 | + array('xcloner_files_to_process_per_request', |
|
428 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
429 | + 0, |
|
430 | + 1000 |
|
431 | + ) |
|
432 | + ); |
|
433 | 433 | |
434 | 434 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
435 | - add_settings_field( |
|
436 | - 'xcloner_directories_to_scan_per_request', |
|
437 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
438 | - array($this, 'do_form_range_field'), |
|
439 | - 'xcloner_system_settings_page', |
|
440 | - 'xcloner_system_settings_group', |
|
441 | - array('xcloner_directories_to_scan_per_request', |
|
442 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
443 | - 0, |
|
444 | - 1000 |
|
445 | - ) |
|
446 | - ); |
|
435 | + add_settings_field( |
|
436 | + 'xcloner_directories_to_scan_per_request', |
|
437 | + __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
438 | + array($this, 'do_form_range_field'), |
|
439 | + 'xcloner_system_settings_page', |
|
440 | + 'xcloner_system_settings_group', |
|
441 | + array('xcloner_directories_to_scan_per_request', |
|
442 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
443 | + 0, |
|
444 | + 1000 |
|
445 | + ) |
|
446 | + ); |
|
447 | 447 | |
448 | 448 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
449 | - add_settings_field( |
|
450 | - 'xcloner_database_records_per_request', |
|
451 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
452 | - array($this, 'do_form_range_field'), |
|
453 | - 'xcloner_system_settings_page', |
|
454 | - 'xcloner_system_settings_group', |
|
455 | - array('xcloner_database_records_per_request', |
|
456 | - __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records','xcloner-backup-and-restore'), |
|
457 | - 0, |
|
458 | - 100000 |
|
459 | - ) |
|
460 | - ); |
|
449 | + add_settings_field( |
|
450 | + 'xcloner_database_records_per_request', |
|
451 | + __('Database Records Per Request','xcloner-backup-and-restore'), |
|
452 | + array($this, 'do_form_range_field'), |
|
453 | + 'xcloner_system_settings_page', |
|
454 | + 'xcloner_system_settings_group', |
|
455 | + array('xcloner_database_records_per_request', |
|
456 | + __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records','xcloner-backup-and-restore'), |
|
457 | + 0, |
|
458 | + 100000 |
|
459 | + ) |
|
460 | + ); |
|
461 | 461 | |
462 | 462 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
463 | - add_settings_field( |
|
464 | - 'xcloner_exclude_files_larger_than_mb', |
|
465 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
466 | - array($this, 'do_form_number_field'), |
|
467 | - 'xcloner_system_settings_page', |
|
468 | - 'xcloner_system_settings_group', |
|
469 | - array('xcloner_exclude_files_larger_than_mb', |
|
470 | - __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
471 | - ) |
|
472 | - ); |
|
463 | + add_settings_field( |
|
464 | + 'xcloner_exclude_files_larger_than_mb', |
|
465 | + __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
466 | + array($this, 'do_form_number_field'), |
|
467 | + 'xcloner_system_settings_page', |
|
468 | + 'xcloner_system_settings_group', |
|
469 | + array('xcloner_exclude_files_larger_than_mb', |
|
470 | + __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
471 | + ) |
|
472 | + ); |
|
473 | 473 | |
474 | 474 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
475 | - add_settings_field( |
|
476 | - 'xcloner_split_backup_limit', |
|
477 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
478 | - array($this, 'do_form_number_field'), |
|
479 | - 'xcloner_system_settings_page', |
|
480 | - 'xcloner_system_settings_group', |
|
481 | - array('xcloner_split_backup_limit', |
|
482 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
483 | - ) |
|
484 | - ); |
|
475 | + add_settings_field( |
|
476 | + 'xcloner_split_backup_limit', |
|
477 | + __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
478 | + array($this, 'do_form_number_field'), |
|
479 | + 'xcloner_system_settings_page', |
|
480 | + 'xcloner_system_settings_group', |
|
481 | + array('xcloner_split_backup_limit', |
|
482 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
483 | + ) |
|
484 | + ); |
|
485 | 485 | |
486 | - register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
487 | - add_settings_field( |
|
488 | - 'xcloner_force_tmp_path_site_root', |
|
489 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
490 | - array($this, 'do_form_switch_field'), |
|
491 | - 'xcloner_system_settings_page', |
|
492 | - 'xcloner_system_settings_group', |
|
493 | - array('xcloner_force_tmp_path_site_root', |
|
486 | + register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
487 | + add_settings_field( |
|
488 | + 'xcloner_force_tmp_path_site_root', |
|
489 | + __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
490 | + array($this, 'do_form_switch_field'), |
|
491 | + 'xcloner_system_settings_page', |
|
492 | + 'xcloner_system_settings_group', |
|
493 | + array('xcloner_force_tmp_path_site_root', |
|
494 | 494 | sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location','xcloner-backup-and-restore'), $this->get_table_prefix()) |
495 | 495 | ) |
496 | - ); |
|
496 | + ); |
|
497 | 497 | |
498 | 498 | //REGISTERING THE 'CLEANUP SECTION' FIELDS |
499 | 499 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
500 | - add_settings_field( |
|
501 | - 'xcloner_cleanup_retention_limit_days', |
|
502 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
503 | - array($this, 'do_form_number_field'), |
|
504 | - 'xcloner_cleanup_settings_page', |
|
505 | - 'xcloner_cleanup_settings_group', |
|
506 | - array('xcloner_cleanup_retention_limit_days', |
|
500 | + add_settings_field( |
|
501 | + 'xcloner_cleanup_retention_limit_days', |
|
502 | + __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
503 | + array($this, 'do_form_number_field'), |
|
504 | + 'xcloner_cleanup_settings_page', |
|
505 | + 'xcloner_cleanup_settings_group', |
|
506 | + array('xcloner_cleanup_retention_limit_days', |
|
507 | 507 | __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
508 | 508 | ) |
509 | - ); |
|
509 | + ); |
|
510 | 510 | |
511 | 511 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
512 | - add_settings_field( |
|
513 | - 'xcloner_cleanup_retention_limit_archives', |
|
514 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
515 | - array($this, 'do_form_number_field'), |
|
516 | - 'xcloner_cleanup_settings_page', |
|
517 | - 'xcloner_cleanup_settings_group', |
|
518 | - array('xcloner_cleanup_retention_limit_archives', |
|
512 | + add_settings_field( |
|
513 | + 'xcloner_cleanup_retention_limit_archives', |
|
514 | + __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
515 | + array($this, 'do_form_number_field'), |
|
516 | + 'xcloner_cleanup_settings_page', |
|
517 | + 'xcloner_cleanup_settings_group', |
|
518 | + array('xcloner_cleanup_retention_limit_archives', |
|
519 | 519 | __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
520 | 520 | ) |
521 | - ); |
|
521 | + ); |
|
522 | 522 | |
523 | 523 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
524 | - add_settings_field( |
|
525 | - 'xcloner_cleanup_capacity_limit', |
|
526 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
527 | - array($this, 'do_form_number_field'), |
|
528 | - 'xcloner_cleanup_settings_page', |
|
529 | - 'xcloner_cleanup_settings_group', |
|
530 | - array('xcloner_cleanup_capacity_limit', |
|
524 | + add_settings_field( |
|
525 | + 'xcloner_cleanup_capacity_limit', |
|
526 | + __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
527 | + array($this, 'do_form_number_field'), |
|
528 | + 'xcloner_cleanup_settings_page', |
|
529 | + 'xcloner_cleanup_settings_group', |
|
530 | + array('xcloner_cleanup_capacity_limit', |
|
531 | 531 | __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
532 | 532 | ) |
533 | - ); |
|
533 | + ); |
|
534 | 534 | |
535 | 535 | //REGISTERING THE 'CRON SECTION' FIELDS |
536 | 536 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
537 | - add_settings_field( |
|
538 | - 'xcloner_cron_frequency', |
|
539 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
540 | - array($this, 'do_form_text_field'), |
|
541 | - 'xcloner_cron_settings_page', |
|
542 | - 'xcloner_cron_settings_group', |
|
543 | - array('xcloner_cron_frequency', |
|
537 | + add_settings_field( |
|
538 | + 'xcloner_cron_frequency', |
|
539 | + __('Cron frequency','xcloner-backup-and-restore'), |
|
540 | + array($this, 'do_form_text_field'), |
|
541 | + 'xcloner_cron_settings_page', |
|
542 | + 'xcloner_cron_settings_group', |
|
543 | + array('xcloner_cron_frequency', |
|
544 | 544 | __('Cron frequency') |
545 | 545 | ) |
546 | - ); |
|
546 | + ); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | // section content cb |
557 | 557 | public function xcloner_settings_section_cb() |
558 | 558 | { |
559 | - //echo '<p>WPOrg Section Introduction.</p>'; |
|
559 | + //echo '<p>WPOrg Section Introduction.</p>'; |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | // text field content cb |
@@ -571,8 +571,8 @@ discard block |
||
571 | 571 | |
572 | 572 | if(!$value) |
573 | 573 | $value = get_option($fieldname); |
574 | - // output the field |
|
575 | - ?> |
|
574 | + // output the field |
|
575 | + ?> |
|
576 | 576 | <div class="row"> |
577 | 577 | <div class="input-field col s10 m10 l8"> |
578 | 578 | <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
@@ -598,8 +598,8 @@ discard block |
||
598 | 598 | |
599 | 599 | if(!$value) |
600 | 600 | $value = get_option($fieldname); |
601 | - // output the field |
|
602 | - ?> |
|
601 | + // output the field |
|
602 | + ?> |
|
603 | 603 | <div class="row"> |
604 | 604 | <div class="input-field col s10 m10 l8"> |
605 | 605 | <textarea class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
@@ -641,8 +641,8 @@ discard block |
||
641 | 641 | |
642 | 642 | if(!$value) |
643 | 643 | $value = get_option($fieldname); |
644 | - // output the field |
|
645 | - ?> |
|
644 | + // output the field |
|
645 | + ?> |
|
646 | 646 | <div class="row"> |
647 | 647 | <div class="input-field col s10 m5 l3"> |
648 | 648 | <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="number" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | { |
5 | 5 | private $logger_file = "xcloner_main_%s.log"; |
6 | 6 | private $logger_file_hash = "xcloner%s.log"; |
7 | - private $hash ; |
|
7 | + private $hash; |
|
8 | 8 | private $xcloner_sanitization; |
9 | 9 | private $xcloner_container; |
10 | 10 | |
11 | 11 | public function __construct(Xcloner $xcloner_container, $hash = "") |
12 | 12 | { |
13 | 13 | $this->xcloner_container = $xcloner_container; |
14 | - if(isset($hash)) |
|
14 | + if (isset($hash)) |
|
15 | 15 | $this->set_hash($hash); |
16 | 16 | } |
17 | 17 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function get_logger_filename($include_hash = 0) |
24 | 24 | { |
25 | - if($include_hash) |
|
25 | + if ($include_hash) |
|
26 | 26 | $filename = sprintf($this->logger_file_hash, $this->get_hash()); |
27 | 27 | else |
28 | 28 | $filename = sprintf($this->logger_file, $this->get_server_unique_hash(5)); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function get_xcloner_start_path() |
34 | 34 | { |
35 | - if(!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
|
35 | + if (!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
|
36 | 36 | $path = realpath(ABSPATH); |
37 | 37 | else |
38 | 38 | $path = get_option('xcloner_start_path'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function get_xcloner_store_path() |
51 | 51 | { |
52 | - if(!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
|
52 | + if (!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
|
53 | 53 | $path = realpath(XCLONER_STORAGE_PATH); |
54 | 54 | else |
55 | 55 | $path = get_option('xcloner_store_path'); |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | public function get_xcloner_tmp_path() |
67 | 67 | { |
68 | 68 | $path = sys_get_temp_dir().DS.".".$this->get_xcloner_tmp_path_suffix(); |
69 | - if(!is_dir($path)) |
|
69 | + if (!is_dir($path)) |
|
70 | 70 | { |
71 | 71 | @mkdir($path); |
72 | 72 | @chmod($path, 0777); |
73 | 73 | } |
74 | 74 | |
75 | - if(!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) |
|
75 | + if (!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) |
|
76 | 76 | $path = $this->get_xcloner_store_path().DS.".".$this->get_xcloner_tmp_path_suffix(); |
77 | 77 | |
78 | 78 | return $path; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function get_enable_mysql_backup() |
82 | 82 | { |
83 | - if(get_option('xcloner_enable_mysql_backup')) |
|
83 | + if (get_option('xcloner_enable_mysql_backup')) |
|
84 | 84 | return true; |
85 | 85 | |
86 | 86 | return false; |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | |
89 | 89 | public function get_backup_extension_name($ext = "") |
90 | 90 | { |
91 | - if(!$ext) |
|
91 | + if (!$ext) |
|
92 | 92 | { |
93 | - if(get_option('xcloner_backup_compression_level')) |
|
93 | + if (get_option('xcloner_backup_compression_level')) |
|
94 | 94 | $ext = ".tgz"; |
95 | 95 | else |
96 | 96 | $ext = ".tar"; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | public function get_hash() |
102 | 102 | { |
103 | - if(!$this->hash){ |
|
103 | + if (!$this->hash) { |
|
104 | 104 | $this->set_hash("-".$this->get_server_unique_hash(5)); |
105 | 105 | } |
106 | 106 | |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | { |
113 | 113 | $hash = "-".md5(rand()); |
114 | 114 | |
115 | - $this->set_hash(substr( $hash, 0, 6)); |
|
115 | + $this->set_hash(substr($hash, 0, 6)); |
|
116 | 116 | |
117 | 117 | return $hash; |
118 | 118 | } |
119 | 119 | |
120 | 120 | public function set_hash($hash = "") |
121 | 121 | { |
122 | - if(substr($hash, 0, 1) != "-" and strlen($hash)) |
|
122 | + if (substr($hash, 0, 1) != "-" and strlen($hash)) |
|
123 | 123 | $hash = "-".$hash; |
124 | 124 | |
125 | - $this->hash = substr( $hash, 0, 6); |
|
125 | + $this->hash = substr($hash, 0, 6); |
|
126 | 126 | |
127 | 127 | return $this; |
128 | 128 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $data = parse_url(get_site_url()); |
133 | 133 | |
134 | - $backup_name = "backup_[domain]".(isset($data['port'])?":".$data['port']:"")."-[time]-".($this->get_enable_mysql_backup()?"sql":"nosql"); |
|
134 | + $backup_name = "backup_[domain]".(isset($data['port']) ? ":".$data['port'] : "")."-[time]-".($this->get_enable_mysql_backup() ? "sql" : "nosql"); |
|
135 | 135 | |
136 | 136 | return $backup_name; |
137 | 137 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | global $wpdb; |
142 | 142 | |
143 | - if(!$data = get_option('xcloner_mysql_hostname')) |
|
143 | + if (!$data = get_option('xcloner_mysql_hostname')) |
|
144 | 144 | $data = $wpdb->dbhost; |
145 | 145 | |
146 | 146 | return $data; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | global $wpdb; |
152 | 152 | |
153 | - if(!$data = get_option('xcloner_mysql_username')) |
|
153 | + if (!$data = get_option('xcloner_mysql_username')) |
|
154 | 154 | $data = $wpdb->dbuser; |
155 | 155 | |
156 | 156 | return $data; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | { |
161 | 161 | global $wpdb; |
162 | 162 | |
163 | - if(!$data = get_option('xcloner_mysql_password')) |
|
163 | + if (!$data = get_option('xcloner_mysql_password')) |
|
164 | 164 | $data = $wpdb->dbpassword; |
165 | 165 | |
166 | 166 | return $data; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | global $wpdb; |
172 | 172 | |
173 | - if(!$data = get_option('xcloner_mysql_database')) |
|
173 | + if (!$data = get_option('xcloner_mysql_database')) |
|
174 | 174 | $data = $wpdb->dbname; |
175 | 175 | |
176 | 176 | return $data; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | $hash = md5(get_home_url().__DIR__); |
196 | 196 | |
197 | - if($strlen) |
|
197 | + if ($strlen) |
|
198 | 198 | $hash = substr($hash, 0, $strlen); |
199 | 199 | |
200 | 200 | return $hash; |
@@ -206,20 +206,20 @@ discard block |
||
206 | 206 | $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
207 | 207 | |
208 | 208 | //ADDING MISSING OPTIONS |
209 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
210 | - add_option( 'xcloner_mysql_settings_page' ); |
|
209 | + if (false == get_option('xcloner_mysql_settings_page')) { |
|
210 | + add_option('xcloner_mysql_settings_page'); |
|
211 | 211 | } // end if |
212 | 212 | |
213 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
214 | - add_option( 'xcloner_cron_settings_page' ); |
|
213 | + if (false == get_option('xcloner_cron_settings_page')) { |
|
214 | + add_option('xcloner_cron_settings_page'); |
|
215 | 215 | } // end if |
216 | 216 | |
217 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
218 | - add_option( 'xcloner_system_settings_page' ); |
|
217 | + if (false == get_option('xcloner_system_settings_page')) { |
|
218 | + add_option('xcloner_system_settings_page'); |
|
219 | 219 | } // end if |
220 | 220 | |
221 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
222 | - add_option( 'xcloner_cleanup_settings_page' ); |
|
221 | + if (false == get_option('xcloner_cleanup_settings_page')) { |
|
222 | + add_option('xcloner_cleanup_settings_page'); |
|
223 | 223 | } // end if |
224 | 224 | |
225 | 225 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | //SYSTEM section |
243 | 243 | add_settings_section( |
244 | 244 | 'xcloner_system_settings_group', |
245 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
245 | + __('These are advanced options recommended for developers!', 'xcloner-backup-and-restore'), |
|
246 | 246 | array($this, 'xcloner_settings_section_cb'), |
247 | 247 | 'xcloner_system_settings_page' |
248 | 248 | ); |
@@ -270,12 +270,12 @@ discard block |
||
270 | 270 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
271 | 271 | add_settings_field( |
272 | 272 | 'xcloner_backup_compression_level', |
273 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
273 | + __('Backup Compression Level', 'xcloner-backup-and-restore'), |
|
274 | 274 | array($this, 'do_form_range_field'), |
275 | 275 | 'xcloner_settings_page', |
276 | 276 | 'xcloner_general_settings_group', |
277 | 277 | array('xcloner_backup_compression_level', |
278 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
278 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load', 'xcloner-backup-and-restore'), |
|
279 | 279 | 0, |
280 | 280 | 9 |
281 | 281 | ) |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
285 | 285 | add_settings_field( |
286 | 286 | 'xcloner_start_path', |
287 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
287 | + __('Backup Start Location', 'xcloner-backup-and-restore'), |
|
288 | 288 | array($this, 'do_form_text_field'), |
289 | 289 | 'xcloner_settings_page', |
290 | 290 | 'xcloner_general_settings_group', |
291 | 291 | array('xcloner_start_path', |
292 | - __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
|
292 | + __('Base path location from where XCloner can start the Backup.', 'xcloner-backup-and-restore'), |
|
293 | 293 | $this->get_xcloner_start_path(), |
294 | 294 | //'disabled' |
295 | 295 | ) |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
299 | 299 | add_settings_field( |
300 | 300 | 'xcloner_store_path', |
301 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
301 | + __('Backup Storage Location', 'xcloner-backup-and-restore'), |
|
302 | 302 | array($this, 'do_form_text_field'), |
303 | 303 | 'xcloner_settings_page', |
304 | 304 | 'xcloner_general_settings_group', |
305 | 305 | array('xcloner_store_path', |
306 | - __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
|
306 | + __('Location where XCloner will store the Backup archives.', 'xcloner-backup-and-restore'), |
|
307 | 307 | $this->get_xcloner_store_path(), |
308 | 308 | //'disabled' |
309 | 309 | ) |
@@ -312,24 +312,24 @@ discard block |
||
312 | 312 | register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
313 | 313 | add_settings_field( |
314 | 314 | 'xcloner_enable_log', |
315 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
315 | + __('Enable XCloner Backup Log', 'xcloner-backup-and-restore'), |
|
316 | 316 | array($this, 'do_form_switch_field'), |
317 | 317 | 'xcloner_settings_page', |
318 | 318 | 'xcloner_general_settings_group', |
319 | 319 | array('xcloner_enable_log', |
320 | - sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s','xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
320 | + sprintf(__('Enable the XCloner Backup log. You will find it stored unde the Backup Storage Location, file %s', 'xcloner-backup-and-restore'), $this->get_logger_filename()) |
|
321 | 321 | ) |
322 | 322 | ); |
323 | 323 | |
324 | 324 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
325 | 325 | add_settings_field( |
326 | 326 | 'xcloner_regex_exclude', |
327 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
327 | + __('Regex Exclude Files', 'xcloner-backup-and-restore'), |
|
328 | 328 | array($this, 'do_form_textarea_field'), |
329 | 329 | 'xcloner_settings_page', |
330 | 330 | 'xcloner_general_settings_group', |
331 | 331 | array('xcloner_regex_exclude', |
332 | - __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
|
332 | + __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line', 'xcloner-backup-and-restore'), |
|
333 | 333 | //$this->get_xcloner_store_path(), |
334 | 334 | //'disabled' |
335 | 335 | ) |
@@ -339,36 +339,36 @@ discard block |
||
339 | 339 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
340 | 340 | add_settings_field( |
341 | 341 | 'xcloner_enable_mysql_backup', |
342 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
342 | + __('Enable Mysql Backup', 'xcloner-backup-and-restore'), |
|
343 | 343 | array($this, 'do_form_switch_field'), |
344 | 344 | 'xcloner_mysql_settings_page', |
345 | 345 | 'xcloner_mysql_settings_group', |
346 | 346 | array('xcloner_enable_mysql_backup', |
347 | - __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
|
347 | + __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.', 'xcloner-backup-and-restore') |
|
348 | 348 | ) |
349 | 349 | ); |
350 | 350 | |
351 | 351 | register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
352 | 352 | add_settings_field( |
353 | 353 | 'xcloner_backup_only_wp_tables', |
354 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
354 | + __('Backup only WP tables', 'xcloner-backup-and-restore'), |
|
355 | 355 | array($this, 'do_form_switch_field'), |
356 | 356 | 'xcloner_mysql_settings_page', |
357 | 357 | 'xcloner_mysql_settings_group', |
358 | 358 | array('xcloner_backup_only_wp_tables', |
359 | - sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
359 | + sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
360 | 360 | ) |
361 | 361 | ); |
362 | 362 | |
363 | 363 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
364 | 364 | add_settings_field( |
365 | 365 | 'xcloner_mysql_hostname', |
366 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
366 | + __('Mysql Hostname', 'xcloner-backup-and-restore'), |
|
367 | 367 | array($this, 'do_form_text_field'), |
368 | 368 | 'xcloner_mysql_settings_page', |
369 | 369 | 'xcloner_mysql_settings_group', |
370 | 370 | array('xcloner_mysql_hostname', |
371 | - __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
|
371 | + __('Wordpress mysql hostname', 'xcloner-backup-and-restore'), |
|
372 | 372 | $this->get_db_hostname(), |
373 | 373 | 'disabled' |
374 | 374 | ) |
@@ -377,12 +377,12 @@ discard block |
||
377 | 377 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
378 | 378 | add_settings_field( |
379 | 379 | 'xcloner_mysql_username', |
380 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
380 | + __('Mysql Username', 'xcloner-backup-and-restore'), |
|
381 | 381 | array($this, 'do_form_text_field'), |
382 | 382 | 'xcloner_mysql_settings_page', |
383 | 383 | 'xcloner_mysql_settings_group', |
384 | 384 | array('xcloner_mysql_username', |
385 | - __('Wordpress mysql username','xcloner-backup-and-restore'), |
|
385 | + __('Wordpress mysql username', 'xcloner-backup-and-restore'), |
|
386 | 386 | $this->get_db_username(), |
387 | 387 | 'disabled' |
388 | 388 | ) |
@@ -391,12 +391,12 @@ discard block |
||
391 | 391 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
392 | 392 | add_settings_field( |
393 | 393 | 'xcloner_mysql_database', |
394 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
394 | + __('Mysql Database', 'xcloner-backup-and-restore'), |
|
395 | 395 | array($this, 'do_form_text_field'), |
396 | 396 | 'xcloner_mysql_settings_page', |
397 | 397 | 'xcloner_mysql_settings_group', |
398 | 398 | array('xcloner_mysql_database', |
399 | - __('Wordpress mysql database','xcloner-backup-and-restore'), |
|
399 | + __('Wordpress mysql database', 'xcloner-backup-and-restore'), |
|
400 | 400 | $this->get_db_database(), |
401 | 401 | 'disabled' |
402 | 402 | ) |
@@ -406,12 +406,12 @@ discard block |
||
406 | 406 | register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
407 | 407 | add_settings_field( |
408 | 408 | 'xcloner_size_limit_per_request', |
409 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
409 | + __('Data Size Limit Per Request', 'xcloner-backup-and-restore'), |
|
410 | 410 | array($this, 'do_form_range_field'), |
411 | 411 | 'xcloner_system_settings_page', |
412 | 412 | 'xcloner_system_settings_group', |
413 | 413 | array('xcloner_size_limit_per_request', |
414 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
414 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB', 'xcloner-backup-and-restore'), |
|
415 | 415 | 0, |
416 | 416 | 1024 |
417 | 417 | ) |
@@ -420,12 +420,12 @@ discard block |
||
420 | 420 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
421 | 421 | add_settings_field( |
422 | 422 | 'xcloner_files_to_process_per_request', |
423 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
423 | + __('Files To Process Per Request', 'xcloner-backup-and-restore'), |
|
424 | 424 | array($this, 'do_form_range_field'), |
425 | 425 | 'xcloner_system_settings_page', |
426 | 426 | 'xcloner_system_settings_group', |
427 | 427 | array('xcloner_files_to_process_per_request', |
428 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
428 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
429 | 429 | 0, |
430 | 430 | 1000 |
431 | 431 | ) |
@@ -434,12 +434,12 @@ discard block |
||
434 | 434 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
435 | 435 | add_settings_field( |
436 | 436 | 'xcloner_directories_to_scan_per_request', |
437 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
437 | + __('Directories To Scan Per Request', 'xcloner-backup-and-restore'), |
|
438 | 438 | array($this, 'do_form_range_field'), |
439 | 439 | 'xcloner_system_settings_page', |
440 | 440 | 'xcloner_system_settings_group', |
441 | 441 | array('xcloner_directories_to_scan_per_request', |
442 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
442 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
443 | 443 | 0, |
444 | 444 | 1000 |
445 | 445 | ) |
@@ -448,12 +448,12 @@ discard block |
||
448 | 448 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
449 | 449 | add_settings_field( |
450 | 450 | 'xcloner_database_records_per_request', |
451 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
451 | + __('Database Records Per Request', 'xcloner-backup-and-restore'), |
|
452 | 452 | array($this, 'do_form_range_field'), |
453 | 453 | 'xcloner_system_settings_page', |
454 | 454 | 'xcloner_system_settings_group', |
455 | 455 | array('xcloner_database_records_per_request', |
456 | - __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records','xcloner-backup-and-restore'), |
|
456 | + __('Use this option to set how many database table records should be fetched per AJAX request, or set to 0 to fetch all. Range 0-100000 records', 'xcloner-backup-and-restore'), |
|
457 | 457 | 0, |
458 | 458 | 100000 |
459 | 459 | ) |
@@ -462,36 +462,36 @@ discard block |
||
462 | 462 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
463 | 463 | add_settings_field( |
464 | 464 | 'xcloner_exclude_files_larger_than_mb', |
465 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
465 | + __('Exclude files larger than (MB)', 'xcloner-backup-and-restore'), |
|
466 | 466 | array($this, 'do_form_number_field'), |
467 | 467 | 'xcloner_system_settings_page', |
468 | 468 | 'xcloner_system_settings_group', |
469 | 469 | array('xcloner_exclude_files_larger_than_mb', |
470 | - __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB','xcloner-backup-and-restore'), |
|
470 | + __('Use this option to automatically exclude files larger than a certain size in MB, or set to 0 to include all. Range 0-1000 MB', 'xcloner-backup-and-restore'), |
|
471 | 471 | ) |
472 | 472 | ); |
473 | 473 | |
474 | 474 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
475 | 475 | add_settings_field( |
476 | 476 | 'xcloner_split_backup_limit', |
477 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
477 | + __('Split Backup Archive Limit (MB)', 'xcloner-backup-and-restore'), |
|
478 | 478 | array($this, 'do_form_number_field'), |
479 | 479 | 'xcloner_system_settings_page', |
480 | 480 | 'xcloner_system_settings_group', |
481 | 481 | array('xcloner_split_backup_limit', |
482 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
482 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB', 'xcloner-backup-and-restore'), |
|
483 | 483 | ) |
484 | 484 | ); |
485 | 485 | |
486 | 486 | register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
487 | 487 | add_settings_field( |
488 | 488 | 'xcloner_force_tmp_path_site_root', |
489 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
489 | + __('Force Temporary Path Within XCloner Storage', 'xcloner-backup-and-restore'), |
|
490 | 490 | array($this, 'do_form_switch_field'), |
491 | 491 | 'xcloner_system_settings_page', |
492 | 492 | 'xcloner_system_settings_group', |
493 | 493 | array('xcloner_force_tmp_path_site_root', |
494 | - sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location','xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
494 | + sprintf(__('Enable this option if you want the XCloner Temporary Path to be within your XCloner Storage Location', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
495 | 495 | ) |
496 | 496 | ); |
497 | 497 | |
@@ -499,36 +499,36 @@ discard block |
||
499 | 499 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
500 | 500 | add_settings_field( |
501 | 501 | 'xcloner_cleanup_retention_limit_days', |
502 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
502 | + __('Cleanup by Date(days)', 'xcloner-backup-and-restore'), |
|
503 | 503 | array($this, 'do_form_number_field'), |
504 | 504 | 'xcloner_cleanup_settings_page', |
505 | 505 | 'xcloner_cleanup_settings_group', |
506 | 506 | array('xcloner_cleanup_retention_limit_days', |
507 | - __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
|
507 | + __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
508 | 508 | ) |
509 | 509 | ); |
510 | 510 | |
511 | 511 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
512 | 512 | add_settings_field( |
513 | 513 | 'xcloner_cleanup_retention_limit_archives', |
514 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
514 | + __('Cleanup by Quantity', 'xcloner-backup-and-restore'), |
|
515 | 515 | array($this, 'do_form_number_field'), |
516 | 516 | 'xcloner_cleanup_settings_page', |
517 | 517 | 'xcloner_cleanup_settings_group', |
518 | 518 | array('xcloner_cleanup_retention_limit_archives', |
519 | - __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
|
519 | + __('Specify the maximum number of backup archives to keep on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
520 | 520 | ) |
521 | 521 | ); |
522 | 522 | |
523 | 523 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
524 | 524 | add_settings_field( |
525 | 525 | 'xcloner_cleanup_capacity_limit', |
526 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
526 | + __('Cleanup by Capacity(MB)', 'xcloner-backup-and-restore'), |
|
527 | 527 | array($this, 'do_form_number_field'), |
528 | 528 | 'xcloner_cleanup_settings_page', |
529 | 529 | 'xcloner_cleanup_settings_group', |
530 | 530 | array('xcloner_cleanup_capacity_limit', |
531 | - __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
|
531 | + __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option', 'xcloner-backup-and-restore') |
|
532 | 532 | ) |
533 | 533 | ); |
534 | 534 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
537 | 537 | add_settings_field( |
538 | 538 | 'xcloner_cron_frequency', |
539 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
539 | + __('Cron frequency', 'xcloner-backup-and-restore'), |
|
540 | 540 | array($this, 'do_form_text_field'), |
541 | 541 | 'xcloner_cron_settings_page', |
542 | 542 | 'xcloner_cron_settings_group', |
@@ -562,20 +562,20 @@ discard block |
||
562 | 562 | // text field content cb |
563 | 563 | public function do_form_text_field($params) |
564 | 564 | { |
565 | - if(!isset($params['3'])) |
|
565 | + if (!isset($params['3'])) |
|
566 | 566 | $params[3] = 0; |
567 | - if(!isset($params['2'])) |
|
567 | + if (!isset($params['2'])) |
|
568 | 568 | $params[2] = 0; |
569 | 569 | |
570 | 570 | list($fieldname, $label, $value, $disabled) = $params; |
571 | 571 | |
572 | - if(!$value) |
|
572 | + if (!$value) |
|
573 | 573 | $value = get_option($fieldname); |
574 | 574 | // output the field |
575 | 575 | ?> |
576 | 576 | <div class="row"> |
577 | 577 | <div class="input-field col s10 m10 l8"> |
578 | - <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
578 | + <input class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
579 | 579 | </div> |
580 | 580 | <div class="col s2 m2 "> |
581 | 581 | <a class="btn-floating tooltipped btn-small" data-position="left" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -589,20 +589,20 @@ discard block |
||
589 | 589 | // textarea field content cb |
590 | 590 | public function do_form_textarea_field($params) |
591 | 591 | { |
592 | - if(!isset($params['3'])) |
|
592 | + if (!isset($params['3'])) |
|
593 | 593 | $params[3] = 0; |
594 | - if(!isset($params['2'])) |
|
594 | + if (!isset($params['2'])) |
|
595 | 595 | $params[2] = 0; |
596 | 596 | |
597 | 597 | list($fieldname, $label, $value, $disabled) = $params; |
598 | 598 | |
599 | - if(!$value) |
|
599 | + if (!$value) |
|
600 | 600 | $value = get_option($fieldname); |
601 | 601 | // output the field |
602 | 602 | ?> |
603 | 603 | <div class="row"> |
604 | 604 | <div class="input-field col s10 m10 l8"> |
605 | - <textarea class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
|
605 | + <textarea class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="text" class="validate" value=""><?php echo isset($value) ? esc_attr($value) : ''; ?></textarea> |
|
606 | 606 | </div> |
607 | 607 | <div class="col s2 m2 "> |
608 | 608 | <a class="btn-floating tooltipped btn-small" data-position="center" data-html="true" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -632,20 +632,20 @@ discard block |
||
632 | 632 | // number field content cb |
633 | 633 | public function do_form_number_field($params) |
634 | 634 | { |
635 | - if(!isset($params['3'])) |
|
635 | + if (!isset($params['3'])) |
|
636 | 636 | $params[3] = 0; |
637 | - if(!isset($params['2'])) |
|
637 | + if (!isset($params['2'])) |
|
638 | 638 | $params[2] = 0; |
639 | 639 | |
640 | 640 | list($fieldname, $label, $value, $disabled) = $params; |
641 | 641 | |
642 | - if(!$value) |
|
642 | + if (!$value) |
|
643 | 643 | $value = get_option($fieldname); |
644 | 644 | // output the field |
645 | 645 | ?> |
646 | 646 | <div class="row"> |
647 | 647 | <div class="input-field col s10 m5 l3"> |
648 | - <input class="validate" <?php echo ($disabled)?"disabled":""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="number" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
648 | + <input class="validate" <?php echo ($disabled) ? "disabled" : ""?> name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" type="number" class="validate" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>"> |
|
649 | 649 | </div> |
650 | 650 | <div class="col s2 m2 "> |
651 | 651 | <a class="btn-floating tooltipped btn-small" data-position="center" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | |
659 | 659 | public function do_form_range_field($params) |
660 | 660 | { |
661 | - if(!isset($params['4'])) |
|
661 | + if (!isset($params['4'])) |
|
662 | 662 | $params[4] = 0; |
663 | 663 | |
664 | 664 | list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | <div class="row"> |
668 | 668 | <div class="input-field col s10 m10 l8"> |
669 | 669 | <p class="range-field"> |
670 | - <input <?php echo ($disabled)?"disabled":""?> type="range" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" min="<?php echo $range_start?>" max="<?php echo $range_end?>" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>" /> |
|
670 | + <input <?php echo ($disabled) ? "disabled" : ""?> type="range" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" min="<?php echo $range_start?>" max="<?php echo $range_end?>" value="<?php echo isset($value) ? esc_attr($value) : ''; ?>" /> |
|
671 | 671 | </p> |
672 | 672 | </div> |
673 | 673 | <div class="col s2 m2 "> |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | |
681 | 681 | public function do_form_switch_field($params) |
682 | 682 | { |
683 | - if(!isset($params['2'])) |
|
683 | + if (!isset($params['2'])) |
|
684 | 684 | $params[2] = 0; |
685 | 685 | list($fieldname, $label, $disabled) = $params; |
686 | 686 | $value = get_option($fieldname); |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | <div class="switch"> |
691 | 691 | <label> |
692 | 692 | Off |
693 | - <input <?php echo ($disabled)?"disabled":""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
693 | + <input <?php echo ($disabled) ? "disabled" : ""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
694 | 694 | <span class="lever"></span> |
695 | 695 | On |
696 | 696 | </label> |
@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | public function __construct(Xcloner $xcloner_container, $hash = "") |
12 | 12 | { |
13 | 13 | $this->xcloner_container = $xcloner_container; |
14 | - if(isset($hash)) |
|
15 | - $this->set_hash($hash); |
|
14 | + if(isset($hash)) { |
|
15 | + $this->set_hash($hash); |
|
16 | + } |
|
16 | 17 | } |
17 | 18 | |
18 | 19 | private function get_xcloner_container() |
@@ -22,20 +23,22 @@ discard block |
||
22 | 23 | |
23 | 24 | public function get_logger_filename($include_hash = 0) |
24 | 25 | { |
25 | - if($include_hash) |
|
26 | - $filename = sprintf($this->logger_file_hash, $this->get_hash()); |
|
27 | - else |
|
28 | - $filename = sprintf($this->logger_file, $this->get_server_unique_hash(5)); |
|
26 | + if($include_hash) { |
|
27 | + $filename = sprintf($this->logger_file_hash, $this->get_hash()); |
|
28 | + } else { |
|
29 | + $filename = sprintf($this->logger_file, $this->get_server_unique_hash(5)); |
|
30 | + } |
|
29 | 31 | |
30 | 32 | return $filename; |
31 | 33 | } |
32 | 34 | |
33 | 35 | public function get_xcloner_start_path() |
34 | 36 | { |
35 | - if(!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) |
|
36 | - $path = realpath(ABSPATH); |
|
37 | - else |
|
38 | - $path = get_option('xcloner_start_path'); |
|
37 | + if(!get_option('xcloner_start_path') or !is_dir(get_option('xcloner_start_path'))) { |
|
38 | + $path = realpath(ABSPATH); |
|
39 | + } else { |
|
40 | + $path = get_option('xcloner_start_path'); |
|
41 | + } |
|
39 | 42 | |
40 | 43 | return $path; |
41 | 44 | } |
@@ -49,10 +52,11 @@ discard block |
||
49 | 52 | |
50 | 53 | public function get_xcloner_store_path() |
51 | 54 | { |
52 | - if(!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) |
|
53 | - $path = realpath(XCLONER_STORAGE_PATH); |
|
54 | - else |
|
55 | - $path = get_option('xcloner_store_path'); |
|
55 | + if(!get_option('xcloner_store_path') or !is_dir(get_option('xcloner_store_path'))) { |
|
56 | + $path = realpath(XCLONER_STORAGE_PATH); |
|
57 | + } else { |
|
58 | + $path = get_option('xcloner_store_path'); |
|
59 | + } |
|
56 | 60 | |
57 | 61 | return $path; |
58 | 62 | } |
@@ -72,16 +76,18 @@ discard block |
||
72 | 76 | @chmod($path, 0777); |
73 | 77 | } |
74 | 78 | |
75 | - if(!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) |
|
76 | - $path = $this->get_xcloner_store_path().DS.".".$this->get_xcloner_tmp_path_suffix(); |
|
79 | + if(!is_dir($path) or !is_writeable($path) or get_option('xcloner_force_tmp_path_site_root')) { |
|
80 | + $path = $this->get_xcloner_store_path().DS.".".$this->get_xcloner_tmp_path_suffix(); |
|
81 | + } |
|
77 | 82 | |
78 | 83 | return $path; |
79 | 84 | } |
80 | 85 | |
81 | 86 | public function get_enable_mysql_backup() |
82 | 87 | { |
83 | - if(get_option('xcloner_enable_mysql_backup')) |
|
84 | - return true; |
|
88 | + if(get_option('xcloner_enable_mysql_backup')) { |
|
89 | + return true; |
|
90 | + } |
|
85 | 91 | |
86 | 92 | return false; |
87 | 93 | } |
@@ -90,10 +96,11 @@ discard block |
||
90 | 96 | { |
91 | 97 | if(!$ext) |
92 | 98 | { |
93 | - if(get_option('xcloner_backup_compression_level')) |
|
94 | - $ext = ".tgz"; |
|
95 | - else |
|
96 | - $ext = ".tar"; |
|
99 | + if(get_option('xcloner_backup_compression_level')) { |
|
100 | + $ext = ".tgz"; |
|
101 | + } else { |
|
102 | + $ext = ".tar"; |
|
103 | + } |
|
97 | 104 | } |
98 | 105 | return ($this->get_hash()).$ext; |
99 | 106 | } |
@@ -119,8 +126,9 @@ discard block |
||
119 | 126 | |
120 | 127 | public function set_hash($hash = "") |
121 | 128 | { |
122 | - if(substr($hash, 0, 1) != "-" and strlen($hash)) |
|
123 | - $hash = "-".$hash; |
|
129 | + if(substr($hash, 0, 1) != "-" and strlen($hash)) { |
|
130 | + $hash = "-".$hash; |
|
131 | + } |
|
124 | 132 | |
125 | 133 | $this->hash = substr( $hash, 0, 6); |
126 | 134 | |
@@ -140,8 +148,9 @@ discard block |
||
140 | 148 | { |
141 | 149 | global $wpdb; |
142 | 150 | |
143 | - if(!$data = get_option('xcloner_mysql_hostname')) |
|
144 | - $data = $wpdb->dbhost; |
|
151 | + if(!$data = get_option('xcloner_mysql_hostname')) { |
|
152 | + $data = $wpdb->dbhost; |
|
153 | + } |
|
145 | 154 | |
146 | 155 | return $data; |
147 | 156 | } |
@@ -150,8 +159,9 @@ discard block |
||
150 | 159 | { |
151 | 160 | global $wpdb; |
152 | 161 | |
153 | - if(!$data = get_option('xcloner_mysql_username')) |
|
154 | - $data = $wpdb->dbuser; |
|
162 | + if(!$data = get_option('xcloner_mysql_username')) { |
|
163 | + $data = $wpdb->dbuser; |
|
164 | + } |
|
155 | 165 | |
156 | 166 | return $data; |
157 | 167 | } |
@@ -160,8 +170,9 @@ discard block |
||
160 | 170 | { |
161 | 171 | global $wpdb; |
162 | 172 | |
163 | - if(!$data = get_option('xcloner_mysql_password')) |
|
164 | - $data = $wpdb->dbpassword; |
|
173 | + if(!$data = get_option('xcloner_mysql_password')) { |
|
174 | + $data = $wpdb->dbpassword; |
|
175 | + } |
|
165 | 176 | |
166 | 177 | return $data; |
167 | 178 | } |
@@ -170,8 +181,9 @@ discard block |
||
170 | 181 | { |
171 | 182 | global $wpdb; |
172 | 183 | |
173 | - if(!$data = get_option('xcloner_mysql_database')) |
|
174 | - $data = $wpdb->dbname; |
|
184 | + if(!$data = get_option('xcloner_mysql_database')) { |
|
185 | + $data = $wpdb->dbname; |
|
186 | + } |
|
175 | 187 | |
176 | 188 | return $data; |
177 | 189 | } |
@@ -194,8 +206,9 @@ discard block |
||
194 | 206 | { |
195 | 207 | $hash = md5(get_home_url().__DIR__); |
196 | 208 | |
197 | - if($strlen) |
|
198 | - $hash = substr($hash, 0, $strlen); |
|
209 | + if($strlen) { |
|
210 | + $hash = substr($hash, 0, $strlen); |
|
211 | + } |
|
199 | 212 | |
200 | 213 | return $hash; |
201 | 214 | } |
@@ -562,15 +575,18 @@ discard block |
||
562 | 575 | // text field content cb |
563 | 576 | public function do_form_text_field($params) |
564 | 577 | { |
565 | - if(!isset($params['3'])) |
|
566 | - $params[3] = 0; |
|
567 | - if(!isset($params['2'])) |
|
568 | - $params[2] = 0; |
|
578 | + if(!isset($params['3'])) { |
|
579 | + $params[3] = 0; |
|
580 | + } |
|
581 | + if(!isset($params['2'])) { |
|
582 | + $params[2] = 0; |
|
583 | + } |
|
569 | 584 | |
570 | 585 | list($fieldname, $label, $value, $disabled) = $params; |
571 | 586 | |
572 | - if(!$value) |
|
573 | - $value = get_option($fieldname); |
|
587 | + if(!$value) { |
|
588 | + $value = get_option($fieldname); |
|
589 | + } |
|
574 | 590 | // output the field |
575 | 591 | ?> |
576 | 592 | <div class="row"> |
@@ -589,15 +605,18 @@ discard block |
||
589 | 605 | // textarea field content cb |
590 | 606 | public function do_form_textarea_field($params) |
591 | 607 | { |
592 | - if(!isset($params['3'])) |
|
593 | - $params[3] = 0; |
|
594 | - if(!isset($params['2'])) |
|
595 | - $params[2] = 0; |
|
608 | + if(!isset($params['3'])) { |
|
609 | + $params[3] = 0; |
|
610 | + } |
|
611 | + if(!isset($params['2'])) { |
|
612 | + $params[2] = 0; |
|
613 | + } |
|
596 | 614 | |
597 | 615 | list($fieldname, $label, $value, $disabled) = $params; |
598 | 616 | |
599 | - if(!$value) |
|
600 | - $value = get_option($fieldname); |
|
617 | + if(!$value) { |
|
618 | + $value = get_option($fieldname); |
|
619 | + } |
|
601 | 620 | // output the field |
602 | 621 | ?> |
603 | 622 | <div class="row"> |
@@ -632,15 +651,18 @@ discard block |
||
632 | 651 | // number field content cb |
633 | 652 | public function do_form_number_field($params) |
634 | 653 | { |
635 | - if(!isset($params['3'])) |
|
636 | - $params[3] = 0; |
|
637 | - if(!isset($params['2'])) |
|
638 | - $params[2] = 0; |
|
654 | + if(!isset($params['3'])) { |
|
655 | + $params[3] = 0; |
|
656 | + } |
|
657 | + if(!isset($params['2'])) { |
|
658 | + $params[2] = 0; |
|
659 | + } |
|
639 | 660 | |
640 | 661 | list($fieldname, $label, $value, $disabled) = $params; |
641 | 662 | |
642 | - if(!$value) |
|
643 | - $value = get_option($fieldname); |
|
663 | + if(!$value) { |
|
664 | + $value = get_option($fieldname); |
|
665 | + } |
|
644 | 666 | // output the field |
645 | 667 | ?> |
646 | 668 | <div class="row"> |
@@ -658,8 +680,9 @@ discard block |
||
658 | 680 | |
659 | 681 | public function do_form_range_field($params) |
660 | 682 | { |
661 | - if(!isset($params['4'])) |
|
662 | - $params[4] = 0; |
|
683 | + if(!isset($params['4'])) { |
|
684 | + $params[4] = 0; |
|
685 | + } |
|
663 | 686 | |
664 | 687 | list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
665 | 688 | $value = get_option($fieldname); |
@@ -680,8 +703,9 @@ discard block |
||
680 | 703 | |
681 | 704 | public function do_form_switch_field($params) |
682 | 705 | { |
683 | - if(!isset($params['2'])) |
|
684 | - $params[2] = 0; |
|
706 | + if(!isset($params['2'])) { |
|
707 | + $params[2] = 0; |
|
708 | + } |
|
685 | 709 | list($fieldname, $label, $disabled) = $params; |
686 | 710 | $value = get_option($fieldname); |
687 | 711 | ?> |
@@ -198,6 +198,9 @@ |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | + /** |
|
202 | + * @param string $storage_type |
|
203 | + */ |
|
201 | 204 | public function verify_filesystem($storage_type) |
202 | 205 | { |
203 | 206 | $method = "get_".$storage_type."_filesystem"; |
@@ -1,23 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | use League\Flysystem\Config; |
3 | 3 | use League\Flysystem\Filesystem; |
4 | - |
|
5 | 4 | use League\Flysystem\Adapter\Ftp as Adapter; |
6 | - |
|
7 | 5 | use League\Flysystem\Sftp\SftpAdapter; |
8 | - |
|
9 | 6 | use League\Flysystem\Dropbox\DropboxAdapter; |
10 | 7 | use Dropbox\Client; |
11 | - |
|
12 | 8 | use MicrosoftAzure\Storage\Common\ServicesBuilder; |
13 | 9 | use League\Flysystem\Azure\AzureAdapter; |
14 | - |
|
15 | 10 | use Aws\S3\S3Client; |
16 | 11 | use League\Flysystem\AwsS3v3\AwsS3Adapter; |
17 | - |
|
18 | 12 | use Mhetreramesh\Flysystem\BackblazeAdapter; |
19 | 13 | use ChrisWhite\B2\Client as B2Client; |
20 | - |
|
21 | 14 | use Sabre\DAV\Client as SabreClient; |
22 | 15 | use League\Flysystem\WebDAV\WebDAVAdapter; |
23 | 16 |
@@ -385,9 +385,9 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | $endpoint = sprintf( |
388 | - 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
389 | - get_option("xcloner_azure_account_name"), |
|
390 | - get_option("xcloner_azure_api_key") |
|
388 | + 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
389 | + get_option("xcloner_azure_account_name"), |
|
390 | + get_option("xcloner_azure_api_key") |
|
391 | 391 | ); |
392 | 392 | |
393 | 393 | $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint); |
@@ -431,12 +431,12 @@ discard block |
||
431 | 431 | |
432 | 432 | |
433 | 433 | $client = new S3Client([ |
434 | - 'credentials' => [ |
|
435 | - 'key' => get_option("xcloner_aws_key"), |
|
436 | - 'secret' => get_option("xcloner_aws_secret") |
|
437 | - ], |
|
438 | - 'region' => get_option("xcloner_aws_region"), |
|
439 | - 'version' => 'latest', |
|
434 | + 'credentials' => [ |
|
435 | + 'key' => get_option("xcloner_aws_key"), |
|
436 | + 'secret' => get_option("xcloner_aws_secret") |
|
437 | + ], |
|
438 | + 'region' => get_option("xcloner_aws_region"), |
|
439 | + 'version' => 'latest', |
|
440 | 440 | ]); |
441 | 441 | |
442 | 442 | $adapter = new AwsS3Adapter($client, get_option("xcloner_aws_bucket_name")); |
@@ -599,9 +599,9 @@ discard block |
||
599 | 599 | { |
600 | 600 | $query = sprintf('mimeType = \'application/vnd.google-apps.folder\' and \'%s\' in parents and name contains \'%s\'', $parent, $dir); |
601 | 601 | $response = $service->files->listFiles([ |
602 | - 'pageSize' => 1, |
|
603 | - 'q' => $query |
|
604 | - ]); |
|
602 | + 'pageSize' => 1, |
|
603 | + 'q' => $query |
|
604 | + ]); |
|
605 | 605 | |
606 | 606 | if(sizeof($response)) |
607 | 607 | { |
@@ -630,16 +630,16 @@ discard block |
||
630 | 630 | $this->logger->info(sprintf("Creating the FTP remote storage connection"), array("")); |
631 | 631 | |
632 | 632 | $adapter = new Adapter([ |
633 | - 'host' => get_option("xcloner_ftp_hostname"), |
|
634 | - 'username' => get_option("xcloner_ftp_username"), |
|
635 | - 'password' => get_option("xcloner_ftp_password"), |
|
636 | - |
|
637 | - /** optional config settings */ |
|
638 | - 'port' => get_option("xcloner_ftp_port", 21), |
|
639 | - 'root' => get_option("xcloner_ftp_path"), |
|
640 | - 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
641 | - 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
642 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
633 | + 'host' => get_option("xcloner_ftp_hostname"), |
|
634 | + 'username' => get_option("xcloner_ftp_username"), |
|
635 | + 'password' => get_option("xcloner_ftp_password"), |
|
636 | + |
|
637 | + /** optional config settings */ |
|
638 | + 'port' => get_option("xcloner_ftp_port", 21), |
|
639 | + 'root' => get_option("xcloner_ftp_path"), |
|
640 | + 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
641 | + 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
642 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
643 | 643 | ]); |
644 | 644 | |
645 | 645 | $adapter->connect(); |
@@ -656,15 +656,15 @@ discard block |
||
656 | 656 | $this->logger->info(sprintf("Creating the SFTP remote storage connection"), array("")); |
657 | 657 | |
658 | 658 | $adapter = new SftpAdapter([ |
659 | - 'host' => get_option("xcloner_sftp_hostname"), |
|
660 | - 'username' => get_option("xcloner_sftp_username"), |
|
661 | - 'password' => get_option("xcloner_sftp_password"), |
|
662 | - |
|
663 | - /** optional config settings */ |
|
664 | - 'port' => get_option("xcloner_sftp_port", 22), |
|
665 | - 'root' => get_option("xcloner_sftp_path"), |
|
666 | - 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
667 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
659 | + 'host' => get_option("xcloner_sftp_hostname"), |
|
660 | + 'username' => get_option("xcloner_sftp_username"), |
|
661 | + 'password' => get_option("xcloner_sftp_password"), |
|
662 | + |
|
663 | + /** optional config settings */ |
|
664 | + 'port' => get_option("xcloner_sftp_port", 22), |
|
665 | + 'root' => get_option("xcloner_sftp_path"), |
|
666 | + 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
667 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
668 | 668 | ]); |
669 | 669 | |
670 | 670 | $adapter->connect(); |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | use Sabre\DAV\Client as SabreClient; |
22 | 22 | use League\Flysystem\WebDAV\WebDAVAdapter; |
23 | 23 | |
24 | -class Xcloner_Remote_Storage{ |
|
24 | +class Xcloner_Remote_Storage { |
|
25 | 25 | |
26 | - private $gdrive_app_name = "XCloner Backup and Restore"; |
|
26 | + private $gdrive_app_name = "XCloner Backup and Restore"; |
|
27 | 27 | |
28 | 28 | private $storage_fields = array( |
29 | 29 | "option_prefix" => "xcloner_", |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | { |
134 | 134 | $this->xcloner_sanitization = $xcloner_container->get_xcloner_sanitization(); |
135 | 135 | $this->xcloner_file_system = $xcloner_container->get_xcloner_filesystem(); |
136 | - $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_remote_storage"); |
|
137 | - $this->xcloner = $xcloner_container; |
|
136 | + $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_remote_storage"); |
|
137 | + $this->xcloner = $xcloner_container; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | private function get_xcloner_container() |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | public function get_available_storages() |
146 | 146 | { |
147 | 147 | $return = array(); |
148 | - foreach($this->storage_fields as $storage=>$data) |
|
148 | + foreach ($this->storage_fields as $storage=>$data) |
|
149 | 149 | { |
150 | 150 | $check_field = $this->storage_fields["option_prefix"].$storage."_enable"; |
151 | - if(get_option($check_field)) |
|
151 | + if (get_option($check_field)) |
|
152 | 152 | $return[$storage] = $data['text']; |
153 | 153 | } |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | public function save($action = "ftp") |
159 | 159 | { |
160 | - if(!$action) |
|
160 | + if (!$action) |
|
161 | 161 | { |
162 | 162 | return false; |
163 | 163 | } |
@@ -165,17 +165,17 @@ discard block |
||
165 | 165 | $storage = $this->xcloner_sanitization->sanitize_input_as_string($action); |
166 | 166 | $this->logger->debug(sprintf("Saving the remote storage %s options", strtoupper($action))); |
167 | 167 | |
168 | - if(is_array($this->storage_fields[$storage])) |
|
168 | + if (is_array($this->storage_fields[$storage])) |
|
169 | 169 | { |
170 | - foreach($this->storage_fields[$storage] as $field=>$validation) |
|
170 | + foreach ($this->storage_fields[$storage] as $field=>$validation) |
|
171 | 171 | { |
172 | 172 | $check_field = $this->storage_fields["option_prefix"].$field; |
173 | 173 | $sanitize_method = "sanitize_input_as_".$validation; |
174 | 174 | |
175 | - if(!isset($_POST[$check_field])) |
|
175 | + if (!isset($_POST[$check_field])) |
|
176 | 176 | $_POST[$check_field] = 0; |
177 | 177 | |
178 | - if(!method_exists($this->xcloner_sanitization, $sanitize_method)) |
|
178 | + if (!method_exists($this->xcloner_sanitization, $sanitize_method)) |
|
179 | 179 | $sanitize_method = "sanitize_input_as_string"; |
180 | 180 | |
181 | 181 | $sanitized_value = $this->xcloner_sanitization->$sanitize_method($_POST[$check_field]); |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | |
190 | 190 | public function check($action = "ftp") |
191 | 191 | { |
192 | - try{ |
|
192 | + try { |
|
193 | 193 | $this->verify_filesystem($action); |
194 | 194 | $this->xcloner->trigger_message(__("%s connection is valid.", 'xcloner-backup-and-restore'), "success", ucfirst($action)); |
195 | 195 | $this->logger->debug(sprintf("Connection to remote storage %s is valid", strtoupper($action))); |
196 | - }catch(Exception $e){ |
|
196 | + }catch (Exception $e) { |
|
197 | 197 | $this->xcloner->trigger_message("%s connection error: ".$e->getMessage(), "error", ucfirst($action)); |
198 | 198 | } |
199 | 199 | } |
@@ -204,35 +204,35 @@ discard block |
||
204 | 204 | |
205 | 205 | $this->logger->info(sprintf("Checking validity of the remote storage %s filesystem", strtoupper($storage_type))); |
206 | 206 | |
207 | - if(!method_exists($this, $method)) |
|
207 | + if (!method_exists($this, $method)) |
|
208 | 208 | return false; |
209 | 209 | |
210 | 210 | list($adapter, $filesystem) = $this->$method(); |
211 | 211 | |
212 | 212 | $test_file = substr(".xcloner_".md5(time()), 0, 15); |
213 | 213 | |
214 | - if($storage_type == "gdrive") |
|
214 | + if ($storage_type == "gdrive") |
|
215 | 215 | { |
216 | - if(!is_array($filesystem->listContents())) |
|
217 | - throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
216 | + if (!is_array($filesystem->listContents())) |
|
217 | + throw new Exception(__("Could not read data", 'xcloner-backup-and-restore')); |
|
218 | 218 | $this->logger->debug(sprintf("I can list data from remote storage %s", strtoupper($storage_type))); |
219 | 219 | |
220 | 220 | return true; |
221 | 221 | } |
222 | 222 | |
223 | 223 | //testing write access |
224 | - if(!$filesystem->write($test_file, "data")) |
|
225 | - throw new Exception(__("Could not write data",'xcloner-backup-and-restore')); |
|
224 | + if (!$filesystem->write($test_file, "data")) |
|
225 | + throw new Exception(__("Could not write data", 'xcloner-backup-and-restore')); |
|
226 | 226 | $this->logger->debug(sprintf("I can write data to remote storage %s", strtoupper($storage_type))); |
227 | 227 | |
228 | 228 | //testing read access |
229 | - if(!$filesystem->read($test_file)) |
|
230 | - throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
229 | + if (!$filesystem->read($test_file)) |
|
230 | + throw new Exception(__("Could not read data", 'xcloner-backup-and-restore')); |
|
231 | 231 | $this->logger->debug(sprintf("I can read data to remote storage %s", strtoupper($storage_type))); |
232 | 232 | |
233 | 233 | //delete test file |
234 | - if(!$filesystem->delete($test_file)) |
|
235 | - throw new Exception(__("Could not delete data",'xcloner-backup-and-restore')); |
|
234 | + if (!$filesystem->delete($test_file)) |
|
235 | + throw new Exception(__("Could not delete data", 'xcloner-backup-and-restore')); |
|
236 | 236 | $this->logger->debug(sprintf("I can delete data to remote storage %s", strtoupper($storage_type))); |
237 | 237 | |
238 | 238 | return true; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | public function upload_backup_to_storage($file, $storage) |
242 | 242 | { |
243 | - if(!$this->xcloner_file_system->get_storage_filesystem()->has($file)) |
|
243 | + if (!$this->xcloner_file_system->get_storage_filesystem()->has($file)) |
|
244 | 244 | { |
245 | 245 | $this->logger->info(sprintf("File not found %s in local storage", $file)); |
246 | 246 | return false; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | $method = "get_".$storage."_filesystem"; |
250 | 250 | |
251 | - if(!method_exists($this, $method)) |
|
251 | + if (!method_exists($this, $method)) |
|
252 | 252 | return false; |
253 | 253 | |
254 | 254 | list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method(); |
@@ -266,22 +266,22 @@ discard block |
||
266 | 266 | |
267 | 267 | $backup_file_stream = $this->xcloner_file_system->get_storage_filesystem()->readStream($file); |
268 | 268 | |
269 | - if(!$remote_storage_filesystem->writeStream($file, $backup_file_stream)) |
|
269 | + if (!$remote_storage_filesystem->writeStream($file, $backup_file_stream)) |
|
270 | 270 | { |
271 | 271 | $this->logger->info(sprintf("Could not transfer file %s", $file)); |
272 | 272 | return false; |
273 | 273 | } |
274 | 274 | |
275 | - if($this->xcloner_file_system->is_multipart($file)) |
|
275 | + if ($this->xcloner_file_system->is_multipart($file)) |
|
276 | 276 | { |
277 | 277 | $parts = $this->xcloner_file_system->get_multipart_files($file); |
278 | - if(is_array($parts)) |
|
279 | - foreach($parts as $part_file) |
|
278 | + if (is_array($parts)) |
|
279 | + foreach ($parts as $part_file) |
|
280 | 280 | { |
281 | 281 | $this->logger->info(sprintf("Transferring backup %s to remote storage %s", $part_file, strtoupper($storage)), array("")); |
282 | 282 | |
283 | 283 | $backup_file_stream = $this->xcloner_file_system->get_storage_filesystem()->readStream($part_file); |
284 | - if(!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream)) |
|
284 | + if (!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream)) |
|
285 | 285 | return false; |
286 | 286 | } |
287 | 287 | } |
@@ -298,18 +298,18 @@ discard block |
||
298 | 298 | |
299 | 299 | $target_filename = $file; |
300 | 300 | |
301 | - if(!method_exists($this, $method)) |
|
301 | + if (!method_exists($this, $method)) |
|
302 | 302 | return false; |
303 | 303 | |
304 | 304 | list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method(); |
305 | 305 | |
306 | - if(!$remote_storage_filesystem->has($file)) |
|
306 | + if (!$remote_storage_filesystem->has($file)) |
|
307 | 307 | { |
308 | 308 | $this->logger->info(sprintf("File not found %s in remote storage %s", $file, strtoupper($storage))); |
309 | 309 | return false; |
310 | 310 | } |
311 | 311 | |
312 | - if($storage == "gdrive") |
|
312 | + if ($storage == "gdrive") |
|
313 | 313 | { |
314 | 314 | $metadata = $remote_storage_filesystem->getMetadata($file); |
315 | 315 | $target_filename = $metadata['filename'].".".$metadata['extension']; |
@@ -319,22 +319,22 @@ discard block |
||
319 | 319 | |
320 | 320 | $backup_file_stream = $remote_storage_filesystem->readStream($file); |
321 | 321 | |
322 | - if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($target_filename, $backup_file_stream)) |
|
322 | + if (!$this->xcloner_file_system->get_storage_filesystem()->writeStream($target_filename, $backup_file_stream)) |
|
323 | 323 | { |
324 | 324 | $this->logger->info(sprintf("Could not transfer file %s", $file)); |
325 | 325 | return false; |
326 | 326 | } |
327 | 327 | |
328 | - if($this->xcloner_file_system->is_multipart($target_filename)) |
|
328 | + if ($this->xcloner_file_system->is_multipart($target_filename)) |
|
329 | 329 | { |
330 | 330 | $parts = $this->xcloner_file_system->get_multipart_files($file, $storage); |
331 | - if(is_array($parts)) |
|
332 | - foreach($parts as $part_file) |
|
331 | + if (is_array($parts)) |
|
332 | + foreach ($parts as $part_file) |
|
333 | 333 | { |
334 | 334 | $this->logger->info(sprintf("Transferring backup %s to local storage from %s storage", $part_file, strtoupper($storage)), array("")); |
335 | 335 | |
336 | 336 | $backup_file_stream = $remote_storage_filesystem->readStream($part_file); |
337 | - if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream)) |
|
337 | + if (!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream)) |
|
338 | 338 | return false; |
339 | 339 | } |
340 | 340 | } |
@@ -348,19 +348,19 @@ discard block |
||
348 | 348 | public function clean_remote_storage($storage, $remote_storage_filesystem) |
349 | 349 | { |
350 | 350 | $check_field = $this->storage_fields["option_prefix"].$storage."_cleanup_days"; |
351 | - if($expire_days = get_option($check_field)) |
|
351 | + if ($expire_days = get_option($check_field)) |
|
352 | 352 | { |
353 | 353 | $this->logger->info(sprintf("Doing %s remote storage cleanup for %s days limit", strtoupper($storage), $expire_days)); |
354 | 354 | $files = $remote_storage_filesystem->listContents(); |
355 | 355 | |
356 | 356 | $current_timestamp = strtotime("-".$expire_days." days"); |
357 | 357 | |
358 | - if(is_array($files)) |
|
359 | - foreach($files as $file) |
|
358 | + if (is_array($files)) |
|
359 | + foreach ($files as $file) |
|
360 | 360 | { |
361 | 361 | $file['timestamp'] = $remote_storage_filesystem->getTimestamp($file['path']); |
362 | 362 | |
363 | - if($current_timestamp >= $file['timestamp']) |
|
363 | + if ($current_timestamp >= $file['timestamp']) |
|
364 | 364 | { |
365 | 365 | $remote_storage_filesystem->delete($file['path']); |
366 | 366 | $this->logger->info("Deleting remote file ".$file['path']." matching rule", array("RETENTION LIMIT TIMESTAMP", $file['timestamp']." =< ".$expire_days)); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | { |
499 | 499 | |
500 | 500 | //if((function_exists("is_plugin_active") && !is_plugin_active("xcloner-google-drive/xcloner-google-drive.php")) || !file_exists(__DIR__ . "/../../xcloner-google-drive/vendor/autoload.php")) |
501 | - if(!class_exists('Google_Client')) |
|
501 | + if (!class_exists('Google_Client')) |
|
502 | 502 | { |
503 | 503 | return false; |
504 | 504 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | { |
525 | 525 | $client = $this->gdrive_construct(); |
526 | 526 | |
527 | - if(!$client) |
|
527 | + if (!$client) |
|
528 | 528 | return false; |
529 | 529 | |
530 | 530 | return $authUrl = $client->createAuthUrl(); |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | { |
535 | 535 | $client = $this->gdrive_construct(); |
536 | 536 | |
537 | - if(!$client) |
|
537 | + if (!$client) |
|
538 | 538 | { |
539 | 539 | $error_msg = "Could not initialize the Google Drive Class, please check that the xcloner-google-drive plugin is enabled..."; |
540 | 540 | $this->logger->error($error_msg); |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | update_option("xcloner_gdrive_access_token", $token['access_token']); |
548 | 548 | update_option("xcloner_gdrive_refresh_token", $token['refresh_token']); |
549 | 549 | |
550 | - $redirect_url = ('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']."?page=xcloner_remote_storage_page#gdrive"); |
|
550 | + $redirect_url = ('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?page=xcloner_remote_storage_page#gdrive"); |
|
551 | 551 | |
552 | 552 | ?> |
553 | 553 | <script> |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | |
573 | 573 | $client = $this->gdrive_construct(); |
574 | 574 | |
575 | - if(!$client) |
|
575 | + if (!$client) |
|
576 | 576 | { |
577 | 577 | $error_msg = "Could not initialize the Google Drive Class, please check that the xcloner-google-drive plugin is enabled..."; |
578 | 578 | $this->logger->error($error_msg); |
@@ -584,18 +584,18 @@ discard block |
||
584 | 584 | $service = new \Google_Service_Drive($client); |
585 | 585 | |
586 | 586 | $parent = 'root'; |
587 | - $dir = basename( get_option("xcloner_gdrive_target_folder")); |
|
587 | + $dir = basename(get_option("xcloner_gdrive_target_folder")); |
|
588 | 588 | |
589 | 589 | $folderID = get_option("xcloner_gdrive_target_folder"); |
590 | 590 | |
591 | 591 | $tmp = parse_url($folderID); |
592 | 592 | |
593 | - if(isset($tmp['query'])) |
|
593 | + if (isset($tmp['query'])) |
|
594 | 594 | { |
595 | 595 | $folderID = str_replace("id=", "", $tmp['query']); |
596 | 596 | } |
597 | 597 | |
598 | - if(stristr($folderID, "/")) |
|
598 | + if (stristr($folderID, "/")) |
|
599 | 599 | { |
600 | 600 | $query = sprintf('mimeType = \'application/vnd.google-apps.folder\' and \'%s\' in parents and name contains \'%s\'', $parent, $dir); |
601 | 601 | $response = $service->files->listFiles([ |
@@ -603,12 +603,12 @@ discard block |
||
603 | 603 | 'q' => $query |
604 | 604 | ]); |
605 | 605 | |
606 | - if(sizeof($response)) |
|
606 | + if (sizeof($response)) |
|
607 | 607 | { |
608 | 608 | foreach ($response as $obj) { |
609 | - $folderID = $obj->getId(); |
|
609 | + $folderID = $obj->getId(); |
|
610 | 610 | } |
611 | - }else{ |
|
611 | + } else { |
|
612 | 612 | $this->xcloner->trigger_message(sprintf(__("Could not find folder ID by name %s", 'xcloner-backup-and-restore'), $folderID), "error"); |
613 | 613 | } |
614 | 614 | } |
@@ -148,8 +148,9 @@ discard block |
||
148 | 148 | foreach($this->storage_fields as $storage=>$data) |
149 | 149 | { |
150 | 150 | $check_field = $this->storage_fields["option_prefix"].$storage."_enable"; |
151 | - if(get_option($check_field)) |
|
152 | - $return[$storage] = $data['text']; |
|
151 | + if(get_option($check_field)) { |
|
152 | + $return[$storage] = $data['text']; |
|
153 | + } |
|
153 | 154 | } |
154 | 155 | |
155 | 156 | return $return; |
@@ -172,11 +173,13 @@ discard block |
||
172 | 173 | $check_field = $this->storage_fields["option_prefix"].$field; |
173 | 174 | $sanitize_method = "sanitize_input_as_".$validation; |
174 | 175 | |
175 | - if(!isset($_POST[$check_field])) |
|
176 | - $_POST[$check_field] = 0; |
|
176 | + if(!isset($_POST[$check_field])) { |
|
177 | + $_POST[$check_field] = 0; |
|
178 | + } |
|
177 | 179 | |
178 | - if(!method_exists($this->xcloner_sanitization, $sanitize_method)) |
|
179 | - $sanitize_method = "sanitize_input_as_string"; |
|
180 | + if(!method_exists($this->xcloner_sanitization, $sanitize_method)) { |
|
181 | + $sanitize_method = "sanitize_input_as_string"; |
|
182 | + } |
|
180 | 183 | |
181 | 184 | $sanitized_value = $this->xcloner_sanitization->$sanitize_method($_POST[$check_field]); |
182 | 185 | update_option($check_field, $sanitized_value); |
@@ -193,7 +196,7 @@ discard block |
||
193 | 196 | $this->verify_filesystem($action); |
194 | 197 | $this->xcloner->trigger_message(__("%s connection is valid.", 'xcloner-backup-and-restore'), "success", ucfirst($action)); |
195 | 198 | $this->logger->debug(sprintf("Connection to remote storage %s is valid", strtoupper($action))); |
196 | - }catch(Exception $e){ |
|
199 | + } catch(Exception $e){ |
|
197 | 200 | $this->xcloner->trigger_message("%s connection error: ".$e->getMessage(), "error", ucfirst($action)); |
198 | 201 | } |
199 | 202 | } |
@@ -204,8 +207,9 @@ discard block |
||
204 | 207 | |
205 | 208 | $this->logger->info(sprintf("Checking validity of the remote storage %s filesystem", strtoupper($storage_type))); |
206 | 209 | |
207 | - if(!method_exists($this, $method)) |
|
208 | - return false; |
|
210 | + if(!method_exists($this, $method)) { |
|
211 | + return false; |
|
212 | + } |
|
209 | 213 | |
210 | 214 | list($adapter, $filesystem) = $this->$method(); |
211 | 215 | |
@@ -213,26 +217,30 @@ discard block |
||
213 | 217 | |
214 | 218 | if($storage_type == "gdrive") |
215 | 219 | { |
216 | - if(!is_array($filesystem->listContents())) |
|
217 | - throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
220 | + if(!is_array($filesystem->listContents())) { |
|
221 | + throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
222 | + } |
|
218 | 223 | $this->logger->debug(sprintf("I can list data from remote storage %s", strtoupper($storage_type))); |
219 | 224 | |
220 | 225 | return true; |
221 | 226 | } |
222 | 227 | |
223 | 228 | //testing write access |
224 | - if(!$filesystem->write($test_file, "data")) |
|
225 | - throw new Exception(__("Could not write data",'xcloner-backup-and-restore')); |
|
229 | + if(!$filesystem->write($test_file, "data")) { |
|
230 | + throw new Exception(__("Could not write data",'xcloner-backup-and-restore')); |
|
231 | + } |
|
226 | 232 | $this->logger->debug(sprintf("I can write data to remote storage %s", strtoupper($storage_type))); |
227 | 233 | |
228 | 234 | //testing read access |
229 | - if(!$filesystem->read($test_file)) |
|
230 | - throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
235 | + if(!$filesystem->read($test_file)) { |
|
236 | + throw new Exception(__("Could not read data",'xcloner-backup-and-restore')); |
|
237 | + } |
|
231 | 238 | $this->logger->debug(sprintf("I can read data to remote storage %s", strtoupper($storage_type))); |
232 | 239 | |
233 | 240 | //delete test file |
234 | - if(!$filesystem->delete($test_file)) |
|
235 | - throw new Exception(__("Could not delete data",'xcloner-backup-and-restore')); |
|
241 | + if(!$filesystem->delete($test_file)) { |
|
242 | + throw new Exception(__("Could not delete data",'xcloner-backup-and-restore')); |
|
243 | + } |
|
236 | 244 | $this->logger->debug(sprintf("I can delete data to remote storage %s", strtoupper($storage_type))); |
237 | 245 | |
238 | 246 | return true; |
@@ -248,8 +256,9 @@ discard block |
||
248 | 256 | |
249 | 257 | $method = "get_".$storage."_filesystem"; |
250 | 258 | |
251 | - if(!method_exists($this, $method)) |
|
252 | - return false; |
|
259 | + if(!method_exists($this, $method)) { |
|
260 | + return false; |
|
261 | + } |
|
253 | 262 | |
254 | 263 | list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method(); |
255 | 264 | |
@@ -275,14 +284,16 @@ discard block |
||
275 | 284 | if($this->xcloner_file_system->is_multipart($file)) |
276 | 285 | { |
277 | 286 | $parts = $this->xcloner_file_system->get_multipart_files($file); |
278 | - if(is_array($parts)) |
|
279 | - foreach($parts as $part_file) |
|
287 | + if(is_array($parts)) { |
|
288 | + foreach($parts as $part_file) |
|
280 | 289 | { |
281 | 290 | $this->logger->info(sprintf("Transferring backup %s to remote storage %s", $part_file, strtoupper($storage)), array("")); |
291 | + } |
|
282 | 292 | |
283 | 293 | $backup_file_stream = $this->xcloner_file_system->get_storage_filesystem()->readStream($part_file); |
284 | - if(!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream)) |
|
285 | - return false; |
|
294 | + if(!$remote_storage_filesystem->writeStream($part_file, $backup_file_stream)) { |
|
295 | + return false; |
|
296 | + } |
|
286 | 297 | } |
287 | 298 | } |
288 | 299 | |
@@ -298,8 +309,9 @@ discard block |
||
298 | 309 | |
299 | 310 | $target_filename = $file; |
300 | 311 | |
301 | - if(!method_exists($this, $method)) |
|
302 | - return false; |
|
312 | + if(!method_exists($this, $method)) { |
|
313 | + return false; |
|
314 | + } |
|
303 | 315 | |
304 | 316 | list($remote_storage_adapter, $remote_storage_filesystem) = $this->$method(); |
305 | 317 | |
@@ -328,14 +340,16 @@ discard block |
||
328 | 340 | if($this->xcloner_file_system->is_multipart($target_filename)) |
329 | 341 | { |
330 | 342 | $parts = $this->xcloner_file_system->get_multipart_files($file, $storage); |
331 | - if(is_array($parts)) |
|
332 | - foreach($parts as $part_file) |
|
343 | + if(is_array($parts)) { |
|
344 | + foreach($parts as $part_file) |
|
333 | 345 | { |
334 | 346 | $this->logger->info(sprintf("Transferring backup %s to local storage from %s storage", $part_file, strtoupper($storage)), array("")); |
347 | + } |
|
335 | 348 | |
336 | 349 | $backup_file_stream = $remote_storage_filesystem->readStream($part_file); |
337 | - if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream)) |
|
338 | - return false; |
|
350 | + if(!$this->xcloner_file_system->get_storage_filesystem()->writeStream($part_file, $backup_file_stream)) { |
|
351 | + return false; |
|
352 | + } |
|
339 | 353 | } |
340 | 354 | } |
341 | 355 | |
@@ -355,10 +369,11 @@ discard block |
||
355 | 369 | |
356 | 370 | $current_timestamp = strtotime("-".$expire_days." days"); |
357 | 371 | |
358 | - if(is_array($files)) |
|
359 | - foreach($files as $file) |
|
372 | + if(is_array($files)) { |
|
373 | + foreach($files as $file) |
|
360 | 374 | { |
361 | 375 | $file['timestamp'] = $remote_storage_filesystem->getTimestamp($file['path']); |
376 | + } |
|
362 | 377 | |
363 | 378 | if($current_timestamp >= $file['timestamp']) |
364 | 379 | { |
@@ -524,8 +539,9 @@ discard block |
||
524 | 539 | { |
525 | 540 | $client = $this->gdrive_construct(); |
526 | 541 | |
527 | - if(!$client) |
|
528 | - return false; |
|
542 | + if(!$client) { |
|
543 | + return false; |
|
544 | + } |
|
529 | 545 | |
530 | 546 | return $authUrl = $client->createAuthUrl(); |
531 | 547 | } |
@@ -608,7 +624,7 @@ discard block |
||
608 | 624 | foreach ($response as $obj) { |
609 | 625 | $folderID = $obj->getId(); |
610 | 626 | } |
611 | - }else{ |
|
627 | + } else{ |
|
612 | 628 | $this->xcloner->trigger_message(sprintf(__("Could not find folder ID by name %s", 'xcloner-backup-and-restore'), $folderID), "error"); |
613 | 629 | } |
614 | 630 | } |
@@ -44,8 +44,6 @@ |
||
44 | 44 | * Initialize the class and set its properties. |
45 | 45 | * |
46 | 46 | * @since 1.0.0 |
47 | - * @param string $plugin_name The name of the plugin. |
|
48 | - * @param string $version The version of this plugin. |
|
49 | 47 | */ |
50 | 48 | public function __construct( Xcloner $xcloner_container ) { |
51 | 49 |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @param string $plugin_name The name of the plugin. |
48 | 48 | * @param string $version The version of this plugin. |
49 | 49 | */ |
50 | - public function __construct( Xcloner $xcloner_container ) { |
|
50 | + public function __construct(Xcloner $xcloner_container) { |
|
51 | 51 | |
52 | - $this->plugin_name = $xcloner_container->get_plugin_name(); |
|
53 | - $this->version = $xcloner_container->get_version(); |
|
52 | + $this->plugin_name = $xcloner_container->get_plugin_name(); |
|
53 | + $this->version = $xcloner_container->get_version(); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * class. |
74 | 74 | */ |
75 | 75 | |
76 | - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/xcloner-public.css', array(), $this->version, 'all' ); |
|
76 | + wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/xcloner-public.css', array(), $this->version, 'all'); |
|
77 | 77 | |
78 | 78 | } |
79 | 79 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * class. |
97 | 97 | */ |
98 | 98 | |
99 | - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/xcloner-public.js', array( 'jquery' ), $this->version, false ); |
|
99 | + wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/xcloner-public.js', array('jquery'), $this->version, false); |
|
100 | 100 | |
101 | 101 | } |
102 | 102 |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | // If this file is called directly, abort. |
29 | -if ( ! defined( 'WPINC' ) ) { |
|
29 | +if (!defined('WPINC')) { |
|
30 | 30 | die; |
31 | 31 | } |
32 | 32 | |
33 | 33 | //i will not load the plugin outside admin or cron |
34 | -if(!is_admin() and !defined('DOING_CRON')) |
|
34 | +if (!is_admin() and !defined('DOING_CRON')) |
|
35 | 35 | return; |
36 | 36 | |
37 | 37 | define("DS", DIRECTORY_SEPARATOR); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function activate_xcloner() |
44 | 44 | { |
45 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-xcloner-activator.php'; |
|
45 | + require_once plugin_dir_path(__FILE__).'includes/class-xcloner-activator.php'; |
|
46 | 46 | Xcloner_Activator::activate(); |
47 | 47 | } |
48 | 48 | |
@@ -52,31 +52,31 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function deactivate_xcloner() |
54 | 54 | { |
55 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-xcloner-deactivator.php'; |
|
55 | + require_once plugin_dir_path(__FILE__).'includes/class-xcloner-deactivator.php'; |
|
56 | 56 | Xcloner_Deactivator::deactivate(); |
57 | 57 | } |
58 | 58 | |
59 | -register_activation_hook( __FILE__, 'activate_xcloner' ); |
|
60 | -register_deactivation_hook( __FILE__, 'deactivate_xcloner' ); |
|
59 | +register_activation_hook(__FILE__, 'activate_xcloner'); |
|
60 | +register_deactivation_hook(__FILE__, 'deactivate_xcloner'); |
|
61 | 61 | |
62 | -require_once plugin_dir_path( __FILE__ ) . 'includes/class-xcloner-activator.php'; |
|
62 | +require_once plugin_dir_path(__FILE__).'includes/class-xcloner-activator.php'; |
|
63 | 63 | |
64 | -if(version_compare(phpversion(), Xcloner_Activator::xcloner_minimum_version, '<')) |
|
64 | +if (version_compare(phpversion(), Xcloner_Activator::xcloner_minimum_version, '<')) |
|
65 | 65 | { |
66 | 66 | ?> |
67 | 67 | <div class="error notice"> |
68 | - <p><?php echo sprintf(__("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s. Plugin is now deactivated."),Xcloner_Activator::xcloner_minimum_version, phpversion())?></p> |
|
68 | + <p><?php echo sprintf(__("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s. Plugin is now deactivated."), Xcloner_Activator::xcloner_minimum_version, phpversion())?></p> |
|
69 | 69 | </div> |
70 | 70 | <?php |
71 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
72 | - deactivate_plugins( plugin_basename( __FILE__ ) ); |
|
71 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
72 | + deactivate_plugins(plugin_basename(__FILE__)); |
|
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | -$db_installed_ver = get_option( "xcloner_db_version" ); |
|
76 | +$db_installed_ver = get_option("xcloner_db_version"); |
|
77 | 77 | $xcloner_db_version = Xcloner_Activator::xcloner_db_version; |
78 | 78 | |
79 | -if($db_installed_ver != $xcloner_db_version) |
|
79 | +if ($db_installed_ver != $xcloner_db_version) |
|
80 | 80 | { |
81 | 81 | Xcloner_Activator::activate(); |
82 | 82 | } |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | wp_deregister_script('heartbeat'); |
92 | 92 | } |
93 | 93 | |
94 | -if(isset($_GET['page']) and stristr($_GET['page'] , "xcloner_")) |
|
94 | +if (isset($_GET['page']) and stristr($_GET['page'], "xcloner_")) |
|
95 | 95 | { |
96 | - add_action( 'init', 'stop_heartbeat', 1 ); |
|
96 | + add_action('init', 'stop_heartbeat', 1); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | |
117 | 117 | } |
118 | 118 | |
119 | -require_once(plugin_dir_path( __FILE__ ) . '/vendor/autoload.php'); |
|
120 | -require plugin_dir_path( __FILE__ ) . 'includes/class-xcloner.php'; |
|
119 | +require_once(plugin_dir_path(__FILE__).'/vendor/autoload.php'); |
|
120 | +require plugin_dir_path(__FILE__).'includes/class-xcloner.php'; |
|
121 | 121 | |
122 | -try{ |
|
122 | +try { |
|
123 | 123 | |
124 | 124 | $xcloner_plugin = run_xcloner(); |
125 | 125 | |
126 | -}catch(Exception $e){ |
|
126 | +}catch (Exception $e) { |
|
127 | 127 | |
128 | 128 | echo $e->getMessage(); |
129 | 129 |
@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | //i will not load the plugin outside admin or cron |
34 | -if(!is_admin() and !defined('DOING_CRON')) |
|
34 | +if(!is_admin() and !defined('DOING_CRON')) { |
|
35 | 35 | return; |
36 | +} |
|
36 | 37 | |
37 | 38 | define("DS", DIRECTORY_SEPARATOR); |
38 | 39 | |
@@ -123,7 +124,7 @@ discard block |
||
123 | 124 | |
124 | 125 | $xcloner_plugin = run_xcloner(); |
125 | 126 | |
126 | -}catch(Exception $e){ |
|
127 | +} catch(Exception $e){ |
|
127 | 128 | |
128 | 129 | echo $e->getMessage(); |
129 | 130 |
@@ -3,8 +3,9 @@ discard block |
||
3 | 3 | |
4 | 4 | $gdrive_auth_url = ""; |
5 | 5 | |
6 | -if(method_exists($remote_storage, "get_gdrive_auth_url")) |
|
6 | +if(method_exists($remote_storage, "get_gdrive_auth_url")) { |
|
7 | 7 | $gdrive_auth_url = $remote_storage->get_gdrive_auth_url(); |
8 | +} |
|
8 | 9 | |
9 | 10 | $gdrive_construct = $remote_storage->gdrive_construct(); |
10 | 11 | ?> |
@@ -25,7 +26,8 @@ discard block |
||
25 | 26 | <div class="switch"> |
26 | 27 | <label> |
27 | 28 | Off |
28 | - <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if(get_option("xcloner_ftp_enable")) echo "checked"?> \> |
|
29 | + <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if(get_option("xcloner_ftp_enable")) { |
|
30 | + echo "checked"?> \> |
|
29 | 31 | <span class="lever"></span> |
30 | 32 | On |
31 | 33 | </label> |
@@ -286,6 +288,7 @@ discard block |
||
286 | 288 | <option readonly value=""><?php echo __("Please Select AWS Region")?></option> |
287 | 289 | <?php |
288 | 290 | $aws_regions = $remote_storage->get_aws_regions(); |
291 | +} |
|
289 | 292 | |
290 | 293 | foreach($aws_regions as $key=>$region){ |
291 | 294 | ?> |
@@ -339,7 +342,8 @@ discard block |
||
339 | 342 | <div class="switch"> |
340 | 343 | <label> |
341 | 344 | Off |
342 | - <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if(get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
345 | + <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if(get_option("xcloner_dropbox_enable")) { |
|
346 | + echo "checked"?> \> |
|
343 | 347 | <span class="lever"></span> |
344 | 348 | On |
345 | 349 | </label> |
@@ -767,6 +771,7 @@ discard block |
||
767 | 771 | <div class="center"> |
768 | 772 | <?php |
769 | 773 | $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=xcloner-google-drive'), 'install-plugin_xcloner-google-drive'); |
774 | +} |
|
770 | 775 | ?> |
771 | 776 | <h6><?php echo __("This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated.")?></h6> |
772 | 777 | <h6><?php echo __("PHP 5.5 minimum version is required.")?></h6> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | $gdrive_auth_url = ""; |
5 | 5 | |
6 | -if(method_exists($remote_storage, "get_gdrive_auth_url")) |
|
6 | +if (method_exists($remote_storage, "get_gdrive_auth_url")) |
|
7 | 7 | $gdrive_auth_url = $remote_storage->get_gdrive_auth_url(); |
8 | 8 | |
9 | 9 | $gdrive_construct = $remote_storage->gdrive_construct(); |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | <!-- FTP STORAGE--> |
21 | 21 | <li id="ftp"> |
22 | 22 | <div class="collapsible-header"> |
23 | - <i class="material-icons">computer</i><?php echo __("FTP Storage",'xcloner-backup-and-restore')?> |
|
23 | + <i class="material-icons">computer</i><?php echo __("FTP Storage", 'xcloner-backup-and-restore')?> |
|
24 | 24 | <div class="right"> |
25 | 25 | <div class="switch"> |
26 | 26 | <label> |
27 | 27 | Off |
28 | - <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if(get_option("xcloner_ftp_enable")) echo "checked"?> \> |
|
28 | + <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if (get_option("xcloner_ftp_enable")) echo "checked"?> \> |
|
29 | 29 | <span class="lever"></span> |
30 | 30 | On |
31 | 31 | </label> |
@@ -35,96 +35,96 @@ discard block |
||
35 | 35 | <div class="collapsible-body"> |
36 | 36 | <div class="row"> |
37 | 37 | <div class="col s12 m3 label"> |
38 | - <label for="ftp_host"><?php echo __("Ftp Hostname",'xcloner-backup-and-restore')?></label> |
|
38 | + <label for="ftp_host"><?php echo __("Ftp Hostname", 'xcloner-backup-and-restore')?></label> |
|
39 | 39 | </div> |
40 | 40 | <div class="col s12 m6"> |
41 | - <input placeholder="<?php echo __("Ftp Hostname",'xcloner-backup-and-restore')?>" id="ftp_host" type="text" name="xcloner_ftp_hostname" class="validate" value="<?php echo get_option("xcloner_ftp_hostname")?>"> |
|
41 | + <input placeholder="<?php echo __("Ftp Hostname", 'xcloner-backup-and-restore')?>" id="ftp_host" type="text" name="xcloner_ftp_hostname" class="validate" value="<?php echo get_option("xcloner_ftp_hostname")?>"> |
|
42 | 42 | </div> |
43 | 43 | <div class=" col s12 m2"> |
44 | - <input placeholder="<?php echo __("Ftp Port",'xcloner-backup-and-restore')?>" id="ftp_port" type="text" name="xcloner_ftp_port" class="validate" value="<?php echo get_option("xcloner_ftp_port", 21)?>"> |
|
44 | + <input placeholder="<?php echo __("Ftp Port", 'xcloner-backup-and-restore')?>" id="ftp_port" type="text" name="xcloner_ftp_port" class="validate" value="<?php echo get_option("xcloner_ftp_port", 21)?>"> |
|
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <div class="row"> |
49 | 49 | <div class="col s12 m3 label"> |
50 | - <label for="ftp_username"><?php echo __("Ftp Username",'xcloner-backup-and-restore')?></label> |
|
50 | + <label for="ftp_username"><?php echo __("Ftp Username", 'xcloner-backup-and-restore')?></label> |
|
51 | 51 | </div> |
52 | 52 | <div class=" col s12 m6"> |
53 | - <input placeholder="<?php echo __("Ftp Username",'xcloner-backup-and-restore')?>" id="ftp_username" type="text" name="xcloner_ftp_username" class="validate" value="<?php echo get_option("xcloner_ftp_username")?>" autocomplete="off" > |
|
53 | + <input placeholder="<?php echo __("Ftp Username", 'xcloner-backup-and-restore')?>" id="ftp_username" type="text" name="xcloner_ftp_username" class="validate" value="<?php echo get_option("xcloner_ftp_username")?>" autocomplete="off" > |
|
54 | 54 | </div> |
55 | 55 | </div> |
56 | 56 | |
57 | 57 | |
58 | 58 | <div class="row"> |
59 | 59 | <div class="col s12 m3 label"> |
60 | - <label for="ftp_password"><?php echo __("Ftp Password",'xcloner-backup-and-restore')?></label> |
|
60 | + <label for="ftp_password"><?php echo __("Ftp Password", 'xcloner-backup-and-restore')?></label> |
|
61 | 61 | </div> |
62 | 62 | <div class=" col s12 m6"> |
63 | - <input placeholder="<?php echo __("Ftp Password",'xcloner-backup-and-restore')?>" id="ftp_password" type="password" name="xcloner_ftp_password" class="validate" value="<?php echo get_option("xcloner_ftp_password")?>" autocomplete="off" > |
|
63 | + <input placeholder="<?php echo __("Ftp Password", 'xcloner-backup-and-restore')?>" id="ftp_password" type="password" name="xcloner_ftp_password" class="validate" value="<?php echo get_option("xcloner_ftp_password")?>" autocomplete="off" > |
|
64 | 64 | </div> |
65 | 65 | </div> |
66 | 66 | |
67 | 67 | <div class="row"> |
68 | 68 | <div class="col s12 m3 label"> |
69 | - <label for="ftp_root"><?php echo __("Ftp Storage Folder",'xcloner-backup-and-restore')?></label> |
|
69 | + <label for="ftp_root"><?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore')?></label> |
|
70 | 70 | </div> |
71 | 71 | <div class=" col s12 m6"> |
72 | - <input placeholder="<?php echo __("Ftp Storage Folder",'xcloner-backup-and-restore')?>" id="ftp_root" type="text" name="xcloner_ftp_path" class="validate" value="<?php echo get_option("xcloner_ftp_path")?>"> |
|
72 | + <input placeholder="<?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore')?>" id="ftp_root" type="text" name="xcloner_ftp_path" class="validate" value="<?php echo get_option("xcloner_ftp_path")?>"> |
|
73 | 73 | </div> |
74 | 74 | </div> |
75 | 75 | |
76 | 76 | <div class="row"> |
77 | 77 | <div class="col s12 m3 label"> |
78 | - <label for="ftp_root"><?php echo __("Ftp Transfer Mode",'xcloner-backup-and-restore')?></label> |
|
78 | + <label for="ftp_root"><?php echo __("Ftp Transfer Mode", 'xcloner-backup-and-restore')?></label> |
|
79 | 79 | </div> |
80 | 80 | <div class=" col s12 m6 input-field inline"> |
81 | - <input name="xcloner_ftp_transfer_mode" type="radio" id="passive" value="1" <?php if(get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
82 | - <label for="passive"><?php echo __("Passive",'xcloner-backup-and-restore')?></label> |
|
81 | + <input name="xcloner_ftp_transfer_mode" type="radio" id="passive" value="1" <?php if (get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
82 | + <label for="passive"><?php echo __("Passive", 'xcloner-backup-and-restore')?></label> |
|
83 | 83 | |
84 | - <input name="xcloner_ftp_transfer_mode" type="radio" id="active" value="0" <?php if(!get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
85 | - <label for="active"><?php echo __("Active",'xcloner-backup-and-restore')?></label> |
|
84 | + <input name="xcloner_ftp_transfer_mode" type="radio" id="active" value="0" <?php if (!get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
85 | + <label for="active"><?php echo __("Active", 'xcloner-backup-and-restore')?></label> |
|
86 | 86 | </div> |
87 | 87 | </div> |
88 | 88 | |
89 | 89 | <div class="row"> |
90 | 90 | <div class="col s12 m3 label"> |
91 | - <label for="ftp_ssl_mode"><?php echo __("Ftp Secure Connection",'xcloner-backup-and-restore')?></label> |
|
91 | + <label for="ftp_ssl_mode"><?php echo __("Ftp Secure Connection", 'xcloner-backup-and-restore')?></label> |
|
92 | 92 | </div> |
93 | 93 | <div class=" col s12 m6 input-field inline"> |
94 | - <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_inactive" value="0" <?php if(!get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
95 | - <label for="ftp_ssl_mode_inactive"><?php echo __("Disable",'xcloner-backup-and-restore')?></label> |
|
94 | + <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_inactive" value="0" <?php if (!get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
95 | + <label for="ftp_ssl_mode_inactive"><?php echo __("Disable", 'xcloner-backup-and-restore')?></label> |
|
96 | 96 | |
97 | - <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_active" value="1" <?php if(get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
98 | - <label for="ftp_ssl_mode_active"><?php echo __("Enable",'xcloner-backup-and-restore')?></label> |
|
97 | + <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_active" value="1" <?php if (get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
98 | + <label for="ftp_ssl_mode_active"><?php echo __("Enable", 'xcloner-backup-and-restore')?></label> |
|
99 | 99 | </div> |
100 | 100 | </div> |
101 | 101 | |
102 | 102 | <div class="row"> |
103 | 103 | <div class="col s12 m3 label"> |
104 | - <label for="ftp_timeout"><?php echo __("Ftp Timeout",'xcloner-backup-and-restore')?></label> |
|
104 | + <label for="ftp_timeout"><?php echo __("Ftp Timeout", 'xcloner-backup-and-restore')?></label> |
|
105 | 105 | </div> |
106 | 106 | <div class=" col s12 m2"> |
107 | - <input placeholder="<?php echo __("Ftp Timeout",'xcloner-backup-and-restore')?>" id="ftp_timeout" type="text" name="xcloner_ftp_timeout" class="validate" value="<?php echo get_option("xcloner_ftp_timeout", 30)?>"> |
|
107 | + <input placeholder="<?php echo __("Ftp Timeout", 'xcloner-backup-and-restore')?>" id="ftp_timeout" type="text" name="xcloner_ftp_timeout" class="validate" value="<?php echo get_option("xcloner_ftp_timeout", 30)?>"> |
|
108 | 108 | </div> |
109 | 109 | </div> |
110 | 110 | |
111 | 111 | <div class="row"> |
112 | 112 | <div class="col s12 m3 label"> |
113 | - <label for="ftp_cleanup_days"><?php echo __("Ftp Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
113 | + <label for="ftp_cleanup_days"><?php echo __("Ftp Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
114 | 114 | </div> |
115 | 115 | <div class=" col s12 m6"> |
116 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="ftp_cleanup_days" type="text" name="xcloner_ftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_ftp_cleanup_days")?>"> |
|
116 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="ftp_cleanup_days" type="text" name="xcloner_ftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_ftp_cleanup_days")?>"> |
|
117 | 117 | </div> |
118 | 118 | </div> |
119 | 119 | |
120 | 120 | <div class="row"> |
121 | 121 | <div class="col s6 m4"> |
122 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="ftp"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
122 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="ftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
123 | 123 | <i class="material-icons right">save</i> |
124 | 124 | </button> |
125 | 125 | </div> |
126 | 126 | <div class="col s6 m4"> |
127 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="ftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
127 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="ftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
128 | 128 | <i class="material-icons right">import_export</i> |
129 | 129 | </button> |
130 | 130 | </div> |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | <!-- SFTP STORAGE--> |
136 | 136 | <li id="sftp"> |
137 | 137 | <div class="collapsible-header"> |
138 | - <i class="material-icons">computer</i><?php echo __("SFTP Storage",'xcloner-backup-and-restore')?> |
|
138 | + <i class="material-icons">computer</i><?php echo __("SFTP Storage", 'xcloner-backup-and-restore')?> |
|
139 | 139 | <div class="right"> |
140 | 140 | <div class="switch"> |
141 | 141 | <label> |
142 | 142 | Off |
143 | - <input type="checkbox" name="xcloner_sftp_enable" class="status" value="1" <?php if(get_option("xcloner_sftp_enable")) echo "checked"?> \> |
|
143 | + <input type="checkbox" name="xcloner_sftp_enable" class="status" value="1" <?php if (get_option("xcloner_sftp_enable")) echo "checked"?> \> |
|
144 | 144 | <span class="lever"></span> |
145 | 145 | On |
146 | 146 | </label> |
@@ -150,80 +150,80 @@ discard block |
||
150 | 150 | <div class="collapsible-body"> |
151 | 151 | <div class="row"> |
152 | 152 | <div class="col s12 m3 label"> |
153 | - <label for="sftp_host"><?php echo __("SFTP Hostname",'xcloner-backup-and-restore')?></label> |
|
153 | + <label for="sftp_host"><?php echo __("SFTP Hostname", 'xcloner-backup-and-restore')?></label> |
|
154 | 154 | </div> |
155 | 155 | <div class="col s12 m6"> |
156 | - <input placeholder="<?php echo __("SFTP Hostname",'xcloner-backup-and-restore')?>" id="sftp_host" type="text" name="xcloner_sftp_hostname" class="validate" value="<?php echo get_option("xcloner_sftp_hostname")?>"> |
|
156 | + <input placeholder="<?php echo __("SFTP Hostname", 'xcloner-backup-and-restore')?>" id="sftp_host" type="text" name="xcloner_sftp_hostname" class="validate" value="<?php echo get_option("xcloner_sftp_hostname")?>"> |
|
157 | 157 | </div> |
158 | 158 | <div class=" col s12 m2"> |
159 | - <input placeholder="<?php echo __("SFTP Port",'xcloner-backup-and-restore')?>" id="sftp_port" type="text" name="xcloner_sftp_port" class="validate" value="<?php echo get_option("xcloner_sftp_port", 22)?>"> |
|
159 | + <input placeholder="<?php echo __("SFTP Port", 'xcloner-backup-and-restore')?>" id="sftp_port" type="text" name="xcloner_sftp_port" class="validate" value="<?php echo get_option("xcloner_sftp_port", 22)?>"> |
|
160 | 160 | </div> |
161 | 161 | </div> |
162 | 162 | |
163 | 163 | <div class="row"> |
164 | 164 | <div class="col s12 m3 label"> |
165 | - <label for="sftp_username"><?php echo __("SFTP Username",'xcloner-backup-and-restore')?></label> |
|
165 | + <label for="sftp_username"><?php echo __("SFTP Username", 'xcloner-backup-and-restore')?></label> |
|
166 | 166 | </div> |
167 | 167 | <div class=" col s12 m6"> |
168 | - <input placeholder="<?php echo __("SFTP Username",'xcloner-backup-and-restore')?>" id="sftp_username" type="text" name="xcloner_sftp_username" class="validate" value="<?php echo get_option("xcloner_sftp_username")?>" autocomplete="off" > |
|
168 | + <input placeholder="<?php echo __("SFTP Username", 'xcloner-backup-and-restore')?>" id="sftp_username" type="text" name="xcloner_sftp_username" class="validate" value="<?php echo get_option("xcloner_sftp_username")?>" autocomplete="off" > |
|
169 | 169 | </div> |
170 | 170 | </div> |
171 | 171 | |
172 | 172 | |
173 | 173 | <div class="row"> |
174 | 174 | <div class="col s12 m3 label"> |
175 | - <label for="sftp_password"><?php echo __("SFTP Password",'xcloner-backup-and-restore')?></label> |
|
175 | + <label for="sftp_password"><?php echo __("SFTP Password", 'xcloner-backup-and-restore')?></label> |
|
176 | 176 | </div> |
177 | 177 | <div class=" col s12 m6"> |
178 | - <input placeholder="<?php echo __("SFTP Password",'xcloner-backup-and-restore')?>" id="ftp_spassword" type="password" name="xcloner_sftp_password" class="validate" value="<?php echo get_option("xcloner_sftp_password")?>" autocomplete="off" > |
|
178 | + <input placeholder="<?php echo __("SFTP Password", 'xcloner-backup-and-restore')?>" id="ftp_spassword" type="password" name="xcloner_sftp_password" class="validate" value="<?php echo get_option("xcloner_sftp_password")?>" autocomplete="off" > |
|
179 | 179 | </div> |
180 | 180 | </div> |
181 | 181 | |
182 | 182 | <div class="row"> |
183 | 183 | <div class="col s12 m3 label"> |
184 | - <label for="sftp_private_key"><?php echo __("SFTP Private Key",'xcloner-backup-and-restore')?></label> |
|
184 | + <label for="sftp_private_key"><?php echo __("SFTP Private Key", 'xcloner-backup-and-restore')?></label> |
|
185 | 185 | </div> |
186 | 186 | <div class=" col s12 m6"> |
187 | - <textarea rows="5" placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key File",'xcloner-backup-and-restore')?>" id="sftp_private_key" type="text" name="xcloner_sftp_private_key" class="validate" value=""><?php echo get_option("xcloner_sftp_private_key")?> |
|
187 | + <textarea rows="5" placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key File", 'xcloner-backup-and-restore')?>" id="sftp_private_key" type="text" name="xcloner_sftp_private_key" class="validate" value=""><?php echo get_option("xcloner_sftp_private_key")?> |
|
188 | 188 | </textarea> |
189 | 189 | </div> |
190 | 190 | </div> |
191 | 191 | |
192 | 192 | <div class="row"> |
193 | 193 | <div class="col s12 m3 label"> |
194 | - <label for="sftp_root"><?php echo __("SFTP Storage Folder",'xcloner-backup-and-restore')?></label> |
|
194 | + <label for="sftp_root"><?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore')?></label> |
|
195 | 195 | </div> |
196 | 196 | <div class=" col s12 m6"> |
197 | - <input placeholder="<?php echo __("SFTP Storage Folder",'xcloner-backup-and-restore')?>" id="sftp_root" type="text" name="xcloner_sftp_path" class="validate" value="<?php echo get_option("xcloner_sftp_path")?>"> |
|
197 | + <input placeholder="<?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore')?>" id="sftp_root" type="text" name="xcloner_sftp_path" class="validate" value="<?php echo get_option("xcloner_sftp_path")?>"> |
|
198 | 198 | </div> |
199 | 199 | </div> |
200 | 200 | |
201 | 201 | <div class="row"> |
202 | 202 | <div class="col s12 m3 label"> |
203 | - <label for="sftp_timeout"><?php echo __("SFTP Timeout",'xcloner-backup-and-restore')?></label> |
|
203 | + <label for="sftp_timeout"><?php echo __("SFTP Timeout", 'xcloner-backup-and-restore')?></label> |
|
204 | 204 | </div> |
205 | 205 | <div class=" col s12 m2"> |
206 | - <input placeholder="<?php echo __("SFTP Timeout",'xcloner-backup-and-restore')?>" id="sftp_timeout" type="text" name="xcloner_sftp_timeout" class="validate" value="<?php echo get_option("xcloner_sftp_timeout", 30)?>"> |
|
206 | + <input placeholder="<?php echo __("SFTP Timeout", 'xcloner-backup-and-restore')?>" id="sftp_timeout" type="text" name="xcloner_sftp_timeout" class="validate" value="<?php echo get_option("xcloner_sftp_timeout", 30)?>"> |
|
207 | 207 | </div> |
208 | 208 | </div> |
209 | 209 | |
210 | 210 | <div class="row"> |
211 | 211 | <div class="col s12 m3 label"> |
212 | - <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
212 | + <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
213 | 213 | </div> |
214 | 214 | <div class=" col s12 m6"> |
215 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="sftp_cleanup_days" type="text" name="xcloner_sftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_sftp_cleanup_days")?>"> |
|
215 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="sftp_cleanup_days" type="text" name="xcloner_sftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_sftp_cleanup_days")?>"> |
|
216 | 216 | </div> |
217 | 217 | </div> |
218 | 218 | |
219 | 219 | <div class="row"> |
220 | 220 | <div class="col s6 m4"> |
221 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
221 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
222 | 222 | <i class="material-icons right">save</i> |
223 | 223 | </button> |
224 | 224 | </div> |
225 | 225 | <div class="col s6 m4"> |
226 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="sftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
226 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="sftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
227 | 227 | <i class="material-icons right">import_export</i> |
228 | 228 | </button> |
229 | 229 | </div> |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | <!-- AWS STORAGE--> |
236 | 236 | <li id="aws"> |
237 | 237 | <div class="collapsible-header"> |
238 | - <i class="material-icons">computer</i><?php echo __("AWS Storage",'xcloner-backup-and-restore')?> |
|
238 | + <i class="material-icons">computer</i><?php echo __("AWS Storage", 'xcloner-backup-and-restore')?> |
|
239 | 239 | <div class="right"> |
240 | 240 | <div class="switch"> |
241 | 241 | <label> |
242 | 242 | Off |
243 | - <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if(get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
243 | + <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if (get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
244 | 244 | <span class="lever"></span> |
245 | 245 | On |
246 | 246 | </label> |
@@ -262,35 +262,35 @@ discard block |
||
262 | 262 | |
263 | 263 | <div class="row"> |
264 | 264 | <div class="col s12 m3 label"> |
265 | - <label for="aws_key"><?php echo __("AWS Key",'xcloner-backup-and-restore')?></label> |
|
265 | + <label for="aws_key"><?php echo __("AWS Key", 'xcloner-backup-and-restore')?></label> |
|
266 | 266 | </div> |
267 | 267 | <div class=" col s12 m6"> |
268 | - <input placeholder="<?php echo __("AWS Key",'xcloner-backup-and-restore')?>" id="aws_key" type="text" name="xcloner_aws_key" class="validate" value="<?php echo get_option("xcloner_aws_key")?>" autocomplete="off" > |
|
268 | + <input placeholder="<?php echo __("AWS Key", 'xcloner-backup-and-restore')?>" id="aws_key" type="text" name="xcloner_aws_key" class="validate" value="<?php echo get_option("xcloner_aws_key")?>" autocomplete="off" > |
|
269 | 269 | </div> |
270 | 270 | </div> |
271 | 271 | |
272 | 272 | <div class="row"> |
273 | 273 | <div class="col s12 m3 label"> |
274 | - <label for="aws_secret"><?php echo __("AWS Secret",'xcloner-backup-and-restore')?></label> |
|
274 | + <label for="aws_secret"><?php echo __("AWS Secret", 'xcloner-backup-and-restore')?></label> |
|
275 | 275 | </div> |
276 | 276 | <div class=" col s12 m6"> |
277 | - <input placeholder="<?php echo __("AWS Secret",'xcloner-backup-and-restore')?>" id="aws_secret" type="text" name="xcloner_aws_secret" class="validate" value="<?php echo get_option("xcloner_aws_secret")?>" autocomplete="off" > |
|
277 | + <input placeholder="<?php echo __("AWS Secret", 'xcloner-backup-and-restore')?>" id="aws_secret" type="text" name="xcloner_aws_secret" class="validate" value="<?php echo get_option("xcloner_aws_secret")?>" autocomplete="off" > |
|
278 | 278 | </div> |
279 | 279 | </div> |
280 | 280 | |
281 | 281 | <div class="row"> |
282 | 282 | <div class="col s12 m3 label"> |
283 | - <label for="aws_region"><?php echo __("AWS Region",'xcloner-backup-and-restore')?></label> |
|
283 | + <label for="aws_region"><?php echo __("AWS Region", 'xcloner-backup-and-restore')?></label> |
|
284 | 284 | </div> |
285 | 285 | <div class=" col s12 m6"> |
286 | - <select placeholder="<?php echo __("example: us-east-1",'xcloner-backup-and-restore')?>" id="aws_region" type="text" name="xcloner_aws_region" class="validate" value="<?php echo get_option("xcloner_aws_region")?>" autocomplete="off" > |
|
286 | + <select placeholder="<?php echo __("example: us-east-1", 'xcloner-backup-and-restore')?>" id="aws_region" type="text" name="xcloner_aws_region" class="validate" value="<?php echo get_option("xcloner_aws_region")?>" autocomplete="off" > |
|
287 | 287 | <option readonly value=""><?php echo __("Please Select AWS Region")?></option> |
288 | 288 | <?php |
289 | 289 | $aws_regions = $remote_storage->get_aws_regions(); |
290 | 290 | |
291 | - foreach($aws_regions as $key=>$region){ |
|
291 | + foreach ($aws_regions as $key=>$region) { |
|
292 | 292 | ?> |
293 | - <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region')?"selected":"")?>><?php echo $region?> = <?php echo $key?></option> |
|
293 | + <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region') ? "selected" : "")?>><?php echo $region?> = <?php echo $key?></option> |
|
294 | 294 | <?php |
295 | 295 | } |
296 | 296 | ?> |
@@ -300,30 +300,30 @@ discard block |
||
300 | 300 | |
301 | 301 | <div class="row"> |
302 | 302 | <div class="col s12 m3 label"> |
303 | - <label for="aws_bucket_name"><?php echo __("AWS Bucket Name",'xcloner-backup-and-restore')?></label> |
|
303 | + <label for="aws_bucket_name"><?php echo __("AWS Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
304 | 304 | </div> |
305 | 305 | <div class=" col s12 m6"> |
306 | - <input placeholder="<?php echo __("AWS Bucket Name",'xcloner-backup-and-restore')?>" id="aws_bucket_name" type="text" name="xcloner_aws_bucket_name" class="validate" value="<?php echo get_option("xcloner_aws_bucket_name")?>" autocomplete="off" > |
|
306 | + <input placeholder="<?php echo __("AWS Bucket Name", 'xcloner-backup-and-restore')?>" id="aws_bucket_name" type="text" name="xcloner_aws_bucket_name" class="validate" value="<?php echo get_option("xcloner_aws_bucket_name")?>" autocomplete="off" > |
|
307 | 307 | </div> |
308 | 308 | </div> |
309 | 309 | |
310 | 310 | <div class="row"> |
311 | 311 | <div class="col s12 m3 label"> |
312 | - <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
312 | + <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
313 | 313 | </div> |
314 | 314 | <div class=" col s12 m6"> |
315 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="aws_cleanup_days" type="text" name="xcloner_aws_cleanup_days" class="validate" value="<?php echo get_option("xcloner_aws_cleanup_days")?>"> |
|
315 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="aws_cleanup_days" type="text" name="xcloner_aws_cleanup_days" class="validate" value="<?php echo get_option("xcloner_aws_cleanup_days")?>"> |
|
316 | 316 | </div> |
317 | 317 | </div> |
318 | 318 | |
319 | 319 | <div class="row"> |
320 | 320 | <div class="col s6 m4"> |
321 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
321 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
322 | 322 | <i class="material-icons right">save</i> |
323 | 323 | </button> |
324 | 324 | </div> |
325 | 325 | <div class="col s6 m4"> |
326 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="aws" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
326 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="aws" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
327 | 327 | <i class="material-icons right">import_export</i> |
328 | 328 | </button> |
329 | 329 | </div> |
@@ -335,12 +335,12 @@ discard block |
||
335 | 335 | <!-- DROPBOX STORAGE--> |
336 | 336 | <li id="dropbox"> |
337 | 337 | <div class="collapsible-header"> |
338 | - <i class="material-icons">computer</i><?php echo __("Dropbox Storage",'xcloner-backup-and-restore')?> |
|
338 | + <i class="material-icons">computer</i><?php echo __("Dropbox Storage", 'xcloner-backup-and-restore')?> |
|
339 | 339 | <div class="right"> |
340 | 340 | <div class="switch"> |
341 | 341 | <label> |
342 | 342 | Off |
343 | - <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if(get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
343 | + <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if (get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
344 | 344 | <span class="lever"></span> |
345 | 345 | On |
346 | 346 | </label> |
@@ -362,49 +362,49 @@ discard block |
||
362 | 362 | |
363 | 363 | <div class="row"> |
364 | 364 | <div class="col s12 m3 label"> |
365 | - <label for="dropbox_access_token"><?php echo __("Dropbox Access Token",'xcloner-backup-and-restore')?></label> |
|
365 | + <label for="dropbox_access_token"><?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore')?></label> |
|
366 | 366 | </div> |
367 | 367 | <div class=" col s12 m6"> |
368 | - <input placeholder="<?php echo __("Dropbox Access Token",'xcloner-backup-and-restore')?>" id="dropbox_access_token" type="text" name="xcloner_dropbox_access_token" class="validate" value="<?php echo get_option("xcloner_dropbox_access_token")?>" autocomplete="off" > |
|
368 | + <input placeholder="<?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore')?>" id="dropbox_access_token" type="text" name="xcloner_dropbox_access_token" class="validate" value="<?php echo get_option("xcloner_dropbox_access_token")?>" autocomplete="off" > |
|
369 | 369 | </div> |
370 | 370 | </div> |
371 | 371 | |
372 | 372 | |
373 | 373 | <div class="row"> |
374 | 374 | <div class="col s12 m3 label"> |
375 | - <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret",'xcloner-backup-and-restore')?></label> |
|
375 | + <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore')?></label> |
|
376 | 376 | </div> |
377 | 377 | <div class=" col s12 m6"> |
378 | - <input placeholder="<?php echo __("Dropbox App Secret",'xcloner-backup-and-restore')?>" id="dropbox_app_secret" type="text" name="xcloner_dropbox_app_secret" class="validate" value="<?php echo get_option("xcloner_dropbox_app_secret")?>" autocomplete="off" > |
|
378 | + <input placeholder="<?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore')?>" id="dropbox_app_secret" type="text" name="xcloner_dropbox_app_secret" class="validate" value="<?php echo get_option("xcloner_dropbox_app_secret")?>" autocomplete="off" > |
|
379 | 379 | </div> |
380 | 380 | </div> |
381 | 381 | |
382 | 382 | <div class="row"> |
383 | 383 | <div class="col s12 m3 label"> |
384 | - <label for="dropbox_prefix"><?php echo __("Dropbox Prefix",'xcloner-backup-and-restore')?></label> |
|
384 | + <label for="dropbox_prefix"><?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore')?></label> |
|
385 | 385 | </div> |
386 | 386 | <div class=" col s12 m6"> |
387 | - <input placeholder="<?php echo __("Dropbox Prefix",'xcloner-backup-and-restore')?>" id="dropbox_prefix" type="text" name="xcloner_dropbox_prefix" class="validate" value="<?php echo get_option("xcloner_dropbox_prefix")?>"> |
|
387 | + <input placeholder="<?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore')?>" id="dropbox_prefix" type="text" name="xcloner_dropbox_prefix" class="validate" value="<?php echo get_option("xcloner_dropbox_prefix")?>"> |
|
388 | 388 | </div> |
389 | 389 | </div> |
390 | 390 | |
391 | 391 | <div class="row"> |
392 | 392 | <div class="col s12 m3 label"> |
393 | - <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
393 | + <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
394 | 394 | </div> |
395 | 395 | <div class=" col s12 m6"> |
396 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="dropbox_cleanup_days" type="text" name="xcloner_dropbox_cleanup_days" class="validate" value="<?php echo get_option("xcloner_dropbox_cleanup_days")?>"> |
|
396 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="dropbox_cleanup_days" type="text" name="xcloner_dropbox_cleanup_days" class="validate" value="<?php echo get_option("xcloner_dropbox_cleanup_days")?>"> |
|
397 | 397 | </div> |
398 | 398 | </div> |
399 | 399 | |
400 | 400 | <div class="row"> |
401 | 401 | <div class="col s6 m4"> |
402 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
402 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
403 | 403 | <i class="material-icons right">save</i> |
404 | 404 | </button> |
405 | 405 | </div> |
406 | 406 | <div class="col s6 m4"> |
407 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="dropbox" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
407 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="dropbox" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
408 | 408 | <i class="material-icons right">import_export</i> |
409 | 409 | </button> |
410 | 410 | </div> |
@@ -416,12 +416,12 @@ discard block |
||
416 | 416 | <!-- AZURE STORAGE--> |
417 | 417 | <li id="azure"> |
418 | 418 | <div class="collapsible-header"> |
419 | - <i class="material-icons">computer</i><?php echo __("Azure Blog Storage",'xcloner-backup-and-restore')?> |
|
419 | + <i class="material-icons">computer</i><?php echo __("Azure Blog Storage", 'xcloner-backup-and-restore')?> |
|
420 | 420 | <div class="right"> |
421 | 421 | <div class="switch"> |
422 | 422 | <label> |
423 | 423 | Off |
424 | - <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if(get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
424 | + <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if (get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
425 | 425 | <span class="lever"></span> |
426 | 426 | On |
427 | 427 | </label> |
@@ -436,56 +436,56 @@ discard block |
||
436 | 436 | </div> |
437 | 437 | <div class=" col s12 m6"> |
438 | 438 | <p> |
439 | - <?php echo sprintf(__('Visit %s and get your "Api Key".','xcloner-backup-and-restore'), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>')?> |
|
439 | + <?php echo sprintf(__('Visit %s and get your "Api Key".', 'xcloner-backup-and-restore'), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>')?> |
|
440 | 440 | </p> |
441 | 441 | </div> |
442 | 442 | </div> |
443 | 443 | |
444 | 444 | <div class="row"> |
445 | 445 | <div class="col s12 m3 label"> |
446 | - <label for="azure_account_name"><?php echo __("Azure Account Name",'xcloner-backup-and-restore')?></label> |
|
446 | + <label for="azure_account_name"><?php echo __("Azure Account Name", 'xcloner-backup-and-restore')?></label> |
|
447 | 447 | </div> |
448 | 448 | <div class=" col s12 m6"> |
449 | - <input placeholder="<?php echo __("Azure Account Name",'xcloner-backup-and-restore')?>" id="azure_account_name" type="text" name="xcloner_azure_account_name" class="validate" value="<?php echo get_option("xcloner_azure_account_name")?>" autocomplete="off" > |
|
449 | + <input placeholder="<?php echo __("Azure Account Name", 'xcloner-backup-and-restore')?>" id="azure_account_name" type="text" name="xcloner_azure_account_name" class="validate" value="<?php echo get_option("xcloner_azure_account_name")?>" autocomplete="off" > |
|
450 | 450 | </div> |
451 | 451 | </div> |
452 | 452 | |
453 | 453 | |
454 | 454 | <div class="row"> |
455 | 455 | <div class="col s12 m3 label"> |
456 | - <label for="azure_api_key"><?php echo __("Azure Api Key",'xcloner-backup-and-restore')?></label> |
|
456 | + <label for="azure_api_key"><?php echo __("Azure Api Key", 'xcloner-backup-and-restore')?></label> |
|
457 | 457 | </div> |
458 | 458 | <div class=" col s12 m6"> |
459 | - <input placeholder="<?php echo __("Azure Api Key",'xcloner-backup-and-restore')?>" id="azure_api_key" type="text" name="xcloner_azure_api_key" class="validate" value="<?php echo get_option("xcloner_azure_api_key")?>" autocomplete="off" > |
|
459 | + <input placeholder="<?php echo __("Azure Api Key", 'xcloner-backup-and-restore')?>" id="azure_api_key" type="text" name="xcloner_azure_api_key" class="validate" value="<?php echo get_option("xcloner_azure_api_key")?>" autocomplete="off" > |
|
460 | 460 | </div> |
461 | 461 | </div> |
462 | 462 | |
463 | 463 | <div class="row"> |
464 | 464 | <div class="col s12 m3 label"> |
465 | - <label for="azure_container"><?php echo __("Azure Container",'xcloner-backup-and-restore')?></label> |
|
465 | + <label for="azure_container"><?php echo __("Azure Container", 'xcloner-backup-and-restore')?></label> |
|
466 | 466 | </div> |
467 | 467 | <div class=" col s12 m6"> |
468 | - <input placeholder="<?php echo __("Azure Container",'xcloner-backup-and-restore')?>" id="azure_container" type="text" name="xcloner_azure_container" class="validate" value="<?php echo get_option("xcloner_azure_container")?>"> |
|
468 | + <input placeholder="<?php echo __("Azure Container", 'xcloner-backup-and-restore')?>" id="azure_container" type="text" name="xcloner_azure_container" class="validate" value="<?php echo get_option("xcloner_azure_container")?>"> |
|
469 | 469 | </div> |
470 | 470 | </div> |
471 | 471 | |
472 | 472 | <div class="row"> |
473 | 473 | <div class="col s12 m3 label"> |
474 | - <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
474 | + <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
475 | 475 | </div> |
476 | 476 | <div class=" col s12 m6"> |
477 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="azure_cleanup_days" type="text" name="xcloner_azure_cleanup_days" class="validate" value="<?php echo get_option("xcloner_azure_cleanup_days")?>"> |
|
477 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="azure_cleanup_days" type="text" name="xcloner_azure_cleanup_days" class="validate" value="<?php echo get_option("xcloner_azure_cleanup_days")?>"> |
|
478 | 478 | </div> |
479 | 479 | </div> |
480 | 480 | |
481 | 481 | <div class="row"> |
482 | 482 | <div class="col s6 m4"> |
483 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
483 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
484 | 484 | <i class="material-icons right">save</i> |
485 | 485 | </button> |
486 | 486 | </div> |
487 | 487 | <div class="col s6 m4"> |
488 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="azure" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
488 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="azure" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
489 | 489 | <i class="material-icons right">import_export</i> |
490 | 490 | </button> |
491 | 491 | </div> |
@@ -497,12 +497,12 @@ discard block |
||
497 | 497 | <!-- BACKBLAZE STORAGE--> |
498 | 498 | <li id="backblaze"> |
499 | 499 | <div class="collapsible-header"> |
500 | - <i class="material-icons">computer</i><?php echo __("BackBlaze Storage",'xcloner-backup-and-restore')?> |
|
500 | + <i class="material-icons">computer</i><?php echo __("BackBlaze Storage", 'xcloner-backup-and-restore')?> |
|
501 | 501 | <div class="right"> |
502 | 502 | <div class="switch"> |
503 | 503 | <label> |
504 | 504 | Off |
505 | - <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if(get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
505 | + <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if (get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
506 | 506 | <span class="lever"></span> |
507 | 507 | On |
508 | 508 | </label> |
@@ -517,56 +517,56 @@ discard block |
||
517 | 517 | </div> |
518 | 518 | <div class=" col s12 m6"> |
519 | 519 | <p> |
520 | - <?php echo sprintf(__('Visit %s and get your Account Id and Application Key.','xcloner-backup-and-restore'), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>')?> |
|
520 | + <?php echo sprintf(__('Visit %s and get your Account Id and Application Key.', 'xcloner-backup-and-restore'), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>')?> |
|
521 | 521 | </p> |
522 | 522 | </div> |
523 | 523 | </div> |
524 | 524 | |
525 | 525 | <div class="row"> |
526 | 526 | <div class="col s12 m3 label"> |
527 | - <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id",'xcloner-backup-and-restore')?></label> |
|
527 | + <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id", 'xcloner-backup-and-restore')?></label> |
|
528 | 528 | </div> |
529 | 529 | <div class=" col s12 m6"> |
530 | - <input placeholder="<?php echo __("BackBlaze Account Id",'xcloner-backup-and-restore')?>" id="backblaze_account_id" type="text" name="xcloner_backblaze_account_id" class="validate" value="<?php echo get_option("xcloner_backblaze_account_id")?>" autocomplete="off" > |
|
530 | + <input placeholder="<?php echo __("BackBlaze Account Id", 'xcloner-backup-and-restore')?>" id="backblaze_account_id" type="text" name="xcloner_backblaze_account_id" class="validate" value="<?php echo get_option("xcloner_backblaze_account_id")?>" autocomplete="off" > |
|
531 | 531 | </div> |
532 | 532 | </div> |
533 | 533 | |
534 | 534 | |
535 | 535 | <div class="row"> |
536 | 536 | <div class="col s12 m3 label"> |
537 | - <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key",'xcloner-backup-and-restore')?></label> |
|
537 | + <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key", 'xcloner-backup-and-restore')?></label> |
|
538 | 538 | </div> |
539 | 539 | <div class=" col s12 m6"> |
540 | - <input placeholder="<?php echo __("BackBlaze Application Key",'xcloner-backup-and-restore')?>" id="backblaze_application_key" type="text" name="xcloner_backblaze_application_key" class="validate" value="<?php echo get_option("xcloner_backblaze_application_key")?>" autocomplete="off" > |
|
540 | + <input placeholder="<?php echo __("BackBlaze Application Key", 'xcloner-backup-and-restore')?>" id="backblaze_application_key" type="text" name="xcloner_backblaze_application_key" class="validate" value="<?php echo get_option("xcloner_backblaze_application_key")?>" autocomplete="off" > |
|
541 | 541 | </div> |
542 | 542 | </div> |
543 | 543 | |
544 | 544 | <div class="row"> |
545 | 545 | <div class="col s12 m3 label"> |
546 | - <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name",'xcloner-backup-and-restore')?></label> |
|
546 | + <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
547 | 547 | </div> |
548 | 548 | <div class=" col s12 m6"> |
549 | - <input placeholder="<?php echo __("BackBlaze Bucket Name",'xcloner-backup-and-restore')?>" id="backblaze_bucket_name" type="text" name="xcloner_backblaze_bucket_name" class="validate" value="<?php echo get_option("xcloner_backblaze_bucket_name")?>" autocomplete="off" > |
|
549 | + <input placeholder="<?php echo __("BackBlaze Bucket Name", 'xcloner-backup-and-restore')?>" id="backblaze_bucket_name" type="text" name="xcloner_backblaze_bucket_name" class="validate" value="<?php echo get_option("xcloner_backblaze_bucket_name")?>" autocomplete="off" > |
|
550 | 550 | </div> |
551 | 551 | </div> |
552 | 552 | |
553 | 553 | <div class="row"> |
554 | 554 | <div class="col s12 m3 label"> |
555 | - <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
555 | + <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
556 | 556 | </div> |
557 | 557 | <div class=" col s12 m6"> |
558 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="backblaze_cleanup_days" type="text" name="xcloner_backblaze_cleanup_days" class="validate" value="<?php echo get_option("xcloner_backblaze_cleanup_days")?>"> |
|
558 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="backblaze_cleanup_days" type="text" name="xcloner_backblaze_cleanup_days" class="validate" value="<?php echo get_option("xcloner_backblaze_cleanup_days")?>"> |
|
559 | 559 | </div> |
560 | 560 | </div> |
561 | 561 | |
562 | 562 | <div class="row"> |
563 | 563 | <div class="col s6 m4"> |
564 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
564 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
565 | 565 | <i class="material-icons right">save</i> |
566 | 566 | </button> |
567 | 567 | </div> |
568 | 568 | <div class="col s6 m4"> |
569 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="backblaze" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
569 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="backblaze" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
570 | 570 | <i class="material-icons right">import_export</i> |
571 | 571 | </button> |
572 | 572 | </div> |
@@ -578,12 +578,12 @@ discard block |
||
578 | 578 | <!-- WEBDAV STORAGE--> |
579 | 579 | <li id="webdav"> |
580 | 580 | <div class="collapsible-header"> |
581 | - <i class="material-icons">computer</i><?php echo __("WebDAV Storage",'xcloner-backup-and-restore')?> |
|
581 | + <i class="material-icons">computer</i><?php echo __("WebDAV Storage", 'xcloner-backup-and-restore')?> |
|
582 | 582 | <div class="right"> |
583 | 583 | <div class="switch"> |
584 | 584 | <label> |
585 | 585 | Off |
586 | - <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if(get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
586 | + <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if (get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
587 | 587 | <span class="lever"></span> |
588 | 588 | On |
589 | 589 | </label> |
@@ -605,57 +605,57 @@ discard block |
||
605 | 605 | |
606 | 606 | <div class="row"> |
607 | 607 | <div class="col s12 m3 label"> |
608 | - <label for="webdav_url"><?php echo __("WebDAV Base Url",'xcloner-backup-and-restore')?></label> |
|
608 | + <label for="webdav_url"><?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore')?></label> |
|
609 | 609 | </div> |
610 | 610 | <div class=" col s12 m6"> |
611 | - <input placeholder="<?php echo __("WebDAV Base Url",'xcloner-backup-and-restore')?>" id="webdav_url" type="text" name="xcloner_webdav_url" class="validate" value="<?php echo get_option("xcloner_webdav_url")?>" autocomplete="off" > |
|
611 | + <input placeholder="<?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore')?>" id="webdav_url" type="text" name="xcloner_webdav_url" class="validate" value="<?php echo get_option("xcloner_webdav_url")?>" autocomplete="off" > |
|
612 | 612 | </div> |
613 | 613 | </div> |
614 | 614 | |
615 | 615 | <div class="row"> |
616 | 616 | <div class="col s12 m3 label"> |
617 | - <label for="webdav_username"><?php echo __("WebDAV Username",'xcloner-backup-and-restore')?></label> |
|
617 | + <label for="webdav_username"><?php echo __("WebDAV Username", 'xcloner-backup-and-restore')?></label> |
|
618 | 618 | </div> |
619 | 619 | <div class=" col s12 m6"> |
620 | - <input placeholder="<?php echo __("WebDAV Username",'xcloner-backup-and-restore')?>" id="webdav_username" type="text" name="xcloner_webdav_username" class="validate" value="<?php echo get_option("xcloner_webdav_username")?>" autocomplete="off" > |
|
620 | + <input placeholder="<?php echo __("WebDAV Username", 'xcloner-backup-and-restore')?>" id="webdav_username" type="text" name="xcloner_webdav_username" class="validate" value="<?php echo get_option("xcloner_webdav_username")?>" autocomplete="off" > |
|
621 | 621 | </div> |
622 | 622 | </div> |
623 | 623 | |
624 | 624 | <div class="row"> |
625 | 625 | <div class="col s12 m3 label"> |
626 | - <label for="webdav_password"><?php echo __("WebDAV Password",'xcloner-backup-and-restore')?></label> |
|
626 | + <label for="webdav_password"><?php echo __("WebDAV Password", 'xcloner-backup-and-restore')?></label> |
|
627 | 627 | </div> |
628 | 628 | <div class=" col s12 m6"> |
629 | - <input placeholder="<?php echo __("WebDAV Password",'xcloner-backup-and-restore')?>" id="webdav_password" type="password" name="xcloner_webdav_password" class="validate" value="<?php echo get_option("xcloner_webdav_password")?>" autocomplete="off" > |
|
629 | + <input placeholder="<?php echo __("WebDAV Password", 'xcloner-backup-and-restore')?>" id="webdav_password" type="password" name="xcloner_webdav_password" class="validate" value="<?php echo get_option("xcloner_webdav_password")?>" autocomplete="off" > |
|
630 | 630 | </div> |
631 | 631 | </div> |
632 | 632 | |
633 | 633 | <div class="row"> |
634 | 634 | <div class="col s12 m3 label"> |
635 | - <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder",'xcloner-backup-and-restore')?></label> |
|
635 | + <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore')?></label> |
|
636 | 636 | </div> |
637 | 637 | <div class=" col s12 m6"> |
638 | - <input placeholder="<?php echo __("WebDAV Target Folder",'xcloner-backup-and-restore')?>" id="webdav_target_folder" type="text" name="xcloner_webdav_target_folder" class="validate" value="<?php echo get_option("xcloner_webdav_target_folder")?>" autocomplete="off" > |
|
638 | + <input placeholder="<?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore')?>" id="webdav_target_folder" type="text" name="xcloner_webdav_target_folder" class="validate" value="<?php echo get_option("xcloner_webdav_target_folder")?>" autocomplete="off" > |
|
639 | 639 | </div> |
640 | 640 | </div> |
641 | 641 | |
642 | 642 | <div class="row"> |
643 | 643 | <div class="col s12 m3 label"> |
644 | - <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
644 | + <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
645 | 645 | </div> |
646 | 646 | <div class=" col s12 m6"> |
647 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="webdav_cleanup_days" type="text" name="xcloner_webdav_cleanup_days" class="validate" value="<?php echo get_option("xcloner_webdav_cleanup_days")?>"> |
|
647 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="webdav_cleanup_days" type="text" name="xcloner_webdav_cleanup_days" class="validate" value="<?php echo get_option("xcloner_webdav_cleanup_days")?>"> |
|
648 | 648 | </div> |
649 | 649 | </div> |
650 | 650 | |
651 | 651 | <div class="row"> |
652 | 652 | <div class="col s6 m4"> |
653 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
653 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
654 | 654 | <i class="material-icons right">save</i> |
655 | 655 | </button> |
656 | 656 | </div> |
657 | 657 | <div class="col s6 m4"> |
658 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="webdav" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
658 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="webdav" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
659 | 659 | <i class="material-icons right">import_export</i> |
660 | 660 | </button> |
661 | 661 | </div> |
@@ -667,13 +667,13 @@ discard block |
||
667 | 667 | <!-- Google DRIVE STORAGE--> |
668 | 668 | <li id="gdrive"> |
669 | 669 | <div class="collapsible-header"> |
670 | - <i class="material-icons">computer</i><?php echo __("Google Drive Storage",'xcloner-backup-and-restore')?> |
|
671 | - <?php if($gdrive_construct):?> |
|
670 | + <i class="material-icons">computer</i><?php echo __("Google Drive Storage", 'xcloner-backup-and-restore')?> |
|
671 | + <?php if ($gdrive_construct):?> |
|
672 | 672 | <div class="right"> |
673 | 673 | <div class="switch"> |
674 | 674 | <label> |
675 | 675 | Off |
676 | - <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if(get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
676 | + <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if (get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
677 | 677 | <span class="lever"></span> |
678 | 678 | On |
679 | 679 | </label> |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | </div> |
684 | 684 | <div class="collapsible-body"> |
685 | 685 | |
686 | - <?php if($gdrive_construct) : ?> |
|
686 | + <?php if ($gdrive_construct) : ?> |
|
687 | 687 | |
688 | 688 | <div class="row"> |
689 | 689 | <div class="col s12 m3 label"> |
@@ -691,28 +691,28 @@ discard block |
||
691 | 691 | </div> |
692 | 692 | <div class=" col s12 m9"> |
693 | 693 | <p> |
694 | - <?php echo sprintf(__('Visit %s to create a new application and get your Client ID and Client Secret.','xcloner-backup-and-restore'), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>')?> |
|
694 | + <?php echo sprintf(__('Visit %s to create a new application and get your Client ID and Client Secret.', 'xcloner-backup-and-restore'), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>')?> |
|
695 | 695 | <a href="https://youtu.be/YXUVPUVgG8k" target="_blank" class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" |
696 | - data-tooltip="<?php echo sprintf(__('Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s','xcloner-backup-and-restore'),"<br />https://youtu.be/YXUVPUVgG8k")?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
696 | + data-tooltip="<?php echo sprintf(__('Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s', 'xcloner-backup-and-restore'), "<br />https://youtu.be/YXUVPUVgG8k")?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
697 | 697 | </p> |
698 | 698 | </div> |
699 | 699 | </div> |
700 | 700 | |
701 | 701 | <div class="row"> |
702 | 702 | <div class="col s12 m3 label"> |
703 | - <label for="gdrive_client_id"><?php echo __("Client ID",'xcloner-backup-and-restore')?></label> |
|
703 | + <label for="gdrive_client_id"><?php echo __("Client ID", 'xcloner-backup-and-restore')?></label> |
|
704 | 704 | </div> |
705 | 705 | <div class=" col s12 m6"> |
706 | - <input placeholder="<?php echo __("Google Client ID",'xcloner-backup-and-restore')?>" id="gdrive_client_id" type="text" name="xcloner_gdrive_client_id" class="validate" value="<?php echo get_option("xcloner_gdrive_client_id")?>"> |
|
706 | + <input placeholder="<?php echo __("Google Client ID", 'xcloner-backup-and-restore')?>" id="gdrive_client_id" type="text" name="xcloner_gdrive_client_id" class="validate" value="<?php echo get_option("xcloner_gdrive_client_id")?>"> |
|
707 | 707 | </div> |
708 | 708 | </div> |
709 | 709 | |
710 | 710 | <div class="row"> |
711 | 711 | <div class="col s12 m3 label"> |
712 | - <label for="gdrive_client_secret"><?php echo __("Client Secret",'xcloner-backup-and-restore')?></label> |
|
712 | + <label for="gdrive_client_secret"><?php echo __("Client Secret", 'xcloner-backup-and-restore')?></label> |
|
713 | 713 | </div> |
714 | 714 | <div class=" col s12 m6"> |
715 | - <input placeholder="<?php echo __("Google Client Secret",'xcloner-backup-and-restore')?>" id="gdrive_client_secret" type="text" name="xcloner_gdrive_client_secret" class="validate" value="<?php echo get_option("xcloner_gdrive_client_secret")?>"> |
|
715 | + <input placeholder="<?php echo __("Google Client Secret", 'xcloner-backup-and-restore')?>" id="gdrive_client_secret" type="text" name="xcloner_gdrive_client_secret" class="validate" value="<?php echo get_option("xcloner_gdrive_client_secret")?>"> |
|
716 | 716 | </div> |
717 | 717 | </div> |
718 | 718 | |
@@ -722,41 +722,41 @@ discard block |
||
722 | 722 | |
723 | 723 | </div> |
724 | 724 | <div class=" col s12 m6"> |
725 | - <a class="btn" target="_blank" id="gdrive_authorization_click" onclick="jQuery('#authentification_code').show()" href="<?php echo $gdrive_auth_url?>"><?php echo sprintf(__('Authorize Google Drive','xcloner-backup-and-restore'))?></a> |
|
726 | - <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here","xcloner-backup-and-restore")?>"> |
|
725 | + <a class="btn" target="_blank" id="gdrive_authorization_click" onclick="jQuery('#authentification_code').show()" href="<?php echo $gdrive_auth_url?>"><?php echo sprintf(__('Authorize Google Drive', 'xcloner-backup-and-restore'))?></a> |
|
726 | + <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here", "xcloner-backup-and-restore")?>"> |
|
727 | 727 | </div> |
728 | 728 | </div> |
729 | 729 | |
730 | 730 | <div class="row"> |
731 | 731 | <div class="col s12 m3 label"> |
732 | - <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path",'xcloner-backup-and-restore')?> |
|
732 | + <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path", 'xcloner-backup-and-restore')?> |
|
733 | 733 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" \ |
734 | 734 | data-tooltip="<?php echo __('Folder ID can be found by right clicking on the folder name and selecting \'Get shareable link\' menu, format https://drive.google.com/open?id={FOLDER_ID}<br /> |
735 | 735 | If you supply a folder name, it has to exists in the drive root and start with / , example /backups.xcloner.com/','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
736 | 736 | </label> |
737 | 737 | </div> |
738 | 738 | <div class=" col s12 m6"> |
739 | - <input placeholder="<?php echo __("Target Folder ID or Root Path",'xcloner-backup-and-restore')?>" id="gdrive_target_folder" type="text" name="xcloner_gdrive_target_folder" class="validate" value="<?php echo get_option("xcloner_gdrive_target_folder")?>" autocomplete="off" > |
|
739 | + <input placeholder="<?php echo __("Target Folder ID or Root Path", 'xcloner-backup-and-restore')?>" id="gdrive_target_folder" type="text" name="xcloner_gdrive_target_folder" class="validate" value="<?php echo get_option("xcloner_gdrive_target_folder")?>" autocomplete="off" > |
|
740 | 740 | </div> |
741 | 741 | </div> |
742 | 742 | |
743 | 743 | <div class="row"> |
744 | 744 | <div class="col s12 m3 label"> |
745 | - <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
745 | + <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
746 | 746 | </div> |
747 | 747 | <div class=" col s12 m6"> |
748 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="gdrive_cleanup_days" type="text" name="xcloner_gdrive_cleanup_days" class="validate" value="<?php echo get_option("xcloner_gdrive_cleanup_days")?>"> |
|
748 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="gdrive_cleanup_days" type="text" name="xcloner_gdrive_cleanup_days" class="validate" value="<?php echo get_option("xcloner_gdrive_cleanup_days")?>"> |
|
749 | 749 | </div> |
750 | 750 | </div> |
751 | 751 | |
752 | 752 | <div class="row"> |
753 | 753 | <div class="col s6 m4"> |
754 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
754 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
755 | 755 | <i class="material-icons right">save</i> |
756 | 756 | </button> |
757 | 757 | </div> |
758 | 758 | <div class="col s6 m4"> |
759 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="gdrive" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
759 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="gdrive" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
760 | 760 | <i class="material-icons right">import_export</i> |
761 | 761 | </button> |
762 | 762 | </div> |
@@ -772,15 +772,15 @@ discard block |
||
772 | 772 | <h6><?php echo __("This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated.")?></h6> |
773 | 773 | <h6><?php echo __("PHP 5.5 minimum version is required.")?></h6> |
774 | 774 | <br /> |
775 | - <a class="install-now btn" data-slug="xcloner-google-drive" href="<?php echo $url;?>" aria-label="Install XCloner Google Drive 1.0.0 now" data-name="XCloner Google Drive 1.0.0"> |
|
776 | - <?php echo sprintf(__('Install Now','xcloner-backup-and-restore'))?> |
|
775 | + <a class="install-now btn" data-slug="xcloner-google-drive" href="<?php echo $url; ?>" aria-label="Install XCloner Google Drive 1.0.0 now" data-name="XCloner Google Drive 1.0.0"> |
|
776 | + <?php echo sprintf(__('Install Now', 'xcloner-backup-and-restore'))?> |
|
777 | 777 | </a> |
778 | 778 | |
779 | 779 | <a href="<?php echo admin_url("plugin-install.php")?>?tab=plugin-information&plugin=xcloner-google-drive&TB_iframe=true&width=772&height=499" class="btn thickbox open-plugin-details-modal" aria-label="More information about Theme Check 20160523.1" data-title="Theme Check 20160523.1"> |
780 | 780 | <!-- |
781 | 781 | <a class="btn" href="https://github.com/ovidiul/XCloner-Google-Drive/archive/master.zip"> |
782 | 782 | --> |
783 | - <?php echo sprintf(__('More Details','xcloner-backup-and-restore'))?> |
|
783 | + <?php echo sprintf(__('More Details', 'xcloner-backup-and-restore'))?> |
|
784 | 784 | </a> |
785 | 785 | </div> |
786 | 786 | </div> |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | * @subpackage Xcloner/admin/partials |
13 | 13 | */ |
14 | 14 | |
15 | -$requirements = $this->get_xcloner_container()->get_xcloner_requirements(); |
|
16 | -$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
17 | -$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
18 | -$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
19 | -$xcloner_scheduler = $this->get_xcloner_container()->get_xcloner_scheduler(); |
|
15 | +$requirements = $this->get_xcloner_container()->get_xcloner_requirements(); |
|
16 | +$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
17 | +$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
18 | +$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
19 | +$xcloner_scheduler = $this->get_xcloner_container()->get_xcloner_scheduler(); |
|
20 | 20 | |
21 | 21 | $logger_content = $logger->getLastDebugLines(); |
22 | 22 | |
23 | -$date_format = get_option( 'date_format' ); |
|
24 | -$time_format = get_option( 'time_format' ); |
|
23 | +$date_format = get_option('date_format'); |
|
24 | +$time_format = get_option('time_format'); |
|
25 | 25 | |
26 | -if($requirements->check_backup_ready_status()) |
|
26 | +if ($requirements->check_backup_ready_status()) |
|
27 | 27 | { |
28 | - $latest_backup = $xcloner_file_system->get_latest_backup(); |
|
28 | + $latest_backup = $xcloner_file_system->get_latest_backup(); |
|
29 | 29 | $xcloner_file_system->backup_storage_cleanup(); |
30 | 30 | } |
31 | 31 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | </div> |
39 | 39 | </div> |
40 | 40 | |
41 | -<?php if(isset($latest_backup['timestamp']) and $latest_backup['timestamp'] < strtotime("-1 day")): ?> |
|
41 | +<?php if (isset($latest_backup['timestamp']) and $latest_backup['timestamp'] < strtotime("-1 day")): ?> |
|
42 | 42 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
43 | 43 | <p><strong> |
44 | 44 | <?php echo __('Your latest backup is older than 24 hours, please create a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </div> |
48 | 48 | <?php endif?> |
49 | 49 | |
50 | -<?php if(!isset($latest_backup['timestamp']) ): ?> |
|
50 | +<?php if (!isset($latest_backup['timestamp'])): ?> |
|
51 | 51 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
52 | 52 | <p><strong> |
53 | 53 | <?php echo __('You have no backup that I could find, please generate a new backup to keep your site protected.', 'xcloner-backup-and-restore') ?> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | </div> |
57 | 57 | <?php endif?> |
58 | 58 | |
59 | -<?php if(!$requirements->check_backup_ready_status()):?> |
|
59 | +<?php if (!$requirements->check_backup_ready_status()):?> |
|
60 | 60 | <div id="setting-error-" class="error settings-error notice is-dismissible"> |
61 | 61 | <p><strong> |
62 | 62 | <?php echo __('Backup system not ready, please check and fix the issues marked in red', 'xcloner-backup-and-restore') ?> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | <div class="row"> |
84 | 84 | <h5><?php echo __("Latest Backup", 'xcloner-backup-and-restore')?></h5> |
85 | 85 | <blockquote> |
86 | - <?php if($latest_backup):?> |
|
86 | + <?php if ($latest_backup):?> |
|
87 | 87 | <div class="item"> |
88 | 88 | <div class="title"><?php echo __("Backup Name", 'xcloner-backup-and-restore')?>:</div> |
89 | 89 | <?php echo $latest_backup['basename']?> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | <div class="item"> |
98 | 98 | <div class="title"><?php echo __("Backup Date", 'xcloner-backup-and-restore')?>:</div> |
99 | 99 | <?php |
100 | - echo date($date_format." ".$time_format, $latest_backup['timestamp']+(get_option( 'gmt_offset' ) * HOUR_IN_SECONDS)) |
|
100 | + echo date($date_format." ".$time_format, $latest_backup['timestamp'] + (get_option('gmt_offset') * HOUR_IN_SECONDS)) |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php else:?> |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | <blockquote> |
112 | 112 | <div class="item"> |
113 | 113 | <div class="title"><?php echo __("Total Size", 'xcloner-backup-and-restore')?>:</div> |
114 | - <?php echo size_format($xcloner_file_system->get_storage_usage());?> |
|
114 | + <?php echo size_format($xcloner_file_system->get_storage_usage()); ?> |
|
115 | 115 | </div> |
116 | 116 | </blockquote> |
117 | 117 | <h5><?php echo __("Next Scheduled Backup", 'xcloner-backup-and-restore')?></h5> |
@@ -120,25 +120,25 @@ discard block |
||
120 | 120 | <?php |
121 | 121 | $list = ($xcloner_scheduler->get_next_run_schedule()); |
122 | 122 | |
123 | - if(is_array($list)) |
|
123 | + if (is_array($list)) |
|
124 | 124 | { |
125 | - $xcloner_file_system->sort_by($list, "next_run_time","asc"); |
|
125 | + $xcloner_file_system->sort_by($list, "next_run_time", "asc"); |
|
126 | 126 | } |
127 | 127 | |
128 | - if(isset($list[0])) |
|
128 | + if (isset($list[0])) |
|
129 | 129 | $latest_schedule = $list[0]; |
130 | 130 | ?> |
131 | - <?php if(isset($latest_schedule->name)):?> |
|
131 | + <?php if (isset($latest_schedule->name)):?> |
|
132 | 132 | <div class="title"><?php echo __("Schedule Name", 'xcloner-backup-and-restore')?>:</div> |
133 | - <?php echo $latest_schedule->name;?> |
|
134 | - <?php endif;?> |
|
133 | + <?php echo $latest_schedule->name; ?> |
|
134 | + <?php endif; ?> |
|
135 | 135 | </div> |
136 | 136 | <div class="item"> |
137 | 137 | <div class="title"><?php echo __("Next Call", 'xcloner-backup-and-restore')?>:</div> |
138 | - <?php if(isset($latest_schedule->next_run_time)) |
|
138 | + <?php if (isset($latest_schedule->next_run_time)) |
|
139 | 139 | echo date($date_format." ".$time_format, $latest_schedule->next_run_time); |
140 | 140 | else |
141 | - echo __("Unscheduled",'xcloner-backup-and-restore'); |
|
141 | + echo __("Unscheduled", 'xcloner-backup-and-restore'); |
|
142 | 142 | ?> |
143 | 143 | </div> |
144 | 144 | </blockquote> |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | </div> |
147 | 147 | </li> |
148 | 148 | |
149 | - <?php if($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
149 | + <?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
150 | 150 | <li class="active"> |
151 | 151 | <div class="collapsible-header active"> |
152 | 152 | <i class="material-icons">bug_report</i><?php echo __('XCloner Debugger', 'xcloner-backup-and-restore')?> |
153 | 153 | <span class="right"><a href="#<?php echo $logger_basename = basename($logger->get_main_logger_url())?>" class="download-logger"><?php echo $logger_basename?></a></span> |
154 | 154 | </div> |
155 | 155 | <div class="collapsible-body"> |
156 | - <div class="console" id="xcloner-console"><?php if($logger_content) echo implode("<br />\n", array_reverse($logger_content)); ?></div> |
|
156 | + <div class="console" id="xcloner-console"><?php if ($logger_content) echo implode("<br />\n", array_reverse($logger_content)); ?></div> |
|
157 | 157 | </div> |
158 | 158 | </li> |
159 | 159 | <script> |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | }, 2000);*/ |
166 | 166 | }) |
167 | 167 | </script> |
168 | - <?php endif;?> |
|
168 | + <?php endif; ?> |
|
169 | 169 | |
170 | 170 | </ul> |
171 | 171 | |
@@ -177,59 +177,59 @@ discard block |
||
177 | 177 | |
178 | 178 | <div class="card blue-grey darken-1 z-depth-4 backup-ready"> |
179 | 179 | <div class="card-content white-text"> |
180 | - <span class="card-title"><?php echo __("System Check",'xcloner-backup-and-restore')?></span> |
|
180 | + <span class="card-title"><?php echo __("System Check", 'xcloner-backup-and-restore')?></span> |
|
181 | 181 | <ul> |
182 | - <li class="card-panel <?php echo ($requirements->check_xcloner_start_path(1)?"teal":"red")?> lighten-2" > |
|
183 | - <?php echo __('Backup Start Location','xcloner-backup-and-restore')?>: <span class="shorten_string "><?php echo $requirements->check_xcloner_start_path();?></span> |
|
182 | + <li class="card-panel <?php echo ($requirements->check_xcloner_start_path(1) ? "teal" : "red")?> lighten-2" > |
|
183 | + <?php echo __('Backup Start Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string "><?php echo $requirements->check_xcloner_start_path(); ?></span> |
|
184 | 184 | </li> |
185 | - <li class="card-panel <?php echo ($requirements->check_xcloner_store_path(1)?"teal":"red")?> lighten-2" > |
|
186 | - <?php echo __('Backup Storage Location','xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_store_path();?></span> |
|
185 | + <li class="card-panel <?php echo ($requirements->check_xcloner_store_path(1) ? "teal" : "red")?> lighten-2" > |
|
186 | + <?php echo __('Backup Storage Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_store_path(); ?></span> |
|
187 | 187 | </li> |
188 | - <li class="card-panel <?php echo ($requirements->check_xcloner_tmp_path(1)?"teal":"red")?> lighten-2" > |
|
189 | - <?php echo __('Temporary Location','xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_tmp_path();?></span> |
|
188 | + <li class="card-panel <?php echo ($requirements->check_xcloner_tmp_path(1) ? "teal" : "red")?> lighten-2" > |
|
189 | + <?php echo __('Temporary Location', 'xcloner-backup-and-restore')?>: <span class="shorten_string"><?php echo $requirements->check_xcloner_tmp_path(); ?></span> |
|
190 | 190 | </li> |
191 | 191 | |
192 | - <li class="card-panel <?php echo ($requirements->check_min_php_version(1)?"teal":"red")?> lighten-2" > |
|
193 | - <?php echo __('PHP Version Check','xcloner-backup-and-restore')?>: <?php echo $requirements->check_min_php_version();?> |
|
192 | + <li class="card-panel <?php echo ($requirements->check_min_php_version(1) ? "teal" : "red")?> lighten-2" > |
|
193 | + <?php echo __('PHP Version Check', 'xcloner-backup-and-restore')?>: <?php echo $requirements->check_min_php_version(); ?> |
|
194 | 194 | ( >= <?php echo $requirements->get_constant('min_php_version')?>) |
195 | 195 | </li> |
196 | - <li class="card-panel <?php echo ($requirements->check_safe_mode(1)?"teal":"orange")?> lighten-2" > |
|
197 | - <?php echo __('PHP Safe Mode','xcloner-backup-and-restore')?>: <?php echo $requirements->check_safe_mode();?> |
|
196 | + <li class="card-panel <?php echo ($requirements->check_safe_mode(1) ? "teal" : "orange")?> lighten-2" > |
|
197 | + <?php echo __('PHP Safe Mode', 'xcloner-backup-and-restore')?>: <?php echo $requirements->check_safe_mode(); ?> |
|
198 | 198 | ( <?php echo $requirements->get_constant('safe_mode')?>) |
199 | 199 | </li> |
200 | - <li class="card-panel <?php echo ($requirements->check_backup_ready_status()?"teal":"red")?> lighten-2"> |
|
201 | - <?php echo ($requirements->check_backup_ready_status()?__('BACKUP READY','xcloner-backup-and-restore'):__('Backup not ready, please check above requirements','xcloner-backup-and-restore'))?> |
|
202 | - <i class="material-icons right tiny"><?php echo ($requirements->check_backup_ready_status()?'thumb_up':'thumb_down')?></i> |
|
200 | + <li class="card-panel <?php echo ($requirements->check_backup_ready_status() ? "teal" : "red")?> lighten-2"> |
|
201 | + <?php echo ($requirements->check_backup_ready_status() ? __('BACKUP READY', 'xcloner-backup-and-restore') : __('Backup not ready, please check above requirements', 'xcloner-backup-and-restore'))?> |
|
202 | + <i class="material-icons right tiny"><?php echo ($requirements->check_backup_ready_status() ? 'thumb_up' : 'thumb_down')?></i> |
|
203 | 203 | </li> |
204 | 204 | </ul> |
205 | 205 | <ul class="additional_system_info"> |
206 | 206 | <li class="card-panel grey darken-1" > |
207 | - <?php echo __('PHP max_execution_time','xcloner-backup-and-restore')?>: <?php echo $requirements->get_max_execution_time();?> |
|
207 | + <?php echo __('PHP max_execution_time', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_max_execution_time(); ?> |
|
208 | 208 | </li> |
209 | 209 | <li class="card-panel grey darken-1" > |
210 | - <?php echo __('PHP memory_limit','xcloner-backup-and-restore')?>: <?php echo $requirements->get_memory_limit();?> |
|
210 | + <?php echo __('PHP memory_limit', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_memory_limit(); ?> |
|
211 | 211 | </li> |
212 | 212 | <li class="card-panel grey darken-1" > |
213 | - <?php echo __('PHP open_basedir','xcloner-backup-and-restore')?>: <?php echo $requirements->get_open_basedir();?> |
|
213 | + <?php echo __('PHP open_basedir', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_open_basedir(); ?> |
|
214 | 214 | </li> |
215 | 215 | <?php |
216 | 216 | $data = array(); |
217 | - if($requirements->check_backup_ready_status()) |
|
217 | + if ($requirements->check_backup_ready_status()) |
|
218 | 218 | $data = $xcloner_file_system->estimate_read_write_time(); |
219 | 219 | ?> |
220 | 220 | <li class="card-panel grey darken-1" > |
221 | - <?php echo __('Reading Time 1MB Block','xcloner-backup-and-restore')?>: <?php echo (isset($data['reading_time'])?$data['reading_time']:__("unknown"));?> |
|
221 | + <?php echo __('Reading Time 1MB Block', 'xcloner-backup-and-restore')?>: <?php echo (isset($data['reading_time']) ? $data['reading_time'] : __("unknown")); ?> |
|
222 | 222 | </li> |
223 | 223 | <li class="card-panel grey darken-1" > |
224 | - <?php echo __('Writing Time 1MB Block','xcloner-backup-and-restore')?>: <?php echo (isset($data['writing_time'])?$data['writing_time']:__("unknown"));?> |
|
224 | + <?php echo __('Writing Time 1MB Block', 'xcloner-backup-and-restore')?>: <?php echo (isset($data['writing_time']) ? $data['writing_time'] : __("unknown")); ?> |
|
225 | 225 | </li> |
226 | 226 | <li class="card-panel grey darken-1" > |
227 | - <?php echo __('Free Disk Space','xcloner-backup-and-restore')?>: <?php echo $requirements->get_free_disk_space();;?> |
|
227 | + <?php echo __('Free Disk Space', 'xcloner-backup-and-restore')?>: <?php echo $requirements->get_free_disk_space(); ;?> |
|
228 | 228 | </li> |
229 | 229 | </ul> |
230 | 230 | </div> |
231 | 231 | <div class="card-action"> |
232 | - <a class="waves-effect waves-light btn system_info_toggle blue darken-1"><i class="material-icons left">list</i><?php echo __('Toggle Additional System Info','xcloner-backup-and-restore')?></a> |
|
232 | + <a class="waves-effect waves-light btn system_info_toggle blue darken-1"><i class="material-icons left">list</i><?php echo __('Toggle Additional System Info', 'xcloner-backup-and-restore')?></a> |
|
233 | 233 | </div> |
234 | 234 | </div> |
235 | 235 |
@@ -100,7 +100,8 @@ discard block |
||
100 | 100 | echo date($date_format." ".$time_format, $latest_backup['timestamp']+(get_option( 'gmt_offset' ) * HOUR_IN_SECONDS)) |
101 | 101 | ?> |
102 | 102 | </div> |
103 | - <?php else:?> |
|
103 | + <?php else { |
|
104 | + :?> |
|
104 | 105 | <div class="item"> |
105 | 106 | <div class="title"><?php echo __("No Backup Yet", 'xcloner-backup-and-restore')?></div> |
106 | 107 | </div> |
@@ -111,7 +112,9 @@ discard block |
||
111 | 112 | <blockquote> |
112 | 113 | <div class="item"> |
113 | 114 | <div class="title"><?php echo __("Total Size", 'xcloner-backup-and-restore')?>:</div> |
114 | - <?php echo size_format($xcloner_file_system->get_storage_usage());?> |
|
115 | + <?php echo size_format($xcloner_file_system->get_storage_usage()); |
|
116 | +} |
|
117 | +?> |
|
115 | 118 | </div> |
116 | 119 | </blockquote> |
117 | 120 | <h5><?php echo __("Next Scheduled Backup", 'xcloner-backup-and-restore')?></h5> |
@@ -125,8 +128,9 @@ discard block |
||
125 | 128 | $xcloner_file_system->sort_by($list, "next_run_time","asc"); |
126 | 129 | } |
127 | 130 | |
128 | - if(isset($list[0])) |
|
129 | - $latest_schedule = $list[0]; |
|
131 | + if(isset($list[0])) { |
|
132 | + $latest_schedule = $list[0]; |
|
133 | + } |
|
130 | 134 | ?> |
131 | 135 | <?php if(isset($latest_schedule->name)):?> |
132 | 136 | <div class="title"><?php echo __("Schedule Name", 'xcloner-backup-and-restore')?>:</div> |
@@ -135,10 +139,11 @@ discard block |
||
135 | 139 | </div> |
136 | 140 | <div class="item"> |
137 | 141 | <div class="title"><?php echo __("Next Call", 'xcloner-backup-and-restore')?>:</div> |
138 | - <?php if(isset($latest_schedule->next_run_time)) |
|
142 | + <?php if(isset($latest_schedule->next_run_time)) { |
|
139 | 143 | echo date($date_format." ".$time_format, $latest_schedule->next_run_time); |
140 | - else |
|
141 | - echo __("Unscheduled",'xcloner-backup-and-restore'); |
|
144 | +} else { |
|
145 | + echo __("Unscheduled",'xcloner-backup-and-restore'); |
|
146 | + } |
|
142 | 147 | ?> |
143 | 148 | </div> |
144 | 149 | </blockquote> |
@@ -153,7 +158,10 @@ discard block |
||
153 | 158 | <span class="right"><a href="#<?php echo $logger_basename = basename($logger->get_main_logger_url())?>" class="download-logger"><?php echo $logger_basename?></a></span> |
154 | 159 | </div> |
155 | 160 | <div class="collapsible-body"> |
156 | - <div class="console" id="xcloner-console"><?php if($logger_content) echo implode("<br />\n", array_reverse($logger_content)); ?></div> |
|
161 | + <div class="console" id="xcloner-console"><?php if($logger_content) { |
|
162 | + echo implode("<br />\n", array_reverse($logger_content)); |
|
163 | +} |
|
164 | +?></div> |
|
157 | 165 | </div> |
158 | 166 | </li> |
159 | 167 | <script> |
@@ -214,8 +222,9 @@ discard block |
||
214 | 222 | </li> |
215 | 223 | <?php |
216 | 224 | $data = array(); |
217 | - if($requirements->check_backup_ready_status()) |
|
218 | - $data = $xcloner_file_system->estimate_read_write_time(); |
|
225 | + if($requirements->check_backup_ready_status()) { |
|
226 | + $data = $xcloner_file_system->estimate_read_write_time(); |
|
227 | + } |
|
219 | 228 | ?> |
220 | 229 | <li class="card-panel grey darken-1" > |
221 | 230 | <?php echo __('Reading Time 1MB Block','xcloner-backup-and-restore')?>: <?php echo (isset($data['reading_time'])?$data['reading_time']:__("unknown"));?> |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
4 | -$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
5 | -$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
6 | -$xcloner_file_transfer = $this->get_xcloner_container()->get_xcloner_file_transfer(); |
|
3 | +$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
4 | +$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
5 | +$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
6 | +$xcloner_file_transfer = $this->get_xcloner_container()->get_xcloner_file_transfer(); |
|
7 | 7 | |
8 | -$start = 0 ; |
|
8 | +$start = 0; |
|
9 | 9 | |
10 | 10 | $backup_list = $xcloner_file_system->get_latest_backups(); |
11 | 11 | |
@@ -21,22 +21,22 @@ discard block |
||
21 | 21 | <div class="col s12"> |
22 | 22 | <ul class="collapsible xcloner-restore " data-collapsible="accordion"> |
23 | 23 | <li data-step="1" class="restore-script-upload-step steps active show"> |
24 | - <div class="collapsible-header active"><i class="material-icons">settings_remote</i><?php echo __("Restore Script Upload",'xcloner-backup-and-restore')?></div> |
|
24 | + <div class="collapsible-header active"><i class="material-icons">settings_remote</i><?php echo __("Restore Script Upload", 'xcloner-backup-and-restore')?></div> |
|
25 | 25 | <div class="collapsible-body row"> |
26 | 26 | |
27 | 27 | <ul class="text-steps"> |
28 | - <li><?php echo __("Please download the restore script from",'xcloner-backup-and-restore')?> <a href='#' onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __("here",'xcloner-backup-and-restore')?></strong></a> |
|
28 | + <li><?php echo __("Please download the restore script from", 'xcloner-backup-and-restore')?> <a href='#' onclick="window.location=ajaxurl+'?action=download_restore_script&phar=true'"><strong><?php echo __("here", 'xcloner-backup-and-restore')?></strong></a> |
|
29 | 29 | </li> |
30 | 30 | <li> |
31 | - <?php echo __("Extract the files on your new host",'xcloner-backup-and-restore')?> |
|
31 | + <?php echo __("Extract the files on your new host", 'xcloner-backup-and-restore')?> |
|
32 | 32 | </li> |
33 | 33 | <li> |
34 | - <?php echo __("Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php",'xcloner-backup-and-restore')?> |
|
34 | + <?php echo __("Provide url below to the <u>xcloner_restore.php</u> restore script, like http://my_restore_site.com/xcloner_restore.php", 'xcloner-backup-and-restore')?> |
|
35 | 35 | </li> |
36 | 36 | <li> |
37 | - <?php echo __("If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.",'xcloner-backup-and-restore')?> |
|
37 | + <?php echo __("If your server is not web accessible, like a localhost computer, you can use a DynDNS service or install a blank copy of Wordpress with XCloner in the same environment and start the restore from there.", 'xcloner-backup-and-restore')?> |
|
38 | 38 | </li> |
39 | - <?php if(is_ssl()):?> |
|
39 | + <?php if (is_ssl()):?> |
|
40 | 40 | <li> |
41 | 41 | <?php echo __("We have detected your connection to the site as being secure, so your restore script address must start with https://.")?> |
42 | 42 | </li> |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | </ul> |
46 | 46 | |
47 | 47 | <div class="input-field col l9 s12"> |
48 | - <input value="<?php echo (is_ssl())?"https://":"http://"?>" id="restore_script_url" type="text" class="validate" placeholder="Url to XCloner Restore Script, example http://myddns.com/xcloner/xcloner_restore.php" > |
|
48 | + <input value="<?php echo (is_ssl()) ? "https://" : "http://"?>" id="restore_script_url" type="text" class="validate" placeholder="Url to XCloner Restore Script, example http://myddns.com/xcloner/xcloner_restore.php" > |
|
49 | 49 | <label for="restore_script_url"></label> |
50 | 50 | <div id="url_validation_status" class="status"></div> |
51 | 51 | </div> |
52 | 52 | <div class="col l3 s12 right-align"> |
53 | - <button class="btn waves-effect waves-light" type="submit" id="validate_url" name="action"><?php echo __("Check",'xcloner-backup-and-restore')?> |
|
53 | + <button class="btn waves-effect waves-light" type="submit" id="validate_url" name="action"><?php echo __("Check", 'xcloner-backup-and-restore')?> |
|
54 | 54 | <i class="material-icons right">send</i> |
55 | 55 | </button> |
56 | 56 | </div> |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | </li> |
59 | 59 | |
60 | 60 | <li data-step="2" class="backup-upload-step steps"> |
61 | - <div class="collapsible-header active"><i class="material-icons">file_upload</i><?php echo __("Upload Local Backup Archive To Remote Host",'xcloner-backup-and-restore')?> |
|
61 | + <div class="collapsible-header active"><i class="material-icons">file_upload</i><?php echo __("Upload Local Backup Archive To Remote Host", 'xcloner-backup-and-restore')?> |
|
62 | 62 | </div> |
63 | 63 | <div class="collapsible-body row"> |
64 | - <p><?php echo __("You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.",'xcloner-backup-and-restore')?></p> |
|
64 | + <p><?php echo __("You can skip this step if you want to transfer the archive in some other way, make sure you upload it in the same directory as the restore script from the previous step.", 'xcloner-backup-and-restore')?></p> |
|
65 | 65 | <div class="input-field col s12 l7"> |
66 | 66 | <select id="backup_file" name="backup_file" class="browser-default"> |
67 | - <option value="" disabled selected><?php echo __("Please select a local backup archive to upload to remote host",'xcloner-backup-and-restore')?></option> |
|
68 | - <?php if(is_array($backup_list)):?> |
|
69 | - <?php foreach($backup_list as $file):?> |
|
67 | + <option value="" disabled selected><?php echo __("Please select a local backup archive to upload to remote host", 'xcloner-backup-and-restore')?></option> |
|
68 | + <?php if (is_array($backup_list)):?> |
|
69 | + <?php foreach ($backup_list as $file):?> |
|
70 | 70 | <option value="<?php echo $file['basename']?>"> |
71 | 71 | <?php echo $file['basename']?> (<?php echo size_format($file['size'])?>) |
72 | 72 | </option> |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | </div> |
83 | 83 | <div class="col s12 l5 right-align"> |
84 | 84 | <div class="toggler"> |
85 | - <button class="btn waves-effect waves-light upload-backup normal" type="submit" id="" name="action"><?php echo __("Upload",'xcloner-backup-and-restore')?> |
|
85 | + <button class="btn waves-effect waves-light upload-backup normal" type="submit" id="" name="action"><?php echo __("Upload", 'xcloner-backup-and-restore')?> |
|
86 | 86 | <i class="material-icons right">send</i> |
87 | 87 | </button> |
88 | - <button class="btn waves-effect waves-light red upload-backup cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?> |
|
88 | + <button class="btn waves-effect waves-light red upload-backup cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?> |
|
89 | 89 | <i class="material-icons right">close</i> |
90 | 90 | </button> |
91 | 91 | </div> |
92 | - <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_upload_backup" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?> |
|
92 | + <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_upload_backup" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?> |
|
93 | 93 | <i class="material-icons right">navigate_next</i> |
94 | 94 | </button> |
95 | 95 | </div> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | </li> |
98 | 98 | |
99 | 99 | <li data-step="3" class="restore-remote-backup-step steps active"> |
100 | - <div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Restore Files Backup Available On Remote Host",'xcloner-backup-and-restore')?> |
|
100 | + <div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Restore Files Backup Available On Remote Host", 'xcloner-backup-and-restore')?> |
|
101 | 101 | <i class="material-icons right" title="Refresh Remote Backup Files List" id="refresh_remote_backup_file">cached</i> |
102 | 102 | |
103 | 103 | <div class="switch right"> |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | <div class=" col s12 l7"> |
115 | 115 | <div class="input-field row"> |
116 | 116 | <input type="text" name="remote_restore_path" id="remote_restore_path" class="validate" placeholder="Restore Target Path"> |
117 | - <label><?php echo __("Remote Restore Target Path",'xcloner-backup-and-restore')?></label> |
|
117 | + <label><?php echo __("Remote Restore Target Path", 'xcloner-backup-and-restore')?></label> |
|
118 | 118 | </div> |
119 | 119 | |
120 | 120 | <div class="input-field row"> |
121 | 121 | <select id="remote_backup_file" name="remote_backup_file" class="browser-default"> |
122 | - <option value="" disabled selected><?php echo __("Please select the remote backup file to restore",'xcloner-backup-and-restore')?></option> |
|
122 | + <option value="" disabled selected><?php echo __("Please select the remote backup file to restore", 'xcloner-backup-and-restore')?></option> |
|
123 | 123 | </select> |
124 | 124 | <label></label> |
125 | 125 | </div> |
@@ -134,14 +134,14 @@ discard block |
||
134 | 134 | |
135 | 135 | <div class="col s12 l5 right-align"> |
136 | 136 | <div class="toggler"> |
137 | - <button class="btn waves-effect waves-light restore_remote_backup normal " type="submit" id="" name="action"><?php echo __("Restore",'xcloner-backup-and-restore')?> |
|
137 | + <button class="btn waves-effect waves-light restore_remote_backup normal " type="submit" id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore')?> |
|
138 | 138 | <i class="material-icons right">send</i> |
139 | 139 | </button> |
140 | - <button class="btn waves-effect waves-light red restore_remote_backup cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?> |
|
140 | + <button class="btn waves-effect waves-light red restore_remote_backup cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?> |
|
141 | 141 | <i class="material-icons right">close</i> |
142 | 142 | </button> |
143 | 143 | </div> |
144 | - <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_remote_backup_step" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?> |
|
144 | + <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_remote_backup_step" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?> |
|
145 | 145 | <i class="material-icons right">navigate_next</i> |
146 | 146 | </button> |
147 | 147 | </div> |
@@ -149,71 +149,71 @@ discard block |
||
149 | 149 | </li> |
150 | 150 | |
151 | 151 | <li data-step="4" class="restore-remote-database-step steps active"> |
152 | - <div class="collapsible-header"><i class="material-icons">list</i><?php echo __("Restore Remote Database - Search and Replace",'xcloner-backup-and-restore')?> |
|
152 | + <div class="collapsible-header"><i class="material-icons">list</i><?php echo __("Restore Remote Database - Search and Replace", 'xcloner-backup-and-restore')?> |
|
153 | 153 | <i class="material-icons right" title="Refresh Database Backup Files List" id="refresh_database_file">cached</i> |
154 | 154 | </div> |
155 | 155 | <div class="collapsible-body row"> |
156 | 156 | |
157 | 157 | <div class="col s12"> |
158 | - <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-tooltip="<?php echo __('Please provide below the mysql connection details for the remote host database.','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
159 | - <h5><?php echo __('Remote Mysql Details','xcloner-backup-and-restore')?></h5> |
|
158 | + <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-tooltip="<?php echo __('Please provide below the mysql connection details for the remote host database.', 'xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
159 | + <h5><?php echo __('Remote Mysql Details', 'xcloner-backup-and-restore')?></h5> |
|
160 | 160 | </div> |
161 | 161 | <div class=" col s12"> |
162 | 162 | <div class="input-field col s12 m6"> |
163 | 163 | <input type="text" name="remote_mysql_host" id="remote_mysql_host" class="validate" placeholder="Remote Mysql Hostname" value="localhost"> |
164 | - <label><?php echo __("Remote Mysql Hostname",'xcloner-backup-and-restore')?></label> |
|
164 | + <label><?php echo __("Remote Mysql Hostname", 'xcloner-backup-and-restore')?></label> |
|
165 | 165 | </div> |
166 | 166 | |
167 | 167 | <div class="input-field col s12 m6"> |
168 | 168 | <input type="text" name="remote_mysql_db" id="remote_mysql_db" class="validate" placeholder="Remote Mysql Database"> |
169 | - <label><?php echo __("Remote Mysql Database",'xcloner-backup-and-restore')?></label> |
|
169 | + <label><?php echo __("Remote Mysql Database", 'xcloner-backup-and-restore')?></label> |
|
170 | 170 | </div> |
171 | 171 | |
172 | 172 | <div class="input-field col s12 m6"> |
173 | 173 | <input type="text" name="remote_mysql_user" id="remote_mysql_user" class="validate" placeholder="Remote Mysql Username"> |
174 | - <label><?php echo __("Remote Mysql Username",'xcloner-backup-and-restore')?></label> |
|
174 | + <label><?php echo __("Remote Mysql Username", 'xcloner-backup-and-restore')?></label> |
|
175 | 175 | </div> |
176 | 176 | |
177 | 177 | |
178 | 178 | <div class="input-field col s12 m6"> |
179 | 179 | <input type="text" name="remote_mysql_pass" id="remote_mysql_pass" class="validate" placeholder="Remote Mysql Password"> |
180 | - <label><?php echo __("Remote Mysql Password",'xcloner-backup-and-restore')?></label> |
|
180 | + <label><?php echo __("Remote Mysql Password", 'xcloner-backup-and-restore')?></label> |
|
181 | 181 | </div> |
182 | 182 | |
183 | 183 | </div> |
184 | 184 | <div class="col s12"> |
185 | - <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-html="true" data-tooltip="<?php echo __('I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
186 | - <h5><?php echo __('Remote Mysql Search and Replace','xcloner-backup-and-restore')?></h5> |
|
185 | + <a class="btn-floating tooltipped btn-small right" data-position="left" data-delay="50" data-html="true" data-tooltip="<?php echo __('I will attempt to replace all mysql backup records matching the provided Source Url with the provided Target Url. <br />Leave blank the Target Url if you would like to skip this option. <br />As a bonus, I will also replace all matching serialized data and fix it\'s parsing.', 'xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
186 | + <h5><?php echo __('Remote Mysql Search and Replace', 'xcloner-backup-and-restore')?></h5> |
|
187 | 187 | </div> |
188 | 188 | <div class="col s12"> |
189 | 189 | <div class="input-field col s12 m6 "> |
190 | - <input type="text" name="wp_home_url" id="wp_home_url" class="validate" placeholder="WP Home Url" value="<?php echo home_url();?>"> |
|
191 | - <label><?php echo __("Source Home Url",'xcloner-backup-and-restore')?></label> |
|
190 | + <input type="text" name="wp_home_url" id="wp_home_url" class="validate" placeholder="WP Home Url" value="<?php echo home_url(); ?>"> |
|
191 | + <label><?php echo __("Source Home Url", 'xcloner-backup-and-restore')?></label> |
|
192 | 192 | </div> |
193 | 193 | |
194 | 194 | <div class="input-field col s12 m6 "> |
195 | 195 | <input type="text" name="remote_restore_url" id="remote_restore_url" class="validate" placeholder="Restore Target Url"> |
196 | - <label><?php echo __("With Target Home Url",'xcloner-backup-and-restore')?></label> |
|
196 | + <label><?php echo __("With Target Home Url", 'xcloner-backup-and-restore')?></label> |
|
197 | 197 | </div> |
198 | 198 | |
199 | - <?php if( site_url() != home_url()) : ?> |
|
199 | + <?php if (site_url() != home_url()) : ?> |
|
200 | 200 | <div class="input-field col s12 m6 "> |
201 | - <input type="text" name="wp_site_url" id="wp_site_url" class="validate" placeholder="WP Site Url" value="<?php echo site_url();?>"> |
|
202 | - <label><?php echo __("Source Site Url",'xcloner-backup-and-restore')?></label> |
|
201 | + <input type="text" name="wp_site_url" id="wp_site_url" class="validate" placeholder="WP Site Url" value="<?php echo site_url(); ?>"> |
|
202 | + <label><?php echo __("Source Site Url", 'xcloner-backup-and-restore')?></label> |
|
203 | 203 | </div> |
204 | 204 | |
205 | 205 | <div class="input-field col s12 m6 "> |
206 | 206 | <input type="text" name="remote_restore_site_url" id="remote_restore_site_url" class="validate" placeholder="Restore Target Url"> |
207 | - <label><?php echo __("With Target Site Url",'xcloner-backup-and-restore')?></label> |
|
207 | + <label><?php echo __("With Target Site Url", 'xcloner-backup-and-restore')?></label> |
|
208 | 208 | </div> |
209 | 209 | |
210 | - <?php endif;?> |
|
210 | + <?php endif; ?> |
|
211 | 211 | </div> |
212 | 212 | |
213 | 213 | <div class=" col s12 l7"> |
214 | 214 | <div class="input-field row"> |
215 | 215 | <select id="remote_database_file" name="remote_database_file" class="browser-default"> |
216 | - <option value="" disabled selected><?php echo __("Please select the remote database backup file to restore",'xcloner-backup-and-restore')?></option> |
|
216 | + <option value="" disabled selected><?php echo __("Please select the remote database backup file to restore", 'xcloner-backup-and-restore')?></option> |
|
217 | 217 | </select> |
218 | 218 | |
219 | 219 | <label></label> |
@@ -232,15 +232,15 @@ discard block |
||
232 | 232 | |
233 | 233 | <div class="col s12 l5 right-align"> |
234 | 234 | <div class="toggler"> |
235 | - <button class="btn waves-effect waves-light restore_remote_mysqldump normal " type="submit" id="" name="action"><?php echo __("Restore",'xcloner-backup-and-restore')?> |
|
235 | + <button class="btn waves-effect waves-light restore_remote_mysqldump normal " type="submit" id="" name="action"><?php echo __("Restore", 'xcloner-backup-and-restore')?> |
|
236 | 236 | <i class="material-icons right">send</i> |
237 | 237 | </button> |
238 | - <button class="btn waves-effect waves-light red restore_remote_mysqldump cancel" type="submit" id="" name="action"><?php echo __("Cancel",'xcloner-backup-and-restore')?> |
|
238 | + <button class="btn waves-effect waves-light red restore_remote_mysqldump cancel" type="submit" id="" name="action"><?php echo __("Cancel", 'xcloner-backup-and-restore')?> |
|
239 | 239 | <i class="material-icons right">close</i> |
240 | 240 | </button> |
241 | 241 | </div> |
242 | 242 | |
243 | - <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next",'xcloner-backup-and-restore')?>" id="skip_restore_remote_database_step" name="action"><?php echo __("Next",'xcloner-backup-and-restore')?> |
|
243 | + <button class="btn waves-effect waves-light grey" type="submit" title="<?php echo __("Skip Next", 'xcloner-backup-and-restore')?>" id="skip_restore_remote_database_step" name="action"><?php echo __("Next", 'xcloner-backup-and-restore')?> |
|
244 | 244 | <i class="material-icons right">navigate_next</i> |
245 | 245 | </button> |
246 | 246 | |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | </li> |
251 | 251 | |
252 | 252 | <li data-step="5" class="restore-finish-step steps active"> |
253 | - <div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Finishing up...",'xcloner-backup-and-restore')?> |
|
253 | + <div class="collapsible-header"><i class="material-icons">folder_open</i><?php echo __("Finishing up...", 'xcloner-backup-and-restore')?> |
|
254 | 254 | </div> |
255 | 255 | <div class="collapsible-body row"> |
256 | 256 | |
257 | 257 | <div class="row"> |
258 | 258 | <div class="col s4"> |
259 | - <label><?php echo __("Update wp-config.php mysql details and update the restored site Url",'xcloner-backup-and-restore')?></label> |
|
259 | + <label><?php echo __("Update wp-config.php mysql details and update the restored site Url", 'xcloner-backup-and-restore')?></label> |
|
260 | 260 | </div> |
261 | 261 | |
262 | 262 | <div class="col s8"> |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | <div class="row"> |
275 | 275 | <div class="col s4"> |
276 | - <label><?php echo __("Delete Restored Backup Temporary Folder",'xcloner-backup-and-restore')?></label> |
|
276 | + <label><?php echo __("Delete Restored Backup Temporary Folder", 'xcloner-backup-and-restore')?></label> |
|
277 | 277 | </div> |
278 | 278 | <div class="col s8"> |
279 | 279 | <div class="switch"> |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | <div class="row"> |
291 | 291 | <div class="col s4"> |
292 | - <label><?php echo __("Delete Restore Script",'xcloner-backup-and-restore')?></label> |
|
292 | + <label><?php echo __("Delete Restore Script", 'xcloner-backup-and-restore')?></label> |
|
293 | 293 | </div> |
294 | 294 | <div class="col s8"> |
295 | 295 | <div class="switch"> |
@@ -308,15 +308,15 @@ discard block |
||
308 | 308 | </div> |
309 | 309 | |
310 | 310 | <div class=" row col s12 center-align" id="xcloner_restore_finish"> |
311 | - <h5><?php echo __("Thank you for using XCloner.",'xcloner-backup-and-restore')?></h5> |
|
312 | - <h6><?php echo sprintf(__("We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore'),'<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore" target="_blank">Wordpress XCloner forums</a>') ?></h6> |
|
311 | + <h5><?php echo __("Thank you for using XCloner.", 'xcloner-backup-and-restore')?></h5> |
|
312 | + <h6><?php echo sprintf(__("We would love to hear about your experience in the %s.", 'xcloner-backup-and-restore'), '<a href="https://wordpress.org/support/plugin/xcloner-backup-and-restore" target="_blank">Wordpress XCloner forums</a>') ?></h6> |
|
313 | 313 | <a class="twitter-follow-button" href="https://twitter.com/thinkovi" data-show-count="false">Follow @thinkovi</a> |
314 | 314 | <script src="//platform.twitter.com/widgets.js" async="" charset="utf-8"></script> |
315 | 315 | </div> |
316 | 316 | |
317 | 317 | <div class="col s12 center-align"> |
318 | 318 | |
319 | - <button class="btn waves-effect waves-light teal" type="submit" id="restore_finish" name="action"><?php echo __("Finish",'xcloner-backup-and-restore')?> |
|
319 | + <button class="btn waves-effect waves-light teal" type="submit" id="restore_finish" name="action"><?php echo __("Finish", 'xcloner-backup-and-restore')?> |
|
320 | 320 | <i class="material-icons right">navigate_next</i> |
321 | 321 | </button> |
322 | 322 | </div> |