Package extension for distribution

In order to have smooth users experience with extension installation and management all extension developers need to comply and follow requirements for AbanteCart extension API and distribution.
Below is a Checklist with some suggestions and guidance to extension construction:

  • All code provided in the extension needs to be clean, well organized and free of bugs.
  • Avoid inclusion of unused or untested codes or files.
  • Avoid replacement of files and limit logical replacement of files.
  • If your extension is dependant on some other extension, make sure to include dependency in configuration. Installation process will check that for you.
  • Place all text in language files and include in the package
  • Include all configuration that is necessary to set up the extension
  • Include all necessary instruction for installation and configuration
  • Include a disclaimer or legal document for the extension. It will be shown before installation.
  • Include .htaccess and index.php in all directories under your extension to prevent unauthorised access to files.
  • Perform check in every PHP file for blocking direct access from the browser. Use code below or similar in all PHP files:
if (! defined ( 'DIR_CORE' )) {
	header ( 'Location: static_pages/' );
}
  • Do testing of the extension and it installation and uninstall process.

Distribution should include the following items. Items marked “required” needs to be included.

  • config.xml (required)
  • install and uninstall php and/or sql
  • image (directory to keep preview images and icon) (required)
  • main.php (required )
  • admin (code for control panel)
  • storefront (code for store front)
  • core (core code for the extension)
  • documentation ( any documentation needed for extension)

Details about most of extension components are covered in extension API development documentation.
In image directory include icon and preview images for your extension. Icon will be shown in market place and the extension menu and preview will be shown in extension details page before download and in the extension configuration section. Naming for icon and preview images:

icon image:            	image/icon.png (Size: 57x57 px)
       	main preview:       	image/preview.jpg (Size: 350 x 350 px)
       	additional preview: image/preview1.jpg (Size: 350 x 350 px)
                                          	image/preview2.jpg (Size: 350 x 350 px)
                                          	more images as needed ...

Extension naming and description is defined in language files
Extension name is defined with definition key = <extension>_name
Extension description is defined with definition key = <extension>_note . Please note that in order to show extension description you should enable it in extension config like <note>true</note>

Archiving instructions:
Final completed package needs to be archived to zip format with all files/directories hierarchy starting from root directory.

An example of directory structure for package:

  • code – contain extension code starting from application root. ( /extensions/<extention>…. )
  • manuals – help files
  • copyright.txt
  • license.txt
  • package.xml
<?xml version="1.0"?>
<package>
    <id>myextention</id>
    <type>extension</type>
  	<version>1.0.0</version>
  	<minversion>1.0.0</minversion>
  	<cartversions>
        	<item>0.9</item>
        	<item>1.0</item>
  	</cartversions>
  	<package_content>
        	<extensions>
              	<extension>myextention</extension>
        	</extensions>
  	</package_content>
</package>

- current version of extension - start version which can be upgraded. have to contain only two parts - major and minor versions.

If you intend to resale extension via AbanteCart market place, please make sure you are compliant with requirements as much as possible. This will help your extension to be approved faster and get better ranking.