Changeset 1271759
- Timestamp:
- 10/23/2015 12:41:30 PM (10 years ago)
- Location:
- wp-ffpc
- Files:
-
- 1 deleted
- 5 edited
- 16 copied
-
tags/1.10.0 (copied) (copied from wp-ffpc/trunk)
-
tags/1.10.0/backends (copied) (copied from wp-ffpc/trunk/backends)
-
tags/1.10.0/backends/apc.php (copied) (copied from wp-ffpc/trunk/backends/apc.php)
-
tags/1.10.0/backends/apcu.php (copied) (copied from wp-ffpc/trunk/backends/apcu.php)
-
tags/1.10.0/backends/memcache.php (copied) (copied from wp-ffpc/trunk/backends/memcache.php)
-
tags/1.10.0/backends/memcached.php (copied) (copied from wp-ffpc/trunk/backends/memcached.php)
-
tags/1.10.0/composer.json (copied) (copied from wp-ffpc/trunk/composer.json)
-
tags/1.10.0/readme.txt (copied) (copied from wp-ffpc/trunk/readme.txt) (3 diffs)
-
tags/1.10.0/uninstall.php (copied) (copied from wp-ffpc/trunk/uninstall.php)
-
tags/1.10.0/wp-admin.css (copied) (copied from wp-ffpc/trunk/wp-admin.css)
-
tags/1.10.0/wp-common (deleted)
-
tags/1.10.0/wp-ffpc-abstract.php (copied) (copied from wp-ffpc/trunk/wp-ffpc-abstract.php)
-
tags/1.10.0/wp-ffpc-acache.php (copied) (copied from wp-ffpc/trunk/wp-ffpc-acache.php) (4 diffs)
-
tags/1.10.0/wp-ffpc-backend.php (copied) (copied from wp-ffpc/trunk/wp-ffpc-backend.php) (1 diff)
-
tags/1.10.0/wp-ffpc-class.php (copied) (copied from wp-ffpc/trunk/wp-ffpc-class.php) (2 diffs)
-
tags/1.10.0/wp-ffpc-nginx-sample.conf (copied) (copied from wp-ffpc/trunk/wp-ffpc-nginx-sample.conf)
-
tags/1.10.0/wp-ffpc.php (copied) (copied from wp-ffpc/trunk/wp-ffpc.php) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-ffpc-acache.php (modified) (4 diffs)
-
trunk/wp-ffpc-backend.php (modified) (1 diff)
-
trunk/wp-ffpc-class.php (modified) (2 diffs)
-
trunk/wp-ffpc.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-ffpc/tags/1.10.0/readme.txt
r1268264 r1271759 5 5 Requires at least: 3.0 6 6 Tested up to: 4.3.1 7 Stable tag: 1. 9.17 Stable tag: 1.10.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 80 80 * Christian Kernbeis 81 81 * Gausden Barry 82 * Maksim Bukreyeu 82 83 83 84 == Installation == … … 128 129 * every .B version indicates new features. 129 130 * every ..C indicates bugfixes for A.B version. 131 132 = 1.10.0 = 133 *2015-10-23* 134 135 *IMPORTANT, READ THIS* 136 137 proper browser cache support: 138 * new options to set real browser cache expiry for singles, taxonomy and home 139 * added Etag support based on browser cache expiry 140 * added proper Expires header according to cache entry generation time + browser cache expiry 141 * added support for Last Modified header for home & taxonomy ( singles already had it) based on the last post modified date within the taxonomy 142 130 143 131 144 = 1.9.1 = -
wp-ffpc/tags/1.10.0/wp-ffpc-acache.php
r1266062 r1271759 140 140 /* store results */ 141 141 $wp_ffpc_values[ $internal ] = $value; 142 __debug__('Got value for ' . $internal); 142 143 } 143 144 } … … 178 179 header('Content-Type: ' . $wp_ffpc_values['meta']['mime']); 179 180 180 /* don't allow browser caching of page */ 181 header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0'); 182 header('Pragma: no-cache'); 183 184 /* expire at this very moment */ 185 header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT"); 181 /* set expiry date */ 182 if (isset($wp_ffpc_values['meta']['expire']) && !empty ( $wp_ffpc_values['meta']['expire'] ) ) { 183 $hash = md5 ( $wp_ffpc_uri . $wp_ffpc_values['meta']['expire'] ); 184 185 switch ($wp_ffpc_values['meta']['type']) { 186 case 'home': 187 case 'feed': 188 $expire = $wp_ffpc_config['browsercache_home']; 189 break; 190 case 'archive': 191 $expire = $wp_ffpc_config['browsercache_taxonomy']; 192 break; 193 case 'single': 194 $expire = $wp_ffpc_config['browsercache']; 195 break; 196 default: 197 $expire = 0; 198 } 199 200 header('Cache-Control: public,max-age='.$expire.',s-maxage='.$expire.',must-revalidate'); 201 header('Expires: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['expire'] ) . " GMT"); 202 header('ETag: '. $hash); 203 unset($expire, $hash); 204 } 205 else { 206 /* in case there is no expiry set, expire immediately and don't serve Etag; browser cache is disabled */ 207 header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT"); 208 /* if I set these, the 304 not modified will never, ever kick in, so not setting these 209 * leaving here as a reminder why it should not be set */ 210 //header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0, post-check=0, pre-check=0'); 211 //header('Pragma: no-cache'); 212 } 186 213 187 214 /* if shortlinks were set */ 188 if ( !empty ( $wp_ffpc_values['meta']['shortlink'] ) )215 if (isset($wp_ffpc_values['meta']['shortlink']) && !empty ( $wp_ffpc_values['meta']['shortlink'] ) ) 189 216 header( 'Link:<'. $wp_ffpc_values['meta']['shortlink'] .'>; rel=shortlink' ); 190 217 191 218 /* if last modifications were set (for posts & pages) */ 192 if ( !empty($wp_ffpc_values['meta']['lastmodified']) )219 if (isset($wp_ffpc_values['meta']['lastmodified']) && !empty($wp_ffpc_values['meta']['lastmodified']) ) 193 220 header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" ); 194 221 195 222 /* pingback urls, if existx */ 196 if ( !empty( $wp_ffpc_values['meta']['pingback']) && $wp_ffpc_config['pingback_header'] )223 if ( isset($wp_ffpc_values['meta']['pingback']) && !empty( $wp_ffpc_values['meta']['pingback'] ) && isset($wp_ffpc_config['pingback_header']) && $wp_ffpc_config['pingback_header'] ) 197 224 header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] ); 198 225 199 226 /* for debugging */ 200 if ( $wp_ffpc_config['response_header'] )227 if ( isset($wp_ffpc_config['response_header']) && $wp_ffpc_config['response_header'] ) 201 228 header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP'); 202 229 203 230 /* HTML data */ 204 205 if ( $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) { 231 if ( isset($wp_ffpc_config['generate_time']) && $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) { 206 232 $mtime = explode ( " ", microtime() ); 207 233 $wp_ffpc_gentime = ( $mtime[1] + $mtime[0] ) - $wp_ffpc_gentime; … … 285 311 } 286 312 287 if ( is_home() ) 288 $meta['type'] = 'home'; 289 elseif (is_feed() ) 290 $meta['type'] = 'feed'; 291 elseif ( is_archive() ) 313 if ( is_home() || is_feed() ) { 314 if (is_home()) 315 $meta['type'] = 'home'; 316 elseif(is_feed()) 317 $meta['type'] = 'feed'; 318 319 if (isset($wp_ffpc_config['browsercache_home']) && !empty($wp_ffpc_config['browsercache_home']) && $wp_ffpc_config['browsercache_home'] > 0) { 320 $meta['expire'] = time() + $wp_ffpc_config['browsercache_home']; 321 } 322 323 __debug__( 'Getting latest post for for home & feed'); 324 /* get newest post and set last modified accordingly */ 325 $args = array( 326 'numberposts' => 1, 327 'orderby' => 'modified', 328 'order' => 'DESC', 329 'post_status' => 'publish', 330 ); 331 332 $recent_post = wp_get_recent_posts( $args, OBJECT ); 333 if ( !empty($recent_post)) { 334 $recent_post = array_pop($recent_post); 335 if (!empty ( $recent_post->post_modified_gmt ) ) { 336 $meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt ); 337 } 338 } 339 340 } 341 elseif ( is_archive() ) { 292 342 $meta['type'] = 'archive'; 293 elseif ( is_single() ) 343 if (isset($wp_ffpc_config['browsercache_taxonomy']) && !empty($wp_ffpc_config['browsercache_taxonomy']) && $wp_ffpc_config['browsercache_taxonomy'] > 0) { 344 $meta['expire'] = time() + $wp_ffpc_config['browsercache_taxonomy']; 345 } 346 347 global $wp_query; 348 349 if ( null != $wp_query->tax_query && !empty($wp_query->tax_query)) { 350 __debug__( 'Getting latest post for taxonomy: ' . json_encode($wp_query->tax_query)); 351 352 $args = array( 353 'numberposts' => 1, 354 'orderby' => 'modified', 355 'order' => 'DESC', 356 'post_status' => 'publish', 357 'tax_query' => $wp_query->tax_query, 358 ); 359 360 $recent_post = get_posts( $args, OBJECT ); 361 362 if ( !empty($recent_post)) { 363 $recent_post = array_pop($recent_post); 364 if (!empty ( $recent_post->post_modified_gmt ) ) { 365 $meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt ); 366 } 367 } 368 } 369 370 } 371 elseif ( is_single() || is_page() ) { 294 372 $meta['type'] = 'single'; 295 elseif ( is_page() ) 296 $meta['type'] = 'page'; 297 else 373 if (isset($wp_ffpc_config['browsercache']) && !empty($wp_ffpc_config['browsercache']) && $wp_ffpc_config['browsercache'] > 0) { 374 $meta['expire'] = time() + $wp_ffpc_config['browsercache']; 375 } 376 377 /* try if post is available 378 if made with archieve, last listed post can make this go bad 379 */ 380 global $post; 381 if ( !empty($post) && !empty ( $post->post_modified_gmt ) ) { 382 /* get last modification data */ 383 $meta['lastmodified'] = strtotime ( $post->post_modified_gmt ); 384 385 /* get shortlink, if possible */ 386 if (function_exists('wp_get_shortlink')) { 387 $shortlink = wp_get_shortlink( ); 388 if (!empty ( $shortlink ) ) 389 $meta['shortlink'] = $shortlink; 390 } 391 } 392 393 } 394 else { 298 395 $meta['type'] = 'unknown'; 396 } 299 397 300 398 if ( $meta['type'] != 'unknown' ) { … … 324 422 $meta['mime'] = $meta['mime'] . $wp_ffpc_config['charset']; 325 423 326 /* try if post is available327 if made with archieve, last listed post can make this go bad328 */329 global $post;330 if ( !empty($post) && ( $meta['type'] == 'single' || $meta['type'] == 'page' ) && !empty ( $post->post_modified_gmt ) ) {331 /* get last modification data */332 $meta['lastmodified'] = strtotime ( $post->post_modified_gmt );333 334 /* get shortlink, if possible */335 if (function_exists('wp_get_shortlink')) {336 $shortlink = wp_get_shortlink( );337 if (!empty ( $shortlink ) )338 $meta['shortlink'] = $shortlink;339 }340 }341 342 424 /* store pingback url if pingbacks are enabled */ 343 425 if ( get_option ( 'default_ping_status' ) == 'open' ) -
wp-ffpc/tags/1.10.0/wp-ffpc-backend.php
r1268264 r1271759 387 387 if ( !empty ( $terms ) ) { 388 388 foreach ( $terms as $term ) { 389 390 /* skip terms that have no post associated and somehow slipped 391 * throught hide_empty */ 392 if ( $term->count == 0) 393 continue; 394 389 395 /* get the permalink for the term */ 390 396 $link = get_term_link ( $term->slug, $taxonomy->name ); 391 397 /* add to container */ 392 398 $links[ $link ] = true; 393 /* remove the taxonomy name from the link, lots of plugins remove this for SEO, it's better to include them than leave them out 394 in worst case, we cache some 404 as well 399 /* remove the taxonomy name from the link, lots of plugins remove this for SEO, it's better to include them than leave them out in worst case, we cache some 404 as well 395 400 */ 396 401 $link = str_replace ( '/'.$taxonomy->rewrite['slug'], '', $link ); -
wp-ffpc/tags/1.10.0/wp-ffpc-class.php
r1268264 r1271759 493 493 494 494 <dt> 495 <label for="browsercache"><?php _e('Browser cache expiration time of posts', 'wp-ffpc'); ?></label> 496 </dt> 497 <dd> 498 <input type="number" name="browsercache" id="browsercache" value="<?php echo $this->options['browsercache']; ?>" /> 499 <span class="description"><?php _e('Sets validity time of posts/pages/singles for the browser cache.', 'wp-ffpc'); ?></span> 500 </dd> 501 502 <dt> 495 503 <label for="expire_taxonomy"><?php _e('Expiration time for taxonomy', 'wp-ffpc'); ?></label> 496 504 </dt> … … 501 509 502 510 <dt> 511 <label for="browsercache_taxonomy"><?php _e('Browser cache expiration time of taxonomy', 'wp-ffpc'); ?></label> 512 </dt> 513 <dd> 514 <input type="number" name="browsercache_taxonomy" id="browsercache_taxonomy" value="<?php echo $this->options['browsercache_taxonomy']; ?>" /> 515 <span class="description"><?php _e('Sets validity time of taxonomy for the browser cache.', 'wp-ffpc'); ?></span> 516 </dd> 517 518 <dt> 503 519 <label for="expire_home"><?php _e('Expiration time for home', 'wp-ffpc'); ?></label> 504 520 </dt> 505 521 <dd> 506 522 <input type="number" name="expire_home" id="expire_home" value="<?php echo $this->options['expire_home']; ?>" /> 507 <span class="description"><?php _e('Sets validity time of home.', 'wp-ffpc'); ?></span> 523 <span class="description"><?php _e('Sets validity time of home on server side.', 'wp-ffpc'); ?></span> 524 </dd> 525 526 <dt> 527 <label for="browsercache_home"><?php _e('Browser cache expiration time of home', 'wp-ffpc'); ?></label> 528 </dt> 529 <dd> 530 <input type="number" name="browsercache_home" id="browsercache_home" value="<?php echo $this->options['browsercache_home']; ?>" /> 531 <span class="description"><?php _e('Sets validity time of home for the browser cache.', 'wp-ffpc'); ?></span> 508 532 </dd> 509 533 -
wp-ffpc/tags/1.10.0/wp-ffpc.php
r1268264 r1271759 4 4 Plugin URI: https://github.com/petermolnar/wp-ffpc 5 5 Description: WordPress in-memory full page cache plugin 6 Version: 1. 9.16 Version: 1.10.0 7 7 Author: Peter Molnar <hello@petermolnar.eu> 8 8 Author URI: http://petermolnar.eu/ … … 33 33 'authpass' => '', 34 34 'authuser' => '', 35 'browsercache' => 0, 36 'browsercache_home' => 0, 37 'browsercache_taxonomy' => 0, 35 38 'expire' => 300, 36 39 'expire_home' => 300, … … 61 64 ); 62 65 63 $wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1. 8.2', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' );66 $wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.10.1', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' ); -
wp-ffpc/trunk/readme.txt
r1268264 r1271759 5 5 Requires at least: 3.0 6 6 Tested up to: 4.3.1 7 Stable tag: 1. 9.17 Stable tag: 1.10.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 80 80 * Christian Kernbeis 81 81 * Gausden Barry 82 * Maksim Bukreyeu 82 83 83 84 == Installation == … … 128 129 * every .B version indicates new features. 129 130 * every ..C indicates bugfixes for A.B version. 131 132 = 1.10.0 = 133 *2015-10-23* 134 135 *IMPORTANT, READ THIS* 136 137 proper browser cache support: 138 * new options to set real browser cache expiry for singles, taxonomy and home 139 * added Etag support based on browser cache expiry 140 * added proper Expires header according to cache entry generation time + browser cache expiry 141 * added support for Last Modified header for home & taxonomy ( singles already had it) based on the last post modified date within the taxonomy 142 130 143 131 144 = 1.9.1 = -
wp-ffpc/trunk/wp-ffpc-acache.php
r1266062 r1271759 140 140 /* store results */ 141 141 $wp_ffpc_values[ $internal ] = $value; 142 __debug__('Got value for ' . $internal); 142 143 } 143 144 } … … 178 179 header('Content-Type: ' . $wp_ffpc_values['meta']['mime']); 179 180 180 /* don't allow browser caching of page */ 181 header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0'); 182 header('Pragma: no-cache'); 183 184 /* expire at this very moment */ 185 header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT"); 181 /* set expiry date */ 182 if (isset($wp_ffpc_values['meta']['expire']) && !empty ( $wp_ffpc_values['meta']['expire'] ) ) { 183 $hash = md5 ( $wp_ffpc_uri . $wp_ffpc_values['meta']['expire'] ); 184 185 switch ($wp_ffpc_values['meta']['type']) { 186 case 'home': 187 case 'feed': 188 $expire = $wp_ffpc_config['browsercache_home']; 189 break; 190 case 'archive': 191 $expire = $wp_ffpc_config['browsercache_taxonomy']; 192 break; 193 case 'single': 194 $expire = $wp_ffpc_config['browsercache']; 195 break; 196 default: 197 $expire = 0; 198 } 199 200 header('Cache-Control: public,max-age='.$expire.',s-maxage='.$expire.',must-revalidate'); 201 header('Expires: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['expire'] ) . " GMT"); 202 header('ETag: '. $hash); 203 unset($expire, $hash); 204 } 205 else { 206 /* in case there is no expiry set, expire immediately and don't serve Etag; browser cache is disabled */ 207 header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT"); 208 /* if I set these, the 304 not modified will never, ever kick in, so not setting these 209 * leaving here as a reminder why it should not be set */ 210 //header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0, post-check=0, pre-check=0'); 211 //header('Pragma: no-cache'); 212 } 186 213 187 214 /* if shortlinks were set */ 188 if ( !empty ( $wp_ffpc_values['meta']['shortlink'] ) )215 if (isset($wp_ffpc_values['meta']['shortlink']) && !empty ( $wp_ffpc_values['meta']['shortlink'] ) ) 189 216 header( 'Link:<'. $wp_ffpc_values['meta']['shortlink'] .'>; rel=shortlink' ); 190 217 191 218 /* if last modifications were set (for posts & pages) */ 192 if ( !empty($wp_ffpc_values['meta']['lastmodified']) )219 if (isset($wp_ffpc_values['meta']['lastmodified']) && !empty($wp_ffpc_values['meta']['lastmodified']) ) 193 220 header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" ); 194 221 195 222 /* pingback urls, if existx */ 196 if ( !empty( $wp_ffpc_values['meta']['pingback']) && $wp_ffpc_config['pingback_header'] )223 if ( isset($wp_ffpc_values['meta']['pingback']) && !empty( $wp_ffpc_values['meta']['pingback'] ) && isset($wp_ffpc_config['pingback_header']) && $wp_ffpc_config['pingback_header'] ) 197 224 header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] ); 198 225 199 226 /* for debugging */ 200 if ( $wp_ffpc_config['response_header'] )227 if ( isset($wp_ffpc_config['response_header']) && $wp_ffpc_config['response_header'] ) 201 228 header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP'); 202 229 203 230 /* HTML data */ 204 205 if ( $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) { 231 if ( isset($wp_ffpc_config['generate_time']) && $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) { 206 232 $mtime = explode ( " ", microtime() ); 207 233 $wp_ffpc_gentime = ( $mtime[1] + $mtime[0] ) - $wp_ffpc_gentime; … … 285 311 } 286 312 287 if ( is_home() ) 288 $meta['type'] = 'home'; 289 elseif (is_feed() ) 290 $meta['type'] = 'feed'; 291 elseif ( is_archive() ) 313 if ( is_home() || is_feed() ) { 314 if (is_home()) 315 $meta['type'] = 'home'; 316 elseif(is_feed()) 317 $meta['type'] = 'feed'; 318 319 if (isset($wp_ffpc_config['browsercache_home']) && !empty($wp_ffpc_config['browsercache_home']) && $wp_ffpc_config['browsercache_home'] > 0) { 320 $meta['expire'] = time() + $wp_ffpc_config['browsercache_home']; 321 } 322 323 __debug__( 'Getting latest post for for home & feed'); 324 /* get newest post and set last modified accordingly */ 325 $args = array( 326 'numberposts' => 1, 327 'orderby' => 'modified', 328 'order' => 'DESC', 329 'post_status' => 'publish', 330 ); 331 332 $recent_post = wp_get_recent_posts( $args, OBJECT ); 333 if ( !empty($recent_post)) { 334 $recent_post = array_pop($recent_post); 335 if (!empty ( $recent_post->post_modified_gmt ) ) { 336 $meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt ); 337 } 338 } 339 340 } 341 elseif ( is_archive() ) { 292 342 $meta['type'] = 'archive'; 293 elseif ( is_single() ) 343 if (isset($wp_ffpc_config['browsercache_taxonomy']) && !empty($wp_ffpc_config['browsercache_taxonomy']) && $wp_ffpc_config['browsercache_taxonomy'] > 0) { 344 $meta['expire'] = time() + $wp_ffpc_config['browsercache_taxonomy']; 345 } 346 347 global $wp_query; 348 349 if ( null != $wp_query->tax_query && !empty($wp_query->tax_query)) { 350 __debug__( 'Getting latest post for taxonomy: ' . json_encode($wp_query->tax_query)); 351 352 $args = array( 353 'numberposts' => 1, 354 'orderby' => 'modified', 355 'order' => 'DESC', 356 'post_status' => 'publish', 357 'tax_query' => $wp_query->tax_query, 358 ); 359 360 $recent_post = get_posts( $args, OBJECT ); 361 362 if ( !empty($recent_post)) { 363 $recent_post = array_pop($recent_post); 364 if (!empty ( $recent_post->post_modified_gmt ) ) { 365 $meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt ); 366 } 367 } 368 } 369 370 } 371 elseif ( is_single() || is_page() ) { 294 372 $meta['type'] = 'single'; 295 elseif ( is_page() ) 296 $meta['type'] = 'page'; 297 else 373 if (isset($wp_ffpc_config['browsercache']) && !empty($wp_ffpc_config['browsercache']) && $wp_ffpc_config['browsercache'] > 0) { 374 $meta['expire'] = time() + $wp_ffpc_config['browsercache']; 375 } 376 377 /* try if post is available 378 if made with archieve, last listed post can make this go bad 379 */ 380 global $post; 381 if ( !empty($post) && !empty ( $post->post_modified_gmt ) ) { 382 /* get last modification data */ 383 $meta['lastmodified'] = strtotime ( $post->post_modified_gmt ); 384 385 /* get shortlink, if possible */ 386 if (function_exists('wp_get_shortlink')) { 387 $shortlink = wp_get_shortlink( ); 388 if (!empty ( $shortlink ) ) 389 $meta['shortlink'] = $shortlink; 390 } 391 } 392 393 } 394 else { 298 395 $meta['type'] = 'unknown'; 396 } 299 397 300 398 if ( $meta['type'] != 'unknown' ) { … … 324 422 $meta['mime'] = $meta['mime'] . $wp_ffpc_config['charset']; 325 423 326 /* try if post is available327 if made with archieve, last listed post can make this go bad328 */329 global $post;330 if ( !empty($post) && ( $meta['type'] == 'single' || $meta['type'] == 'page' ) && !empty ( $post->post_modified_gmt ) ) {331 /* get last modification data */332 $meta['lastmodified'] = strtotime ( $post->post_modified_gmt );333 334 /* get shortlink, if possible */335 if (function_exists('wp_get_shortlink')) {336 $shortlink = wp_get_shortlink( );337 if (!empty ( $shortlink ) )338 $meta['shortlink'] = $shortlink;339 }340 }341 342 424 /* store pingback url if pingbacks are enabled */ 343 425 if ( get_option ( 'default_ping_status' ) == 'open' ) -
wp-ffpc/trunk/wp-ffpc-backend.php
r1268264 r1271759 387 387 if ( !empty ( $terms ) ) { 388 388 foreach ( $terms as $term ) { 389 390 /* skip terms that have no post associated and somehow slipped 391 * throught hide_empty */ 392 if ( $term->count == 0) 393 continue; 394 389 395 /* get the permalink for the term */ 390 396 $link = get_term_link ( $term->slug, $taxonomy->name ); 391 397 /* add to container */ 392 398 $links[ $link ] = true; 393 /* remove the taxonomy name from the link, lots of plugins remove this for SEO, it's better to include them than leave them out 394 in worst case, we cache some 404 as well 399 /* remove the taxonomy name from the link, lots of plugins remove this for SEO, it's better to include them than leave them out in worst case, we cache some 404 as well 395 400 */ 396 401 $link = str_replace ( '/'.$taxonomy->rewrite['slug'], '', $link ); -
wp-ffpc/trunk/wp-ffpc-class.php
r1268264 r1271759 493 493 494 494 <dt> 495 <label for="browsercache"><?php _e('Browser cache expiration time of posts', 'wp-ffpc'); ?></label> 496 </dt> 497 <dd> 498 <input type="number" name="browsercache" id="browsercache" value="<?php echo $this->options['browsercache']; ?>" /> 499 <span class="description"><?php _e('Sets validity time of posts/pages/singles for the browser cache.', 'wp-ffpc'); ?></span> 500 </dd> 501 502 <dt> 495 503 <label for="expire_taxonomy"><?php _e('Expiration time for taxonomy', 'wp-ffpc'); ?></label> 496 504 </dt> … … 501 509 502 510 <dt> 511 <label for="browsercache_taxonomy"><?php _e('Browser cache expiration time of taxonomy', 'wp-ffpc'); ?></label> 512 </dt> 513 <dd> 514 <input type="number" name="browsercache_taxonomy" id="browsercache_taxonomy" value="<?php echo $this->options['browsercache_taxonomy']; ?>" /> 515 <span class="description"><?php _e('Sets validity time of taxonomy for the browser cache.', 'wp-ffpc'); ?></span> 516 </dd> 517 518 <dt> 503 519 <label for="expire_home"><?php _e('Expiration time for home', 'wp-ffpc'); ?></label> 504 520 </dt> 505 521 <dd> 506 522 <input type="number" name="expire_home" id="expire_home" value="<?php echo $this->options['expire_home']; ?>" /> 507 <span class="description"><?php _e('Sets validity time of home.', 'wp-ffpc'); ?></span> 523 <span class="description"><?php _e('Sets validity time of home on server side.', 'wp-ffpc'); ?></span> 524 </dd> 525 526 <dt> 527 <label for="browsercache_home"><?php _e('Browser cache expiration time of home', 'wp-ffpc'); ?></label> 528 </dt> 529 <dd> 530 <input type="number" name="browsercache_home" id="browsercache_home" value="<?php echo $this->options['browsercache_home']; ?>" /> 531 <span class="description"><?php _e('Sets validity time of home for the browser cache.', 'wp-ffpc'); ?></span> 508 532 </dd> 509 533 -
wp-ffpc/trunk/wp-ffpc.php
r1268264 r1271759 4 4 Plugin URI: https://github.com/petermolnar/wp-ffpc 5 5 Description: WordPress in-memory full page cache plugin 6 Version: 1. 9.16 Version: 1.10.0 7 7 Author: Peter Molnar <hello@petermolnar.eu> 8 8 Author URI: http://petermolnar.eu/ … … 33 33 'authpass' => '', 34 34 'authuser' => '', 35 'browsercache' => 0, 36 'browsercache_home' => 0, 37 'browsercache_taxonomy' => 0, 35 38 'expire' => 300, 36 39 'expire_home' => 300, … … 61 64 ); 62 65 63 $wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1. 8.2', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' );66 $wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.10.1', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' );
Note: See TracChangeset
for help on using the changeset viewer.