This commit is contained in:
Javier Casares 2026-08-15 12:40:32 +00:00
commit 061329c704
11 changed files with 114 additions and 25 deletions

View file

@ -333,6 +333,20 @@ class Robotstxt_Manager_Settings {
return is_string( $raw ) ? $raw : '';
}
// Account keys are UUIDs issued by the store; reject anything that
// cannot be one rather than storing a mangled key that only fails
// later at connection time.
if ( ! preg_match( '/^[a-f0-9][a-f0-9-]{7,126}$/i', $plain ) ) {
add_settings_error(
'robotstxt_manager_api_key',
'invalid_api_key',
esc_html__( 'The API key format is invalid. Copy the full key from your ROBOTSTXT account page.', 'robotstxt-manager' )
);
$raw = get_option( 'robotstxt_manager_api_key', '' );
return is_string( $raw ) ? $raw : '';
}
delete_transient( 'robotstxt_manager_catalog' );
return Robotstxt_Manager_Encryption::encrypt( $plain );