PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.10.3
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.10.3
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 2 years ago javascript 2 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 2 years ago help.php 3 years ago oneclick.php 2 years ago safemode.php 2 years ago safemode.tpl 4 years ago
diag.php
164 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 nonce: nitroNonce,
92 toggled: {
93 "general-info-status": $("#general-info-status:checked").length,
94 "active-plugins-status": $("#active-plugins-status:checked").length,
95 "conflicting-plugins-status": $("#conflicting-plugins-status:checked").length,
96 "user-config-status": $("#user-config-status:checked").length,
97 "dir-info-status": $("#dir-info-status:checked").length
98 }
99 },
100 beforeSend: function (xhr,sett) {
101 if ($(".diagnostic-option:checked").length > 0) {
102 $("#diagnostics-loader").show();
103 isReportGenerating = true;
104 return true;
105 } else {
106 alert("<?php esc_html_e( 'Please select at least one of the report options', 'nitropack' ); ?>");
107 return false;
108 }
109 },
110 success: function(response, status, xhr) {
111 if (response.length > 1) {
112 var filename = "";
113 var disposition = xhr.getResponseHeader('Content-Disposition');
114 if (disposition && disposition.indexOf('attachment') !== -1) {
115 var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
116 var matches = filenameRegex.exec(disposition);
117 if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, '');
118 }
119
120 var type = xhr.getResponseHeader('Content-Type');
121 var blob = new Blob([response], { type: type });
122
123 if (typeof window.navigator.msSaveBlob !== 'undefined') {
124 // 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."
125 window.navigator.msSaveBlob(blob, filename);
126 } else {
127 var URL = window.URL || window.webkitURL;
128 var downloadUrl = URL.createObjectURL(blob);
129
130 if (filename) {
131 // use HTML5 a[download] attribute to specify filename
132 var a = document.createElement("a");
133 // safari doesn't support this yet
134 if (typeof a.download === 'undefined') {
135 window.location.href = downloadUrl;
136 } else {
137 a.href = downloadUrl;
138 a.download = filename;
139 document.body.appendChild(a);
140 a.click();
141 }
142 } else {
143 window.location.href = downloadUrl;
144 }
145
146 setTimeout(function () { URL.revokeObjectURL(downloadUrl); }, 100);
147 }
148 Notification.success("<?php esc_html_e( 'Report generated successfully.', 'nitropack' ); ?>");
149 } else {
150 Notification.error("<?php esc_html_e( 'Response is empty. Report generation failed.', 'nitropack' ); ?>");
151 }
152 },
153 error: function() {
154 Notification.error("<?php esc_html_e( 'There was an error while generating the report.', 'nitropack' ); ?>");
155 },
156 complete: function() {
157 $("#diagnostics-loader").hide();
158 isReportGenerating = false;
159 }
160 });
161 });
162 })(jQuery);
163 </script>
164