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 Name | Package Name | Repository URL |
---|---|---|
PublishPress Authors | publishpress-authors | https://github.com/publishpress/publishpress-authors |
PublishPress Authors Pro | publishpress-authors-pro | https://github.com/publishpress/publishpress-authors-pro |
PublishPress Blocks | publishpress-blocks | https://github.com/publishpress/publishpress-blocks |
PublishPress Blocks Pro | publishpress-blocks-pro | https://github.com/publishpress/publishpress-blocks-pro |
PublishPress Capabilities | publishpress-capabilities | https://github.com/publishpress/publishpress-capabilities |
PublishPress Capabilities Pro | publishpress-capabilities-pro | https://github.com/publishpress/publishpress-capabilities-pro |
PublishPress Checklists | publishpress-checklists | https://github.com/publishpress/publishpress-checklists |
PublishPress Checklists Pro | publishpress-checklists-pro | https://github.com/publishpress/publishpress-checklists-pro |
PublishPress Future | publishpress-future | https://github.com/publishpress/publishpress-future |
PublishPress Future Pro | publishpress-future-pro | https://github.com/publishpress/publishpress-future-pro |
PublishPress Planner | publishpress-planner | https://github.com/publishpress/publishpress-planner |
PublishPress Planner Pro * | publishpress-planner-pro | https://github.com/publishpress/publishpress-planner-pro |
PublishPress Permissions | publishpress-permissions | https://github.com/publishpress/publishpress-permissions |
PublishPress Permissions Pro * | publishpress-permissions-pro | https://github.com/publishpress/publishpress-permissions-pro |
PublishPress Revisions | publishpress-revisions | https://github.com/publishpress/publishpress-revisions |
PublishPress Revisions Pro * | publishpress-revisions-pro | https://github.com/publishpress/publishpress-revisions-pro |
PublishPress Series | publishpress-series | https://github.com/publishpress/publishpress-series |
PublishPress Series Pro * | publishpress-series-pro | https://github.com/publishpress/publishpress-series-pro |
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:
- Backup Your Site: Always a good first step before making changes to your plugins.
- 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.
- 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. - Run Composer Update: Execute the command
composer update
. - 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.