Change the meta conditional and add to the panel
This commit is contained in:
parent
5fcd580d3d
commit
510dd9ea25
2 changed files with 24 additions and 10 deletions
|
@ -149,13 +149,10 @@ if ( $wp_ffpc_backend->status() === false ) {
|
||||||
/* include the mobile detect */
|
/* include the mobile detect */
|
||||||
include_once ('backends/mobile-detect.php');
|
include_once ('backends/mobile-detect.php');
|
||||||
$mobile_detect = new Mobile_Detect;
|
$mobile_detect = new Mobile_Detect;
|
||||||
|
|
||||||
/* verify if mobile device (phones or tablets). */
|
/* verify if mobile device (phones or tablets). */
|
||||||
if ($mobile_detect->isMobile() ) {
|
$wp_ffpc_keys = ($mobile_detect->isMobile() ?
|
||||||
$wp_ffpc_keys = array ( 'meta' => $wp_ffpc_config['prefix_meta']. 'mobile_', 'data' => $wp_ffpc_config['prefix_data']. 'mobile_' );
|
array ( 'meta' => $wp_ffpc_config['prefix_meta_mobile'], 'data' => $wp_ffpc_config['prefix_data_mobile'] ) :
|
||||||
} else {
|
array ( 'meta' => $wp_ffpc_config['prefix_meta'], 'data' => $wp_ffpc_config['prefix_data']);
|
||||||
$wp_ffpc_keys = array ( 'meta' => $wp_ffpc_config['prefix_meta'], 'data' => $wp_ffpc_config['prefix_data']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$wp_ffpc_values = array();
|
$wp_ffpc_values = array();
|
||||||
|
|
||||||
|
@ -320,6 +317,8 @@ function wp_ffpc_callback( $buffer ) {
|
||||||
global $wp_ffpc_backend;
|
global $wp_ffpc_backend;
|
||||||
/* check is it's a redirect */
|
/* check is it's a redirect */
|
||||||
global $wp_ffpc_redirect;
|
global $wp_ffpc_redirect;
|
||||||
|
/* check is it's a mobile version*/
|
||||||
|
global $mobile_detect;
|
||||||
|
|
||||||
/* no is_home = error, WordPress functions are not availabe */
|
/* no is_home = error, WordPress functions are not availabe */
|
||||||
if (!function_exists('is_home'))
|
if (!function_exists('is_home'))
|
||||||
|
@ -468,8 +467,7 @@ function wp_ffpc_callback( $buffer ) {
|
||||||
|
|
||||||
/* add generation info is option is set, but only to HTML */
|
/* add generation info is option is set, but only to HTML */
|
||||||
if ( $wp_ffpc_config['generate_time'] == '1' && stripos($buffer, '</body>') ) {
|
if ( $wp_ffpc_config['generate_time'] == '1' && stripos($buffer, '</body>') ) {
|
||||||
global $wp_ffpc_gentime,
|
global $wp_ffpc_gentime;
|
||||||
$mobile_detect;
|
|
||||||
|
|
||||||
/* verify the device type to output into the generation stats */
|
/* verify the device type to output into the generation stats */
|
||||||
$device_type = $mobile_detect -> isMobile() ? 'mobile': 'desktop';
|
$device_type = $mobile_detect -> isMobile() ? 'mobile': 'desktop';
|
||||||
|
@ -496,10 +494,10 @@ function wp_ffpc_callback( $buffer ) {
|
||||||
*/
|
*/
|
||||||
$to_store = apply_filters( 'wp-ffpc-to-store', $to_store );
|
$to_store = apply_filters( 'wp-ffpc-to-store', $to_store );
|
||||||
|
|
||||||
$prefix_meta = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] );
|
$prefix_meta = ($mobile_detect -> isMobile())? $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta_mobile'] ): $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] );
|
||||||
$wp_ffpc_backend->set ( $prefix_meta, $meta );
|
$wp_ffpc_backend->set ( $prefix_meta, $meta );
|
||||||
|
|
||||||
$prefix_data = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] );
|
$prefix_data = ($mobile_detect -> isMobile())? $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data_mobile'] ): $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] );
|
||||||
$wp_ffpc_backend->set ( $prefix_data , $to_store );
|
$wp_ffpc_backend->set ( $prefix_data , $to_store );
|
||||||
|
|
||||||
if ( !empty( $meta['status'] ) && $meta['status'] == 404 ) {
|
if ( !empty( $meta['status'] ) && $meta['status'] == 404 ) {
|
||||||
|
|
|
@ -617,6 +617,14 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
||||||
<span class="description"><?php _e('Prefix for HTML content keys, can be used in nginx.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!<br />If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?></span>
|
<span class="description"><?php _e('Prefix for HTML content keys, can be used in nginx.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!<br />If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt>
|
||||||
|
<label for="prefix_data"><?php _e('Mobile Data prefix', 'wp-ffpc'); ?></label>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<input type="text" name="prefix_data" id="prefix_data" value="<?php echo $this->options['prefix_data_mobile']; ?>" />
|
||||||
|
<span class="description"><?php _e('Prefix for HTML content keys, can be used in nginx.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!<br />If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt>
|
<dt>
|
||||||
<label for="prefix_meta"><?php _e('Meta prefix', 'wp-ffpc'); ?></label>
|
<label for="prefix_meta"><?php _e('Meta prefix', 'wp-ffpc'); ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
@ -625,6 +633,14 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
||||||
<span class="description"><?php _e('Prefix for meta content keys, used only with PHP processing.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!', 'wp-ffpc'); ?></span>
|
<span class="description"><?php _e('Prefix for meta content keys, used only with PHP processing.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!', 'wp-ffpc'); ?></span>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt>
|
||||||
|
<label for="prefix_meta"><?php _e('Mobile eta prefix', 'wp-ffpc'); ?></label>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<input type="text" name="prefix_meta" id="prefix_meta" value="<?php echo $this->options['prefix_meta_mobile']; ?>" />
|
||||||
|
<span class="description"><?php _e('Prefix for meta content keys, used only with PHP processing.<br /><strong>WARNING</strong>: changing this will result the previous cache to becomes invalid!', 'wp-ffpc'); ?></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt>
|
<dt>
|
||||||
<label for="key"><?php _e('Key scheme', 'wp-ffpc'); ?></label>
|
<label for="key"><?php _e('Key scheme', 'wp-ffpc'); ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
|
Loading…
Reference in a new issue