Skip to content

Commit 0bfd4d1

Browse files
committed
no longer needed
1 parent b0cca02 commit 0bfd4d1

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* add `Private Package` option for `Additions`, these private packages are not to be used with bulk REST endpoints
88
* switch to standard `uninstall.php` as issue with calling `Freemius` during their `after_uninstall` hook
99
* add early exit in `get_repo_slugs()` during AJAX installation for Add-Ons
10+
* removed `Add_Ons::upgrader_source_selection` no longer needed
1011

1112
#### 12.11.0 / 2025-02-02
1213
* update Additions to add additional listings

git-updater.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: Git Updater
1313
* Plugin URI: https://git-updater.com
1414
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
15-
* Version: 12.11.0.5
15+
* Version: 12.11.0.6
1616
* Author: Andy Fragen
1717
* License: MIT
1818
* Domain Path: /languages

src/Git_Updater/Add_Ons.php

-41
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function load_hooks() {
4545
add_action( 'admin_init', [ $this, 'addons_page_init' ] );
4646
add_action( 'install_plugins_pre_plugin-information', [ $this, 'prevent_redirect_on_modal_activation' ] );
4747
add_filter( 'plugins_api', [ $this, 'plugins_api' ], 99, 3 );
48-
add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 4 );
4948

5049
$this->add_settings_tabs();
5150
}
@@ -153,46 +152,6 @@ public function plugins_api( $result, $action, $args ) {
153152
return $result;
154153
}
155154

156-
/**
157-
* Correctly rename addon for activation.
158-
*
159-
* @param string $source Path fo $source.
160-
* @param string $remote_source Path of $remote_source.
161-
* @param \Plugin_Upgrader|\Theme_Upgrader $upgrader An Upgrader object.
162-
* @param array $hook_extra Array of hook data.
163-
*
164-
* @return string|\WP_Error
165-
*/
166-
public function upgrader_source_selection( string $source, string $remote_source, \Plugin_Upgrader|\Theme_Upgrader $upgrader, $hook_extra = [] ) {
167-
global $wp_filesystem;
168-
169-
$new_source = $source;
170-
171-
// Rename plugins.
172-
if ( $upgrader instanceof \Plugin_Upgrader ) {
173-
foreach ( self::$addons as $addon ) {
174-
if ( str_contains( $source, $addon ) ) {
175-
$hook_extra['plugin'] = "{$addon}/{$addon}.php";
176-
break;
177-
}
178-
}
179-
if ( isset( $hook_extra['plugin'] ) ) {
180-
$slug = dirname( $hook_extra['plugin'] );
181-
$new_source = trailingslashit( $remote_source ) . $slug;
182-
}
183-
}
184-
185-
if ( ! isset( $slug ) || basename( $source ) === $slug ) {
186-
return $source;
187-
}
188-
189-
if ( trailingslashit( strtolower( $source ) ) !== trailingslashit( strtolower( $new_source ) ) ) {
190-
$wp_filesystem->move( $source, $new_source, true );
191-
}
192-
193-
return trailingslashit( $new_source );
194-
}
195-
196155
/**
197156
* Some method to insert cards for API plugin installation.
198157
*

0 commit comments

Comments
 (0)