Plugin Directory

Changeset 1271759


Ignore:
Timestamp:
10/23/2015 12:41:30 PM (10 years ago)
Author:
cadeyrn
Message:

version 1.10.0: adding browser cache and last modified to everything

Location:
wp-ffpc
Files:
1 deleted
5 edited
16 copied

Legend:

Unmodified
Added
Removed
  • wp-ffpc/tags/1.10.0/readme.txt

    r1268264 r1271759  
    55Requires at least: 3.0
    66Tested up to: 4.3.1
    7 Stable tag: 1.9.1
     7Stable tag: 1.10.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8080* Christian Kernbeis
    8181* Gausden Barry
     82* Maksim Bukreyeu
    8283
    8384== Installation ==
     
    128129* every .B version indicates new features.
    129130* every ..C indicates bugfixes for A.B version.
     131
     132= 1.10.0 =
     133*2015-10-23*
     134
     135*IMPORTANT, READ THIS*
     136
     137proper 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
    130143
    131144= 1.9.1 =
  • wp-ffpc/tags/1.10.0/wp-ffpc-acache.php

    r1266062 r1271759  
    140140        /* store results */
    141141        $wp_ffpc_values[ $internal ] = $value;
     142        __debug__('Got value for ' . $internal);
    142143    }
    143144}
     
    178179    header('Content-Type: ' . $wp_ffpc_values['meta']['mime']);
    179180
    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 */
     182if (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}
     205else {
     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}
    186213
    187214/* if shortlinks were set */
    188 if (!empty ( $wp_ffpc_values['meta']['shortlink'] ) )
     215if (isset($wp_ffpc_values['meta']['shortlink']) && !empty ( $wp_ffpc_values['meta']['shortlink'] ) )
    189216    header( 'Link:<'. $wp_ffpc_values['meta']['shortlink'] .'>; rel=shortlink' );
    190217
    191218/* if last modifications were set (for posts & pages) */
    192 if ( !empty($wp_ffpc_values['meta']['lastmodified']) )
     219if (isset($wp_ffpc_values['meta']['lastmodified']) && !empty($wp_ffpc_values['meta']['lastmodified']) )
    193220    header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" );
    194221
    195222/* pingback urls, if existx */
    196 if ( !empty( $wp_ffpc_values['meta']['pingback'] ) && $wp_ffpc_config['pingback_header'] )
     223if ( isset($wp_ffpc_values['meta']['pingback']) && !empty( $wp_ffpc_values['meta']['pingback'] ) && isset($wp_ffpc_config['pingback_header']) && $wp_ffpc_config['pingback_header'] )
    197224    header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] );
    198225
    199226/* for debugging */
    200 if ( $wp_ffpc_config['response_header'] )
     227if ( isset($wp_ffpc_config['response_header']) && $wp_ffpc_config['response_header'] )
    201228    header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP');
    202229
    203230/* HTML data */
    204 
    205 if ( $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) {
     231if ( isset($wp_ffpc_config['generate_time']) && $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) {
    206232    $mtime = explode ( " ", microtime() );
    207233    $wp_ffpc_gentime = ( $mtime[1] + $mtime[0] ) - $wp_ffpc_gentime;
     
    285311    }
    286312
    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() ) {
    292342        $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() ) {
    294372        $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 {
    298395        $meta['type'] = 'unknown';
     396    }
    299397
    300398    if ( $meta['type'] != 'unknown' ) {
     
    324422    $meta['mime'] = $meta['mime'] . $wp_ffpc_config['charset'];
    325423
    326     /* try if post is available
    327         if made with archieve, last listed post can make this go bad
    328     */
    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 
    342424    /* store pingback url if pingbacks are enabled */
    343425    if ( get_option ( 'default_ping_status' ) == 'open' )
  • wp-ffpc/tags/1.10.0/wp-ffpc-backend.php

    r1268264 r1271759  
    387387                if ( !empty ( $terms ) ) {
    388388                    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
    389395                        /* get the permalink for the term */
    390396                        $link = get_term_link ( $term->slug, $taxonomy->name );
    391397                        /* add to container */
    392398                        $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
    395400                        */
    396401                        $link = str_replace ( '/'.$taxonomy->rewrite['slug'], '', $link  );
  • wp-ffpc/tags/1.10.0/wp-ffpc-class.php

    r1268264 r1271759  
    493493
    494494                <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>
    495503                    <label for="expire_taxonomy"><?php _e('Expiration time for taxonomy', 'wp-ffpc'); ?></label>
    496504                </dt>
     
    501509
    502510                <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>
    503519                    <label for="expire_home"><?php _e('Expiration time for home', 'wp-ffpc'); ?></label>
    504520                </dt>
    505521                <dd>
    506522                    <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>
    508532                </dd>
    509533
  • wp-ffpc/tags/1.10.0/wp-ffpc.php

    r1268264 r1271759  
    44Plugin URI: https://github.com/petermolnar/wp-ffpc
    55Description: WordPress in-memory full page cache plugin
    6 Version: 1.9.1
     6Version: 1.10.0
    77Author: Peter Molnar <hello@petermolnar.eu>
    88Author URI: http://petermolnar.eu/
     
    3333    'authpass'            => '',
    3434    'authuser'            => '',
     35    'browsercache'          => 0,
     36    'browsercache_home'     => 0,
     37    'browsercache_taxonomy' => 0,
    3538    'expire'              => 300,
    3639    'expire_home'         => 300,
     
    6164);
    6265
    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  
    55Requires at least: 3.0
    66Tested up to: 4.3.1
    7 Stable tag: 1.9.1
     7Stable tag: 1.10.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8080* Christian Kernbeis
    8181* Gausden Barry
     82* Maksim Bukreyeu
    8283
    8384== Installation ==
     
    128129* every .B version indicates new features.
    129130* every ..C indicates bugfixes for A.B version.
     131
     132= 1.10.0 =
     133*2015-10-23*
     134
     135*IMPORTANT, READ THIS*
     136
     137proper 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
    130143
    131144= 1.9.1 =
  • wp-ffpc/trunk/wp-ffpc-acache.php

    r1266062 r1271759  
    140140        /* store results */
    141141        $wp_ffpc_values[ $internal ] = $value;
     142        __debug__('Got value for ' . $internal);
    142143    }
    143144}
     
    178179    header('Content-Type: ' . $wp_ffpc_values['meta']['mime']);
    179180
    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 */
     182if (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}
     205else {
     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}
    186213
    187214/* if shortlinks were set */
    188 if (!empty ( $wp_ffpc_values['meta']['shortlink'] ) )
     215if (isset($wp_ffpc_values['meta']['shortlink']) && !empty ( $wp_ffpc_values['meta']['shortlink'] ) )
    189216    header( 'Link:<'. $wp_ffpc_values['meta']['shortlink'] .'>; rel=shortlink' );
    190217
    191218/* if last modifications were set (for posts & pages) */
    192 if ( !empty($wp_ffpc_values['meta']['lastmodified']) )
     219if (isset($wp_ffpc_values['meta']['lastmodified']) && !empty($wp_ffpc_values['meta']['lastmodified']) )
    193220    header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" );
    194221
    195222/* pingback urls, if existx */
    196 if ( !empty( $wp_ffpc_values['meta']['pingback'] ) && $wp_ffpc_config['pingback_header'] )
     223if ( isset($wp_ffpc_values['meta']['pingback']) && !empty( $wp_ffpc_values['meta']['pingback'] ) && isset($wp_ffpc_config['pingback_header']) && $wp_ffpc_config['pingback_header'] )
    197224    header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] );
    198225
    199226/* for debugging */
    200 if ( $wp_ffpc_config['response_header'] )
     227if ( isset($wp_ffpc_config['response_header']) && $wp_ffpc_config['response_header'] )
    201228    header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP');
    202229
    203230/* HTML data */
    204 
    205 if ( $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) {
     231if ( isset($wp_ffpc_config['generate_time']) && $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) {
    206232    $mtime = explode ( " ", microtime() );
    207233    $wp_ffpc_gentime = ( $mtime[1] + $mtime[0] ) - $wp_ffpc_gentime;
     
    285311    }
    286312
    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() ) {
    292342        $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() ) {
    294372        $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 {
    298395        $meta['type'] = 'unknown';
     396    }
    299397
    300398    if ( $meta['type'] != 'unknown' ) {
     
    324422    $meta['mime'] = $meta['mime'] . $wp_ffpc_config['charset'];
    325423
    326     /* try if post is available
    327         if made with archieve, last listed post can make this go bad
    328     */
    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 
    342424    /* store pingback url if pingbacks are enabled */
    343425    if ( get_option ( 'default_ping_status' ) == 'open' )
  • wp-ffpc/trunk/wp-ffpc-backend.php

    r1268264 r1271759  
    387387                if ( !empty ( $terms ) ) {
    388388                    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
    389395                        /* get the permalink for the term */
    390396                        $link = get_term_link ( $term->slug, $taxonomy->name );
    391397                        /* add to container */
    392398                        $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
    395400                        */
    396401                        $link = str_replace ( '/'.$taxonomy->rewrite['slug'], '', $link  );
  • wp-ffpc/trunk/wp-ffpc-class.php

    r1268264 r1271759  
    493493
    494494                <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>
    495503                    <label for="expire_taxonomy"><?php _e('Expiration time for taxonomy', 'wp-ffpc'); ?></label>
    496504                </dt>
     
    501509
    502510                <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>
    503519                    <label for="expire_home"><?php _e('Expiration time for home', 'wp-ffpc'); ?></label>
    504520                </dt>
    505521                <dd>
    506522                    <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>
    508532                </dd>
    509533
  • wp-ffpc/trunk/wp-ffpc.php

    r1268264 r1271759  
    44Plugin URI: https://github.com/petermolnar/wp-ffpc
    55Description: WordPress in-memory full page cache plugin
    6 Version: 1.9.1
     6Version: 1.10.0
    77Author: Peter Molnar <hello@petermolnar.eu>
    88Author URI: http://petermolnar.eu/
     
    3333    'authpass'            => '',
    3434    'authuser'            => '',
     35    'browsercache'          => 0,
     36    'browsercache_home'     => 0,
     37    'browsercache_taxonomy' => 0,
    3538    'expire'              => 300,
    3639    'expire_home'         => 300,
     
    6164);
    6265
    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.