Skip to content

Instantly share code, notes, and snippets.

View BurlesonBrad's full-sized avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
@BurlesonBrad
BurlesonBrad / .htaccess
Created July 19, 2016 21:37
For Katharina
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType text/js "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
<?php
/**
* Plugin Name: Woocommerce Vendors Bookings Management
* Description: Allows vendors to manage their bookings in the frontend
* Version: 1.0.0
* Author: Liam Bailey
* Author URI: http://webbyscots.com/
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
@BurlesonBrad
BurlesonBrad / optimize-woocommerce.php
Created June 13, 2016 16:58
Speed Up WooCommerce by Only Loading WooCommerce Assets on Pages that Contain WooCommerce
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@BurlesonBrad
BurlesonBrad / index-with-redis.php
Created April 30, 2016 02:52 — forked from JimWestergren/index-with-redis.php
Redis as a Frontend Cache for WordPress
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
<?php
/*
Author: Hans2103
credit: Jim Westergren, Jeedo Aquino & Flynsarmy
File: index-with-redis.php
Updated: 2013-05-27
This is a redis caching system for Wordpress based on Redis connection using PHPRedis.
https://github.com/nicolasff/phpredis
<?php
/**
* Plugin Name: Tons Of Fun for Nick
* Plugin URI: https://yourmom.com
* Description: A Drop In Plugin That'll speed the sh_t outta your site. No options, just ACTIVE or INCACTIVE :-)
* Version: 1
* Author: Brad
* Author URI: https://yourmom.com
* Requires at least: 4.5
* Tested up to: 4.5
<?php
/*
* Plugin Name: Brad Gives to Usability Dynamics
* Plugin URI: https://bradgriffin.me
* Description: Look at your pageflow. After a user adds anything Invoice related to my cart, redirect the user to another Invoice related product. Same concept with the Property products. Almost immediately, you're total per transaction amount will go up #whoop!
* Author: Brad Griffin
* Author URI: https://bradgriffin.me
* Version: 1.0
* License: GPL 2.0
* Text Domain: woocommerce
@BurlesonBrad
BurlesonBrad / terms.php
Created March 24, 2016 12:54
Add TOS Condition for Wholesalers
<?php
/**
* Checkout terms and conditions checkbox
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@BurlesonBrad
BurlesonBrad / dashboard-tab-settings.php
Last active March 23, 2016 14:21
Add field for image, display name, and welcome message
<?php
$affiliate_id = affwp_get_affiliate_id();
$user_email = affwp_get_affiliate_email( $affiliate_id );
$payment_email = affwp_get_affiliate_payment_email( $affiliate_id, $user_email ); // Fallback to user_email
?>
<div id="affwp-affiliate-dashboard-profile" class="affwp-tab-content">
<h4><?php _e( 'Profile Settings', 'affiliate-wp' ); ?></h4>
@BurlesonBrad
BurlesonBrad / gist:03eb675ad1deadf43251
Created March 10, 2016 21:56
Get rid of the subtotal line
add_filter( 'woocommerce_get_order_item_totals', 'adjust_woocommerce_get_order_item_totals' );
function adjust_woocommerce_get_order_item_totals( $totals ) {
unset($totals['cart_subtotal'] );
return $totals;
}