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..cb35a654 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === WPGraphQL Smart Cache === -Contributors: markkelnar, jasonbahl +Contributors: WPGraphQL, markkelnar, jasonbahl 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 6f636adc..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'; @@ -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 );