Hyper Cache - Version 2.4.3

Version Description

Download this release

Release Info

Developer satollo
Plugin Icon wp plugin Hyper Cache
Version 2.4.3
Comparing to
See all releases

Code changes from version 2.3.3 to 2.4.3

Files changed (6) hide show
  1. advanced-cache.php +117 -55
  2. hyper-cache.pot +420 -0
  3. languages/en_US.php +4 -4
  4. options.php +383 -275
  5. plugin.php +2 -2
  6. readme.txt +1 -1
advanced-cache.php CHANGED
@@ -1,9 +1,6 @@
1
  <?php
2
  @include(dirname(__FILE__) . '/hyper-cache-config.php');
3
 
4
- // From the config file
5
- if (!$hyper_cache_enabled) return false;
6
-
7
  global $hyper_cache_stop;
8
  $hyper_cache_stop = false;
9
 
@@ -15,7 +12,8 @@ if (defined(SID) && SID != '') return false;
15
 
16
  $hyper_uri = $_SERVER['REQUEST_URI'];
17
 
18
- if ($hyper_cache_urls == 'default' && strpos($hyper_uri, '?') !== false) return false;
 
19
  if (strpos($hyper_uri, 'robots.txt') !== false) return false;
20
 
21
  // Checks for rejected url
@@ -40,12 +38,16 @@ if (count($hyper_cache_reject_agents) > 0)
40
  }
41
  }
42
 
43
-
44
-
45
-
46
  // Do not use or cache pages when a wordpress user is logged on
47
  foreach ($_COOKIE as $n=>$v)
48
  {
 
 
 
 
 
 
 
49
  // SHIT!!! This test cookie makes to cache not work!!!
50
  if ($n == 'wordpress_test_cookie') continue;
51
  // wp 2.5 and wp 2.3 have different cookie prefix, skip cache if a post password cookie is present, also
@@ -75,6 +77,8 @@ if (strpos($hyper_uri, '/wp-admin/') !== false || strpos($hyper_uri, '/wp-includ
75
 
76
  $hyper_uri = $_SERVER['HTTP_HOST'] . $hyper_uri;
77
 
 
 
78
  // The name of the file with html and other data
79
  $hyper_cache_name = md5($hyper_uri);
80
  $hyper_file = ABSPATH . 'wp-content/hyper-cache/' . hyper_mobile_type() . $hyper_cache_name . '.dat';
@@ -82,28 +86,51 @@ $hyper_file = ABSPATH . 'wp-content/hyper-cache/' . hyper_mobile_type() . $hyper
82
  // The file is present?
83
  if (is_file($hyper_file))
84
  {
 
 
85
  if (!$hyper_cache_timeout || (time() - filectime($hyper_file)) < $hyper_cache_timeout*60)
86
  {
 
 
87
  // Load it and check is it's still valid
88
  $hyper_data = unserialize(file_get_contents($hyper_file));
89
 
90
- // Protect against broken cache files
 
91
  if ($hyper_data != null)
92
  {
93
 
94
  if ($hyper_data['location'])
95
  {
 
96
  header('Location: ' . $hyper_data['location']);
97
  flush;
98
  die();
99
  }
100
 
 
 
101
  if ($hyper_data['status'] == 404)
102
  {
103
- header("HTTP/1.1 404 Not Found");
104
- $hyper_data = unserialize(file_get_contents(ABSPATH . 'wp-content/hyper-cache/404.dat'));
 
 
 
 
 
 
 
 
 
 
 
105
  }
 
106
 
 
 
 
107
  if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER))
108
  {
109
  $if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"]));
@@ -111,49 +138,69 @@ if (is_file($hyper_file))
111
  {
112
  header("HTTP/1.0 304 Not Modified");
113
  flush();
 
114
  die();
115
  }
116
  }
117
 
118
-
119
  header('Last-Modified: ' . date("r", filectime($hyper_file)));
120
 
121
  header('Content-Type: ' . $hyper_data['mime']);
122
 
 
123
  // Send the cached html
124
  if ($hyper_cache_gzip && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && strlen($hyper_data['gz']) > 0)
125
  {
 
126
  header('Content-Encoding: gzip');
127
  echo $hyper_data['gz'];
 
128
  }
129
  else
130
  {
131
- if (strlen($hyper_data['html']) > 0)
 
 
132
  {
 
133
  echo $hyper_data['html'];
134
  }
135
  else
136
  {
137
- echo gzdecode($hyper_data['gz']);
 
138
  }
 
139
  }
140
  flush();
141
  hyper_cache_clean();
142
  die();
143
  }
 
 
 
 
144
  }
145
  }
 
 
 
 
146
 
147
  // Now we start the caching, but we remove the cookie which stores the commenter data otherwise the page will be generated
148
  // with a pre compiled comment form...
149
- foreach ($_COOKIE as $n=>$v )
150
  {
151
- if (substr($n, 0, 14) == 'comment_author')
152
  {
153
- unset($_COOKIE[$n]);
 
 
 
154
  }
155
  }
156
 
 
157
  ob_start('hyper_cache_callback');
158
 
159
  // From here Wordpress starts to process the request
@@ -212,11 +259,6 @@ function hyper_cache_callback($buffer)
212
 
213
  $data['html'] = $buffer;
214
 
215
- if ($hyper_cache_gzip && function_exists('gzencode'))
216
- {
217
- $data['gz'] = gzencode($buffer);
218
- }
219
-
220
  if (is_404())
221
  {
222
  if (!file_exists(ABSPATH . 'wp-content/hyper-cache/404.dat'))
@@ -226,7 +268,6 @@ function hyper_cache_callback($buffer)
226
  fclose($file);
227
  }
228
  unset($data['html']);
229
- unset($data['gz']);
230
  $data['status'] = 404;
231
  }
232
 
@@ -237,17 +278,19 @@ function hyper_cache_callback($buffer)
237
 
238
  function hyper_cache_write(&$data)
239
  {
240
- global $hyper_file, $hyper_cache_storage;
241
 
242
  $data['uri'] = $_SERVER['REQUEST_URI'];
243
- $data['referer'] = $_SERVER['HTTP_REFERER'];
244
- $data['time'] = time();
245
- $data['host'] = $_SERVER['HTTP_HOST'];
246
- $data['agent'] = $_SERVER['HTTP_USER_AGENT'];
247
 
248
- if ($hyper_cache_storage == 'minimize')
 
249
  {
250
- unset($data['html']);
 
251
  }
252
 
253
  $file = fopen($hyper_file, 'w');
@@ -255,7 +298,6 @@ function hyper_cache_write(&$data)
255
  fclose($file);
256
 
257
  header('Last-Modified: ' . date("r", filectime($hyper_file)));
258
-
259
  }
260
 
261
  function hyper_cache_compress(&$buffer)
@@ -307,9 +349,11 @@ function hyper_cache_clean()
307
  {
308
  global $hyper_cache_timeout, $hyper_cache_clean_interval;
309
 
310
- if (!$hyper_cache_clean_interval) return;
311
  if (rand(1, 10) != 5) return;
312
 
 
 
313
  $time = time();
314
  $file = ABSPATH . 'wp-content/hyper-cache/last-clean.dat';
315
  if (file_exists($file) && ($time - filectime($file) < $hyper_cache_clean_interval*60)) return;
@@ -324,42 +368,60 @@ function hyper_cache_clean()
324
  if ($file == '.' || $file == '..') continue;
325
 
326
  $t = filectime($path . '/' . $file);
327
- if ($time - $t > $hyper_cache_timeout) @unlink($path . '/' . $file);
328
  }
329
  closedir($handle);
330
  }
 
331
  }
332
 
333
- if (!function_exists('gzdecode'))
 
334
  {
335
- function gzdecode ($data)
336
- {
337
- $flags = ord(substr($data, 3, 1));
338
- $headerlen = 10;
339
- $extralen = 0;
340
 
341
- $filenamelen = 0;
342
- if ($flags & 4) {
343
- $extralen = unpack('v' ,substr($data, 10, 2));
344
 
345
- $extralen = $extralen[1];
346
- $headerlen += 2 + $extralen;
347
- }
348
- if ($flags & 8) // Filename
349
 
350
- $headerlen = strpos($data, chr(0), $headerlen) + 1;
351
- if ($flags & 16) // Comment
 
 
352
 
353
- $headerlen = strpos($data, chr(0), $headerlen) + 1;
354
- if ($flags & 2) // CRC at end of file
355
 
356
- $headerlen += 2;
357
- $unpacked = gzinflate(substr($data, $headerlen));
358
- if ($unpacked === FALSE)
359
 
360
- $unpacked = $data;
361
- return $unpacked;
362
- }
 
363
  }
364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  ?>
1
  <?php
2
  @include(dirname(__FILE__) . '/hyper-cache-config.php');
3
 
 
 
 
4
  global $hyper_cache_stop;
5
  $hyper_cache_stop = false;
6
 
12
 
13
  $hyper_uri = $_SERVER['REQUEST_URI'];
14
 
15
+ if (!$hyper_cache_cache_qs && strpos($hyper_uri, '?') !== false) return false;
16
+
17
  if (strpos($hyper_uri, 'robots.txt') !== false) return false;
18
 
19
  // Checks for rejected url
38
  }
39
  }
40
 
 
 
 
41
  // Do not use or cache pages when a wordpress user is logged on
42
  foreach ($_COOKIE as $n=>$v)
