ClassicPress/classicpress-seo

Hijacked dismissible admin notices

Closed this issue ยท 3 comments

When Classic Seo is active, there is an AJAX error every time you try to dismiss other's admin notices.
Seems to me that the jQuery code is linked to the generic is-dismissible class.

Didn't made a PR because I'm not totally sure and have not tested it, but this is the fix that worked for me:

  • Change this line with
    $( '.is-dismissible .classic-seo-notice' ).on( 'click', '.notice-dismiss', function() {

  • After this line add
    $classes[] = 'classic-seo-notice';

Thanks for reporting this @xxsimoxx. I will look into it and report back here.

@xxsimoxx I've had a good look into this and as far as I can tell, the error occurs when dismissing notifications such as "Settings updated". Other notifications such as "We detected new post type(s)..." don't generate the error, or at least not for me.

I've created a PR (#144) which is the same as your solution above except that I've used cpseo_notice instead of classic-seo-notice in keeping with naming conventions elsewhere in the plugin.

When the PR is merged, it will close this issue.

Thanks again for reporting it and for the solution. ๐Ÿ‘๐Ÿป

Thank you for fixing this!
The AJAX error was in every non-classicpress-seo notices.
I've just tested the PR and works ๐Ÿ‘๐Ÿป