This commit is contained in:
Javier Casares 2026-08-18 10:47:06 +00:00
commit b2849880ec
8 changed files with 91 additions and 16 deletions

View file

@ -149,7 +149,7 @@ class Robotstxt_Manager_Core_Client {
);
}
$response = $this->get( '/plugins' );
$response = $this->get( '/me/subscriptions' );
if ( is_wp_error( $response ) ) {
return array(
@ -161,6 +161,13 @@ class Robotstxt_Manager_Core_Client {
$code = (int) wp_remote_retrieve_response_code( $response );
if ( 401 === $code ) {
return array(
'ok' => false,
'message' => __( 'Invalid API key. Please check your key and try again.', 'robotstxt-manager' ),
);
}
if ( 200 !== $code ) {
return array(
'ok' => false,
@ -175,7 +182,7 @@ class Robotstxt_Manager_Core_Client {
return array(
'ok' => true,
'message' => __( 'Connected.', 'robotstxt-manager' ),
'catalog_count' => $count,
'subscriptions' => $count,
);
}