admin_header( false );
if ( isset( $msg ) && ! empty( $msg ) ) {
echo '
';
}
$action_url = network_admin_url( 'admin.php?page=wpseo_files' ); // auto-falls back on admin_url for non-multisite
if ( ! file_exists( $robots_file ) ) {
if ( is_writable( get_home_path() ) ) {
$content = '';
}
else {
$content = '' . __( 'If you had a robots.txt file and it was editable, you could edit it from here.', 'wordpress-seo' );
}
}
else {
$f = fopen( $robots_file, 'r' );
$content = '';
if ( filesize( $robots_file ) > 0 ) {
$content = fread( $f, filesize( $robots_file ) );
}
$robots_txt_content = esc_textarea( $content );
if ( ! is_writable( $robots_file ) ) {
$content = '
' . __( 'If your robots.txt were writable, you could edit it from here.', 'wordpress-seo' ) . '
';
$content .= ' ';
} else {
$content = '';
}
}
$wpseo_admin_pages->postbox( 'robotstxt', __( 'Robots.txt', 'wordpress-seo' ), $content );
if ( ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) === false ) && file_exists( $ht_access_file ) ) {
$f = fopen( $ht_access_file, 'r' );
$contentht = '';
if ( filesize( $ht_access_file ) > 0 ) {
$contentht = fread( $f, filesize( $ht_access_file ) );
}
$contentht = esc_textarea( $contentht );
if ( ! is_writable( $ht_access_file ) ) {
$content = '' . __( 'If your .htaccess were writable, you could edit it from here.', 'wordpress-seo' ) . '
';
$content .= '' . $contentht . ' ';
} else {
$content = '';
$content .= wp_nonce_field( 'wpseo-htaccess', '_wpnonce', true, false );
$content .= '' . __( 'Edit the content of your .htaccess:', 'wordpress-seo' ) . '
';
$content .= '' . $contentht . ' ';
$content .= '
';
$content .= ' ';
}
$wpseo_admin_pages->postbox( 'htaccess', __( '.htaccess file', 'wordpress-seo' ), $content );
} elseif ( ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) === false ) && ! file_exists( $ht_access_file ) ) {
$content = '' . __( 'If you had a .htaccess file and it was editable, you could edit it from here.', 'wordpress-seo' );
$wpseo_admin_pages->postbox( 'htaccess', __( '.htaccess file', 'wordpress-seo' ), $content );
}
$wpseo_admin_pages->admin_footer( false );