Create plugin that works in background

You need to use WP Background Processing which fire off non-blocking asynchronous requests.

WooCommerce also use this for background processing. Check the file /includes/libraries/wp-background-process.php

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