Skip to content

Instantly share code, notes, and snippets.

@WPEtopher
WPEtopher / convert.php
Created January 15, 2013 04:05
A script for converting MySQL databases to UTF8 (tables and columns).
/*
Plugin Name: Convert WP Database to UTF-8
Plugin URI: http://topher.wpengine.com/
Description: Converts the WordPress database (both tables and columns) to UTF-8 character set.
Version: 1.1.0
Author: Topher Hota (@WPEtopher), Yihui Xie
Author URI: http://yihui.name
*/
/*
#<span class="wpengine-promo"><a href="http://wpengine.com/" target="_blank">(.*)</a></span># =>
@WPEtopher
WPEtopher / gist:5190594
Created March 18, 2013 20:37
Intercept POST Requests
<?php
$log_file = "log.txt";
// if it's not a POST request, just move along
if($_SERVER['REQUEST_METHOD'] != "POST") {
return(0);
}
// if you only want specific files like admin-ajax or xmlrpc, uncomment the next 3 lines
//if($_SERVER['PHP_SELF'] != "/wp-admin/admin-ajax.php" && $_SERVER['PHP_SELF'] != "/xmlrpc.php") {
@WPEtopher
WPEtopher / gist:5346895
Created April 9, 2013 15:55
List Child Accounts & Their Locations
php /nas/wp/www/tools/wpe.php customer-record-get PARENTSITE 1 | grep account_name | cut -d ' ' -f 15 > ~/sites.txt && while read site; do php /nas/wp/www/tools/wpe.php option-get $site cluster && echo " $site"; done < ~/sites.txt && rm ~/sites.txt