Freebie: Magento Modified Core Files Report by Amasty [Updated]

Magento Modified Core Files report

Hey Amasty blog readers! Today I wanted to share a tool that I created to help our developers in providing faster and better support for our customers.

But after chatting with my colleagues I realized this tool can be of help for other developers and even store owners! Click read more to see what the tool is about and to download it for free.

Who needs to check if Magento core files were modified?

  1. Sometimes store owners may need to check if Magento core files were modified. This script isn’t needed if you have a ‘clean’ Magento installation.

This point is all about buying extensions from trusted vendors. The script lets you check if a free extension or an extension from an unknown developer modifies Magento core files – and if it does, you may suspect malicious activity behind your back, for example, stealing payment data.

  1. Magento developers will also benefit from using this script. You can quickly and easily check Magento core files of the store you’re going to support or to identify changes that were made by previous developers or Magento extensions.

Why is modifying core files a deadly sin?

It happens (sigh) that developers modify Magento core files, but this practice is what you should avoid at any costs.

If you’ve noticed that a developer changed Magento core files of your store, here’s my indulgence to fire him straight away.

Compatibility issues

Say, you install an extension that modifies Magento core files. It may work perfectly only until you use any other Magento modules; they will rely on expected (standard) Magento functionality. Therefore, Magento core changes are likely to cause incorrect performance of other installed extensions.

Upgrade issues

If you use an extension that modifies Magento core files or you have manually modified files, you lose an opportunity to properly upgrade your Magento installation. An upgrade will destroy core changes, and features attached to these changes won’t work. To restore them, you’ll need to reinstall the module.

Given that Magento upgrades are essential for safety and correct performance of your store, it becomes too much of a problem.

For example, here’s an article about the latest Magento critical vulnerability, and we have spoken of Magento upgrade importance before.

A trusted developer knows that Magento has a way of overriding native features without hurting the installation.

What does Modified Core Files Report do?

If you’re unsure about the source of troubles on your store after someone’s customization or installation of third-party modules, or if you’re a developer and need to quickly check if the Magento core files are untouched, the Modified Core Files Report will help you.

Manual check of core files can’t be performed because Magento core has lots of files, and the tool does it automatically, saving your time and effort.

  • It shows the core files that have been changed;
  • It shows the exact changes and highlight them, comparing the files with the original files from your Magento version;
  • It also shows the changes made by ‘legal’ overriding of Magento core files in the app/code/local/Mage folder.

Check Magento core files


If you have any questions regarding the tool, I’d be happy to help.
UPD 13 Nov. 2015 the checker was updated

Pavel Barbarich

Pavel Barbarich

Pavel is able to cope with any code challenges which greatly helps him in the work of a developer and technical support manager. He likes finding elegant solutions even to those problems that seem undecidable. Besides concentrating on constant self-improvement, Pavel likes traveling to different places and reading, he is also a real geek.

You may also like...

