WordPress.DB.PreparedSQL.NotPrepared

SQL query is not prepared

A database query includes dynamic data without using `$wpdb->prepare()` or an equivalent safe pattern.

critical weight

Why It Shows Up

The scan found a SQL string passed to `$wpdb` where variables appear to be interpolated or concatenated directly.

Why It Matters

Unprepared SQL can allow SQL injection when user-controlled values reach the query.

How to Fix

  • Move dynamic values into placeholders such as `%s`, `%d`, `%f`, or `%i` where supported.
  • Pass the values as separate arguments to `$wpdb->prepare()`.
  • For table names, column names, and sort directions, use strict allowlists instead of raw user input.

Affected Plugins

RankPluginScoreErrorsWarningsInstallsAddedUpdatedTop Issue
#1251Category Order and Taxonomy Terms Order763510500k+wp function not compatible with requires wp
#1252Index WP Users For Speed7710351k+Non-prefixed global variable
#1253Posts List7711157k+Non-prefixed hook name
#1254Table Of Contents Block7715810k+wp function not compatible with requires wp
#1255Flipbox8014172k+wp function not compatible with requires wp
#1256Media Library File Size803156k+Nonce verification recommended
#1257WP Social Ninja – Embed Social Feeds, User Reviews & Chat Widgets80261830k+Missing direct file access protection
#1258Countdown Block8114104k+wp function not compatible with requires wp
#1259Accordion Toggle8217112k+Non-prefixed class
#1260Image Gallery Block8213103k+wp function not compatible with requires wp
#1261Image Slider Block8213143k+wp function not compatible with requires wp
#1262Events Calendar Modules for Divi841122k+Nonce verification recommended
#1263Floating Button – Easily Create Sticky, Fixed & Floating Buttons8461844k+Non-prefixed global variable
#1264Timeline Module for Divi8416113k+Text Domain Mismatch
#1265GazChap's WooCommerce Auto Category Product Thumbnails85481k+trademarked term
#1266Vanilla PDF Embed85833k+parse url parse url
#1267WP Missed Schedule Posts877910k+trademarked term
#1268Featured Image Admin Thumb9071020k+Non-prefixed hook name
#1269HivePress Messages907107k+Direct Query
#1270MWW Scheduled Post Trigger924260k+Direct Query