43
  {
44
+ // If it's required to bypass the cache when the visitor is a commentor, stop.
45
+ if ($hyper_cache_comment && substr($n, 0, 15) == 'comment_author_')
46
+ {
47
+ hyper_cache_stats('commenter');
48
+ return false;
49
+ }
50
+
51
  // SHIT!!! This test cookie makes to cache not work!!!
52
  if ($n == 'wordpress_test_cookie') continue;
53
  // wp 2.5 and wp 2.3 have different cookie prefix, skip cache if a post password cookie is present, also
77
 
78
  $hyper_uri = $_SERVER['HTTP_HOST'] . $hyper_uri;
79
 
80
+ hyper_cache_log('URI: ' . $hyper_uri);
81
+
82
  // The name of the file with html and other data
83
  $hyper_cache_name = md5($hyper_uri);
84
  $hyper_file = ABSPATH . 'wp-content/hyper-cache/' . hyper_mobile_type() . $hyper_cache_name . '.dat';
86
  // The file is present?
87
  if (is_file($hyper_file))
88
  {
89
+ hyper_cache_log('cached page file found: ' . $hyper_cache_name);
90
+
91
  if (!$hyper_cache_timeout || (time() - filectime($hyper_file)) < $hyper_cache_timeout*60)
92
  {
93
+ hyper_cache_log('cached page still valid');
94
+
95
  // Load it and check is it's still valid
96
  $hyper_data = unserialize(file_get_contents($hyper_file));
97
 
98
+ // Protect against broken cache files and start to check redirects and
99
+ // 404.
100
  if ($hyper_data != null)
101
  {
102
 
103
  if ($hyper_data['location'])
104
  {
105
+ hyper_cache_log('was a redirect to ' . $hyper_data['location']);
106
  header('Location: ' . $hyper_data['location']);
107
  flush;
108
  die();
109
  }
110
 
111
+ // If the URI was a 404 try to load the (unique) 404 cache page, if exists,
112
+ // otherwise delete the cached page because it is no more valid.
113
  if ($hyper_data['status'] == 404)
114
  {
115
+ hyper_cache_log('was a 404');
116
+ $hyper_cache_404_file = ABSPATH . 'wp-content/hyper-cache/404.dat';
117
+ $hyper_data = @unserialize(file_get_contents($hyper_cache_404_file));
118
+ if ($hyper_data)
119
+ {
120
+ header("HTTP/1.1 404 Not Found");
121
+ hyper_cache_stats('404');
122
+ }
123
+ else
124
+ {
125
+ @unlink($hyper_file);
126
+ unset($hyper_data);
127
+ }
128
  }
129
+ }
130
 
131
+ // It's time to serve the cached page
132
+ if ($hyper_data != null)
133
+ {
134
  if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER))
135
  {
136
  $if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"]));
138
  {
139
  header("HTTP/1.0 304 Not Modified");
140
  flush();
141
+ hyper_cache_stats('304');
142
  die();
143
  }
144
  }
145
 
 
146
  header('Last-Modified: ' . date("r", filectime($hyper_file)));
147
 
148
  header('Content-Type: ' . $hyper_data['mime']);
149
 
150
+ hyper_cache_log('encoding accepted: ' . $_SERVER['HTTP_ACCEPT_ENCODING']);
151
  // Send the cached html
152
  if ($hyper_cache_gzip && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && strlen($hyper_data['gz']) > 0)
153
  {
154
+ hyper_cache_log('gzip encoding accepted, serving compressed data');
155
  header('Content-Encoding: gzip');
156
  echo $hyper_data['gz'];
157
+ hyper_cache_stats('gzip');
158
  }
159
  else
160
  {
161
+ // No compression accepted, check if we have the plain html or
162
+ // decompress the compressed one.
163
+ if ($hyper_data['html'])
164
  {
165
+ hyper_cache_log('serving plain data');
166
  echo $hyper_data['html'];
167
  }
168
  else
169
  {
170
+ hyper_cache_log('decoding compressed data (length: ' . strlen($hyper_data['gz']) . ')');
171
+ echo hyper_cache_gzdecode($hyper_data['gz']);
172
  }
173
+ hyper_cache_stats('plain');
174
  }
175
  flush();
176
  hyper_cache_clean();
177
  die();
178
  }
179
+ else
180
+ {
181
+ hyper_cache_log('[ERROR] unable to deserialize data');
182
+ }
183
  }
184
  }
185
+ else
186
+ {
187
+ hyper_cache_log('cached page file NOT found: ' . $hyper_file);
188
+ }
189
 
190
  // Now we start the caching, but we remove the cookie which stores the commenter data otherwise the page will be generated
191
  // with a pre compiled comment form...
192
+ if (!$hyper_cache_comment)
193
  {
194
+ foreach ($_COOKIE as $n=>$v )
195
  {
196
+ if (substr($n, 0, 14) == 'comment_author')
197
+ {
198
+ unset($_COOKIE[$n]);
199
+ }
200
  }
201
  }
202
 
203
+ hyper_cache_stats('wp');
204
  ob_start('hyper_cache_callback');
205
 
206
  // From here Wordpress starts to process the request
259
 
260
  $data['html'] = $buffer;
261
 
 
 
 
 
 
262
  if (is_404())
263
  {
264
  if (!file_exists(ABSPATH . 'wp-content/hyper-cache/404.dat'))
268
  fclose($file);
269
  }
270
  unset($data['html']);
 
271
  $data['status'] = 404;
272
  }
273
 
278
 
279
  function hyper_cache_write(&$data)
280
  {
281
+ global $hyper_file, $hyper_cache_store_compressed;
282
 
283
  $data['uri'] = $_SERVER['REQUEST_URI'];
284
+ // $data['referer'] = $_SERVER['HTTP_REFERER'];
285
+ // $data['time'] = time();
286
+ // $data['host'] = $_SERVER['HTTP_HOST'];
287
+ // $data['agent'] = $_SERVER['HTTP_USER_AGENT'];
288
 
289
+ // Look if we need the compressed version
290
+ if ($hyper_cache_store_compressed)
291
  {
292
+ $data['gz'] = gzencode($data['html']);
293
+ if ($data['gz']) unset($data['html']);
294
  }
295
 
296
  $file = fopen($hyper_file, 'w');
298
  fclose($file);
299
 
300
  header('Last-Modified: ' . date("r", filectime($hyper_file)));
 
301
  }
302
 
303
  function hyper_cache_compress(&$buffer)
349
  {
350
  global $hyper_cache_timeout, $hyper_cache_clean_interval;
351
 
352
+ if (!$hyper_cache_clean_interval || !$hyper_cache_timeout) return;
353
  if (rand(1, 10) != 5) return;
354
 
355
+ hyper_cache_log('start cleaning');
356
+
357
  $time = time();
358
  $file = ABSPATH . 'wp-content/hyper-cache/last-clean.dat';
359
  if (file_exists($file) && ($time - filectime($file) < $hyper_cache_clean_interval*60)) return;
368
  if ($file == '.' || $file == '..') continue;
369
 
370
  $t = filectime($path . '/' . $file);
371
+ if ($time - $t > $hyper_cache_timeout*60) @unlink($path . '/' . $file);
372
  }
373
  closedir($handle);
374
  }
375
+ hyper_cache_log('end cleaning');
376
  }
377
 
378
+
379
+ function hyper_cache_gzdecode ($data)
380
  {
381
+ hyper_cache_log('gzdecode called with data length ' + strlen($data));
 
 
 
 
382
 
383
+ $flags = ord(substr($data, 3, 1));
384
+ $headerlen = 10;
385
+ $extralen = 0;
386
 
387
+ $filenamelen = 0;
388
+ if ($flags & 4) {
389
+ $extralen = unpack('v' ,substr($data, 10, 2));
 
390
 
391
+ $extralen = $extralen[1];
392
+ $headerlen += 2 + $extralen;
393
+ }
394
+ if ($flags & 8) // Filename
395
 
396
+ $headerlen = strpos($data, chr(0), $headerlen) + 1;
397
+ if ($flags & 16) // Comment
398
 
399
+ $headerlen = strpos($data, chr(0), $headerlen) + 1;
400
+ if ($flags & 2) // CRC at end of file
 
401
 
402
+ $headerlen += 2;
403
+ $unpacked = gzinflate(substr($data, $headerlen));
404
+ if ($unpacked === FALSE) $unpacked = $data;
405
+ return $unpacked;
406
  }
407
 
408
+
409
+ function hyper_cache_log($text)
410
+ {
411
+ // $file = fopen(dirname(__FILE__) . '/hyper_cache.log', 'a');
412
+ // if (!$file) return;
413
+ // fwrite($file, $_SERVER['REMOTE_ADDR'] . ' ' . date('Y-m-d H:i:s') . ' ' . $text . "\n");
414
+ // fclose($file);
415
+ }
416
+
417
+ function hyper_cache_stats($type)
418
+ {
419
+ global $hyper_cache_stats;
420
+
421
+ if (!$hyper_cache_stats) return;
422
+ $file = fopen(dirname(__FILE__) . '/hyper-cache-' . $type . '.txt', 'a');
423
+ if (!$file) return;
424
+ fwrite($file, 'x');
425
+ fclose($file);
426
+ }
427
  ?>
hyper-cache.pot ADDED
@@ -0,0 +1,420 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # This file is put in the public domain.
3
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
+ #
5
+ #, fuzzy
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PACKAGE VERSION\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/hyper-cache\n"
10
+ "POT-Creation-Date: 2009-09-02 10:41+0000\n"
11
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=CHARSET\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+
18
+ #: options.php:160
19
+ msgid ""
20
+ "Hyper Cache is NOT correctly installed: some files or directories have not "
21
+ "been created. Check if the wp-content directory is writable and remove any "
22
+ "advanced-cache.php file into it. Deactivate and reactivate the plugin."
23
+ msgstr ""
24
+
25
+ #: options.php:166
26
+ msgid ""
27
+ "The WordPress cache system is not enabled! Please, activate it adding the "
28
+ "line of code below in the file wp-config.php."
29
+ msgstr ""
30
+
31
+ #: options.php:172
32
+ #, php-format
33
+ msgid ""
34
+ "<strong>And if this plugin stops to work?</strong><br />Hyper Cache required "
35
+ "a lot of effort to be developed and\r\n"
36
+ " I'm pretty sure is giving you a good, even if invisible, service.\r\n"
37
+ " Probably Hyper Cache makes you save money with your hosting provider "
38
+ "using a\r\n"
39
+ " basic and cheap hosting plan intead of a bigger and expensive one.\r\n"
40
+ " <br />So, why not consider a <a href=\"%s\"><strong>donation</strong></"
41
+ "a>?"
42
+ msgstr ""
43
+
44
+ #: options.php:181
45
+ #, php-format
46
+ msgid ""
47
+ "You can find more details about configurations and working mode\r\n"
48
+ " on <a href=\"%s\">Hyper Cache official page</a>."
49
+ msgstr ""
50
+
51
+ #: options.php:187
52
+ msgid "Other interesting plugins:"
53
+ msgstr ""
54
+
55
+ #: options.php:197
56
+ msgid "Statistics"
57
+ msgstr ""
58
+
59
+ #: options.php:201
60
+ msgid "Enable statistics collection"
61
+ msgstr ""
62
+
63
+ #: options.php:205
64
+ msgid ""
65
+ "Very experimental and not really efficient,\r\n"
66
+ " but can be useful to check how the cache works."
67
+ msgstr ""
68
+
69
+ #: options.php:207
70
+ msgid ""
71
+ "Many .txt files willbe created inside the wp-content folder,\r\n"
72
+ " you can safely delete them if you need."
73
+ msgstr ""
74
+
75
+ #: options.php:226
76
+ msgid ""
77
+ "Below are statitics about requests Hyper Cache can handle and the ratio "
78
+ "between the\r\n"
79
+ "requests served by Hyper Cache and the ones served by WordPress."
80
+ msgstr ""
81
+
82
+ #: options.php:229
83
+ msgid ""
84
+ "Requests that bypass the cache due to configurations are not counted because "
85
+ "they are\r\n"
86
+ "explicitely not cacheable."
87
+ msgstr ""
88
+
89
+ #: options.php:237
90
+ msgid "Detailed data broken up on different types of cache hits"
91
+ msgstr ""
92
+
93
+ #: options.php:250 options.php:323 options.php:349 options.php:388
94
+ #: options.php:511
95
+ msgid "Update"
96
+ msgstr ""
97
+
98
+ #: options.php:253
99
+ msgid "Configuration"
100
+ msgstr ""
101
+
102
+ #: options.php:258
103
+ msgid "Cached pages timeout"
104
+ msgstr ""
105
+
106
+ #: options.php:261 options.php:274
107
+ msgid "minutes"
108
+ msgstr ""
109
+
110
+ #: options.php:263
111
+ msgid ""
112
+ "Minutes a cached page is valid and served to users. A zero value means a "
113
+ "cached page is\r\n"
114
+ " valid forever."
115
+ msgstr ""
116
+
117
+ #: options.php:265
118
+ msgid ""
119
+ "If a cached page is older than specified value (expired) it is no more used "
120
+ "and\r\n"
121
+ " will be regenerated on next request of it."
122
+ msgstr ""
123
+
124
+ #: options.php:271
125
+ msgid "Cache autoclean"
126
+ msgstr ""
127
+
128
+ #: options.php:276
129
+ msgid ""
130
+ "Frequency of the autoclean process which removes to expired cached pages to "
131
+ "free\r\n"
132
+ " disk space. Set lower or equals of timeout above. If set to zero the "
133
+ "autoclean process never\r\n"
134
+ " runs."
135
+ msgstr ""
136
+
137
+ #: options.php:283
138
+ msgid "Cache invalidation mode"
139
+ msgstr ""
140
+
141
+ #: options.php:286
142
+ msgid "All cached pages"
143
+ msgstr ""
144
+
145
+ #: options.php:287
146
+ msgid "Modified pages and home page"
147
+ msgstr ""
148
+
149
+ #: options.php:288
150
+ msgid "Only modified pages"
151
+ msgstr ""
152
+
153
+ #: options.php:289
154
+ msgid "Nothing"
155
+ msgstr ""
156
+
157
+ #: options.php:292
158
+ msgid ""
159
+ "\"Invalidation\" is the process of deleting cached pages when they are no "
160
+ "more valid."
161
+ msgstr ""
162
+
163
+ #: options.php:293
164
+ msgid ""
165
+ "Invalidation process is started when blog contents are modified (new post, "
166
+ "post update, new comment,...) so\r\n"
167
+ " one or more cached pages need to be refreshed to get that new "
168
+ "content."
169
+ msgstr ""
170
+
171
+ #: options.php:299
172
+ msgid "Disable cache for commenters"
173
+ msgstr ""
174
+
175
+ #: options.php:303
176
+ msgid ""
177
+ "When users leave comments, WordPress show pages with their comments even if "
178
+ "in moderation\r\n"
179
+ " (and not visible to others) and pre-fills the comment form."
180
+ msgstr ""
181
+
182
+ #: options.php:305
183
+ msgid "If you want to keep those features, enable this option."
184
+ msgstr ""
185
+
186
+ #: options.php:306
187
+ msgid "The caching system will be less efficient but the blog more usable."
188
+ msgstr ""
189
+
190
+ #: options.php:312
191
+ msgid "Feeds caching"
192
+ msgstr ""
193
+
194
+ #: options.php:316
195
+ msgid "When enabled the blog feeds will be cache as well."
196
+ msgstr ""
197
+
198
+ #: options.php:317
199
+ msgid ""
200
+ "Usually this options has to be left unchecked but if your blog is rather "
201
+ "static,\r\n"
202
+ " you can enable it and have a bit more efficiency"
203
+ msgstr ""
204
+
205
+ #: options.php:326
206
+ msgid "Configuration for mobile devices"
207
+ msgstr ""
208
+
209
+ #: options.php:329
210
+ msgid "Detect mobile devices"
211
+ msgstr ""
212
+
213
+ #: options.php:333
214
+ msgid ""
215
+ "When enabled mobile devices will be detected and the cached page stored "
216
+ "under different name."
217
+ msgstr ""
218
+
219
+ #: options.php:334
220
+ msgid ""
221
+ "This makes blogs with different themes for mobile devices to work correctly."
222
+ msgstr ""
223
+
224
+ #: options.php:339
225
+ msgid "Mobile agent list"
226
+ msgstr ""
227
+
228
+ #: options.php:343
229
+ msgid "One per line mobile agents to check for when a page is requested."
230
+ msgstr ""
231
+
232
+ #: options.php:344
233
+ msgid ""
234
+ "The mobile agent string is matched against the agent a device is sending to "
235
+ "the server."
236
+ msgstr ""
237
+
238
+ #: options.php:353
239
+ msgid "Compression"
240
+ msgstr ""
241
+
242
+ #: options.php:357
243
+ msgid ""
244
+ "Your hosting space has not the \"gzencode\" function, so no compression "
245
+ "options are available."
246
+ msgstr ""
247
+
248
+ #: options.php:363
249
+ msgid "Enable compression"
250
+ msgstr ""
251
+
252
+ #: options.php:367
253
+ msgid "When possible the page will be sent compressed to save bandwidth."
254
+ msgstr ""
255
+
256
+ #: options.php:368
257
+ msgid ""
258
+ "Only the textual part of a page can be compressed, not images, so a photo\r\n"
259
+ " blog will consume a lot of bandwidth even with compression enabled."
260
+ msgstr ""
261
+
262
+ #: options.php:370 options.php:383
263
+ msgid "Leave the options disabled if you note malfunctions, like blank pages."
264
+ msgstr ""
265
+
266
+ #: options.php:372
267
+ msgid "If you enable this option, the option below will be enabled as well."
268
+ msgstr ""
269
+
270
+ #: options.php:377
271
+ msgid "Disk space usage"
272
+ msgstr ""
273
+
274
+ #: options.php:381
275
+ msgid "Enable this option to minimize disk space usage."
276
+ msgstr ""
277
+
278
+ #: options.php:382
279
+ msgid "The cache will be a little less performant."
280
+ msgstr ""
281
+
282
+ #: options.php:394
283
+ msgid "Cached page count"
284
+ msgstr ""
285
+
286
+ #: options.php:400
287
+ msgid "Advanced options"
288
+ msgstr ""
289
+
290
+ #: options.php:404
291
+ msgid "Translation"
292
+ msgstr ""
293
+
294
+ #: options.php:408
295
+ msgid "DO NOT show this panel translated."
296
+ msgstr ""
297
+
298
+ #: options.php:412
299
+ msgid "HTML optimization"
300
+ msgstr ""
301
+
302
+ #: options.php:416
303
+ msgid "Try to optimize the generated HTML."
304
+ msgstr ""
305
+
306
+ #: options.php:417
307
+ msgid ""
308
+ "Be sure to extensively verify it it works with your theme on different "
309
+ "browsers!"
310
+ msgstr ""
311
+
312
+ #: options.php:418
313
+ msgid "NO MORE EFFECTIVE DUE TO COMPATIBILITY PROBLEMS"
314
+ msgstr ""
315
+
316
+ #: options.php:423
317
+ msgid "Home caching"
318
+ msgstr ""
319
+
320
+ #: options.php:427
321
+ msgid "DO NOT cache the home page so it is always fresh."
322
+ msgstr ""
323
+
324
+ #: options.php:432
325
+ msgid "Redirect caching"
326
+ msgstr ""
327
+
328
+ #: options.php:436
329
+ msgid "Cache WordPress redirects."
330
+ msgstr ""
331
+
332
+ #: options.php:437
333
+ msgid ""
334
+ "WordPress sometime sends back redirects that can be cached to avoid further "
335
+ "processing time."
336
+ msgstr ""
337
+
338
+ #: options.php:442
339
+ msgid "URL with parameters"
340
+ msgstr ""
341
+
342
+ #: options.php:446
343
+ msgid "Cache requests with query string (parameters)."
344
+ msgstr ""
345
+
346
+ #: options.php:447
347
+ msgid ""
348
+ "This option has to be enabled for blogs which have post URLs with a question "
349
+ "mark on them."
350
+ msgstr ""
351
+
352
+ #: options.php:448
353
+ msgid ""
354
+ "This option is disabled by default because there is plugins which use\r\n"
355
+ " URL parameter to perform specific action that cannot be cached"
356
+ msgstr ""
357
+
358
+ #: options.php:450
359
+ msgid ""
360
+ "For who is using search engines friendly permalink format is safe to\r\n"
361
+ " leave this option disabled, no performances will be lost."
362
+ msgstr ""
363
+
364
+ #: options.php:456
365
+ msgid "URI to reject"
366
+ msgstr ""
367
+
368
+ #: options.php:460
369
+ msgid "Write one URI per line, each URI has to start with a slash."
370
+ msgstr ""
371
+
372
+ #: options.php:461
373
+ msgid ""
374
+ "A specified URI will match the requested URI if the latter starts with the "
375
+ "former."
376
+ msgstr ""
377
+
378
+ #: options.php:462
379
+ msgid ""
380
+ "If you want to specify a stric matching, surround the URI with double quotes."
381
+ msgstr ""
382
+
383
+ #: options.php:481
384
+ msgid "Agents to reject"
385
+ msgstr ""
386
+
387
+ #: options.php:485
388
+ msgid "Write one agent per line."
389
+ msgstr ""
390
+
391
+ #: options.php:486
392
+ msgid ""
393
+ "A specified agent will match the client agent if the latter contains the "
394
+ "former. The matching is case insensitive."
395
+ msgstr ""
396
+
397
+ #: options.php:491
398
+ msgid "Cookies matching"
399
+ msgstr ""
400
+
401
+ #: options.php:495
402
+ msgid "Write one cookie name per line."
403
+ msgstr ""
404
+
405
+ #: options.php:496
406
+ msgid ""
407
+ "When a specified cookie will match one of the cookie names sent bby the "
408
+ "client the cache stops."
409
+ msgstr ""
410
+
411
+ #: options.php:499
412
+ msgid ""
413
+ "It seems you have Facebook Connect plugin installed. Add this cookie name to "
414
+ "make it works\r\n"
415
+ " with Hyper Cache:"
416
+ msgstr ""
417
+
418
+ #: plugin.php:72
419
+ msgid "Settings"
420
+ msgstr ""
languages/en_US.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- $hyper_labels['wp_cache_not_enabled'] = "The wordPress cache system is not enabled. Please, activate it adding the line of code below in the file wp-config.php. Thank you!";
4
- $hyper_labels['configuration'] = "Configuration";
5
- $hyper_labels['activate'] = "Activate the cache?";
6
  $hyper_labels['timeout'] = "Expire a cached page after";
