public static function tag( $str, $wrapTag = 0, $attributes = [] ) {
		$selfclose = [ 'link', 'input', 'br', 'img' ];

		if ( !is_string( $str ) ) {
			return '';
		}
		if ( !is_string( $wrapTag ) ) {
			return $str;
		}
		$wrapTag = trim( strtolower( $wrapTag ) );
		$attrString = '';
		if ( is_array( $attributes ) ) {
			foreach ( $attributes as $attrKey => $attrVal ) {
				$attrKey = htmlspecialchars( trim( strtolower( $attrKey ) ), ENT_QUOTES );
				$attrVal = htmlspecialchars( trim( $attrVal ), ENT_QUOTES );
				$attrString .= " $attrKey=\"$attrVal\"";
			}
		}
		$return = "<$wrapTag$attrString";
		if ( in_array( $wrapTag, $selfclose ) ) {
			$return .= '/>';
		} else {
			$return .= ">" . htmlspecialchars( $str ) . "</$wrapTag>";
		}
		return $return;
	}