Head Cleaner - Version 1.4.0.2

Version Description

Download this release

Release Info

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

Code changes from version 1.4.0.1 to 1.4.0.2

Files changed (3) hide show
  1. head-cleaner.php +13 -11
  2. readme.txt +1 -1
  3. readme_ja.txt +1 -1
head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.4.0.1
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -267,14 +267,14 @@ class HeadCleaner extends wokController {
267
  $cache_dir = $this->_create_cache_dir();
268
  if ( $cache_dir !== FALSE )
269
  $this->_create_htaccess($cache_dir);
270
- $this->_remove_cache_file();
271
  }
272
 
273
  //**************************************************************************************
274
  // plugin deactivation
275
  //**************************************************************************************
276
  public function deactivation(){
277
- $this->_remove_cache_file();
278
  }
279
 
280
  //**************************************************************************************
@@ -1251,6 +1251,9 @@ class HeadCleaner extends wokController {
1251
  case 'js':
1252
  $cache_filename = $this->cache_path . 'js/' . $cache_filename . '.js';
1253
  break;
 
 
 
1254
  }
1255
  }
1256
  return $cache_filename;
@@ -1265,8 +1268,8 @@ class HeadCleaner extends wokController {
1265
 
1266
  if (!file_exists($cache_filename)) {
1267
  $src =
1268
- preg_match('/\.'.preg_quote($type).'[\?]*[^\?]*)$/i', $src)
1269
- ? trim(preg_replace('/(\.'.preg_quote($type).')([\?]*[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $src)))
1270
  : $filename
1271
  ;
1272
  if (preg_match('/^https?:\/\//i', $src)) {
@@ -1274,7 +1277,7 @@ class HeadCleaner extends wokController {
1274
 
1275
  } else {
1276
  $src = realpath($src);
1277
- if ($src !== FALSE && file_exists($src)) {
1278
  $content = @file_get_contents($src);
1279
  } else {
1280
  $content = $this->_remote_get($filename);
@@ -1283,7 +1286,7 @@ class HeadCleaner extends wokController {
1283
 
1284
  switch ($type) {
1285
  case 'css':
1286
- $content = $this->_css_url_edit($content, $filename);
1287
  // URLs of images in CSS will be converted into the data scheme URIs
1288
  if ($this->_base64_img_ok())
1289
  $content = preg_replace_callback('/url\((https?:\/\/.*?\.(jpe?g|png|gif|bmp|ico)[^\)]*)\)/i', array(&$this, '_base64_replace'), $content);
@@ -1683,7 +1686,7 @@ class HeadCleaner extends wokController {
1683
  $replace = array();
1684
  foreach ((array) $matches as $match) {
1685
  $filename = str_replace($this->wp_url, ABSPATH, trim($match[1]));
1686
- list($content, $cache_path) = $this->_file_read(file_exists($filename) ? $filename : $match[1]);
1687
  $content = $this->_css_url_edit($content, $filename);
1688
  if ($this->options['css_optimise'])
1689
  $content = $this->_css_optimise($content, false);
@@ -1931,14 +1934,13 @@ class HeadCleaner extends wokController {
1931
  // Show Option Page
1932
  //**************************************************************************************
1933
  public function add_admin_scripts() {
1934
- $this->addjQuery(); // regist jQuery
1935
  }
1936
 
1937
  public function add_admin_head() {
1938
  $out = <<< E__O__T
1939
  <style type="text/css">/*<![CDATA[ */
1940
  .optiontable td {line-height:25px;}
1941
- td.more-options {display:none;}
1942
  /* ]]>*/</style>
1943
 
1944
  <script type="text/javascript">//<![CDATA[
@@ -2622,4 +2624,4 @@ if (function_exists('register_activation_hook'))
2622
  register_activation_hook(__FILE__, array(&$head_cleaner, 'activation'));
2623
  if (function_exists('register_deactivation_hook'))
2624
  register_deactivation_hook(__FILE__, array(&$head_cleaner, 'deactivation'));
2625
- ?>
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.4.0.2
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
267
  $cache_dir = $this->_create_cache_dir();
268
  if ( $cache_dir !== FALSE )
269
  $this->_create_htaccess($cache_dir);
270
+ // $this->_remove_cache_file();
271
  }
272
 
273
  //**************************************************************************************
274
  // plugin deactivation
275
  //**************************************************************************************
276
  public function deactivation(){
277
+ // $this->_remove_cache_file();
278
  }
279
 
280
  //**************************************************************************************
1251
  case 'js':
1252
  $cache_filename = $this->cache_path . 'js/' . $cache_filename . '.js';
1253
  break;
1254
+ default:
1255
+ $cache_filename = $this->cache_path . $cache_filename;
1256
+ break;
1257
  }
1258
  }
1259
  return $cache_filename;
1268
 
1269
  if (!file_exists($cache_filename)) {
1270
  $src =
1271
+ $type !== false && preg_match('/\.'.preg_quote($type).'[\?]*[^\?]*)$/i', $filename)
1272
+ ? trim(preg_replace('/(\.'.preg_quote($type).')([\?]*[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $filename)))
1273
  : $filename
1274
  ;
1275
  if (preg_match('/^https?:\/\//i', $src)) {
1277
 
1278
  } else {
1279
  $src = realpath($src);
1280
+ if ($src !== false && file_exists($src)) {
1281
  $content = @file_get_contents($src);
1282
  } else {
1283
  $content = $this->_remote_get($filename);
1286
 
1287
  switch ($type) {
1288
  case 'css':
1289
+ $content = $this->_css_url_edit($content, $src);
1290
  // URLs of images in CSS will be converted into the data scheme URIs
1291
  if ($this->_base64_img_ok())
1292
  $content = preg_replace_callback('/url\((https?:\/\/.*?\.(jpe?g|png|gif|bmp|ico)[^\)]*)\)/i', array(&$this, '_base64_replace'), $content);
1686
  $replace = array();
1687
  foreach ((array) $matches as $match) {
1688
  $filename = str_replace($this->wp_url, ABSPATH, trim($match[1]));
1689
+ list($content, $cache_path) = $this->_file_read(file_exists($filename) ? $filename : $match[1], 'css');
1690
  $content = $this->_css_url_edit($content, $filename);
1691
  if ($this->options['css_optimise'])
1692
  $content = $this->_css_optimise($content, false);
1934
  // Show Option Page
1935
  //**************************************************************************************
1936
  public function add_admin_scripts() {
1937
+ wp_enqueue_script('jquery');
1938
  }
1939
 
1940
  public function add_admin_head() {
1941
  $out = <<< E__O__T
1942
  <style type="text/css">/*<![CDATA[ */
1943
  .optiontable td {line-height:25px;}
 
1944
  /* ]]>*/</style>
1945
 
1946
  <script type="text/javascript">//<![CDATA[
2624
  register_activation_hook(__FILE__, array(&$head_cleaner, 'activation'));
2625
  if (function_exists('register_deactivation_hook'))
2626
  register_deactivation_hook(__FILE__, array(&$head_cleaner, 'deactivation'));
2627
+ ?>
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: 3.0.2
7
- Stable tag: 1.4.0.1
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: 3.0.2
7
+ Stable tag: 1.4.0.2
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: 3.0.2
7
- Stable tag: 1.4.0.1
8
 
9
  Head と footer をお掃除します。
10
 
4
  Tags: head optimization, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
  Tested up to: 3.0.2
7
+ Stable tag: 1.4.0.2
8
 
9
  Head と footer をお掃除します。
10