Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?

I am a real fan of the Allman (BSD) coding indent style. However, when i review the top rated plugins on WordPress, i am finding them using the K&R coding indent style.

Is there a requirement from WordPress.org that forces users to use the K&R indent style when developing plugins or themes? I read all the manual but couldn’t get a clear answer on which indent style we are allowed to use.

Your help will be greatly appreciated.

1 Answer
1

WordPress.org does not have any hard requirements for code styles for plugins or themes.

In the plugin guidelines, the relevant section is #4, “Keep your code (mostly) human readable.” Mainly it is about obfuscation. The most relevant line is this:

We recommend following WordPress Core Coding Standards.

Note the word recommend, there. This is not a hard requirement.

The relevant portion of the theme review guidelines doesn’t really mention code style directly, so there’s no requirements for this kind of thing for themes either.

I’m kind of glad that there is some freedom here, but you will find that there’s plenty of very messy code in the plugin directory, that doesn’t really follow any one code style consistently at all. That’s allowed—for better or worse. 🙂

Leave a Comment