+ // Fetch or generate keys and salts.
+ $no_api = isset( $_POST['noapi'] );
+ require_once( ABSPATH . WPINC . '/plugin.php' );
+ require_once( ABSPATH . WPINC . '/l10n.php' );
+ require_once( ABSPATH . WPINC . '/pomo/translations.php' );
+ if ( ! $no_api ) {
+ require_once( ABSPATH . WPINC . '/class-http.php' );
+ require_once( ABSPATH . WPINC . '/http.php' );
+ wp_fix_server_vars();
+ /**#@+
+ * @ignore
+ */
+ function get_bloginfo() {
+ return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) );
+ }
+ /**#@-*/
+ $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
+ }
+
+ if ( $no_api || is_wp_error( $secret_keys ) ) {
+ $secret_keys = array();
+ require_once( ABSPATH . WPINC . '/pluggable.php' );
+ for ( $i = 0; $i < 8; $i++ ) {
+ $secret_keys[] = wp_generate_password( 64, true, true );
+ }
+ } else {
+ $secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
+ foreach ( $secret_keys as $k => $v ) {
+ $secret_keys[$k] = substr( $v, 28, 64 );
+ }
+ }
+ $key = 0;