Changeset 1345834
- Timestamp:
- 02/08/2016 12:07:04 PM (10 years ago)
- Location:
- wp-sitemanager/trunk
- Files:
-
- 5 edited
-
advanced_cache_tpl/advanced-cache.tpl (modified) (4 diffs)
-
modules/meta-manager.php (modified) (1 diff)
-
modules/site-cache.php (modified) (17 diffs)
-
readme.txt (modified) (2 diffs)
-
wp-sitemanager.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-sitemanager/trunk/advanced_cache_tpl/advanced-cache.tpl
r1299609 r1345834 11 11 private $allowed_query_keys; 12 12 private $site_mode = ### SITE MODE ###; 13 private $replace_class_file; 13 14 14 15 function __construct() { … … 72 73 $site_id = isset( $this->sites[$_SERVER['SERVER_NAME']] ) ? $this->sites[$_SERVER['SERVER_NAME']] : ''; 73 74 $table = $table_prefix . $add_prefix; 75 $this->replace_class_file = WP_CONTENT_DIR . '/replace-class-' . $site_id . '.php'; 74 76 break; 75 77 case 'directory' : … … 81 83 $site_id = isset( $this->sites[$key] ) ? $this->sites[$key] : BLOG_ID_CURRENT_SITE; 82 84 $table = $table_prefix . $add_prefix; 85 $this->replace_class_file = WP_CONTENT_DIR . '/replace-class-' . $site_id . '.php'; 83 86 break; 84 87 default : … … 161 164 header( 'X-cache: cache' ); 162 165 } 166 if ( file_exists( $this->replace_class_file ) ) { 167 require_once( $this->replace_class_file ); 168 $row->content = KUSANAGI_Replace::replace( $row->content ); 169 } 163 170 echo $row->content; 164 171 echo "\n" .'<!-- CacheID : ' . $row->hash . ' -->'; -
wp-sitemanager/trunk/modules/meta-manager.php
r1305832 r1345834 549 549 } 550 550 551 return apply_filters( 'wp_sitemanager_open_graph_image', $image );551 return apply_filters( 'wp_sitemanager_open_graph_image', $image, $width, $height ); 552 552 } 553 553 -
wp-sitemanager/trunk/modules/site-cache.php
r1189382 r1345834 43 43 } else { 44 44 add_action( 'init' , array( $this, 'buffer_start' ) ); 45 45 add_filter( 'wp_headers' , array( $this, 'add_b_cache_header' ) ); 46 46 // add_action( 'template_redirect' , array( $this, 'check_vars' ) ); 47 47 } … … 51 51 } 52 52 53 function check_installed() {53 public function check_installed() { 54 54 $version = get_option( 'site_manager_cache_installed', false ); 55 55 if ( ! $version ) { … … 63 63 } 64 64 } 65 function create_cache_table() {65 private function create_cache_table() { 66 66 global $cache_db; 67 67 … … 126 126 127 127 128 function add_setting_menu() {128 public function add_setting_menu() { 129 129 add_submenu_page( $this->parent->root, 'キャッシュ', 'キャッシュ', 'administrator', basename( $this->parent->root ) . '-cache', array( $this, 'cache_setting_page' ) ); 130 130 } 131 131 132 function cache_setting_page() {132 public function cache_setting_page() { 133 133 $life_time = get_option( 'site_cache_life', array( 'home' => 60, 'archive' => 60, 'singular' => 360, 'exclude' => '', 'allowed_query_keys' => '', 'update' => 'none' ) ); 134 134 $clear_link = add_query_arg( array( 'del_cache' => '1' ) ); … … 211 211 } 212 212 213 function update_cache_setting() {213 public function update_cache_setting() { 214 214 if ( isset( $_GET['del_cache'] ) && $_GET['del_cache'] == '1' && apply_filters( 'allow_sitemanager_cache_clear', true ) ) { 215 215 $this->clear_all_cache(); … … 240 240 241 241 242 function is_writable_advanced_cache_file() {242 private function is_writable_advanced_cache_file() { 243 243 $writable = false; 244 244 if ( file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) { … … 255 255 256 256 257 function check_advanced_cache_file() {257 private function check_advanced_cache_file() { 258 258 if ( file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) { 259 259 if ( is_readable( WP_CONTENT_DIR . '/advanced-cache.php' ) ) { … … 271 271 } 272 272 273 function check_vars() {273 public function check_vars() { 274 274 var_dump( $_SERVER ); 275 275 } 276 276 277 function buffer_start() {277 public function buffer_start() { 278 278 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'] ) ) { 279 279 ob_start( 'write_cache_file' ); … … 282 282 } 283 283 284 function write_cache_file() {284 public function write_cache_file() { 285 285 $buffer = ob_get_contents(); 286 286 } 287 287 288 288 289 function clear_all_cache() {289 private function clear_all_cache() { 290 290 global $cache_db; 291 291 $sql = "TRUNCATE TABLE `{$cache_db->prefix}site_cache`"; … … 294 294 295 295 296 function clear_front_cache() {296 private function clear_front_cache() { 297 297 global $cache_db; 298 298 $sql = " … … 305 305 306 306 307 function clear_single_cache( $post ) {307 private function clear_single_cache( $post ) { 308 308 global $cache_db; 309 309 … … 342 342 343 343 344 function post_publish_clear_cache( $new_status, $old_status, $post ) {344 public function post_publish_clear_cache( $new_status, $old_status, $post ) { 345 345 if ( $new_status == 'publish' ) { 346 346 $life_time = get_option( 'site_cache_life', array( 'update' => 'none' ) ); … … 361 361 362 362 363 function transition_comment_status( $new_status, $old_status, $comment ) {363 public function transition_comment_status( $new_status, $old_status, $comment ) { 364 364 if ( $new_status == 'approved' || $old_status == 'approved' ) { 365 365 $this->clear_all_cache(); … … 368 368 369 369 370 function new_comment( $comment_ID, $approved ) {370 public function new_comment( $comment_ID, $approved ) { 371 371 if ( $approved === 1 ) { 372 372 $this->clear_all_cache(); … … 375 375 376 376 377 function generate_advanced_cache_file() { 377 public function add_b_cache_header( $headers ) { 378 $headers['X-B-Cache'] = 'BYPASS'; 379 return $headers; 380 } 381 382 383 public function generate_advanced_cache_file() { 378 384 global $wpdb, $wp; 379 385 … … 466 472 $this->instance->$instanse = new WP_SiteManager_cache( $this ); 467 473 474 468 475 function write_cache_file( $buffer ) { 469 476 global $WP_SiteManager, $cache_db, $wp; … … 675 682 } 676 683 } 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 } 677 693 return $buffer; 678 694 } -
wp-sitemanager/trunk/readme.txt
r1325067 r1345834 4 4 Requires at least: 4.2 5 5 Tested up to: 4.4.1 6 Stable tag: 1.1. 86 Stable tag: 1.1.9 7 7 8 8 WP SiteManager is an integrated package comprising of necessary functions for using WordPress as a CMS. … … 34 34 35 35 == 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 36 40 = 1.1.8 = 37 41 * fix : notice error on the Multi device page. -
wp-sitemanager/trunk/wp-sitemanager.php
r1325067 r1345834 5 5 Description: WP SiteManager is an integrated package comprising of necessary functions for using WordPress as a CMS. 6 6 Author: Prime Strategy Co.,LTD. 7 Version: 1.1. 87 Version: 1.1.9 8 8 Author URI: http://www.prime-strategy.co.jp/ 9 9 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.