68 Responses

  1. Pieter says:

    Nice!

    Would be great if you can add support for the Magento patches (somehow), because right now if you applied some patches to your Magento installation, it will say some files were modified from the core, which is true off course, but it was done intentionally.

    Also a small bug, if you have both Modified & Redefined files, it will only show the Modified files. You need to change the ‘elseif’ to ‘if’ on line 216 in the index.php file to fix this.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey Pieter!

      Thanks for your feedback, first of all. We will correct this bug and re-upload the files.

      As far as the patches are concerned, thanks for your suggestion – we will definitely look into this feature.

  2. John says:

    For those of us not familiar with .7z, how do we run this?

  3. Bach Carsten says:

    Hi

    How can I use this script?

    Regards.
    Bach

  4. Bach Carsten says:

    I am not sure how I can see the compare screen like above.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey Bach,
      try this:
      1) copy the script into the folder where you have your Magento installed
      2) run the script through mymagento/amsupport/ URL.
      Please let me know if that helps.

  5. Vikrant says:

    Where can we download the script from?

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey!
      You can subscribe to the newsletter in the form above, and with the subscription confirmation letter you’ll get a link to download the script.
      Let me know if that helps.

  6. Mark says:

    I’m already subscribed but can’t get the file download.

    Can you please email me a direct link?

  7. Matteo says:

    Hello, I’m trying this script but I get a “Couldn’t get file from Amasty server” error.
    Do I miss something?

  8. Gurpreet Singh Sidhu says:

    I’m already subscribed but can’t get the file download.

    Can you please email me a direct link?

  9. becky says:

    I have put my email in and clicked subscribe then a message came up saying “To complete the subscription process, please click the link in the email we just sent you” but I didn’t get any email!!

    Any chance you can you please send me the file (or a link to download)

    Thanks :-)

  10. becky says:

    sorry dont know why it put my comment twice. the email has come through now so I have downloaded the file. Thanks this will help me a lot as I have had to leave upgrading because I was worried it would break my site!

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey,
      nice you figured it out! Sometimes the confirmation email with the link takes time to come through.
      Have a nice day!

  11. G says:

    Why did this just take my site out with a message on white page saying my core is modified? I would have been nice to know my site would go off line with this message for all to see. It’s a good thing I made copy of files first..

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey,
      I’m sorry you faced some outage here – but the script isn’t supposed to take your site down.
      Could you please provide some more details on what happened – I’m not sure I get why you needed to copy the files as the script shouldn’t actually do anything with them. Also could you please provide your Magento version, and I’ll send this info to Pavel so he could have a look.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey,

      I’ve checked with Pavel on this issue. This can happen if you just copied all the files to your main folder (and also replaced index.php). When copy the script files to the main folder, you should keep them in the folders as they are organized in the archive. Hope that helps.

  12. Alexey says:

    Hello, I’ve been subscribed to the newsletter and received an offer to download the script and to download it I need to subscribe even though I’m already subscribed? Does this make sense?

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey,
      please check your email – I’ve sent the script to you.
      Sorry that we screwed up here – it’s our mistake. Next time we’ll find another way to deliver freebies to our subscribers.
      Again, my apology for the inconvenience!

  13. Joe St. Clair says:

    You should give a big warning to people to use this only as a tool for those who know what they are doing. The way that the script currently works it is running the diff against the base install.
    So for example in you installed the new SUPEE-5344 patch, as we all should have by now, then this script will flag the core changes made by the script. A person not knowing better might revert these changes back to “Core” and in the process make their install vulnerable to the Shoplift attack again.

    It is for this reason that I really wish that magento team would surround the patched lines from patches with comments like #Begin Supee-15333

    • Ksenia Dobreva Ksenia Dobreva says:

      Hi Joe,

      we see your point, and you’re right, indeed. Thanks for commenting!

      The thing is that we created this tool for our support team and only afterwards decided to share it with our subscribers.

      Now we see that the script becomes more popular and people need it, so I guess there are high chances we’ll add this support in the future.

      I totally agree with you on the point that people without special knowledge may be misled. We will update the article with a comment on this – though, sometimes it’s impossible to protect people from themselves if they firmly decided to use the tool even though they possess very little knowledge when it comes to Magento development.

  14. Joshua Jarman says:

    The latest version of the zip just contains a single file “magento-integrity-checker.git” and none of the git tools I have on OSX will open it, they all say it is an invalid git repository. :-( Can you please email me the zip with the actual files in it? Thanks!

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey Joshua, please check your email, I’ve sent you the files.
      In fact, magento-integrity-checker.git is just a folder. I guess OSX can’t see it’s a simple folder because of the name, in that case you can just rename it to remove .git from the name and your operational system will see it’s not a file.
      Hope that helps.

  15. Alex says:

    Hello,
    The script dropped error: “Couldn’t get file from Amasty server”

    Going into code of the script I used var_dump($url), an find a link it tries: http://cds.amasty.net/community/1.9.1.1.md5. In a browser I get 404 error as well.

    What might be wrong?

    Regards,
    Alex.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey,

      thanks for reporting! This is because you use the latest version of Magento Community, which hasn’t been added yet, but we will definitely add this version support today or tomorrow. So you’ll just need to try this once again, no need for script update.

      Hope that helps!

  16. Rick says:

    “Couldn’t get file from Amasty server”
    Using 1.9.2.0

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey Rick, very sorry, looks like we haven’t uploaded the latest Magento version that came out on July. Our developer is out of office now, he’ll be back in a couple of days and fix this, I’ll inform you right away.
      Thanks for your interest!

  17. B. Moore says:

    Have you updated this extension to include info about latest magento patches?

    Seem like a waste to install if it will always say the core files have been modified because of the patches.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hi there,

      you’re right, we haven’t added patches support yet. But as we received several requests on this feature, we’re planning to upgrade the code when we have time and resources available.

      Thanks for your feedback!

  18. creo imaginem says:

    Hi, many thanks for this magic tool! As a freelancer, I often join teams on existing projects, and this tool helped me to discover some mistakes on a awful project 😉

  19. Sagarika says:

    Hi, we got the below result. Please let us know how to fix.

    Modified Core Files Report by Amasty

    Mage file not found

    • Ksenia Dobreva Ksenia Dobreva says:

      Hi Sagarika,

      thanks for asking.

      Looks like your script is too far from Magento files.
      For example, if Index.php is in folder A, the report script should be in A/scriptfolder/index.php.

      Hope that helps.

  20. Sagarika says:

    we are on magento 1.9.0.1

    Thanks

  21. Ken says:

    Got the error “Couldn’t get file from Amasty server”, I’m using 1.9.2.2

  22. Mary says:

    I could not find the core files I needed anywhere! Thanks so much for this tool. I had 2 files that were modified so Magento was not letting me update 5344. I corrected the code and finally ran 5344 without error and the rest followed suit.

  23. Praveen Vishnoi says:

    I could not find the core files I needed anywhere! Thanks so much for this tool. but this tool not showing modified file.
    it showing
    Modified Core Files Report by Amasty
    Congratulations! Your Magento is clean!
    but my core file is changed suerly. so plzz tell about this what is problem
    first i past script then type url http://localhost/*******/amsupport/
    is it right way or not ….

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey! Thanks for asking. Please open any file in the lib folder and change it, it should appear as changed afterwards. Could you please inform me about the result?

      • Praveen Vishnoi says:

        Thank you very much for the prompt reply, I changend in /amsupport/lib/Diff.php (change 3 to 4) then it’s show this message –
        Modified Core Files Report by Amasty
        Couldn’t get file from Amasty server
        and changed in /magento/lib/FILE it showing clean again.

      • Praveen Vishnoi says:

        kindly, check this version is uploaded on server or not.

        • Ksenia Dobreva Ksenia Dobreva says:

          Hey Praveen, the version has been there and is now. There’s some issue, but we can’t identify without having a look. If you upload the project to the server and give us the credentials, we can have a look and give a more exact answer.
          You can send the credentials to ksenia.dobreva@amasty.com. Thanks!

  24. Guhan says:

    Hi, I am using Magento EE – 1.14.2.1. When i am running the url mymagento/amsupport/, it is showing some error like, Couldn’t get file from Amasty server. What might be the problem?

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey Guhan,

      thanks for your comment. I looked it up and it seems like there was no 1.14.2.1 EE version on our servers. Could you please try once again? Now it should be working fine. Cheers!

  25. Terry says:

    Pls what’s a core file

  26. Simon says:

    I have not received my email, please can you send link ASAP. Thank you.

    • Simon says:

      Thank you for sending the email.

      I get this error when using it with magento version 1.9.2.4

      Couldn’t get file from Amasty server

  27. F. Amekran says:

    Like user: “Sagarika” i had “Mage file not found”, see: http://www.ap-tuning.be/indextest.php

    I’ve tried your solution, made a folder in the root and put the script files there so that it became like this
    http://www.ap-tuning.be/script/indextest.php, but that didnt work also.

    Can you help me please?

    • Ksenia Dobreva Ksenia Dobreva says:

      Hey there and thanks for the question.
      Looks like you need to upload the full amsupport/ directory, not just one file. Hope that helps.

  28. Kalyan says:

    Hi,

    I am getting the output without any UI. It is showing plain text. I tried changing a core file but it is also not showing up. I am getting only redefined files.

    I ran this URL http://localhost/magento/amsupport, amsupport has all the files I downloaded.

    Please let me know if I am doing anything wrong.

    • Ksenia Dobreva Ksenia Dobreva says:

      Hi there, sorry for the late reply.
      Are you seeing any errors in the browser console? Does Javascript work fine on your machine?

  29. Aneel says:

    Hi,

    I am using Magento enterprise version Magento ver. 1.12.0.0, but i am getting error “Couldn’t get file from Amasty server”, does it support Magento version 1.12.0.0?

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *