public static function is_valid_plugin_name($plugintype, $pluginname) {
        if ($plugintype === 'mod') {
            // Modules must not have the same name as core subsystems.
            if (!isset(self::$subsystems)) {
                // Watch out, this is called from init!
                self::init();
            }
            if (isset(self::$subsystems[$pluginname])) {
                return false;
            }
            // Modules MUST NOT have any underscores,
            // component normalisation would break very badly otherwise!
            return (bool)preg_match('/^[a-z][a-z0-9]*$/', $pluginname);

        } else {
            return (bool)preg_match('/^[a-z](?:[a-z0-9_](?!__))*[a-z0-9]+$/', $pluginname);
        }
    }
public static function is_valid_plugin_name($plugintype, $pluginname) {
        if ($plugintype === 'mod') {
            // Modules must not have the same name as core subsystems.
            if (!isset(self::$subsystems)) {
                // Watch out, this is called from init!
                self::init();
            }
            if (isset(self::$subsystems[$pluginname])) {
                return false;
            }
            // Modules MUST NOT have any underscores,
            // component normalisation would break very badly otherwise!
            return (bool)preg_match('/^[a-z][a-z0-9]*$/', $pluginname);

        } else {
            return (bool)preg_match('/^[a-z](?:[a-z0-9_](?!__))*[a-z0-9]+$/', $pluginname);
        }
    }
public static function is_valid_plugin_name ( $ plugintype , $ pluginname ) { if ( $ plugintype === 'mod' ) { // Modules must not have the same name as core subsystems. if ( ! isset ( self :: $ subsystems ) ) { // Watch out, this is called from init! self :: init ( ) ; } if ( isset ( self :: $ subsystems [ $ pluginname ] ) ) { return false ; } // Modules MUST NOT have any underscores, // component normalisation would break very badly otherwise! return ( bool ) preg_match ( '/^[a-z][a-z0-9]*$/' , $ pluginname ) ; } else { return ( bool ) preg_match ( '/^[a-z](?:[a-z0-9_](?!__))*[a-z0-9]+$/' , $ pluginname ) ; } }
This method validates a plug name. It is much faster than calling clean_param.

@param string $plugintype type of plugin
@param string $pluginname a string that might be a plugin name.
@return bool if this string is a valid plugin name.
This method validates a plug name . It is much faster than calling clean_param .