many changes of code

use a var to no repeat action on the form...
Eliminate content_url() and use plugin_dir var ....
add _POST security (for no error of code) in dir change...
AND add many comments lines...