Skip to content

Commit 1aa6e7a

Browse files
committed
Reuse earlier lookup of auth credentials
1 parent b24a773 commit 1aa6e7a

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/DetectSitemapsURLs.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,8 @@ public static function detect( string $wp_site_url ): \Iterator {
7676

7777
$headers = [];
7878

79-
$auth_user = CoreOptions::getValue( 'basicAuthUser' );
80-
81-
if ( $auth_user ) {
82-
$auth_password = CoreOptions::getValue( 'basicAuthPassword' );
83-
84-
if ( $auth_password ) {
85-
$headers['auth'] = [ $auth_user, $auth_password ];
86-
}
79+
if ( $auth_user && $auth_password ) {
80+
$headers['auth'] = [ $auth_user, $auth_password ];
8781
}
8882

8983
$request = new Request( 'GET', $base_uri . '/robots.txt', $headers );

0 commit comments

Comments
 (0)