Plugin Directory

Changeset 1191882


Ignore:
Timestamp:
07/03/2015 03:18:48 PM (11 years ago)
Author:
rahul286
Message:

Improved purging and fixed redis

Location:
nginx-helper/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nginx-helper/trunk/nginx-helper.php

    r1191338 r1191882  
    44  Plugin URI: https://rtcamp.com/nginx-helper/
    55  Description: Cleans nginx's fastcgi/proxy cache whenever a post is edited/published. Also does few more things.
    6   Version: 1.9.1
     6  Version: 1.9.2
    77  Author: rtCamp
    88  Author URI: https://rtcamp.com
     
    5050            add_action( 'add_init', array( &$this, 'update_map' ) );
    5151
    52             add_action( 'save_post', array( &$rt_wp_nginx_purger, 'purgePost' ), 200, 1 );
     52            //add_action( 'save_post', array( &$rt_wp_nginx_purger, 'purgePost' ), 200, 1 );
    5353            // add_action( 'publish_post', array( &$rt_wp_nginx_purger, 'purgePost' ), 200, 1 );
    5454            // add_action( 'publish_page', array( &$rt_wp_nginx_purger, 'purgePost' ), 200, 1 );
     
    127127
    128128            global $blog_id, $rt_wp_nginx_purger;
    129             if ( !$this->options['enable_purge'] ) {
    130                 return;
    131             }
    132             if ( $old_status != $new_status && $old_status != 'inherit' && $new_status != 'inherit' && $old_status != 'auto-draft' && $new_status != 'auto-draft' && $new_status != 'publish' && !wp_is_post_revision( $post->ID ) ) {
     129            $skip_status = array( 'auto-draft', 'draft', 'inherit', 'trash', 'pending' );
     130            $purge_status = array( 'publish', 'future' );
     131           
     132            if ( !$this->options['enable_purge'] || in_array( $old_status, $skip_status ) ) {
     133                return;
     134            }
     135           
     136            if( in_array( $old_status, $purge_status ) || in_array( $new_status, $purge_status ) ) {
    133137                $rt_wp_nginx_purger->log( "Purge post on transition post STATUS from " . $old_status . " to " . $new_status );
    134138                $rt_wp_nginx_purger->purgePost( $post->ID );
  • nginx-helper/trunk/readme.txt

    r1191338 r1191882  
    11=== Nginx Helper ===
    2 Contributors: rtcamp, rahul286, saurabhshukla, manishsongirkar36, faishal, desaiuditd, Darren Slatten, jk3us, daankortenbach, telofy, pjv, llonchj, jinnko, weskoop, bcole808, gungeekatx, rohanveer
     2Contributors: rtcamp, rahul286, saurabhshukla, manishsongirkar36, faishal, desaiuditd, Darren Slatten, jk3us, daankortenbach, telofy, pjv, llonchj, jinnko, weskoop, bcole808, gungeekatx, rohanveer, chandrapatel
    33Tags: nginx, cache, purge, nginx map, nginx cache, maps, fastcgi, proxy, rewrite, permalinks
    44Requires at least: 3.0
    55Tested up to: 4.2.2
    6 Stable tag: 1.9.1
     6Stable tag: 1.9.2
    77later (of-.1course)
    88Fix purging for custom post types
     
    117117== Changelog ==
    118118
     119= 1.9.2 =
     120Fix purging for Redis cache and FastCGI cache
     121
    119122= 1.9.1 =
    120123Fix purging for custom post types
  • nginx-helper/trunk/redis-purger.php

    r1190839 r1191882  
    219219            $host = $rt_wp_nginx_helper->options['redis_hostname'];
    220220            $prefix = $rt_wp_nginx_helper->options['redis_prefix'];
    221             $_url_purge_base = $prefix . $parse['scheme'] . 'GET' . $host . $parse['path'];
     221            $_url_purge_base = $prefix . $parse['scheme'] . 'GET' . $parse['host'] . $parse['path'];
    222222            delete_single_key( $_url_purge_base );
    223223        }
Note: See TracChangeset for help on using the changeset viewer.