kmp = $kmp; $this->banned_plugins = $kmp->banned_plugins; if ( ! class_exists( 'WP_CLI' ) || ! class_exists( 'WP_CLI_Command' ) ) { return; } require_once plugin_dir_path( __FILE__ ) . 'commands/class-plugin-list-command.php'; require_once plugin_dir_path( __FILE__ ) . 'commands/class-cache-purge-command.php'; $banned_plugins_args = array( 'banned_list' => $this->banned_plugins->get_banned_list(), 'warning_list' => $this->banned_plugins->get_warning_list(), 'disabled_list' => $this->banned_plugins->get_disabled_list(), ); WP_CLI::add_command( 'kinsta plugin list', new Plugin_List_Command( $banned_plugins_args ) ); WP_CLI::add_command( 'kinsta cache purge', new Cache_Purge_Command( $this->kmp->kinsta_cache_purge ) ); WP_CLI::add_command( 'kinsta cache autopurge', new Cache\AutopurgeCommand( $autopurge ) ); WP_CLI::add_hook( 'after_invoke:cache flush', function () { ( new Cache_Purge_Command( $this->kmp->kinsta_cache_purge ) )( array(), array( 'all' => true ) ); } ); } }