WordPress.DB.RestrictedFunctions.mysql_mysqli_connect_error

mysql mysqli connect 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
#1WPPizza – A Restaurant Plugin184,6892,7031k+Text Domain Mismatch
#2Advanced File Manager – Ultimate File Manager for WordPress And Document Library Solution191,218901100k+Exception output is not escaped
#3Matomo Analytics – Powerful, Privacy-First Insights for WordPress191,900877100k+Exception output is not escaped
#4GoUrl Bitcoin Payment Gateway & Paid Downloads & Membership201,832720700Non Singular String Literal Domain
#5Backup Migration219811,09380k+Non-prefixed global variable
#6Duplicator – Backups & Migration Plugin – Cloud Backups, Scheduled Backups, & More212,5721,2771m+Output is not escaped
#7FileOrganizer – WordPress File Manager21536241200k+unlink unlink
#8WP phpMyAdmin214,5286,43540k+Missing Arg Domain
#9wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin211,8121,43270k+Output is not escaped
#10File Manager Pro – Filester22566391100k+Request data is not unslashed
#11File Manager227405201m+Unsafe printing function
#121 Click Migration & Backup: Free WordPress Migration Plugin with Zero Downtime & Easy Clone24140193400Direct Query
#13Backuply – Backup, Restore, Migrate and Clone24711556600k+Non-prefixed global variable
#14Softaculous241155010k+file system operations fread
#15EZ SQL Reports Shortcode Widget and DB Backup27165158500Output is not escaped
#16Graphina – Charts and Graphs For Elementor391,91011310k+Text Domain Mismatch