Skip to content

Instantly share code, notes, and snippets.

@afragen
Last active June 23, 2025 19:11
Show Gist options
  • Save afragen/3c6c2164b341f47c2b17eb5f705e3325 to your computer and use it in GitHub Desktop.
Save afragen/3c6c2164b341f47c2b17eb5f705e3325 to your computer and use it in GitHub Desktop.
Remove GU renaming filter during OTGS Installer plugin installation.
<?php
/**
* Git Updater fix for OTGS Installer.
*
* Plugin Name: Git Updater fix for OTGS Installer
* Plugin URI: https://gist.github.com/afragen/3c6c2164b341f47c2b17eb5f705e3325
* Description: Remove Git Updater renaming filter during OTGS Installer plugin installation.
* Version: 1.0.1
* Author: Andy Fragen
* License: MIT
* Requires at least: 6.6
* Requires PHP: 7.4
* Gist Plugin URI: https://gist.github.com/afragen/3c6c2164b341f47c2b17eb5f705e3325
*/
namespace Fragen\Git_Updater;
use Fragen\Singleton;
add_action('init', __NAMESPACE__ . '\\check_otgs_installer', 20);
function check_otgs_installer(): void {
global $wp_filter;
$has_action = has_action('wp_ajax_installer_download_plugin');
$otgs_installer = isset($_POST['action']) && 'installer_download_plugin' === wp_unslash($_POST['action']) && defined('OTGS_INSTALLER_VERSION');
if ($otgs_installer && $has_action && class_exists('\\Fragen\\Git_Updater\\Bootstrap')) {
$base = Singleton::get_instance('Base', new Init());
remove_filter('upgrader_source_selection', [$base, 'upgrader_source_selection']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment