Dangers to allowing Access-Control-Allow-Origin: * for Feeds only?

You need to have a super great reason to disable CORS, as no real reason was given here the answer should be “do not do it, it is not secure”.

You assume that no one can craft a feed link which will give him a write access. This might be true, but you should not open holes in your security based on “assuming”.

In the very least, if some other domain needs “AJAX” access to your feeds, you should disable CORS only for that specific domain.

In addition pre_get_posts is totally the wrong place to do it, and you should do it on init. The way your code is currently written it may disable CORS for pages which are not feed.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)