Skip to content

Commit 6c2ea2a

Browse files
committed
Created docs on how to install plugins.
1 parent ee32488 commit 6c2ea2a

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
| Title | Description |
1919
|------------------------------------|------------------------------|
2020
| [Automatic Persisted Queries in Next.js Pages Router](how-to/nextjs-pages-router/enable-apq/index.md) | Learn how to reduce latency and network strain in GraphQL queries using Automatic Persisted Queries (APQ) by hashing and reusing query hashes. |
21+
| [Install Toolkit Plugins via Composer](how-to/install-toolkit-plugins/index.md) | Step-by-step guide to installing and activating HWP Toolkit plugins in your WordPress environment using Composer. |
2122

2223

2324
## Contributing
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Installing HWP Toolkit Plugins with Composer
2+
3+
You can install any HWP Toolkit plugin using Composer, which is the recommended way for modern WordPress development workflows.
4+
5+
You can also install them manually from our [Releases](https://github.com/wpengine/hwptoolkit/releases) page.
6+
7+
## Requirements
8+
9+
- Composer 1.x or 2.x
10+
- WordPress 6.0+
11+
- PHP 7.4+
12+
13+
## Quick Start: Example `composer.json`
14+
15+
Copy and use this example as your `composer.json` for a typical WordPress project using HWP Toolkit plugins:
16+
17+
```json
18+
{
19+
"name": "wpengine/headless-wordpress-toolkit-composer-test",
20+
"description": "Headless WordPress Toolkit Composer Test",
21+
"repositories": [
22+
{
23+
"type": "composer",
24+
"url": "https://raw.githubusercontent.com/wpengine/hwptoolkit/main/plugins/composer-packages.json"
25+
}
26+
],
27+
"require": {
28+
"wpengine/hwp-previews": "*",
29+
"wpengine/wp-graphql-webhooks": "*"
30+
},
31+
"config": {
32+
"allow-plugins": {
33+
"composer/installers": true
34+
}
35+
}
36+
}
37+
```
38+
39+
## Installation Steps
40+
41+
1. **Copy the above JSON into your project's `composer.json` file.**
42+
43+
2. **Install dependencies:**
44+
45+
```bash
46+
composer install
47+
```
48+
49+
3. **Activate the plugin(s) in WordPress**
50+
51+
Go to the WordPress admin and activate the plugin(s) as usual.
52+
53+
---
54+
55+
## Updating
56+
57+
To update to the latest version:
58+
59+
```bash
60+
composer update wpengine/hwp-previews wpengine/wp-graphql-webhooks
61+
```
62+
63+
---
64+
65+
## Troubleshooting
66+
67+
- If you see an error about missing `composer/installers`, run `composer require composer/installers`.
68+
- If the plugin does not appear in your plugins list, check your `installer-paths` and that you are in the correct WordPress directory.
69+
- Ensure the `repositories` section is present and correct in your `composer.json`.
70+
71+
---
72+
73+
## Contributing
74+
75+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

plugins/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ WordPress plugins for the Headless WordPress Toolkit. Each plugin is paired with
1010
| [`wp-graphql-webhooks`](./wp-graphql-webhooks/README.md) | A WordPress plugin that extends [WPGraphQL](https://www.wpgraphql.com/) to support webhook subscriptions and dispatching for headless WordPress environments. This allows external applications to listen and respond to WordPress content changes through GraphQL-driven webhook events. |
1111

1212

13+
## Install
14+
15+
You can install HWP Toolkit plugins in two ways:
16+
17+
- **Using Composer:** Follow the [step-by-step guide](../docs/how-to/install-toolkit-plugins/index.md) to install and activate plugins in your WordPress environment.
18+
- **Manual Download:** Visit the [Releases](https://github.com/wpengine/hwptoolkit/releases) page to manually download the plugin files and upload them to your WordPress site.
19+
20+
21+
>[!NOTE]
22+
> The main composer packages file [composer-packages.json](composer-packages.json) is automatically updated as part our release workflow.
23+
1324
## Contributing
1425

1526
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

0 commit comments

Comments
 (0)