remove debug code
redirect published posts to permalink
remove unused code
fix missing variable
fix incorrect trailing slashes