PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.2.0
JetBackup – Backup, Restore & Migrate v1.2.0
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / com / core / functions.php
backup / com / core Last commit date
backup 6 years ago database 6 years ago exception 6 years ago extension 6 years ago log 6 years ago notice 6 years ago restore 6 years ago schedule 6 years ago storage 6 years ago widget 6 years ago SGBoot.php 6 years ago SGConfig.php 6 years ago SGPing.php 6 years ago functions.php 6 years ago
functions.php
693 lines
1 <?php
2
3 function backupGuardGetCapabilities()
4 {
5 switch (SG_PRODUCT_IDENTIFIER) {
6 case 'backup-guard-en':
7 case 'backup-guard-wp-platinum':
8 case 'backup-guard-en-regular':
9 case 'backup-guard-en-extended':
10 return BACKUP_GUARD_CAPABILITIES_PLATINUM;
11 case 'backup-guard-wp-gold':
12 return BACKUP_GUARD_CAPABILITIES_GOLD;
13 case 'backup-guard-wp-silver':
14 return BACKUP_GUARD_CAPABILITIES_SILVER;
15 case 'backup-guard-wp-free':
16 return BACKUP_GUARD_CAPABILITIES_FREE;
17 }
18 }
19
20 function convertToReadableSize($size)
21 {
22 if (!$size) {
23 return '';
24 }
25
26 $base = log($size) / log(1000);
27 $suffix = array("", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
28 $f_base = floor($base);
29
30 return round(pow(1000, $base - floor($base)), 1) . $suffix[$f_base];
31 }
32
33 function backupGuardgetSealPopup()
34 {
35 $currentDate = time();
36 $sgShouldShowPopup = SGConfig::get('SG_SHOULD_SHOW_POPUP') == null ? true : SGConfig::get('SG_SHOULD_SHOW_POPUP');
37 $sgPluginInstallUpdateDate = SGConfig::get('SG_PLUGIN_INSTALL_UPDATE_DATE') == null ? time() : SGConfig::get('SG_PLUGIN_INSTALL_UPDATE_DATE');
38
39 // check ig plugin is active for free days show poup
40 if (($currentDate - $sgPluginInstallUpdateDate >= SG_PLUGIN_ACTIVE_INTERVAL) && $sgShouldShowPopup) {
41 ?>
42 <script>
43 window.SGPMPopupLoader=window.SGPMPopupLoader||{ids:[],popups:{},call:function(w,d,s,l,id){
44 w['sgp']=w['sgp']||function(){(w['sgp'].q=w['sgp'].q||[]).push(arguments[0]);};
45 var sg1=d.createElement(s),sg0=d.getElementsByTagName(s)[0];
46 if(SGPMPopupLoader && SGPMPopupLoader.ids && SGPMPopupLoader.ids.length > 0){SGPMPopupLoader.ids.push(id); return;}
47 SGPMPopupLoader.ids.push(id);
48 sg1.onload = function(){SGPMPopup.openSGPMPopup();}; sg1.async=true; sg1.src=l;
49 sg0.parentNode.insertBefore(sg1,sg0);
50 return {};
51 }};
52 SGPMPopupLoader.call(window,document,'script','https://popupmaker.com/assets/lib/SGPMPopup.min.js','7c685e17');
53 </script>
54 <?php
55 SGConfig::set('SG_SHOULD_SHOW_POPUP', 0);
56 }
57
58 return;
59 }
60
61 function backupGuardConvertDateTimezone($date, $dateFormat = "Y-m-d H:i:s", $timezone = "UTC")
62 {
63 if (in_array($timezone, timezone_identifiers_list())) {
64 $date = date_create($date);
65 $timezone = timezone_open($timezone);
66 date_timezone_set($date, $timezone);
67
68 if (!$dateFormat) {
69 $dateFormat = "Y-m-d H:i:s";
70 }
71
72 return date_format($date, $dateFormat);
73 }
74
75 return $date;
76 }
77
78 function backupGuardRemoveSlashes($value)
79 {
80 if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
81 return wp_unslash($value);
82 }
83 else {
84 if (is_array($value)) {
85 return array_map('stripslashes', $value);
86 }
87
88 return stripslashes($value);
89 }
90 }
91
92 function backupGuardSanitizeTextField($value)
93 {
94 if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
95 if (is_array($value)) {
96 return array_map('sanitize_text_field', $value);
97 }
98
99 return sanitize_text_field($value);
100 }
101 else {
102 if (is_array($value)) {
103 return array_map('strip_tags', $value);
104 }
105
106 return strip_tags($value);
107 }
108 }
109
110 function backupGuardIsMultisite()
111 {
112 if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
113 return defined('BG_IS_MULTISITE')?BG_IS_MULTISITE:is_multisite();
114 }
115 else {
116 return false;
117 }
118 }
119
120 function backupGuardGetBanner($env, $type="plugin", $userType = null)
121 {
122 require_once(SG_LIB_PATH.'BackupGuard/Client.php');
123 $client = new BackupGuard\Client();
124 return $client->getBanner(strtolower($env), $type, $userType);
125 }
126
127 function backupGuardGetFilenameOptions($options)
128 {
129 $selectedPaths = explode(',', $options['SG_BACKUP_FILE_PATHS']);
130 $pathsToExclude = explode(',', $options['SG_BACKUP_FILE_PATHS_EXCLUDE']);
131
132 $opt = '';
133
134 if (SG_ENV_ADAPTER == SG_ENV_WORDPRESS) {
135 $opt .= 'opt(';
136
137 if ($options['SG_BACKUP_TYPE'] == SG_BACKUP_TYPE_CUSTOM) {
138 if ($options['SG_ACTION_BACKUP_DATABASE_AVAILABLE']) {
139 $opt .= 'db_';
140 }
141
142 if ($options['SG_ACTION_BACKUP_FILES_AVAILABLE']) {
143 if (in_array('wp-content', $selectedPaths)) {
144 $opt .= 'wpc_';
145 }
146 if (!in_array('wp-content/plugins', $pathsToExclude)) {
147 $opt .= 'plg_';
148 }
149 if (!in_array('wp-content/themes', $pathsToExclude)) {
150 $opt .= 'thm_';
151 }
152 if (!in_array('wp-content/uploads', $pathsToExclude)) {
153 $opt .= 'upl_';
154 }
155 }
156
157
158 }
159 else {
160 $opt .= 'full';
161 }
162
163 $opt = trim($opt, "_");
164 $opt .= ')_';
165 }
166
167 return $opt;
168 }
169
170 function backupGuardGenerateToken()
171 {
172 return md5(time());
173 }
174
175 // Parse a URL and return its components
176 function backupGuardParseUrl($url)
177 {
178 $urlComponents = parse_url($url);
179 $domain = $urlComponents['host'];
180 $port = '';
181
182 if (isset($urlComponents['port']) && strlen($urlComponents['port'])) {
183 $port = ":".$urlComponents['port'];
184 }
185
186 $domain = preg_replace("/(www|\dww|w\dw|ww\d)\./", "", $domain);
187
188 $path = "";
189 if (isset($urlComponents['path'])) {
190 $path = $urlComponents['path'];
191 }
192
193 return $domain.$port.$path;
194 }
195
196 function backupGuardIsReloadEnabled()
197 {
198 // Check if reloads option is turned on
199 return SGConfig::get('SG_BACKUP_WITH_RELOADINGS')?true:false;
200 }
201
202 function backupGuardGetBackupOptions($options)
203 {
204 $backupOptions = array(
205 'SG_BACKUP_UPLOAD_TO_STORAGES' => '',
206 'SG_BACKUP_FILE_PATHS_EXCLUDE' => '',
207 'SG_BACKUP_FILE_PATHS' => ''
208 );
209
210 if (isset($options['sg-custom-backup-name']) && $options['sg-custom-backup-name']) {
211 SGConfig::set("SG_CUSTOM_BACKUP_NAME", $options['sg-custom-backup-name']);
212 }
213 else {
214 SGConfig::set("SG_CUSTOM_BACKUP_NAME", '');
215 }
216
217 //If background mode
218 $isBackgroundMode = !empty($options['backgroundMode']) ? 1 : 0;
219
220 if ($isBackgroundMode) {
221 $backupOptions['SG_BACKUP_IN_BACKGROUND_MODE'] = $isBackgroundMode;
222 }
223
224 //If cloud backup
225 if (!empty($options['backupCloud']) && count($options['backupStorages'])) {
226 $clouds = $options['backupStorages'];
227 $backupOptions['SG_BACKUP_UPLOAD_TO_STORAGES'] = implode(',', $clouds);
228 }
229
230 $backupOptions['SG_BACKUP_TYPE'] = $options['backupType'];
231
232 if ($options['backupType'] == SG_BACKUP_TYPE_FULL) {
233 $backupOptions['SG_ACTION_BACKUP_DATABASE_AVAILABLE']= 1;
234 $backupOptions['SG_ACTION_BACKUP_FILES_AVAILABLE'] = 1;
235 $backupOptions['SG_BACKUP_FILE_PATHS_EXCLUDE'] = SG_BACKUP_FILE_PATHS_EXCLUDE;
236 $backupOptions['SG_BACKUP_FILE_PATHS'] = 'wp-content';
237 }
238 else if ($options['backupType'] == SG_BACKUP_TYPE_CUSTOM) {
239 //If database backup
240 $isDatabaseBackup = !empty($options['backupDatabase']) ? 1 : 0;
241 $backupOptions['SG_ACTION_BACKUP_DATABASE_AVAILABLE'] = $isDatabaseBackup;
242
243 //If db backup
244 if($options['backupDBType']){
245 $tablesToBackup = implode(',', $options['table']);
246 $backupOptions['SG_BACKUP_TABLES_TO_BACKUP'] = $tablesToBackup;
247 }
248
249 //If files backup
250 if (!empty($options['backupFiles']) && count($options['directory'])) {
251 $backupFiles = explode(',', SG_BACKUP_FILE_PATHS);
252 $filesToExclude = @array_diff($backupFiles, $options['directory']);
253
254 if (in_array('wp-content', $options['directory'])) {
255 $options['directory'] = array('wp-content');
256 }
257 else {
258 $filesToExclude = array_diff($filesToExclude, array('wp-content'));
259 }
260
261 $filesToExclude = implode(',', $filesToExclude);
262 if (strlen($filesToExclude)) {
263 $filesToExclude = ','.$filesToExclude;
264 }
265
266 $backupOptions['SG_BACKUP_FILE_PATHS_EXCLUDE'] = SG_BACKUP_FILE_PATHS_EXCLUDE.$filesToExclude;
267 $options['directory'] = backupGuardSanitizeTextField($options['directory']);
268 $backupOptions['SG_BACKUP_FILE_PATHS'] = implode(',', $options['directory']);
269 $backupOptions['SG_ACTION_BACKUP_FILES_AVAILABLE'] = 1;
270 }
271 else {
272 $backupOptions['SG_ACTION_BACKUP_FILES_AVAILABLE'] = 0;
273 $backupOptions['SG_BACKUP_FILE_PATHS'] = 0;
274 }
275 }
276 return $backupOptions;
277 }
278
279 function backupGuardLoadStateData()
280 {
281 if (file_exists(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME)) {
282 $sgState = new SGState();
283 $stateFile = file_get_contents(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME);
284 $sgState = $sgState->factory($stateFile);
285 return $sgState;
286 }
287
288 return false;
289 }
290
291 function backupGuardValidateApiCall($token)
292 {
293 if (!strlen($token)) {
294 exit();
295 }
296
297 $statePath = SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME;
298
299 if (!file_exists($statePath)) {
300 exit();
301 }
302
303 $state = file_get_contents($statePath);
304 $state = json_decode($state, true);
305 $stateToken = $state['token'];
306
307 if ($stateToken != $token) {
308 exit();
309 }
310
311 return true;
312 }
313
314 function backupGuardScanBackupsDirectory($path)
315 {
316 $backups = scandir($path);
317 $backupFolders = array();
318 foreach ($backups as $key => $backup) {
319 if ($backup == "." || $backup == "..") {
320 continue;
321 }
322
323 if (is_dir($path.$backup)) {
324 $backupFolders[$backup] = filemtime($path.$backup);
325 }
326 }
327 // Sort(from low to high) backups by creation date
328 asort($backupFolders);
329 return $backupFolders;
330 }
331
332 function backupGuardSymlinksCleanup($dir)
333 {
334 if (is_dir($dir)) {
335 $objects = scandir($dir);
336 foreach ($objects as $object) {
337 if ($object == "." || $object == "..") {
338 continue;
339 }
340
341 if (filetype($dir.$object) != "dir") {
342 @unlink($dir.$object);
343 }
344 else {
345 backupGuardSymlinksCleanup($dir.$object.'/');
346 @rmdir($dir.$object);
347 }
348 }
349 }
350 else {
351 @unlink($dir);
352 }
353 return;
354 }
355
356 function backupGuardRealFilesize($filename)
357 {
358 $fp = fopen($filename, 'r');
359 $return = false;
360 if (is_resource($fp))
361 {
362 if (PHP_INT_SIZE < 8) // 32 bit
363 {
364 if (0 === fseek($fp, 0, SEEK_END))
365 {
366 $return = 0.0;
367 $step = 0x7FFFFFFF;
368 while ($step > 0)
369 {
370 if (0 === fseek($fp, - $step, SEEK_CUR))
371 {
372 $return += floatval($step);
373 }
374 else
375 {
376 $step >>= 1;
377 }
378 }
379 }
380 }
381 else if (0 === fseek($fp, 0, SEEK_END)) // 64 bit
382 {
383 $return = ftell($fp);
384 }
385 }
386
387 return $return;
388 }
389
390 function backupGuardFormattedDuration($startTs, $endTs)
391 {
392 $unit = 'seconds';
393 $duration = $endTs-$startTs;
394 if ($duration>=60 && $duration<3600)
395 {
396 $duration /= 60.0;
397 $unit = 'minutes';
398 }
399 else if ($duration>=3600)
400 {
401 $duration /= 3600.0;
402 $unit = 'hours';
403 }
404 $duration = number_format($duration, 2, '.', '');
405
406 return $duration.' '.$unit;
407 }
408
409 function backupGuardDeleteDirectory($dirName)
410 {
411 $dirHandle = null;
412 if (is_dir($dirName))
413 {
414 $dirHandle = opendir($dirName);
415 }
416
417 if (!$dirHandle)
418 {
419 return false;
420 }
421
422 while ($file = readdir($dirHandle))
423 {
424 if ($file != "." && $file != "..")
425 {
426 if (!is_dir($dirName."/".$file))
427 {
428 @unlink($dirName."/".$file);
429 }
430 else
431 {
432 backupGuardDeleteDirectory($dirName.'/'.$file);
433 }
434 }
435 }
436
437 closedir($dirHandle);
438 return @rmdir($dirName);
439 }
440
441 function backupGuardDownloadFile($file, $type = 'application/octet-stream')
442 {
443 $file = backupGuardRemoveSlashes($file);
444 if (file_exists($file)) {
445 header('Content-Description: File Transfer');
446 header('Content-Type: '.$type);
447 header('Content-Disposition: attachment; filename="'.basename($file).'";');
448 header('Expires: 0');
449 header('Cache-Control: must-revalidate');
450 header('Pragma: public');
451 header('Content-Length: ' . filesize($file));
452 readfile($file);
453 }
454
455 exit;
456 }
457
458 function backupGuardDownloadFileSymlink($safedir, $filename)
459 {
460 $safedir = backupGuardRemoveSlashes($safedir);
461 $filename = backupGuardRemoveSlashes($filename);
462
463 $downloaddir = SG_SYMLINK_PATH;
464 $downloadURL = SG_SYMLINK_URL;
465
466 if (!file_exists($downloaddir)) {
467 mkdir($downloaddir, 0777);
468 }
469
470 $letters = 'abcdefghijklmnopqrstuvwxyz';
471 srand((double) microtime() * 1000000);
472 $string = '';
473
474 for ($i = 1; $i <= rand(4,12); $i++) {
475 $q = rand(1,24);
476 $string = $string.$letters[$q];
477 }
478
479 $handle = opendir($downloaddir);
480 while ($dir = readdir($handle)) {
481 if ($dir == "." || $dir == "..") {
482 continue;
483 }
484
485 if (is_dir($downloaddir.$dir)) {
486 @unlink($downloaddir . $dir . "/" . $filename);
487 @rmdir($downloaddir . $dir);
488 }
489 }
490
491 closedir($handle);
492
493 mkdir($downloaddir . $string, 0777);
494 $res = @symlink($safedir . $filename, $downloaddir . $string . "/" . $filename);
495 if ($res) {
496 header('Content-Description: File Transfer');
497 header('Content-Type: application/octet-stream');
498 header('Content-Disposition: attachment;filename="'.$filename.'"');
499 header('Content-Transfer-Encoding: binary');
500 header("Location: " . $downloadURL . $string . "/" . $filename);
501 }
502 else{
503 wp_die(_backupGuardT("Symlink / shortcut creation failed! Seems your server configurations don't allow symlink creation, so we're unable to provide you the direct download url. You can download your backup using any FTP client. All backups and related stuff we locate '/wp-content/uploads/backup-guard' directory. If you need this functionality, you should check out your server configurations and make sure you don't have any limitation related to symlink creation.", true));
504 }
505 exit;
506 }
507
508 function backupGuardGetCurrentUrlScheme()
509 {
510 return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')?'https':'http';
511 }
512
513 function backupGuardValidateLicense()
514 {
515 $pluginCapabilities = backupGuardGetCapabilities();
516 if ($pluginCapabilities == BACKUP_GUARD_CAPABILITIES_FREE) {
517 return true;
518 }
519
520 //only check once per day
521 $ts = (int)SGConfig::get('SG_LICENSE_CHECK_TS');
522 if (time() - $ts < SG_LICENSE_CHECK_TIMEOUT) {
523 return true;
524 }
525
526 require_once(SG_LIB_PATH.'SGAuthClient.php');
527
528 $url = site_url();
529
530 $auth = SGAuthClient::getInstance();
531 $res = $auth->validateUrl($url);
532
533 if ($res === -1) { //login is required
534 backup_guard_login_page();
535 return false;
536 }
537 else if ($res === false) { //invalid license
538 backup_guard_link_license_page();
539 return false;
540 }
541 else {
542 SGConfig::set('SG_LICENSE_CHECK_TS', time(), true);
543 SGConfig::set('SG_LICENSE_KEY', $res, true);
544 }
545
546 return true;
547 }
548
549 //returns true if string $haystack ends with string $needle or $needle is an empty string
550 function backupGuardStringEndsWith($haystack, $needle)
551 {
552 $length = strlen($needle);
553
554 return $length === 0 ||
555 (substr($haystack, -$length) === $needle);
556 }
557 //returns true if string $haystack starts with string $needle
558 function backupGuardStringStartsWith($haystack, $needle)
559 {
560 $length = strlen($needle);
561 return (substr($haystack, 0, $length) === $needle);
562 }
563
564 function backupGuardGetDbTables(){
565 $sgdb = SGDatabase::getInstance();
566 $tables = $sgdb->query("SHOW TABLES");
567 $tablesKey = 'Tables_in_'.SG_DB_NAME;
568 $tableNames = array();
569 $customTablesToExclude = str_replace(' ', '', SGConfig::get('SG_TABLES_TO_EXCLUDE'));
570 $tablesToExclude = explode(',', $customTablesToExclude);
571 foreach ($tables as $table):
572 $tableName = $table[$tablesKey];
573 if($tableName != SG_ACTION_TABLE_NAME && $tableName != SG_CONFIG_TABLE_NAME && $tableName != SG_SCHEDULE_TABLE_NAME){
574 array_push($tableNames, array('name'=>$tableName,
575 'current'=> backupGuardStringStartsWith($tableName, SG_ENV_DB_PREFIX)? 'true':'false',
576 'disabled'=>in_array($tableName,$tablesToExclude)? 'disabled':''
577 ));
578 }
579 endforeach;
580 usort($tableNames, function ($name1, $name2){
581 if(backupGuardStringStartsWith($name1['name'], SG_ENV_DB_PREFIX)){
582 if(backupGuardStringStartsWith($name2['name'], SG_ENV_DB_PREFIX)){
583 return 0;
584 }
585 return -1;
586 }
587 return 1;
588 });
589 return $tableNames;
590 }
591
592 function backupGuardGetBackupTablesHTML($defaultChecked = false){
593 $tables = backupGuardGetDbTables();
594 ?>
595
596 <div class="checkbox">
597 <label for="custombackupdb-chbx">
598 <input type="checkbox" class="sg-custom-option" name="backupDatabase" id="custombackupdb-chbx" <?php echo $defaultChecked?'checked':'' ?>>
599 <?php _backupGuardT('Backup database'); ?>
600 </label>
601 <div class="col-md-12 sg-checkbox sg-backup-db-options">
602 <div class="checkbox">
603 <label for="custombackupdbfull-radio" class="sg-backup-db-mode" title="<?php _backupGuardT('Backup all tables found in the database')?>">
604 <input type="radio" name="backupDBType" id="custombackupdbfull-radio" value="0" checked>
605 <?php _backupGuardT('Full'); ?>
606 </label>
607 <label for="custombackupdbcurent-radio" class="sg-backup-db-mode" title="<?php echo _backupGuardT('Backup tables related to the current WordPress installation. Only tables with', true).' '.SG_ENV_DB_PREFIX.' '._backupGuardT('will be backed up', true)?>">
608 <input type="radio" name="backupDBType" id="custombackupdbcurent-radio" value="1">
609 <?php _backupGuardT('Only WordPress'); ?>
610 </label>
611 <label for="custombackupdbcustom-radio" class="sg-backup-db-mode" title="<?php _backupGuardT('Select tables you want to include in your backup') ?>">
612 <input type="radio" name="backupDBType" id="custombackupdbcustom-radio" value="2">
613 <?php _backupGuardT('Custom'); ?>
614 </label>
615 <!--Tables-->
616 <div class="col-md-12 sg-custom-backup-tables">
617 <?php foreach ($tables as $table): ?>
618 <div class="checkbox">
619 <label for="<?php echo $table['name']?>">
620 <input type="checkbox" name="table[]" current="<?php echo $table['current'] ?>" <?php echo $table['disabled'] ?> id="<?php echo $table['name']?>" value="<?php echo $table['name'];?>">
621 <?php echo basename($table['name']);?>
622 <?php if($table['disabled']) {?>
623 <span class="sg-disableText"><?php _backupGuardT('(excluded from settings)') ?></span>
624 <?php } ?>
625 </label>
626 </div>
627 <?php endforeach;?>
628 </div>
629 </div>
630 </div>
631
632 </div>
633
634 <?php
635
636 }
637
638 function backupGuardIsAccountGold()
639 {
640 return strpos("gold", SG_PRODUCT_IDENTIFIER)!== false;
641 }
642
643 function backupGuardGetProductName()
644 {
645 $name = '';
646 switch (SG_PRODUCT_IDENTIFIER) {
647 case 'backup-guard-wp-silver':
648 $name = 'Silver';
649 break;
650 case 'backup-guard-wp-platinum':
651 $name = 'Platinum';
652 break;
653 case 'backup-guard-en':
654 case 'backup-guard-en-regular':
655 $name = 'Regular';
656 break;
657 case 'backup-guard-en-extended':
658 $name = 'Extended';
659 break;
660 case 'backup-guard-wp-gold':
661 $name = 'Gold';
662 break;
663 case 'backup-guard-wp-free':
664 $name = 'Free';
665 break;
666 }
667
668 return $name;
669 }
670
671 function backupGuardGetFileSelectiveRestore()
672 {
673 ?>
674 <div class="col-md-12 sg-checkbox sg-restore-files-options">
675 <div class="checkbox">
676 <label for="restorefilesfull-radio" class="sg-restore-files-mode" >
677 <input type="radio" name="restoreFilesType" checked id="restorefilesfull-radio" value="0">
678 <?php _backupGuardT('Full'); ?>
679 </label>
680
681 <label for="restorefilescustom-radio" class="sg-restore-files-mode">
682 <input type="radio" name="restoreFilesType" id="restorefilescustom-radio" value="1">
683 <?php _backupGuardT('Custom'); ?>
684 </label>
685 <!--Files-->
686 <div class="col-md-12 sg-file-selective-restore">
687 <div id="fileSystemTreeContainer"></div>
688 </div>
689 </div>
690 </div>
691 <?php
692 }
693