Optimizing or rewriting core queries

You could certainly write a wrapper function that implements caching of the WooCommerce core functionality, but WooCommerce isn’t going to use your wrapper function, so pretty pointless.

Your best option is to create and use your own data store for WooCommerce that extends the WC_Data_Store_WP class, and add caching to those functions.

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