$wp_rewrite->rules is always NULL

Your rewrite rules aren’t showing up because you’re calling it from functions.php before they’ve been defined on a global level. So, you can either hook into an action or pull the rules directly from the DB.

Doing it through a hook:

function check_my_rewrites() {
  if ( is_admin() ) var_dump($wp_rewrite->wp_rewrite_rules());
}

add_action( 'init','check_my_rewrites' );

Otherwise, you can use the following SQL to pull the values:
SELECT option_value FROM wp_options WHERE option_name="rewrite_rules";

Then you can copy and paste the value into an online formatter to look at properly.

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