Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / karma.php
Last active Dec 1, 2022
Impose karma on specific users
View karma.php
<?php
/**
* Karma.
*
* @package Fragen\Karma
*
* Plugin Name: Karma
* Plugin URI: https://gist.github.com/afragen/b45511007d0a1c07ad285ce6e223a91c
* Description: Impose karma on users.
* Version: 0.5.1
@afragen
afragen / git-updater-fastspring-popup.php
Created Nov 3, 2022
Add javascript for FastSpring's Git Updater popup store.
View git-updater-fastspring-popup.php
<?php
/**
* Add FastSpring popup store script for Git Updater.
*
* @package FastSpringPopUpStore
*
* Plugin Name: FastSpring Popup Store for Git Updater
* Plugin URI: https://gist.github.com/afragen/e7819dd1e17be5792c299dbef989d446
* Description: Add FastSpring popup store javascript for Git Updater.
* Version: 0.1.0
@afragen
afragen / php.ini.hbs
Last active Jan 11, 2023
Stuff for xDebug 3.x and Local
View php.ini.hbs
; Add to all lightning services PHP conf files using xDebug 3.x
xdebug.mode=debug
xdebug.client_port=9003
xdebug.start_with_request=trigger
xdebug.discover_client_host=yes
xdebug.idekey=VSCODE
; Add to all lightning services PHP conf files using xDebug 2.x
xdebug.remote_enable=1
xdebug.remote_connect_back=Off
@afragen
afragen / trick-auto-update.php
Created Aug 24, 2022
Allows one to mash the WP Crontrol 'Run now' link with abandon.
View trick-auto-update.php
/**
* Trick `WP_Automatic_Updater` into thinking there is no existing lock.
*
* By default, the auto-updater will only run once every hour even if
* the cron job is manually fired. That makes it hard to run multiple tests
* in a short period of time.
*/
add_filter(
'option_auto_updater.lock',
function ($value) {
View test-fatal.php
<?php
/**
* Auto-update fatal error check test plugin.
*
* @package AutoUpdateFatalErrorCheck
*
* Plugin Name: Auto-update Fatal Error Check Test Plugin
* Plugin URI: https://github.com/afragen/fatal-plugin
* Description: Set local version to 0 and comment code from plugin for testing.
* Version: 0.1.1
@afragen
afragen / auto-update-fatal-error-check.php
Last active Aug 3, 2022
Run the Rollback code if the plugin has an activation error.
View auto-update-fatal-error-check.php
<?php
/**
* Auto-update fatal error check.
*
* @package AutoUpdateFatalErrorCheck
*
* Plugin Name: Auto-update Fatal Error Check
* Plugin URI: https://gist.github.com/afragen/518819349528dba930cf7845180d5274
* Description: Check for a PHP error on plugin auto-update and deactivate plugin if one exists.
* Version: 0.4.2
@afragen
afragen / gist-oembed.php
Last active Aug 5, 2022
WordPress plugin to embed gists or gist files.
View gist-oembed.php
<?php
/**
* Gist oEmbed.
*
* @package Fragen\Gist_OEmbed
*
* Plugin Name: Gist oEmbed
* Plugin URI: https://gist.github.com/afragen/36ab01da116aadd27a3f4d85cce90390
* Description: oEmbed Gist or files within Gists.
* Version: 0.6.2
View stop-plugin-auto-update-success-email.php
<?php
/**
* Stop success email from plugin auto-updates.
*
* @package StopAutoUpdateSuccessEmail
*
* Plugin Name: Stop Plugin Auto-update Success Email
* Plugin URI: https://gist.github.com/afragen/e2f40ed2e71e590a127e8adc1db05948
* Description: Stop success email from plugin auto-updates.
* Version: 0.1.0
@afragen
afragen / auto-flush-object-cache.php
Last active Dec 25, 2022
Catches 'PHP Fatal error Allowed memory size of xxxxxxx bytes exhausted' and 'RedisException' debug.log messages and flushes object cache.
View auto-flush-object-cache.php
<?php
/**
* Auto-flush object cache.
*
* @package Fragen\Auto_Flush_Cache
*
* Plugin Name: Auto-Flush Object Cache
* Plugin URI: https://gist.github.com/afragen/d46d3cc2c7e07d99f921560dfbb70246
* Description: Auto-flush the object cache when error log records PHP Fatal error for allowed memory size.
* Version: 0.7.0
@afragen
afragen / instructions.md
Last active Apr 14, 2022
Change LocalWP wp-config.php for WP-CLI
View instructions.md