PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.9.0
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.9.0
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 / diag.php
nitropack / view Last commit date
images 3 years ago javascript 3 years ago stylesheet 2 years ago admin.php 2 years ago connect-oneclick.php 2 years ago connect.php 2 years ago dashboard-oneclick.php 2 years ago dashboard.php 2 years ago diag.php 3 years ago help.php 3 years ago oneclick.php 2 years ago safemode.php 3 years ago safemode.tpl 4 years ago
diag.php
163 lines
1 <div>
2 <div class="row">
3 <div class="col-md-6 mb-3">
4 <div class="card-overlay-blurrable np-widget" id="diagnostic-widget">
5 <div class="card card-d-item">
6 <div class="card-body">
7 <h5 class="card-title"><?php esc_html_e( 'Diagnostics report', 'nitropack' ); ?></h5>
8 <ul class="list-group list-group-flush">
9 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
10 <span id="loading-general-info">
11 <?php esc_html_e( 'Include NitroPack info(version, methods, environment)', 'nitropack' ); ?>
12 </span>
13 <span id="general-info-toggle">
14 <label id="general-info-slider" class="switch">
15 <input type="checkbox" class="diagnostic-option" id="general-info-status" checked>
16 <span class="slider"></span>
17 </label>
18 </span>
19 </li>
20 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
21 <span id="loading-plugins-status">
22 <?php esc_html_e( 'Include active plugins list', 'nitropack' ); ?>
23 </span>
24 <span id="active-plugins-toggle">
25 <label id="active-plugins-slider" class="switch">
26 <input type="checkbox" class="diagnostic-option" id="active-plugins-status" checked>
27 <span class="slider"></span>
28 </label>
29 </span>
30 </li>
31 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
32 <span id="conflicting-plugins-info">
33 <?php esc_html_e( 'Include conflicting plugins list', 'nitropack' ); ?>
34 </span>
35 <span id="conflicting-plugins-toggle">
36 <label id="conflicting-plugins-slider" class="switch">
37 <input type="checkbox" class="diagnostic-option" id="conflicting-plugins-status" checked>
38 <span class="slider"></span>
39 </label>
40 </span>
41 </li>
42 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
43 <span id="loading-user-config">
44 <?php esc_html_e( 'Include user config', 'nitropack' ); ?>
45 </span>
46 <span id="user-config-toggle">
47 <label id="user-config-slider" class="switch">
48 <input type="checkbox" class="diagnostic-option" id="user-config-status" checked>
49 <span class="slider"></span>
50 </label>
51 </span>
52 </li>
53 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
54 <span id="loading-dir-info">
55 <?php esc_html_e( 'Include directory info(structure,permissions)', 'nitropack' ); ?>
56 </span>
57 <span id="dir-info-toggle">
58 <label id="dir-info-slider" class="switch">
59 <input type="checkbox" class="diagnostic-option" id="dir-info-status" checked>
60 <span class="slider"></span>
61 </label>
62 </span>
63 </li>
64 <li class="list-group-item px-0 d-flex justify-content-between align-items-center">
65 <span>
66 <a id="gen-report-btn" href="javascript:void(0);" class="btn btn-light btn-outline-secondary"><i class="fa fa-refresh fa-spin" style="display:none" id="diagnostics-loader"></i>&nbsp;&nbsp;<?php esc_html_e( 'Generate&nbsp;Report', 'nitropack' ); ?></a>
67 </span>
68 </li>
69 </ul>
70 <p class="mb-0 mt-2"><i class="fa fa-info-circle text-primary" aria-hidden="true"></i> <?php esc_html_e( 'The generated report will be saved to your computer and can later be attached to your ticket.', 'nitropack' ); ?></p>
71 </div>
72 </div>
73 </div>
74 </div>
75 </div>
76 </div>
77 <script>
78
79 ($ => {
80 let isReportGenerating = false;
81
82 $("#gen-report-btn").on("click", function(e) {
83 if (isReportGenerating) return;
84
85 $.ajax({
86 url: ajaxurl,
87 type: "POST",
88 dataType: "text",
89 data: {
90 action: 'nitropack_generate_report',
91 toggled: {
92 "general-info-status": $("#general-info-status:checked").length,
93 "active-plugins-status": $("#active-plugins-status:checked").length,
94 "conflicting-plugins-status": $("#conflicting-plugins-status:checked").length,
95 "user-config-status": $("#user-config-status:checked").length,
96 "dir-info-status": $("#dir-info-status:checked").length
97 }
98 },
99 beforeSend: function (xhr,sett) {
100 if ($(".diagnostic-option:checked").length > 0) {
101 $("#diagnostics-loader").show();
102 isReportGenerating = true;
103 return true;
104 } else {
105 alert("<?php esc_html_e( 'Please select at least one of the report options', 'nitropack' ); ?>");
106 return false;
107 }
108 },
109 success: function(response, status, xhr) {
110 if (response.length > 1) {
111 var filename = "";
112 var disposition = xhr.getResponseHeader('Content-Disposition');
113 if (disposition && disposition.indexOf('attachment') !== -1) {
114 var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
115 var matches = filenameRegex.exec(disposition);
116 if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, '');
117 }
118
119 var type = xhr.getResponseHeader('Content-Type');
120 var blob = new Blob([response], { type: type });
121
122 if (typeof window.navigator.msSaveBlob !== 'undefined') {
123 // 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."
124 window.navigator.msSaveBlob(blob, filename);
125 } else {
126 var URL = window.URL || window.webkitURL;
127 var downloadUrl = URL.createObjectURL(blob);
128
129 if (filename) {
130 // use HTML5 a[download] attribute to specify filename
131 var a = document.createElement("a");
132 // safari doesn't support this yet
133 if (typeof a.download === 'undefined') {
134 window.location.href = downloadUrl;
135 } else {
136 a.href = downloadUrl;
137 a.download = filename;
138 document.body.appendChild(a);
139 a.click();
140 }
141 } else {
142 window.location.href = downloadUrl;
143 }
144
145 setTimeout(function () { URL.revokeObjectURL(downloadUrl); }, 100);
146 }
147 Notification.success("<?php esc_html_e( 'Report generated successfully.', 'nitropack' ); ?>");
148 } else {
149 Notification.error("<?php esc_html_e( 'Response is empty. Report generation failed.', 'nitropack' ); ?>");
150 }
151 },
152 error: function() {
153 Notification.error("<?php esc_html_e( 'There was an error while generating the report.', 'nitropack' ); ?>");
154 },
155 complete: function() {
156 $("#diagnostics-loader").hide();
157 isReportGenerating = false;
158 }
159 });
160 });
161 })(jQuery);
162 </script>
163