diff --git a/.github/scripts/get_plugin_slug.sh b/.github/scripts/get_plugin_slug.sh
index 3e86aace..096dfd9b 100644
--- a/.github/scripts/get_plugin_slug.sh
+++ b/.github/scripts/get_plugin_slug.sh
@@ -29,16 +29,40 @@ done
# Get unique plugin names
UNIQUE_PLUGINS=($(printf '%s\n' "${PLUGINS[@]}" | sort -u))
-# Find the first plugin that actually exists
-PLUGIN_SLUG=""
+# Find all valid plugins that have changes
+VALID_PLUGINS=()
for plugin in "${UNIQUE_PLUGINS[@]}"; do
- if [ -d "plugins/$plugin" ] || [[ " ${CHANGED_FILES[@]} " =~ "plugins/$plugin/" ]]; then
- PLUGIN_SLUG="$plugin"
- echo "Found plugin in changes or directory: $PLUGIN_SLUG"
- break
+ if [ -d "plugins/$plugin" ]; then
+ count=$(printf '%s\n' "${PLUGINS[@]}" | grep -c "^$plugin$")
+ VALID_PLUGINS+=("$plugin")
+ echo "Found plugin with $count changes: $plugin"
fi
done
+# Output all valid plugins as JSON array for matrix strategy
+if [ ${#VALID_PLUGINS[@]} -gt 0 ]; then
+ # Simple, reliable JSON array generation
+ PLUGINS_JSON="["
+ for i in "${!VALID_PLUGINS[@]}"; do
+ if [ $i -eq 0 ]; then
+ PLUGINS_JSON="$PLUGINS_JSON\"${VALID_PLUGINS[i]}\""
+ else
+ PLUGINS_JSON="$PLUGINS_JSON,\"${VALID_PLUGINS[i]}\""
+ fi
+ done
+ PLUGINS_JSON="$PLUGINS_JSON]"
+
+ echo "plugins=$PLUGINS_JSON" >> "$GITHUB_OUTPUT"
+ echo "has-plugins=true" >> "$GITHUB_OUTPUT"
+
+ # For backward compatibility, set slug to first plugin
+ PLUGIN_SLUG="${VALID_PLUGINS[0]}"
+else
+ echo "plugins=[]" >> "$GITHUB_OUTPUT"
+ echo "has-plugins=false" >> "$GITHUB_OUTPUT"
+ PLUGIN_SLUG=""
+fi
+
if [ -z "$PLUGIN_SLUG" ]; then
echo "No valid plugin directory found"
exit 1
diff --git a/.github/scripts/update_composer_package.sh b/.github/scripts/update_composer_package.sh
index bdc0f7b8..1791b658 100755
--- a/.github/scripts/update_composer_package.sh
+++ b/.github/scripts/update_composer_package.sh
@@ -18,7 +18,7 @@ usage() {
echo " description - Optional: Package description (uses generic default if not provided)"
echo ""
echo "Examples:"
- echo " $0 '0.0.2' 'https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.2/wp-graphql-webhooks.zip'"
+ echo " $0 '0.0.2' 'https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.2/wpgraphql-webhooks.zip'"
echo ""
echo " With custom package name and description:"
echo " $0 '0.0.5' 'https://example.com/plugin.zip' 'wpengine/my-plugin' 'My custom plugin description'"
diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml
index c897155c..ece6c118 100644
--- a/.github/workflows/plugin-artifact-for-pr.yml
+++ b/.github/workflows/plugin-artifact-for-pr.yml
@@ -9,41 +9,68 @@ on:
- 'plugins/*/**.json'
jobs:
- create-plugin-artifact:
- name: Create Plugin Artifact
+ detect-plugins:
+ name: Detect Changed Plugins
runs-on: ubuntu-latest
-
+ outputs:
+ plugins: ${{ steps.plugin.outputs.plugins }}
+ has-plugins: ${{ steps.plugin.outputs.has-plugins }}
steps:
- name: Checkout
uses: actions/checkout@v4
- - name: Get changed plugin directory
+ - name: Get changed plugin directories
id: plugin
run: |
bash .github/scripts/get_plugin_slug.sh \
${{ github.event.pull_request.base.sha }} \
${{ github.event.pull_request.head.sha }}
- - name: Create plugin artifact
+ create-plugin-artifacts:
+ name: Create Plugin Artifacts
+ runs-on: ubuntu-latest
+ needs: detect-plugins
+ if: needs.detect-plugins.outputs.has-plugins == 'true'
+ strategy:
+ fail-fast: false
+ matrix:
+ plugin: ${{ fromJson(needs.detect-plugins.outputs.plugins) }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Create plugin artifact for ${{ matrix.plugin }}
uses: ./.github/actions/create-plugin-artifact
- env:
- PLUGIN_SLUG: ${{ steps.plugin.outputs.slug }}
with:
- slug: ${{ env.PLUGIN_SLUG }}
+ slug: ${{ matrix.plugin }}
composer-options: '--no-progress --optimize-autoloader --no-dev'
- - name: Comment with artifact link
+ comment-on-pr:
+ name: Comment with Artifact Links
+ runs-on: ubuntu-latest
+ needs: [detect-plugins, create-plugin-artifacts]
+ if: needs.detect-plugins.outputs.has-plugins == 'true'
+ steps:
+ - name: Comment with artifact links
uses: actions/github-script@v7
env:
- PLUGIN_SLUG: ${{ steps.plugin.outputs.slug }}
+ PLUGINS: ${{ needs.detect-plugins.outputs.plugins }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
const runId = context.runId;
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`;
- const slug = process.env.PLUGIN_SLUG;
- const body = `âšī¸ [Download the latest ${slug} plugin zip from this PR](${artifactUrl})\n(See the 'Artifacts' section at the bottom)`;
+ const plugins = JSON.parse(process.env.PLUGINS);
+
+ let body = '## đĻ Plugin Artifacts Ready!\n\n';
+ body += `[Download from GitHub Actions run](${artifactUrl})\n\n`;
+ body += '**Available plugins:**\n';
+ plugins.forEach(plugin => {
+ body += `- â
${plugin}.zip\n`;
+ });
+ body += '\nSee the "Artifacts" section at the bottom of the Actions run page';
// Find existing comment from this bot
const comments = await github.rest.issues.listComments({
@@ -55,7 +82,7 @@ jobs:
const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.user.login === 'github-actions[bot]' &&
- comment.body.includes(`âšī¸ [Download the latest ${slug} plugin zip from this PR]`)
+ comment.body.includes('## đĻ Plugin Artifacts Ready!')
);
if (botComment) {
diff --git a/docs/how-to/install-toolkit-plugins/index.md b/docs/how-to/install-toolkit-plugins/index.md
index 394de293..5ee2c251 100644
--- a/docs/how-to/install-toolkit-plugins/index.md
+++ b/docs/how-to/install-toolkit-plugins/index.md
@@ -26,7 +26,7 @@ Copy and use this example as your `composer.json` for a typical WordPress projec
],
"require": {
"wpengine/hwp-previews": "*",
- "wpengine/wp-graphql-webhooks": "*"
+ "wpengine/wpgraphql-webhooks": "*"
},
"config": {
"allow-plugins": {
@@ -57,7 +57,7 @@ Copy and use this example as your `composer.json` for a typical WordPress projec
To update to the latest version:
```bash
-composer update wpengine/hwp-previews wpengine/wp-graphql-webhooks
+composer update wpengine/hwp-previews wpengine/wpgraphql-webhooks
```
---
diff --git a/plugins/README.md b/plugins/README.md
index 3d4287fa..cdf4b2d2 100644
--- a/plugins/README.md
+++ b/plugins/README.md
@@ -7,7 +7,7 @@ WordPress plugins for the Headless WordPress Toolkit. Each plugin is paired with
| Plugin | Description |
|--------|-------------|
| [`hwp-previews`](./hwp-previews/README.md) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
-| [`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. |
+| [`wpgraphql-webhooks`](./wpgraphql-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. |
## Install
diff --git a/plugins/composer-packages.json b/plugins/composer-packages.json
index 5bca95f2..ff8bcdf2 100644
--- a/plugins/composer-packages.json
+++ b/plugins/composer-packages.json
@@ -160,9 +160,9 @@
}
}
},
- "wpengine/wp-graphql-webhooks": {
+ "wpengine/wpgraphql-webhooks": {
"0.0.4": {
- "name": "wpengine/wp-graphql-webhooks",
+ "name": "wpengine/wpgraphql-webhooks",
"version": "0.0.4",
"type": "wordpress-plugin",
"description": "Headless webhooks for WPGraphQL",
@@ -180,7 +180,7 @@
"email": "support@wpengine.com"
},
"dist": {
- "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.4/wp-graphql-webhooks.zip",
+ "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.4/wpgraphql-webhooks.zip",
"type": "zip"
},
"require": {
@@ -188,7 +188,7 @@
}
},
"0.0.3": {
- "name": "wpengine/wp-graphql-webhooks",
+ "name": "wpengine/wpgraphql-webhooks",
"version": "0.0.3",
"type": "wordpress-plugin",
"description": "Headless webhooks for WPGraphQL",
@@ -206,7 +206,7 @@
"email": "support@wpengine.com"
},
"dist": {
- "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.3/wp-graphql-webhooks.zip",
+ "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.3/wpgraphql-webhooks.zip",
"type": "zip"
},
"require": {
@@ -214,7 +214,7 @@
}
},
"0.0.2": {
- "name": "wpengine/wp-graphql-webhooks",
+ "name": "wpengine/wpgraphql-webhooks",
"version": "0.0.2",
"type": "wordpress-plugin",
"description": "Headless webhooks for WPGraphQL",
@@ -232,7 +232,7 @@
"email": "support@wpengine.com"
},
"dist": {
- "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.2/wp-graphql-webhooks.zip",
+ "url": "https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fwpgraphql-webhooks-wordpress-plugin-0.0.2/wpgraphql-webhooks.zip",
"type": "zip"
},
"require": {
diff --git a/plugins/wpgraphql-debug-extensions/bin/install-test-env.sh b/plugins/wpgraphql-debug-extensions/bin/install-test-env.sh
index 468e3af0..ad437a0b 100644
--- a/plugins/wpgraphql-debug-extensions/bin/install-test-env.sh
+++ b/plugins/wpgraphql-debug-extensions/bin/install-test-env.sh
@@ -149,7 +149,7 @@ setup_plugin() {
fi
# Add this repo as a plugin to the repo
- if [ ! -d $WORDPRESS_ROOT_DIR/wp-content/plugins/wp-graphql-webhooks ]; then
+ if [ ! -d $WORDPRESS_ROOT_DIR/wp-content/plugins/wpgraphql-webhooks ]; then
echo -e "$(status_message "Symlinking the plugin to the WordPress plugins directory...")"
cd "$ORIGINAL_PATH"
diff --git a/plugins/wpgraphql-webhooks/composer.json b/plugins/wpgraphql-webhooks/composer.json
index 9c7bacac..c5192219 100644
--- a/plugins/wpgraphql-webhooks/composer.json
+++ b/plugins/wpgraphql-webhooks/composer.json
@@ -95,7 +95,7 @@
"php:psalm:fix": "psalm --alter"
},
"archive": {
- "name": "wp-graphql-webhooks",
+ "name": "wpgraphql-webhooks",
"exclude": [
"/.*",
"/assets",
diff --git a/plugins/wpgraphql-webhooks/src/Admin/WebhooksListTable.php b/plugins/wpgraphql-webhooks/src/Admin/WebhooksListTable.php
index 480da016..62843bdf 100644
--- a/plugins/wpgraphql-webhooks/src/Admin/WebhooksListTable.php
+++ b/plugins/wpgraphql-webhooks/src/Admin/WebhooksListTable.php
@@ -35,8 +35,8 @@ public function __construct( WebhookRepository $repository ) {
$this->repository = $repository;
parent::__construct( [
- 'singular' => __( 'Webhook', 'wp-graphql-webhooks' ),
- 'plural' => __( 'Webhooks', 'wp-graphql-webhooks' ),
+ 'singular' => __( 'Webhook', 'graphql-webhooks' ),
+ 'plural' => __( 'Webhooks', 'graphql-webhooks' ),
'ajax' => false,
] );
}
@@ -49,11 +49,11 @@ public function __construct( WebhookRepository $repository ) {
public function get_columns() {
return [
'cb' => '',
- 'name' => __( 'Name', 'wp-graphql-webhooks' ),
- 'event' => __( 'Event', 'wp-graphql-webhooks' ),
- 'method' => __( 'Method', 'wp-graphql-webhooks' ),
- 'url' => __( 'URL', 'wp-graphql-webhooks' ),
- 'headers' => __( 'Headers', 'wp-graphql-webhooks' ),
+ 'name' => __( 'Name', 'graphql-webhooks' ),
+ 'event' => __( 'Event', 'graphql-webhooks' ),
+ 'method' => __( 'Method', 'graphql-webhooks' ),
+ 'url' => __( 'URL', 'graphql-webhooks' ),
+ 'headers' => __( 'Headers', 'graphql-webhooks' ),
];
}
@@ -77,7 +77,7 @@ public function get_sortable_columns() {
*/
public function get_bulk_actions() {
return [
- 'delete' => __( 'Delete', 'wp-graphql-webhooks' ),
+ 'delete' => __( 'Delete', 'graphql-webhooks' ),
];
}
@@ -93,12 +93,12 @@ public function process_bulk_action() {
// Verify nonce
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['_wpnonce'] ), 'bulk-' . $this->_args['plural'] ) ) {
- wp_die( esc_html__( 'Security check failed.', 'wp-graphql-webhooks' ) );
+ wp_die( esc_html__( 'Security check failed.', 'graphql-webhooks' ) );
}
// Check permissions
if ( ! current_user_can( 'manage_options' ) ) {
- wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'wp-graphql-webhooks' ) );
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'graphql-webhooks' ) );
}
// Get selected webhooks
@@ -194,7 +194,7 @@ public function column_default( $item, $column_name ) {
return '' . esc_html( $item->method ) . '';
case 'headers':
$count = is_array( $item->headers ) ? count( $item->headers ) : 0;
- return $count > 0 ? sprintf( __( '%d headers', 'wp-graphql-webhooks' ), $count ) : 'â';
+ return $count > 0 ? sprintf( __( '%d headers', 'graphql-webhooks' ), $count ) : 'â';
default:
return '';
}
@@ -236,9 +236,9 @@ public function column_name( $item ) {
);
$actions = [
- 'edit' => sprintf( '%s', esc_url( $edit_url ), __( 'Edit', 'wp-graphql-webhooks' ) ),
- 'test' => sprintf( '%s', $item->id, __( 'Test', 'wp-graphql-webhooks' ) ),
- 'delete' => sprintf( '%s', esc_url( $delete_url ), __( 'Delete', 'wp-graphql-webhooks' ) ),
+ 'edit' => sprintf( '%s', esc_url( $edit_url ), __( 'Edit', 'graphql-webhooks' ) ),
+ 'test' => sprintf( '%s', $item->id, __( 'Test', 'graphql-webhooks' ) ),
+ 'delete' => sprintf( '%s', esc_url( $delete_url ), __( 'Delete', 'graphql-webhooks' ) ),
];
return sprintf(
@@ -253,7 +253,7 @@ public function column_name( $item ) {
* Display when no items
*/
public function no_items() {
- esc_html_e( 'No webhooks found.', 'wp-graphql-webhooks' );
+ esc_html_e( 'No webhooks found.', 'graphql-webhooks' );
}
/**
diff --git a/plugins/wpgraphql-webhooks/wpgraphql-webhooks.php b/plugins/wpgraphql-webhooks/wpgraphql-webhooks.php
index c4963b52..72515d74 100644
--- a/plugins/wpgraphql-webhooks/wpgraphql-webhooks.php
+++ b/plugins/wpgraphql-webhooks/wpgraphql-webhooks.php
@@ -8,7 +8,7 @@
* Author URI: https://github.com/wpengine
* Update URI: https://github.com/wpengine/hwptoolkit
* Version: 0.0.4
- * Text Domain: wpgraphql-webhooks
+ * Text Domain: graphql-webhooks
* Domain Path: /languages
* Requires at least: 6.0
* Tested up to: 6.8
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 10f9fd06..ffa1b80e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -57,7 +57,7 @@ importers:
plugins/hwp-previews: {}
- plugins/wp-graphql-webhooks:
+ plugins/wpgraphql-webhooks:
devDependencies:
'@playwright/test':
specifier: ^1.53.1