Contribute with Code

Learning how to make your first code contribution can be intimidating, but it’s not as hard as you may think.

This tutorial will walk you through the minimal steps necessary to fix a sample bug. Once you’ve gone through it, you can apply the same steps to real bugs and feature requests. It will take between 10 minutes and a couple of hours, depending on your development environment, prior knowledge, etc.

If you get stuck anywhere along the way, feel free to ask for help in the #meta channel on Slack.

Find a Bug to Fix

The MetaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. team uses a tool called Trac to manage bug reports and feature requests. A new ticket is opened when someone reports an issue and then closed when the issue is resolved.

Normally you’d look for a ticket to work on by browsing the reports, but for this tutorial, we’ll be using ticket #1885.

If you open that ticket, you’ll find that it has a description of the “bug” that we’re going to fix. The change is intentionally minimal since the important thing right now is just learning the process.

Setup Your Development Environment

Now that you know what bug to fix, you’ll need a development environment to work in.

If you don’t already have an environment, individual projects will often have one available. For example, the Pattern Directory repository has instructions for setting up a Docker environment. If your project doesn’t have an environment, you can try the WordPress Meta Environment.

If you do already have an existing development environment:

  1. Open a terminal and copy/paste the commands in the following steps. If any command contains a path to a directory, you’ll need to modify it to match the actual path on your computer.
    1. Not sure how to open a terminal? Check out these instructions for OS X or for Windows.
  2. cd /path/to/your/wp-content
  3. git clone git://meta.git.wordpress.org/ wordpress-meta
    1. Don’t have GitGit Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/.? You can download it from git-scm.com.
  4. cd plugins
  5. Create a symlink to the WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They’re one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Fonts pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party:
    1. OS X/Linux: ln -s ../wordpress-meta/wordcamp.org/public_html/wp-content/plugins/wc-fonts/ wc-fonts
    2. Windows: mklink C:\Users\jane\Desktop\sites\example.org\wp-content\plugins\wc-fonts C:\Users\jane\Desktop\sites\example.org\wp-content\wordpress-meta\wordcamp.org\public_html\wp-content\plugins\wc-fonts
  6. Browse to wp-admin/plugins.php and activate the WordCamp Fonts plugins.