Chapter 11: Advanced Topics
Installing Plug-ins
Problem
You want to extend Movable Type's functionality and install a plug-in.
Solution
Installing a basic plug-in requires you to place a file with an .pl extension into the plugins directory; however more advanced plug-ins may have additional steps.
Discussion
Plug-ins are Perl scripts with a .pl extension that reside in the subdirectory named plugins under the Movable Type application directory. (If you are running an older version of MT that was upgraded and have not installed a plug-in before, you may have to create this directory.) Each time MT is initialized, these files are loaded, which notifies the system of their existence and tells it how to execute their functionality.
Installing a basic plug-in is quite easy. Simply place the code in plugins. That's it. Only files with .pl extensions are considered plug-ins and are loaded automatically by the system.
Plug-ins do not need system execution privileges in order to operate. Be careful not to include any files that are not plug-ins, as MT will execute them when trying to load them into the system as plug-ins. Depending on what the particular script does, the results could yield strange warnings and error message -- or worse!
In recent versions of MT, functionality was introduced to list installed plugins, including links to settings and documentation. Note that it is not required for all plu-g-ins to register themselves to be listed. The absence of a plugin does not necessarily mean it was not installed properly. Many older plug-ins were written before this feature was even available.
Plug-ins are listed at both the system and weblog levels. The primary difference is in the settings. Plug-in settings can be made on a system or per-weblog basis or both. How settings are implemented will depend on each plug-in and the nature of its functionality.
To see the system-level listings of plug-ins, click the Plug-ins System Shortcuts on the Main Menu or the Plug-ins button in the System Toolbar. In a specific weblog, plug-ins are listed by going into Settings and selecting the Plug-ins tab.
More advanced plug-ins may require additional steps to install. Some plug-ins will split out their functionality into separate Perl modules. Others may require the use of a CPAN module or additional configuration. Check the plug-in's installation instructions for more detail.
Another issue to consider when installing plug-ins is that they are available to all weblogs hosted by this instance of MT. (Instance meaning sharing the same mt.cgi URL and configuration.) Installing a poorly-behaved plug-in could impact the operations of others on that system.
For most of the plug-ins available and in use, see the MT Plug-in Directory at http://www.sixapart.com/pronet/plugins/.
Put the following in the KB instead?
Testing and Debugging Plugin Installations
Once you install a plug-in you'll want to test that it works. Create a test template and give it a try. Most well documented plug-ins include a synopsis of their use. It's a good idea to use this sample code to stop any errors from being introduced. Once you've created and saved your test template, build a page and take a look at it in your browser to see if it worked.
Not everything goes as planned though.
These are some baseline tips to debugging (and hopefully fixing) a faulty plug-in installation.
MT is very good about trapping and displaying most error messages to your browser. These can provide valuable information such as missing libraries, permission problems, improper configurations, and errors in tags use. If the errors persist, note the exact error message and action, and remove the plug-in to see if the error messages stops.
Less critical are warning messages that are output while MT continues processing. These tend to be harmless and are typically a symptom of a poor programming practice in the plugins code. Warning messages are not always bad. Sometimes warning message are used by developers to output debugging messages.
The most difficult installation issue to handle is a plug-in that seemingly does nothing and yields no error or warnings messages to your browser. Begin by checking the system Activity Log for error messages generated by the plug-in. MT will trap every failed plug-in load and record related error messages. In a majority of cases this will provide you with clues or even the solution to your problem.
If you continue to have issues you can't resolve, utilize the Movable Type Support forums for help. See "Using the Community Forums".



