Make WordPress Core

Opened 15 months ago

Closed 10 months ago

Last modified 4 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:

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.


10 months 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.


10 months ago

#3 @swissspidy
10 months ago

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

#4 @swissspidy
10 months ago

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

#5 @swissspidy
10 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.

@SergeyBiryukov commented on PR #6014:


4 months ago
#6

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

Note: See TracTickets for help on using tickets.