Votes control

The plugin will add two meta boxes in the back-end: one to display the votes and another to control the votes.
Controlling, in this context and plugin iteration, will mean the post editor will be given the possibility to:

reset all votes on a post

consolidate all votes on a post

The first one will imply, in the back-end, deleting all the plugin generated comments for a post while the latter will mean deleting all the comments as well but store a count somewhere for a post to have a record of the votes.
This will be the UI result

Test, provide and use

The process is now a known one where I’ve scaffolded a test for the control meta box class

Again a class modelling the context the meta box will render into will allow me to control the class input and its interactions with its surroundings.
Once the meta box class and its dependencies are defined and tested (where applicable, I’m not losing my sanity to test adapters) it’s time to iron out the JavaScript side of things.
Before that I’ve updated the MetaBoxes and the Scripts service providers to set up the show.

WebPack to the rescue

I will enqueue a single script on the site backend, idlikethis-admin.js, and will produce it using the code splitting powers of webpack.
In essence I will associate each button to an extended Backbone view and delegate the back-end communication and syncing to an extended Backbone model.
The main file tells almost all the story