Title: Custom Sensor Help
Last modified: August 18, 2022

---

# Custom Sensor Help

 *  Resolved [liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * (@liquidonthedrums)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/custom-sensor-help/)
 * Hi,
 * I have used the docs and sample plugin provided on your site in hope to set up
   a custom event sensor.
 * I want to have the logic contained in my theme so am using the ‘wsal_custom_sensors_classes_dirs’
   hook to change the path for the sensor. However, I can’t seem to get this hook
   to fire??
 * The Sensor class lives at /wp-content/my-theme/src/ce-wp-activity-log/custom-
   sensors
 * The filter in my functions.php file is as follows:
 * add_filter( ‘wsal_custom_sensors_classes_dirs’, ‘add_custom_sensors_path’ );
 * function add_custom_sensors_path($paths = []): array {
    $paths = ( is_array( 
   $paths ) ) ? $paths : array(); $paths[] = trailingslashit( trailingslashit( get_stylesheet_directory()).‘
   src’ . DIRECTORY_SEPARATOR . ‘ce-wp-activity-log’ . DIRECTORY_SEPARATOR . ‘custom-
   sensors’ ); return $paths; }
 * I am also using the Gravity forms extension and can see that it uses the same
   hook. When I var_dump() out the $paths variable in the SensorManager.php (where
   the filter is run), the Gravity forms path is there, but mine isn’t.
 * Just wondering if you might know what the issue is here? Any assistance would
   be much appreciated. Thanks
 * *** Update ***
    After some additional investigation I have found that my hook
   is being included, but only on the front end of the site. I am wanting to capture
   some admin events… is this possible? Thanks
    -  This topic was modified 3 years, 9 months ago by [liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/).

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

 *  Plugin Support [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/custom-sensor-help/#post-15929237)
 * Hello [@liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * Thank you very much for using our plugin.
 * May I ask why you would want to have the logic contained in your theme? The first
   thing I would recommend, is to follow the steps in the guide on [how to create an activity log extension](https://wpactivitylog.com/support/kb/create-custom-events-wordpress-activity-log/)–
   in short, the extensions should be a standalone plugin.
 * There are a number of reasons why we use such setup, so this would be my first
   recommendation.
 * Please let me know if that does the trick.
 * Looking forward to hearing from you.
 *  Thread Starter [liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * (@liquidonthedrums)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/custom-sensor-help/#post-15942369)
 * Hi [@robert681](https://wordpress.org/support/users/robert681/) ,
 * The reason for including in the theme is that my theme is a packaged set of functionality.
   While I understand the benefits of modularizing functionality, it is not the 
   best solution for this current project.
 * Regardless, I have attempted to follow the guide to create a plugin but am still
   having issues.
 * There are links to multiple sample plugins on the linked page:
    – [https://github.com/WPWhiteSecurity/wsal-extension-example](https://github.com/WPWhiteSecurity/wsal-extension-example)–
   [https://wpactivitylog.com/downloads/wsal-plugin/wp-security-audit-log-custom-events-sample-plugin.zip](https://wpactivitylog.com/downloads/wsal-plugin/wp-security-audit-log-custom-events-sample-plugin.zip)
 * There are also references to using a mu-plugin, and then it also says to create
   sensors in the ‘/wp-content/uploads/wp-security-audit-log/custom-sensors/’ directory.
 * I’m a bit confused as to what the structure of the plugin/ code needs to be and
   where it needs to be located. Ultimately, I am using the Gravity Forms PHP API
   functions and want to be able to fire a custom event after my code is executed.
 * Any assistance would be greatly appeciated. Thanks.
 *  Plugin Support [robertabela](https://wordpress.org/support/users/robert681/)
 * (@robert681)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/custom-sensor-help/#post-15988551)
 * Hello [@liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * I am sorry for the late response. We’ve been quite busy with the release of another
   plugin of ours, and this slipped through the crack – apologies.
 * In regards to your issue; we have tested the extension we refer to and can confirm
   that it captures changes from both the dashboard and the backend. So offhand 
   it is difficult to say why you are encountering this issue without looking at
   your code. Would you be able to share that?
 * If there is too much sensitive and technical data in the code, you can send us
   your extension via email, at [support@wpwhitesecurity.com](https://wordpress.org/support/topic/custom-sensor-help/support@wpwhitesecurity.com?output_format=md).
 * Looking forward to hearing from you.

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

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

 * ![](https://ps.w.org/wp-security-audit-log/assets/icon-256x256.png?rev=2961534)
 * [WP Activity Log](https://wordpress.org/plugins/wp-security-audit-log/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-security-audit-log/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-security-audit-log/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-security-audit-log/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-security-audit-log/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-security-audit-log/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [robertabela](https://wordpress.org/support/users/robert681/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/custom-sensor-help/#post-15988551)
 * Status: resolved