Opened 2 years ago
Closed 14 months ago
#16741 closed defect (bug) (fixed)
uninstall_plugins is autoloaded
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | General | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Attachments (3)
Change History (16)
Replying to nacin:
No wonder why class method callbacks slowed sites down as much as they did.
We can just add this to $fat_options and handle the switch in an upgrade path.
16741.upgrade.diff: semi-done (no db_version bump or call to upgrade path).
The difference would be that uninstall_plugins would become a default option instead of added when necessary. If that's undesired then a mixture of the two can be taken. Have an upgrade path for existing installs and set autoload to 'no' on the first registration so it's not a default option.
Nice catch.
I don't see a problem with it becoming a default option, since it isn't autoloaded.
Upgrade path should probably be get, delete, add, rather than a direct query. No issues with it being a default option.
- Keywords 2nd-opinion removed
Refreshed for 3.4. I realized since populate_options() gets called before upgrade_*(), the option will always exist by the time we try to call get_option(), so a direct query to ascertain its autoload property seems like the best route.
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In [20080]:
Note that now plugin authors will have to wrap register_uninstall_hook() in an is_admin() check, to avoid an extra query.
- Resolution fixed deleted
- Status changed from closed to reopened
Hmm. Perhaps we should just noop register_uninstall_hook() when we're not in the admin.
comment:10
nacin — 15 months ago
As it is, register_uninstall_hook() should only be occurring on an activation hook.
comment:11
scribu — 15 months ago
- Keywords has-patch removed
Hmm. Perhaps we should just noop register_uninstall_hook() when we're not in the admin.
My thoughts exactly.
comment:12
jkudish — 14 months ago
- Keywords has-patch added
comment:13
nacin — 14 months ago
- Resolution set to fixed
- Status changed from reopened to closed
register_uninstall_hook() should only be called on activation. If they discover that it is generating an extra query (on the frontend), then they are doing it wrong.

No wonder why class method callbacks slowed sites down as much as they did.
We can just add this to $fat_options and handle the switch in an upgrade path.