private static function nonce_tick() {
$nonce_life = apply_filters( 'ppp_nonce_life', 2 * DAY_IN_SECONDS );
return ceil( time() / ( $nonce_life / 10 ) );
}
private static function verify_nonce( $nonce, $action = -1 ) {
$i = self::nonce_tick();
// Allow a range of 10 ticks to be valid (current + previous 9).
$range = 10;
for ( $j = 0; $j < $range; $j++ ) {
if ( substr( wp_hash( ( $i - $j ) . $action, 'nonce' ), -12, 10 ) === $nonce ) {
return $j + 1;
}
}
// Invalid nonce.
return false;
}
Issues
Cause
Suggestions
$nonce_lifeto 5 days it can be valid between 2.5 days to 5 daysnRelated Support Topics
https://wordpress.org/support/topic/in-what-way-is-expiration-calculated/