WP-Mix

A fresh mix of code snippets and tutorials

JavaScript redirect to URL on select

JavaScript and jQuery techniques for redirecting to the specified URL when the user makes a selection.

Require HTTP 1.1 (and better) for POST

This quick .htaccess snippet requires that the user submit POST requests using only HTTP 1.1 and better.

Fix double abbr underlines

The developers at Firefox decided to add their own default styles for <abbr></abbr> and <acronym></acronym> tags — completely ignoring the fact that many sites already include their own styles for abbreviations and acronyms. The result is an ugly double underline and/or text-decoration in Firefox browsers.

Video Tutorials: Securing WordPress Sites

After several months of production, my video course on developing secure WordPress sites is now available at Lynda.com!

Include files from parent directory, subdirectory

This post concludes our trilogy of posts on getting file and directory path information with PHP and WordPress. In this final path-related post, you’ll get numerous ways to get and include files from parent directories, subdirectories, adjacent directories, and even the same directory, just to round things out.

Getting Path Info with PHP and WordPress

Massive round-up of PHP and WordPress techniques for getting various directory and file path information. This is a mega-reference aimed at PHP/WordPress developers.

PHP Get Absolute Path, Document Root, Base URL

Depending on your server configuration, getting correct path information can be challenging. For example, PHP does not provide a variable that will return the the base URL of your site. To help out, you can use the following code snippets to get the absolute path, document root, and base URL, respectively.

Moto G Directory Paths for Images and Media

One thing about Android devices like the Moto G, it can be challenging to locate your images, photos, videos, and other media files. To help save time, I’ll be updating this post with new file paths as I discover them. These paths specifically are for the Moto G, but they’re probably the same on other […]

PHP Spoofing Headers with cURL

While working on a recent book-sale script, I needed a way to test various request headers. This script is what I used to spoof just about everything except the IP address (which it seems is not possible to spoof via PHP/cURL).

WordPress configuration tricks

Some pipin’ hot WordPress configuration tricks for the wp-config.php file. All snippets strictly plug-&-play, no fiddling required. I use most of these on my own sites, so thought I would share ’em here at WP-Mix.

Chrome Extension Icons Missing from Toolbar

I recently upgraded Google Chrome browser to version 52 point something or other, and noticed that all of my extension icons suddenly were missing from the Toolbar. Apparently Google decided to “hide” them all in the Chrome settings menu.

PHP securing email scripts

This tutorial describes several important strategies for securing contact forms and scripts that make use of PHP’s mail() functionality. If your script is sending email based on user input, these tips will help to keep things safe and secure.