I have an important update regarding this ticket. While debugging further, I encountered a **second** Fatal Error in the Notification Manager module, and I have a theory about what might be causing the underlying data corruption.
Here is some additional context that I hope will be helpful for your developers' investigation:
**1. The Potential Root Cause (Race Condition Theory)**
I suspect the corrupted metadata might be the result of a race condition on the front-end CRED form. If a visitor double/triple-clicks the submit button (or uses their browser's "Back" button to resubmit), the form can fire multiple simultaneous POST requests since the submit button isn't natively disabled after the first click.
My theory is that when 2-3 identical posts are generated, the simultaneous database writing might be corrupting the Toolset metadata for those specific posts—saving it as a malformed string instead of the expected array.
**2. The Second Fatal Error (The Deletion Crash)**
Regardless of *how* the data gets corrupted, this strict-type vulnerability also completely breaks WordPress post deletion.
When an Admin attempts to delete (Move to Trash) one of these duplicated posts, it triggers this new Fatal Error (I have redacted my specific server paths for privacy):
Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, string given in [server-path]/wp-content/plugins/cred-frontend-editor/application/controllers/notification_manager/post.php:188
Stack trace:
#0 [server-path]/wp-content/plugins/cred-frontend-editor/application/controllers/notification_manager/post.php(188): array_keys()
#1 [server-path]/wp-content/plugins/cred-frontend-editor/application/controllers/notification_manager/post.php(154): CRED_Notification_Manager_Post->check_for_notifications()
#2 [server-path]/wp-includes/class-wp-hook.php(343): CRED_Notification_Manager_Post->check_for_notifications_by_status_switch()
#3 [server-path]/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
#4 [server-path]/wp-includes/plugin.php(522): WP_Hook->do_action()
#5 [server-path]/wp-includes/post.php(4050): do_action()
#6 [server-path]/wp-admin/post.php(260): wp_trash_post()
#7 {main}
**The Impact:** Because this crash happens during the `wp_trash_post()` hook, it completely aborts the WordPress deletion process. Admins are locked out with a white screen and cannot remove the posts from the dashboard. I had to manually delete the corrupted entries directly via phpMyAdmin.
**3. Suggested Safeguards for the Dev Team**
I've added custom JS and redirects on my end to try and prevent double-submissions. However, I highly recommend the development team look into auditing the `CRED_Notification_Manager` module for PHP 8 strict-type compatibility.
Even if database metadata is malformed or unexpected, it ideally shouldn't trigger a Fatal Error that breaks core WordPress functions (like autosaving or trashing). Adding a simple `is_array()` check before running functions like `reset()`, `array_keys()`, or `foreach()` on fetched metadata (like `$attached_data`) could be a great safeguard against this.
I hope these clues help the team track down and patch the issue!