Title: Error when activating plugin
Last modified: August 29, 2024

---

# Error when activating plugin

 *  Resolved [slhodson](https://wordpress.org/support/users/slhodson/)
 * (@slhodson)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/)
 * I am trying to create a custom plugin and keep getting the following error when
   activating it:
 * > Plugin could not be activated because it triggered a **fatal error**.
 * The plugin does seem to activate however, but obviously this error raises an 
   eyebrow. I tested with a very basic custom plugin and I am even able to reproduce
   it by activating the Hello Dolly plugin.
   I enabled debug mode and got the following
   log:
 *     ```wp-block-code
       [Thu Aug 29 13:09:08.622051 2024] [php:error] [pid 67:tid 67] [client 192.168.65.1:16990] PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "after_otter_activation" not found or invalid function name in /var/www/html/wp-includes/class-wp-hook.php:326\nStack trace:\n#0 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)\n#1 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)\n#2 /var/www/html/wp-admin/includes/plugin.php(730): do_action('activated_plugi...', 'hello.php', false)\n#3 /var/www/html/wp-admin/plugins.php(60): activate_plugin('hello.php', 'http://localhos...', false)\n#4 {main}\n  thrown in /var/www/html/wp-includes/class-wp-hook.php on line 326, referer: http://localhost:8000/wp-admin/plugins.php?plugin_status=all&paged=1&s
       ```
   
 * It seems to have some issue with the `after_otter_activation` function which 
   is part of the theme.
   Is this a bug and something that should be “ignored” for
   now?Note: I am running WordPress locally via Docker.

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

 *  [rodicaelena](https://wordpress.org/support/users/rodicaelena/)
 * (@rodicaelena)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17989530)
 * Hi,
 * Thanks for reaching out!
 * This does not seam to be any bug. It’s most likely related to the custom plugin
   you are trying to build.
 * I suggest you have an extra look on it, and try to find any possible issue there.
 * Kind regards,
 * Rodica
 *  Thread Starter [slhodson](https://wordpress.org/support/users/slhodson/)
 * (@slhodson)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17992283)
 * Hi [@rodicaelena](https://wordpress.org/support/users/rodicaelena/),
   I removed
   all custom plugins and still got the same result.With some further digging, I
   found the cause to be line 69 in the `Admin.php` file from the theme.Currently
   it is:`add_action( 'activated_plugin', 'after_otter_activation' );`So I changed
   it to:`add_action( 'activated_plugin', array( $this, 'after_otter_activation'));`
   And now the error is gone.I’m no WordPress or PHP expert so maybe this isn’t 
   the correct solution, but this line was the cause of my issue.
 *  [rodicaelena](https://wordpress.org/support/users/rodicaelena/)
 * (@rodicaelena)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17994000)
 * Hi [@slhodson](https://wordpress.org/support/users/slhodson/),
 * Thank you for getting back to me!
 * Indeed this seams to be an issue in the theme, which I’ve reported here [https://github.com/Codeinwp/neve-fse/issues/147](https://github.com/Codeinwp/neve-fse/issues/147)
 * Thank you for your help!
 *  [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * (@hardeepasrani)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17994074)
 * Hey [@slhodson](https://wordpress.org/support/users/slhodson/),
 * Thank you for pointing out the issue. We’ve made a patch release that fixes this
   issue. Let us know if it works as expected for you after the update which should
   be out in few minutes.
 *  Thread Starter [slhodson](https://wordpress.org/support/users/slhodson/)
 * (@slhodson)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17994651)
 * I can confirm that this is fixed in the latest (v1.1.1) release.
   Thanks for the
   speedy work.
 *  [rodicaelena](https://wordpress.org/support/users/rodicaelena/)
 * (@rodicaelena)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17994685)
 * Thank you for the cooperation!

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

The topic ‘Error when activating plugin’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/neve-fse/1.1.7/screenshot.png)
 * Neve FSE
 * [Support Threads](https://wordpress.org/support/theme/neve-fse/)
 * [Active Topics](https://wordpress.org/support/theme/neve-fse/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/neve-fse/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/neve-fse/reviews/)

## Tags

 * [plugin](https://wordpress.org/support/topic-tag/plugin/)

 * 6 replies
 * 3 participants
 * Last reply from: [rodicaelena](https://wordpress.org/support/users/rodicaelena/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/error-when-activating-plugin-49/#post-17994685)
 * Status: resolved