Head Cleaner - Version 1.4.1.3

Version Description

Download this release

Release Info

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

Code changes from version 1.4.1.2 to 1.4.1.3

Files changed (3) hide show
  1. head-cleaner.php +23 -7
  2. readme.txt +4 -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.1.2
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -725,7 +725,7 @@ class HeadCleaner extends wokController {
725
  foreach ($wk_inline_css as $key => $val) {
726
  $val = trim($val);
727
  if (!empty($val))
728
- $inline_css .= $this->_css_tag($val, $media, true);
729
  }
730
  }
731
  unset($wk_inline_css);
@@ -2671,22 +2671,38 @@ E__O__T;
2671
  } elseif(is_singular()) {
2672
  global $wpmp_conf, $post;
2673
 
 
2674
  $id = get_the_ID();
2675
  if (!isset($post)) {
2676
  $post = &get_post($id);
2677
  }
2678
  $title = trim(wp_title('', false));
2679
 
2680
- $thumb = (
2681
- has_post_thumbnail($id)
2682
- ? preg_replace("/^.*['\"](https?:\/\/[^'\"]*)['\"].*/i","$1",get_the_post_thumbnail($id))
2683
- : ''
2684
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2685
  if (empty($thumb) && preg_match_all('/<img .*src=[\'"]([^\'"]+)[\'"]/', $post->post_content, $matches, PREG_SET_ORDER)) {
2686
  $thumb = $matches[0][1];
2687
  }
2688
  unset($matches);
2689
 
 
2690
  $excerpt = (
2691
  !post_password_required($post)
2692
  ? get_the_excerpt()
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.4.1.3
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
725
  foreach ($wk_inline_css as $key => $val) {
726
  $val = trim($val);
727
  if (!empty($val))
728
+ $inline_css .= $this->_css_tag($val, $key, true);
729
  }
730
  }
731
  unset($wk_inline_css);
2671
  } elseif(is_singular()) {
2672
  global $wpmp_conf, $post;
2673
 
2674
+ // get the title
2675
  $id = get_the_ID();
2676
  if (!isset($post)) {
2677
  $post = &get_post($id);
2678
  }
2679
  $title = trim(wp_title('', false));
2680
 
2681
+ // get the thumbnail
2682
+ $thumb = '';
2683
+ if (has_post_thumbnail($id)) {
2684
+ $thumb = preg_replace("/^.*['\"](https?:\/\/[^'\"]*)['\"].*/i","$1",get_the_post_thumbnail($id));
2685
+ } else {
2686
+ $attachments = get_children(array(
2687
+ 'post_parent' => $id ,
2688
+ 'post_type' => 'attachment' ,
2689
+ 'post_mime_type' => 'image' ,
2690
+ 'orderby' => 'menu_order' ,
2691
+ ));
2692
+ foreach ($attachments as $attachment) {
2693
+ $image_src = wp_get_attachment_image_src($attachment->ID);
2694
+ $thumb = (isset($image_src[0]) ? $image_src[0] : '');
2695
+ unset($image_src);
2696
+ break;
2697
+ }
2698
+ unset($attachments);
2699
+ }
2700
  if (empty($thumb) && preg_match_all('/<img .*src=[\'"]([^\'"]+)[\'"]/', $post->post_content, $matches, PREG_SET_ORDER)) {
2701
  $thumb = $matches[0][1];
2702
  }
2703
  unset($matches);
2704
 
2705
+ // get the excerpt
2706
  $excerpt = (
2707
  !post_password_required($post)
2708
  ? get_the_excerpt()
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, facebook, OGP
5
  Requires at least: 2.5
6
  Tested up to: 3.1
7
- Stable tag: 1.4.1.2
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
@@ -91,6 +91,9 @@ Head Cleaner Ver.1.1.5 includes 'php_browscap.ini' .
91
 
92
  == Changelog ==
93
 
 
 
 
94
  **1.4.1.1 - January 25, 2011**
95
  Fixed a bug, Canonical tag issue.
96
 
4
  Tags: head, header, footer, javascript, css, optimization, minified, performance, facebook, OGP
5
  Requires at least: 2.5
6
  Tested up to: 3.1
7
+ Stable tag: 1.4.1.3
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
91
 
92
  == Changelog ==
93
 
94
+ **1.4.1.3 - March 8, 2011**
95
+ Minor bug fixes. thx [HaRD](http://www.karuta.org/wp/ HaRD) !
96
+
97
  **1.4.1.1 - January 25, 2011**
98
  Fixed a bug, Canonical tag issue.
99
 
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.1
7
- Stable tag: 1.4.1.2
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.1
7
+ Stable tag: 1.4.1.3
8
 
9
  Head と footer をお掃除します。
10