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

by mageefy on Feb 13, 2023 Celebrities 405 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: 16976
Publishing
Articles: 79,235
Categories: 202
Online
Active Users: 1175
Members: 1
Guests: 1174
Bots: 13234
Visits last 24h (live): 8979
Visits last 24h (bots): 69405

Latest Comments

Opting for a Vip Escort Delhi professional is a commitment to a premium, secure, and discreet lifestyle. Their unwavering focus on your desires, set within a private and comfortable...
I really enjoyed exploring Article Realm because it covers a variety of useful topics for people interested in building an online presence. This article especially highlights how SEO, keywords,...
on Sep 1, 2026 about The Latest Online Business
I like the focus on identifying specific gains from personal content marketing because it makes the strategy feel more purposeful than simply posting regularly and hoping something sticks. In my...
I also liked the point about low-traffic websites. AI may identify behavioral patterns faster, but when the sample size is too small, the test results can still be unreliable. A tool can speed up...
The article also made me think about something that's easy to overlook: backlinks should ultimately provide value to real users. If a link has no real context and exists only to increase the...
FNAF Game is one of those games that can make even a quiet room feel terrifying. I really enjoy how the game builds tension slowly instead of relying only on sudden scares. Watching the cameras,...
Deadshot IO is a really enjoyable FPS experience for players who like fast combat and competitive gameplay.
It is the easiest and fastest way to monetize a website. All you need to do is sign up and install the plugin, after which you can decide how many ads to display and how much revenue to generate....
It is the easiest and fastest way to monetize a website. All you need to do is sign up and install the plugin, after which you can decide how many ads to display and how much revenue to generate....
It is the easiest and fastest way to monetize a website. All you need to do is sign up and install the plugin, after which you can decide how many ads to display and how much revenue to generate....

Translate To: