Use get_terms instead of wpdb->query & CS