Apptrian_Minify_HTML_CSS_JS - Version 1.5.0

Version Notes

+ Minification of script tags type="text/template"
* Compatibility with SUPEE-6788 patch

Download this release

Release Info

Developer Apptrian
Extension Apptrian_Minify_HTML_CSS_JS
Version 1.5.0
Comparing to
See all releases


Code changes from version 1.4.0 to 1.5.0

app/code/community/Apptrian/Minify/Block/Adminhtml/Button/Minify.php CHANGED
@@ -26,7 +26,7 @@ class Apptrian_Minify_Block_Adminhtml_Button_Minify extends Mage_Adminhtml_Block
26
  }
27
 
28
  $url = Mage::helper('adminhtml')->getUrl(
29
- 'apptrian_minify/adminhtml_minify/process');
30
 
31
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
32
  ->setType('button')
26
  }
27
 
28
  $url = Mage::helper('adminhtml')->getUrl(
29
+ 'adminhtml/apptrian_minify/process');
30
 
31
  $html = $this->getLayout()->createBlock('adminhtml/widget_button')
32
  ->setType('button')
app/code/community/Apptrian/Minify/controllers/Adminhtml/{MinifyController.php → Apptrian/MinifyController.php} RENAMED
@@ -6,7 +6,7 @@
6
  * @copyright Copyright (c) 2015 Apptrian (http://www.apptrian.com)
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
- class Apptrian_Minify_Adminhtml_MinifyController extends Mage_Adminhtml_Controller_Action
10
  {
11
 
12
  public function processAction()
6
  * @copyright Copyright (c) 2015 Apptrian (http://www.apptrian.com)
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
+ class Apptrian_Minify_Adminhtml_Apptrian_MinifyController extends Mage_Adminhtml_Controller_Action
10
  {
11
 
12
  public function processAction()
app/code/community/Apptrian/Minify/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <Apptrian_Minify>
14
- <version>1.4.0</version>
15
  </Apptrian_Minify>
16
  </modules>
17
  <global>
@@ -75,13 +75,13 @@
75
  </frontend>
76
  <admin>
77
  <routers>
78
- <apptrian_minify>
79
- <use>admin</use>
80
  <args>
81
- <module>Apptrian_Minify</module>
82
- <frontName>apptrian_minify</frontName>
 
83
  </args>
84
- </apptrian_minify>
85
  </routers>
86
  </admin>
87
  <adminhtml>
11
  <config>
12
  <modules>
13
  <Apptrian_Minify>
14
+ <version>1.5.0</version>
15
  </Apptrian_Minify>
16
  </modules>
17
  <global>
75
  </frontend>
76
  <admin>
77
  <routers>
78
+ <adminhtml>
 
79
  <args>
80
+ <modules>
81
+ <apptrian_minify after="Mage_Adminhtml">Apptrian_Minify_Adminhtml</apptrian_minify>
82
+ </modules>
83
  </args>
84
+ </adminhtml>
85
  </routers>
86
  </admin>
87
  <adminhtml>
lib/Minify/HTML.php CHANGED
@@ -229,11 +229,20 @@ class Minify_HTML {
229
  // remove CDATA section markers
230
  $js = $this->_removeCdata($js);
231
 
232
- // minify
233
- $minifier = $this->_jsMinifier
234
- ? $this->_jsMinifier
235
- : 'trim';
236
- $js = call_user_func($minifier, $js);
 
 
 
 
 
 
 
 
 
237
 
238
  return $this->_reservePlace($this->_needsCdata($js)
239
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
229
  // remove CDATA section markers
230
  $js = $this->_removeCdata($js);
231
 
232
+ if (false !== stripos($openScript, '<script type="text/template"')) {
233
+
234
+ // minify
235
+ $js = Minify_HTML::minify($js);
236
+
237
+ } else {
238
+
239
+ // minify
240
+ $minifier = $this->_jsMinifier
241
+ ? $this->_jsMinifier
242
+ : 'trim';
243
+ $js = call_user_func($minifier, $js);
244
+
245
+ }
246
 
247
  return $this->_reservePlace($this->_needsCdata($js)
248
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
lib/Minify/HTMLComp.php CHANGED
@@ -239,11 +239,20 @@ class Minify_HTMLComp {
239
  // remove CDATA section markers
240
  $js = $this->_removeCdata($js);
241
 
242
- // minify
243
- $minifier = $this->_jsMinifier
244
- ? $this->_jsMinifier
245
- : 'trim';
246
- $js = call_user_func($minifier, $js);
 
 
 
 
 
 
 
 
 
247
 
248
  return $this->_reservePlace($this->_needsCdata($js)
249
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
239
  // remove CDATA section markers
240
  $js = $this->_removeCdata($js);
241
 
242
+ if (false !== stripos($openScript, '<script type="text/template"')) {
243
+
244
+ // minify
245
+ $js = Minify_HTMLComp::minify($js);
246
+
247
+ } else {
248
+
249
+ // minify
250
+ $minifier = $this->_jsMinifier
251
+ ? $this->_jsMinifier
252
+ : 'trim';
253
+ $js = call_user_func($minifier, $js);
254
+
255
+ }
256
 
257
  return $this->_reservePlace($this->_needsCdata($js)
258
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
lib/Minify/HTMLMax.php CHANGED
@@ -242,11 +242,20 @@ class Minify_HTMLMax {
242
  // remove CDATA section markers
243
  $js = $this->_removeCdata($js);
244
 
245
- // minify
246
- $minifier = $this->_jsMinifier
247
- ? $this->_jsMinifier
248
- : 'trim';
249
- $js = call_user_func($minifier, $js);
 
 
 
 
 
 
 
 
 
250
 
251
  return $this->_reservePlace($this->_needsCdata($js)
252
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
242
  // remove CDATA section markers
243
  $js = $this->_removeCdata($js);
244
 
245
+ if (false !== stripos($openScript, '<script type="text/template"')) {
246
+
247
+ // minify
248
+ $js = Minify_HTMLMax::minify($js);
249
+
250
+ } else {
251
+
252
+ // minify
253
+ $minifier = $this->_jsMinifier
254
+ ? $this->_jsMinifier
255
+ : 'trim';
256
+ $js = call_user_func($minifier, $js);
257
+
258
+ }
259
 
260
  return $this->_reservePlace($this->_needsCdata($js)
261
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
lib/Minify/HTMLMaxComp.php CHANGED
@@ -242,11 +242,20 @@ class Minify_HTMLMaxComp {
242
  // remove CDATA section markers
243
  $js = $this->_removeCdata($js);
244
 
245
- // minify
246
- $minifier = $this->_jsMinifier
247
- ? $this->_jsMinifier
248
- : 'trim';
249
- $js = call_user_func($minifier, $js);
 
 
 
 
 
 
 
 
 
250
 
251
  return $this->_reservePlace($this->_needsCdata($js)
252
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
242
  // remove CDATA section markers
243
  $js = $this->_removeCdata($js);
244
 
245
+ if (false !== stripos($openScript, '<script type="text/template"')) {
246
+
247
+ // minify
248
+ $js = Minify_HTMLMaxComp::minify($js);
249
+
250
+ } else {
251
+
252
+ // minify
253
+ $minifier = $this->_jsMinifier
254
+ ? $this->_jsMinifier
255
+ : 'trim';
256
+ $js = call_user_func($minifier, $js);
257
+
258
+ }
259
 
260
  return $this->_reservePlace($this->_needsCdata($js)
261
  ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
package.xml CHANGED
@@ -1,19 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Apptrian_Minify_HTML_CSS_JS</name>
4
- <version>1.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Minify HTML CSS JS including inline CSS/JS and speed up your site. Works with default Magento CSS/JS merger.</summary>
10
  <description>Apptrian Minify HTML CSS JS is a very small and efficient extension. It will minify HTML including inline CSS and JS code. Minification of CSS and JS files is compatible with default Magento CSS and JS file merger. There are no complex setups nor query strings on minified CSS and JS files. Extension is very easy to install and use. Compatible with FPC and Varnish cache extensions.</description>
11
- <notes>+ Added option for removing important comments&#xD;
12
- * Improved extension configuration</notes>
13
  <authors><author><name>Apptrian</name><user>apptrian</user><email>apptrian@yahoo.com</email></author></authors>
14
- <date>2015-06-21</date>
15
- <time>15:38:30</time>
16
- <contents><target name="magecommunity"><dir name="Apptrian"><dir name="Minify"><dir name="Block"><file name="About.php" hash="55714f78c451f529f64261efc28ba407"/><dir name="Adminhtml"><dir name="Button"><file name="Minify.php" hash="4d16be7cfa93b9eba7da21108747e38d"/></dir></dir><file name="Info.php" hash="d967c088301c8e90ada86e8fd8d009bd"/></dir><dir name="Helper"><file name="Data.php" hash="658da016ad02230dc1333b653274be01"/></dir><dir name="Model"><file name="Cron.php" hash="deb94ca0e0d4fc84e7f3b8ec93270e1e"/><file name="Observer.php" hash="34114a1af8a5dded1cd62e3c77ba069b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MinifyController.php" hash="3554f1ef8be979bc2170635485d613ba"/></dir></dir><dir name="etc"><file name="config.xml" hash="2a9b2a91b48b1c4c2c24bd7e0041e9ee"/><file name="system.xml" hash="611feb105fa72eb38cc9a772c7c657e6"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Apptrian_Minify.xml" hash="93ef03671067cf44a0b02f0100c8d2d0"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Apptrian_Minify.csv" hash="694d5a244eeaaa7293520581b82ffcf7"/></dir></target><target name="magelib"><dir name="HTTP"><file name="ConditionalGet.php" hash="84d5f4e0b97e37228310a31a4bdc1240"/><file name="Encoder.php" hash="d697f04651d6363d1dd5dd8c2ce94cbd"/></dir><dir name="Minify"><file name="Build.php" hash="99800ab664e1fb0ff46a7133ab13bb1b"/><dir name="CSS"><file name="Compressor.php" hash="6f1d5d8c3f7ac47cabaca9d6ee923206"/><file name="UriRewriter.php" hash="d6c800c1b9b0603c3386f84074bc41a0"/></dir><file name="CSS.php" hash="c585f82e0a6f8af12da2d3337aa7e901"/><file name="CSSmin.php" hash="7e0549e63f49b99aac0f6688bfcf99ef"/><dir name="Cache"><file name="APC.php" hash="f83c096f1ea3eb712bf020371b7d3755"/><file name="File.php" hash="5550b7ad5d3cc20710a0835fdf20e3ec"/><file name="Memcache.php" hash="a572e300270f5cdb535de67eb1d9ce3b"/><file name="WinCache.php" hash="037003b972c8f648880b43b2c912afb7"/><file name="XCache.php" hash="a3239040e672955a8a520eef6e251d68"/><file name="ZendPlatform.php" hash="a20755bc554cfef6733ac64574c4f90e"/></dir><file name="ClosureCompiler.php" hash="0d04a74dae339bd8d2d0465503590819"/><file name="CommentPreserver.php" hash="f9fbae74aea3125d25f375942846d9c0"/><dir name="Controller"><file name="Base.php" hash="756cd27141da15f6bc0a9d34960e0338"/><file name="Files.php" hash="a0bc419aa48d256e19a64596dee53991"/><file name="Groups.php" hash="bf35ccd3d384c40033b978a402eaf917"/><file name="MinApp.php" hash="0910bc4af5280098b8411a8a23aa3e91"/><file name="Page.php" hash="c54a4b19474f9d0e9beb8ccb4e3678b3"/><file name="Version1.php" hash="0e4bce53a0b66c79aa6d15e52cf8ec50"/></dir><file name="DebugDetector.php" hash="d1bee7f6ab4dcf7be5d36dbcd1b81354"/><dir name="HTML"><file name="Helper.php" hash="af89e2e30f70dd935dd86d31649159e6"/></dir><file name="HTML.php" hash="d48eabaae177099a264b5a97379b0abf"/><file name="HTMLComp.php" hash="a2929a26f75e6877fd5f58e6fdc5f2d0"/><file name="HTMLMax.php" hash="63b191db9ce4b878809c33e5cc74323e"/><file name="HTMLMaxComp.php" hash="c6c76d9106d38c3a3fcd7c4ae4ff571a"/><file name="ImportProcessor.php" hash="075c561afa4825021fa44c3cac68ab94"/><dir name="JS"><file name="ClosureCompiler.php" hash="0d6d0017c3b9decdf0e1f647c0b53f17"/></dir><file name="Lines.php" hash="526499d43d682432dac9483da4509179"/><file name="Loader.php" hash="5e84b0e739587d8df742f47953f135d5"/><file name="Logger.php" hash="ee493543ebb47aa06f976f23a0f3d86a"/><file name="Packer.php" hash="e91f63a82c4fbd660c2341163e87dd4b"/><file name="Source.php" hash="f7055f963f00e5ae9f5b0005d5e4a5ec"/><dir name="YUI"><file name="CssCompressor.java" hash="cb15a586f2dcc4fead535bc982e3f91e"/><file name="CssCompressor.php" hash="12d5b4e38488c68bc84cc0efba6eb338"/></dir><file name="YUICompressor.php" hash="3ada081677d0cf118bba1f4b533b97cf"/></dir><dir name="."><file name="CSSmin.php" hash="b88ddd36d0ff681aa8a221467c0c71c1"/><file name="DooDigestAuth.php" hash="9d66abc8cfa37b5f593fc09c734f0269"/><file name="FirePHP.php" hash="f619b5a77fee4b21e4397e98d858fbf4"/><file name="JavaScriptPacker.php" hash="84900da372a375d3b2f117c5abe740a9"/><file name="JSMin.php" hash="63ada69cc753fe4136c67e1d3daabca3"/><file name="JSMinMax.php" hash="2fed0d2f38ae28220da56216ec2fe38f"/><file name="JSMinPlus.php" hash="13d47b54dd73ef825e5d86e6cc633e32"/><file name="Minify.php" hash="df50518e69c132b1354eb8ba73a8ed7c"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Apptrian_Minify_HTML_CSS_JS</name>
4
+ <version>1.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Minify HTML CSS JS including inline CSS/JS and speed up your site. Works with default Magento CSS/JS merger.</summary>
10
  <description>Apptrian Minify HTML CSS JS is a very small and efficient extension. It will minify HTML including inline CSS and JS code. Minification of CSS and JS files is compatible with default Magento CSS and JS file merger. There are no complex setups nor query strings on minified CSS and JS files. Extension is very easy to install and use. Compatible with FPC and Varnish cache extensions.</description>
11
+ <notes>+ Minification of script tags type="text/template"&#xD;
12
+ * Compatibility with SUPEE-6788 patch</notes>
13
  <authors><author><name>Apptrian</name><user>apptrian</user><email>apptrian@yahoo.com</email></author></authors>
14
+ <date>2015-11-09</date>
15
+ <time>14:17:27</time>
16
+ <contents><target name="magecommunity"><dir name="Apptrian"><dir name="Minify"><dir name="Block"><file name="About.php" hash="55714f78c451f529f64261efc28ba407"/><dir name="Adminhtml"><dir name="Button"><file name="Minify.php" hash="966704bb8cc4a2b5d109f242c01cc5d4"/></dir></dir><file name="Info.php" hash="d967c088301c8e90ada86e8fd8d009bd"/></dir><dir name="Helper"><file name="Data.php" hash="658da016ad02230dc1333b653274be01"/></dir><dir name="Model"><file name="Cron.php" hash="deb94ca0e0d4fc84e7f3b8ec93270e1e"/><file name="Observer.php" hash="34114a1af8a5dded1cd62e3c77ba069b"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Apptrian"><file name="MinifyController.php" hash="8a909223b5275465acd302f342da78eb"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="246256177d441c79bb349c4caeb9c767"/><file name="system.xml" hash="611feb105fa72eb38cc9a772c7c657e6"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Apptrian_Minify.xml" hash="93ef03671067cf44a0b02f0100c8d2d0"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Apptrian_Minify.csv" hash="694d5a244eeaaa7293520581b82ffcf7"/></dir></target><target name="magelib"><dir name="HTTP"><file name="ConditionalGet.php" hash="84d5f4e0b97e37228310a31a4bdc1240"/><file name="Encoder.php" hash="d697f04651d6363d1dd5dd8c2ce94cbd"/></dir><dir name="Minify"><file name="Build.php" hash="99800ab664e1fb0ff46a7133ab13bb1b"/><dir name="CSS"><file name="Compressor.php" hash="6f1d5d8c3f7ac47cabaca9d6ee923206"/><file name="UriRewriter.php" hash="d6c800c1b9b0603c3386f84074bc41a0"/></dir><file name="CSS.php" hash="c585f82e0a6f8af12da2d3337aa7e901"/><file name="CSSmin.php" hash="7e0549e63f49b99aac0f6688bfcf99ef"/><dir name="Cache"><file name="APC.php" hash="f83c096f1ea3eb712bf020371b7d3755"/><file name="File.php" hash="5550b7ad5d3cc20710a0835fdf20e3ec"/><file name="Memcache.php" hash="a572e300270f5cdb535de67eb1d9ce3b"/><file name="WinCache.php" hash="037003b972c8f648880b43b2c912afb7"/><file name="XCache.php" hash="a3239040e672955a8a520eef6e251d68"/><file name="ZendPlatform.php" hash="a20755bc554cfef6733ac64574c4f90e"/></dir><file name="ClosureCompiler.php" hash="0d04a74dae339bd8d2d0465503590819"/><file name="CommentPreserver.php" hash="f9fbae74aea3125d25f375942846d9c0"/><dir name="Controller"><file name="Base.php" hash="756cd27141da15f6bc0a9d34960e0338"/><file name="Files.php" hash="a0bc419aa48d256e19a64596dee53991"/><file name="Groups.php" hash="bf35ccd3d384c40033b978a402eaf917"/><file name="MinApp.php" hash="0910bc4af5280098b8411a8a23aa3e91"/><file name="Page.php" hash="c54a4b19474f9d0e9beb8ccb4e3678b3"/><file name="Version1.php" hash="0e4bce53a0b66c79aa6d15e52cf8ec50"/></dir><file name="DebugDetector.php" hash="d1bee7f6ab4dcf7be5d36dbcd1b81354"/><dir name="HTML"><file name="Helper.php" hash="af89e2e30f70dd935dd86d31649159e6"/></dir><file name="HTML.php" hash="35190e3378ff263774eb9cf975de22f0"/><file name="HTMLComp.php" hash="4435690b51daba79b367b57ffb930aa5"/><file name="HTMLMax.php" hash="355bd23860d3856bed6242c59b69fa19"/><file name="HTMLMaxComp.php" hash="2335b33c4014ae96046deb41ff1e17e2"/><file name="ImportProcessor.php" hash="075c561afa4825021fa44c3cac68ab94"/><dir name="JS"><file name="ClosureCompiler.php" hash="0d6d0017c3b9decdf0e1f647c0b53f17"/></dir><file name="Lines.php" hash="526499d43d682432dac9483da4509179"/><file name="Loader.php" hash="5e84b0e739587d8df742f47953f135d5"/><file name="Logger.php" hash="ee493543ebb47aa06f976f23a0f3d86a"/><file name="Packer.php" hash="e91f63a82c4fbd660c2341163e87dd4b"/><file name="Source.php" hash="f7055f963f00e5ae9f5b0005d5e4a5ec"/><dir name="YUI"><file name="CssCompressor.java" hash="cb15a586f2dcc4fead535bc982e3f91e"/><file name="CssCompressor.php" hash="12d5b4e38488c68bc84cc0efba6eb338"/></dir><file name="YUICompressor.php" hash="3ada081677d0cf118bba1f4b533b97cf"/></dir><dir name="."><file name="CSSmin.php" hash="b88ddd36d0ff681aa8a221467c0c71c1"/><file name="DooDigestAuth.php" hash="9d66abc8cfa37b5f593fc09c734f0269"/><file name="FirePHP.php" hash="f619b5a77fee4b21e4397e98d858fbf4"/><file name="JavaScriptPacker.php" hash="84900da372a375d3b2f117c5abe740a9"/><file name="JSMin.php" hash="63ada69cc753fe4136c67e1d3daabca3"/><file name="JSMinMax.php" hash="2fed0d2f38ae28220da56216ec2fe38f"/><file name="JSMinPlus.php" hash="13d47b54dd73ef825e5d86e6cc633e32"/><file name="Minify.php" hash="df50518e69c132b1354eb8ba73a8ed7c"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>