Fixed 'before-insert' hook: now checks if language is PHP before assigning env.code to env.backupCode