Skip to main content

🚧 Plugins Todo 🚧

  • Installing plugins through Composer
  • Adding a plugin to Composer
  • Adding an SSH key of a developer to the private-packages repo
  • Activate plugins through code

🚧️ PAGE STILL UNDER CONSTRUCTION 🚧️

Add private plugins

For adding private plugins you need to have archive with plugin.

Process:

  • Create empty repo
  • Add files in repo
  • Add composer.json
  • Commit change
  • Create tag version plugin
  • Push to BitBucket

Create empty repo

Go to Private Plugin in Bitbucket (https://bitbucket.org/private-packages/). You usually don't have access to the repo. If you need to get access for add plugin write (mark@dreamersofday.co or valera@dreamersofday.co).

Steps:

  • Go to Bitbucket.org
  • Click Create repository
  • Select
    • Workspace : Private Packages
    • Project: premium-plugins
    • Repository name: (Write any name)
    • Access level: Check
    • Include a README? : NO
    • Default branch name: empty
    • Include .gitignore? : NO
  • Click Create repository

Add files in repo

Steps:

  • Copy empty repo
    git clone git@bitbucket.org:private-packages/{RepoName}.git
  • Go to folder with repo
    cd {RepoName}
  • Copy in this folder all files plugin

    Warning! You must not copy hidden files in plugin

Add composer.json

This file contains settings so that it can be added to another project. Steps:

  • Create file composer.json in root folder your repo {RepoName}
  • Add in composer.json
{
"name": "private-plugins/{plugin-name}",
"description": "{Plugin name}",
"type": "wordpress-plugin",
"require": {
"composer/installers": "1.*"
}
}

Warning! {plugin-name} - in name use -. Don't use spaces {Plugin name} - name plugin. You can use spaces

Example composer.json: Add Gravity form plugin

{
"name": "private-plugins/gravity-forms",
"description": "Gravity Forms",
"type": "wordpress-plugin",
"require": {
"composer/installers": "1.*"
}
}

Commit change

Steps:

  • Add all files in repo. Flag -f need for add in repo absolute all files
    git add . -f
  • Create commit
    git commit -m "Init plugin repo"

Create tag version plugin

The tag is needed for plugin version control. Try to find plugin version in file changelog.txt. If this succeeds, then install the plugin version, if this is not possible, set the version to "1.0.0"

git tag 1.0.0

or

git tag {plugin-version}

Push to BitBucket

Push all files and tags to BitBucket

git push origin master --tags

Info

If you find error in this article write valera@dreamersofday.co or Slack.