Muschamp Rd

Simple Random Quotation WordPress Plugin

June 15th, 2011
WordPress Logo

One of the things I’ve been going to do for a long time is make a WordPress plugin, you know just to prove I could. But for  the longest time I didn’t have an idea. Then I made a whole bunch of web mashups with PHP and I decided after all that a WordPress plugin would be easy.

Rather than take on all the overhead of my mashup codebase, I decided to just make a super simple plugin that pulls a random quotation from a .csv file and displays it on screen. The plugin is widget enabled, you just drag it to a dynamic sidebar and provide a file path and voila random quotation.

It isn’t necessarily the most clever or the optimal solution, but it wasn’t that hard to create, even though I found a lot of the WordPress plugin tutorials lacking. It is based a little on Hello Dolly but also on one or two tutorials I found in Google.  Here are two token screen shots of how it looks in my sidebar and what the little admin screen looks like.

I wish I would have looked in my bookmarks instead of Google as this seems like a better way to do things, certainly more object oriented.

Many years have passed and I have not maintained this plugin, but I imagine it still works or could easily be made to work again. I have upgraded to WordPress 5, but I now have a very minimal sidebar and WordPress installation. I think I’m down to a half dozen plugins. I am updating old blog posts to see if they can be salvaged or better still leveraged in my never ending job search.

I have not managed to blog my way to a better career and I think it is going to take more than writing a single WordPress plugin or even passing all three CFA® exams so if you have any advice you can leave it below.

9 Comments

  • Muskie says:

    WordPress wants me to test this plugin and certify it works with the latest version of WordPress. But I don’t have a lot of time for my blog anymore. Today I’ve spent a couple hour ‘improving’ things but I haven’t actually created any new content…

  • Muskie says:

    I can’t find this plugin in the plugin directory now?  Why would they delete it, there are other random quotation plugins but not mine, WordPress.org also reset my password…  It’s stuff like this that doesn’t inspire me to write more open source code especially PHP, I don’t even like PHP!

  • International2004-a says:

    Is this quotations plugin available for WP 3.2.1? Couldn’t see a download link for it. Thanks

    • Muskie says:

      I haven’t upgraded this blog to that version of WordPress yet, but this plugin is super simple.  All it does is read a .csv file and choose a random quotation.  I don’t see why it wouldn’t work.  I don’t know if it is being used much.  It is installed in my sidebar and just works as long as it can find the text file…

    • Muskie says:

      I just upgraded to WP 3.2.1 and the plugin is still functioning fine.  Even better the conditionals in the sidebar seem to be returning the expected results.  I’ve had the biggest unexplainable problem where sidebar conditionals are not returning expected values.  I wanted to have smaller sidebars in some cases, I think it was some advice I read by Joost somewhere. Maybe I’ll try is SEO plugin now finally, but first I’m going to update some other plugins and fix my sidebar once and for all!

      Of course I fixed it once and for all before and WordPress and/or plugin upgrades busted it…

      • Muskie says:

        All is not well is_tag is returning not true for my tag archives, it returns is_date and is_archive.  I’ve worked on a lot of content management systems and I don’t know how this can be this fubar’ed for this long.  It probably has to do with the fact I’ve had this WordPress blog since 2005 and that many upgrades has left my database slightly less than optimal, but still this has been a known issue for many updates and still it isn’t fixed completely.

  • International2004-a says:

    Is this quotations plugin available for WP 3.2.1? Couldn’t see a download link for it. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Posts on Muskblog © Andrew "Muskie" McKay.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Muskblog. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.