Head Cleaner - Version 1.1.3

Version Description

Download this release

Release Info

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

Code changes from version 1.1.2 to 1.1.3

Files changed (4) hide show
  1. head-cleaner.php +14 -14
  2. readme.txt +9 -1
  3. readme_ja.txt +2 -1
  4. screenshot-2.png +0 -0
head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.1.2
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -42,19 +42,20 @@ Includes:
42
  @license http://opensource.org/licenses/gpl-license.php GNU Public License
43
  */
44
 
 
 
 
45
  //**************************************************************************************
46
  // Defines
47
  //**************************************************************************************
48
  define('HC_PRIORITY', 10000);
49
- define('HC_ANALYZE_EXPIRED', 60 * 60 * 24 * 7);
50
  define('HC_XMLNS', 'http://www.w3.org/1999/xhtml');
51
 
52
 
53
  //**************************************************************************************
54
- if (version_compare(phpversion(), "5.0.0", ">=")) :
55
-
56
  if (!defined('ABSPATH') && strstr($_SERVER['PHP_SELF'], '/head-cleaner.php')) {
57
- define('HC_EXPIRED_JS_CSS', 60 * 60 * 24 * 30);
58
  define('HC_CACHE_DIR', '/../../cache/head-cleaner');
59
 
60
  if (isset($_GET['f']) && isset($_GET['t'])) {
@@ -106,7 +107,7 @@ if (!class_exists('wokController') || !class_exists('wokScriptManager'))
106
  //**************************************************************************************
107
  class HeadCleanerController extends wokController {
108
  public $plugin_name = 'head-cleaner';
109
- public $plugin_ver = '1.1.2';
110
 
111
  // Deafault Options
112
  private $options_default = array(
@@ -1699,7 +1700,7 @@ class HeadCleanerController extends wokController {
1699
  $i = 0;
1700
  foreach ($head_filters as $priority => $filters) {
1701
  foreach ($filters as $function_name){
1702
- if (strpos($function_name, 'HeadCleanerController') === FALSE && strpos($function_name, 'noindex') === FALSE) {
1703
  $out .= "<tr>";
1704
  $out .= "<th><input type=\"checkbox\" name=\"head_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
1705
  $out .= "<th><input type=\"checkbox\" name=\"head_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
@@ -1736,7 +1737,7 @@ class HeadCleanerController extends wokController {
1736
  $i = 0;
1737
  foreach ($footer_filters as $priority => $filters) {
1738
  foreach ($filters as $function_name){
1739
- if (strpos($function_name, 'HeadCleanerController') === FALSE && strpos($function_name, 'noindex') === FALSE) {
1740
  $out .= "<tr>";
1741
  $out .= "<th><input type=\"checkbox\" name=\"foot_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
1742
  $out .= "<th><input type=\"checkbox\" name=\"foot_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
@@ -1770,7 +1771,7 @@ class HeadCleanerController extends wokController {
1770
  $out .= "</div>\n";
1771
 
1772
  // Add Update Button
1773
- $out .= "<p style=\"margin-top:1em\"><input type=\"submit\" name=\"options_update\" value=\"".__('Update Options', $this->textdomain_name)." &raquo;\" class=\"button\" /></p>";
1774
  $out .= "</form></div>\n";
1775
 
1776
  // Cache Delete
@@ -1779,7 +1780,7 @@ class HeadCleanerController extends wokController {
1779
  $out .= "<form method=\"post\" id=\"remove_cache\" action=\"".$this->admin_action."\">\n";
1780
  if ($this->wp25) $out .= $this->makeNonceField("remove_cache", "_wpnonce_remove_cache", true, false);
1781
  $out .= "<p>" . __('All cache files are removed.', $this->textdomain_name) . "</p>";
1782
- $out .= "<input type=\"submit\" name=\"remove_cache\" value=\"".__('Remove All Cache Files', $this->textdomain_name)." &raquo;\" class=\"button\" />";
1783
  $out .= "</form></div>\n";
1784
 
1785
  // Options Delete
@@ -1788,7 +1789,7 @@ class HeadCleanerController extends wokController {
1788
  $out .= "<form method=\"post\" id=\"delete_options\" action=\"".$this->admin_action."\">\n";
1789
  if ($this->wp25) $out .= $this->makeNonceField("delete_options", "_wpnonce_delete_options", true, false);
1790
  $out .= "<p>" . __('All the settings of &quot;Head Cleaner&quot; are deleted.', $this->textdomain_name) . "</p>";
1791
- $out .= "<input type=\"submit\" name=\"options_delete\" value=\"".__('Delete Options', $this->textdomain_name)." &raquo;\" class=\"button\" />";
1792
  $out .= "</form></div>\n";
1793
 
1794
  // Output
@@ -1961,15 +1962,14 @@ if (is_admin()) {
1961
  add_action('admin_menu', array(&$head_cleaner, 'admin_menu'));
1962
  add_filter('plugin_action_links', array(&$head_cleaner, 'plugin_setting_links'), 10, 2 );
1963
 
1964
- if (function_exists('register_activation_hook')) {
1965
  register_activation_hook(__FILE__, array(&$head_cleaner, 'activation'));
 
1966
  register_deactivation_hook(__FILE__, array(&$head_cleaner, 'deactivation'));
1967
- }
1968
 
1969
  } else {
1970
  add_action('get_header', array(&$head_cleaner, 'head_start'));
1971
  add_action('wp_footer', array(&$head_cleaner, 'filters_save'), 11);
1972
 
1973
  }
1974
- endif;
1975
  ?>
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.1.3
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
42
  @license http://opensource.org/licenses/gpl-license.php GNU Public License
43
  */
44
 
45
+ if (version_compare(phpversion(), "5.0.0", "<"))
46
+ return false;
47
+
48
  //**************************************************************************************
49
  // Defines
50
  //**************************************************************************************
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'])) {
107
  //**************************************************************************************
108
  class HeadCleanerController extends wokController {
109
  public $plugin_name = 'head-cleaner';
110
+ public $plugin_ver = '1.1.3';
111
 
112
  // Deafault Options
113
  private $options_default = array(
1700
  $i = 0;
1701
  foreach ($head_filters as $priority => $filters) {
1702
  foreach ($filters as $function_name){
1703
+ if ( ! preg_match('/^(HeadCleanerController::.*|noindex|lambda_[\d]+|rsd_link|wlwmanifest_link|wp_generator)$/', $function_name)) {
1704
  $out .= "<tr>";
1705
  $out .= "<th><input type=\"checkbox\" name=\"head_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
1706
  $out .= "<th><input type=\"checkbox\" name=\"head_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
1737
  $i = 0;
1738
  foreach ($footer_filters as $priority => $filters) {
1739
  foreach ($filters as $function_name){
1740
+ if ( ! preg_match('/^(HeadCleanerController|noindex|lambda_[\d]+|rsd_link|wlwmanifest_link|wp_generator)/', $function_name)) {
1741
  $out .= "<tr>";
1742
  $out .= "<th><input type=\"checkbox\" name=\"foot_filters[$i]\" value=\"$function_name\"".($priority > HC_PRIORITY ? " checked=\"true\"" : "")." /></th>";
1743
  $out .= "<th><input type=\"checkbox\" name=\"foot_remove[$i]\" value=\"$function_name\"".($priority <= 0 ? " checked=\"true\"" : "")." /></th>";
1771
  $out .= "</div>\n";
1772
 
1773
  // Add Update Button
1774
+ $out .= "<p style=\"margin-top:1em\"><input type=\"submit\" name=\"options_update\" class=\"button-primary\" value=\"".__('Update Options', $this->textdomain_name)." &raquo;\" class=\"button\" /></p>";
1775
  $out .= "</form></div>\n";
1776
 
1777
  // Cache Delete
1780
  $out .= "<form method=\"post\" id=\"remove_cache\" action=\"".$this->admin_action."\">\n";
1781
  if ($this->wp25) $out .= $this->makeNonceField("remove_cache", "_wpnonce_remove_cache", true, false);
1782
  $out .= "<p>" . __('All cache files are removed.', $this->textdomain_name) . "</p>";
1783
+ $out .= "<input type=\"submit\" name=\"remove_cache\" class=\"button-primary\" value=\"".__('Remove All Cache Files', $this->textdomain_name)." &raquo;\" class=\"button\" />";
1784
  $out .= "</form></div>\n";
1785
 
1786
  // Options Delete
1789
  $out .= "<form method=\"post\" id=\"delete_options\" action=\"".$this->admin_action."\">\n";
1790
  if ($this->wp25) $out .= $this->makeNonceField("delete_options", "_wpnonce_delete_options", true, false);
1791
  $out .= "<p>" . __('All the settings of &quot;Head Cleaner&quot; are deleted.', $this->textdomain_name) . "</p>";
1792
+ $out .= "<input type=\"submit\" name=\"options_delete\" class=\"button-primary\" value=\"".__('Delete Options', $this->textdomain_name)." &raquo;\" class=\"button\" />";
1793
  $out .= "</form></div>\n";
1794
 
1795
  // Output
1962
  add_action('admin_menu', array(&$head_cleaner, 'admin_menu'));
1963
  add_filter('plugin_action_links', array(&$head_cleaner, 'plugin_setting_links'), 10, 2 );
1964
 
1965
+ if (function_exists('register_activation_hook'))
1966
  register_activation_hook(__FILE__, array(&$head_cleaner, 'activation'));
1967
+ if (function_exists('register_deactivation_hook'))
1968
  register_deactivation_hook(__FILE__, array(&$head_cleaner, 'deactivation'));
 
1969
 
1970
  } else {
1971
  add_action('get_header', array(&$head_cleaner, 'head_start'));
1972
  add_action('wp_footer', array(&$head_cleaner, 'filters_save'), 11);
1973
 
1974
  }
 
1975
  ?>
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.2
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
@@ -36,6 +36,13 @@ To speed up the loading of JavaScript and CSS.
36
  * Prototype.js, script.aculo.us, jQuery, mootools is being loaded more than one case, one to read only once.
37
  * Prototype.js, script.aculo.us, jQuery, mootools and fix the load order to avoid possible conflicts.
38
 
 
 
 
 
 
 
 
39
  == Installation ==
40
 
41
  1. Upload the entire `head-cleaner` folder to the `/wp-content/plugins/` directory.
@@ -64,3 +71,4 @@ To activate each one, please check if any conflicts with plugins.
64
  == Screenshots ==
65
 
66
  1. The admin page
 
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.3
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
36
  * Prototype.js, script.aculo.us, jQuery, mootools is being loaded more than one case, one to read only once.
37
  * Prototype.js, script.aculo.us, jQuery, mootools and fix the load order to avoid possible conflicts.
38
 
39
+ = Localization =
40
+ "Head Cleaner" has been translated into languages. Our thanks and appreciation must go to the following for their contributions:
41
+
42
+ * Japanese (ja) - [wokamoto](http://dogmap.jp/ "wokamoto") (plugin author)
43
+
44
+ If you have translated into your language, please let me know.
45
+
46
  == Installation ==
47
 
48
  1. Upload the entire `head-cleaner` folder to the `/wp-content/plugins/` directory.
71
  == Screenshots ==
72
 
73
  1. The admin page
74
+ 2. YSlow Result
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.2
8
 
9
  Head �� footer �����|�����܂��B
10
 
@@ -77,3 +77,4 @@ Head Cleaner
77
  == Screenshots ==
78
 
79
  1. �Ǘ����
 
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.3
8
 
9
  Head �� footer �����|�����܂��B
10
 
77
  == Screenshots ==
78
 
79
  1. �Ǘ����
80
+ 2. YSlow ����
screenshot-2.png ADDED
Binary file