PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.16.8
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.16.8
1.19.8 1.19.7 1.19.6 1.19.5 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.12.0 1.13.0 1.14.0 1.15.0 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.16.6 1.16.7 1.16.8 1.17.0 1.17.6 1.17.7 1.17.8 1.17.9 1.18.0 1.18.1 1.18.2 1.18.3 1.18.4 1.18.5 1.18.6 1.18.7 1.18.8 1.18.9 1.19.0 1.19.1 1.19.2 1.19.3 1.19.4 1.3.19 1.3.20 1.4.0 1.4.1 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.16 1.5.17 1.5.18 1.5.19 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.8.1 1.8.3 1.9.0 1.9.1 1.9.2
nitropack / view / system-report.php
nitropack / view Last commit date
images 1 year ago javascript 1 year ago modals 1 year ago stylesheet 1 year ago templates 2 years ago admin.php 1 year ago connect-oneclick.php 1 year ago connect.php 2 years ago dashboard-oneclick.php 2 years ago dashboard.php 1 year ago oneclick.php 2 years ago safemode.php 2 years ago system-report.php 1 year ago
system-report.php
175 lines
1 <?php $diagnostic_settings = array(
2 array(
3 'name' => esc_html__('Include NitroPack info (version, methods, environment)', 'nitropack'),
4 'desc' => '',
5 'id' => 'general-info-status',
6 'class' => 'diagnostic-option',
7 'setting' => 'include_info'
8 ),
9 array(
10 'name' => esc_html__('Include active plugins list', 'nitropack'),
11 'desc' => '',
12 'id' => 'active-plugins-status',
13 'class' => 'diagnostic-option',
14 'setting' => 'active_plugins'
15 ),
16 array(
17 'name' => esc_html__('Include conflicting plugins list', 'nitropack'),
18 'desc' => '',
19 'id' => 'conflicting-plugins-status',
20 'class' => 'diagnostic-option',
21 'setting' => 'conflicting_plugins'
22 ),
23 array(
24 'name' => esc_html__('Include plugin config', 'nitropack'),
25 'desc' => '',
26 'id' => 'user-config-status',
27 'class' => 'diagnostic-option',
28 'setting' => 'user_conflict'
29 ),
30 array(
31 'name' => esc_html__('Include directory status', 'nitropack'),
32 'desc' => '',
33 'id' => 'dir-info-status',
34 'class' => 'diagnostic-option',
35 'setting' => 'dir_info_status'
36 ),
37 );
38 ?>
39
40 <div class="grid grid-cols-1 gap-6">
41 <div class="col-span-1">
42 <div class="card">
43 <div class="flex">
44 <div class="" style="flex-basis: 66%;">
45 <h3><?php esc_html_e('System Info Report', 'nitropack'); ?></h3>
46 <p><?php esc_html_e('The system info report provides detailed insights into your NitroPack setup, including website configuration. Sharing this report with our support team enables them to quickly diagnose and resolve any issues you might face.', 'nitropack'); ?></p>
47 </div>
48 <div class="ml-auto">
49 <a id="gen-report-btn" href="javascript:void(0);" class="btn btn-secondary"><img src="<?php echo plugin_dir_url(__FILE__) . 'images/download.svg'; ?> " class="icon-left" /> <span class="btn-text"><?php esc_html_e('Download', 'nitropack'); ?></span></a>
50 </div>
51 </div>
52 <div class="card-body">
53 <div>
54 <div id="accordion-collapse" data-accordion="collapse" class="mt-4" data-active-classes="active" data-inactive-classes="not-active">
55 <div id="accordion-collapse-heading-1" class="text-center">
56 <a class="btn btn-link" data-accordion-target="#accordion-collapse-body-1" aria-expanded="false" aria-controls="accordion-collapse-body-1">
57 <span><?php esc_html_e('Customize Report', 'nitropack'); ?></span>
58 <svg width="9" height="6" data-accordion-icon class="w-3 h-3 rotate-180 shrink-0 icon-right" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 10 6">
59 <path d="M8.5 5L4.5 1L0.5 5" stroke="#4600CC" stroke-linecap="round" stroke-linejoin="round" />
60 </svg>
61 </a>
62 </div>
63 <div id="accordion-collapse-body-1" class="accordion-body hidden" aria-labelledby="accordion-collapse-heading-1">
64 <div class="options-container">
65 <?php foreach ($diagnostic_settings as $setting) : ?>
66 <div class="nitro-option">
67 <div class="nitro-option-main">
68 <h6><?php echo $setting['name']; ?></h6>
69 <label class="inline-flex items-center cursor-pointer ml-auto">
70 <input type="checkbox" value="" id="<?php echo $setting['id']; ?>" class="sr-only peer <?php echo $setting['class']; ?>" name="<?php echo $setting['setting']; ?>" checked>
71 <div class="toggle"></div>
72 </label>
73 </div>
74 </div>
75 <?php endforeach; ?>
76 </div>
77 </div>
78 </div>
79 </div>
80 </div>
81 </div>
82 </div>
83 </div>
84
85
86 <script>
87 ($ => {
88 let isReportGenerating = false;
89
90 $("#gen-report-btn").on("click", function(e) {
91 if (isReportGenerating) return;
92
93 $.ajax({
94 url: ajaxurl,
95 type: "POST",
96 dataType: "text",
97 data: {
98 action: 'nitropack_generate_report',
99 nonce: nitroNonce,
100 toggled: {
101 "general-info-status": $("#general-info-status:checked").length,
102 "active-plugins-status": $("#active-plugins-status:checked").length,
103 "conflicting-plugins-status": $("#conflicting-plugins-status:checked").length,
104 "user-config-status": $("#user-config-status:checked").length,
105 "dir-info-status": $("#dir-info-status:checked").length
106 }
107 },
108 beforeSend: function(xhr, sett) {
109 if ($(".diagnostic-option:checked").length > 0) {
110 $("#diagnostics-loader").show();
111 isReportGenerating = true;
112 return true;
113 } else {
114 alert("<?php esc_html_e('Please select at least one of the report options', 'nitropack'); ?>");
115 return false;
116 }
117 },
118 success: function(response, status, xhr) {
119 if (response.length > 1) {
120 var filename = "";
121 var disposition = xhr.getResponseHeader('Content-Disposition');
122 if (disposition && disposition.indexOf('attachment') !== -1) {
123 var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
124 var matches = filenameRegex.exec(disposition);
125 if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, '');
126 }
127
128 var type = xhr.getResponseHeader('Content-Type');
129 var blob = new Blob([response], {
130 type: type
131 });
132
133 if (typeof window.navigator.msSaveBlob !== 'undefined') {
134 // IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed."
135 window.navigator.msSaveBlob(blob, filename);
136 } else {
137 var URL = window.URL || window.webkitURL;
138 var downloadUrl = URL.createObjectURL(blob);
139
140 if (filename) {
141 // use HTML5 a[download] attribute to specify filename
142 var a = document.createElement("a");
143 // safari doesn't support this yet
144 if (typeof a.download === 'undefined') {
145 window.location.href = downloadUrl;
146 } else {
147 a.href = downloadUrl;
148 a.download = filename;
149 document.body.appendChild(a);
150 a.click();
151 }
152 } else {
153 window.location.href = downloadUrl;
154 }
155
156 setTimeout(function() {
157 URL.revokeObjectURL(downloadUrl);
158 }, 100);
159 }
160 NitropackUI.triggerToast('success', "<?php esc_html_e('Report generated successfully.', 'nitropack'); ?>");
161 } else {
162 NitropackUI.triggerToast('error', "<?php esc_html_e('Response is empty. Report generation failed.', 'nitropack'); ?>");
163 }
164 },
165 error: function() {
166 NitropackUI.triggerToast('error', "<?php esc_html_e('There was an error while generating the report.', 'nitropack'); ?>");
167 },
168 complete: function() {
169 $("#diagnostics-loader").hide();
170 isReportGenerating = false;
171 }
172 });
173 });
174 })(jQuery);
175 </script>