Ordermonitor_Agent - Version 1.2.4

Version Notes

Refactor and performance update

Download this release

Release Info

Developer Adam Levenson
Extension Ordermonitor_Agent
Version 1.2.4
Comparing to
See all releases


Code changes from version 1.2.3 to 1.2.4

app/code/community/Ordermonitor/Agent/.DS_Store CHANGED
Binary file
app/code/community/Ordermonitor/Agent/Model/Cron.php CHANGED
@@ -65,7 +65,7 @@ class Ordermonitor_Agent_Model_Cron extends Mage_Core_Model_Abstract
65
  ->columns(array('status', 'scheduled_at', 'executed_at', 'finished_at'))
66
  ->limit(1);
67
 
68
- $jobInfo = $items->getFirstItem()->toArray();
69
 
70
  if (count($jobInfo) > 0) {
71
  $results['status'] = $jobInfo['status'];
@@ -125,7 +125,7 @@ class Ordermonitor_Agent_Model_Cron extends Mage_Core_Model_Abstract
125
  ->columns(array('status', 'scheduled_at', 'executed_at', 'finished_at'))
126
  ->limit(1);
127
 
128
- $jobInfo = $items->getFirstItem()->toArray();
129
 
130
  return (!isset($jobInfo['finished_at']) || is_null($jobInfo['finished_at'] ) ? $maxTime : $time - strtotime($jobInfo['finished_at']));
131
  }
65
  ->columns(array('status', 'scheduled_at', 'executed_at', 'finished_at'))
66
  ->limit(1);
67
 
68
+ $jobInfo = $items->getFirstItem()->setPageSize(1)->toArray();
69
 
70
  if (count($jobInfo) > 0) {
71
  $results['status'] = $jobInfo['status'];
125
  ->columns(array('status', 'scheduled_at', 'executed_at', 'finished_at'))
126
  ->limit(1);
127
 
128
+ $jobInfo = $items->getFirstItem()->setPageSize(1)->toArray();
129
 
130
  return (!isset($jobInfo['finished_at']) || is_null($jobInfo['finished_at'] ) ? $maxTime : $time - strtotime($jobInfo['finished_at']));
131
  }
app/code/community/Ordermonitor/Agent/Model/Monitor.php CHANGED
@@ -278,7 +278,7 @@ class Ordermonitor_Agent_Model_Monitor extends Mage_Core_Model_Abstract
278
  'MIN(base_price) as min_base_price'
279
  ));
280
 
281
- return $items->getFirstItem()->toArray();
282
  }
283
 
