Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Conflict: Notice Dismissal Hijacking Notice Dismissal of Other Plugins #18

Open
KZeni opened this issue Aug 1, 2022 · 0 comments

Comments

@KZeni
Copy link

KZeni commented Aug 1, 2022

I posted this at https://wordpress.org/support/topic/plugin-conflict-notice-dismissal-hijacking-notice-dismissal-of-other-plugins/, but I wanted to post this here just in case its useful.

It appears the admin notice dismissal script is hijacking/conflicting with the notice dismissal of WP ADA Compliance Check (https://wordpress.org/plugins/wp-ada-compliance-check-basic/) and potentially others.

I started troubleshooting the issue here: https://wordpress.org/support/topic/honor-the-html-validation-suggested-plugin-notices-dismissal/#post-15878601

It appears this has its dismissal JS code enqueued as a very generic name of dismissible-notices when the script is very much specific to this one plugin.

Also, even after fixing the JS script name conflict, this plugin seems to be hijacking the dismissal of the notice from WP ADA Compliance Check (per https://wordpress.org/support/topic/honor-the-html-validation-suggested-plugin-notices-dismissal/#post-15878714) so something more needs to be done.

This really needs to be better scoped/named to avoid interfering with other plugins that also have dismissible notices.

Also, https://wordpress.org/support/topic/honor-the-html-validation-suggested-plugin-notices-dismissal/ can probably be used for anything WP ADA Compliance Check needs updated. It’s likely both plugins involved in this conflict need to be updated to fix this (as well as avoid future issues and/or issues with other plugins.)

How to recreate the issue

You can encounter the issue by installing the WP ADA Compliance Check plugin (https://wordpress.org/plugins/wp-ada-compliance-check-basic/) and trying to dismiss the notice about their HTML Validation plugin that’s shown on the Dashboard page of the site admin. The notice keeps being shown after being dismissed even though it has https://github.com/w3guy/persist-admin-notices-dismissal being used to make it remember the notice was dismissed.

The problem is that both plugins are enqueueing a script with the generic name of “dismissible-notices” where both plugins need this renamed to avoid conflicts since they’re loading a script specific to that plugin (one would imagine a generic script name like this is only good when loading a library that might be shared with other plugins/etc. & not something like this where it’s loading unique functionality.)

Also, it appears that there’s additional work to be done even once the script naming conflict is resolved. Clicking the dismiss button on the notice from WP ADA Compliance Check still has the dismissal script from this plugin be triggered while then preventing the script specific to that plugin then isn’t executed & the previously dismissed notice keeps re-showing on refresh.

Meanwhile, this problematic notice remembers its dismissed perfectly fine when Email Address Encoder is deactivated.

Again, this probably isn’t specific to just this plugin & it’s just the plugin where I came across this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant