Every new module is a welcomed challenge for the Amasty software testing team. We put maximum effort in testing extensions for bugs, errors, and convenience to make sure each new module is easy to run and smoothly integrates into a Magento-powered store.

Still, from time to time customers can have compatibility problems even with perfect modules. That is why today, we will learn what to do, and actually how to precisely identify a compatibility problem if something goes wrong with the implementation of a new Magento 2 module.

 

What can lead to compatibility issues?

Let’s leave the module functionality aside and focus on its integration into the Magento web store system of a merchant. Overall, there are five factors that influence how well a module works with other extensions and the web store environment itself.

#1. CMS edition and version

As you know, there are two Magento editions. Magento Enterprise is a paid, feature-rich, and flexible platform aimed at large market players. Magento Community is free and thus has some limitations. The differences in the functionality of editions often become the reason for poor compatibility between a custom module and the web store platform.

In addition, Magento developers are working hard to improve their product with every new release. However, later versions of the platform can include elements that conflict with or damage the performance of custom modules.

#2. Magento code customization

Many merchants either have in-house developers or turn to software consulting companies for customization and maintenance of their Magento web stores. Developers often have to do the necessary changes in the core of the platform so as to code features and tweak the design and layout of pages in line with the merchant’s requirements. Such changes in the Magento core can also result in the improper performance of custom modules.

#3. Web store extensions

At the module development stage, the Amasty team pays particular attention to its integration into the Magento environment. Unfortunately, it is impossible to take into account how the extension will work together with the code of third-party modules. As a result, if a third party module is poorly coded or has some bugs but uses the same functionality of the Magento platform as our extension does, performance problems can appear if both extensions are enabled.

#4. PHP and MySQL version

Module vendors adhere to the Magento requirements to PHP and MySQL versions. However, sometimes merchants run the latest Magento releases even on the servers, whose PHP and MySQL configurations are outdated. However well-coded a module is, its implementation in such a fragile environment can cause performance issues.

#5. Third-party web services (Varnish, CDN, or proxy)

While our team works hard to guarantee a smooth performance of new modules on different Magento versions and with the latest technologies, we can hardly anticipate all peculiarities of a custom Magento store or third-party extensions.

Why do compatibility issues happen?

First, there can be a conflict between two modules that bring to life the same functionality using different methods.

For example, a customer decides to extend Magento Enterprise with a module that has similar features to the tools included in Magento Enterprise by default.

Second, two modules can modify the same request to the database and each of them can add a custom sub-request (say, join with the same alias). This will cause an error despite a smooth performance of each module.

To prevent or at least minimize such cases, remember to run modules using a correct sequence of setup commands given in the Composer User Guide.

How to find the one to blame?

Say, you installed a new module and faced a compatibility problem. How to find out which module works improperly – a new add-on or one of those installed before?

Three tips below will help you find the answer. Before you start, record the steps that you took prior to the issue (if any). We will need it in a moment for testing.

#1. Check the error message

Switch from the production mode to the developer mode as only this way you can view the error text. Use F12 to open devtools and then one by one repeat exactly the steps that you recorded. When the error appears, the console will show you the text of the error, which should help you clarify the details:

check-the-error-message-blog-post

#2. Disable the new module/other modules

Turn off a new module using the command php bin/magento module:disable Module_Name. Alternatively, you can turn off all third-party modules and leave the new module. For this, use the same command as before separating each module name by a space (php bin/magento module:disable Module_Name1 Module_Name2). After completing the error steps, you will understand whether this is the new module that triggers the error or some third-party module affects the system in general and the new module in particular.

#3. Find the extension that fails

To precisely identify the extension that provokes issues, you can disable third-party modules one by one every time reiterating the steps that lead to an error. When the error doesn’t appear, you will know that the currently disabled module is incompatible with the new extension.

Now, as you clearly know the core of the problem, it will be much easier to fix it.

Conclusion

The integration of a Magento 2 module into a web store environment is a sophisticated process, the success of which depends on a number of direct and indirect factors. An error can appear right after the installation or as a result of the module requests to the Magento core.

The three steps we discussed today will help you identify the reason for poor performance and this way solve the problem much faster. And in business terms, time often correlates with profit.