PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.7
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.7
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / templates / cache / page-cache.php

page-cache.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.7, at templates/cache/page-cache.php

112 lines 6.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
2 <?php if ($does_server_handles_cache) : ?>
3 <div class="wpo-info highlight-dashicons">
4 <h3><?php _e('Your web hosting company/server handles: ', 'wp-optimize'); ?></h3>
5 <p><?php _e('Page caching', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
6 <p><?php _e('Gzip compression', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
7 <p><?php _e('Browser static file caching (via headers)', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
8 </div>
9 <?php else : ?>
10 <div class="wpo-info">
11 <a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the cache feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
12 <div class="wpo-info__content">
13 <p><strong><?php _e('Not sure how to use the cache feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our how-to video below.', 'wp-optimize'); ?></p>
14 <div class="wpo-video-preview">
15 <a href="https://vimeo.com/337247770" data-embed="https://player.vimeo.com/video/337247770?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/cache-video-preview.png" alt="<?php _e('Cache video preview', 'wp-optimize');?>" /></a>
16 </div>
17 <small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/337247770" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small>
18 </div>
19 </div>
20 <div class="wpo-fieldgroup wpo-first-child cache-options">
21 <div class="notice notice-warning below-h2 wpo-warnings__enabling-cache wpo_hidden"><p></p><ul></ul></div>
22 <div class="notice error below-h2 wpo-error wpo-error__enabling-cache wpo_hidden"><p></p></div>
23
24 <pre id="wpo_advanced_cache_output" style="display: none;"></pre>
25
26 <div class="switch-container">
27 <label class="switch">
28 <input name="enable_page_caching" id="enable_page_caching" class="cache-settings" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_page_caching'] || $wpo_cache->is_enabled()); ?>>
29 <span class="slider round"></span>
30 </label>
31 <label for="enable_page_caching">
32 <?php _e('Enable page caching', 'wp-optimize'); ?>
33 </label>
34 </div>
35 <p>
36 <?php echo __("This is all that's needed for caching to work.", 'wp-optimize').' '.__('WP-Optimize will automatically detect and configure itself optimally for your site.', 'wp-optimize').' '.__('You can tweak the the settings below and in the advanced settings tab, if needed.', 'wp-optimize'); ?>
37 </p>
38
39 <?php if (!empty($active_cache_plugins)) { ?>
40 <p class="wpo-error">
41 <?php
42 printf(__('It looks like you already have an active caching plugin (%s) installed. Having more than one active page cache might cause unexpected results.', 'wp-optimize'), implode(', ', $active_cache_plugins));
43 ?>
44 </p>
45 <?php } ?>
46
47 </div>
48
49 <h3 class="purge-cache" <?php echo $display; ?>> <?php _e('Purge the cache', 'wp-optimize'); ?></h3>
50 <div class="wpo-fieldgroup cache-options purge-cache" <?php echo $display; ?> >
51 <p class="wpo-button-wrap">
52 <input id="wp-optimize-purge-cache" class="button button-primary <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>" type="submit" value="<?php esc_attr_e('Purge cache', 'wp-optimize'); ?>" <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>>
53 <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
54 <span class="save-done dashicons dashicons-yes display-none"></span>
55 </p>
56 <p>
57 <?php _e('Deletes the entire cache contents but keeps the page cache enabled.', 'wp-optimize'); ?>
58 </p>
59 <p>
60 <span id="wpo_current_cache_size_information"><?php _e('Current cache size:', 'wp-optimize'); ?> <?php echo WP_Optimize()->format_size($cache_size['size']); ?></span>
61 <br><span id="wpo_current_cache_file_count"><?php _e('Number of files:', 'wp-optimize'); ?> <?php echo $cache_size['file_count']; ?></span>
62 </p>
63 </div>
64
65 <h3><?php _e('Cache settings', 'wp-optimize'); ?></h3>
66
67 <div class="wpo-fieldgroup cache-options">
68
69 <div class="wpo-fieldgroup__subgroup">
70 <label for="enable_mobile_caching">
71 <input name="enable_mobile_caching" id="enable_mobile_caching" class="cache-settings" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_mobile_caching'], 1); ?>>
72 <?php _e('Generate separate files for mobile devices', 'wp-optimize'); ?>
73 </label>
74 <span tabindex="0" data-tooltip="<?php _e('Useful if your website has mobile-specific content.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
75 </div>
76
77 <div class="wpo-fieldgroup__subgroup">
78 <label for="enable_user_caching">
79 <input name="enable_user_caching" id="enable_user_caching" class="cache-settings wpo-select-group" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_user_caching']); ?>>
80 <?php _e('Serve cached pages to logged in users', 'wp-optimize'); ?>
81 </label>
82 <span tabindex="0" data-tooltip="<?php _e('Enable this option if you do not have user-specific or restricted content on your website.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
83 </div>
84
85 <?php do_action('wpo_after_cache_settings'); ?>
86
87 <div class="wpo-fieldgroup__subgroup">
88 <label for="page_cache_length_value"><?php _e('Cache lifespan', 'wp-optimize'); ?></label>
89 <p>
90 <input name="page_cache_length_value" id="page_cache_length_value" class="cache-settings" type="number" value="<?php echo esc_attr($wpo_cache_options['page_cache_length_value']); ?>">
91 <select name="page_cache_length_unit" id="page_cache_length_unit" class="cache-settings">
92 <option value="hours" <?php selected('hours', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Hours', 'wp-optimize'); ?></option>
93 <option value="days" <?php selected('days', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Days', 'wp-optimize'); ?></option>
94 <option value="months" <?php selected('months', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Months', 'wp-optimize'); ?></option>
95 </select>
96 </p>
97 <span>
98 <?php _e('Time after which a new cached version will be generated (0 = only when the cache is emptied)', 'wp-optimize'); ?>
99 </span>
100 </div>
101
102 <?php do_action('wpo_page_cache_settings_after', $wpo_cache_options); ?>
103
104 </div>
105
106 <input id="wp-optimize-save-cache-settings" class="button button-primary" type="submit" name="wp-optimize-save-cache-settings" value="<?php esc_attr_e('Save changes', 'wp-optimize'); ?>">
107
108 <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="....">
109
110 <span class="save-done dashicons dashicons-yes display-none"></span>
111 <?php endif;
112