Category Archives: WordPress

All about my love for WordPress. BTW, I am self-claimed WordPress Super star.

A quick preview of WP CLI – Chennai WordPress Meetup

Today I gave a talk about using WP CLI in the March 2020 edition of Chennai WordPress Meetup.

The talk was more of a hand-on session where I gave demo and explained the different features that are available in WP CLI.

You can download the slides from my slideshare account or view them below. While you are at it, you can also checkout some of my other talks.

A quick preview of WP CLI – Chennai WordPress Meetup from Sudar Muthu

Posted in WordPress | 1 Comment

WordPress Developer tools to increase productivity in WordCamp Mumbai

I am in Mumbai this weekend to attend WordCamp Mumbai 2017. Unlike other WordCamps this one is spread across two days.

In this WordCamp I gave a talk about WordPress developer tools and moderated a group discussion about testing.

Group discussion about Testing

This time in addition to regular talks, the organizers also added a group discussion about testing. I moderated this discussion among a panel of 4 people who are heavily involved in testing.

The discussion revolved around the various testing tools and processes that people use for testing especially in the WordPress context and how they account for compatibility issues with different PHP versions, WordPress versions and other plugins.

I found this discussion very useful as a developer and learned about a couple of things that I can do to make testing easier.

There were also lot of good suggestions from the audience and one of them mentioned that you should try to do pair programming involving a developer and tester together. This is the first time I heard of such a practice and I am very interested to know whether this works. I might give it a try sometime soon.

My talk about increasing your productivity as a WordPress developer

I gave a talk about the different developer tools that I use to increase my productivity as a WordPress developer. This talk is very similar to the one that I gave in WordCamp Kochi last month, but I tweaked a couple of things especially around wp-cli and phpcs since there were other talks that went in detail in those topics.

I covered the following tools.

  • IDE (PhpStorm, vim)
  • Vagrant and FlyWheel
  • wp-cli
  • xDebug
  • phpcs
  • phpunit

Slides

You can download the slides from my slideshare account or view them below. While you are at it, you can also checkout some of my other talks.

The talk was recorded, so I am sure the organizers will upload them to WordPress TV soon. Once it is uploaded I will link it up here.

Posted in Events/Conferences, WordPress | Tagged , , | 14 Comments

WordPress Developer tools to increase productivity

I traveled to Kochi today to attend WordCamp Kochi 2017, the first ever WordCamp to happen in South India. I am waiting in the airport to return home as I write this.

Even though this was the first WordCamp in Kochi, the organizer did a wonderful job and it was planned and executed perfectly. Kudos to the organizers and volunteers.

Remote working culture in India

I was very surprised and happy to note that remote working culture has really taken off in India.

When I attended WordCamp Pune in 2015, apart from my colleges who worked at 10up, there were only one or two other people who worked remotely. But this time I found more than 10 people who are working remotely.

There were lot of foreign companies and even some local Indian companies that have adopted remote working.

I don’t get the eyeballs that I used to get earlier anymore when ever I mention that work 100% remotely 😉

My talk about increasing your productivity as a WordPress developer

I gave a talk about the different developer tools that I use to increase my productivity as a WordPress developer.

Instead of just listing down the tools or just talking about how to install/configure them which anyone can find out easily by a simple web search, I talked about my experience using these tools and the reasons why I choose these tools.

Continue reading »

Posted in Events/Conferences, WordPress | Tagged , , | 17 Comments

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 , , , | 1 Comment

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 , , , | 4 Comments

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 , , | 3 Comments

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

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

Unit Testing for WordPress

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.

Continue reading »

Posted in Events/Conferences, WordPress | Tagged , , | 1 Comment