PHP Unit testing at Drupal Camp 2015

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.

Continue reading »

Posted in Events/Conferences | Tagged , , | 3 Comments

Creating single select WordPress taxonomies

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.

Continue reading »

Posted in WordPress | Tagged , | Leave a comment

Unit Testing PHP using PHPUnit

I spoke about doing Unit testing in PHP using PHPUnit at the Bangalore Open source meetup today.

Continue reading »

Posted in Events/Conferences, Web Programming | Tagged , , , | Leave a comment

Don’t enable SAVEQUEIRES in production WordPress sites

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 $wpdb->queries.

While this is a great way to debug DB queries, this could be a huge issue on production sites.

Continue reading »

Posted in WordPress | Tagged , | Leave a comment

Github Ribbon Plugin v1.2 release

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.

Continue reading »

Posted in WordPress | Tagged , , | Leave a comment

[Book Review] Ponniyin Selvan

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.

Continue reading »

Posted in Books | Tagged , , | Leave a comment

Mapping plugin folder in VVV using shared folders

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 :)

Continue reading »

Posted in WordPress | Tagged , | 2 Comments

Easy Retweet Plugin v3.0.3 release

I just released v3.0.3 of my Easy Retweet WordPress plugin.

About Easy Retweet WordPress plugin

Easy Retweet WordPress Plugin that allows you to easily add Twitter tweet or buttons to your WordPress posts.

You can choose to add these buttons using any one of the following ways

  • Automatic way – Just configure the button in the settings screen
  • Using shortcodes
  • Using template functions

You can also enable Google Analytics tracking for the links that are generated by buttons created by this plugin.

Continue reading »

Posted in Plugin Releases | Tagged , , , | Leave a comment

[Book Review] A Brief History of Time

After starting the year with Isaac Asimov’s Autobiography, I read a science book – A Brief History of Time by Stephen Hawking next to keep up with my goal to read books from different genre this year.

I tried to read this book a couple of years ago, but stopped in between and didn’t complete. I forgot the real reason why I stopped and so I took it up again this time and read it from the beginning.

Compared to my last book, this was not a page turner, but I was learning lot of new things which motivated me to finish the book. It took me about a week to complete this book.

Anyways, as I promised at the beginning of the year, I will try to write reviews for most of the books that I read and here is my review of the second book that I read this year – A Brief History of Time by Stephen Hawking.

Continue reading »

Posted in Books | Tagged , , | 5 Comments

Coursera’s Data Science Specialization Track

In my year-end post for 2014 I posted about Coursera’s Data Science Specialization Track and after that a couple of people have asked me to give more details about these coursers and share my experience in taking them.

In this post I will give more details about this sets of coursers and about my experiences so far in taking them.

Continue reading »

Posted in Certifications | Tagged , , | 2 Comments