After being in Bangalore for about six years, I have finally moved back to Chennai, my hometown, this past weekend.
It is with great sadness that I came to know that Alex King one of the original WordPress developers has passed away last night.
Even though he doesn’t know me personally, he was one of my major inspirations and a major reason I started working on WordPress. He was also the reason I wrote my first every WordPress plugin back in 2008.
I am in Pune attending WordCamp Pune 2015. It’s been very exciting so far and finally I had chance to meet lot of people in person whom I am have been in contact online for more than half a decade.
My talk about Unit testing in WordPress
I have recently added Unit testing as part of my development workflow and it has helped me a lot as a developer and has even changed the way I think about code. It also has helped me a couple of times to catch bugs early that had the potential to spoil my weekend if it went to production
I gave a talk about how you can also use Unit testing to get peaceful weekends.
At the beginning of the talk I talked about the basic concepts in Unit testing and you can do it for plain PHP code. After that I moved on to show how the same concepts can be applied for WordPress code using frameworks like wp_mocks.
I just gave a talk today about Unit testing PHP code using PHPUnit in Drupal Camp 2015.
I have recently added Unit testing as part of my development workflow and it has helped me a lot as a developer and has even changed the way I think about code.
In this talk I talked about how to get started doing Unit testing in PHP and about some of the tips that I learned as I started doing Unit testing.
As most of you would have already know, WordPress by default provides two built-in taxonomies – Categories and Tags. If you need to create a new association, then it is also very easy to create custom taxonomies in WordPress.
But one of the major limitations while creating custom taxonomies in WordPress is that you can’t make them as “single select”. By “single select” I mean the ability to restrict only one term to be selected for a post.
Following in one example where you might need this ability. Let’s say you are storing movie information in a custom post type and you need to store the PG rating for the movie in a custom taxonomy. Each movie will have only one rating and you should restrict that only one rating term is stored for a movie.
Recently I faced a similar scenario and this post talks about how I solved it.
I spoke about doing Unit testing in PHP using PHPUnit at the Bangalore Open source meetup today.
One of the common ways to debug DB queries in WordPress is to enable
SAVEQUERIES, which keeps track of all the DB queries that are executed in WordPress, together with other information like how long it took for the query to execute, what are the functions that called it etc and stores in the global array variable
While this is a great way to debug DB queries, this could be a huge issue on production sites.
I just released
v1.2 of my Github Ribbon Plugin.
About Github Ribbon
Github Ribbons is a WordPress Plugin that allows you to add “Fork me on Github” ribbons to your WordPress posts or pages. You can enable the ribbon per post/page level or at global level.
As I mentioned in my earlier book review post where I reviewed Stephen Hawking’s A brief History of Time, I started reading Ponniyin Selvan by Kalki and got completely engross in it. It is the main reason you didn’t see any blog post from me in the last few weeks, even though I took a resolution to write at least one blog post a week.
I discovered Varying Vagrant Vagrants (VVV) a couple of months ago and since then I have used it for my WordPress plugin development and testing. It is extremely easy to set up and let’s me test my plugins in various versions of WordPress very easily.
In my never-ending quest to optimize my development environment and work flow, I tried various configurations and finally settled on the following setup where I am mapping my plugins folder using VVV’s shared folders. This allows me to easily test my plugins in various versions of WordPress, without copying them around.
I thought of sharing my setup and my
Customfile so that it would be useful for others or to future-me