Make WordPress Core

Opened 8 months ago

Closed 3 months ago

#59433 closed defect (bug) (fixed)

Plugin deletion results must be stored in an option instead of a transient to avoid the transient being removed on shutdown

Reported by: kkmuffme's profile kkmuffme Owned by: swissspidy's profile swissspidy
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has-patch commit
Focuses: Cc:


When using an external object cache, if any plugin hooks wp_cache_flush on shutdown hook/register shutdown function, this transient will be removed and the plugin delete result is never shown to the user.

The result should be stored in an option instead of a transient to fix this problem.

You could argue that you shouldnt call cache flush on shutdown, however this is often the only way to fix compatibility issues where plugins do not remove their data from cache on uninstall and you are left with a broken site after uninstalling.

Change History (5)

This ticket was mentioned in PR #6014 on WordPress/wordpress-develop by @kkmuffme.

4 months ago

  • Keywords has-patch added

Store delete result in non-autoloaded option instead of cache/transient to ensure it cannot be accidentally removed by other plugins that flush the cache.

This ticket was mentioned in Slack in #core by kkmuffme. View the logs.

4 months ago

#3 @swissspidy
4 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.5

#4 @swissspidy
4 months ago

  • Owner set to swissspidy
  • Status changed from new to assigned

#5 @swissspidy
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 57586:

Plugins: Store plugin deletion results in temporary option.

Storing the data in a non-autoloaded rather than a transient ensures it cannot be accidentally removed due to a cache flush.

Props: kkmuffme, mukesh27.
Fixes #59433.

Note: See TracTickets for help on using tickets.