usort() replaces the array keys, so sorting $plugins with it made the key ($plugin_file) into just an integer. Checking whether an integer is an active plugin obviously fails. When I tested enabling author sorting, the list only contained the first entry, for some reason (it should have been empty).
Using uasort() instead preserves the array keys and lets the checks for whether each plugin is active work properly.
This will probably merge-conflict with #17, but I'm happy to rebase either PR for you if needed.
(Edit: Removed extra commits… not sure how those got in, but they're gone now.)
usort()
replaces the array keys, so sorting$plugins
with it made the key ($plugin_file
) into just an integer. Checking whether an integer is an active plugin obviously fails. When I tested enabling author sorting, the list only contained the first entry, for some reason (it should have been empty).Using
uasort()
instead preserves the array keys and lets the checks for whether each plugin is active work properly.This will probably merge-conflict with #17, but I'm happy to rebase either PR for you if needed.
(Edit: Removed extra commits… not sure how those got in, but they're gone now.)