When a WordPress plugin is uninstalled, WordPress runs the uninstall.php script if it exists. This script must check if the constant WP_UNINSTALL_PLUGIN is defined to confirm it is running during uninstall and not accessed directly. The script then deletes plugin options using delete_option and removes custom database tables with SQL DROP TABLE commands. This cleanup ensures no leftover data remains after the plugin is removed. The execution table shows step-by-step how the uninstall script checks conditions and deletes data safely. Variables like WP_UNINSTALL_PLUGIN, plugin options, and tables change state during the process. Key points include the importance of the WP_UNINSTALL_PLUGIN check and safe deletion commands that do nothing if data is missing. The visual quiz tests understanding of these steps and their effects.