| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
* Settings page template |
| 5 |
* |
| 6 |
* @package PoweredCache |
| 7 |
* @subpackage PoweredCache/Settings |
| 8 |
*/ |
| 9 |
|
| 10 |
// Exit if accessed directly |
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
?> |
| 16 |
|
| 17 |
<div class="meta-box-sortables ui-sortable"> |
| 18 |
<div class="postbox"> |
| 19 |
<div class="inside"> |
| 20 |
|
| 21 |
<table class="form-table"> |
| 22 |
<tbody> |
| 23 |
<tr> |
| 24 |
<th scope="row"><label for="powered_cache_caching_status"><?php _e( 'Page Cache', 'powered-cache' ); ?></label></th> |
| 25 |
<td> |
| 26 |
<label><input type="checkbox" <?php checked( powered_cache_get_option( 'enable_page_caching' ), 1 ); ?> id="powered_cache_caching_status" name="powered_cache_settings[enable_page_caching]" value="1"> |
| 27 |
<?php _e( 'Enable page caching that will reduce the response time of your site.', 'powered-cache' ); ?> |
| 28 |
(<a target="_blank" href="http://docs.poweredcache.com/article/4-page-cache">?</a>) |
| 29 |
</label> |
| 30 |
<?php global $is_apache; |
| 31 |
if ( $is_apache && ( ( is_multisite() && current_user_can( 'manage_network' ) ) || ( ! is_multisite() && current_user_can( 'activate_plugins' ) ) ) ): ?> |
| 32 |
<div id="configure-htaccess-option"> |
| 33 |
<label><input type="checkbox" id="cache_configure_htaccess" name="powered_cache_settings[configure_htaccess]" <?php checked( powered_cache_get_option( 'configure_htaccess' ), 1 ); ?> value="1"><?php _e( 'Configure <code>.htaccess</code> file automatically.', 'powered-cache' ); ?></label> |
| 34 |
</div> |
| 35 |
<?php endif; ?> |
| 36 |
</td> |
| 37 |
</tr> |
| 38 |
|
| 39 |
<?php |
| 40 |
// additional control needed for cache flushing |
| 41 |
if ( ( is_multisite() && current_user_can( 'manage_network' ) ) || ( ! is_multisite() && current_user_can( 'activate_plugins' ) ) ): ?> |
| 42 |
<tr> |
| 43 |
<th scope="row"><label for="powered_cache_object_cache"><?php _e( 'Object Caching', 'powered-cache' ); ?></label></th> |
| 44 |
<td> |
| 45 |
<select name="powered_cache_settings[object_cache]" id="powered_cache_object_cache"> |
| 46 |
<option value="off" <?php selected( powered_cache_get_option( 'object_cache' ), 'off' ); ?>><?php _e( 'Off', 'powered-cache' ); ?></option> |
| 47 |
<?php |
| 48 |
foreach($object_cache_methods as $obj_cache): |
| 49 |
?> |
| 50 |
<option <?php selected( powered_cache_get_option( 'object_cache' ), $obj_cache ); ?> value="<?php echo $obj_cache; ?>"><?php echo ucfirst( $obj_cache ); ?></option> |
| 51 |
<?php endforeach;?> |
| 52 |
</select> |
| 53 |
<?php echo __( 'Speed up dynamic pageviews', 'powered-cache' ); ?> |
| 54 |
(<a target="_blank" href="http://docs.poweredcache.com/article/6-object-cache">?</a>) |
| 55 |
</td> |
| 56 |
</tr> |
| 57 |
<?php endif; ?> |
| 58 |
|
| 59 |
<tr> |
| 60 |
<th scope="row"><label for="powered_cache_mobile_cache"><?php _e( 'Mobile Cache', 'powered-cache' ); ?></label></th> |
| 61 |
<td> |
| 62 |
<label><input type="checkbox" id="powered_cache_mobile_cache" name="powered_cache_settings[cache_mobile]" <?php checked( powered_cache_get_option( 'cache_mobile' ), 1 ); ?> value="1"><?php _e('Enable caching for mobile devices.','powered-cache'); ?></label> |
| 63 |
|
| 64 |
<div id="separate-mobile-cache" style="display:<?php echo( '1' == powered_cache_get_option( 'cache_mobile' ) ? '' : 'none;' ) ?>"> |
| 65 |
<label><input type="checkbox" id="cache_mobile_separate_file" name="powered_cache_settings[cache_mobile_separate_file]" <?php checked( powered_cache_get_option( 'cache_mobile_separate_file' ), 1 ); ?> value="1"><?php _e('Use separate cache file for mobile.','powered-cache'); ?></label> |
| 66 |
</div> |
| 67 |
(<a target="_blank" href="http://docs.poweredcache.com/article/7-mobile-cache">?</a>) |
| 68 |
|
| 69 |
</td> |
| 70 |
</tr> |
| 71 |
|
| 72 |
<tr> |
| 73 |
<th scope="row"><label for="powered_cache_loggedin_user_cache"><?php _e( 'Logged in user cache', 'powered-cache' ); ?></label></th> |
| 74 |
<td> |
| 75 |
<label><input type="checkbox" id="powered_cache_loggedin_user_cache" name="powered_cache_settings[loggedin_user_cache]" <?php checked( powered_cache_get_option( 'loggedin_user_cache' ), 1 ); ?> value="1"><?php _e('Show cached page for logged in users','powered-cache'); ?></label> |
| 76 |
(<a target="_blank" href="http://docs.poweredcache.com/article/8-logged-in-user-cache">?</a>) |
| 77 |
</td> |
| 78 |
</tr> |
| 79 |
|
| 80 |
<tr> |
| 81 |
<th scope="row"><label for="powered_cache_ssl_cache"><?php _e( 'SSL Cache', 'powered-cache' ); ?></label></th> |
| 82 |
<td> |
| 83 |
<label><input type="checkbox" id="powered_cache_ssl_cache" name="powered_cache_settings[ssl_cache]" <?php checked( powered_cache_get_option( 'ssl_cache' ), 1 ); ?> value="1"><?php _e('Enable caching for SSL','powered-cache'); ?></label> |
| 84 |
(<a target="_blank" href="http://docs.poweredcache.com/article/9-caching-on-https">?</a>) |
| 85 |
</td> |
| 86 |
</tr> |
| 87 |
|
| 88 |
<tr> |
| 89 |
<th scope="row"><label for="powered_cache_gzip_status"><?php _e( 'Gzip', 'powered-cache' ); ?></label></th> |
| 90 |
<td> |
| 91 |
<label><input type="checkbox" id="powered_cache_gzip_status" name="powered_cache_settings[gzip_compression]" <?php checked( powered_cache_get_option( 'gzip_compression' ), 1 ); ?> value="1"><?php _e('Enable gzip compression','powered-cache'); ?></label> |
| 92 |
(<a target="_blank" href="http://docs.poweredcache.com/article/15-enable-gzip-compression">?</a>) |
| 93 |
</td> |
| 94 |
</tr> |
| 95 |
|
| 96 |
<tr> |
| 97 |
<th scope="row"><label for="powered_cache_cache_timeout"><?php _e( 'Cache Timeout', 'powered-cache' ); ?></label></th> |
| 98 |
<td> |
| 99 |
<?php |
| 100 |
$cache_timeout_in_minutes = powered_cache_get_option( 'cache_timeout' ); |
| 101 |
list( $cache_timeout, $selected_interval ) = Powered_Cache_Admin_Helper::get_timeout_interval( $cache_timeout_in_minutes ); |
| 102 |
?> |
| 103 |
<label><input size="5" id="powered_cache_cache_timeout" type="text" value="<?php echo $cache_timeout; ?>" name="powered_cache_settings[cache_timeout]"> </label> |
| 104 |
<label> |
| 105 |
<select name="powered_cache_settings[cache_timeout_interval]" id="powered_cache_cache_timeout_interval"> |
| 106 |
<option <?php selected( 'MINUTE', $selected_interval ); ?> value="MINUTE"><?php echo __( 'Minute', 'powered-cache' ); ?></option> |
| 107 |
<option <?php selected( 'HOUR', $selected_interval ); ?> value="HOUR"><?php echo __( 'Hour', 'powered-cache' ); ?></option> |
| 108 |
<option <?php selected( 'DAY', $selected_interval ); ?> value="DAY"><?php echo __( 'Day', 'powered-cache' ); ?></option> |
| 109 |
</select> |
| 110 |
</label> |
| 111 |
(<a target="_blank" href="http://docs.poweredcache.com/article/10-cache-timeout">?</a>) |
| 112 |
</td> |
| 113 |
</tr> |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
</tbody> |
| 118 |
</table> |
| 119 |
|
| 120 |
</div> |
| 121 |
<!-- .inside --> |
| 122 |
|
| 123 |
</div> |
| 124 |
<!-- .postbox --> |
| 125 |
|
| 126 |
</div> |
| 127 |
|