options->telegram->enabled ) { return false; } return self::hasCredentials(); } /** * Whether the credentials are present, regardless of the toggle. * * Used by the settings sanitiser to tell "never set up" apart from "set up and then retired", * which is what makes switching it back on refusable rather than merely hidden. * * @since 4.0.4 * * @return bool True when both credentials are stored. */ public static function hasCredentials() { $token = trim( (string) aioseo404To301()->options->telegram->botToken ); $chatId = trim( (string) aioseo404To301()->options->telegram->chatId ); return '' !== $token && '' !== $chatId; } }