0

I am learning WordPress Plugin development. I am going to submit the plugin in wordpress.org.

In this regard how can I use Composer in my plugin ?

When should I run composer install ? Should I run command before submit ?

2
  • 4
    you can use composer like in any php development. edit your question to give more details.
    – mmm
    Commented Aug 6 at 8:43
  • Thanks @mmm. When should I run composer install ? Should I run command before submit ?
    – Foysal
    Commented Aug 7 at 5:22

1 Answer 1

2

You are using composer to install libraries for your project, that you later use in your code, so yes, you should run and use composer during development, finish your whole code, and then you can submit your plugin with final code.

When you first submit your plugin, WordPress team is evaluating your code in terms of security, good practices etc. so the code you are submitting should be your final, working and tested code.

2
  • Thanks @mWin. That mean's I'll run composer install at the time of plugin development. After that I'll package up the result and submit to wordpress.org. Right ? I read this post wordpress.stackexchange.com/questions/352863/….
    – Foysal
    Commented Aug 7 at 9:15
  • 1
    @Foysal yes, when you will submit code to WordPress you put it on SVN, and you can run composer install on SVN, also you do not want to put development files on SVN (this will increase package size). On SVN you should send production ready code. So composer install should be run locally, npm/yarn install if you are using React also should be executed before you put code on SVN.
    – mWin
    Commented Aug 13 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.