7
  $hyper_labels['timeout_desc'] = "minutes (set to zero to never expire)";
8
  $hyper_labels['count'] = "Total cached pages (cached redirect is counted too)";
@@ -19,7 +19,7 @@ $hyper_labels['redirects_desc'] = "Can give problems with some configuration. Tr
19
  $hyper_labels['mobile'] = "Detetect and cache for mobile devices";
20
  $hyper_labels['clean_interval'] = "Autoclean every";
21
  $hyper_labels['clean_interval_desc'] = "minutes (set to zero to disable)";
22
- $hyper_labels['not_activated'] = "Hyper Cache is NOT correctly installed: some files or directories have not been created. Check if the wp-content directory is writable and remove any advanced-cache.php file into it. Deactivate and reactivate the plugin.";
23
  $hyper_labels['expire_type'] = "What cached pages to delete on events";
24
  $hyper_labels['expire_type_desc'] = "<b>none</b>: the cache never delete the cached page on events (comments, new posts, and so on)<br />";
25
  $hyper_labels['expire_type_desc'] .= "<b>single pages</b>: the cached pages relative to the post modified (by the editor or when a comment is added) plus the home page. New published posts invalidate all the cache.<br />";
1
  <?php
2
 
3
+ //$hyper_labels['wp_cache_not_enabled'] = "The wordPress cache system is not enabled. Please, activate it adding the line of code below in the file wp-config.php. Thank you!";
4
+ //$hyper_labels['configuration'] = "Configuration";
5
+ //$hyper_labels['activate'] = "Activate the cache?";
6
  $hyper_labels['timeout'] = "Expire a cached page after";
7
  $hyper_labels['timeout_desc'] = "minutes (set to zero to never expire)";
8
  $hyper_labels['count'] = "Total cached pages (cached redirect is counted too)";
19
  $hyper_labels['mobile'] = "Detetect and cache for mobile devices";
20
  $hyper_labels['clean_interval'] = "Autoclean every";
21
  $hyper_labels['clean_interval_desc'] = "minutes (set to zero to disable)";
22
+ //$hyper_labels['not_activated'] = "Hyper Cache is NOT correctly installed: some files or directories have not been created. Check if the wp-content directory is writable and remove any advanced-cache.php file into it. Deactivate and reactivate the plugin.";
23
  $hyper_labels['expire_type'] = "What cached pages to delete on events";
24
  $hyper_labels['expire_type_desc'] = "<b>none</b>: the cache never delete the cached page on events (comments, new posts, and so on)<br />";
25
  $hyper_labels['expire_type_desc'] .= "<b>single pages</b>: the cached pages relative to the post modified (by the editor or when a comment is added) plus the home page. New published posts invalidate all the cache.<br />";
options.php CHANGED
@@ -2,72 +2,16 @@
2
 
3
  $options = get_option('hyper');
4
 
5
- @include(dirname(__FILE__) . '/languages/en_US.php');
6
- if (!$options['_notranslation'] && WPLANG != '') @include(dirname(__FILE__) . '/languages/' . WPLANG . '.php');
7
-
8
- function hyper_request($name, $default=null)
9
  {
10
- if (!isset($_POST[$name]))
11
- {
12
- return $default;
13
- }
14
-
15
- if (get_magic_quotes_gpc())
16
- {
17
- return hyper_stripslashes($_POST[$name]);
18
- }
19
- else
20
- {
21
- return $_POST[$name];
22
- }
23
- }
24
-
25
- function hyper_stripslashes($value)
26
- {
27
- $value = is_array($value)?array_map('hyper_stripslashes', $value):stripslashes($value);
28
- return $value;
29
- }
30
-
31
- function hyper_field_checkbox($name, $label='', $tips='', $attrs='') {
32
- global $options;
33
-
34
- echo '<th scope="row">';
35
- echo '<label for="options[' . $name . ']">' . $label . '</label></th>';
36
- echo '<td><input type="checkbox" ' . $attrs . ' name="options[' . $name . ']" value="1" ' . ($options[$name]!= null?'checked':'') . '/>';
37
- echo ' ' . $tips;
38
- echo '</td>';
39
- }
40
-
41
- function hyper_field_text($name, $label='', $tips='', $attrs='') {
42
- global $options;
43
- if (strpos($attrs, 'size') === false) $attrs .= 'size="30"';
44
- echo '<th scope="row">';
45
- echo '<label for="options[' . $name . ']">' . $label . '</label></th>';
46
- echo '<td><input type="text" ' . $attrs . ' name="options[' . $name . ']" value="' .
47
- htmlspecialchars($options[$name]) . '"/>';
48
- echo ' ' . $tips;
49
- echo '</td>';
50
- }
51
-
52
- function hyper_field_textarea($name, $label='', $tips='', $attrs='') {
53
- global $options;
54
-
55
- if (strpos($attrs, 'cols') === false) $attrs .= 'cols="70"';
56
- if (strpos($attrs, 'rows') === false) $attrs .= 'rows="5"';
57
-
58
- echo '<th scope="row">';
59
- echo '<label for="options[' . $name . ']">' . $label . '</label></th>';
60
- echo '<td><textarea wrap="off" ' . $attrs . ' name="options[' . $name . ']">' .
61
- htmlspecialchars($options[$name]) . '</textarea>';
62
- echo '<br />' . $tips;
63
- echo '</td>';
64
  }
65
 
66
  $installed = is_dir(ABSPATH . 'wp-content/hyper-cache') && is_file(ABSPATH . 'wp-content/advanced-cache.php') &&
67
  @filesize(ABSPATH . 'wp-content/advanced-cache.php') == @filesize(ABSPATH . 'wp-content/plugins/hyper-cache/advanced-cache.php');
68
 
69
-
70
- if ($installed && isset($_POST['clear']))
71
  {
72
  hyper_cache_invalidate();
73
  }
@@ -75,21 +19,21 @@ if ($installed && isset($_POST['clear']))
75
 
76
  if ($installed && isset($_POST['save']))
77
  {
78
- $options = hyper_request('options');
 
 
79
 
80
- if ($options['timeout'] == '' || !is_numeric($options['timeout']))
81
- {
82
- $options['timeout'] = 60;
83
- }
84
 
85
- if ($options['clean_interval'] == '' || !is_numeric($options['clean_interval']))
86
- {
87
- $options['clean_interval'] = 0;
88
- }
89
 
90
  $buffer = "<?php\n";
91
  $buffer .= '$hyper_cache_charset = "' . get_option('blog_charset') . '"' . ";\n";
92
- $buffer .= '$hyper_cache_enabled = ' . ($options['enabled']?'true':'false') . ";\n";
 
 
93
  $buffer .= '$hyper_cache_compress = ' . ($options['compress']?'true':'false') . ";\n";
94
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
95
  $buffer .= '$hyper_cache_cron_key = \'' . $options['cron_key'] . "';\n";
@@ -97,13 +41,16 @@ if ($installed && isset($_POST['save']))
97
  $buffer .= '$hyper_cache_redirects = ' . ($options['redirects']?'true':'false') . ";\n";
98
  $buffer .= '$hyper_cache_mobile = ' . ($options['mobile']?'true':'false') . ";\n";
99
  $buffer .= '$hyper_cache_feed = ' . ($options['feed']?'true':'false') . ";\n";
 
 
100
  $buffer .= '$hyper_cache_home = ' . ($options['home']?'true':'false') . ";\n";
101
  //$buffer .= '$hyper_cache_folder = \'' . $options['folder'] . "';\n";
102
- if (function_exists('gzencode'))
103
- {
104
- $buffer .= '$hyper_cache_gzip = ' . ($options['gzip']?'true':'false') . ";\n";
105
- $buffer .= '$hyper_cache_storage = \'' . $options['storage'] . "';\n";
106
- }
 
107
  $buffer .= '$hyper_cache_urls = \'' . $options['urls'] . "';\n";
108
  $buffer .= '$hyper_cache_folder = \'' . ABSPATH . 'wp-content/hyper-cache' . "';\n";
109
  $buffer .= '$hyper_cache_clean_interval = ' . $options['clean_interval'] . ";\n";
@@ -188,14 +135,6 @@ if ($installed && isset($_POST['save']))
188
  }
