Using wp_insert_post with WP Network in a cron script

switch_to_blog isn’t deprecated anymore. You can use it just fine. However, it does have a bit of overhead, so you want to use it as little as possible.

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