#Index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****** | |
Parallelize downloads across hostnames for WordPress. | |
Useful to boost static resources load speed on websites. | |
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others. | |
See full post > https://medium.com/p/32e9dc2fec0c | |
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex: | |
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Author: Doug Edgington | |
Description: modified version of Woocomemrce SSL functionality, forces ssl on Woocommerce pages and two additional custom pages | |
*/ | |
function dee_ssl_template_redirect() { | |
if ( ! is_ssl() ) { | |
if ( is_checkout() || is_account_page() || is_woocommerce() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'pre_get_posts', array( $this, 'fix_hierarchy_performance_issue' ) ); | |
function fix_hierarchy_performance_issue( $query ) { | |
if ( $query->query['post_type']=='hotspot' && $query->query['orderby']=='menu_order title' ) { | |
$query->set( 'orderby', 'menu_order title post_name' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'query', 'sel_filter_slow_query', 999 ); | |
function sel_filter_slow_query( $query ) { | |
//set an array of functions which run the slow queries: | |
$banned_functions = array ( 'count_users','bbp_get_statistics', 'bpbbpst_support_statistics' ); | |
foreach($banned_functions as $banned_function){ | |
if ( in_array( $banned_function , wp_list_pluck( debug_backtrace(), 'function' ) ) ) { | |
return "SELECT 1 "; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Increase the memory usage. | |
# If you get an error after adding this, try 64M or 32M instead. | |
php_value memory_limit "128M" | |
# Add syntax highlighting | |
AddType application/x-httpd-php-source .phps | |
# JavaScript | |
# Normalize to standard type (it's sniffed in IE anyways) | |
# tools.ietf.org/html/rfc4329#section-7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other general wordpress optimizations, place in wp-config.php file before "That's all, stop editing!" line. | |
define('WP_DEBUG', false); | |
define('WP_POST_REVISIONS', 5); | |
define('AUTOSAVE_INTERVAL', 600); | |
define( 'EMPTY_TRASH_DAYS', 3 ); | |
define('WP_MEMORY_LIMIT','256M'); | |
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); | |
// optional, remove this comment and the // below if you want to limit external requests in admin screens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function im_setup() { | |
// ++++++++++++++++ REGISTER THEME OBJECTS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // | |
// Register and enqueue Javascript | |
function im_js() { | |
// Modernizr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (x86_64) | |
-- | |
-- Host: localhost Database: wordpress | |
-- ------------------------------------------------------ | |
-- Server version 5.5.29-0ubuntu0.12.04.2 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
OlderNewer