In order to edit template files through the wordpress interface, I have always chmod 777 *.php for that template. Is this safe? What is the best way to do this?