modals
3 days ago
templates
1 month ago
admin.php
1 month ago
connect-oneclick.php
1 month ago
connect.php
2 weeks ago
dashboard-oneclick.php
1 month ago
dashboard.php
1 month ago
oneclick.php
1 month ago
preview-site.php
7 months ago
system-report.php
4 months ago
dashboard-oneclick.php
105 lines
| 1 | <?php |
| 2 | $settings = new \NitroPack\WordPress\Settings(); |
| 3 | $notifications = new \NitroPack\WordPress\Notifications\Notifications(); |
| 4 | |
| 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 | if ( ! $nitro ) { |
| 16 | ?> |
| 17 | <div class="card"> |
| 18 | <div class="card-header"> |
| 19 | <h3><?php esc_html_e( 'NitroPack failed to connect correctly', 'nitropack' ); ?> |
| 20 | </h3> |
| 21 | </div> |
| 22 | <div class="card-body"> |
| 23 | <p><?php esc_html_e( 'This usually happens when the plugin is installed and the connection process is started, but for some reason the connection process is not completed.', 'nitropack' ); ?><br> |
| 24 | <?php esc_html_e( 'Please disconnect and re-connect the plugin again and make sure your API key is correct and the site is connected in', 'nitropack' ); ?> |
| 25 | <a href="https://app.nitropack.io/dashboard" target="_blank">https://app.nitropack.io/dashboard</a> |
| 26 | </p> |
| 27 | <p><?php esc_html_e( 'If the issue persists, please contact our support team.', 'nitropack' ); ?></p> |
| 28 | </div> |
| 29 | <div class="card-footer disconnect-container"> |
| 30 | <a class="btn btn-primary" id="disconnect-btn"><?php esc_html_e( 'Disconnect NitroPack', 'nitropack' ); ?></a> |
| 31 | <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-disconnect.php'; ?> |
| 32 | </div> |
| 33 | </div> |
| 34 | <?php |
| 35 | return; |
| 36 | } |
| 37 | try { |
| 38 | $cache_warmup_stats = $nitro->getApi()->getWarmupStats(); |
| 39 | } catch ( \Exception $e ) { |
| 40 | $cache_warmup_stats = [ 'status' => 0 ]; |
| 41 | } |
| 42 | $cache_warmup_enabled = ! empty( $cache_warmup_stats['status'] ) && $cache_warmup_stats['status'] === 1 ? true : false; |
| 43 | ?> |
| 44 | <div class="grid grid-cols-2 gap-6 grid-col-1-tablet items-start nitropack-dashboard"> |
| 45 | <div class="col-span-1"> |
| 46 | <!-- Optimized Pages Card --> |
| 47 | <?php $settings->optimizations->render(); ?> |
| 48 | |
| 49 | <!-- Optimization Mode Card --> |
| 50 | <?php $settings->optimization_level->render(); ?> |
| 51 | |
| 52 | <div class="card card-automated-behavior"> |
| 53 | <div class="card-header"> |
| 54 | <h3><?php esc_html_e( 'Automated Behavior', 'nitropack' ); ?></h3> |
| 55 | </div> |
| 56 | <div class="card-body"> |
| 57 | <div class="options-container"> |
| 58 | <?php $settings->auto_purge->render(); |
| 59 | $settings->cpt_optimization->render(); ?> |
| 60 | |
| 61 | </div> |
| 62 | </div> |
| 63 | </div> |
| 64 | <!-- Automated Behavior Card End --> |
| 65 | <!-- Go to app Card --> |
| 66 | <div class="card exclusion-card"> |
| 67 | <div class="card-header"> |
| 68 | <h3><?php esc_html_e( 'Exclusions', 'nitropack' ); ?></h3> |
| 69 | </div> |
| 70 | <div class="card-body"> |
| 71 | <div class="options-container"> |
| 72 | <?php $settings->shortcodes->render(); ?> |
| 73 | </div> |
| 74 | </div> |
| 75 | </div> |
| 76 | <!-- Go to app card End --> |
| 77 | </div> |
| 78 | <div class="col-span-1"> |
| 79 | <!-- Basic Settings Card --> |
| 80 | <div class="card card-basic-settings"> |
| 81 | <div class="card-header"> |
| 82 | <h3><?php esc_html_e( 'Basic Settings', 'nitropack' ); ?></h3> |
| 83 | </div> |
| 84 | <div class="card-body"> |
| 85 | <div class="options-container"> |
| 86 | <?php |
| 87 | $settings->cache_warmup->render(); |
| 88 | $settings->test_mode->render(); |
| 89 | $settings->html_compression->render(); |
| 90 | $settings->beaver_builder->render(); |
| 91 | $settings->editor_clear_cache->render(); |
| 92 | ?> |
| 93 | </div> |
| 94 | </div> |
| 95 | </div> |
| 96 | </div> |
| 97 | <?php |
| 98 | $CPTOptimization = NitroPack\WordPress\Settings\CPTOptimization::getInstance(); |
| 99 | $notOptimizedCPTs = $CPTOptimization->nitropack_filter_non_optimized(); |
| 100 | $notices = get_option( 'nitropack-dismissed-notices', [] ); |
| 101 | $optimizedCPT_notice = in_array( 'OptimizeCPT', $notices, true ) ? true : false; |
| 102 | if ( ! $optimizedCPT_notice && ! empty( $notOptimizedCPTs ) ) |
| 103 | require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-not-optimized-CPT.php'; ?> |
| 104 | </div> |
| 105 | <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-unsaved-changes.php'; ?> |