# wordpress-seo/trunk/src/ai/generator/domain/usage-parameters.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version trunk. 75 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/ai/generator/domain/usage-parameters.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/trunk/raw/src/ai/generator/domain/usage-parameters.php
- Modified: 2026-07-07T11:18:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/ai/generator/domain/usage-parameters.php#L10-L20`.

```php
<?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;
	}
}

```
