Skip to content

Instantly share code, notes, and snippets.

@ryanshoover
ryanshoover / wpengine-stop-htaccess-rewrites.php
Created February 4, 2019 20:02
WP Plugin Stop htaccess rewrites
<?php
/**
* Stop htaccess rewrites
*
* @package wpengine-stop-htaccess-rewrites
* @author wpengine
* @license Proprietary
*
* @wordpress-muplugin
* Plugin Name: Stop htaccess rewrites
diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php
index 9460c80ca6..dd7306e1c2 100644
--- a/wp-admin/custom-header.php
+++ b/wp-admin/custom-header.php
@@ -1461,12 +1461,10 @@ endif;
public function get_uploaded_header_images() {
$header_images = get_uploaded_header_images();
$timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
- $alt_text_key = '_wp_attachment_image_alt';
@ryanshoover
ryanshoover / bill-wizard-trailing-slash.php
Created August 28, 2018 18:13
WP Plugin - stop removing trailing slash
<?php
/**
* The Bill Wizard Trailing Slash Fix
*
* @package bill-wizard-trailing-slash
* @author wpengine
* @license Proprietary
*
* @wordpress-plugin
* Plugin Name: The Bill Wizard Trailing Slash Fix
@ryanshoover
ryanshoover / show-templates.php
Created August 16, 2018 21:18
Plugin to add the page template to the Pages admin
<?php
/**
* Show Page Templates
*
* @package show-page-templates
* @author ryanshoover
* @license Proprietary
*
* @wordpress-plugin
* Plugin Name: Show Page Templates

Keybase proof

I hereby claim:

  • I am ryanshoover on github.
  • I am ryanshoover (https://keybase.io/ryanshoover) on keybase.
  • I have a public key ASAk-byUVD79TFYZjWC5VHJYjQK3xCAXqTHToUeWXW_SCgo

To claim this, I am signing this object:

@ryanshoover
ryanshoover / calc-revenue-diff.php
Created April 9, 2018 18:59
Calculate revenue difference for a faster site
<?php
/**
* Calculate the difference in revenue I should experience
* if my load time changes.
*
* Based on the assumption that every second of page load
* causes a 7% drop in conversions.
*
* Formula in LaTex: [ R = \frac{ R_p }{ {e}^{\ln(0.93) T_p} }\ e^{\ln(0.93) T_c} - R_p ]
*
@ryanshoover
ryanshoover / functions.php
Created February 2, 2018 16:32
WP Engine GeoIP - Remove slashed apostrophes
<?php
/**
* Filters the WP Engine GeoIP location names.
* Removes any slashes in the names.
*
* @param array $geos GeoIP-identified location names.
* @return array GeoIP-identified location names without slashes.
*/
function myprefix_remove_geoip_slashes( $geos ) {
return wp_unslash( $geos );
@ryanshoover
ryanshoover / woocommerce-shayda.php
Created January 2, 2018 22:23
Shayda's WooCommerce Tweaks
<?php
/**
* Plugin Name: Shayda's WooCommerce Tweaks
* Plugin URI: http://dinewithshayda.com
* Description: Makes WooCommerce do what Shayda demands it should do.
* Version: 1.0
* Author: shayda
* Author URI: http://dinewithshayda.com
*
* @package woocommerce-shayda
@ryanshoover
ryanshoover / .circleci config.yml
Last active January 24, 2023 16:18
CircleCI 2.1 Continuous Integration with WP Engine
# Continuous Integration to a WP Engine install
# PHP CircleCI 2.1 configuration file
# Requirements:
# 1. In CircleCI settings, add environment variables for your site's installs:
# * WPE_PRODUCTION_INSTALL=thenameofyourproductioninstall
# * WPE_STAGING_INSTALL=thenameofyourstaginginstall
# * WPE_DEVELOPMENT_INSTALL=thenameofyourdevelopmentinstall
# 2. In your repo, have two files
# * `./.gitignores/__default` -- Excludes any compiled files
@ryanshoover
ryanshoover / codecheck.sh
Created August 21, 2017 18:44
Plugin Audit
#!/bin/bash
default_path='.'
pluginpath=${1:-$default_path}
declare -a types=("full" "source")
for type in ${types[@]}
do
echo Running PHPCS report: ${type}