New Features:

  • Added an Activity page that shows picks/day and number of unique pickers/day.

Fixes:

  • Indexed the primary table that handles user-submitted picks.
  • Updated the My Stats and All Stats pages to handle HOU cards correctly.
  • Removed all floats from my custom css.
  • Fixed the generation of unique pack hash to include timestamp properly.
  • Pulled a bevy of actions out of the wp_head() action that were loading unnecessarily:
    • feed_links, feed_links_extra, rest_output_link_wp_head, adjacent_posts_rel_link_wp_head, wp_shortlink_wp_head, _custom_logo_header_styles wp_oembed_add_discovery_links, wp_oembed_add_host_js

I’ve been colloquially referring to this update as ‘the performance update’ and boy-howdy, that is an apt name. As the tables of picks continues to grow, so too did the individual load times on loading a pack or submitting a pick. I’d always had this slowdown on my radar, but it wasn’t until Hour of Devastation release that users actually started discussing the slowness. This was a call to action in my eyes.

I’m a bit ashamed to say that the most impactful change was indexing the pick table (named pack_15 for now completely lost legacy reasons). On the one hand, this site is a learning experience for me, but on the other, indexing a table being used in such a visible and primary way should have been something I fixed a long time ago. Better late than never I suppose.

Loading Hour of Devastation into the site was straightforward, but I needed to recode my method since I haven’t been keeping my back-end python files in order. In addition, MTGJSON omitted the HOU masterpieces, so I needed to code those in by hand. Certainly not my favorite activity, but it was fun getting to spend time examining each Masterpiece closely, ugly frames aside. There were a few lingering issues from my import which were fixed with this update.

The remaining improvements relate back to my post on r/webdev and the invaluable recommendations I received there. WordPress bakes in a lot of unnecessary features that were negatively impacting load times, so those were removed. In addition, my CSS-fu is rudimentary at best, so I attended to a few issues that I caused by using an ‘at-least-it-works’ approach. More to be done here for sure.

The activity feature is identical to a SQL query I run to keep tabs on how frequently the site is being used. I didn’t like not being able to check these numbers unless I was at home in front of my production computer, so I figured I’d add it as a feature to the site. I’m not a huge fan of the menu at this point, Leaderboard and Activity should find a home in their own section but I’ll leave that for next month’s update.

That does it for now. Happy 1st picking!

Leave a Reply

Your email address will not be published. Required fields are marked *