When the Style field selects anything except link and custom. Missing shape field

When custom is selected in the Style field. The Appearance field is missing and must be present.

When Link is selected in the Style field. The Appearance field is present and it must not be present.

The problem is not only that the fields are shown or hidden incorrectly, but also that the button generation is not correct, especially when the link is selected. Please review the addon completely.