-
Notifications
You must be signed in to change notification settings - Fork 2
[POC] Smart Cache Integration w/ UI #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
ℹ️ Download the wp-graphql-headless-webhooks plugin artifact from this workflow run (see the 'Artifacts' section at the bottom). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a proof-of-concept integration for Smart Cache events into the WPGraphQL Webhooks plugin, consolidating cache purge events to avoid webhook spam. Key changes include removing an outdated cleanup script, adding Smart Cache event support (via a new SmartCacheEventHandler), and updating admin views and REST endpoints to support the new integration.
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
scripts/cleanup-wp-env.sh | Removed an obsolete cleanup script. |
scripts/clean.sh | Updated environment clean-up logic to remove wp-env state directories. |
plugins/wp-graphql-headless-webhooks/src/Repository/WebhookRepository.php | Modified allowed events and improved HTTP method validation. |
plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheEventHandler.php | Added a handler that consolidates Smart Cache events before triggering webhooks. |
plugins/wp-graphql-headless-webhooks/src/Events/WebhookEventManager.php | Integrated the new Smart Cache event handler into the webhook event management. |
Remaining plugin files (Admin views, assets, configuration) | Updated to support new REST endpoints, admin UI integration, and overall Smart Cache integration. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)
plugins/wp-graphql-headless-webhooks/src/Events/SmartCacheEventHandler.php:47
- Consider type-hinting the webhook_trigger_callback parameter as callable to improve type safety and clarity.
public function __construct( $webhook_trigger_callback ) {
plugins/wp-graphql-headless-webhooks/src/Events/WebhookEventManager.php:37
- Ensure that the signature and expected parameters of the trigger_webhooks method match the requirements of SmartCacheEventHandler's callback usage.
$this->smart_cache_handler = new SmartCacheEventHandler( [ $this, 'trigger_webhooks' ] );
scripts/clean.sh:7
- [nitpick] Confirm that removing the entire '~/.wp-env' directory (instead of its contents) is the intended behavior in environments with multiple configurations.
rm -rf ~/.wp-env
Uh oh!
There was an error while loading. Please reload this page.