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

by mageefy on Feb 13, 2023 Celebrities 399 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/37103-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: 16857
Publishing
Articles: 78,802
Categories: 202
Online
Active Users: 284
Members: 0
Guests: 284
Bots: 2468
Visits last 24h (live): 6424
Visits last 24h (bots): 44946

Latest Comments

Busy work schedules and physical demands often leave people feeling exhausted. Many adults choose a Stamina Capsule For Man to complement their healthy lifestyle.
Nice Post Good Work Mumbai
on Aug 11, 2026 about Activating Peacock TV on Fire TV:
Experience the joy of eggy car , where every level presents a new challenge! Navigate through tricky paths and keep your egg intact. With its simple controls and addictive gameplay, Eggy Car is...
Besides these intense study and training sessions, if you need a lighthearted form of management and constructive entertainment, a fun simulation game like monkey mart would certainly...
The discreet professionalism of Escorts Ito ensures your private moments remain your own, allowing you to fully immerse yourself in the pleasure of their company.  
Thanks for sharing 
on Aug 11, 2026 about Patricklamma
I really enjoyed going through your collection of articles. You have covered a wide range of useful topics, and the consistency of your writing shows genuine effort and knowledge. I especially...
on Aug 11, 2026 about Dr. Sam Khoury
A well-designed home also benefits from the right flooring and décor. TheRugShopUK offers rugs in various styles and sizes that can add comfort, warmth, and character to granny flats, bedrooms,...
Quordle is like Wordle on steroids! Solving four words at once is a fun challenge that keeps me focused.

Translate To: