@@ -26,6 +26,6 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | // If uninstall not called from WordPress, then exit. |
| 29 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 29 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
| 30 | 30 | exit; |
| 31 | 31 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | load_plugin_textdomain( |
| 38 | 38 | 'xcloner-backup-and-restore', |
| 39 | 39 | false, |
| 40 | - dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' |
|
| 40 | + dirname(dirname(plugin_basename(__FILE__))).'/languages/' |
|
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | 43 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
| 4 | -$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
| 5 | -$logger_content = $logger->getLastDebugLines(); |
|
| 3 | +$xcloner_settings = $this->get_xcloner_container()->get_xcloner_settings(); |
|
| 4 | +$logger = $this->get_xcloner_container()->get_xcloner_logger(); |
|
| 5 | +$logger_content = $logger->getLastDebugLines(); |
|
| 6 | 6 | ?> |
| 7 | 7 | <div class="col s12 "> |
| 8 | 8 | <div> |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | <?php echo __('XCloner Debugger Dashboard', 'xcloner-backup-and-restore') ?> |
| 11 | 11 | </h5> |
| 12 | 12 | |
| 13 | - <?php if($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
| 13 | + <?php if ($xcloner_settings->get_xcloner_option('xcloner_enable_log')) :?> |
|
| 14 | 14 | <ul class="collapsible xcloner-debugger" data-collapsible="accordion"> |
| 15 | 15 | <li class="active"> |
| 16 | 16 | <div class="collapsible-header active"><i class="material-icons">bug_report</i>XCloner Debugger</div> |
| 17 | 17 | <div class="collapsible-body"> |
| 18 | - <div class="console" id="xcloner-console"><?php if(isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div> |
|
| 18 | + <div class="console" id="xcloner-console"><?php if (isset($logger_content)) echo implode("<br />\n", $logger_content); ?></div> |
|
| 19 | 19 | </div> |
| 20 | 20 | </li> |
| 21 | 21 | </ul> |
@@ -28,6 +28,6 @@ discard block |
||
| 28 | 28 | }, 2000);*/ |
| 29 | 29 | }) |
| 30 | 30 | </script> |
| 31 | - <?php endif;?> |
|
| 31 | + <?php endif; ?> |
|
| 32 | 32 | </div> |
| 33 | 33 | </div> |
@@ -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 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | class Xcloner_Sanitization { |
| 5 | 5 | |
| 6 | - public function __construct(){} |
|
| 6 | + public function __construct() {} |
|
| 7 | 7 | |
| 8 | 8 | public function sanitize_input_as_int($option) |
| 9 | 9 | { |
@@ -24,14 +24,14 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $path = filter_var($option, FILTER_SANITIZE_URL); |
| 26 | 26 | |
| 27 | - try{ |
|
| 27 | + try { |
|
| 28 | 28 | $option = Util::normalizePath($path); |
| 29 | - }catch(Exception $e){ |
|
| 29 | + }catch (Exception $e) { |
|
| 30 | 30 | add_settings_error('xcloner_error_message', '', __($e->getMessage()), 'error'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if($path and !is_dir($path)){ |
|
| 34 | - add_settings_error('xcloner_error_message', '', __(sprintf('Invalid Server Path %s',$option)), 'error'); |
|
| 33 | + if ($path and !is_dir($path)) { |
|
| 34 | + add_settings_error('xcloner_error_message', '', __(sprintf('Invalid Server Path %s', $option)), 'error'); |
|
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | class Xcloner_Requirements |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - var $min_php_version = "5.4.0"; |
|
| 7 | - var $safe_mode = "Off"; |
|
| 6 | + var $min_php_version = "5.4.0"; |
|
| 7 | + var $safe_mode = "Off"; |
|
| 8 | 8 | |
| 9 | 9 | private $xcloner_settings; |
| 10 | 10 | private $xcloner_container; |
@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | public function check_backup_ready_status() |
| 24 | 24 | { |
| 25 | - if(!$this->check_min_php_version(1)) |
|
| 25 | + if (!$this->check_min_php_version(1)) |
|
| 26 | 26 | return false; |
| 27 | 27 | |
| 28 | - if(!$this->check_safe_mode(1)) |
|
| 28 | + if (!$this->check_safe_mode(1)) |
|
| 29 | 29 | return false; |
| 30 | 30 | |
| 31 | - if(!$this->check_xcloner_start_path(1)) |
|
| 31 | + if (!$this->check_xcloner_start_path(1)) |
|
| 32 | 32 | return false; |
| 33 | 33 | |
| 34 | - if(!$this->check_xcloner_store_path(1)) |
|
| 34 | + if (!$this->check_xcloner_store_path(1)) |
|
| 35 | 35 | return false; |
| 36 | 36 | |
| 37 | - if(!$this->check_xcloner_tmp_path(1)) |
|
| 37 | + if (!$this->check_xcloner_tmp_path(1)) |
|
| 38 | 38 | return false; |
| 39 | 39 | |
| 40 | 40 | return true; |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | public function check_min_php_version($return_bool = 0) |
| 49 | 49 | { |
| 50 | 50 | |
| 51 | - if($return_bool == 1) |
|
| 51 | + if ($return_bool == 1) |
|
| 52 | 52 | { |
| 53 | - if(version_compare(phpversion(), $this->min_php_version, '<')) |
|
| 53 | + if (version_compare(phpversion(), $this->min_php_version, '<')) |
|
| 54 | 54 | return false; |
| 55 | 55 | else |
| 56 | 56 | return true; |
@@ -59,31 +59,31 @@ discard block |
||
| 59 | 59 | return phpversion(); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function check_safe_mode($return_bool=0) |
|
| 62 | + public function check_safe_mode($return_bool = 0) |
|
| 63 | 63 | { |
| 64 | 64 | $safe_mode = "Off"; |
| 65 | 65 | |
| 66 | - if($return_bool) |
|
| 66 | + if ($return_bool) |
|
| 67 | 67 | { |
| 68 | - if( ini_get('safe_mode') ) |
|
| 68 | + if (ini_get('safe_mode')) |
|
| 69 | 69 | return false; |
| 70 | 70 | else |
| 71 | 71 | return true; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if( ini_get('safe_mode') ) |
|
| 74 | + if (ini_get('safe_mode')) |
|
| 75 | 75 | $safe_mode = "On"; |
| 76 | 76 | |
| 77 | 77 | return $safe_mode; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function check_xcloner_start_path($return_bool=0) |
|
| 80 | + public function check_xcloner_start_path($return_bool = 0) |
|
| 81 | 81 | { |
| 82 | 82 | $path = $this->xcloner_settings->get_xcloner_start_path(); |
| 83 | 83 | |
| 84 | - if($return_bool) |
|
| 84 | + if ($return_bool) |
|
| 85 | 85 | { |
| 86 | - if(!file_exists($path)) |
|
| 86 | + if (!file_exists($path)) |
|
| 87 | 87 | return false; |
| 88 | 88 | |
| 89 | 89 | return is_readable($path); |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | return $path; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function check_xcloner_tmp_path($return_bool=0) |
|
| 95 | + public function check_xcloner_tmp_path($return_bool = 0) |
|
| 96 | 96 | { |
| 97 | 97 | $path = $this->xcloner_settings->get_xcloner_tmp_path(); |
| 98 | 98 | |
| 99 | - if($return_bool) |
|
| 99 | + if ($return_bool) |
|
| 100 | 100 | { |
| 101 | - if(!file_exists($path)) |
|
| 101 | + if (!file_exists($path)) |
|
| 102 | 102 | return false; |
| 103 | 103 | |
| 104 | - if(!is_writeable($path)) |
|
| 104 | + if (!is_writeable($path)) |
|
| 105 | 105 | @chmod($path, 0777); |
| 106 | 106 | |
| 107 | 107 | return is_writeable($path); |
@@ -110,16 +110,16 @@ discard block |
||
| 110 | 110 | return $path; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - public function check_xcloner_store_path($return_bool=0) |
|
| 113 | + public function check_xcloner_store_path($return_bool = 0) |
|
| 114 | 114 | { |
| 115 | 115 | $path = $this->xcloner_settings->get_xcloner_store_path(); |
| 116 | 116 | |
| 117 | - if($return_bool) |
|
| 117 | + if ($return_bool) |
|
| 118 | 118 | { |
| 119 | - if(!file_exists($path)) |
|
| 119 | + if (!file_exists($path)) |
|
| 120 | 120 | return false; |
| 121 | 121 | |
| 122 | - if(!is_writeable($path)) |
|
| 122 | + if (!is_writeable($path)) |
|
| 123 | 123 | @chmod($path, 0777); |
| 124 | 124 | |
| 125 | 125 | return is_writeable($path); |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | public function get_open_basedir() |
| 142 | 142 | { |
| 143 | - $open_basedir = ini_get('open_basedir'); |
|
| 143 | + $open_basedir = ini_get('open_basedir'); |
|
| 144 | 144 | |
| 145 | - if(!$open_basedir) |
|
| 145 | + if (!$open_basedir) |
|
| 146 | 146 | $open_basedir = "none"; |
| 147 | 147 | return $open_basedir; |
| 148 | 148 | } |
@@ -156,14 +156,14 @@ discard block |
||
| 156 | 156 | $unit_list = array('B', 'KB', 'MB', 'GB', 'PB'); |
| 157 | 157 | |
| 158 | 158 | if ($bytes == 0) { |
| 159 | - return $bytes . ' ' . $unit_list[0]; |
|
| 159 | + return $bytes.' '.$unit_list[0]; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $unit_count = count($unit_list); |
| 163 | 163 | for ($i = $unit_count - 1; $i >= 0; $i--) { |
| 164 | 164 | $power = $i * 10; |
| 165 | 165 | if (($bytes >> $power) >= 1) |
| 166 | - return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; |
|
| 166 | + return round($bytes / (1 << $power), $decimals).' '.$unit_list[$i]; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -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 | |
@@ -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> |
@@ -35,22 +35,22 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | global $wpdb; |
| 37 | 37 | |
| 38 | - if(version_compare(phpversion(), Xcloner_Activator::xcloner_minimum_version, '<')) |
|
| 38 | + if (version_compare(phpversion(), Xcloner_Activator::xcloner_minimum_version, '<')) |
|
| 39 | 39 | { |
| 40 | - wp_die('<p>'.sprintf(__("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s"),Xcloner_Activator::xcloner_minimum_version, phpversion()).'</p>', __("XCloner Activation Error"), array( 'response'=>500, 'back_link'=>TRUE ) ); |
|
| 40 | + wp_die('<p>'.sprintf(__("XCloner requires minimum PHP version %s in order to run correctly. We have detected your version as %s"), Xcloner_Activator::xcloner_minimum_version, phpversion()).'</p>', __("XCloner Activation Error"), array('response'=>500, 'back_link'=>TRUE)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $charset_collate = $wpdb->get_charset_collate(); |
| 44 | 44 | |
| 45 | - $installed_ver = get_option( "xcloner_db_version" ); |
|
| 45 | + $installed_ver = get_option("xcloner_db_version"); |
|
| 46 | 46 | |
| 47 | 47 | $xcloner_db_version = Xcloner_Activator::xcloner_db_version; |
| 48 | 48 | |
| 49 | - $xcloner_scheduler_table = $wpdb->prefix . "xcloner_scheduler"; |
|
| 49 | + $xcloner_scheduler_table = $wpdb->prefix."xcloner_scheduler"; |
|
| 50 | 50 | |
| 51 | - if($installed_ver != $xcloner_db_version) |
|
| 51 | + if ($installed_ver != $xcloner_db_version) |
|
| 52 | 52 | { |
| 53 | - $xcloner_schedule_sql="CREATE TABLE `".$xcloner_scheduler_table."` ( |
|
| 53 | + $xcloner_schedule_sql = "CREATE TABLE `".$xcloner_scheduler_table."` ( |
|
| 54 | 54 | `id` int(11) NOT NULL AUTO_INCREMENT, |
| 55 | 55 | `name` varchar(255) NOT NULL, |
| 56 | 56 | `recurrence` varchar(25) NOT NULL, |
@@ -64,53 +64,53 @@ discard block |
||
| 64 | 64 | ) ".$charset_collate."; |
| 65 | 65 | "; |
| 66 | 66 | |
| 67 | - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
| 68 | - dbDelta( $xcloner_schedule_sql ); |
|
| 67 | + require_once(ABSPATH.'wp-admin/includes/upgrade.php'); |
|
| 68 | + dbDelta($xcloner_schedule_sql); |
|
| 69 | 69 | |
| 70 | - update_option( "xcloner_db_version", $xcloner_db_version ); |
|
| 70 | + update_option("xcloner_db_version", $xcloner_db_version); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if(get_option('xcloner_backup_compression_level') === false) |
|
| 73 | + if (get_option('xcloner_backup_compression_level') === false) |
|
| 74 | 74 | update_option('xcloner_backup_compression_level', 0); |
| 75 | 75 | |
| 76 | - if(get_option('xcloner_enable_log') === false) |
|
| 76 | + if (get_option('xcloner_enable_log') === false) |
|
| 77 | 77 | update_option('xcloner_enable_log', 1); |
| 78 | 78 | |
| 79 | - if(get_option('xcloner_enable_mysql_backup') === false) |
|
| 79 | + if (get_option('xcloner_enable_mysql_backup') === false) |
|
| 80 | 80 | update_option('xcloner_enable_mysql_backup', 1); |
| 81 | 81 | |
| 82 | - if(get_option('xcloner_system_settings_page') === false) |
|
| 82 | + if (get_option('xcloner_system_settings_page') === false) |
|
| 83 | 83 | update_option('xcloner_system_settings_page', 100); |
| 84 | 84 | |
| 85 | - if(get_option('xcloner_files_to_process_per_request') === false) |
|
| 85 | + if (get_option('xcloner_files_to_process_per_request') === false) |
|
| 86 | 86 | update_option('xcloner_files_to_process_per_request', 250); |
| 87 | 87 | |
| 88 | - if(get_option('xcloner_database_records_per_request') === false) |
|
| 88 | + if (get_option('xcloner_database_records_per_request') === false) |
|
| 89 | 89 | update_option('xcloner_database_records_per_request', 10000); |
| 90 | 90 | |
| 91 | - if(get_option('xcloner_exclude_files_larger_than_mb') === false) |
|
| 91 | + if (get_option('xcloner_exclude_files_larger_than_mb') === false) |
|
| 92 | 92 | update_option('xcloner_exclude_files_larger_than_mb', 0); |
| 93 | 93 | |
| 94 | - if(get_option('xcloner_split_backup_limit') === false) |
|
| 94 | + if (get_option('xcloner_split_backup_limit') === false) |
|
| 95 | 95 | update_option('xcloner_split_backup_limit', 2048); |
| 96 | 96 | |
| 97 | - if(get_option('xcloner_size_limit_per_request') === false) |
|
| 97 | + if (get_option('xcloner_size_limit_per_request') === false) |
|
| 98 | 98 | update_option('xcloner_size_limit_per_request', 50); |
| 99 | 99 | |
| 100 | - if(get_option('xcloner_cleanup_retention_limit_days') === false) |
|
| 100 | + if (get_option('xcloner_cleanup_retention_limit_days') === false) |
|
| 101 | 101 | update_option('xcloner_cleanup_retention_limit_days', 60); |
| 102 | 102 | |
| 103 | - if(get_option('xcloner_cleanup_retention_limit_archives') === false) |
|
| 103 | + if (get_option('xcloner_cleanup_retention_limit_archives') === false) |
|
| 104 | 104 | update_option('xcloner_cleanup_retention_limit_archives', 100); |
| 105 | 105 | |
| 106 | - if(get_option('xcloner_directories_to_scan_per_request') === false) |
|
| 106 | + if (get_option('xcloner_directories_to_scan_per_request') === false) |
|
| 107 | 107 | update_option('xcloner_directories_to_scan_per_request', 25); |
| 108 | 108 | |
| 109 | 109 | /*if(!get_option('xcloner_diff_backup_recreate_period')) |
| 110 | 110 | update_option('xcloner_diff_backup_recreate_period', 10); |
| 111 | 111 | * */ |
| 112 | 112 | |
| 113 | - if(!get_option('xcloner_regex_exclude')) |
|
| 113 | + if (!get_option('xcloner_regex_exclude')) |
|
| 114 | 114 | update_option('xcloner_regex_exclude', "(wp-content\/updraft|wp-content\/uploads\/wp_all_backup)(.*)$".PHP_EOL."(.*)\.(svn|git)(.*)$".PHP_EOL."wp-content\/cache(.*)$".PHP_EOL."(.*)error_log$"); |
| 115 | 115 | |
| 116 | 116 | } |