Unit Tests for WooCommerce Extensions

I am completely new to PHP unit testing, but I decided it was time to learn after discovering a critical bug in a small WooCommerce extension I had built for a client.

The extension I built added a feature that allowed administrators to limit specific coupons to new customers only. I had done some manual testing and made sure that new customers could use the coupon and existing customers could not. But there was a logic bug I missed that prevented existing customers from using any coupons, even ones that did not have the “new customer” restriction.

After finding the bug, I knew there were several use cases I would need to check every time an update was made to the plugin:

  • New customer should be able to apply a coupon
  • New customer should be able to apply a coupon with a “new customer” restriction
  • Existing customer should be able to apply a coupon without a “new customer” restriction
  • Existing customer should *not* be able to apply a coupon with the “new customer” restriction

Obviously, checking this manually each time would be rather tedious- which is why I turned to unit tests.

Continue reading

Thoughts on Theme Options

One of the most difficult decisions I face when building a new theme is which customization options to include.

It’s an incredibly difficult feature to balance. Customization options can make it possible for a single theme to be used for a greater variety of websites (which is good from a sales perspective), but it can also make a theme more complex to set up and customize.

Many of the best-selling commercial WordPress themes are ones that allow non-developers a huge amount of customization choices. Avada, Canvas, Divi, Make, Total and X Theme all have hundreds of settings. The big website platforms like Squarespace and Wix also provide a huge amount of design control.

Options Are Both Popular and Complex

I understand why customization is important. One of the main purposes of a website is to express a brand or identity. Customization of fonts and colors can be hugely important. When I helped my wife set up her first WordPress site years ago, I installed Canvas by WooThemes because I knew she’d want something that could be altered to fit her specific design aesthetic (and I didn’t have time at the time to customize it for her).

But even with a thousand options, there’s no way that everything can be customized. And adding many options has a downside: it increases the complexity of the user interface and code. Continue reading

Zelda Released, Zenith Retired

Zenith was the best selling theme on DevPress, so it may seem like an odd move to retire it. However, we’re introducing a new theme today called Zelda designed to take its place.

zelda

Everyone who has an active license for Zenith now has access to Zelda if you’d like to switch. You can also choose to stay with Zenith if you’re happy with it (DevPress will continue support for a year and release updates as needed). Continue reading

Introducing Summit

screenshot

Summit is a simple one-column WordPress theme, perfect for blogging and small business. It features large header images and a number of customizable display options. Social icons can be added to the header. A customizable widget area is available in the footer. Summit is also responsive and looks great on desktop and mobile devices. I encourage you to check out the demo to see how it looks. Continue reading