Magneto 1 – Customer database full of spam

So, one day, I noticed one of my servers was sending a ton of emails out to dodgy looking …   or  …  addresses.  UH OH!

At first I thought the mail server on my webserver had been compromised. On further investigation I managed to see to that the contents of these mails were account registration validation emails.  Looking in the Magento admin (Customers>Manage Customers) I saw them…thousands of new customer registrations – with Russian copy in the name fields and, on the whole [something]  or  [something]   addresses but also some with [something]

Continue reading Magneto 1 – Customer database full of spam

Magento 1.9x Write to Custom Log File

To write information to your own custom log file, say to trace errors in a custom module, track odd behaviour or record that a certain event has happened, you use Mage::log()

Mage::log(‘<WHAT TO WRITE IN THE LOG>’, null, ‘FILENAME.log’, true);

If you want to log the output of an array, use print_r but with the second parameter set to true – this converts the output to a string.

e.g. Mage::log(print_r($myArray,true), null, ‘FILENAME.log’, true);

I hope this is helpful. If it has and has saved you some time, feel free to buy me a beer.