• Resolved htz77

    (@tzeldin88)


    Hi. I’m trying to use custom alerts, based on instructions from How to Create Custom Alerts in the WordPress Audit Trail.

    Using the sample code provided in the zip, I’m getting a Fatal Error that crashes my entire wp admin:

    Fatal error: Uncaught Error: Class ‘WSAL_Sensors_WSAL_Sensors_CustomHooks’ not found in /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/classes/SensorManager.php:64 Stack trace: #0 /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/classes/SensorManager.php(32): WSAL_SensorManager->AddFromClass(‘WSAL_Sensors_WS…’) #1 /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/wp-security-audit-log.php(152): WSAL_SensorManager->__construct(Object(WpSecurityAuditLog)) #2 /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/wp-security-audit-log.php(120): WpSecurityAuditLog->__construct() #3 /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/wp-security-audit-log.php(871): WpSecurityAuditLog::GetInstance() #4 /home3/my-acct/public_html/my-site.dev/wp/wp-settings.php(303): include_once( in /home3/my-acct/public_html/my-site.dev/wp/wp-content/plugins/wp-security-audit-log/classes/SensorManager.php on line 64

    Please advise, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter htz77

    (@tzeldin88)

    I found and resolved the problem. The instructions are incorrect regarding the name of the Custom Hooks file (in How to Create Custom Alerts in the WordPress Audit Trail).

    The instructions say: if your class name is WSAL_Sensors_CustomHooks then

    The filename should always be the same as that of the class. So in this example the file is WSAL_Sensors_CustomHooks.php.

    But after reviewing the plugin’s own sensors (in wp-security-audit-log/classes/Sensors/), I found that the filenames exclude the prefix WSAL_Sensors_ though the class names have it, like WSAL_Sensors_Database.

    So to recap, I resolved this fatal error with Custom Alerts in the WP Security Audit Log plugin, by using:
    – class name = WSAL_Sensors_CustomHooks
    – file name = CustomHooks.php

    Hope this helps anyone else who encounter this problem.

    • This reply was modified 8 years, 7 months ago by htz77.

    Hello @tzeldin88,

    Thank you very much for posting the answer and sorry if this has caused an inconvenience. We had updated the code but did not update the documentation. Doing it now.

    Thanks again for updating the post. Should there be anything else we can assist you with, please do not hesitate to ask.

    Craig

    (@spedadvocate)

    Unfortunately, the documentation is still confusing. It now says: Once you’re ready with the code save the sensor file in the /wp-content/uploads/wp-security-audit-log/custom-sensors/ directory. The filename should always be the same as that of the class. So in this example the file is CustomHooks.php. Should it not say “The filename should always be the same as that of the class without the leading ‘WSAL_Sensors_’ “? I was stuck on that a bit today.

    Hello @spedadvocate,

    Sorry for the delay in replying. You are correct, the documentation was a bit confusing. In fact we just updated it and changed the sentence you are referring to. Now it is:

    Once you’re ready with the code save the sensor file in the /wp-content/uploads/wp-security-audit-log/custom-sensors/ directory. The filename should always be the same as that of the class without the WSAL_Sensors_ prefix. So in this example the file is CustomHooks.php.

    Sorry if this has caused any confusion and hope this is solved. Should there be anything else we can assist you with, please do not hesitate to get in touch.

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

The topic ‘Help with Custom Alerts’ is closed to new replies.