Optimize and fix pushPotEntries.php