Confession: Nose Graze has never used the Ultimate Book Blogger plugin. That’s because the creation went like this:
- Start the Nose Graze blog.
- Build my own system for formatting book reviews and archives using Advanced Custom Fields. I literally did this on day one of my blog.
- …a year passes…
- I think, “Hey, maybe other people would like this too!” But my system wasn’t able to be redistributed as-is, so I coded something new (Ultimate Book Blogger plugin).
And I simply never moved Nose Graze over because that was a big migration project I wasn’t really interested in doing. My system already worked.
I finally decided to code myself a better system
This project didn’t actually start out as, “I want to code a better system for Nose Graze.” It started out as purely a hypothetical project: “What would Ultimate Book Blogger look like today if I could rebuild it?” So this was my fun project for a hypothetical “UBB do-over”. I wasn’t even really planning on using it in the end (then what was I doing it for? IDK), but I loved it and decided to move Nose Graze over to it.
In the end, this project stopped being a hypothetical re-coding of UBB, and just became a super simple plugin that I wanted to use on my own site. The final result is really not like UBB at all.
So what is it exactly?
Before I dig into details, I want to make something clear: I still don’t know what this plugin is.
I know it’s something I’m now using on Nose Graze and will continue to use, but I think the big question is: will UBB go in this direction? And to that, I don’t know. I will talk a bit about this at the end.
For now, just consider this me showing off my own new system and you’re welcome to tell me what you think. 😛
As I said before, Nose Graze used to use Advanced Custom Fields. A form like this appeared on the Edit Post page:
I also had taxonomies for author, publisher, genre, etc.
Books and reviews
My new plugin no longer binds reviews (and book info) to posts. Instead, there are new areas in the admin panel: one for books and one for reviews.
I can add a book, fill out the book information, display that information in a post, and create a review of that book.
Books and reviews are kept separate, but you can link a review to a book. This separate system allows me to also add a book’s details to a post without needing a review if I don’t want one.
Reviews can be associated with blog posts or lead to an external URL
This is something that has been widely requested in UBB but just didn’t really work within the current system.
When adding a review in my new plugin, I basically choose a ‘source’ for the review:
The ID of a blog post (if the review is on my blog).
I can enter any other URL of my choosing (like to my Goodreads review).
Then in my review archive, the review will either link to the blog post or that external URL.
A better, more compressed UI
One of the worst things about UBB is the cluttered interface for adding a book. The book information is a combination of post meta, which appears in the main meta box area, and taxonomies, which are shoved off to the right. See below:
This separation is disjointing, especially to new users.
It was the same with my ACF method on Nose Graze. The ACF box was in the middle and taxonomies were on the right.
In my new plugin, everything is custom coded, which gives me a lot of flexibility in how I display the book information. I can group things together more logically (like the series name and series number can be right next to each other).
Adding a book review from a blog post
This process is pretty awesome. I drew a lot of inspiration from the WP Recipe Maker plugin.
There’s a new button above the editor for “Insert Book”.
Clicking this brings up a modal like the “Add Media” one.
You can either search for an existing book or add a brand new one.
After clicking “Insert”, the book gets created and a new shortcode is added to the post editor. But the shortcode looks like this (visual editor only):
If you click on the book info box, it opens the modal back up with that book information already loaded in, so you can easily edit that book.
It’s a few more steps to actually turn that into a review because I didn’t integrate the review part with the modal. I probably could have, but it got more complicated and I lost motivation since I don’t actually use the visual editor anyway.
So to add a review, there’s a separate box below the editor for “Book Reviews”. I click “Add Review”, select which book it’s for, choose my rating, and press “add”. This creates the new review entry and associates it with the post.
This is definitely something I’d like to bring over to UBB. It’s just plain awesome.
Searchable review archive
The only big change that readers will see on my site is the new review archive. Let’s look at a little before and after:
- All reviews listed on one page (like this — I did actually still keep this for funsies).
- Separate pages/shortcodes for reviews by title, reviews by author, reviews by series, etc.
- Reviews are split up into paginated results.
- There’s only ONE archive, but that one archive has a form for filtering where you can narrow/change the results.
A huge problem with UBB is people having thousands of reviews and then running out of memory to display them all on a page. This is partly because of how book info is added to posts via post meta, and it’s just a bit convoluted. This new display breaks the results up into multiple pages, but also has pretty awesome searching/filtering.
Cool admin analytics
This one is exciting! For this I drew a lot of UI inspiration from EDD Metrics.
I even added a system where I can log how many times I’ve read a book to track re-reads. Sadly those numbers are pretty inaccurate right now since I only just added it so it only has my re-reads from November, but I’m excited to see the data moving forward!
Under the hood: it’s a lot of custom code (and custom database tables)
From the get-go, I had two goals:
- Use fewer (if any) third party libraries.
- Use custom database tables.
I wanted #1 because I used a few third party libraries in UBB (like CMB2) and they ended up making my life a lot harder down the road. I have nothing against CMB2 and think it’s great for the right person and right product, but with UBB it started being more of a hindrance than anything else.
And I wanted #2 for a few reasons.. Most people would probably gravitate towards custom post types (one for ‘Books’ and one for ‘Reviews’) and while I totally get that approach, I ultimately decided against it. I just really wanted to build this plugin into something that scales really well (thousands and thousands of books), and I wanted the data to be easy to manipulate and fast to query. I ended up needing to replicate a lot of core code to work with my custom tables, but in the end it’s working in a way that’s 100% perfect for my project.
How can this be integrated into UBB?
This new plugin really focuses on three things:
- Display book information in blog posts.
- Maintain an archive of reviews (with filters).
- See interesting statistics about the books you read and review.
UBB does a ton of other stuff, which is why I guess the two plugins are totally separate for now. This new plugin has no widgets, only like four settings, no giveaway/blog tour/blogroll support, no “fetch info from x site”, no related posts, no about the author boxes… But I do think I can draw a lot of inspiration from this new plugin as I move forward with UBB.
Also, this post is called “I gutted my database..” because I deleted my old data, which ended up being 25,086 rows from the postmeta table and 2,871 taxonomy-related rows.
So what do you think? Pretty cool?
P.S. Carina just released her 2017 book spreadsheet, which also has a lot of cool reading statistics! Check it out if you’re into spreadsheets and stats.