Install PublishPress Plugins Using Composer

It is possible to install and manage the PublishPress plugins using Composer.

The instructions for Free and Pro plugins are similar, the only difference is that Pro plugins require authentication to our private repositories.

No matter if you are using WPStarter, Bedrock, pure Composer, or any other boilerplate, the settings are mostly the same.

WPStarter or Bedrock are not required, but they are some of the different ways you can use to install WordPress itself as a Composer dependency.


Compose Setup for PublishPress Plugins #

Settings for composer.json #

The following example shows how to configure the PublishPress Authors plugin.

{
  "repositories": [
    {
      "type": "github",
      "url": "https://github.com/publishpress/publishpress-authors",
      "only": ["publishpress/publishpress-authors"]
    }
  ],
  "require": {
    "publishpress/publishpress-authors": "*"
  },
  "config": {
    "preferred-install": {
      "publishpress/publishpress-authors": "dist"
    }
}

For other PublishPress plugins, you can find the respective package name or repository URL for the other plugins in the table below.

For Free plugins, you can use our Github repo of the WPackagist repository. Pro plugins require authentication, which is described in the next main topic.

Plugin NamePackage NameRepository URL
PublishPress Authorspublishpress-authorshttps://github.com/publishpress/publishpress-authors
PublishPress Authors Propublishpress-authors-prohttps://github.com/publishpress/publishpress-authors-pro
PublishPress Blockspublishpress-blockshttps://github.com/publishpress/publishpress-blocks
PublishPress Blocks Propublishpress-blocks-prohttps://github.com/publishpress/publishpress-blocks-pro
PublishPress Capabilitiespublishpress-capabilitieshttps://github.com/publishpress/publishpress-capabilities
PublishPress Capabilities Propublishpress-capabilities-prohttps://github.com/publishpress/publishpress-capabilities-pro
PublishPress Checklistspublishpress-checklistshttps://github.com/publishpress/publishpress-checklists
PublishPress Checklists Propublishpress-checklists-prohttps://github.com/publishpress/publishpress-checklists-pro
PublishPress Futurepublishpress-futurehttps://github.com/publishpress/publishpress-future
PublishPress Future Propublishpress-future-prohttps://github.com/publishpress/publishpress-future-pro
PublishPress Plannerpublishpress-plannerhttps://github.com/publishpress/publishpress-planner
PublishPress Planner Pro *publishpress-planner-prohttps://github.com/publishpress/publishpress-planner-pro
PublishPress Permissionspublishpress-permissionshttps://github.com/publishpress/publishpress-permissions
PublishPress Permissions Pro *publishpress-permissions-prohttps://github.com/publishpress/publishpress-permissions-pro
PublishPress Revisionspublishpress-revisionshttps://github.com/publishpress/publishpress-revisions
PublishPress Revisions Pro *publishpress-revisions-prohttps://github.com/publishpress/publishpress-revisions-pro
PublishPress Seriespublishpress-serieshttps://github.com/publishpress/publishpress-series
PublishPress Series Pro *publishpress-series-prohttps://github.com/publishpress/publishpress-series-pro
List of package names and repositories for installing PublishPress plugins on Composer

Installing From a Local Path #

Composer supports local paths for installing packages from a local directory, instead of referencing them to download from a remote repository URL. In that case, you can still use our plugins, manually downloading the ZIP files you need and moving them to the specific folder you want. Then instead of using a repository URL in the “composer.json” file, you can use the following repository configuration:

{
  "repositories": [
    {
      "type": "path",
      "url": "../../packages/the-plugin-package"
    }
  ]
}

Directory Names #

Some plugins like Blocks, Capabilities, and Future, were renamed in the past, so when they are installed in a site using the plugins directory, or by uploading a ZIP package, they will be installed in a folder named as their respective legacy name. But if installed by Composer, all the plugins will be in a folder named as the package name used in the “require” setting in the “composer.json” file.


PublishPress Pro Repository Authentication #

If you have an active PublishPress subscription, please contact us. The number of Composer users does depend on your plan. Our 1 Site plans provide support for 1 key, our 5 Site plans provide support for 5 keys, and so on.

Access to our private repositories using SSH Keys #

Send us one public SSH key per repository and ask for access. It requires changing the Repository URL by adding the suffix .git at the end, like: https://github.com/publishpress/publishpress-authors.git. You will need to generate and send one key per repository you want to access. In case you need more info about how to generate SSH keys you can read this documentation: Generating a new SSH key and adding it to the ssh-agent.

Access to our private repositories using GitHub User #

Please send us your GitHub user and ask for repository access. You can use the GitHub Personal Token in your server for authenticating on Composer.

You will be able to access multiple repositories using the same GitHub User, according to your active subscription.


Switching to Composer for Existing Plugins #

If you've previously installed a PublishPress plugin through WordPress and now wish to manage it using Composer, you can easily make the transition without uninstalling the plugin from the WordPress admin panel. Here are the steps:

  1. Backup Your Site: Always a good first step before making changes to your plugins.
  2. Delete the Plugin Folder: Navigate to your WordPress plugins directory and delete the folder of the plugin you want to manage with Composer. This ensures that there are no conflicts when Composer installs the plugin.
  3. Add the Plugin to the Composer File: Open the composer.json file and add the PublishPress plugin as a requirement following the instructions from the beginning of this document.
  4. Run Composer Update: Execute the command composer update.
  5. Visit the Admin Panel: The first time you visit your WordPress admin panel after the update, any required migration tasks will automatically run or be scheduled to run in the background.