Kraken_Image_Optimizer - Version 2.0.5

Version Notes

Fixed bugs with file extensions and missing quota_used properties

Download this release

Release Info

Developer Nekkra UG
Extension Kraken_Image_Optimizer
Version 2.0.5
Comparing to
See all releases


Code changes from version 2.0.4 to 2.0.5

app/code/local/Welance/Kraken/Helper/Data.php CHANGED
@@ -91,15 +91,15 @@ class Welance_Kraken_Helper_Data extends Mage_Core_Helper_Abstract
91
  continue;
92
  }
93
 
94
- // SplFileInfo::getExtension NOT supported < 5.3.6
95
- if (method_exists('SplFileInfo', 'getExtension')) {
96
- if (!in_array($object->getExtension(),$imageTypes)) {
97
- continue;
98
- }
99
- } else {
100
- if (!in_array(pathinfo($imageName, PATHINFO_EXTENSION),$imageTypes)) {
101
- continue;
102
- }
103
  }
104
 
105
  $checksum = sha1_file($fullpath);
91
  continue;
92
  }
93
 
94
+ // SplFileInfo::getExtension NOT supported < 5.3.6
95
+ if (method_exists('SplFileInfo', 'getExtension')) {
96
+ if (!in_array(strtolower($object->getExtension()),$imageTypes)) {
97
+ continue;
98
+ }
99
+ } else {
100
+ if (!in_array(strtolower(pathinfo($imageName, PATHINFO_EXTENSION)),$imageTypes)) {
101
+ continue;
102
+ }
103
  }
104
 
105
  $checksum = sha1_file($fullpath);
app/code/local/Welance/Kraken/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Welance_Kraken>
5
- <version>2.0.3</version>
6
  </Welance_Kraken>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Welance_Kraken>
5
+ <version>2.0.5</version>
6
  </Welance_Kraken>
7
  </modules>
8
  <global>
app/design/adminhtml/default/default/template/kraken/statistics.phtml CHANGED
@@ -12,22 +12,30 @@
12
  <h3>Kraken.io Account</h3>
13
  <div class="kraken-inner">
14
  <?php if ($response->success == true): ?>
15
- <div class="kraken-box">
16
- Plan level
17
- <strong><?php echo $response->plan_name ?></strong>
18
- </div>
19
- <div class="kraken-box">
20
- Monthly quota
21
- <strong><?php echo $helper->getImageSizeConverted($response->quota_total) ?></strong>
22
- </div>
23
- <div class="kraken-box">
24
- Current usage
25
- <strong><?php echo $helper->getImageSizeConverted($response->quota_used) ?></strong>
26
- </div>
27
- <div class="kraken-box">
28
- Remaining quota
29
- <strong><?php echo $helper->getImageSizeConverted($response->quota_remaining) ?></strong>
30
- </div>
 
 
 
 
 
 
 
 
31
  <?php else: ?>
32
  <ul class="messages">
33
  <li class="notice-msg">
12
  <h3>Kraken.io Account</h3>
13
  <div class="kraken-inner">
14
  <?php if ($response->success == true): ?>
15
+ <?php if(property_exists($response,'plan_name')): ?>
16
+ <div class="kraken-box">
17
+ Plan level
18
+ <strong><?php echo $response->plan_name ?></strong>
19
+ </div>
20
+ <?php endif; ?>
21
+ <?php if(property_exists($response,'quota_total')): ?>
22
+ <div class="kraken-box">
23
+ Monthly quota
24
+ <strong><?php echo $helper->getImageSizeConverted($response->quota_total) ?></strong>
25
+ </div>
26
+ <?php endif; ?>
27
+ <?php if(property_exists($response,'quota_used')): ?>
28
+ <div class="kraken-box">
29
+ Current usage
30
+ <strong><?php echo $helper->getImageSizeConverted($response->quota_used) ?></strong>
31
+ </div>
32
+ <?php endif; ?>
33
+ <?php if(property_exists($response,'quota_remaining')): ?>
34
+ <div class="kraken-box">
35
+ Remaining quota
36
+ <strong><?php echo $helper->getImageSizeConverted($response->quota_remaining) ?></strong>
37
+ </div>
38
+ <?php endif; ?>
39
  <?php else: ?>
40
  <ul class="messages">
41
  <li class="notice-msg">
