Hyper Cache - Version 1.2

Version Description

Download this release

Release Info

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

Code changes from version 1.1.1 to 1.2

advanced-cache.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- @include( dirname(__FILE__) . '/hyper-cache-config.php' );
3
 
4
  // From the config file
5
  if (!$hyper_cache_enabled) return false;
@@ -8,114 +8,132 @@ if (!$hyper_cache_enabled) return false;
8
  if ($_SERVER["REQUEST_METHOD"] == 'POST') return false;
9
 
10
  // Do not use or cache pages when a wordpress user is logged on
11
- foreach ( (array) $_COOKIE as $n => $v ) {
12
- // wp 2.5 and wp 2.3 have different cookie prefix
13
- if (substr($n, 0, 14) == 'wordpressuser_' || substr($n, 0, 10) == 'wordpress_' || substr($n, 0, 12) == 'wp-postpass_') {
 
 
14
  return false;
15
  }
16
  }
17
 
18
  $hyper_uri = stripslashes($_SERVER['REQUEST_URI']);
19
 
20
- //if (!$hyper_cache_get && strpos($hyper_uri, '?') !== false) return false;
21
-
22
  // Do not cache WP pages, even if those calls typically don't go throught this script
23
- if (strpos($hyper_uri, '/wp-admin/') !== false ||
24
- strpos($hyper_uri, '/wp-includes/') !== false ||
25
- strpos($hyper_uri, '/wp-content/') !== false ) {
26
  return false;
27
  }
28
 
29
-
30
- // Special blocks: the download manager plugin
31
- /*
32
- if (strpos($hyper_uri, '/download/') !== false) {
33
- return false;
34
- }
35
- */
36
-
37
- // Remove the anchor
38
- /*
39
- $x = strpos($hyper_uri, '#');
40
- if ($x !== false) {
41
- $hyper_uri = substr($hyper_uri, 0, $x);
42
- }
43
- */
44
-
45
  $hyper_cache_name = md5($hyper_uri);
46
  $hyper_file = ABSPATH . 'wp-content/hyper-cache/' . $hyper_cache_name . '.dat';
47
 
48
- if ( is_file($hyper_file) ) {
49
- $hyper_data = unserialize( file_get_contents($hyper_file) );
 
 
 
50
 
51
  // Default timeout
52
- if ($hyper_cache_timeout == null) {
 
53
  $hyper_cache_timeout = 60;
54
  }
55
 
56
- if ($hyper_data != null && ($hyper_data['time'] > time()-($hyper_cache_timeout*60)) && $hyper_data['html'] != '') {
57
- if ($hyper_data['mime'] == '')
 
58
  {
59
- header('Content-Type: text/html;charset=UTF-8');
 
 
60
  }
61
- else {
62
- header('Content-Type: ' . $hyper_data['mime']);
 
 
 
 
 
 
 
 
 
 
63
  }
64
- echo $hyper_data['html'];
65
- echo '<!-- hyper cache: ' . $hyper_cache_name . ' -->';
66
  flush();
67
  die();
68
  }
69
  }
70
 
71
- // Now we start the caching, but we remove the cookie which stores the comment for data
72
- foreach ( (array) $_COOKIE as $n => $v ) {
73
- if (substr($n, 0, 14) == 'comment_author') {
 
 
 
74
  unset($_COOKIE[$n]);
75
  }
76
  }
77
 
78
  ob_start('hyper_cache_callback');
