Edit File by line
/home/barbar84/www/wp-admin/includes
File: network.php
'LOGGED_IN_KEY' => '',
[500] Fix | Delete
'NONCE_KEY' => '',
[501] Fix | Delete
'AUTH_SALT' => '',
[502] Fix | Delete
'SECURE_AUTH_SALT' => '',
[503] Fix | Delete
'LOGGED_IN_SALT' => '',
[504] Fix | Delete
'NONCE_SALT' => '',
[505] Fix | Delete
);
[506] Fix | Delete
foreach ( $keys_salts as $c => $v ) {
[507] Fix | Delete
if ( defined( $c ) ) {
[508] Fix | Delete
unset( $keys_salts[ $c ] );
[509] Fix | Delete
}
[510] Fix | Delete
}
[511] Fix | Delete
[512] Fix | Delete
if ( ! empty( $keys_salts ) ) {
[513] Fix | Delete
$keys_salts_str = '';
[514] Fix | Delete
$from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
[515] Fix | Delete
if ( is_wp_error( $from_api ) ) {
[516] Fix | Delete
foreach ( $keys_salts as $c => $v ) {
[517] Fix | Delete
$keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
[518] Fix | Delete
}
[519] Fix | Delete
} else {
[520] Fix | Delete
$from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
[521] Fix | Delete
foreach ( $keys_salts as $c => $v ) {
[522] Fix | Delete
$keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
[523] Fix | Delete
}
[524] Fix | Delete
}
[525] Fix | Delete
$num_keys_salts = count( $keys_salts );
[526] Fix | Delete
?>
[527] Fix | Delete
<p>
[528] Fix | Delete
<?php
[529] Fix | Delete
if ( 1 === $num_keys_salts ) {
[530] Fix | Delete
printf(
[531] Fix | Delete
/* translators: %s: wp-config.php */
[532] Fix | Delete
__( 'This unique authentication key is also missing from your %s file.' ),
[533] Fix | Delete
'<code>wp-config.php</code>'
[534] Fix | Delete
);
[535] Fix | Delete
} else {
[536] Fix | Delete
printf(
[537] Fix | Delete
/* translators: %s: wp-config.php */
[538] Fix | Delete
__( 'These unique authentication keys are also missing from your %s file.' ),
[539] Fix | Delete
'<code>wp-config.php</code>'
[540] Fix | Delete
);
[541] Fix | Delete
}
[542] Fix | Delete
?>
[543] Fix | Delete
<?php _e( 'To make your installation more secure, you should also add:' ); ?>
[544] Fix | Delete
</p>
[545] Fix | Delete
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
[546] Fix | Delete
<?php
[547] Fix | Delete
}
[548] Fix | Delete
?>
[549] Fix | Delete
</li>
[550] Fix | Delete
<?php
[551] Fix | Delete
if ( iis7_supports_permalinks() ) :
[552] Fix | Delete
// IIS doesn't support RewriteBase, all your RewriteBase are belong to us.
[553] Fix | Delete
$iis_subdir_match = ltrim( $base, '/' ) . $subdir_match;
[554] Fix | Delete
$iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base;
[555] Fix | Delete
$iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
[556] Fix | Delete
[557] Fix | Delete
$web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
[558] Fix | Delete
<configuration>
[559] Fix | Delete
<system.webServer>
[560] Fix | Delete
<rewrite>
[561] Fix | Delete
<rules>
[562] Fix | Delete
<rule name="WordPress Rule 1" stopProcessing="true">
[563] Fix | Delete
<match url="^index\.php$" ignoreCase="false" />
[564] Fix | Delete
<action type="None" />
[565] Fix | Delete
</rule>';
[566] Fix | Delete
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
[567] Fix | Delete
$web_config_file .= '
[568] Fix | Delete
<rule name="WordPress Rule for Files" stopProcessing="true">
[569] Fix | Delete
<match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
[570] Fix | Delete
<action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" />
[571] Fix | Delete
</rule>';
[572] Fix | Delete
}
[573] Fix | Delete
$web_config_file .= '
[574] Fix | Delete
<rule name="WordPress Rule 2" stopProcessing="true">
[575] Fix | Delete
<match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" />
[576] Fix | Delete
<action type="Redirect" url="' . $iis_subdir_replacement . 'wp-admin/" redirectType="Permanent" />
[577] Fix | Delete
</rule>
[578] Fix | Delete
<rule name="WordPress Rule 3" stopProcessing="true">
[579] Fix | Delete
<match url="^" ignoreCase="false" />
[580] Fix | Delete
<conditions logicalGrouping="MatchAny">
[581] Fix | Delete
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
[582] Fix | Delete
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
[583] Fix | Delete
</conditions>
[584] Fix | Delete
<action type="None" />
[585] Fix | Delete
</rule>
[586] Fix | Delete
<rule name="WordPress Rule 4" stopProcessing="true">
[587] Fix | Delete
<match url="^' . $iis_subdir_match . '(wp-(content|admin|includes).*)" ignoreCase="false" />
[588] Fix | Delete
<action type="Rewrite" url="' . $iis_rewrite_base . '{R:1}" />
[589] Fix | Delete
</rule>
[590] Fix | Delete
<rule name="WordPress Rule 5" stopProcessing="true">
[591] Fix | Delete
<match url="^' . $iis_subdir_match . '([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
[592] Fix | Delete
<action type="Rewrite" url="' . $iis_rewrite_base . '{R:2}" />
[593] Fix | Delete
</rule>
[594] Fix | Delete
<rule name="WordPress Rule 6" stopProcessing="true">
[595] Fix | Delete
<match url="." ignoreCase="false" />
[596] Fix | Delete
<action type="Rewrite" url="index.php" />
[597] Fix | Delete
</rule>
[598] Fix | Delete
</rules>
[599] Fix | Delete
</rewrite>
[600] Fix | Delete
</system.webServer>
[601] Fix | Delete
</configuration>
[602] Fix | Delete
';
[603] Fix | Delete
[604] Fix | Delete
echo '<li><p>';
[605] Fix | Delete
printf(
[606] Fix | Delete
/* translators: 1: File name (.htaccess or web.config), 2: File path. */
[607] Fix | Delete
__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
[608] Fix | Delete
'<code>web.config</code>',
[609] Fix | Delete
'<code>' . $home_path . '</code>'
[610] Fix | Delete
);
[611] Fix | Delete
echo '</p>';
[612] Fix | Delete
if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) {
[613] Fix | Delete
echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
[614] Fix | Delete
}
[615] Fix | Delete
?>
[616] Fix | Delete
<textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?></textarea>
[617] Fix | Delete
</li>
[618] Fix | Delete
</ol>
[619] Fix | Delete
[620] Fix | Delete
<?php
[621] Fix | Delete
elseif ( $is_nginx ) : // End iis7_supports_permalinks(). Link to Nginx documentation instead:
[622] Fix | Delete
[623] Fix | Delete
echo '<li><p>';
[624] Fix | Delete
printf(
[625] Fix | Delete
/* translators: %s: Documentation URL. */
[626] Fix | Delete
__( 'It seems your network is running with Nginx web server. <a href="%s">Learn more about further configuration</a>.' ),
[627] Fix | Delete
__( 'https://wordpress.org/support/article/nginx/' )
[628] Fix | Delete
);
[629] Fix | Delete
echo '</p></li>';
[630] Fix | Delete
[631] Fix | Delete
else : // End $is_nginx. Construct an .htaccess file instead:
[632] Fix | Delete
[633] Fix | Delete
$ms_files_rewriting = '';
[634] Fix | Delete
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
[635] Fix | Delete
$ms_files_rewriting = "\n# uploaded files\nRewriteRule ^";
[636] Fix | Delete
$ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n";
[637] Fix | Delete
}
[638] Fix | Delete
[639] Fix | Delete
$htaccess_file = <<<EOF
[640] Fix | Delete
RewriteEngine On
[641] Fix | Delete
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
[642] Fix | Delete
RewriteBase {$base}
[643] Fix | Delete
RewriteRule ^index\.php$ - [L]
[644] Fix | Delete
{$ms_files_rewriting}
[645] Fix | Delete
# add a trailing slash to /wp-admin
[646] Fix | Delete
RewriteRule ^{$subdir_match}wp-admin$ {$subdir_replacement_01}wp-admin/ [R=301,L]
[647] Fix | Delete
[648] Fix | Delete
RewriteCond %{REQUEST_FILENAME} -f [OR]
[649] Fix | Delete
RewriteCond %{REQUEST_FILENAME} -d
[650] Fix | Delete
RewriteRule ^ - [L]
[651] Fix | Delete
RewriteRule ^{$subdir_match}(wp-(content|admin|includes).*) {$rewrite_base}{$subdir_replacement_12} [L]
[652] Fix | Delete
RewriteRule ^{$subdir_match}(.*\.php)$ {$rewrite_base}$subdir_replacement_12 [L]
[653] Fix | Delete
RewriteRule . index.php [L]
[654] Fix | Delete
[655] Fix | Delete
EOF;
[656] Fix | Delete
[657] Fix | Delete
echo '<li><p>';
[658] Fix | Delete
printf(
[659] Fix | Delete
/* translators: 1: File name (.htaccess or web.config), 2: File path. */
[660] Fix | Delete
__( 'Add the following to your %1$s file in %2$s, <strong>replacing</strong> other WordPress rules:' ),
[661] Fix | Delete
'<code>.htaccess</code>',
[662] Fix | Delete
'<code>' . $home_path . '</code>'
[663] Fix | Delete
);
[664] Fix | Delete
echo '</p>';
[665] Fix | Delete
if ( ! $subdomain_install && WP_CONTENT_DIR !== ABSPATH . 'wp-content' ) {
[666] Fix | Delete
echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
[667] Fix | Delete
}
[668] Fix | Delete
?>
[669] Fix | Delete
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>"><?php echo esc_textarea( $htaccess_file ); ?></textarea>
[670] Fix | Delete
</li>
[671] Fix | Delete
</ol>
[672] Fix | Delete
[673] Fix | Delete
<?php
[674] Fix | Delete
endif; // End IIS/Nginx/Apache code branches.
[675] Fix | Delete
[676] Fix | Delete
if ( ! is_multisite() ) {
[677] Fix | Delete
?>
[678] Fix | Delete
<p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>
[679] Fix | Delete
<?php
[680] Fix | Delete
}
[681] Fix | Delete
}
[682] Fix | Delete
[683] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function