transient( $key ) ) < self::LIMIT; } /** * Count one call against the bucket. * * @since 4.10.0 * * @param string $key Bucket key. * * @return void */ public function record( $key ) { $name = $this->transient( $key ); $count = (int) get_transient( $name ); set_transient( $name, $count + 1, self::WINDOW ); } /** * Get the transient name backing one bucket. * * @since 4.10.0 * * @param string $key Bucket key. * * @return string */ private function transient( $key ) { return 'wp_mail_smtp_preflight_' . md5( $key ); } }