How to contribute to the WordPress project
Image from the br.wordpress.org

How to contribute to the WordPress project


In this article I am going to explain my personal story of “Why did I decide to become a WordPress Core Contributor” and give some tips to begin.

A couple months ago I was decided to find an open source project to contribute and consequently to improve my GitHub profile, so, the question was ‘Which one?’. I had a large experience in PHP and its community is huge then a project build in PHP seemed to be the best choice, the great insight was “WordPress is a good idea”, after all, a great part of web systems run it, look on this link, it would be rewarding to know your code is contributing to something big like WordPress along with this I was starting in a great web portal in Brazil developing projects in WP.

I’ve started to research to find out “how could I to contribute to WordPress?” and of course the GitHub repository address, then my disappointment, did you remember my initial motivation? Yes, to improve my Github profile reputation, but the WordPress Project is on subversion and the GitHub repository is only a mirror, my plan fails miserably =(, it was funny because even with that I was still motivated to do it.

Makewordpres.org

This website is my great and main tip if you to decide to ignore all I will to say about WordPress start to do it before this hint =). The WordPress team on the website says “There are many different ways for you to get involved with WordPress”, all the ways you can to contribute to the project is on there, my two initial choices were Polyglots and Core.

Polyglots

This choice was in my humble opinion the easiest one and I also would you recommend to start here if you don’t know where to begin. Actually to help with the translation of a project is the better choice for any open source project, anyone can contribute to your mother language even if you do not know anything about code or don't know any language programming.

The WordPress.org make it still easier with ample documentation https://make.wordpress.org/polyglots/, you can to translate or send suggestions.

Core

As developer, this choice was certainly more exciting, and I started to think “where I can put my code?”, MakeWordPress documentation give me a hand with that, on this link https://make.wordpress.org/core there is a section “Want to contribute? Get started quickly with our tickets marked as good first bugs”, to solve minor bugs is a good kick off to start to programming to any open source project, to make all this information available the WP has chosen the Trac Project a terrific tool to manage tickets.

About me, I chose another approach, unit tests, any open source team would be thankful you if you help to improve the code coverage and WP team thinks about it, there is a particular section which explains everything about automated tests. The next step was to get the code from the svn repository although the git to be a great versioning tool (You are still the best GIT, thanks, Uncle Linus). I used to work with subversion at the beginning of my career, so, it was not a difficult task remember the svn commands, but if you didn’t have the same luck this is a good tutorial.

PHPUnit

For to write the unit tests the WP uses the PHPUnit a significant and widespread Xunit framework, it was written by Sebastian Bergmann and is really easy to install and run as you can see in his tutorial.

Identifying opportunities and coding

The next step was to identify the part to write the unit tests, so I decided to run the PHPUnit tests using the -coverage-html flag to see which parts of code did not have any code coverage or lacking a good coverage:

Eureka! I was able to see it, and now I could start the fun, write some code, since then I’ve written some unit tests, and I become code contributor, this was my first and easiest contribution until now:


The method is a one-line method and a straightforward one to understand:


It receives a string and checks if the string is “y” if is yes return true otherwise false, as shown above using the PHPUnit I could see that this method did not have any line covered, so I wrote my unit test and checked again, voilá! 100% lines coverage for this method, ok just one line, but I was able to improve the code coverage of the code, a good first contribution.

As I said at the beginning, the WordPress uses the subversion to version control, how I submit this code? First of all, you have to generate a diff file, is easy using the command svn diff, as you can see below:

svn diff tests/phpunit/tests/functions.php > file.diff


An important note, when running the svn diff command always use the absolute path, as I did above to avoid any problems when later applying the patch and do not forget to follow the WordPress coding standards.

The next step is open a ticket on the Trac system about this issue and attaching this file diff and is done, you have made your fist contribution for the WordPress Project, clap yourself with pride. Now, wait for someone who is part of the core team to have a look at your code and to do the review.

Badges

As long as you become involved in the WordPress Project you can receive some badges as a kind of the reward on your WordPress profile for your contribution, and there are several badges as you can see on this link https://make.wordpress.org/meta/handbook/documentation/profile-badges/. I’ve received until this present time for my code and translated contribution two badges, the core and translate contributor ones.

Communication channel

Another good way do get involved and to know what is going on in WordPress Core is the wordpress.slack.com, WP uses the Slack, a terrific communication tool that is becoming more and more popular mainly in the corporate world. People from many parts discuss about the WordPress project, however, be careful because there is no support channel here to help with technical problems, the aim is to talk about the WP project and how to improve it.

Conclusion

You have to face some feelings and challenges when you want to contribute to an open source project, like shyness or fear of making mistakes, however, I’ve received a lot of good feedbacks from the core team for my contributions and all my questions has been answered kindly on the slack team.

Unfortunately, it did not help with my GitHub account as I wished at the beginning but It was gratifying to be involved in such great project as the WordPress and to know that your code is helping a lot of people around the world if you want to know all my contributions check my WordPress profile here.

To view or add a comment, sign in

Others also viewed

Explore content categories