Skip to content

Instantly share code, notes, and snippets.

@JPry
JPry / remove-wpe-info.php
Last active March 1, 2026 18:43
Remove WP Engine info from WP Dashboard
<?php
// Remove all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine"
$user = wp_get_current_user();
if ( $user->user_login != 'wpengine' ) {
add_action( 'admin_init', 'jpry_remove_menu_pages' );
add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 );
}
/**
@JPry
JPry / resume.json
Last active November 3, 2025 20:53
resume.json
{
"meta": {
"theme": "minyma"
},
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json",
"basics": {
"name": "Jeremy Pry",
"label": "Senior Software Engineer",
"email": "resume@jpry.com",
"image": "https://0.gravatar.com/avatar/a076539d53678b43d19892f076eba148b5de43d5dac020ad9a4739962e55c4e2?size=512&d=initials",
@JPry
JPry / curl.sh
Created December 21, 2012 01:19
Use CURL to request a domain name/path from a specific IP address. Substitute the domain for "example.com", and the IP address and path in the URL.
curl -H "Host: example.com" -I http://IP.ADD.RE.SS/path/to/file/or/folder/
@JPry
JPry / heartbeat_allowed.php
Last active April 13, 2023 16:48
Note that you must change "plugins.php" to match whatever page you want to allow.
<?php
/**
* Plugin Name: Allow Heartbeat on more pages
* Plugin URI: https://gist.github.com/JPry/b1f6c55a5d5337557f97
* Description: Allow the Heartbeat API on more pages in the Dashboard
* Version: 1.0
* Author: Jeremy Pry
* Author URI: http://jeremypry.com/
* License: GPL2
*/
@JPry
JPry / limit_retries.php
Last active January 26, 2023 07:49
Limit WooCommerce Subscriptions to only 3 payment retries
<?php
add_filter( 'wcs_default_retry_rules', 'jpry_limit_3_retries' );
/**
* Limit the WooCommerce Subscriptions retry system to only 3 retries.
*
* This keeps the existing retry rules, but only the first 3. Everything thereafter
* is discarded.
*
@JPry
JPry / nginx.conf
Created December 3, 2012 23:42
Nginx - change mime type for certain file type (pdf)
location ~* /(.*\.pdf) {
types { application/octet-stream .pdf; }
default_type application/octet-stream;
}
@JPry
JPry / wp-fix.sql
Created November 7, 2012 15:32
Remove funky characters in WordPress database
update wp_posts set post_content = replace(post_content,'’','\'');
update wp_posts set post_title = replace(post_title,'’','\'');
update wp_comments set comment_content = replace(comment_content,'’','\'');
update wp_postmeta set meta_value = replace(meta_value,'’','\'');
update wp_posts set post_content = replace(post_content,'…','...');
update wp_posts set post_title = replace(post_title,'…','...');
update wp_comments set comment_content = replace(comment_content,'…','...');
update wp_postmeta set meta_value = replace(meta_value,'…','...');
@JPry
JPry / nginx.conf
Created November 29, 2012 18:50
Nginx - Force PDFs to download
location ~* /(.*\.pdf) {
types { application/octet-stream .pdf; }
default_type application/octet-stream;
}
@JPry
JPry / action-scheduler-create-action-page.php
Last active January 26, 2022 03:25
This plugin drops into the /wp-content/mu-plugins/ folder to add a page that creates a scheduled action for Action Scheduler.
<?php
/**
* Plugin Name: Add "Create Scheduled Action" page
* Plugin URI: https://gist.github.com/JPry/357ee26a46e3d8e2b68d1690f5bbbf75
* Description: Add a page to the Tools menu that allows for the manual creation of scheduled actions with Action
* Scheduler. Version: 1.0.0
* Author: Jeremy Pry
* Author URI: https://jeremypry.com/
* License: MIT
*/
@JPry
JPry / example-plugin.php
Created January 10, 2022 21:27
An example for including a JavaScript file into WordPress
<?php
/**
* Plugin Name: Example including a JS file into WordPress.
*/
add_action( 'wp_enqueue_scripts', 'jpry_example_include_scripts' );
function jpry_example_include_scripts() {
wp_enqueue_script(
'jpry-example-script', // This is an arbitrary name to reference this particular script