hi!!,
First of all you cant add a UStaticMeshComponent to the level because GEditor->AddActor want a AActor type and UStaticMeshComponent is a UMeshComponent and this is the issue that cause the editor crash
so insted of trying to spawn a UStaticMeshComponent you should spawn a AStaticMeshActor this way:
//dont forget to add the include file for the Actortype
#include "Engine/StaticMeshActor.h"
//....
//....
//inside PluginButtonClicked()
UWorld* const World = GEditor->GetEditorWorldContext().World();
AStaticMeshActor* newmesh = Cast<AStaticMeshActor>(GEditor->AddActor(World->GetCurrentLevel(),AStaticMeshActor::StaticClass(), FTransform(FVector(0))));
and the you can add the component to the actor newmesh->AddComponent(/*components parementers here*/)