WordPress.DB.DirectDatabaseQuery.DirectQuery
Direct Query
The plugin runs a direct database query instead of using a higher-level WordPress API or cache-aware pattern.
Why It Shows Up
Plugin Check found `$wpdb` access that queries the database directly, changes schema, or bypasses normal caching expectations.
Why It Matters
Direct queries can be correct, but they are easier to make unsafe, slower at scale, and harder for WordPress to cache or filter.
How to Fix
- Use WordPress APIs such as post, term, metadata, option, or user functions when they fit the task.
- If direct SQL is necessary, prepare dynamic values and add a clear caching strategy for repeated reads.
- Keep schema changes in activation or upgrade routines and make them idempotent.
References
Affected Plugins
| Rank | Plugin | Score | Errors | Warnings | Installs | Updated | Top Issue |
|---|---|---|---|---|---|---|---|
| #2351 | Surfer – WordPress Plugin | 97 | 1 | 25 | 6k+ | Direct Query | |
| #2352 | SVG Support | 97 | 1 | 27 | 1m+ | Non-prefixed global variable | |
| #2353 | Remote Website Management by Watchful | 97 | 4 | 12 | 4k+ | Direct Query | |
| #2354 | WPMR Google Feed Manager for WooCommerce – Sell on Google Merchant Center & Shopping | 97 | 1 | 7 | 10k+ | trademarked term | |
| #2355 | WPC Product Size Chart for WooCommerce | 97 | 19 | 2k+ | Non-prefixed class | ||
| #2356 | Broken Link Checker by AIOSEO – Find & Fix Broken Internal, External & Video Links | 98 | 1 | 15 | 300k+ | Non-prefixed global variable | |
| #2357 | Disable Generate Thumbnails | 98 | 1 | 14 | 6k+ | Non-prefixed global variable | |
| #2358 | Easyship WooCommerce Shipping Rates | 98 | 1 | 16 | 2k+ | Direct Query | |
| #2359 | HBAgency | 98 | 1 | 16 | 9k+ | Non-prefixed global variable | |
| #2360 | Local Fonts Uploader – Upload & Host Any Font Locally for GDPR | 98 | 1 | 10 | 4k+ | Direct Query | |
| #2361 | Mime Types Plus | 98 | 1 | 12 | 10k+ | Non-prefixed global variable | |
| #2362 | Plus WebP or AVIF | 98 | 24 | 5k+ | Non-prefixed global variable | ||
| #2363 | Trust Badges | 98 | 1 | 4 | 1k+ | Direct Query | |
| #2364 | WP Database Reset | 98 | 1 | 10 | 5k+ | Direct Query | |
| #2365 | Machete | 99 | 7 | 7k+ | Direct Query | ||
| #2366 | Statify Filter | 99 | 6 | 2k+ | Direct Query | ||
| #2367 | VS Meta Description | 99 | 1 | 3 | 3k+ | Direct Query |