Just a few years ago I visited Turkey and things had been safe and relatively calm. Then they open their doors to hundreds of thousands of refugees and now terror attack after terror attack. If the left had their way, all of them would have been in the USA already.
The political situation in Turkey is far more complex than that.
For a start, they have a leader, Erdoğan, who is taking the country backwards in terms of secularism and religious separateness from politics. There is open conflict with the PKK. They cross the divide between the West and East in many ways which encourages extremists to focus on soft targets in the country. They were the first country to declare ISIS a terrorist organisation and have provided open support to the USA (e.g. allowing the US to operate within Turkish airspace) in action against ISIS.
There is no doubt that the Turkey/Syria border is ineffective in stopping arms and people crossing either way but that's not because they opened their border, it because (a) there is a war next door to them and (b) they have sided against ISIS who are sitting pretty next door to them. It's true to say that terrorists have made use of the refugee crisis but to tar a group of vulnerable and needy people with the brush of extremism is unfair.
Turkey is still safe IMHO. It's a large country and the risk of being caught up in an attack is slim. In most of the country westerners can walk the streets safely and be welcomed. Of course one needs to be sensible but it's not like the place is a war zone. Even the UK FCO, who advise on travel for UK citizens, say it's generally safe.