conditional statement for active permalinks

get_option( 'permalink_structure' ) is your friend. If you’re using the default it will be set as an empty string:

if( get_option( 'permalink_structure' ) !== '' ) {
    // custom permalink enabled code
} else {
    // no permalink 
}

tech