• notzippy

    (@notzippy)


    A helpful and very simple addition you can add that would improve this plugin is to add an option to allow the user to enter basic auth information, so when building the site your static content generate can pass the credentials and be allowed to access the wordpress site. The code you need to add this to is in includes/class-ss-url-fetcher.php, add in the headers array to the wp_remote_get request like the following

    
    		$response = wp_remote_get( $url, array(
    			'timeout' => self::TIMEOUT,
    			'sslverify' => false, // not verifying SSL because all calls are local
    			'redirection' => 0, // disable redirection
    			'blocking' => true, // do not execute code until this call is complete
    			'stream' => true, // stream body content to a file
    			'filename' => $temp_filename,
                'headers' => array(
                  'Authorization' => 'Basic ' . base64_encode( $REALM_NAME . ':' . $REALM_PASSWORD )
                )
    		) );
    

    This allows for the main wordpress site to be hidden

    Nz

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Basic Auth addition’ is closed to new replies.