Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / ..github-action-workflows.md
Last active April 16, 2025 17:13
Various GitHub Action workflows

These are most of the GitHub Action workflows that I use in my plugins.

I have included a .gitattributes file too. For those who don't know, a .gitattributes file using export-ignore will remove those files/folders designated from any download or zip export. This is very handy with or without a build process.

releases.yml includes the generation of a build-attestation-provenance for security.

@afragen
afragen / quiet-trigger-warnings.php
Last active March 18, 2025 20:20
Place in mu-plugins folder
<?php
/**
* Quiet specific trigger warnings.
*
* @package Quiet_Trigger_Errors
*
* Plugin Name: Quiet Trigger Errors
* Plugin URI: https://gist.github.com/afragen/986ba6046ebea963074283a77cae07fc
* Description: Quiet the trigger warnings to the error log.
@afragen
afragen / generate-pot-pr.yml
Last active December 11, 2024 17:54
Creates new branch and PR for POT file
name: Generate POT PR
on:
workflow_dispatch:
push:
branches:
- main
jobs:
generate-pot:
<?php
/**
* Plugin Name: Send Andy Admin Email
* Description: Add my email as admin_email.
* Author: Andy Fragen
* License: GPLv2 or later
* Version: 0.1.0
* Gist Plugin URI: https://gist.github.com/afragen/3c786cf1eb83ac2928b0b61344f16cd7
*/
@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 November 14, 2024 23:56
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.1.0
@afragen
afragen / error-logging.php
Last active February 12, 2025 13: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.
* ( 'upgrade_hooks' AND/OR 'filesystem_hooks' )
* eg, `define( 'ERROR_LOGGING_HOOKS', [ '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