Head Cleaner - Version 1.4.2.4

Version Description

Download this release

Release Info

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

Code changes from version 1.4.2.3 to 1.4.2.4

head-cleaner.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
- Version: 1.4.2.3
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
@@ -74,6 +74,7 @@ class HeadCleaner extends wokController {
74
  const XMLNS_OG = 'http://ogp.me/ns#';
75
  const XMLNS_FB = 'http://www.facebook.com/2008/fbml';
76
  const IMG_BASE64_MAX_SIZE = 4096;
 
77
 
78
  // Deafault Options
79
  private $options_default = array(
@@ -148,7 +149,7 @@ class HeadCleaner extends wokController {
148
  /**********************************************************
149
  * Constructor
150
  ***********************************************************/
151
- public function __construct() {
152
  $this->init(__FILE__);
153
  $this->options = $this->_init_options($this->getOptions());
154
  $this->filters = $this->options['filters'];
@@ -221,13 +222,16 @@ class HeadCleaner extends wokController {
221
  }
222
  }
223
 
224
- // activation & deactivation
225
  if (function_exists('register_activation_hook')) {
226
  register_activation_hook(__FILE__, array(&$this, 'activation'));
227
  }
228
  if (function_exists('register_deactivation_hook')) {
229
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
230
  }
 
 
 
231
  }
232
 
233
  /**********************************************************
@@ -303,14 +307,45 @@ class HeadCleaner extends wokController {
303
  $cache_dir = $this->_create_cache_dir();
304
  if ( $cache_dir !== FALSE )
305
  $this->_create_htaccess($cache_dir);
306
- // $this->_remove_cache_file();
 
 
 
 
 
 
 
 
 
 
 
307
  }
308
 
309
  //**************************************************************************************
310
  // plugin deactivation
311
  //**************************************************************************************
312
  public function deactivation(){
313
- // $this->_remove_cache_file();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  }
315
 
316
  //**************************************************************************************
@@ -429,6 +464,7 @@ class HeadCleaner extends wokController {
429
  //**************************************************************************************
430
  public function head_cleaner($buffer) {
431
  $buffer = $this->_tag_trim($this->ob_handler($buffer));
 
432
  if (!function_exists('str_get_html')) {
433
  $ret_val = apply_filters($this->plugin_name.'/head_cleaner', $buffer);
434
  return $ret_val;
@@ -970,6 +1006,7 @@ class HeadCleaner extends wokController {
970
  // html cleaner
971
  //**************************************************************************************
972
  public function html_cleaner($content) {
 
973
  $ret_val = $this->_html_cleaner_helper($content);
974
 
975
  if(is_singular()) {
@@ -1064,6 +1101,7 @@ class HeadCleaner extends wokController {
1064
  //**************************************************************************************
1065
  public function footer_cleaner($buffer) {
1066
  $buffer = $this->_tag_trim($this->ob_handler($buffer));
 
1067
  if (!function_exists('str_get_html')) {
1068
  $ret_val = apply_filters($this->plugin_name.'/footer_cleaner', $buffer);
1069
  return $ret_val;
@@ -1236,7 +1274,7 @@ class HeadCleaner extends wokController {
1236
  // Get permalink
1237
  //**************************************************************************************
1238
  private function _get_permalink() {
1239
- $url = get_bloginfo('url');
1240
  if (! preg_match('|^(https?://[^/]*)|', $url, $host)) {
1241
  $host[1] = (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')
1242
  ? 'http://'
@@ -2579,7 +2617,7 @@ E__O__T;
2579
  //**************************************************************************************
2580
  private function _delete_settings() {
2581
  $this->deleteOptions();
2582
- $this->_remove_cache_file();
2583
  $this->options = $this->_init_options();
2584
 
2585
  return $this->options;
1
  <?php
2
  /*
3
  Plugin Name: Head Cleaner
4
+ Version: 1.4.2.4
5
  Plugin URI: http://wppluginsj.sourceforge.jp/head-cleaner/
6
  Description: Cleaning tags from your WordPress header and footer.
7
  Author: wokamoto
74
  const XMLNS_OG = 'http://ogp.me/ns#';
75
  const XMLNS_FB = 'http://www.facebook.com/2008/fbml';
76
  const IMG_BASE64_MAX_SIZE = 4096;
77
+ const OPTION_SAVE_FILE = FALSE;
78
 
79
  // Deafault Options
80
  private $options_default = array(
149
  /**********************************************************
150
  * Constructor
151
  ***********************************************************/
152
+ function __construct() {
153
  $this->init(__FILE__);
154
  $this->options = $this->_init_options($this->getOptions());
155
  $this->filters = $this->options['filters'];
222
  }
223
  }
224
 
225
+ // activation & deactivation & uninstall
226
  if (function_exists('register_activation_hook')) {
227
  register_activation_hook(__FILE__, array(&$this, 'activation'));
228
  }
229
  if (function_exists('register_deactivation_hook')) {
230
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
231
  }
232
+ if ( function_exists('register_uninstall_hook') ) {
233
+ register_uninstall_hook(__FILE__, array(&$this, 'uninstall'));
234
+ }
235
  }
