From ce34234f86acc5b8ab1b2e792d2fdd7525f1e35b Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Tue, 18 Oct 2022 14:11:57 -0600 Subject: [PATCH 1/2] - add temp patch for wpe mu plugin --- README.md | 8 ++++++-- readme.txt | 2 +- wp-graphql-smart-cache.php | 11 +++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0e1fcc0b..c3daa210 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# WP GraphQL Smart Cache - BETA USERS +# WP GraphQL Smart Cache -If you've been contacted to beta test this plugin, you can access the docs here: https://docs.google.com/document/d/16n2LxJB5POBkkWF6OIC9et1BogLMiRf6qZwL7ofBT5k/edit?usp=sharing +This plugin provides caching and cache-invalidation options for WPGraphQL. + +## Docs + +coming soon! diff --git a/readme.txt b/readme.txt index e6b1895b..a483a74d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === WPGraphQL Smart Cache === -Contributors: markkelnar, jasonbahl +Contributors: WPGraphQL, markkelnar, jasonbahl Tags: GraphQL Requires at least: 4.5 Tested up to: 5.6.1 diff --git a/wp-graphql-smart-cache.php b/wp-graphql-smart-cache.php index 6f636adc..acfe49f1 100644 --- a/wp-graphql-smart-cache.php +++ b/wp-graphql-smart-cache.php @@ -188,3 +188,14 @@ function () { $invalidation->init(); } ); + +function _temp_patch_for_wpe_mu_plugin( $purge_keys ) { + if ( ! function_exists( 'graphql_get_endpoint_url' ) || ! method_exists( 'WpeCommon', 'http_to_varnish' ) ) { + return; + } + WpeCommon::http_to_varnish( 'PURGE_GRAPHQL', null, [ + 'GraphQL-Purge-Keys' => $purge_keys, + 'GraphQL-URL' => graphql_get_endpoint_url(), + ] ); +} +add_action( 'graphql_purge', '_temp_patch_for_wpe_mu_plugin', 0, 1 ); From 0630a5eb1f7ca7efee82b972d35688182623a833 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Tue, 18 Oct 2022 14:28:31 -0600 Subject: [PATCH 2/2] v0.2.1 - add temporary patch for wp-engine users. will be removed when the wp engine mu-plugin is updated. --- readme.txt | 6 +++++- wp-graphql-smart-cache.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index a483a74d..cb35a654 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: GraphQL Requires at least: 4.5 Tested up to: 5.6.1 Requires PHP: 5.6 -Stable tag: 0.2.0 +Stable tag: 0.2.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -24,6 +24,10 @@ In order to use v0.2.0+ of WPGraphQL Smart Cache, you will need WPGraphQL v1.12. == Changelog == += 0.2.1 = + +- add temporary patch for wp-engine users. Will be removed when the wp engine mu plugin is updated. + = 0.2.0 - chore: remove unreferenced .zip build artifact diff --git a/wp-graphql-smart-cache.php b/wp-graphql-smart-cache.php index acfe49f1..fe0fa1e3 100644 --- a/wp-graphql-smart-cache.php +++ b/wp-graphql-smart-cache.php @@ -11,7 +11,7 @@ * Requires PHP: 7.4 * Text Domain: wp-graphql-smart-cache * Domain Path: /languages - * Version: 0.2.0 + * Version: 0.2.1 * License: GPL-3 * License URI: https://www.gnu.org/licenses/gpl-3.0.html * @@ -35,7 +35,7 @@ } const WPGRAPHQL_REQUIRED_MIN_VERSION = '1.2.0'; -const WPGRAPHQL_SMART_CACHE_VERSION = '0.2.0'; +const WPGRAPHQL_SMART_CACHE_VERSION = '0.2.1'; require __DIR__ . '/vendor/autoload.php';