PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.19.4
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.19.4
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 / dashboard.php
nitropack / view Last commit date
animations 7 months ago images 3 months ago javascript 2 months ago modals 3 months ago stylesheet 2 months ago templates 1 year ago admin.php 3 months ago connect-oneclick.php 3 months ago connect.php 7 months ago dashboard-oneclick.php 3 months ago dashboard.php 3 months ago oneclick.php 3 months ago preview-site.php 7 months ago system-report.php 4 months ago
dashboard.php
149 lines
1 <?php
2 $settings = new \NitroPack\WordPress\Settings();
3 $components = new \NitroPack\WordPress\Settings\Components();
4 $notifications = new \NitroPack\WordPress\Notifications\Notifications();
5 $conflictingPlugins = \NitroPack\WordPress\ConflictingPlugins::getInstance();
6 $conflictingPlugins_list = $conflictingPlugins->nitropack_get_conflicting_plugins();
7 if ( $conflictingPlugins_list ) {
8 require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-plugin-deactivate.php';
9 }
10
11 $notifications->nitropack_display_admin_notices();
12 $dismissed_notices = get_option( 'nitropack-dismissed-notices' );
13
14 $nitro = get_nitropack_sdk();
15 try {
16 $cache_warmup_stats = $nitro->getApi()->getWarmupStats();
17 } catch ( \Exception $e ) {
18 $cache_warmup_stats = [ 'status' => 0 ];
19 }
20 $cache_warmup_enabled = ! empty( $cache_warmup_stats['status'] ) && $cache_warmup_stats['status'] === 1 ? true : false;
21
22 if ( empty( $dismissed_notices['skip_cache_warmup'] ) && ! $cache_warmup_enabled ) : ?>
23 <div class="card cache-warmup">
24 <div class="progress-wrapper mb-4">
25 <div class="progress-bar">
26 <div class="progress" style="width: 100%;"></div>
27 </div>
28 <div class="step"><?php esc_html_e( 'Step', 'nitropack' ); ?> 3/3</div>
29 </div>
30 <div class="card-body">
31 <h3><?php esc_html_e( 'Enable proactive optimizations', 'nitropack' ); ?>
32 </h3>
33 <p><?php esc_html_e( 'Turn on Cache Warmup so NitroPack can start optimizing your pages immediately, without waiting for traffic. This guarantees a fast site for every visitor right from the start.', 'nitropack' ); ?>
34 </p>
35 </div>
36 <div class="card-footer">
37 <button id="enable-cache-warmup"
38 class="btn btn-primary"><?php esc_html_e( 'Enable Cache Warmup', 'nitropack' ); ?></button>
39 <a id="skip-cache-warmup" class="btn btn-secondary ml-2"><?php esc_html_e( 'Skip', 'nitropack' ); ?></a>
40 </div>
41 </div>
42 <?php endif; ?>
43 <div class="grid grid-cols-2 gap-6 grid-col-1-tablet items-start nitropack-dashboard">
44 <div class="col-span-1">
45 <!-- Go to app Card -->
46 <div class="card app-card">
47 <div class="card-header">
48 <h3><?php esc_html_e( 'Customize NitroPack\'s Optimization Settings in Your Account', 'nitropack' ); ?>
49 </h3>
50 </div>
51 <div class="card-body">
52 <div class="flex items-center justify-between">
53 <div class="text-box">
54 <p>
55 <?php esc_html_e( 'You can further configure how NitroPack\'s optimization behaves through your account.', 'nitropack' ); ?>
56 </p>
57 </div>
58 <?php
59 function getNitropackDashboardUrl() {
60 $siteId = nitropack_get_current_site_id();
61 $dashboardUrl = 'https://app.nitropack.io/dashboard';
62
63 if ( $siteId !== null ) {
64 $dashboardUrl .= '?update_session_website_id=' . urlencode( $siteId );
65 }
66
67 return $dashboardUrl;
68 }
69 echo $components->render_button( [ 'text' => 'Go to app', 'type' => null, 'classes' => 'btn btn-primary ml-2 flex-shrink-0', 'href' => esc_url( getNitropackDashboardUrl() ), 'attributes' => [ 'target' => '_blank' ] ] );
70 ?>
71
72 </div>
73 </div>
74 </div>
75 <!-- Go to app card End -->
76 <!-- Optimized Pages Card -->
77 <?php $settings->optimizations->render(); ?>
78 <!-- Optimized Pages Card End -->
79 <!-- Optimization Mode Card -->
80 <?php $settings->optimization_level->render(); ?>
81 <!-- Optimization Mode Card End -->
82 <!-- Automated Behavior Card -->
83 <div class="card card-automated-behavior">
84 <div class="card-header">
85 <h3><?php esc_html_e( 'Automated Behavior', 'nitropack' ); ?></h3>
86 </div>
87 <div class="card-body">
88 <div class="options-container">
89 <?php $settings->auto_purge->render();
90 $settings->cpt_optimization->render(); ?>
91 </div>
92 </div>
93 </div>
94 <!-- Automated Behavior Card End -->
95 <!-- Go to app Card -->
96 <div class="card exclusion-card">
97 <div class="card-header">
98 <h3><?php esc_html_e( 'Exclusions', 'nitropack' ); ?></h3>
99 </div>
100 <div class="card-body">
101 <div class="options-container">
102 <?php $settings->shortcodes->render(); ?>
103 </div>
104 </div>
105 </div>
106 <!-- Go to app card End -->
107 </div>
108 <div class="col-span-1">
109 <!-- Subscription Card -->
110 <?php $settings->subscription->render(); ?>
111
112 <!-- Subscription Card End -->
113 <!-- Basic Settings Card -->
114 <div class="card card-basic-settings">
115 <div class="card-header">
116 <h3><?php esc_html_e( 'Basic Settings', 'nitropack' ); ?></h3>
117 </div>
118 <div class="card-body">
119 <div class="options-container">
120 <?php
121 $settings->cache_warmup->render();
122 $settings->test_mode->render();
123 $settings->html_compression->render();
124 $settings->beaver_builder->render();
125 $settings->editor_clear_cache->render();
126 if ( class_exists( 'WooCommerce' ) ) { ?>
127 <?php $settings->cart_cache->render(); ?>
128 <?php $settings->stock_refresh->render();
129 } ?>
130 </div>
131 </div>
132 <div class="card-footer disconnect-container">
133 <a class="text-primary btn-link"
134 id="disconnect-btn"><?php esc_html_e( 'Disconnect NitroPack plugin', 'nitropack' ); ?></a>
135 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-disconnect.php'; ?>
136 </div>
137 </div>
138 <!-- Basic Settings Card End -->
139
140 </div>
141 <?php $CPTOptimization = NitroPack\WordPress\Settings\CPTOptimization::getInstance();
142 $notOptimizedCPTs = $CPTOptimization->nitropack_filter_non_optimized();
143 $notices = get_option( 'nitropack-dismissed-notices', [] );
144 $optimizedCPT_notice = in_array( 'OptimizeCPT', $notices, true ) ? true : false;
145 if ( ! $optimizedCPT_notice && ! empty( $notOptimizedCPTs ) )
146 require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-not-optimized-CPT.php'; ?>
147
148 </div>
149 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-unsaved-changes.php'; ?>