PluginProbe ʕ •ᴥ•ʔ
WP Super Cache / 0.6.2
WP Super Cache v0.6.2
3.1.1 trunk 0.1 0.2 0.3 0.3.1 0.4 0.5 0.5.1 0.5.2 0.5.3 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.6.7 0.6.8 0.7 0.7.1 0.8 0.8.1 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.8.8 0.8.9 0.9 0.9.1 0.9.2 0.9.3 0.9.3.1 0.9.4 0.9.4.1 0.9.4.2 0.9.4.3 0.9.5 0.9.6 0.9.6.1 0.9.7 0.9.8 0.9.9 0.9.9.1 0.9.9.2 0.9.9.3 0.9.9.4 0.9.9.5 0.9.9.6 0.9.9.7 0.9.9.8 0.9.9.9 1.0 1.0.1 1.1 1.1.1 1.10.0 1.11.0 1.12.0 1.12.1 1.12.2 1.12.3 1.12.4 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.7.1 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.9 1.9.1 1.9.2 1.9.3 1.9.4 2.0.0 2.0.1 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0
wp-super-cache / wp-cache-phase1.php
wp-super-cache Last commit date
plugins 18 years ago Changelog.txt 18 years ago readme.txt 18 years ago wp-cache-base.php 18 years ago wp-cache-config-sample.php 18 years ago wp-cache-phase1.php 18 years ago wp-cache-phase2.php 18 years ago wp-cache.php 18 years ago
wp-cache-phase1.php
121 lines
1 <?php
2 if( !@include(ABSPATH . 'wp-content/wp-cache-config.php') ) {
3 return;
4 }
5 if( !defined( 'WPCACHEHOME' ) )
6 define('WPCACHEHOME', dirname(__FILE__).'/');
7
8 include( WPCACHEHOME . 'wp-cache-base.php');
9
10 $mutex_filename = 'wp_cache_mutex.lock';
11 $new_cache = false;
12
13
14 // Don't change variables behind this point
15
16 $plugins = glob( WPCACHEHOME . 'plugins/*.php' );
17 if( is_array( $plugins ) ) {
18 foreach ( $plugins as $plugin ) {
19 if( is_file( $plugin ) )
20 require_once( $plugin );
21 }
22 }
23
24 if (!$cache_enabled || $_SERVER["REQUEST_METHOD"] == 'POST')
25 return;
26
27 $file_expired = false;
28 $cache_filename = '';
29 $meta_file = '';
30 $wp_cache_gzip_encoding = '';
31
32 function gzip_accepted(){
33 if( ini_get( 'zlib.output_compression' ) ) // don't compress WP-Cache data files when PHP is already doing it
34 return false;
35
36 if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === false) return false;
37 if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') === false) return 'gzip';
38 return 'x-gzip';
39 }
40
41 if ($cache_compression) {
42 $wp_cache_gzip_encoding = gzip_accepted();
43 }
44
45 $key = $blogcacheid . md5($_SERVER['HTTP_HOST'].preg_replace('/#.*$/', '', str_replace( '/index.php', '/', $_SERVER['REQUEST_URI'] ) ).$wp_cache_gzip_encoding.wp_cache_get_cookies_values());
46
47 $cache_filename = $file_prefix . $key . '.html';
48 $meta_file = $file_prefix . $key . '.meta';
49 $cache_file = realpath( $cache_path . $cache_filename );
50 $meta_pathname = realpath( $cache_path . 'meta/' . $meta_file );
51
52 $wp_start_time = microtime();
53 if( ($mtime = @filemtime($meta_pathname)) ) {
54 if ($mtime + $cache_max_time > time() ) {
55 $meta = new CacheMeta;
56 if (! ($meta = unserialize(@file_get_contents($meta_pathname))) )
57 return;
58 foreach ($meta->headers as $header) {
59 header($header);
60 }
61 if ( !($content_size = @filesize($cache_file)) > 0 || $mtime < @filemtime($cache_file))
62 return;
63 if ($meta->dynamic) {
64 include($cache_file);
65 } else {
66 /* No used to avoid problems with some PHP installations
67 $content_size += strlen($log);
68 header("Content-Length: $content_size");
69 */
70 if(!@readfile ($cache_file))
71 return;
72 }
73 die;
74 }
75 $file_expired = true; // To signal this file was expired
76 }
77
78 function wp_cache_postload() {
79 global $cache_enabled;
80
81 if (!$cache_enabled)
82 return;
83 require( WPCACHEHOME . 'wp-cache-phase2.php');
84 wp_cache_phase2();
85 }
86
87 function wp_cache_get_cookies_values() {
88 $string = '';
89 while ($key = key($_COOKIE)) {
90 if (preg_match("/^wp-postpass|^wordpress|^comment_author_email_/", $key)) {
91 $string .= $_COOKIE[$key] . ",";
92 }
93 next($_COOKIE);
94 }
95 reset($_COOKIE);
96 if( $string != '' )
97 return $string;
98
99 $string = do_cacheaction( 'wp_cache_get_cookies_values', $string );
100 return $string;
101 }
102
103 function add_cacheaction( $action, $func ) {
104 global $wp_supercache_actions;
105 $wp_supercache_actions[ $action ][] = $func;
106 }
107
108 function do_cacheaction( $action, $value = '' ) {
109 global $wp_supercache_actions;
110 if( is_array( $wp_supercache_actions[ $action ] ) ) {
111 $actions = $wp_supercache_actions[ $action ];
112 foreach( $actions as $func ) {
113 $value = $func( $value );
114 }
115 }
116
117 return $value;
118 }
119
120 ?>
121