Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Dec 12, 2022
2 parents d8bdebd + 9a2e356 commit 88d1938
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 41 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* set Git Updater to auto-update with new `$db_version`
* replace Appsero SDK with Freemius SDK
* suspend Freemius plugin updating for Git Updater
* fix uninstall.php for Freemius

#### 11.1.10 / 2022-11-05
* fix Appsero cron task from running more than scheduled
Expand Down
21 changes: 21 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' );

$this->remove_fs_plugin_updater_hooks( $gu_fs );
Expand Down Expand Up @@ -184,4 +185,24 @@ public function remove_fs_plugin_updater_hooks( \Freemius $gu_fs ) {
]
);
}

/**
* Uninstall.
*
* @return void
*/
public function uninstall_cleanup() {
$options = [ 'github_updater', 'github_updater_api_key', 'github_updater_remote_management', 'git_updater', 'git_updater_api_key', 'git_updater_additions' ];
foreach ( $options as $option ) {
delete_option( $option );
delete_site_option( $option );
}

global $wpdb;
$table = is_multisite() ? $wpdb->base_prefix . 'sitemeta' : $wpdb->base_prefix . 'options';
$column = is_multisite() ? 'meta_key' : 'option_name';
$delete_string = 'DELETE FROM ' . $table . ' WHERE ' . $column . ' LIKE %s LIMIT 1000';

$wpdb->query( $wpdb->prepare( $delete_string, [ '%ghu-%' ] ) ); // phpcs:ignore
}
}
41 changes: 0 additions & 41 deletions uninstall.php

This file was deleted.

0 comments on commit 88d1938

Please sign in to comment.