memberful / memberful-wp

Better membership software for WordPress.
https://memberful.com
42 stars 15 forks source link

replace invalid aria role attributes with data attributes #362

Open matthewmcvickar opened 2 months ago

matthewmcvickar commented 2 months ago

The shortcodes for showing Memberful sign-in, sign-out, register, and account links all have invalid ARIA role attributes. The roles sign_in, sign_out, register, and account do not appear in the list of valid ARIA roles.

This is an accessibility problem because invalid ARIA roles should not be used, and also because automated accessibility audits will catch this and report errors to users who cannot fix it because it's part of the plugin code.

These roles don't appear to be significant—they are not used anywhere in the plugin or in the embed.js script, so I think they can be safely removed.

I can, however, see how they could be helpful for styling or JS targeting, so replacing them with custom data attributes is a better way to do that, and I've done so in this PR.