WP-Mix

A fresh mix of code snippets and tutorials

Popular Posts

All posts ordered by popularity

Page 35 of 36

Coda Tip: Fix Reverse Publish Not Working

Another mystery solved! For several years now, I’ve used Coda for coding, SFTP, and related tasks. Downloading files from the server is a common task, but for some reason you always have to click “Reverse Publish Selected Files” several times before the download will start. It’s not a big deal, but I’ve always thought it […]

Video Tutorials: Running WordPress on Shared Hosting

After months of hard work, I am pleased to announce the launch of my new video course on running WordPress on shared hosting. This course shows you how to get your own WordPress-powered site up and running as quickly and inexpensively as possible. It walks through the entire process step-by-step, with helpful visuals and examples […]

SMS Text API Services

I’ve been wanting to build a “server uptime” app that optionally sends a text message to alert users if certain conditions are met. I can build the app part myself, but needed a solid way to send the SMS messages. In my pursuit of a solution for this, came across several reasonably priced solutions. Thought […]

Fix “Function Not Found” Error in WordPress Must-Use Plugins

Posting these notes in case they are useful to anyone looking for related information. This may or may not be related to must-use plugins. I am still testing on vanilla WordPress installation. Update: after some further experimenting, it looks like the issue was resolved by uploading a fresh set of WordPress core files. So try […]

Whitelist File Names via Apache/.htaccess

I’ve posted tons of tutorials showing how to block things with Apache/.htaccess. Generally blocking involves defining a list and then forbidding access to it. In this quick post, we’re going to change it up, by defining a list and forbidding access to anything that is not included. The list can be anything, IP addresses, request […]

WordPress Remove Query Strings from Scripts and Styles

I’ve had this post sitting here unpublished for a while now. Thought it’s finally time to post and share with anyone who may be looking for it. Basically here are two ways to remove query strings from the URLs of any registered scripts and styles. Let’s take a look..

Quick Apache/.htaccess Snippet to Secure the WordPress Login Page

For WordPress sites where I am the only person logging in, I like to add the following Apache/.htaccess snippet to allow my IP address only, and deny access to all others. So when anyone tries to access the WP Login Page and they are not not coming from my IP address, they are denied with […]

PHP Check if Safe Mode is On

Quick snippet to check if PHPs “safe mode” is enabled on the current machine. This technique uses the ini_get() function checking the safe_mode option. Simple and self-explanatory:

Block Wayback Machine

If your website has been online for any length of time, it probably has been crawled and stored in the Internet Archive, AKA the Wayback Machine. That means your web pages will be available even if your site is taken offline. To remove any pages that already have been archived, you need to contact the […]

Recursive Download Files with Wget

Quick note for future reference. GNU’s Wget enables you to download files and resources directly via Terminal/shell. The big tip here is the r option, which tells Wget to download the target files recursively. For example, if you want to download an entire site:

Replace JavaScript Smooth Scroll with CSS

In the past, we had to resort to JavaScript to smoothly scroll to on-page target destinations. Fortunately things have evolved and we can now save some extra kilobytes by replacing (relatively) heavy handed JavaScript and jQuery techniques with just a few bytes of CSS.

PHP Simple Random String Generator

Here is a simple function for generating a random string via PHP. Oh I can hear it now, all the “random-things” experts out there crying out in pain because the function doesn’t return actual true random numbers. And they are right, true “randomness” is difficult to measure and achieve, especially with PHP. So for this […]