-
-
Save stingray82/bdd1a97de50636e6eed47863c7a06cf7 to your computer and use it in GitHub Desktop.
Create an override function, as to bypass Freemius in some less than smart plugins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| /** | |
| * Create an override function, as to bypass Freemius in stupid plugins. | |
| * @wordpress-muplugin | |
| * Plugin Name: Freemius Killer | |
| * Description: Global override for Freemius' "loader". | |
| * Version: 1.0.0 | |
| * Author: Austin Passy | |
| * Author URI: https://github.com/thefrosty | |
| * phpcs:disable | |
| */ | |
| if (!\is_blog_installed()) { | |
| return; | |
| } | |
| // Create the Freemius Stub in case other plugins use their own global we need to override. | |
| $freemius_stub = new class { | |
| public function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) | |
| { | |
| return; | |
| } | |
| }; | |
| /** | |
| * Find your plugins' Freemius global variable and assign it below. | |
| * This example is using Menu Image; $mi_fs found in `wp-content/plugins/menu-image/menu-image.php:147` | |
| */ | |
| global $mi_fs; | |
| $mi_fs = $freemius_stub; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment