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
#3251Internet Archive Wayback Machine Link Fixer772221k+Database parameter is not escaped
#3252Photo & Video Gallery – Image, Video & Portfolio774101k+Missing Version
#3253Posts List7711157k+Non-prefixed hook name
#3254SureRank SEO – Smart Assistant with Meta Tags, Social Preview, XML Sitemap, and Schema775895300k+Non-prefixed hook name
#3255Table Of Contents Block7715810k+wp function not compatible with requires wp
#3256Tagembed Social Feeds Widget772113710k+Non-prefixed function
#3257Taggbox – Free Social Media Widgets, Review Badges & Shoppable UGC77231131k+Direct Query
#3258Unattach77411900Nonce verification recommended
#3259Username7758700Deprecated function: screen_icon
#3260WP Comment Notification772810400Missing Arg Domain
#3261X-Currency – The Ultimate WooCommerce currency switcher for a smoother shopping experience7717771k+Non-prefixed global variable
#3262Claspo – Popups, Spin the Wheel & Email Capture78107161k+wp function not compatible with requires wp
#3263Web3 Crypto Payments by DePay for WooCommerce7861011k+Direct Query
#3264Image Alt Text785199k+Nonce verification recommended
#3265Recent Posts7872400Database parameter is not escaped
#3266RSS Includes Pages784810k+Output is not escaped
#3267SearchWP Live Ajax Search7882350k+Non-prefixed global variable
#3268WooCommerce Square78626680k+Non-prefixed hook name
#3269Auto Featured Image (Auto Post Thumbnail)7953050k+Non-prefixed hook name
#3270Boxzilla – WordPress Popup Builder7946420k+Non-prefixed global variable
#3271Klaviyo792686100k+Non-prefixed function
#3272Location Weather – WordPress Weather Forecast, Air Quality & Weather Widget7956710k+Non-prefixed global variable
#3273Real Category Management: Content Management in Category Folders794732k+Non-prefixed constant
#3274Related Products Manager for WooCommerce799431k+Non-prefixed global variable
#3275Notifima – WooCommerce Stock Manager, Inventory Management, Waitlist79121423k+Text Domain Mismatch
#3276WP Last Modified Info79453240k+Short PHP open tag found
#3277WP Referral Code791819600Missing direct file access protection
#3278Antispam Bee80438700k+Nonce verification recommended
#3279ShopEngine Gutenberg WooCommerce Builder Blocks Addon – All in One WooCommerce Solution804247353k+Non-prefixed global variable
#3280Eli's PHP Compatibility Scanner80122400Missing nonce verification
#3281Flipbox8014172k+wp function not compatible with requires wp
#3282Ailo – AI Slug Translator808141k+wp function not compatible with requires wp
#3283Media Library File Size803156k+Nonce verification recommended
#3284Pro Mime Types – Manage file media types8055982k+Non-prefixed global variable
#3285Random Content801083k+Output is not escaped
#3286SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers804565200k+Non-prefixed hook name
#3287Product Feed PRO for WooCommerce by AdTribes – Product Feeds for WooCommerce80945080k+Non-prefixed hook name
#3288GoCardless for WooCommerce80601k+Non-prefixed class
#3289Discounts Per Payment Method on WooCommerce80881k+Missing Translators Comment
#3290WP Social Ninja – Embed Social Feeds, User Reviews & Chat Widgets80261830k+Missing direct file access protection
#3291Change Permalink Helper8155900Direct Query
#3292Countdown Block8114104k+wp function not compatible with requires wp
#3293Joinchat – Enhanced "click to chat"811732700k+wp function not compatible with requires wp
#3294eCommerce Shipping Dashboard by UPS for WooCommerce816351k+Non-prefixed constant
#3295LoftLoader81171970k+Missing direct file access protection
#3296OG — Better Share on Social Media81145130k+Non-prefixed hook name
#3297Price Table Block811516900file system operations mkdir
#3298Progress Bars811514500file system operations mkdir
#3299Orphans8114350k+Dynamic hook name
#3300Stream8158080k+Direct Query