bugfixes and small enhancements
@@ -4,7 +4,7 @@ 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.0 -Stable tag: 1.7.0 +Stable tag: 1.7.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html@@ -47,8 +47,12 @@ * Jason Miller
* [Dave Clark](https://github.com/dkcwd "Dave Clark") * Miguel Clara * [plescheff](https://github.com/plescheff) +* Firas Dib * [CotswoldPhoto](http://wordpress.org/support/profile/cotswoldphoto) * [tamagokun](https://github.com/tamagokun) +* Many Ayromlou +* mailgarant.nl +* Christian Rößner == Installation ==@@ -110,6 +114,22 @@ * every A. indicates BIG changes.
* every .B version indicates new features. * every ..C indicates bugfixes for A.B version. += 1.7.1 = +*2014-12-04* + +What's fixed: + +* [Unable to determine path from Post Permalink](https://wordpress.org/support/topic/unable-to-determine-path-from-post-permalink) noise fixed +* potential Multisite precache bug fixed ( database prefixes were not set according to original prefix ) + +What's new: + +* added permanent cache exception of localhost + +What's changed: + +* pingback header preservation is now off by default and can manually be turned on + = 1.7.0 = *2014-09-19*@@ -122,10 +142,6 @@
* **dropped Xcache support**: the reasons behind this is the outstandingly terrible documentation of Xcache * **dropped persistent memcache mode**: no one was using it and even if the were only caused trouble * **removed '/wp-' hardcoded cache exception**; this is now the default in the regex exceptions field as ^/wp-; please add this manually in case you've already been using the regex field - -What's on it's way: - -* brace yourselves, redis support is coming = 1.6.4 = *2014-09-12*
@@ -3,6 +3,10 @@ /**
* advanced cache worker of WordPress plugin WP-FFPC */ +/* ignore localhost */ +if ( $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'] || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) + return false; + /* check for WP cache enabled*/ if ( !WP_CACHE ) return false;@@ -173,7 +177,7 @@ if ( !empty($wp_ffpc_values['meta']['lastmodified']) )
header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" ); /* pingback urls, if existx */ -if ( !empty( $wp_ffpc_values['meta']['pingback'] ) ) +if ( !empty( $wp_ffpc_values['meta']['pingback'] ) && $wp_ffpc_config['pingback_header'] ) header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] ); /* for debugging */@@ -182,6 +186,7 @@ header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP');
/* HTML data */ echo $wp_ffpc_values['data']; + flush(); die();@@ -318,6 +323,9 @@ $prefix_meta = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] );
$wp_ffpc_backend->set ( $prefix_meta, $meta ); $prefix_data = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] ); + + //if ( $wp_ffpc_config['gzip'] && function_exists('gzencode') ) + $wp_ffpc_backend->set ( $prefix_data , $buffer ); if ( !empty( $meta['status'] ) && $meta['status'] == 404 ) {
@@ -254,7 +254,7 @@ /* get permalink */
$permalink = get_permalink( $post_id ); /* no path, don't do anything */ - if ( empty( $permalink ) ) { + if ( empty( $permalink ) && $permalink != false ) { $this->log ( sprintf( __translate__( 'unable to determine path from Post Permalink, post ID: %s', $this->plugin_constant ), $post_id ), LOG_WARNING ); return false; }
@@ -176,8 +176,8 @@
/* initiate backend */ $this->backend = new WP_FFPC_Backend ( $this->options ); - /* get all available post types */ - $post_types = get_post_types( ); + /* get all available post types * + $post_types = get_post_types( );*/ /* cache invalidation hooks */ add_action( 'transition_post_status', array( &$this->backend , 'clear_ng' ), 10, 3 );@@ -563,6 +563,14 @@ <fieldset id="<?php echo $this->plugin_constant ?>-debug">
<legend><?php _e( 'Debug & in-depth settings', $this->plugin_constant ); ?></legend> <dl> <dt> + <label for="pingback_header"><?php _e('Enable X-Pingback header preservation', $this->plugin_constant); ?></label> + </dt> + <dd> + <input type="checkbox" name="pingback_header" id="pingback_header" value="1" <?php checked($this->options['pingback_header'],true); ?> /> + <span class="description"><?php _e('Preserve X-Pingback URL in response header.', $this->plugin_constant); ?></span> + </dd> + + <dt> <label for="log"><?php _e("Enable logging", $this->plugin_constant); ?></label> </dt> <dd>@@ -653,12 +661,6 @@ <span class="description"><?php _e('Exclude content based on cookies names starting with this from caching. Separate multiple cookies names with commas.<br />If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', $this->plugin_constant); ?></span>
</dd> <dt> - - </dt> - <dd> - </dd> - - <dt> <label for="nocache_url"><?php _e("Don't cache following URL paths - use with caution!", $this->plugin_constant); ?></label> </dt> <dd>@@ -669,6 +671,7 @@ }
?></textarea> <span class="description"><?php _e('Regular expressions use you must! e.g. <em>pattern1|pattern2|etc</em>', $this->plugin_constant); ?></span> </dd> + </dl> </fieldset>@@ -1128,7 +1131,8 @@ /* when plugin is network wide active, we need to pre-cache for all link of all blogs */
if ( $this->network ) { /* list all blogs */ global $wpdb; - $blog_list = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM wp_blogs ORDER BY blog_id", '' ) ); + $pfix = empty ( $wpdb->base_prefix ) ? 'wp' : $wpdb->base_prefix; + $blog_list = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ". $pfix ."_blogs ORDER BY blog_id", '' ) ); foreach ($blog_list as $blog) { if ( $blog->archived != 1 && $blog->spam != 1 && $blog->deleted != 1) {@@ -1190,14 +1194,16 @@ break;
case 'page': $permalink = get_page_link( $post->ID ); break; - case 'post': + /* + * case 'post': $permalink = get_permalink( $post->ID ); break; + */ case 'attachment': $permalink = get_attachment_link( $post->ID ); break; default: - $permalink = get_post_permalink( $post->ID ); + $permalink = get_permalink( $post->ID ); break; }
@@ -54,8 +54,9 @@ 'generate_time' => false,
'precache_schedule' => 'null', 'key' => '$scheme://$host$request_uri', 'comments_invalidate' => true, + 'pingback_header' => false, ); -$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.7.0', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' ); +$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.7.1', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' ); ?>