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,900877100k+Exception output is not escaped
#3WP Umbrella: Security Backup Restore & Monitoring2297499980k+Exception output is not escaped
#4WP-WebAuthn229573962k+Exception output is not escaped
#5InfiniteWP Client232,2871,811200k+Exception output is not escaped
#6Clone2324426240k+Output is not escaped
#7Backuply – Backup, Restore, Migrate and Clone24711556600k+Non-prefixed global variable
#8InstaWP Connect – 1-click WP Staging & Migration2425481540k+Non-prefixed global variable
#9Softaculous241155010k+file system operations fread
#10Login Security Solution272161544k+Output is not escaped