Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / mu-loader.php
Last active March 21, 2024 12:54
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
*/
/**
<?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 / karma.php
Last active February 2, 2024 17:23
Impose karma on specific users
<?php
/**
* Karma.
*
* @package Fragen\Karma
*
* Plugin Name: Karma
* Plugin URI: https://gist.github.com/afragen/b45511007d0a1c07ad285ce6e223a91c
* Description: Impose karma on users.
* Version: 0.8.0
@afragen
afragen / log-user-ip.php
Last active February 2, 2024 17:22
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.1.0
@afragen
afragen / git-updater-ignore.php
Last active January 11, 2024 03:17
A plugin to ignore specific repositories from Git Updater
<?php
/**
* Plugin Name: Git Updater Ignore
* Plugin URI: https://gist.github.com/afragen/414612961ac500b652862096a54d62d7
* Description: This plugin is used to set Git Updater to ignore specific repository slugs.
* Version: 0.3
* Author: Andy Fragen
* License: MIT
* Requires at least: 5.2
* Requires PHP: 5.6
@afragen
afragen / _Docker-wp_xDebug_AppleSilicon.md
Last active December 20, 2023 20:30
My setup for wordpress-develop Docker wp environment on Apple Silicon with xDebug active

These are the files needed for setting up the Docker wp environment for wordpress-develop with xDebug active on Apple Silicon. Currently Docker wp runs

  • PHP 7.4.33
  • xDebug 3.1.6

I created and placed the custom-php-config.ini file one level above wordpress-develop.

The docker-compose.override.yml is at the root level of wordpress-develop.

Then simply follow the instructions in the https://github.com/WordPress/wordpress-develop/blob/trunk/README.md

@afragen
afragen / raspi-setup-gitea.md
Last active December 20, 2023 16:47 — forked from mirhec/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups

Setup Gitea on Raspberry Pi (3b+)

These instructions are based on this article: https://docs.gitea.io/en-us/install-from-source/.

Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:

Use Noobs to install Raspian.

Open menu Preferences > Raspberry Pi Settings

@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
<?php
/**
* Plugin Name: RAU Edge Case - 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/775d9627e4578ba286817a5dceb92807