esc_html should be used anytime we're outputting data inside HTML code.
<h4><?php echo esc_html( $title ); ?></h4>