My experience on submitting First theme- Kafal to WordPress.org

September 01, 2017

In February I wrote a blog on Open Source and WordPress theme and decided that I will submit a theme to WordPress.org. And now I am back with another blog on my WordPress theme Kafal. It’s a pleasure to inform you all the readers that my theme passed the review process and accepted in the WordPress.org repository. Theme ‘Kafal‘ is now live and have been downloaded 1500+ times and currently active on 200+ blogs/websites. I am that much happy about it that every day at least 5 times I check the theme details in WP.org.

It was all started in February when I don’t have much work besides my academics. At that time I was craving for the work. Then after a lot of research, I published the blog on Open Source and making a theme. At that time I was already a member of WordPress slack. I think slack is the best place to start your journey. In this blog, I’m going to share my experience, what I’ve learned during this period.


Coding Improvements

I started my HTML career with <!Doctype html>, which means started with HTML5 but never understand what the difference between the HTML 4 and HTML5. In this theme, I’ve used new semantic elements from HTML5 like headerheaderfooterarticlemainaside etc.

WordPress provides many APIs and I’ve used many of them. This time what was new for me is the Theme Customization API.  Added live preview option for custom options like ‘Header Color’ and ‘Blog Title & Tagline’ etc. That’s a cool API for designing good UX for theme users.

Previously while developing a theme I’ve never bothered on using escaping and sanitizing functions. If you check my first theme ‘Makes me Wonder’ that I’ve created in my second year, I’ve never used any escaping function. Or if I’ve used it then it must be a code that I’ve copied from SO or codex. But now whenever a code that involves DB or User inputs, the first thing that comes to my mind is escaping and sanitization of the data. Writing a poor code with less security can lead to an XSS attack to the site.

I have learnt much more things about the coding style, that I can’t recall at this time but I will surely share them in future.

 

Theme Customization API and Bootswatch themes

Created theme repository named ‘Solitude‘ and started working on it. I wanted it to be like the best of its type. And started designing the theme. I am a great fan of Bootswatch, as they provide cool themes for the Bootstrap. I wanted to create a theme that you can change the theme variant with these Bootswatch themes. So I downloaded different Bootswatch themes and integrated them into the theme with the Theme Customization API. You can change your bootstrap theme with the different variant of Bootstrap. But due to lack of design skills and other works, I stopped working on the theme ‘Solitude’. This theme has more options but it lags in design and has a poor coding style. I will work in this theme maybe in future.

 

Using _s (underscores)

After ‘Solitude’ it was a leap of 2 months when I started again working on the theme. This time with more enthusiasm, more energy. But when it comes to writing the same code again just for scaffolding it’s kind of a heavy task for me. So now this time what I did was, I forked ‘_s(underscores)‘ the starter theme created by Automattic for hacking. Created my own branch and started hacking the theme.

By the way, I’ll not prefer using _s if you are just starting out in WordPress and don’t know the basics.

 

Using basic testing methods & build tools

I wrote a blog on Integrating Travis CI with WordPress Theme. Using build tools and CI(continuous Integration) is must for the projects because a single human error can be a huge problem. So we teach machines to check our code and warn us about our mistakes. I’ve used Travis CI to test my theme, if it is passing the WordPress coding standards or not. There are also some plugins that can test your themes with the WordPress coding standards like ‘Theme Check‘.  These tools will help is making a good theme with Coding Standards.

 

Various Open Source Licenses

When I first submitted my theme on 19th June(Trac ticket), the ticket closed 2 days after that on 21st June. That was a quick review by one of the theme reviewer team lead @poena. The theme got rejected because of having more than 5 different errors. The first and most important error was declaring the license of the theme.

I was aware that for uploading to WordPress.org the theme should have an open source license GPLv3 or compatible. But I haven’t declared it. By saying theme I also mean the assets used in the theme like images, libraries etc. You can check the conversation over the ticket and check all the links she provided about theme development.

For learning about the licenses choosealicense.com is a good source.

Setting Realistic Deadlines

Without a deadline, a side project may become garbage because it will never be completed. What I learned is that setting a realistic deadline increases the productivity. Be it our assignments, project reports etc. Even we start studying just before the exams. Moving out from the comfort zone, doing the projects that you love & stop procrastination. I have also set a deadline for the theme and yes because of that I have a commit in git with ‘Hackathon’ (check the dates) 😛

Hackathon for Kafal
Profile Shubham Pandey WordPress

 

Have any views about this, please let me know in the comment section.

Thanks!

Thanks for reading if you have any comments or feedback you can reach out to me on twitter.

Up Next