Plugin Author
Austin
(@austyfrosty)
I am sorry, the dismiss notice link should remove the message. I will look into it.
Plugin Author
Austin
(@austyfrosty)
I’ve double checked and tested the link and have no troubles clearing the message. Which version of the plugin are you running? Please update to the latest if you are not running version > 2.1.2
.
I had 2.1.2 when I made the comment, but I have now upgraded to the very fresh 2.1.4 and it still happens. Here is a video showing it:
http://www.youtube.com/watch?v=czCUW0B6Or0
I ended up deleting the place where the announcements are for those who want to get rid of this spam:
File: /wp-content/plugins/custom-login/classes/class.settings-api.php
Line: 90
add_action( 'admin_notices', array( $this, 'show_notifications' ) );
However, for the author. I see the error in your coding, it occurs where there is no stored announcement_message:
In show_notifications()
you have $old_message
set to get the option of announcement_message (which is nothing by default). You then get the message and store it into the announcement_message option. However on line 780 you check if the old is different from the new, and since old is blank, it’s different so you effectively delete the ignore option and the announcement_message. Deleting the ignore will make it show for this page view, but deleting the current announcement_message will make this whole thing repeat again, never actually ever storing an announcement_message option.
Change line 780 of class.settings-api.php to:
if ( trim( $old_message ) !== trim( $announcement->message ) && !empty($old_message) ) {
and the problem will be fixed.
Plugin Author
Austin
(@austyfrosty)
Thanks for the update ParoXsitiC.
Clicking the “dismiss” link worked for me, seems to be working fine in the current version.