Head Cleaner - Version 1.4.0.7

Version Description

Download this release

Release Info

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

Code changes from version 1.4.0.6 to 1.4.0.7

Files changed (3) hide show
  1. head-cleaner.php +18 -10
  2. readme.txt +2 -2
  3. readme_ja.txt +2 -2
head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.4.0.6
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -783,10 +783,11 @@ class HeadCleaner extends wokController {
783
  //**************************************************************************************
784
  private function _parse_script_tag($elements){
785
  $script_tag = '';
786
- $inner_js = '';
787
- $foot_js = '';
788
- $js_src = array();
789
- $js_libs = array();
 
790
  $inner_js_src = array();
791
 
792
  foreach ((array) $elements as $element) {
@@ -907,10 +908,16 @@ class HeadCleaner extends wokController {
907
  $inline_js = '';
908
  $other_tag = '';
909
 
 
 
 
 
 
 
910
  // Get Simple DOM Object
911
  $dom = str_get_html(
912
  '<html><head></head><body>' .
913
- '<div id="footer">' . $buffer . '</div>' .
914
  '</body></html>'
915
  );
916
  if ($dom === false)
@@ -992,6 +999,7 @@ class HeadCleaner extends wokController {
992
 
993
  // tag normalize
994
  $ret_val = $this->_tag_normalize($ret_val);
 
995
 
996
  // add debug information
997
  if ($this->options['debug_mode'])
@@ -1280,7 +1288,7 @@ class HeadCleaner extends wokController {
1280
 
1281
  if (!file_exists($cache_filename)) {
1282
  $src =
1283
- $type !== false && preg_match('/\.'.preg_quote($type, '/').'[\?]*[^\?]*)$/i', $filename)
1284
  ? trim(preg_replace('/(\.'.preg_quote($type, '/').')([\?]*[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $filename)))
1285
  : $filename
1286
  ;
@@ -1822,9 +1830,9 @@ class HeadCleaner extends wokController {
1822
  @mkdir(dirname($cache_dir), $mode);
1823
  if( !file_exists($cache_dir) )
1824
  @mkdir($cache_dir, $mode);
1825
- if( !file_exists($cache_dir) . '/css/' )
1826
- @mkdir($cache_dir . '/css/', $mode);
1827
- if( !file_exists($cache_dir) . '/js/' )
1828
  @mkdir($cache_dir . '/js/', $mode);
1829
 
1830
  return (file_exists($cache_dir) ? $cache_dir : FALSE);
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.4.0.7
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
783
  //**************************************************************************************
784
  private function _parse_script_tag($elements){
785
  $script_tag = '';
786
+ $inner_js = '';
787
+ $inline_js = '';
788
+ $foot_js = '';
789
+ $js_src = array();
790
+ $js_libs = array();
791
  $inner_js_src = array();
792
 
793
  foreach ((array) $elements as $element) {
908
  $inline_js = '';
909
  $other_tag = '';
910
 
911
+ $fotter_txt = preg_replace_callback(
912
+ array('/(onclick=)(")([^"]*)(")/i', '/(onclick=)(\')([^\']*)(\')/i'),
913
+ array(&$this, '_tag_replace'),
914
+ $buffer
915
+ );
916
+
917
  // Get Simple DOM Object
918
  $dom = str_get_html(
919
  '<html><head></head><body>' .
920
+ '<div id="footer">' . $fotter_txt . '</div>' .
921
  '</body></html>'
922
  );
923
  if ($dom === false)
999
 
1000
  // tag normalize
1001
  $ret_val = $this->_tag_normalize($ret_val);
1002
+ $ret_val = str_replace('&#039;', "'", $ret_val);
1003
 
1004
  // add debug information
1005
  if ($this->options['debug_mode'])
1288
 
1289
  if (!file_exists($cache_filename)) {
1290
  $src =
1291
+ $type !== false && preg_match('/\.'.preg_quote($type, '/').'[\?]*[^\?]*$/i', $filename)
1292
  ? trim(preg_replace('/(\.'.preg_quote($type, '/').')([\?]*[^\?]*)$/i', '$1', str_replace($this->wp_url, ABSPATH, $filename)))
1293
  : $filename
1294
  ;
1830
  @mkdir(dirname($cache_dir), $mode);
1831
  if( !file_exists($cache_dir) )
1832
  @mkdir($cache_dir, $mode);
1833
+ if( !file_exists($cache_dir.'/css/') )
1834
+ @mkdir($cache_dir.'/css/', $mode);
1835
+ if( !file_exists($cache_dir.'/js/') )
1836
  @mkdir($cache_dir . '/js/', $mode);
1837
 
1838
  return (file_exists($cache_dir) ? $cache_dir : FALSE);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wokamoto
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
- Tested up to: 3.0.3
7
- Stable tag: 1.4.0.6
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
+ Tested up to: 3.1
7
+ Stable tag: 1.4.0.7
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
readme_ja.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wokamoto
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head optimization, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
- Tested up to: 3.0.3
7
- Stable tag: 1.4.0.6
8
 
9
  Head と footer をお掃除します。
10
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: head optimization, javascript, css, optimization, minified, performance
5
  Requires at least: 2.5
6
+ Tested up to: 3.1
7
+ Stable tag: 1.4.0.7
8
 
9
  Head と footer をお掃除します。
10