284
  /**
@@ -441,7 +441,7 @@ class Ordermonitor_Agent_Model_Monitor extends Mage_Core_Model_Abstract
441
  ->columns(array('sum(is_active) as cartsCreatedActive'))
442
  ->columns(array('count(entity_id) as cartsCreated'));
443
 
444
- $newCartsCount = $newCarts->getFirstItem()->toArray();
445
 
446
  //Carts updated
447
  $updatedCarts = Mage::getModel('sales/quote')
@@ -459,7 +459,7 @@ class Ordermonitor_Agent_Model_Monitor extends Mage_Core_Model_Abstract
459
  ->columns(array('sum(is_active) as cartsUpdatedActive'))
460
  ->columns(array('count(entity_id) as cartsUpdated'));
461
 
462
- $updatedCartsCount = $updatedCarts->getFirstItem()->toArray();
463
 
464
  $results['data'] = array(
465
  'newCarts' => (int)$newCartsCount['cartsCreated'],
@@ -497,7 +497,7 @@ class Ordermonitor_Agent_Model_Monitor extends Mage_Core_Model_Abstract
497
  ->reset(Zend_Db_Select::COLUMNS)
498
  ->columns(array('count(entity_id) as totalOrders'));
499
 
500
- $results = $orders->getFirstItem()->toArray();
501
 
502
  return (int)$results['totalOrders'];
503
  }
278
  'MIN(base_price) as min_base_price'
279
  ));
280
 
281
+ return $items->getFirstItem()->setPageSize(1)->toArray();
282
  }
283
 
284
  /**
441
  ->columns(array('sum(is_active) as cartsCreatedActive'))
442
  ->columns(array('count(entity_id) as cartsCreated'));
443
 
444
+ $newCartsCount = $newCarts->getFirstItem()->setPageSize(1)->toArray();
445
 
446
  //Carts updated
447
  $updatedCarts = Mage::getModel('sales/quote')
459
  ->columns(array('sum(is_active) as cartsUpdatedActive'))
460
  ->columns(array('count(entity_id) as cartsUpdated'));
461
 
462
+ $updatedCartsCount = $updatedCarts->getFirstItem()->setPageSize(1)->toArray();
463
 
464
  $results['data'] = array(
465
  'newCarts' => (int)$newCartsCount['cartsCreated'],
497
  ->reset(Zend_Db_Select::COLUMNS)
498
  ->columns(array('count(entity_id) as totalOrders'));
499
 
500
+ $results = $orders->getFirstItem()->setPageSize(1)->toArray();
501
 
502
  return (int)$results['totalOrders'];
503
  }
app/code/community/Ordermonitor/Agent/controllers/AgentController.php CHANGED
@@ -68,7 +68,6 @@ class Ordermonitor_Agent_AgentController extends Mage_Core_Controller_Front_Acti
68
  );
69
 
70
  $results = $om->getOrderInfo($start, $end, $storeIds, $params);
71
- $om->getCartInfo($start, $end, $storeIds);
72
 
73
  if ($getItemTotals === true) {
74
  $itemTotals = $om->getItemTotals($start, $end, $storeIds, $skus, $limit);
68
  );
69
 
70
  $results = $om->getOrderInfo($start, $end, $storeIds, $params);
 
71
 
72
  if ($getItemTotals === true) {
73
  $itemTotals = $om->getItemTotals($start, $end, $storeIds, $skus, $limit);
app/code/community/Ordermonitor/Agent/etc/config.xml CHANGED
@@ -14,7 +14,7 @@
14
  <modules>
15
  <Ordermonitor_Agent>
16
  <!-- @Om - If version changes, update the default value for <om_version> at end of file -->
17
- <version>1.2.3</version>
18
  </Ordermonitor_Agent>
19
  </modules>
20
  <frontend>
@@ -69,7 +69,7 @@
69
  <default>
70
  <ordermonitor>
71
  <general_configuration>
72
- <om_version>1.2.3</om_version>
73
  <om_username/>
74
  <om_api_key/>
75
  </general_configuration>
14
  <modules>
15
  <Ordermonitor_Agent>
16
  <!-- @Om - If version changes, update the default value for <om_version> at end of file -->
17
+ <version>1.2.4</version>
18
  </Ordermonitor_Agent>
19
  </modules>
20
  <frontend>
69
  <default>
70
  <ordermonitor>
71
  <general_configuration>
72
+ <om_version>1.2.4</om_version>
73
  <om_username/>
74
  <om_api_key/>
75
  </general_configuration>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ordermonitor_Agent</name>
4
- <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.ordermonitor.com/license">Commercial</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Monitor what matters; orders. Get notifications if something goes awry. Trends and forecasting give you insight into how your store is performing.</summary>
10
  <description>The Order Monitor Agent collects and aggregates data for the Order Monitor service, enabling you to setup alerts based on order volume, aov, discounts and much more. Compare your metrics to yesterday and your average to see if your trending up or down. Forecasting allows to predict the sales for the day.</description>
11
- <notes>Minor adjustments, version number bump.</notes>
12
  <authors><author><name>Adam Levenson</name><user>adamdo</user><email>adam@digitaloperative.com</email></author></authors>
13
- <date>2016-02-24</date>
14
- <time>18:07:06</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Ordermonitor_Agent.xml" hash="d801d81de66117f06637c0750e2a5931"/></dir></target><target name="magecommunity"><dir name="Ordermonitor"><dir name="Agent"><file name="Exception.php" hash="8831bc1226e079c73176a27acd23a02b"/><dir name="Helper"><file name="Data.php" hash="cf9a837e4b1e6a2c40000ab3b795e5d8"/></dir><dir name="Model"><file name="Cron.php" hash="81f3ae712cb1200c01f9dc36d6d2f524"/><file name="Inventory.php" hash="3fec6496931d6d3f533c9760d1479e5f"/><file name="Monitor.php" hash="a035dadb0930ab49575ef54f9ebbc51a"/></dir><dir name="controllers"><file name="AgentController.php" hash="02433e97f441c23eb761b1ca19d6aaa7"/></dir><dir name="etc"><file name="config.xml" hash="972b37af2dc950dfb77c514f8206625f"/><file name="system.xml" hash="1984b77515766fedb9ce67c0e4b1cd35"/></dir><file name=".DS_Store" hash="816504a148fbbe790644c6c7427a6f81"/></dir><file name=".DS_Store" hash="60238f239932c73cc1be075fbd3e96ef"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max>1.9.2.4</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ordermonitor_Agent</name>
4
+ <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.ordermonitor.com/license">Commercial</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Monitor what matters; orders. Get notifications if something goes awry. Trends and forecasting give you insight into how your store is performing.</summary>
10
  <description>The Order Monitor Agent collects and aggregates data for the Order Monitor service, enabling you to setup alerts based on order volume, aov, discounts and much more. Compare your metrics to yesterday and your average to see if your trending up or down. Forecasting allows to predict the sales for the day.</description>
11
+ <notes>Refactor and performance update</notes>
12
  <authors><author><name>Adam Levenson</name><user>adamdo</user><email>adam@digitaloperative.com</email></author></authors>
13
+ <date>2016-08-24</date>
14
+ <time>17:37:59</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Ordermonitor_Agent.xml" hash="d801d81de66117f06637c0750e2a5931"/></dir></target><target name="magecommunity"><dir name="Ordermonitor"><dir name="Agent"><file name="Exception.php" hash="8831bc1226e079c73176a27acd23a02b"/><dir name="Helper"><file name="Data.php" hash="cf9a837e4b1e6a2c40000ab3b795e5d8"/></dir><dir name="Model"><file name="Cron.php" hash="0c1e69dd09290b52dd3ba5835addd4da"/><file name="Inventory.php" hash="3fec6496931d6d3f533c9760d1479e5f"/><file name="Monitor.php" hash="b4e84246c25fd819bb84d0f0973da66e"/></dir><dir name="controllers"><file name="AgentController.php" hash="44b5adcd836930cf6bb7ac1ccb44be51"/></dir><dir name="etc"><file name="config.xml" hash="5a4871b414a5e53e2d573e3d167b2a06"/><file name="system.xml" hash="1984b77515766fedb9ce67c0e4b1cd35"/></dir><file name=".DS_Store" hash="f2a80b0b1af549917580ca71da495323"/></dir><file name=".DS_Store" hash="60238f239932c73cc1be075fbd3e96ef"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max>1.9.2.4</max></package></required></dependencies>
18
  </package>