@@ -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 | } |
@@ -144,20 +144,20 @@ discard block |
||
144 | 144 | $remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
145 | 145 | |
146 | 146 | |
147 | - if(isset($_POST['action'])) |
|
147 | + if (isset($_POST['action'])) |
|
148 | 148 | { |
149 | 149 | $_POST['action'] = $xcloner_sanitization->sanitize_input_as_string($_POST['action']); |
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); |
@@ -209,262 +209,262 @@ discard block |
||
209 | 209 | |
210 | 210 | public function settings_init() |
211 | 211 | { |
212 | - global $wpdb; |
|
213 | - $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
212 | + global $wpdb; |
|
213 | + $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
214 | 214 | |
215 | - //ADDING MISSING OPTIONS |
|
216 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
215 | + //ADDING MISSING OPTIONS |
|
216 | + if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
217 | 217 | add_option( 'xcloner_mysql_settings_page' ); |
218 | 218 | } // end if |
219 | 219 | |
220 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
220 | + if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
221 | 221 | add_option( 'xcloner_cron_settings_page' ); |
222 | 222 | } // end if |
223 | 223 | |
224 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
224 | + if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
225 | 225 | add_option( 'xcloner_system_settings_page' ); |
226 | 226 | } // end if |
227 | 227 | |
228 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
228 | + if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
229 | 229 | add_option( 'xcloner_cleanup_settings_page' ); |
230 | 230 | } // end if |
231 | 231 | |
232 | 232 | |
233 | - //ADDING SETTING SECTIONS |
|
234 | - //GENERAL section |
|
235 | - add_settings_section( |
|
236 | - 'xcloner_general_settings_group', |
|
237 | - __(' '), |
|
238 | - array($this, 'xcloner_settings_section_cb'), |
|
239 | - 'xcloner_settings_page' |
|
240 | - ); |
|
241 | - //MYSQL section |
|
242 | - add_settings_section( |
|
243 | - 'xcloner_mysql_settings_group', |
|
244 | - __(' '), |
|
245 | - array($this, 'xcloner_settings_section_cb'), |
|
246 | - 'xcloner_mysql_settings_page' |
|
247 | - ); |
|
233 | + //ADDING SETTING SECTIONS |
|
234 | + //GENERAL section |
|
235 | + add_settings_section( |
|
236 | + 'xcloner_general_settings_group', |
|
237 | + __(' '), |
|
238 | + array($this, 'xcloner_settings_section_cb'), |
|
239 | + 'xcloner_settings_page' |
|
240 | + ); |
|
241 | + //MYSQL section |
|
242 | + add_settings_section( |
|
243 | + 'xcloner_mysql_settings_group', |
|
244 | + __(' '), |
|
245 | + array($this, 'xcloner_settings_section_cb'), |
|
246 | + 'xcloner_mysql_settings_page' |
|
247 | + ); |
|
248 | 248 | |
249 | - //SYSTEM section |
|
250 | - add_settings_section( |
|
251 | - 'xcloner_system_settings_group', |
|
252 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
253 | - array($this, 'xcloner_settings_section_cb'), |
|
254 | - 'xcloner_system_settings_page' |
|
255 | - ); |
|
249 | + //SYSTEM section |
|
250 | + add_settings_section( |
|
251 | + 'xcloner_system_settings_group', |
|
252 | + __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
253 | + array($this, 'xcloner_settings_section_cb'), |
|
254 | + 'xcloner_system_settings_page' |
|
255 | + ); |
|
256 | 256 | |
257 | - //CLEANUP section |
|
258 | - add_settings_section( |
|
259 | - 'xcloner_cleanup_settings_group', |
|
260 | - __(' '), |
|
261 | - array($this, 'xcloner_settings_section_cb'), |
|
262 | - 'xcloner_cleanup_settings_page' |
|
263 | - ); |
|
257 | + //CLEANUP section |
|
258 | + add_settings_section( |
|
259 | + 'xcloner_cleanup_settings_group', |
|
260 | + __(' '), |
|
261 | + array($this, 'xcloner_settings_section_cb'), |
|
262 | + 'xcloner_cleanup_settings_page' |
|
263 | + ); |
|
264 | 264 | |
265 | 265 | |
266 | 266 | //CRON section |
267 | - add_settings_section( |
|
268 | - 'xcloner_cron_settings_group', |
|
269 | - __(' '), |
|
270 | - array($this, 'xcloner_settings_section_cb'), |
|
271 | - 'xcloner_cron_settings_page' |
|
272 | - ); |
|
267 | + add_settings_section( |
|
268 | + 'xcloner_cron_settings_group', |
|
269 | + __(' '), |
|
270 | + array($this, 'xcloner_settings_section_cb'), |
|
271 | + 'xcloner_cron_settings_page' |
|
272 | + ); |
|
273 | 273 | |
274 | 274 | |
275 | 275 | |
276 | 276 | //REGISTERING THE 'GENERAL SECTION' FIELDS |
277 | 277 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
278 | - add_settings_field( |
|
279 | - 'xcloner_backup_compression_level', |
|
280 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
281 | - array($this, 'do_form_range_field'), |
|
282 | - 'xcloner_settings_page', |
|
283 | - 'xcloner_general_settings_group', |
|
284 | - array('xcloner_backup_compression_level', |
|
285 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
286 | - 0, |
|
287 | - 9 |
|
288 | - ) |
|
289 | - ); |
|
278 | + add_settings_field( |
|
279 | + 'xcloner_backup_compression_level', |
|
280 | + __('Backup Compression Level','xcloner-backup-and-restore'), |
|
281 | + array($this, 'do_form_range_field'), |
|
282 | + 'xcloner_settings_page', |
|
283 | + 'xcloner_general_settings_group', |
|
284 | + array('xcloner_backup_compression_level', |
|
285 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
286 | + 0, |
|
287 | + 9 |
|
288 | + ) |
|
289 | + ); |
|
290 | 290 | |
291 | - register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
292 | - add_settings_field( |
|
293 | - 'xcloner_start_path', |
|
294 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
295 | - array($this, 'do_form_text_field'), |
|
296 | - 'xcloner_settings_page', |
|
297 | - 'xcloner_general_settings_group', |
|
298 | - array('xcloner_start_path', |
|
291 | + register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
292 | + add_settings_field( |
|
293 | + 'xcloner_start_path', |
|
294 | + __('Backup Start Location','xcloner-backup-and-restore'), |
|
295 | + array($this, 'do_form_text_field'), |
|
296 | + 'xcloner_settings_page', |
|
297 | + 'xcloner_general_settings_group', |
|
298 | + array('xcloner_start_path', |
|
299 | 299 | __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
300 | 300 | $this->get_xcloner_start_path(), |
301 | 301 | //'disabled' |
302 | 302 | ) |
303 | - ); |
|
303 | + ); |
|
304 | 304 | |
305 | - register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
306 | - add_settings_field( |
|
307 | - 'xcloner_store_path', |
|
308 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
309 | - array($this, 'do_form_text_field'), |
|
310 | - 'xcloner_settings_page', |
|
311 | - 'xcloner_general_settings_group', |
|
312 | - array('xcloner_store_path', |
|
305 | + register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
|
306 | + add_settings_field( |
|
307 | + 'xcloner_store_path', |
|
308 | + __('Backup Storage Location','xcloner-backup-and-restore'), |
|
309 | + array($this, 'do_form_text_field'), |
|
310 | + 'xcloner_settings_page', |
|
311 | + 'xcloner_general_settings_group', |
|
312 | + array('xcloner_store_path', |
|
313 | 313 | __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
314 | 314 | $this->get_xcloner_store_path(), |
315 | 315 | //'disabled' |
316 | 316 | ) |
317 | - ); |
|
317 | + ); |
|
318 | 318 | |
319 | - register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
320 | - add_settings_field( |
|
321 | - 'xcloner_enable_log', |
|
322 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
323 | - array($this, 'do_form_switch_field'), |
|
324 | - 'xcloner_settings_page', |
|
325 | - 'xcloner_general_settings_group', |
|
326 | - array('xcloner_enable_log', |
|
319 | + register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
320 | + add_settings_field( |
|
321 | + 'xcloner_enable_log', |
|
322 | + __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
323 | + array($this, 'do_form_switch_field'), |
|
324 | + 'xcloner_settings_page', |
|
325 | + 'xcloner_general_settings_group', |
|
326 | + array('xcloner_enable_log', |
|
327 | 327 | 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()) |
328 | 328 | ) |
329 | 329 | ); |
330 | 330 | |
331 | 331 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
332 | - add_settings_field( |
|
333 | - 'xcloner_regex_exclude', |
|
334 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
335 | - array($this, 'do_form_textarea_field'), |
|
336 | - 'xcloner_settings_page', |
|
337 | - 'xcloner_general_settings_group', |
|
338 | - array('xcloner_regex_exclude', |
|
332 | + add_settings_field( |
|
333 | + 'xcloner_regex_exclude', |
|
334 | + __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
335 | + array($this, 'do_form_textarea_field'), |
|
336 | + 'xcloner_settings_page', |
|
337 | + 'xcloner_general_settings_group', |
|
338 | + array('xcloner_regex_exclude', |
|
339 | 339 | __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
340 | 340 | //$this->get_xcloner_store_path(), |
341 | 341 | //'disabled' |
342 | 342 | ) |
343 | - ); |
|
343 | + ); |
|
344 | 344 | |
345 | 345 | //REGISTERING THE 'MYSQL SECTION' FIELDS |
346 | 346 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
347 | - add_settings_field( |
|
348 | - 'xcloner_enable_mysql_backup', |
|
349 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
350 | - array($this, 'do_form_switch_field'), |
|
351 | - 'xcloner_mysql_settings_page', |
|
352 | - 'xcloner_mysql_settings_group', |
|
353 | - array('xcloner_enable_mysql_backup', |
|
347 | + add_settings_field( |
|
348 | + 'xcloner_enable_mysql_backup', |
|
349 | + __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
350 | + array($this, 'do_form_switch_field'), |
|
351 | + 'xcloner_mysql_settings_page', |
|
352 | + 'xcloner_mysql_settings_group', |
|
353 | + array('xcloner_enable_mysql_backup', |
|
354 | 354 | __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
355 | 355 | ) |
356 | - ); |
|
356 | + ); |
|
357 | 357 | |
358 | - register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
359 | - add_settings_field( |
|
360 | - 'xcloner_backup_only_wp_tables', |
|
361 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
362 | - array($this, 'do_form_switch_field'), |
|
363 | - 'xcloner_mysql_settings_page', |
|
364 | - 'xcloner_mysql_settings_group', |
|
365 | - array('xcloner_backup_only_wp_tables', |
|
358 | + register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
|
359 | + add_settings_field( |
|
360 | + 'xcloner_backup_only_wp_tables', |
|
361 | + __('Backup only WP tables','xcloner-backup-and-restore'), |
|
362 | + array($this, 'do_form_switch_field'), |
|
363 | + 'xcloner_mysql_settings_page', |
|
364 | + 'xcloner_mysql_settings_group', |
|
365 | + array('xcloner_backup_only_wp_tables', |
|
366 | 366 | sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
367 | 367 | ) |
368 | - ); |
|
368 | + ); |
|
369 | 369 | |
370 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
371 | - add_settings_field( |
|
372 | - 'xcloner_mysql_hostname', |
|
373 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
374 | - array($this, 'do_form_text_field'), |
|
375 | - 'xcloner_mysql_settings_page', |
|
376 | - 'xcloner_mysql_settings_group', |
|
377 | - array('xcloner_mysql_hostname', |
|
370 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
371 | + add_settings_field( |
|
372 | + 'xcloner_mysql_hostname', |
|
373 | + __('Mysql Hostname','xcloner-backup-and-restore'), |
|
374 | + array($this, 'do_form_text_field'), |
|
375 | + 'xcloner_mysql_settings_page', |
|
376 | + 'xcloner_mysql_settings_group', |
|
377 | + array('xcloner_mysql_hostname', |
|
378 | 378 | __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
379 | 379 | $this->get_db_hostname(), |
380 | 380 | 'disabled' |
381 | 381 | ) |
382 | - ); |
|
382 | + ); |
|
383 | 383 | |
384 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
385 | - add_settings_field( |
|
386 | - 'xcloner_mysql_username', |
|
387 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
388 | - array($this, 'do_form_text_field'), |
|
389 | - 'xcloner_mysql_settings_page', |
|
390 | - 'xcloner_mysql_settings_group', |
|
391 | - array('xcloner_mysql_username', |
|
384 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
385 | + add_settings_field( |
|
386 | + 'xcloner_mysql_username', |
|
387 | + __('Mysql Username','xcloner-backup-and-restore'), |
|
388 | + array($this, 'do_form_text_field'), |
|
389 | + 'xcloner_mysql_settings_page', |
|
390 | + 'xcloner_mysql_settings_group', |
|
391 | + array('xcloner_mysql_username', |
|
392 | 392 | __('Wordpress mysql username','xcloner-backup-and-restore'), |
393 | 393 | $this->get_db_username(), |
394 | 394 | 'disabled' |
395 | 395 | ) |
396 | - ); |
|
396 | + ); |
|
397 | 397 | |
398 | - register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
399 | - add_settings_field( |
|
400 | - 'xcloner_mysql_database', |
|
401 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
402 | - array($this, 'do_form_text_field'), |
|
403 | - 'xcloner_mysql_settings_page', |
|
404 | - 'xcloner_mysql_settings_group', |
|
405 | - array('xcloner_mysql_database', |
|
398 | + register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
|
399 | + add_settings_field( |
|
400 | + 'xcloner_mysql_database', |
|
401 | + __('Mysql Database','xcloner-backup-and-restore'), |
|
402 | + array($this, 'do_form_text_field'), |
|
403 | + 'xcloner_mysql_settings_page', |
|
404 | + 'xcloner_mysql_settings_group', |
|
405 | + array('xcloner_mysql_database', |
|
406 | 406 | __('Wordpress mysql database','xcloner-backup-and-restore'), |
407 | 407 | $this->get_db_database(), |
408 | 408 | 'disabled' |
409 | 409 | ) |
410 | - ); |
|
410 | + ); |
|
411 | 411 | |
412 | - //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
413 | - register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
414 | - add_settings_field( |
|
415 | - 'xcloner_size_limit_per_request', |
|
416 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
417 | - array($this, 'do_form_range_field'), |
|
418 | - 'xcloner_system_settings_page', |
|
419 | - 'xcloner_system_settings_group', |
|
420 | - array('xcloner_size_limit_per_request', |
|
421 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
422 | - 0, |
|
423 | - 1024 |
|
424 | - ) |
|
425 | - ); |
|
412 | + //REGISTERING THE 'SYSTEM SECTION' FIELDS |
|
413 | + register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
|
414 | + add_settings_field( |
|
415 | + 'xcloner_size_limit_per_request', |
|
416 | + __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
417 | + array($this, 'do_form_range_field'), |
|
418 | + 'xcloner_system_settings_page', |
|
419 | + 'xcloner_system_settings_group', |
|
420 | + array('xcloner_size_limit_per_request', |
|
421 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
422 | + 0, |
|
423 | + 1024 |
|
424 | + ) |
|
425 | + ); |
|
426 | 426 | |
427 | 427 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
428 | - add_settings_field( |
|
429 | - 'xcloner_files_to_process_per_request', |
|
430 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
431 | - array($this, 'do_form_range_field'), |
|
432 | - 'xcloner_system_settings_page', |
|
433 | - 'xcloner_system_settings_group', |
|
434 | - array('xcloner_files_to_process_per_request', |
|
435 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
436 | - 0, |
|
437 | - 1000 |
|
438 | - ) |
|
439 | - ); |
|
428 | + add_settings_field( |
|
429 | + 'xcloner_files_to_process_per_request', |
|
430 | + __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
431 | + array($this, 'do_form_range_field'), |
|
432 | + 'xcloner_system_settings_page', |
|
433 | + 'xcloner_system_settings_group', |
|
434 | + array('xcloner_files_to_process_per_request', |
|
435 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
436 | + 0, |
|
437 | + 1000 |
|
438 | + ) |
|
439 | + ); |
|
440 | 440 | |
441 | 441 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
442 | - add_settings_field( |
|
443 | - 'xcloner_directories_to_scan_per_request', |
|
444 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
445 | - array($this, 'do_form_range_field'), |
|
446 | - 'xcloner_system_settings_page', |
|
447 | - 'xcloner_system_settings_group', |
|
448 | - array('xcloner_directories_to_scan_per_request', |
|
449 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
450 | - 0, |
|
451 | - 1000 |
|
452 | - ) |
|
453 | - ); |
|
442 | + add_settings_field( |
|
443 | + 'xcloner_directories_to_scan_per_request', |
|
444 | + __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
445 | + array($this, 'do_form_range_field'), |
|
446 | + 'xcloner_system_settings_page', |
|
447 | + 'xcloner_system_settings_group', |
|
448 | + array('xcloner_directories_to_scan_per_request', |
|
449 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
450 | + 0, |
|
451 | + 1000 |
|
452 | + ) |
|
453 | + ); |
|
454 | 454 | |
455 | 455 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
456 | - add_settings_field( |
|
457 | - 'xcloner_database_records_per_request', |
|
458 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
459 | - array($this, 'do_form_range_field'), |
|
460 | - 'xcloner_system_settings_page', |
|
461 | - 'xcloner_system_settings_group', |
|
462 | - array('xcloner_database_records_per_request', |
|
463 | - __('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'), |
|
464 | - 0, |
|
465 | - 100000 |
|
466 | - ) |
|
467 | - ); |
|
456 | + add_settings_field( |
|
457 | + 'xcloner_database_records_per_request', |
|
458 | + __('Database Records Per Request','xcloner-backup-and-restore'), |
|
459 | + array($this, 'do_form_range_field'), |
|
460 | + 'xcloner_system_settings_page', |
|
461 | + 'xcloner_system_settings_group', |
|
462 | + array('xcloner_database_records_per_request', |
|
463 | + __('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'), |
|
464 | + 0, |
|
465 | + 100000 |
|
466 | + ) |
|
467 | + ); |
|
468 | 468 | |
469 | 469 | /*register_setting('xcloner_system_settings_group', 'xcloner_diff_backup_recreate_period', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
470 | 470 | add_settings_field( |
@@ -479,90 +479,90 @@ discard block |
||
479 | 479 | );*/ |
480 | 480 | |
481 | 481 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
482 | - add_settings_field( |
|
483 | - 'xcloner_exclude_files_larger_than_mb', |
|
484 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
485 | - array($this, 'do_form_number_field'), |
|
486 | - 'xcloner_system_settings_page', |
|
487 | - 'xcloner_system_settings_group', |
|
488 | - array('xcloner_exclude_files_larger_than_mb', |
|
489 | - __('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'), |
|
490 | - ) |
|
491 | - ); |
|
482 | + add_settings_field( |
|
483 | + 'xcloner_exclude_files_larger_than_mb', |
|
484 | + __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
485 | + array($this, 'do_form_number_field'), |
|
486 | + 'xcloner_system_settings_page', |
|
487 | + 'xcloner_system_settings_group', |
|
488 | + array('xcloner_exclude_files_larger_than_mb', |
|
489 | + __('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'), |
|
490 | + ) |
|
491 | + ); |
|
492 | 492 | |
493 | 493 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
494 | - add_settings_field( |
|
495 | - 'xcloner_split_backup_limit', |
|
496 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
497 | - array($this, 'do_form_number_field'), |
|
498 | - 'xcloner_system_settings_page', |
|
499 | - 'xcloner_system_settings_group', |
|
500 | - array('xcloner_split_backup_limit', |
|
501 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
502 | - ) |
|
503 | - ); |
|
494 | + add_settings_field( |
|
495 | + 'xcloner_split_backup_limit', |
|
496 | + __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
497 | + array($this, 'do_form_number_field'), |
|
498 | + 'xcloner_system_settings_page', |
|
499 | + 'xcloner_system_settings_group', |
|
500 | + array('xcloner_split_backup_limit', |
|
501 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
502 | + ) |
|
503 | + ); |
|
504 | 504 | |
505 | - register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
506 | - add_settings_field( |
|
507 | - 'xcloner_force_tmp_path_site_root', |
|
508 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
509 | - array($this, 'do_form_switch_field'), |
|
510 | - 'xcloner_system_settings_page', |
|
511 | - 'xcloner_system_settings_group', |
|
512 | - array('xcloner_force_tmp_path_site_root', |
|
505 | + register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
|
506 | + add_settings_field( |
|
507 | + 'xcloner_force_tmp_path_site_root', |
|
508 | + __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
509 | + array($this, 'do_form_switch_field'), |
|
510 | + 'xcloner_system_settings_page', |
|
511 | + 'xcloner_system_settings_group', |
|
512 | + array('xcloner_force_tmp_path_site_root', |
|
513 | 513 | 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()) |
514 | 514 | ) |
515 | - ); |
|
515 | + ); |
|
516 | 516 | |
517 | 517 | //REGISTERING THE 'CLEANUP SECTION' FIELDS |
518 | 518 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
519 | - add_settings_field( |
|
520 | - 'xcloner_cleanup_retention_limit_days', |
|
521 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
522 | - array($this, 'do_form_number_field'), |
|
523 | - 'xcloner_cleanup_settings_page', |
|
524 | - 'xcloner_cleanup_settings_group', |
|
525 | - array('xcloner_cleanup_retention_limit_days', |
|
519 | + add_settings_field( |
|
520 | + 'xcloner_cleanup_retention_limit_days', |
|
521 | + __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
522 | + array($this, 'do_form_number_field'), |
|
523 | + 'xcloner_cleanup_settings_page', |
|
524 | + 'xcloner_cleanup_settings_group', |
|
525 | + array('xcloner_cleanup_retention_limit_days', |
|
526 | 526 | __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
527 | 527 | ) |
528 | - ); |
|
528 | + ); |
|
529 | 529 | |
530 | 530 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
531 | - add_settings_field( |
|
532 | - 'xcloner_cleanup_retention_limit_archives', |
|
533 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
534 | - array($this, 'do_form_number_field'), |
|
535 | - 'xcloner_cleanup_settings_page', |
|
536 | - 'xcloner_cleanup_settings_group', |
|
537 | - array('xcloner_cleanup_retention_limit_archives', |
|
531 | + add_settings_field( |
|
532 | + 'xcloner_cleanup_retention_limit_archives', |
|
533 | + __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
534 | + array($this, 'do_form_number_field'), |
|
535 | + 'xcloner_cleanup_settings_page', |
|
536 | + 'xcloner_cleanup_settings_group', |
|
537 | + array('xcloner_cleanup_retention_limit_archives', |
|
538 | 538 | __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
539 | 539 | ) |
540 | - ); |
|
540 | + ); |
|
541 | 541 | |
542 | 542 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
543 | - add_settings_field( |
|
544 | - 'xcloner_cleanup_capacity_limit', |
|
545 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
546 | - array($this, 'do_form_number_field'), |
|
547 | - 'xcloner_cleanup_settings_page', |
|
548 | - 'xcloner_cleanup_settings_group', |
|
549 | - array('xcloner_cleanup_capacity_limit', |
|
543 | + add_settings_field( |
|
544 | + 'xcloner_cleanup_capacity_limit', |
|
545 | + __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
546 | + array($this, 'do_form_number_field'), |
|
547 | + 'xcloner_cleanup_settings_page', |
|
548 | + 'xcloner_cleanup_settings_group', |
|
549 | + array('xcloner_cleanup_capacity_limit', |
|
550 | 550 | __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
551 | 551 | ) |
552 | - ); |
|
552 | + ); |
|
553 | 553 | |
554 | 554 | //REGISTERING THE 'CRON SECTION' FIELDS |
555 | 555 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
556 | - add_settings_field( |
|
557 | - 'xcloner_cron_frequency', |
|
558 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
559 | - array($this, 'do_form_text_field'), |
|
560 | - 'xcloner_cron_settings_page', |
|
561 | - 'xcloner_cron_settings_group', |
|
562 | - array('xcloner_cron_frequency', |
|
556 | + add_settings_field( |
|
557 | + 'xcloner_cron_frequency', |
|
558 | + __('Cron frequency','xcloner-backup-and-restore'), |
|
559 | + array($this, 'do_form_text_field'), |
|
560 | + 'xcloner_cron_settings_page', |
|
561 | + 'xcloner_cron_settings_group', |
|
562 | + array('xcloner_cron_frequency', |
|
563 | 563 | __('Cron frequency') |
564 | 564 | ) |
565 | - ); |
|
565 | + ); |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | // section content cb |
576 | 576 | public function xcloner_settings_section_cb() |
577 | 577 | { |
578 | - //echo '<p>WPOrg Section Introduction.</p>'; |
|
578 | + //echo '<p>WPOrg Section Introduction.</p>'; |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | // text field content cb |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | |
591 | 591 | if(!$value) |
592 | 592 | $value = get_option($fieldname); |
593 | - // output the field |
|
594 | - ?> |
|
593 | + // output the field |
|
594 | + ?> |
|
595 | 595 | <div class="row"> |
596 | 596 | <div class="input-field col s10 m10 l8"> |
597 | 597 | <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) : ''; ?>"> |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | |
618 | 618 | if(!$value) |
619 | 619 | $value = get_option($fieldname); |
620 | - // output the field |
|
621 | - ?> |
|
620 | + // output the field |
|
621 | + ?> |
|
622 | 622 | <div class="row"> |
623 | 623 | <div class="input-field col s10 m10 l8"> |
624 | 624 | <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> |
@@ -661,8 +661,8 @@ discard block |
||
661 | 661 | |
662 | 662 | if(!$value) |
663 | 663 | $value = get_option($fieldname); |
664 | - // output the field |
|
665 | - ?> |
|
664 | + // output the field |
|
665 | + ?> |
|
666 | 666 | <div class="row"> |
667 | 667 | <div class="input-field col s10 m5 l3"> |
668 | 668 | <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,18 +66,18 @@ discard block |
||
66 | 66 | public function get_xcloner_tmp_path($suffix = true) |
67 | 67 | { |
68 | 68 | $path = sys_get_temp_dir(); |
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 | { |
77 | 77 | $path = $this->get_xcloner_store_path(); |
78 | 78 | } |
79 | 79 | |
80 | - if($suffix) |
|
80 | + if ($suffix) |
|
81 | 81 | { |
82 | 82 | $path = $path.DS.".".$this->get_xcloner_tmp_path_suffix(); |
83 | 83 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function get_enable_mysql_backup() |
89 | 89 | { |
90 | - if(get_option('xcloner_enable_mysql_backup')) |
|
90 | + if (get_option('xcloner_enable_mysql_backup')) |
|
91 | 91 | return true; |
92 | 92 | |
93 | 93 | return false; |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | |
96 | 96 | public function get_backup_extension_name($ext = "") |
97 | 97 | { |
98 | - if(!$ext) |
|
98 | + if (!$ext) |
|
99 | 99 | { |
100 | - if(get_option('xcloner_backup_compression_level')) |
|
100 | + if (get_option('xcloner_backup_compression_level')) |
|
101 | 101 | $ext = ".tgz"; |
102 | 102 | else |
103 | 103 | $ext = ".tar"; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function get_hash() |
109 | 109 | { |
110 | - if(!$this->hash){ |
|
110 | + if (!$this->hash) { |
|
111 | 111 | $this->set_hash("-".$this->get_server_unique_hash(5)); |
112 | 112 | } |
113 | 113 | |
@@ -119,17 +119,17 @@ discard block |
||
119 | 119 | { |
120 | 120 | $hash = "-".md5(rand()); |
121 | 121 | |
122 | - $this->set_hash(substr( $hash, 0, 6)); |
|
122 | + $this->set_hash(substr($hash, 0, 6)); |
|
123 | 123 | |
124 | 124 | return $hash; |
125 | 125 | } |
126 | 126 | |
127 | 127 | public function set_hash($hash = "") |
128 | 128 | { |
129 | - if(substr($hash, 0, 1) != "-" and strlen($hash)) |
|
129 | + if (substr($hash, 0, 1) != "-" and strlen($hash)) |
|
130 | 130 | $hash = "-".$hash; |
131 | 131 | |
132 | - $this->hash = substr( $hash, 0, 6); |
|
132 | + $this->hash = substr($hash, 0, 6); |
|
133 | 133 | |
134 | 134 | return $this; |
135 | 135 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | $data = parse_url(get_site_url()); |
140 | 140 | |
141 | - $backup_name = "backup_[domain]".(isset($data['port'])?"_".$data['port']:"")."-[time]-".($this->get_enable_mysql_backup()?"sql":"nosql"); |
|
141 | + $backup_name = "backup_[domain]".(isset($data['port']) ? "_".$data['port'] : "")."-[time]-".($this->get_enable_mysql_backup() ? "sql" : "nosql"); |
|
142 | 142 | |
143 | 143 | return $backup_name; |
144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | global $wpdb; |
149 | 149 | |
150 | - if(!$data = get_option('xcloner_mysql_hostname')) |
|
150 | + if (!$data = get_option('xcloner_mysql_hostname')) |
|
151 | 151 | $data = $wpdb->dbhost; |
152 | 152 | |
153 | 153 | return $data; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | global $wpdb; |
159 | 159 | |
160 | - if(!$data = get_option('xcloner_mysql_username')) |
|
160 | + if (!$data = get_option('xcloner_mysql_username')) |
|
161 | 161 | $data = $wpdb->dbuser; |
162 | 162 | |
163 | 163 | return $data; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | global $wpdb; |
169 | 169 | |
170 | - if(!$data = get_option('xcloner_mysql_password')) |
|
170 | + if (!$data = get_option('xcloner_mysql_password')) |
|
171 | 171 | $data = $wpdb->dbpassword; |
172 | 172 | |
173 | 173 | return $data; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | { |
178 | 178 | global $wpdb; |
179 | 179 | |
180 | - if(!$data = get_option('xcloner_mysql_database')) |
|
180 | + if (!$data = get_option('xcloner_mysql_database')) |
|
181 | 181 | $data = $wpdb->dbname; |
182 | 182 | |
183 | 183 | return $data; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | $hash = md5(get_home_url().__DIR__); |
203 | 203 | |
204 | - if($strlen) |
|
204 | + if ($strlen) |
|
205 | 205 | $hash = substr($hash, 0, $strlen); |
206 | 206 | |
207 | 207 | return $hash; |
@@ -213,20 +213,20 @@ discard block |
||
213 | 213 | $this->xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
214 | 214 | |
215 | 215 | //ADDING MISSING OPTIONS |
216 | - if( false == get_option( 'xcloner_mysql_settings_page' ) ) { |
|
217 | - add_option( 'xcloner_mysql_settings_page' ); |
|
216 | + if (false == get_option('xcloner_mysql_settings_page')) { |
|
217 | + add_option('xcloner_mysql_settings_page'); |
|
218 | 218 | } // end if |
219 | 219 | |
220 | - if( false == get_option( 'xcloner_cron_settings_page' ) ) { |
|
221 | - add_option( 'xcloner_cron_settings_page' ); |
|
220 | + if (false == get_option('xcloner_cron_settings_page')) { |
|
221 | + add_option('xcloner_cron_settings_page'); |
|
222 | 222 | } // end if |
223 | 223 | |
224 | - if( false == get_option( 'xcloner_system_settings_page' ) ) { |
|
225 | - add_option( 'xcloner_system_settings_page' ); |
|
224 | + if (false == get_option('xcloner_system_settings_page')) { |
|
225 | + add_option('xcloner_system_settings_page'); |
|
226 | 226 | } // end if |
227 | 227 | |
228 | - if( false == get_option( 'xcloner_cleanup_settings_page' ) ) { |
|
229 | - add_option( 'xcloner_cleanup_settings_page' ); |
|
228 | + if (false == get_option('xcloner_cleanup_settings_page')) { |
|
229 | + add_option('xcloner_cleanup_settings_page'); |
|
230 | 230 | } // end if |
231 | 231 | |
232 | 232 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | //SYSTEM section |
250 | 250 | add_settings_section( |
251 | 251 | 'xcloner_system_settings_group', |
252 | - __('These are advanced options recommended for developers!','xcloner-backup-and-restore'), |
|
252 | + __('These are advanced options recommended for developers!', 'xcloner-backup-and-restore'), |
|
253 | 253 | array($this, 'xcloner_settings_section_cb'), |
254 | 254 | 'xcloner_system_settings_page' |
255 | 255 | ); |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | register_setting('xcloner_general_settings_group', 'xcloner_backup_compression_level', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
278 | 278 | add_settings_field( |
279 | 279 | 'xcloner_backup_compression_level', |
280 | - __('Backup Compression Level','xcloner-backup-and-restore'), |
|
280 | + __('Backup Compression Level', 'xcloner-backup-and-restore'), |
|
281 | 281 | array($this, 'do_form_range_field'), |
282 | 282 | 'xcloner_settings_page', |
283 | 283 | 'xcloner_general_settings_group', |
284 | 284 | array('xcloner_backup_compression_level', |
285 | - __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load','xcloner-backup-and-restore'), |
|
285 | + __('Options between [0-9]. Value 0 means no compression, while 9 is maximum compression affecting cpu load', 'xcloner-backup-and-restore'), |
|
286 | 286 | 0, |
287 | 287 | 9 |
288 | 288 | ) |
@@ -291,12 +291,12 @@ discard block |
||
291 | 291 | register_setting('xcloner_general_settings_group', 'xcloner_start_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
292 | 292 | add_settings_field( |
293 | 293 | 'xcloner_start_path', |
294 | - __('Backup Start Location','xcloner-backup-and-restore'), |
|
294 | + __('Backup Start Location', 'xcloner-backup-and-restore'), |
|
295 | 295 | array($this, 'do_form_text_field'), |
296 | 296 | 'xcloner_settings_page', |
297 | 297 | 'xcloner_general_settings_group', |
298 | 298 | array('xcloner_start_path', |
299 | - __('Base path location from where XCloner can start the Backup.','xcloner-backup-and-restore'), |
|
299 | + __('Base path location from where XCloner can start the Backup.', 'xcloner-backup-and-restore'), |
|
300 | 300 | $this->get_xcloner_start_path(), |
301 | 301 | //'disabled' |
302 | 302 | ) |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | register_setting('xcloner_general_settings_group', 'xcloner_store_path', array($this->xcloner_sanitization, "sanitize_input_as_absolute_path")); |
306 | 306 | add_settings_field( |
307 | 307 | 'xcloner_store_path', |
308 | - __('Backup Storage Location','xcloner-backup-and-restore'), |
|
308 | + __('Backup Storage Location', 'xcloner-backup-and-restore'), |
|
309 | 309 | array($this, 'do_form_text_field'), |
310 | 310 | 'xcloner_settings_page', |
311 | 311 | 'xcloner_general_settings_group', |
312 | 312 | array('xcloner_store_path', |
313 | - __('Location where XCloner will store the Backup archives.','xcloner-backup-and-restore'), |
|
313 | + __('Location where XCloner will store the Backup archives.', 'xcloner-backup-and-restore'), |
|
314 | 314 | $this->get_xcloner_store_path(), |
315 | 315 | //'disabled' |
316 | 316 | ) |
@@ -319,24 +319,24 @@ discard block |
||
319 | 319 | register_setting('xcloner_general_settings_group', 'xcloner_enable_log', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
320 | 320 | add_settings_field( |
321 | 321 | 'xcloner_enable_log', |
322 | - __('Enable XCloner Backup Log','xcloner-backup-and-restore'), |
|
322 | + __('Enable XCloner Backup Log', 'xcloner-backup-and-restore'), |
|
323 | 323 | array($this, 'do_form_switch_field'), |
324 | 324 | 'xcloner_settings_page', |
325 | 325 | 'xcloner_general_settings_group', |
326 | 326 | array('xcloner_enable_log', |
327 | - 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()) |
|
327 | + 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()) |
|
328 | 328 | ) |
329 | 329 | ); |
330 | 330 | |
331 | 331 | register_setting('xcloner_general_settings_group', 'xcloner_regex_exclude', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
332 | 332 | add_settings_field( |
333 | 333 | 'xcloner_regex_exclude', |
334 | - __('Regex Exclude Files','xcloner-backup-and-restore'), |
|
334 | + __('Regex Exclude Files', 'xcloner-backup-and-restore'), |
|
335 | 335 | array($this, 'do_form_textarea_field'), |
336 | 336 | 'xcloner_settings_page', |
337 | 337 | 'xcloner_general_settings_group', |
338 | 338 | array('xcloner_regex_exclude', |
339 | - __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line','xcloner-backup-and-restore'), |
|
339 | + __('Regular expression match to exclude files and folders, example patterns provided below, one pattern per line', 'xcloner-backup-and-restore'), |
|
340 | 340 | //$this->get_xcloner_store_path(), |
341 | 341 | //'disabled' |
342 | 342 | ) |
@@ -346,36 +346,36 @@ discard block |
||
346 | 346 | register_setting('xcloner_mysql_settings_group', 'xcloner_enable_mysql_backup', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
347 | 347 | add_settings_field( |
348 | 348 | 'xcloner_enable_mysql_backup', |
349 | - __('Enable Mysql Backup','xcloner-backup-and-restore'), |
|
349 | + __('Enable Mysql Backup', 'xcloner-backup-and-restore'), |
|
350 | 350 | array($this, 'do_form_switch_field'), |
351 | 351 | 'xcloner_mysql_settings_page', |
352 | 352 | 'xcloner_mysql_settings_group', |
353 | 353 | array('xcloner_enable_mysql_backup', |
354 | - __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.','xcloner-backup-and-restore') |
|
354 | + __('Enable Mysql Backup Option. If you don\'t want to backup the database, you can disable this.', 'xcloner-backup-and-restore') |
|
355 | 355 | ) |
356 | 356 | ); |
357 | 357 | |
358 | 358 | register_setting('xcloner_mysql_settings_group', 'xcloner_backup_only_wp_tables'); |
359 | 359 | add_settings_field( |
360 | 360 | 'xcloner_backup_only_wp_tables', |
361 | - __('Backup only WP tables','xcloner-backup-and-restore'), |
|
361 | + __('Backup only WP tables', 'xcloner-backup-and-restore'), |
|
362 | 362 | array($this, 'do_form_switch_field'), |
363 | 363 | 'xcloner_mysql_settings_page', |
364 | 364 | 'xcloner_mysql_settings_group', |
365 | 365 | array('xcloner_backup_only_wp_tables', |
366 | - sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix','xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
366 | + sprintf(__('Enable this if you only want to Backup only tables starting with \'%s\' prefix', 'xcloner-backup-and-restore'), $this->get_table_prefix()) |
|
367 | 367 | ) |
368 | 368 | ); |
369 | 369 | |
370 | 370 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_hostname', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
371 | 371 | add_settings_field( |
372 | 372 | 'xcloner_mysql_hostname', |
373 | - __('Mysql Hostname','xcloner-backup-and-restore'), |
|
373 | + __('Mysql Hostname', 'xcloner-backup-and-restore'), |
|
374 | 374 | array($this, 'do_form_text_field'), |
375 | 375 | 'xcloner_mysql_settings_page', |
376 | 376 | 'xcloner_mysql_settings_group', |
377 | 377 | array('xcloner_mysql_hostname', |
378 | - __('Wordpress mysql hostname','xcloner-backup-and-restore'), |
|
378 | + __('Wordpress mysql hostname', 'xcloner-backup-and-restore'), |
|
379 | 379 | $this->get_db_hostname(), |
380 | 380 | 'disabled' |
381 | 381 | ) |
@@ -384,12 +384,12 @@ discard block |
||
384 | 384 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_username', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
385 | 385 | add_settings_field( |
386 | 386 | 'xcloner_mysql_username', |
387 | - __('Mysql Username','xcloner-backup-and-restore'), |
|
387 | + __('Mysql Username', 'xcloner-backup-and-restore'), |
|
388 | 388 | array($this, 'do_form_text_field'), |
389 | 389 | 'xcloner_mysql_settings_page', |
390 | 390 | 'xcloner_mysql_settings_group', |
391 | 391 | array('xcloner_mysql_username', |
392 | - __('Wordpress mysql username','xcloner-backup-and-restore'), |
|
392 | + __('Wordpress mysql username', 'xcloner-backup-and-restore'), |
|
393 | 393 | $this->get_db_username(), |
394 | 394 | 'disabled' |
395 | 395 | ) |
@@ -398,12 +398,12 @@ discard block |
||
398 | 398 | register_setting('xcloner_mysql_settings_group', 'xcloner_mysql_database', array($this->xcloner_sanitization, "sanitize_input_as_raw")); |
399 | 399 | add_settings_field( |
400 | 400 | 'xcloner_mysql_database', |
401 | - __('Mysql Database','xcloner-backup-and-restore'), |
|
401 | + __('Mysql Database', 'xcloner-backup-and-restore'), |
|
402 | 402 | array($this, 'do_form_text_field'), |
403 | 403 | 'xcloner_mysql_settings_page', |
404 | 404 | 'xcloner_mysql_settings_group', |
405 | 405 | array('xcloner_mysql_database', |
406 | - __('Wordpress mysql database','xcloner-backup-and-restore'), |
|
406 | + __('Wordpress mysql database', 'xcloner-backup-and-restore'), |
|
407 | 407 | $this->get_db_database(), |
408 | 408 | 'disabled' |
409 | 409 | ) |
@@ -413,12 +413,12 @@ discard block |
||
413 | 413 | register_setting('xcloner_system_settings_group', 'xcloner_size_limit_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
414 | 414 | add_settings_field( |
415 | 415 | 'xcloner_size_limit_per_request', |
416 | - __('Data Size Limit Per Request','xcloner-backup-and-restore'), |
|
416 | + __('Data Size Limit Per Request', 'xcloner-backup-and-restore'), |
|
417 | 417 | array($this, 'do_form_range_field'), |
418 | 418 | 'xcloner_system_settings_page', |
419 | 419 | 'xcloner_system_settings_group', |
420 | 420 | array('xcloner_size_limit_per_request', |
421 | - __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB','xcloner-backup-and-restore'), |
|
421 | + __('Use this option to set how much file data can XCloner backup in one AJAX request. Range 0-1024 MB', 'xcloner-backup-and-restore'), |
|
422 | 422 | 0, |
423 | 423 | 1024 |
424 | 424 | ) |
@@ -427,12 +427,12 @@ discard block |
||
427 | 427 | register_setting('xcloner_system_settings_group', 'xcloner_files_to_process_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
428 | 428 | add_settings_field( |
429 | 429 | 'xcloner_files_to_process_per_request', |
430 | - __('Files To Process Per Request','xcloner-backup-and-restore'), |
|
430 | + __('Files To Process Per Request', 'xcloner-backup-and-restore'), |
|
431 | 431 | array($this, 'do_form_range_field'), |
432 | 432 | 'xcloner_system_settings_page', |
433 | 433 | 'xcloner_system_settings_group', |
434 | 434 | array('xcloner_files_to_process_per_request', |
435 | - __('Use this option to set how many files XCloner should process at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
435 | + __('Use this option to set how many files XCloner should process at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
436 | 436 | 0, |
437 | 437 | 1000 |
438 | 438 | ) |
@@ -441,12 +441,12 @@ discard block |
||
441 | 441 | register_setting('xcloner_system_settings_group', 'xcloner_directories_to_scan_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
442 | 442 | add_settings_field( |
443 | 443 | 'xcloner_directories_to_scan_per_request', |
444 | - __('Directories To Scan Per Request','xcloner-backup-and-restore'), |
|
444 | + __('Directories To Scan Per Request', 'xcloner-backup-and-restore'), |
|
445 | 445 | array($this, 'do_form_range_field'), |
446 | 446 | 'xcloner_system_settings_page', |
447 | 447 | 'xcloner_system_settings_group', |
448 | 448 | array('xcloner_directories_to_scan_per_request', |
449 | - __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call','xcloner-backup-and-restore'), |
|
449 | + __('Use this option to set how many directories XCloner should scan at one time before doing another AJAX call', 'xcloner-backup-and-restore'), |
|
450 | 450 | 0, |
451 | 451 | 1000 |
452 | 452 | ) |
@@ -455,12 +455,12 @@ discard block |
||
455 | 455 | register_setting('xcloner_system_settings_group', 'xcloner_database_records_per_request', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
456 | 456 | add_settings_field( |
457 | 457 | 'xcloner_database_records_per_request', |
458 | - __('Database Records Per Request','xcloner-backup-and-restore'), |
|
458 | + __('Database Records Per Request', 'xcloner-backup-and-restore'), |
|
459 | 459 | array($this, 'do_form_range_field'), |
460 | 460 | 'xcloner_system_settings_page', |
461 | 461 | 'xcloner_system_settings_group', |
462 | 462 | array('xcloner_database_records_per_request', |
463 | - __('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'), |
|
463 | + __('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'), |
|
464 | 464 | 0, |
465 | 465 | 100000 |
466 | 466 | ) |
@@ -481,36 +481,36 @@ discard block |
||
481 | 481 | register_setting('xcloner_system_settings_group', 'xcloner_exclude_files_larger_than_mb', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
482 | 482 | add_settings_field( |
483 | 483 | 'xcloner_exclude_files_larger_than_mb', |
484 | - __('Exclude files larger than (MB)','xcloner-backup-and-restore'), |
|
484 | + __('Exclude files larger than (MB)', 'xcloner-backup-and-restore'), |
|
485 | 485 | array($this, 'do_form_number_field'), |
486 | 486 | 'xcloner_system_settings_page', |
487 | 487 | 'xcloner_system_settings_group', |
488 | 488 | array('xcloner_exclude_files_larger_than_mb', |
489 | - __('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'), |
|
489 | + __('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'), |
|
490 | 490 | ) |
491 | 491 | ); |
492 | 492 | |
493 | 493 | register_setting('xcloner_system_settings_group', 'xcloner_split_backup_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
494 | 494 | add_settings_field( |
495 | 495 | 'xcloner_split_backup_limit', |
496 | - __('Split Backup Archive Limit (MB)','xcloner-backup-and-restore'), |
|
496 | + __('Split Backup Archive Limit (MB)', 'xcloner-backup-and-restore'), |
|
497 | 497 | array($this, 'do_form_number_field'), |
498 | 498 | 'xcloner_system_settings_page', |
499 | 499 | 'xcloner_system_settings_group', |
500 | 500 | array('xcloner_split_backup_limit', |
501 | - __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB','xcloner-backup-and-restore'), |
|
501 | + __('Use this option to automatically split the backup archive into smaller parts. Range 0-10000 MB', 'xcloner-backup-and-restore'), |
|
502 | 502 | ) |
503 | 503 | ); |
504 | 504 | |
505 | 505 | register_setting('xcloner_system_settings_group', 'xcloner_force_tmp_path_site_root'); |
506 | 506 | add_settings_field( |
507 | 507 | 'xcloner_force_tmp_path_site_root', |
508 | - __('Force Temporary Path Within XCloner Storage','xcloner-backup-and-restore'), |
|
508 | + __('Force Temporary Path Within XCloner Storage', 'xcloner-backup-and-restore'), |
|
509 | 509 | array($this, 'do_form_switch_field'), |
510 | 510 | 'xcloner_system_settings_page', |
511 | 511 | 'xcloner_system_settings_group', |
512 | 512 | array('xcloner_force_tmp_path_site_root', |
513 | - 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()) |
|
513 | + 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()) |
|
514 | 514 | ) |
515 | 515 | ); |
516 | 516 | |
@@ -518,36 +518,36 @@ discard block |
||
518 | 518 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_days', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
519 | 519 | add_settings_field( |
520 | 520 | 'xcloner_cleanup_retention_limit_days', |
521 | - __('Cleanup by Date(days)','xcloner-backup-and-restore'), |
|
521 | + __('Cleanup by Date(days)', 'xcloner-backup-and-restore'), |
|
522 | 522 | array($this, 'do_form_number_field'), |
523 | 523 | 'xcloner_cleanup_settings_page', |
524 | 524 | 'xcloner_cleanup_settings_group', |
525 | 525 | array('xcloner_cleanup_retention_limit_days', |
526 | - __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option','xcloner-backup-and-restore') |
|
526 | + __('Specify the maximum number of days a backup archive can be kept on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
527 | 527 | ) |
528 | 528 | ); |
529 | 529 | |
530 | 530 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_retention_limit_archives', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
531 | 531 | add_settings_field( |
532 | 532 | 'xcloner_cleanup_retention_limit_archives', |
533 | - __('Cleanup by Quantity','xcloner-backup-and-restore'), |
|
533 | + __('Cleanup by Quantity', 'xcloner-backup-and-restore'), |
|
534 | 534 | array($this, 'do_form_number_field'), |
535 | 535 | 'xcloner_cleanup_settings_page', |
536 | 536 | 'xcloner_cleanup_settings_group', |
537 | 537 | array('xcloner_cleanup_retention_limit_archives', |
538 | - __('Specify the maximum number of backup archives to keep on the server. 0 disables this option','xcloner-backup-and-restore') |
|
538 | + __('Specify the maximum number of backup archives to keep on the server. 0 disables this option', 'xcloner-backup-and-restore') |
|
539 | 539 | ) |
540 | 540 | ); |
541 | 541 | |
542 | 542 | register_setting('xcloner_cleanup_settings_group', 'xcloner_cleanup_capacity_limit', array($this->xcloner_sanitization, "sanitize_input_as_int")); |
543 | 543 | add_settings_field( |
544 | 544 | 'xcloner_cleanup_capacity_limit', |
545 | - __('Cleanup by Capacity(MB)','xcloner-backup-and-restore'), |
|
545 | + __('Cleanup by Capacity(MB)', 'xcloner-backup-and-restore'), |
|
546 | 546 | array($this, 'do_form_number_field'), |
547 | 547 | 'xcloner_cleanup_settings_page', |
548 | 548 | 'xcloner_cleanup_settings_group', |
549 | 549 | array('xcloner_cleanup_capacity_limit', |
550 | - __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option','xcloner-backup-and-restore') |
|
550 | + __('Remove oldest backups if all created backups exceed the configured limit in Megabytes. 0 disables this option', 'xcloner-backup-and-restore') |
|
551 | 551 | ) |
552 | 552 | ); |
553 | 553 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | register_setting('xcloner_cron_settings_group', 'xcloner_cron_frequency'); |
556 | 556 | add_settings_field( |
557 | 557 | 'xcloner_cron_frequency', |
558 | - __('Cron frequency','xcloner-backup-and-restore'), |
|
558 | + __('Cron frequency', 'xcloner-backup-and-restore'), |
|
559 | 559 | array($this, 'do_form_text_field'), |
560 | 560 | 'xcloner_cron_settings_page', |
561 | 561 | 'xcloner_cron_settings_group', |
@@ -581,20 +581,20 @@ discard block |
||
581 | 581 | // text field content cb |
582 | 582 | public function do_form_text_field($params) |
583 | 583 | { |
584 | - if(!isset($params['3'])) |
|
584 | + if (!isset($params['3'])) |
|
585 | 585 | $params[3] = 0; |
586 | - if(!isset($params['2'])) |
|
586 | + if (!isset($params['2'])) |
|
587 | 587 | $params[2] = 0; |
588 | 588 | |
589 | 589 | list($fieldname, $label, $value, $disabled) = $params; |
590 | 590 | |
591 | - if(!$value) |
|
591 | + if (!$value) |
|
592 | 592 | $value = get_option($fieldname); |
593 | 593 | // output the field |
594 | 594 | ?> |
595 | 595 | <div class="row"> |
596 | 596 | <div class="input-field col s10 m10 l8"> |
597 | - <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) : ''; ?>"> |
|
597 | + <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 | 598 | </div> |
599 | 599 | <div class="col s2 m2 "> |
600 | 600 | <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> |
@@ -608,20 +608,20 @@ discard block |
||
608 | 608 | // textarea field content cb |
609 | 609 | public function do_form_textarea_field($params) |
610 | 610 | { |
611 | - if(!isset($params['3'])) |
|
611 | + if (!isset($params['3'])) |
|
612 | 612 | $params[3] = 0; |
613 | - if(!isset($params['2'])) |
|
613 | + if (!isset($params['2'])) |
|
614 | 614 | $params[2] = 0; |
615 | 615 | |
616 | 616 | list($fieldname, $label, $value, $disabled) = $params; |
617 | 617 | |
618 | - if(!$value) |
|
618 | + if (!$value) |
|
619 | 619 | $value = get_option($fieldname); |
620 | 620 | // output the field |
621 | 621 | ?> |
622 | 622 | <div class="row"> |
623 | 623 | <div class="input-field col s10 m10 l8"> |
624 | - <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> |
|
624 | + <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> |
|
625 | 625 | </div> |
626 | 626 | <div class="col s2 m2 "> |
627 | 627 | <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> |
@@ -652,20 +652,20 @@ discard block |
||
652 | 652 | // number field content cb |
653 | 653 | public function do_form_number_field($params) |
654 | 654 | { |
655 | - if(!isset($params['3'])) |
|
655 | + if (!isset($params['3'])) |
|
656 | 656 | $params[3] = 0; |
657 | - if(!isset($params['2'])) |
|
657 | + if (!isset($params['2'])) |
|
658 | 658 | $params[2] = 0; |
659 | 659 | |
660 | 660 | list($fieldname, $label, $value, $disabled) = $params; |
661 | 661 | |
662 | - if(!$value) |
|
662 | + if (!$value) |
|
663 | 663 | $value = get_option($fieldname); |
664 | 664 | // output the field |
665 | 665 | ?> |
666 | 666 | <div class="row"> |
667 | 667 | <div class="input-field col s10 m5 l3"> |
668 | - <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) : ''; ?>"> |
|
668 | + <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) : ''; ?>"> |
|
669 | 669 | </div> |
670 | 670 | <div class="col s2 m2 "> |
671 | 671 | <a class="btn-floating tooltipped btn-small" data-html="true" data-position="center" data-delay="50" data-tooltip="<?php echo $label?>" data-tooltip-id=""><i class="material-icons">help_outline</i></a> |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | |
679 | 679 | public function do_form_range_field($params) |
680 | 680 | { |
681 | - if(!isset($params['4'])) |
|
681 | + if (!isset($params['4'])) |
|
682 | 682 | $params[4] = 0; |
683 | 683 | |
684 | 684 | list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | <div class="row"> |
688 | 688 | <div class="input-field col s10 m10 l8"> |
689 | 689 | <p class="range-field"> |
690 | - <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) : ''; ?>" /> |
|
690 | + <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) : ''; ?>" /> |
|
691 | 691 | </p> |
692 | 692 | </div> |
693 | 693 | <div class="col s2 m2 "> |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | |
701 | 701 | public function do_form_switch_field($params) |
702 | 702 | { |
703 | - if(!isset($params['2'])) |
|
703 | + if (!isset($params['2'])) |
|
704 | 704 | $params[2] = 0; |
705 | 705 | list($fieldname, $label, $disabled) = $params; |
706 | 706 | $value = get_option($fieldname); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | <div class="switch"> |
711 | 711 | <label> |
712 | 712 | Off |
713 | - <input <?php echo ($disabled)?"disabled":""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
713 | + <input <?php echo ($disabled) ? "disabled" : ""?> type="checkbox" name="<?php echo $fieldname?>" id="<?php echo $fieldname?>" value="1" <?php echo ($value) ? 'checked="checked"' : ''; ?>"> |
|
714 | 714 | <span class="lever"></span> |
715 | 715 | On |
716 | 716 | </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 | } |
@@ -87,8 +91,9 @@ discard block |
||
87 | 91 | |
88 | 92 | public function get_enable_mysql_backup() |
89 | 93 | { |
90 | - if(get_option('xcloner_enable_mysql_backup')) |
|
91 | - return true; |
|
94 | + if(get_option('xcloner_enable_mysql_backup')) { |
|
95 | + return true; |
|
96 | + } |
|
92 | 97 | |
93 | 98 | return false; |
94 | 99 | } |
@@ -97,10 +102,11 @@ discard block |
||
97 | 102 | { |
98 | 103 | if(!$ext) |
99 | 104 | { |
100 | - if(get_option('xcloner_backup_compression_level')) |
|
101 | - $ext = ".tgz"; |
|
102 | - else |
|
103 | - $ext = ".tar"; |
|
105 | + if(get_option('xcloner_backup_compression_level')) { |
|
106 | + $ext = ".tgz"; |
|
107 | + } else { |
|
108 | + $ext = ".tar"; |
|
109 | + } |
|
104 | 110 | } |
105 | 111 | return ($this->get_hash()).$ext; |
106 | 112 | } |
@@ -126,8 +132,9 @@ discard block |
||
126 | 132 | |
127 | 133 | public function set_hash($hash = "") |
128 | 134 | { |
129 | - if(substr($hash, 0, 1) != "-" and strlen($hash)) |
|
130 | - $hash = "-".$hash; |
|
135 | + if(substr($hash, 0, 1) != "-" and strlen($hash)) { |
|
136 | + $hash = "-".$hash; |
|
137 | + } |
|
131 | 138 | |
132 | 139 | $this->hash = substr( $hash, 0, 6); |
133 | 140 | |
@@ -147,8 +154,9 @@ discard block |
||
147 | 154 | { |
148 | 155 | global $wpdb; |
149 | 156 | |
150 | - if(!$data = get_option('xcloner_mysql_hostname')) |
|
151 | - $data = $wpdb->dbhost; |
|
157 | + if(!$data = get_option('xcloner_mysql_hostname')) { |
|
158 | + $data = $wpdb->dbhost; |
|
159 | + } |
|
152 | 160 | |
153 | 161 | return $data; |
154 | 162 | } |
@@ -157,8 +165,9 @@ discard block |
||
157 | 165 | { |
158 | 166 | global $wpdb; |
159 | 167 | |
160 | - if(!$data = get_option('xcloner_mysql_username')) |
|
161 | - $data = $wpdb->dbuser; |
|
168 | + if(!$data = get_option('xcloner_mysql_username')) { |
|
169 | + $data = $wpdb->dbuser; |
|
170 | + } |
|
162 | 171 | |
163 | 172 | return $data; |
164 | 173 | } |
@@ -167,8 +176,9 @@ discard block |
||
167 | 176 | { |
168 | 177 | global $wpdb; |
169 | 178 | |
170 | - if(!$data = get_option('xcloner_mysql_password')) |
|
171 | - $data = $wpdb->dbpassword; |
|
179 | + if(!$data = get_option('xcloner_mysql_password')) { |
|
180 | + $data = $wpdb->dbpassword; |
|
181 | + } |
|
172 | 182 | |
173 | 183 | return $data; |
174 | 184 | } |
@@ -177,8 +187,9 @@ discard block |
||
177 | 187 | { |
178 | 188 | global $wpdb; |
179 | 189 | |
180 | - if(!$data = get_option('xcloner_mysql_database')) |
|
181 | - $data = $wpdb->dbname; |
|
190 | + if(!$data = get_option('xcloner_mysql_database')) { |
|
191 | + $data = $wpdb->dbname; |
|
192 | + } |
|
182 | 193 | |
183 | 194 | return $data; |
184 | 195 | } |
@@ -201,8 +212,9 @@ discard block |
||
201 | 212 | { |
202 | 213 | $hash = md5(get_home_url().__DIR__); |
203 | 214 | |
204 | - if($strlen) |
|
205 | - $hash = substr($hash, 0, $strlen); |
|
215 | + if($strlen) { |
|
216 | + $hash = substr($hash, 0, $strlen); |
|
217 | + } |
|
206 | 218 | |
207 | 219 | return $hash; |
208 | 220 | } |
@@ -581,15 +593,18 @@ discard block |
||
581 | 593 | // text field content cb |
582 | 594 | public function do_form_text_field($params) |
583 | 595 | { |
584 | - if(!isset($params['3'])) |
|
585 | - $params[3] = 0; |
|
586 | - if(!isset($params['2'])) |
|
587 | - $params[2] = 0; |
|
596 | + if(!isset($params['3'])) { |
|
597 | + $params[3] = 0; |
|
598 | + } |
|
599 | + if(!isset($params['2'])) { |
|
600 | + $params[2] = 0; |
|
601 | + } |
|
588 | 602 | |
589 | 603 | list($fieldname, $label, $value, $disabled) = $params; |
590 | 604 | |
591 | - if(!$value) |
|
592 | - $value = get_option($fieldname); |
|
605 | + if(!$value) { |
|
606 | + $value = get_option($fieldname); |
|
607 | + } |
|
593 | 608 | // output the field |
594 | 609 | ?> |
595 | 610 | <div class="row"> |
@@ -608,15 +623,18 @@ discard block |
||
608 | 623 | // textarea field content cb |
609 | 624 | public function do_form_textarea_field($params) |
610 | 625 | { |
611 | - if(!isset($params['3'])) |
|
612 | - $params[3] = 0; |
|
613 | - if(!isset($params['2'])) |
|
614 | - $params[2] = 0; |
|
626 | + if(!isset($params['3'])) { |
|
627 | + $params[3] = 0; |
|
628 | + } |
|
629 | + if(!isset($params['2'])) { |
|
630 | + $params[2] = 0; |
|
631 | + } |
|
615 | 632 | |
616 | 633 | list($fieldname, $label, $value, $disabled) = $params; |
617 | 634 | |
618 | - if(!$value) |
|
619 | - $value = get_option($fieldname); |
|
635 | + if(!$value) { |
|
636 | + $value = get_option($fieldname); |
|
637 | + } |
|
620 | 638 | // output the field |
621 | 639 | ?> |
622 | 640 | <div class="row"> |
@@ -652,15 +670,18 @@ discard block |
||
652 | 670 | // number field content cb |
653 | 671 | public function do_form_number_field($params) |
654 | 672 | { |
655 | - if(!isset($params['3'])) |
|
656 | - $params[3] = 0; |
|
657 | - if(!isset($params['2'])) |
|
658 | - $params[2] = 0; |
|
673 | + if(!isset($params['3'])) { |
|
674 | + $params[3] = 0; |
|
675 | + } |
|
676 | + if(!isset($params['2'])) { |
|
677 | + $params[2] = 0; |
|
678 | + } |
|
659 | 679 | |
660 | 680 | list($fieldname, $label, $value, $disabled) = $params; |
661 | 681 | |
662 | - if(!$value) |
|
663 | - $value = get_option($fieldname); |
|
682 | + if(!$value) { |
|
683 | + $value = get_option($fieldname); |
|
684 | + } |
|
664 | 685 | // output the field |
665 | 686 | ?> |
666 | 687 | <div class="row"> |
@@ -678,8 +699,9 @@ discard block |
||
678 | 699 | |
679 | 700 | public function do_form_range_field($params) |
680 | 701 | { |
681 | - if(!isset($params['4'])) |
|
682 | - $params[4] = 0; |
|
702 | + if(!isset($params['4'])) { |
|
703 | + $params[4] = 0; |
|
704 | + } |
|
683 | 705 | |
684 | 706 | list($fieldname, $label, $range_start, $range_end, $disabled) = $params; |
685 | 707 | $value = get_option($fieldname); |
@@ -700,8 +722,9 @@ discard block |
||
700 | 722 | |
701 | 723 | public function do_form_switch_field($params) |
702 | 724 | { |
703 | - if(!isset($params['2'])) |
|
704 | - $params[2] = 0; |
|
725 | + if(!isset($params['2'])) { |
|
726 | + $params[2] = 0; |
|
727 | + } |
|
705 | 728 | list($fieldname, $label, $disabled) = $params; |
706 | 729 | $value = get_option($fieldname); |
707 | 730 | ?> |
@@ -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 |
@@ -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,79 +150,79 @@ 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 or Private Key Password",'xcloner-backup-and-restore')?></label> |
|
175 | + <label for="sftp_password"><?php echo __("SFTP or Private Key Password", 'xcloner-backup-and-restore')?></label> |
|
176 | 176 | </div> |
177 | 177 | <div class=" col s12 m6"> |
178 | - <input placeholder="<?php echo __("SFTP or Private Key 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 or Private Key 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(RSA)",'xcloner-backup-and-restore')?></label> |
|
184 | + <label for="sftp_private_key"><?php echo __("SFTP Private Key(RSA)", '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 RSA 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")?></textarea> |
|
187 | + <textarea rows="5" placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key RSA 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")?></textarea> |
|
188 | 188 | </div> |
189 | 189 | </div> |
190 | 190 | |
191 | 191 | <div class="row"> |
192 | 192 | <div class="col s12 m3 label"> |
193 | - <label for="sftp_root"><?php echo __("SFTP Storage Folder",'xcloner-backup-and-restore')?></label> |
|
193 | + <label for="sftp_root"><?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore')?></label> |
|
194 | 194 | </div> |
195 | 195 | <div class=" col s12 m6"> |
196 | - <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")?>"> |
|
196 | + <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 | 197 | </div> |
198 | 198 | </div> |
199 | 199 | |
200 | 200 | <div class="row"> |
201 | 201 | <div class="col s12 m3 label"> |
202 | - <label for="sftp_timeout"><?php echo __("SFTP Timeout",'xcloner-backup-and-restore')?></label> |
|
202 | + <label for="sftp_timeout"><?php echo __("SFTP Timeout", 'xcloner-backup-and-restore')?></label> |
|
203 | 203 | </div> |
204 | 204 | <div class=" col s12 m2"> |
205 | - <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)?>"> |
|
205 | + <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 | 206 | </div> |
207 | 207 | </div> |
208 | 208 | |
209 | 209 | <div class="row"> |
210 | 210 | <div class="col s12 m3 label"> |
211 | - <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
211 | + <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
212 | 212 | </div> |
213 | 213 | <div class=" col s12 m6"> |
214 | - <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")?>"> |
|
214 | + <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 | 215 | </div> |
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div class="row"> |
219 | 219 | <div class="col s6 m4"> |
220 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
220 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
221 | 221 | <i class="material-icons right">save</i> |
222 | 222 | </button> |
223 | 223 | </div> |
224 | 224 | <div class="col s6 m4"> |
225 | - <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')?> |
|
225 | + <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 | 226 | <i class="material-icons right">import_export</i> |
227 | 227 | </button> |
228 | 228 | </div> |
@@ -234,12 +234,12 @@ discard block |
||
234 | 234 | <!-- AWS STORAGE--> |
235 | 235 | <li id="aws"> |
236 | 236 | <div class="collapsible-header"> |
237 | - <i class="material-icons">computer</i><?php echo __("AWS Storage",'xcloner-backup-and-restore')?> |
|
237 | + <i class="material-icons">computer</i><?php echo __("AWS Storage", 'xcloner-backup-and-restore')?> |
|
238 | 238 | <div class="right"> |
239 | 239 | <div class="switch"> |
240 | 240 | <label> |
241 | 241 | Off |
242 | - <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if(get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
242 | + <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if (get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
243 | 243 | <span class="lever"></span> |
244 | 244 | On |
245 | 245 | </label> |
@@ -261,35 +261,35 @@ discard block |
||
261 | 261 | |
262 | 262 | <div class="row"> |
263 | 263 | <div class="col s12 m3 label"> |
264 | - <label for="aws_key"><?php echo __("AWS Key",'xcloner-backup-and-restore')?></label> |
|
264 | + <label for="aws_key"><?php echo __("AWS Key", 'xcloner-backup-and-restore')?></label> |
|
265 | 265 | </div> |
266 | 266 | <div class=" col s12 m6"> |
267 | - <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" > |
|
267 | + <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 | 268 | </div> |
269 | 269 | </div> |
270 | 270 | |
271 | 271 | <div class="row"> |
272 | 272 | <div class="col s12 m3 label"> |
273 | - <label for="aws_secret"><?php echo __("AWS Secret",'xcloner-backup-and-restore')?></label> |
|
273 | + <label for="aws_secret"><?php echo __("AWS Secret", 'xcloner-backup-and-restore')?></label> |
|
274 | 274 | </div> |
275 | 275 | <div class=" col s12 m6"> |
276 | - <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" > |
|
276 | + <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 | 277 | </div> |
278 | 278 | </div> |
279 | 279 | |
280 | 280 | <div class="row"> |
281 | 281 | <div class="col s12 m3 label"> |
282 | - <label for="aws_region"><?php echo __("AWS Region",'xcloner-backup-and-restore')?></label> |
|
282 | + <label for="aws_region"><?php echo __("AWS Region", 'xcloner-backup-and-restore')?></label> |
|
283 | 283 | </div> |
284 | 284 | <div class=" col s12 m6"> |
285 | - <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" > |
|
285 | + <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 | 286 | <option readonly value=""><?php echo __("Please Select AWS Region")?></option> |
287 | 287 | <?php |
288 | 288 | $aws_regions = $remote_storage->get_aws_regions(); |
289 | 289 | |
290 | - foreach($aws_regions as $key=>$region){ |
|
290 | + foreach ($aws_regions as $key=>$region) { |
|
291 | 291 | ?> |
292 | - <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region')?"selected":"")?>><?php echo $region?> = <?php echo $key?></option> |
|
292 | + <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region') ? "selected" : "")?>><?php echo $region?> = <?php echo $key?></option> |
|
293 | 293 | <?php |
294 | 294 | } |
295 | 295 | ?> |
@@ -299,30 +299,30 @@ discard block |
||
299 | 299 | |
300 | 300 | <div class="row"> |
301 | 301 | <div class="col s12 m3 label"> |
302 | - <label for="aws_bucket_name"><?php echo __("AWS Bucket Name",'xcloner-backup-and-restore')?></label> |
|
302 | + <label for="aws_bucket_name"><?php echo __("AWS Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
303 | 303 | </div> |
304 | 304 | <div class=" col s12 m6"> |
305 | - <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" > |
|
305 | + <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 | 306 | </div> |
307 | 307 | </div> |
308 | 308 | |
309 | 309 | <div class="row"> |
310 | 310 | <div class="col s12 m3 label"> |
311 | - <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
311 | + <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
312 | 312 | </div> |
313 | 313 | <div class=" col s12 m6"> |
314 | - <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")?>"> |
|
314 | + <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 | 315 | </div> |
316 | 316 | </div> |
317 | 317 | |
318 | 318 | <div class="row"> |
319 | 319 | <div class="col s6 m4"> |
320 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
320 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
321 | 321 | <i class="material-icons right">save</i> |
322 | 322 | </button> |
323 | 323 | </div> |
324 | 324 | <div class="col s6 m4"> |
325 | - <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')?> |
|
325 | + <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 | 326 | <i class="material-icons right">import_export</i> |
327 | 327 | </button> |
328 | 328 | </div> |
@@ -334,12 +334,12 @@ discard block |
||
334 | 334 | <!-- DROPBOX STORAGE--> |
335 | 335 | <li id="dropbox"> |
336 | 336 | <div class="collapsible-header"> |
337 | - <i class="material-icons">computer</i><?php echo __("Dropbox Storage",'xcloner-backup-and-restore')?> |
|
337 | + <i class="material-icons">computer</i><?php echo __("Dropbox Storage", 'xcloner-backup-and-restore')?> |
|
338 | 338 | <div class="right"> |
339 | 339 | <div class="switch"> |
340 | 340 | <label> |
341 | 341 | Off |
342 | - <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if(get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
342 | + <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if (get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
343 | 343 | <span class="lever"></span> |
344 | 344 | On |
345 | 345 | </label> |
@@ -361,49 +361,49 @@ discard block |
||
361 | 361 | |
362 | 362 | <div class="row"> |
363 | 363 | <div class="col s12 m3 label"> |
364 | - <label for="dropbox_access_token"><?php echo __("Dropbox Access Token",'xcloner-backup-and-restore')?></label> |
|
364 | + <label for="dropbox_access_token"><?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore')?></label> |
|
365 | 365 | </div> |
366 | 366 | <div class=" col s12 m6"> |
367 | - <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" > |
|
367 | + <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 | 368 | </div> |
369 | 369 | </div> |
370 | 370 | |
371 | 371 | |
372 | 372 | <div class="row"> |
373 | 373 | <div class="col s12 m3 label"> |
374 | - <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret",'xcloner-backup-and-restore')?></label> |
|
374 | + <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore')?></label> |
|
375 | 375 | </div> |
376 | 376 | <div class=" col s12 m6"> |
377 | - <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" > |
|
377 | + <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 | 378 | </div> |
379 | 379 | </div> |
380 | 380 | |
381 | 381 | <div class="row"> |
382 | 382 | <div class="col s12 m3 label"> |
383 | - <label for="dropbox_prefix"><?php echo __("Dropbox Prefix",'xcloner-backup-and-restore')?></label> |
|
383 | + <label for="dropbox_prefix"><?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore')?></label> |
|
384 | 384 | </div> |
385 | 385 | <div class=" col s12 m6"> |
386 | - <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")?>"> |
|
386 | + <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 | 387 | </div> |
388 | 388 | </div> |
389 | 389 | |
390 | 390 | <div class="row"> |
391 | 391 | <div class="col s12 m3 label"> |
392 | - <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
392 | + <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
393 | 393 | </div> |
394 | 394 | <div class=" col s12 m6"> |
395 | - <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")?>"> |
|
395 | + <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 | 396 | </div> |
397 | 397 | </div> |
398 | 398 | |
399 | 399 | <div class="row"> |
400 | 400 | <div class="col s6 m4"> |
401 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
401 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
402 | 402 | <i class="material-icons right">save</i> |
403 | 403 | </button> |
404 | 404 | </div> |
405 | 405 | <div class="col s6 m4"> |
406 | - <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')?> |
|
406 | + <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 | 407 | <i class="material-icons right">import_export</i> |
408 | 408 | </button> |
409 | 409 | </div> |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | <!-- AZURE STORAGE--> |
416 | 416 | <li id="azure"> |
417 | 417 | <div class="collapsible-header"> |
418 | - <i class="material-icons">computer</i><?php echo __("Azure Blog Storage",'xcloner-backup-and-restore')?> |
|
418 | + <i class="material-icons">computer</i><?php echo __("Azure Blog Storage", 'xcloner-backup-and-restore')?> |
|
419 | 419 | <div class="right"> |
420 | 420 | <div class="switch"> |
421 | 421 | <label> |
422 | 422 | Off |
423 | - <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if(get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
423 | + <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if (get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
424 | 424 | <span class="lever"></span> |
425 | 425 | On |
426 | 426 | </label> |
@@ -435,56 +435,56 @@ discard block |
||
435 | 435 | </div> |
436 | 436 | <div class=" col s12 m6"> |
437 | 437 | <p> |
438 | - <?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>')?> |
|
438 | + <?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 | 439 | </p> |
440 | 440 | </div> |
441 | 441 | </div> |
442 | 442 | |
443 | 443 | <div class="row"> |
444 | 444 | <div class="col s12 m3 label"> |
445 | - <label for="azure_account_name"><?php echo __("Azure Account Name",'xcloner-backup-and-restore')?></label> |
|
445 | + <label for="azure_account_name"><?php echo __("Azure Account Name", 'xcloner-backup-and-restore')?></label> |
|
446 | 446 | </div> |
447 | 447 | <div class=" col s12 m6"> |
448 | - <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" > |
|
448 | + <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 | 449 | </div> |
450 | 450 | </div> |
451 | 451 | |
452 | 452 | |
453 | 453 | <div class="row"> |
454 | 454 | <div class="col s12 m3 label"> |
455 | - <label for="azure_api_key"><?php echo __("Azure Api Key",'xcloner-backup-and-restore')?></label> |
|
455 | + <label for="azure_api_key"><?php echo __("Azure Api Key", 'xcloner-backup-and-restore')?></label> |
|
456 | 456 | </div> |
457 | 457 | <div class=" col s12 m6"> |
458 | - <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" > |
|
458 | + <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 | 459 | </div> |
460 | 460 | </div> |
461 | 461 | |
462 | 462 | <div class="row"> |
463 | 463 | <div class="col s12 m3 label"> |
464 | - <label for="azure_container"><?php echo __("Azure Container",'xcloner-backup-and-restore')?></label> |
|
464 | + <label for="azure_container"><?php echo __("Azure Container", 'xcloner-backup-and-restore')?></label> |
|
465 | 465 | </div> |
466 | 466 | <div class=" col s12 m6"> |
467 | - <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")?>"> |
|
467 | + <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 | 468 | </div> |
469 | 469 | </div> |
470 | 470 | |
471 | 471 | <div class="row"> |
472 | 472 | <div class="col s12 m3 label"> |
473 | - <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
473 | + <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
474 | 474 | </div> |
475 | 475 | <div class=" col s12 m6"> |
476 | - <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")?>"> |
|
476 | + <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 | 477 | </div> |
478 | 478 | </div> |
479 | 479 | |
480 | 480 | <div class="row"> |
481 | 481 | <div class="col s6 m4"> |
482 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
482 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
483 | 483 | <i class="material-icons right">save</i> |
484 | 484 | </button> |
485 | 485 | </div> |
486 | 486 | <div class="col s6 m4"> |
487 | - <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')?> |
|
487 | + <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 | 488 | <i class="material-icons right">import_export</i> |
489 | 489 | </button> |
490 | 490 | </div> |
@@ -496,12 +496,12 @@ discard block |
||
496 | 496 | <!-- BACKBLAZE STORAGE--> |
497 | 497 | <li id="backblaze"> |
498 | 498 | <div class="collapsible-header"> |
499 | - <i class="material-icons">computer</i><?php echo __("BackBlaze Storage",'xcloner-backup-and-restore')?> |
|
499 | + <i class="material-icons">computer</i><?php echo __("BackBlaze Storage", 'xcloner-backup-and-restore')?> |
|
500 | 500 | <div class="right"> |
501 | 501 | <div class="switch"> |
502 | 502 | <label> |
503 | 503 | Off |
504 | - <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if(get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
504 | + <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if (get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
505 | 505 | <span class="lever"></span> |
506 | 506 | On |
507 | 507 | </label> |
@@ -516,56 +516,56 @@ discard block |
||
516 | 516 | </div> |
517 | 517 | <div class=" col s12 m6"> |
518 | 518 | <p> |
519 | - <?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>')?> |
|
519 | + <?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 | 520 | </p> |
521 | 521 | </div> |
522 | 522 | </div> |
523 | 523 | |
524 | 524 | <div class="row"> |
525 | 525 | <div class="col s12 m3 label"> |
526 | - <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id",'xcloner-backup-and-restore')?></label> |
|
526 | + <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id", 'xcloner-backup-and-restore')?></label> |
|
527 | 527 | </div> |
528 | 528 | <div class=" col s12 m6"> |
529 | - <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" > |
|
529 | + <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 | 530 | </div> |
531 | 531 | </div> |
532 | 532 | |
533 | 533 | |
534 | 534 | <div class="row"> |
535 | 535 | <div class="col s12 m3 label"> |
536 | - <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key",'xcloner-backup-and-restore')?></label> |
|
536 | + <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key", 'xcloner-backup-and-restore')?></label> |
|
537 | 537 | </div> |
538 | 538 | <div class=" col s12 m6"> |
539 | - <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" > |
|
539 | + <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 | 540 | </div> |
541 | 541 | </div> |
542 | 542 | |
543 | 543 | <div class="row"> |
544 | 544 | <div class="col s12 m3 label"> |
545 | - <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name",'xcloner-backup-and-restore')?></label> |
|
545 | + <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
546 | 546 | </div> |
547 | 547 | <div class=" col s12 m6"> |
548 | - <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" > |
|
548 | + <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 | 549 | </div> |
550 | 550 | </div> |
551 | 551 | |
552 | 552 | <div class="row"> |
553 | 553 | <div class="col s12 m3 label"> |
554 | - <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
554 | + <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
555 | 555 | </div> |
556 | 556 | <div class=" col s12 m6"> |
557 | - <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")?>"> |
|
557 | + <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 | 558 | </div> |
559 | 559 | </div> |
560 | 560 | |
561 | 561 | <div class="row"> |
562 | 562 | <div class="col s6 m4"> |
563 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
563 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
564 | 564 | <i class="material-icons right">save</i> |
565 | 565 | </button> |
566 | 566 | </div> |
567 | 567 | <div class="col s6 m4"> |
568 | - <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')?> |
|
568 | + <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 | 569 | <i class="material-icons right">import_export</i> |
570 | 570 | </button> |
571 | 571 | </div> |
@@ -577,12 +577,12 @@ discard block |
||
577 | 577 | <!-- WEBDAV STORAGE--> |
578 | 578 | <li id="webdav"> |
579 | 579 | <div class="collapsible-header"> |
580 | - <i class="material-icons">computer</i><?php echo __("WebDAV Storage",'xcloner-backup-and-restore')?> |
|
580 | + <i class="material-icons">computer</i><?php echo __("WebDAV Storage", 'xcloner-backup-and-restore')?> |
|
581 | 581 | <div class="right"> |
582 | 582 | <div class="switch"> |
583 | 583 | <label> |
584 | 584 | Off |
585 | - <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if(get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
585 | + <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if (get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
586 | 586 | <span class="lever"></span> |
587 | 587 | On |
588 | 588 | </label> |
@@ -604,57 +604,57 @@ discard block |
||
604 | 604 | |
605 | 605 | <div class="row"> |
606 | 606 | <div class="col s12 m3 label"> |
607 | - <label for="webdav_url"><?php echo __("WebDAV Base Url",'xcloner-backup-and-restore')?></label> |
|
607 | + <label for="webdav_url"><?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore')?></label> |
|
608 | 608 | </div> |
609 | 609 | <div class=" col s12 m6"> |
610 | - <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" > |
|
610 | + <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 | 611 | </div> |
612 | 612 | </div> |
613 | 613 | |
614 | 614 | <div class="row"> |
615 | 615 | <div class="col s12 m3 label"> |
616 | - <label for="webdav_username"><?php echo __("WebDAV Username",'xcloner-backup-and-restore')?></label> |
|
616 | + <label for="webdav_username"><?php echo __("WebDAV Username", 'xcloner-backup-and-restore')?></label> |
|
617 | 617 | </div> |
618 | 618 | <div class=" col s12 m6"> |
619 | - <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" > |
|
619 | + <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 | 620 | </div> |
621 | 621 | </div> |
622 | 622 | |
623 | 623 | <div class="row"> |
624 | 624 | <div class="col s12 m3 label"> |
625 | - <label for="webdav_password"><?php echo __("WebDAV Password",'xcloner-backup-and-restore')?></label> |
|
625 | + <label for="webdav_password"><?php echo __("WebDAV Password", 'xcloner-backup-and-restore')?></label> |
|
626 | 626 | </div> |
627 | 627 | <div class=" col s12 m6"> |
628 | - <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" > |
|
628 | + <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 | 629 | </div> |
630 | 630 | </div> |
631 | 631 | |
632 | 632 | <div class="row"> |
633 | 633 | <div class="col s12 m3 label"> |
634 | - <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder",'xcloner-backup-and-restore')?></label> |
|
634 | + <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore')?></label> |
|
635 | 635 | </div> |
636 | 636 | <div class=" col s12 m6"> |
637 | - <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" > |
|
637 | + <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 | 638 | </div> |
639 | 639 | </div> |
640 | 640 | |
641 | 641 | <div class="row"> |
642 | 642 | <div class="col s12 m3 label"> |
643 | - <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
643 | + <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
644 | 644 | </div> |
645 | 645 | <div class=" col s12 m6"> |
646 | - <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")?>"> |
|
646 | + <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 | 647 | </div> |
648 | 648 | </div> |
649 | 649 | |
650 | 650 | <div class="row"> |
651 | 651 | <div class="col s6 m4"> |
652 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
652 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
653 | 653 | <i class="material-icons right">save</i> |
654 | 654 | </button> |
655 | 655 | </div> |
656 | 656 | <div class="col s6 m4"> |
657 | - <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')?> |
|
657 | + <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 | 658 | <i class="material-icons right">import_export</i> |
659 | 659 | </button> |
660 | 660 | </div> |
@@ -666,13 +666,13 @@ discard block |
||
666 | 666 | <!-- Google DRIVE STORAGE--> |
667 | 667 | <li id="gdrive"> |
668 | 668 | <div class="collapsible-header"> |
669 | - <i class="material-icons">computer</i><?php echo __("Google Drive Storage",'xcloner-backup-and-restore')?> |
|
670 | - <?php if($gdrive_construct):?> |
|
669 | + <i class="material-icons">computer</i><?php echo __("Google Drive Storage", 'xcloner-backup-and-restore')?> |
|
670 | + <?php if ($gdrive_construct):?> |
|
671 | 671 | <div class="right"> |
672 | 672 | <div class="switch"> |
673 | 673 | <label> |
674 | 674 | Off |
675 | - <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if(get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
675 | + <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if (get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
676 | 676 | <span class="lever"></span> |
677 | 677 | On |
678 | 678 | </label> |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | </div> |
683 | 683 | <div class="collapsible-body"> |
684 | 684 | |
685 | - <?php if($gdrive_construct) : ?> |
|
685 | + <?php if ($gdrive_construct) : ?> |
|
686 | 686 | |
687 | 687 | <div class="row"> |
688 | 688 | <div class="col s12 m3 label"> |
@@ -690,28 +690,28 @@ discard block |
||
690 | 690 | </div> |
691 | 691 | <div class=" col s12 m9"> |
692 | 692 | <p> |
693 | - <?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>')?> |
|
693 | + <?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 | 694 | <a href="https://youtu.be/YXUVPUVgG8k" target="_blank" class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" |
695 | - 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> |
|
695 | + 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 | 696 | </p> |
697 | 697 | </div> |
698 | 698 | </div> |
699 | 699 | |
700 | 700 | <div class="row"> |
701 | 701 | <div class="col s12 m3 label"> |
702 | - <label for="gdrive_client_id"><?php echo __("Client ID",'xcloner-backup-and-restore')?></label> |
|
702 | + <label for="gdrive_client_id"><?php echo __("Client ID", 'xcloner-backup-and-restore')?></label> |
|
703 | 703 | </div> |
704 | 704 | <div class=" col s12 m6"> |
705 | - <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")?>"> |
|
705 | + <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 | 706 | </div> |
707 | 707 | </div> |
708 | 708 | |
709 | 709 | <div class="row"> |
710 | 710 | <div class="col s12 m3 label"> |
711 | - <label for="gdrive_client_secret"><?php echo __("Client Secret",'xcloner-backup-and-restore')?></label> |
|
711 | + <label for="gdrive_client_secret"><?php echo __("Client Secret", 'xcloner-backup-and-restore')?></label> |
|
712 | 712 | </div> |
713 | 713 | <div class=" col s12 m6"> |
714 | - <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")?>"> |
|
714 | + <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 | 715 | </div> |
716 | 716 | </div> |
717 | 717 | |
@@ -721,41 +721,41 @@ discard block |
||
721 | 721 | |
722 | 722 | </div> |
723 | 723 | <div class=" col s12 m6"> |
724 | - <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> |
|
725 | - <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here","xcloner-backup-and-restore")?>"> |
|
724 | + <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> |
|
725 | + <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here", "xcloner-backup-and-restore")?>"> |
|
726 | 726 | </div> |
727 | 727 | </div> |
728 | 728 | |
729 | 729 | <div class="row"> |
730 | 730 | <div class="col s12 m3 label"> |
731 | - <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path",'xcloner-backup-and-restore')?> |
|
731 | + <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path", 'xcloner-backup-and-restore')?> |
|
732 | 732 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" \ |
733 | 733 | 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 /> |
734 | 734 | 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> |
735 | 735 | </label> |
736 | 736 | </div> |
737 | 737 | <div class=" col s12 m6"> |
738 | - <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" > |
|
738 | + <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 | 739 | </div> |
740 | 740 | </div> |
741 | 741 | |
742 | 742 | <div class="row"> |
743 | 743 | <div class="col s12 m3 label"> |
744 | - <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
744 | + <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
745 | 745 | </div> |
746 | 746 | <div class=" col s12 m6"> |
747 | - <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")?>"> |
|
747 | + <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 | 748 | </div> |
749 | 749 | </div> |
750 | 750 | |
751 | 751 | <div class="row"> |
752 | 752 | <div class="col s6 m4"> |
753 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
753 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
754 | 754 | <i class="material-icons right">save</i> |
755 | 755 | </button> |
756 | 756 | </div> |
757 | 757 | <div class="col s6 m4"> |
758 | - <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')?> |
|
758 | + <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 | 759 | <i class="material-icons right">import_export</i> |
760 | 760 | </button> |
761 | 761 | </div> |
@@ -771,15 +771,15 @@ discard block |
||
771 | 771 | <h6><?php echo __("This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated.")?></h6> |
772 | 772 | <h6><?php echo __("PHP 5.5 minimum version is required.")?></h6> |
773 | 773 | <br /> |
774 | - <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"> |
|
775 | - <?php echo sprintf(__('Install Now','xcloner-backup-and-restore'))?> |
|
774 | + <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"> |
|
775 | + <?php echo sprintf(__('Install Now', 'xcloner-backup-and-restore'))?> |
|
776 | 776 | </a> |
777 | 777 | |
778 | 778 | <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"> |
779 | 779 | <!-- |
780 | 780 | <a class="btn" href="https://github.com/ovidiul/XCloner-Google-Drive/archive/master.zip"> |
781 | 781 | --> |
782 | - <?php echo sprintf(__('More Details','xcloner-backup-and-restore'))?> |
|
782 | + <?php echo sprintf(__('More Details', 'xcloner-backup-and-restore'))?> |
|
783 | 783 | </a> |
784 | 784 | </div> |
785 | 785 | </div> |
@@ -350,7 +350,7 @@ |
||
350 | 350 | |
351 | 351 | if(defined('DOING_CRON') || $_POST['hash'] == "generate_hash"){ |
352 | 352 | $this->xcloner_settings->generate_new_hash(); |
353 | - }else{ |
|
353 | + } else{ |
|
354 | 354 | $this->xcloner_settings->set_hash($_POST['hash']); |
355 | 355 | } |
356 | 356 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
308 | 308 | |
309 | 309 | //wp_localize_script( 'ajax-script', 'my_ajax_object', |
310 | - // array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); |
|
310 | + // array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); |
|
311 | 311 | |
312 | 312 | } |
313 | 313 | |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | |
342 | 342 | private function define_plugin_settings(){ |
343 | 343 | /** |
344 | - * register wporg_settings_init to the admin_init action hook |
|
345 | - */ |
|
344 | + * register wporg_settings_init to the admin_init action hook |
|
345 | + */ |
|
346 | 346 | |
347 | 347 | $this->xcloner_settings = new XCloner_Settings($this); |
348 | 348 | |
@@ -393,15 +393,15 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | function friendly_error_type($type) { |
396 | - static $levels=null; |
|
397 | - if ($levels===null) { |
|
398 | - $levels=[]; |
|
399 | - foreach (get_defined_constants() as $key=>$value) { |
|
400 | - if (strpos($key,'E_')!==0) {continue;} |
|
396 | + static $levels=null; |
|
397 | + if ($levels===null) { |
|
398 | + $levels=[]; |
|
399 | + foreach (get_defined_constants() as $key=>$value) { |
|
400 | + if (strpos($key,'E_')!==0) {continue;} |
|
401 | 401 | $levels[$value]= $key; //substr($key,2); |
402 | - } |
|
403 | - } |
|
404 | - return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
|
402 | + } |
|
403 | + } |
|
404 | + return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | private function define_ajax_hooks() |
@@ -441,19 +441,19 @@ discard block |
||
441 | 441 | add_action( 'wp_ajax_restore_backup', array($xcloner_api,'restore_backup') ); |
442 | 442 | add_action( 'admin_notices', array($this, 'xcloner_error_admin_notices' )); |
443 | 443 | |
444 | - } |
|
444 | + } |
|
445 | 445 | |
446 | 446 | } |
447 | 447 | |
448 | 448 | function add_plugin_action_links($links, $file) { |
449 | - if ($file == plugin_basename(dirname(dirname(__FILE__)) . '/xcloner.php')) |
|
449 | + if ($file == plugin_basename(dirname(dirname(__FILE__)) . '/xcloner.php')) |
|
450 | 450 | { |
451 | 451 | $links[] = '<a href="admin.php?page=xcloner_settings_page">'.__('Settings', 'xcloner-backup-and-restore').'</a>'; |
452 | 452 | $links[] = '<a href="admin.php?page=xcloner_generate_backups_page">'.__('Generate Backup', 'xcloner-backup-and-restore').'</a>'; |
453 | 453 | } |
454 | 454 | |
455 | - return $links; |
|
456 | - } |
|
455 | + return $links; |
|
456 | + } |
|
457 | 457 | |
458 | 458 | public function xcloner_error_admin_notices() { |
459 | 459 | settings_errors( 'xcloner_error_message' ); |
@@ -537,9 +537,9 @@ discard block |
||
537 | 537 | function xcloner_display() |
538 | 538 | { |
539 | 539 | // check user capabilities |
540 | - if (!current_user_can('manage_options')) { |
|
541 | - return; |
|
542 | - } |
|
540 | + if (!current_user_can('manage_options')) { |
|
541 | + return; |
|
542 | + } |
|
543 | 543 | |
544 | 544 | $page = sanitize_key($_GET['page']); |
545 | 545 |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | return $this->xcloner_file_transfer; |
149 | 149 | } |
150 | 150 | |
151 | - public function check_dependencies(){ |
|
151 | + public function check_dependencies() { |
|
152 | 152 | |
153 | 153 | $backup_storage_path = realpath(__DIR__.DS."..".DS."..".DS."..").DS."backups".DS; |
154 | 154 | |
155 | 155 | define("XCLONER_STORAGE_PATH", realpath($backup_storage_path)); |
156 | 156 | |
157 | - if(!is_dir($backup_storage_path)) |
|
157 | + if (!is_dir($backup_storage_path)) |
|
158 | 158 | { |
159 | - if(!@mkdir($backup_storage_path)) |
|
159 | + if (!@mkdir($backup_storage_path)) |
|
160 | 160 | { |
161 | 161 | $status = "error"; |
162 | 162 | $message = sprintf(__("Unable to create the Backup Storage Location Folder %s . Please fix this before starting the backup process."), $backup_storage_path); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return; |
165 | 165 | } |
166 | 166 | } |
167 | - if(!is_writable($backup_storage_path)) |
|
167 | + if (!is_writable($backup_storage_path)) |
|
168 | 168 | { |
169 | 169 | $status = "error"; |
170 | 170 | $message = sprintf(__("Unable to write to the Backup Storage Location Folder %s . Please fix this before starting the backup process."), $backup_storage_path); |
@@ -178,15 +178,15 @@ discard block |
||
178 | 178 | public function trigger_message($message, $status = "error", $message_param1 = "", $message_param2 = "", $message_param3 = "") |
179 | 179 | { |
180 | 180 | $message = sprintf(__($message), $message_param1, $message_param2, $message_param3); |
181 | - add_action( 'xcloner_admin_notices', array($this,"trigger_message_notice"), 10, 2); |
|
182 | - do_action( 'xcloner_admin_notices', $message, $status); |
|
181 | + add_action('xcloner_admin_notices', array($this, "trigger_message_notice"), 10, 2); |
|
182 | + do_action('xcloner_admin_notices', $message, $status); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | public function trigger_message_notice($message, $status = "success") |
186 | 186 | { |
187 | 187 | ?> |
188 | 188 | <div class="notice notice-<?php echo $status?> is-dismissible"> |
189 | - <p><?php _e( $message, 'xcloner-backup-and-restore' ); ?></p> |
|
189 | + <p><?php _e($message, 'xcloner-backup-and-restore'); ?></p> |
|
190 | 190 | </div> |
191 | 191 | <?php |
192 | 192 | } |
@@ -213,79 +213,79 @@ discard block |
||
213 | 213 | * The class responsible for orchestrating the actions and filters of the |
214 | 214 | * core plugin. |
215 | 215 | */ |
216 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-loader.php'; |
|
216 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-loader.php'; |
|
217 | 217 | |
218 | 218 | /** |
219 | 219 | * The class responsible for defining internationalization functionality |
220 | 220 | * of the plugin. |
221 | 221 | */ |
222 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-i18n.php'; |
|
222 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-i18n.php'; |
|
223 | 223 | |
224 | 224 | /** |
225 | 225 | * The class responsible for defining all actions that occur in the admin area. |
226 | 226 | */ |
227 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-xcloner-admin.php'; |
|
227 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-xcloner-admin.php'; |
|
228 | 228 | |
229 | 229 | /** |
230 | 230 | * The class responsible for debugging XCloner. |
231 | 231 | */ |
232 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-logger.php'; |
|
232 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-logger.php'; |
|
233 | 233 | |
234 | 234 | /** |
235 | 235 | * The class responsible for defining the admin settings area. |
236 | 236 | */ |
237 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-settings.php'; |
|
237 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-settings.php'; |
|
238 | 238 | |
239 | 239 | /** |
240 | 240 | * The class responsible for defining the Remote Storage settings area. |
241 | 241 | */ |
242 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-remote-storage.php'; |
|
242 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-remote-storage.php'; |
|
243 | 243 | |
244 | 244 | /** |
245 | 245 | * The class responsible for implementing the database backup methods. |
246 | 246 | */ |
247 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-database.php'; |
|
247 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-database.php'; |
|
248 | 248 | |
249 | 249 | /** |
250 | 250 | * The class responsible for sanitization of users input. |
251 | 251 | */ |
252 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-sanitization.php'; |
|
252 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-sanitization.php'; |
|
253 | 253 | |
254 | 254 | /** |
255 | 255 | * The class responsible for XCloner system requirements validation. |
256 | 256 | */ |
257 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-requirements.php'; |
|
257 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-requirements.php'; |
|
258 | 258 | |
259 | 259 | /** |
260 | 260 | * The class responsible for XCloner backup archive creation. |
261 | 261 | */ |
262 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-archive.php'; |
|
262 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-archive.php'; |
|
263 | 263 | |
264 | 264 | /** |
265 | 265 | * The class responsible for XCloner API requests. |
266 | 266 | */ |
267 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-api.php'; |
|
267 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-api.php'; |
|
268 | 268 | |
269 | 269 | /** |
270 | 270 | * The class responsible for the XCloner File System methods. |
271 | 271 | */ |
272 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-file-system.php'; |
|
272 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-file-system.php'; |
|
273 | 273 | |
274 | 274 | /** |
275 | 275 | * The class responsible for the XCloner File Transfer methods. |
276 | 276 | */ |
277 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-file-transfer.php'; |
|
277 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-file-transfer.php'; |
|
278 | 278 | |
279 | 279 | /** |
280 | 280 | * The class responsible for the XCloner Scheduler methods. |
281 | 281 | */ |
282 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-xcloner-scheduler.php'; |
|
282 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-xcloner-scheduler.php'; |
|
283 | 283 | |
284 | 284 | /** |
285 | 285 | * The class responsible for defining all actions that occur in the public-facing |
286 | 286 | * side of the site. |
287 | 287 | */ |
288 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-xcloner-public.php'; |
|
288 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-xcloner-public.php'; |
|
289 | 289 | |
290 | 290 | $this->loader = new Xcloner_Loader($this); |
291 | 291 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | $plugin_i18n = new Xcloner_i18n(); |
306 | 306 | |
307 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
307 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
308 | 308 | |
309 | 309 | //wp_localize_script( 'ajax-script', 'my_ajax_object', |
310 | 310 | // array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); |
@@ -320,11 +320,11 @@ discard block |
||
320 | 320 | */ |
321 | 321 | private function define_admin_hooks() { |
322 | 322 | |
323 | - $plugin_admin = new Xcloner_Admin( $this ); |
|
323 | + $plugin_admin = new Xcloner_Admin($this); |
|
324 | 324 | $this->plugin_admin = $plugin_admin; |
325 | 325 | |
326 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
327 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
326 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
327 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
328 | 328 | |
329 | 329 | } |
330 | 330 | |
@@ -333,24 +333,24 @@ discard block |
||
333 | 333 | * |
334 | 334 | * @access private |
335 | 335 | */ |
336 | - private function define_admin_menu(){ |
|
336 | + private function define_admin_menu() { |
|
337 | 337 | |
338 | 338 | add_action('admin_menu', array($this->loader, 'xcloner_backup_add_admin_menu')); |
339 | 339 | |
340 | 340 | } |
341 | 341 | |
342 | - private function define_plugin_settings(){ |
|
342 | + private function define_plugin_settings() { |
|
343 | 343 | /** |
344 | 344 | * register wporg_settings_init to the admin_init action hook |
345 | 345 | */ |
346 | 346 | |
347 | 347 | $this->xcloner_settings = new XCloner_Settings($this); |
348 | 348 | |
349 | - if(defined('DOING_CRON') || isset($_POST['hash'])){ |
|
349 | + if (defined('DOING_CRON') || isset($_POST['hash'])) { |
|
350 | 350 | |
351 | - if(defined('DOING_CRON') || $_POST['hash'] == "generate_hash"){ |
|
351 | + if (defined('DOING_CRON') || $_POST['hash'] == "generate_hash") { |
|
352 | 352 | $this->xcloner_settings->generate_new_hash(); |
353 | - }else{ |
|
353 | + } else { |
|
354 | 354 | $this->xcloner_settings->set_hash($_POST['hash']); |
355 | 355 | } |
356 | 356 | } |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | */ |
374 | 374 | private function define_public_hooks() { |
375 | 375 | |
376 | - $plugin_public = new Xcloner_Public( $this ); |
|
376 | + $plugin_public = new Xcloner_Public($this); |
|
377 | 377 | |
378 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
379 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
378 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
379 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
380 | 380 | |
381 | 381 | } |
382 | 382 | |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | $logger = new XCloner_Logger($this, "php_system"); |
386 | 386 | $error = error_get_last(); |
387 | 387 | |
388 | - if($error['type'] and $logger) |
|
388 | + if ($error['type'] and $logger) |
|
389 | 389 | { |
390 | - $logger->info($this->friendly_error_type ($error['type']).": ".var_export($error, true)); |
|
390 | + $logger->info($this->friendly_error_type($error['type']).": ".var_export($error, true)); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | } |
394 | 394 | |
395 | 395 | function friendly_error_type($type) { |
396 | - static $levels=null; |
|
397 | - if ($levels===null) { |
|
398 | - $levels=[]; |
|
396 | + static $levels = null; |
|
397 | + if ($levels === null) { |
|
398 | + $levels = []; |
|
399 | 399 | foreach (get_defined_constants() as $key=>$value) { |
400 | - if (strpos($key,'E_')!==0) {continue;} |
|
401 | - $levels[$value]= $key; //substr($key,2); |
|
400 | + if (strpos($key, 'E_') !== 0) {continue; } |
|
401 | + $levels[$value] = $key; //substr($key,2); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
@@ -406,47 +406,47 @@ discard block |
||
406 | 406 | |
407 | 407 | private function define_ajax_hooks() |
408 | 408 | { |
409 | - if(is_admin() || defined('DOING_CRON')) |
|
409 | + if (is_admin() || defined('DOING_CRON')) |
|
410 | 410 | { |
411 | - $this->xcloner_logger = new XCloner_Logger($this, "xcloner_api"); |
|
412 | - $this->xcloner_filesystem = new Xcloner_File_System($this); |
|
411 | + $this->xcloner_logger = new XCloner_Logger($this, "xcloner_api"); |
|
412 | + $this->xcloner_filesystem = new Xcloner_File_System($this); |
|
413 | 413 | |
414 | 414 | //$this->xcloner_filesystem->set_diff_timestamp_start (strtotime("-15 days")); |
415 | 415 | |
416 | - $this->archive_system = new Xcloner_Archive($this); |
|
417 | - $this->xcloner_database = new Xcloner_Database($this); |
|
418 | - $this->xcloner_scheduler = new Xcloner_Scheduler($this); |
|
419 | - $this->xcloner_remote_storage = new Xcloner_Remote_Storage($this); |
|
420 | - $this->xcloner_file_transfer = new Xcloner_File_Transfer($this); |
|
416 | + $this->archive_system = new Xcloner_Archive($this); |
|
417 | + $this->xcloner_database = new Xcloner_Database($this); |
|
418 | + $this->xcloner_scheduler = new Xcloner_Scheduler($this); |
|
419 | + $this->xcloner_remote_storage = new Xcloner_Remote_Storage($this); |
|
420 | + $this->xcloner_file_transfer = new Xcloner_File_Transfer($this); |
|
421 | 421 | |
422 | - $xcloner_api = new Xcloner_Api($this); |
|
422 | + $xcloner_api = new Xcloner_Api($this); |
|
423 | 423 | |
424 | - add_action( 'wp_ajax_get_database_tables_action', array($xcloner_api,'get_database_tables_action') ); |
|
425 | - add_action( 'wp_ajax_get_file_system_action', array($xcloner_api,'get_file_system_action') ); |
|
426 | - add_action( 'wp_ajax_scan_filesystem', array($xcloner_api,'scan_filesystem') ); |
|
427 | - add_action( 'wp_ajax_backup_database', array($xcloner_api,'backup_database') ); |
|
428 | - add_action( 'wp_ajax_backup_files' , array($xcloner_api,'backup_files') ); |
|
429 | - add_action( 'wp_ajax_save_schedule' , array($xcloner_api,'save_schedule') ); |
|
430 | - add_action( 'wp_ajax_get_schedule_by_id', array($xcloner_api,'get_schedule_by_id') ); |
|
431 | - add_action( 'wp_ajax_get_scheduler_list', array($xcloner_api,'get_scheduler_list') ); |
|
432 | - add_action( 'wp_ajax_delete_schedule_by_id' , array($xcloner_api,'delete_schedule_by_id') ); |
|
433 | - add_action( 'wp_ajax_delete_backup_by_name' , array($xcloner_api,'delete_backup_by_name') ); |
|
434 | - add_action( 'wp_ajax_download_backup_by_name', array($xcloner_api,'download_backup_by_name') ); |
|
435 | - add_action( 'wp_ajax_remote_storage_save_status', array($xcloner_api,'remote_storage_save_status') ); |
|
436 | - add_action( 'wp_ajax_upload_backup_to_remote', array($xcloner_api,'upload_backup_to_remote') ); |
|
437 | - add_action( 'wp_ajax_list_backup_files' , array($xcloner_api,'list_backup_files') ); |
|
438 | - add_action( 'wp_ajax_restore_upload_backup' , array($xcloner_api,'restore_upload_backup') ); |
|
439 | - add_action( 'wp_ajax_download_restore_script', array($xcloner_api,'download_restore_script') ); |
|
440 | - add_action( 'wp_ajax_copy_backup_remote_to_local', array($xcloner_api,'copy_backup_remote_to_local') ); |
|
441 | - add_action( 'wp_ajax_restore_backup', array($xcloner_api,'restore_backup') ); |
|
442 | - add_action( 'admin_notices', array($this, 'xcloner_error_admin_notices' )); |
|
424 | + add_action('wp_ajax_get_database_tables_action', array($xcloner_api, 'get_database_tables_action')); |
|
425 | + add_action('wp_ajax_get_file_system_action', array($xcloner_api, 'get_file_system_action')); |
|
426 | + add_action('wp_ajax_scan_filesystem', array($xcloner_api, 'scan_filesystem')); |
|
427 | + add_action('wp_ajax_backup_database', array($xcloner_api, 'backup_database')); |
|
428 | + add_action('wp_ajax_backup_files', array($xcloner_api, 'backup_files')); |
|
429 | + add_action('wp_ajax_save_schedule', array($xcloner_api, 'save_schedule')); |
|
430 | + add_action('wp_ajax_get_schedule_by_id', array($xcloner_api, 'get_schedule_by_id')); |
|
431 | + add_action('wp_ajax_get_scheduler_list', array($xcloner_api, 'get_scheduler_list')); |
|
432 | + add_action('wp_ajax_delete_schedule_by_id', array($xcloner_api, 'delete_schedule_by_id')); |
|
433 | + add_action('wp_ajax_delete_backup_by_name', array($xcloner_api, 'delete_backup_by_name')); |
|
434 | + add_action('wp_ajax_download_backup_by_name', array($xcloner_api, 'download_backup_by_name')); |
|
435 | + add_action('wp_ajax_remote_storage_save_status', array($xcloner_api, 'remote_storage_save_status')); |
|
436 | + add_action('wp_ajax_upload_backup_to_remote', array($xcloner_api, 'upload_backup_to_remote')); |
|
437 | + add_action('wp_ajax_list_backup_files', array($xcloner_api, 'list_backup_files')); |
|
438 | + add_action('wp_ajax_restore_upload_backup', array($xcloner_api, 'restore_upload_backup')); |
|
439 | + add_action('wp_ajax_download_restore_script', array($xcloner_api, 'download_restore_script')); |
|
440 | + add_action('wp_ajax_copy_backup_remote_to_local', array($xcloner_api, 'copy_backup_remote_to_local')); |
|
441 | + add_action('wp_ajax_restore_backup', array($xcloner_api, 'restore_backup')); |
|
442 | + add_action('admin_notices', array($this, 'xcloner_error_admin_notices')); |
|
443 | 443 | |
444 | 444 | } |
445 | 445 | |
446 | 446 | } |
447 | 447 | |
448 | 448 | function add_plugin_action_links($links, $file) { |
449 | - if ($file == plugin_basename(dirname(dirname(__FILE__)) . '/xcloner.php')) |
|
449 | + if ($file == plugin_basename(dirname(dirname(__FILE__)).'/xcloner.php')) |
|
450 | 450 | { |
451 | 451 | $links[] = '<a href="admin.php?page=xcloner_settings_page">'.__('Settings', 'xcloner-backup-and-restore').'</a>'; |
452 | 452 | $links[] = '<a href="admin.php?page=xcloner_generate_backups_page">'.__('Generate Backup', 'xcloner-backup-and-restore').'</a>'; |
@@ -456,13 +456,13 @@ discard block |
||
456 | 456 | } |
457 | 457 | |
458 | 458 | public function xcloner_error_admin_notices() { |
459 | - settings_errors( 'xcloner_error_message' ); |
|
459 | + settings_errors('xcloner_error_message'); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | public function define_cron_hooks() |
463 | 463 | { |
464 | 464 | //registering new schedule intervals |
465 | - add_filter( 'cron_schedules', array($this, 'add_new_intervals')); |
|
465 | + add_filter('cron_schedules', array($this, 'add_new_intervals')); |
|
466 | 466 | |
467 | 467 | |
468 | 468 | $xcloner_scheduler = $this->get_xcloner_scheduler(); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | $page = sanitize_key($_GET['page']); |
545 | 545 | |
546 | - if($page) |
|
546 | + if ($page) |
|
547 | 547 | { |
548 | 548 | $this->display($page); |
549 | 549 | } |
@@ -58,19 +58,19 @@ discard block |
||
58 | 58 | |
59 | 59 | public function xcloner_backup_add_admin_menu() |
60 | 60 | { |
61 | - if ( function_exists('add_menu_page') ) |
|
62 | - add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup'); |
|
61 | + if (function_exists('add_menu_page')) |
|
62 | + add_menu_page(__('Site Backup', 'xcloner-backup-and-restore'), __('Site Backup', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup'); |
|
63 | 63 | |
64 | - if ( function_exists('add_submenu_page') ) |
|
64 | + if (function_exists('add_submenu_page')) |
|
65 | 65 | { |
66 | 66 | |
67 | - add_submenu_page( 'xcloner_init_page', __('XCloner Dashboard','xcloner-backup-and-restore'), __('Dashboard','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display')); |
|
68 | - add_submenu_page( 'xcloner_init_page', __('XCloner Backup Settings','xcloner-backup-and-restore'), __('Settings','xcloner-backup-and-restore'), 'manage_options', 'xcloner_settings_page', array($this->xcloner_container, 'xcloner_display')); |
|
69 | - add_submenu_page( 'xcloner_init_page', __('Remote Storage Settings','xcloner-backup-and-restore'), __('Remote Storage','xcloner-backup-and-restore'), 'manage_options', 'xcloner_remote_storage_page', array($this->xcloner_container, 'xcloner_display')); |
|
70 | - add_submenu_page( 'xcloner_init_page', __('Manage Backups','xcloner-backup-and-restore'), __('Manage Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_manage_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
71 | - add_submenu_page( 'xcloner_init_page', __('Scheduled Backups','xcloner-backup-and-restore'), __('Scheduled Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_scheduled_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
72 | - add_submenu_page( 'xcloner_init_page', __('Generate Backups','xcloner-backup-and-restore'), __('Generate Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_generate_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
73 | - add_submenu_page( 'xcloner_init_page', __('Restore Backups','xcloner-backup-and-restore'), __('Restore Backups','xcloner-backup-and-restore'), 'manage_options', 'xcloner_restore_page', array($this->xcloner_container, 'xcloner_display')); |
|
67 | + add_submenu_page('xcloner_init_page', __('XCloner Dashboard', 'xcloner-backup-and-restore'), __('Dashboard', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display')); |
|
68 | + add_submenu_page('xcloner_init_page', __('XCloner Backup Settings', 'xcloner-backup-and-restore'), __('Settings', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_settings_page', array($this->xcloner_container, 'xcloner_display')); |
|
69 | + add_submenu_page('xcloner_init_page', __('Remote Storage Settings', 'xcloner-backup-and-restore'), __('Remote Storage', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_remote_storage_page', array($this->xcloner_container, 'xcloner_display')); |
|
70 | + add_submenu_page('xcloner_init_page', __('Manage Backups', 'xcloner-backup-and-restore'), __('Manage Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_manage_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
71 | + add_submenu_page('xcloner_init_page', __('Scheduled Backups', 'xcloner-backup-and-restore'), __('Scheduled Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_scheduled_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
72 | + add_submenu_page('xcloner_init_page', __('Generate Backups', 'xcloner-backup-and-restore'), __('Generate Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_generate_backups_page', array($this->xcloner_container, 'xcloner_display')); |
|
73 | + add_submenu_page('xcloner_init_page', __('Restore Backups', 'xcloner-backup-and-restore'), __('Restore Backups', 'xcloner-backup-and-restore'), 'manage_options', 'xcloner_restore_page', array($this->xcloner_container, 'xcloner_display')); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
87 | 87 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
88 | 88 | */ |
89 | - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
90 | - $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
|
89 | + public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
90 | + $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
101 | 101 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 |
102 | 102 | */ |
103 | - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
104 | - $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
|
103 | + public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
104 | + $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param int $accepted_args The number of arguments that should be passed to the $callback. |
119 | 119 | * @return array The collection of actions and filters registered with WordPress. |
120 | 120 | */ |
121 | - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
121 | + private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) { |
|
122 | 122 | |
123 | 123 | $hooks[] = array( |
124 | 124 | 'hook' => $hook, |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function run() { |
141 | 141 | |
142 | - foreach ( $this->filters as $hook ) { |
|
143 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
142 | + foreach ($this->filters as $hook) { |
|
143 | + add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
144 | 144 | } |
145 | 145 | |
146 | - foreach ( $this->actions as $hook ) { |
|
147 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
146 | + foreach ($this->actions as $hook) { |
|
147 | + add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | } |
@@ -58,8 +58,9 @@ |
||
58 | 58 | |
59 | 59 | public function xcloner_backup_add_admin_menu() |
60 | 60 | { |
61 | - if ( function_exists('add_menu_page') ) |
|
62 | - add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup'); |
|
61 | + if ( function_exists('add_menu_page') ) { |
|
62 | + add_menu_page( __('Site Backup','xcloner-backup-and-restore'), __('Site Backup','xcloner-backup-and-restore'), 'manage_options', 'xcloner_init_page', array($this->xcloner_container, 'xcloner_display'), 'dashicons-backup'); |
|
63 | + } |
|
63 | 64 | |
64 | 65 | if ( function_exists('add_submenu_page') ) |
65 | 66 | { |
@@ -4,44 +4,44 @@ discard block |
||
4 | 4 | use Monolog\Handler\StreamHandler; |
5 | 5 | use Monolog\Handler\RotatingFileHandler; |
6 | 6 | |
7 | -class Xcloner_Logger extends Logger{ |
|
7 | +class Xcloner_Logger extends Logger { |
|
8 | 8 | |
9 | - private $logger_path ; |
|
9 | + private $logger_path; |
|
10 | 10 | private $max_logger_files = 7; |
11 | 11 | private $main_logger_url; |
12 | 12 | |
13 | 13 | public function __construct(Xcloner $xcloner_container, $logger_name = "xcloner_logger") |
14 | 14 | { |
15 | - if(!$xcloner_container->get_xcloner_settings()) |
|
15 | + if (!$xcloner_container->get_xcloner_settings()) |
|
16 | 16 | { |
17 | 17 | $xcloner_settings = new Xcloner_Settings($xcloner_container); |
18 | - }else{ |
|
18 | + } else { |
|
19 | 19 | $xcloner_settings = $xcloner_container->get_xcloner_settings(); |
20 | 20 | } |
21 | 21 | |
22 | 22 | $hash = $xcloner_settings->get_hash(); |
23 | - if($hash == "-".$xcloner_settings->get_server_unique_hash(5)) |
|
23 | + if ($hash == "-".$xcloner_settings->get_server_unique_hash(5)) |
|
24 | 24 | { |
25 | 25 | $hash = ""; |
26 | 26 | } |
27 | 27 | |
28 | - $logger_path = $xcloner_settings->get_xcloner_store_path().DS.$xcloner_settings->get_logger_filename(); |
|
29 | - $logger_path_tmp = ""; |
|
28 | + $logger_path = $xcloner_settings->get_xcloner_store_path().DS.$xcloner_settings->get_logger_filename(); |
|
29 | + $logger_path_tmp = ""; |
|
30 | 30 | |
31 | - if($hash) |
|
31 | + if ($hash) |
|
32 | 32 | { |
33 | 33 | $logger_path_tmp = $xcloner_settings->get_xcloner_tmp_path().DS.$xcloner_settings->get_logger_filename(1); |
34 | 34 | } |
35 | 35 | |
36 | 36 | $this->logger_path = $logger_path; |
37 | 37 | |
38 | - if(!is_dir($xcloner_settings->get_xcloner_store_path()) or !is_writable($xcloner_settings->get_xcloner_store_path())) |
|
38 | + if (!is_dir($xcloner_settings->get_xcloner_store_path()) or !is_writable($xcloner_settings->get_xcloner_store_path())) |
|
39 | 39 | { |
40 | 40 | $logger_path = "php://stderr"; |
41 | 41 | $logger_path_tmp = ""; |
42 | 42 | } |
43 | 43 | |
44 | - if(!$xcloner_settings->get_xcloner_option('xcloner_enable_log')) |
|
44 | + if (!$xcloner_settings->get_xcloner_option('xcloner_enable_log')) |
|
45 | 45 | { |
46 | 46 | $logger_path = "php://stderr"; |
47 | 47 | $logger_path_tmp = ""; |
@@ -52,21 +52,21 @@ discard block |
||
52 | 52 | |
53 | 53 | $debug_level = Logger::INFO; |
54 | 54 | |
55 | - if(WP_DEBUG) |
|
55 | + if (WP_DEBUG) |
|
56 | 56 | { |
57 | 57 | $debug_level = Logger::DEBUG; |
58 | 58 | } |
59 | 59 | |
60 | 60 | |
61 | - if($logger_path) |
|
61 | + if ($logger_path) |
|
62 | 62 | { |
63 | 63 | $stream = new RotatingFileHandler($logger_path, $this->max_logger_files, $debug_level); |
64 | 64 | $this->pushHandler($stream); |
65 | 65 | |
66 | - $this->main_logger_url = $stream->getUrl(); |
|
66 | + $this->main_logger_url = $stream->getUrl(); |
|
67 | 67 | } |
68 | 68 | |
69 | - if($hash and $logger_path_tmp) |
|
69 | + if ($hash and $logger_path_tmp) |
|
70 | 70 | { |
71 | 71 | $this->pushHandler(new StreamHandler($logger_path_tmp, $debug_level)); |
72 | 72 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $lines = array(); |
85 | 85 | |
86 | - if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url)) |
|
86 | + if (!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url)) |
|
87 | 87 | return false; |
88 | 88 | |
89 | 89 | $fp = fopen($this->main_logger_url, 'r'); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $lastLine = ""; |
93 | 93 | |
94 | 94 | // Loop backword until we have our lines or we reach the start |
95 | - while($pos > 0 && count($lines) < $totalLines) { |
|
95 | + while ($pos > 0 && count($lines) < $totalLines) { |
|
96 | 96 | |
97 | 97 | $C = fgetc($fp); |
98 | - if($C == "\n") { |
|
98 | + if ($C == "\n") { |
|
99 | 99 | // skip empty lines |
100 | - if(trim($lastLine) != "") { |
|
100 | + if (trim($lastLine) != "") { |
|
101 | 101 | $lines[] = $lastLine; |
102 | 102 | } |
103 | 103 | $lastLine = ''; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | if(!$xcloner_container->get_xcloner_settings()) |
16 | 16 | { |
17 | 17 | $xcloner_settings = new Xcloner_Settings($xcloner_container); |
18 | - }else{ |
|
18 | + } else{ |
|
19 | 19 | $xcloner_settings = $xcloner_container->get_xcloner_settings(); |
20 | 20 | } |
21 | 21 | |
@@ -83,8 +83,9 @@ discard block |
||
83 | 83 | { |
84 | 84 | $lines = array(); |
85 | 85 | |
86 | - if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url)) |
|
87 | - return false; |
|
86 | + if(!file_exists($this->main_logger_url) or !is_readable($this->main_logger_url)) { |
|
87 | + return false; |
|
88 | + } |
|
88 | 89 | |
89 | 90 | $fp = fopen($this->main_logger_url, 'r'); |
90 | 91 | fseek($fp, -1, SEEK_END); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
4 | -$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
5 | -$xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
|
6 | -$storage_selection = ""; |
|
3 | +$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
4 | +$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
5 | +$xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
|
6 | +$storage_selection = ""; |
|
7 | 7 | |
8 | -if(isset($_GET['storage_selection']) and $_GET['storage_selection']) |
|
8 | +if (isset($_GET['storage_selection']) and $_GET['storage_selection']) |
|
9 | 9 | { |
10 | 10 | $storage_selection = $xcloner_sanitization->sanitize_input_as_string($_GET['storage_selection']); |
11 | 11 | } |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | <div class="col s12 m6 l9"> |
22 | 22 | <h1><?= esc_html(get_admin_page_title()); ?></h1> |
23 | 23 | </div> |
24 | - <?php if(sizeof($available_storages)):?> |
|
24 | + <?php if (sizeof($available_storages)):?> |
|
25 | 25 | <div class="col s12 m6 l3 remote-storage-selection"> |
26 | 26 | <select name="storage_selection" id="storage_selection" class="validate" required > |
27 | 27 | |
28 | - <?php if($storage_selection):?> |
|
28 | + <?php if ($storage_selection):?> |
|
29 | 29 | <option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option> |
30 | 30 | <?php else: ?> |
31 | 31 | <option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option> |
32 | - <?php endif;?> |
|
32 | + <?php endif; ?> |
|
33 | 33 | |
34 | - <?php foreach($available_storages as $storage=>$text):?> |
|
35 | - <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
34 | + <?php foreach ($available_storages as $storage=>$text):?> |
|
35 | + <option value="<?php echo $storage?>"<?php if ($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
36 | 36 | <?php endforeach?> |
37 | 37 | </select> |
38 | 38 | <?php endif?> |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | <label for="select_all"> </label> |
48 | 48 | </p> |
49 | 49 | </th> |
50 | - <th data-field="id"><?php echo __("Backup Name",'xcloner-backup-and-restore')?></th> |
|
51 | - <th data-field="name"><?php echo __("Created Time",'xcloner-backup-and-restore')?></th> |
|
52 | - <th data-field="name"><?php echo __("Size",'xcloner-backup-and-restore')?></th> |
|
53 | - <th class="no-sort" data-field="price"><?php echo __("Action",'xcloner-backup-and-restore')?></th> |
|
50 | + <th data-field="id"><?php echo __("Backup Name", 'xcloner-backup-and-restore')?></th> |
|
51 | + <th data-field="name"><?php echo __("Created Time", 'xcloner-backup-and-restore')?></th> |
|
52 | + <th data-field="name"><?php echo __("Size", 'xcloner-backup-and-restore')?></th> |
|
53 | + <th class="no-sort" data-field="price"><?php echo __("Action", 'xcloner-backup-and-restore')?></th> |
|
54 | 54 | |
55 | 55 | </tr> |
56 | 56 | </thead> |
@@ -60,20 +60,20 @@ discard block |
||
60 | 60 | |
61 | 61 | <?php |
62 | 62 | $i = 0; |
63 | -foreach($backup_list as $file_info):?> |
|
63 | +foreach ($backup_list as $file_info):?> |
|
64 | 64 | <?php |
65 | - if($storage_selection == "gdrive") |
|
65 | + if ($storage_selection == "gdrive") |
|
66 | 66 | $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
67 | 67 | $file_exists_on_local_storage = true; |
68 | 68 | |
69 | - if($storage_selection) |
|
69 | + if ($storage_selection) |
|
70 | 70 | { |
71 | - if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
71 | + if (!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
72 | 72 | $file_exists_on_local_storage = false; |
73 | 73 | } |
74 | 74 | |
75 | 75 | ?> |
76 | -<?php if(!isset($file_info['parent'])):?> |
|
76 | +<?php if (!isset($file_info['parent'])):?> |
|
77 | 77 | |
78 | 78 | <tr> |
79 | 79 | <td class="checkbox"> |
@@ -84,55 +84,55 @@ discard block |
||
84 | 84 | </td> |
85 | 85 | <td> |
86 | 86 | <span class=""><?php echo $file_info['path']?></span> |
87 | - <?php if(!$file_exists_on_local_storage): ?> |
|
88 | - <a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
87 | + <?php if (!$file_exists_on_local_storage): ?> |
|
88 | + <a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
89 | 89 | <?php endif?> |
90 | 90 | <?php |
91 | - if(isset($file_info['childs']) and is_array($file_info['childs'])): |
|
91 | + if (isset($file_info['childs']) and is_array($file_info['childs'])): |
|
92 | 92 | ?> |
93 | 93 | <a href="#" title="expand" class="expand-multipart add"><i class="material-icons">add</i></a> |
94 | 94 | <a href="#" title="collapse" class="expand-multipart remove"><i class="material-icons">remove</i></a> |
95 | 95 | <ul class="multipart"> |
96 | - <?php foreach($file_info['childs'] as $child):?> |
|
96 | + <?php foreach ($file_info['childs'] as $child):?> |
|
97 | 97 | <li> |
98 | 98 | <?php echo $child[0]?> (<?php echo size_format($child[2])?>) |
99 | 99 | <?php |
100 | 100 | $child_exists_on_local_storage = true; |
101 | - if($storage_selection) |
|
101 | + if ($storage_selection) |
|
102 | 102 | { |
103 | - if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
103 | + if (!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
104 | 104 | $child_exists_on_local_storage = false; |
105 | 105 | } |
106 | 106 | ?> |
107 | - <?php if(!$child_exists_on_local_storage): ?> |
|
108 | - <a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
107 | + <?php if (!$child_exists_on_local_storage): ?> |
|
108 | + <a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
109 | 109 | <?php endif?> |
110 | - <?php if(!$storage_selection) :?> |
|
111 | - <a href="#<?php echo $child[0];?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a> |
|
112 | - <a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
113 | - <?php elseif($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?> |
|
114 | - <a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
110 | + <?php if (!$storage_selection) :?> |
|
111 | + <a href="#<?php echo $child[0]; ?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a> |
|
112 | + <a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
113 | + <?php elseif ($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?> |
|
114 | + <a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
115 | 115 | <?php endif?> |
116 | 116 | </li> |
117 | - <?php endforeach;?> |
|
117 | + <?php endforeach; ?> |
|
118 | 118 | </ul> |
119 | - <?php endif;?> |
|
119 | + <?php endif; ?> |
|
120 | 120 | </td> |
121 | - <td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
121 | + <td><?php if (isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
122 | 122 | <td><?php echo size_format($file_info['size'])?></td> |
123 | 123 | <td> |
124 | - <?php if(!$storage_selection):?> |
|
125 | - <a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
124 | + <?php if (!$storage_selection):?> |
|
125 | + <a href="#<?php echo $file_info['basename']; ?>" class="download" title="<?php echo __('Download Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
126 | 126 | |
127 | - <?php if(sizeof($available_storages)):?> |
|
128 | - <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |
|
127 | + <?php if (sizeof($available_storages)):?> |
|
128 | + <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |
|
129 | 129 | <?php endif?> |
130 | - <a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
131 | - <?php endif;?> |
|
130 | + <a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
131 | + <?php endif; ?> |
|
132 | 132 | |
133 | - <a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup','xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a> |
|
134 | - <?php if($storage_selection and !$file_exists_on_local_storage):?> |
|
135 | - <a href="#<?php echo $file_info['basename'];?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
133 | + <a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a> |
|
134 | + <?php if ($storage_selection and !$file_exists_on_local_storage):?> |
|
135 | + <a href="#<?php echo $file_info['basename']; ?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
136 | 136 | <?php endif?> |
137 | 137 | |
138 | 138 | </td> |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | </tbody> |
146 | 146 | </table> |
147 | 147 | |
148 | -<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete",'xcloner-backup-and-restore')?></a> |
|
148 | +<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete", 'xcloner-backup-and-restore')?></a> |
|
149 | 149 | |
150 | 150 | <!-- List Backup Content Modal--> |
151 | 151 | <div id="backup_cotent_modal" class="modal"> |
152 | 152 | <div class="modal-content"> |
153 | - <h4><?php echo sprintf(__("Listing Backup Content ",'xcloner-backup-and-restore'), "")?></h4> |
|
153 | + <h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "")?></h4> |
|
154 | 154 | <h5 class="backup-name"></h5> |
155 | 155 | |
156 | 156 | <div class="progress"> |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | <!-- Local Transfer Modal--> |
164 | 164 | <div id="local_storage_upload_modal" class="modal"> |
165 | 165 | <div class="modal-content"> |
166 | - <h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage",'xcloner-backup-and-restore'), "")?></h4> |
|
166 | + <h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage", 'xcloner-backup-and-restore'), "")?></h4> |
|
167 | 167 | <h5 class="backup-name"></h5> |
168 | 168 | |
169 | 169 | <div class="row status"> |
170 | 170 | <div class="progress"> |
171 | 171 | <div class="indeterminate"></div> |
172 | 172 | </div> |
173 | - <?php echo __("Uploading backup to the local storage filesystem...",'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
173 | + <?php echo __("Uploading backup to the local storage filesystem...", 'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
174 | 174 | </div> |
175 | 175 | </div> |
176 | 176 | </div> |
@@ -180,17 +180,17 @@ discard block |
||
180 | 180 | <form method="POST" class="remote-storage-form"> |
181 | 181 | <input type="hidden" name="file" class="backup_name"> |
182 | 182 | <div class="modal-content"> |
183 | - <h4><?php echo __("Remote Storage Transfer",'xcloner-backup-and-restore')?></h4> |
|
183 | + <h4><?php echo __("Remote Storage Transfer", 'xcloner-backup-and-restore')?></h4> |
|
184 | 184 | <p> |
185 | - <?php if(sizeof($available_storages)):?> |
|
185 | + <?php if (sizeof($available_storages)):?> |
|
186 | 186 | <div class="row"> |
187 | 187 | <div class="col s12 label"> |
188 | - <label><?php echo sprintf(__('Send %s to remote storage','xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label> |
|
188 | + <label><?php echo sprintf(__('Send %s to remote storage', 'xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label> |
|
189 | 189 | </div> |
190 | 190 | <div class="input-field col s8 m10"> |
191 | 191 | <select name="transfer_storage" id="transfer_storage" class="validate" required > |
192 | 192 | <option value="" selected><?php echo __('please select...', 'xcloner-backup-and-restore') ?></option> |
193 | - <?php foreach($available_storages as $storage=>$text):?> |
|
193 | + <?php foreach ($available_storages as $storage=>$text):?> |
|
194 | 194 | <option value="<?php echo $storage?>"><?php echo $text?></option> |
195 | 195 | <?php endforeach?> |
196 | 196 | </select> |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | </div> |
202 | 202 | </div> |
203 | 203 | <div class="row status"> |
204 | - <?php echo __("Uploading backup to the selected remote storage...",'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
204 | + <?php echo __("Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
205 | 205 | <div class="progress"> |
206 | 206 | <div class="indeterminate"></div> |
207 | 207 | </div> |
@@ -27,12 +27,16 @@ discard block |
||
27 | 27 | |
28 | 28 | <?php if($storage_selection):?> |
29 | 29 | <option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option> |
30 | - <?php else: ?> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
31 | 32 | <option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option> |
32 | - <?php endif;?> |
|
33 | + <?php endif; |
|
34 | +} |
|
35 | +?> |
|
33 | 36 | |
34 | 37 | <?php foreach($available_storages as $storage=>$text):?> |
35 | - <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
38 | + <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) { |
|
39 | + echo "selected"?>><?php echo $text?></option> |
|
36 | 40 | <?php endforeach?> |
37 | 41 | </select> |
38 | 42 | <?php endif?> |
@@ -60,16 +64,19 @@ discard block |
||
60 | 64 | |
61 | 65 | <?php |
62 | 66 | $i = 0; |
67 | +} |
|
63 | 68 | foreach($backup_list as $file_info):?> |
64 | 69 | <?php |
65 | - if($storage_selection == "gdrive") |
|
66 | - $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
70 | + if($storage_selection == "gdrive") { |
|
71 | + $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
72 | + } |
|
67 | 73 | $file_exists_on_local_storage = true; |
68 | 74 | |
69 | 75 | if($storage_selection) |
70 | 76 | { |
71 | - if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
72 | - $file_exists_on_local_storage = false; |
|
77 | + if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) { |
|
78 | + $file_exists_on_local_storage = false; |
|
79 | + } |
|
73 | 80 | } |
74 | 81 | |
75 | 82 | ?> |
@@ -100,8 +107,9 @@ discard block |
||
100 | 107 | $child_exists_on_local_storage = true; |
101 | 108 | if($storage_selection) |
102 | 109 | { |
103 | - if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
104 | - $child_exists_on_local_storage = false; |
|
110 | + if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) { |
|
111 | + $child_exists_on_local_storage = false; |
|
112 | + } |
|
105 | 113 | } |
106 | 114 | ?> |
107 | 115 | <?php if(!$child_exists_on_local_storage): ?> |
@@ -118,11 +126,14 @@ discard block |
||
118 | 126 | </ul> |
119 | 127 | <?php endif;?> |
120 | 128 | </td> |
121 | - <td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
129 | + <td><?php if(isset($file_info['timestamp'])) { |
|
130 | + echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
122 | 131 | <td><?php echo size_format($file_info['size'])?></td> |
123 | 132 | <td> |
124 | 133 | <?php if(!$storage_selection):?> |
125 | - <a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
134 | + <a href="#<?php echo $file_info['basename']; |
|
135 | +} |
|
136 | +?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
126 | 137 | |
127 | 138 | <?php if(sizeof($available_storages)):?> |
128 | 139 | <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |