Internal Development Standards

At Jigoshop eCommerce, our team of developers follows a set of the same rules and policies for the development of each plugin. Our procedures were designed to achieve the following objectives:

  • Design code and files for performance so that a website with even 15 Jigoshop eCommerce plugins can be fast
  • prepare common development rules and policies for developers;
  • simplify directory structure, code, and file naming convention
  • ensure compatibility with a number of commonly used tools including Google Insight, HTML and CSS validators

Please find our internal development policies and rules below:

  1. Structure of directories
    • Each plugin is required to follow the listed directory structure (empty directories excluded) – highlighted red for Jigoshop 1.x and blue for Jigoshop eCommerce respectively:
      • assets
        • js
        • css
        • images
      • Jigoshop1x
        • assets
          • js
          • css
          • images
        • src
          • Jigoshop
            • Plugin_Name
        • templates
      • src
        • Jigoshop
          • Extension
            • Plugin_Name
              • Common
              • Admin
              • Frontend
      • templates
  2. Template init file
    • Each plugin should use the up-to-date version of an init file (template)
  3. The code should be divided into Jigoshop 1.x and Jigoshop eCommerce
    • The idea behind dividing the code is to avoid multiple checks for a version of Jigoshop. As a result, there should be 2 versions of the code:
      • one for Jigoshop 1.x in the “Jigoshop1x” directory
      • one for Jigoshop eCommerce in the “src” directory, as specified in 1.
  4. Divide CSS and JavaScript files into common, frontend and admin
    • Thanks to dividing the CSS and JavaScripts files into common, frontend and backend we can ensure that no unnecessary items are sent to the browser, thus improving page generation times. As a result, plugins will have common/frontend/admin subdirectories in their respective assets/js and assets/css directories. The file names should imply where they’re used, thus a script loaded on the product edition page (dashboard) should be located in “assets/js/admin” and be named “products.js”.
  5. PHP code has to be compatible with PHP  5.4 for Jigoshop1.x and PHP 5.6 for Jigoshop eCommerce
  6. All the old and slow functions should be removed.
    • Example: ereg_* are slow and therefore they should be replaced with preg_*
  7. Every plugin should be prepared in a such a way that it doesn’t cause any issues with the following tools: Google Insight and Pingdom.
  8. All the obsolete code and unnecessary comments should be removed.
  9. PHP code should be compatible with the PSR-2 and PSR-4 standards.
  10. Plugins shouldn’t cause any HTML, CSS and PHP errors/warnings.
  11. Assuming that all the points above are followed, code and all the files should pass following tests: PHP-CPD (Copy Paste Detector), PHP-MD (Mess Detector), PHP-CS (Code Sniffer), HTML validator, CSS validator.
Jigoshop