I was offered 100 000 dollars and half of Automattic to become a premium theme author on WordPress.com. This was a one time deal. Take it or leave it. Hmmmm, let me think about it.
As you might have guessed this never happened, not even in my day dreams. But it was something we joked about when the process of becoming a theme author on WordPress.com started.
January 13, 2014 I received email from Philip Arthur Moore where he asked have I considered selling my themes on WordPress.com? Well, that’s something I haven’t been thinking much because I thought it would be next to impossible to get my themes in there. But yes, I was interested! I felt the same as I hear AC/DC and Angus young’s guitar solo live.
But couple of weeks later Philip announced that he is leaving Automattic.
@philip_arthur No, don't. I was just getting to know you:)
— Sami Keijonen (@samikeijonen) January 31, 2014
I almost over reacted and thought here goes my deal in the toilet. But thanks to Philip he forced he’s colleagues to take me under their wings. So huge huge thanks to Philip! I still don’t know why he emailed me in the first place.
Edit: Now you can email them! Apply for a theme author in WordPress.com.
The next process was pick a theme that I wanted to submit on WP.com. The choice was easy. I had just build couple of months theme called Mina olen for WordPress.org. I signed the contract and review process started.
Themes are reviewed in WordPress.org by volunteers and they are doing amazing work. Sometimes it can be bloody competition who gets the Featured themes. Also WordPress.com themes goes through very intensive review and they have even more guidelines than WP.org themes. For example these are not allowed.
I have build all my themes using Hybrid Core and Mina olen have custom metaboxes for callout text and link. So I had cleaning to do. Kirk Wight took my theme under a intensive review and taught me some new cool tricks.
It took me couple of days to rip Hybrid Core off from Mina olen WP.com theme. At first I felt bad about it because most of my theme knowledge is from Justin Tadlock and Theme Hybrid community.
But in the end I kind of started to see my theme development in a new light. I’ve been so used of using Hybrid Core that I was spoiled. And there were things that I haven’t realize and understood completely. I left some of the functions and classes from the HC (for example breadcrumb trail script) but I liked how my theme got slimmer and I understood every line of code.
I think this might be the way I’m gonna build new themes from now on: take best parts from Hybrid Core and _s theme and combine them together. These are the arguments why I might take this direction.
Theme review went well and there wasn’t any major issues. But Kirk is a sharp fellow and there were many things he pointed out to be fixed. I ported most of them also in WP.org version of a theme.
Escaping
Escaping the strings comes down to security. I thought I had done all but Kirk found many strings more. Here are examples.
`get_permalink()` should be `esc_url( get_permalink() ) `.
`get_the_date()` should be `esc_html( get_the_date() )`
`get_theme_mod( ‘mina_olen_footer’ )` should be `esc_textarea( get_theme_mod( ‘mina_olen_footer’ ) )`
Remove defaults
There is no need to write the defaults on WP functions. For example declaring Custom header I had these values the same as defaults.
The same goes for theme customizer. To keep code clean you can remove these defaults.
`’type’ => ‘theme_mod’` and `’capability’ => ‘edit_theme_options’`
Theme Customizer
First, all theme-specific options in the Customizer should be in one section in WP.com themes, called “Theme”. So I removed all my sections and moved them under same section.
This part of the theme review was the most educational to me. Did you know that if you want to get all the pages in Customizer you can just use Core `’type’ => ‘dropdown-pages’`, rather than your own custom function like I did. I certainly didn’t.
In Customizer `esc_url` should be replaced by `esc_url_raw` for sanitize_callback, as it’s being validated into the database, rather than for display.
For checkbox Kirk showed me really easy way to sanitaze it.
`
function mina_olen_sanitize_checkbox( $input ) {
if ( 1 == $input ) {
return 1;
} else {
return ”;
}
}
`
There were also couple of other custom sanitaze functions.
(This chapter was added March 20, 2014).
The most important part for me is that I know I have good enough skills developing WordPress Themes. And now I know I can. I had couple of questions before submitting theme to WP.com and I liked the answers.
Mina Olen means I am and theme name was picked up from song. The singer is my all time favourite Pauli Hanhiniemi and the song is written by Juha Tapio who is listening the song. Perhaps my next theme is called You Are?
I am very proud to be theme author on WordPress.com. I am forever thankful to Philip for giving me this opportunity. I am very pleased if you need my theme on WP.org or on WP.com. I am still 99 999 dollars short for what they promised.