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 | Added | Updated | Top Issue |
|---|---|---|---|---|---|---|---|---|
| #3151 | Burst Statistics – Simple WordPress Analytics (Google Analytics Alternative) | 69 | 33 | 379 | 200k+ | Direct Query | ||
| #3152 | CDN Enabler | 69 | 14 | 7 | 10k+ | Output is not escaped | ||
| #3153 | Contact Form 7 | 69 | 56 | 39 | 10m+ | Missing direct file access protection | ||
| #3154 | CryptX | 69 | 11 | 30 | 10k+ | Missing nonce verification | ||
| #3155 | DOKU Payment | 69 | 53 | 46 | 400 | wp function not compatible with requires wp | ||
| #3156 | GZSEO | 69 | 3 | 66 | 400 | Direct Query | ||
| #3157 | PDF.js Viewer | 69 | 14 | 38 | 20k+ | Non-prefixed global variable | ||
| #3158 | Scroll Down Arrow | 69 | 30 | 30 | 800 | Missing Arg Domain | ||
| #3159 | Search by SKU for Woocommerce | 69 | 13 | 10 | 10k+ | Direct Query | ||
| #3160 | Easy Username Updater | 69 | 19 | 28 | 10k+ | Missing Arg Domain | ||
| #3161 | Export WordPress Menus | 69 | 94 | 22 | 1k+ | wp function not compatible with requires wp | ||
| #3162 | Ambrosite Next/Previous Page Link Plus | 70 | 11 | 21 | 900 | Interpolated SQL is not prepared | ||
| #3163 | AppScenic – Smart AI Dropshipping | 70 | 16 | 41 | 3k+ | Dynamic hook name | ||
| #3164 | FAZ Cookie Manager | 70 | 315 | 900 | Non-prefixed hook name | |||
| #3165 | Portfolio Post Type | 70 | 7 | 11 | 50k+ | Nonce verification recommended | ||
| #3166 | Search and Replace | 70 | 7 | 9 | 10k+ | Input is not sanitized | ||
| #3167 | Simple Login Captcha | 70 | 20 | 19 | 10k+ | date date | ||
| #3168 | Smart WYSIWYG Blocks Of Content | 70 | 36 | 4 | 1k+ | Output is not escaped | ||
| #3169 | Spocket ‑ US & EU Dropshipping | 70 | 15 | 31 | 1k+ | Direct Query | ||
| #3170 | Export Users With Meta | 70 | 13 | 13 | 2k+ | Direct Query | ||
| #3171 | Download Manager Addons for Elementor | 70 | 272 | 13 | 6k+ | Non Singular String Literal Domain | ||
| #3172 | aapanel WP Toolkit | 71 | 20 | 18 | 2k+ | wp function not compatible with requires wp | ||
| #3173 | BuddyPress Default Data | 71 | 8 | 21 | 400 | Interpolated SQL is not prepared | ||
| #3174 | GPX Viewer | 71 | 10 | 26 | 900 | Missing Version | ||
| #3175 | Multiple Roles | 71 | 7 | 20 | 5k+ | Non-prefixed global variable | ||
| #3176 | Nginx Helper | 71 | 47 | 60 | 200k+ | Non-prefixed global variable | ||
| #3177 | Privyr CRM – Instant Lead Alerts for Contact Forms | 71 | 2 | 25 | 4k+ | Non-prefixed function | ||
| #3178 | SmartSMTP | 71 | 8 | 42 | 2k+ | Nonce verification recommended | ||
| #3179 | WooCommerce Shipping | 71 | 48 | 70k+ | Direct Query | |||
| #3180 | WPGraphQL Smart Cache | 71 | 87 | 9 | 7k+ | Text Domain Mismatch | ||
| #3181 | Bulk Term Editor | 72 | 19 | 9 | 400 | Output is not escaped | ||
| #3182 | Disable Title | 72 | 20 | 15 | 2k+ | Text Domain Mismatch | ||
| #3183 | Discontinued Product Stock Status for WooCommerce | 72 | 1 | 51 | 500 | Missing nonce verification | ||
| #3184 | EU Order Withdrawal Button for WooCommerce | 72 | 52 | 406 | 4k+ | Non-prefixed hook name | ||
| #3185 | Media Library Organizer – Folders, File Manager & Media Categories | 72 | 20 | 130 | 20k+ | Non-prefixed global variable | ||
| #3186 | Responsive Blocks – Page Builder for Blocks & Patterns | 72 | 47 | 43 | 3k+ | badly named files | ||
| #3187 | Shipping Rate By Cities | 72 | 4 | 21 | 700 | Direct Query | ||
| #3188 | Templ Optimizer | 72 | 6 | 63 | 1k+ | Direct Query | ||
| #3189 | Starter Templates & Sites Pack by ThemeGrill | 72 | 28 | 51 | 70k+ | Non-prefixed hook name | ||
| #3190 | TinyPNG – JPEG, PNG & WebP image compression | 72 | 40 | 73 | 100k+ | Non-prefixed global variable | ||
| #3191 | Ultimate Member Custom Tab Builder Lite | 72 | 12 | 15 | 500 | Output is not escaped | ||
| #3192 | Place Order Without Payment for WooCommerce | 72 | 244 | 62 | 3k+ | Text Domain Mismatch | ||
| #3193 | Direct Checkout for WooCommerce | 72 | 77 | 35 | 80k+ | Text Domain Mismatch | ||
| #3194 | OpenID Connect Generic Client | 73 | 9 | 59 | 10k+ | Non-prefixed hook name | ||
| #3195 | Emergency password reset | 73 | 56 | 14 | 800 | wp function not compatible with requires wp | ||
| #3196 | EU Withdrawal Button for WooCommerce | 73 | 27 | 400 | Missing nonce verification | |||
| #3197 | My Simple Space | 73 | 21 | 3 | 8k+ | Output is not escaped | ||
| #3198 | Permalinks Moved Permanently | 73 | 7 | 7 | 700 | Database parameter is not escaped | ||
| #3199 | Comment Edit Core – Simple Comment Editing | 73 | 27 | 85 | 2k+ | Non-prefixed hook name | ||
| #3200 | TOCHAT.BE | 73 | 2 | 71 | 800 | Request data is not unslashed |