What I’m working on: building a plugin for book reviews

Last year, I met with some of the peeps from the Open Classroom‘s School Library (and Library Committee) to come up with ideas for how the Open Classroom website could better serve them. This was part of an existing process I was going through for planning the update to the website that I launched a couple weeks ago and you can check out now. (WordPress peeps might notice it’s using ThemeID‘s (now CyberChimps‘) Responsive theme as a base. Ironically, I had to make the Responsive theme actually “responsive”, but that’s a topic for another post…) What came out of that conversation was the foundation for a complex, custom post type-based plugin that uses a wide variety of custom taxonomies that would be used for sorting books (and book reviews) by a variety of different things, from genre to subject to authors and illustrators to reading level. I’m entering the final stages of development for the plugin where most of what needs to be done will be some front end and UX stuff, so I’m excited to show off some screenshots of the stuff I’ve been working on. Here we go.

The menu

Book Review menu

The first thing is the menu. A fairly standard WordPress menu. What’s interesting to point out here is that I’m using the Genericons icon font as the dashboard menu icon for the custom post type. I did this because when the WordPress dashboard gets overhauled in 3.7 (or 3.8?), all the menu icons will no longer be the sprite-base images we’re used to seeing, but will instead be using the Dashicons icon font which was specifically built for the WordPress dashboard. This makes the icons more scalable and beautiful on retina devices and also corresponds to the “flat” design of the new layout. So, I decided to get a head start on it now. However, in order to do so with the current version of WordPress, I had to do some clever CSS hacking to hide the existing icon and replace it with a specific character from a font I am loading in the dashboard. I posted the (CSS) code for that in a Gist yesterday.

Review Authors, Genres, Book Authors, Reading Levels, etc. are all taxonomies — so they can be used to sort the reviews. There’s another taxonomy that doesn’t appear here called Ratings. I removed it from the menu because I only wanted 5 possible values for the rating system for 1-5 stars — I didn’t want people to add their own arbitrary ratings which wouldn’t work with the display once the front-end stuff is built. Additionally, when the plugin is activated, it automatically inserts 5 “terms” for the Ratings taxonomy — numeric values of 1 – 5. This way you will be able to sort by rating, but all of that is invisible to the user except when they are writing or viewing the review. Each of the taxonomies (except for Book Author and Genre) are optional, and can be enabled/disabled from the options page which I’ll go over in a bit. All the new taxonomies are off by default — this is a shot of the menu with all of them active — so you start out with a fairly simple system with only a few sub-pages that gets more complex as you enable more features.

The list

Book Review list

This should look familiar to anyone who’s used WordPress — it’s a standard post list, in this case featuring each review. This is an early version of this; I’m going to be adding custom columns so you’ll be able to see the various taxonomies (like Book Author, Genre, etc) for each book. What you won’t notice as much is the dashboard icon. Here, again, I’m using Genericons — the book is a character in the icon font — so I had to do some CSS magic to get that to display instead of an image icon. The future (MP6) WordPress dashboard doesn’t use icons at all, so that’s moot, but it actually made it easier to work with since I don’t have to create some rules and then create new rules to cancel out the first rules when the next version of WordPress rolls around. You’ll also notice that the author of the Shadow and Bone review is “reviewer”, which is a user I created to test out the new user roles that are added by this plugin as well, which I’ll also go into in a bit…

Add new

Add new book review

Here’s the Add New screen and, as you can see, there’s a lot of stuff. By default, WordPress loads all taxonomies on the right side — they can be moved around by dragging them, but that forces the user to do that and, otherwise, makes a huge list on one side that ends up lopsided. I tried to counter this a bit by moving some of these to the middle and then, using some admin css, resized the boxes so I could fit more in a smaller space. It’s not a perfect system, it’s not perfectly responsive, but it’s a start. I tried grouping the taxonomies by things that would typically go together, so author, illustrator and series are all together under the review, while genre and subject live together in the right column. It’s still crowded, but again, this gets much simpler if you have fewer options enabled.

Options

Options

This is the options page where you can turn on/off any of the settings. With the exception of Stock, each of these corresponds to a taxonomy that doesn’t get called if the option is disabled. For Awards, the Upload Award Image section does not appear if the Awards option is disabled and if both Awards and Stock are disabled, that Additional Information box disappears.

User Roles

User Roles

Finally, the user roles. User Roles are my new favorite thing to play with. I just got done building a different plugin for the Open Classroom that added user roles to control a different post type, and thought that I could do that here as well. In the Book Reviews plugin, there are two new user roles, Librarian and Book Reviewer.

Book Reviewer is similar to an Author in WordPress — they can publish their own reviews, but they can’t edit others’. Additionally (and different than the Author role), they can use all the taxonomies that are used by the plugin (so they can add the author, genre, awards, etc). They have also been given the ability to create and publish WordPress posts, but they can’t edit other people’s posts.

Librarian is basically the Book Review admin — they can edit other people’s reviews and publish their own, but as far as the rest of the WordPress admin, they don’t have any capabilities higher than what the Reviewers can do.

