Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / display-db-tables-widget.php
Last active November 21, 2024 12:03
Display WordPress DB table names in a dashboard widget.
<?php
/**
* Display DB Tables Widget.
*
* @package Fragen\Display_DB_Tables
*
* Plugin Name: Display DB Tables Widget
* Plugin URI: https://gist.github.com/afragen/47e11b4df8513709889877d1bf0d82c7
* Description: Display WordPress DB table names in dashboard widget.
* Version: 0.1.0
@afragen
afragen / fix-rau-scrape-redirect.php
Last active July 15, 2025 18:07
Fixes Rollback Auto-Update scraping when `home_url('/')` is redirected.
<?php
/**
* Fix Rollback Auto-Update scrape for home_url redirect.
*
* @package Fix_RAU_Scrape_Redirect
*
* Plugin Name: Fix Rollback Auto-Update HomeURL redirect
* Plugin URI: https://gist.github.com/afragen/494f5674ab18947a865c12d94f76155d
* Description: Redirecting the home URL can interfere with Rollback Auto-Update scraping. This fixes by adding the scrape query args when appropriate.
* Version: 0.2.0
@afragen
afragen / error-logging.php
Last active January 26, 2026 19:56
Error logging during Git Updater webhook
<?php
/**
* Error logging.
*
* To log different sets of hooks the following constant
* ERROR_LOGGING_HOOKS will need to be set.
*
* ERROR_LOGGING_HOOKS accepts an array of any combination of the following elements.
* ( 'wp_error', 'upgrade_hooks' AND/OR 'filesystem_hooks' )
@afragen
afragen / git-updater-dot-org-overrides.php
Last active October 13, 2024 16:06
One off plugin to add Git Updater dot org overrides so the hook remains active even when the specific plugin is not active.
<?php
/**
* Git Updater Overrides for WP.org repo.
*
* @package GU_Overrides
*
* Plugin Name: Git Updater Overrides for WP.org
* Plugin URI: https://gist.github.com/afragen/763e57af7ddc5a40692fdf5d977f2902
* Description: Override WP.org updates for plugins and themes in favor of updates from Git Updater.
* Version: 0.2.0
@afragen
afragen / glotpress-mods.php
Last active December 9, 2024 22:06
Simple plugin to fix some PHP8 errors in GlotPress and more
<?php
/**
* GlotPress Modifications.
*
* Plugin Name: GlotPress Modifications
* Plugin URI: https://gist.github.com/afragen/acf808925400dc8a0544fd9611ff2189
* Description: Modifications to GlotPress to fix PHP 8 errors, use extended locale and more.
* Version: 0.9.0
* Author: Andy Fragen
* License: MIT
<?php
/**
* Plugin Name: WP-CLI: Force Auto-Updates
* Description: Forces auto-updates. `wp autoupdates force`
* Author: WordPress Core Contributors
* Author URI: https://make.wordpress.org/core
* License: GPLv2 or later
* Gist Plugin URI: https://gist.github.com/afragen/86ab7b2e9edac70697ecb0e7c5c49056
* Version: 1.0.0
@afragen
afragen / mu-loader.php
Last active April 8, 2026 16:37
A generic mu-plugins loader for plugins stored in wp-content/plugins folder.
<?php
/**
* MU Loader
*
* @author Andy Fragen, Colin Stewart
* @license MIT
* @package mu-plugins
*/
/**
@afragen
afragen / log-user-ip.php
Last active July 15, 2025 18:25
Log user IP to debug.log on login.
<?php
/**
* Log User IP.
*
* @package Fragen\Log_User_IP
*
* Plugin Name: Log User IP
* Plugin URI: https://gist.github.com/afragen/dda81b07997c5cc1d58fd90396adeb0a
* Description: Log user IP to debug.log at login.
* Version: 0.2.0
@afragen
afragen / fast-updates.php
Created October 19, 2023 21:55
A modified plugin from Peter Wilson for testing auto-updates
<?php
/**
* Plugin Name: Schedule Update Events NOW(ish)!
* Description: Schedules auto-updates every 60 seconds (if not already running). If they don't start, refresh. You can run the long command if impatient. But don't be impatient 😉
*/
namespace PWCC\FastUpdates;
// return;
<?php
/**
* Plugin Name: RAU Edge Case 2 - Defining Function in main plugin file.
* Description: Defining class in main plugin file.
* Version: 0.1.0
* Author: Andy Fragen
* License: MIT
* Requires at least: 6.2
* Requires PHP: 7.1
* Gist Plugin URI: https://gist.github.com/afragen/5366d3c9be9ba95b26545ca7105a9474