Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years 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 Owned by: swissspidy
Priority: normal Milestone: 6.5
Component: Plugins Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

​https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/plugins.php#L431

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 (6)

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


3 years ago
#1

  • 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.


3 years ago

#3 @swissspidy
3 years ago

  • Keywords commit added
  • Milestone Awaiting Review → 6.5

#4 @swissspidy
3 years ago

  • Owner set to swissspidy
  • Status new → assigned

#5 @swissspidy
3 years ago

  • Resolution → fixed
  • Status assigned → 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.

​@SergeyBiryukov commented on ​PR #6014:


2 years ago
#6

Thanks for the PR! Looks like this was merged in r57586.

Note: See TracTickets for help on using tickets.