Plugin Directory

Changeset 1345834


Ignore:
Timestamp:
02/08/2016 12:07:04 PM (10 years ago)
Author:
primestrategy
Message:

Commit WP SiteManager 1.1.9

Location:
wp-sitemanager/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-sitemanager/trunk/advanced_cache_tpl/advanced-cache.tpl

    r1299609 r1345834  
    1111    private $allowed_query_keys;
    1212    private $site_mode = ### SITE MODE ###;
     13    private $replace_class_file;
    1314
    1415    function __construct() {
     
    7273            $site_id = isset( $this->sites[$_SERVER['SERVER_NAME']] ) ? $this->sites[$_SERVER['SERVER_NAME']] : '';
    7374            $table = $table_prefix . $add_prefix;
     75            $this->replace_class_file = WP_CONTENT_DIR . '/replace-class-' . $site_id . '.php';
    7476            break;
    7577        case 'directory' :
     
    8183            $site_id = isset( $this->sites[$key] ) ? $this->sites[$key] : BLOG_ID_CURRENT_SITE;
    8284            $table = $table_prefix . $add_prefix;
     85            $this->replace_class_file = WP_CONTENT_DIR . '/replace-class-' . $site_id . '.php';
    8386            break;
    8487        default :
     
    161164                        header( 'X-cache: cache' );
    162165                    }
     166                    if ( file_exists( $this->replace_class_file ) ) {
     167                        require_once( $this->replace_class_file );
     168                        $row->content = KUSANAGI_Replace::replace( $row->content );
     169                    }
    163170                    echo $row->content;
    164171                    echo "\n" .'<!-- CacheID : ' . $row->hash . ' -->';   
  • wp-sitemanager/trunk/modules/meta-manager.php

    r1305832 r1345834  
    549549    }
    550550
    551     return apply_filters( 'wp_sitemanager_open_graph_image', $image );
     551    return apply_filters( 'wp_sitemanager_open_graph_image', $image, $width, $height );
    552552}
    553553
  • wp-sitemanager/trunk/modules/site-cache.php

    r1189382 r1345834  
    4343    } else {
    4444        add_action( 'init'                                         , array( $this, 'buffer_start' ) );
    45 
     45        add_filter( 'wp_headers'                                   , array( $this, 'add_b_cache_header' ) );
    4646//      add_action( 'template_redirect'                            , array( $this, 'check_vars' ) );
    4747    }
     
    5151}
    5252
    53 function check_installed() {
     53public function check_installed() {
    5454    $version = get_option( 'site_manager_cache_installed', false );
    5555    if ( ! $version ) {
     
    6363    }
    6464}
    65 function create_cache_table() {
     65private function create_cache_table() {
    6666    global $cache_db;
    6767
     
    126126
    127127
    128 function add_setting_menu() {
     128public function add_setting_menu() {
    129129    add_submenu_page( $this->parent->root, 'キャッシュ', 'キャッシュ', 'administrator', basename( $this->parent->root ) . '-cache', array( $this, 'cache_setting_page' ) );
    130130}
    131131
    132 function cache_setting_page() {
     132public function cache_setting_page() {
    133133    $life_time = get_option( 'site_cache_life', array( 'home' => 60, 'archive' => 60, 'singular' => 360, 'exclude' => '', 'allowed_query_keys' => '', 'update' => 'none' ) );
    134134    $clear_link = add_query_arg( array( 'del_cache' => '1' ) );
     
    211211}
    212212
    213 function update_cache_setting() {
     213public function update_cache_setting() {
    214214    if ( isset( $_GET['del_cache'] ) && $_GET['del_cache'] == '1' && apply_filters( 'allow_sitemanager_cache_clear', true ) ) {
    215215        $this->clear_all_cache();
     
    240240
    241241
    242 function is_writable_advanced_cache_file() {
     242private function is_writable_advanced_cache_file() {
    243243    $writable = false;
    244244    if ( file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
     
    255255
    256256
    257 function check_advanced_cache_file() {
     257private function check_advanced_cache_file() {
    258258    if ( file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
    259259        if ( is_readable( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
     
    271271}
    272272
    273 function check_vars() {
     273public function check_vars() {
    274274    var_dump( $_SERVER );
    275275}
    276276
    277 function buffer_start() {
     277public function buffer_start() {
    278278    if ( defined( 'WP_CACHE' ) && WP_CACHE && isset( $_SERVER['REQUEST_URI'] ) && isset( $_SERVER['HTTP_USER_AGENT'] ) && isset( $_SERVER['REQUEST_METHOD'] ) && isset( $_SERVER['SCRIPT_NAME'] ) && isset( $_SERVER['SERVER_NAME'] ) ) {
    279279        ob_start( 'write_cache_file' );
     
    282282}
    283283
    284 function write_cache_file() {
     284public function write_cache_file() {
    285285    $buffer = ob_get_contents();
    286286}
    287287
    288288
    289 function clear_all_cache() {
     289private function clear_all_cache() {
    290290    global $cache_db;
    291291    $sql = "TRUNCATE TABLE `{$cache_db->prefix}site_cache`";
     
    294294
    295295
    296 function clear_front_cache() {
     296private function clear_front_cache() {
    297297    global $cache_db;
    298298    $sql = "
     
    305305
    306306
    307 function clear_single_cache( $post ) {
     307private function clear_single_cache( $post ) {
    308308    global $cache_db;
    309309   
     
    342342
    343343
    344 function post_publish_clear_cache( $new_status, $old_status, $post ) {
     344public function post_publish_clear_cache( $new_status, $old_status, $post ) {
    345345    if ( $new_status == 'publish' ) {
    346346        $life_time = get_option( 'site_cache_life', array( 'update' => 'none' ) );
     
    361361
    362362
    363 function transition_comment_status( $new_status, $old_status, $comment ) {
     363public function transition_comment_status( $new_status, $old_status, $comment ) {
    364364    if ( $new_status == 'approved' || $old_status == 'approved' ) {
    365365        $this->clear_all_cache();
     
    368368
    369369
    370 function new_comment( $comment_ID, $approved ) {
     370public function new_comment( $comment_ID, $approved ) {
    371371    if ( $approved === 1 ) {
    372372        $this->clear_all_cache();
     
    375375
    376376
    377 function generate_advanced_cache_file() {
     377public function add_b_cache_header( $headers ) {
     378    $headers['X-B-Cache'] = 'BYPASS';
     379    return $headers;
     380}
     381
     382
     383public function generate_advanced_cache_file() {
    378384    global $wpdb, $wp;
    379385
     
    466472$this->instance->$instanse = new WP_SiteManager_cache( $this );
    467473
     474
    468475function write_cache_file( $buffer ) {
    469476    global $WP_SiteManager, $cache_db, $wp;
     
    675682        }
    676683    }
     684   
     685    $replace_class_file  = WP_CONTENT_DIR . '/replace-class.php';
     686    if ( is_multisite() && 1 != get_current_blog_id() ) {
     687        $replace_class_file = WP_CONTENT_DIR . '/replace-class-' . get_current_blog_id() . '.php';
     688    }
     689    if ( file_exists( $replace_class_file ) ) {
     690        include_once( $replace_class_file );
     691        $buffer = KUSANAGI_Replace::replace( $buffer );
     692    }
    677693    return $buffer;
    678694}
  • wp-sitemanager/trunk/readme.txt

    r1325067 r1345834  
    44Requires at least: 4.2
    55Tested up to: 4.4.1
    6 Stable tag: 1.1.8
     6Stable tag: 1.1.9
    77
    88WP SiteManager is an integrated package comprising of necessary functions for using WordPress as a CMS.
     
    3434
    3535== Changelog ==
     36= 1.1.9 =
     37* add : add 2 args( $with, $height ) for 'wp_sitemanager_open_graph_image' filter
     38* add : enable replace-class.php for cache system.
     39
    3640= 1.1.8 =
    3741* fix : notice error on the Multi device page.
  • wp-sitemanager/trunk/wp-sitemanager.php

    r1325067 r1345834  
    55 Description: WP SiteManager is an integrated package comprising of necessary functions for using WordPress as a CMS.
    66 Author: Prime Strategy Co.,LTD.
    7  Version: 1.1.8
     7 Version: 1.1.9
    88 Author URI: http://www.prime-strategy.co.jp/
    99 License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.