Mycroft Search Plugin Generator
I was at work, and an idea hit me: Firefox search plugins are just text files. They also contain a lot of stuff that WordPress stores in it’s database. Why not make WordPress generate a search plugin for itself? Why not make a plugin that will work on any WordPress 1.5+ install? So I spent the rest of the day making the Mycroft Search Plugin Generator plugin
Current Version: 0.92
How it works:
- RECOMMENDED: Install WordPress Plugin Manager then use the One Click Install for Mycroft Search Plugin Generator. This will also make it easier to install other plugins and upgrade them in the future.
- OR: Download Mycroft Search Plugin Generator, extract and upload
wp-content/pluginsdirectory. Log-in to your WP admin panel, go to the Plugins tab and activate the Mycroft Search Plugin Generator plugin.
- Go to Options > Mycroft Search Plugin and change the options. At the very least, be sure to click “Update options »”, as this is the only event that the .src file will ever get created.
How to implement:
First, go to Options > Mycroft Search Plugin and configure the plugin
- Use Custom Name for Plugin
If you turn this option on, Custom Plugin Name will be used for the name of the plugin. Otherwise, your standard weblog title will be used.
- Plugin File Name
This will become the first part of the .src file. This should not contain any characters that standard file names cannot contain. If you enter any, it will be changed the same way that post and page slugs are generated. When you install, a recommended plugin file name will be generated from your weblog title.
- Plugin Icon
This is the icon that will appear next to your search plugin. This should be the full URL to a 16×16 GIF or PNG file.
The image file name must be identical to the Plugin File Name, and end in either .gif or .png. For example: http://inner.geek.nz/innergeek.gif
- Plugin Category
To be honest, I don’t know how this is ever used in Firefox, but Firefox asks for it. Feel free to change it to a category of website that your weblog fits. Blogs is probably sufficient.
- Plugin Description
Same as above. Defaults to “Searches the blog posts on [weblog title]”
If you’re using the_mycroft_plugin() in your header or footer template, you probably want this to be set to “in <head>“. This assumes you have
< ?php wp_head(); ?>in your header.
Then Simply add this php code to any WordPress template:
<?php the_mycroft_plugin (); ?>
to get Add [weblog title] to your Firefox Search Box!, where
or customise the link text like this:
<?php the_mycroft_plugin ("Firefox Search Plugin"); ?>
to get Firefox Search Plugin.
0.92: * Alert to non-firefox users telling them they need Firefox to use Mycroft plugins.
* Fixed problem with Use Custom name.
* Shortened menu item from “Mycroft Search Plugin” to “Mycroft”.
* Moved image preview to simulated menu preview with rollover effect.
* Linked to plugin page in plugin header.
* Increased the size of some text boxes.
* Fixed some wording issues.
0.91: Fixed issue with .src not getting created when it didn’t exist.
0.9: Initial Public Release.
- The plugin does not create the .src file until you press “Update options »”.
- Image field is not checked to see if the image’s filename or dimensions are valid.
- Doesn’t come with a default image set, but tries to guess what the image will be named.
- Brett Taylor (Me! aka Glutnix) for coming up with the idea and implementing it within a day.
Bugs and Suggestions
Any bugs or suggestions, please email me â€“ email link in the sidebar.