The messages displayed in the Admin area are managed by the Aelia Foundation Classes (AFC, for short). That plugin is actually the framework on which the Aelia plugins are based.


Why the admin messages are hidden, but they reappear later

If you see an message in the admin area, which disappears when you click on the "dismiss" button, and reappears later, the most common cause of that issue is that the table used by the AFC to track the dismissal has been deleted, or was not created correctly. Without the table, the "dismiss" operation runs, tries to store data used to track that the message was dismissed, but the storage operation fails. 


Normally, trying to write data to a missing table should throw a fatal error, which would result in a crash. To avoid that, we implemented a graceful handler, which allows the page to load and tries to recreate the table later. In some cases, the table can't ever be created, e.g. due to permission issues, and that causes a loop. The message appears, the "dismiss" action fails without throwing an error, then the message appears again, repeating the cycle. 



How to fix the issue

To ensure that the dismissal of messages is tracked properly, you can simply create the missing table manually, as follows:

  1. Create a backup of your database. The manual creation of a table is not dangerous, but it's always a good idea to have a backup of the database before making any change.
  2. Create the missing table by running the following SQL command:
    -- Important: ensure that the table prefix, which here is "wp_", is correct before running the query
    CREATE TABLE IF NOT EXISTS wp_aelia_dismissed_messages (
     `user_id` int NOT NULL,
     `message_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
     `date_updated` datetime DEFAULT NULL,
     PRIMARY KEY (`user_id`, `message_id`)
    ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


Tip

Before running the SQL query, you might have to change the table prefix ("wp_", in the example) to the one in use by your site. If you don't know what your database prefix is, you can find it by going to WooCommerce > Status > System Status. The database prefix will be displayed in the Database section. Example:

After running the SQL query, the Aelia Foundation Classes will be able to track the "dismiss message" operation on admin messages, which will remain hidden afterwards.