WordPress.DB.RestrictedFunctions.mysql_mysql_close

mysql mysql close

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
#2Matomo Analytics – Powerful, Privacy-First Insights for WordPress191,993892100k+Exception output is not escaped
#3WP Umbrella: Security Backup Restore & Monitoring221,0191,19980k+Exception output is not escaped
#4WP-WebAuthn229573962k+Exception output is not escaped
#5InstaWP Connect – 1-click WP Staging & Migration2325281740k+Non-prefixed global variable
#6InfiniteWP Client232,3791,844200k+Exception output is not escaped
#7Clone2324426240k+Output is not escaped
#8Backuply – Backup, Restore, Migrate and Clone24729553600k+Non-prefixed global variable
#9Defender Security – Malware Scanner, Login Security & Firewall241,3271,32980k+Non-prefixed namespace
#10Softaculous241155010k+file system operations fread
#11Login Security Solution272161544k+Output is not escaped