WordPress.DB.RestrictedFunctions.mysql_mysqli_error

mysql mysqli error

The plugin uses a raw MySQL extension or class instead of WordPress database APIs.

medium weight

Why It Shows Up

The scan found `mysql_*`, `mysqli_*`, PDO MySQL, or related database functions in plugin code.

Why It Matters

Bypassing `$wpdb` can ignore WordPress database configuration, escaping conventions, character sets, and compatibility layers.

How to Fix

  • Replace raw MySQL calls with `$wpdb` methods or higher-level WordPress APIs.
  • Use `$wpdb->prepare()` for dynamic values.
  • If a third-party library requires a database connection, isolate it and document why WordPress APIs cannot be used.

Affected Plugins

RankPluginScoreErrorsWarningsInstallsAddedUpdatedTop Issue
#1Matomo Analytics – Powerful, Privacy-First Insights for WordPress191,911877100k+Exception output is not escaped
#2Duplicator – Backups & Migration Plugin – Cloud Backups, Scheduled Backups, & More212,5721,2771m+Output is not escaped
#3wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin211,8111,43270k+Output is not escaped
#4Prime Mover – Migrate WordPress Website & Backups221,3261,60010k+Non-prefixed global variable
#5File Manager227405201m+Unsafe printing function
#6WP STAGING – WordPress Backup, Restore, Migration & Clone231,5041,567100k+Non-prefixed global variable
#71 Click Migration & Backup: Free WordPress Migration Plugin with Zero Downtime & Easy Clone24140193400Direct Query
#8Backuply – Backup, Restore, Migrate and Clone24704551700k+Non-prefixed global variable
#9Softaculous241155010k+file system operations fread
#10UpdraftPlus: WP Backup & Migration Plugin242772993m+Non-prefixed global variable
#11EZ SQL Reports Shortcode Widget and DB Backup27165158500Output is not escaped
#12User Spam Remover31115141k+Output is not escaped
#13PW WooCommerce Bulk Edit3421914920k+Unsafe printing function
#14MapSVG – Vector maps, Image maps, Google Maps3574471k+Missing direct file access protection
#15SQL Executioner7018172k+Non-prefixed global variable
#16Run SQL Query78138600Non-prefixed global variable