Articles, Tutorials

Submitting your Composer-powered plugin to

Are you working on a new super useful WordPress plugin? Do you want it to be developer-friendly? Define it as a Composer package and submit it to the official Composer package repository: Other programmers can then require your plugin as a dependency to their projects. You’ll make their lives much better and they’ll give you a hug.

Defining a plugin as Composer package

Before using Composer, you need to download and install it. When installed, open your command line application and navigate to your plugin’s main directory. Run

composer init

from the command line. An interactive Composer config generator will guide you through the process. Fill out the package name and rest of the fields. After that, edit the generated composer.json file and add a new key-value pair:

"type": "wordpress-plugin"

under the "name" key. You also need to add composer/installers into the "require" part of the file:

"require": {
    "composer/installers": "~1.0.12"

Using git, commit and push the plugin to GitHub or any other online git repository.

Submitting the plugin to

Create a new account Hit the “Submit Package” button. Copy-paste the plugin’s online git repository URL to the input field and hit “Check”. Finish the process.

Congratulations, your plugin is now in the official Composer package repository!

Now, I can simply require it and have it installed into my WordPress project’s plugins directory.

Additional resources

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s