Kevinleary.net, LLC.

Blog

Sensible approaches to build and maintain custom WordPress websites.

WPMU: Add User to All Sites in a Multisite Network

One of the pesky things about WordPress MU is testing. Every time I work with a WPMU site I find myself needing single level site admins in addition to network super admin users. Multisite provides an Add User screen inside of the Network Admin area to do this manually, but it’s slow and cumbersome. I’ve…

Correcting Typographic Widows with PHP

A typographic widow is a word alone on its own line, and it usually doesn’t look good. On the web, it often happens with headings, and there isn’t a clean way to correct it with CSS alone. There are some JavaScript approaches, but I’ve found PHP to be best because it avoids any shifting layouts…

TikTok Conversion & Attribution Tracking

TikTok advertising is quickly becoming a major advertising channel for US brands. Facebook’s limitations on audiences and targeting approach for certain business categories (like financial) have made other advertising platforms like TikTok more beneficial dollar for dollar. I’ve done a handful of TikTok pixel tracking implementations, and the most thorough and reliable approach involves a…

WPEngine Sage/Blade Templates Broken 1/18/2023

On 1/18/2023 numerous WordPress sites using the Roots Sage theme began experiencing issues on WPEngine. If you are a developer or WPEngine customer experiencing trouble with the roots sage theme or blade template compiling, then this fix may save you trouble. Previous Approach (broken 1/18/2023) Prior to today, the following approach worked well to get…

JavaScript Precise Age from a Birthdate

Calculating a precise age in years from a birthdate with JavaScript is not as simple as it seems. To be truly precise you need to factor in time zone, daylight savings time variations and leap years. If you’ve been digging around the web then you’ve seen many approaches that will get you part of the…

Hubspot Form Tracking in Google Tag Manager

Hubspot provides global form events that trigger three events related to forms. One occurs when a form is first loaded, and two when it’s submitted. These events provide a mechanism for triggering conversion pixels, but they don’t provide any of the values submitted with the form which makes it difficult to configure advanced matching with…

Advanced Spam Rules for Gravity Forms in WordPress

This is a follow-up to an earlier post that outlined the same method and approach, but additional examples are provided here that have been found effective in 2022/2023. Just about every website with contact forms has issues with spam submissions. Common approaches that have worked for years are no longer effective at blocking spammers. This…

Uninstalling Elasticsearch

Uninstalling Elasticsearch on your own linux server isn’t that straight forward or well documented. This guide walks through the process of uninstalling step by step for reference to anyone that needs a simple guide. Check for Running Instances The first step on all systems is to confirm that Elasticsearch is not actively running. Option #1:…

Marketo Form Conversions in Google Tag Manager

Tracking conversions when a Marketo form is submitted on your website is a common step in ad optimizations. The following approach is what I’ve used with clients to track conversions when a Marketo form submission successfully occurs on their website. The events provided by the script can be used to trigger conversion pixels in any…

Drift Event Tracking in Google Tag Manager

The drift documentation provides a different method, but it requires code level changes to your site. Drift is already sending custom events to Google Tag Managers dataLayer, so these JavaScript event handlers are not necessary anymore. It’s likely that Drift will likely update their documentation to reflect this approach if they haven’t already. Google Tag…

Images.weserv.nl Slow Loading

Images.weserv.nl is a an open-source image resizing and caching web API that’s used on millions of webites to optmize, resize and transform images on the fly. The images are served by CloudFlare’s CDN, providing a distributed worldwide cache for performance. Beginning November 2022 the service was rate limited by a change to CloudFlare’s terms of…

Remove Box Shadows From One Side with CSS

CSS’s native clip-path property makes it very easy to cutoff a box-shadow on one or more sides of an element. If you’ve ever wanted to use a box-shadow like a border, imagining something similar to box-shadow-top: none, then this is an ideal solution. There are many other more complex ways mentioned around the web for…

Restart MongoDB Commands

It’s not entirely clear how to quickly start, stop and restart MongoDB with a command line, so I’ve documented it here based on the need for a simple, straightforward approach. MongoDB Commands Use the following commands to start, stop or restart MongoDB. Mac OS On Mac OS the installation process for MongoDB’s Community Edition uses…

Custom Corporate Zoom Branding

Zoom allows organizations to control certain aspects of the conferencing UX, applying colors, typography, logos, background and more to completely brand the experience of joining a corporate conference call. I’ve had a few requests to do this, so I thought an explanation on how it’s done may be helpful. Live Example A live example can…

Apple News Fonts List

A list of fonts available for use in Apple News when working with the publisher API, including list of each font. More information can found in Apple’s official documentation: Applying Apple News Format Fonts