Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 378 of 427)

Resolving wp_redirect and the “Headers Already Sent” message

I’ve been working on building a web application in WordPress on which I’m implementing a set of rewrite rules to introduce RESTful routing into the application.

Once the application is done, I hope to provide a significantly more in-depth post on how I built it, but in the mean time I figured I’d cover how I’m handling certain challenges that I’ve faced in development.

In this case, I needed to fire a call to wp_redirect after a certain event happened, but kept getting the PHP error:

Cannot modify header information - headers already sent by (output started ... )

Here’s how I ended up resolving the wp_redirect headers already sent message.

Continue reading

Use Markdown To Write Email (and Other Rich Text)

I dig markdown. Aside from the obvious uses on GitHub, I’ve also begun to use it in changelogs, README files, and general text-based notes that I take.

The other day, I sent the following tweet:

And it’s true. If I could, I’d use markdown to write almost anything in place of using rich formatting. Once you get the hang of it, it’s faster, it has clean syntax that are even easy to follow if they aren’t styled, and it’s much simpler than, say, markup (hence, ahem, markdown).

Thanks to a tip from Bobby Shirley, it’s completely possible – and easy – markdown email.

Continue reading

Thinking Holistically About WordPress Plugins as Products – The User’s Experience

This is the final post in the Thinking Holistically About WordPress Plugins as Products series.

Throughout this series, I’ve been sharing my thoughts on what it means to think holistically about building WordPress plugins as products rather than simple utilities for blogging.

In the first post in the series, I defined this by saying:

Thinking holistically about WordPress Plugins is about the top-to-bottom, end-to-end experience that goes into building and that will go into using the product.

And in the second post, I shared my thoughts on the top-to-bottom – or the developer’s experience – of approaching WordPress plugin development as if we’re building quality products.

Similarly, I consider the end-to-end aspect of development to be epart of the WordPress Plugin user experience and that it’s arguably just as important as the developer’s experience.

So in attempt to continue thinking holistically about WordPress plugin development, here are my thoughts on the user’s experience – or the end-to-end aspects – of development.

Continue reading

How To Check If a User Has a Gravatar in WordPress

If you're experienced with programmatically creating pages, you may wish to skip down to the code.

I’ve been working on a project where the requirements simply stated this:

  • If the user has a gravatar, display it
  • Otherwise, give the user the ability to upload a profile image from their computer

The WordPress API offers the get_avatar function for easily retrieving a users gravatar image, but there’s currently no API function that allows us to check if a user has a gravatar.

Continue reading

WordPress Designer, Developer, or Blogger? Advertise!

Comments are closed on this post. If you'd like to talk with me about advertising, email me!

Advertise Here

One of the fun things about maintaining a blog and getting plugged into a community is that it affords opportunities both for yourself and others. In those opportunities, you also have the chance to experiment with a variety of options when it comes to monetizing your property.

For a couple of months now, I’ve been running advertisements on posts that are older than two weeks and that sit between the post content and the comment content. For example.

It’s proven relatively successful by my own internal metrics, so I wanted to continue the experiment. Today, I’m opening up more advertisements on the sidebar.

The short of it:

  • Sidebar 300×250: $20 / month for 30 days (which is currently filled)
  • 2x Sidebar 125×125: $15 / month for 30 days

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