Unlock Your Magento 2 Potential with Five Essential Free Tools

  • Home
  • Blog
  • Magento
  • Unlock Your Magento 2 Potential with Five Essential Free Tools
Magento eCommerce development

Finding ways to streamline your workflow and boost productivity is crucial for the success of Magento eCommerce development. Fortunately, the Magento community offers various modules and tools designed specifically to enhance the Magento eCommerce development experience.

In this blog post, we’ll delve into five must-have modules that every Magento 2 programmer should consider incorporating into their arsenal. These modules address common pain points, provide valuable insights, and offer convenient functionalities that save you time and effort during development. From optimizing cache management to gaining deeper insights into Magento’s dependency injection system, these tools will make Magento eCommerce development easier and more efficient.

1. Magerun2: The Swiss Army Knife for Magento

Another essential tool during Magento eCommerce development is MageRun 2, often referred to as the Swiss army knife for Magento. Despite its roots in the Magento 1 era, Magerun2 remains relevant for Magento 2. While the bin/Magento script has taken over many of its functions, Magerun still offers valuable features.

dev:console Command

Among the numerous commands available, one stands out as a game-changer, the dev:console command. This powerful command-line tool in Magento eCommerce development allows developers to seamlessly enter an interactive PHP shell. The real magic lies in its seamless integration with Magento, enabling swift and efficient execution of commands without delays.

$di Variable

The $di (dependency injection) variable is particularly noteworthy as it provides direct access to the object manager. It means developers can effortlessly create objects with dependency injection straight from the command line. The dev:console command in MageRun 2 truly elevates the development experience during Magento eCommerce development.

2. The quickdevbar: Open-Source Debugging Toolbar

The quickdevbar stands out as an open-source dev toolbar that has been around since the inception of Magento 2. After a quick installation, you can activate it by adding your IP address to the allowed list. Once saved and the cache is cleared, a small icon appears at the top left of the Magento instance. Clicking on it reveals a toolbar that provides a wealth of debugging information about Magento. This Magento eCommerce development tool includes details about HTTP request data, output from the PHP info function, and more.

Design, Profiler, and Queries Tab

Under the “Design” tab, you can find layout handles and block classes. The “Profiler” tab provides information on the mage profiler, including a list of fired observers, dispatched events, called collections and models, and executed plugins and methods. The “Queries” tab is handy as it displays all the raw SQL queries performed on the page and their estimated runtime. It helps identify slow queries and understand why a specific repository may be loading a particular data set during Magento eCommerce development. The ability to sort queries by execution time is a standout feature of this toolbar.

Log and Action Bars

Logging can be tedious, but the toolbar simplifies it by displaying the contents of all log files in one place, enhancing the developer experience. You can reset each log file individually by clicking the corresponding reset button. The “Actions” tab offers a Toggler to turn various developer settings on or off during Magento eCommerce development. It is a convenient flush cache button that clears the cache faster than the built-in option in Magento.

Translations Bar

While the translations tab may work smoothly, and the toolbar itself may have some bugs, especially when running PHP 8.1, it remains a valuable tool for gaining insight into your Magento store. Having access to this hidden data is incredibly beneficial during Magento eCommerce development.

The Quick Dev Bar proves to be a beneficial tool for understanding what’s happening in your Magento store and accessing crucial information that would otherwise remain hidden.

3. Disable Two-Factor Auth Module: Streamlining Development Workflow

When Magento 2.4 was released, it introduced a mandatory two-factor authentication (2FA) requirement, forcing developers to enter their 2FA code every time they logged into the admin during development. This change significantly hindered the development workflow.

Enhanced Security

To address this issue, you can use this module to disable 2FA when in developer mode automatically. It is a better alternative than disabling the 2FA module on your local machine. Accidentally committing that disabled module to version control could lead to security vulnerabilities in the production environment. Completely disabling 2FA is not an option during Magento eCommerce development, as it was introduced to enhance the security of the store admin.

Flexible and Easy to Install

The beauty of the “Disable Two-Factor Auth” module is that it’s easy to install and requires no further attention. When the module is pushed upstream, 2FA remains enabled on staging and production systems, as they never run in developer mode. Additionally, you can always disable 2FA directly from the admin if needed to diagnose or debug any issues in the production environment. This module offers flexibility and has gained significant popularity, with over half a million downloads at the time of this recording.

4. bin/magento dev:di:info: Understanding Dependency Injection

When you run the command “bin/magento” and examine its output, you’ll notice a little-known flag called “dev:di:info.” This command provides valuable insights into Magento’s dependency injection system, revealing what’s happening behind the scenes. Simply type the command followed by a quoted string of the interface you want more information about. For instance, to learn about the Magento Framework’s request interface, you would type “bin/magento dev:di:info “Magento\Framework\App\RequestInterface.” The output you receive demystifies interface preferences, constructor arguments, and any associated plugins.

While IDEs like PhpStorm offer some of this information through highlights, annotations, and hints, this command consolidates everything into one convenient location. If you encounter difficulties with a specific interface implementation or face challenges while debugging, this command can be a lifesaver. It’s a valuable addition to your code debugging arsenal.

5. Cache-clean: Automating Cache Clearing

One of the most frustrating aspects of working with Magento is the constant need to clear the cache, a meme that originated in Magento 1 and still persists in Magento 2. Clearing the cache becomes a repetitive and time-consuming task that hampers the Magento eCommerce development workflow. However, there is a solution that eliminates the need for manual cache clearing is the cache-clean project.

This ingenious tool acts as your personal Magento cache butler and concierge, silently running in the background and springing into action whenever you edit any file in Magento. It intelligently detects which caches are affected, automatically cleans and purges them, and makes your Magento eCommerce development experience smoother than ever. Installation is effortless, and a single command is all it takes to run cache-clean.

Conclusion

We’ve highlighted five essential developer tools for Magento 2 programmers that can revolutionize their development experience. With tools like magerun2, developers have a Swiss army knife at their disposal, providing powerful command-line capabilities and seamless integration with Magento. The cache-clean module offers a hassle-free solution for cache management, eliminating the need for manual cache clearing. The dev:di:info command brings transparency to Magento’s dependency injection system, making it easier to debug and understand code structures. By utilizing these tools, Magento developers can significantly improve their productivity, optimize their workflow, and ultimately deliver better results in less time.

If you’re seeking assistance with Magento 2 development, consider reaching out to VserveeCommerce. Our experts provide expert guidance and support to help you with your Magento projects and ensure successful outcomes.

This blog was inspired by the video ‘5 FREE Developer Tools Every Magento 2 Programmer MUST Have’ by ‘Mark Shust.’