Skip to content

Commit 9d229b0

Browse files
committed
Merge branch 'develop'
2 parents f49cb43 + 9e0fe74 commit 9d229b0

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#### [unreleased]
22

3+
#### 12.2.1 / 2023-04-21
4+
* ensure `$wp_filesystem` set for `Bootstrap::rename_on_activation()`
5+
* uninstall tested to function correctly
6+
37
#### 12.2.0 / 2023-04-20
48
* update `freemius/wordpress-sdk`
59
* update `afragen/wp-dismiss-notice`

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.2.0
15+
* Version: 12.2.1
1616
* Author: Andy Fragen
1717
* License: MIT
1818
* Domain Path: /languages

uninstall.php gu-uninstall.php

File renamed without changes.

src/Git_Updater/Bootstrap.php

+7
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ public function remove_cron_events() {
157157
* @return void|bool
158158
*/
159159
public function rename_on_activation() {
160+
global $wp_filesystem;
161+
162+
if ( ! $wp_filesystem ) {
163+
require_once ABSPATH . '/wp-admin/includes/file.php';
164+
WP_Filesystem();
165+
}
166+
160167
// Exit if coming from webhook.
161168
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
162169
if ( isset( $_GET['plugin'], $_GET['webhook_source'] ) && 'git-updater' === $_GET['plugin'] ) {

src/Git_Updater/GU_Freemius.php

+10
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function gu_fs() {
9191
$gu_fs->add_filter( 'plugin_icon', [ $this, 'add_icon' ] );
9292
$gu_fs->add_filter( 'is_submenu_visible', [ $this, 'is_submenu_visible' ], 10, 2 );
9393
$gu_fs->add_filter( 'permission_list', [ $this, 'permission_list' ] );
94+
$gu_fs->add_action( 'after_uninstall', [ $this, 'uninstall_cleanup' ] );
9495
// $gu_fs->add_filter( 'show_deactivation_feedback_form', '__return_false' );
9596

9697
// Hide all Freemius menus with filter.
@@ -146,6 +147,15 @@ public function permission_list( $permissions ) {
146147
return $permissions;
147148
}
148149

150+
/**
151+
* Uninstall.
152+
*
153+
* @return void
154+
*/
155+
public function uninstall_cleanup() {
156+
require_once dirname( __DIR__, 2 ) . '/gu-uninstall.php';
157+
}
158+
149159
/**
150160
* Remove FS_Plugin_Updater hooks.
151161
* Allow Git Updater to use it's own update code for itself.

0 commit comments

Comments
 (0)