79
- function hyper_cache_callback($buffer) {
80
- global $hyper_file, $hyper_compress, $post;
81
 
82
- if (strlen($buffer) == 0) return '';
 
 
 
 
 
 
 
 
 
83
 
84
- // Check for password posts -- do not cache
85
- /*
86
- rewind_posts();
87
- while (have_posts())
88
- {
89
- the_post();
90
- if (!empty($post->post_password)) return $buffer;
91
- }
92
- */
93
  $data['uri'] = $_SERVER['REQUEST_URI'];
94
  $data['referer'] = $_SERVER['HTTP_REFERER'];
95
  $data['time'] = time();
96
- if (is_feed()) {
97
- $data['mime'] = 'text/xml;charset=UTF-8';
98
- } else {
99
- $data['mime'] = 'text/html;charset=UTF-8';
100
  }
101
- if ($hyper_compress)
102
  {
103
- $buffer = ereg_replace("[ \t]+", ' ', $buffer);
104
- $buffer = ereg_replace("[\r\n]", "\n", $buffer);
105
- $buffer = ereg_replace(" *\n *", "\n", $buffer);
106
- $buffer = ereg_replace("\n+", "\n", $buffer);
107
- $buffer = ereg_replace("\" />", "\"/>", $buffer);
108
- $buffer = ereg_replace("<tr>\n", "<tr>", $buffer);
109
- $buffer = ereg_replace("<td>\n", "<td>", $buffer);
110
- $buffer = ereg_replace("<ul>\n", "<ul>", $buffer);
111
- $buffer = ereg_replace("</ul>\n", "</ul>", $buffer);
112
- $buffer = ereg_replace("<p>\n", "<p>", $buffer);
113
- $buffer = ereg_replace("</p>\n", "</p>", $buffer);
114
- $buffer = ereg_replace("</li>\n", "</li>", $buffer);
115
- $buffer = ereg_replace("</td>\n", "</td>", $buffer);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
- $data['html'] = $buffer;
118
-
119
  $file = fopen($hyper_file, 'w');
120
  fwrite($file, serialize($data));
121
  fclose($file);
1
  <?php
2
+ @include(dirname(__FILE__) . '/hyper-cache-config.php');
3
 
4
  // From the config file
5
  if (!$hyper_cache_enabled) return false;
8
  if ($_SERVER["REQUEST_METHOD"] == 'POST') return false;
9
 
10
  // Do not use or cache pages when a wordpress user is logged on
11
+ foreach ($_COOKIE as $n=>$v)
12
+ {
13
+ // wp 2.5 and wp 2.3 have different cookie prefix, skip cache if a post password cookie is present, also
14
+ if (substr($n, 0, 14) == 'wordpressuser_' || substr($n, 0, 10) == 'wordpress_' || substr($n, 0, 12) == 'wp-postpass_')
15
+ {
16
  return false;
17
  }
18
  }
19
 
20
  $hyper_uri = stripslashes($_SERVER['REQUEST_URI']);
21
 
 
 
22
  // Do not cache WP pages, even if those calls typically don't go throught this script
23
+ if (strpos($hyper_uri, '/wp-admin/') !== false || strpos($hyper_uri, '/wp-includes/') !== false || strpos($hyper_uri, '/wp-content/') !== false )
24
+ {
 
25
  return false;
26
  }
27
 
28
+ // The name of the file with html and other data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  $hyper_cache_name = md5($hyper_uri);
30
  $hyper_file = ABSPATH . 'wp-content/hyper-cache/' . $hyper_cache_name . '.dat';
31
 
32
+ // The file is present?
33
+ if (is_file($hyper_file))
34
+ {
35
+ // Load it and check is it's still valid
36
+ $hyper_data = unserialize(file_get_contents($hyper_file));
37
 
38
  // Default timeout
39
+ if ($hyper_cache_timeout == null)
40
+ {
41
  $hyper_cache_timeout = 60;
42
  }
43
 
44
+ if ($hyper_data != null && ($hyper_data['time'] > time()-($hyper_cache_timeout*60)))
45
+ {
46
+ if ($hyper_data['location'])
47
  {
48
+ header('Location: ' . $hyper_data['location']);
49
+ flush;
50
+ die();
51
  }
52
+
53
+ header('Content-Type: ' . $hyper_data['mime']);
54
+
55
+ // Send the cached html
56
+ if ($hyper_cache_gzip && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && $hyper_data['gz'])
57
+ {
58
+ header('Content-Encoding: gzip');
59
+ echo $hyper_data['gz'];
60
+ }
61
+ else
62
+ {
63
+ echo $hyper_data['html'];
64
  }
65
+
 
66
  flush();
67
  die();
68
  }
69
  }
70
 
71
+ // Now we start the caching, but we remove the cookie which stores the commenter data otherwise the page will be generated
72
+ // with a pre compiled comment form...
73
+ foreach ($_COOKIE as $n=>$v )
74
+ {
75
+ if (substr($n, 0, 14) == 'comment_author')
76
+ {
77
  unset($_COOKIE[$n]);
78
  }
79
  }
80
 
81
  ob_start('hyper_cache_callback');
 
 
82
 
83
+ // From here Wordpress starts to process the request
84
+
85
+ // Called whenever the page generation is ended
86
+ function hyper_cache_callback($buffer)
87
+ {
88
+ global $hyper_redirect, $hyper_file, $hyper_compress, $post, $hyper_cache_name, $hyper_cache_gzip;
89
+
90
+ // Sometine the buffer is empty, eg when wordpress sends back a redirect - no cache is needed (it would e nice to cache
91
+ // the redirects and stop wordpress to works computing it every time, but there is no way to read the sent header...)
92
+ if (!$hyper_redirect && strlen($buffer) == 0) return '';
93
 
 
 
 
 
 
 
 
 
 
94
  $data['uri'] = $_SERVER['REQUEST_URI'];
95
  $data['referer'] = $_SERVER['HTTP_REFERER'];
96
  $data['time'] = time();
97
+ if ($hyper_redirect)
98
+ {
99
+ $data['location'] = $hyper_redirect;
 
100
  }
101
+ else
102
  {
103
+ if (is_feed())
104
+ {
105
+ $data['mime'] = 'text/xml;charset=UTF-8';
106
+ }
107
+ else
108
+ {
109
+ $data['mime'] = 'text/html;charset=UTF-8';
110
+ }
111
+
112
+ // Clean up a it the html, this is a energy saver plugin!
113
+ if ($hyper_compress)
114
+ {
115
+ $buffer = ereg_replace("[ \t]+", ' ', $buffer);
116
+ $buffer = ereg_replace("[\r\n]", "\n", $buffer);
117
+ $buffer = ereg_replace(" *\n *", "\n", $buffer);
118
+ $buffer = ereg_replace("\n+", "\n", $buffer);
119
+ $buffer = ereg_replace("\" />", "\"/>", $buffer);
120
+ $buffer = ereg_replace("<tr>\n", "<tr>", $buffer);
121
+ $buffer = ereg_replace("<td>\n", "<td>", $buffer);
122
+ $buffer = ereg_replace("<ul>\n", "<ul>", $buffer);
123
+ $buffer = ereg_replace("</ul>\n", "</ul>", $buffer);
124
+ $buffer = ereg_replace("<p>\n", "<p>", $buffer);
125
+ $buffer = ereg_replace("</p>\n", "</p>", $buffer);
126
+ $buffer = ereg_replace("</li>\n", "</li>", $buffer);
127
+ $buffer = ereg_replace("</td>\n", "</td>", $buffer);
128
+ }
129
+ $buffer .= '<!-- hyper cache: ' . $hyper_cache_name . ' -->';
130
+ $data['html'] = $buffer;
131
+ if ($hyper_cache_gzip && function_exists('gzencode'))
132
+ {
133
+ $data['gz'] = gzencode($buffer);
134
+ }
135
  }
136
+
 
137
  $file = fopen($hyper_file, 'w');
138
  fwrite($file, serialize($data));
139
  fclose($file);
de_DE.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+
3
+ $hyper_labels['wp_cache_not_enabled'] = "Das WordPress Cachesystem ist nicht aktiv. Um es zu aktivieren bitte die folgende Zeile Code der Datei wp-config.php hinzuf&uuml;gen. Danke!";
4
+ $hyper_labels['configuration'] = "Konfiguration";
5
+ $hyper_labels['activate'] = "Cache aktiv?";
6
+ $hyper_labels['expire'] = "Ablauf des Cache nach";
7
+ $hyper_labels['minutes'] = "Minuten";
8
+ $hyper_labels['invalidate_single_posts'] = "Invalidate single posts";
9
+ $hyper_labels['invalidate_single_posts_desc'] = "Invalidate only the single cached post when modified (new comment, edited, ...)";
10
+ $hyper_labels['count'] = "Gecachte Seiten";
11
+ $hyper_labels['save'] = "Speichern";
12
+ $hyper_labels['gzip_compression'] = "Gzip compression";
13
+ $hyper_labels['gzip_compression_desc'] = "Enable gzip compression to serve copressed pages for gzip enabled browsers";
14
+ $hyper_labels['clear'] = "Cache l&ouml;schen";
15
+ $hyper_labels['compress_html'] = "Optimize HTML";
16
+
17
+ ?>
en_US.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
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['expire'] = "Expire a cached page after";
7
+ $hyper_labels['minutes'] = "minutes";
8
+ $hyper_labels['invalidate_single_posts'] = "Invalidate single posts";
9
+ $hyper_labels['invalidate_single_posts_desc'] = "Invalidate only the single cached post when modified (new comment, edited, ...)";
10
+ $hyper_labels['count'] = "Total cached pages (cached redirect is counted too)";
11
+ $hyper_labels['save'] = "Save";
12
+ $hyper_labels['gzip_compression'] = "Gzip compression";
13
+ $hyper_labels['gzip_compression_desc'] = "Enable gzip compression to serve copressed pages for gzip enabled browsers";
14
+ $hyper_labels['clear'] = "Clear the cache";
15
+ $hyper_labels['compress_html'] = "Optimize HTML";
16
+ $hyper_labels['compress_html_desc'] = "Try to optimize the HTML removing unuseful spaces. Do not use if you are usgin &lt;pre&gt; tags in the posts";
17
+ $hyper_labels['never_expire'] = "Never expire";
18
+ $hyper_labels['never_expire_desc'] = "Do not expire the cache on actions, check only the cache timeout";
19
+
20
+ ?>
fr_FR.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+
3
+ $hyper_labels['wp_cache_not_enabled'] = "Le cache de WordPress n'est pas activ&eacute;. Merci d'ajouter la ligne suivante dans votre fichier wp-config.php. Merci !";
4
+ $hyper_labels['configuration'] = "Configuration";
5
+ $hyper_labels['activate'] = "Activer le cache?";
6
+ $hyper_labels['expire'] = "Les pages contenues dans le cache expirent apr&egrave;s";
7
+ $hyper_labels['minutes'] = "minutes";
8
+ $hyper_labels['invalidate_single_posts'] = "Invalidate single posts";
9
+ $hyper_labels['invalidate_single_posts_desc'] = "Invalidate only the single cached post when modified (new comment, edited, ...)";
10
+ $hyper_labels['count'] = "Total cached pages (cached redirect is counted too)";
11
+ $hyper_labels['save'] = "Enregistrer";
12
+ $hyper_labels['gzip_compression'] = "Gzip compression";
13
+ $hyper_labels['gzip_compression_desc'] = "Enable gzip compression to serve copressed pages for gzip enabled browsers";
14
+ $hyper_labels['clear'] = "Effacer le cache";
15
+
16
+ ?>
hyper-cache-de_DE.mo DELETED
Binary file
hyper-cache-de_DE.po DELETED
@@ -1,66 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Hyper Cache\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-04-13 11:16+0100\n"
6
- "PO-Revision-Date: 2008-10-13 22:50+0100\n"
7
- "Last-Translator: Satollo <satollo@gmail.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
- "X-Poedit-Basepath: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
14
- "X-Poedit-SearchPath-0: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
15
-
16
- #: D:\SVN\Plugins\Hyper
17
- #: Cache\trunk/options.php:99
18
- msgid "not_enabled"
19
- msgstr "Das WordPress Cachesystem ist nicht aktiv. Um es zu aktivieren bitte die folgende Zeile Code der Datei wp-config.php hinzuf&uuml;gen. Danke!"
20
-
21
- #: D:\SVN\Plugins\Hyper
22
- #: Cache\trunk/options.php:105
23
- msgid "configuration"
24
- msgstr "Konfiguration"
25
-
26
- #: D:\SVN\Plugins\Hyper
27
- #: Cache\trunk/options.php:108
28
- msgid "active"
29
- msgstr "Cache aktiv?"
30
-
31
- #: D:\SVN\Plugins\Hyper
32
- #: Cache\trunk/options.php:111
33
- msgid "expire"
34
- msgstr "Ablauf des Cache nach"
35
-
36
- #: D:\SVN\Plugins\Hyper
37
- #: Cache\trunk/options.php:111
38
- msgid "minutes"
39
- msgstr "Minuten"
40
-
41
- #: D:\SVN\Plugins\Hyper
42
- #: Cache\trunk/options.php:116
43
- msgid "save"
44
- msgstr "Speichern"
45
-
46
- msgid "clear"
47
- msgstr "Cache l&ouml;schen"
48
-
49
- msgid "count"
50
- msgstr "Gecachte Seiten"
51
-
52
- msgid "not_expire_on_actions"
53
- msgstr "Do not expire on actions"
54
-
55
- msgid "not_expire_on_actions_desc"
56
- msgstr "New comments, new posts, ..., rely only on cache timeout"
57
-
58
- msgid "invalidate_single_posts"
59
- msgstr "Try to invalidate the single posts"
60
-
61
- msgid "invalidate_single_posts_desc"
62
- msgstr "Ivalidate only the web page of the modified posts, not all the blog web pages (only for actions on comments and post edit - posts publish and delete invalidate all the cache)"
63
-
64
- msgid "compress_html"
65
- msgstr "Compress the html cached"
66
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
hyper-cache-en_US.mo DELETED
Binary file
hyper-cache-en_US.po DELETED
@@ -1,66 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Hyper Cache\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-04-13 11:16+0100\n"
6
- "PO-Revision-Date: 2008-10-13 22:50+0100\n"
7
- "Last-Translator: Satollo <satollo@gmail.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
- "X-Poedit-Basepath: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
14
- "X-Poedit-SearchPath-0: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
15
-
16
- #: D:\SVN\Plugins\Hyper
17
- #: Cache\trunk/options.php:99
18
- msgid "not_enabled"
19
- msgstr "The wordPress cache system is not enabled. Please, activate it adding the line of code below in the file wp-config.php. Thank you!"
20
-
21
- #: D:\SVN\Plugins\Hyper
22
- #: Cache\trunk/options.php:105
23
- msgid "configuration"
24
- msgstr "Configuration"
25
-
26
- #: D:\SVN\Plugins\Hyper
27
- #: Cache\trunk/options.php:108
28
- msgid "active"
29
- msgstr "Cache active?"
30
-
31
- #: D:\SVN\Plugins\Hyper
32
- #: Cache\trunk/options.php:111
33
- msgid "expire"
34
- msgstr "Expire a cached page after"
35
-
36
- #: D:\SVN\Plugins\Hyper
37
- #: Cache\trunk/options.php:111
38
- msgid "minutes"
39
- msgstr "minutes"
40
-
41
- #: D:\SVN\Plugins\Hyper
42
- #: Cache\trunk/options.php:116
43
- msgid "save"
44
- msgstr "Save"
45
-
46
- msgid "clear"
47
- msgstr "Clear the cache"
48
-
49
- msgid "count"
50
- msgstr "Cached pages"
51
-
52
- msgid "not_expire_on_actions"
53
- msgstr "Do not expire on actions"
54
-
55
- msgid "not_expire_on_actions_desc"
56
- msgstr "New comments, new posts, ..., rely only on cache timeout"
57
-
58
- msgid "invalidate_single_posts"
59
- msgstr "Try to invalidate the single posts"
60
-
61
- msgid "invalidate_single_posts_desc"
62
- msgstr "Ivalidate only the web page of the modified posts, not all the blog web pages (only for actions on comments and post edit - posts publish and delete invalidate all the cache)"
63
-
64
- msgid "compress_html"
65
- msgstr "Compress the html cached"
66
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
hyper-cache-fr_FR.mo DELETED
Binary file
hyper-cache-fr_FR.po DELETED
@@ -1,66 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Hyper Cache\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-04-13 11:16+0100\n"
6
- "PO-Revision-Date: 2008-10-13 22:50+0100\n"
7
- "Last-Translator: Satollo <satollo@gmail.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
- "X-Poedit-Basepath: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
14
- "X-Poedit-SearchPath-0: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
15
-
16
- #: D:\SVN\Plugins\Hyper
17
- #: Cache\trunk/options.php:99
18
- msgid "not_enabled"
19
- msgstr "Le cache de WordPress n'est pas activ&eacute;. Merci d'ajouter la ligne suivante dans votre fichier wp-config.php. Merci !"
20
-
21
- #: D:\SVN\Plugins\Hyper
22
- #: Cache\trunk/options.php:105
23
- msgid "configuration"
24
- msgstr "Configuration"
25
-
26
- #: D:\SVN\Plugins\Hyper
27
- #: Cache\trunk/options.php:108
28
- msgid "active"
29
- msgstr "Activer le cache ?"
30
-
31
- #: D:\SVN\Plugins\Hyper
32
- #: Cache\trunk/options.php:111
33
- msgid "expire"
34
- msgstr "Les pages contenues dans le cache expirent apr&egrave;s"
35
-
36
- #: D:\SVN\Plugins\Hyper
37
- #: Cache\trunk/options.php:111
38
- msgid "minutes"
39
- msgstr "(minutes!)"
40
-
41
- #: D:\SVN\Plugins\Hyper
42
- #: Cache\trunk/options.php:116
43
- msgid "save"
44
- msgstr "Enregistrer"
45
-
46
- msgid "clear"
47
- msgstr "Effacer le cache"
48
-
49
- msgid "count"
50
- msgstr "Nombre de pages en cache"
51
-
52
- msgid "not_expire_on_actions"
53
- msgstr "Do not expire on actions"
54
-
55
- msgid "not_expire_on_actions_desc"
56
- msgstr "New comments, new posts, ..., rely only on cache timeout"
57
-
58
- msgid "invalidate_single_posts"
59
- msgstr "Try to invalidate the single posts"
60
-
61
- msgid "invalidate_single_posts_desc"
62
- msgstr "Ivalidate only the web page of the modified posts, not all the blog web pages (only for actions on comments and post edit - posts publish and delete invalidate all the cache)"
63
-
64
- msgid "compress_html"
65
- msgstr "Compress the html cached"
66
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
hyper-cache-it_IT.mo DELETED
Binary file
hyper-cache-it_IT.po DELETED
@@ -1,64 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Hyper Cache\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-04-13 11:16+0100\n"
6
- "PO-Revision-Date: 2008-10-13 22:50+0100\n"
7
- "Last-Translator: Satollo <satollo@gmail.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-KeywordsList: __;_e\n"
13
- "X-Poedit-Basepath: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
14
- "X-Poedit-SearchPath-0: D:\\SVN\\Plugins\\Hyper Cache\\trunk\n"
15
-
16
- #: D:\SVN\Plugins\Hyper
17
- #: Cache\trunk/options.php:99
18
- msgid "not_enabled"
19
- msgstr "Il sistema di caching di WordPress non &egrave; attivo. Attivarlo inserendo la riga sotto nel file wp-config.php. Grazie!"
20
-
21
- #: D:\SVN\Plugins\Hyper
22
- #: Cache\trunk/options.php:105
23
- msgid "configuration"
24
- msgstr "Configurazione"
25
-
26
- #: D:\SVN\Plugins\Hyper
27
- #: Cache\trunk/options.php:108
28
- msgid "active"
29
- msgstr "Attivare la cache?"
30
-
31
- msgid "expire"
32
- msgstr "La pagine scadono dopo:"
33
-
34
- #: D:\SVN\Plugins\Hyper
35
- #: Cache\trunk/options.php:111
36
- msgid "minutes"
37
- msgstr "in minuti!"
38
-
39
- #: D:\SVN\Plugins\Hyper
40
- #: Cache\trunk/options.php:116
41
- msgid "save"
42
- msgstr "Salva"
43
-
44
- msgid "clear"
45
- msgstr "Azzera la cache"
46
-
47
- msgid "count"
48
- msgstr "Pagine in cache"
49
-
50
- msgid "not_expire_on_actions"
51
- msgstr "Non invalidare sulle azioni"
52
-
53
- msgid "not_expire_on_actions_desc"
54
- msgstr "Nuovi commenti, nuovi articoli, ..., basati solo sul tempo di scadenza pagine"
55
-
56
- msgid "invalidate_single_posts"
57
- msgstr "Try to invalidate the single posts"
58
-
59
- msgid "invalidate_single_posts_desc"
60
- msgstr "Ivalidate only the web page of the modified posts, not all the blog web pages (only for actions on comments and post edit - posts publish and delete invalidate all the cache)"
61
-
62
- msgid "compress_html"
63
- msgstr "Compress the html cached"
64
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
it_IT.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?
2
+
3
+ $hyper_labels['wp_cache_not_enabled'] = "Il sistema di caching di WordPress non &egrave; attivo. Attivarlo inserendo la riga sotto nel file wp-config.php. Grazie!";
4
+ $hyper_labels['configuration'] = "Configurazione";
5
+ $hyper_labels['activate'] = "Attivare la cache?";
6
+ $hyper_labels['expire'] = "Tempo di scadenza";
7
+ $hyper_labels['minutes'] = "minuti";
8
+ $hyper_labels['invalidate_single_posts'] = "Invalida i singoli articoli";
9
+ $hyper_labels['invalidate_single_posts_desc'] = "Invalida solamente gli articoli e le pagine modificate (nuovi commenti, modifica, ...)";
10
+ $hyper_labels['count'] = "Total cached pages (cached redirect is counted too)";
11
+ $hyper_labels['save'] = "Salva";
12
+ $hyper_labels['gzip_compression'] = "Compressione gzip";
13
+ $hyper_labels['gzip_compression_desc'] = "Abilita la compressione per i browser che la supportano";
14
+ $hyper_labels['clear'] = "Pulisci la cache";
15
+ $hyper_labels['compress_html'] = "Ottimizza l'HTML";
16
+ $hyper_labels['compress_html_desc'] = "Cerca di ottimizzare l'HTML (non usare se utilizzate il tag &lt;pre&gt;)";
17
+ $hyper_labels['never_expire'] = "Non invalidare";
18
+ $hyper_labels['never_expire_desc'] = "Non invalidare la cache sulla azioni, ma usa solo il tempo di scadenza";
19
+
20
+ ?>
21
+
22
+
options.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- if (function_exists('load_plugin_textdomain')) {
3
- load_plugin_textdomain('hyper-cache', 'wp-content/plugins/hyper-cache');
4
- }
 
 
 
5
 
6
  function hyper_request( $name, $default=null ) {
7
  if ( !isset($_POST[$name]) ) {
@@ -73,6 +76,7 @@ if (isset($_POST['save'])) {
73
  $buffer .= '$hyper_compress = ' . ($options['compress']?'true':'false') . ";\n";
74
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
75
  $buffer .= '$hyper_cache_get = ' . ($options['get']?'true':'false') . ";\n";
 
76
  $buffer .= '?>';
77
  $file = fopen(ABSPATH . 'wp-content/hyper-cache-config.php', 'w');
78
  fwrite($file, $buffer);
@@ -95,33 +99,36 @@ else
95
  <?php
96
  if (!defined('WP_CACHE') ) {
97
  echo '<div class="alert error" style="margin-top:10px;"><p>';
98
- _e('not_enabled', 'hyper-cache');
99
  echo "<pre>define('WP_CACHE', true);</pre>";
100
  echo '</p></div>';
101
  }
102
  ?>
103
 
104
- <h3><?php _e('configuration', 'hyper-cache'); ?></h3>
105
  <table class="form-table">
106
  <tr valign="top">
107
- <?php hyper_field_checkbox('cache', __('active', 'hyper-cache')); ?>
108
  </tr>
109
  <tr valign="top">
110
- <?php hyper_field_text('timeout', __('expire', 'hyper-cache'), __('minutes', 'hyper-cache'), 'size="5"'); ?>
111
  </tr>
112
 
113
  <tr valign="top">
114
- <?php hyper_field_checkbox('not_expire_on_actions', __('not_expire_on_actions', 'hyper-cache'), __('not_expire_on_actions_desc', 'hyper-cache')); ?>
115
  </tr>
116
  <tr valign="top">
117
- <?php hyper_field_checkbox('invalidate_single_posts', __('invalidate_single_posts', 'hyper-cache'), __('invalidate_single_posts_desc', 'hyper-cache')); ?>
118
  </tr>
119
  <tr valign="top">
120
- <?php hyper_field_checkbox('compress', __('compress_html', 'hyper-cache')); ?>
121
  </tr>
 
 
 
122
 
123
  <tr valign="top">
124
- <th scope="row"><?php _e('count', 'hyper-cache'); ?></th>
125
  <td><?php echo hyper_count(); ?></td>
126
  </tr>
127
  </table>
@@ -139,8 +146,8 @@ else
139
  -->
140
 
141
  <p class="submit">
142
- <input class="button" type="submit" name="save" value="<?php _e('save', 'hyper-cache'); ?>">
143
- <input class="button" type="submit" name="clear" value="<?php _e('clear', 'hyper-cache'); ?>">
144
  </p>
145
  </form>
146
  </div>
1
  <?php
2
+ //if (function_exists('load_plugin_textdomain')) {
3
+ // load_plugin_textdomain('hyper-cache', 'wp-content/plugins/hyper-cache');
4
+ //}
5
+
6
+ include('en_US.php');
7
+ if (WPLANG) include(WPLANG . '.php');
8
 
9
  function hyper_request( $name, $default=null ) {
10
  if ( !isset($_POST[$name]) ) {
76
  $buffer .= '$hyper_compress = ' . ($options['compress']?'true':'false') . ";\n";
77
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
78
  $buffer .= '$hyper_cache_get = ' . ($options['get']?'true':'false') . ";\n";
79
+ $buffer .= '$hyper_cache_gzip = ' . ($options['gzip']?'true':'false') . ";\n";
80
  $buffer .= '?>';
81
  $file = fopen(ABSPATH . 'wp-content/hyper-cache-config.php', 'w');
82
  fwrite($file, $buffer);
99
  <?php
100
  if (!defined('WP_CACHE') ) {
101
  echo '<div class="alert error" style="margin-top:10px;"><p>';
102
+ echo $hyper_labels['wp_cache_not_enabled'];
103
  echo "<pre>define('WP_CACHE', true);</pre>";
104
  echo '</p></div>';
105
  }
106
  ?>
107
 
108
+ <h3><?php echo $hyper_labels['configuration']; ?></h3>
109
  <table class="form-table">
110
  <tr valign="top">
111
+ <?php hyper_field_checkbox('cache', $hyper_labels['activate']); ?>
112
  </tr>
113
  <tr valign="top">
114
+ <?php hyper_field_text('timeout', $hyper_labels['expire'], $hyper_labels['minutes'], 'size="5"'); ?>
115
  </tr>
116
 
117
  <tr valign="top">
118
+ <?php hyper_field_checkbox('not_expire_on_actions', $hyper_labels['never_expire'], $hyper_labels['never_expire_desc']); ?>
119
  </tr>
120
  <tr valign="top">
121
+ <?php hyper_field_checkbox('invalidate_single_posts', $hyper_labels['invalidate_single_posts'], $hyper_labels['invalidate_single_posts_desc']); ?>
122
  </tr>
123
  <tr valign="top">
124
+ <?php hyper_field_checkbox('compress', $hyper_labels['compress_html'], $hyper_labels['compress_html_desc']); ?>
125
  </tr>
126
+ <tr valign="top">
127
+ <?php hyper_field_checkbox('gzip', $hyper_labels['gzip_compression'], $hyper_labels['gzip_compression_desc']); ?>
128
+ </tr>
129
 
130
  <tr valign="top">
131
+ <th scope="row"><?php echo $hyper_labels['count']; ?></th>
132
  <td><?php echo hyper_count(); ?></td>
133
  </tr>
134
  </table>
146
  -->
147
 
148
  <p class="submit">
149
+ <input class="button" type="submit" name="save" value="<?php echo $hyper_labels['save']; ?>">
150
+ <input class="button" type="submit" name="clear" value="<?php echo $hyper_labels['clear']; ?>">
151
  </p>
152
  </form>
153
  </div>
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Hyper Cache
4
  Plugin URI: http://www.satollo.com/english/wordpress/hyper-cache
5
  Description: Hyper Cache is an extremely aggressive cache for WordPress.
6
- Version: 1.1.1
7
  Author: Satollo
8
  Author URI: http://www.satollo.com
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -84,8 +84,10 @@ function hyper_activate() {
84
 
85
 
86
  add_action('deactivate_hyper-cache/plugin.php', 'hyper_deactivate');
87
- function hyper_deactivate() {
88
- delete_option('hyper');
 
 
89
 
90
  if (file_exists(ABSPATH . 'wp-content/advanced-cache.php')) unlink(ABSPATH . 'wp-content/advanced-cache.php');
91
  if (file_exists(ABSPATH . 'wp-content/hyper-cache-config.php')) unlink(ABSPATH . 'wp-content/hyper-cache-config.php');
@@ -172,7 +174,6 @@ function hyper_count() {
172
  return $count;
173
  }
174
 
175
-
176
  if ($hyper_options['cache'] && !$hyper_options['not_expire_on_actions'])
177
  {
178
  // Posts
@@ -212,4 +213,14 @@ if ($hyper_options['cache'] && !$hyper_options['not_expire_on_actions'])
212
  add_action('delete_comment', 'hyper_cache_invalidate', 0);
213
  }
214
  }
 
 
 
 
 
 
 
 
 
 
215
  ?>
3
  Plugin Name: Hyper Cache
4
  Plugin URI: http://www.satollo.com/english/wordpress/hyper-cache
5
  Description: Hyper Cache is an extremely aggressive cache for WordPress.
6
+ Version: 1.2
7
  Author: Satollo
8
  Author URI: http://www.satollo.com
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
84
 
85
 
86
  add_action('deactivate_hyper-cache/plugin.php', 'hyper_deactivate');
87
+ function hyper_deactivate()
88
+ {
89
+ // Wrong!!! The Wordpress automatic update deactivate the plugin, delting all the options!!!
90
+ delete_option('hyper');
91
 
92
  if (file_exists(ABSPATH . 'wp-content/advanced-cache.php')) unlink(ABSPATH . 'wp-content/advanced-cache.php');
93
  if (file_exists(ABSPATH . 'wp-content/hyper-cache-config.php')) unlink(ABSPATH . 'wp-content/hyper-cache-config.php');
174
  return $count;
175
  }
176
 
 
177
  if ($hyper_options['cache'] && !$hyper_options['not_expire_on_actions'])
178
  {
179
  // Posts
213
  add_action('delete_comment', 'hyper_cache_invalidate', 0);
214
  }
215
  }
216
+
217
+ add_filter('redirect_canonical', 'hyper_redirect_canonical', 10, 2);
218
+ $hyper_redirect = null;
219
+ function hyper_redirect_canonical($redirect_url, $requested_url)
220
+ {
221
+ global $hyper_redirect;
222
+ $hyper_redirect = $redirect_url;
223
+
224
+ return $redirect_url;
225
+ }
226
  ?>
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: cache,chaching
3
  Requires at least: 2.1
4
  Tested up to: 2.6.2
5
- Stable tag: 1.1.1
6
  Donate link: http://www.satollo.com/english/donate
7
  Contributors: satollo,momo360modena
8
 
@@ -10,9 +10,17 @@ Hyper Cache is an extremely aggressive cache for WordPress.
10
 
11
  == Description ==
12
 
13
- Hyper Cache is an experimental really aggressive cache for WordPress. I wrote it because my hosting provider is very low in resources, particulary on the mysql side.
 
 
14
 
15
- The cache tries to reduce the database queries to zero.
 
 
 
 
 
 
16
 
17
  To install, please read carefully the instructions on:
18
 
2
  Tags: cache,chaching
3
  Requires at least: 2.1
4
  Tested up to: 2.6.2
5
+ Stable tag: 1.2
6
  Donate link: http://www.satollo.com/english/donate
7
  Contributors: satollo,momo360modena
8
 
10
 
11
  == Description ==
12
 
13
+ Hyper Cache is a really aggressive cache for WordPress. This cache helps
14
+ in solving the low resources problems of many hosting provider, specially
15
+ when the is big slowness or timeout in the mysql side.
16
 
17
+ The cache reduces the database queries to _zero_ serving cached
18
+ page _without activate_ wordpress. The cache can serve _gzip_
19
+ compressed page to lower the bandwith usage and/or optimized html
20
+ pages.
21
+
22
+ There are drawbacks to obtain such performances, check the plugin
23
+ page on my site.
24
 
25
  To install, please read carefully the instructions on:
26