From fd92e507750e3a55cf8fe2a8040effda5099bd83 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 23 Dec 2024 10:46:09 +0100 Subject: [PATCH] Add missing multiplicator for nonce life Fixes https://github.com/ocean90/public-post-preview/issues/180 --- public-post-preview.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public-post-preview.php b/public-post-preview.php index 3eebed6..dcb3f45 100644 --- a/public-post-preview.php +++ b/public-post-preview.php @@ -767,7 +767,8 @@ private static function maybe_redirect_to_published_post( $post_id ) { * @return int The time-dependent variable. */ private static function nonce_tick() { - $nonce_life = apply_filters( 'ppp_nonce_life', get_option( 'public_post_preview_expiration_time' ) ?: 48 ); + $expiration = get_option( 'public_post_preview_expiration_time' ) ?: 48; + $nonce_life = apply_filters( 'ppp_nonce_life', $expiration * HOUR_IN_SECONDS ); return ceil( time() / ( $nonce_life / 2 ) ); }