Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Apr 21, 2023
2 parents f49cb43 + 9e0fe74 commit 9d229b0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#### [unreleased]

#### 12.2.1 / 2023-04-21
* ensure `$wp_filesystem` set for `Bootstrap::rename_on_activation()`
* uninstall tested to function correctly

#### 12.2.0 / 2023-04-20
* update `freemius/wordpress-sdk`
* update `afragen/wp-dismiss-notice`
Expand Down
2 changes: 1 addition & 1 deletion git-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin Name: Git Updater
* Plugin URI: https://git-updater.com
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
* Version: 12.2.0
* Version: 12.2.1
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions src/Git_Updater/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ public function remove_cron_events() {
* @return void|bool
*/
public function rename_on_activation() {
global $wp_filesystem;

if ( ! $wp_filesystem ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
}

// Exit if coming from webhook.
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( isset( $_GET['plugin'], $_GET['webhook_source'] ) && 'git-updater' === $_GET['plugin'] ) {
Expand Down
10 changes: 10 additions & 0 deletions src/Git_Updater/GU_Freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function gu_fs() {
$gu_fs->add_filter( 'plugin_icon', [ $this, 'add_icon' ] );
$gu_fs->add_filter( 'is_submenu_visible', [ $this, 'is_submenu_visible' ], 10, 2 );
$gu_fs->add_filter( 'permission_list', [ $this, 'permission_list' ] );
$gu_fs->add_action( 'after_uninstall', [ $this, 'uninstall_cleanup' ] );
// $gu_fs->add_filter( 'show_deactivation_feedback_form', '__return_false' );

// Hide all Freemius menus with filter.
Expand Down Expand Up @@ -146,6 +147,15 @@ public function permission_list( $permissions ) {
return $permissions;
}

/**
* Uninstall.
*
* @return void
*/
public function uninstall_cleanup() {
require_once dirname( __DIR__, 2 ) . '/gu-uninstall.php';
}

/**
* Remove FS_Plugin_Updater hooks.
* Allow Git Updater to use it's own update code for itself.
Expand Down

0 comments on commit 9d229b0

Please sign in to comment.