Better Search v2.0

Highlight Search Results in Better Search Admin Option

Better Search just got massively better with v2.0.0. If you’ve been using WordPress’ default search engine then you’ll know by now that WordPress doesn’t give you relevant search results for your search terms. You’ll get posts that contain the search term ordered by date. Better Search completely replaces the inbuilt WordPress search engine by a contextual based search fetching you more relevant search results.

For v2.0.0, I spent a lot of time completely cleaning up all the code, fixing a lot of bugs and adding in a tonne of new features. The biggest addition to the plugin is several new and many improved filters and actions that will allow developers an ability to tap in and improve the plugin without the need for editing the plugin file. I’ve also documented these actions and filters in-line. So, if you’re curious, do take a look at the code in the Github repository.

If you’ve got a support query, or like to report a bug, please use the dedicated WordPress.org support forum. I simply ignore most comments or emails asking for support.

Highlight search results

This has been one of the most requested features for Better Search and finally finds it’s way into v2.0.

Highlight Search Results in Better Search Admin Option

Highlight Search Results in Better Search Admin Option

You’ll find this option under in the Better Search settings page under the Search options section. Selecting this option will wrap the search terms with a class .bsearch_highlight. You will need to add  .bsearch_highlight { background:#ffc; } to the Custom Styles box further down the options page. If you’re installing the plugin for the first time, or have reset the options, then you’ll find this included by default.

Recreate Index and Delete Transients

Better Search Maintenance options

Better Search Maintenance options

If you’ve deleted or editted a post, the index created by Better Search might still be stale. In order to quickly reset it, you can hit the Recreate Index button.

In order to speed up subsequent search results, Better Search uses the Transients API to cache the results of a particular search term. This works in both seamless mode and using custom templates. However, a known issue with transiensts is that they are not auto-deleted. You can use a plugin like Delete Expired Transients to clean up expired transients automatically. Alternatively, you can hit the Delete transients button to delete any transients set by Better Search. Note that this deletes all transients set by the plugin (not just expired ones).

Complete list of changes in Better Search v2.0:

  • New: Network Activate and Deactivate the plugin on WordPress Multisite
  • New: Option to highlight search results. If missing, add: .bsearch_highlight { background:#ffc; } under Custom Styles
  • New: Fully filterable search query
  • New: Recreate Index button in the settings page
  • New: Delete transients button in the settings page
  • Modified: Better Search will now try BOOLEAN MODE and non-FULLTEXT modes in case FULLTEXT search doesn’t return any results
  • Modified: Deprecated always dynamic heatmap option that bypassed cache
  • Modified: Reorganised admin interface
  • Modified: Seamless mode is now the default mode
  • Modified: Better Search uses transients to catch results when not using seamless mode
  • Modified: Search form uses class instead of id
  • Fixed: Seamless mode would overwrite all queries, even those outside the loop
  • Fixed: WordPress widget settings

Download

Download Better Search v2.0.0

CRP Taxonomy Tools v1.1.0

Select custom taxonomies in addition to traditional categories and tags

I pushed through a small, but important, update to Contextual Related Posts Taxonomy Tools, which is an addon to Contextual Related Posts. I’ve also developed this as an example for other developers to create addons to Contextual Related Posts.

CRP Taxonomy Tools allows you to restrict the related posts generated by Contextual Related Posts to the same category and tag. At least, it used to until now.

Support for Custom Taxonomies

v1.1.0 now adds support to custom taxonomies as well. This is especially useful to custom post types where the quality of the related post may not be the most ideal set. e.g. if you’re running a movie review blog and you have two different taxonomies for actors and genres, you can now restrict the related posts on your custom post types to just these taxonomies.

Select custom taxonomies in addition to traditional categories and tags

Select custom taxonomies in addition to traditional categories and tags

Disable Contextual Matching

Another feature that I have added to the plugin is the ability to disable contextual matching. This will turn of the core feature that Contextual Related Posts is built on and so is available only as part of this addon. If you do choose to disable contextual matching, make sure that you turn on the restricting by same categories, tags or custom taxonomies. Otherwise, all your posts will return the same related posts.

Disable Contextual Matching

Disable Contextual Matching in Contextual Related Posts

You’ll also find a new option that let’s you restrict the non-contextual matching only to attachments / media and custom post types only.

Disable Contextual Matching on Custom Post Types

Disable Contextual Matching on Custom Post Types

If you activate this option, then posts and pages will continue to show truly related posts. Attachments and custom post types will no longer show contextual matched posts, but would remain restricted to posts from the same category, tags or custom taxonomy.

Closing words

CRP Taxonomy Tools is a very useful addon that enables that extra level of relatedness that you might want to add to your site. If you’re using this plugin and might be looking to get some questions answered, then please make a new post in the Support Forum. Comments below asking for support are likely to be ignored.

If you like this addon, then do consider a 5-star review as well. It’s always encouraging when I read something nice about the work that I do :)

And, lastly, CRP Taxonomy Tools is also available on Github. If you’ve got a feature that you’ve already implemented, then consider forking the plugin and send me a pull request. Alternatively, create a new issue with a feature request.

Top 10 – Popular Posts for WordPress v2.1.0

Top 10 - Reset count and tools

Following on the heels of Contextual Related Posts v2.1.0 from last week, I’ve released Top 10 – Popular Posts for WordPress v2.1.0 with several bug fixes and many new features. If you’re using this plugin and looking for support, please do not post a comment below, but instead create a new thread in the WordPress.org support forum or create a new issue in Github.

Fix blog_id 0 errors

Top 10 - Reset count and tools

Top 10 – Reset count and tools

Top v2.0 introduced a bug where in some cases, hits on some posts were recorded in the database with an ID of 0. Also new installs didn’t have their database properly set up for this. v2.1.0 fixes both these issues. Additionally, I’ve added a new button at the bottom of the Settings page titled “Merge blog ID 0 and 1 post counts” which will convert all recorded posts with a blog ID of 0 to 1. The counts will be summed up and not replaced so you won’t lose the correctly recorded counts.

Bye bye Timthumb

Timthumb is completed deprecated from this version. It’s no longer bundled with the plugin. If you’d like to continue using timthumb, you’ll need to host it yourself and hook it into Top 10.

If you’re looking for a replacement to timthumb, do check out OTF Regenerate Thumbnails. It’s designed to regenerate images on the fly!

Custom Post Types in the Widget

You can now choose which post types to display in the widget. This will allow you to selectively choose top posts by custom post type. e.g. if you’re running a site with reviews which are registered as a separate post type, then you will be able to display the top visited reviews on your site.

Top 10 Widget

Top 10 Widget

New function get_tptn_pop_posts

I’ve introduced this new function that will allow you to fetch the new posts as an object (or alternatively as an array).

Just use <?php get_tptn_pop_posts(); ?> and you’re set to go. The function allows you to pass an amazingly huge set of arguments, i.e. everything that is available under tptn_default_options()

Are you using Top 10?

If you’ve been using Top 10, do consider writing a good review of the plugin on the WordPress.org. This will encourage more users to try the plugin. Additionally, if you can, do consider a donation. Currently, that’s the only income that this plugin generates.

Complete list of changes in Top 10 – Popular Posts for WordPress v2.1.0:

  • New: Button in Top 10 settings page to merge posts across blog ID 0 and 1
  • New: Function & filter get_tptn_pop_posts that can be used to fetch the popular posts as an object or array. Perfect if you want to write custom code in your theme
  • New: Support for WPML to return the correct language ID. Thanks to Tony Flags’ code snippet.
  • New: Filter tptn_list_count to modify the formatted list count. See a working example
  • New: Post types can now be selected in the widget. This allows you to select top posts by post type
  • Modified: Plugin will attempt to pull the correct size image when fetching the first image in a post
  • Modified: Deprecated “Always display latest post count in the daily lists”
  • Modified: timthumb has been deprecated. The script is no longer packaged within Top 10
  • Fixed: Bug in tracking code when not using Ajax
  • Fixed: Bug in admin column did not check for the blog_id
  • Fixed: Bug where default thumbnail location was not correctly saved
  • Fixed: Incorrect thumbnail was pulled on attachment pages
  • Fixed: blog_id column of the database is correctly initialised as DEFAULT '1'

Contextual Related Posts v2.1.0

CRP Thumbnail Options

After the major release of Contextual Related Posts v2.2.0, I’ve spent quite a bit of time over the past few weeks working on v2.1.0 which brings together several bug fixes, some optimisation and many new features. If you’re using this plugin and looking for support, please do not post a comment below, but instead create a new thread in the WordPress.org support forum or create a new issue in Github.

If you’re just upgraded the plugin, remember to clear the cache and even better, reset the plugin settings. Remember to save any custom CSS code that you might be using.

No more Timthumb

I blogged about removing timthumb from my plugins several months ago after Ben stopped supporting the plugin. With Google announcing the shut down of Google Code, I believe this is the final nail in the coffin of an arguably amazing script.

Contextual Related Posts v2.1.0 completely does away with timthumb. The settings have been removed and the script is no longer bundled.

If you’re still looking to use timthumb on your site, you might want to consider self-hosting it. You can find the latest working version in the Github repository I created and the corresponding filter to hook it into Contextual Related Posts.

If you’re looking for a replacement to timthumb, do check out OTF Regenerate Thumbnails. It’s designed to regenerate images on the fly!

Inbuilt WordPress Thumbnails

CRP Thumbnail Options

CRP Thumbnail Options

v2.0.0 came with preliminary support for WordPress’ inbuilt image sizes. However, the implementation wasn’t perfect. I first implemented this GUI in Top 10 v2.0 and have now replicated this within Contextual Related Posts v2.1.1.

You can now select an inbuilt image size or just select a custom size. The default setting  is 150×150 and cropped, which is what the default style uses.

Complete list of changes:

  • New: Separate cache for related posts added to feeds. Prevents conflict with the cache for normal related posts
  • New: Timthumb has been deprecated
  • New: Setting “Related posts should be newer than:” to 0 to disable limiting posts by age
  • New: Filters crp_posts_match, crp_posts_now_date, crp_posts_from_date to modify the WHERE clause
  • Modified: thumb_timthumb, thumb_timthumb_q and filter attributes for the functioncrp_get_the_post_thumbnail have been deprecated. If you’re using this function, an entry will be created for the deprecated log
  • Modified: Reset default thumbnail URL location to plugin default if the field is blank or only contains /default.png
  • Modified: Meta-box will no longer be displayed on non-public post types
  • Modified: For first image, the plugin will attempt to seek the correct thumbnail size if available
  • Fixed: Author link was incorrectly displayed multiple times in the list when Show Author was enabled
  • Fixed: WP Notice Errors when using the Widget via the Customizer menu in WordPress
  • Fixed: Incorrect thumbnail was pulled on attachment pages

Developers and translators

If you’re interested in translating Contextual Related Posts into your own language, do consider joining the WP Translations team and translate Contextual Related Posts on Transifex.

If you’re a developer interested in writing a new feature or have identified a bug that you would like to get fixed, head over to Github, fork the plugin and send me a pull request.

Users

If you’ve been using Contextual Related Posts, do consider writing a good review of the plugin on the WordPress.org forum. Additionally, do consider a donation. Currently, that’s the only income that this plugin generates.

What’s coming?

I still have a lot more features that I plan to add into the base plugin. Some of the features in the timeline in no particular order include:

  • Custom related posts on a post level basis
  • Exclude posts on a post level basis
  • Random posts
  • Stop words / word filters
  • Switching off the meta-box

If you’d like to suggest a feature you can quickly do so by creating a new issue in Github.

I’ll also be focusing on developing a detailed knowledge base for this and my other plugins. I’ve been spending a while researching the best option to go and it might likely be a separate WordPress blog running a custom knowledge base theme.

So go ahead and upgrade this plugin if you’re already using it. If you’re not, why aren’t you? It’s the fastest related posts plugin in the WordPress universe and it’s completely free to use!

Happy New Year 2015!

Happy New Year 2015

Happy New Year 2015

A happy new year to all the readers of my blog. May 2015 be a successful and happy year bringing you and your family good health and a lot of happiness!

2014 – Year in Review

A year ago, I posted my 2013 year in review. Back then I set some personal goals and I must admit that I managed to miss most of them! (Note to self: Revisit year in review posts during the year).

However, I am glad that I managed to keep at least a few of them and progressed on several of them.

Although we didn’t visit the US and Canada this year due to a sudden change in plans, Ashwina and I made a visit to Cornwall and Ireland as well as another visit to the Tower of London. Both visits remained undocumented on this blog because I was never able to find the time to do so. I believe that I’ve also managed to eat a bit healthier in spite of my crazy work hours. Although, I still need to get down to some serious exercising! At least, that’s what the doctor advised…

On the WordPress front, I had hoped to release premium versions of both Contextual Related Posts and Top 10. However, with my day job as an investment banker stealing most of my time over the past 12 months, this wish remained unfulfilled.

On the positive side, I successfully managed to release Contextual Related Posts v2 and Top 10 v2 as well as updates to my other WordPress plugins. v2 of my two most popular plugins heralds the possibility for paid and free addons. There is a lot of work that remains on my plugins and I will continue developing them. In addition, I am also building a new site dedicated for the addons.

Amongst other things, I did manage to get a bit of reading and also spent a lot of time playing the piano this past year. Am glad that this spark is still there!

Before I sign off…

Ashwina, since I know you’re my biggest fan and definitely reading this post… Thank you for always being there by my side these past three years. I am, without doubt, the happiest man in the universe!

And, to all my readers and followers: Thank you for reading Ajay – On the Road called Life. I look forward to hearing from you over the next year.