This part should be commented:
$excerpt = preg_replace(” (\[.*?\])”, ”, $excerpt);
$excerpt = strip_tags( strip_shortcodes($excerpt) );
$excerpt = substr($excerpt, 0, $limit);
$excerpt = trim(preg_replace( ‘/\s+/’, ‘ ‘, $excerpt));
$excerpt .= ‘…’;
then its works!