Make sure we're using the right variables inside a method.
Strings clean-up.
Don't use a variable all willy-nilly. Check to make sure it's actually
set somewhere first.

Yes, we can dynamically declare variables inside $this and use them right
away, but that's not ideal. Also, if we're setting a var inside an "if"
statement, make sure there's a fallback value if we try to use that var
later on without checking to see if it's set.
Update JavaScript to follow WP Core Coding Standards.

- camelCase variable names
- declare using var
- Yoda conditions
- strict equality checks
Formatting and style changes for PHP.

- whitespace is our friend
- Yoda conditions
- just because you _can_ end a single-line statement without a semicolon
doesn't mean you should.