WordPress: A Tip About WP Super Cache

First of all, let me apologize for having been so absent over the last few weeks. As you may or may not have heard already, we just launched the new website at University of Mary Washington, and things have been hectic trying to put the final pieces into place.

One of those final pieces was to get WP Super Cache up and running on the site, in order to keep our server from overloading. When we first launched, I didn’t realize that we didn’t have the plugin configured properly, and our various plugins and theme functions really started to drag things to a crawl.

After doing a lot of digging and debugging, I found that WP Super Cache was ignoring cached files throughout our server because they all included GET variables.

Handling One Radio Button With JavaScript

Today, I discovered an issue that I have probably encountered in the past; but it’s been so long I forgot about it. I had some JavaScript set up to select a radio button based on text input, and then update the text based on the selected radio button (it’s a TinyMCE plugin that inserts a shortcode into the WordPress visual editor). Throughout all of the testing I performed, everything worked just fine. Today, though, someone else was testing the interface and could not get the text or the radio button to update properly.

After a bit of testing and messing around with the interface, I finally discovered that my JavaScript wasn’t recognizing the existence of the radio button on the form. After a bit more testing, I realized that’s because only one radio button existed; and JavaScript doesn’t treat radio buttons as arrays when there’s only one instance. When I had been testing before, I had multiple radio buttons, so everything worked; but now there was only one button, so it fell over.

Setting up WordPress MU Domain Mapping on GoDaddy

I recently worked with a client to help move a GoDaddy “WebsiteTonight” website into WordPress. In the process, I recommended that she turn her existing WordPress website into a multisite installation, set up her second site as another site in that install, and then set up domain mapping to give each of the websites a separate domain name.

This setup allows her to login a single time, and be able to switch back and forth between the sites to perform edits. It also makes it simpler to manage plugins, update WordPress and keep the theme consistent between the two sites.

Some WordPress Gallery Features You Might Not Know About

The other day, I was playing around with the WordPress [

] shortcode, and came across the need to exclude an image that was attached to the page. The image I needed to exclude was kind of like a featured image, and I didn’t want it to appear again in the gallery itself. So, I searched for information about excluding images from the WordPress [

] shortcode, and came across the related WordPress Codex article.

While reading that article, I noticed a handful of features I’d never known about in that particular shortcode. After all, I always basically assumed that the options WordPress gives you when inserting a gallery were probably the only options that were available.

Google Launches Initial Google+ API

googleGoogle’s latest attempt at social networking, Google+, now has a new first-cut at a developer API. The Google+ Platform blog has info on the release of the new API.

Startup blogger Robert Scoble put together a list of some of the feedback on the new API – it seems the reaction is mixed. RSS creator Dave Winer says Google “doesn’t get it”. Why am I surprised that a company who has a VP, Bradley Horowitz, post on Twitter that he only cares about Twitter users with over 100,000 followers might not fully understand how to promote a new API to developers?

The Google Plus team notes that they are using the follow existing standards and best practices where they can:

  • Our API methods are RESTful HTTP requests which return JSON responses.
  • Our payload formats use standard syntax (e.g. PoCo for people info, ActivityStrea.ms for activities).
  • We use OAuth 2 for secure trusted access to user data.

The Google Plus API is located here if you want to start to play with it.

Please Stop Using cURL in WordPress Plugins

WordPress HTTP class usage

Unfortunately, I keep finding WordPress plugins that try to call cURL functions directly. Unfortunately, not only do these plugins fail to work if cURL isn’t installed, it throws a fatal PHP error in the process.

The problem with using cURL in WordPress plugins is that WordPress solved that problem more than 2 years ago by implementing the WP_Http class. WP_Http is a class included in the WordPress core that has multiple options. One of those options is cURL, but it gracefully reverts to other PHP functions if cURL isn’t available.

Basically, anything you can do with cURL can be done with the WP_Http class, and it will allow your plugin to be much more versatile and compatible with more server setups.