diff --git a/readme.txt b/readme.txt index 13e78cf..edd0ec5 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i 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 @@ Many thanks for donations, contributors, supporters, testers & bug reporters: * [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 @@ Version numbering logic: * 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* @@ -123,10 +143,6 @@ What's changed: * **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* diff --git a/wp-ffpc-acache.php b/wp-ffpc-acache.php index fbc788a..122a167 100644 --- a/wp-ffpc-acache.php +++ b/wp-ffpc-acache.php @@ -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 @@ if ( $wp_ffpc_config['response_header'] ) /* HTML data */ echo $wp_ffpc_values['data']; + flush(); die(); @@ -318,6 +323,9 @@ function wp_ffpc_callback( $buffer ) { $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 ) { diff --git a/wp-ffpc-backend.php b/wp-ffpc-backend.php index db44de2..4f946b5 100644 --- a/wp-ffpc-backend.php +++ b/wp-ffpc-backend.php @@ -254,7 +254,7 @@ class WP_FFPC_Backend { $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; } diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index ceaaba7..047813c 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -176,8 +176,8 @@ class WP_FFPC extends PluginAbstract { /* 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 ); @@ -562,6 +562,14 @@ class WP_FFPC extends PluginAbstract {
plugin_constant ); ?>
+
+ +
+
+ options['pingback_header'],true); ?> /> + plugin_constant); ?> +
+
@@ -652,12 +660,6 @@ class WP_FFPC extends PluginAbstract { If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', $this->plugin_constant); ?> -
- -
-
-
-
@@ -669,6 +671,7 @@ class WP_FFPC extends PluginAbstract { ?> pattern1|pattern2|etc', $this->plugin_constant); ?> +
@@ -1128,7 +1131,8 @@ class WP_FFPC extends PluginAbstract { 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 @@ class WP_FFPC extends PluginAbstract { 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; } diff --git a/wp-ffpc.php b/wp-ffpc.php index 7d867b0..7cbe7d1 100644 --- a/wp-ffpc.php +++ b/wp-ffpc.php @@ -54,8 +54,9 @@ $wp_ffpc_defaults = array ( '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' ); ?>