It is impossible to speak about Magento code quality without testing your Magento module code standards. With that in mind, we can follow the steps in this article. https://lnkd.in/ehH3RKQ2
Jonathan D.’s Post
More Relevant Posts
-
Unlock Magento 2 debugging secrets with our in-depth guide! Whether you're new to development or a seasoned expert, this blog is your go-to resource for mastering Magento 2 troubleshooting. Inside, we cover: 🔹 Different development modes and when to use them 🔹 Essential tools like Xdebug and PhpStorm 🔹 Activating developer modes and template path hints 🔹 Using Magento logs for valuable insights Dive in to learn more! https://lnkd.in/gaDKUcSS
To view or add a comment, sign in
-
Discover the secrets of debugging in Magento 2 with our comprehensive guide! Whether you're a beginner or an experienced developer, this resource is your ultimate companion for troubleshooting Magento 2. Here's what you'll find inside: 🔹 A breakdown of development modes and their best use cases 🔹 Must-have tools like Xdebug and PhpStorm 🔹 How to activate developer modes and enable template path hints 🔹 Leveraging Magento logs for actionable insights Start mastering Magento 2 troubleshooting today! Read more: https://lnkd.in/gaDKUcSS
To view or add a comment, sign in
-
How to Create Custom API and Use CRUD Operations in Magento 2 https://lnkd.in/gKtAWK9b
To view or add a comment, sign in
-
🔍 Looking to master Magento 2 debugging? Our latest blog dives into the best methods for debugging your Magento 2 store, essential for ensuring smooth operations and an enhanced customer experience. 🚀 Discover the types of development modes, powerful debugging tools like Xdebug and PhpStorm, enabling developer modes and template path hints, and utilizing Magento logs. 🛠️ Whether you're a seasoned developer or new to Magento 2, this guide is your go-to resource for efficient debugging. 📖 Read now and optimize your eCommerce store! https://lnkd.in/gaDKUcSS
To view or add a comment, sign in
-
An example of a poor naming convention in the Magento core code 👇 Poor naming patterns can cause tons of headaches, and they could be easily avoided in your own custom code. Here's the issue: In the Magento_Customer module's Customer model, there's an "authenticate" function that accepts two args: - $login - $password The problem? $login is completely ambiguous. Could it be: - an auth key? - a username? - an email address? - something else? The first line of that function calls loadByEmail($login). So this hints at it being an email address. But it gets a bit more convoluted because loadByEmail accepts a parameter named $customerEmail. Why was "customer" prepended to the variable name? As Nate Bargatze says… “Nobody knows” 😂 Let's call this what it is: horribly written spaghetti code. The concession is that this code can be traced back to a commit from 14 years ago. So it was likely imported from Magento 1 and never corrected or refactored. While we can't fix legacy code like this, we can prevent writing it moving forward in our own code. This is exactly why code reviews matter. Keeping code and naming conventions top-of-mind, and as simple as possible, is also always a good decision. If you hate those "pedantic" pushbacks in your code reviews... just remember this code analysis as a great example of why a review session can prevent your own codebase from becoming a big plate of spaghetti. // Macademy is the simplest way to learn Magento 🟧 // Join 9,000+ devs & get three free video lessons every week → link in bio
To view or add a comment, sign in
-
-
Magento getters can sometimes return null. Wuh? 🤔 Something you may not know: There are two methods to get data from Magento, and one can cause hard-to-find debugging issues. // USING GETDATA // getData() → More explicit → No hidden conversions → Easier to debug → Better performance → Works consistently Example: // Looks for exactly what you typed $block->getData('customViewModel') // MAGIC GETTERS → Looks cleaner → Converts camelCase to snake_case → Has hidden conversion logic → Can cause unexpected nulls → ...but is more prone to bugs Example: // Internally looks for 'custom_view_model' $block->getCustomViewModel() // REAL WORLD GOTCHA Layout XML: <argument name="customViewModel" .../> This works: $block->getData('customViewModel') But this returns null! $block->getCustomViewModel() This can cause completely unnecessary headaches when it comes time to debugging Magento templates. // DO YOU USE MAGIC? Which method do you prefer in your Magento projects? // Macademy is the simplest way to learn Magento 🟧 // Full lesson → https://lnkd.in/gszgPyjA
Magento 2’s getData() and magic getter methods
To view or add a comment, sign in
-
Frustrated with manually dealing with invalidated cache in Magento? It can be a real hassle. If there are multiple invalidated caches, and you need to check the box of EACH ONE. This is pointless and can take you away from coding. This is where the Magento 2 Selective Cache module by Max Pronko comes into play. It adds a new "Refresh Invalidated Cache" button to the Cache Management page. With just a click, you can clean up all those invalidated cache types at once. What's neat about this is that you can even create a cronjob to automatically refresh invalidated caches. This is a simple update, but it can make Magento cache management a whole lot simpler. Check out the module on GitHub at https://lnkd.in/gN9fnEVf
To view or add a comment, sign in
-
-
🚨 Developers, ever placed a test order in production? I did. 😱 Learn how a simple Chrome extension saved my workflow and could save yours too! ✅ Prevent costly mistakes ✅ Boost productivity ✅ Customize your Magento Admin Panel Bonus: I love this tool and is now part of my daily workflow routine. Read my latest blog post to discover this game-changing tip. Don't be like me - be better! #WebDevelopment #EcommerceTips #MagentoAdmin #DeveloperHacks
To view or add a comment, sign in
-
Blog: "Setup a #Magento module via setup:upgrade or not?" I personally favor a different approach: I assume that people are only modifying a Magento instance if that instance is in the Developer Mode. When a module Foo_Bar therefore needs to be enabled, the following command needs to be executed... https://lnkd.in/eZYnttwB
To view or add a comment, sign in
-
Blog "Setup a #Magento module via setup:upgrade or not?" Using the command setup:upgrade for enabling modules, to my opinion, sets wrong expectations. It is better to be explicit about all steps. A proper Magento developer needs to thoroughly understand those underlying steps anyway. https://lnkd.in/eZYnttwB
To view or add a comment, sign in