All the Book Review posting and publishing capabilities have also been mapped to the existing WordPress user roles corresponding to their existing capabilities otherwise, with the exception of the Author role (which normally can’t publish posts) who can, like the Book Reviewer, actually publish book reviews, rather than submit them for someone else to review before publishing.

So when’s it going to be ready?

Hopefully, I’ll be finishing this up this week and then I’ll post it to the WordPress.org plugins repository as a free plugin. Yes, this is a lot of work to put up for free, but honestly, I have more than enough on my plate right now to want to deal with figuring out a way to monetize it. What will be coming soon will be shortcodes to display reviews and tweaking the columns in the Book Reviews list as well as preparing (and testing) the language files so it can be localized into other languages. If you’re interested in testing it before I make it public, give me a holler either on Twitter or on the contact form on my about page and I’ll send you a copy. Currently it’s being hosted on a private Git repository I set up not long before WordCamp SF.

Right now!

Update

New post columns!

Comments

11 responses to “What I’m working on: building a plugin for book reviews”

  1. Prasad Tiruvalluri Avatar

    I think you should look into usage of ratings in integers? When reviewing, how do you take care of ratings lime 4.5, 4.3 etc., I am using another plugin for ratings. Not good as there is a chance of incompatibility..

    1. Chris Reynolds Avatar

      Since the review rating is coming from a single reviewer, I’m not overly concerned about partial-star ratings (4.5, 3.2, etc). If it was an open rating system that allowed others to rate things, then I’d want to incorporate something like that. I had briefly considered including half-stars, but ultimately decided that — since the icon font I was using didn’t have any half star icons and rendering the star ratings in the admin was already going to be problematic (I’m using numbers instead of stars, the stars are only seen on the front end), it would be best to keep it simple and just use whole numbers from 0 to 5 and the reviewer can interpret those however they choose (or not use ratings at all). The idea for the plugin was less that other people could rate these books (although I think that is one way people might use it, with a different rating system in place), but rather that you could write book reviews and put your own rating on them (and then visitors could comment on the review, ask questions, or provide their own feedback).

      1. Prasad Tiruvalluri Avatar

        I am using your plugin. I would like to continue using it as it is the best out there. I hear that UBB is good but it is paid and since my blog is a hobby blog, I am not going to any paid plugins, themes etc.,
        I am happy that you have been so quick to respond. I really like that . I keep searching for better plugins every week or so but nothing comes up.
        I have one peeve with this plugin. This is not attached to any category and since I have category pages on my Main Menu this does not come there. I had to go thru some hoops to make it available on a menu. I am also not sure if they are available to search Engines or part of the SEO. Also it is in a separate database, I guess. So when I make a post, it does not appear on the front page. It does not trigger ifttt recipe. It does not trigger any other stuff sharing the post on social media thru publicize. I think that is a big drawback. Is there a solution for this or am I doing some thing wrong?

      2. Chris Reynolds Avatar

        Book Reviews are intentionally separate from the blog. They are not intended to be included in the normal stream of blog posts, otherwise they could just be blog posts. Same with categories. They do not share the same categories as blog posts because they are not blog posts. There are recipes on sites like WPBeginner on how to get posts of a different post type included in your main blog stream and there may be plugins that do this as well.

        As far as SEO, they are handled, seen and indexed by search engines exactly the same as regular blog posts. If you use a plugin like WordPress SEO, it will give you options for book reviews the same as it would for blog posts. Book Reviews are not in a different database but they are a different content type. For the same reason that they aren’t in the main blog stream, they aren’t in the default RSS feed, but that doesn’t mean they don’t have an RSS feed or the ability to trigger IFTTT rules — you just need to use the RSS feed for book reviews — e.g. yourdomain.com/book-review/feed/.

      3. Prasad Tiruvalluri Avatar

        Oh Btw, The feedback is my own and I do not know which reviewer you are talking about. This (rating) was a real problem for me and I solved it in a different way. Also do not go by the number of people who have rated for anything. Out of 8,000 people who have downloaded, only 6 have commented/rated. Nobody knows what the other (me included) think. Just a thought..

      4. Chris Reynolds Avatar

        I only meant that there is one reviewer, e.g. the author of that book review. There’s no aggregate scoring, no average rating needed, so partial stars, to me, just overcomplicate the issue.

  2. Prasad Tiruvalluri Avatar

    Sorry, I got it. I think, I need to use the short codes to get the reviews into posts.

  3. Prasad Tiruvalluri Avatar

    Hi Chris –
    One question. If I make a post and use the short code in it like say [book-reviews format=full]. I see that it displays all the book reviews I made till then. The question I have is if it is dynamic in the sense that will the post keep adding any new book reviews I make after I had made the above post? Does it have any effect on the page loads if it has to do it on the fly?

    1. Chris Reynolds Avatar

      Using the shortcode basically makes whatever post or page you’re on into an archive page for book reviews — that is, it sets it to display all book reviews. So you don’t need to do anything to get the latest reviews. It’s not really doing anything “on the fly”, it’s just retrieving that data from the database. If you had your book review page open, and wrote a review in a different tab, it wouldn’t update on that book review page, you’d still need to refresh but once you did, you’d see the latest review. Make sense?

      1. Prasad Tiruvalluri Avatar

        Thanks. Awesome support.

Leave a Reply

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