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:
When you change the settings, the plugin generates a .src file. This file is a Mycroft plugin file. the_mycroft_plugin() outputs some javascript and a link which trigger Firefox into installing the plugin.

Installation/Documentation:
Either:

Then:

  • 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]“
  • Include Javascript in <head> or when the_mycroft_plugin() is called
    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.
    If it’s set to when the_mycroft_plugin() is called, the Javascript will be included inline just before the link is output.

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.

Version History:
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.

Known Issues:

  • 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.

Credit:

  • 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.

19 Comments »

  • test comment on a page

    #1: Comment by Brett — May 20, 2005 @ 3:02 pm

  • Plugin WordPress: Mycroft Search Plugin Generator

    Mycroft Search Plugin Generator permette agli utenti di aggiungere facilmente un plugin di ricerca per Firefox per fare delle ricerche all’ interno del loro blog WordPress.
    [Traduzione da BloggingPro]

    #2: Trackback by WordPress Italy — May 21, 2005 @ 3:12 am

  • Would love to get this working, but unfortunately on the options page I get the following error:

    Fatal error: Cannot redeclare the_mycroft_plugin() (previously declared in /home/.abbottwasher/dsasaki/el-oso.net/blog/wp-content/plugins/wbft-mycroft-search.php:22) in /home/.abbottwasher/dsasaki/el-oso.net/blog/wp-content/plugins/wbft-mycroft-search.php on line 22

    #3: Comment by oso — May 28, 2005 @ 5:08 am

  • Oso, that’s just weird… have you installed it twice or something? Try deleting the file you have, downloading the plugin file again and install that instead…

    #4: Comment by Brett — May 30, 2005 @ 5:37 pm

  • Strange, I tried exactly that, but still getting the same error message. There’s only one copy in my plugins folder (or anywhere else for that matter). I’ll wait and see if anyone else gets the same message and can figure it out.

    #5: Comment by oso — May 31, 2005 @ 2:58 am

  • I get the exact same error!

    #6: Comment by Austin — June 15, 2005 @ 7:28 am

  • Austin, are you using wordpress 1.5 or 1.5.2?

    #7: Comment by oso — June 16, 2005 @ 7:50 am

  • 1.5

    #8: Comment by Austin — June 16, 2005 @ 11:34 am

  • [...] in that will work on any WordPress 1.5+ install? So I spent the rest of the day making the Mycroft Search Plugin Generator plugin! Try it at the bottom of the side [...]

    #9: Pingback by inner.geek » Blog Archive » WordPress Plugin: Mycroft Search Plugin Generator — June 16, 2005 @ 2:21 pm

  • I’m planning on upgrading to 1.5.2 soon and will leave a comment if that fixes my problems.

    #10: Comment by oso — June 18, 2005 @ 4:01 am

  • Is there a way to use this online on a website, outside WordPress?
    Is it a stupid question?

    #11: Comment by Franck — June 21, 2005 @ 8:03 pm

  • Hi Franck, the only stupid questions are the ones not asked.

    But the answer to your question is No: it’s a WordPress plugin, it works with WordPress only.

    You can however, make your own firefox plugin manually. Do a google search and you’ll find instructions on how to achieve this.

    #12: Comment by Brett — June 22, 2005 @ 5:06 pm

  • hi, this is a great plugin, but i was wondering, i can’t seem to make the link a picture instead of a text link, most likely because my php skills are pretty poor :)

    is there a way to do this? i have an excellent gif id like to use!

    #13: Comment by matt pist — September 17, 2005 @ 12:09 pm

  • hi!
    I used your plugin but i have a problem.

    When i add my site to search box, the image (.gif as you told) doesn’t shown, but the site name is already there and i can functionally search. What may be the problem?

    i checked gif’s directory and searchplugins folder. The gif is in the searchplugins folder. i tested it in Firefox 1.0.7

    #14: Comment by opereysin — July 26, 2006 @ 6:45 am

  • Hello,
    Just wondering if anyone could help. I did something stupid and started my blog using a numerical archive system, and now I'd like to change it so that the post title is part of the URL for SEO reasons. Is there any WordPress plugins that anyone knows of that could switch it without sending Googlers to invalid pages? Maybe some sort of redirector to the correct page?

    Thanks.

    #15: Comment by Rene — October 31, 2006 @ 9:55 pm

  • I found using WordPress to design my web sites a great time saver and with plugins for automatic sitemap generation and SEO optimisation and easy changing of themes its such a web design time saver. If fact i just made a template from the theme i’m currently using and after veiwing the souce code i just saved as html and with a bit of copy and pasting moved all the content on my older html pages to the new template now my older pages all look the same as the blog template. On a new site this isnt a problem but this one has been around a while before i used WordPress. Still have a load of article pages to move over but i should be able to automate some of it with a few block text replacer programs i have.

    #16: Comment by Rob - web page tools — February 22, 2007 @ 9:42 am

  • [...] search plugin to the right under News Feeds.The WordPress plugin that makes this possible is the Mycroft Search Plugin Generator, though like other WordPress plugins I’ve encountered recently, it required some tweaking to [...]

    #17: Pingback by Firefox Search Plugin - Matthew Botos — March 15, 2007 @ 1:45 pm

  • I think Optimal Title should do the trick. thanks for this useful plugin.

    #18: Comment by Wordpress Quickstart Guy — August 20, 2007 @ 1:31 am

  • I am a newbee at blogging.
    I want to create a worksheet page on my blog that can be printed. I want the worksheet to have some static information provided by me and some parts that user will type in before printing the page.
    Am I looking for a plugin that will generator such a page? If so, help me with the technical terms needed to search for this plugin.
    Thank you sooooo much.
    Janice VanCleave
    http://www.scienceprojectideasforkids.com

    #19: Comment by Janice VanCleave — June 2, 2008 @ 5:15 am

RSS feed for comments on this post. TrackBack URL

Leave a comment