PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.3.7
JetBackup – Backup, Restore & Migrate v1.3.7
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 / public / dashboardWidget.php
backup / public Last commit date
ajax 6 years ago config 6 years ago cron 6 years ago css 6 years ago fonts 6 years ago img 6 years ago include 6 years ago js 6 years ago templates 6 years ago backups.php 6 years ago boot.php 6 years ago cloud.php 6 years ago dashboardWidget.php 6 years ago proFeatures.php 6 years ago restore_wordpress.php 6 years ago schedule.php 6 years ago security.php 6 years ago services.php 6 years ago settings.php 6 years ago support.php 6 years ago systemInfo.php 6 years ago
dashboardWidget.php
114 lines
1 <?php
2 require_once(SG_BACKUP_PATH.'SGBackup.php');
3 // Function that outputs the contents of the dashboard widget
4 function backup_guard_dashboard_widget_function( $post, $callback_args ) {
5
6 $banner = backupGuardGetBanner(SG_ENV_WORDPRESS,"dashboard-widget");
7
8 $backups = SGBackup::getAllBackups();
9 $allBackupsCount = count($backups);
10 $successBackups = 0;
11 $faildBackups = 0;
12 $inprogress = 0;
13 $warningBackups = 0;
14 $canceledBackups = 0;
15
16 for($i = 0; $i < $allBackupsCount; $i++){
17 switch ($allBackupsCount[$i]['status']){
18 case SG_ACTION_STATUS_IN_PROGRESS_DB:
19 case SG_ACTION_STATUS_IN_PROGRESS_FILES:
20 $inprogress++;
21 break;
22 case SG_ACTION_STATUS_FINISHED_WARNINGS:
23 $warningBackups++;
24 break;
25 case SG_ACTION_STATUS_CANCELLED:
26 $canceledBackups++;
27 break;
28 case SG_ACTION_STATUS_ERROR:
29 $faildBackups++;
30 break;
31 default:
32 $successBackups++;
33 }
34 }
35 if(strpos(SG_PRODUCT_IDENTIFIER,"silver") !== false || strpos(SG_PRODUCT_IDENTIFIER,"gold") !== false) {
36 $sgb = new SGBackup();
37 $scheduleParams = $sgb->getScheduleParamsById(SG_SCHEDULER_DEFAULT_ID);
38 $scheduleParams = backupGuardParseBackupOptions($scheduleParams);
39 $schedulesCount = strlen($scheduleParams['label'])? 1 : 0;
40
41 }else if(strpos(SG_PRODUCT_IDENTIFIER,"free") === false) { // platinum
42 require_once(SG_BACKUP_PATH.'SGBackupSchedule.php');
43 $allSchedules = SGBackupSchedule::getAllSchedules();
44 $schedulesCount = count($allSchedules);
45 }
46
47
48 ?>
49 <div style="width: 100%; font-size: 12px; "><?php echo $banner ?></div>
50 <div id="canvas-holder" style="width:100%">
51 <canvas id="chart-area" />
52 </div>
53 <script>
54 window.onload = function () {
55 var config = {
56 type: 'pie',
57 data: {
58 datasets: [{
59 data: [
60 <?php echo $successBackups ?>,
61 <?php echo $faildBackups ?>,
62 <?php echo $warningBackups ?>,
63 <?php echo $canceledBackups ?>,
64 <?php echo $inprogress ?>
65
66
67 ],
68 backgroundColor: [
69 "#2b8b3a",
70 "#f96868",
71 "#ffb848",
72 "#7C858E",
73 "#64aed9"
74
75 ],
76 label: 'Dataset 1'
77 }],
78 labels: [
79 "Success (<?php echo $successBackups ?>)",
80 "Failed (<?php echo $faildBackups ?>)",
81 "Warning (<?php echo $warningBackups ?>)",
82 "Canceled (<?php echo $canceledBackups ?>)",
83 "In progress (<?php echo $inprogress ?>)",
84 ]
85 },
86 options: {
87 responsive: true,
88 legend: {
89 labels: {
90 // This more specific font property overrides the global property
91 fontFamily: "'Source Sans Pro', 'Calibri', 'Candara', 'Arial', 'sans-serif'"
92 }
93 }
94 }
95 };
96 <?php
97 if(isset($schedulesCount)) {
98 ?>
99 config.data.datasets[0].data.push(<?php echo $schedulesCount ?>);
100 config.data.datasets[0].backgroundColor.push("#cecece");
101 config.data.labels.push("Schedules (<?php echo $schedulesCount ?>)");
102 <?php
103 }
104
105 ?>
106 var ctx = document.getElementById("chart-area").getContext("2d");
107 window.myPie = new Chart(ctx, config);
108
109 }
110 </script>
111 <?php
112 }
113
114