$payload The canonical validation payload to keep. * @return void */ public function remember( string $licenseKey, array $payload ): void { set_transient( $this->transientKey( $licenseKey ), $payload, self::GRACE_HOURS * HOUR_IN_SECONDS ); } /** * The remembered payload for a key, or null when none is fresh. * * @since 1.0.0 * * @param string $licenseKey The license key. * @return array|null The remembered payload, or null. */ public function recall( string $licenseKey ): ?array { $payload = get_transient( $this->transientKey( $licenseKey ) ); return is_array( $payload ) ? $payload : null; } /** * Remove a remembered payload. * * @since 1.0.0 * * @param string $licenseKey The license key. * @return void */ public function forget( string $licenseKey ): void { delete_transient( $this->transientKey( $licenseKey ) ); } /** * Make a transient name without the license key. * * @since 1.0.0 * * @param string $licenseKey The license key. * @return string The transient name. */ private function transientKey( string $licenseKey ): string { return 'releasecart_lkg_' . md5( $licenseKey ); } }