Email Log WordPress plugin v1.9.1 released

Just a quick note to let you all know that I have released v1.9.1 of my Email Log WordPress plugin that allows you to log every email that is sent from WordPress.

This released fixed a minor security bug that allows logged-in unprivileged users to view content of the logged email.

Since it is a security fix, it is a mandatory update.

Continue reading »

Posted in WordPress | Tagged , , , | Leave a comment

[Book Review] Why Do Buses Come in Threes?

If you look at my Good Reads profile, you will know that I have read lot of fiction lately. I wanted to take a break and so I picked up Why Do Buses Come in Three: The Hidden Mathematics of Everyday Life by Robert Eastaway and Jeremy Wyndham.

I came to know about this book through Good Read’s recommendation and added it to my to-read list probably a year ago. When I wanted to read a non-fiction book for a break I found it in my to-read list and immediately picked it up.

I found that alternating between fiction and non-fiction books is a nice way to read books from different genre and I have followed it up for the last couple of years.

why-do-buses-come-in-threes

Synopsis

Why Do Buses Come in Three: The Hidden Mathematics of Everyday Life tries to explain how Maths governs most of the things that we experience in everyday life. It answers some of the questions that we have everyday like why do buses come in threes (mentioned in the title), or why showers are always either too hot or too cold or why do clever people get things wrong etc using Maths.

In addition to answering these questions, the book also mentions the theory behind answers in simple terms.

Things I learned from this book

The major thing that I learned from this book is that some times common sense (or intuition) may not be correct. It is either your brain trying to do an approximation (and failing miserably) or some clever marketer who is using statistics to lie to you 🙂

Some of the famous ones include

  • Why do clever people get things wrong?
  • Bad luck and number 13
  • Why am I always in traffic jams?
  • How can a TV program claim that it was watched by x number of people?

The other thing that I learned from this book are a couple of magic tricks based on Maths that were mentioned in the last chapter.

Things I liked in this book

The main thing that I liked about this book is that it took most of the common day problems that pretty much everyone would have witnessed and then answered it using Maths. I found it very appealing since you can easily understand as you would have already experienced them.

The other thing that I liked about this book is that the answers were explained in very simple language which means you can understand most of them with very limited knowledge of Maths.

Also I liked the last chapter that had some magic tricks based on Maths that you can try with your friends 🙂

My Rating

My rating for this book is 4 out of 5.

The only reason that I didn’t give 5 stars was because some of the theory that were mentioned in the book were not explained properly. I agree that this book was not about the theory, but I felt that some of it could either have been removed or explained a bit more.

My next book

After finishing the current set of fiction books that I am reading, I am planning to read No Place to Hide by Glenn Greenwald. The author is the reporter broke who broke the story about NSA surveillance scandal based on the documents released by Edward Snowden and in this book the author explores the extraordinary co-operation between private industry and the NSA, and the far-reaching consequences of the government’s surveillance program.

Sounds like an interesting read 🙂

Posted in Books | Tagged , , | 3 Comments

Email Log WordPress plugin v1.9 released

I just released version 1.9 of my Email Log WordPress plugin. This released fixed an issue with pagination while viewing log files and various improvements at code level.

About Email Log WordPress plugin

Email Log is a WordPress plugin that allows you to log every email sent through WordPress and provides a UI where you can view them. The logged emails can be searched based on date, email address or subject.

Continue reading »

Posted in WordPress | Tagged , , , | Leave a comment

How to find if you are on the last page of a multi-page post in WordPress

Recently I came across a requirement at work where I had to find out if a particular post had pagination (page-breaks) and if yes then whether the user is on the last of those pages.

Even though this sounded simple, I had to dig into WordPress core source code to find out a way to solve it since there were no helper functions and you have to use global variables to figure it out.

I thought of writing about my findings here so that it would be helpful to others and I would also know where to look up when I need to do it again 🙂

Continue reading »

Posted in WordPress | Tagged , , | Leave a comment

Easy Retweet WordPress plugin v3.1 Released

