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.

medium weight

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.

Affected Plugins

RankPluginScoreErrorsWarningsInstallsAddedUpdatedTop Issue
#3501HBAgency981169k+Non-prefixed global variable
#3502Local Fonts Uploader – Upload & Host Any Font Locally for GDPR981104k+Direct Query
#3503Mime Types Plus9811210k+Non-prefixed global variable
#3504Plus WebP or AVIF98245k+Non-prefixed global variable
#3505ProvenExpert98810900wp function not compatible with requires wp
#3506Swift Switcher — Bulk & Custom Post Type Converter9815600Direct Query
#3507Trust Badges98141k+Direct Query
#3508WP Database Reset981105k+Direct Query
#3509Chart Block – Visualize Data with Bar, Line, Pie Charts9991k+Non-prefixed constant
#3510Machete9977k+Direct Query
#3511Media Library Tools – AI-Powered Rename, Clean & CSV Import/Export99141k+Discouraged PHP function
#3512Ogp Plus9916500Non-prefixed global variable
#3513Simple Ticker9917500Non-prefixed global variable
#3514Statify Filter9962k+Direct Query
#3515VS Meta Description99133k+Direct Query