| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/wordpress-seo/src/ai/generator/domain/ |
Upload File : |
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\AI\Generator\Domain;
use WP_User;
/**
* Parameters for a usage request.
*/
class Usage_Parameters {
/**
* The user the request is on behalf of.
*
* @var WP_User
*/
private $user;
/**
* Whether usage should be read from the time-unbound free-usage bucket rather than a period.
*
* @var bool
*/
private $is_free;
/**
* The usage period (e.g. `2026-06`) the request applies to when it is not a free-usage request.
*
* @var string
*/
private $period;
/**
* The constructor.
*
* @param WP_User $user The user.
* @param bool $is_free Whether to read the free-usage bucket instead of a period.
* @param string $period The usage period (e.g. `2026-06`); ignored for free-usage requests.
*/
public function __construct( WP_User $user, bool $is_free, string $period ) {
$this->user = $user;
$this->is_free = $is_free;
$this->period = $period;
}
/**
* Returns the user.
*
* @return WP_User The user.
*/
public function get_user(): WP_User {
return $this->user;
}
/**
* Returns whether usage should be read from the free-usage bucket.
*
* @return bool True when the request targets the free-usage bucket.
*/
public function is_free(): bool {
return $this->is_free;
}
/**
* Returns the usage period the request applies to.
*
* @return string The usage period (e.g. `2026-06`).
*/
public function get_period(): string {
return $this->period;
}
}