admin_header( 'Files', false ); if ( isset( $msg ) && !empty( $msg ) ) { echo '

' . esc_html( $msg ) . '

'; } if ( file_exists( get_home_path() . "robots.txt" ) ) { $robots_file = get_home_path() . "robots.txt"; $f = fopen( $robots_file, 'r' ); if ( filesize( $robots_file ) > 0 ) $content = fread( $f, filesize( $robots_file ) ); else $content = ''; $robotstxtcontent = 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 = '
'; $content .= wp_nonce_field( 'wpseo-robotstxt', '_wpnonce', true, false ); $content .= "

" . __( "Edit the content of your robots.txt:", 'wordpress-seo' ) . "

"; $content .= '
'; $content .= '
'; $content .= '
'; } } else { $content = '

'.__('If you had a robots.txt file and it was editable, you could edit it from here.','wordpress-seo'); } $wpseo_admin_pages->postbox( 'robotstxt', __( 'Robots.txt', 'wordpress-seo' ), $content ); if ( (isset($_SERVER['SERVER_SOFTWARE']) && stristr($_SERVER['SERVER_SOFTWARE'], 'nginx') === false) && file_exists( get_home_path() . ".htaccess" ) ) { $htaccess_file = get_home_path() . "/.htaccess"; $f = fopen( $htaccess_file, 'r' ); $contentht = fread( $f, filesize( $htaccess_file ) ); $contentht = esc_textarea( $contentht ); if ( !is_writable( $htaccess_file ) ) { $content = "

" . __( "If your .htaccess were writable, you could edit it from here.", 'wordpress-seo' ) . "

"; $content .= '
'; } else { $content = '
'; $content .= wp_nonce_field( 'wpseo-htaccess', '_wpnonce', true, false ); $content .= "

" . __( 'Edit the content of your .htaccess:', 'wordpress-seo' ) . "

"; $content .= '
'; $content .= '
'; $content .= '
'; } $wpseo_admin_pages->postbox( 'htaccess', __( '.htaccess file', 'wordpress-seo' ), $content ); } else if ( (isset($_SERVER['SERVER_SOFTWARE']) && stristr($_SERVER['SERVER_SOFTWARE'], 'nginx') === false) && !file_exists( get_home_path() . ".htaccess" ) ) { $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 );