This my code:
$albums = $wpdb->get_results( "SELECT id, name FROM $wpdb->wppa_albums", ARRAY_A );
It produces 2 warnings:
– Use of a direct database call is discouraged.
– Direct database call without caching detected. Consider using wp_cache_get()
/ wp_cache_set()
or wp_cache_delete()
.
What should i do with these messages? I have no idea how wp_cache_get()
can be used here.
Note: My plugin wp-photo-album-plus creates and maintains various own db tables, like wppa_albums
How to fix the warning
Raju is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.