Category: WordPress

Plugin developer, Core contributor and support volunteer. Yeah, I’m a WordPress fan!

  • Writing WordPress plugins – what I’ve learnt

    On January 28th of this year I made available my first WordPress plugin – Simple AdSense Insert. I now have 6 in my portfolio, with another 2 about to be published. And in this short amount of time I’ve already learnt a few things.

    1. Users don’t talk to you much, unless something isn’t working. Not that it’s a bad thing – I’ve been able to tweak instructions and even create new versions of my plugins thanks to this kind of response. However, I’d love to hear about what people would like to see in the way of improvements or even new plugins!
    2. Users don’t donate 😉 So I’ll just have to keep trying to make my money from advertising!
    3. Niche products aren’t so popular. I’ve created plugins for Wakoopa, TheThingsIWant and Readbag, but all have failed to do well. However, those for Twitter, Adsense and PayPal are doing a lot, lot better.

    To demonstrate my last point, here is a graphical representation of how many people have downloaded my current plugins…

    Graph1

    Pretty conclusive. Having said that, some of those result are scewed because of the length of time the plugins have been made available. So let’s change the results to represent the number of downloads over the days the plugin has been available…

    Graph 2

    Wow, that makes a huge different to my code embed plugin – the only one of the popular ones that isn’t somehow linked to another product.

    In this case it’s popular, well, because it’s not linked to another service and it’s filling a role that doesn’t currently exist. When I wanted to put some code into my posts I couldn’t find a plugin to do it. There was one but the author kept the download to his site (if it’s not on the WordPress plugins site it won’t automatically inform you when a new version is available) and insisted on your email address (for sending you emails at a later time all about his other great stuff) before letting you know how to download it.

    And this is it – populariting comes through one of two things.

    1. A link to a service – money making or social networking – that’s rather popular
    2. Being unique and providing a service that people are looking for

    Now all I need to do is think of that one plugin that ticks both boxes. Of course, if you have an idea, I’m happy to hear your views!

  • Improving WordPress Search : Update

    A couple of months ago, I talked about improving the search facility built into WordPress. However, soon after, I also mentioned problems I was having with the plugin Search Unleashed.

    Sadly the plugin is no better and I’ve had it disabled all this time.

    The friend that I originally researched this all for reported, however, that Search Unleashed was not reporting by relevance after all. Since then I’ve seen details on Better Search, an alternative plugin that (supposedly) does provide relevance-based results. I’d try it out and report back back but after my initial activation, I deactivated it again. Rather than build upon your existing search template, it uses its own. So, by default, the search page doesn’t even look like your theme – you have to start the layout, etc, from scratch. That’s not something I’d like to do unless I really wanted to use the plugin. And I’m not that fussed.

    But if anybody else does give it a go, please let me know!

  • Getting Help for my WordPress Plugins

    Since I’ve started writing WordPress plugins, I’ve had a few questions about them.

    These I don’t mind at all and I’m very happy to answer them. However, I’m often limited as to how much help I can give by what details I’m actually sent.

    So, to help out, I’ve immediately implemented an attachment feature on the contact page so that you can send me examples of you code – this attachment feature only allows limited size files and only certain extensions. For code, none of these should cause an issue.

    Let’s assume you’ve tried one of my plugins and it’s not working properly. In that case I’d need the following…

    1. What’s actually happening when you try it? Is any output appearing? Are there any error messages?
    2. Please send me a copy of the file in which you’ve added my code. In most cases this will be sidebar.php.
    3. Lastly, let me know the URL of the page where it’s going wrong, assuming you’ve not turned off the plugin or removed the offending code.

    Send me this and there’s a good chance the return email from myself will have the answer in it!

  • WordPress goes widescreen

    Well, my blog has. Yes, I’ve added an extra column to it.

    I thought the information down the left hand side was getting a little long. The further down the screen it goes, the less chance of it being read. So I’ve split it into 2 and divided it onto both sides of the page. The left hand side is for information about me. The right hand side is for information about the blog.

    And it’s still XHTML compliant.

    But in doing so I found a problem with my Simple Wakoopa List plugin – when displaying “newly used” software the links don’t work properly. After having a bit of a fumble about, it would appear the problem is the feed from Wakoopa rather than my plugin – it doesn’t appear the supply them in certain circumstances. A quick fix would be to not display a link if one is not forthcoming from the XML feed. However, just after I wrote the plugin, Wakoopa launched a new API – my plan, therefore, is to move to this. The one downside, though, is that I can’t find an equivalent of “newly used” with the new system. So I’ve contacted Wakoopa. As soon as I get a response I’ll code a fix.

  • Improving WordPress Search

    Improving WordPress Search

    WordPress search sucks. It’s well known.

    A friend has been looking for what he thinks is the solution and, let’s be honest, he’s got it pretty much right.

    He believes any half-decent search should…

    1. return posts by most relevant first
    2. do proper searches based on the phrase you submit
    3. indicate which words matched the post
    4. show how many posts matched
    5. list the posts by just title, or summary or full and allow you to switch
    6. show which page you’re on, if there are more than one page of results

    I’m not sure about point 5 – your average search engine, for instance, will give a summary and title and allow you to click it for the full details. I think a search should work like that.

    Unfortunately my friend hasn’t found a solution..

    I’ve looked at various plugins, but not really had any luck finding one which fixes all the problems.

    So, not knowing whether I would be able to solve this dilemma with existing plugins or if I’d end up writing my own, I set about finding an answer.

    And I did.

    Here’s what you need to do.

    Improving the Search Results

    Install Search Unleashed. This will add an improved search ability, will show post summaries, highlight searched text and display results in order of relevance.

    I also found I had to manually update my themes search.php file to change the rest of the summarised output – removing the calendar image, etc. You don’t have to do this, but it provided a nice compact result.

    Show the Number of Results

    Install Results Count. You will then need to add some code not only to your search.php theme file but (if you want) to archive.php. This will now display the number of results and which ones you are current viewing. For example, Showing results  1 - 16 of 32 for the search term:  wordpress.

    Install WP Page Numbers. Again, you will need to follow the instructions for inserting the appropriate code into search.php. The configuration options will also allow you to change the style of the output. What this plugin does, in a nutshell, is display the current page of results plus lists the other pages available, and let’s you move between them. For example…

    Line Numbers Example

    Increasing the number of Search Results Per Page

    The one problem with summarising your search results is that the blogs are a lot smaller on the page. WordPress only gives you one place to specify the number of posts per page and this applies to all forms of output – this means that the summarised results will take up a lot less of the page and, if there’s a lot of results, you may be aching to increase this number.

    In the case of my blog, I have the number of posts set to 5. I found that the number of summarised search results would look best at 16.

    Unfortunately, this is a bit of a manual fix. First of all, dig out your themes search.php file again. Hopefully you should be able to find the following line of code within it…

    <?php if (have_posts()) : ?>

    When you have, insert the following just before it…

    <?php
    $wp_query->query_vars["posts_per_page"] = 16;
    $wp_query->get_posts();
    ?>

    This will override the number of posts just for the search results. This solution doesn’t work for the Results Count plugin though, so you will need to change this too. As it’s a change to the plugin code, be aware that you may need to make this change again if you ever update the plugin.

    In results-count.php, find the line…

    $numposts = $wp_query->found_posts;

    Now, insert after it…

    $posts_per_page=16;

    The Result

    I think that covers pretty much all of what Tony was after. Except point 5.

    If you’d like to try the results out then, well, do a search on this site. Feedback is always appreciated!