-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Innovator Development Guidelines
This document with guidelines exists to keep the quality on our codebase on the same level in all aspects regardless of whom who have written the code.
It defines how we want code to be written so we can guarantee the quality of the final product.
WordPress Development
-
Comply to the WordPress coding standards: http://make.wordpress.org/core/handbook/coding-standards/
-
Use OOP and classes for logic
-
On large projects; split logical areas of the application into plugins, ie one plugin for a booking system and another for an integration. Don’t mix both, and don’t put it in the theme.
-
The theme should only contain code for displaying data, all logic should be contained in plugins. Really small changes could be included if small and considered appropriate.
-
If a function exists in the framework - don’t make your own. This also applies to code doing the same think even if it is not in a function. For example: use get_term_link instead of concatenating url strings yourself.
-
Use filters and hooks as much as possible
-
Don’t leave code commented out when commiting completed code, only working code shoulde be left when the project is done
-
Folder structure:
root - put all php files here
* css - all css and less goes here
* img - all images here
* js - all script files here
- Put code needed for viewing data in the php template file, code för manipulating data (ex fetching from an API in a separate class and call it from the view).
-
For ajax requests - hook in with
wp_ajaxorwp_ajax_noprivfunctions -
One class per file.
-
All stylesheets should be registered with
wp_eneuque_scriptor (admin_script) hook. -
Minimal inline, use inline to hook up with classes,
ex. $(‘#button’).enableMyFunc();
but declare "enableMyFunc" in a separate file
- Use closures for jQuery and wrap the global namespace, ex:
(function($){
// add code here
}()(jQuery);
-
Use LESS (lesscss.org) to compile the .css
-
Include the .less files in the project commit
-
Divide the styles in to sections using comments
-
No inline css
-
No style-tags
-
All stylesheets should be registered with wp_eneuque_style (or admin style) hook.
-
Use semantic html
-
All public html should be html5 strict. In wp-admin it should comply to the html coding standards (http://make.wordpress.org/core/handbook/coding-standards/html/)
- Never use
mysql_*functions directly. Useglobal $wpdbif really neeed.
timetracking Toggl
All Innovator employees report their time spent on tasks in an online tracking system called toggl.
Toggl is an internal reviewing system that we use to:
-
Create detailed timereports to our employers for invoices
-
Create better estimated prices to our employers.
Every employee will be handed a login to toggl registered on there own email adress. The employee will be send an email to register.
Using Toggl should be done on task basis. Timestamps can be copied from the project specification or GitHub issue list. Be sure to put in the right client so your stamp is booked properly.