I have two different stores of Magento 1.9
and Magento 2.3
. I need to know details of unused custom extensions and third party modules of my stores which are enable but not used for long time, so that I can disable/remove it. Is there any method or way to do that in Magento ...?
1 Answer
This is only half the answer, but your question is pretty broad, so I'm doing my best...
The short answer is that there really isn't a universal way to do this because it will depend on your extension.
The long answer is that you could either disable the extension to see if it causes problems or find ways of tracking usage. You could try to log an entry every time an extension is loaded, but that will depend on the extension and what it is used for.
I would recommend looking for a _construct()
or __construct
(Note the additional '_') function in one of the Block
, Model
or controllers
folders, then use Mage::log() to see when it is loaded. For example:
In a file like <magento-root>/app/code/<community-OR-local>/Custom/Extension/Block/Custom.php
, add the beginning of the file would look something like this:
<?php
class Custom_Extension_Block_Custom extends Mage_Core_Block_Template {
protected function _construct() {
// THIS IS THE LINE YOU WOULD ADD
Mage::log('Custom_Extension_Block_Custom->_construct() called from the following url: '.Mage::helper('core/url')->getCurrentUrl());
parent::_construct();
$this->setSomeBlockData('some block data');
}
// ... more code before file ends
}
This will tell you when and where it the block is being created, which would work similarly for Models and controllers.
It is worth noting that some extensions will automatically be used when certain pages are loaded, just because the extension is enabled and it automatically overrides default template/model/other files. Also, this is for Magento 1, but I am sure you could find similar ways to track Magento 2 extensions.
php bin/magento module:status