Plug-in & Module Development

Perfect Plugin and Module Development Services  Calicut Kannur Bangalore Cochin

Latest advancements are revolutionizing the entire e-commerce industry. You need to rub shoulder with such a rapid change in flow of wind.

Businesses are opting for extensions/plug-ins and modules for taking their e-commerce websites and stores to the next level of success.

Are you taking it lightly? If yes, you are committing a blunder leading your e-commerce website or store towards a disaster. Do you want this to happen? This is where we prove our metal on a daily basis! We provide high quality extension/plugin and module development services in the category of Magento/Woo-Commerce/Joomla/Drupal/Wordpress.

There are three major components to WordPress:

  1. Core
  2. Themes
  3. Plugins

Why We Make Plugins

If there's one cardinal rule in WordPress development, it's this: Don't touch WordPress core. This means that you don't edit core WordPress files to add functionality to your site. This is because, when WordPress updates to a new version, it overwrites all the core files. Any functionality you want to add should therefore be added through plugins using approved WordPress APIs.

WordPress plugins can be as simple or as complicated as you need them to be, depending on what you want to do. The simplest plugin is a single PHP file. The Hello Dolly plugin is an example of such a plugin. The plugin PHP file just needs a Plugin Header, a couple of PHP functions, and some hooks to attach your functions to. Plugins allow you to greatly extend the functionality of WordPress without touching WordPress core itself.

Writing Plug-ins

Once you decide what you want your plug-in to do, creating it is a simple process. A basic overview of the plug-in development process is given in the following steps.

  1. Plan your plug-in: decide on the services you want the plug-in software to provide and how it will interact with the browser and the special media for which the plug-in is created.
  2. Decide the MIME type for the plug-in.
  3. Set up your development environment properly. You can use a variety of environments to create a plug-in, but make sure that you have the necessary files from the plugin SDK.
  4. Create a plug-in project.
  5. Write your plug-in code and implement the appropriate Plug-in API methods for basic plug-in operation. You'll find an overview of the Plug-in API methods in this chapter, as well as separate chapters for all of the major functional areas of the Plug-in API. Also see Making Plug-ins Scriptable for more information about making plug-ins accessible from the browser.
  6. Build the plug-in for your operating system. See "Building Plug-ins".
  7. Install the plug-in in the plug-in directory for your operating system. See Installing Plug-ins.
  8. Test your plug-in and debug as necessary.
  9. Create an HTML page and embed the plug-in object. For information about the HTML elements to use, see Using HTML to Display Plug-ins. To see your plug-in in action, simply display the HTML page that calls it in the browser

Registering Plug-ins

Gecko identifies a plug-in by the MIME type it supports. When it needs to display data of a particular MIME type, the browser finds and invokes the plug-in object that supports that type. The data can come from either an object element in an HTML file (where the object or embed element either specifies the MIME type directly or references a file of that type), from a separate non-HTML file of that MIME type, or from the server.

The server looks for the MIME type registered by a plug-in, based on the file extension, and starts sending the file to the browser. The browser looks up the media type, and if it finds a plug-in registered to that type, loads the plug-in software.

When it starts up, the browser checks for plug-in modules for the platform and registers them. It determines which plug-ins are installed and which types they support through a combination of user preferences that are private to the browser, the contents of the plug-ins directory, or the registry on Windows.

A MIME type is made up of a major type (such as application or image) and a minor type, for example, image/jpeg. If you define a new MIME type for a plug-in, you must register it with IETF (Internet Engineering Task Force). Until your new MIME type is registered, preface its name with "x-", for example, image/x-nwim. For more information about MIME types, see these MIME RFCs:

  1. RFC-2045: "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"
  2. RFC-2046: "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"
  3. RFC-4288: "Media Type Specifications and Registration Procedures"

Drawing a Plug-in Instance

Before drawing itself on the page, the plug-in must provide information about itself, set the window or other target in which it draws, arrange for redrawing, and handle events.

A windowless plug-in can call the following Netscape methods to draw itself:

  1. NPN_ForceRedraw: Force a paint message for windowless plug-ins.
  2. NPN_InvalidateRect: Invalidate an area in a windowless plug-in before repainting or refreshing.
  3. NPN_InvalidateRegion: Invalidate an area in a windowless plug-in before repainting or refreshing.

