Hyper Cache - Version 1.0.7

Version Description

Download this release

Release Info

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

Code changes from version 1.0.6 to 1.0.7

advanced-cache.php CHANGED
@@ -21,9 +21,10 @@ foreach ( (array) $_COOKIE as $n => $v ) {
21
 
22
  $hyper_uri = stripslashes($_SERVER['REQUEST_URI']);
23
 
 
 
24
  // Do not cache WP pages, even if those calls typically don't go throught this script
25
- if( strpos($hyper_uri, '?') !== false ||
26
- strpos($hyper_uri, '/wp-admin/') !== false ||
27
  strpos($hyper_uri, '/wp-includes/') !== false ||
28
  strpos($hyper_uri, '/wp-content/') !== false ) {
29
  return false;
@@ -31,9 +32,11 @@ if( strpos($hyper_uri, '?') !== false ||
31
 
32
 
33
  // Special blocks: the download manager plugin
 
34
  if (strpos($hyper_uri, '/download/') !== false) {
35
  return false;
36
  }
 
37
 
38
  // Remove the anchor
39
  $x = strpos($hyper_uri, '#');
@@ -53,7 +56,13 @@ if ( is_file($hyper_file) ) {
53
  }
54
 
55
  if ($hyper_data != null && ($hyper_data['time'] > time()-($hyper_cache_timeout*60)) && $hyper_data['html'] != '') {
56
- header('Content-Type: text/html;charset=UTF-8');
 
 
 
 
 
 
57
  echo $hyper_data['html'];
58
  echo '<!-- hyper cache -->';
59
  flush();
@@ -75,6 +84,11 @@ function hyper_cache_callback($buffer) {
75
  $data['uri'] = $_SERVER['REQUEST_URI'];
76
  $data['referer'] = $_SERVER['HTTP_REFERER'];
77
  $data['time'] = time();
 
 
 
 
 
78
  $data['html'] = $buffer;
79
 
80
  $file = fopen($hyper_file, 'w');
21
 
22
  $hyper_uri = stripslashes($_SERVER['REQUEST_URI']);
23
 
24
+ if (!$hyper_cache_get && strpos($hyper_uri, '?') !== false) return false;
25
+
26
  // Do not cache WP pages, even if those calls typically don't go throught this script
27
+ if (strpos($hyper_uri, '/wp-admin/') !== false ||
 
28
  strpos($hyper_uri, '/wp-includes/') !== false ||
29
  strpos($hyper_uri, '/wp-content/') !== false ) {
30
  return false;
32
 
33
 
34
  // Special blocks: the download manager plugin
35
+ /*
36
  if (strpos($hyper_uri, '/download/') !== false) {
37
  return false;
38
  }
39
+ */
40
 
41
  // Remove the anchor
42
  $x = strpos($hyper_uri, '#');
56
  }
57
 
58
  if ($hyper_data != null && ($hyper_data['time'] > time()-($hyper_cache_timeout*60)) && $hyper_data['html'] != '') {
59
+ if ($hyper_data['mime'] == '')
60
+ {
61
+ header('Content-Type: text/html;charset=UTF-8');
62
+ }
63
+ else {
64
+ header('Content-Type: ' . $hyper_data['mime']);
65
+ }
66
  echo $hyper_data['html'];
67
  echo '<!-- hyper cache -->';
68
  flush();
84
  $data['uri'] = $_SERVER['REQUEST_URI'];
85
  $data['referer'] = $_SERVER['HTTP_REFERER'];
86
  $data['time'] = time();
87
+ if (is_feed()) {
88
+ $data['mime'] = 'text/xml;charset=UTF-8';
89
+ } else {
90
+ $data['mime'] = 'text/html;charset=UTF-8';
91
+ }
92
  $data['html'] = $buffer;
93
 
94
  $file = fopen($hyper_file, 'w');
hyper-cache-de_DE.mo CHANGED
Binary file
hyper-cache-de_DE.po CHANGED
@@ -3,7 +3,7 @@ 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-04-16 09:24+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -49,3 +49,9 @@ msgstr "Cache l&ouml;schen"
49
  msgid "count"
50
  msgstr "Gecachte Seiten"
51
 
 
 
 
 
 
 
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-06-06 17:16+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
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
+
hyper-cache-en_US.mo CHANGED
Binary file
hyper-cache-en_US.po CHANGED
@@ -3,7 +3,7 @@ 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-04-16 09:24+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -49,3 +49,9 @@ msgstr "Clear the cache"
49
  msgid "count"
50
  msgstr "Cached pages"
51
 
 
 
 
 
 
 
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-06-06 17:16+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
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
+
hyper-cache-fr_FR.mo CHANGED
Binary file
hyper-cache-fr_FR.po CHANGED
@@ -3,7 +3,7 @@ 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-04-16 09:24+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -49,3 +49,9 @@ msgstr "Effacer le cache"
49
  msgid "count"
50
  msgstr "Nombre de pages en cache"
51
 
 
 
 
 
 
 
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-06-06 17:16+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
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
+
hyper-cache-it_IT.mo CHANGED
Binary file
hyper-cache-it_IT.po CHANGED
@@ -3,7 +3,7 @@ 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-04-16 09:24+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -28,8 +28,6 @@ msgstr "Configurazione"
28
  msgid "active"
29
  msgstr "Attivare la cache?"
30
 
31
- #: D:\SVN\Plugins\Hyper
32
- #: Cache\trunk/options.php:111
33
  msgid "expire"
34
  msgstr "La pagine scadono dopo:"
35
 
@@ -49,3 +47,9 @@ msgstr "Azzera la cache"
49
  msgid "count"
50
  msgstr "Pagine in cache"
51
 
 
 
 
 
 
 
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-06-06 17:16+0100\n"
7
  "Last-Translator: Satollo <satollo@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
28
  msgid "active"
29
  msgstr "Attivare la cache?"
30
 
 
 
31
  msgid "expire"
32
  msgstr "La pagine scadono dopo:"
33
 
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
+
options.php CHANGED
@@ -63,11 +63,6 @@ if (isset($_POST['save'])) {
63
  $options = hyper_request('options');
64
  update_option('hyper', $options);
65
 
66
- // Write the configuration file
67
- if (!file_exists(ABSPATH . '/wp-content/hyper-cache')) {
68
- mkdir(ABSPATH . '/wp-content/hyper-cache', 0766);
69
- }
70
-
71
  if (!$options['timeout'] || !is_numeric($options['timeout'])) {
72
  $options['timeout'] = 60;
73
  }
@@ -75,17 +70,12 @@ if (isset($_POST['save'])) {
75
  $buffer = "<?php\n";
76
  $buffer .= '$hyper_cache_enabled = ' . ($options['cache']?'true':'false') . ";\n";
77
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
 
78
  $buffer .= '?>';
79
  $file = fopen(ABSPATH . 'wp-content/hyper-cache-config.php', 'w');
80
  fwrite($file, $buffer);
81
  fclose($file);
82
 
83
- // Write the advanced-cache.php (so we grant it's the correct version)
84
- $buffer = file_get_contents(dirname(__FILE__) . '/advanced-cache.php');
85
- $file = fopen(ABSPATH . 'wp-content/advanced-cache.php', 'w');
86
-
87
- fwrite($file, $buffer);
88
- fclose($file);
89
  } else {
90
  $options = get_option('hyper');
91
  if (!$options['timeout']) {
@@ -114,16 +104,30 @@ if (isset($_POST['save'])) {
114
  <tr valign="top">
115
  <?php hyper_field_text('timeout', __('expire', 'hyper-cache'), __('minutes', 'hyper-cache'), 'size="5"'); ?>
116
  </tr>
117
- </table>
118
-
119
- <table class="form-table">
 
 
120
  <tr valign="top">
121
  <th scope="row"><?php _e('count', 'hyper-cache'); ?></th>
122
  <td><?php echo hyper_count(); ?></td>
123
  </tr>
124
  </table>
125
 
126
- <p>
 
 
 
 
 
 
 
 
 
 
 
 
127
  <input class="button" type="submit" name="save" value="<?php _e('save', 'hyper-cache'); ?>">
128
  <input class="button" type="submit" name="clear" value="<?php _e('clear', 'hyper-cache'); ?>">
129
  </p>
63
  $options = hyper_request('options');
64
  update_option('hyper', $options);
65
 
 
 
 
 
 
66
  if (!$options['timeout'] || !is_numeric($options['timeout'])) {
67
  $options['timeout'] = 60;
68
  }
70
  $buffer = "<?php\n";
71
  $buffer .= '$hyper_cache_enabled = ' . ($options['cache']?'true':'false') . ";\n";
72
  $buffer .= '$hyper_cache_timeout = ' . $options['timeout'] . ";\n";
73
+ $buffer .= '$hyper_cache_get = ' . ($options['get']?'true':'false') . ";\n";
74
  $buffer .= '?>';
75
  $file = fopen(ABSPATH . 'wp-content/hyper-cache-config.php', 'w');
76
  fwrite($file, $buffer);
77
  fclose($file);
78
 
 
 
 
 
 
 
79
  } else {
80
  $options = get_option('hyper');
81
  if (!$options['timeout']) {
104
  <tr valign="top">
105
  <?php hyper_field_text('timeout', __('expire', 'hyper-cache'), __('minutes', 'hyper-cache'), 'size="5"'); ?>
106
  </tr>
107
+
108
+ <tr valign="top">
109
+ <?php hyper_field_checkbox('not_expire_on_actions', __('not_expire_on_actions', 'hyper-cache'), __('not_expire_on_actions_desc', 'hyper-cache'), 'size="5"'); ?>
110
+ </tr>
111
+
112
  <tr valign="top">
113
  <th scope="row"><?php _e('count', 'hyper-cache'); ?></th>
114
  <td><?php echo hyper_count(); ?></td>
115
  </tr>
116
  </table>
117
 
118
+ <!--
119
+ <h3><?php _e('advanced options', 'hyper-cache'); ?></h3>
120
+ <table class="form-table">
121
+ <tr valign="top">
122
+ <?php echo hyper_field_textarea('urls', __('url to reject', 'hyper-cache')); ?>
123
+ </tr>
124
+ <tr valign="top">
125
+ <?php echo hyper_field_checkbox('get', __('cache get with parameters', 'hyper-cache')); ?>
126
+ </tr>
127
+ </table>
128
+ -->
129
+
130
+ <p class="submit">
131
  <input class="button" type="submit" name="save" value="<?php _e('save', 'hyper-cache'); ?>">
132
  <input class="button" type="submit" name="clear" value="<?php _e('clear', 'hyper-cache'); ?>">
133
  </p>
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.0.6
7
  Author: Satollo
8
  Author URI: http://www.satollo.com
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -29,6 +29,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
  ---
30
  Changelog
31
  ---
 
 
 
 
32
  Version 1.0.6
33
  - German translation by Frank Luef
34
  - Fixed some not blocking url when installing without the WP_CACHE defined
@@ -49,23 +53,37 @@ Version 1.0.4
49
 
50
  $hyper_options = get_option('hyper');
51
 
52
- /*
53
  add_action('activate_hyper-cache/plugin.php', 'hyper_activate');
54
  function hyper_activate() {
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
- */
57
 
58
  add_action('deactivate_hyper-cache/plugin.php', 'hyper_deactivate');
59
  function hyper_deactivate() {
60
  delete_option('hyper');
61
 
62
- unlink(ABSPATH . 'wp-content/advanced-cache.php');
63
- unlink(ABSPATH . 'wp-content/hyper-cache-config.php');
64
 
65
- $path = ABSPATH . 'wp-content/' . time();
66
- rename(ABSPATH . 'wp-content/hyper-cache', $path);
 
 
67
 
68
- hyper_delete_path( $path );
 
69
  }
70
 
71
  add_action('admin_head', 'hyper_admin_head');
@@ -73,12 +91,16 @@ function hyper_admin_head() {
73
  add_options_page('Hyper Cache', 'Hyper Cache', 'manage_options', 'hyper-cache/options.php');
74
  }
75
 
76
- function hyper_cache_invalidate() {
 
 
 
 
 
77
  $path = ABSPATH . 'wp-content/' . time();
78
  rename(ABSPATH . 'wp-content/hyper-cache', $path);
79
- mkdir(ABSPATH . 'wp-content/hyper-cache', 0766);
80
-
81
  hyper_delete_path( $path );
 
82
  }
83
 
84
  function hyper_delete_path( $path = '' ) {
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.0.7
7
  Author: Satollo
8
  Author URI: http://www.satollo.com
9
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
29
  ---
30
  Changelog
31
  ---
32
+ Version 1.0.7
33
+ - Fixed the mime type for feed
34
+ - Added the "do not expire on actions" option
35
+
36
  Version 1.0.6
37
  - German translation by Frank Luef
38
  - Fixed some not blocking url when installing without the WP_CACHE defined
53
 
54
  $hyper_options = get_option('hyper');
55
 
56
+
57
  add_action('activate_hyper-cache/plugin.php', 'hyper_activate');
58
  function hyper_activate() {
59
+ if (!file_exists(ABSPATH . '/wp-content/hyper-cache')) {
60
+ mkdir(ABSPATH . '/wp-content/hyper-cache', 0766);
61
+ }
62
+ hyper_cache_invalidate();
63
+
64
+ // Write the advanced-cache.php (so we grant it's the correct version)
65
+ $buffer = file_get_contents(dirname(__FILE__) . '/advanced-cache.php');
66
+ $file = fopen(ABSPATH . 'wp-content/advanced-cache.php', 'w');
67
+
68
+ fwrite($file, $buffer);
69
+ fclose($file);
70
  }
71
+
72
 
73
  add_action('deactivate_hyper-cache/plugin.php', 'hyper_deactivate');
74
  function hyper_deactivate() {
75
  delete_option('hyper');
76
 
77
+ if (file_exists(ABSPATH . 'wp-content/advanced-cache.php')) unlink(ABSPATH . 'wp-content/advanced-cache.php');
78
+ if (file_exists(ABSPATH . 'wp-content/hyper-cache-config.php')) unlink(ABSPATH . 'wp-content/hyper-cache-config.php');
79
 
80
+ if (is_dir(ABSPATH . 'wp-content/hyper-cache'))
81
+ {
82
+ $path = ABSPATH . 'wp-content/' . time();
83
+ rename(ABSPATH . 'wp-content/hyper-cache', $path);
84
 
85
+ hyper_delete_path( $path );
86
+ }
87
  }
88
 
89
  add_action('admin_head', 'hyper_admin_head');
91
  add_options_page('Hyper Cache', 'Hyper Cache', 'manage_options', 'hyper-cache/options.php');
92
  }
93
 
94
+ function hyper_cache_invalidate()
95
+ {
96
+ global $hyper_options;
97
+
98
+ if ($hyper_options['not_expire_on_actions']) return;
99
+
100
  $path = ABSPATH . 'wp-content/' . time();
101
  rename(ABSPATH . 'wp-content/hyper-cache', $path);
 
 
102
  hyper_delete_path( $path );
103
+ mkdir(ABSPATH . 'wp-content/hyper-cache', 0766);
104
  }
105
 
106
  function hyper_delete_path( $path = '' ) {
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Hyper Cache ===
2
  Tags: cache,chaching
3
  Requires at least: 2.1
4
- Tested up to: 2.5
5
- Stable tag: 1.0.6
6
  Donate link: http://www.satollo.com/english/donate
7
  Contributors: satollo,momo360modena
8
 
@@ -32,6 +32,8 @@ Thank you to Frank Luef for the german translation.
32
  2. Go into the WordPress admin interface and activate the plugin
33
  3. Optional: go to the options page and configure the plugin
34
 
 
 
35
  == Frequently Asked Questions ==
36
 
37
  No questions have been asked.
1
  === Hyper Cache ===
2
  Tags: cache,chaching
3
  Requires at least: 2.1
4
+ Tested up to: 2.5.1
5
+ Stable tag: 1.0.7
6
  Donate link: http://www.satollo.com/english/donate
7
  Contributors: satollo,momo360modena
8
 
32
  2. Go into the WordPress admin interface and activate the plugin
33
  3. Optional: go to the options page and configure the plugin
34
 
35
+ Before upgrade DEACTIVATE the plugin!
36
+
37
  == Frequently Asked Questions ==
38
 
39
  No questions have been asked.