public static function is_mlbackend_used($plugin) {
        $models = self::get_all_models();
        foreach ($models as $model) {
            $processor = $model->get_predictions_processor();
            $noprefixnamespace = ltrim(get_class($processor), '\\');
            $processorplugin = substr($noprefixnamespace, 0, strpos($noprefixnamespace, '\\'));
            if ($processorplugin == $plugin) {
                return true;
            }
        }

        // Default predictions processor.
        $defaultprocessorclass = get_config('analytics', 'predictionsprocessor');
        $pluginclass = '\\' . $plugin . '\\processor';
        if ($pluginclass === $defaultprocessorclass) {
            return true;
        }

        return false;
    }
public static function is_mlbackend_used($plugin) {
        $models = self::get_all_models();
        foreach ($models as $model) {
            $processor = $model->get_predictions_processor();
            $noprefixnamespace = ltrim(get_class($processor), '\\');
            $processorplugin = substr($noprefixnamespace, 0, strpos($noprefixnamespace, '\\'));
            if ($processorplugin == $plugin) {
                return true;
            }
        }

        // Default predictions processor.
        $defaultprocessorclass = get_config('analytics', 'predictionsprocessor');
        $pluginclass = '\\' . $plugin . '\\processor';
        if ($pluginclass === $defaultprocessorclass) {
            return true;
        }

        return false;
    }
public static function is_mlbackend_used ( $ plugin ) { $ models = self :: get_all_models ( ) ; foreach ( $ models as $ model ) { $ processor = $ model -> get_predictions_processor ( ) ; $ noprefixnamespace = ltrim ( get_class ( $ processor ) , '\\' ) ; $ processorplugin = substr ( $ noprefixnamespace , 0 , strpos ( $ noprefixnamespace , '\\' ) ) ; if ( $ processorplugin == $ plugin ) { return true ; } } // Default predictions processor. $ defaultprocessorclass = get_config ( 'analytics' , 'predictionsprocessor' ) ; $ pluginclass = '\\' . $ plugin . '\\processor' ; if ( $ pluginclass === $ defaultprocessorclass ) { return true ; } return false ; }
Whether the provided plugin is used by any model.

@param string $plugin
@return bool
Whether the provided plugin is used by any model .