The browser calls these Plug-in methods:

  1. NPP_GetValue: Query the plug-in for information.
  2. NPP_Print: Request a platform-specific print operation for the instance.
  3. NPP_SetValue: Set the browser information.
  4. NPP_SetWindow: Set the window in which a plug-in draws.
  5. NPP_HandleEvent: Deliver a platform-specific event to the instance.

Handling Memory  Calicut Kannur Bangalore Cochin

Plug-in developers can take advantage of the memory features provided in the Plug-in API to allocate and free memory.

  1. Use the NPN_MemAlloc method to allocate memory from the browser.
  2. Use the NPN_MemFree method to free memory allocated with NPN_MemAlloc.
  3. Use the NPN_MemFlush method to free memory (Mac OS only) before calling memory-intensive Mac Toolbox calls.

Sending and Receiving Streams

Streams are objects that represent URLs and the data they contain. A stream is associated with a specific instance of a plug-in, but a plug-in can have more than one stream per instance. Streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. Each stream has an associated MIME type identifying the format of the data in the stream.

Streams produced by the browser can be automatically sent to the plug-in instance or requested by the plug-in. The plug-in can select one of these transmission modes:

  1. Normal mode: the browser sends the stream data sequentially to the plug-in as the data becomes available.
  2. Random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream. This mode requires server support.
  3. File mode: the browser saves the data to a local file in cache and passes that file path to the plug-in.

Streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse. In the browser's normal-mode streams, the browser calls the plug-in to inform it that the stream was created and to push more data. In streams produced by the plug-in, by contrast, the plug-in calls Netscape functions to create a stream, push data into it, and delete it.


Working with URLs

The Plug-in API provides methods that plug-ins can use to retrieve data from or post data to a URL anywhere on the network, provide hyperlinks to other documents, post form data to CGI scripts using HTTP, or upload files to a remote server using FTP.

  1. Use NPN_GetURL to request the browser to load a URL into a particular browser window or frame for display, or to deliver the data of that URL to the plug-in instance in a new stream.
  2. The NPN_GetURLNotify function operates like NPN_GetURL, except that it notifies the plug-in of the result when the operation completes.
  3. Use NPN_PostURL to send data to a URL from a memory buffer or file. The result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream.
  4. The NPN_PostURLNotify function operates like NPN_PostURL, except that it notifies the plug-in of the result when the operation completes.

Getting Version and UI Information  Calicut Kannur Bangalore Cochin

The Netscape group of Plug-in API methods provides some basic services to the plug-in. You can use these Netscape methods:

  1. To identify the browser in which your plug-in is displayed: Use the NPN_UserAgent method to read this information.
  2. To determine whether plug-in and the browser versions are compatible and possibly provide alternative processing for different versions: Use the NPN_Version method to check for changes in major and minor version numbers.

Displaying Messages on the Status Line

Functionally, your plug-in is seamlessly integrated into the browser and operates as an addition to current browser capabilities. To make the user feel that the plug-in is part of the the browser user interface, your plug-in can emulate the browser behavior by providing status line messages. Use the NPN_Status method to display a message on the status line.


Making Plug-ins Scriptable

Scriptable plug-ins are plug-ins that have been extended to provide methods that can be called from JavaScript and the DOM when accessed through the object or embed element.


Building Plug-ins  Calicut Kannur Bangalore Cochin

Once you have added the special code and additional files to make your plug-in scriptable as described in the previous section, the build process is quite straightforward. In addition to the DLL that goes in the plugins folder, you must also place a type library and an extra header file in the appropriate places in your application directory. This section describes those extra scriptability steps in more detail.

Building NativeScript plugins is a great way to learn more about how NativeScript works, to create functionality that you can share across applications, and to leverage some really powerful functionality - such as the ability to use native iOS and Android frameworks.


Installing Plug-ins

Plug-ins should not be installed into the Firefox directory. The plug-in installer should either package the plug-in into an extension and install it using normal extension installation practices, or install the plug-in to the system standard install locations.


Get in Touch