WordPress development tutorials

Developers: Stop Using sslverify = false — WordPress has you covered

I listened to a talk recently about using WordPress to communicate with external APIs, which is something we do frequently at SkyVerge. We’ve built over 20 payment gateway integrations for WooCommerce, each of which needs to communicate with the payment processor’s API. One thing that I noticed in the talk is that setting sslverify = false when using wp_remote_get or wp_remote_post was recommended. This is a fairly common practice and has thus become recommended for…

Read More

WordPress development tutorials

How to move Jetpack Social Sharing Buttons before a post

If you use Jetpack on your (self-hosted) WordPress site, you probably use the sharing buttons (sharedaddy) capabilities that Jetpack has. By default, these sharing buttons are shown at the end of your post following the content. This tutorial will show you how to move Jetpack Social Sharing buttons elsewhere in your post, such as before your content. You can also check out this overview from the Jetpack team. We’ll assume a couple of things: You…

Read More

8 Lessons Learned by building the WooCommerce iPhone App

One of our major goals for the first half of this year was to release the official WooCommerce iPhone app. While we released the app a bit behind schedule (in July), we were still really excited to get our first iOS app out the door and to create a mobile store management tool that we’d want to use ourselves. However, the process of building the app wasn’t entirely smooth sailing, so we figured we’d share…

Read More

Code

How to Safely Add Custom Code to WordPress Sites

There are many times that you want to tweak plugins, add a code snippet, or change some styling for your WordPress site. However, many users make these changes in a way that’s not viable for the long-term. For example, these changes shouldn’t be put into your parent WordPress theme, as they’ll be overridden when you update your theme (the same goes for plugins). Some users use this as a reason not to update themes or…

Read More

Timezones

Down the Rabbit Hole: WordPress and Timezones

“Why, sometimes I’ve believed as many as six impossible things before breakfast.” ― Lewis Carroll, Alice in Wonderland A few months ago, we were working on the WooCommerce Pre-Orders extension and had to think about how we wanted to store the release date & time. Like most concepts that look simple and easy at first, this turned out to be somewhat complex. Throughout development, I ended up learning quite a bit about working with timezones…

Read More

Introducing the WooCommerce XML-RPC API

We know you’ve been waiting for a full-fledged WooCommerce API, and while that particular piece of greatness is still a few months away (see this Github issue for details), we’ve developed a simple XML-RPC API to help you start integrating WooCommerce with your backend systems today. This has been tested over the past few months with a handful of clients and we’re ready to release it to the world. Currently it only supports updating order…

Read More

Guide to Migrating Your Plugin to WooCommerce 2.0

With the release of WooCommerce 2.0 becoming more imminent (well, maybe not quite imminent yet, but certainly drawing nearer), those of us with WooCommerce plugins need to start work on getting them ready for the big release. WooCommerce has never been one to hold back on making plugin-busting implementation changes with a new release, and they’re setting the bar quite high with 2.0. It’s chalk full of code changes and improvements plugin developers must be…

Read More

Tweaking the WooCommerce Order Admin: Searching For Custom Fields

The WooCommerce Order Admin allows you to search for orders by the following fields: order key billing first name billing last name billing company billing address 1 billing address 2 billing city billing postcode billing country billing state billing email billing phone order items But what if you want to search by another order field? Perhaps the order total? Well it’s as easy as adding something like the following to your themes functions.php: function woocommerce_shop_order_search_order_total(…

Read More

WordPress development tutorials

Don’t Share Terms Between WordPress Taxonomies

By default WordPress will reuse terms with the same name and slug between different taxonomies (at least for now). For instance, if you add the term ‘red’ as a tag, and then add the category ‘red’, the same wp_terms record will be shared between them. This is also true for any custom taxonomies you define (remember that despite their seeming differences, WordPress tags and categories are both implemented as taxonomies). Now, in general this is…

Read More

WooCommerce Order Admin Calc Line Totals

Compatibility Notice: The following article and code applies to pre-WooCommerce 2.1 only. It is not compatible with WooCommerce 2.1+ As of version 1.6.5.2 at least, WooCommerce does not provide a way to automatically calculate the Line Subtotal and Line Total values for a given product quantity, when creating or updating an order through the Order Admin: As shown in the above image, there’s a button to calculate the line taxes for the order items, as…

Read More