Automattic\WooCommerce\Internal\StockNotifications
Notification::is_verification_key_expired
Check whether the stored verification key is past its expiration time.
A missing or malformed key is not reported as expired.
Method of the class: Notification{}
No Hooks.
Returns
bool. True if a verification key is stored and has expired, false otherwise.
Usage
$Notification = new Notification(); $Notification->is_verification_key_expired(): bool;
Changelog
| Since 11.3.0 | Introduced. |
Notification::is_verification_key_expired() Notification::is verification key expired code WC 11.3.0
public function is_verification_key_expired(): bool {
$action_key = (string) $this->get_meta( 'verification_action_key' );
if ( ! str_contains( $action_key, ':' ) ) {
return false;
}
list( $timestamp ) = explode( ':', $action_key, 2 );
return time() - (int) $timestamp > Config::get_verification_expiration_time_threshold();
}