From 898cba414be1120c7b56c266ddedaf1b0826f397 Mon Sep 17 00:00:00 2001 From: Francis Tseng Date: Fri, 15 Sep 2017 13:55:26 -0400 Subject: [PATCH 1/2] set transient clearing on post publish, and drastically shorter cache time --- includes/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/helpers.php b/includes/helpers.php index 41148bb..f1b2467 100644 --- a/includes/helpers.php +++ b/includes/helpers.php @@ -141,7 +141,7 @@ function tni_core_get_unauthorized_posts() { $posts = array_values( array_filter( $post_query, 'tni_is_subscription_only' ) ); } - set_transient( 'tni_unauthorized_posts', $posts, HOURS_IN_SECONDS * 12 ); + set_transient( 'tni_unauthorized_posts', $posts, MINUTE_IN_SECONDS * 5); } @@ -166,4 +166,4 @@ function tni_core_purge_transients( $ID, $post ) { delete_transient( 'tni_unauthorized_posts' ); } } -//add_action( 'publish_post', 'tni_core_purge_transients' ); +add_action( 'publish_post', 'tni_core_purge_transients' ); From 82e6663eba1c5bec023070c9b0b0d972e198dbb9 Mon Sep 17 00:00:00 2001 From: Francis Tseng Date: Fri, 15 Sep 2017 13:56:14 -0400 Subject: [PATCH 2/2] version bump --- readme.txt | 6 +++++- tni-core-functionality.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index fa4d936..86f8c7c 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: misfist Tags: custom Requires at least: 4.7 Tested up to: 4.8 -Version: 1.2.9 +Version: 1.2.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -22,6 +22,10 @@ This section describes how to install the plugin and get it working. == Changelog == += 1.2.10 Sept 15, 2017 = +* Reduced unauthorized post transient cache time +* Enabled unauthorized post transient clearing on post publish + = 1.2.9 Aug 18, 2017 = * Added function return array of unauthorized post IDs diff --git a/tni-core-functionality.php b/tni-core-functionality.php index f96a6f5..d1e9687 100644 --- a/tni-core-functionality.php +++ b/tni-core-functionality.php @@ -10,7 +10,7 @@ * Text Domain: tni-core * Domain Path: /languages * - * Version: 1.2.9 + * Version: 1.2.10 * * @package Tni_Core_Functionality */