Server : LiteSpeed
System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64
User : gazetufm ( 1431)
PHP Version : 8.1.35
Disable Function : NONE
Directory :  /home2/gazetufm/dumoshi.com/wp-content/plugins/wp-mail-smtp/src/Providers/Preflight/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: Throttle.php

Path: //home2/gazetufm/dumoshi.com/wp-content/plugins/wp-mail-smtp/src/Providers/Preflight/Throttle.php

Size: 1.25 KB

Permissions: 0644

<?php

namespace WPMailSMTP\Providers\Preflight;

/**
 * Caps how fast one caller can drive outbound provider calls.
 *
 * The route's capability gate is what keeps strangers out, so this only limits abuse.
 *
 * @since 4.10.0
 */
class Throttle {

	/**
	 * Calls allowed per bucket per window.
	 *
	 * @since 4.10.0
	 *
	 * @var int
	 */
	const LIMIT = 20;

	/**
	 * Bucket lifetime, in seconds.
	 *
	 * @since 4.10.0
	 *
	 * @var int
	 */
	private const WINDOW = MINUTE_IN_SECONDS;

	/**
	 * Whether the bucket has room for one more call.
	 *
	 * @since 4.10.0
	 *
	 * @param string $key Bucket key.
	 *
	 * @return bool
	 */
	public function allows( $key ) {

		return (int) get_transient( $this->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 );
	}
}

← Back to Directory Edit File 🔒 Chmod

WP File Manager