As I promised in my year end review post, I have started working on my WordPress plugins. My Easy Retweet WordPress plugin badly needed an update to fix a couple of warnings and I just released v3.1 of the plugin with a couple of fixes and some new features.

About Easy Retweet WordPress plugin

Easy Retweet WordPress Plugin that allows you to easily add Twitter tweet 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 WordPress | Tagged , , , | Leave a comment

Creating custom tables with correct Character Set and Collation in WordPress

Sometime ago I wrote a blog post about how to properly create custom tables in WordPress that are also compatible with WordPress Multisite.

One thing that I didn’t mention in that article is setting the correct character set and collation for those custom tables.

What are character set and collation?

From MySQL docs:

A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters in a character set.

You will be specifying the character set and collation as part of the CREATE TABLE sql query.

What values should be used for character set and collation?

WordPress has a complex logic to figure out the correct character set and collation for each instance and provides a way to override them in wp-config.php file.

WordPress also does a lot of security checks and rejects text-based on the character set and collation of the tables. So if you are creating custom tables in WordPress then instead of hard coding the character set and collation (or leaving it blank) you should use the one that WordPress had determined.

You can use the get_charset_collate() function in wpdb class to get this value. Append the value returned by this function at the end of your CREATE TABLE sql.

Posted in WordPress | Tagged , | Leave a comment

Looking back at 2015

2015 just ended (is it already a month?) and like the last 7 years here is my year-end review post and plans for 2016. I generally publish them in the first week of January itself, but this year started as a very busy year and this post got pushed back by a month.

Personal Highlights

2015 was a special year for me from my career perspective since I worked the entire year from home. Towards the end of 2014, I joined 10up which enabled me to work from home and this work-place freedom has also helped me to move back to Chennai, my hometown after being in Bangalore for about 6 years.

Working from home has enabled me to spend more time with my family, especially with my 2-year-old son and I am very glad that I choose to work with 10up.

Continue reading »

Posted in Random/Personal | Tagged , , | 6 Comments

My contributions to WordPress 4.4

As most of you might have known, WordPress 4.4 just got released. It has a lot of cool new features like responsive images, REST API, Term Meta etc. Brian Krogsgard has a nice and comprehensive writeup about the new features and read it if you want to get more information about these new features.

Another important aspect of WordPress 4.4 release is that it had 471 contributors, the highest so far. I am happy to say that I am one of those 471 people and this is the second time I got props for a WordPress release. The previous one was for WordPress 4.3 which was released in August this year.

In this post I am going to briefly talk about the tickets that I worked on for WordPress 4.4.

Human readable data size constants

The first ticket that I contributed a patch was 22405. My patch introduced constants for common data sizes, so that you can use human readable constants like KB_IN_BYTES instead of hard-coded numbers like 1024 * 1024.

The following are the new constants that got added.

  • KB_IN_BYTES
  • MB_IN_BYTES
  • GB_IN_BYTES
  • TB_IN_BYTES

In addition to adding these constants, I also went over WordPress core codebase and replaced hard-coded numbers with the above constants.

Change password reset email subject based on user information

WordPress already provides the retrieve_password_title filter that allows you to change the subject of the “password reset” emails. But the problem with that filter is that it doesn’t pass user information. So if you wanted to change the email subject based on user information then it was not possible till now.

I have added both user_login and user_data parameters to the retrieve_password_title filter and now this allows you to change the email subject based on user information. This was done as part of ticket 34252

Documentation fixes

In addition to the above tickets I also worked on 34363, which was just a documentation fix.

I am very happy to have played a (small) part in the release of WordPress 4.4. If you are interested in contributing to WordPress then checkout the contributor handbook.

Posted in WordPress | Tagged , | 2 Comments

Goodbye Bangalore, Hello again Chennai

After being in Bangalore for about six years, I have finally moved back to Chennai, my hometown, this past weekend.

Continue reading »

Posted in Random/Personal | Tagged , , | Leave a comment

Thank you, Alex King

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.

Continue reading »

Posted in Random/Personal | Tagged , , | 3 Comments