Opened 7 months ago
Last modified 7 months ago
#64568 new defect (bug)
get_plugins() returning stale data after delete_plugins() successfully executed
| Reported by: | pentatonicfunk | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Plugins | Version: | |
| Severity: | normal | Keywords: | has-patch changes-requested |
| Cc: | Focuses: |
Description
it seems even though plugins group cache is part of wp_cache_add_non_persistent_groups, in the example below it returns stale data because executions happens in the same runtime.
$ wp shell wp> get_plugins() => array(1) { ["health-check/health-check.php"]=> array(15) { ["Name"]=> string(30) "Health Check & Troubleshooting" ["PluginURI"]=> string(43) "https://wordpress.org/plugins/health-check/" ["Version"]=> string(5) "1.7.1" ["Description"]=> string(44) "Checks the health of your WordPress install." ["Author"]=> string(27) "The WordPress.org community" ["AuthorURI"]=> string(43) "https://wordpress.org/plugins/health-check/" ["TextDomain"]=> string(12) "health-check" ["DomainPath"]=> string(0) "" ["Network"]=> bool(false) ["RequiresWP"]=> string(0) "" ["RequiresPHP"]=> string(3) "5.6" ["UpdateURI"]=> string(0) "" ["RequiresPlugins"]=> string(0) "" ["Title"]=> string(30) "Health Check & Troubleshooting" ["AuthorName"]=> string(27) "The WordPress.org community" } } wp> delete_plugins( ["health-check/health-check.php"] ) => bool(true) wp> get_plugins() <-- expecting health-check to be gone => array(1) { ["health-check/health-check.php"]=> array(15) { ["Name"]=> string(30) "Health Check & Troubleshooting" ["PluginURI"]=> string(43) "https://wordpress.org/plugins/health-check/" ["Version"]=> string(5) "1.7.1" ["Description"]=> string(44) "Checks the health of your WordPress install." ["Author"]=> string(27) "The WordPress.org community" ["AuthorURI"]=> string(43) "https://wordpress.org/plugins/health-check/" ["TextDomain"]=> string(12) "health-check" ["DomainPath"]=> string(0) "" ["Network"]=> bool(false) ["RequiresWP"]=> string(0) "" ["RequiresPHP"]=> string(3) "5.6" ["UpdateURI"]=> string(0) "" ["RequiresPlugins"]=> string(0) "" ["Title"]=> string(30) "Health Check & Troubleshooting" ["AuthorName"]=> string(27) "The WordPress.org community" } } wp>
Change History (3)
This ticket was mentioned in PR #10843 on WordPress/wordpress-develop by @hbhalodia.
7 months ago
#2
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/64568
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It seems that
wp_clean_plugins_cache()should be getting called afterdelete_plugins()runs. I don't see that this is the case.