In computing, a plug-in (also spelled plugin), add-in (also addin, add-on, or addon) or extension is a software component that extends the functionality of an existing software system without requiring the system to be re-built. A plug-in feature is one way that a system can be customizable.
Plugins can be created by the same publisher as the main software. It’s also common to see third-party plugins developed by other companies or developers.
The word “extension” is also commonly used to refer to a plugin. Although given a different name, extensions work the same way as plugins, namely by adding functionality without altering the main program.
- First, start the
Creator Projectto build the driver for the main program. - The content of
FormUnit.pasis the content that is started by the main program as a plugin. - Press
Ctrl+F9or selectProject > Compilefrom the menu to generate the driver. If the project is executed, this error message will appear, which can be ignored.
- PlugIn initialization..
procedure TForm2.FormCreate(Sender: TObject);
var
pc: PChar;
resourcestring
rsNoModuleName = 'Could not determine module name';
begin
GetMem(pc, MAX_PATH);
if Assigned(pc) then
try
ZeroMemory(pc, MAX_PATH);
GetModuleFileName(hInstance, pc, MAX_PATH);
Label2.Caption := ExtractFilename(string(pc));
finally
FreeMem(pc);
end
else
Label1.Caption := rsNoModuleName;
end;
procedure FormShowModal(Parent: Pointer); stdcall;
begin
Form2 := TForm2.Create(nil);
if Assigned(Parent) then
Form2.SetParent(Parent);
Form2.ShowModal;
end;- After the driver is build, the PlugInDemo project starts.
- Loading the plugin driver into the main program.
procedure TForm1.FormCreate(Sender: TObject);
begin
LoadPlugins();
end;
procedure TForm1.LoadPlugins;
var
Path : string;
PluginFile : string;
sr : TSearchRec;
lib : THandle;
s : string;
NewItem : TMenuItem;
ItemCount : Cardinal;
begin
ItemCount := 0;
// Specify the name for certain drivers
Path := ExtractFilepath(ParamStr(0)) + PLUGIN_PATH + '\*.dll';
if FindFirst(Path, faAnyFile, sr) = 0 then
begin
repeat
PluginFile := ExtractFilepath(ParamStr(0)) + PLUGIN_PATH + '\' + sr.Name;
Lib := LoadLibrary(PChar(PluginFile));
if Lib <> 0 then
begin
// build menu item
@MenuCaption := GetProcAddress(Lib, 'MenuCaption');
SetLength(PluginArray, ItemCount + 1);
@PluginArray[ItemCount] := GetProcAddress(Lib, 'LoadPlugin');
if (Assigned(MenuCaption)) and (Assigned(PluginArray[ItemCount])) then
begin
NewItem := TMenuItem.Create(self);
SetLength(s, 1024);
SetLength(s, MenuCaption(PAnsiChar(s), 1024));
NewItem.Caption := PChar(s);
NewItem.Tag := ItemCount;
NewItem.OnClick := MenuOnClick;
mnuPlugins.Add(NewItem);
Inc(ItemCount);
end;
end;
until FindNext(sr) <> 0;
end;
end;Plugins are used to add extra features to a web program without changing the main program. They are used on a range of programs, from CMSs to browsers.
A plugin can help improve the user experience and make it easier for users to make certain changes. For example, WordPress plugins make it easier to interact with the CMS. Users can easily alter the code and functionality of their website by downloading a plugin instead of writing the code themselves.
A browser plugin, often called an extension, interacts with the browser. Some examples of browser plugins may be ad blockers that prevent you from seeing advertisements on websites, or overlays that provide you extra information.
Although plugins are still commonly used in computer programs and apps, their use in web browsers has reduced over the past few years. Plugins like Adobe Flash Player, which was once an important plugin for interactive elements like videos and games, have been replaced by HTML5, providing a superior user experience.
Most CMSs, including WordPress, Shopify, and Squarespace, offer users the possibility to work with plugins/extensions. Most CMSs also allow third parties to create plugins that alter a user’s website, which provides users with more choice and flexibility.
The features added to the CMS using plugins can range from an easy method for adding a contact form to a website to plugins for page speed optimization. WordPress is one of the most popular CMSs that offers plugins by third-party developers. WordPress plugins can be either paid or free and add extra functionality to the main WordPress platform.
Although not used as often today, many browsers still support the use of browser extensions. These plugins can add additional features like ad-blocking or data scraping. They can also add simple features like showing whether links on a page are dofollow or nofollow.
Many text editors use plugins to provide support for certain programming languages. These plugins can make writing code easier and provide clearer formatting for different programming languages.
Software for editing videos and images commonly comes with plugins to provide improved compatibility for certain file types.
Examples of plug-in use for various categories of applications:
- Digital audio workstations and audio editing software use audio plug-ins to generate, process or analyze sound. Ardour, Audacity, Cubase, FL Studio, Logic Pro X and Pro Tools are examples of such systems.
- Email clients use plug-ins to decrypt and encrypt email. Pretty Good Privacy is an example of such plug-ins.
- Video game console emulators often use plug-ins to modularize the separate subsystems of the devices they seek to emulate. For example, the PCSX2 emulator makes use of video, audio, optical, etc. plug-ins for those respective components of the PlayStation 2.
- Graphics software use plug-ins to support file formats and process images. A Photoshop plug-in may do this.
- Broadcasting and live-streaming software, like OBS Studio, as an open source software utilizes plug-ins for user-specific needs.
- Media players use plug-ins to support file formats and apply filters. foobar2000, GStreamer, Quintessential, VLC, Winamp, and XMMS are examples of such media players.
- Packet sniffers use plug-ins to decode packet formats. OmniPeek is an example of such packet sniffers.
- Remote sensing applications use plug-ins to process data from different sensor types; e.g., Opticks.
- Text editors and integrated development environments use plug-ins to support programming languages or enhance the development process, e.g., Visual Studio, RAD Studio, Eclipse, IntelliJ IDEA, jEdit and MonoDevelop support plug-ins. Visual Studio itself can be plugged into other applications via Visual Studio Tools for Office and Visual Studio Tools for Applications.
- Web browsers have historically used executables as plug-ins, though they all are deprecated. Examples include the Adobe Flash Player, a Java virtual machine (for Java applets), QuickTime, Microsoft Silverlight and the Unity Web Player. (Browser extensions, which are a separate type of installable module, are still widely in use.)
The host application provides services which the plug-in can use, including a way for plug-ins to register themselves with the host application and a protocol for the exchange of data with plug-ins. Plug-ins depend on the services provided by the host application and do not usually work by themselves. Conversely, the host application operates independently of the plug-ins, making it possible for end-users to add and update plug-ins dynamically without needing to make changes to the host application.
