This commit is contained in:
Javier Casares 2026-08-24 06:42:23 +00:00
commit c7a8d9efcc
7 changed files with 123 additions and 27 deletions

View file

@ -356,10 +356,12 @@ class Robotstxt_Manager_Core_Client {
$raw_status = $row['status'] ?? '';
$raw_expires_at = $row['expires_at'] ?? '';
$raw_bound = $row['bound_domain'] ?? '';
$rows[ $slug ] = array(
'status' => is_string( $raw_status ) ? $raw_status : '',
'expires_at' => is_string( $raw_expires_at ) ? $raw_expires_at : '',
'status' => is_string( $raw_status ) ? $raw_status : '',
'expires_at' => is_string( $raw_expires_at ) ? $raw_expires_at : '',
'bound_domain' => is_string( $raw_bound ) ? $raw_bound : '',
);
}
@ -383,6 +385,11 @@ class Robotstxt_Manager_Core_Client {
return '';
}
// Send this site's domain so per-domain license binding is enforced
// at token issuance (Core 1.11.0+); older Core ignores the field.
$host = strtolower( (string) wp_parse_url( home_url(), PHP_URL_HOST ) );
$domain = (string) preg_replace( '/^www\./', '', $host );
$response = wp_remote_post(
$this->store_url . '/wp-json/' . self::REST_NAMESPACE . '/me/download-token',
array(
@ -391,7 +398,12 @@ class Robotstxt_Manager_Core_Client {
'Accept' => 'application/json',
'Content-Type' => 'application/json',
),
'body' => (string) wp_json_encode( array( 'slug' => $slug ) ),
'body' => (string) wp_json_encode(
array(
'slug' => $slug,
'domain' => $domain,
)
),
'timeout' => self::TIMEOUT,
)
);