WP-Mix

A fresh mix of code snippets and tutorials

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.

WordPress plugin redirect when settings saved

This technique is a bit esoteric and mostly for my own reference. Feel free to try the code if it makes sense to you; otherwise, maybe just move on to the next code snippet. Just not enough time in the day to explain everything.

WordPress Get the Author Outside Loop

This tutorial explains how to get the current Post Author outside of the WordPress Loop.

WordPress Disable Author Archives

This WordPress snippet disables all author-archive views. This may be useful to prevent user enumeration scans, and also may help to minimize duplicate content (for SEO purposes).

Disable caching with HTML

If you can’t use .htaccess to disable caching at the server-level, here is an alternate HTML-only method that disables Cache-Control, Pragma, and Expires headers via <meta /> tags.

Disable caching with .htaccess

Quick .htaccess snippet to disable browser caching by modifying Cache-Control, Pragma, and Expires headers. Strictly plug-n-play.

Monitor File Changes via Cron

Monitoring any changes made to your files is a super-useful security technique. Lots of applications, including forensics, diagnostics, and being cool. Here is a quick way to set it up directly via simple cron job.

WordPress Get Recent Comments

In this tutorial, you’ll learn two ways to get the most recent comments on your WordPress-powered site. The first method uses get_comments(),and the second method uses the newer WP_Comment_Query class.