PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.15.0
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.15.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 / admin.php
nitropack / view Last commit date
images 2 years ago javascript 2 years ago modals 2 years ago stylesheet 2 years ago templates 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 diagnostics.php 2 years ago oneclick.php 2 years ago safemode.php 2 years ago
admin.php
213 lines
1 <script>
2 let nitroNonce = '<?php echo wp_create_nonce(NITROPACK_NONCE); ?>';
3 </script>
4 <div id="nitropack-container">
5 <nav class="nitro-navigation">
6 <div class="nitro-navigation-inner">
7 <img src="<?php echo plugin_dir_url(__FILE__) . 'images/nitropack_logo.svg'; ?>" height="25" alt="NitroPack" />
8 </div>
9 </nav>
10
11 <main id="main">
12
13 <div class="container">
14 <?php if (count(get_nitropack()->Notifications->get('system')) > 0) { ?>
15 <div class="notification notification-danger" id="notifications">
16 <div class="text-box">
17 <div class="title-wrapper">
18 <img src="<?php echo plugin_dir_url(__FILE__) . 'images/alert-triangle.svg'; ?>" alt="alert" class="icon" />
19 <h5 class="title"><?php esc_html_e('Notifications', 'nitropack'); ?></h5>
20 </div>
21 <ul>
22
23 <?php foreach (get_nitropack()->Notifications->get('system') as $notification) : ?>
24 <li class="grid grid-cols-2 justify-between items-center">
25 <div class="col-span-8">
26 <?php echo $notification['message']; ?>
27 </div>
28 <div class="col-span-4 ml-auto">
29 <a class="btn btn-danger rml_btn" data-notification_end="<?php echo $notification['end_date']; ?>" data-notification_id="<?php echo $notification['id']; ?>">Remind me later</a>
30 </div>
31 </li>
32 <?php endforeach; ?>
33 </ul>
34 </div>
35 </div>
36 <?php } ?>
37 <?php if (!isset($_GET['subpage'])) : ?>
38 <?php require_once NITROPACK_PLUGIN_DIR . "view/dashboard.php";
39 ?>
40 <?php endif; ?>
41
42
43 <?php if (isset($_GET['subpage']) && $_GET['subpage'] == 'diagnostics') : ?>
44 <?php require_once NITROPACK_PLUGIN_DIR . "view/diagnostics.php";
45 ?>
46 <?php endif; ?>
47 </div>
48 </main>
49 <?php require_once NITROPACK_PLUGIN_DIR . 'view/templates/template-toast.php'; ?>
50 </div>
51
52 <?php if (NITROPACK_SUPPORT_BUBBLE_VISIBLE) { ?>
53 <div class="support-widget">
54 <!-- support widget -->
55 <script>
56 window.intercomSettings = {
57 api_base: "https://api-iam.intercom.io",
58 app_id: "d5v9p9vg"
59 };
60
61 (function() {
62 var w = window;
63 var ic = w.Intercom;
64 if (typeof ic === "function") {
65 ic('reattach_activator');
66 ic('update', w.intercomSettings);
67 } else {
68 var d = document;
69 var i = function() {
70 i.c(arguments);
71 };
72 i.q = [];
73 i.c = function(args) {
74 i.q.push(args);
75 };
76 w.Intercom = i;
77 var l = function() {
78 var s = d.createElement('script');
79 s.type = 'text/javascript';
80 s.async = true;
81 s.src = 'https://widget.intercom.io/widget/d5v9p9vg';
82 var x = d.getElementsByTagName('script')[0];
83 x.parentNode.insertBefore(s, x);
84 };
85 if (document.readyState === 'complete') {
86 l();
87 } else if (w.attachEvent) {
88 w.attachEvent('onload', l);
89 } else {
90 w.addEventListener('load', l, false);
91 }
92 }
93 })();
94 </script>
95 <!-- end support widget -->
96 </div>
97 <?php } ?>
98 <script>
99 (function($) {
100 window.Notification = (_ => {
101 var timeout;
102
103 var display = (msg, type) => {
104 clearTimeout(timeout);
105 $('#nitropack-notification').remove();
106
107 $('[name="form"]').prepend('<div id="nitropack-notification" class="notice notice-' + type + '" is-dismissible"><p>' + msg + '</p></div>');
108
109 timeout = setTimeout(_ => {
110 $('#nitropack-notification').remove();
111 }, 10000);
112 loadDismissibleNotices();
113 }
114
115 return {
116 success: msg => {
117 display(msg, 'success');
118 },
119 error: msg => {
120 display(msg, 'error');
121 },
122 info: msg => {
123 display(msg, 'info');
124 },
125 warning: msg => {
126 display(msg, 'warning');
127 }
128 }
129 })();
130
131 const clearCacheHandler = clearCacheAction => {
132 return function(success, error) {
133 $.ajax({
134 url: ajaxurl,
135 type: 'GET',
136 data: {
137 action: "nitropack_" + clearCacheAction + "_cache",
138 nonce: nitroNonce
139 },
140 dataType: 'json',
141 beforeSend: function() {
142 $('#optimizations-purge-cache').attr('disabled', true);
143 },
144 success: function(data) {
145 if (data.type === 'success') {
146 NitropackUI.triggerToast('success', data.message);
147 cacheEvent = new Event("cache." + clearCacheAction + ".success");
148 } else {
149
150 NitropackUI.triggerToast('error', data.message);
151 cacheEvent = new Event("cache." + clearCacheAction + ".error");
152 }
153 window.dispatchEvent(cacheEvent);
154 },
155 error: function(data) {
156
157 NitropackUI.triggerToast('error', data.message);
158 cacheEvent = new Event("cache." + clearCacheAction + ".error");
159 window.dispatchEvent(cacheEvent);
160 },
161 complete: function() {
162 setTimeout(function() {
163 $('#optimizations-purge-cache').attr('disabled', false);
164 }, 3000);
165 }
166 });
167 };
168 }
169
170 $(window).on("load", _ => {
171 //Remove styles from jobcareer and jobhunt plugins since they break our layout. They should not be loaded on our options page anyway.
172 $('link[href*="jobcareer"').remove();
173 $('link[href*="jobhunt"').remove();
174
175 $("#dashboard").addClass("show active");
176 window.addEventListener('cache.invalidate.request', clearCacheHandler("invalidate"));
177 window.addEventListener('cache.purge.request', clearCacheHandler("purge"));
178
179 });
180 const loading_icon = '<img src="<?php echo plugin_dir_url(__FILE__); ?>/images/loading.svg" width="14" class="icon loading"/>',
181 success_icon = '<img src="<?php echo plugin_dir_url(__FILE__); ?>/images/check.svg" width="16" class="icon success"/>';
182
183 $("#nitro-restore-connection-btn").on("click", function() {
184 $.ajax({
185 url: ajaxurl,
186 type: 'GET',
187 data: {
188 action: "nitropack_reconfigure_webhooks",
189 nonce: nitroNonce
190 },
191 dataType: 'json',
192 beforeSend: function() {
193 $("#nitro-restore-connection-btn").attr("disabled", true).html(loading_icon);
194 },
195 success: function(data) {
196 if (!data.status || data.status != "success") {
197 if (data.message) {
198 alert("<?php esc_html_e('Error:', 'nitropack'); ?> " + data.message);
199 } else {
200 alert("<?php esc_html_e('Error: We were unable to restore the connection. Please contact our support team to get this resolved.', 'nitropack'); ?>");
201 }
202 } else {
203 $("#nitro-restore-connection-btn").attr("disabled", true).html(success_icon);
204 NitropackUI.triggerToast('success', data.message);
205 }
206 },
207 complete: function() {
208 location.reload();
209 }
210 });
211 });
212 })(jQuery);
213 </script>