Skip to content

Instantly share code, notes, and snippets.

View danmaby's full-sized avatar

Dan Maby danmaby

View GitHub Profile
@danmaby
danmaby / functions.php
Created February 16, 2018 07:42
Amazon Polly for WordPress - Custom Post Types
/**
* Amazon Polly "Events" CPT
**/
function my_amazon_polly_post_types( $post_types ) {
$post_types[] = 'events';
return $post_types;
}
add_filter( 'amazon_polly_post_types', 'my_amazon_polly_post_types' );
@danmaby
danmaby / functions.php
Created November 12, 2017 18:12
prevent https:// for cron job when using Local by Flywheel
/**
* ============== REMOVE FROM LIVE ===================
prevent https:// for cron job
**/
add_filter( 'cron_request', function( $args ) {
$args['url'] = set_url_scheme( $args['url'], 'http' );
return $args;
} );
@danmaby
danmaby / .htaccess
Last active June 27, 2017 20:17
Site Optimisation All Sites
## ENABLE GZIP COMPRESSION ##
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
@danmaby
danmaby / .htaccess
Last active February 16, 2018 15:17
Site Security All Sites
#
<IfModule mod_headers.c>
# HSTS - force redirect to HTTPS at the browser level.
# Submit for Chrome preload list at https://hstspreload.appspot.com/
Header set Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload"
# X-Xss-Protection
Header always set X-Xss-Protection "1; mode=block"
# Stop clickjacking by only allowing us to frame our own site