Skip to content

Instantly share code, notes, and snippets.

View JoelLisenby's full-sized avatar

Joel Lisenby JoelLisenby

View GitHub Profile
JoelLisenby /
Last active April 29, 2024 23:07
Reset 2FA Grace Period in WordFence from the database/phpmyadmin

If you find yourself locked out due to no 2FA, but you have access to your WordPress database you can increase your WordFence 2FA grace period by following the instructions below.

Needed items:

  • Your user ID (find in the wp_users table)
  1. Go to phpmyadmin, view the wp_usermeta table.
  2. Do a search for meta_key = wfls-grace-period-reset and user_id = [your user id]
  3. Update the value of this row to a future unix timestamp like now + 3600 seconds to give you a 1 hour grace period.
JoelLisenby /
Last active February 20, 2024 17:48

A Linode 32GB VPS configuration

Utilizing memcached (with php8.2-memcached) over localhost. We found a 5X improvement in speed from (15s to 3s) when viewing the events default view while logged in after enabling memcached in this way for The Events Ticktes/Calendar plugin when paired with WooCommerce.

Drop in object-cache.php to /wp-content/object-cache.php from:

  • This script uses php8.2-memcache, not php8.2-memcached, but having both installed does not harm anything. They can both be installed safely.


JoelLisenby /
Last active January 17, 2024 17:40
TEVO Tarantula i3 - Start and End GCODE with bed leveling and low preheat to prevent oozing before print


G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
M109 S160 ; Preheat nozzle lower temp
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
// Example run:
// php -f get_wpengine_installs_status.php > installs.csv
// acquire your username and password from
$result_obj = run_query( '' );
JoelLisenby / wordpress_disable_comments_pingbacks.php
Last active May 4, 2023 16:58
Disable comments and pingbacks settings for all WordPress network sites
// Disables comments and pingbacks settings for all existing sites in a WordPress network
$sites = get_sites();
foreach ( $sites as $site ) {
switch_to_blog( $site->blog_id );
update_option( 'default_comment_status', 'closed' );
update_option( 'default_ping_status', 'closed' );
JoelLisenby / jbl_find_replace.php
Last active April 20, 2022 04:34
Find and Replace Title and Content for Specific Post Type in WordPress with WP_Query
/* Backup site first before using. This adds a menu to wp-admin so you can run the script.
*** Visiting this menu will automatically run the script!! ***
'jbl Find Replace',
'jbl Find Replace',
JoelLisenby / functions.php
Last active February 19, 2022 20:36
Remove Flash of Unstyled Content in WordPress using SiteOrigin Page Builder and Mega Menu
function head_fouc_script() {
<script>"visibility", "hidden", "important");
#mega-menu-wrap-primary #mega-menu-primary { /* these IDs may differ depending on the name of your menu. */
visibility: inherit; /* mega menu sets visibility visible and shows if you don't set this */
JoelLisenby /
Last active August 22, 2021 19:53
A simple Dynamic DNS script for use with crontab for Linode Domain DNS Records API using dig and linode-cli from python pip
wanip=`dig +short`
oldip=`linode-cli domains records-view $domainid $recordid --text --no-header --format="target"`
if [ $oldip != $wanip ]
linode-cli domains records-update $domainid $recordid --target $wanip
JoelLisenby / usps_accepted_at.php
Last active June 23, 2020 16:08
Simple PHP function to check if USPS package has been accepted / picked up using official USPS API
function usps_picked_up( $tracking_number ) {
if( empty( $tracking_number ) || !ctype_alnum( $tracking_number ) ) {
return false;
$user_id = "YOUR_USER_ID";
$usps_api_uri = "";
$xml = rawurlencode("<TrackRequest USERID=\"". $user_id ."\">
JoelLisenby / getUrlWithParams.js
Last active May 15, 2020 00:15
Add/update or Remove URL parameters from the provided URL
/* getUrlWithParams()
* Add/update or remove url parameters from the provided url.
* Example: getUrlWithParams({'tab':tab_name},['remove']);
var getUrlWithParams = function(url, add_update, remove = []) {
var url = new URL(url);
var splita ='&');
var params = {};
var merged = {};