suggestion:
- update min ap as soon as you decide to add the portal using `plugin.apList.minPortalAp[side] = Math.max(plugin.apList.minPortalAp[side], portal.playerApGain.totalAp);`
- instead of sorting and pop-ing the last element, use $.grep(plugin.apList.topPortals[side], function(portal) { return portal.playerApGain.totalAp > plugin.apList.minPortalAp[side]; });`

This saves you from having to sort each time and should also remove the smallest element. Maybe need to introduce some temp variables so the lines don’t get too long.

Your choice, I’m okay with the current way as well.