• Resolved icedman21

    (@icedman21)


    We have been receiving a ton of alerts from WordPress where Uncaught exceptions are being thrown in the protected function _CommitItem found in the /wp-security-audit-log/classes/AlertManager.php file.

    Error Details
    =============
    An error of type E_ERROR was caused in line 359 of the file /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/AlertManager.php. Error message: Uncaught Exception: Event with code 6051 has not be registered. in /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/AlertManager.php:359
    Stack trace:
    #0 /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/AlertManager.php(355): WSAL_AlertManager->_CommitItem(6051, Array, NULL, false)
    #1 /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/AlertManager.php(240): WSAL_AlertManager->_CommitItem(6051, Array, NULL)
    #2 /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/Settings.php(474): WSAL_AlertManager->Trigger(6051, Array)
    #3 /home/user/domain.com/wp-content/plugins/wp-security-audit-log/classes/Settings.php(1613): WSAL_Settings->SetIncognito(true)
    #4 /home/user/domain.com/wp-content/plugins/wp-security-audit-log/wp-security-audit-log.php(1436): WSAL_Settings->se

    It has to do with several unregistered Event IDs.

    If your plugin throws an exception, it should handle it, because otherwise the site goes down temporarily when the Exception is thrown. That is not a very good practice.

    Are there any plans to fix this issue?

    • This topic was modified 4 years, 4 months ago by icedman21.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support robertabela

    (@robert681)

    Hello @icedman21

    Thank you for using our plugin.

    I am sorry to read about your issue. I need more information to be able to understand the issue and the context.

    1) Can you please tell us what version of the plugin, WordPress and PHP are you running?
    2) Are you doing something specific to reproduce this issue or it happens at random?
    3) I am presuming the plugin is still running in general and you are only encountering this problem while doing something. As in it is not that you cannot activate the plugin, right?

    The more information you can give us the better and quicker we can understand the issue and assist you.

    In regards to the exceptions, we already try to catch exceptions. However, it is not always possible to catch them all.

    Looking forward to hearing from you and thank you for your cooperation and patience.

    Thread Starter icedman21

    (@icedman21)

    Hi,

    1) WordPress version 5.8.1
    Current theme: X Pro DFX4 Hybrid (version 4.0.0)
    Current plugin: WP Activity Log (version 4.3.3.1)
    PHP version 7.2.34

    2) This happens when certain events that have not been registered are encountered.

    In the example above, it’s event code 6059 – Error message: Uncaught Exception: Event with code 6051 has not be registered.

    When that happens, the function _CommitItem() in the /wp-content/plugins/wp-security-audit-log/classes/AlertManager.php(355): WSAL_AlertManager file throws an exception:

    throw new Exception( sprintf( esc_html__( 'Event with code %d has not be registered.', 'wp-security-audit-log' ), $type ) );

    This is not handled by any handler and causes the site to go down temporarily.

    It seems there is no exception handler for this. So, would it be possible to implement an exception handler or add a try-catch block that will handle the exception and prevent the site from going down?

    3) Yes, the3 plugin works but it brongs down the site from time to time when unregistered events are encountered.

    Plugin Support robertabela

    (@robert681)

    Hello @icedman21

    Thank you for your feedback.

    We have identified the issue and I can confirm that a fix will be included in the next update of the plugin, which is due to be released this week, or next week the latest.

    If you would like to try the latest version of the plugin, you can download update 4.4. Please note that this update is still in testing phase and not finalized yet, or ready for production websites.

    Thank you very much for reporting this issue and for your cooperation. Should there be anything else we can assist you with, please do not hesitate to ask.

    Have a good day.

    Thread Starter icedman21

    (@icedman21)

    Hi @robert681

    Looks like this fix works great.

    Looking forward to the release of the update.

    Thanks for your help.

    Plugin Support robertabela

    (@robert681)

    I’m glad to read that @icedman21

    Unless somethings goes wrong, we should be releasing update 4.4 next week. Should there be anything else we can assist you with, please do not hesitate to ask.

    Also, please spare a minute to rate our plugin and service. These ratings really help us.

    Thank you and have a great weekend.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Uncaught Exceptions’ is closed to new replies.