236
 
237
  /**********************************************************
307
  $cache_dir = $this->_create_cache_dir();
308
  if ( $cache_dir !== FALSE )
309
  $this->_create_htaccess($cache_dir);
310
+
311
+ if (self::OPTION_SAVE_FILE !== FALSE) {
312
+ $option_file = dirname(__FILE__) . '/' . self::OPTION_SAVE_FILE;
313
+ if ( file_exists($option_file) ) {
314
+ $wk_options = unserialize(file_get_contents($option_file));
315
+ if ( $wk_options != $this->options ) {
316
+ $this->options = $wk_options;
317
+ $this->updateOptions();
318
+ @unlink($option_file);
319
+ }
320
+ }
321
+ }
322
  }
323
 
324
  //**************************************************************************************
325
  // plugin deactivation
326
  //**************************************************************************************
327
  public function deactivation(){
328
+ if (self::OPTION_SAVE_FILE !== FALSE) {
329
+ $wk_options = serialize($this->options);
330
+ $option_file = dirname(__FILE__) . '/' . self::OPTION_SAVE_FILE;
331
+ if ( file_put_contents( $option_file, $wk_options ) && file_exists($option_file) ) {
332
+ $this->_delete_settings();
333
+ }
334
+ }
335
+ }
336
+
337
+ //**************************************************************************************
338
+ // plugin uninstall
339
+ //**************************************************************************************
340
+ public function uninstall(){
341
+ $this->_delete_settings();
342
+ $this->_remove_cache_file();
343
+ if (self::OPTION_SAVE_FILE !== FALSE) {
344
+ $option_file = dirname(__FILE__) . '/' . self::OPTION_SAVE_FILE;
345
+ if ( file_exists($option_file) ) {
346
+ @unlink($option_file);
347
+ }
348
+ }
349
  }
350
 
351
  //**************************************************************************************
464
  //**************************************************************************************
465
  public function head_cleaner($buffer) {
466
  $buffer = $this->_tag_trim($this->ob_handler($buffer));
467
+ $buffer = apply_filters($this->plugin_name.'/pre_head_cleaner', $buffer);
468
  if (!function_exists('str_get_html')) {
469
  $ret_val = apply_filters($this->plugin_name.'/head_cleaner', $buffer);
470
  return $ret_val;
1006
  // html cleaner
1007
  //**************************************************************************************
1008
  public function html_cleaner($content) {
1009
+ $content = apply_filters($this->plugin_name.'/pre_html_cleaner', $content);
1010
  $ret_val = $this->_html_cleaner_helper($content);
1011
 
1012
  if(is_singular()) {
1101
  //**************************************************************************************
1102
  public function footer_cleaner($buffer) {
1103
  $buffer = $this->_tag_trim($this->ob_handler($buffer));
1104
+ $buffer = apply_filters($this->plugin_name.'/pre_footer_cleaner', $buffer);
1105
  if (!function_exists('str_get_html')) {
1106
  $ret_val = apply_filters($this->plugin_name.'/footer_cleaner', $buffer);
1107
  return $ret_val;
1274
  // Get permalink
1275
  //**************************************************************************************
1276
  private function _get_permalink() {
1277
+ $url = get_option('home');
1278
  if (! preg_match('|^(https?://[^/]*)|', $url, $host)) {
1279
  $host[1] = (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off')
1280
  ? 'http://'
2617
  //**************************************************************************************
2618
  private function _delete_settings() {
2619
  $this->deleteOptions();
2620
+ //$this->_remove_cache_file();
2621
  $this->options = $this->_init_options();
2622
 
2623
  return $this->options;
languages/head-cleaner-bg_BG.mo ADDED
Binary file
languages/head-cleaner-bg_BG.po ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Head Cleaner\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-03-09 17:56+0900\n"
6
+ "PO-Revision-Date: 2011-08-23 11:04+0200\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: Dimitar Kolevski <dimitar.kolevski@mail.bg>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Bulgarian\n"
13
+ "X-Poedit-Country: BULGARIA\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ # description
20
+ msgid "Cleaning tags from your WordPress header and footer."
21
+ msgstr "Почистване на тагове от вашия WordPress хедър и футър."
22
+
23
+ #: ../head-cleaner.php:1405
24
+ msgid "Head Cleaner"
25
+ msgstr "Head Cleaner"
26
+
27
+ #: ../head-cleaner.php:1414
28
+ #: ../includes/common-controller.php:166
29
+ msgid "Settings"
30
+ msgstr "Настройки"
31
+
32
+ #: ../head-cleaner.php:1501
33
+ #: ../head-cleaner.php:1511
34
+ #: ../head-cleaner.php:1521
35
+ msgid "Done!"
36
+ msgstr "Готово!"
37
+
38
+ #: ../head-cleaner.php:1533
39
+ msgid "Head Cleaner Options"
40
+ msgstr "Опции за ръководител Cleaner"
41
+
42
+ #: ../head-cleaner.php:1541
43
+ msgid "CSS and JavaScript are cached on the server."
44
+ msgstr "CSS и JavaScript са кеширани на сървъра."
45
+
46
+ #: ../head-cleaner.php:1545
47
+ msgid "Put JavaScripts at the Bottom."
48
+ msgstr "Поставете JavaScripts на дъното."
49
+
50
+ #: ../head-cleaner.php:1549
51
+ msgid "CSS and JS are dynamically generated."
52
+ msgstr "CSS и JS се генерират динамично."
53
+
54
+ #: ../head-cleaner.php:1557
55
+ msgid "Two or more CSS is combined."
56
+ msgstr "Две или повече CSS е комбиниран."
57
+
58
+ #: ../head-cleaner.php:1561
59
+ msgid "CSS is optimized."
60
+ msgstr "CSS е оптимизирана."
61
+
62
+ #: ../head-cleaner.php:1564
63
+ msgid "Default media attribute applied to CSS."
64
+ msgstr "Медии по подразбиране атрибут прилага за CSS."
65
+
66
+ #: ../head-cleaner.php:1573
67
+ msgid "Two or more JavaScript is combined."
68
+ msgstr "Две или повече JavaScript е комбиниран."
69
+
70
+ #: ../head-cleaner.php:1577
71
+ msgid "JavaScript is minified."
72
+ msgstr "JavaScript е minified."
73
+
74
+ #: ../head-cleaner.php:1581
75
+ msgid "Bottom JavaScript is combined, too."
76
+ msgstr "Bottom JavaScript се комбинира също."
77
+
78
+ #: ../head-cleaner.php:1589
79
+ msgid "Remove generator tag."
80
+ msgstr "Извадете генератор маркер."
81
+
82
+ #: ../head-cleaner.php:1593
83
+ msgid "Remove RSD link tag."
84
+ msgstr "Извадете RSD тагове връзка."
85
+
86
+ #: ../head-cleaner.php:1597
87
+ msgid "Remove wlwmanifest link tag."
88
+ msgstr "Извадете wlwmanifest тагове връзка."
89
+
90
+ #: ../head-cleaner.php:1604
91
+ msgid "Debug mode"
92
+ msgstr "Debug режим"
93
+
94
+ #: ../head-cleaner.php:1617
95
+ msgid "The CSS optimization settings"
96
+ msgstr "В настройките за оптимизация на CSS"
97
+
98
+ #: ../head-cleaner.php:1619
99
+ msgid "Compression (code layout):"
100
+ msgstr "Компресия (код оформление):"
101
+
102
+ #: ../head-cleaner.php:1621
103
+ msgid "Highest (no readability, smallest size)"
104
+ msgstr "Най-висок (не четивността, най-малкия размер)"
105
+
106
+ #: ../head-cleaner.php:1622
107
+ msgid "High (moderate readability, smaller size)"
108
+ msgstr "High (умерена четивността, по-малък размер)"
109
+
110
+ #: ../head-cleaner.php:1623
111
+ msgid "Standard (balance between readability and size)"
112
+ msgstr "Стандарт (баланс между четивността и размер)"
113
+
114
+ #: ../head-cleaner.php:1624
115
+ msgid "Low (higher readability)"
116
+ msgstr "Low (по-висока четимост)"
117
+
118
+ #: ../head-cleaner.php:1627
119
+ msgid "Optimise shorthands"
120
+ msgstr "Оптимизирайте съкращения"
121
+
122
+ #: ../head-cleaner.php:1629
123
+ msgid "All optimisations"
124
+ msgstr "Всички оптимизации"
125
+
126
+ #: ../head-cleaner.php:1630
127
+ msgid "Safe optimisations"
128
+ msgstr "Safe оптимизации"
129
+
130
+ #: ../head-cleaner.php:1631
131
+ msgid "Don't optimise"
132
+ msgstr "Да не се оптимизира"
133
+
134
+ #: ../head-cleaner.php:1636
135
+ msgid "Compress colors"
136
+ msgstr "Компресиране цветове"
137
+
138
+ #: ../head-cleaner.php:1639
139
+ msgid "Compress font-weight"
140
+ msgstr "Компресиране на шрифта тегло"
141
+
142
+ #: ../head-cleaner.php:1642
143
+ msgid "Remove unnecessary backslashes"
144
+ msgstr "Премахване на ненужни обратно наклонена черта"
145
+
146
+ #: ../head-cleaner.php:1650
147
+ msgid "Active JavaScripts"
148
+ msgstr "Active JavaScripts"
149
+
150
+ #: ../head-cleaner.php:1653
151
+ msgid "Move to footer"
152
+ msgstr "Преместване към долния"
153
+
154
+ #: ../head-cleaner.php:1654
155
+ msgid "JavaScripts"
156
+ msgstr "JavaScripts"
157
+
158
+ #: ../head-cleaner.php:1666
159
+ msgid "Active Filters"
160
+ msgstr "активни филтри"
161
+
162
+ #: ../head-cleaner.php:1669
163
+ #: ../head-cleaner.php:1706
164
+ msgid "Don't process!"
165
+ msgstr "Не процес!"
166
+
167
+ #: ../head-cleaner.php:1670
168
+ #: ../head-cleaner.php:1707
169
+ msgid "Remove"
170
+ msgstr "Премахване"
171
+
172
+ #: ../head-cleaner.php:1671
173
+ msgid "Head filters"
174
+ msgstr "ръководител филтри"
175
+
176
+ #: ../head-cleaner.php:1673
177
+ #: ../head-cleaner.php:1710
178
+ msgid "Priority"
179
+ msgstr "приоритет"
180
+
181
+ #: ../head-cleaner.php:1708
182
+ msgid "Bottom filters"
183
+ msgstr "Bottom филтри"
184
+
185
+ #: ../head-cleaner.php:1744
186
+ msgid "Update Options"
187
+ msgstr "Актуализация Опции"
188
+
189
+ #: ../head-cleaner.php:1749
190
+ msgid "Remove all cache files"
191
+ msgstr "Премахване на всички кеш файлове"
192
+
193
+ #: ../head-cleaner.php:1752
194
+ msgid "All cache files are removed."
195
+ msgstr "Всички кеш файлове са отстранени."
196
+
197
+ #: ../head-cleaner.php:1753
198
+ msgid "Remove All Cache Files"
199
+ msgstr "Премахване на всички кеш файлове"
200
+
201
+ #: ../head-cleaner.php:1758
202
+ msgid "Uninstall"
203
+ msgstr "Uninstall"
204
+
205
+ #: ../head-cleaner.php:1761
206
+ msgid "All the settings of &quot;Head Cleaner&quot; are deleted."
207
+ msgstr "Всички настройки на \"Head Cleaner\" се заличават."
208
+
209
+ #: ../head-cleaner.php:1762
210
+ msgid "Delete Options"
211
+ msgstr "Изтрий опции"
212
+
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Head Cleaner ===
2
- 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, facebook, OGP
5
  Requires at least: 2.5
6
- Tested up to: 3.2-beta2
7
- Stable tag: 1.4.2.3
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
@@ -41,6 +41,7 @@ To speed up the loading of JavaScript and CSS.
41
  "Head Cleaner" has been translated into languages. Our thanks and appreciation must go to the following for their contributions:
42
 
43
  * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
 
44
  * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
45
  * German (de) - Carsten
46
  * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)
1
  === Head Cleaner ===
2
+ Contributors: wokamoto, megumithemes, Webnist, tai
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, facebook, OGP
5
  Requires at least: 2.5
6
+ Tested up to: 3.2.1
7
+ Stable tag: 1.4.2.4
8
 
9
  Cleaning tags from your WordPress header and footer.
10
 
41
  "Head Cleaner" has been translated into languages. Our thanks and appreciation must go to the following for their contributions:
42
 
43
  * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
44
+ * Bulgarian (bg_BG) - [Web Geek](http://webhostinggeeks.com/ "Web Geek")
45
  * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
46
  * German (de) - Carsten
47
  * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)
readme_ja.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Head Cleaner ===
2
- 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.2-beta2
7
- Stable tag: 1.4.2.3
8
 
9
  Head と footer をお掃除します。
10
 
@@ -38,6 +38,7 @@ WordPress サイトの `<head>` の中身と、フッタ領域を整形しなお
38
  "Head Cleaner" を各国語に翻訳してくださった方々に感謝を込めて。
39
 
40
  * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
 
41
  * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
42
  * German (de) - Carsten
43
  * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)
1
  === Head Cleaner ===
2
+ Contributors: wokamoto, megumithemes, Webnist, tai
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.2.1
7
+ Stable tag: 1.4.2.4
8
 
9
  Head と footer をお掃除します。
10
 
38
  "Head Cleaner" を各国語に翻訳してくださった方々に感謝を込めて。
39
 
40
  * Belorussian (by) - [Marcis Gasuns](http://www.comfi.com/ "Marcis Gasuns")
41
+ * Bulgarian (bg_BG) - [Web Geek](http://webhostinggeeks.com/ "Web Geek")
42
  * Dutch (nl_NL) - [Rene](http://wpwebshop.com/blog "WPWebshop Blog")
43
  * German (de) - Carsten
44
  * Japanese (ja) - [OKAMOTO Wataru](http://dogmap.jp/ "dogmap.jp") (plugin author)