Blog

Posting Weekly

Using page template as custom API endpoint

The WordPress REST API is awesome and fully extendable to do your own custom crazy ideas. The following I’m about to explain goes against all of that. Instead of extending the WordPress REST API I’m creating my own custom API endpoint using nothing other then a custom page template. Learn APIs by building the most basic version…

WordPress plugin template for repeat tasks

Ever once in a while I have a customer with a custom PHP file running some daily batch process. Moving these over to a managed WordPress host can get well messy as there isn’t a great way to run a custom cron jobs. In order to keep things clean I like wrapping the custom PHP code…

When to not recommend WordPress

WordPress is awesome. I use WordPress for my business and all of my clients use it for their business. Recently I’ve been wondering if there a guide that people could use to figured out if WordPress is the best choice to them. One of my customers recently reached out to me for advice on what to do…

Resolving WordPress plugin conflicts

The WordPress plugin ecosystem is like the wild west. There are amazing companies producing quality plugins. There are also tons of lone rangers who put out unsupported and poorly written plugins. Plugin conflicts are inevitable and happen during plugin updates. Not doing updates is not an option so here is a framework for dealing with and…

WordPress.com stats via API

Every site I maintain gets Jetpack installed with the Stats module activate. These stats are pretty basic. While they might not be as comprehensive as Google Analytics they are extremely powerful as they are accessible via the WordPress.com API. WordPress.com Rest API is not WP Rest API The WordPress.com Rest API is a product of…

Automating WP Engine’s User Portal with Ruby Script

There is a Ruby gem called Mechanize which is a powerful library for automating web interactions. While playing around with it over the course of a weekend I ended up making the following Ruby script can be run over the command line to login to WP Engine’s web user portal (my.wpengine.com) and do various tasks. The…

Bulk Domain Record Lookups with Bash

Looking up domain records is a common daily task. Most of the time I use a website called MX Toolbox. That works great for single lookup. On occasion I need to do a bulk lookup for group of websites. While there are some websites that do bulk I found the best way is to simply run…

Injecting a custom mu-plugin for FTP deployments on WP Engine

Sometimes FTP is your only option In a world where we have such amazing tools like WP-CLI it’s hard to imagine why you’d want to attempt scripting over FTP. WP Engine doesn’t allow SSH access and FTP was really the only option if I wanted to automate things with their service. One time use mu-plugins It all starts with…

Manipulating Gravity Forms exports

Gravity Forms is my go to form plugin for WordPress. Recently a client asked to change the address state field to use state codes (example: PA) rather then full states (example: Pennsylvania). While I could replace the default address field with a custom dropdown field, I didn’t want to break any past entries. Modifing the…

Protecting static files with PHP script and WP Engine

There are many membership plugins for WordPress. A number of my customers run MemberPress which is a powerful and flexible membership plugin. I recently ran into a situation where images uploaded via the media library on restricted posts were getting shared by paid users and eventually picked up by Google and other search engines.…