Head Cleaner - Version 1.1.6

Version Description

Download this release

Release Info

Developer wokamoto
Plugin Icon wp plugin Head Cleaner
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.1.5
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -51,21 +51,21 @@ if (version_compare(phpversion(), "5.0.0", "<"))
51
  define('HC_PRIORITY', 10000);
52
  define('HC_ANALYZE_EXPIRED', 604800); // 60 * 60 * 24 * 7 [sec.]
53
  define('HC_XMLNS', 'http://www.w3.org/1999/xhtml');
 
54
 
55
 
56
  //**************************************************************************************
57
  if (!defined('ABSPATH') && strstr($_SERVER['PHP_SELF'], '/head-cleaner.php')) {
58
  define('HC_EXPIRED_JS_CSS', 2592000); // 60 * 60 * 24 * 30 [sec.]
59
- define('HC_CACHE_DIR', '/../../cache/head-cleaner');
60
 
61
  if (isset($_GET['f']) && isset($_GET['t'])) {
62
- $cache_path = realpath(dirname(__FILE__) . HC_CACHE_DIR) . '/';
63
  $filename_hash = trim(stripslashes($_GET['f']));
64
  $type = trim(stripslashes($_GET['t']));
65
 
66
  if (strlen($filename_hash) == 32 && ($type == 'js' || $type == 'css')) {
67
  $is_gzip = (strpos(strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') !== FALSE);
68
- $filename = "{$cache_path}{$type}/{$filename_hash}.{$type}" . ($is_gzip ? '.gz' : '');
69
  if (file_exists($filename)) {
70
  $offset = (!defined('HC_EXPIRED_JS_CSS') ? HC_EXPIRED_JS_CSS : 60 * 60 * 24 * 30);
71
  $content_type = 'text/' . ($type == 'js' ? 'javascript' : $type);
@@ -107,7 +107,7 @@ if (!class_exists('wokController') || !class_exists('wokScriptManager'))
107
  //**************************************************************************************
108
  class HeadCleanerController extends wokController {
109
  public $plugin_name = 'head-cleaner';
110
- public $plugin_ver = '1.1.4';
111
 
112
  // Deafault Options
113
  private $options_default = array(
@@ -195,7 +195,7 @@ class HeadCleanerController extends wokController {
195
  }
196
 
197
  // Set browscap
198
- if ( function_exists('get_browser') && !ini_get('browscap') )
199
  ini_set('browscap', dirname(__FILE__) . '/includes/php_browscap.ini');
200
 
201
  // Require PHP Libraries
@@ -1351,10 +1351,9 @@ class HeadCleanerController extends wokController {
1351
  //**************************************************************************************
1352
  // Create cache dir
1353
  //**************************************************************************************
1354
- private function _create_cache_dir($cache = '', $plugin = '') {
1355
- if (empty($cache)) $cache = 'cache';
1356
- if (empty($plugin)) $plugin = $this->plugin_name;
1357
- $cache_dir = $this->_wp_content_dir("/$cache/$plugin/");
1358
 
1359
  $mode = 0777;
1360
  if( !file_exists(dirname($cache_dir)) )
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.1.6
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
51
  define('HC_PRIORITY', 10000);
52
  define('HC_ANALYZE_EXPIRED', 604800); // 60 * 60 * 24 * 7 [sec.]
53
  define('HC_XMLNS', 'http://www.w3.org/1999/xhtml');
54
+ define('HC_CACHE_DIR', 'cache/head-cleaner');
55
 
56
 
57
  //**************************************************************************************
58
  if (!defined('ABSPATH') && strstr($_SERVER['PHP_SELF'], '/head-cleaner.php')) {
59
  define('HC_EXPIRED_JS_CSS', 2592000); // 60 * 60 * 24 * 30 [sec.]
 
60
 
61
  if (isset($_GET['f']) && isset($_GET['t'])) {
62
+ $cache_dir = realpath(dirname(__FILE__) . '/../../' . HC_CACHE_DIR) . '/';
63
  $filename_hash = trim(stripslashes($_GET['f']));
64
  $type = trim(stripslashes($_GET['t']));
65
 
66
  if (strlen($filename_hash) == 32 && ($type == 'js' || $type == 'css')) {
67
  $is_gzip = (strpos(strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') !== FALSE);
68
+ $filename = "{$cache_dir}{$type}/{$filename_hash}.{$type}" . ($is_gzip ? '.gz' : '');
69
  if (file_exists($filename)) {
70
  $offset = (!defined('HC_EXPIRED_JS_CSS') ? HC_EXPIRED_JS_CSS : 60 * 60 * 24 * 30);
71
  $content_type = 'text/' . ($type == 'js' ? 'javascript' : $type);
107
  //**************************************************************************************
108
  class HeadCleanerController extends wokController {
109
  public $plugin_name = 'head-cleaner';
110
+ public $plugin_ver = '1.1.6';
111
 
112
  // Deafault Options
113
  private $options_default = array(
195
  }
196
 
197
  // Set browscap
198
+ if ( !ini_get('browscap') )
199
  ini_set('browscap', dirname(__FILE__) . '/includes/php_browscap.ini');
200
 
201
  // Require PHP Libraries
1351
  //**************************************************************************************
1352
  // Create cache dir
1353
  //**************************************************************************************
1354
+ private function _create_cache_dir($cache_dir = '') {
1355
+ if (empty($cache_dir)) $cache_dir = HC_CACHE_DIR;
1356
+ $cache_dir = $this->_wp_content_dir('/' . trailingslashit($cache_dir) );
 
1357
 
1358
  $mode = 0777;
1359
  if( !file_exists(dirname($cache_dir)) )
includes/common-controller.php CHANGED
@@ -249,7 +249,7 @@ class wokController {
249
 
250
  // WP_CONTENT_DIR
251
  function wp_content_dir($path = '') {
252
- return trailingslashit(trailingslashit(!defined('WP_CONTENT_DIR')
253
  ? WP_CONTENT_DIR
254
  : trailingslashit(ABSPATH) . 'wp-content'
255
  ) . preg_replace('/^\//', '', $path) );
@@ -257,7 +257,7 @@ class wokController {
257
 
258
  // WP_CONTENT_URL
259
  function wp_content_url($path = '') {
260
- return trailingslashit(trailingslashit(!defined('WP_CONTENT_URL')
261
  ? WP_CONTENT_URL
262
  : trailingslashit(get_option('siteurl')) . 'wp-content'
263
  ) . preg_replace('/^\//', '', $path) );
249
 
250
  // WP_CONTENT_DIR
251
  function wp_content_dir($path = '') {
252
+ return trailingslashit( trailingslashit( defined('WP_CONTENT_DIR')
253
  ? WP_CONTENT_DIR
254
  : trailingslashit(ABSPATH) . 'wp-content'
255
  ) . preg_replace('/^\//', '', $path) );
257
 
258
  // WP_CONTENT_URL
259
  function wp_content_url($path = '') {
260
+ return trailingslashit( trailingslashit( defined('WP_CONTENT_URL')
261
  ? WP_CONTENT_URL
262
  : trailingslashit(get_option('siteurl')) . 'wp-content'
263
  ) . preg_replace('/^\//', '', $path) );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJ
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
- Stable tag: 1.1.5
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
+ Stable tag: 1.1.6
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
readme_ja.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJ
4
  Tags: head optimization, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
- Stable tag: 1.1.5
8
 
9
  Head �� footer �����|�����܂��B
10
 
4
  Tags: head optimization, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
  Tested up to: 2.7.1
7
+ Stable tag: 1.1.6
8
 
9
  Head �� footer �����|�����܂��B
10