added field php to plugin, and fixed broken loop