How to effortlessly move a WordPress site using bash scripting + rsync + WP-CLI

Migrate website

After recently being tasked with moving around 100 sites (some multisite, some not), I thought it worth the effort to create migration scripts.  Now, instead of potentially hours worth of work, running these scripts typically takes less than 1 minute. I chose to split the scripts up, one to place on the source server, and … Read more

Protecting WordPress File Uploads

File lock

A Go-Daddy backed security company analyzed over 25k infected websites and 4,426,795 cleaned files to determine that the WordPress content management system accounted for 90% of all hacked websites in 2018 (increasing from 83% in 2017). The top three tactics for attacks included backdoors (68%), malware (56%), and SEO spam (51%).

Caching Explained

Caching

This post greatly simplifies some of the core conepts of the web. If you’re interested in learning more about the underpinnings of the web, refer to “Further Readings” at the bottom of this post. Quick Background Before digging into caching, it’s important to briefly cover the core principles of how the Internet works. Within the … Read more

Syncing an Access DB to MS SQL

MS Access

MS Access has fallen out of favor many years ago, especially for use on the web, but it’s still being used by offices to capture data internally.  When recently asked whether that data could be exposed on a website, I thought I’d put together the following ASP.NET code to be able to do so relatively … Read more

Using rSync To Quickly Upgrade WordPress Plugins

rSync

We occasionally have commercial WordPress plugins that don’t auto-update.  In those instances, it’s still easy to upgrade them all at once, across both our multi-site networks/sites using the following bash script.   #!/bin/bash # execute script in terminal by running bash scriptname.sh # to generate public/private key pair (to avoid repeated logins) # ssh-keygen -t rsa … Read more

Custom Post Types in WordPress

Custom Post Types

What Are Custom Post Types? While most WordPress sites at CSU primarily use Pages, Posts can be just as, if not more, useful in the right context. Typically, posts are viewed as a blogging feature intended for your everyday, typical blog. However, nothing within WordPress restricts you to use posts solely for blog posts. You can … Read more

Creating Your Own WordPress Shortcode

WordPress Shortcodes

Shortcodes: An Introduction What are shortcodes in WordPress? As WordPress.com elegantly says, A shortcode lets you do nifty things with very little effort. Think of a shortcode as a shortcut to add features to your website that would normally require lots of complicated computer code and technical ability. When Would I Need to Use a … Read more