SLSWC includes a Composer repository that lets you install and update plugins and themes using Composer, just like any other PHP package.
Why Use Composer?
Composer is the standard dependency manager for PHP. Using it to manage your WordPress plugins and themes gives you several advantages:
- Automated updates โ Run a single
composer updatecommand to update all your licensed software at once, instead of updating each plugin or theme manually through the WordPress admin. - Version pinning โ Lock your dependencies to specific versions using
composer.lock, ensuring your production environment runs exactly the versions you have tested. - CI/CD integration โ Incorporate plugin and theme installation into your automated deployment pipelines. Your build server can pull the latest licensed versions without manual intervention.
- Reproducible environments โ Every team member and server gets the same versions, eliminating "works on my machine" issues.
Tip: You will need an API key or license key for authentication. If you have not generated one yet, see API Key first.
Prerequisites
- A valid, active license for the product you want to install.
- An API key or your license key for authentication (see API Key).
- Composer installed on your system.
Repository URL
The Composer repository is available at:
https://your-store.com/slswc-composer/packages.json
Replace your-store.com with the actual store URL.
Note: The store must have the Composer repository enabled. It is off by default, so if the URL returns a 404, ask the store owner to turn it on.
Setting Up composer.json
Add the SLSWC repository to your project's composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://your-store.com/slswc-composer/"
}
]
}
Authentication
The Composer repository uses HTTP Basic Auth. You can authenticate with either:
- Your license key as both the username and password
- Your API consumer key and consumer secret (from My Account > API Key)
Option 1: Interactive Prompt
When you run composer require, Composer will prompt for credentials. Enter your license key as the username (and password), or your consumer key and secret.
Option 2: auth.json
Create an auth.json file in your project root (or Composer home directory) so credentials are stored locally:
{
"http-basic": {
"your-store.com": {
"username": "your-license-key-or-consumer-key",
"password": "your-license-key-or-consumer-secret"
}
}
}
Important: Add
auth.jsonto your.gitignoreto avoid committing credentials.
Installing a Package
Once the repository and authentication are configured, install a product:
composer require vendor-name/product-slug
The vendor name and product slug are determined by the store. For example:
composer require your-store/my-awesome-plugin
Packages are typed as either wordpress-plugin or wordpress-theme, so they install to wp-content/plugins/ or wp-content/themes/ automatically (when using composer/installers).
Updating Packages
Run the standard Composer update command:
composer update vendor-name/product-slug
Or update all packages:
composer update
The repository serves only products you have a valid license for (active, inactive, or expiring). Expired licenses are excluded.
Troubleshooting
| Problem | Solution |
|---|---|
| 401 Unauthorized | Check that your license key or API credentials are correct. Make sure the license is not expired. |
| 404 Not Found | Verify the store URL is correct. Confirm that the Composer repository is enabled by the store owner. |
| Package not found | Ensure you have a valid license for that specific product. Check the exact vendor/slug with the store owner. |
| Outdated packages list | The repository response is cached for up to 1 hour. Wait or ask the store owner to clear the cache. |
Related Pages
- API Key โ Generate the credentials needed for Composer authentication
- License Keys โ View and manage the licenses that grant Composer access
- FAQ โ Common questions including Composer setup