WP Style Tiles progress

I’ve been chipping away at WP Style Tiles all day today. I’m at a point where I’m between trips away, and I’ve been focusing mostly on brushing up on WordPress skills, and the plugin has been a good test.

Here’s what I’ve crossed off the list:

Remove CPT UI dependency
I think there is some sort of glitch with the way CPT UI exports CPT code. It only had to entries in the $labels array, which I’m 99% certain was the issue with my fields not working correctly. This may have only happened because I didn’t fill in all of the fields like I have in the past. So maybe that would fix it…something to look into later.

Remove ACF dependency; move to CMB2
I’m so happy this is done, and now am seeing the pros and cons of both Advanced Custom Fields, and CMB2. ACF has that handy AF interface for setting up fields, but CMB2 has better, more intuitive ways of grouping fields together. There was quite a learning curve updating the output template, but it’s there, and I have more familiarity with CMB2, which is nice. 🙂

Here’s what’s in progress

General code clean up
Oh man, yesterday, I embarrassingly realized I was abusing & misusing esc_attr() when I should have been using esc_html(). Anyway, I’ve fixed that within the plugin (as well as a few other things where I was doing that), and started working on transferring my styles from inline styles to <style> tags injected into the head of the post. It’s somewhat debatable whether it looks nicer, but it will definitely be easier for a user to write custom styles to overwrite things (#deathto!importanttags).

There’s still code to be cleaned up, but I will keep chipping away at things as I go.

New to-do items

Design and coding are iterative processes, and I often find as I’m working through improving something, there are even more things I notice that could be improved in the next pass.

Add isset or ! empty checks on all fields / groups
There are fields or groups in the template that won’t always be completed (like subheadings). In those instances, it seems like a good idea to not print the wrapping code for those groups.

Figure out front-end metaboxes in CMB2
I spent about an hour in a bit of a daze trying to figure out how to get the custom CSS metabox to load on the front end with no success. I think taking a step back will help me gain some perspective so I can figure it out tomorrow.

Other notes

One side benefit of working on WP Style Tiles is working with a few different themes to test things out. Yesterday, I started using it in my theme to make sure it was compatible with Alcatraz (which is working great so far!), and since I was looking at my theme so much, I went in a fixed a few style issues that have been bothering me (namely, pre tags and tables). I want to do a more thorough review before I deploy, but they’re definitely looking better. 🙂