= 1.11.1 =
* exclude cache for WooCommerce * fix load textdomain * add Italian (it_IT) translation
This commit is contained in:
parent
d09fa5828b
commit
ee76a2a9d8
5 changed files with 640 additions and 591 deletions
12
readme.txt
12
readme.txt
|
@ -3,8 +3,8 @@ Contributors: cadeyrn, ameir, haroldkyle, plescheff, dkcwd, IgorCode
|
|||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC
|
||||
Tags: cache, page cache, full page cache, nginx, memcached, apc, speed
|
||||
Requires at least: 3.0
|
||||
Tested up to: 4.4.1
|
||||
Stable tag: 1.11.0
|
||||
Tested up to: 4.5
|
||||
Stable tag: 1.11.1
|
||||
License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
@ -82,6 +82,7 @@ Many thanks for donations, contributors, supporters, testers & bug reporters:
|
|||
* Gausden Barry
|
||||
* Maksim Bukreyeu
|
||||
* Lissome Hong Kong Limited
|
||||
* [Gabriele Lauricella](https://github.com/gablau)
|
||||
|
||||
== Installation ==
|
||||
|
||||
|
@ -131,6 +132,13 @@ Version numbering logic:
|
|||
* every .B version indicates new features.
|
||||
* every ..C indicates bugfixes for A.B version.
|
||||
|
||||
= 1.11.1 =
|
||||
*2016-04-21*
|
||||
|
||||
* exclude cache for WooCommerce
|
||||
* fix load textdomain
|
||||
* add Italian (it_IT) translation
|
||||
|
||||
= 1.11.0 =
|
||||
*2016-01-15*
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ abstract class WP_FFPC_ABSTRACT {
|
|||
|
||||
add_action( 'init', array(&$this,'plugin_init'));
|
||||
add_action( 'admin_enqueue_scripts', array(&$this,'enqueue_admin_css_js'));
|
||||
add_action( 'plugins_loaded', array(&$this,'plugin_load_textdomain'));
|
||||
|
||||
}
|
||||
|
||||
|
@ -171,6 +172,13 @@ abstract class WP_FFPC_ABSTRACT {
|
|||
$this->plugin_post_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* admin panel, load plugin textdomain
|
||||
*/
|
||||
public function plugin_load_textdomain() {
|
||||
load_plugin_textdomain( 'wp-ffpc', false , dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* admin panel, the HTML usually
|
||||
|
|
|
@ -69,6 +69,16 @@ else {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* no cache for WooCommerce URL patterns */
|
||||
if ( isset($wp_ffpc_config['nocache_woocommerce']) && !empty($wp_ffpc_config['nocache_woocommerce']) &&
|
||||
isset($wp_ffpc_config['nocache_woocommerce_url']) && trim($wp_ffpc_config['nocache_woocommerce_url']) ) {
|
||||
$pattern = sprintf('#%s#', trim($wp_ffpc_config['nocache_woocommerce_url']));
|
||||
if ( preg_match($pattern, $wp_ffpc_uri) ) {
|
||||
__wp_ffpc_debug__ ( "Cache exception based on WooCommenrce URL regex pattern matched, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* no cache for uri with query strings, things usually go bad that way */
|
||||
if ( isset($wp_ffpc_config['nocache_dyn']) && !empty($wp_ffpc_config['nocache_dyn']) && stripos($wp_ffpc_uri, '?') !== false ) {
|
||||
__wp_ffpc_debug__ ( 'Dynamic url cache is disabled ( url with "?" ), skipping');
|
||||
|
|
|
@ -408,6 +408,18 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
|||
if( ! function_exists( 'current_user_can' ) || ! current_user_can( 'manage_options' ) ){
|
||||
die( );
|
||||
}
|
||||
|
||||
/* woo_commenrce page url */
|
||||
if ( class_exists( 'WooCommerce' ) ) {
|
||||
$page_wc_checkout=str_replace( home_url(), '', wc_get_page_permalink( 'checkout' ) );
|
||||
$page_wc_myaccount=str_replace( home_url(), '', wc_get_page_permalink( 'myaccount' ) );
|
||||
$page_wc_cart=str_replace( home_url(), '', wc_get_page_permalink( 'cart' ) );
|
||||
$this->options['nocache_woocommerce_url'] = '^'.$page_wc_checkout.'|^'.$page_wc_myaccount.'|^'.$page_wc_cart;
|
||||
|
||||
} else {
|
||||
$this->options['nocache_woocommerce_url'] = '';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
@ -689,12 +701,13 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
|||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:16%; text-align:left"><label for="nocache_home"><?php _e("Exclude home", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:16%; text-align:left"><label for="nocache_feed"><?php _e("Exclude feeds", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:16%; text-align:left"><label for="nocache_archive"><?php _e("Exclude archives", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:16%; text-align:left"><label for="nocache_page"><?php _e("Exclude pages", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:16%; text-align:left"><label for="nocache_single"><?php _e("Exclude singulars", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:13%; text-align:left"><label for="nocache_home"><?php _e("Exclude home", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:13%; text-align:left"><label for="nocache_feed"><?php _e("Exclude feeds", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:13%; text-align:left"><label for="nocache_archive"><?php _e("Exclude archives", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:13%; text-align:left"><label for="nocache_page"><?php _e("Exclude pages", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:13%; text-align:left"><label for="nocache_single"><?php _e("Exclude singulars", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:17%; text-align:left"><label for="nocache_dyn"><?php _e("Dynamic requests", 'wp-ffpc'); ?></label></th>
|
||||
<th style="width:18%; text-align:left"><label for="nocache_woocommerce"><?php _e("WooCommerce", 'wp-ffpc'); ?></label></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -723,6 +736,12 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
|||
<input type="checkbox" name="nocache_dyn" id="nocache_dyn" value="1" <?php checked($this->options['nocache_dyn'],true); ?> />
|
||||
<span class="description"><?php _e('Exclude every URL with "?" in it.', 'wp-ffpc'); ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" name="nocache_woocommerce_url" id="nocache_woocommerce_url" value="<?php if(isset( $this->options['nocache_woocommerce_url'] ) ) echo $this->options['nocache_woocommerce_url']; ?>" />
|
||||
<input type="checkbox" name="nocache_woocommerce" id="nocache_woocommerce" value="1" <?php checked($this->options['nocache_woocommerce'],true); ?> />
|
||||
<span class="description"><?php _e('Exclude dynamic WooCommerce page.', 'wp-ffpc');?>
|
||||
<?php if(isset( $this->options['nocache_woocommerce_url'] ) ) echo "<br />Url:".$this->options['nocache_woocommerce_url']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -771,7 +790,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
|
|||
<?php _e('List of backends, with the following syntax: <br />- in case of TCP based connections, list the servers as host1:port1,host2:port2,... . Do not add trailing , and always separate host and port with : .<br />- for a unix socket enter: unix://[socket_path]', 'wp-ffpc'); ?></span>
|
||||
</dd>
|
||||
|
||||
<h3><?php _e('Authentication ( only for SASL enabled Memcached or Redis')?></h3>
|
||||
<h3><?php _e('Authentication ( only for SASL enabled Memcached or Redis)')?></h3>
|
||||
<?php
|
||||
if ( ! ini_get('memcached.use_sasl') && ( !empty( $this->options['authuser'] ) || !empty( $this->options['authpass'] ) ) ) { ?>
|
||||
<div class="error"><p><strong><?php _e( 'WARNING: you\'ve entered username and/or password for memcached authentication ( or your browser\'s autocomplete did ) which will not work unless you enable memcached sasl in the PHP settings: add `memcached.use_sasl=1` to php.ini' , 'wp-ffpc') ?></strong></p></div>
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
Plugin Name: WP-FFPC
|
||||
Plugin URI: https://github.com/petermolnar/wp-ffpc
|
||||
Description: WordPress in-memory full page cache plugin
|
||||
Version: 1.11.0
|
||||
Version: 1.11.1
|
||||
Author: Peter Molnar <hello@petermolnar.eu>
|
||||
Author URI: http://petermolnar.eu/
|
||||
License: GPLv3
|
||||
Text Domain: wp-ffpc
|
||||
Domain Path: /languages/
|
||||
*/
|
||||
|
||||
/* Copyright 2010-2014 Peter Molnar ( hello@petermolnar.eu )
|
||||
|
@ -54,6 +56,8 @@ $wp_ffpc_defaults = array (
|
|||
'nocache_page' => false,
|
||||
'nocache_cookies' => false,
|
||||
'nocache_dyn' => true,
|
||||
'nocache_woocommerce' => true,
|
||||
'nocache_woocommerce_url' => '',
|
||||
'nocache_url' => '^/wp-',
|
||||
'nocache_comment' => '',
|
||||
'response_header' => false,
|
||||
|
|
Loading…
Reference in a new issue