Skip to content

Instantly share code, notes, and snippets.

View ironprogrammer's full-sized avatar
💭
hackin the gibsons

Brian Alexander ironprogrammer

💭
hackin the gibsons
View GitHub Profile
@ironprogrammer
ironprogrammer / symlinked.php
Last active December 13, 2025 01:12
Indicate plugins symlinked or under source control
<?php
/**
* Adds indicators to plugin actions menu if plugin is symlinked and/or under
* source control.
*
* Why do this?
* Because until https://core.trac.wordpress.org/ticket/36710 is resolved,
* it's too easy to accidentally update or delete a symlinked plugin
* (which is likely also under source control 🤯).
*
@ironprogrammer
ironprogrammer / wordpress.zsh
Last active October 10, 2025 01:03
macOS command line functions and aliases for contributing to `wordpress-develop`
# `wordpress-develop` contributor command line scripts for macOS
# Requires WP-CLI: https://wp-cli.org
# use local project's PHPunit
alias phpunit='vendor/bin/phpunit'
# PHPunit aliases, e.g. `puf name_of_test`
alias pu=phpunit
alias puf='phpunit --testdox --filter'
alias pug='phpunit --testdox --group'
alias pul='phpunit --list-groups'
@ironprogrammer
ironprogrammer / wordpress-sqlite.zsh
Last active October 9, 2025 22:37
Quick WordPress on SQLite instances, with rollback and DB backup.
# Spin up a SQLite WP site, e.g.: `wp-sqlite wp-603 6.0.3`
# If omitted, version defaults to latest, and pins rollback to that version
# @TODO consider using https://developer.wordpress.org/cli/commands/cli/alias/ for locals?
wp-sqlite() {
local wp_name=''
local wp_ver='latest'
# check required arg for site name
if [ -z "$1" ]; then
echo Usage: wp-sqlite site-name \[wp-version\]
@ironprogrammer
ironprogrammer / notes.md
Created December 9, 2022 03:46
Trac 54504/PR 3732 Testing

Notes from testing PR 3732

(Note that some commands refer to shell functions from wordpress.zsh and wordpress-sqlite.zsh.)

## Testing Instructions for Trac 54504

# PREPARE PR SOURCE
# get pr
gh pr checkout 3732
@ironprogrammer
ironprogrammer / confirm-file-counts.sh
Last active October 8, 2025 17:09
Trac 57386 Testing
# confirm file counts
# tested in chassis (virtualbox + vagrant)
# adjust path if necessary: content/plugins/
for plugin in woocommerce jetpack akismet hello-dolly mailpoet wordpress-seo; do
echo ${plugin}:
echo -- root files: `find content/plugins/${plugin}/. -maxdepth 1 -not -type d | wc -l`
echo -- root dirs: `ls 2>/dev/null -UAd1 content/plugins/${plugin}/*/ | wc -l`
echo -- total files: `find content/plugins/${plugin}/. -type f | wc -l`
done
@ironprogrammer
ironprogrammer / test-trac-57575-plugin.php
Last active October 8, 2025 17:08
Trac 57575 Test Plugin
<?php
/**
* Plugin Name: Test for Trac 57575
* Plugin URI: https://core.trac.wordpress.org/ticket/57575
* Description: This plugin modifies links to external URLs in `core/paragraph` blocks using the HTML Tag Processor.
* Requires at least: 6.2
* Requires PHP: 5.6
* Version: 1.0.0
* Author: WordPress Core Contributors
*
@ironprogrammer
ironprogrammer / test-trac-57575-mu-sandbox.php
Last active October 8, 2025 17:07
Trac 57575 "Sandbox" MU Plugin
<?php
/**
* Trac 57575: WP_HTML_Tag_Processor Testing
* https://core.trac.wordpress.org/ticket/57575
*
* Also refer to unit test suite for additional examples:
* https://github.com/WordPress/wordpress-develop/tree/5b4ad8fa5634177102ee5771a2b7edfd86927f8b/tests/phpunit/tests/html
*
* ******************************** WARNING ***********************************
* * This plugin intentionally prevents the normal WordPress UI from loading. *
@ironprogrammer
ironprogrammer / fake-wordpress-update.php
Last active October 8, 2025 17:06
Trac 57662 test plugin -- enables custom WordPress package update
<?php
/**
* Plugin Name: Fake WordPress Update
* Description: Filters the value of <code>site_transient_update_core</code> to allow a custom install package.
* Author: WordPress Core Contributors
* Author URI: https://make.wordpress.org/core
* License: GPLv2 or later
* Version: 1.0.0
*
* Adapted from https://gist.githubusercontent.com/hellofromtonya/bb0aa2d4b2311c8b40fa5ae8ada4dc19
@ironprogrammer
ironprogrammer / README.md
Last active October 8, 2025 17:05
Test Contributor Badge Checker

Test Contributor Badge Checker

This script checks a list of WordPress.org contributors for whether they have the Test Contributor badge, and if not, if they've recently submitted a test report in Trac.

To Get Started

Copy these files into a folder. Create a contribs.txt file with a list of WPORG usernames or Slack IDs to check. One entry per line works best.

Where Do I Get Contributor IDs?

Here is an incomplete list of sources to check for new test contributions:

  • #core-test triage participants who conduct repro or patch testing
@ironprogrammer
ironprogrammer / README.md
Last active October 8, 2025 17:03
C2PA metadata testing