Stock Quote Tooltip

This project is based on the BlogQuote project started by Anders Brownworth, who created a standalone JSP application that allowed placement of some HTML code to generate stock quotes in a tooltip. For example:

VMware (VMW)
Microsoft (MSFT)
Berkshire Hathaway (BRK-B)

I took his work and converted the web service to PHP, while also adding the WordPress-specific pieces that add the required code on-the-fly. This plugin allows for automatic inclusion of stock quote tooltips when you mouseover a configured company name. The mapping of company names to stock symbols is configured in the WordPress Options tab, under Stock Quote TT. If you are looking for a tabular listing of stock quotes to include in your sidebar, go here.

There are several parts to this plugin:

  • StockQuoteTT.php is the actual plugin that handles the options page, as well as the insertion of the filter to dynamically add the required code around the company names you specify. It also contains some JavaScript code that is dynamically inserted into each page of your blog to handle the calls to the web service, below.
  • sqttGetQuote.php is the XML web service that accepts a stock quote on the query string, and return the information in XML format to the calling application.
  • sqttShowQuote.js contains the rest of the JavaScript code that handles calls to the XML web service, and caching of quotes within the same page for about 100 seconds.
  • sqttQuoteStyle.css is a cascading stylesheet that formats the tooltip and link. Feel free to customize it to your liking.

To install, simply unzip into your WordPress plugins folder, which should result in a folder called sqtt. Enable the plugin, and configure it under the options tab.

This page will contain updates to code, documentation, and bugs.

The plugin has been tested with WordPress 1.5 and 2.x.

This is free software, but donations are accepted in the sidebar.

Download here.

Change Log

Rev Date Description
0.1 2005-10-11 Initial Release
0.2 2005-10-13 Fix for broken links issue. Code will now only be inserted for company names found outside of A tags.
0.3 2005-10-16 Fixes for Internet Explorer
Code is now valid XHTML 1.0 Transitional
0.4 2005-10-21 Fix for redeclare error in Admin pages.
0.5 2007-05-01 Changed from fopen to cURL. This allows the plugin to work on hosts where allow_url_fopen is disabled.
0.6 2007-09-07 Fix for Yahoo Finance URL change
0.7 2007-09-07 Fix the 0.6 version

89 Responses to “Stock Quote Tooltip”

  • very good plugin …

  • This is a great plugin. It installed without any problems and is used daily. Thanks!

  • Hi –

    Thanks for the plugin…very nice.

    Question: Is there a setting to have to highlight only the first instance of a company name? Right now the company is highlighted on every instance and this might be annoying to some. I saw this mentioned above, but no further discussion of it.

    Thanks again.

  • Great plugin, do you think you can expand both your stock plugin’s to include an option for the user to list their target buy and sell prices? Most financial bloggers set their own buy and sell prices. This would be really useful to people like me looking for an easy way to display a stock quote along with some predictions on their blog.


  • Hi Andy,

    It looks like the plug-in on your blog isn’t working. I’ve installed it on my blog and it was working fine for a few days. On your blog and on my own it is saying “The document has moved here”. I guess Yahoo! Finance adjusted the location of the quote server? Could you take a quick look? I publish a load of articles using your plug-in exclusively.

  • yes this plugin worked fine a few days.. now the pop up says only loading… Someone help?

  • I’m have the same problem, has anyone found a fix for this? How is it still working on this site?

  • The issue described in the last few comments has been fixed. Yahoo changed the URL for quote downloads. Download the new 0.6 version above and all should be well.

  • Andy,

    I downloaded 0.6, activated it etc. but now there is not even a pop up… The company names do not turn into blue..

    I will check this website for updates, thnx!

  • I’m sorry, but it doesn’t work on 2.3.2. The page goes blank when I activate the plugin. I see others are having same problem.

  • All I get is a mouseover box that says “loading”.

    Neat plugin…wish I could get it to work.

  • Although the mouseover info box is not working, at least it links the symbol to a Yahoo chart. Now, which file would I change to tell it to bring up a 1-day chart and to open the Yahoo site in another tab/window?

  • Any tweak of the plugin to include it in blogsome blogs….in blogsome there is no option to upload a plugin, though it is wordpress powered blog

  • plug in installed fine. How do I get it o show up? can I put into a widget?

  • I keep getting the following error message:

    Cannot load sqtt/StockQuoteTT.php.

    Please help.

  • Is there a way to simply add this to a regular website, and not a wordpress blog? I’ve been searching high and low for something that I could use on my website to display current indices, and this looks great.

  • Hello, thanks for the great plugin! Everything is working fine however when it pulls up the box the graph and the text are outside the box. How do I fix this? Thanks

  • Anybody ever figure out how to get the “Loading” out of the tooltip?

  • hey that quote chart you have on the top right hand corner where did you get it ? i cant seem to find it anywhere, btw love your script going to install it shortly.


  • Hi,

    I am getting the following error:

    %BEG_OF_TITLE%Stock Quotes%END_OF_TITLE%
    Fatal error: Call to undefined function curl_init() in C:\wamp\www\wordpress\wp-content\plugins\stock-quote-sidebar\stockquote.php on line 402

    How do I fix this? Pls advice. I’m using WP 2.7.


  • Hi,

    I am using this plugin and have added the stock exchange (^BSESN) but it is showing the Stock Exchange name also as ^BSESN which isn’t looking good. Is there anyway I could change it as BSE or BOMBAY STOCK EXCHANGE?

    I am facing same issues for some other stocks as well…

    Pls. advice.


  • Thank you so much for this! It has helped me out immensely! The stock market is incredibly difficult to understand and grasp and the learning curve is steep but once conquered, it can prove to be very profitable. You now have a chance to ‘practice’ trading stock picks at all for free. Become a part of the community and learn from the best.

  • Is there a way to center the quotes in the sidebar instead of having them shifted to the left? BTW – Great work on this!

  • Does this plugin still work for anyone? All of the boxes are coming up blank for me.

  • The box is not working in my blog.

  • Hello,
    Thanks for the great plugin
    It looks like the plug-in on your blog isn’t working. I’ve installed it on my blog and it was working fine for a few days.

  • Is there a setting to have to highlight only the first instance of a company name?

  • This is not working, are there any alternatives??!!

  • i’ve been using this plugin and it worked like a charm for me…since yesterday i observe that no data and chart for Dow Jones…Andy can you please look into it…

  • Hi,

    Great plugin?

    Is it possible to add currencies to the widget?

  • Another great tool, Andy. I use it with Stock Quote Sidebar and they are both great!

  • Great plug in. I’m having problems with it in the Suffusion Theme though…the text goes outside of the box (gray lines get put between the company name, price, and bottom change section thus spacing it out). I’ve tried it in IE, Firefox & Chrome, all the same.

    I’m not a great coder but I played with the .css ‘height’ properties and it didn’t change anything. I’ve also trying deleting the plug-in and re-installing but it comes back the same way and with my previous settings. I’m assuming that the code gets copied into the theme somewhere? Can you give me any idea of which .PHP files I should be looking at?

    Note that the plug-in appears fine for me on your site, so I’m assuming the theme I’m using has something to do with it. Any help or suggestions would be greatly appreciated!

  • Hi,

    Thanks for the tips, i want to try this one too, it sounds interesting. I think this one can help me.

    And I hope it will work fine with my blog so that i can explore more out of it. Thanks again for the post.


  • Nice piece of software, I like the plugin very much. I would like to know how to make bigger the charts that appear when I position the mouse over the name? Is it possible?

Leave a Reply