Plugin Directory

Changeset 1603672


Ignore:
Timestamp:
02/26/2017 12:59:55 AM (9 years ago)
Author:
ze3kr
Message:

Add version 0.0.2

Location:
full-site-cache-cf/tags/0.0.2
Files:
2 deleted
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • full-site-cache-cf/tags/0.0.2/full-site-cache-cf.php

    r1586189 r1603672  
    22/**
    33 * @package Full Site Cache for CloudFront
    4  * @version 0.0.1
     4 * @version 0.0.2
    55 */
    66/*
     
    88Description: This plugin allows can auto invalidate the cache automatically if you are using full site CDN.
    99Author: ZE3kr
    10 Version: 0.0.1
     10Version: 0.0.2
    1111Author URI: https://ze3kr.com/
    1212Text Domain: full-site-cache-cf
     
    106106        tlo_cf_purge_post_id_cron( $comment['comment_post_ID'] );
    107107    }
     108
     109    return $approved;
    108110}
    109111
     
    121123    // post type actions
    122124    foreach ( $post_types as $post_type ) {
    123         add_action( 'publish_' .$post_type, 'tlo_cf_purge_blog_cron');
    124         add_action( 'publish_future_' .$post_type, 'tlo_cf_purge_blog_cron');
     125        add_action( 'publish_' .$post_type, 'tlo_cf_purge_post_id_cron');
     126        add_action( 'publish_future_' .$post_type, 'tlo_cf_purge_post_id_cron');
    125127    }
    126128}
     129
     130function on_all_status_transitions( $new_status, $old_status, $post ) {
     131    if ( ($new_status == 'publish' && $old_status != 'publish') || ($new_status == 'new') || ($old_status == 'publish'  &&  $new_status != 'publish') ) {
     132        tlo_cf_purge_blog_cron();
     133    }
     134}
     135add_action(  'transition_post_status',  'on_all_status_transitions', 10, 3 );
    127136
    128137add_action( 'transition_comment_status', 'tlo_cf_purge_comment_status', 91, 3 );
     
    159168    $secret_key = AWS_SECRET_ACCESS_KEY;
    160169
    161     echo $xml;
    162170    $len = strlen($xml);
    163171    $date = gmdate('D, d M Y G:i:s T');
  • full-site-cache-cf/tags/0.0.2/readme.txt

    r1586193 r1603672  
    55Requires at least: 4.4
    66Tested up to: 4.7.2
    7 Stable tag: 0.0.1
     7Stable tag: 0.0.2
    88License: GNU GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1717= Invalidation behaviors =
    1818
    19 + Invalidate the whole cache when a post updated
     19+ Invalidate the whole cache when a new post published
     20+ Invalidate a post page when a post updated
    2021+ Invalidate a post page if have any comment has changed on that page
    2122+ Each invalidation has a minimum interval of 10 minutes
     
    4849== Changelog ==
    4950
     51= 0.0.2 =
     52
     53+ Fixed for comment approval.
     54+ Changed the invalidate behavior.
     55
    5056= 0.0.1 =
    5157
Note: See TracChangeset for help on using the changeset viewer.