Effects of criticality and disorder on piezoelectric properties of ferroelectrics