Skip to content

Commit

Permalink
Merge pull request #172 from wp-graphql/release/0.2.1
Browse files Browse the repository at this point in the history
v0.2.1
  • Loading branch information
jasonbahl authored Oct 18, 2022
2 parents 728e057 + 0630a5e commit 473811e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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!
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
15 changes: 13 additions & 2 deletions wp-graphql-smart-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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';

Expand Down Expand Up @@ -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 );

0 comments on commit 473811e

Please sign in to comment.