189
  else
190
  {
191
- if ($options['timeout'] == '')
192
- {
193
- $options['timeout'] = 60;
194
- }
195
- if ($options['clean_interval'] == '')
196
- {
197
- $options['clean_interval'] = 1440;
198
- }
199
  if ($options['mobile_agents'] == '')
200
  {
201
  $options['mobile_agents'] = "elaine/3.0\niphone\nipod\npalm\neudoraweb\nblazer\navantgo\nwindows ce\ncellphone\nsmall\nmmef20\ndanger\nhiptop\nproxinet\nnewt\npalmos\nnetfront\nsharp-tq-gx10\nsonyericsson\nsymbianos\nup.browser\nup.link\nts21i-10\nmot-v\nportalmmm\ndocomo\nopera mini\npalm\nhandspring\nnokia\nkyocera\nsamsung\nmotorola\nmot\nsmartphone\nblackberry\nwap\nplaystation portable\nlg\nmmp\nopwv\nsymbian\nepoc";
@@ -204,202 +143,371 @@ else
204
 
205
  ?>
206
  <div class="wrap">
207
- <form method="post">
208
- <h2>Hyper Cache</h2>
209
 
210
- <?php
211
- if (!$installed)
212
- {
213
- echo '<div class="alert error" style="margin-top:10px;"><p>';
214
- echo $hyper_labels['not_activated'];
215
- echo '</p></div>';
216
- }
217
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
  <?php
220
- if (!defined('WP_CACHE') ) {
221
- echo '<div class="alert error" style="margin-top:10px;"><p>';
222
- echo $hyper_labels['wp_cache_not_enabled'];
223
- echo "<pre>define('WP_CACHE', true);</pre>";
224
- echo '</p></div>';
225
- }
 
226
  ?>
227
- <p>To have more information about Hyper Cache read the <a href="http://www.satollo.com/english/wordpress/hyper-cache">official plugin page</a>
228
- or write me to info@satollo.com.</p>
229
-
230
-
231
- <p>Consider a <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483">DONATION</a> to support this plugin or
232
- if it <strong>saved you a lot of money</strong> avoiding expensive hosting providers to sustain your blog traffic...</p>
233
-
234
- <p>
235
- My other plugins:
236
- <a href="http://www.satollo.com/english/wordpress/post-layout">Post Layout</a>,
237
- <a href="http://www.satollo.com/english/wordpress/feed-layout">Feed Layout</a>,
238
- </p>
239
-
240
- <p>Check the advanced options if you are using the Global Translator Plugin or if you are NOT using
241
- permalinks (eg. IIS hosted blogs).</p>
242
-
243
- <h3><?php echo $hyper_labels['configuration']; ?></h3>
244
- <table class="form-table">
245
- <tr valign="top">
246
- <?php hyper_field_checkbox('_notranslation', $hyper_labels['_notranslation']); ?>
247
- </tr>
248
- <tr valign="top">
249
- <?php hyper_field_checkbox('enabled', $hyper_labels['activate']); ?>
250
- </tr>
251
- <tr valign="top">
252
- <?php hyper_field_text('timeout', $hyper_labels['timeout'], $hyper_labels['timeout_desc'], 'size="5"'); ?>
253
- </tr>
254
- <tr valign="top">
255
- <?php hyper_field_text('clean_interval', $hyper_labels['clean_interval'], $hyper_labels['clean_interval_desc'], 'size="5"'); ?>
256
- </tr>
257
-
258
- <tr valign="top">
259
- <th scope="row"><label><?php echo $hyper_labels['expire_type']; ?></label></th>
260
- <td>
261
- <select name="options[expire_type]">
262
- <option value="post_strictly" <?php echo ($options['expire_type'] == 'post_strictly')?'selected':''; ?>>Single pages strictly</option>
263
- <option value="post" <?php echo ($options['expire_type'] == 'post')?'selected':''; ?>>Single pages</option>
264
- <option value="all" <?php echo ($options['expire_type'] == 'all')?'selected':''; ?>>All</option>
265
- <option value="none" <?php echo ($options['expire_type'] == 'none')?'selected':''; ?>>None</option>
266
- </select><br />
267
- <?php echo $hyper_labels['expire_type_desc']; ?>
268
- </td>
269
- </tr>
270
- <tr valign="top">
271
- <?php hyper_field_checkbox('feed', $hyper_labels['feed'], $hyper_labels['feed_desc']); ?>
272
- </tr>
273
- <tr valign="top">
274
- <?php hyper_field_checkbox('compress', $hyper_labels['compress_html'], $hyper_labels['compress_html_desc']); ?>
275
- </tr>
276
- <tr valign="top">
277
- <?php hyper_field_checkbox('mobile', $hyper_labels['mobile']); ?>
278
- </tr>
279
- <tr valign="top">
280
- <th scope="row"><label><?php echo $hyper_labels['mobile_agents']; ?></label></th>
281
- <td>
282
- <textarea wrap="off" rows="5" cols="70" name="options[mobile_agents]"><?php echo htmlspecialchars($options['mobile_agents']); ?></textarea>
283
- <br />
284
- <?php echo $hyper_labels['mobile_agents_desc']; ?>
285
- </td>
286
- </tr>
287
- <tr valign="top">
288
- <th scope="row"><label><?php echo $hyper_labels['gzip']; ?></label></th>
289
- <td>
290
- <?php if (function_exists('gzencode')) { ?>
291
- <input type="checkbox" name="options[gzip]" value="1" <?php echo $options['gzip']!=null?'checked':''; ?> />
292
- <br />
293
- <?php echo $hyper_labels['gzip_desc']; ?>
294
- <?php } else { ?>
295
- <?php echo $hyper_labels['gzip_nogzencode_desc']; ?>
296
- <?php } ?>
297
- </td>
298
- </tr>
299
-
300
- <!--
 
 
 
301
  <tr valign="top">
302
- <?php hyper_field_text('folder', $hyper_labels['folder'], $hyper_labels['folder_desc'], 'size="5"'); ?>
 
 
 
 
 
 
 
 
 
303
  </tr>
304
- -->
305
- <tr valign="top">
306
- <th scope="row"><?php echo $hyper_labels['count']; ?></th>
307
- <td><?php echo hyper_count(); ?></td>
308
- </tr>
309
- </table>
310
-
311
-
312
- <h3><?php echo $hyper_labels['advanced_options']; ?></h3>
313
- <table class="form-table">
314
- <tr valign="top">
315
- <?php hyper_field_checkbox('home', $hyper_labels['home'], $hyper_labels['home_desc']); ?>
316
- </tr>
317
- <tr valign="top">
318
- <?php hyper_field_checkbox('redirects', $hyper_labels['redirects'], $hyper_labels['redirects_desc']); ?>
319
- </tr>
320
- <tr valign="top">
321
- <th scope="row"><label><?php echo $hyper_labels['storage']; ?></label></th>
322
- <td>
323
- <?php if (function_exists('gzencode')) { ?>
324
- <select name="options[storage]">
325
- <option value="default" <?php echo ($options['storage'] == 'default')?'selected':''; ?>>Default</option>
326
- <option value="minimize" <?php echo ($options['storage'] == 'minimize')?'selected':''; ?>>Minimize the disk space</option>
327
- </select>
328
- <?php } else { ?>
329
- <?php echo $hyper_labels['storage_nogzencode_desc']; ?>
330
- <?php } ?>
331
- </td>
332
- </tr>
333
- <tr valign="top">
334
- <th scope="row"><label><?php echo $hyper_labels['urls_analysis']; ?></label></th>
335
- <td>
336
- <select name="options[urls]">
337
- <option value="default" <?php echo ($options['urls'] == 'default')?'selected':''; ?>><?php echo $hyper_labels['urls_analysis_default']; ?></option>
338
- <option value="full" <?php echo ($options['urls'] == 'full')?'selected':''; ?>><?php echo $hyper_labels['urls_analysis_full']; ?></option>
339
- <!--
340
- <option value="removeqs" <?php echo ($options['removeqs'] == 'full')?'selected':''; ?>><?php echo $hyper_labels['urls_analysis_removeqs']; ?></option>
341
- -->
342
- </select>
343
- <br />
344
- <?php echo $hyper_labels['urls_analysis_desc']; ?>
345
- </td>
346
- </tr>
347
- <tr valign="top">
348
- <th scope="row"><label><?php echo $hyper_labels['reject']; ?></label></th>
349
- <td>
350
- <textarea wrap="off" rows="5" cols="70" name="options[reject]"><?php echo htmlspecialchars($options['reject']); ?></textarea>
351
- <br />
352
- <?php echo $hyper_labels['reject_desc']; ?>
353
-
354
- <?php
355
- $languages = get_option('gltr_preferred_languages');
356
- if (is_array($languages))
357
- {
358
- echo '<br />';
359
- $home = get_option('home');
360
- $x = strpos($home, '/', 8); // skips http://
361
- $base = '';
362
- if ($x !== false) $base = substr($home, $x);
363
- echo 'It seems you have Global Translator installed. The URI prefixes below can be added to avoid double caching of translated pages:<br />';
364
- foreach($languages as $l) echo $base . '/' . $l . '/ ';
365
- }
366
- ?>
367
- </td>
368
- </tr>
369
- <tr valign="top">
370
- <th scope="row"><label><?php echo $hyper_labels['reject_agents']; ?></label></th>
371
- <td>
372
- <textarea wrap="off" rows="5" cols="70" name="options[reject_agents]"><?php echo htmlspecialchars($options['reject_agents']); ?></textarea>
373
- <br />
374
- <?php echo $hyper_labels['reject_agents_desc']; ?>
375
- </td>
376
- </tr>
377
- <tr valign="top">
378
- <th scope="row"><label>Cookies that bypass Hyper Cache</label></th>
379
- <td>
380
- <textarea wrap="off" rows="5" cols="70" name="options[reject_cookies]"><?php echo htmlspecialchars($options['reject_cookies']); ?></textarea>
381
- <br />
382
- One per line insert cookie names that, if present, bypass the cache. The names specifies will
383
- match if there is at least one cookie name <strong>starting</strong> with such name.
384
- <?php if (defined('FBC_APP_KEY_OPTION')) { ?>
385
- <br />
386
- It seems you have <strong>Facebook Connect</strong> plugin installed. Add this cookie name to make it works
387
- with Hyper Cache:<br />
388
- <strong><?php echo get_option(FBC_APP_KEY_OPTION); ?>_user</strong>
389
- <?php } ?>
390
-
391
- </td>
392
- </tr>
393
- <tr valign="top">
394
- <?php hyper_field_text('cron_key', $hyper_labels['cron_key'], $hyper_labels['cron_key_desc'], 'size="30"'); ?>
395
- </tr>
396
-
397
- </table>
398
-
399
-
400
- <p class="submit">
401
- <input class="button" type="submit" name="save" value="<?php echo $hyper_labels['save']; ?>">
402
- <input class="button" type="submit" name="clear" value="<?php echo $hyper_labels['clear']; ?>">
403
- </p>
404
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  </div>
2
 
3
  $options = get_option('hyper');
4
 
5
+ if (!$options['notranslation'])
 
 
 
6
  {
7
+ $plugin_dir = basename(dirname(__FILE__));
8
+ load_plugin_textdomain('hyper-cache', 'wp-content/plugins/' . $plugin_dir, $plugin_dir);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
  $installed = is_dir(ABSPATH . 'wp-content/hyper-cache') && is_file(ABSPATH . 'wp-content/advanced-cache.php') &&
12
  @filesize(ABSPATH . 'wp-content/advanced-cache.php') == @filesize(ABSPATH . 'wp-content/plugins/hyper-cache/advanced-cache.php');
13
 
14
+ if ($installed && isset($_POST['clean']))
 
15
  {
16
  hyper_cache_invalidate();
17
  }
19
 
20
  if ($installed && isset($_POST['save']))
21
  {
22
+ if (!check_admin_referer()) die('No hacking please');
23
+
24
+ $options = stripslashes_deep($_POST['options']);
25
 
26
+ if (!is_numeric($options['timeout'])) $options['timeout'] = 60;
27
+ $options['timeout'] = (int)$options['timeout'];
 
 
28
 
29
+ if (!is_numeric($options['clean_interval'])) $options['clean_interval'] = 60;
30
+ $options['clean_interval'] = (int)$options['clean_interval'];
 
 
31
 
32
  $buffer = "<?php\n";
33
  $buffer .= '$hyper_cache_charset = "' . get_option('blog_charset') . '"' . ";\n";
34
+ $buffer .= '$hyper_cache_enabled = true' . ";\n";
35
+ $buffer .= '$hyper_cache_stats = ' . ($options['stats']?'true':'false') . ";\n";
36
+ $buffer .= '$hyper_cache_comment = ' . ($options['comment']?'true':'false') . ";\n";
37
  $buffer .= '$hyper_cache_compress = ' . ($options['compress']?'true':'false') . ";\n";
38
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
39
  $buffer .= '$hyper_cache_cron_key = \'' . $options['cron_key'] . "';\n";
41
  $buffer .= '$hyper_cache_redirects = ' . ($options['redirects']?'true':'false') . ";\n";
42
  $buffer .= '$hyper_cache_mobile = ' . ($options['mobile']?'true':'false') . ";\n";
43
  $buffer .= '$hyper_cache_feed = ' . ($options['feed']?'true':'false') . ";\n";
44
+ $buffer .= '$hyper_cache_cache_qs = ' . ($options['cache_qs']?'true':'false') . ";\n";
45
+
46
  $buffer .= '$hyper_cache_home = ' . ($options['home']?'true':'false') . ";\n";
47
  //$buffer .= '$hyper_cache_folder = \'' . $options['folder'] . "';\n";
48
+
49
+ if ($options['gzip']) $options['store_compressed'] = 1;
50
+
51
+ $buffer .= '$hyper_cache_gzip = ' . ($options['gzip']?'true':'false') . ";\n";
52
+ $buffer .= '$hyper_cache_store_compressed = ' . ($options['store_compressed']?'true':'false') . ";\n";
53
+
54
  $buffer .= '$hyper_cache_urls = \'' . $options['urls'] . "';\n";
55
  $buffer .= '$hyper_cache_folder = \'' . ABSPATH . 'wp-content/hyper-cache' . "';\n";
56
  $buffer .= '$hyper_cache_clean_interval = ' . $options['clean_interval'] . ";\n";
135
  }
136
  else
137
  {
 
 
 
 
 
 
 
 
138
  if ($options['mobile_agents'] == '')
139
  {
140
  $options['mobile_agents'] = "elaine/3.0\niphone\nipod\npalm\neudoraweb\nblazer\navantgo\nwindows ce\ncellphone\nsmall\nmmef20\ndanger\nhiptop\nproxinet\nnewt\npalmos\nnetfront\nsharp-tq-gx10\nsonyericsson\nsymbianos\nup.browser\nup.link\nts21i-10\nmot-v\nportalmmm\ndocomo\nopera mini\npalm\nhandspring\nnokia\nkyocera\nsamsung\nmotorola\nmot\nsmartphone\nblackberry\nwap\nplaystation portable\nlg\nmmp\nopwv\nsymbian\nepoc";
143
 
144
  ?>
145
  <div class="wrap">
 
 
146
 
147
+ <h2>Hyper Cache</h2>
148
+
149
+ <?php if (!$installed) { ?>
150
+ <div class="alert error" style="margin-top:10px;">
151
+ <?php _e('Hyper Cache is NOT correctly installed: some files or directories have not been created. Check if the wp-content directory is writable and remove any advanced-cache.php file into it. Deactivate and reactivate the plugin.'); ?>
152
+ </div>
153
+ <?php } ?>
154
+
155
+ <?php if (!defined('WP_CACHE') || !WP_CACHE) { ?>
156
+ <div class="alert error" style="margin-top:10px;">
157
+ <?php _e('The WordPress cache system is not enabled! Please, activate it adding the line of code below in the file wp-config.php.'); ?>
158
+ <pre>define('WP_CACHE', true);</pre>
159
+ </div>
160
+ <?php } ?>
161
+
162
+ <div style="padding: 10px; background-color: #E0EFF6; border: 1px solid #006">
163
+ <?php printf(__('<strong>And if this plugin stops to work?</strong><br />Hyper Cache required a lot of effort to be developed and
164
+ I\'m pretty sure is giving you a good, even if invisible, service.
165
+ Probably Hyper Cache makes you save money with your hosting provider using a
166
+ basic and cheap hosting plan intead of a bigger and expensive one.
167
+ <br />So, why not consider a <a href="%s"><strong>donation</strong></a>?', 'hyper-cache'),
168
+ 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483'); ?>
169
+ </div>
170
+
171
+ <p>
172
+ <?php printf(__('You can find more details about configurations and working mode
173
+ on <a href="%s">Hyper Cache official page</a>.', 'hyper-cache'),
174
+ 'http://www.satollo.net/plugins/hyper-cache'); ?>
175
+ </p>
176
+
177
+ <p>
178
+ <?php _e('Other interesting plugins:'); ?>
179
+ <a href="http://www.satollo.net/plugins/post-layout">Post Layout</a>,
180
+ <a href="http://www.satollo.net/plugins/postacards">Postcards</a>,
181
+ <a href="http://www.satollo.net/plugins/comment-notifier">Comment Notifier</a>,
182
+ <a href="http://www.satollo.net/plugins/comment-image">Comment Image</a>.
183
+ </p>
184
+
185
+ <form method="post">
186
+ <?php wp_nonce_field(); ?>
187
+
188
+ <h3><?php _e('Cache status', 'hyper-cache'); ?></h3>
189
+ <table class="form-table">
190
+ <tr valign="top">
191
+ <th><?php _e('Cached page count', 'hyper-cache'); ?></th>
192
+ <td><?php echo hyper_count(); ?></td>
193
+ </tr>
194
+ </table>
195
+ <p class="submit">
196
+ <input class="button" type="submit" name="clean" value="<?php _e('Clean the cache', 'hyper-cache'); ?>">
197
+ </p>
198
+
199
+
200
+ <h3><?php _e('Statistics', 'hyper-cache'); ?></h3>
201
+
202
+ <table class="form-table">
203
+ <tr valign="top">
204
+ <th><?php _e('Enable statistics collection', 'hyper-cache'); ?></th>
205
+ <td>
206
+ <input type="checkbox" name="options[stats]" value="1" <?php echo $options['stats']?'checked':''; ?>/>
207
+ <br />
208
+ <?php _e('Very experimental and not really efficient,
209
+ but can be useful to check how the cache works.', 'hyper-cache'); ?>
210
+ <?php _e('Many .txt files willbe created inside the wp-content folder,
211
+ you can safely delete them if you need.', 'hyper-cache'); ?>
212
+ </td>
213
+ </tr>
214
+ </table>
215
+
216
+ <?php if ($options['stats']) { ?>
217
 
218
  <?php
219
+ $hit_304 = @filesize(ABSPATH . 'wp-content/hyper-cache-304.txt');
220
+ $hit_404 = @filesize(ABSPATH . 'wp-content/hyper-cache-404.txt');
221
+ $hit_gzip = @filesize(ABSPATH . 'wp-content/hyper-cache-gzip.txt');
222
+ $hit_plain = @filesize(ABSPATH . 'wp-content/hyper-cache-plain.txt');
223
+ $hit_wp = @filesize(ABSPATH . 'wp-content/hyper-cache-wp.txt');
224
+ $hit_commenter = @filesize(ABSPATH . 'wp-content/hyper-cache-commenter.txt');
225
+ $total = (float)($hit_304 + $hit_404 + $hit_gzip + $hit_plain + $hit_wp + 1);
226
  ?>
227
+
228
+ <p>
229
+ <?php _e('Below are statitics about requests Hyper Cache can handle and the ratio between the
230
+ requests served by Hyper Cache and the ones served by WordPress.', 'hyper-cache'); ?>
231
+
232
+ <?php _e('Requests that bypass the cache due to configurations are not counted because they are
233
+ explicitely not cacheable.', 'hyper-cache'); ?>
234
+ </p>
235
+ <table cellspacing="5">
236
+ <tr><td>Cache hits</td><td><div style="width:<?php echo (int)(($total-$hit_wp)/$total*300); ?>px; background-color: #0f0; float: left;">&nbsp;</div> <?php echo (int)(($total-$hit_wp)/$total*100); ?>%</td></tr>
237
+ <tr><td>Cache misses</td><td><div style="width:<?php echo (int)(($hit_wp)/$total*300); ?>px; background-color: #f00; float: left;">&nbsp;</div> <?php echo (int)(($hit_wp)/$total*100); ?>%</td></tr>
238
+ </table>
239
+
240
+ <p><?php _e('Detailed data broken up on different types of cache hits'); ?></p>
241
+
242
+ <table cellspacing="5">
243
+ <tr><td>Total requests handled</td><td><?php echo $total; ?></td></tr>
244
+ <tr><td>304 responses</td><td><div style="width:<?php echo (int)(($hit_304)/$total*300); ?>px; background-color: #339; float: left;">&nbsp;</div><?php echo (int)($hit_304/$total*100); ?>% (<?php echo $hit_304; ?>)</td></tr>
245
+ <tr><td>404 responses</td><td><div style="width:<?php echo (int)(($hit_404)/$total*300); ?>px; background-color: #33b; float: left;">&nbsp;</div><?php echo (int)($hit_404/$total*100); ?>% (<?php echo $hit_404; ?>)</td></tr>
246
+ <tr><td>Compressed pages served</td><td><div style="width:<?php echo (int)(($hit_gzip)/$total*300); ?>px; background-color: #33d; float: left;">&nbsp;</div><?php echo (int)($hit_gzip/$total*100); ?>% (<?php echo $hit_gzip; ?>)</td></tr>
247
+ <tr><td>Plain pages served</td><td><div style="width:<?php echo (int)(($hit_plain)/$total*300); ?>px; background-color: #33f; float: left;">&nbsp;</div><?php echo (int)($hit_plain/$total*100); ?>% (<?php echo $hit_plain; ?>)</td></tr>
248
+ <tr><td>Not in cache</td><td><div style="width:<?php echo (int)(($hit_wp)/$total*300); ?>px; background-color: #f00; float: left;">&nbsp;</div><?php echo (int)($hit_wp/$total*100); ?>% (<?php echo $hit_wp; ?>)</td></tr>
249
+ </table>
250
+
251
+ <?php } ?>
252
+ <p class="submit">
253
+ <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>">
254
+ </p>
255
+
256
+ <h3><?php _e('Configuration'); ?></h3>
257
+
258
+ <table class="form-table">
259
+
260
+ <tr valign="top">
261
+ <th><?php _e('Cached pages timeout', 'hyper-cache'); ?></th>
262
+ <td>
263
+ <input type="text" size="5" name="options[timeout]" value="<?php echo htmlspecialchars($options['timeout']); ?>"/>
264
+ (<?php _e('minutes', 'hyper-cache'); ?>)
265
+ <br />
266
+ <?php _e('Minutes a cached page is valid and served to users. A zero value means a cached page is
267
+ valid forever.', 'hyper-cache'); ?>
268
+ <?php _e('If a cached page is older than specified value (expired) it is no more used and
269
+ will be regenerated on next request of it.', 'hyper-cache'); ?>
270
+ <?php _e('720 minutes is half a day, 1440 is a full day and so on.', 'hyper-cache'); ?>
271
+ </td>
272
+ </tr>
273
+
274
+ <tr valign="top">
275
+ <th><?php _e('Cache autoclean', 'hyper-cache'); ?></th>
276
+ <td>
277
+ <input type="text" size="5" name="options[clean_interval]" value="<?php echo htmlspecialchars($options['clean_interval']); ?>"/>
278
+ (<?php _e('minutes', 'hyper-cache'); ?>)
279
+ <br />
280
+ <?php _e('Frequency of the autoclean process which removes to expired cached pages to free
281
+ disk space.', 'hyper-cache'); ?>
282
+ <?php _e('Set lower or equals of timeout above. If set to zero the autoclean process never
283
+ runs.', 'hyper-cache'); ?>
284
+ <?php _e('If timeout is set to zero, autoclean never runs, so this value has no meaning', 'hyper-cache'); ?>
285
+ </td>
286
+ </tr>
287
+
288
+ <tr valign="top">
289
+ <th><?php _e('Cache invalidation mode', 'hyper-cache'); ?></th>
290
+ <td>
291
+ <select name="options[expire_type]">
292
+ <option value="all" <?php echo ($options['expire_type'] == 'all')?'selected':''; ?>><?php _e('All cached pages', 'hyper-cache'); ?></option>
293
+ <option value="post" <?php echo ($options['expire_type'] == 'post')?'selected':''; ?>><?php _e('Modified pages and home page', 'hyper-cache'); ?></option>
294
+ <option value="post_strictly" <?php echo ($options['expire_type'] == 'post_strictly')?'selected':''; ?>><?php _e('Only modified pages', 'hyper-cache'); ?></option>
295
+ <option value="none" <?php echo ($options['expire_type'] == 'none')?'selected':''; ?>><?php _e('Nothing', 'hyper-cache'); ?></option>
296
+ </select>
297
+ <br />
298
+ <?php _e('"Invalidation" is the process of deleting cached pages when they are no more valid.', 'hyper-cache'); ?>
299
+ <?php _e('Invalidation process is started when blog contents are modified (new post, post update, new comment,...) so
300
+ one or more cached pages need to be refreshed to get that new content.', 'hyper-cache'); ?>
301
+ </td>
302
+ </tr>
303
+
304
  <tr valign="top">
305
+ <th><?php _e('Disable cache for commenters', 'hyper-cache'); ?></th>
306
+ <td>
307
+ <input type="checkbox" name="options[comment]" value="1" <?php echo $options['comment']?'checked':''; ?>/>
308
+ <br />
309
+ <?php _e('When users leave comments, WordPress show pages with their comments even if in moderation
310
+ (and not visible to others) and pre-fills the comment form.', 'hyper-cache'); ?>
311
+ <?php _e('If you want to keep those features, enable this option.', 'hyper-cache'); ?>
312
+ <?php _e('The caching system will be less efficient but the blog more usable.'); ?>
313
+
314
+ </td>
315
  </tr>
316
+
317
+ <tr valign="top">
318
+ <th><?php _e('Feeds caching', 'hyper-cache'); ?></th>
319
+ <td>
320
+ <input type="checkbox" name="options[feed]" value="1" <?php echo $options['feed']?'checked':''; ?>/>
321
+ <br />
322
+ <?php _e('When enabled the blog feeds will be cache as well.', 'hyper-cache'); ?>
323
+ <?php _e('Usually this options has to be left unchecked but if your blog is rather static,
324
+ you can enable it and have a bit more efficiency', 'hyper-cache'); ?>
325
+ </td>
326
+ </tr>
327
+ </table>
328
+ <p class="submit">
329
+ <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>">
330
+ </p>
331
+
332
+ <h3><?php _e('Configuration for mobile devices', 'hyper-cache'); ?></h3>
333
+ <table class="form-table">
334
+ <tr valign="top">
335
+ <th><?php _e('Detect mobile devices', 'hyper-cache'); ?></th>
336
+ <td>
337
+ <input type="checkbox" name="options[mobile]" value="1" <?php echo $options['mobile']?'checked':''; ?>/>
338
+ <br />
339
+ <?php _e('When enabled mobile devices will be detected and the cached page stored under different name.', 'hyper-cache'); ?>
340
+ <?php _e('This makes blogs with different themes for mobile devices to work correctly.', 'hyper-cache'); ?>
341
+ </td>
342
+ </tr>
343
+
344
+ <tr valign="top">
345
+ <th><?php _e('Mobile agent list', 'hyper-cache'); ?></th>
346
+ <td>
347
+ <textarea wrap="off" rows="4" cols="70" name="options[mobile_agents]"><?php echo htmlspecialchars($options['mobile_agents']); ?></textarea>
348
+ <br />
349
+ <?php _e('One per line mobile agents to check for when a page is requested.', 'hyper-cache'); ?>
350
+ <?php _e('The mobile agent string is matched against the agent a device is sending to the server.', 'hyper-cache'); ?>
351
+ </td>
352
+ </tr>
353
+ </table>
354
+ <p class="submit">
355
+ <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>">
356
+ </p>
357
+
358
+
359
+ <h3><?php _e('Compression', 'hyper-cache'); ?></h3>
360
+
361
+ <?php if (!function_exists('gzencode')) { ?>
362
+
363
+ <p><?php _e('Your hosting space has not the "gzencode" function, so no compression options are available.', 'hyper-cache'); ?></p>
364
+
365
+ <?php } else { ?>
366
+
367
+ <table class="form-table">
368
+ <tr valign="top">
369
+ <th><?php _e('Enable compression', 'hyper-cache'); ?></th>
370
+ <td>
371
+ <input type="checkbox" name="options[gzip]" value="1" <?php echo $options['gzip']?'checked':''; ?> />
372
+ <br />
373
+ <?php _e('When possible the page will be sent compressed to save bandwidth.', 'hyper-cache'); ?>
374
+ <?php _e('Only the textual part of a page can be compressed, not images, so a photo
375
+ blog will consume a lot of bandwidth even with compression enabled.', 'hyper-cache'); ?>
376
+ <?php _e('Leave the options disabled if you note malfunctions, like blank pages.', 'hyper-cache'); ?>
377
+ <br />
378
+ <?php _e('If you enable this option, the option below will be enabled as well.', 'hyper-cache'); ?>
379
+ </td>
380
+ </tr>
381
+
382
+ <tr valign="top">
383
+ <th><?php _e('Disk space usage', 'hyper-cache'); ?></th>
384
+ <td>
385
+ <input type="checkbox" name="options[store_compressed]" value="1" <?php echo $options['store_compressed']?'checked':''; ?> />
386
+ <br />
387
+ <?php _e('Enable this option to minimize disk space usage.', 'hyper-cache'); ?>
388
+ <?php _e('The cache will be a little less performant.', 'hyper-cache'); ?>
389
+ <?php _e('Leave the options disabled if you note malfunctions, like blank pages.', 'hyper-cache'); ?>
390
+ </td>
391
+ </tr>
392
+ </table>
393
+ <p class="submit">
394
+ <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>">
395
+ </p>
396
+ <?php } ?>
397
+
398
+
399
+ <h3><?php _e('Advanced options', 'hyper-cache'); ?></h3>
400
+
401
+ <table class="form-table">
402
+ <tr valign="top">
403
+ <th><?php _e('Translation', 'hyper-cache'); ?></th>
404
+ <td>
405
+ <input type="checkbox" name="options[notranslation]" value="1" <?php echo $options['notranslation']?'checked':''; ?>/>
406
+ <br />
407
+ <?php _e('DO NOT show this panel translated.', 'hyper-cache'); ?>
408
+ </td>
409
+ </tr>
410
+ <tr valign="top">
411
+ <th><?php _e('HTML optimization', 'hyper-cache'); ?></th>
412
+ <td>
413
+ <input type="checkbox" name="options[compress]" value="1" <?php echo $options['compress']?'checked':''; ?>/>
414
+ <br />
415
+ <?php _e('Try to optimize the generated HTML.','hyper-cache'); ?>
416
+ <?php _e('Be sure to extensively verify it it works with your theme on different browsers!', 'hyper-cache'); ?>
417
+ <?php _e('NO MORE EFFECTIVE DUE TO COMPATIBILITY PROBLEMS', 'hyper-cache'); ?>
418
+ </td>
419
+ </tr>
420
+
421
+ <tr valign="top">
422
+ <th><?php _e('Home caching', 'hyper-cache'); ?></th>
423
+ <td>
424
+ <input type="checkbox" name="options[home]" value="1" <?php echo $options['home']?'checked':''; ?>/>
425
+ <br />
426
+ <?php _e('DO NOT cache the home page so it is always fresh.','hyper-cache'); ?>
427
+ </td>
428
+ </tr>
429
+
430
+ <tr valign="top">
431
+ <th><?php _e('Redirect caching', 'hyper-cache'); ?></th>
432
+ <td>
433
+ <input type="checkbox" name="options[redirects]" value="1" <?php echo $options['redirects']?'checked':''; ?>/>
434
+ <br />
435
+ <?php _e('Cache WordPress redirects.', 'hyper-cache'); ?>
436
+ <?php _e('WordPress sometime sends back redirects that can be cached to avoid further processing time.', 'hyper-cache'); ?>
437
+ </td>
438
+ </tr>
439
+
440
+ <tr valign="top">
441
+ <th><?php _e('URL with parameters', 'hyper-cache'); ?></th>
442
+ <td>
443
+ <input type="checkbox" name="options[cache_qs]" value="1" <?php echo $options['cache_qs']?'checked':''; ?>/>
444
+ <br />
445
+ <?php _e('Cache requests with query string (parameters).', 'hyper-cache'); ?>
446
+ <?php _e('This option has to be enabled for blogs which have post URLs with a question mark on them.', 'hyper-cache'); ?>
447
+ <?php _e('This option is disabled by default because there is plugins which use
448
+ URL parameter to perform specific action that cannot be cached', 'hyper-cache'); ?>
449
+ <?php _e('For who is using search engines friendly permalink format is safe to
450
+ leave this option disabled, no performances will be lost.', 'hyper-cache'); ?>
451
+ </td>
452
+ </tr>
453
+
454
+ <tr valign="top">
455
+ <th><?php _e('URI to reject', 'hyper-cache'); ?></th>
456
+ <td>
457
+ <textarea wrap="off" rows="5" cols="70" name="options[reject]"><?php echo htmlspecialchars($options['reject']); ?></textarea>
458
+ <br />
459
+ <?php _e('Write one URI per line, each URI has to start with a slash.', 'hyper-cache'); ?>
460
+ <?php _e('A specified URI will match the requested URI if the latter starts with the former.', 'hyper-cache'); ?>
461
+ <?php _e('If you want to specify a stric matching, surround the URI with double quotes.', 'hyper-cache'); ?>
462
+
463
+ <?php
464
+ $languages = get_option('gltr_preferred_languages');
465
+ if (is_array($languages))
466
+ {
467
+ echo '<br />';
468
+ $home = get_option('home');
469
+ $x = strpos($home, '/', 8); // skips http://
470
+ $base = '';
471
+ if ($x !== false) $base = substr($home, $x);
472
+ echo 'It seems you have Global Translator installed. The URI prefixes below can be added to avoid double caching of translated pages:<br />';
473
+ foreach($languages as $l) echo $base . '/' . $l . '/ ';
474
+ }
475
+ ?>
476
+ </td>
477
+ </tr>
478
+
479
+ <tr valign="top">
480
+ <th><?php _e('Agents to reject', 'hyper-cache'); ?></th>
481
+ <td>
482
+ <textarea wrap="off" rows="5" cols="70" name="options[reject_agents]"><?php echo htmlspecialchars($options['reject_agents']); ?></textarea>
483
+ <br />
484
+ <?php _e('Write one agent per line.', 'hyper-cache'); ?>
485
+ <?php _e('A specified agent will match the client agent if the latter contains the former. The matching is case insensitive.', 'hyper-cache'); ?>
486
+ </td>
487
+ </tr>
488
+
489
+ <tr valign="top">
490
+ <th><?php _e('Cookies matching', 'hyper-cache'); ?></th>
491
+ <td>
492
+ <textarea wrap="off" rows="5" cols="70" name="options[reject_cookies]"><?php echo htmlspecialchars($options['reject_cookies']); ?></textarea>
493
+ <br />
494
+ <?php _e('Write one cookie name per line.', 'hyper-cache'); ?>
495
+ <?php _e('When a specified cookie will match one of the cookie names sent bby the client the cache stops.', 'hyper-cache'); ?>
496
+ <?php if (defined('FBC_APP_KEY_OPTION')) { ?>
497
+ <br />
498
+ <?php _e('It seems you have Facebook Connect plugin installed. Add this cookie name to make it works
499
+ with Hyper Cache:', 'hyper-cache'); ?>
500
+ <br />
501
+ <strong><?php echo get_option(FBC_APP_KEY_OPTION); ?>_user</strong>
502
+ <?php } ?>
503
+
504
+ </td>
505
+ </tr>
506
+
507
+ </table>
508
+
509
+ <p class="submit">
510
+ <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>">
511
+ </p>
512
+ </form>
513
  </div>
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Hyper Cache
4
  Plugin URI: http://www.satollo.net/plugins/hyper-cache
5
  Description: Hyper Cache is a features rich cache system WordPress. After an upgrade, DEACTIVATE, REACTIVATE and RECONFIGURE. ALWAYS!
6
- Version: 2.3.2
7
  Author: Satollo
8
  Author URI: http://www.satollo.net
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -237,7 +237,7 @@ function hyper_count()
237
 
238
  // Intercepts the action that can trigger a cache invalidation if the cache system is enabled
239
  // and invalidation is asked for actions (if is not only based on cache timeout)
240
- if ($hyper_options['enabled'] && $hyper_options['expire_type'] != 'none')
241
  {
242
 
243
  // We need to invalidate everything for those actions because home page, categories pages,
3
  Plugin Name: Hyper Cache
4
  Plugin URI: http://www.satollo.net/plugins/hyper-cache
5
  Description: Hyper Cache is a features rich cache system WordPress. After an upgrade, DEACTIVATE, REACTIVATE and RECONFIGURE. ALWAYS!
6
+ Version: 2.4.3
7
  Author: Satollo
8
  Author URI: http://www.satollo.net
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
237
 
238
  // Intercepts the action that can trigger a cache invalidation if the cache system is enabled
239
  // and invalidation is asked for actions (if is not only based on cache timeout)
240
+ if ($hyper_options['expire_type'] != 'none')
241
  {
242
 
243
  // We need to invalidate everything for those actions because home page, categories pages,
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Hyper Cache ===
2
  Tags: cache,chaching,speed,performance,super cache,wp cache
3
  Requires at least: 2.1
4
- Tested up to: 2.8.1
5
  Stable tag: trunk
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
7
  Contributors: satollo,momo360modena
1
  === Hyper Cache ===
2
  Tags: cache,chaching,speed,performance,super cache,wp cache
3
  Requires at least: 2.1
4
+ Tested up to: 2.8.4
5
  Stable tag: trunk
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2545483
7
  Contributors: satollo,momo360modena