Complete coding main functions of the plug-in