Is there a way ,or some steps which ensure any custom module/code written in Magento is adhering to all standard/best practices, without it breaking Magento in any case i.e upgrades,extension conflicts etc.

  • You should have a Magento certified developer review and test in a development enviroment – brentwpeterson Jun 28 '14 at 16:18
  • what would a MCD review..can you list it? – huzefam Jun 28 '14 at 16:22
  • MCD == Magento Certified Developer. They can review the code and tell you if it is best practice or not. – brentwpeterson Jul 3 '14 at 18:14

As others already pointed out, the best way is of course to let an experienced Magento developer manually review the code. He does not necessarily need to be a certified developer, but he should of course be experience in Magento and should know the best practices.

Anyway, if you would like to do an automatic check of extension, have a look at the following resources:

  • Check the extension with Judge. Also available on GitHub.
  • Check rewrite conflicts or rewrites in general with n98-magerun.
  • Check if the extension has been reviewed on MageKarma.

The first thing you should do is doing a diff between the codebase you have and the official version of Magento, in the app/code/core folder. With that you might be able to tell if the core files have been modified.

Inchoo has a great guide for that here. In the case of custom modules there is not much to do but to check them one by one and enabling/disabling them to see which one is causing conflicts.

There are some interesting guides in the wild too, just search "check magento conflicts" in Google or here and you will see a few guides from the big players. One of my favourites is this guide from Ashley Schroder.

  • thanks..for the answer, what i am looking for is a tool or set of rules that identify that code written is adhering to best practices or no. – huzefam Jun 29 '14 at 7:20
  • I don't believe you will find a specific tool to look for this. – brentwpeterson Jun 30 '14 at 1:40

You don't need a certified developer, it does allow your senior manager to sleep better at night, but doesn't actually mean they know any more - sometimes the opposite. The key to good code is combining business processes and technical code, however that is quite rare. Every problem can be fixed with business processes -or- technical code - combining the two is the most optimal as it leads to 10s to 100s lines of code rather than 1,000s and 10s of extensions.

So the best practice, have as little code as possible written to solve the problem and use as few extensions as possible. The more code there is the more problems you are likely to have.

The problem with Magento is that its natural habitat is Micro and Small Enterprise (sub $3mil & sub $14mil/yr revenue companies). Due to this most of the development resource will try and code their way out of the problem - this destabilises the platform. It is also part of the reason you will not find a 'best practice' for Magento like you do for solutions such as SAP (the consultants we work with have both Magento & SAP experience) - they created their own.

Unfortunately 99.9% of Magento resource would not understand these 'best practices' as it goes against the platforms natural level - the best practice is to keep it as simple as possible - the problem is that the community are averse to such 'practices'. This would mean very few extensions, very little custom code, and try not to push the plaform to do something it is not naturally designed to do - it is not Hybris or ATG.

  • Like the statement ' more code you have more problems' thanks for the advice..cheers – huzefam Sep 2 '14 at 14:12
  • Terrible advice and completely incorrect. Magento powers many $100M+ stores without issue. But worse still is that you promote not making any modifications to Magento - which is utterly ridiculous. Magento is a platform. Its entire purpose is customisation and extensibility, so that any merchant can make it fit their business. Magento was WHOLLY designed to be modified. – choco-loo Oct 11 '14 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.