Add extra checks to prevent errors.
Use default args in case metadata doesn't look as expected.
Allow post publish to discourse even if discourse comments are not enabled.
Do not return true in use_discourse_comments if post is newer than a week regardless of the publish_to_discourse option.
Use WP coding standards.
Use the default post types if no post type is explicitly in admin options.
Linting.
Check if publish is active before publishing.
Merge pull request #65 from sanislav/master

Fix bugs, add defensive programming and use WP coding standards