Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@afragen
afragen / change-default-content-folder.php
Last active October 25, 2021 20:27
Use the 'gu_fix_repo_slug' filter to change the default wp-content folder name.
<?php
/**
* Usage of 'gu_fix_repo_slug' filter.
*
* @package wordpress-plugin
* @link https://github.com/afragen/git-updater/issues/971
*/
/**
* Plugin Name: Change Default Content Folder
@afragen
afragen / show-gu-settings.php
Last active July 6, 2021 16:57
Simple plugin to override earlier filter set to hide Git Updater Settings
<?php
/**
* Plugin Name: Show Git Updater Settings
* Description: Override hiding of Git Updater Settings. Use only for debugging/testing. Someone set this for a good reason.
* Plugin URI: https://gist.github.com/afragen/290703613c50dab70dd06992c23cdfe0
* Author: Andy Fragen
* Author URI: https://github.com/afragen
* Version: 0.1
* Requires PHP: 5.6
* Requires at least: 5.2
<?php
/**
* Plugin Name: test
*/
use Fragen\Git_Updater\Plugin;
$bookings = array(
'name' => 'WooCommerce Bookings',
@afragen
afragen / git-updater-ignore.php
Last active September 13, 2024 19:53
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 / api-check-git-updater-premium-plugins.php
Last active June 2, 2021 19:26
Override default filters that skip API checks on premium Git Updater plugins in private repositories.
<?php
/**
* Plugin Name: API Check Git Updater Premium Plugins
* Plugin URI: https://gist.github.com/afragen/b752eb5da399a55f5597780efbbd5230
* Description: This plugin is used to override default exclusion of skipping API checks for Git Updater premium plugins in private repositories.
* Version: 0.1
* Author: Andy Fragen
* License: MIT
* Requires at least: 5.2
* Requires PHP: 7.1
@afragen
afragen / test-ghu-gu-update.php
Last active May 15, 2021 23:00
Test updating from GitHub Updater v9.9.10 to Git Updater
<?php
/**
* Plugin Name: Test GitHub Updater to Git Updater update
* Plugin URI: https://gist.github.com/afragen/64e4037576bd5292b5f3aeb1db39e0eb
* Description: Test the update process from GitHub Updater v9.9.10 to Git Updater.
* Author: Andy Fragen
* Version: 0.1.0
* Author URI: http://thefragens.com
* Gist Plugin URI: https://gist.github.com/afragen/64e4037576bd5292b5f3aeb1db39e0eb
* License: MIT
@afragen
afragen / freemius-self-update.php
Created May 3, 2021 18:42
If the plugin can update outside of Freemius integration, this overrides the Freemius behavior.
/**
* Remove Freemius dashboard update overrides.
*
* @return void
*/
public function allow_self_update() {
remove_all_filters( 'after_plugin_row_git-updater/git-updater.php' );
remove_all_filters( 'after_plugin_row_git-updater-pro/git-updater.php' );
add_action(
@afragen
afragen / prevent-plugin-update-dot-org.php
Last active February 11, 2021 18:54
Prevent updating for specific WordPress plugins.
<?php
// Prevent updating of specific dot org plugins.
add_filter(
'site_transient_update_plugins',
function( $transient ) {
$plugin_arr = [ 'test-plugin2/test-plugin2.php', 'akismet/akismet.php' ];
foreach ( $plugin_arr as $plugin_file ) {
if ( isset( $transient->response[ $plugin_file ]->id )
&& false !== strpos( $transient->response[ $plugin_file ]->id, 'w.org/plugins' )
) {
@afragen
afragen / rollback-testing.php
Last active November 7, 2022 13:28
Plugin to simulate plugin/theme update failure for testing Rollback Update Failure feature plugin.
<?php
/**
* Rollback Update Testing
*
* @package rollback-update-testing
* @author Andy Fragen <[email protected]>
* @license MIT
*/
/**
@afragen
afragen / local-edd-store.php
Last active July 31, 2020 20:56
Needed for non https local EDD store to correctly run. Set $store_url to your local store URL.
<?php
/**
* Plugin Name: Local EDD Store
* Description: Set `reject_unsafe_urls` to false for $store_url. $store_url will need to be set for the URL of your local EDD store.
* Author: Andy Fragen
* Version: 0.3
* Gist Plugin URI: https://gist.github.com/afragen/ed00f34f8e03aeedb96bdbf6f3e50495
*/
add_filter(