Posted on

Downloading a Magento Connect Extension manually before installing it

I always install my Magento extensions manually so for me downloading and looking over an extension before copying it into my SVN repo is important. I don’t actually recommend using Magento Connect to install things on production stores (no one does that, right?) – it’s a bit like playing Russian roulette really. You might be able to install 1 or 2 extensions with Magento Connect, but if you install 6, you’ll definitely blow your brains out hose your Magento store.

Here’s a quick few steps to take so you can do that yourself. I’ll assume you have a local development version of Magento running on your laptop or desktop.

1) Jump into the root of your development store:

cd ~/Documents/web/magento/

2) Download the extension with pear:

./pear download magento-community/Netzarbeiter_CustomerActivation

3) For simplicity, I move the file over to my downloads directory to extract and inspect it:

mv ~/Documents/web/magento/ ~/Downloads/

Then you can unarchive the extension, take a look at the files, scrutinize to your hearts content before you decide it’s a good extension and install it into your SVN repo manually. Then when you update your staging site you can check everything works, before releasing to production. Of course in this particular case I’ll install the extension blindly, Vinai codes elegant extensions that are certain to work!

Some things I look for:

  • Schema scripts in the sql directory that make drastic schema changes
  • Ugly phone-home calls (you know who you are!)
  • Comments like “TODO: remove this before releasing”
  • Comments like “TODO: implement this”
  • Check what models the extension is overriding, it’s one way to avoid extension clashes

Any I missed let me know? And yes I am fully aware that most of my extensions would fail my own criteria 😛

22 thoughts on “Downloading a Magento Connect Extension manually before installing it

  1. GET OUT OF MY HEAD, Ashley.

  2. Good tip, only gripe I have is that the downloaded extension archive packages the files with a directory hierarchy that doesn’t start from the site root but the app/code app/design skin etc dirs are all at the top level.

    Would be nice to write a shell script to repack the download to something that’s easily installable later :).

  3. To get around Robert’s comment about the hierarchy, I tend to ask the developer for a fresh Zip of the entire tree. That way I a) get to speak with the developer and “sus them out”, b) get the latest and greatest code and c) usually a direct contact route for any troubleshooting or bug reports.

    When I inspect the code, on top of the criteria Ashley lists, I also look for dodgy phtml block inclusions with backlinks. I also look for weird name classes, which tells me they copied someone else’s code and didn’t even bother to change class and method names. There basically are a lot of rational and not to rational ways to evaluate a module, and I am VERY picky what makes it in. Sometimes, if the naming doesn’t make any sense, I’d change the module names etc. so down the line I can better understand what was what.

    I’ve not used Magento Connect since 1.1.8 and haven’t missed it one bit. To me it’s a liability, handing out control over something that is so important, you really do want to keep that control firmly in your own hands.

  4. @Robert you can change the pear config, e.g.

    This way, the package will be installed in a temporary directory (e.g. mage_tmp)

  5. Ugly phone-home calls (you know who you are!)

    What extensions do this?

  6. @Capnhud – Sorry, I’m not going to name names, at least one of the extensions I have used has a web ping back to their creator with domain information. If it worries you, then a casual browse of the code in an extension will reveal anything like that.

  7. I found this online Magento Extension downloader which is very simple to use:

  8. @Majid – thanks a lot for sharing such a simple way. It helped me a lot.

    @Ashely – Really a nice article and i have gained a lot from your Magento articles. hope one day we work together.

  9. Might be common knowledge, but with Magento Connect 2 you can use ‘./mage download channel Package_name’ which will download the .tgz to ‘/downloader/.cache/[channel]/’.

    e.g. ‘./mage download community Netzarbeiter_CustomerActivation’ will go into ‘/downloader/.cache/community/Netzarbeiter_CustomerActivation-0.2.9.tgz’

  10. I made a Windows Batch script “mage.bat” so you can run and download/upgrade Magento and it’s extensions on Windows as well. Grab it here if you need it:

  11. Something handy:

    All you need is the extension key! 😉

  12. Make sure you use the 1.0 extension key though. Or am I the only stupid one here .. ? 😉

  13. I like using a good ole´ ftp client. Works wonderfully!

  14. Thanks Wallace and Majid, that downloader is just what I needed!

  15. @Wallace That downloader is great! Thanks!

    @Ashley Thanks for your help, this post really helped. (Y)!

  16. Nice post, I also recomemnd this online Magento Extension downloader which is cool too

  17. hey Ashley what tools do you use to determine the home calls etc..?

  18. Simple method.
    Download Magento modules using your browser:

  19. Hello,
    Not working on CE
    Can somebody help?
    I have wamp on win7. Have successfully installed pear for php 5.3.0.
    Got error :
    C:\wamp\bin\php\php5.3.5>pear download
    Could not download from “
    cebook” (File
    not valid (received: HTTP/1.1 403 Forbidden
    Invalid or missing remote package file
    download failed

  20. This tool : let you donwload magento modules with a 2.0 or 1.0 magento connect key. You can also choose the version of the module to download.

  21. Would you mind suggesting the best way to uninstall the module completely [remove files and database] without using magento connect?

    This will be handy when the module was installed manually and its not visible under magentoconnect.


Comments are closed.