app/design/frontend/base/default/layout/kraken.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout>
4
+ <catalog_product_view>
5
+ <reference name="head">
6
+ <action method="addJs"><script>kraken/async.js</script></action>
7
+ <action method="addJs"><script>kraken/optimize.v2.min.js</script></action>
8
+ </reference>
9
+ <reference name="before_body_end">
10
+ <block type="welance_kraken/product_image" name="welance.kraken.cache.optimizer" as="cacheOptimizer" template="kraken/product/image.phtml" />
11
+ </reference>
12
+ </catalog_product_view>
13
+ </layout>
app/design/frontend/base/default/template/kraken/product/image.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ var cacheImages = <?php echo $this->getImagesToOptimize(); ?>;
3
+ var requestUrl = '<?php echo Mage::getUrl('kraken/optimize/cache') ?>';
4
+ var cacheConcurrency = <?php echo $this->getConcurrency() ?>;
5
+
6
+ document.observe("dom:loaded", function() {
7
+ optimizeImages.optimizeCache(cacheImages);
8
+ });
9
+ </script>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Kraken_Image_Optimizer</name>
4
- <version>2.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension enables Magento users to optimize their product, skin and media images by consuming the Kraken.io image optimization API. (https://kraken.io)</summary>
10
  <description>This extension exists for the sole purpose of allowing Magento users to optimize their product, skin and media images by consuming the Kraken.io image optimization API. (https://kraken.io)</description>
11
- <notes>Fixed SQL query used for fetching unoptimized Media and Skin images</notes>
12
  <authors><author><name>Nekkra UG</name><user>KrakenIO</user><email>support@kraken.io</email></author></authors>
13
- <date>2015-10-27</date>
14
- <time>10:45:52</time>
15
- <contents><target name="magelocal"><dir name="Welance"><dir name="Kraken"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><file name="Signup.php" hash="56a9ee65c5d9fd769b7a5a0854b71a16"/><file name="Status.php" hash="99dd2cb6da9d62e4d8cab36ea29d13e5"/><dir name="User"><file name="Status.php" hash="f33827a151d7ccd76684dde79599c3a2"/></dir></dir><dir name="Images"><file name="Media.php" hash="9dd94a375ceaa004df26d314a935fa63"/><file name="Skin.php" hash="f0dc5623a3974e50ce94b71cae4cd7cd"/></dir><file name="Images.php" hash="77fe1a1c7a0fb28209a741266467db69"/><file name="Statistics.php" hash="6cdae1bc41185b93c49d97465ee75704"/></dir><dir name="Product"><file name="Image.php" hash="2243dae68917d4e49b7c8786d3dc173b"/></dir></dir><dir name="Helper"><file name="Api.php" hash="bdad47443f357c6241005b76304d985e"/><file name="Data.php" hash="855163b8739ae02bc0e68ad071d880e6"/></dir><dir name="Model"><file name="Abstract.php" hash="46ad69f601aa392e44fadf43dc8ff558"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Validation"><file name="File.php" hash="03b116c93529a00f064c428519415b90"/><file name="Quality.php" hash="63919067f4576cc1a0c6ef663b1d1779"/></dir></dir><dir name="Source"><file name="Compression.php" hash="516d83f51e2216b45e51d20d6d1f8575"/><file name="Concurrency.php" hash="436d106916fae3d01bd7272e34d9771c"/></dir></dir></dir></dir><dir name="Image"><file name="Cache.php" hash="b1405ed2975e5b2fa0136f7722f03828"/></dir><dir name="Images"><file name="Media.php" hash="3d73a5ba9276744d92de042f4ca5d228"/><file name="Skin.php" hash="d6181c6772baa9a84d26e6adda5c87be"/></dir><file name="Observer.php" hash="8e27670e4c5ce3d62d0fcc5b27b6972a"/><dir name="Product"><file name="Image.php" hash="11c24a47125de4787bf082a2227c1e77"/></dir><dir name="Resource"><dir name="Image"><dir name="Cache"><file name="Collection.php" hash="4f29016539f9586ba707c1815f1e12b6"/></dir><file name="Cache.php" hash="7058d029a436aa3d0be1dc6f3c7fae57"/></dir><dir name="Images"><dir name="Media"><file name="Collection.php" hash="e77abb3c2122a0f5582bf14739935d85"/></dir><file name="Media.php" hash="c6aa05e4362b645b001854e9578ee5d1"/><dir name="Skin"><file name="Collection.php" hash="2e81919a1fa3014a9083b12382fc46e0"/></dir><file name="Skin.php" hash="420d0b85798bbd5eb52d40d96eff2868"/></dir></dir></dir><dir name="controllers"><file name="KrakenController.php" hash="d00de7431a787527e6b84b79dc5df547"/><file name="OptimizeController.php" hash="d4a7b8d09b951960c6afd93ea4a3bda9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71d3f77d2a29e267a1b3b172ac457ccc"/><file name="config.xml" hash="ef19419d77c4b3608ab798116e6620b9"/><file name="system.xml" hash="083bab919a0a16a8ab546815d7526850"/></dir><dir name="sql"><dir name="welance_kraken_setup"><file name="mysql4-install-0.0.1.php" hash="c672010d8288677aea0d008a4ec49d0f"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="f6ec9a39c730faa436d29338b35a21b2"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="884f018b06073d09cd38094251316a12"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="21b4fed490c176909fc54d36f49b6caa"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="3399d922082321a9c9fdb3f4d8ddbbb0"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="8084b2f3b1fe2bad7bbbbd1136974289"/><file name="mysql4-upgrade-0.0.6-2.0.0.php" hash="a62483557a3d026e7c2b57999f8924a4"/><file name="mysql4-upgrade-1.0.0-2.0.0.php" hash="a62483557a3d026e7c2b57999f8924a4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="kraken.xml" hash="a2533032af5ce2b9aa1e5506a213faf9"/></dir><dir name="template"><dir name="kraken"><dir name="images"><file name="media.phtml" hash="276ff814433f3b99f7bb418a9b791b62"/><file name="skin.phtml" hash="a6881c5fe4f9390c88fa0f9dc73a7be4"/></dir><file name="images.phtml" hash="f4a3760c6340e2a83569a715975c0a88"/><file name="statistics.phtml" hash="f2ac7696fcdc49f3ce74970059ee486e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Welance_Kraken.xml" hash="5924028abd4db847049907d0685fe928"/></dir></target><target name="mageweb"><dir name="js"><dir name="kraken"><file name="async.js" hash="69a9fc4244b4ed9465d9dc17bfec7e8e"/><file name="jquery.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="optimize.js" hash="b0a5b7e67564574a0d92b6f6c37d2501"/><file name="optimize.v2.min.js" hash="00fe66aea8cef84efcc1a587e6471329"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="kraken"><file name="images.css" hash="4efcb99215e85cea9ef8904594b35d06"/><file name="kraken-tile.png" hash="f893c560e69916c5df3b4542659c0615"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Kraken_Image_Optimizer</name>
4
+ <version>2.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension enables Magento users to optimize their product, skin and media images by consuming the Kraken.io image optimization API. (https://kraken.io)</summary>
10
  <description>This extension exists for the sole purpose of allowing Magento users to optimize their product, skin and media images by consuming the Kraken.io image optimization API. (https://kraken.io)</description>
11
+ <notes>Fixed bugs with file extensions and missing quota_used properties</notes>
12
  <authors><author><name>Nekkra UG</name><user>KrakenIO</user><email>support@kraken.io</email></author></authors>
13
+ <date>2016-01-26</date>
14
+ <time>09:54:37</time>
15
+ <contents><target name="magelocal"><dir name="Welance"><dir name="Kraken"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><file name="Signup.php" hash="56a9ee65c5d9fd769b7a5a0854b71a16"/><file name="Status.php" hash="99dd2cb6da9d62e4d8cab36ea29d13e5"/><dir name="User"><file name="Status.php" hash="f33827a151d7ccd76684dde79599c3a2"/></dir></dir><dir name="Images"><file name="Media.php" hash="9dd94a375ceaa004df26d314a935fa63"/><file name="Skin.php" hash="f0dc5623a3974e50ce94b71cae4cd7cd"/></dir><file name="Images.php" hash="77fe1a1c7a0fb28209a741266467db69"/><file name="Statistics.php" hash="6cdae1bc41185b93c49d97465ee75704"/></dir><dir name="Product"><file name="Image.php" hash="2243dae68917d4e49b7c8786d3dc173b"/></dir></dir><dir name="Helper"><file name="Api.php" hash="bdad47443f357c6241005b76304d985e"/><file name="Data.php" hash="a92a5069a7d68a030f1aa40154f22a80"/></dir><dir name="Model"><file name="Abstract.php" hash="46ad69f601aa392e44fadf43dc8ff558"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Validation"><file name="File.php" hash="03b116c93529a00f064c428519415b90"/><file name="Quality.php" hash="63919067f4576cc1a0c6ef663b1d1779"/></dir></dir><dir name="Source"><file name="Compression.php" hash="516d83f51e2216b45e51d20d6d1f8575"/><file name="Concurrency.php" hash="436d106916fae3d01bd7272e34d9771c"/></dir></dir></dir></dir><dir name="Image"><file name="Cache.php" hash="b1405ed2975e5b2fa0136f7722f03828"/></dir><dir name="Images"><file name="Media.php" hash="3d73a5ba9276744d92de042f4ca5d228"/><file name="Skin.php" hash="d6181c6772baa9a84d26e6adda5c87be"/></dir><file name="Observer.php" hash="8e27670e4c5ce3d62d0fcc5b27b6972a"/><dir name="Product"><file name="Image.php" hash="11c24a47125de4787bf082a2227c1e77"/></dir><dir name="Resource"><dir name="Image"><dir name="Cache"><file name="Collection.php" hash="4f29016539f9586ba707c1815f1e12b6"/></dir><file name="Cache.php" hash="7058d029a436aa3d0be1dc6f3c7fae57"/></dir><dir name="Images"><dir name="Media"><file name="Collection.php" hash="e77abb3c2122a0f5582bf14739935d85"/></dir><file name="Media.php" hash="c6aa05e4362b645b001854e9578ee5d1"/><dir name="Skin"><file name="Collection.php" hash="2e81919a1fa3014a9083b12382fc46e0"/></dir><file name="Skin.php" hash="420d0b85798bbd5eb52d40d96eff2868"/></dir></dir></dir><dir name="controllers"><file name="KrakenController.php" hash="d00de7431a787527e6b84b79dc5df547"/><file name="OptimizeController.php" hash="d4a7b8d09b951960c6afd93ea4a3bda9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71d3f77d2a29e267a1b3b172ac457ccc"/><file name="config.xml" hash="7689401c8f2325863682ff2e51072a15"/><file name="system.xml" hash="083bab919a0a16a8ab546815d7526850"/></dir><dir name="sql"><dir name="welance_kraken_setup"><file name="mysql4-install-0.0.1.php" hash="c672010d8288677aea0d008a4ec49d0f"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="f6ec9a39c730faa436d29338b35a21b2"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="884f018b06073d09cd38094251316a12"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="21b4fed490c176909fc54d36f49b6caa"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="3399d922082321a9c9fdb3f4d8ddbbb0"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="8084b2f3b1fe2bad7bbbbd1136974289"/><file name="mysql4-upgrade-0.0.6-2.0.0.php" hash="a62483557a3d026e7c2b57999f8924a4"/><file name="mysql4-upgrade-1.0.0-2.0.0.php" hash="a62483557a3d026e7c2b57999f8924a4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="kraken.xml" hash="a2533032af5ce2b9aa1e5506a213faf9"/></dir><dir name="template"><dir name="kraken"><dir name="images"><file name="media.phtml" hash="276ff814433f3b99f7bb418a9b791b62"/><file name="skin.phtml" hash="a6881c5fe4f9390c88fa0f9dc73a7be4"/></dir><file name="images.phtml" hash="f4a3760c6340e2a83569a715975c0a88"/><file name="statistics.phtml" hash="ecc8b4f9c46580bbe57e7dbfdae637e5"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="kraken.xml" hash="98b82cae20a42821b0cefd441e12befd"/></dir><dir name="template"><dir name="kraken"><dir name="product"><file name="image.phtml" hash="bc755f1aba5bccf9777cc34e1b0b403c"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Welance_Kraken.xml" hash="5924028abd4db847049907d0685fe928"/></dir></target><target name="mageweb"><dir name="js"><dir name="kraken"><file name="async.js" hash="69a9fc4244b4ed9465d9dc17bfec7e8e"/><file name="jquery.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="optimize.js" hash="b0a5b7e67564574a0d92b6f6c37d2501"/><file name="optimize.v2.min.js" hash="00fe66aea8cef84efcc1a587e6471329"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="kraken"><file name="images.css" hash="4efcb99215e85cea9ef8904594b35d06"/><file name="kraken-tile.png" hash="f893c560e69916c5df3b4542659c0615"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>