Which steps need to follow For Standard Extension Development for Magento 2

by mageefy on Feb 10, 2023 Celebrities 404 Views

For a Magento 2 extension, you should be following the Magento EQP (Extension Quality Program) code standards. Magento provides a tool to validate the PSR-2 code standards and most of Magento's added standards on top of that. Magento has provided the package validation tool, Which detects any kind of packaging errors to reduce the module rejections from the Marketplace.

Steps which need to follow For Standard Extension Development for Magento 2 :

  • 1) must have composer.json in root folder of extension(Eg. app/code/Vendor/Module/composer.json)
  • 2) must have registration.php in root folder of extension (Eg. app/code/Vendor/Module/registration.php)
  • 3) Do not use $_REQUEST, $_POST directly
  • 4) Never end class file with ending php tag ?>
  • 5) Remove unnecessory code and comments
  • 6) Use spaces for indentation
  • 7) check with phpcs coding standard and remove all errors, Refer Coding standard tab
  • 8) Must pass severity=10 while chicking coding standard with MEQP2, Refer coding standard
  • 9) do compilation and resolve all errors
  • 10) validate_m2_package_v2

Follow the below steps to validate your package with "validate_m2_package.php" :

Clone the repository https://github.com/magento/marketplace-tools or Download the file validate_m2_package.php
Now place your module zipped file in the same folder where you placed the previous file.
Note: To zip your package, navigate to root path of your module i.e /app/code/Vendor Name/Module Name/ and then zip your package. Make sure composer.json remains in the root path of your zipped package.

Now execute the following command
$ <path_to_php> validate_m2_package.php -d vendor-modulename.zip

where <path_to_php> is the path to php compiler and vendor-modulename.zip should be name of your module zipped file.

for example:
php validate_m2_package.php -d modulename.zip

https://www.mageefy.com/blog/post/steps-need-follow-standard-extension-development-magento-2

Article source: https://article-realm.com/article/Arts-Entertainment/Celebrities/36997-Which-steps-need-to-follow-For-Standard-Extension-Development-for-Magento-2.html

Comments

No comments have been left here yet. Be the first who will do it.
Safety

captchaPlease input letters you see on the image.
Click on image to redraw.

Reviews

Guest

Overall Rating:

Most Viewed Articles

Statistics

Members
Members: 17266
Publishing
Articles: 79,974
Categories: 202
Online
Active Users: 846
Members: 1
Guests: 845
Bots: 5581
Visits last 24h (live): 5296
Visits last 24h (bots): 36848

Latest Comments

Embarking on a peaceful yoga and Ayurveda retreat in India sounds like the ultimate way to achieve complete inner peace, stress relief, and total mental clarity. Too bad all that inner calm gets...
Finding a detailed global market report on recombinant cell culture supplements hidden away in a music directory is a wild plot twist, it almost as abrupt as running head-first into a sudden spike...
Exploring the majestic forts and royal history of India sounds like an incredible journey through timeless architecture. Too bad no amount of royal heritage can help you master the chaotic,...
This blog really convinced me to do it! Thanks, very good post  Jpbosku    
This blog really convinced me to do it! Thanks, very good post  Jpbosku    
Thanks for sharing these informations. I really like your blog post very much. You have really shared a informative and interesting blog post .    pakde4d    
I love the way you write and share your niche! Very interesting and different!    pakde4d    
Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has...
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information.. pakde4d  
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired...

Translate To: