First of: this isn’t a rant for AheadWorks: they offer great plugins which save us lots and lots of time.
However: there is something to mention here. When I was using the Blog and the Advanced Reports modules, I noticed a serious drop in performance in the backend. All of a sudden it took 10 seconds longer to load! Commenting out the awall_exts and awall_upds observers in app/code/local/AW/All/etc/config.xml seems to fix it. So what gives?
Of course it took me some debugging and backtracing to get to this point. By using the excellent AOE Profiler I quickly noticed that these two observers where taking massive time in the page load, but the memory usage was very low:
When you backtrace the call stack of this event, you’ll notice that some point AW_All_Model_Feed_Abstract::getFeedData() is called, which executes a cURL request to http://media.aheadworks.com/feeds/extensions.xml . Even though this function has a timeout set to 1 the error response of the curl request states that it waited 5 seconds for the timeout.
But why wasn’t my local development machine able to retrieve this file? When I open it in the browser it downloads in a jiffy!
Vagrant
It turns out that – since I always work from within Vagrant – my cURL request that was executed by PHP from within Vagrant couldn’t correctly resolve the host. Although I don’t know exactly why this is, it’s easily solved by adding the correct IP address of media.aheadworks.com manually to my /etc/hosts file in my Vagrant machine.
At the time of writing this is 54.192.14.5 , so my line in my hosts file looks like this:
1 |
54.192.14.5 media.aheadworks.com |
But please note that when you run into the same problem and try to fix it to check if this IP-address is still correct.
Visitors give this article an average rating of 5.0 out of 5.
How would you rate this article?
★ ★ ★ ★ ★
Hello,
Thanks for your blog.
I resolved problem like this:
app\code\local\AW\ALL\Model\Feed\Abstract.php
Change this function ->
public function getFeedData()
{
return false;
/*$curl = new Varien_Http_Adapter_Curl();
$curl->setConfig(array(
‘timeout’ => 1
));
$curl->write(Zend_Http_Client::GET, $this->getFeedUrl(), ‘1.0’);
$data = $curl->read();
if ($data === false) {
return false;
}
$data = preg_split(‘/^\r?$/m’, $data, 2);
$data = trim($data[1]);
$curl->close();
try {
$xml = new SimpleXMLElement($data);
}
catch (Exception $e) {
return false;
}
return $xml;*/
}
Thanks for sharing these tips, these tips helped me a lot to fix my store loading issue, Option 2 is very important. I have selected cloudways magento hosting, https://www.cloudways.com/en/magento-managed-cloud-hosting.php, having the best hosting won’t let you go technical and fix your issues.