From 6bad5a5c39e08aa39838c3de1d75543047428149 Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:14:56 +0100 Subject: [PATCH 1/5] feat: webhooks plugin renamed+beta release --- .../access-functions.php | 152 ------------------ .../deactivation.php | 20 --- .../phpstan/constants.php | 10 -- .../.distignore | 0 .../.editorconfig | 0 .../.env.dist | 0 .../.gitattributes | 0 .../.gitignore | 0 .../.phpcs.xml.dist | 5 +- .../README.md | 2 +- .../ControlStructures/ElseKeywordSniff.php | 0 .../activation.php | 4 +- .../assets/css/admin.css | 0 .../assets/js/admin.js | 0 .../bin/_lib.sh | 0 .../bin/build-docker.sh | 0 .../bin/install-plugins.sh | 0 .../bin/install-test-env.sh | 0 .../bin/run-codeception.sh | 0 .../composer.json | 11 +- .../composer.lock | 58 ++++--- plugins/wp-graphql-webhooks/deactivation.php | 20 +++ .../docker-compose.yml | 0 .../docs/index.md | 0 .../docs/reference.md | 0 .../docs/screenshots/create_webhook-ui.png | Bin plugins/wp-graphql-webhooks/package.json | 19 +++ .../phpcs/WebhooksStandard/ruleset.xml | 0 .../phpstan.neon.dist | 6 +- .../Rules/ClassConstantVarAnnotationRule.php | 0 .../phpstan/class-wp-post-type.stub | 0 .../phpstan/class-wp-taxonomy.stub | 0 .../wp-graphql-webhooks/phpstan/constants.php | 10 ++ .../psalm.xml | 3 +- .../readme.txt | 0 .../src/Admin/WebhooksAdmin.php | 49 +++--- .../src/Admin/WebhooksListTable.php | 2 +- .../views/partials/webhook-header-row.php | 6 +- .../src/Admin/views/webhook-form.php | 0 .../src/Admin/views/webhooks-list.php | 4 +- .../src/Autoloader.php | 4 +- .../src/Entity/Webhook.php | 0 .../src/Events/Interfaces/EventManager.php | 0 .../src/Events/SmartCacheEventMapper.php | 0 .../src/Events/SmartCacheWebhookManager.php | 0 .../src/Events/WebhookEventManager.php | 0 .../src/Fields/RootQuery.php | 6 +- .../src/Handlers/Interfaces/Handler.php | 0 .../src/Handlers/WebhookHandler.php | 0 .../src/Mutation/CreateWebhook.php | 22 +-- .../src/Mutation/DeleteWebhook.php | 16 +- .../src/Mutation/UpdateWebhook.php | 30 ++-- .../src/Plugin.php | 8 +- .../src/PostTypes/WebhookPostType.php | 24 +-- .../Interfaces/WebhookRepositoryInterface.php | 0 .../src/Repository/WebhookRepository.php | 2 +- .../src/Rest/WebhookTestEndpoint.php | 6 +- .../Services/Interfaces/ServiceLocator.php | 0 .../src/Services/PluginServiceLocator.php | 0 .../src/Type/Webhook.php | 16 +- .../src/TypeRegistry.php | 0 .../tests/acceptance.suite.dist.yml | 0 .../tests/acceptance/.gitkeep | 0 .../tests/bootstrap.php | 0 .../tests/functional.suite.dist.yml | 0 .../tests/functional/.gitkeep | 0 .../tests/unit.suite.dist.yml | 0 .../tests/unit/.gitkeep | 0 .../tests/wpunit.suite.dist.yml | 0 .../wp-graphql-webhooks.php} | 62 +++---- 70 files changed, 232 insertions(+), 345 deletions(-) delete mode 100644 plugins/wp-graphql-headless-webhooks/access-functions.php delete mode 100644 plugins/wp-graphql-headless-webhooks/deactivation.php delete mode 100644 plugins/wp-graphql-headless-webhooks/phpstan/constants.php rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.distignore (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.editorconfig (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.env.dist (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.gitattributes (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.gitignore (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/.phpcs.xml.dist (97%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/README.md (97%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/Sniffs/ControlStructures/ElseKeywordSniff.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/activation.php (65%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/assets/css/admin.css (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/assets/js/admin.js (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/bin/_lib.sh (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/bin/build-docker.sh (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/bin/install-plugins.sh (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/bin/install-test-env.sh (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/bin/run-codeception.sh (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/composer.json (94%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/composer.lock (99%) create mode 100644 plugins/wp-graphql-webhooks/deactivation.php rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/docker-compose.yml (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/docs/index.md (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/docs/reference.md (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/docs/screenshots/create_webhook-ui.png (100%) create mode 100644 plugins/wp-graphql-webhooks/package.json rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/phpcs/WebhooksStandard/ruleset.xml (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/phpstan.neon.dist (88%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/phpstan/Rules/ClassConstantVarAnnotationRule.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/phpstan/class-wp-post-type.stub (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/phpstan/class-wp-taxonomy.stub (100%) create mode 100644 plugins/wp-graphql-webhooks/phpstan/constants.php rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/psalm.xml (89%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/readme.txt (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Admin/WebhooksAdmin.php (90%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Admin/WebhooksListTable.php (99%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Admin/views/partials/webhook-header-row.php (80%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Admin/views/webhook-form.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Admin/views/webhooks-list.php (92%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Autoloader.php (87%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Entity/Webhook.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Events/Interfaces/EventManager.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Events/SmartCacheEventMapper.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Events/SmartCacheWebhookManager.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Events/WebhookEventManager.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Fields/RootQuery.php (93%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Handlers/Interfaces/Handler.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Handlers/WebhookHandler.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Mutation/CreateWebhook.php (87%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Mutation/DeleteWebhook.php (87%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Mutation/UpdateWebhook.php (86%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Plugin.php (93%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/PostTypes/WebhookPostType.php (63%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Repository/Interfaces/WebhookRepositoryInterface.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Repository/WebhookRepository.php (99%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Rest/WebhookTestEndpoint.php (96%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Services/Interfaces/ServiceLocator.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Services/PluginServiceLocator.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/Type/Webhook.php (88%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/src/TypeRegistry.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/acceptance.suite.dist.yml (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/acceptance/.gitkeep (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/bootstrap.php (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/functional.suite.dist.yml (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/functional/.gitkeep (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/unit.suite.dist.yml (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/unit/.gitkeep (100%) rename plugins/{wp-graphql-headless-webhooks => wp-graphql-webhooks}/tests/wpunit.suite.dist.yml (100%) rename plugins/{wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php => wp-graphql-webhooks/wp-graphql-webhooks.php} (53%) diff --git a/plugins/wp-graphql-headless-webhooks/access-functions.php b/plugins/wp-graphql-headless-webhooks/access-functions.php deleted file mode 100644 index 2a413c34..00000000 --- a/plugins/wp-graphql-headless-webhooks/access-functions.php +++ /dev/null @@ -1,152 +0,0 @@ - $args { - * Args for the webhook type. - * - * @type string $label Human-readable label for the webhook type (default: $type). - * @type string $description Description of the webhook type (default: ''). - * @type array $events Optional. List of events to register. - * @type array $config Optional. Additional configuration for the webhook. - * } - */ -if ( ! function_exists( 'register_webhook_type' ) ) { - function register_webhook_type( string $type, array $args = [] ): void { - /** @psalm-suppress HookNotFound */ - if ( did_action( 'graphql_register_webhooks' ) > 0 ) { - _doing_it_wrong( 'register_webhook_type', 'Call this before WebhookRegistry::init', '0.1.0' ); - - return; - } - - /** @psalm-suppress HookNotFound */ - add_action( - 'graphql_register_webhooks', - function (WebhookTypeRegistry $registry) use ($type, $args): void { - $events = []; - if ( ! empty( $args['events'] ) && is_array( $args['events'] ) ) { - foreach ( $args['events'] as $eventData ) { - $events[] = new Event( - $eventData['name'], - $eventData['hookName'], - $eventData['callback'] ?? null, - $eventData['priority'] ?? 10, - $eventData['argCount'] ?? 1 - ); - } - } - - $webhook = new WebhookDTO( - $type, - $args['label'] ?? '', - $args['description'] ?? '', - $args['config'] ?? [], - $events - ); - - $registry->register_webhook_type( $webhook ); - } - ); - } - -} - -/** - * Creates a new webhook - * - * @param string $type Webhook type identifier. - * @param string $name Webhook name/title. - * @param array $config Webhook configuration. - * - * @return int|\WP_Error Post ID of the new webhook or error. - */ -if ( ! function_exists( 'create_webhook' ) ) { - - /** - * @return \WP_Error|int - */ - function create_webhook( string $type, string $name, array $config = [] ) { // @phpstan-ignore missingType.iterableValue - return WebhookRegistry::instance()->create_webhook( $type, $name, $config ); - } - -} - -/** - * Gets a registered webhook type - * - * @param string $type Webhook type identifier. - * - * @return array|null Webhook type configuration or null if not found. - */ -if ( ! function_exists( 'get_webhook_type' ) ) { - - /** @phpstan-ignore missingType.iterableValue */ - function get_webhook_type( string $type ): ?array { - return WebhookRegistry::instance()->get_webhook_type( $type ); - } - -} - -/** - * Gets all registered webhook types - * - * @return array> All registered webhook types. - */ -if ( ! function_exists( 'get_webhook_types' ) ) { - - /** @phpstan-ignore missingType.iterableValue */ - function get_webhook_types(): array { - return WebhookRegistry::instance()->get_webhook_types(); - } - -} - -/** - * Registers a GraphQL event configuration to be attached to a WordPress action. - * - * This function schedules an event registration callback to be executed when - * the `graphql_register_events` action is fired (during `EventRegistry::init()`). - * - * The registered event will listen to a specified WordPress action (e.g. 'publish_post'), - * and execute a qualifying callback to potentially dispatch notifications or other side effects. - * - * @param Event $event The event object to register. - * - * @return void - */ -function register_graphql_event( Event $event ): void { - if ( did_action( 'graphql_register_events' ) ) { - _doing_it_wrong( - __FUNCTION__, - 'Call this before EventRegistry::init', - '0.0.1' - ); - return; - } - - add_action( - 'graphql_register_events', - static function (GraphQLEventRegistry $event_registry) use ($event) { - $event_registry->register_event( $event ); - } - ); -} \ No newline at end of file diff --git a/plugins/wp-graphql-headless-webhooks/deactivation.php b/plugins/wp-graphql-headless-webhooks/deactivation.php deleted file mode 100644 index 09f768d4..00000000 --- a/plugins/wp-graphql-headless-webhooks/deactivation.php +++ /dev/null @@ -1,20 +0,0 @@ - - + Sniffs for the WPGraphQL plugin ecosystem - ./access-functions.php - ./wp-graphql-headless-webhooks.php + ./wp-graphql-webhooks.php ./activation.php ./deactivation.php ./src/ diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-webhooks/README.md similarity index 97% rename from plugins/wp-graphql-headless-webhooks/README.md rename to plugins/wp-graphql-webhooks/README.md index 1592a7b5..dbd82d41 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-webhooks/README.md @@ -1,4 +1,4 @@ -# WPGraphQL Headless Webhooks +# WPGraphQL Webhooks ## Overview diff --git a/plugins/wp-graphql-headless-webhooks/Sniffs/ControlStructures/ElseKeywordSniff.php b/plugins/wp-graphql-webhooks/Sniffs/ControlStructures/ElseKeywordSniff.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/Sniffs/ControlStructures/ElseKeywordSniff.php rename to plugins/wp-graphql-webhooks/Sniffs/ControlStructures/ElseKeywordSniff.php diff --git a/plugins/wp-graphql-headless-webhooks/activation.php b/plugins/wp-graphql-webhooks/activation.php similarity index 65% rename from plugins/wp-graphql-headless-webhooks/activation.php rename to plugins/wp-graphql-webhooks/activation.php index 7fe42676..3ef61bbd 100644 --- a/plugins/wp-graphql-headless-webhooks/activation.php +++ b/plugins/wp-graphql-webhooks/activation.php @@ -11,9 +11,9 @@ * Runs when the plugin is activated. * */ -function graphql_headless_webhooks_activation_callback(): callable { +function graphql_webhooks_activation_callback(): callable { return static function (): void { // Runs when the plugin is activated. - do_action( 'graphql_headless_webhooks_activate' ); + do_action( 'graphql_webhooks_activate' ); }; } \ No newline at end of file diff --git a/plugins/wp-graphql-headless-webhooks/assets/css/admin.css b/plugins/wp-graphql-webhooks/assets/css/admin.css similarity index 100% rename from plugins/wp-graphql-headless-webhooks/assets/css/admin.css rename to plugins/wp-graphql-webhooks/assets/css/admin.css diff --git a/plugins/wp-graphql-headless-webhooks/assets/js/admin.js b/plugins/wp-graphql-webhooks/assets/js/admin.js similarity index 100% rename from plugins/wp-graphql-headless-webhooks/assets/js/admin.js rename to plugins/wp-graphql-webhooks/assets/js/admin.js diff --git a/plugins/wp-graphql-headless-webhooks/bin/_lib.sh b/plugins/wp-graphql-webhooks/bin/_lib.sh similarity index 100% rename from plugins/wp-graphql-headless-webhooks/bin/_lib.sh rename to plugins/wp-graphql-webhooks/bin/_lib.sh diff --git a/plugins/wp-graphql-headless-webhooks/bin/build-docker.sh b/plugins/wp-graphql-webhooks/bin/build-docker.sh similarity index 100% rename from plugins/wp-graphql-headless-webhooks/bin/build-docker.sh rename to plugins/wp-graphql-webhooks/bin/build-docker.sh diff --git a/plugins/wp-graphql-headless-webhooks/bin/install-plugins.sh b/plugins/wp-graphql-webhooks/bin/install-plugins.sh similarity index 100% rename from plugins/wp-graphql-headless-webhooks/bin/install-plugins.sh rename to plugins/wp-graphql-webhooks/bin/install-plugins.sh diff --git a/plugins/wp-graphql-headless-webhooks/bin/install-test-env.sh b/plugins/wp-graphql-webhooks/bin/install-test-env.sh similarity index 100% rename from plugins/wp-graphql-headless-webhooks/bin/install-test-env.sh rename to plugins/wp-graphql-webhooks/bin/install-test-env.sh diff --git a/plugins/wp-graphql-headless-webhooks/bin/run-codeception.sh b/plugins/wp-graphql-webhooks/bin/run-codeception.sh similarity index 100% rename from plugins/wp-graphql-headless-webhooks/bin/run-codeception.sh rename to plugins/wp-graphql-webhooks/bin/run-codeception.sh diff --git a/plugins/wp-graphql-headless-webhooks/composer.json b/plugins/wp-graphql-webhooks/composer.json similarity index 94% rename from plugins/wp-graphql-headless-webhooks/composer.json rename to plugins/wp-graphql-webhooks/composer.json index 69dde89d..ab9b7a14 100644 --- a/plugins/wp-graphql-headless-webhooks/composer.json +++ b/plugins/wp-graphql-webhooks/composer.json @@ -1,5 +1,5 @@ { - "name": "wpengine/wp-graphql-headless-webhooks", + "name": "wpengine/wp-graphql-webhooks", "description": "Headless webhooks for WPGraphQL", "type": "library", "license": "GPL-3.0-or-later", @@ -54,10 +54,7 @@ "autoload": { "psr-4": { "WPGraphQL\\Webhooks\\": "src/" - }, - "files": [ - "access-functions.php" - ] + } }, "autoload-dev": { "psr-4": { @@ -97,12 +94,12 @@ "php:psalm:fix": "psalm --alter" }, "archive": { - "name": "wp-graphql-headless-webhooks", + "name": "wp-graphql-webhooks", "exclude": [ "/.*", "/assets", "/bin", - "/wp-graphql-headless-webhooks", + "/wp-graphql-webhooks", "/composer.lock", "/phpstan.neon.dist", "/README.md" diff --git a/plugins/wp-graphql-headless-webhooks/composer.lock b/plugins/wp-graphql-webhooks/composer.lock similarity index 99% rename from plugins/wp-graphql-headless-webhooks/composer.lock rename to plugins/wp-graphql-webhooks/composer.lock index ac224b43..8ee946c0 100644 --- a/plugins/wp-graphql-headless-webhooks/composer.lock +++ b/plugins/wp-graphql-webhooks/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c95ce760de9d78f5a1b0c1e16bbc33a4", + "content-hash": "296d34c535b1b1b2d96b903639e40ac5", "packages": [ { "name": "axepress/wp-graphql-plugin-boilerplate", @@ -1775,28 +1775,28 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "reference": "6e0fa428497bf560152ee73ffbb8af5c6a56b0dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/6e0fa428497bf560152ee73ffbb8af5c6a56b0dd", + "reference": "6e0fa428497bf560152ee73ffbb8af5c6a56b0dd", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.2", "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", + "composer/composer": "^2.2", "ext-json": "*", "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcompatibility/php-compatibility": "^9.0", "yoast/phpunit-polyfills": "^1.0" }, @@ -1816,9 +1816,9 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", @@ -1826,7 +1826,6 @@ } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -1847,9 +1846,28 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-06-27T17:24:01+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -2891,16 +2909,16 @@ }, { "name": "mck89/peast", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", - "reference": "3a752d39bd7d8dc1e19bcf424f3d5ac1a1ca6ad5" + "reference": "90e01c0da3a5a1c2c06d94a56fa2e0594769d525" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/3a752d39bd7d8dc1e19bcf424f3d5ac1a1ca6ad5", - "reference": "3a752d39bd7d8dc1e19bcf424f3d5ac1a1ca6ad5", + "url": "https://api.github.com/repos/mck89/peast/zipball/90e01c0da3a5a1c2c06d94a56fa2e0594769d525", + "reference": "90e01c0da3a5a1c2c06d94a56fa2e0594769d525", "shasum": "" }, "require": { @@ -2913,7 +2931,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17.0-dev" + "dev-master": "1.17.1-dev" } }, "autoload": { @@ -2934,9 +2952,9 @@ "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.17.0" + "source": "https://github.com/mck89/peast/tree/v1.17.1" }, - "time": "2025-03-07T19:44:14+00:00" + "time": "2025-06-27T14:33:03+00:00" }, { "name": "mockery/mockery", diff --git a/plugins/wp-graphql-webhooks/deactivation.php b/plugins/wp-graphql-webhooks/deactivation.php new file mode 100644 index 00000000..95295bed --- /dev/null +++ b/plugins/wp-graphql-webhooks/deactivation.php @@ -0,0 +1,20 @@ + - - + diff --git a/plugins/wp-graphql-headless-webhooks/readme.txt b/plugins/wp-graphql-webhooks/readme.txt similarity index 100% rename from plugins/wp-graphql-headless-webhooks/readme.txt rename to plugins/wp-graphql-webhooks/readme.txt diff --git a/plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksAdmin.php b/plugins/wp-graphql-webhooks/src/Admin/WebhooksAdmin.php similarity index 90% rename from plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksAdmin.php rename to plugins/wp-graphql-webhooks/src/Admin/WebhooksAdmin.php index 77a0e162..3ad67163 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksAdmin.php +++ b/plugins/wp-graphql-webhooks/src/Admin/WebhooksAdmin.php @@ -62,10 +62,19 @@ public function init(): void { */ public function add_admin_menu(): void { // Add submenu under GraphQL menu using the correct parent slug + add_menu_page( + __( 'Webhooks', 'wp-graphql-webhooks' ), + __( 'Webhooks', 'wp-graphql-webhooks' ), + 'manage_options', + self::ADMIN_PAGE_SLUG, + [ $this, 'render_admin_page' ], + 'dashicons-rss', + 25 + ); add_submenu_page( 'graphiql-ide', - __( 'GraphQL Webhooks', 'wp-graphql-headless-webhooks' ), - __( 'Webhooks', 'wp-graphql-headless-webhooks' ), + __( 'GraphQL Webhooks', 'wp-graphql-webhooks' ), + __( 'Webhooks', 'wp-graphql-webhooks' ), 'manage_options', self::ADMIN_PAGE_SLUG, [ $this, 'render_admin_page' ] @@ -100,16 +109,16 @@ public function enqueue_assets( string $hook ): void { wp_enqueue_style( 'graphql-webhooks-admin', - WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_URL . 'assets/css/admin.css', + WPGRAPHQL_WEBHOOKS_PLUGIN_URL . 'assets/css/admin.css', [], - WPGRAPHQL_HEADLESS_WEBHOOKS_VERSION + WPGRAPHQL_WEBHOOKS_VERSION ); wp_enqueue_script( 'graphql-webhooks-admin', - WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_URL . 'assets/js/admin.js', + WPGRAPHQL_WEBHOOKS_PLUGIN_URL . 'assets/js/admin.js', [ 'jquery' ], - WPGRAPHQL_HEADLESS_WEBHOOKS_VERSION, + WPGRAPHQL_WEBHOOKS_VERSION, true ); @@ -120,7 +129,7 @@ public function enqueue_assets( string $hook ): void { 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'restUrl' => rest_url( 'graphql-webhooks/v1/' ), 'nonce' => wp_create_nonce( 'wp_rest' ), - 'confirmDelete' => __( 'Are you sure you want to delete this webhook?', 'wp-graphql-headless-webhooks' ), + 'confirmDelete' => __( 'Are you sure you want to delete this webhook?', 'wp-graphql-webhooks' ), 'headerTemplate' => $this->get_header_row_template(), ] ); @@ -145,7 +154,7 @@ private function get_header_row_template(): string { */ private function verify_admin_permission(): bool { if ( ! current_user_can( 'manage_options' ) ) { - wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-graphql-headless-webhooks' ) ); + wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-graphql-webhooks' ) ); return false; } return true; @@ -160,7 +169,7 @@ private function verify_admin_permission(): bool { */ private function verify_nonce( string $nonce_name, string $action ): bool { if ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $_REQUEST[ $nonce_name ], $action ) ) { - wp_die( __( 'Security check failed.', 'wp-graphql-headless-webhooks' ) ); + wp_die( __( 'Security check failed.', 'wp-graphql-webhooks' ) ); return false; } return true; @@ -244,15 +253,15 @@ private function handle_webhook_delete(): void { // Get webhook ID $webhook_id = intval( $_GET['webhook'] ); $nonce = isset( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; - + // Verify nonce if ( ! wp_verify_nonce( $nonce, 'delete-webhook-' . $webhook_id ) ) { - wp_die( __( 'Security check failed.', 'wp-graphql-headless-webhooks' ) ); + wp_die( __( 'Security check failed.', 'wp-graphql-webhooks' ) ); } // Delete webhook $deleted = $this->repository->delete( $webhook_id ) ? 1 : 0; - + // Redirect with result wp_redirect( add_query_arg( [ 'deleted' => $deleted ], remove_query_arg( [ 'action', 'webhook', '_wpnonce' ], $this->get_admin_url() ) ) ); exit; @@ -361,14 +370,14 @@ private function sanitize_headers( array $headers ): array { public function ajax_test_webhook(): void { if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'wp_rest' ) ) { wp_send_json_error( [ - 'message' => __( 'Invalid security token.', 'wp-graphql-headless-webhooks' ), + 'message' => __( 'Invalid security token.', 'wp-graphql-webhooks' ), 'error_code' => 'invalid_nonce' ] ); } if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( [ - 'message' => __( 'You do not have permission to test webhooks.', 'wp-graphql-headless-webhooks' ), + 'message' => __( 'You do not have permission to test webhooks.', 'wp-graphql-webhooks' ), 'error_code' => 'insufficient_permissions' ] ); } @@ -376,7 +385,7 @@ public function ajax_test_webhook(): void { $webhook_id = isset( $_POST['webhook_id'] ) ? intval( $_POST['webhook_id'] ) : 0; if ( ! $webhook_id ) { wp_send_json_error( [ - 'message' => __( 'Invalid webhook ID.', 'wp-graphql-headless-webhooks' ), + 'message' => __( 'Invalid webhook ID.', 'wp-graphql-webhooks' ), 'error_code' => 'invalid_webhook_id' ] ); } @@ -384,7 +393,7 @@ public function ajax_test_webhook(): void { $webhook = $this->repository->get( $webhook_id ); if ( ! $webhook ) { wp_send_json_error( [ - 'message' => __( 'Webhook not found.', 'wp-graphql-headless-webhooks' ), + 'message' => __( 'Webhook not found.', 'wp-graphql-webhooks' ), 'error_code' => 'webhook_not_found' ] ); } @@ -412,7 +421,7 @@ public function ajax_test_webhook(): void { 'headers' => array_merge( [ 'Content-Type' => 'application/json', - 'User-Agent' => 'WPGraphQL-Webhooks/' . WPGRAPHQL_HEADLESS_WEBHOOKS_VERSION, + 'User-Agent' => 'WPGraphQL-Webhooks/' . WPGRAPHQL_WEBHOOKS_VERSION, ], $webhook->headers ), @@ -430,7 +439,7 @@ public function ajax_test_webhook(): void { if ( is_wp_error( $response ) ) { wp_send_json_error( [ 'message' => sprintf( - __( 'Failed to send test webhook: %s', 'wp-graphql-headless-webhooks' ), + __( 'Failed to send test webhook: %s', 'wp-graphql-webhooks' ), $response->get_error_message() ), 'error_code' => $response->get_error_code(), @@ -446,8 +455,8 @@ public function ajax_test_webhook(): void { $response_data = [ 'success' => $is_success, 'message' => $is_success - ? sprintf( __( 'Test webhook sent successfully to %s', 'wp-graphql-headless-webhooks' ), $webhook->url ) - : sprintf( __( 'Webhook returned HTTP %d', 'wp-graphql-headless-webhooks' ), $response_code ), + ? sprintf( __( 'Test webhook sent successfully to %s', 'wp-graphql-webhooks' ), $webhook->url ) + : sprintf( __( 'Webhook returned HTTP %d', 'wp-graphql-webhooks' ), $response_code ), 'webhook_id' => $webhook->id, 'webhook_name' => $webhook->name, 'target_url' => $webhook->url, diff --git a/plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksListTable.php b/plugins/wp-graphql-webhooks/src/Admin/WebhooksListTable.php similarity index 99% rename from plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksListTable.php rename to plugins/wp-graphql-webhooks/src/Admin/WebhooksListTable.php index ec92182e..9ed03cdd 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Admin/WebhooksListTable.php +++ b/plugins/wp-graphql-webhooks/src/Admin/WebhooksListTable.php @@ -98,7 +98,7 @@ public function process_bulk_action() { // Check permissions if ( ! current_user_can( 'manage_options' ) ) { - wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-graphql-headless-webhooks' ) ); + wp_die( __( 'You do not have sufficient permissions to access this page.', 'wp-graphql-webhooks' ) ); } // Get selected webhooks diff --git a/plugins/wp-graphql-headless-webhooks/src/Admin/views/partials/webhook-header-row.php b/plugins/wp-graphql-webhooks/src/Admin/views/partials/webhook-header-row.php similarity index 80% rename from plugins/wp-graphql-headless-webhooks/src/Admin/views/partials/webhook-header-row.php rename to plugins/wp-graphql-webhooks/src/Admin/views/partials/webhook-header-row.php index 01fc8618..7080913e 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Admin/views/partials/webhook-header-row.php +++ b/plugins/wp-graphql-webhooks/src/Admin/views/partials/webhook-header-row.php @@ -20,14 +20,14 @@ diff --git a/plugins/wp-graphql-headless-webhooks/src/Admin/views/webhook-form.php b/plugins/wp-graphql-webhooks/src/Admin/views/webhook-form.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Admin/views/webhook-form.php rename to plugins/wp-graphql-webhooks/src/Admin/views/webhook-form.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Admin/views/webhooks-list.php b/plugins/wp-graphql-webhooks/src/Admin/views/webhooks-list.php similarity index 92% rename from plugins/wp-graphql-headless-webhooks/src/Admin/views/webhooks-list.php rename to plugins/wp-graphql-webhooks/src/Admin/views/webhooks-list.php index 9af6f985..5297b388 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Admin/views/webhooks-list.php +++ b/plugins/wp-graphql-webhooks/src/Admin/views/webhooks-list.php @@ -13,9 +13,9 @@ ?>
-

+

- +
diff --git a/plugins/wp-graphql-headless-webhooks/src/Autoloader.php b/plugins/wp-graphql-webhooks/src/Autoloader.php similarity index 87% rename from plugins/wp-graphql-headless-webhooks/src/Autoloader.php rename to plugins/wp-graphql-webhooks/src/Autoloader.php index 57c42cbf..91ee0dce 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Autoloader.php +++ b/plugins/wp-graphql-webhooks/src/Autoloader.php @@ -28,7 +28,7 @@ class Autoloader { */ public static function autoload(): bool { // If we're not *supposed* to autoload anything, then return true. - if ( defined( 'WPGRAPHQL_HEADLESS_WEBHOOKS_AUTOLOAD' ) && false === WPGRAPHQL_HEADLESS_WEBHOOKS_AUTOLOAD ) { + if ( defined( 'WPGRAPHQL_WEBHOOKS_AUTOLOAD' ) && false === WPGRAPHQL_WEBHOOKS_AUTOLOAD ) { return true; } @@ -60,7 +60,7 @@ protected static function require_autoloader( string $autoloader_file ): bool { * Displays a notice if the autoloader is missing. */ protected static function missing_autoloader_notice(): void { - $error_message = 'Headless Webhooks for WPGraphQL: The Composer autoloader was not found. If you installed the plugin from the GitHub source, make sure to run `composer install`.'; + $error_message = 'Webhooks for WPGraphQL: The Composer autoloader was not found. If you installed the plugin from the GitHub source, make sure to run `composer install`.'; if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { error_log( esc_html( $error_message ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- This is a development notice. diff --git a/plugins/wp-graphql-headless-webhooks/src/Entity/Webhook.php b/plugins/wp-graphql-webhooks/src/Entity/Webhook.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Entity/Webhook.php rename to plugins/wp-graphql-webhooks/src/Entity/Webhook.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Events/Interfaces/EventManager.php b/plugins/wp-graphql-webhooks/src/Events/Interfaces/EventManager.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Events/Interfaces/EventManager.php rename to plugins/wp-graphql-webhooks/src/Events/Interfaces/EventManager.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheEventMapper.php b/plugins/wp-graphql-webhooks/src/Events/SmartCacheEventMapper.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheEventMapper.php rename to plugins/wp-graphql-webhooks/src/Events/SmartCacheEventMapper.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheWebhookManager.php b/plugins/wp-graphql-webhooks/src/Events/SmartCacheWebhookManager.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheWebhookManager.php rename to plugins/wp-graphql-webhooks/src/Events/SmartCacheWebhookManager.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Events/WebhookEventManager.php b/plugins/wp-graphql-webhooks/src/Events/WebhookEventManager.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Events/WebhookEventManager.php rename to plugins/wp-graphql-webhooks/src/Events/WebhookEventManager.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Fields/RootQuery.php b/plugins/wp-graphql-webhooks/src/Fields/RootQuery.php similarity index 93% rename from plugins/wp-graphql-headless-webhooks/src/Fields/RootQuery.php rename to plugins/wp-graphql-webhooks/src/Fields/RootQuery.php index 1ad1c13d..86485e77 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Fields/RootQuery.php +++ b/plugins/wp-graphql-webhooks/src/Fields/RootQuery.php @@ -25,7 +25,7 @@ public static function register(): void { // Register the "webhooks" field (list of webhooks) register_graphql_field( 'RootQuery', 'webhooks', [ 'type' => [ 'list_of' => 'Webhook' ], - 'description' => __( 'List all registered webhooks.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'List all registered webhooks.', 'wp-graphql-webhooks' ), 'resolve' => function() { $query = new \WP_Query([ 'post_type' => 'graphql_webhook', @@ -40,11 +40,11 @@ public static function register(): void { // Register the "webhook" field (fetch single webhook by ID) register_graphql_field( 'RootQuery', 'webhook', [ 'type' => 'Webhook', - 'description' => __( 'Fetch a webhook by ID.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Fetch a webhook by ID.', 'wp-graphql-webhooks' ), 'args' => [ 'id' => [ 'type' => Type::nonNull( Type::id() ), - 'description' => __( 'The global ID of the webhook to retrieve.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The global ID of the webhook to retrieve.', 'wp-graphql-webhooks' ), ], ], 'resolve' => function( $root, $args ) { diff --git a/plugins/wp-graphql-headless-webhooks/src/Handlers/Interfaces/Handler.php b/plugins/wp-graphql-webhooks/src/Handlers/Interfaces/Handler.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Handlers/Interfaces/Handler.php rename to plugins/wp-graphql-webhooks/src/Handlers/Interfaces/Handler.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Handlers/WebhookHandler.php b/plugins/wp-graphql-webhooks/src/Handlers/WebhookHandler.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Handlers/WebhookHandler.php rename to plugins/wp-graphql-webhooks/src/Handlers/WebhookHandler.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Mutation/CreateWebhook.php b/plugins/wp-graphql-webhooks/src/Mutation/CreateWebhook.php similarity index 87% rename from plugins/wp-graphql-headless-webhooks/src/Mutation/CreateWebhook.php rename to plugins/wp-graphql-webhooks/src/Mutation/CreateWebhook.php index cb0d4402..8923dac3 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Mutation/CreateWebhook.php +++ b/plugins/wp-graphql-webhooks/src/Mutation/CreateWebhook.php @@ -26,42 +26,42 @@ public static function register(): void { 'inputFields' => [ 'title' => [ 'type' => 'String', - 'description' => __( 'The title of the webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The title of the webhook', 'wp-graphql-webhooks' ), ], 'content' => [ 'type' => 'String', - 'description' => __( 'The content/description of the webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The content/description of the webhook', 'wp-graphql-webhooks' ), ], 'eventTrigger' => [ 'type' => 'String', - 'description' => __( 'The event hook name that triggers this webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The event hook name that triggers this webhook', 'wp-graphql-webhooks' ), ], 'enabled' => [ 'type' => 'Boolean', - 'description' => __( 'Whether the webhook is enabled', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Whether the webhook is enabled', 'wp-graphql-webhooks' ), ], 'security' => [ 'type' => 'String', - 'description' => __( 'Security information for the webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Security information for the webhook', 'wp-graphql-webhooks' ), ], 'handlerClass' => [ 'type' => 'String', - 'description' => __( 'The handler class used for dispatching', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The handler class used for dispatching', 'wp-graphql-webhooks' ), ], 'handlerConfig' => [ 'type' => 'String', - 'description' => __( 'Configuration for the handler, JSON encoded', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Configuration for the handler, JSON encoded', 'wp-graphql-webhooks' ), ], 'status' => [ 'type' => 'String', - 'description' => __( 'Post status, e.g. PUBLISH or DRAFT', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Post status, e.g. PUBLISH or DRAFT', 'wp-graphql-webhooks' ), 'defaultValue' => 'publish', ], ], 'outputFields' => [ 'webhook' => [ 'type' => 'Webhook', - 'description' => __( 'The created webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The created webhook', 'wp-graphql-webhooks' ), 'resolve' => function ($payload) { return get_post( $payload['webhookId'] ); }, @@ -70,7 +70,7 @@ public static function register(): void { 'mutateAndGetPayload' => function ($input, $context, $info) { // Check user capabilities if ( ! current_user_can( 'manage_options' ) ) { - throw new UserError( __( 'You do not have permission to create webhooks.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'You do not have permission to create webhooks.', 'wp-graphql-webhooks' ) ); } // Prepare post data @@ -83,7 +83,7 @@ public static function register(): void { $post_id = wp_insert_post( $post_data ); if ( is_wp_error( $post_id ) ) { - throw new UserError( __( 'Failed to create webhook.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'Failed to create webhook.', 'wp-graphql-webhooks' ) ); } if ( isset( $input['eventTrigger'] ) ) { update_post_meta( $post_id, '_event_trigger', sanitize_text_field( $input['eventTrigger'] ) ); diff --git a/plugins/wp-graphql-headless-webhooks/src/Mutation/DeleteWebhook.php b/plugins/wp-graphql-webhooks/src/Mutation/DeleteWebhook.php similarity index 87% rename from plugins/wp-graphql-headless-webhooks/src/Mutation/DeleteWebhook.php rename to plugins/wp-graphql-webhooks/src/Mutation/DeleteWebhook.php index bb222f6e..9962e51f 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Mutation/DeleteWebhook.php +++ b/plugins/wp-graphql-webhooks/src/Mutation/DeleteWebhook.php @@ -26,20 +26,20 @@ public static function register(): void { 'inputFields' => [ 'id' => [ 'type' => 'ID', - 'description' => __( 'The ID of the webhook to delete', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The ID of the webhook to delete', 'wp-graphql-webhooks' ), ], ], 'outputFields' => [ 'deletedWebhookId' => [ 'type' => 'ID', - 'description' => __( 'The ID of the deleted webhook', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The ID of the deleted webhook', 'wp-graphql-webhooks' ), 'resolve' => function ($payload) { return $payload['deletedWebhookId'] ?? null; }, ], 'success' => [ 'type' => 'Boolean', - 'description' => __( 'Whether the webhook was successfully deleted', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Whether the webhook was successfully deleted', 'wp-graphql-webhooks' ), 'resolve' => function ($payload) { return $payload['success'] ?? false; }, @@ -48,27 +48,27 @@ public static function register(): void { 'mutateAndGetPayload' => function ($input, $context, $info) { // Capability check if ( ! current_user_can( 'manage_options' ) ) { - throw new UserError( __( 'You do not have permission to delete webhooks.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'You do not have permission to delete webhooks.', 'wp-graphql-webhooks' ) ); } if ( empty( $input['id'] ) ) { - throw new UserError( __( 'The ID of the webhook to delete is required.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'The ID of the webhook to delete is required.', 'wp-graphql-webhooks' ) ); } $post_id = is_numeric( $input['id'] ) ? (int) $input['id'] : 0; if ( $post_id <= 0 ) { - throw new UserError( __( 'Invalid webhook ID.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'Invalid webhook ID.', 'wp-graphql-webhooks' ) ); } $post = get_post( $post_id ); if ( ! $post || $post->post_type !== 'graphql_webhook' ) { - throw new UserError( __( 'Webhook not found.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'Webhook not found.', 'wp-graphql-webhooks' ) ); } // Delete the post (force delete to bypass trash) $deleted = wp_delete_post( $post_id, true ); if ( ! $deleted ) { - throw new UserError( __( 'Failed to delete webhook.', 'wp-graphql-headless-webhooks' ) ); + throw new UserError( __( 'Failed to delete webhook.', 'wp-graphql-webhooks' ) ); } return [ diff --git a/plugins/wp-graphql-headless-webhooks/src/Mutation/UpdateWebhook.php b/plugins/wp-graphql-webhooks/src/Mutation/UpdateWebhook.php similarity index 86% rename from plugins/wp-graphql-headless-webhooks/src/Mutation/UpdateWebhook.php rename to plugins/wp-graphql-webhooks/src/Mutation/UpdateWebhook.php index 74520ba2..4bd1894d 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Mutation/UpdateWebhook.php +++ b/plugins/wp-graphql-webhooks/src/Mutation/UpdateWebhook.php @@ -26,45 +26,45 @@ public static function register(): void { 'inputFields' => [ 'id' => [ 'type' => 'ID', - 'description' => __('The ID of the webhook to update', 'wp-graphql-headless-webhooks'), + 'description' => __('The ID of the webhook to update', 'wp-graphql-webhooks'), ], 'title' => [ 'type' => 'String', - 'description' => __('The new title of the webhook', 'wp-graphql-headless-webhooks'), + 'description' => __('The new title of the webhook', 'wp-graphql-webhooks'), ], 'content' => [ 'type' => 'String', - 'description' => __('The new content/description of the webhook', 'wp-graphql-headless-webhooks'), + 'description' => __('The new content/description of the webhook', 'wp-graphql-webhooks'), ], 'eventTrigger' => [ 'type' => 'String', - 'description' => __('The new event hook name that triggers this webhook', 'wp-graphql-headless-webhooks'), + 'description' => __('The new event hook name that triggers this webhook', 'wp-graphql-webhooks'), ], 'enabled' => [ 'type' => 'Boolean', - 'description' => __('Whether the webhook is enabled', 'wp-graphql-headless-webhooks'), + 'description' => __('Whether the webhook is enabled', 'wp-graphql-webhooks'), ], 'security' => [ 'type' => 'String', - 'description' => __('Security information for the webhook', 'wp-graphql-headless-webhooks'), + 'description' => __('Security information for the webhook', 'wp-graphql-webhooks'), ], 'handlerClass' => [ 'type' => 'String', - 'description' => __('The handler class used for dispatching', 'wp-graphql-headless-webhooks'), + 'description' => __('The handler class used for dispatching', 'wp-graphql-webhooks'), ], 'handlerConfig' => [ 'type' => 'String', - 'description' => __('Configuration for the handler, JSON encoded', 'wp-graphql-headless-webhooks'), + 'description' => __('Configuration for the handler, JSON encoded', 'wp-graphql-webhooks'), ], 'status' => [ 'type' => 'String', - 'description' => __('Post status, e.g. PUBLISH or DRAFT', 'wp-graphql-headless-webhooks'), + 'description' => __('Post status, e.g. PUBLISH or DRAFT', 'wp-graphql-webhooks'), ], ], 'outputFields' => [ 'webhook' => [ 'type' => 'Webhook', - 'description' => __('The updated webhook', 'wp-graphql-headless-webhooks'), + 'description' => __('The updated webhook', 'wp-graphql-webhooks'), 'resolve' => function ($payload) { return get_post($payload['webhookId']); }, @@ -72,22 +72,22 @@ public static function register(): void { ], 'mutateAndGetPayload' => function ($input, $context, $info) { if (!current_user_can('manage_options')) { - throw new UserError(__('You do not have permission to update webhooks.', 'wp-graphql-headless-webhooks')); + throw new UserError(__('You do not have permission to update webhooks.', 'wp-graphql-webhooks')); } if (empty($input['id'])) { - throw new UserError(__('The ID of the webhook to update is required.', 'wp-graphql-headless-webhooks')); + throw new UserError(__('The ID of the webhook to update is required.', 'wp-graphql-webhooks')); } $post_id = is_numeric($input['id']) ? (int) $input['id'] : 0; if ($post_id <= 0) { - throw new UserError(__('Invalid webhook ID.', 'wp-graphql-headless-webhooks')); + throw new UserError(__('Invalid webhook ID.', 'wp-graphql-webhooks')); } $post = get_post($post_id); if (!$post || $post->post_type !== 'graphql_webhook') { - throw new UserError(__('Webhook not found.', 'wp-graphql-headless-webhooks')); + throw new UserError(__('Webhook not found.', 'wp-graphql-webhooks')); } $post_data = ['ID' => $post_id]; @@ -102,7 +102,7 @@ public static function register(): void { } $updated_post_id = wp_update_post($post_data, true); if (is_wp_error($updated_post_id)) { - throw new UserError(__('Failed to update webhook.', 'wp-graphql-headless-webhooks')); + throw new UserError(__('Failed to update webhook.', 'wp-graphql-webhooks')); } if (isset($input['eventTrigger'])) { diff --git a/plugins/wp-graphql-headless-webhooks/src/Plugin.php b/plugins/wp-graphql-webhooks/src/Plugin.php similarity index 93% rename from plugins/wp-graphql-headless-webhooks/src/Plugin.php rename to plugins/wp-graphql-webhooks/src/Plugin.php index 51d49a1a..e8774da1 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Plugin.php +++ b/plugins/wp-graphql-webhooks/src/Plugin.php @@ -116,11 +116,11 @@ private function setup(): void { */ private function includes(): void { if ( - defined( 'WPGRAPHQL_HEADLESS_WEBHOOKS_AUTOLOAD' ) - && false !== WPGRAPHQL_HEADLESS_WEBHOOKS_AUTOLOAD - && defined( 'WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_DIR' ) + defined( 'WPGRAPHQL_WEBHOOKS_AUTOLOAD' ) + && false !== WPGRAPHQL_WEBHOOKS_AUTOLOAD + && defined( 'WPGRAPHQL_WEBHOOKS_PLUGIN_DIR' ) ) { - require_once WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_DIR . 'vendor/autoload.php'; + require_once WPGRAPHQL_WEBHOOKS_PLUGIN_DIR . 'vendor/autoload.php'; } } diff --git a/plugins/wp-graphql-headless-webhooks/src/PostTypes/WebhookPostType.php b/plugins/wp-graphql-webhooks/src/PostTypes/WebhookPostType.php similarity index 63% rename from plugins/wp-graphql-headless-webhooks/src/PostTypes/WebhookPostType.php rename to plugins/wp-graphql-webhooks/src/PostTypes/WebhookPostType.php index 23f0c7b3..8dbfc619 100644 --- a/plugins/wp-graphql-headless-webhooks/src/PostTypes/WebhookPostType.php +++ b/plugins/wp-graphql-webhooks/src/PostTypes/WebhookPostType.php @@ -24,18 +24,18 @@ public static function init(): void { */ public static function register_webhook_cpt(): void { $labels = [ - 'name' => __( 'Webhooks', 'wp-graphql-headless-webhooks' ), - 'singular_name' => __( 'Webhook', 'wp-graphql-headless-webhooks' ), - 'add_new' => __( 'Add New', 'wp-graphql-headless-webhooks' ), - 'add_new_item' => __( 'Add New Webhook', 'wp-graphql-headless-webhooks' ), - 'edit_item' => __( 'Edit Webhook', 'wp-graphql-headless-webhooks' ), - 'new_item' => __( 'New Webhook', 'wp-graphql-headless-webhooks' ), - 'view_item' => __( 'View Webhook', 'wp-graphql-headless-webhooks' ), - 'search_items' => __( 'Search Webhooks', 'wp-graphql-headless-webhooks' ), - 'not_found' => __( 'No Webhooks found', 'wp-graphql-headless-webhooks' ), - 'not_found_in_trash' => __( 'No Webhooks found in Trash', 'wp-graphql-headless-webhooks' ), - 'parent_item_colon' => __( 'Parent Webhook:', 'wp-graphql-headless-webhooks' ), - 'menu_name' => __( 'Webhooks', 'wp-graphql-headless-webhooks' ), + 'name' => __( 'Webhooks', 'wp-graphql-webhooks' ), + 'singular_name' => __( 'Webhook', 'wp-graphql-webhooks' ), + 'add_new' => __( 'Add New', 'wp-graphql-webhooks' ), + 'add_new_item' => __( 'Add New Webhook', 'wp-graphql-webhooks' ), + 'edit_item' => __( 'Edit Webhook', 'wp-graphql-webhooks' ), + 'new_item' => __( 'New Webhook', 'wp-graphql-webhooks' ), + 'view_item' => __( 'View Webhook', 'wp-graphql-webhooks' ), + 'search_items' => __( 'Search Webhooks', 'wp-graphql-webhooks' ), + 'not_found' => __( 'No Webhooks found', 'wp-graphql-webhooks' ), + 'not_found_in_trash' => __( 'No Webhooks found in Trash', 'wp-graphql-webhooks' ), + 'parent_item_colon' => __( 'Parent Webhook:', 'wp-graphql-webhooks' ), + 'menu_name' => __( 'Webhooks', 'wp-graphql-webhooks' ), ]; $args = [ 'labels' => $labels, diff --git a/plugins/wp-graphql-headless-webhooks/src/Repository/Interfaces/WebhookRepositoryInterface.php b/plugins/wp-graphql-webhooks/src/Repository/Interfaces/WebhookRepositoryInterface.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Repository/Interfaces/WebhookRepositoryInterface.php rename to plugins/wp-graphql-webhooks/src/Repository/Interfaces/WebhookRepositoryInterface.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Repository/WebhookRepository.php b/plugins/wp-graphql-webhooks/src/Repository/WebhookRepository.php similarity index 99% rename from plugins/wp-graphql-headless-webhooks/src/Repository/WebhookRepository.php rename to plugins/wp-graphql-webhooks/src/Repository/WebhookRepository.php index 3ac45bef..7cd81e26 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Repository/WebhookRepository.php +++ b/plugins/wp-graphql-webhooks/src/Repository/WebhookRepository.php @@ -145,7 +145,7 @@ public function create( Webhook $webhook ) { public function update( int $id, Webhook $webhook ) { $post = get_post( $id ); if ( ! $post || $post->post_type !== 'graphql_webhook' ) { - return new WP_Error( 'invalid_webhook', __( 'Webhook not found.', 'wp-graphql-headless-webhooks' ) ); + return new WP_Error( 'invalid_webhook', __( 'Webhook not found.', 'wp-graphql-webhooks' ) ); } // Validate using the Webhook entity diff --git a/plugins/wp-graphql-headless-webhooks/src/Rest/WebhookTestEndpoint.php b/plugins/wp-graphql-webhooks/src/Rest/WebhookTestEndpoint.php similarity index 96% rename from plugins/wp-graphql-headless-webhooks/src/Rest/WebhookTestEndpoint.php rename to plugins/wp-graphql-webhooks/src/Rest/WebhookTestEndpoint.php index 4fc4481a..5c07bd31 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Rest/WebhookTestEndpoint.php +++ b/plugins/wp-graphql-webhooks/src/Rest/WebhookTestEndpoint.php @@ -79,7 +79,7 @@ public function test_webhook( WP_REST_Request $request ): WP_REST_Response|WP_Er if ( ! $webhook ) { return new WP_Error( 'webhook_not_found', - __( 'Webhook not found.', 'wp-graphql-headless-webhooks' ), + __( 'Webhook not found.', 'wp-graphql-webhooks' ), [ 'status' => 404 ] ); } @@ -133,7 +133,7 @@ public function test_webhook( WP_REST_Request $request ): WP_REST_Response|WP_Er return new WP_REST_Response( [ 'success' => true, - 'message' => __( 'Test webhook dispatched successfully.', 'wp-graphql-headless-webhooks' ), + 'message' => __( 'Test webhook dispatched successfully.', 'wp-graphql-webhooks' ), 'details' => [ 'webhook_id' => $webhook_id, 'webhook_name' => $webhook->name, @@ -156,7 +156,7 @@ public function test_webhook( WP_REST_Request $request ): WP_REST_Response|WP_Er 'webhook_test_failed', sprintf( /* translators: %s: error message */ - __( 'Failed to dispatch test webhook: %s', 'wp-graphql-headless-webhooks' ), + __( 'Failed to dispatch test webhook: %s', 'wp-graphql-webhooks' ), $e->getMessage() ), [ 'status' => 500 ] diff --git a/plugins/wp-graphql-headless-webhooks/src/Services/Interfaces/ServiceLocator.php b/plugins/wp-graphql-webhooks/src/Services/Interfaces/ServiceLocator.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Services/Interfaces/ServiceLocator.php rename to plugins/wp-graphql-webhooks/src/Services/Interfaces/ServiceLocator.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Services/PluginServiceLocator.php b/plugins/wp-graphql-webhooks/src/Services/PluginServiceLocator.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/Services/PluginServiceLocator.php rename to plugins/wp-graphql-webhooks/src/Services/PluginServiceLocator.php diff --git a/plugins/wp-graphql-headless-webhooks/src/Type/Webhook.php b/plugins/wp-graphql-webhooks/src/Type/Webhook.php similarity index 88% rename from plugins/wp-graphql-headless-webhooks/src/Type/Webhook.php rename to plugins/wp-graphql-webhooks/src/Type/Webhook.php index 3f129c4e..16a05c08 100644 --- a/plugins/wp-graphql-headless-webhooks/src/Type/Webhook.php +++ b/plugins/wp-graphql-webhooks/src/Type/Webhook.php @@ -21,53 +21,53 @@ class Webhook { */ public static function register(): void { register_graphql_object_type( 'Webhook', [ - 'description' => __( 'A Webhook configuration object.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'A Webhook configuration object.', 'wp-graphql-webhooks' ), 'fields' => [ 'id' => [ 'type' => 'ID', - 'description' => __( 'The global ID of the webhook.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The global ID of the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return (string) $webhook->ID; }, ], 'eventTrigger' => [ 'type' => 'String', - 'description' => __( 'The event hook name that triggers this webhook.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The event hook name that triggers this webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_event_trigger', true ); }, ], 'title' => [ 'type' => 'String', - 'description' => __( 'The title of the webhook.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The title of the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_the_title( $webhook ); }, ], 'enabled' => [ 'type' => 'Boolean', - 'description' => __( 'Whether the webhook is enabled.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Whether the webhook is enabled.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return (bool) get_post_meta( $webhook->ID, '_enabled', true ); }, ], 'security' => [ 'type' => 'String', - 'description' => __( 'Security information for the webhook.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Security information for the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_security', true ); }, ], 'handlerClass' => [ 'type' => 'String', - 'description' => __( 'The handler class used for dispatching.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'The handler class used for dispatching.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_handler_class', true ); }, ], 'handlerConfig' => [ 'type' => 'String', - 'description' => __( 'Configuration for the handler.', 'wp-graphql-headless-webhooks' ), + 'description' => __( 'Configuration for the handler.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_handler_config', true ); }, diff --git a/plugins/wp-graphql-headless-webhooks/src/TypeRegistry.php b/plugins/wp-graphql-webhooks/src/TypeRegistry.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/src/TypeRegistry.php rename to plugins/wp-graphql-webhooks/src/TypeRegistry.php diff --git a/plugins/wp-graphql-headless-webhooks/tests/acceptance.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/acceptance.suite.dist.yml rename to plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml diff --git a/plugins/wp-graphql-headless-webhooks/tests/acceptance/.gitkeep b/plugins/wp-graphql-webhooks/tests/acceptance/.gitkeep similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/acceptance/.gitkeep rename to plugins/wp-graphql-webhooks/tests/acceptance/.gitkeep diff --git a/plugins/wp-graphql-headless-webhooks/tests/bootstrap.php b/plugins/wp-graphql-webhooks/tests/bootstrap.php similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/bootstrap.php rename to plugins/wp-graphql-webhooks/tests/bootstrap.php diff --git a/plugins/wp-graphql-headless-webhooks/tests/functional.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/functional.suite.dist.yml rename to plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml diff --git a/plugins/wp-graphql-headless-webhooks/tests/functional/.gitkeep b/plugins/wp-graphql-webhooks/tests/functional/.gitkeep similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/functional/.gitkeep rename to plugins/wp-graphql-webhooks/tests/functional/.gitkeep diff --git a/plugins/wp-graphql-headless-webhooks/tests/unit.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/unit.suite.dist.yml similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/unit.suite.dist.yml rename to plugins/wp-graphql-webhooks/tests/unit.suite.dist.yml diff --git a/plugins/wp-graphql-headless-webhooks/tests/unit/.gitkeep b/plugins/wp-graphql-webhooks/tests/unit/.gitkeep similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/unit/.gitkeep rename to plugins/wp-graphql-webhooks/tests/unit/.gitkeep diff --git a/plugins/wp-graphql-headless-webhooks/tests/wpunit.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/wpunit.suite.dist.yml similarity index 100% rename from plugins/wp-graphql-headless-webhooks/tests/wpunit.suite.dist.yml rename to plugins/wp-graphql-webhooks/tests/wpunit.suite.dist.yml diff --git a/plugins/wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php b/plugins/wp-graphql-webhooks/wp-graphql-webhooks.php similarity index 53% rename from plugins/wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php rename to plugins/wp-graphql-webhooks/wp-graphql-webhooks.php index 63837c99..c721b6b4 100644 --- a/plugins/wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php +++ b/plugins/wp-graphql-webhooks/wp-graphql-webhooks.php @@ -1,14 +1,14 @@ */ -function graphql_headless_webhooks_dependencies_not_ready(): array { +function graphql_webhooks_dependencies_not_ready(): array { $deps = []; if ( ! class_exists( '\WPGraphQL' ) ) { @@ -102,15 +102,15 @@ function graphql_headless_webhooks_dependencies_not_ready(): array { /** * Initializes plugin. */ -function graphql_headless_webhooks_init(): void { - graphql_headless_webhooks_constants(); - $not_ready = graphql_headless_webhooks_dependencies_not_ready(); +function graphql_webhooks_init(): void { + graphql_webhooks_constants(); + $not_ready = graphql_webhooks_dependencies_not_ready(); - if ( $not_ready === [] && defined( 'WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_DIR' ) ) { + if ( $not_ready === [] && defined( 'WPGRAPHQL_WEBHOOKS_PLUGIN_DIR' ) ) { // Load text domain at the init hook - add_action( 'init', 'WPGraphQL\Webhooks\graphql_headless_webhooks_load_textdomain' ); + add_action( 'init', 'WPGraphQL\Webhooks\graphql_webhooks_load_textdomain' ); - require_once WPGRAPHQL_HEADLESS_WEBHOOKS_PLUGIN_DIR . 'src/Plugin.php'; + require_once WPGRAPHQL_WEBHOOKS_PLUGIN_DIR . 'src/Plugin.php'; $plugin = new \WPGraphQL\Webhooks\Plugin(); $plugin::instance(); return; @@ -127,7 +127,7 @@ static function () use ($dep) { // Using plain string to avoid early text domain loading printf( /* translators: dependency not ready error message */ - '%1$s must be active for WPGraphQL Headless Webhooks to work.', + '%1$s must be active for WPGraphQL Webhooks to work.', esc_html( $dep ) ); ?> @@ -143,16 +143,16 @@ static function () use ($dep) { /** * Load plugin text domain. */ -function graphql_headless_webhooks_load_textdomain(): void { +function graphql_webhooks_load_textdomain(): void { load_plugin_textdomain( - 'wp-graphql-headless-webhooks', + 'wp-graphql-webhooks', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); } // Load the text domain during init, not earlier -add_action( 'init', 'WPGraphQL\Webhooks\graphql_headless_webhooks_load_textdomain', 1 ); +add_action( 'init', 'WPGraphQL\Webhooks\graphql_webhooks_load_textdomain', 1 ); /** @psalm-suppress HookNotFound */ -add_action( 'plugins_loaded', 'WPGraphQL\Webhooks\graphql_headless_webhooks_init' ); \ No newline at end of file +add_action( 'plugins_loaded', 'WPGraphQL\Webhooks\graphql_webhooks_init' ); \ No newline at end of file From cd7bad3048c42eb034669962f6c814ff4388c85a Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:28:30 +0100 Subject: [PATCH 2/5] chore: removed more occurences of "headless" --- plugins/wp-graphql-webhooks/.env.dist | 2 +- plugins/wp-graphql-webhooks/.gitattributes | 4 ++-- plugins/wp-graphql-webhooks/bin/install-test-env.sh | 4 ++-- plugins/wp-graphql-webhooks/docker-compose.yml | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/wp-graphql-webhooks/.env.dist b/plugins/wp-graphql-webhooks/.env.dist index 3a8442f4..b778fd31 100644 --- a/plugins/wp-graphql-webhooks/.env.dist +++ b/plugins/wp-graphql-webhooks/.env.dist @@ -35,4 +35,4 @@ WORDPRESS_DB_USER=${DB_USER} WORDPRESS_DB_PASSWORD=${DB_PASSWORD} WORDPRESS_DB_NAME=${DB_NAME} -PLUGIN_SLUG=wp-graphql-headless-webhooks \ No newline at end of file +PLUGIN_SLUG=wp-graphql-webhooks \ No newline at end of file diff --git a/plugins/wp-graphql-webhooks/.gitattributes b/plugins/wp-graphql-webhooks/.gitattributes index 3837da1e..3b84e2d6 100644 --- a/plugins/wp-graphql-webhooks/.gitattributes +++ b/plugins/wp-graphql-webhooks/.gitattributes @@ -6,7 +6,7 @@ /docs export-ignore /phpstan export-ignore /tests export-ignore -/wp-graphql-headless-webhooks export-ignore +/wp-graphql-webhooks export-ignore /.coveralls export-ignore /.distignore export-ignore @@ -18,4 +18,4 @@ /composer.lock export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore -/wp-graphql-headless-webhooks.php export-ignore \ No newline at end of file +/wp-graphql-webhooks.php export-ignore \ No newline at end of file diff --git a/plugins/wp-graphql-webhooks/bin/install-test-env.sh b/plugins/wp-graphql-webhooks/bin/install-test-env.sh index 4e47321b..468e3af0 100644 --- a/plugins/wp-graphql-webhooks/bin/install-test-env.sh +++ b/plugins/wp-graphql-webhooks/bin/install-test-env.sh @@ -144,12 +144,12 @@ setup_file_permissions() { setup_plugin() { if [ "${SKIP_WP_SETUP}" = "true" ]; then - echo -e "$(warning_message "Skipping wp-graphql-headless-webhooks installation...")" + echo -e "$(warning_message "Skipping wp-graphql--webhooks installation...")" return 0 fi # Add this repo as a plugin to the repo - if [ ! -d $WORDPRESS_ROOT_DIR/wp-content/plugins/wp-graphql-headless-webhooks ]; then + if [ ! -d $WORDPRESS_ROOT_DIR/wp-content/plugins/wp-graphql-webhooks ]; then echo -e "$(status_message "Symlinking the plugin to the WordPress plugins directory...")" cd "$ORIGINAL_PATH" diff --git a/plugins/wp-graphql-webhooks/docker-compose.yml b/plugins/wp-graphql-webhooks/docker-compose.yml index 5a66a880..d5af7ae5 100644 --- a/plugins/wp-graphql-webhooks/docker-compose.yml +++ b/plugins/wp-graphql-webhooks/docker-compose.yml @@ -4,9 +4,9 @@ services: app: depends_on: - app_db - image: wp-graphql-headless-webhooks:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.0} + image: wp-graphql-webhooks:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.0} volumes: - - '.:/var/www/html/wp-content/plugins/wp-graphql-headless-webhooks' + - '.:/var/www/html/wp-content/plugins/wp-graphql-webhooks' - './.log/app:/var/log/apache2' env_file: - .env @@ -34,9 +34,9 @@ services: testing: depends_on: - app_db - image: wp-graphql-headless-webhooks-testing:latest-wp${WP_VERSION-5.9}-php${PHP_VERSION-8.0} + image: wp-graphql-webhooks-testing:latest-wp${WP_VERSION-5.9}-php${PHP_VERSION-8.0} volumes: - - '.:/var/www/html/wp-content/plugins/wp-graphql-headless-webhooks' + - '.:/var/www/html/wp-content/plugins/wp-graphql-webhooks' - './.log/testing:/var/log/apache2' env_file: - .env From 64e91d440d6f5a55e38d884c976e58d501c077d0 Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:33:26 +0100 Subject: [PATCH 3/5] chore: update package.json --- plugins/wp-graphql-webhooks/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/wp-graphql-webhooks/package.json b/plugins/wp-graphql-webhooks/package.json index fd29f31c..9d4b1922 100644 --- a/plugins/wp-graphql-webhooks/package.json +++ b/plugins/wp-graphql-webhooks/package.json @@ -10,10 +10,10 @@ "author": "wpengine", "license": "GPL-2.0", "devDependencies": { - "@playwright/test": "^1.52.0", - "@wordpress/e2e-test-utils-playwright": "^1.25.0", - "@wordpress/env": "^10.25.0", - "@wordpress/jest-console": "^8.25.0", - "@wordpress/scripts": "^30.18.0" + "@playwright/test": "^1.53.1", + "@wordpress/e2e-test-utils-playwright": "^1.26.0", + "@wordpress/env": "^10.26.0", + "@wordpress/jest-console": "^8.26.0", + "@wordpress/scripts": "^30.19.0" } } \ No newline at end of file From 2e903cda3d2e18ff56d287d363679b54d01704a6 Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:16:35 +0100 Subject: [PATCH 4/5] chore: update functional suite --- plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml index 99b293cb..ad7d9698 100644 --- a/plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml +++ b/plugins/wp-graphql-webhooks/tests/functional.suite.dist.yml @@ -16,7 +16,7 @@ modules: loadOnly: true plugins: - wp-graphql/wp-graphql.php - - wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php + - wp-graphql-webhooks/wp-graphql-webhooks.php activatePlugins: - wp-graphql/wp-graphql.php - - wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php \ No newline at end of file + - wp-graphql-webhooks/wp-graphql-webhooks.php \ No newline at end of file From 02362a6bbf07dd6b440c26a0468d499a99731f1c Mon Sep 17 00:00:00 2001 From: Theo <328805+theodesp@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:18:57 +0100 Subject: [PATCH 5/5] chore: update plugin folder references --- examples/next/webhooks-isr/.wp-env.json | 2 +- plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/next/webhooks-isr/.wp-env.json b/examples/next/webhooks-isr/.wp-env.json index b18d87b2..19c93194 100644 --- a/examples/next/webhooks-isr/.wp-env.json +++ b/examples/next/webhooks-isr/.wp-env.json @@ -4,7 +4,7 @@ "https://github.com/wp-graphql/wp-graphql/releases/latest/download/wp-graphql.zip", "https://github.com/wp-graphql/wp-graphql-smart-cache/releases/download/v2.0.0/wpgraphql-smart-cache.zip", "https://downloads.wordpress.org/plugin/code-snippets.3.6.8.zip", - "../../../plugins/wp-graphql-headless-webhooks" + "../../../plugins/wp-graphql-webhooks" ], "config": { "WP_DEBUG": true, diff --git a/plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml b/plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml index 2b41ca99..8352a8ea 100644 --- a/plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml +++ b/plugins/wp-graphql-webhooks/tests/acceptance.suite.dist.yml @@ -19,7 +19,7 @@ modules: loadOnly: true plugins: - wp-graphql/wp-graphql.php - - wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php + - wp-graphql-webhooks/wp-graphql-webhooks.php activatePlugins: - wp-graphql/wp-graphql.php - - wp-graphql-headless-webhooks/wp-graphql-headless-webhooks.php \ No newline at end of file + - wp-graphql--webhooks/wp-graphql-webhooks.php \ No newline at end of file