Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
View sitehealth.txt
`
### wp-core ###
version: 5.7.2
site_language: en_US
user_language: en_US
timezone: America/Chicago
permalink: /%postname%/
https_status: true
multisite: false
View local.log
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\apache-2.4.43+6\\lib\\main.js","timestamp":"2021-03-20T19:11:24.995Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%\\lightning-services\\apache-2.4.43+6\\lib\\main.js","timestamp":"2021-03-20T19:11:25.332Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\php-7.4.1+14\\lib\\main.js","timestamp":"2021-03-20T19:11:25.338Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%\\lightning-services\\php-7.4.1+14\\lib\\main.js","timestamp":"2021-03-20T19:11:25.491Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\php-8.0.0+1\\lib\\main.js","timestamp":"2021-03-20T19:11:25.497Z"}
{"thread":"main","class":
View addme
<IfModule mod_deflate.c>
# Force compression for mangled headers.
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
View snippet.php
/** Disable Ajax Call from WooCommerce */
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11);
function dequeue_woocommerce_cart_fragments() {
if (is_front_page()) wp_dequeue_script('wc-cart-fragments');
}
@BurlesonBrad
BurlesonBrad / header-tracking-snippet.php
Created Jan 27, 2020
🚫No WordPress plugin needed to add tracking code to the header 👍
View header-tracking-snippet.php
function header_tag_analytics() { ?>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-XX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXX-XX');
</script>
// Add your Tweeder scripts Adroll scripts Facebook scripts BounceX scripts Optimizely scripts or whatever needs to be in the head
@BurlesonBrad
BurlesonBrad / snippet.php
Created Nov 4, 2019
Jason changes the WooCommerce Checkout Custom Ajax Spinner
View snippet.php
add_action('wp_head', 'custom_ajax_spinner', 1000 );
function custom_ajax_spinner() {
?>
<style>
.woocommerce .blockUI.blockOverlay:before,
.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
top: 50%;
@BurlesonBrad
BurlesonBrad / promise.php
Created Oct 29, 2019
/wp-content/plugins/google-site-kit/third-party/react/promise/src/
View promise.php
<?php
namespace Google\Site_Kit_Dependencies\React\Promise;
class Promise implements \Google\Site_Kit_Dependencies\React\Promise\ExtendedPromiseInterface, \Google\Site_Kit_Dependencies\React\Promise\CancellablePromiseInterface
{
private $canceller;
private $result;
private $handlers = [];
private $progressHandlers = [];
@BurlesonBrad
BurlesonBrad / .htaccess
Created Oct 23, 2019
Get *ALL* domain addresses pointed in the *RIGHT* direction 👍
View .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://domain.com%{REQUEST_URI} [L,NE,R=301]
@BurlesonBrad
BurlesonBrad / snippets.php
Created Apr 24, 2019
Miranda: Add these two snippets to the "Code Snippets" plugin.
View snippets.php
function redirect_to_home_if_author_parameter() {
$is_author_set = get_query_var( 'author', '' );
if ( $is_author_set != '' && !is_admin()) {
wp_redirect( home_url(), 301 );
exit;
}
}
add_action( 'template_redirect', 'redirect_to_home_if_author_parameter' );
@BurlesonBrad
BurlesonBrad / suspend.php
Created Mar 19, 2019
for Amanda Brookshire
View suspend.php
<?php /* <---don't add that line if you're pasting this into a snippets plugin */
add_filter( 'gettext', 'amanda_changes_suspend_to_pause', 20, 3 );
function amanda_changes_suspend_to_pause( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Suspend' :
$translated_text = __( 'Pause', 'woocommerce' );
break;
}
}