We are moving to another server. If you experience issues while browsing the site, please try again in 24 hours!

Mashshare coding standards for developer

Mashshare coding standards for developer Mashshare has been built with developers in mind, which means that all of the code is well laid out, organized, easy to read, and documented. The source code for Mashshare is also highly extensible, which makes it extremely easy for developers to hook in their own pieces of functionality, or modify existing […]

blue

Mashshare coding standards for developer

Mashshare has been built with developers in mind, which means that all of the code is well laid out, organized, easy to read, and documented. The source code for Mashshare is also highly extensible, which makes it extremely easy for developers to hook in their own pieces of functionality, or modify existing parts.

If you are looking to do development on Mashshare, either by contributing to the core plugin or by creating add-ons, there are a few things you should familiarize yourself with before you begin.

Github – Bug and Enhancement Tracking

The entire source for Mashshare is available on Github, and this is also where all main bug / enhancement tracking takes place. If you have developer-specific questions, it is best to create an Issue instead of leaving a comment here on this site. If you have an enhancement you would like to propose, Github is also the place to post it.

Organization

Mashshare’s source code is organized into separate, meaningfully named files. For example, all functions that relate to template output are placed in a file called “template-functions.php“. If you are to do development work on Mashshare, then you are expected to follow the organization and naming convention that is already in place. If you create a new function that has to do with 3rd party plugin compatibility, you will place it into the “plugin-compatibility.php” file.

Function and Class Naming

Organization is one of the most important, but an equally important key to remember is naming. All functions, without exception, are prefixed with mashsb_. This is an abbreviation for Mashshare Share Buttons and helps us ensure we do not create functions with conflicting names with other plugins or themes. For example, do not create a function named like this:

Do this instead:

You should also take care to ensure you have named your function appropriately, and that a function does not already exist to do what you need.

Classes should follow the same rules.

Follow WordPress Standards

We work hard to make sure Mashshare follows the best coding standards, and we expect you to do the same. If you need assistance on learning some of the standards we expect of you, please consult the official WordPress Coding Standards codex.

Submitting Your Code

If you have written an add-on, contact René to discuss getting it listed and possibly selling it on the site. If you are making a contribution to the core source code, please submit a Pull Request on the plugin’s Github page.

x
Follow MashShare?